1 /* x-hook.h -- lists of function,data pairs to call. 2 * 3 * Copyright (c) 2003-2012 Apple Inc. All rights reserved. 4 * 5 * Permission is hereby granted, free of charge, to any person 6 * obtaining a copy of this software and associated documentation files 7 * (the "Software"), to deal in the Software without restriction, 8 * including without limitation the rights to use, copy, modify, merge, 9 * publish, distribute, sublicense, and/or sell copies of the Software, 10 * and to permit persons to whom the Software is furnished to do so, 11 * subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be 14 * included in all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT 20 * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 * DEALINGS IN THE SOFTWARE. 24 * 25 * Except as contained in this notice, the name(s) of the above 26 * copyright holders shall not be used in advertising or otherwise to 27 * promote the sale, use or other dealings in this Software without 28 * prior written authorization. 29 */ 30 31 #ifndef X_HOOK_H 32 #define X_HOOK_H 1 33 34 #include "x-list.h" 35 36 typedef void x_hook_function (void *arg, void *data); 37 38 X_EXTERN x_list *X_PFX(hook_add) (x_list * lst, x_hook_function * fun, 39 void *data); 40 X_EXTERN x_list *X_PFX(hook_remove) (x_list * lst, x_hook_function * fun, 41 void *data); 42 X_EXTERN void X_PFX(hook_run) (x_list * lst, void *arg); 43 X_EXTERN void X_PFX(hook_free) (x_list * lst); 44 45 #endif /* X_HOOK_H */ 46