MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / CLIB_ROUTINE main

Function CLIB_ROUTINE main

src/msgs/build_file.cpp:100–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100int CLIB_ROUTINE main(int argc, char** argv)
101{
102/**************************************
103 *
104 * m a i n
105 *
106 **************************************
107 *
108 * Functional description
109 * Top level routine.
110 *
111 **************************************/
112 TEXT filename[MAXPATHLEN] = "";
113 TEXT gen_c_filename[MAXPATHLEN] = "";
114 TEXT gen_pas_filename[MAXPATHLEN] = "";
115
116 const TEXT* const* const end_args = argv + argc;
117
118 for (++argv; argv < end_args;)
119 {
120 const TEXT* p = *argv++;
121 bool sw_bad = false;
122
123 if (*p != '-')
124 sw_bad = true;
125 else
126 {
127 switch (UPPER(p[1]))
128 {
129 case 'F':
130 if (argv >= end_args)
131 sw_bad = true;
132 else
133 copy_terminate(filename, *argv++, MAXPATHLEN);
134 break;
135
136 case 'C':
137 if (argv >= end_args)
138 sw_bad = true;
139 else
140 copy_terminate(gen_c_filename, *argv++, MAXPATHLEN);
141 break;
142
143 case 'P':
144 if (argv >= end_args)
145 sw_bad = true;
146 else
147 copy_terminate(gen_pas_filename, *argv++, MAXPATHLEN);
148 break;
149
150 default:
151 sw_bad = true;
152 }
153 }
154
155 if (sw_bad)
156 {
157 printf("Invalid option \"%s\". Valid options are:\n", p);

Callers

nothing calls this directly

Calls 5

do_msgsFunction · 0.85
do_codesFunction · 0.85
copy_terminateFunction · 0.70
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected