• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/cups-372.4/cups/test/

Lines Matching defs:vars

118   cups_array_t	*vars;			/* Array of variables */
168 static int do_tests(_cups_vars_t *vars, const char *testfile);
169 static void expand_variables(_cups_vars_t *vars, char *dst, const char *src,
172 static ipp_t *get_collection(_cups_vars_t *vars, FILE *fp, int *linenum);
179 static char *get_variable(_cups_vars_t *vars, const char *name);
193 static void set_variable(_cups_vars_t *vars, const char *name,
226 _cups_vars_t vars; /* Variables */
247 memset(&vars, 0, sizeof(vars));
248 vars.family = AF_UNSPEC;
249 vars.vars = cupsArrayNew((cups_array_func_t)compare_vars, NULL);
284 vars.family = AF_INET;
289 vars.family = AF_INET6;
299 vars.encryption = HTTP_ENCRYPT_REQUIRED;
316 vars.encryption = HTTP_ENCRYPT_ALWAYS;
334 vars.timeout = _cupsStrScand(argv[i], NULL, localeconv());
398 set_variable(&vars, name, value);
411 if (vars.filename)
413 free(vars.filename);
414 vars.filename = NULL;
437 vars.filename = strdup(argv[i]);
439 vars.filename = strdup(filename);
442 vars.filename = strdup(filename);
445 vars.filename = strdup(filename);
448 vars.filename = strdup(argv[i]);
450 if ((ext = strrchr(vars.filename, '.')) != NULL)
457 set_variable(&vars, "filetype", "image/gif");
462 set_variable(&vars, "filetype", "text/html");
464 set_variable(&vars, "filetype", "image/jpeg");
467 set_variable(&vars, "filetype", "application/vnd.hp-PCL");
469 set_variable(&vars, "filetype", "application/pdf");
471 set_variable(&vars, "filetype", "image/png");
474 set_variable(&vars, "filetype", "application/postscript");
479 set_variable(&vars, "filetype", "image/pwg-raster");
482 set_variable(&vars, "filetype", "text/plain");
484 set_variable(&vars, "filetype", "application/openxps");
486 set_variable(&vars, "filetype", "application/octet-stream");
494 set_variable(&vars, "filetype", "application/octet-stream");
582 if (vars.uri)
590 vars.encryption = HTTP_ENCRYPT_ALWAYS;
593 vars.uri = argv[i];
594 uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, vars.uri,
595 vars.scheme, sizeof(vars.scheme),
596 vars.userpass, sizeof(vars.userpass),
597 vars.hostname, sizeof(vars.hostname),
598 &(vars.port),
599 vars.resource, sizeof(vars.resource));
608 if (vars.userpass[0])
610 if ((Password = strchr(vars.userpass, ':')) != NULL)
613 Username = vars.userpass;
615 set_variable(&vars, "uriuser", vars.userpass);
618 httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), vars.scheme, NULL,
619 vars.hostname, vars.port, vars.resource);
620 vars.uri = uri;
628 if (!vars.uri)
650 if (!do_tests(&vars, testfile))
655 if (!vars.uri || !testfile)
669 do_tests(&vars, testfile);
678 do_tests(&vars, testfile);
753 do_tests(_cups_vars_t *vars, /* I - Variables */
827 if ((http = httpConnect2(vars->hostname, vars->port, NULL, vars->family,
828 vars->encryption, 1, 30000, NULL)) == NULL)
830 print_fatal_error("Unable to connect to %s on port %d - %s", vars->hostname,
831 vars->port, cupsLastErrorString());
843 if (vars->timeout > 0.0)
844 httpSetTimeout(http, vars->timeout, timeout_cb, NULL);
874 expand_variables(vars, token, temp, sizeof(token));
875 set_variable(vars, attr, token);
896 expand_variables(vars, token, temp, sizeof(token));
897 if (!get_variable(vars, attr))
898 set_variable(vars, attr, token);
918 expand_variables(vars, file_id, temp, sizeof(file_id));
963 if (!do_tests(vars, get_filename(testfile, filename, temp,
996 if (get_variable(vars, attr) &&
997 !do_tests(vars, get_filename(testfile, filename, temp,
1031 if (!get_variable(vars, attr) &&
1032 !do_tests(vars, get_filename(testfile, filename, temp,
1060 if (get_variable(vars, temp))
1079 if (!get_variable(vars, temp))
1196 strlcpy(resource, vars->resource, sizeof(resource));
1262 ipp_t *col = get_collection(vars, fp, &linenum);
1285 expand_variables(vars, compression, temp, sizeof(compression));
1318 expand_variables(vars, token, temp, sizeof(token));
1319 set_variable(vars, attr, token);
1394 if (get_variable(vars, temp))
1413 expand_variables(vars, token, temp, sizeof(token));
1435 if (!get_variable(vars, temp))
1475 expand_variables(vars, test_id, temp, sizeof(test_id));
1573 expand_variables(vars, token, temp, sizeof(token));
1624 expand_variables(vars, token, temp, sizeof(token));
1676 expand_variables(vars, token, temp, sizeof(token));
1790 ipp_t *col = get_collection(vars, fp, &linenum);
1889 expand_variables(vars, token, temp, sizeof(token));
2270 expand_variables(vars, token, temp, sizeof(token));
2606 set_variable(vars, "job-id", temp);
2611 set_variable(vars, "job-uri", attrptr->values[0].string.text);
2617 set_variable(vars, "notify-subscription-id", temp);
2821 !get_variable(vars, statuses[i].if_defined))
2825 get_variable(vars, statuses[i].if_not_defined))
2835 set_variable(vars, statuses[i].define_match, "1");
2847 set_variable(vars, statuses[i].define_no_match, "1");
2858 !get_variable(vars, statuses[i].if_defined))
2862 get_variable(vars, statuses[i].if_not_defined))
2879 if (expect->if_defined && !get_variable(vars, expect->if_defined))
2883 get_variable(vars, expect->if_not_defined))
2895 set_variable(vars, expect->define_no_match, "1");
2931 set_variable(vars, expect->define_no_match, "1");
2963 set_variable(vars, expect->define_no_match, "1");
2985 set_variable(vars, expect->define_no_match, "1");
3009 set_variable(vars, expect->define_match, "1");
3012 set_variable(vars, expect->define_value, buffer);
3294 expand_variables(_cups_vars_t *vars, /* I - Variables */
3336 else if (vars)
3348 value = vars->uri;
3350 value = vars->filename;
3352 value = vars->scheme;
3354 value = vars->userpass;
3356 value = vars->hostname;
3359 snprintf(temp, sizeof(temp), "%d", vars->port);
3363 value = vars->resource;
3367 value = get_variable(vars, temp);
3459 get_collection(_cups_vars_t *vars, /* I - Variables */
3481 ipp_t *subcol = get_collection(vars, fp, linenum);
3522 expand_variables(vars, token, temp, sizeof(token));
3596 ipp_t *subcol = get_collection(vars, fp, linenum);
3888 get_variable(_cups_vars_t *vars, /* I - Variables */
3896 match = cupsArrayFind(vars->vars, &key);
4607 set_variable(_cups_vars_t *vars, /* I - Variables */
4617 if (vars->filename)
4618 free(vars->filename);
4620 vars->filename = strdup(value);
4625 if ((var = cupsArrayFind(vars->vars, &key)) != NULL)
4640 cupsArrayAdd(vars->vars, var);