-/* $OpenBSD: apps.c,v 1.14 2014/12/14 14:42:06 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.15 2014/12/28 14:21:42 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
break;
case OPTION_ARG_FUNC:
- if (opt->func(opt, argv[i]) != 0)
+ if (opt->opt.argfunc(argv[i]) != 0)
return (1);
break;
break;
case OPTION_FUNC:
- if (opt->func(opt, NULL) != 0)
+ if (opt->opt.func() != 0)
return (1);
break;
-/* $OpenBSD: apps.h,v 1.9 2014/12/14 14:42:06 jsing Exp $ */
+/* $OpenBSD: apps.h,v 1.10 2014/12/28 14:21:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
} type;
union {
char **arg;
+ int (*argfunc)(char *arg);
int *flag;
+ int (*func)(void);
int *value;
} opt;
- int (*func)(struct option *opt, char *arg);
const int value;
};
-/* $OpenBSD: ecparam.c,v 1.6 2014/12/14 14:45:33 jsing Exp $ */
+/* $OpenBSD: ecparam.c,v 1.7 2014/12/28 14:21:42 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
} ecparam_config;
static int
-ecparam_opt_form(struct option *opt, char *arg)
+ecparam_opt_form(char *arg)
{
if (strcmp(arg, "compressed") == 0)
ecparam_config.form = POINT_CONVERSION_COMPRESSED;
}
static int
-ecparam_opt_enctype(struct option *opt, char *arg)
+ecparam_opt_enctype(char *arg)
{
if (strcmp(arg, "explicit") == 0)
ecparam_config.asn1_flag = 0;
.desc = "Specify point conversion form:\n"
" compressed, uncompressed (default), hybrid",
.type = OPTION_ARG_FUNC,
- .func = ecparam_opt_form,
+ .opt.argfunc = ecparam_opt_form,
},
#ifndef OPENSSL_NO_ENGINE
{
.desc = "Specify EC parameter ASN.1 encoding type:\n"
" explicit, named_curve (default)",
.type = OPTION_ARG_FUNC,
- .func = ecparam_opt_enctype,
+ .opt.argfunc = ecparam_opt_enctype,
},
{
.name = "text",
-/* $OpenBSD: version.c,v 1.3 2014/10/13 02:46:14 bcook Exp $ */
+/* $OpenBSD: version.c,v 1.4 2014/12/28 14:21:42 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
} version_config;
static int
-version_all_opts(struct option *opt, char *arg)
+version_all_opts(void)
{
version_config.cflags = 1;
version_config.date = 1;
.name = "a",
.desc = "All information (same as setting all other flags)",
.type = OPTION_FUNC,
- .func = version_all_opts,
+ .opt.func = version_all_opts,
},
{
.name = "b",