|
Last change
on this file since cb7be8f was cd1e3fc0, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago |
|
Manually update getopt() license
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Rev | Line | |
|---|
| [7c3fb9b] | 1 | /*
|
|---|
| [cd1e3fc0] | 2 | * SPDX-FileCopyrightText: 2000 The NetBSD Foundation, Inc.
|
|---|
| 3 | * SPDX-FileCopyrightText: 2008 Tim Post
|
|---|
| [216d6fc] | 4 | *
|
|---|
| [cd1e3fc0] | 5 | * SPDX-License-Identifier: BSD-3-Clause AND LicenseRef-GetOptLicense
|
|---|
| [216d6fc] | 6 | */
|
|---|
| 7 |
|
|---|
| [cd1e3fc0] | 8 | /* $NetBSD: getopt.h,v 1.10.6.1 2008/05/18 12:30:09 yamt Exp $ */
|
|---|
| 9 |
|
|---|
| [216d6fc] | 10 | /* Ported to HelenOS August 2008 by Tim Post <echo@echoreply.us> */
|
|---|
| 11 |
|
|---|
| 12 | #ifndef _GETOPT_H_
|
|---|
| 13 | #define _GETOPT_H_
|
|---|
| 14 |
|
|---|
| 15 | /*
|
|---|
| 16 | * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
|
|---|
| 17 | */
|
|---|
| 18 | #define no_argument 0
|
|---|
| 19 | #define required_argument 1
|
|---|
| 20 | #define optional_argument 2
|
|---|
| 21 |
|
|---|
| 22 | struct option {
|
|---|
| 23 | /* name of long option */
|
|---|
| 24 | const char *name;
|
|---|
| 25 | /*
|
|---|
| 26 | * one of no_argument, required_argument, and optional_argument:
|
|---|
| 27 | * whether option takes an argument
|
|---|
| 28 | */
|
|---|
| 29 | int has_arg;
|
|---|
| 30 | /* if not NULL, set *flag to val when option found */
|
|---|
| 31 | int *flag;
|
|---|
| 32 | /* if flag not NULL, value to set *flag to; else return value */
|
|---|
| 33 | int val;
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | /* HelenOS Port - These need to be exposed for legacy getopt() */
|
|---|
| [ba29018] | 37 | extern char *optarg;
|
|---|
| [216d6fc] | 38 | extern int optind, opterr, optopt;
|
|---|
| 39 | extern int optreset;
|
|---|
| 40 |
|
|---|
| [1433ecda] | 41 | int getopt_long(int, char *const *, const char *,
|
|---|
| [216d6fc] | 42 | const struct option *, int *);
|
|---|
| 43 |
|
|---|
| 44 | /* HelenOS Port : Expose legacy getopt() */
|
|---|
| [1433ecda] | 45 | int getopt(int, char *const [], const char *);
|
|---|
| [216d6fc] | 46 |
|
|---|
| 47 | #endif /* !_GETOPT_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.