Subversion Repositories svn1-original

Rev

Rev 46 | Rev 54 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46 Rev 51
Line 271... Line 271...
271
    return ( len );
271
    return ( len );
272
}
272
}
273
 
273
 
274
/*========================================================================
274
/*========================================================================
275
 *
275
 *
-
 
276
 *  Print to to the printer
-
 
277
 *
-
 
278
 *  Purpose:
-
 
279
 *      This function is called to do print data on the printer
-
 
280
 *
-
 
281
 *  Assume:
-
 
282
 *      One CSV field per print
-
 
283
 *      New lines are at the end of a line printed. This does allow for
-
 
284
 *      a single new-line.
-
 
285
 *
-
 
286
 *
-
 
287
 *  Parameters:
-
 
288
 *      Standard printf type parameters
-
 
289
 *
-
 
290
 *  Returns:
-
 
291
 *      TRUE : Operation was succesful
-
 
292
 *
-
 
293
 *========================================================================*/
-
 
294
 
-
 
295
int csv_print( char *format, ... )
-
 
296
{
-
 
297
    va_list     ap;
-
 
298
    char        pp[200];
-
 
299
    int         len;
-
 
300
    bool        eol = FALSE;
-
 
301
 
-
 
302
 
-
 
303
    va_start( ap, format );
-
 
304
    len = vsprintf( pp, format, ap );
-
 
305
    va_end( ap );
-
 
306
 
-
 
307
    /*
-
 
308
    **  Detect the end of a line and flag for later processing
-
 
309
    */
-
 
310
    if ( len > 0 && pp[len - 1] == '\n' )
-
 
311
    {
-
 
312
        len--;
-
 
313
        eol = TRUE;
-
 
314
    }
-
 
315
 
-
 
316
    if ( ! eol )
-
 
317
    {
-
 
318
        if ( print_col )
-
 
319
            fwrite( ",", 1, 1, pfile );
-
 
320
        fwrite( "\"", 1, 1, pfile );
-
 
321
        fwrite( pp, 1, len, pfile );
-
 
322
        print_col += len;
-
 
323
        fwrite( "\"", 1, 1, pfile );
-
 
324
    }
-
 
325
 
-
 
326
    /*
-
 
327
    **  Perform End of Line operation before printing the final newline
-
 
328
    */
-
 
329
    if ( eol )
-
 
330
    {
-
 
331
        print_line++;
-
 
332
        print_col = 0;
-
 
333
 
-
 
334
        /*
-
 
335
        **  Now print the final newline
-
 
336
        */
-
 
337
        fwrite( "\n", 1, 1, pfile );
-
 
338
        len ++;
-
 
339
    }
-
 
340
 
-
 
341
    return ( len );
-
 
342
}
-
 
343
 
-
 
344
 
-
 
345
/*========================================================================
-
 
346
 *
276
 *  Print to to the printer without any frills
347
 *  Print to to the printer without any frills
277
 *
348
 *
278
 *  Purpose:
349
 *  Purpose:
279
 *      This function is called to do print data on the printer
350
 *      This function is called to do print data on the printer
280
 *
351
 *
Line 432... Line 503...
432
 
503
 
433
void printbanner( char *title )
504
void printbanner( char *title )
434
{
505
{
435
    int         l, s;
506
    int         l, s;
436
 
507
 
-
 
508
    if ( !title )
-
 
509
        return;
-
 
510
 
437
    l = strlen( config.event_name );
511
    l = strlen( config.event_name );
438
    s = ( print_width - l ) / 2;
512
    s = ( print_width - l ) / 2;
439
    print( "%*s", s, "" );
513
    print( "%*s", s, "" );
440
 
514
 
441
    if ( print_html )
515
    if ( print_html )