31 #define DEFAULT_MON_PREFIX "@DEFAULT_MON_PREFIX@" 
   34 #define DEFAULT_STATE_NAME "@DEFAULT_STATE_NAME@" 
   37 #define DEFAULT_MARK_FREQUENCY @DEFAULT_MARK_FREQUENCY@ 
   40 #define DEFAULT_MARK_FREQ_STRING "@DEFAULT_MARK_FREQUENCY@" 
   51 #define SERIAL_SLEEP 1E3 
   69 typedef void *(*device_fn)(
void *);
 
  109 bool timespec_subtract(
struct timespec *result, 
struct timespec *x, 
struct timespec *y);
 
void *(* device_fn)(void *)
Device specific callback functions.
 
bool timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y)
Difference between timespecs (used for rate keeping)
 
bool write_state_file(char *sFName, channel_stats stats[128][128], uint32_t lTS, char *vFName)
Write out the state file.
 
bool(* dc_parser)(log_thread_args_t *, config_section *)
Data source specific configuration parsers;.
 
bool log_softwareVersion(msgqueue *q)
Push current software version into message queue.
 
void destroy_global_opts(struct global_opts *go)
Cleanup function for global_opts struct.
 
unsigned int count
Number of messages received.
 
uint32_t lastTimestamp
Timestamp of last received message.
 
msg_t * lastMessage
Last message received.
 
Configuration file section.
 
Device specific function information.
 
device_fn logging
Main logging thread, passed to pthread_create()
 
device_fn startup
Called serially at startup, opens devices etc.
 
device_fn shutdown
Called on shutdown - close handles etc.
 
device_fn channels
Send a current channel map to the queue (optional)
 
char * dataPrefix
File prefix for main log and data files (optionally prefixed by path)
 
int coreFreq
Core marker/timer frequency.
 
char * configFileName
Name of configuration file used.
 
char * stateName
Name (and optionally path) to state file for live data.
 
bool saveState
Enable / Disable use of state file. Default true.
 
char * monFileStem
Current serial numbered file prefix.
 
bool rotateMonitor
Enable / Disable daily rotation of main log and data files.
 
FILE * varFile
Current variables file.
 
FILE * monitorFile
Current data output file.
 
Logging thread information.
 
msgqueue * logQ
Main message queue. Pushed to by threads, consumed by main()
 
device_callbacks funcs
Callback information for this device/thread.
 
char * tag
Tag/source name for messages etc.
 
char * type
Data source type.
 
void * dParams
Device/Thread specific data.
 
program_state * pstate
Current program state, used for logging.
 
int returnCode
Thread return code (output)
 
Represent a simple FIFO message queue.
 
Program state and logging information.