xref: /aosp_15_r20/external/libsrtp2/include/getopt_s.h (revision 90e502c7aef8d77d0622bb67d75435c6190cfc1a)
1*90e502c7SAndroid Build Coastguard Worker /*
2*90e502c7SAndroid Build Coastguard Worker  * getopt.h
3*90e502c7SAndroid Build Coastguard Worker  *
4*90e502c7SAndroid Build Coastguard Worker  * interface to a minimal implementation of the getopt() function,
5*90e502c7SAndroid Build Coastguard Worker  * written so that test applications that use that function can run on
6*90e502c7SAndroid Build Coastguard Worker  * non-POSIX platforms
7*90e502c7SAndroid Build Coastguard Worker  *
8*90e502c7SAndroid Build Coastguard Worker  */
9*90e502c7SAndroid Build Coastguard Worker /*
10*90e502c7SAndroid Build Coastguard Worker  *
11*90e502c7SAndroid Build Coastguard Worker  * Copyright (c) 2001-2017 Cisco Systems, Inc.
12*90e502c7SAndroid Build Coastguard Worker  * All rights reserved.
13*90e502c7SAndroid Build Coastguard Worker  *
14*90e502c7SAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
15*90e502c7SAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions
16*90e502c7SAndroid Build Coastguard Worker  * are met:
17*90e502c7SAndroid Build Coastguard Worker  *
18*90e502c7SAndroid Build Coastguard Worker  *   Redistributions of source code must retain the above copyright
19*90e502c7SAndroid Build Coastguard Worker  *   notice, this list of conditions and the following disclaimer.
20*90e502c7SAndroid Build Coastguard Worker  *
21*90e502c7SAndroid Build Coastguard Worker  *   Redistributions in binary form must reproduce the above
22*90e502c7SAndroid Build Coastguard Worker  *   copyright notice, this list of conditions and the following
23*90e502c7SAndroid Build Coastguard Worker  *   disclaimer in the documentation and/or other materials provided
24*90e502c7SAndroid Build Coastguard Worker  *   with the distribution.
25*90e502c7SAndroid Build Coastguard Worker  *
26*90e502c7SAndroid Build Coastguard Worker  *   Neither the name of the Cisco Systems, Inc. nor the names of its
27*90e502c7SAndroid Build Coastguard Worker  *   contributors may be used to endorse or promote products derived
28*90e502c7SAndroid Build Coastguard Worker  *   from this software without specific prior written permission.
29*90e502c7SAndroid Build Coastguard Worker  *
30*90e502c7SAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31*90e502c7SAndroid Build Coastguard Worker  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32*90e502c7SAndroid Build Coastguard Worker  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
33*90e502c7SAndroid Build Coastguard Worker  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
34*90e502c7SAndroid Build Coastguard Worker  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
35*90e502c7SAndroid Build Coastguard Worker  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36*90e502c7SAndroid Build Coastguard Worker  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37*90e502c7SAndroid Build Coastguard Worker  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*90e502c7SAndroid Build Coastguard Worker  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*90e502c7SAndroid Build Coastguard Worker  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40*90e502c7SAndroid Build Coastguard Worker  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
41*90e502c7SAndroid Build Coastguard Worker  * OF THE POSSIBILITY OF SUCH DAMAGE.
42*90e502c7SAndroid Build Coastguard Worker  *
43*90e502c7SAndroid Build Coastguard Worker  */
44*90e502c7SAndroid Build Coastguard Worker 
45*90e502c7SAndroid Build Coastguard Worker #ifndef GETOPT_S_H
46*90e502c7SAndroid Build Coastguard Worker #define GETOPT_S_H
47*90e502c7SAndroid Build Coastguard Worker 
48*90e502c7SAndroid Build Coastguard Worker #ifdef __cplusplus
49*90e502c7SAndroid Build Coastguard Worker extern "C" {
50*90e502c7SAndroid Build Coastguard Worker #endif
51*90e502c7SAndroid Build Coastguard Worker 
52*90e502c7SAndroid Build Coastguard Worker /*
53*90e502c7SAndroid Build Coastguard Worker  * getopt_s(), optarg_s, and optind_s are small, locally defined
54*90e502c7SAndroid Build Coastguard Worker  * versions of the POSIX standard getopt() interface.
55*90e502c7SAndroid Build Coastguard Worker  */
56*90e502c7SAndroid Build Coastguard Worker 
57*90e502c7SAndroid Build Coastguard Worker int getopt_s(int argc, char *const argv[], const char *optstring);
58*90e502c7SAndroid Build Coastguard Worker 
59*90e502c7SAndroid Build Coastguard Worker extern char *optarg_s; /* defined in getopt.c */
60*90e502c7SAndroid Build Coastguard Worker 
61*90e502c7SAndroid Build Coastguard Worker extern int optind_s; /* defined in getopt.c */
62*90e502c7SAndroid Build Coastguard Worker 
63*90e502c7SAndroid Build Coastguard Worker #ifdef __cplusplus
64*90e502c7SAndroid Build Coastguard Worker }
65*90e502c7SAndroid Build Coastguard Worker #endif
66*90e502c7SAndroid Build Coastguard Worker 
67*90e502c7SAndroid Build Coastguard Worker #endif /* GETOPT_S_H */
68