CharsetInfo.cxx revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1994, 1997 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __GNUG__
#pragma implementation
#endif
#include "splib.h"
#include "CharsetInfo.h"
#include "ISet.h"
#include "constant.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
{
// FIXME remove mappings from desc for characters greater charMax
init();
}
{
}
{
init();
}
void CharsetInfo::init()
{
else
for (;;) {
if (n == Unsigned32(-1))
else if (n != Unsigned32(-2))
break;
}
}
}
// These are the characters that the ANSI C
// standard guarantees will be in the basic execution
// character set.
static char execChars[] =
"\t\n\r "
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"!\"#%&'()*+,-./:"
";<=>?[\\]^_{|}~";
// These are the corresponding ISO 646 codes.
static char univCodes[] = {
9, 10, 13, 32,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58,
59, 60, 61, 62, 63, 91, 92, 93, 94, 95, 123, 124, 125, 126,
};
WideChar c;
}
}
{
break;
}
}
{
for (int i = 0; i < 10; i++)
if (c == execToDesc('0' + i))
return i;
return -1;
}
{
for (int i = 0; i < 10; i++)
if (c == execToDesc('0' + i))
return i;
for (int i = 0; i < 6; i++)
return i + 10;
return -1;
}
{
while (*s != '\0')
result += execToDesc(*s++);
return result;
}
#ifdef SP_NAMESPACE
}
#endif