Ejemplo n.º 1
0
void    lay_aline( lay_tag ltag )
{
    char            *   p;
    condcode            cc;
    int                 k;
    lay_att             curr;
    att_args            l_args;
    bool                cvterr;

    ltag = ltag;
    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_aline ) {
        ProcFlags.lay_xxx = el_aline;
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = true;
        for( k = 0, curr = aline_att[k]; curr > 0; k++, curr = aline_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.aline.skip );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop;
    return;
}
Ejemplo n.º 2
0
void    lay_date( const gmltag * entry )
{
    char            *   p;
    condcode            cc;
    int                 k;
    lay_att             curr;
    att_args            l_args;
    int                 cvterr;

    entry = entry;
    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_date ) {
        ProcFlags.lay_xxx = el_date;
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = date_att[k]; curr > 0; k++, curr = date_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_date_form:
                    p = l_args.start[0] + l_args.len[0];
                    cvterr = i_date_form( p, curr, layout_work.date.date_form );
                    break;
                case   e_left_adjust:
                    cvterr = i_space_unit( p, curr, &layout_work.date.left_adjust );
                    break;
                case   e_right_adjust:
                    cvterr = i_space_unit( p, curr, &layout_work.date.right_adjust );
                    break;
                case   e_page_position:
                    cvterr = i_page_position( p, curr, &layout_work.date.page_position );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr, &layout_work.date.font );
                    if( layout_work.date.font >= wgml_font_cnt ) {
                        layout_work.date.font = 0;
                    }
                    break;
                case   e_pre_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.date.pre_skip );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 3
0
void    lay_abspref( lay_tag ltag )
{
    char            *   p;
    condcode            cc;
    int                 k;
    lay_att             curr;
    att_args            l_args;
    int                 cvterr;
    lay_sub             x_tag;
    abspref_lay_tag *   ap;

    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    switch( ltag ) {
    case LAY_TAG_ABSTRACT:
        x_tag = el_abstract;
        ap = &layout_work.abstract;
        break;
    case LAY_TAG_PREFACE:
        x_tag = el_preface;
        ap = &layout_work.preface;
        break;
    default:
        out_msg( "WGML logic error glabsprf.c.\n");
        file_mac_info();
        err_count++;
        break;
    }
    if( ProcFlags.lay_xxx != x_tag ) {
        ProcFlags.lay_xxx = x_tag;
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = abspref_att[k]; curr > 0; k++, curr = abspref_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_post_skip:
                    cvterr = i_space_unit( p, curr, &(ap->post_skip) );
                    break;
                case   e_pre_top_skip:
                    cvterr = i_space_unit( p, curr, &(ap->pre_top_skip) );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr, &(ap->font) );
                    if( ap->font >= wgml_font_cnt ) ap->font = 0;
                    break;
                case   e_spacing:
                    cvterr = i_int8( p, curr, &(ap->spacing) );
                    break;
                case   e_header:
                    cvterr = i_yes_no( p, curr, &(ap->header) );
                    break;
                case   e_abstract_string:
                    if( x_tag == el_abstract ) {
                        cvterr = i_xx_string( p, curr, ap->string );
                    }
                    break;
                case   e_preface_string:
                    if( x_tag == el_preface ) {
                        cvterr = i_xx_string( p, curr, ap->string );
                    }
                    break;
                case   e_page_eject:
                    cvterr = i_page_eject( p, curr, &(ap->page_eject) );
                    break;
                case   e_page_reset:
                    cvterr = i_yes_no( p, curr, &(ap->page_reset) );
                    break;
                case   e_columns:
                    cvterr = i_int8( p, curr, &(ap->columns) );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get one with value
    }
    scan_start = scan_stop;
    return;
}
Ejemplo n.º 4
0
void    lay_xmp( lay_tag ltag )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    int             cvterr;

    /* unused parameters */ (void)ltag;

    p = scan_start;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_xmp ) {
        ProcFlags.lay_xxx = el_xmp;
    }
    cc = get_lay_sub_and_value( &l_args );  // get one with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = xmp_att[k]; curr > 0; k++, curr = xmp_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_left_indent:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.xmp.left_indent );
                    break;
                case   e_right_indent:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.xmp.right_indent );
                    break;
                case   e_pre_skip:
                    cvterr = i_space_unit( p, curr, &layout_work.xmp.pre_skip );
                    break;
                case   e_post_skip:
                    cvterr = i_space_unit( p, curr, &layout_work.xmp.post_skip );
                    break;
                case   e_spacing:
                    cvterr = i_int8( p, curr, &layout_work.xmp.spacing );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr, &layout_work.xmp.font );
                    if( layout_work.xmp.font >= wgml_font_cnt ) {
                        layout_work.xmp.font = 0;
                    }
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get one with value
    }
    scan_start = scan_stop;
    return;
}
Ejemplo n.º 5
0
void    lay_figcap( const gmltag * entry )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    int             cvterr;

    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_figcap ) {
        ProcFlags.lay_xxx = el_figcap;
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = figcap_att[k]; curr > 0; k++, curr = figcap_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_pre_lines:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.figcap.pre_lines );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr, &layout_work.figcap.font );
                    if( layout_work.figcap.font >= wgml_font_cnt ) {
                        layout_work.figcap.font = 0;
                    }
                    break;
                case   e_figcap_string:
                    cvterr = i_xx_string( p, curr,
                                            &layout_work.figcap.string );
                    break;
                case   e_string_font:
                    cvterr = i_font_number( p, curr, &layout_work.figcap.string_font );
                    if( layout_work.figcap.string_font >= wgml_font_cnt ) {
                        layout_work.figcap.string_font = 0;
                    }
                    break;
                case   e_delim:
                    cvterr = i_char( p, curr, &layout_work.figcap.delim );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 6
