-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.h
50 lines (42 loc) · 1.36 KB
/
entry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
*/
#ifndef ENTRY_H
#define ENTRY_H
#include <stdint.h>
#include <time.h>
// Struct for storing calender event info
#define INKY_ENTRY_MAXBYTES_NAME 128
#define INKY_ENTRY_MAXBYTES_TIME 128
#define INKY_ENTRY_MAXBYTES_LOCATION 128
typedef struct entry
{
char name[INKY_ENTRY_MAXBYTES_NAME];
char time[INKY_ENTRY_MAXBYTES_TIME];
char location[INKY_ENTRY_MAXBYTES_LOCATION];
time_t timeStamp;
int8_t day = -1;
int8_t sortTieBreak; //higher number, higher up display
int8_t bgColour;
int8_t fgColour;
} entry_t;
#define INKY_EVENT_COLOUR_RANDOM (-1)
#define INKY_EVENT_COLOUR_BLACK 0
#define INKY_EVENT_COLOUR_WHITE 1
#define INKY_EVENT_COLOUR_GREEN 2
#define INKY_EVENT_COLOUR_BLUE 3
#define INKY_EVENT_COLOUR_RED 4
#define INKY_EVENT_COLOUR_YELLOW 5
#define INKY_EVENT_COLOUR_ORANGE 6
// Here we store calendar entries
extern int entriesNum;
#define MAX_ENTRIES 100
extern entry_t entries[MAX_ENTRIES];
//Set fg colour to an appropriate choice for bgColour
void entry_SetColour(entry_t *entry, uint8_t bgColour);
void resetEntries(void);
void SortEntries(void);
#endif