File: cpdb-pickle-print.c

package info (click to toggle)
cpdb-libs 2.0~b5-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: ansic: 2,967; sh: 139; xml: 111; makefile: 103
file content (20 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <cpdb/frontend.h>

int main(int argc, char **argv)
{
    if (argc != 2)
    {
        printf("Usage : %s filepath_to_print\n", argv[0]);
        exit(EXIT_SUCCESS);
    }
    cpdb_printer_obj_t *p = cpdbResurrectPrinterFromFile("/tmp/.printer-pickle");
    if (p == NULL)
    {
        printf("No serialized printer found. "
               "You must first 'pickle' a printer using the "
               "'pickle-printer' command inside cpdb-text-frontend\n");
        exit(EXIT_FAILURE);
    }
    cpdbPrintFile(p, argv[1]);
}