MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
macsio_clargs.h
Go to the documentation of this file.
1 #ifndef _MACSIO_CLAGS_H
2 #define _MACSIO_CLAGS_H
3 /*
4 Copyright (c) 2015, Lawrence Livermore National Security, LLC.
5 Produced at the Lawrence Livermore National Laboratory.
6 Written by Mark C. Miller
7 
8 LLNL-CODE-676051. All rights reserved.
9 
10 This file is part of MACSio
11 
12 Please also read the LICENSE file at the top of the source code directory or
13 folder hierarchy.
14 
15 This program is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License (as published by the Free Software
17 Foundation) version 2, dated June 1991.
18 
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
22 Public License for more details.
23 
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
26 Place, Suite 330, Boston, MA 02111-1307 USA
27 */
28 
29 #include <errno.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 
34 /* error modes */
35 #define MACSIO_CLARGS_WARN 0
36 #define MACSIO_CLARGS_ERROR 1
37 
38 /* route modes */
39 #define MACSIO_CLARGS_TOMEM 0
40 #define MACSIO_CLARGS_TOJSON 1
41 
42 /* default modes */
43 #define MACSIO_CLARGS_ASSIGN_OFF 0
44 #define MACSIO_CLARGS_ASSIGN_ON 0
45 
46 #define MACSIO_CLARGS_HELP -1
47 #define MACSIO_CLARGS_OK 0
48 #define MACSIO_CLARGS_GRP_SEP_STR "macsio_args_group_"
49 #define MACSIO_CLARGS_GRP_BEG MACSIO_CLARGS_GRP_SEP_STR "beg_"
50 #define MACSIO_CLARGS_GRP_END MACSIO_CLARGS_GRP_SEP_STR "end_"
51 #define MACSIO_CLARGS_ARG_GROUP_BEG(GRPNAME) MACSIO_CLARGS_GRP_BEG #GRPNAME, MACSIO_CLARGS_NODEFAULT
52 #define MACSIO_CLARGS_ARG_GROUP_END(GRPNAME) MACSIO_CLARGS_GRP_END #GRPNAME, MACSIO_CLARGS_NODEFAULT, ""
53 #define MACSIO_CLARGS_END_OF_ARGS "macsio_end_of_args"
54 #define MACSIO_CLARGS_NODEFAULT (void*)0
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
61 {
62  unsigned int error_mode : 1;
63  unsigned int route_mode : 2;
64  unsigned int defaults_mode : 1;
66 
67 #warning RE-THINK THESE NAMES
68 extern int MACSIO_CLARGS_ProcessCmdline(void **retobj, MACSIO_CLARGS_ArgvFlags_t flags, int argi, int argc, char **argv, ...);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _UTIL_H */
int MACSIO_CLARGS_ProcessCmdline(void **retobj, MACSIO_CLARGS_ArgvFlags_t flags, int argi, int argc, char **argv,...)
struct _MACSIO_CLARGS_ArgvFlags_t MACSIO_CLARGS_ArgvFlags_t