2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2020-05-29 22:15:08 +03:00
|
|
|
* Copyright (c) 2020, Sergey Bugaev <bugaevc@serenityos.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2018-10-31 17:50:43 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-09-09 08:20:00 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
2020-05-29 22:15:08 +03:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
2020-05-28 14:27:20 +02:00
|
|
|
#define no_argument 0
|
|
|
|
|
#define required_argument 1
|
|
|
|
|
#define optional_argument 2
|
2019-09-06 20:03:16 +02:00
|
|
|
|
|
|
|
|
struct option {
|
2020-05-28 14:27:20 +02:00
|
|
|
const char* name;
|
2019-09-06 20:03:16 +02:00
|
|
|
int has_arg;
|
|
|
|
|
int* flag;
|
|
|
|
|
int val;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-29 16:10:41 +02:00
|
|
|
extern int opterr;
|
|
|
|
|
extern int optopt;
|
|
|
|
|
extern int optind;
|
|
|
|
|
extern int optreset;
|
|
|
|
|
extern char* optarg;
|
2021-04-11 06:47:47 +02:00
|
|
|
int getopt_long(int argc, char* const* argv, const char* short_options, const struct option* long_options, int* out_long_option_index);
|
2018-10-31 17:50:43 +01:00
|
|
|
|
|
|
|
|
__END_DECLS
|