• Home
  • Raw
  • Download

Lines Matching refs:cg

102 static void	cups_set_default_ipp_port(_cups_globals_t *cg);
133 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsEncryption() local
136 if (cg->encryption == (http_encryption_t)-1) in cupsEncryption()
139 return (cg->encryption); in cupsEncryption()
160 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsGetPassword() local
163 return ((cg->password_cb)(prompt, NULL, NULL, NULL, cg->password_data)); in cupsGetPassword()
188 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsGetPassword2() local
194 return ((cg->password_cb)(prompt, http, method, resource, cg->password_data)); in cupsGetPassword2()
218 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsServer() local
221 if (!cg->server[0]) in cupsServer()
224 return (cg->server); in cupsServer()
245 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetClientCertCB() local
248 cg->client_cert_cb = cb; in cupsSetClientCertCB()
249 cg->client_cert_data = user_data; in cupsSetClientCertCB()
268 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetCredentials() local
275 _httpFreeCredentials(cg->tls_credentials); in cupsSetCredentials()
276 cg->tls_credentials = _httpCreateCredentials(credentials); in cupsSetCredentials()
279 return (cg->tls_credentials ? 0 : -1); in cupsSetCredentials()
299 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetEncryption() local
302 cg->encryption = e; in cupsSetEncryption()
304 if (cg->http) in cupsSetEncryption()
305 httpEncryption(cg->http, e); in cupsSetEncryption()
327 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetPasswordCB() local
331 cg->password_cb = (cups_password_cb2_t)_cupsGetPassword; in cupsSetPasswordCB()
333 cg->password_cb = (cups_password_cb2_t)cb; in cupsSetPasswordCB()
335 cg->password_data = NULL; in cupsSetPasswordCB()
359 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetPasswordCB2() local
363 cg->password_cb = (cups_password_cb2_t)_cupsGetPassword; in cupsSetPasswordCB2()
365 cg->password_cb = cb; in cupsSetPasswordCB2()
367 cg->password_data = user_data; in cupsSetPasswordCB2()
390 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetServer() local
395 strlcpy(cg->server, server, sizeof(cg->server)); in cupsSetServer()
397 if (cg->server[0] != '/' && (options = strrchr(cg->server, '/')) != NULL) in cupsSetServer()
402 cg->server_version = 10; in cupsSetServer()
404 cg->server_version = 11; in cupsSetServer()
406 cg->server_version = 20; in cupsSetServer()
408 cg->server_version = 21; in cupsSetServer()
410 cg->server_version = 22; in cupsSetServer()
413 cg->server_version = 20; in cupsSetServer()
415 if (cg->server[0] != '/' && (port = strrchr(cg->server, ':')) != NULL && in cupsSetServer()
420 cg->ipp_port = atoi(port); in cupsSetServer()
423 if (!cg->ipp_port) in cupsSetServer()
424 cups_set_default_ipp_port(cg); in cupsSetServer()
426 if (cg->server[0] == '/') in cupsSetServer()
427 strlcpy(cg->servername, "localhost", sizeof(cg->servername)); in cupsSetServer()
429 strlcpy(cg->servername, cg->server, sizeof(cg->servername)); in cupsSetServer()
433 cg->server[0] = '\0'; in cupsSetServer()
434 cg->servername[0] = '\0'; in cupsSetServer()
435 cg->server_version = 20; in cupsSetServer()
436 cg->ipp_port = 0; in cupsSetServer()
439 if (cg->http) in cupsSetServer()
441 httpClose(cg->http); in cupsSetServer()
442 cg->http = NULL; in cupsSetServer()
464 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetServerCertCB() local
467 cg->server_cert_cb = cb; in cupsSetServerCertCB()
468 cg->server_cert_data = user_data; in cupsSetServerCertCB()
485 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsSetUser() local
489 strlcpy(cg->user, user, sizeof(cg->user)); in cupsSetUser()
491 cg->user[0] = '\0'; in cupsSetUser()
507 _cups_globals_t *cg = _cupsGlobals(); in cupsSetUserAgent() local
524 strlcpy(cg->user_agent, user_agent, sizeof(cg->user_agent)); in cupsSetUserAgent()
528 if (cg->uatokens < _CUPS_UATOKENS_OS) in cupsSetUserAgent()
530 switch (cg->uatokens) in cupsSetUserAgent()
534 cg->user_agent[0] = '\0'; in cupsSetUserAgent()
537 strlcpy(cg->user_agent, "CUPS IPP", sizeof(cg->user_agent)); in cupsSetUserAgent()
540 snprintf(cg->user_agent, sizeof(cg->user_agent), "CUPS/%d IPP/2", CUPS_VERSION_MAJOR); in cupsSetUserAgent()
543 …snprintf(cg->user_agent, sizeof(cg->user_agent), "CUPS/%d.%d IPP/2.1", CUPS_VERSION_MAJOR, CUPS_VE… in cupsSetUserAgent()
546 strlcpy(cg->user_agent, CUPS_MINIMAL " IPP/2.1", sizeof(cg->user_agent)); in cupsSetUserAgent()
583 if (cg->uatokens == _CUPS_UATOKENS_OS) in cupsSetUserAgent()
584 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (Windows %d.%d) IPP/2.0", version.… in cupsSetUserAgent()
586 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (Windows %d.%d; %s) IPP/2.0", vers… in cupsSetUserAgent()
602 if (cg->uatokens == _CUPS_UATOKENS_OS) in cupsSetUserAgent()
603 snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (macOS %s) IPP/2.0", version); in cupsSetUserAgent()
605 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (macOS %s; %s) IPP/2.0", version, … in cupsSetUserAgent()
608 if (cg->uatokens == _CUPS_UATOKENS_OS) in cupsSetUserAgent()
609 snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s) IPP/2.0", version); in cupsSetUserAgent()
611 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s; %s) IPP/2.0", version, na… in cupsSetUserAgent()
621 if (cg->uatokens == _CUPS_UATOKENS_OS) in cupsSetUserAgent()
622 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (%s %s) IPP/2.0", name.sysname, na… in cupsSetUserAgent()
624 …snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (%s %s; %s) IPP/2.0", name.sysname… in cupsSetUserAgent()
641 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in cupsUser() local
644 if (!cg->user[0]) in cupsUser()
647 return (cg->user); in cupsUser()
660 _cups_globals_t *cg = _cupsGlobals(); /* Thread globals */ in cupsUserAgent() local
663 if (!cg->user_agent[0]) in cupsUserAgent()
666 return (cg->user_agent); in cupsUserAgent()
684 _cups_globals_t *cg = _cupsGlobals(); in _cupsGetPassword() local
713 passptr = cg->password; in _cupsGetPassword()
714 passend = cg->password + sizeof(cg->password) - 1; in _cupsGetPassword()
732 if (passptr > cg->password) in _cupsGetPassword()
746 if (passptr > cg->password) in _cupsGetPassword()
748 while (passptr > cg->password) in _cupsGetPassword()
763 passptr = cg->password; in _cupsGetPassword()
790 if (passbytes == 1 && passptr > cg->password) in _cupsGetPassword()
793 return (cg->password); in _cupsGetPassword()
797 memset(cg->password, 0, sizeof(cg->password)); in _cupsGetPassword()
809 _cups_globals_t *cg = _cupsGlobals(); in _cupsGetPassword()
849 passptr = cg->password; in _cupsGetPassword()
850 passend = cg->password + sizeof(cg->password) - 1; in _cupsGetPassword()
873 if (passptr > cg->password) in _cupsGetPassword()
887 if (passptr > cg->password) in _cupsGetPassword()
889 while (passptr > cg->password) in _cupsGetPassword()
905 passptr = cg->password; in _cupsGetPassword()
933 if (passbytes == 1 && passptr > cg->password) in _cupsGetPassword()
936 return (cg->password); in _cupsGetPassword()
940 memset(cg->password, 0, sizeof(cg->password)); in _cupsGetPassword()
955 _cups_globals_t *cg = _cupsGlobals(); /* Thread globals */ in _cupsGSSServiceName() local
958 if (!cg->gss_service_name[0]) in _cupsGSSServiceName()
961 return (cg->gss_service_name); in _cupsGSSServiceName()
976 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ in _cupsSetDefaults() local
992 snprintf(filename, sizeof(filename), "%s/client.conf", cg->cups_serverroot); in _cupsSetDefaults()
999 if (cg->home) in _cupsSetDefaults()
1005 snprintf(filename, sizeof(filename), "%s/.cups/client.conf", cg->home); in _cupsSetDefaults()
1019 cg->uatokens = cc.uatokens; in _cupsSetDefaults()
1021 if (cg->encryption == (http_encryption_t)-1) in _cupsSetDefaults()
1022 cg->encryption = cc.encryption; in _cupsSetDefaults()
1024 if (!cg->server[0] || !cg->ipp_port) in _cupsSetDefaults()
1027 if (!cg->ipp_port) in _cupsSetDefaults()
1028 cups_set_default_ipp_port(cg); in _cupsSetDefaults()
1030 if (!cg->user[0]) in _cupsSetDefaults()
1031 strlcpy(cg->user, cc.user, sizeof(cg->user)); in _cupsSetDefaults()
1034 if (!cg->gss_service_name[0]) in _cupsSetDefaults()
1035 strlcpy(cg->gss_service_name, cc.gss_service_name, sizeof(cg->gss_service_name)); in _cupsSetDefaults()
1038 if (cg->trust_first < 0) in _cupsSetDefaults()
1039 cg->trust_first = cc.trust_first; in _cupsSetDefaults()
1041 if (cg->any_root < 0) in _cupsSetDefaults()
1042 cg->any_root = cc.any_root; in _cupsSetDefaults()
1044 if (cg->expired_certs < 0) in _cupsSetDefaults()
1045 cg->expired_certs = cc.expired_certs; in _cupsSetDefaults()
1047 if (cg->validate_certs < 0) in _cupsSetDefaults()
1048 cg->validate_certs = cc.validate_certs; in _cupsSetDefaults()
1400 _cups_globals_t *cg) /* I - Global data */ in cups_set_default_ipp_port() argument
1407 if ((cg->ipp_port = atoi(ipp_port)) <= 0) in cups_set_default_ipp_port()
1408 cg->ipp_port = CUPS_DEFAULT_IPP_PORT; in cups_set_default_ipp_port()
1411 cg->ipp_port = CUPS_DEFAULT_IPP_PORT; in cups_set_default_ipp_port()