X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=rpi%2Fmain.c;fp=rpi%2Fmain.c;h=0000000000000000000000000000000000000000;hb=b1a8334f97f84e10ee9cef96377bbdcfbf5f945c;hp=bb3b5ac292f08991ac439988d3a9b098d6ead1dd;hpb=fc9e4c8ef6b420cd877abb834758655e15367555;p=matches%2FMCTX3420.git diff --git a/rpi/main.c b/rpi/main.c deleted file mode 100644 index bb3b5ac..0000000 --- a/rpi/main.c +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file main.c - * @purpose Entry point to the program, starts threads, handles cleanup on program exit - */ - -#define _POSIX_C_SOURCE 200809L // For strsignal to work - -// --- Standard headers --- // -#include -#include -#include // for signal handling -#include // string functions - -// --- Custom headers --- // -#include "log.h" -#include "options.h" - -// --- Variable definitions --- // -Options g_options; // options passed to program through command line arguments - -// --- Function definitions --- // - -/** - * @funct ParseArguments - * @purpose Parse command line arguments, set up an options variable - * @param argc - Num args - * @param argv - Array of args - * @param opts - Pointer to options. &g_options - */ -void ParseArguments(int argc, char ** argv, Options * opts) -{ - opts->program = argv[0]; // program name - opts->verbosity = LOGDEBUG; // default log level - Log(LOGDEBUG, "ParseArguments", "Called as %s with %d arguments.", opts->program, argc); -} - -/** - * @funct SignalHandler - * @purpose Handle signals - * @param sig - The signal - */ -void SignalHandler(int sig) -{ - // At the moment just always exit. - // Call `exit` so that Cleanup will be called to... clean up. - Log(LOGWARN, "SignalHandler", "Got signal %d (%s). Exiting.", sig, strsignal(sig)); - exit(sig); -} - -/** - * @funct Cleanup - * @purpose Called when program exits - */ -void Cleanup() -{ - Log(LOGDEBUG, "Cleanup", "Begin cleanup."); - Log(LOGDEBUG, "Cleanup", "Finish cleanup."); - -} - -/** - * @funct main - * @purpose Main entry point; start worker threads, setup signal handling, wait for threads to exit, exit - * @param argc - Num args - * @param argv - Args - * @returns 0 on success, error code on failure - */ -int main(int argc, char ** argv) -{ - return 0; -} - -