source: trunk/src/emx/include/getopt.h@ 1506

Last change on this file since 1506 was 1506, checked in by bird, 21 years ago

@unixroot. header reviews. ++

  • Property cvs2svn:cvs-rev set to 1.6
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.2 KB
Line 
1/* getopt.h,v 1.6 2004/09/14 22:27:33 bird Exp */
2/** @file
3 * FreeBSD 5.1
4 * @changed bird: Added two GNU apis for libiberty.
5 */
6
7/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
8/* $FreeBSD: src/include/getopt.h,v 1.1 2002/09/29 04:14:30 eric Exp $ */
9
10/*-
11 * Copyright (c) 2000 The NetBSD Foundation, Inc.
12 * All rights reserved.
13 *
14 * This code is derived from software contributed to The NetBSD Foundation
15 * by Dieter Baron and Thomas Klausner.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 * 3. All advertising materials mentioning features or use of this software
26 * must display the following acknowledgement:
27 * This product includes software developed by the NetBSD
28 * Foundation, Inc. and its contributors.
29 * 4. Neither the name of The NetBSD Foundation nor the names of its
30 * contributors may be used to endorse or promote products derived
31 * from this software without specific prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
34 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
35 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
36 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
37 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
38 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 * POSSIBILITY OF SUCH DAMAGE.
44 */
45
46
47#ifndef _GETOPT_H_
48#define _GETOPT_H_
49
50#include <sys/cdefs.h>
51#include <unistd.h>
52
53/*
54 * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
55 */
56#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
57#define no_argument 0
58#define required_argument 1
59#define optional_argument 2
60
61struct option {
62 /* name of long option */
63 const char *name;
64 /*
65 * one of no_argument, required_argument, and optional_argument:
66 * whether option takes an argument
67 */
68 int has_arg;
69 /* if not NULL, set *flag to val when option found */
70 int *flag;
71 /* if flag not NULL, value to set *flag to; else return value */
72 int val;
73};
74
75__BEGIN_DECLS
76int getopt_long __P((int, char * const *, const char *,
77 const struct option *, int *));
78
79/* bird - start: these are provided thru libiberty. */
80int getopt_long_only __P((int argc, char *const *, const char *,
81 const struct option *, int *));
82int _getopt_internal __P((int, char *const *, const char *,
83 const struct option *, int *, int));
84/* bird - end */
85
86__END_DECLS
87#endif
88
89#endif /* !_GETOPT_H_ */
Note: See TracBrowser for help on using the repository browser.