|
samba unix风格的配置文件配置信息读取C代码.(7) * considered end-of-file markers. * * ------------------------------------------------------------------------ ** */ { int c; for( c = mygetc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = mygetc( InFile ) ) ; return( c ); } /* EatComment */ /***************************************************************************** * Scan backards within a string to discover if the last non-whitespace * character is a line-continuation character ('\\'). * * Input: line - A pointer to a buffer containing the string to be * scanned. * pos - This is taken to be the offset of the end of the * string. This position is *not* scanned. * * Output: The offset of the '\\' character if it was found, or -1 to * indicate that it was not. * *****************************************************************************/ static int Continuation( char *line, int pos ) { int pos2 = 0; pos--; while( (pos >= 0) && isspace((int)line[pos]) ) pos--; /* we should recognize if `\` is part of a multibyte character or not. */ while(pos2 <= pos) { size_t skip = 0; skip = get_character_len(line[pos2]); if (skip) { pos2 += skip; } else if (pos == pos2) {
|