void GetQuoteStr(short maxlen) { unsigned int v = 0; short c=0; if (*FilePtr++ != '"') Error(Error_Skip, "String has missing '\"'"); while (1) { v = *FilePtr++; if (v == 0 || v == 13) Error(Error_Skip, "string not terminated correctly"); if (v == '\"') break; if (v == '\\') { v = GetEscCode(); } WriteByte(v); if (c++ >= maxlen) Error(Error_Skip, "string exceeded maximum length"); } return; }
void GetStringName(int maxlen) { unsigned int v = 0; int c = 0; char *NamePtr = Name; if (*FilePtr++ != '"') Error(Error_Skip, "String has missing '\"'"); if (maxlen >= NAME_MAX) Error(Error_Fatal, "Demands of string size too high"); while (1) { v = *FilePtr++; if (v == 0 || v == 13) Error(Error_Skip, "string not terminated correctly"); if (v == '\"') break; if (v == '\\') v = GetEscCode(); *NamePtr++ = (char)v; if (c++ >= NAME_MAX) Error(Error_Skip, "string exceeded maximum length"); } *NamePtr++ = 0; return; }
int GetNum() { register unsigned int v = 0; if (Token("'")) // found « { if (Token("\\")) // Test "\" { v = GetEscCode(); NeedToken("\'"); return v; } v = GetCharNum(); NeedToken("\'"); return v; } if (*FilePtr == '0' && (*(FilePtr+1) =='x' || *(FilePtr+1) == 'X')) { FilePtr+=2; return GetHexNum(16); } return GetDecNum(16); }