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

Function cgiCopyTemplateFile

cgi-bin/template.c:32–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 */
31
32void
33cgiCopyTemplateFile(FILE *out, /* I - Output file */
34 const char *tmpl) /* I - Template file to read */
35{
36 FILE *in; /* Input file */
37
38 fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
39 tmpl ? tmpl : "(null)");
40
41 /*
42 * Range check input...
43 */
44
45 if (!tmpl || !out)
46 return;
47
48 /*
49 * Open the template file...
50 */
51
52 if ((in = fopen(tmpl, "r")) == NULL)
53 {
54 fprintf(stderr, "ERROR: Unable to open template file \"%s\" - %s\n",
55 tmpl, strerror(errno));
56 return;
57 }
58
59 /*
60 * Parse the file to the end...
61 */
62
63 cgi_copy(out, in, 0, 0, 0);
64
65 /*
66 * Close the template file and return...
67 */
68
69 fclose(in);
70}
71
72
73/*

Callers 1

mainFunction · 0.85

Calls 1

cgi_copyFunction · 0.85

Tested by 1

mainFunction · 0.68