Subversion Repositories svn1

Rev

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

Rev 389 Rev 390
Line 33... Line 33...
33
 
33
 
34
FILE       *pfile;                               /* Fd of the printer channel */
34
FILE       *pfile;                               /* Fd of the printer channel */
35
time_t      pri_time;                            /* Time printer is opened - for banners */
35
time_t      pri_time;                            /* Time printer is opened - for banners */
36
int         print_width;                         /* Width of the printout */
36
int         print_width;                         /* Width of the printout */
37
report_type print_html = text;                   /* Printing with HTML */
37
report_type print_html = text;                   /* Printing with HTML */
38
int         print_col = 0;                       /* Current print column */
38
size_t      print_col = 0;                       /* Current print column */
39
int         print_line = 0;                      /* Current print line */
39
int         print_line = 0;                      /* Current print line */
40
int         print_underline_start;               /* Start of underline */
40
size_t      print_underline_start;               /* Start of underline */
41
int         print_underline_end;                 /* End of underline */
41
size_t      print_underline_end;                 /* End of underline */
42
long        print_current_colour;                /* Current printing colour */
42
long        print_current_colour;                /* Current printing colour */
43
QString     printFileName;                       /* Last printer file opened */
43
QString     printFileName;                       /* Last printer file opened */
44
char        print_href[200];                     /* Current HREF string */
44
char        print_href[200];                     /* Current HREF string */
45
 
45
 
46
/*========================================================================
46
/*========================================================================
Line 234... Line 234...
234
 *  Returns:
234
 *  Returns:
235
 *      TRUE : Operation was succesful
235
 *      TRUE : Operation was succesful
236
 *
236
 *
237
 *========================================================================*/
237
 *========================================================================*/
238
 
238
 
239
int print( const char *format, ... )
239
size_t print( const char *format, ... )
240
{
240
{
241
    va_list     ap;
241
    va_list     ap;
242
    char        pp[200];
242
    char        pp[200];
243
    int         len;
243
    size_t      len;
244
    bool        eol = FALSE;
244
    bool        eol = FALSE;
245
 
245
 
246
 
246
 
247
    /*
247
    /*
248
    **  If this is the start of a new line then we may need to colour it
248
    **  If this is the start of a new line then we may need to colour it
Line 281... Line 281...
281
    }
281
    }
282
 
282
 
283
    //  Insert pre-set HTML HREF into the string
283
    //  Insert pre-set HTML HREF into the string
284
    if (print_html && *print_href) {
284
    if (print_html && *print_href) {
285
        int iStart = 0;
285
        int iStart = 0;
286
        int iEnd = len;
286
        size_t iEnd = len;
287
        char *debugPtr = pp;
287
        //char *debugPtr = pp;
288
 
288
 
289
        for (int ii = 0; ii < len; ii++) {
289
        for (int ii = 0; ii < len; ii++) {
290
            if (pp[ii] != ' ') {
290
            if (pp[ii] != ' ') {
291
                iStart = ii;
291
                iStart = ii;
292
                break;
292
                break;
293
            }
293
            }
294
        }
294
        }
295
 
295
 
296
        for (int ii = len-1; ii >= iStart; ii--) {
296
        for (size_t ii = len-1; ii >= iStart; ii--) {
297
            if (pp[ii] != ' ') {
297
            if (pp[ii] != ' ') {
298
                iEnd = ii + 1;
298
                iEnd = ii + 1;
299
                break;
299
                break;
300
            }
300
            }
301
        }
301
        }
302
 debugPtr = print_href;
302
        //debugPtr = print_href;
303
 
303
 
304
        strncat(print_href, &pp[iStart], iEnd - iStart);
304
        strncat(print_href, &pp[iStart], iEnd - iStart);
305
        strcat(print_href, "</A>");
305
        strcat(print_href, "</A>");
306
        strncat(print_href, &pp[iEnd], len - iEnd );
306
        strncat(print_href, &pp[iEnd], len - iEnd );
307
        strcpy(&pp[iStart], print_href);
307
        strcpy(&pp[iStart], print_href);
Line 328... Line 328...
328
        **  Detect the end of a non-HTML underline
328
        **  Detect the end of a non-HTML underline
329
        */
329
        */
330
        print_underline ( FALSE );
330
        print_underline ( FALSE );
331
        if ( print_underline_start < print_underline_end )
331
        if ( print_underline_start < print_underline_end )
332
        {
332
        {
333
            int length;
333
            size_t length;
334
 
334
 
335
            fwrite( "\n", 1, 1, pfile );
335
            fwrite( "\n", 1, 1, pfile );
336
 
336
 
337
            length = print_underline_start;
337
            length = print_underline_start;
338
            while( length-- )
338
            while( length-- )
Line 595... Line 595...
595
 *
595
 *
596
 *========================================================================*/
596
 *========================================================================*/
597
 
597
 
598
void printbanner( const char *title )
598
void printbanner( const char *title )
599
{
599
{
600
    int         l, s;
600
    size_t         l, s;
601
 
601
 
602
    if ( !title )
602
    if ( !title )
603
        return;
603
        return;
604
 
604
 
605
    l = strlen( config.event_name );
605
    l = strlen( config.event_name );