Lines Matching defs:argv
142 static int do_cmd(LHASH_OF(FUNCTION) *prog,int argc,char *argv[]);
219 # define ARGV _Argv
221 # define ARGV Argv
224 int main(int Argc, char *ARGV[])
235 char **argv,*p;
242 * we bypass this mess, as on non-VMS systems. (See ARGV,
245 * pointers for argv[].
246 * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
248 * duplicate of argv[].
250 * to NULL-terminate a 64-bit argv[]. (As this was written, the
253 * 64-bit argv[argc] for NULL, and, if necessary, use a
254 * (properly) NULL-terminated (64-bit) duplicate of argv[].
255 * The same code is used in either case to duplicate argv[].
260 char **Argv = NULL;
263 if ((sizeof( _Argv) < 8) /* 32-bit argv[]. */
265 || (_Argv[ Argc] != NULL) /* Untrusted argv[argc] not NULL. */
270 Argv = OPENSSL_malloc( (Argc+ 1)* sizeof( char *));
271 if (Argv == NULL)
274 Argv[i] = _Argv[i];
275 Argv[ Argc] = NULL; /* Certain NULL termination. */
280 /* Use the known-good 32-bit argv[] (which needs the
282 * tested-good 64-bit argv[] as-is. */
283 Argv = (char **)_Argv;
366 program_name(Argv[0],pname,sizeof pname);
372 Argv[0]=pname;
373 ret=fp->func(Argc,Argv);
382 Argv++;
383 ret=do_cmd(prog,Argc,Argv);
414 if (!chopup_args(&arg,buf,&argc,&argv)) break;
416 ret=do_cmd(prog,argc,argv);
423 BIO_printf(bio_err,"error in %s\n",argv[0]);
448 /* Free any duplicate Argv[] storage. */
451 OPENSSL_free(Argv);
465 static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
470 if ((argc <= 0) || (argv[0] == NULL))
472 f.name=argv[0];
476 if (EVP_get_digestbyname(argv[0]))
482 else if (EVP_get_cipherbyname(argv[0]))
491 ret=fp->func(argc,argv);
493 else if ((strncmp(argv[0],"no-",3)) == 0)
502 f.name=argv[0]+3;
505 BIO_printf(bio_stdout, "%s\n", argv[0]);
507 BIO_printf(bio_stdout, "%s\n", argv[0]+3);
511 else if ((strcmp(argv[0],"quit") == 0) ||
512 (strcmp(argv[0],"q") == 0) ||
513 (strcmp(argv[0],"exit") == 0) ||
514 (strcmp(argv[0],"bye") == 0))
519 else if ((strcmp(argv[0],LIST_STANDARD_COMMANDS) == 0) ||
520 (strcmp(argv[0],LIST_MESSAGE_DIGEST_COMMANDS) == 0) ||
521 (strcmp(argv[0],LIST_MESSAGE_DIGEST_ALGORITHMS) == 0) ||
522 (strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0) ||
523 (strcmp(argv[0],LIST_CIPHER_ALGORITHMS) == 0) ||
524 (strcmp(argv[0],LIST_PUBLIC_KEY_ALGORITHMS) == 0))
529 if (strcmp(argv[0],LIST_STANDARD_COMMANDS) == 0)
531 else if (strcmp(argv[0],LIST_MESSAGE_DIGEST_COMMANDS) == 0)
533 else if (strcmp(argv[0],LIST_MESSAGE_DIGEST_ALGORITHMS) == 0)
535 else if (strcmp(argv[0],LIST_PUBLIC_KEY_ALGORITHMS) == 0)
537 else if (strcmp(argv[0],LIST_CIPHER_ALGORITHMS) == 0)
539 else /* strcmp(argv[0],LIST_CIPHER_COMMANDS) == 0 */
572 argv[0]);