|
|
|
|
| |
When writing your own applications, if a given program also defines codes for other options, make sure these OPT_SSL_XXX symbols have different values than those codes.
The SSL-related option structures in sslopt-longopts.h refer to a set of variables that are used to hold the option values. To declare these, use an #include directive to include the contents of the sslopt-vars.h file into your program preceding the definition of the my_opts array. sslopt-vars.h looks like this:
#ifdef HAVE_OPENSSL
static my_bool opt_use_ssl = 0;
static char *opt_ssl_key = 0;
static char *opt_ssl_cert = 0;
static char *opt_ssl_ca = 0;
static char *opt_ssl_capath = 0;
static char *opt_ssl_cipher = 0;
#endif
In the get_one_option() routine, add a line that includes the sslopt-case.h file:
my_bool
get_one_option (int optid, const struct my_option *opt, char *argument)
{
switch (optid)
{
case '?':
my_print_help (my_opts); /* print help message */
exit (0);
case 'p': /* password */
if (!argument) /* no value given, so solicit it later */
ask_password = 1;
else /* copy password, wipe out original */
{
opt_password = strdup (argument);
if (opt_password == NULL)
{
print_error (NULL, "could not allocate password buffer");
exit (1);
}
while (*argument)
*argument++ = 'x';
}
break;
#include < sslopt-case.h>
}
return (0);
}
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|