Add casts to memory allocation related calls
[deliverable/binutils-gdb.git] / gdb / mi / mi-getopt.h
index 32fa8a6b013fc1240d05a0994e2223c932fdda50..6477e3ffb408b68862f5058984a07b3686d1eccc 100644 (file)
@@ -1,5 +1,5 @@
 /* MI Option Parser.
 /* MI Option Parser.
-   Copyright (C) 2000, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2000-2015 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
 #ifndef MI_GETOPT_H
 #define MI_GETOPT_H
 
 #ifndef MI_GETOPT_H
 #define MI_GETOPT_H
 
+/* The option list.  Terminated by NAME==NULL.  ARG_P that the option
+   requires an argument.  INDEX is returned to identify the option.  */
+
+struct mi_opt
+  {
+    const char *name;
+    int index;
+    int arg_p;
+  };
+
 /* Like getopt() but with simpler semantics.
 
    An option has the form ``-<name>''. The special option ``--''
 /* Like getopt() but with simpler semantics.
 
    An option has the form ``-<name>''. The special option ``--''
    If ARGV[OPTIND] is not an option, -1 is returned and OPTIND updated
    to specify the non-option argument.  OPTARG is set to NULL.
 
    If ARGV[OPTIND] is not an option, -1 is returned and OPTIND updated
    to specify the non-option argument.  OPTARG is set to NULL.
 
-   mi_getopt() calls ``error("%s: Unknown option %c", prefix,
-   option)'' if an unknown option is encountered. */
+   If an unknown option is encountered, mi_getopt() calls
+   ``error("%s: Unknown option %c", prefix, option)'' while
+   mi_getopt_allow_unknown returns -1.  */
 
 
-struct mi_opt;
 extern int mi_getopt (const char *prefix, int argc, char **argv,
 extern int mi_getopt (const char *prefix, int argc, char **argv,
-                     struct mi_opt *opt, int *optind, char **optarg);
-
-/* The option list.  Terminated by NAME==NULL.  ARG_P that the option
-   requires an argument.  INDEX is returned to identify th option. */
-
-struct mi_opt
-  {
-    const char *name;
-    int index;
-    int arg_p;
-  };
-
-struct mi_opt;
-
-/* mi_valid_noargs
-   
-   Determines if ARGC/ARGV are a valid set of parameters to satisfy 
-   an MI function that is not supposed to recieve any arguments.
+                     const struct mi_opt *opt, int *optind, char **optarg);
+extern int mi_getopt_allow_unknown (const char *prefix, int argc,
+                                   char **argv, const struct mi_opt *opts,
+                                   int *oind, char **oarg);
+
+/* mi_valid_noargs determines if ARGC/ARGV are a valid set of
+   parameters to satisfy an MI function that is not supposed to
+   recieve any arguments.
    
    
-   An MI function that should not recieve arguments can still be 
+   An MI function that should not receive arguments can still be 
    passed parameters after the special option '--' such as below.
 
    Example: The MI function -exec-run takes no args.
    passed parameters after the special option '--' such as below.
 
    Example: The MI function -exec-run takes no args.
This page took 0.027561 seconds and 4 git commands to generate.