From 6739d60c0dd15ab4ea07062bccfa5534976c2fd3 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Fri, 23 Dec 2022 14:23:21 +0300 Subject: [PATCH] refactor(core): define hole sasa/tanzaku/kazari constants --- include/core.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/include/core.h b/include/core.h index 92c0f4b..133c016 100644 --- a/include/core.h +++ b/include/core.h @@ -13,11 +13,6 @@ extern "C" { #include #endif -// ==================== CONSTANTS ==================== // - -// ID of hole - an invalid record -#define HOLE_ID (-1) - // ==================== STRUCTS AND TYPEDEFS ==================== // // Sasa (笹) - a file record @@ -39,9 +34,9 @@ typedef struct tanzaku { // Kazari (飾り) - a sasa-tanzaku relation record typedef struct kazari { - uint64_t created_ts; // Kazari creation timestamp uint64_t sasa_id; // Sasa ID uint64_t tanzaku_id; // Tanzaku ID + uint64_t created_ts; // Kazari creation timestamp } Kazari; // Sasahyou (笹表) - database of sasa @@ -77,6 +72,20 @@ typedef struct shoppyou { FILE *file; // Storage file for shoppyou } Shoppyou; +// ==================== CONSTANTS ==================== // + +// ID of hole - an invalid record +#define HOLE_ID (-1) + +// Hole sasa constant +const Sasa HOLE_SASA = {HOLE_ID}; + +// Hole tanzaku constant +const Tanzaku HOLE_TANZAKU = {HOLE_ID}; + +// Hole kazari constant +const Kazari HOLE_KAZARI = {HOLE_ID}; + // ==================== SASAHYOU SECTION ==================== // // Initialize empty sasahyou