Improve documentation by adding build notes to the a9m24x0 CPU cards
[barebox-mini2440.git] / include / getopt.h
blob4f43ac409858cecd1a494081f699776a76f766dc
1 /*
2 * getopt.h - a simple getopt(3) implementation.
4 * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef __GETOPT_H
21 #define __GETOPT_H
23 extern int opterr;
24 extern int optind;
25 extern int optopt;
26 extern char *optarg;
29 * Simple getopt(3) implementation.
30 * This version of getopt does not take long options but should
31 * otherwise behave like one expects.
33 * - It takes ':' in optstring for required arguments and '::'
34 * for optional arguments.
35 * - arguments can be followed directly by optargs (like -loptarg)
36 * or in the next argv[] element (like -l optarg).
37 * - arguments can be grouped together (like ls -alR)
38 * - options can be mixed with nonoptions (like ls /bin -R)
41 int getopt(int argc, char *argv[], char *optstring);
44 * We do not start a new process for each getopt() run, so we
45 * need this function to reset the static variables.
47 void getopt_reset(void);
49 #endif /* __GETOPT_H */