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

Function cupsAdminSetServerSettings

cups/adminutil.c:412–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 */
411
412int /* O - 1 on success, 0 on failure */
413cupsAdminSetServerSettings(
414 http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
415 int num_settings, /* I - Number of settings */
416 cups_option_t *settings) /* I - Settings */
417{
418 int i; /* Looping var */
419 http_status_t status; /* GET/PUT status */
420 const char *server_port_env; /* SERVER_PORT env var */
421 int server_port; /* IPP port for server */
422 cups_file_t *cupsd; /* cupsd.conf file */
423 char cupsdconf[1024]; /* cupsd.conf filename */
424 int remote; /* Remote cupsd.conf file? */
425 char tempfile[1024]; /* Temporary new cupsd.conf */
426 cups_file_t *temp; /* Temporary file */
427 char line[1024], /* Line from cupsd.conf file */
428 *value; /* Value on line */
429 int linenum, /* Line number in file */
430 in_location, /* In a location section? */
431 in_policy, /* In a policy section? */
432 in_default_policy, /* In the default policy section? */
433 in_cancel_job, /* In a cancel-job section? */
434 in_admin_location, /* In the /admin location? */
435 in_conf_location, /* In the /admin/conf location? */
436 in_log_location, /* In the /admin/log location? */
437 in_root_location; /* In the / location? */
438 const char *val; /* Setting value */
439 int share_printers, /* Share local printers */
440 remote_admin, /* Remote administration allowed? */
441 remote_any, /* Remote access from anywhere? */
442 user_cancel_any, /* Cancel-job policy set? */
443 debug_logging; /* LogLevel debug set? */
444 int wrote_port_listen, /* Wrote the port/listen lines? */
445 wrote_browsing, /* Wrote the browsing lines? */
446 wrote_policy, /* Wrote the policy? */
447 wrote_loglevel, /* Wrote the LogLevel line? */
448 wrote_admin_location, /* Wrote the /admin location? */
449 wrote_conf_location, /* Wrote the /admin/conf location? */
450 wrote_log_location, /* Wrote the /admin/log location? */
451 wrote_root_location; /* Wrote the / location? */
452 int indent; /* Indentation */
453 int cupsd_num_settings; /* New number of settings */
454 int old_share_printers, /* Share local printers */
455 old_remote_admin, /* Remote administration allowed? */
456 old_remote_any, /* Remote access from anywhere? */
457 old_user_cancel_any, /* Cancel-job policy set? */
458 old_debug_logging; /* LogLevel debug set? */
459 cups_option_t *cupsd_settings, /* New settings */
460 *setting; /* Current setting */
461 _cups_globals_t *cg = _cupsGlobals(); /* Global data */
462
463
464 /*
465 * Range check input...
466 */
467
468 if (!http)
469 http = _cupsConnect();

Callers 3

do_config_serverFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 15

_cupsGlobalsFunction · 0.85
_cupsConnectFunction · 0.85
_cupsSetErrorFunction · 0.85
get_cupsd_confFunction · 0.85
cupsFileOpenFunction · 0.85
cupsGetOptionFunction · 0.85
cupsFreeOptionsFunction · 0.85
cupsTempFile2Function · 0.85
cupsFileCloseFunction · 0.85
ippPortFunction · 0.85
cupsFileGetConfFunction · 0.85

Tested by 1

mainFunction · 0.68