diff options
Diffstat (limited to 'src/system/dlt-system.h')
-rw-r--r-- | src/system/dlt-system.h | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/src/system/dlt-system.h b/src/system/dlt-system.h index c415ad7..6f068ec 100644 --- a/src/system/dlt-system.h +++ b/src/system/dlt-system.h @@ -56,12 +56,12 @@ #ifndef DLT_SYSTEM_H_ #define DLT_SYSTEM_H_ -// DLT related includes. +/* DLT related includes. */ #include "dlt.h" #include "dlt_common.h" -// Constants -#define DEFAULT_CONF_FILE ( CONFIGURATION_FILES_DIR "/dlt-system.conf") +/* Constants */ +#define DEFAULT_CONF_FILE (CONFIGURATION_FILES_DIR "/dlt-system.conf") #define DLT_SYSTEM_LOG_FILE_MAX 32 #define DLT_SYSTEM_LOG_DIRS_MAX 32 #define DLT_SYSTEM_LOG_PROCESSES_MAX 32 @@ -74,113 +74,113 @@ #define MAX_THREADS 8 -// Macros -#define MALLOC_ASSERT(x) if(x == NULL) {\ - fprintf(stderr, "Out of memory\n");\ - abort();} +/* Macros */ +#define MALLOC_ASSERT(x) if (x == NULL) { \ + fprintf(stderr, "Out of memory\n"); \ + abort(); } /** * Configuration structures. * Please see dlt-system.conf for explanation of all the options. */ -// Command line options +/* Command line options */ typedef struct { - char *ConfigurationFileName; - int Daemonize; + char *ConfigurationFileName; + int Daemonize; } DltSystemCliOptions; -// Configuration shell options +/* Configuration shell options */ typedef struct { - int Enable; + int Enable; } ShellOptions; -// Configuration syslog options +/* Configuration syslog options */ typedef struct { - int Enable; - char *ContextId; - int Port; + int Enable; + char *ContextId; + int Port; } SyslogOptions; -// Configuration journal options +/* Configuration journal options */ typedef struct { - int Enable; - char *ContextId; - int CurrentBoot; - int Follow; - int MapLogLevels; + int Enable; + char *ContextId; + int CurrentBoot; + int Follow; + int MapLogLevels; } JournalOptions; typedef struct { - int Enable; - char *ContextId; - int TimeStartup; - int TimeDelay; - int TimeoutBetweenLogs; - char *TempDir; - - // Variable number of file transfer dirs - int Count; - int Compression[DLT_SYSTEM_LOG_DIRS_MAX]; - int CompressionLevel[DLT_SYSTEM_LOG_DIRS_MAX]; - char *Directory[DLT_SYSTEM_LOG_DIRS_MAX]; + int Enable; + char *ContextId; + int TimeStartup; + int TimeDelay; + int TimeoutBetweenLogs; + char *TempDir; + + /* Variable number of file transfer dirs */ + int Count; + int Compression[DLT_SYSTEM_LOG_DIRS_MAX]; + int CompressionLevel[DLT_SYSTEM_LOG_DIRS_MAX]; + char *Directory[DLT_SYSTEM_LOG_DIRS_MAX]; } FiletransferOptions; typedef struct { - int Enable; - - // Variable number of files to transfer - int Count; - char *ContextId[DLT_SYSTEM_LOG_FILE_MAX]; - char *Filename[DLT_SYSTEM_LOG_FILE_MAX]; - int Mode[DLT_SYSTEM_LOG_FILE_MAX]; - int TimeDelay[DLT_SYSTEM_LOG_FILE_MAX]; + int Enable; + + /* Variable number of files to transfer */ + int Count; + char *ContextId[DLT_SYSTEM_LOG_FILE_MAX]; + char *Filename[DLT_SYSTEM_LOG_FILE_MAX]; + int Mode[DLT_SYSTEM_LOG_FILE_MAX]; + int TimeDelay[DLT_SYSTEM_LOG_FILE_MAX]; } LogFileOptions; typedef struct { - int Enable; - char *ContextId; - - // Variable number of processes - int Count; - char *Name[DLT_SYSTEM_LOG_PROCESSES_MAX]; - char *Filename[DLT_SYSTEM_LOG_PROCESSES_MAX]; - int Mode[DLT_SYSTEM_LOG_PROCESSES_MAX]; - int TimeDelay[DLT_SYSTEM_LOG_PROCESSES_MAX]; + int Enable; + char *ContextId; + + /* Variable number of processes */ + int Count; + char *Name[DLT_SYSTEM_LOG_PROCESSES_MAX]; + char *Filename[DLT_SYSTEM_LOG_PROCESSES_MAX]; + int Mode[DLT_SYSTEM_LOG_PROCESSES_MAX]; + int TimeDelay[DLT_SYSTEM_LOG_PROCESSES_MAX]; } LogProcessOptions; typedef struct { - char *ApplicationId; - ShellOptions Shell; - SyslogOptions Syslog; - JournalOptions Journal; - FiletransferOptions Filetransfer; - LogFileOptions LogFile; - LogProcessOptions LogProcesses; + char *ApplicationId; + ShellOptions Shell; + SyslogOptions Syslog; + JournalOptions Journal; + FiletransferOptions Filetransfer; + LogFileOptions LogFile; + LogProcessOptions LogProcesses; } DltSystemConfiguration; typedef struct { - pthread_t threads[MAX_THREADS]; - int count; - int shutdown; + pthread_t threads[MAX_THREADS]; + int count; + int shutdown; } DltSystemThreads; /** * Forward declarations for the whole application */ -// In dlt-system-options.c +/* In dlt-system-options.c */ int read_command_line(DltSystemCliOptions *options, int argc, char *argv[]); int read_configuration_file(DltSystemConfiguration *config, char *file_name); -// In dlt-process-handling.c +/* In dlt-process-handling.c */ int daemonize(); void start_threads(DltSystemConfiguration *config); void join_threads(); void dlt_system_signal_handler(int sig); void register_with_dlt(DltSystemConfiguration *config); -// Thread initiators: +/* Thread initiators: */ void init_shell(); void start_syslog(); void start_filetransfer(DltSystemConfiguration *conf); |