File: gethopt.h

package info (click to toggle)
libtext-markdown-discount-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,524 kB
  • sloc: ansic: 5,765; pascal: 1,027; sh: 208; makefile: 196; perl: 184
file content (43 lines) | stat: -rw-r--r-- 918 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * gethopt;  options processing with both single-character and whole-work
 *           options both introduced with -
 */

#ifndef __GETHOPT_D
#define __GETHOPT_D

#include <stdio.h>
#include <string.h>


struct h_opt {
    int  option;
    char *optword;
    char optchar;
    char *opthasarg;
    char *optdesc;
} ;

#define HOPTERR	((struct h_opt*)-1)

struct h_context {
    char **argv;
    int    argc;
    int    optchar;
    int    optind;
    char  *optarg;
    char   optopt;
    int    opterr:1;
    int    optend:1;
} ;

extern char *hoptarg(struct h_context *);
extern int   hoptind(struct h_context *);
extern char  hoptopt(struct h_context *);
extern void  hoptset(struct h_context *, int, char **);
extern int   hopterr(struct h_context *, int);
extern struct h_opt *gethopt(struct h_context *, struct h_opt*, int);

extern void hoptusage(char *, struct h_opt*, int, char *);

#endif/*__GETHOPT_D*/