Antonio Vázquez Blanco has uploaded this change for review.

View Change

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.

Change-Id: Iaceeabedc26e93147d8122376d88e730aad1e355
Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
---
M cli_classic.c
M cli_getopt.c
R include/cli_getopt.h
3 files changed, 12 insertions(+), 6 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/72/85072/1
diff --git a/cli_classic.c b/cli_classic.c
index 896c167..f21e477 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <cli_classic.h>
+#include "cli_getopt.h"
#include "flash.h"
#include "flashchips.h"
#include "fmap.h"
diff --git a/cli_getopt.c b/cli_getopt.c
index fc51fcf..8d799e3 100644
--- a/cli_getopt.c
+++ b/cli_getopt.c
@@ -25,13 +25,14 @@
* SOFTWARE.
*/

+#include "cli_getopt.h"
+
#include <unistd.h>
#include <wchar.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
-#include "cli_classic.h"
-#include "flash.h"
+#include "flash.h" // msg_gerr

char *optarg;
int optind=1, opterr=1, optopt, optpos;
diff --git a/include/cli_classic.h b/include/cli_getopt.h
similarity index 84%
rename from include/cli_classic.h
rename to include/cli_getopt.h
index eb1f0fe..670bd24 100644
--- a/include/cli_classic.h
+++ b/include/cli_getopt.h
@@ -12,8 +12,13 @@
* GNU General Public License for more details.
*/

-#ifndef CLI_CLASSIC_H
-#define CLI_CLASSIC_H
+#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>
@@ -40,4 +45,4 @@
const struct option *longopts, int *longind);

#endif /* HAVE_GETOPT_H */
-#endif /* CLI_CLASSIC_H */
+#endif /* __CLI_GETOPT_H__ */

To view, visit change 85072. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Iaceeabedc26e93147d8122376d88e730aad1e355
Gerrit-Change-Number: 85072
Gerrit-PatchSet: 1
Gerrit-Owner: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>