hookprv.h

00001 /*
00002  * Copyright (c) 2005-2012 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 #ifndef ENABLE_HOOKS
00020     #define hook_call( func, ... )
00021 #else
00022     #define hook_call( func, ... ) \
00023         do { if(ctx && ctx->hook && ctx->hook->func) \
00024                 ctx->hook->func( __VA_ARGS__ ); \
00025         } while(0)
00026 
00027 struct hook_s
00028 {
00029     /* server hooks function pointers */
00030     hook_server_init_t server_init;
00031     hook_server_term_t server_term;
00032 
00033     /* children hooks */
00034     hook_child_init_t child_init;
00035     hook_child_term_t child_term;
00036 
00037     /* per-connection hook */
00038     hook_request_t request;
00039 
00040     /* server loop hook */
00041     hook_server_loop_t server_loop;
00042 };
00043 
00044 #endif  /* ENABLE_HOOKS */
00045 
00046 #ifdef __cplusplus
00047 }
00048 #endif 
00049 
00050 #endif
00051 

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved