summaryrefslogtreecommitdiffstats
path: root/qemu/roms/ipxe/src/include/getopt.h
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/ipxe/src/include/getopt.h
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/ipxe/src/include/getopt.h')
-rw-r--r--qemu/roms/ipxe/src/include/getopt.h94
1 files changed, 0 insertions, 94 deletions
diff --git a/qemu/roms/ipxe/src/include/getopt.h b/qemu/roms/ipxe/src/include/getopt.h
deleted file mode 100644
index db3de1786..000000000
--- a/qemu/roms/ipxe/src/include/getopt.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef _GETOPT_H
-#define _GETOPT_H
-
-/** @file
- *
- * Parse command-line options
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
-
-#include <stddef.h>
-
-enum getopt_argument_requirement {
- /** Option does not take an argument */
- no_argument = 0,
- /** Option requires an argument */
- required_argument = 1,
- /** Option may have an argument */
- optional_argument = 2,
-};
-
-/** A long option, as used for getopt_long() */
-struct option {
- /** Long name of this option */
- const char *name;
- /** Option takes an argument
- *
- * Must be one of @c no_argument, @c required_argument, or @c
- * optional_argument.
- */
- int has_arg;
- /** Location into which to store @c val, or NULL.
- *
- * See the description for @c val for more details.
- */
- int *flag;
- /** Value to return
- *
- * If @c flag is NULL, then this is the value that will be
- * returned by getopt_long() when this option is found, and
- * should therefore be set to the equivalent short option
- * character.
- *
- * If @c flag is non-NULL, then this value will be written to
- * the location pointed to by @flag, and getopt_long() will
- * return 0.
- */
- int val;
-};
-
-extern char *optarg;
-extern int optind;
-extern int nextchar;
-extern int optopt;
-
-extern int getopt_long ( int argc, char * const argv[], const char *optstring,
- const struct option *longopts, int *longindex );
-
-/**
- * Parse command-line options
- *
- * @v argv Argument count
- * @v argv Argument list
- * @v optstring Option specification string
- * @ret option Option found, or -1 for no more options
- *
- * See getopt_long() for full details.
- */
-static inline int getopt ( int argc, char * const argv[],
- const char *optstring ) {
- static const struct option no_options[] = {
- { NULL, 0, NULL, 0 }
- };
- return getopt_long ( argc, argv, optstring, no_options, NULL );
-}
-
-/**
- * Reset getopt() internal state
- *
- * Due to a limitation of the POSIX getopt() API, it is necessary to
- * add a call to reset_getopt() before each set of calls to getopt()
- * or getopt_long(). This arises because POSIX assumes that each
- * process will parse command line arguments no more than once; this
- * assumption is not valid within Etherboot. We work around the
- * limitation by arranging for execv() to call reset_getopt() before
- * executing the command.
- */
-static inline void reset_getopt ( void ) {
- optind = 1;
- nextchar = 0;
-}
-
-#endif /* _GETOPT_H */