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

Function cupsdAddClass

scheduler/classes.c:22–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 */
21
22cupsd_printer_t * /* O - New class */
23cupsdAddClass(const char *name) /* I - Name of class */
24{
25 cupsd_printer_t *c; /* New class */
26 char uri[1024]; /* Class URI */
27
28
29 /*
30 * Add the printer and set the type to "class"...
31 */
32
33 if ((c = cupsdAddPrinter(name)) != NULL)
34 {
35 /*
36 * Change from a printer to a class...
37 */
38
39 c->type = CUPS_PRINTER_CLASS;
40
41 httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
42 ServerName, RemotePort, "/classes/%s", name);
43 cupsdSetString(&c->uri, uri);
44
45 cupsdSetString(&c->error_policy, "retry-current-job");
46 }
47
48 return (c);
49}
50
51
52/*

Callers 2

add_classFunction · 0.85
cupsdLoadAllClassesFunction · 0.85

Calls 3

cupsdAddPrinterFunction · 0.85
httpAssembleURIfFunction · 0.85
cupsdSetStringFunction · 0.85

Tested by

no test coverage detected