24#warning deprecated file!
26#define JA_API static inline
29#define PROGRAM_NAME "dummy"
32#ifndef PROGRAM_VERSION
33#define PROGRAM_VERSION 0.0
37#define PROGRAM_USAGE "no usage defined!"
41#define PROGRAM_HELP "help is not defined!"
47JA_API
void ja_parse(
int argc,
char*
const* argv,
void (*cb) (
char,
const char*),
const char* e) {
51 size_t s = e ? strlen(e) : 0;
55 if (e) memcpy(exp + 2, e, s+1);
57 while ((c = getopt(argc, argv, exp)) != -1) {
60 printf(
"%s %f\n", PROGRAM_NAME, PROGRAM_VERSION);
63 printf(
"%s %f : %s\n%s\n", PROGRAM_NAME, PROGRAM_VERSION, PROGRAM_USAGE, PROGRAM_HELP);
70 if (cb) cb(c, optarg);