MCPcopy Create free account
hub / github.com/OpenPrinting/cups / copy_comments

Function copy_comments

filter/pstops.c:556–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554 */
555
556static ssize_t /* O - Length of next line */
557copy_comments(cups_file_t *fp, /* I - File to read from */
558 pstops_doc_t *doc, /* I - Document info */
559 ppd_file_t *ppd, /* I - PPD file */
560 char *line, /* I - Line buffer */
561 ssize_t linelen, /* I - Length of initial line */
562 size_t linesize) /* I - Size of line buffer */
563{
564 int saw_bounding_box, /* Saw %%BoundingBox: comment? */
565 saw_for, /* Saw %%For: comment? */
566 saw_pages, /* Saw %%Pages: comment? */
567 saw_title; /* Saw %%Title: comment? */
568
569
570 /*
571 * Loop until we see %%EndComments or a non-comment line...
572 */
573
574 saw_bounding_box = 0;
575 saw_for = 0;
576 saw_pages = 0;
577 saw_title = 0;
578
579 while (line[0] == '%')
580 {
581 /*
582 * Strip trailing whitespace...
583 */
584
585 while (linelen > 0)
586 {
587 linelen --;
588
589 if (!isspace(line[linelen] & 255))
590 break;
591 else
592 line[linelen] = '\0';
593 }
594
595 /*
596 * Log the header...
597 */
598
599 fprintf(stderr, "DEBUG: %s\n", line);
600
601 /*
602 * Pull the headers out...
603 */
604
605 if (!strncmp(line, "%%Pages:", 8))
606 {
607 int pages; /* Number of pages */
608
609 if (saw_pages)
610 fputs("DEBUG: A duplicate %%Pages: comment was seen.\n", stderr);
611
612 saw_pages = 1;
613

Callers 1

copy_dscFunction · 0.85

Calls 8

cupsGetOptionFunction · 0.85
cupsAddOptionFunction · 0.85
ppdMarkOptionFunction · 0.85
doc_printfFunction · 0.85
UpdatePageVarsFunction · 0.85
cupsFileGetLineFunction · 0.85
WriteTextCommentFunction · 0.85
doc_putsFunction · 0.85

Tested by

no test coverage detected