#ifndef SCAPX_H #define SCAPX_H #define POPTS(msg) \ do { \ fprintf(stderr, "Usage: scapx\n"); \ fprintf(stderr, "%s\n\n\n", msg); \ fprintf(stdout, "-d, --display\t\t capture a specific display\n"); \ fprintf(stdout, "-a, --a\t\t\t capture all displays\n"); \ fprintf(stdout, "-h, --help\t\t print this menu and quit. Alternatively, man scapx\n"); \ fprintf(stdout, "-v, --version\t\t print program version and quit\n\n"); \ exit(EXIT_FAILURE); \ } while (0) // TODO: put in util.h #ifdef DEBUG #define SLOG(...) (fprintf(stderr, ##__VA_ARGS__)) #define DEBUG_INFO(FMT, ...) do { \ if (DEBUG) \ fprintf(stderr, "%s:%d " FMT "\n", __func__, __LINE__, ##__VA_ARGS__); \ } while (0) #endif #define FATAL_ERROR(errstr, ...) \ do { \ fprintf(stderr, (errstr), ##__VA_ARGS__); \ exit(EXIT_FAILURE); \ } while (0) #endif