_EXP_TYPE_ _env_make_NAM_(const _STR_TYPE_ str) { _SIZ_TYPE_ idx; _EXP_TYPE_ nam; for (idx = 1; idx < DCT_top; idx++) { nam = _ag_get_TAB_EXP_(_NAMES_, idx); if (!strcmp(str, _ag_get_TXT_(nam))) return nam; } if (DCT_top > DCT_siz) _error_(_DCT_ERROR_); nam = _ag_make_TXT_(str); _ag_set_TAB_EXP_(_NAMES_, DCT_top++, nam); return nam; }
static char * identifiergenerator (const char *text, int state) { static int len; static _EXP_TYPE_ dct; _EXP_TYPE_ d; char *name, *fulltext, quotechar; int quoted=0; if (!state) { len = strlen (text); fulltext = rl_line_buffer; while (*fulltext) { if (*fulltext=='"' || *fulltext=='\'') if (quoted) { if (quotechar==*fulltext) quoted = 0; } /* the one-statement block keeps the "else" in its place */ else { quoted = 1; quotechar = *fulltext; } fulltext++; } if (quoted) return NULL; else dct = _DCT_; } while (!_ag_is_VOI_(dct)) { name = _ag_get_TXT_(_ag_get_DCT_NAM_(dct)); dct = _ag_get_DCT_DCT_(dct); if (strncmp (name, text, len) == 0) { for (d = _DCT_; _ag_get_DCT_NAM_(d).raw != _ag_get_DCT_NAM_(dct).raw; d = _ag_get_DCT_DCT_(d)); if (d.raw == dct.raw) return strcpy(xmalloc(strlen(name)+1),name); } } return NULL; }
_NIL_TYPE_ _error_msg_(const _RES_TYPE_ err, const _EXP_TYPE_ txt) { _error_str_(err, _ag_get_TXT_(txt)); }