#ifndef _MAIN_C # include # include "Ctypes.h" #endif short CharTable[256]; static void SetCharTable(int flag, const unsigned char *characters) { size_t idx; for (idx=0; characters[idx]; idx++) CharTable[characters[idx]] |= flag; } void InitCharTable(void) { /* Zero CharTable */ memset(CharTable, 0, sizeof(CharTable)); /* Fill in our types */ /* White Space */ SetCharTable(WHITES, " \t\r\n\v\014"); /* alphas */ SetCharTable(UALPHA, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); SetCharTable(LALPHA, "abcdefghijklmnopqrstuvwxyz"); /* digits */ SetCharTable(DIGITS, "0123456789"); /* xalphas */ SetCharTable(XCHARS, "$_@!%^&*()."); /* search */ SetCharTable(SCHARS, "+?"); /* Path */ SetCharTable(PCHARS, "/:#"); /* Set Shunned characters */ { int i; for (i=0; i <= 31; i++) CharTable[FROMISO(i)] |= SHUNCH; CharTable[FROMISO(127)] |= SHUNCH; CharTable[FROMISO(255)] |= SHUNCH; } }