/* * str_getch() * takes care of reading from multiple strings. * returns the next-char from the input stream. * returns EOF when the complete shader is parsed. */ static int str_getch(StringInputSrc *in) { for(;;){ if (*in->p){ if (*in->p == '\n') { in->base.line++; IncLineNumber(); } return *in->p++; } if(++(cpp->PaWhichStr) < cpp->PaArgc){ free(in); SetStringNumber(cpp->PaWhichStr); SetLineNumber(1); ScanFromString(cpp->PaArgv[cpp->PaWhichStr]); in=(StringInputSrc*)cpp->currentInput; continue; } else{ cpp->currentInput = in->base.prev; cpp->PaWhichStr=0; free(in); return EOF; } } } // str_getch
int InitScannerInput(CPPStruct *cpp, int count, const char* const string[], const int length[]) { cpp->PaWhichStr = 0; cpp->PaArgv = string; cpp->PaArgc = count; cpp->PaStrLen = length; ScanFromString(string[0]); return 0; }
CDateTime::CDateTime( const char* szTime ) : m_dtsTime() { SetNow(); EDTFORMAT edtfFormat = DetermineFormat( szTime ); ScanFromString( szTime, edtfFormat ); }