0
void    lay_page( const gmltag * entry )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    int             cvterr;

    entry = entry;
    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_page ) {
        ProcFlags.lay_xxx = el_page;
    }
    cc = get_lay_sub_and_value( &l_args );  // get one with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = page_att[k]; curr > 0; k++, curr = page_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_top_margin:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.page.top_margin );
                    break;
                case   e_left_margin:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.page.left_margin );
                    break;
                case   e_right_margin:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.page.right_margin );
                    break;
                case   e_depth:
                    cvterr = i_space_unit( p, curr, &layout_work.page.depth );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get one with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 7
0
void    lay_banner( const gmltag * entry )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    bool            cvterr;
 
    p = scan_start;
    cvterr = false;
 
    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_banner ) {
        ProcFlags.lay_xxx = el_banner;
        ProcFlags.banner = true;
        init_banner_wk( &wk );
    } else {
        if( !strnicmp( ":banner", buff2, sizeof( ":banner" ) ) ) {
            err_count++;                // nested :banner
            g_err( err_nested_tag, entry->tagname );
            file_mac_info();
 
            while( !ProcFlags.reprocess_line  ) {
                eat_lay_sub_tag();
                if( strnicmp( ":ebanner", buff2, sizeof( ":ebanner" ) ) ) {
                    ProcFlags.reprocess_line = false;  // not :ebanner, go on
                }
            }
            return;
        }
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = true;
        for( k = 0; k < att_count; k++ ) {
            curr = banner_att[k];
 
            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];
 
                if( count[k] ) {
                    cvterr = 1;         // attribute specified twice
                } else {
                    count[k] += 1;
                    sum_count++;
                    switch( curr ) {
                    case   e_left_adjust:
                        cvterr = i_space_unit( p, curr, &wk.left_adjust );
                        break;
                    case   e_right_adjust:
                        cvterr = i_space_unit( p, curr, &wk.right_adjust );
                        break;
                    case   e_depth:
                        cvterr = i_space_unit( p, curr, &wk.depth );
                        break;
                    case   e_place:
                        cvterr = i_place( p, curr, &wk.place );
                        break;
                    case   e_docsect:
                        cvterr = i_docsect( p, curr, &wk.docsect );
                        break;
                    case   e_refplace:  // not stored in banner struct
                        cvterr = i_place( p, curr, &refplace );
                        break;
                    case   e_refdoc:    // not stored in banner struct
                        cvterr = i_docsect( p, curr, &refdoc );
                        break;
                    default:
                        out_msg( "WGML logic error.\n");
                        cvterr = true;
                        break;
                    }
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr ) {                  // there was an error
            err_count++;
            g_err( err_att_val_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 8
0
void    lay_appendix( const gmltag * entry )
{
    char            *   p;
    condcode            cc;
    int                 k;
    lay_att             curr;
    att_args            l_args;
    int                 cvterr;

    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_appendix ) {
        ProcFlags.lay_xxx = el_appendix;
    }
    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = appendix_att[k]; curr > 0; k++, curr = appendix_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_indent:
                    cvterr = i_space_unit( p, curr,
                                    &layout_work.hx.hx_head[hds_appendix].indent );
                    break;
                case   e_pre_top_skip:
                    cvterr = i_space_unit( p, curr,
                                &layout_work.hx.hx_sect[hds_appendix].pre_top_skip );
                    break;
                case   e_pre_skip:
                    cvterr = i_space_unit( p, curr,
                                    &layout_work.hx.hx_head[hds_appendix].pre_skip );
                    break;
                case   e_post_skip:
                    cvterr = i_space_unit( p, curr,
                                    &layout_work.hx.hx_sect[hds_appendix].post_skip );
                    break;
                case   e_spacing:
                    cvterr = i_int8( p, curr,
                                    &layout_work.hx.hx_sect[hds_appendix].spacing );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr,
                                        &layout_work.hx.hx_sect[hds_appendix].text_font );
                    if( layout_work.hx.hx_sect[hds_appendix].text_font >= wgml_font_cnt ) {
                        layout_work.hx.hx_sect[hds_appendix].text_font = 0;
                    }
                    break;
                case   e_number_font:
                    cvterr = i_font_number( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].number_font );
                    if( layout_work.hx.hx_head[hds_appendix].number_font >= wgml_font_cnt ) {
                        layout_work.hx.hx_head[hds_appendix].number_font = 0;
                    }
                    break;
                case   e_number_form:
                    cvterr = i_number_form( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].number_form );
                    break;
                case   e_page_position:
                    cvterr = i_page_position( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].line_position );
                    break;
                case   e_number_style:
                    cvterr = i_number_style( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].number_style );
                    break;
                case   e_page_eject:
                    cvterr = i_page_eject( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].page_eject );
                    break;
                case   e_line_break:
                    cvterr = i_yes_no( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].line_break );
                    break;
                case   e_display_heading:
                    cvterr = i_yes_no( p, curr,
                            &layout_work.hx.hx_head[hds_appendix].display_heading );
                    break;
                case   e_number_reset:
                    cvterr = i_yes_no( p, curr,
                                &layout_work.hx.hx_head[hds_appendix].number_reset );
                    break;
                case   e_case:
                    cvterr = i_case( p, curr,
                                     &layout_work.hx.hx_head[hds_appendix].hd_case );
                    break;
                case   e_align:
                    cvterr = i_space_unit( p, curr,
                                        &layout_work.hx.hx_head[hds_appendix].align );
                    break;
                case   e_header:
                    cvterr = i_yes_no( p, curr,
                                       &layout_work.hx.hx_sect[hds_appendix].header );
                    break;
                case   e_appendix_string:
                    cvterr = i_xx_string( p, curr, &layout_work.appendix.string );
                    break;
                case   e_page_reset:
                    cvterr = i_yes_no( p, curr, &layout_work.appendix.page_reset );
                    break;
                case   e_section_eject:
                    cvterr = i_page_eject( p, curr,
                                                &layout_work.appendix.section_eject );
                    break;
                case   e_columns:
                    cvterr = i_int8( p, curr, &layout_work.appendix.columns );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 9
