#ifndef GETARG_H #define GETARG_H /* * Copyright (c) Alex Holden 2000. * * This code is public domain; you can do whatever you want with it, though I * would prefer you to contribute any bug fixes back to me if possible. * This software comes with NO WARRANTY WHATSOEVER, not even the implied * warranties of merchantability and fitness for a particular purpose. */ typedef struct { int argc; char **argv; char **realargv; } getarg_state; /* The value to set a character to to mark it as used (don't set it to 0!) */ #define GETARG_USEDFLAG 1 /* The symbol which prefixes a short flag (or list of short flags) */ #define GETARG_SHORTFLAG '-' /* The two symbols which prefix a long flag */ #define GETARG_LONGFLAG0 '-' #define GETARG_LONGFLAG1 '-' extern getarg_state *getarg_init(int argc, char *argv[]); extern char *_getarg(getarg_state *state, char shortflag, char *longflag, int ga, int *cnt); extern char *getarg(getarg_state *state, char shortflag, char *longflag); extern int getflag(getarg_state *state, char shortflag, char *longflag); extern void getarg_destroy(getarg_state *state); #endif