void HTMLSRC_init_caches( BOOLEAN dont_exit ) { int i; char *p; char buf[1000]; if ( WWW_TraceFlag && ( WWW_TraceMask & 8 ) ) { fprintf( TraceFP( ), "HTMLSRC_init_caches(%d tagspecs)\n", 12 ); } i = 0; for ( ; i <= 11; i++ ) { LYstrncpy( buf, HTL_tagspecs_defaults[ i ], 999 ); HTSACopy( &HTL_tagspecs[ i ], buf ); if ( WWW_TraceFlag && ( WWW_TraceMask & 8 ) ) { fprintf( TraceFP( ), "parsing lexeme %d: %s\n", i + 1, buf ); } p = strchr( buf, ':' ); if ( p ) p = 0; if ( html_src_parse_tagspec( buf, i, 0, 1 ) == 0 && dont_exit == 0 ) failed_init( "1st", i ); if ( html_src_parse_tagspec( 0, i, 0, 0 ) == 0 && dont_exit == 0 ) failed_init( "2nd", i ); // i++; } return; }
PUBLIC void HTMLSRC_init_caches ARGS1( BOOL, dont_exit) { int i; char* p; char buf[1000]; for (i = 0; i < HTL_num_lexemes; ++i) { /*we assume that HT_tagspecs was NULLs at when program started*/ LYstrncpy(buf, HTL_tagspecs[i] ? HTL_tagspecs[i] : HTL_tagspecs_defaults[i], sizeof(buf) - 1); StrAllocCopy(HTL_tagspecs[i], buf); if ((p = strchr(buf, ':')) != 0) *p = '\0'; if (html_src_parse_tagspec(buf, i, FALSE, TRUE) && !dont_exit ) { fprintf(stderr, "internal error while caching 1st tagspec of %d lexeme", i); exit_immediately(EXIT_FAILURE); } if (html_src_parse_tagspec( p ? p+1 : NULL , i, FALSE, FALSE) && !dont_exit) { fprintf(stderr, "internal error while caching 2nd tagspec of %d lexeme", i); exit_immediately(EXIT_FAILURE); } } }