0
void    lay_tochx( const gmltag * entry )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    int             cvterr;
    int             hx_l;

    p = scan_start;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    switch( entry->tagname[4] ) {
    case   '0':
        hx_l = el_toch0;
        break;
    case   '1':
        hx_l = el_toch1;
        break;
    case   '2':
        hx_l = el_toch2;
        break;
    case   '3':
        hx_l = el_toch3;
        break;
    case   '4':
        hx_l = el_toch4;
        break;
    case   '5':
        hx_l = el_toch5;
        break;
    case   '6':
        hx_l = el_toch6;
        break;
    default:
        hx_l = el_toch6;
        break;
    }
    if( ProcFlags.lay_xxx != hx_l ) {
        ProcFlags.lay_xxx = hx_l;
    }

    hx_l = entry->tagname[4] - '0';     // construct TOCHx level
    if( hx_l > 6 ) {
        hx_l = 6;
        out_msg( "WGML logic error in glhx.c\n" );
        err_count++;
    }

    cc = get_lay_sub_and_value( &l_args );  // get one with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = tochx_att[k]; curr > 0; k++, curr = tochx_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_group:
                    cvterr = i_int8( p, curr, &layout_work.tochx[hx_l].group );
                    break;
                case   e_indent:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.tochx[hx_l].indent );
                    break;
                case   e_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.tochx[hx_l].skip );
                    break;
                case   e_pre_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.tochx[hx_l].pre_skip );
                    break;
                case   e_post_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.tochx[hx_l].post_skip );
                    break;
                case   e_font:
                    cvterr = i_font_number( p, curr, &layout_work.tochx[hx_l].font );
                    if( layout_work.tochx[hx_l].font >= wgml_font_cnt ) {
                        layout_work.tochx[hx_l].font = 0;
                    }
                    break;
                case   e_align:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.tochx[hx_l].align );
                    break;
                case   e_display_in_toc:
                    cvterr = i_yes_no( p, curr,
                                     &layout_work.tochx[hx_l].display_in_toc );
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get one with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 10
0
void    lay_ix( const gmltag * entry )
{
    char            *   p;
    condcode            cc;
    int                 k;
    lay_att             curr;
    att_args            l_args;
    int                 cvterr;
    int                 ix_l;

    p = scan_start;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    switch( entry->tagname[1] ) {
    case   '1':
        ix_l = el_i1;
        break;
    case   '2':
        ix_l = el_i2;
        break;
    default:
        ix_l = el_i3;
        break;
    }
    if( ProcFlags.lay_xxx != ix_l ) {
        ProcFlags.lay_xxx = ix_l;
    }

    ix_l = entry->tagname[1] - '1';     // construct Ix level  0 - 2
    if( ix_l > 2 ) {
        ix_l = 2;
        out_msg( "WGML logic error in glix.c\n" );
        err_count++;
    }

    cc = get_lay_sub_and_value( &l_args );  // get att with value
    while( cc == pos ) {
        cvterr = -1;
        for( k = 0, curr = ix_att[k]; curr > 0; k++, curr = ix_att[k] ) {

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                switch( curr ) {
                case   e_pre_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.ix[ix_l].pre_skip );
                    break;
                case   e_post_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.ix[ix_l].post_skip );
                    break;
                case   e_skip:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.ix[ix_l].skip );
                    break;
                case   e_font:
                    cvterr = i_int8( p, curr, &layout_work.ix[ix_l].font );
                    if( layout_work.ix[ix_l].font >= wgml_font_cnt ) {
                        layout_work.ix[ix_l].font = 0;
                    }
                    break;
                case   e_indent:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.ix[ix_l].indent );
                    break;
                case   e_wrap_indent:
                    cvterr = i_space_unit( p, curr,
                                           &layout_work.ix[ix_l].wrap_indent );
                    break;
                case   e_index_delim:
                    cvterr = i_xx_string( p, curr,
                                          &layout_work.ix[ix_l].index_delim );
                    break;
                case   e_string_font:
                    if( ix_l < 2 ) {
                        cvterr = i_int8( p, curr,
                                         &layout_work.ix[ix_l].string_font );
                    if( layout_work.ix[ix_l].string_font >= wgml_font_cnt ) {
                        layout_work.ix[ix_l].string_font = 0;
                    }
                    }
                    break;
                default:
                    out_msg( "WGML logic error.\n");
                    cvterr = true;
                    break;
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        if( cvterr < 0 ) {
            err_count++;
            g_err( err_att_name_inv );
            file_mac_info();
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}
Ejemplo n.º 11
0
void    lay_banregion( const gmltag * entry )
{
    char        *   p;
    condcode        cc;
    int             k;
    lay_att         curr;
    att_args        l_args;
    bool            cvterr;

    p = scan_start;
    cvterr = false;

    if( !GlobalFlags.firstpass ) {
        scan_start = scan_stop + 1;
        eat_lay_sub_tag();
        return;                         // process during first pass only
    }
    if( ProcFlags.lay_xxx != el_banregion ) {
        if( ProcFlags.lay_xxx == el_banner ) {
            lay_banner_end_prepare();
        }
        ProcFlags.lay_xxx = el_banregion;

        init_banregion_wk( &wk );

    } else {
        if( !strnicmp( ":banregion", buff2, sizeof( ":banregion" ) ) ) {
            err_count++;
            g_err( err_nested_tag, entry->tagname );
            file_mac_info();

            while( !ProcFlags.reprocess_line  ) {
                eat_lay_sub_tag();
                if( strnicmp( ":ebanregion", buff2, sizeof( ":ebanregion" ) ) ) {
                    ProcFlags.reprocess_line = false;// not :ebanregion, go on
                }
            }
            return;
        }
    }
    cc = get_lay_sub_and_value( &l_args );              // get att with value
    while( cc == pos ) {
        cvterr = true;
        for( k = 0; k < att_count; k++ ) {
            curr = banregion_att[k];

            if( !strnicmp( att_names[curr], l_args.start[0], l_args.len[0] ) ) {
                p = l_args.start[1];

                if( count[k] ) {
                    cvterr = 1;                  // attribute specified twice
                } else {
                    count[k] += 1;
                    sum_count++;
                    switch( curr ) {
                    case   e_indent:
                        cvterr = i_space_unit( p, curr, &wk.indent );
                        break;
                    case   e_hoffset:
                        cvterr = i_space_unit( p, curr, &wk.hoffset );
                        break;
                    case   e_width:
                        cvterr = i_space_unit( p, curr, &wk.width );
                        break;
                    case   e_voffset:
                        cvterr = i_space_unit( p, curr, &wk.voffset );
                        break;
                    case   e_depth:
                        cvterr = i_space_unit( p, curr, &wk.depth );
                        break;
                    case   e_font:
                        cvterr = i_font_number( p, curr, &wk.font );
                        if( wk.font >= wgml_font_cnt )
                            wk.font = 0;
                        break;
                    case   e_refnum:
                        cvterr = i_int8( p, curr, &wk.refnum );
                        break;
                    case   e_region_position:
                        cvterr = i_page_position( p, curr, &wk.region_position );
                        break;
                    case   e_pouring:
                        cvterr = i_pouring( p, curr, &wk.pouring );
                        break;
                    case   e_script_format:
                        cvterr = i_yes_no( p, curr, &wk.script_format );
                        break;
                    case   e_contents:
                        if( l_args.quoted ) {
                            wk.contents.content_type = string_content;
                            cvterr = i_xx_string( p, curr, wk.contents.string );
                        } else {
                            cvterr = i_content( p, curr, &wk.contents );
                        }
                        break;
                    default:
                        out_msg( "WGML logic error.\n");
                        cvterr = true;
                        break;
                    }
                }
                if( cvterr ) {          // there was an error
                    err_count++;
                    g_err( err_att_val_inv );
                    file_mac_info();
                }
                break;                  // break out of for loop
            }
        }
        cc = get_lay_sub_and_value( &l_args );  // get att with value
    }
    scan_start = scan_stop + 1;
    return;
}