2002-07-23 13:31:04 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
2011-02-16 17:25:01 +00:00
|
|
|
#include <openssl/crypto.h>
|
2002-07-23 13:31:04 +00:00
|
|
|
#include <openssl/e_os2.h>
|
|
|
|
#include <openssl/buffer.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
|
|
|
char *p, *q = 0, *program;
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
p = strrchr(argv[0], '/');
|
|
|
|
if (!p)
|
|
|
|
p = strrchr(argv[0], '\\');
|
2002-07-23 13:31:04 +00:00
|
|
|
#ifdef OPENSSL_SYS_VMS
|
2015-01-22 03:40:55 +00:00
|
|
|
if (!p)
|
|
|
|
p = strrchr(argv[0], ']');
|
|
|
|
if (p)
|
|
|
|
q = strrchr(p, '>');
|
|
|
|
if (q)
|
|
|
|
p = q;
|
|
|
|
if (!p)
|
|
|
|
p = strrchr(argv[0], ':');
|
|
|
|
q = 0;
|
2002-07-23 13:31:04 +00:00
|
|
|
#endif
|
2015-01-22 03:40:55 +00:00
|
|
|
if (p)
|
|
|
|
p++;
|
|
|
|
if (!p)
|
|
|
|
p = argv[0];
|
|
|
|
if (p)
|
|
|
|
q = strchr(p, '.');
|
|
|
|
if (p && !q)
|
|
|
|
q = p + strlen(p);
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
if (!p)
|
|
|
|
program = BUF_strdup("(unknown)");
|
|
|
|
else {
|
|
|
|
program = OPENSSL_malloc((q - p) + 1);
|
|
|
|
strncpy(program, p, q - p);
|
|
|
|
program[q - p] = '\0';
|
|
|
|
}
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
for (p = program; *p; p++)
|
|
|
|
if (islower((unsigned char)(*p)))
|
|
|
|
*p = toupper((unsigned char)(*p));
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
q = strstr(program, "TEST");
|
|
|
|
if (q > p && q[-1] == '_')
|
|
|
|
q--;
|
|
|
|
*q = '\0';
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
printf("No %s support\n", program);
|
2002-07-23 13:31:04 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
OPENSSL_free(program);
|
|
|
|
return (0);
|
|
|
|
}
|