/*
- * "$Id: template.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id: template.c 6717 2007-07-24 23:47:12Z mike $"
*
* CGI template function.
*
FILE *in; /* Input file */
- fprintf(stderr, "DEBUG: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
+ fprintf(stderr, "DEBUG2: cgiCopyTemplateFile(out=%p, tmpl=\"%s\")\n", out,
tmpl ? tmpl : "(null)");
/*
FILE *in; /* Input file */
- fprintf(stderr, "DEBUG: cgiCopyTemplateLang(tmpl=\"%s\")\n",
+ fprintf(stderr, "DEBUG2: cgiCopyTemplateLang(tmpl=\"%s\")\n",
tmpl ? tmpl : "(null)");
/*
else
locale[0] = '\0';
- fprintf(stderr, "DEBUG: locale=\"%s\"...\n", locale);
+ fprintf(stderr, "DEBUG2: locale=\"%s\"...\n", locale);
/*
* See if we have a template file for this language...
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
}
- fprintf(stderr, "DEBUG: Template file is \"%s\"...\n", filename);
+ fprintf(stderr, "DEBUG2: Template file is \"%s\"...\n", filename);
/*
* Open the template file...
int uriencode; /* Encode as URI */
- fprintf(stderr, "DEBUG: %*sStarting at file position %ld...\n", indent, "",
+ fprintf(stderr, "DEBUG2: %*sStarting at file position %ld...\n", indent, "",
ftell(in));
/*
if (s == name && isspace(ch & 255))
{
- fprintf(stderr, "DEBUG: %*sLone { at %ld...\n", indent, "", ftell(in));
+ fprintf(stderr, "DEBUG2: %*sLone { at %ld...\n", indent, "", ftell(in));
if (out)
{
}
if (ch == '}')
- fprintf(stderr, "DEBUG: %*s\"{%s}\" at %ld...\n", indent, "", name,
+ fprintf(stderr, "DEBUG2: %*s\"{%s}\" at %ld...\n", indent, "", name,
ftell(in));
/*
pos = ftell(in);
- fprintf(stderr, "DEBUG: %*sLooping on \"%s\" at %ld, count=%d...\n",
+ fprintf(stderr, "DEBUG2: %*sLooping on \"%s\" at %ld, count=%d...\n",
indent, "", name + 1, pos, count);
if (count > 0)
else
cgi_copy(NULL, in, 0, '}', indent + 2);
- fprintf(stderr, "DEBUG: %*sFinished looping on \"%s\"...\n", indent,
+ fprintf(stderr, "DEBUG2: %*sFinished looping on \"%s\"...\n", indent,
"", name + 1);
continue;
{
if (uriencode)
cgi_puturi(outptr, out);
+ else if (!strcasecmp(name, "?cupsdconf_default"))
+ fputs(outptr, stdout);
else
cgi_puts(outptr, out);
}
if (ch != '?')
{
fprintf(stderr,
- "DEBUG: %*sBad terminator '%c' at file position %ld...\n",
+ "DEBUG2: %*sBad terminator '%c' at file position %ld...\n",
indent, "", ch, ftell(in));
return;
}
}
fprintf(stderr,
- "DEBUG: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
+ "DEBUG2: %*sStarting \"{%s%c%s\" at %ld, result=%d...\n",
indent, "", name, op, compare, ftell(in), result);
if (result)
* Comparison true; output first part and ignore second...
*/
- fprintf(stderr, "DEBUG: %*sOutput first part...\n", indent, "");
+ fprintf(stderr, "DEBUG2: %*sOutput first part...\n", indent, "");
cgi_copy(out, in, element, ':', indent + 2);
- fprintf(stderr, "DEBUG: %*sSkip second part...\n", indent, "");
+ fprintf(stderr, "DEBUG2: %*sSkip second part...\n", indent, "");
cgi_copy(NULL, in, element, '}', indent + 2);
}
else
* Comparison false; ignore first part and output second...
*/
- fprintf(stderr, "DEBUG: %*sSkip first part...\n", indent, "");
+ fprintf(stderr, "DEBUG2: %*sSkip first part...\n", indent, "");
cgi_copy(NULL, in, element, ':', indent + 2);
- fprintf(stderr, "DEBUG: %*sOutput second part...\n", indent, "");
+ fprintf(stderr, "DEBUG2: %*sOutput second part...\n", indent, "");
cgi_copy(out, in, element, '}', indent + 2);
}
- fprintf(stderr, "DEBUG: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
+ fprintf(stderr, "DEBUG2: %*sFinished \"{%s%c%s\", out=%p...\n", indent, "",
name, op, compare, out);
}
else if (ch == '\\') /* Quoted char */
putc(ch, out);
if (ch == EOF)
- fprintf(stderr, "DEBUG: %*sReturning at file position %ld on EOF...\n",
+ fprintf(stderr, "DEBUG2: %*sReturning at file position %ld on EOF...\n",
indent, "", ftell(in));
else
fprintf(stderr,
- "DEBUG: %*sReturning at file position %ld on character '%c'...\n",
+ "DEBUG2: %*sReturning at file position %ld on character '%c'...\n",
indent, "", ftell(in), ch);
if (ch == EOF && term)
/*
- * End of "$Id: template.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id: template.c 6717 2007-07-24 23:47:12Z mike $".
*/