#include #include #include #ifndef _WIN32 #define MM_API __attribute__((visibility("default"))) #else #define MM_API __attribute__((dllexport)) #endif #define BACKEND_NAME "cli" #include "midimonster.h" #include "core/core.h" #include "core/config.h" volatile static sig_atomic_t shutdown_requested = 0; MM_API int log_printf(int level, char* module, char* fmt, ...){ int rv = 0; va_list args; va_start(args, fmt); fprintf(stderr, "%s%s\t", level ? "debug/" : "", module); rv = vfprintf(stderr, fmt, args); va_end(args); return rv; } static void signal_handler(int signum){ shutdown_requested = 1; } static void version(){ printf("MIDIMonster %s\n", MIDIMONSTER_VERSION); } static int usage(char* fn){ version(); fprintf(stderr, "Usage:\n"); fprintf(stderr, "\t%s [] \n", fn); fprintf(stderr, "\nOptions:\n"); fprintf(stderr, "\t-v,--version - show version\n"); fprintf(stderr, "\t-b - override backend options (can be used multiple times)\n"); fprintf(stderr, "\t-i - override instance options (can be used multiple times)\n"); fprintf(stderr, "\nInstance/Backend options format:\n"); fprintf(stderr, ".