]> git.ipfire.org Git - thirdparty/util-linux.git/blob - clock/shhopt.h
Imported from util-linux-2.10m tarball.
[thirdparty/util-linux.git] / clock / shhopt.h
1 /* $Id: shhopt.h,v 2.2 1997/07/06 23:11:58 aebr Exp $ */
2 #ifndef SHHOPT_H
3 #define SHHOPT_H
4
5 /* constants for recognized option types. */
6 typedef enum {
7 OPT_END, /* nothing. used as ending element. */
8 OPT_FLAG, /* no argument following. sets variable to 1. */
9 OPT_STRING, /* string argument. */
10 OPT_INT, /* signed integer argument. */
11 OPT_UINT, /* unsigned integer argument. */
12 OPT_LONG, /* signed long integer argument. */
13 OPT_ULONG, /* unsigned long integer argument. */
14 } optArgType;
15
16 /* flags modifying the default way options are handeled. */
17 #define OPT_CALLFUNC 1 /* pass argument to a function. */
18
19 typedef struct {
20 char shortName; /* Short option name. */
21 char *longName; /* Long option name, no including '--'. */
22 optArgType type; /* Option type. */
23 void *arg; /* Pointer to variable to fill with argument,
24 * or pointer to function if Type == OPT_FUNC. */
25 int flags; /* Modifier flags. */
26 } optStruct;
27
28
29 void optSetFatalFunc(void (*f)(const char *, ...));
30 void optParseOptions(int *argc, char *argv[],
31 const optStruct opt[], int allowNegNum);
32
33 #endif