diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-05-15 17:54:19 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-05-15 17:54:19 +0200 |
| commit | 650d928cc6164fbf10dc3a32e416737654cd1c2e (patch) | |
| tree | f37c326a6745aad05ac39a01d976031e5acca0b7 | |
| parent | 415908d6ec85e96d79f7f6267ea01c9cc6f50c77 (diff) | |
| download | sdep-650d928cc6164fbf10dc3a32e416737654cd1c2e.tar.gz sdep-650d928cc6164fbf10dc3a32e416737654cd1c2e.zip | |
Removed unnecessary alignment
Diffstat (limited to '')
| -rw-r--r-- | sdep.c | 39 |
1 files changed, 20 insertions, 19 deletions
| @@ -18,45 +18,46 @@ | |||
| 18 | */ | 18 | */ |
| 19 | static char *default_format = "%Y-%m-%d %H:%M"; | 19 | static char *default_format = "%Y-%m-%d %H:%M"; |
| 20 | 20 | ||
| 21 | typedef struct Event Event; | 21 | |
| 22 | typedef struct Event Event; | ||
| 22 | typedef struct EventList EventList; | 23 | typedef struct EventList EventList; |
| 23 | typedef struct EventNode EventNode; | 24 | typedef struct EventNode EventNode; |
| 24 | typedef struct Options Options; | 25 | typedef struct Options Options; |
| 25 | 26 | ||
| 26 | struct Event{ | 27 | struct Event{ |
| 27 | struct tm time; | 28 | struct tm time; |
| 28 | char *text; | 29 | char *text; |
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 31 | struct EventList { | 32 | struct EventList { |
| 32 | EventNode *first; | 33 | EventNode *first; |
| 33 | EventNode *last; | 34 | EventNode *last; |
| 34 | int count; | 35 | int count; |
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | struct EventNode { | 38 | struct EventNode { |
| 38 | Event ev; | 39 | Event ev; |
| 39 | EventNode *next; | 40 | EventNode *next; |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | struct Options { | 43 | struct Options { |
| 43 | struct tm from; | 44 | struct tm from; |
| 44 | struct tm to; | 45 | struct tm to; |
| 45 | char *format_in; | 46 | char *format_in; |
| 46 | char *format_out; | 47 | char *format_out; |
| 47 | char *separator; | 48 | char *separator; |
| 48 | }; | 49 | }; |
| 49 | 50 | ||
| 50 | static void add_event(struct tm, char *, EventList *); | 51 | static void add_event(struct tm, char *, EventList *); |
| 51 | static int compare_tm(const void *, const void *); | 52 | static int compare_tm(const void *, const void *); |
| 52 | static int compare_event(const void *, const void *); | 53 | static int compare_event(const void *, const void *); |
| 53 | static Options default_op(void); | 54 | static Options default_op(void); |
| 54 | static int events_in_range(EventList *, Options, Event *); | 55 | static int events_in_range(EventList *, Options, Event *); |
| 55 | static char *format_line(Event, Options, char *); | 56 | static char *format_line(Event, Options, char *); |
| 56 | static void read_input(Options, EventList *); | 57 | static void read_input(Options, EventList *); |
| 57 | static Options read_op(int, char *[]); | 58 | static Options read_op(int, char *[]); |
| 58 | static char *strtrim(char *); | 59 | static char *strtrim(char *); |
| 59 | static void write_output(Options, Event *, int); | 60 | static void write_output(Options, Event *, int); |
| 60 | 61 | ||
| 61 | 62 | ||
| 62 | static void | 63 | static void |
