00001 /* 00002 * Copyright (c) 2005, 2007 by KoanLogic s.r.l. <http://www.koanlogic.com> 00003 * All rights reserved. 00004 * 00005 * This file is part of KLone, and as such it is subject to the license stated 00006 * in the LICENSE file which you have received as part of this distribution. 00007 * 00008 * $Id: hookprv.h,v 1.1 2007/09/04 12:15:16 tat Exp $ 00009 */ 00010 00011 #ifndef _KLONE_HOOK_PRV_H_ 00012 #define _KLONE_HOOK_PRV_H_ 00013 #include <klone/hook.h> 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 #define hook_call( func, ... ) \ 00020 do { if(ctx && ctx->hook && ctx->hook->func) \ 00021 ctx->hook->func( __VA_ARGS__ ); \ 00022 } while(0) 00023 00024 struct hook_s 00025 { 00026 /* server hooks function pointers */ 00027 hook_server_init_t server_init; 00028 hook_server_term_t server_term; 00029 00030 /* children hooks */ 00031 hook_child_init_t child_init; 00032 hook_child_term_t child_term; 00033 00034 /* per-connection hook */ 00035 hook_request_t request; 00036 }; 00037 00038 #ifdef __cplusplus 00039 } 00040 #endif 00041 00042 #endif 00043