/*
- * "$Id: admin.c,v 1.22.2.20 2003/01/07 18:26:18 mike Exp $"
+ * "$Id: admin.c,v 1.22.2.21 2003/03/21 17:09:50 mike Exp $"
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
*/
if (oldinfo)
- ippSetCGIVars(oldinfo, NULL, NULL);
+ ippSetCGIVars(oldinfo, NULL, NULL, NULL);
cgiCopyTemplateLang(stdout, TEMPLATES, "modify-printer.tmpl", getenv("LANG"));
}
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
strlcpy(make, var, sizeof(make));
- ippSetCGIVars(response, "ppd-make", make);
+ ippSetCGIVars(response, "ppd-make", make, NULL);
cgiCopyTemplateLang(stdout, TEMPLATES, "choose-model.tmpl",
getenv("LANG"));
}
/*
- * End of "$Id: admin.c,v 1.22.2.20 2003/01/07 18:26:18 mike Exp $".
+ * End of "$Id: admin.c,v 1.22.2.21 2003/03/21 17:09:50 mike Exp $".
*/
/*
- * "$Id: classes.c,v 1.18.2.6 2003/01/07 18:26:19 mike Exp $"
+ * "$Id: classes.c,v 1.18.2.7 2003/03/21 17:09:50 mike Exp $"
*
* Class status CGI for the Common UNIX Printing System (CUPS).
*
uri);
}
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+ "requested-attributes", NULL, "all");
+
/*
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
CUPS_DATADIR "/data/testprint.ps")) != NULL)
{
status = response->request.status.status_code;
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
/*
- * End of "$Id: classes.c,v 1.18.2.6 2003/01/07 18:26:19 mike Exp $".
+ * End of "$Id: classes.c,v 1.18.2.7 2003/03/21 17:09:50 mike Exp $".
*/
/*
- * "$Id: ipp-var.c,v 1.23.2.8 2003/03/14 21:43:29 mike Exp $"
+ * "$Id: ipp-var.c,v 1.23.2.9 2003/03/21 17:09:50 mike Exp $"
*
* IPP variable routines for the Common UNIX Printing System (CUPS).
*
void
ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
const char *filter_name, /* I - Filter name */
- const char *filter_value) /* I - Filter value */
+ const char *filter_value, /* I - Filter value */
+ const char *prefix) /* I - Prefix for name or NULL */
{
int element; /* Element in CGI array */
ipp_attribute_t *attr, /* Attribute in response... */
*filter; /* Filtering attribute */
int i; /* Looping var */
char name[1024], /* Name of attribute */
+ *nameptr, /* Pointer into name */
value[16384], /* Value(s) */
*valptr; /* Pointer into value */
char method[HTTP_MAX_URI],
if (attr->name == NULL)
continue;
- for (i = 0; attr->name[i]; i ++)
+ if (prefix)
+ {
+ snprintf(name, sizeof(name), "%s.", prefix);
+ nameptr = name + strlen(name);
+ }
+ else
+ nameptr = name;
+
+ for (i = 0; attr->name[i] && nameptr < (name + sizeof(name) - 1); i ++)
if (attr->name[i] == '-')
- name[i] = '_';
+ *nameptr++ = '_';
else
- name[i] = attr->name[i];
+ *nameptr++ = attr->name[i];
- name[i] = '\0';
+ *nameptr = '\0';
/*
* Add "job_printer_name" variable if we have a "job_printer_uri"
sizeof(value) - (valptr - value));
break;
+ case IPP_TAG_BEGIN_COLLECTION :
+ ippSetCGIVars(attr->values[i].collection, filter_name,
+ filter_value, name);
+ break;
+
default :
break; /* anti-compiler-warning-code */
}
* Add the element...
*/
- cgiSetArray(name, element, value);
+ if (attr->value_tag != IPP_TAG_BEGIN_COLLECTION)
+ cgiSetArray(name, element, value);
/* fprintf(stderr, "DEBUG: %s[%d]=\"%s\"\n", name, element, value);*/
}
/*
- * End of "$Id: ipp-var.c,v 1.23.2.8 2003/03/14 21:43:29 mike Exp $".
+ * End of "$Id: ipp-var.c,v 1.23.2.9 2003/03/21 17:09:50 mike Exp $".
*/
/*
- * "$Id: ipp-var.h,v 1.5.2.2 2003/01/07 18:26:19 mike Exp $"
+ * "$Id: ipp-var.h,v 1.5.2.3 2003/03/21 17:09:51 mike Exp $"
*
* IPP variable definitions for the Common UNIX Printing System (CUPS).
*
* Include necessary headers...
*/
-#include <ctype.h>
#include <cups/cups.h>
#include <cups/debug.h>
#include <cups/language.h>
extern char *ippGetTemplateDir(void);
extern void ippSetServerVersion(void);
-extern void ippSetCGIVars(ipp_t *, const char *, const char *);
+extern void ippSetCGIVars(ipp_t *, const char *, const char *, const char *);
/*
- * End of "$Id: ipp-var.h,v 1.5.2.2 2003/01/07 18:26:19 mike Exp $".
+ * End of "$Id: ipp-var.h,v 1.5.2.3 2003/03/21 17:09:51 mike Exp $".
*/
/*
- * "$Id: jobs.c,v 1.15.2.8 2003/01/07 18:26:19 mike Exp $"
+ * "$Id: jobs.c,v 1.15.2.9 2003/03/21 17:09:51 mike Exp $"
*
* Job status CGI for the Common UNIX Printing System (CUPS).
*
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
/*
- * End of "$Id: jobs.c,v 1.15.2.8 2003/01/07 18:26:19 mike Exp $".
+ * End of "$Id: jobs.c,v 1.15.2.9 2003/03/21 17:09:51 mike Exp $".
*/
/*
- * "$Id: printers.c,v 1.21.2.7 2003/01/07 18:26:20 mike Exp $"
+ * "$Id: printers.c,v 1.21.2.8 2003/03/21 17:09:51 mike Exp $"
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
uri);
}
+ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+ "requested-attributes", NULL, "all");
+
/*
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
CUPS_DATADIR "/data/testprint.ps")) != NULL)
{
status = response->request.status.status_code;
- ippSetCGIVars(response, NULL, NULL);
+ ippSetCGIVars(response, NULL, NULL, NULL);
ippDelete(response);
}
/*
- * End of "$Id: printers.c,v 1.21.2.7 2003/01/07 18:26:20 mike Exp $".
+ * End of "$Id: printers.c,v 1.21.2.8 2003/03/21 17:09:51 mike Exp $".
*/