4
* Copyright 2008 Massachusetts Institute of Technology.
7
* Export of this software from the United States of America may
8
* require a specific license from the United States Government.
9
* It is the responsibility of any person or organization contemplating
10
* export to obtain such a license before exporting.
12
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13
* distribute this software and its documentation for any purpose and
14
* without fee is hereby granted, provided that the above copyright
15
* notice appear in all copies and that both that copyright notice and
16
* this permission notice appear in supporting documentation, and that
17
* the name of M.I.T. not be used in advertising or publicity pertaining
18
* to distribution of the software without specific, written prior
19
* permission. Furthermore if you modify this software you must label
20
* your software as modified software and not distribute it in such a
21
* fashion that it might be confused with the original M.I.T. software.
22
* M.I.T. makes no representations about the suitability of
23
* this software for any purpose. It is provided "as is" without express
24
* or implied warranty.
41
if (!(o->pszString = new char[lstrlenA(opts.pszString) + 1]))
43
if (!(o->pszEndpoint = new char[lstrlenA(opts.pszEndpoint) + 1]))
45
strcpy(o->pszString, opts.pszString);
46
strcpy(o->pszEndpoint, opts.pszEndpoint);
63
delete [] o->pszString;
65
delete [] o->pszEndpoint;
72
ParseOpts::IsValidOpt(
76
return (m_ValidOpts[ch % 256] != 0);
86
fprintf(stderr, " -%c %s\n", ch, text);
95
fprintf(stderr, "Usage: %s [options]\n", program);
96
PrintOpt('k', "stop server");
97
#ifdef CCAPI_TEST_OPTIONS
98
PrintOpt('s', "string");
99
PrintOpt('e', "endpoint");
100
PrintOpt('m', "maxcalls");
101
PrintOpt('n', "mincalls");
102
PrintOpt('f', "flag_wait_op");
103
PrintOpt('u', "unprotected");
104
PrintOpt('b', "use security callback");
106
PrintOpt('c', "output debug info to console");
111
ParseOpts::SetValidOpts(
115
memset(m_ValidOpts, 0, sizeof(m_ValidOpts));
116
char *p = valid_opts;
117
for (p = valid_opts; *p; p++) {
118
m_ValidOpts[*p % sizeof(m_ValidOpts)] = 1;
130
for (i = 1; i < argc; i++) {
131
if ((*argv[i] == '-') || (*argv[i] == '/')) {
132
char ch = tolower(*(argv[i]+1));
137
opts.bShutdown = TRUE;
139
#ifdef CCAPI_TEST_OPTIONS
141
opts.pszString = argv[++i];
144
opts.pszEndpoint = argv[++i];
147
opts.cMaxCalls = (unsigned int) atoi(argv[++i]);
150
opts.cMinCalls = (unsigned int) atoi(argv[++i]);
153
opts.fDontWait = (unsigned int) atoi(argv[++i]);
156
opts.bDontProtect = TRUE;
159
opts.bSecCallback = TRUE;
163
opts.bConsole = TRUE;
177
ParseOpts::ParseOpts(char* valid_opts)
179
SetValidOpts(valid_opts);
182
ParseOpts::ParseOpts()
186
ParseOpts::~ParseOpts()