82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
*iter->isSpecifiedPtr = false;
if (iter->argumentPtr)
*iter->argumentPtr = nil;
count++;
}
_longOptions = [[OFMapTable alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions];
_options = [self
allocMemoryWithSize: sizeof(*_options)
count: count + 1];
for (iter = options, iter2 = _options;
iter->shortOption != '\0' || iter->longOption != nil;
iter++, iter2++) {
iter2->shortOption = iter->shortOption;
iter2->longOption = nil;
iter2->hasArgument = iter->hasArgument;
|
>
<
<
<
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
*iter->isSpecifiedPtr = false;
if (iter->argumentPtr)
*iter->argumentPtr = nil;
count++;
}
_options = of_malloc(count + 1, sizeof(*_options));
_longOptions = [[OFMapTable alloc]
initWithKeyFunctions: keyFunctions
objectFunctions: objectFunctions];
for (iter = options, iter2 = _options;
iter->shortOption != '\0' || iter->longOption != nil;
iter++, iter2++) {
iter2->shortOption = iter->shortOption;
iter2->longOption = nil;
iter2->hasArgument = iter->hasArgument;
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
return self;
}
- (void)dealloc
{
of_options_parser_option_t *iter;
[_longOptions release];
if (_options != NULL)
for (iter = _options;
iter->shortOption != '\0' || iter->longOption != nil;
iter++)
[iter->longOption release];
|
>
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
return self;
}
- (void)dealloc
{
of_options_parser_option_t *iter;
free(_options);
[_longOptions release];
if (_options != NULL)
for (iter = _options;
iter->shortOption != '\0' || iter->longOption != nil;
iter++)
[iter->longOption release];
|