Beispiel #1
0
static void do_el_list_out( doc_element * array, uint8_t count )
{
    doc_element *   cur_el;
    doc_element *   save;
    int             i;
    text_line   *   cur_line;

    /*  Advise the user that multiple columns are not, in fact, implemented */

    if( count > 1 ) {
        out_msg( "Multi-column output not implemented" );
    }

    /*  The array should have the doc_elements in linked-list form in the   */
    /*  same order as the columns they came from were linked together.      */
    /*  The columns should no longer point to these doc_element lists.      */

    for( i = 0; i < count; i++ ) {
        cur_el = &array[i];
        while( cur_el != NULL ) {
            if( i == 0 ) {      // restrict output to first column, for now
                switch( cur_el->type ) {
                case el_binc :
                    ob_binclude( &cur_el->element.binc );
                    break;
                case el_graph :
                    if( ps_device ) {   // no action for character devices
                        ob_graphic( &cur_el->element.graph );
                    }
                    break;
                case el_text :
                    if( GlobalFlags.lastpass ) {
                        for( cur_line = cur_el->element.text.first; cur_line != NULL; cur_line = cur_line ->next ) {
                            fb_output_textline( cur_line );
                        }
                    }
                    break;
                default :
                    g_err( err_intern, __FILE__, __LINE__ );
                }
            }
            save = cur_el->next;
            cur_el->next = NULL;            // clear only current element
            clear_doc_element( cur_el );
            add_doc_el_to_pool( cur_el ); 
            cur_el = save;
        }
    }    

    return;
}
Beispiel #2
0
void    free_some_mem( void )
{

    if( token_buf != NULL ) {
        mem_free( token_buf );
    }
    if( alt_ext != NULL ) {
        mem_free( alt_ext );
    }
    if( def_ext != NULL ) {
        mem_free( def_ext );
    }
    if( master_fname != NULL ) {
        mem_free( master_fname );
    }
    if( master_fname_attr != NULL ) {
        mem_free( master_fname_attr );
    }
    if( dev_name != NULL ) {
        mem_free( dev_name );
    }
    if( lay_files != NULL ) {
        laystack * lwk;

        while( lay_files != NULL ) {
            lwk = lay_files->next;
            mem_free( lay_files );
            lay_files = lwk;
        }
    }
    if( out_file != NULL ) {
        mem_free( out_file );
    }
    if( out_file_attr != NULL ) {
        mem_free( out_file_attr );
    }
    if( global_dict != NULL ) {
        free_dict( &global_dict );
    }
    if( macro_dict != NULL ) {
        free_macro_dict( &macro_dict );
    }
    if( ref_dict != NULL ) {
        free_ref_dict( &ref_dict );
    }
    if( fig_dict != NULL ) {
        free_ref_dict( &fig_dict );
    }
    if( fn_dict != NULL ) {
        free_ref_dict( &fn_dict );
    }
    if( tag_dict != NULL ) {
        free_tag_dict( &tag_dict );
    }
    if( index_dict != NULL ) {
        free_index_dict( &index_dict );
    }
    if( buff2 != NULL ) {
        mem_free( buff2 );
    }
    if( workbuf != NULL ) {
        mem_free( workbuf );
    }
    if( t_line != NULL ) {
        add_text_chars_to_pool( t_line );
        add_text_line_to_pool( t_line );
    }
    if( t_element != NULL ) {
        clear_doc_element( t_element );
    }
    if( t_page.top_ban != NULL ) {
        if( t_page.top_ban->first != NULL ) {
            clear_doc_element( t_page.top_ban->first );
            add_doc_el_to_pool( t_page.top_ban->first );
        }
        add_ban_col_to_pool( t_page.top_ban );
    }
    if( t_page.page_width != NULL ) {
        clear_doc_element( t_page.page_width );
        add_doc_el_to_pool( t_page.page_width );
    }
    if( t_page.main != NULL ) {
        if( t_page.main->main != NULL ) {
            clear_doc_element( t_page.main->main );
            add_doc_el_to_pool( t_page.main->main );
        }
        if( t_page.main->bot_fig != NULL ) {
            clear_doc_element( t_page.main->bot_fig );
            add_doc_el_to_pool( t_page.main->bot_fig );
        }
        if( t_page.main->footnote != NULL ) {
            clear_doc_element( t_page.main->footnote );
            add_doc_el_to_pool( t_page.main->footnote );
        }
        add_doc_col_to_pool( t_page.main );
    }
    if( t_page.bot_ban != NULL ) {
        if( t_page.bot_ban->first != NULL ) {
            clear_doc_element( t_page.bot_ban->first );
            add_doc_el_to_pool( t_page.bot_ban->first );
        }
        add_ban_col_to_pool( t_page.bot_ban );
    }
    if( n_page.col_top != NULL ) {
        clear_doc_element( n_page.col_top );
        add_doc_el_to_pool( n_page.col_top );
    }
    if( n_page.col_main != NULL ) {
        clear_doc_element( n_page.col_main );
        add_doc_el_to_pool( n_page.col_main );
    }
    if( n_page.col_bot != NULL ) {
        clear_doc_element( n_page.col_bot );
        add_doc_el_to_pool( n_page.col_bot );
    }
    if( n_page.col_fn != NULL ) {
        clear_doc_element( n_page.col_fn );
        add_doc_el_to_pool( n_page.col_fn );
    }

    free_layout_banner();

    free_pool_storage();

}