chiark / gitweb /
cgi-fcgi-perl: wip, computes socket path
[chiark-utils.git] / cprogs / myopt.h
1 /*
2  * myopt.h - declarations for my very own option parsing
3  *
4  * Copyright (C) 1994,1995 Ian Jackson <ian@davenant.greenend.org.uk>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 3,
9  * or (at your option) any later version.
10  *
11  * This is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this file; if not, consult the Free Software
18  * Foundation's website at www.fsf.org, or the GNU Project website at
19  * www.gnu.org.
20  */
21
22 #ifndef MYOPT_H
23 #define MYOPT_H
24
25 extern void usagemessage(void); /* supply this */
26
27 typedef void (*voidfnp)(void);
28
29 struct cmdinfo {
30   const char *olong;
31   char oshort;
32   int takesvalue; /* 0 = normal   1 = standard value   2 = option string cont */
33   int *iassignto;
34   const char **sassignto;
35   void (*call)(const struct cmdinfo*, const char *value);
36   int arg;
37   void *parg;
38   voidfnp farg;
39 };
40
41 void myopt(const char *const **argvp, const struct cmdinfo *cmdinfos);
42 void badusage(const char *fmt, ...);
43
44 #endif /* MYOPT_H */