1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-10-16 07:11:53 +02:00
Files
flashrom/include/cli_getopt.h
Antonio Vázquez Blanco 690ec44e0b cli: Use SPDX in headers
Change-Id: Ie523cf5b26a29de8e9e9efb56efe04a5ff86a59c
Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/85073
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-10-14 10:39:40 +00:00

41 lines
915 B
C

/*
* This file is part of the flashrom project.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __CLI_GETOPT_H__
#define __CLI_GETOPT_H__
/**
* This header is responsible for either including a standard getop
* implementation header or to provide a compatible one.
*/
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
#define no_argument 0
#define required_argument 1
#define optional_argument 2
extern char *optarg;
extern int optind, opterr, optopt;
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
int getopt (int argc, char *const *argv, const char *shortopts);
int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
int getopt_long_only (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
#endif /* HAVE_GETOPT_H */
#endif /* __CLI_GETOPT_H__ */