Lines Matching refs:pnt

108 static const char * get_string( const char * pnt, char ** label )  in get_string()  argument
112 word = pnt; in get_string()
115 if ( *pnt == '\0' || *pnt == ' ' || *pnt == '\t' ) in get_string()
117 pnt++; in get_string()
120 *label = malloc( pnt - word + 1 ); in get_string()
121 memcpy( *label, word, pnt - word ); in get_string()
122 (*label)[pnt - word] = '\0'; in get_string()
124 if ( *pnt != '\0' ) in get_string()
125 pnt++; in get_string()
126 return pnt; in get_string()
135 static const char * get_qstring( const char * pnt, char ** label ) in get_qstring() argument
144 if ( *pnt == '\0' ) in get_qstring()
145 return pnt; in get_qstring()
146 quote_char = *pnt++; in get_qstring()
155 if ( *pnt == '\0' ) in get_qstring()
157 if ( *pnt == quote_char && pnt[-1] != '\\' ) in get_qstring()
161 if ( *pnt == '"' || *pnt == '\'' || *pnt == '[' || *pnt == ']' ) in get_qstring()
163 *pnt1++ = *pnt++; in get_qstring()
172 pnt++; in get_qstring()
173 while ( *pnt == ' ' || *pnt == '\t' ) in get_qstring()
174 pnt++; in get_qstring()
175 return pnt; in get_qstring()
184 static const char * get_qnqstring( const char * pnt, char ** label ) in get_qnqstring() argument
188 while ( *pnt == ' ' || *pnt == '\t' ) in get_qnqstring()
189 pnt++; in get_qnqstring()
191 if ( *pnt == '\0' ) in get_qnqstring()
192 return pnt; in get_qnqstring()
193 quote_char = *pnt; in get_qnqstring()
195 return get_qstring( pnt, label ); in get_qnqstring()
197 return get_string( pnt, label ); in get_qnqstring()
205 static struct condition * tokenize_if( const char * pnt ) in tokenize_if() argument
212 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_if()
213 pnt++; in tokenize_if()
214 if ( *pnt != '[' ) in tokenize_if()
216 pnt++; in tokenize_if()
224 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_if()
225 pnt++; in tokenize_if()
226 if ( *pnt == '\0' ) in tokenize_if()
228 if ( *pnt == ']' ) in tokenize_if()
240 if ( *pnt == '-' && pnt[1] == 'a' ) in tokenize_if()
244 cond->op = op_and; pnt += 2; continue; in tokenize_if()
247 if ( *pnt == '-' && pnt[1] == 'o' ) in tokenize_if()
251 cond->op = op_or; pnt += 2; continue; in tokenize_if()
254 if ( *pnt == '!' && pnt[1] == '=' ) in tokenize_if()
258 cond->op = op_neq; pnt += 2; continue; in tokenize_if()
261 if ( *pnt == '=' ) in tokenize_if()
265 cond->op = op_eq; pnt += 1; continue; in tokenize_if()
268 if ( *pnt == '!' ) in tokenize_if()
273 cond->op = op_bang; pnt += 1; continue; in tokenize_if()
276 if ( *pnt == '"' ) in tokenize_if()
283 pnt++; in tokenize_if()
284 if ( *pnt == '$' ) in tokenize_if()
285 { cond->op = op_variable; pnt++; } in tokenize_if()
290 word = pnt; in tokenize_if()
293 if ( *pnt == '\0' ) in tokenize_if()
295 if ( *pnt == '"' ) in tokenize_if()
297 pnt++; in tokenize_if()
302 char * str = malloc( pnt - word + 1 ); in tokenize_if()
303 memcpy( str, word, pnt - word ); in tokenize_if()
304 str [pnt - word] = '\0'; in tokenize_if()
316 pnt++; in tokenize_if()
332 const char * pnt ) in tokenize_choices() argument
341 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_choices()
342 pnt++; in tokenize_choices()
343 if ( *pnt == '\0' ) in tokenize_choices()
344 return pnt; in tokenize_choices()
357 pnt = get_string( pnt, &cfg->label ); in tokenize_choices()
365 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_choices()
366 pnt++; in tokenize_choices()
367 pnt = get_string( pnt, &buffer ); in tokenize_choices()
372 return pnt; in tokenize_choices()
380 static void tokenize_line( const char * pnt ) in tokenize_line() argument
389 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
390 pnt++; in tokenize_line()
397 if (strncmp(pnt, s, strlen(s)) == 0) { token = t; pnt += strlen(s); break; } in tokenize_line()
400 switch ( *pnt ) in tokenize_line()
471 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
472 pnt++; in tokenize_line()
473 do_source( pnt ); in tokenize_line()
508 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
509 pnt++; in tokenize_line()
519 pnt = get_qstring ( pnt, &cfg->label ); in tokenize_line()
520 pnt = get_string ( pnt, &buffer ); in tokenize_line()
529 pnt = get_qstring ( pnt, &cfg->label ); in tokenize_line()
530 pnt = get_qstring ( pnt, &choice_list ); in tokenize_line()
531 pnt = get_string ( pnt, &cfg->value ); in tokenize_line()
539 pnt = get_qstring(pnt, &cfg->label); in tokenize_line()
542 pnt = get_qstring(pnt, &cfg->label); in tokenize_line()
552 pnt = get_string( pnt, &buffer ); in tokenize_line()
554 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
555 pnt++; in tokenize_line()
556 if ( ( pnt[0] == 'Y' || pnt[0] == 'M' || pnt[0] == 'N' in tokenize_line()
557 || pnt[0] == 'y' || pnt[0] == 'm' || pnt[0] == 'n' ) in tokenize_line()
558 && ( pnt[1] == '\0' || pnt[1] == ' ' || pnt[1] == '\t' ) ) in tokenize_line()
560 if ( *pnt == 'n' || *pnt == 'N' ) cfg->value = strdup( "CONSTANT_N" ); in tokenize_line()
561 else if ( *pnt == 'y' || *pnt == 'Y' ) cfg->value = strdup( "CONSTANT_Y" ); in tokenize_line()
562 else if ( *pnt == 'm' || *pnt == 'M' ) cfg->value = strdup( "CONSTANT_M" ); in tokenize_line()
564 else if ( *pnt == '$' ) in tokenize_line()
566 pnt++; in tokenize_line()
567 pnt = get_string( pnt, &cfg->value ); in tokenize_line()
578 pnt = get_string( pnt, &buffer ); in tokenize_line()
580 pnt = get_string( pnt, &cfg->value ); in tokenize_line()
584 pnt = get_string( pnt, &buffer ); in tokenize_line()
586 pnt = get_qnqstring( pnt, &cfg->value ); in tokenize_line()
594 pnt = get_qstring ( pnt, &cfg->label ); in tokenize_line()
595 pnt = get_string ( pnt, &buffer ); in tokenize_line()
598 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
599 pnt++; in tokenize_line()
607 if ( ( pnt[0] == 'Y' || pnt[0] == 'M' || pnt[0] == 'N' in tokenize_line()
608 || pnt[0] == 'y' || pnt[0] == 'm' || pnt[0] == 'n' ) in tokenize_line()
609 && ( pnt[1] == '\0' || pnt[1] == ' ' || pnt[1] == '\t' ) ) in tokenize_line()
612 if ( pnt[0] == 'Y' || pnt[0] == 'y' ) in tokenize_line()
614 else if ( pnt[0] == 'N' || pnt[0] == 'n' ) in tokenize_line()
618 pnt++; in tokenize_line()
621 else if ( *pnt == '$' ) in tokenize_line()
623 pnt++; in tokenize_line()
624 pnt = get_string( pnt, &(*dep_ptr)->name ); in tokenize_line()
632 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
633 pnt++; in tokenize_line()
634 } while ( *pnt ); in tokenize_line()
691 pnt = get_qstring ( pnt, &cfg->label ); in tokenize_line()
692 pnt = get_string ( pnt, &buffer ); in tokenize_line()
694 pnt = get_string ( pnt, &cfg->value ); in tokenize_line()
698 pnt = get_qstring ( pnt, &cfg->label ); in tokenize_line()
699 pnt = get_string ( pnt, &buffer ); in tokenize_line()
701 pnt = get_qnqstring ( pnt, &cfg->value ); in tokenize_line()
707 cfg->cond = tokenize_if( pnt ); in tokenize_line()
711 pnt = get_qstring( pnt, &cfg->label ); in tokenize_line()
715 if ( strncmp( pnt, "next_comment", 12 ) == 0 ) in tokenize_line()
718 pnt = get_qstring( pnt, &cfg->label ); in tokenize_line()
722 pnt = get_string( pnt, &buffer ); in tokenize_line()
724 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
725 pnt++; in tokenize_line()
726 while (*pnt) in tokenize_line()
732 pnt = get_string( pnt, &buffer ); in tokenize_line()
734 while ( *pnt == ' ' || *pnt == '\t' ) in tokenize_line()
735 pnt++; in tokenize_line()
783 char * pnt; in do_source() local
792 pnt = buffer + strlen(buffer) - 1; in do_source()
793 if ( *pnt == '\n' ) in do_source()
794 *pnt-- = '\0'; in do_source()
797 if ( *pnt == '\\' ) in do_source()
799 offset = pnt - buffer; in do_source()