Options.cxx revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Derived from comp.sources.unix/volume3/att_getopt.
// See
#ifndef Options_DEF_INCLUDED
#define Options_DEF_INCLUDED 1
#ifndef OPTION_CHAR
#define OPTION_CHAR T('-')
#endif
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
template<class T>
{
}
template<class T>
{
for (const T *s = opts_; *s; s++)
if (*s == c)
return s;
return 0;
}
template<class T>
{
const T *cp;
if (sp_ == 1) {
return false;
if ((
#ifdef OTHER_OPTION_CHAR
#endif
#ifdef REORDER_ARGS
int i;
if ((
#ifdef OTHER_OPTION_CHAR
argv_[i][0] == OTHER_OPTION_CHAR ||
#endif
break;
if (i < argc_) {
c = argv_[i][1];
if (c != T(':') && c != OPTION_CHAR
int j;
for (j = i - 1; j >= ind_; j--)
}
else {
int j;
for (j = i - 1; j >= ind_; j--)
}
}
else
#endif
return false;
}
#ifdef OTHER_OPTION_CHAR
#endif
) {
ind_++;
return false;
}
}
ind_++;
sp_ = 1;
}
c = T('?');
return true;
}
if (*++cp == T(':')) {
sp_ = 1;
return true;
}
else
sp_ = 1;
}
else {
sp_ = 1;
ind_++;
}
arg_ = 0;
}
return true;
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* not Options_DEF_INCLUDED */