Clean up timestamp enum definition

This commit is contained in:
Martin Lund 2024-04-20 15:02:43 +02:00
parent b05f38abd0
commit ae76f8f58d
3 changed files with 8 additions and 8 deletions

View file

@ -67,7 +67,7 @@ struct option_t
bool log_append; bool log_append;
bool log_strip; bool log_strip;
bool local_echo; bool local_echo;
enum timestamp_t timestamp; timestamp_t timestamp;
const char *log_filename; const char *log_filename;
const char *log_directory; const char *log_directory;
const char *map; const char *map;

View file

@ -94,7 +94,7 @@ char *timestamp_current_time(void)
return (len < TIME_STRING_SIZE_MAX) ? time_string : NULL; return (len < TIME_STRING_SIZE_MAX) ? time_string : NULL;
} }
const char* timestamp_state_to_string(enum timestamp_t timestamp) const char* timestamp_state_to_string(timestamp_t timestamp)
{ {
switch (timestamp) switch (timestamp)
{ {
@ -124,9 +124,9 @@ const char* timestamp_state_to_string(enum timestamp_t timestamp)
} }
} }
enum timestamp_t timestamp_option_parse(const char *arg) timestamp_t timestamp_option_parse(const char *arg)
{ {
enum timestamp_t timestamp = TIMESTAMP_24HOUR; // Default timestamp_t timestamp = TIMESTAMP_24HOUR; // Default
if (arg != NULL) if (arg != NULL)
{ {

View file

@ -21,7 +21,7 @@
#pragma once #pragma once
enum timestamp_t typedef enum
{ {
TIMESTAMP_NONE, TIMESTAMP_NONE,
TIMESTAMP_24HOUR, TIMESTAMP_24HOUR,
@ -29,8 +29,8 @@ enum timestamp_t
TIMESTAMP_24HOUR_DELTA, TIMESTAMP_24HOUR_DELTA,
TIMESTAMP_ISO8601, TIMESTAMP_ISO8601,
TIMESTAMP_END, TIMESTAMP_END,
}; } timestamp_t;
char *timestamp_current_time(void); char *timestamp_current_time(void);
const char* timestamp_state_to_string(enum timestamp_t timestamp); const char* timestamp_state_to_string(timestamp_t timestamp);
enum timestamp_t timestamp_option_parse(const char *arg); timestamp_t timestamp_option_parse(const char *arg);