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

Function cupsdDeleteSubscription

scheduler/subscriptions.c:446–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444 */
445
446void
447cupsdDeleteSubscription(
448 cupsd_subscription_t *sub, /* I - Subscription object */
449 int update) /* I - 1 = update subscriptions.conf, 0 = don't update, -1 = don't update and don't lock */
450{
451 /*
452 * Close the pipe to the notifier as needed...
453 */
454
455 if (sub->pipe >= 0)
456 close(sub->pipe);
457
458 /*
459 * Remove subscription from array...
460 */
461
462 if (update >= 0)
463 _cupsRWLockWrite(&SubscriptionsLock);
464
465 cupsArrayRemove(Subscriptions, sub);
466
467 if (update >= 0)
468 _cupsRWUnlock(&SubscriptionsLock);
469
470 /*
471 * Free memory...
472 */
473
474 _cupsRWDestroy(&sub->lock);
475
476 cupsdClearString(&(sub->owner));
477 cupsdClearString(&(sub->recipient));
478
479 cupsArrayDelete(sub->events);
480
481 free(sub);
482
483 /*
484 * Update the subscriptions as needed...
485 */
486
487 if (update > 0)
488 cupsdMarkDirty(CUPSD_DIRTY_SUBSCRIPTIONS);
489}
490
491
492/*

Callers 4

cupsdExpireSubscriptionsFunction · 0.85
cancel_subscriptionFunction · 0.85

Calls 7

_cupsRWLockWriteFunction · 0.85
cupsArrayRemoveFunction · 0.85
_cupsRWUnlockFunction · 0.85
_cupsRWDestroyFunction · 0.85
cupsdClearStringFunction · 0.85
cupsArrayDeleteFunction · 0.85
cupsdMarkDirtyFunction · 0.85

Tested by

no test coverage detected