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