1.1 --- a/src/tools/actparse.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/tools/actparse.c Mon Jul 28 04:51:04 2008 +0000
1.5 // Strip c-style comments
1.7 - if( *p == '/' && *(p+1) == '*' ) {
1.10 - if( *p == '*' && *(p+1) == '/' ) {
1.16 - } else if( *p == '/' && *(p+1) == '/' ) {
1.18 - while( *p && *p != '\n' ) {
1.24 + if( *p == '/' && *(p+1) == '*' ) {
1.27 + if( *p == '*' && *(p+1) == '/' ) {
1.33 + } else if( *p == '/' && *(p+1) == '/' ) {
1.35 + while( *p && *p != '\n' ) {
1.43 strcpy( operation, g_strstrip(opclean) );
1.45 for( i=0; i<rules->rule_count; i++ ) {
1.46 - if( strcasecmp(rules->rules[i]->format, operation) == 0 ) {
1.47 - if( actions->actions[i] != NULL ) {
1.48 - fprintf( stderr, "Duplicate actions for operation '%s'\n", operation );
1.51 - actions->actions[i] = act;
1.54 + if( strcasecmp(rules->rules[i]->format, operation) == 0 ) {
1.55 + if( actions->actions[i] != NULL ) {
1.56 + fprintf( stderr, "Duplicate actions for operation '%s'\n", operation );
1.59 + actions->actions[i] = act;
1.63 fprintf(stderr, "No operation found matching '%s'\n", operation );
1.69 struct actionset *parse_action_file( struct ruleset *rules, FILE *f )
1.77 memset( actions, 0, sizeof( struct actionset ) );
1.78 /* Read whole file in (for convenience) */
1.79 fstat( fileno(f), &st );
1.82 actions->pretext = text;
1.83 for( i=0; i<length; i++ ) {
1.84 - if( text[i] == '\n' ) {
1.86 - if( i+3 < length && text[i+1] == '%' && text[i+2] == '%' ) {
1.92 + if( text[i] == '\n' ) {
1.94 + if( i+3 < length && text[i+1] == '%' && text[i+2] == '%' ) {
1.102 char *operation = &text[i];
1.103 for( ; i<length; i++ ) {
1.104 - if( text[i] == '\n' ) {
1.106 - if( i+3 < length && text[i+1] == '%' && text[i+2] == '%' ) {
1.112 - if( text[i] == '{' && text[i+1] == ':' ) {
1.115 - char *action = &text[i];
1.116 - for( ;i<length; i++ ) {
1.117 - if( text[i] == ':' && text[i+1] == '}' ) {
1.120 - if( add_action( actions, rules, operation, action ) != 0 ) {
1.125 - operation = &text[i+1];
1.130 + if( text[i] == '\n' ) {
1.132 + if( i+3 < length && text[i+1] == '%' && text[i+2] == '%' ) {
1.138 + if( text[i] == '{' && text[i+1] == ':' ) {
1.141 + char *action = &text[i];
1.142 + for( ;i<length; i++ ) {
1.143 + if( text[i] == ':' && text[i+1] == '}' ) {
1.146 + if( add_action( actions, rules, operation, action ) != 0 ) {
1.151 + operation = &text[i+1];
1.158 actions->posttext = &text[i];