48 int main(
int argc,
char *argv[]) {
52 char *usage =
"Usage: %1$s [-v] datfile\n"
58 while ((go = getopt(argc, argv,
"v")) != -1) {
64 log_error(&state,
"Unknown option `-%c'", optopt);
70 if (argc - optind != 1) {
76 fprintf(stderr, usage, argv[0]);
81 char *inFileName = strdup(argv[optind]);
82 FILE *inFile = fopen(inFileName,
"rb");
84 log_error(&state,
"Unable to open input file");
92 while (!(feof(inFile))) {
98 "Error reading messages from file (Code: 0x%52x)\n",
103 log_info(&state, 1,
"End of file reached");
111 if (msgstring) { fprintf(stdout,
"%s\n", msgstring); }
int main(int argc, char *argv[])
char * msg_to_string(const msg_t *msg)
Generate string representation of message.
void msg_destroy(msg_t *msg)
Destroy a message.
bool mp_readMessage(int handle, msg_t *out)
Static wrapper around mp_readMessage_buf.
void destroy_program_state(program_state *s)
Cleanly destroy program state.
void log_info(const program_state *s, const int level, const char *format,...)
Output formatted information message at a given level.
void log_error(const program_state *s, const char *format,...)
Output formatted error message.
msg_data_t data
Embedded data.
uint8_t type
Message type. Common types to be documented.
Program state and logging information.
int verbose
Current log verbosity (console output)
bool started
Indicates startup completed.
float value
Generic numerical data.
#define GIT_VERSION_STRING
Git version description.