diff options
author | ache <ache@ache.one> | 2017-11-08 03:49:10 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2017-11-08 03:49:10 +0100 |
commit | 28a3fa7afebb9937fa42b9d53678eb8fd0be529d (patch) | |
tree | 83e5caf6ce15aed1cfc1145f1bea91722b67ec9b /main.h |
Init commit
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -0,0 +1,56 @@ +#ifndef MAIN_MESMS_H +#define MAIN_MESMS_H + +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif + +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 // For strnlen() +#endif + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <ncurses.h> +#include <getopt.h> + + +#define HIDDEN 1 + +void resize(void); + + +void fail_exit(const char *msg); + + + +// Checks errors for (most) ncurses functions. CHECK(fn, x, y, z) is a checked +// version of fn(x, y, z). +#define CHECK(fn, ...) \ + do \ + if (fn(__VA_ARGS__) == ERR) \ + fail_exit(#fn"() failed"); \ + while (false) + + +#define max(a, b) \ + ({ typeof(a) _a = a; \ + typeof(b) _b = b; \ + _a > _b ? _a : _b; }) + + +#define VERSION_MESMS "Alpha" +#define HELP_STRING_MESMS "Utilisation : mesms [OPTION]..." "\n"\ + "Gestionnaire de SMS" "\n"\ + "Options :" "\n"\ + "\t\t--help -h Affiche l'aide simple" "\n"\ + "\t\t--version -v Affiche la version" "\n"\ + "\n" "\n"\ + "" + + + +#endif |