Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/bind9/isc
File: ondestroy.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
#ifndef ISC_ONDESTROY_H
[11] Fix | Delete
#define ISC_ONDESTROY_H 1
[12] Fix | Delete
[13] Fix | Delete
#include <isc/lang.h>
[14] Fix | Delete
#include <isc/types.h>
[15] Fix | Delete
[16] Fix | Delete
ISC_LANG_BEGINDECLS
[17] Fix | Delete
[18] Fix | Delete
/*! \file isc/ondestroy.h
[19] Fix | Delete
* ondestroy handling.
[20] Fix | Delete
*
[21] Fix | Delete
* Any class ``X'' of objects that wants to send out notifications
[22] Fix | Delete
* on its destruction should declare a field of type isc_ondestroy_t
[23] Fix | Delete
* (call it 'ondest').
[24] Fix | Delete
*
[25] Fix | Delete
* \code
[26] Fix | Delete
* typedef struct {
[27] Fix | Delete
* ...
[28] Fix | Delete
* isc_ondestroy_t ondest;
[29] Fix | Delete
* ...
[30] Fix | Delete
* } X;
[31] Fix | Delete
* \endcode
[32] Fix | Delete
*
[33] Fix | Delete
* When an object ``A'' of type X is created
[34] Fix | Delete
* it must initialize the field ondest with a call to
[35] Fix | Delete
*
[36] Fix | Delete
* \code
[37] Fix | Delete
* isc_ondestroy_init(&A->ondest).
[38] Fix | Delete
* \endcode
[39] Fix | Delete
*
[40] Fix | Delete
* X should also provide a registration function for third-party
[41] Fix | Delete
* objects to call to register their interest in being told about
[42] Fix | Delete
* the destruction of a particular instance of X.
[43] Fix | Delete
*
[44] Fix | Delete
* \code
[45] Fix | Delete
* isc_result_t
[46] Fix | Delete
* X_ondestroy(X *instance, isc_task_t *task,
[47] Fix | Delete
* isc_event_t **eventp) {
[48] Fix | Delete
* return(isc_ondestroy_register(&instance->ondest, task,eventp));
[49] Fix | Delete
* }
[50] Fix | Delete
* \endcode
[51] Fix | Delete
*
[52] Fix | Delete
* Note: locking of the ondestory structure embedded inside of X, is
[53] Fix | Delete
* X's responsibility.
[54] Fix | Delete
*
[55] Fix | Delete
* When an instance of X is destroyed, a call to isc_ondestroy_notify()
[56] Fix | Delete
* sends the notifications:
[57] Fix | Delete
*
[58] Fix | Delete
* \code
[59] Fix | Delete
* X *instance;
[60] Fix | Delete
* isc_ondestroy_t ondest = instance->ondest;
[61] Fix | Delete
*
[62] Fix | Delete
* ... completely cleanup 'instance' here...
[63] Fix | Delete
*
[64] Fix | Delete
* isc_ondestroy_notify(&ondest, instance);
[65] Fix | Delete
* \endcode
[66] Fix | Delete
*
[67] Fix | Delete
*
[68] Fix | Delete
* see lib/dns/zone.c for an ifdef'd-out example.
[69] Fix | Delete
*/
[70] Fix | Delete
[71] Fix | Delete
struct isc_ondestroy {
[72] Fix | Delete
unsigned int magic;
[73] Fix | Delete
isc_eventlist_t events;
[74] Fix | Delete
};
[75] Fix | Delete
[76] Fix | Delete
void
[77] Fix | Delete
isc_ondestroy_init(isc_ondestroy_t *ondest);
[78] Fix | Delete
/*%<
[79] Fix | Delete
* Initialize the on ondest structure. *must* be called before first call
[80] Fix | Delete
* to isc_ondestroy_register().
[81] Fix | Delete
*/
[82] Fix | Delete
[83] Fix | Delete
isc_result_t
[84] Fix | Delete
isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task,
[85] Fix | Delete
isc_event_t **eventp);
[86] Fix | Delete
[87] Fix | Delete
/*%<
[88] Fix | Delete
* Stores task and *eventp away inside *ondest. Ownership of **event is
[89] Fix | Delete
* taken from the caller (and *eventp is set to NULL). The task is attached
[90] Fix | Delete
* to.
[91] Fix | Delete
*/
[92] Fix | Delete
[93] Fix | Delete
void
[94] Fix | Delete
isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender);
[95] Fix | Delete
/*%<
[96] Fix | Delete
* Dispatches the event(s) to the task(s) that were given in
[97] Fix | Delete
* isc_ondestroy_register call(s) (done via calls to
[98] Fix | Delete
* isc_task_sendanddetach()). Before dispatch, the sender value of each
[99] Fix | Delete
* event structure is set to the value of the sender parameter. The
[100] Fix | Delete
* internal structures of the ondest parameter are cleaned out, so no other
[101] Fix | Delete
* cleanup is needed.
[102] Fix | Delete
*/
[103] Fix | Delete
[104] Fix | Delete
ISC_LANG_ENDDECLS
[105] Fix | Delete
[106] Fix | Delete
#endif /* ISC_ONDESTROY_H */
[107] Fix | Delete
[108] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function