• Home
  • Raw
  • Download

Lines Matching refs:cg

79   _cups_globals_t *cg;			/* Pointer to global data */  in _cupsGlobals()  local
94 if ((cg = (_cups_globals_t *)_cupsThreadGetData(cups_globals_key)) == NULL) in _cupsGlobals()
100 if ((cg = cups_globals_alloc()) != NULL) in _cupsGlobals()
101 _cupsThreadSetData(cups_globals_key, cg); in _cupsGlobals()
108 return (cg); in _cupsGlobals()
137 _cups_globals_t *cg; /* Global data */ in DllMain() local
153 if ((cg = (_cups_globals_t *)TlsGetValue(cups_globals_key)) != NULL) in DllMain()
154 cups_globals_free(cg); in DllMain()
158 if ((cg = (_cups_globals_t *)TlsGetValue(cups_globals_key)) != NULL) in DllMain()
159 cups_globals_free(cg); in DllMain()
181 _cups_globals_t *cg = malloc(sizeof(_cups_globals_t)); in cups_globals_alloc() local
192 if (!cg) in cups_globals_alloc()
200 memset(cg, 0, sizeof(_cups_globals_t)); in cups_globals_alloc()
201 cg->encryption = (http_encryption_t)-1; in cups_globals_alloc()
202 cg->password_cb = (cups_password_cb2_t)_cupsGetPassword; in cups_globals_alloc()
203 cg->trust_first = -1; in cups_globals_alloc()
204 cg->any_root = -1; in cups_globals_alloc()
205 cg->expired_certs = -1; in cups_globals_alloc()
206 cg->validate_certs = -1; in cups_globals_alloc()
213 cg->thread_id = ++ cups_global_index; in cups_globals_alloc()
261 if ((cg->cups_datadir = getenv("CUPS_DATADIR")) == NULL) in cups_globals_alloc()
262 cg->cups_datadir = installdir; in cups_globals_alloc()
264 if ((cg->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL) in cups_globals_alloc()
265 cg->cups_serverbin = installdir; in cups_globals_alloc()
267 if ((cg->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL) in cups_globals_alloc()
268 cg->cups_serverroot = confdir; in cups_globals_alloc()
270 if ((cg->cups_statedir = getenv("CUPS_STATEDIR")) == NULL) in cups_globals_alloc()
271 cg->cups_statedir = confdir; in cups_globals_alloc()
273 if ((cg->localedir = getenv("LOCALEDIR")) == NULL) in cups_globals_alloc()
274 cg->localedir = localedir; in cups_globals_alloc()
276 cg->home = getenv("HOME"); in cups_globals_alloc()
290 cg->cups_datadir = CUPS_DATADIR; in cups_globals_alloc()
291 cg->cups_serverbin = CUPS_SERVERBIN; in cups_globals_alloc()
292 cg->cups_serverroot = CUPS_SERVERROOT; in cups_globals_alloc()
293 cg->cups_statedir = CUPS_STATEDIR; in cups_globals_alloc()
294 cg->localedir = CUPS_LOCALEDIR; in cups_globals_alloc()
302 if ((cg->cups_datadir = getenv("CUPS_DATADIR")) == NULL) in cups_globals_alloc()
303 cg->cups_datadir = CUPS_DATADIR; in cups_globals_alloc()
305 if ((cg->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL) in cups_globals_alloc()
306 cg->cups_serverbin = CUPS_SERVERBIN; in cups_globals_alloc()
308 if ((cg->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL) in cups_globals_alloc()
309 cg->cups_serverroot = CUPS_SERVERROOT; in cups_globals_alloc()
311 if ((cg->cups_statedir = getenv("CUPS_STATEDIR")) == NULL) in cups_globals_alloc()
312 cg->cups_statedir = CUPS_STATEDIR; in cups_globals_alloc()
314 if ((cg->localedir = getenv("LOCALEDIR")) == NULL) in cups_globals_alloc()
315 cg->localedir = CUPS_LOCALEDIR; in cups_globals_alloc()
317 cg->home = getenv("HOME"); in cups_globals_alloc()
320 if (cg->home && strstr(cg->home, "/Library/Containers/")) in cups_globals_alloc()
321 cg->home = NULL; in cups_globals_alloc()
325 if (!cg->home) in cups_globals_alloc()
330 cg->home = _cupsStrAlloc(pw->pw_dir); in cups_globals_alloc()
334 return (cg); in cups_globals_alloc()
344 cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */ in cups_globals_free() argument
350 if (cg->last_status_message) in cups_globals_free()
351 _cupsStrFree(cg->last_status_message); in cups_globals_free()
353 for (buffer = cg->cups_buffers; buffer; buffer = next) in cups_globals_free()
359 cupsArrayDelete(cg->leg_size_lut); in cups_globals_free()
360 cupsArrayDelete(cg->ppd_size_lut); in cups_globals_free()
361 cupsArrayDelete(cg->pwg_size_lut); in cups_globals_free()
363 httpClose(cg->http); in cups_globals_free()
366 _httpFreeCredentials(cg->tls_credentials); in cups_globals_free()
369 cupsFileClose(cg->stdio_files[0]); in cups_globals_free()
370 cupsFileClose(cg->stdio_files[1]); in cups_globals_free()
371 cupsFileClose(cg->stdio_files[2]); in cups_globals_free()
373 cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings); in cups_globals_free()
375 if (cg->raster_error.start) in cups_globals_free()
376 free(cg->raster_error.start); in cups_globals_free()
378 free(cg); in cups_globals_free()