Subversion Repositories svn1-original

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 61
Line 69... Line 69...
69
    {
69
    {
70
        pname = p_filename( name[0] ? name : filebase, ext ,"html" );
70
        pname = p_filename( name[0] ? name : filebase, ext ,"html" );
71
    }
71
    }
72
    else
72
    else
73
    {
73
    {
74
        pname = p_filename( name[0] ? name : filebase, "", ext[0] ? ext : "lst" );
74
        pname = p_filename( filebase, name[0] ? name : "", ext[0] ? ext : "lst" );
75
    }
75
    }
76
 
76
 
-
 
77
    /*
-
 
78
    **  Now use basic function
-
 
79
    */
-
 
80
    return open_printer_name (pname, width, html, title );
-
 
81
}
-
 
82
 
-
 
83
/*----------------------------------------------------------------------------
-
 
84
 * FUNCTION           : open_printer_name
-
 
85
 *
-
 
86
 * DESCRIPTION        : Open a printer with a known name
-
 
87
 *
-
 
88
 *      This function is called to open the printer and prepare to print
-
 
89
 *
-
 
90
 *  Parameters:
-
 
91
 *      pname       Name of print file
-
 
92
 *      width       Width of the printed file
-
 
93
 *      html        Printing in HTML mode
-
 
94
 *
-
 
95
 *  Returns:
-
 
96
 *      TRUE if the printer can be attached
-
 
97
 *
-
 
98
 *
-
 
99
 *  Note: Use an "htm" file extension as DOS cannot handle 4 letter extensions
-
 
100
----------------------------------------------------------------------------*/
-
 
101
 
-
 
102
bool open_printer_name( char *pname, int width, bool html, char *title )
-
 
103
{
77
    print_width = width ? width : 80;
104
    print_width = width ? width : 80;
78
    print_col = 0;
105
    print_col = 0;
79
    print_line = 0;
106
    print_line = 0;
80
    print_underline_start = -1;
107
    print_underline_start = -1;
81
    print_underline_end = -1;
108
    print_underline_end = -1;
Line 271... Line 298...
271
    return ( len );
298
    return ( len );
272
}
299
}
273
 
300
 
274
/*========================================================================
301
/*========================================================================
275
 *
302
 *
-
 
303
 *  Print to to the printer
-
 
304
 *
-
 
305
 *  Purpose:
-
 
306
 *      This function is called to do print data on the printer
-
 
307
 *
-
 
308
 *  Assume:
-
 
309
 *      One CSV field per print
-
 
310
 *      New lines are at the end of a line printed. This does allow for
-
 
311
 *      a single new-line.
-
 
312
 *
-
 
313
 *
-
 
314
 *  Parameters:
-
 
315
 *      Standard printf type parameters
-
 
316
 *
-
 
317
 *  Returns:
-
 
318
 *      TRUE : Operation was succesful
-
 
319
 *
-
 
320
 *========================================================================*/
-
 
321
 
-
 
322
int csv_print( char *format, ... )
-
 
323
{
-
 
324
    va_list     ap;
-
 
325
    char        pp[200];
-
 
326
    int         len;
-
 
327
    bool        eol = FALSE;
-
 
328
 
-
 
329
 
-
 
330
    va_start( ap, format );
-
 
331
    len = vsprintf( pp, format, ap );
-
 
332
    va_end( ap );
-
 
333
 
-
 
334
    /*
-
 
335
    **  Detect the end of a line and flag for later processing
-
 
336
    */
-
 
337
    if ( len > 0 && pp[len - 1] == '\n' )
-
 
338
    {
-
 
339
        len--;
-
 
340
        eol = TRUE;
-
 
341
    }
-
 
342
 
-
 
343
    if ( ! eol )
-
 
344
    {
-
 
345
        if ( print_col )
-
 
346
            fwrite( ",", 1, 1, pfile );
-
 
347
        fwrite( "\"", 1, 1, pfile );
-
 
348
        fwrite( pp, 1, len, pfile );
-
 
349
        print_col += len;
-
 
350
        fwrite( "\"", 1, 1, pfile );
-
 
351
    }
-
 
352
 
-
 
353
    /*
-
 
354
    **  Perform End of Line operation before printing the final newline
-
 
355
    */
-
 
356
    if ( eol )
-
 
357
    {
-
 
358
        print_line++;
-
 
359
        print_col = 0;
-
 
360
 
-
 
361
        /*
-
 
362
        **  Now print the final newline
-
 
363
        */
-
 
364
        fwrite( "\n", 1, 1, pfile );
-
 
365
        len ++;
-
 
366
    }
-
 
367
 
-
 
368
    return ( len );
-
 
369
}
-
 
370
 
-
 
371
 
-
 
372
/*========================================================================
-
 
373
 *
276
 *  Print to to the printer without any frills
374
 *  Print to to the printer without any frills
277
 *
375
 *
278
 *  Purpose:
376
 *  Purpose:
279
 *      This function is called to do print data on the printer
377
 *      This function is called to do print data on the printer
280
 *
378
 *
Line 432... Line 530...
432
 
530
 
433
void printbanner( char *title )
531
void printbanner( char *title )
434
{
532
{
435
    int         l, s;
533
    int         l, s;
436
 
534
 
-
 
535
    if ( !title )
-
 
536
        return;
-
 
537
 
437
    l = strlen( config.event_name );
538
    l = strlen( config.event_name );
438
    s = ( print_width - l ) / 2;
539
    s = ( print_width - l ) / 2;
439
    print( "%*s", s, "" );
540
    print( "%*s", s, "" );
440
 
541
 
441
    if ( print_html )
542
    if ( print_html )