static void usage( void ) { int k; int kscreen; g_banner(); kscreen = 0; for( k = inf_use_start; k <= inf_use_end; k++ ) { g_info_lm( k ); if( isatty( fileno( stdin ) ) ) { if( kscreen == 22 ) { kscreen = 0; g_info_lm( inf_pause ); getchar(); } else { kscreen++; } } } my_exit( 4 ); }
void process_line( void ) { bool anything_substituted; anything_substituted = remove_leading_space();// for " :TAG " constructs classify_record( *buff2 ); // classify script CW, GML tag or nothing if( !split_input_buffer() ) { // .* .cm .dm :cmt found } else { anything_substituted |= resolve_symvar_functions( buff2 ); if( input_cbs->fmflags & II_research && GlobalFlags.firstpass && anything_substituted ) { g_info_lm( inf_subst_line, buff2 ); // show line with substitution(s) } } buff2_lg = strlen( buff2 ); scan_start = buff2; scan_stop = buff2 + buff2_lg; return; }
void scan_line( void ) { condcode cc; ifcb * cb; cb = input_cbs->if_cb; scan_start = buff2; scan_stop = buff2 + buff2_lg; if( !ProcFlags.literal ) { set_if_then_do( cb ); cc = test_process( cb ); } else { if( !ProcFlags.ct ) { // special for .ct .li construct if( (t_line != NULL) && (t_line->first != NULL) ) { scr_process_break(); } } cc = pos; } if( cc == pos ) { // process record if( ProcFlags.scr_cw ) { scan_script(); // script control line } else if( ProcFlags.gml_tag ) { scan_gml(); // GML tags } /*******************************************************************/ /* here we arrive if no script keyword / GML tag recognized */ /* or for unprocessed text in the input record */ /* or for attributes of LAYOUT tags */ /*******************************************************************/ if( (*scan_start != '\0') && (scan_start <= scan_stop) ) { if( input_cbs->fmflags & II_research && GlobalFlags.firstpass ) { g_info_lm( inf_text_line, scan_start ); } if( ProcFlags.layout ) { // LAYOUT active: process attributes lay_tags[lay_ind].gmlproc( &lay_tags[lay_ind] ); } else { // processs (remaining) text if( rs_loc > 0 ) { start_doc_sect(); // if not already done g_err_tag_rsloc( rs_loc, scan_start ); } else { process_text( scan_start, g_curr_font ); } } } /*******************************************************************/ /* For .co off or :xmp and the last part of the line just processed*/ /* ensure the line is output */ /*******************************************************************/ if( !ProcFlags.layout && (input_cbs->fmflags & II_eol) ) { if( !ProcFlags.concat || ProcFlags.xmp_active ) { scr_process_break(); } } } else if( input_cbs->fmflags & II_research && GlobalFlags.firstpass ) { g_info_lm( inf_skip_line ); // show skipped line } if( ProcFlags.literal ) { if( li_cnt < LONG_MAX ) { // we decrement, do not wait for .li OFF if( li_cnt-- <= 0 ) { ProcFlags.literal = false; } } if( input_cbs->fmflags & II_eol ) { scr_process_break(); // ensure the line is output } } }