Initialize Tizen 2.3
[external/popt.git] / auto / types.in
1 <?xml version="1.0" encoding="UTF-8"?>
2 <collection>
3
4 <spec_type>
5   <kind> common_env </kind>
6   <global_code>
7     static int aVal = 141421;
8     static unsigned int aFlag = 0x8aceU;
9
10     static short aShort = (short)4523;
11     static int aInt = 271828;
12     static long aLong = 738905609L;
13     static long long aLongLong = 738905609LL;
14     static float aFloat = 3.1415926535;
15     static double aDouble = 9.86960440108935861883;
16     static const char ** aArgv = NULL;
17
18     static struct poptOption optionsTable[] = {
19       { "val", '\0', POPT_ARG_VAL | POPT_ARGFLAG_SHOW_DEFAULT, &aVal, 125992,
20         "POPT_ARG_VAL: 125992 141421", 0},
21       { "int", 'i', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &aInt, 0,
22         "POPT_ARG_INT: 271828", NULL },
23       { "short", 's', POPT_ARG_SHORT | POPT_ARGFLAG_SHOW_DEFAULT, &aShort, 0,
24         "POPT_ARG_SHORT: 4523", NULL },
25       { "long", 'l', POPT_ARG_LONG | POPT_ARGFLAG_SHOW_DEFAULT, &aLong, 0,
26         "POPT_ARG_LONG: 738905609", NULL },
27       { "longlong", 'L', POPT_ARG_LONGLONG | POPT_ARGFLAG_SHOW_DEFAULT, &aLongLong, 0,
28         "POPT_ARG_LONGLONG: 738905609", NULL },
29       { "float", 'f', POPT_ARG_FLOAT | POPT_ARGFLAG_SHOW_DEFAULT, &aFloat, 0,
30         "POPT_ARG_FLOAT: 3.14159", NULL },
31       { "double", 'd', POPT_ARG_DOUBLE | POPT_ARGFLAG_SHOW_DEFAULT, &aDouble, 0,
32         "POPT_ARG_DOUBLE: 9.8696", NULL },
33       { "argv", '\0', POPT_ARG_ARGV, &aArgv, 0,
34         "POPT_ARG_ARGV: append string to argv array (can be used multiple times)","STRING"},
35       POPT_AUTOALIAS
36       POPT_AUTOHELP
37       POPT_TABLEEND
38     };
39   </global_code>
40 </spec_type>
41
42 <spec_type>
43   <kind> common_param </kind>
44   <data_type> poptContext </data_type>
45   <value> poptGetContext(argv[0], argc, argv, optionsTable, 0) </value>
46   <final_code>
47     $0 = poptFreeContext($0);
48   </final_code>
49   <associating>
50     <except>
51       poptAddItem       <!-- FIXME -->
52     </except>
53   </associating>
54 </spec_type>
55 <spec_type>
56   <kind> normal </kind>
57   <data_type> poptContext </data_type>
58   <value> poptGetContext(argv[0], argc, argv, optionsTable, 0) </value>
59   <associating>
60     <interfaces>
61       poptFreeContext
62       poptFini
63     </interfaces>
64     <links> param1 </links>
65   </associating>
66 </spec_type>
67 <spec_type>
68   <kind> normal </kind>
69   <data_type> poptItem </data_type>
70   <value> NULL </value>
71   <global_code>
72     #include <malloc.h>
73   </global_code>
74   <init_code>
75     $0 = calloc(1, sizeof(*$0));
76     $0->option = *poptHelpOptionsI18N;
77     $0->argc = 1;
78     $0->argv = calloc(2, sizeof(*$0->argv));
79     $0->argv[0] = strdup("arg1");
80   </init_code>
81   <associating>
82     <interfaces> poptAddItem </interfaces>
83     <links> param2 </links>
84   </associating>
85 </spec_type>
86
87 <spec_type>
88   <kind> common_param </kind>
89   <data_type> struct poptAlias </data_type>
90   <value> _alias </value>
91   <global_code>
92     #include <malloc.h>
93     static struct poptAlias _alias = {
94       .longName = "longName",
95       .shortName = 'l',
96       .argc = 0,
97       .argv = NULL
98     };
99   </global_code>
100   <init_code>
101     $0.argc = 1;
102     $0.argv = calloc($0.argc + 1, sizeof(*$0.argv));
103     $0.argv[0] = strdup("arg1");
104   </init_code>
105 </spec_type>
106
107 <spec_type>
108   <kind> common_param </kind>
109   <name> poptBits </name>
110   <data_type> poptBits </data_type>
111   <value>
112     create_poptBits()
113   </value>
114   <global_code>
115     poptBits create_poptBits()
116     {
117         poptBits a = NULL;
118         (void) poptSaveBits(&a, 0, "foo");
119         (void) poptSaveBits(&a, 0, "bar");
120         (void) poptSaveBits(&a, 0, "baz");
121         return a;
122     }
123   </global_code>
124 </spec_type>
125
126 <spec_type>
127   <kind> normal </kind>
128   <data_type> const char *** </data_type>
129   <value> &av </value>
130   <global_code>
131     #include <malloc.h>
132   </global_code>
133   <init_code>
134     const char ** av = NULL;
135   </init_code>
136   <final_code>
137     free(av[0]);
138     free(av);
139   </final_code>
140   <associating>
141     <interfaces> poptSaveString </interfaces>
142     <links> param1 </links>
143   </associating>
144 </spec_type>
145
146 </collection>
147