disable the unrecognized nls and x flags
[AROS-Contrib.git] / arospdf / goo / parseargs.h
blob0d163b9856e094787bee0d4739a67ade8a2e003b
1 /*
2 * parseargs.h
4 * Command line argument parser.
6 * Copyright 1996-2003 Glyph & Cog, LLC
7 */
9 #ifndef PARSEARGS_H
10 #define PARSEARGS_H
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 #include "gtypes.h"
19 * Argument kinds.
21 typedef enum {
22 argFlag, /* flag (present / not-present) */
23 /* [val: GBool *] */
24 argInt, /* integer arg */
25 /* [val: int *] */
26 argFP, /* floating point arg */
27 /* [val: double *] */
28 argString, /* string arg */
29 /* [val: char *] */
30 /* dummy entries -- these show up in the usage listing only; */
31 /* useful for X args, for example */
32 argFlagDummy,
33 argIntDummy,
34 argFPDummy,
35 argStringDummy
36 } ArgKind;
39 * Argument descriptor.
41 typedef struct {
42 char *arg; /* the command line switch */
43 ArgKind kind; /* kind of arg */
44 void *val; /* place to store value */
45 int size; /* for argString: size of string */
46 char *usage; /* usage string */
47 } ArgDesc;
50 * Parse command line. Removes all args which are found in the arg
51 * descriptor list <args>. Stops parsing if "--" is found (and removes
52 * it). Returns gFalse if there was an error.
54 extern GBool parseArgs(ArgDesc *args, int *argc, char *argv[]);
57 * Print usage message, based on arg descriptor list.
59 extern void printUsage(char *program, char *otherArgs, ArgDesc *args);
62 * Check if a string is a valid integer or floating point number.
64 extern GBool isInt(char *s);
65 extern GBool isFP(char *s);
67 #ifdef __cplusplus
69 #endif
71 #endif