mirror of
https://review.coreboot.org/flashrom.git
synced 2025-10-01 00:34:55 +02:00
Rename cli_classic.h to a more adequate cli_getop.h
The header only defines getop related stuff so it seems more intuitive this way. Also, use SPDX to reduce header comment sizes. Change-Id: I5986828f3bdec583af6f7b02cbe1a9c45ed2000f Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
This commit is contained in:
41
include/cli_getopt.h
Normal file
41
include/cli_getopt.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
|
||||
* 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__ */
|
Reference in New Issue
Block a user