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

Function main

examples/dbcrypt/CryptApplication.cpp:223–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223int main(int ac, char** av)
224{
225 App::Action act = App::NONE;
226
227 if (ac < 2 || ac > 3)
228 return usage();
229
230 if (ac == 3)
231 {
232 if (av[1][0] != '-')
233 return usage();
234
235 switch(av[1][1])
236 {
237 case 'e':
238 act = App::ENC;
239 break;
240 case 'd':
241 act = App::DEC;
242 break;
243 case 'l':
244 act = App::EX_LCL;
245 break;
246 case 'r':
247 act = App::EX_RMT;
248 break;
249 default:
250 return usage();
251 }
252 av++;
253 }
254
255#ifdef WIN_NT
256 _putenv_s("ISC_USER", "sysdba");
257 _putenv_s("ISC_PASSWORD", "masterkey");
258#else
259 setenv("ISC_USER", "sysdba", 0);
260 setenv("ISC_PASSWORD", "masterkey", 0);
261#endif
262
263 App app;
264 try
265 {
266 app.execute(av[1], act);
267 }
268 catch (const char* where)
269 {
270 app.print(where);
271 return 1;
272 }
273
274 return 0;
275}

Callers

nothing calls this directly

Calls 4

setenvFunction · 0.85
usageFunction · 0.70
executeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected