Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getopt.h « include « linux « sys « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3fdf4645cb7a38f08a433342fcad3f6c0b233854 (plain)
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
/* libc/sys/linux/include/getopt.h - Extended command line parsing */

/* Written 2000 by Werner Almesberger */


#ifndef _NEWLIB_GETOPT_H
#define _NEWLIB_GETOPT_H

#include <unistd.h>

enum { NO_ARG, REQUIRED_ARG, OPTIONAL_ARG };
/* Define glibc names as well for compatibility.  */
#define no_argument NO_ARG
#define required_argument REQUIRED_ARG
#define optional_argument OPTIONAL_ARG

struct option {
    const char *name;
    int has_arg;
    int *flag;
    int val;
};

int getopt_long(int argc,char *const argv[],const char *optstring,
  const struct option *longopts,int *longindex);

int getopt_long_only(int argc,char *const argv[],const char *optstring,
  const struct option *longopts,int *longindex);

#endif