Add include guards and fix types

This commit is contained in:
Ngô Ngọc Đức Huy 2021-06-23 11:16:28 +07:00
parent 14eefd974c
commit c725a3d1c1
Signed by: huyngo
GPG Key ID: 904AF1C7CDF695C3
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,8 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "constants.h"
static const enum color DONE_COLOR = GREEN;
static const enum color FAIL_COLOR = RED;
@ -5,13 +10,16 @@ static const enum color FAIL_COLOR = RED;
// Recommended values (see strftime(3):
// %a: day of the week
// %d: day of month
static const enum DAY_REPR = "%d";
static const char DAY_REPR[] = "%d";
static const int REPR_LENGTH = 3;
// Default is a full block,
// SHOULD be 1 character longer than the length of DAY_REPR
static const char DONE_CHAR[] = "\u2588\u2588 ";
static const char FAIL_CHAR[] = "\u2588\u2588 ";
static const char DONE_CHAR[] = "\u2588\u2588\u2588";
static const char FAIL_CHAR[] = "\u2588\u2588\u2588";
// The number of days for habit tracking
static const int TRACK_LENGTH = 7;
static const char HABIT_FILE[] = "~/.wochabit";
#endif

View File

@ -1,3 +1,6 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H
enum color{
BLACK,
RED,
@ -12,4 +15,6 @@ enum color{
static const char COLOR_PREFIX[] = "\033[3%d;1m";
static const char COLOR_SUFFIX[] = "\033[0m";
static const DATE_SIZE = 11; // "YYYY-MM-DD\0" = 11 chars
static const int DATE_SIZE = 11; // "YYYY-MM-DD\0" = 11 chars
#endif