mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 22:52:34 +02:00

The header only defines getop related stuff so it seems more intuitive this way. Change-Id: Iaceeabedc26e93147d8122376d88e730aad1e355 Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/85072 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
/*
|
|
* This file is part of the flashrom project.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#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__ */
|