Main Page | Data Structures | File List | Globals | Related Pages

layout.h

Go to the documentation of this file.
00001 /* $Id: layout.h,v 1.3 2003/09/12 21:06:45 legoater Exp $
00002  *
00003  * layout.h
00004  * 
00005  * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
00006  *
00007  * See the COPYING file for the terms of usage and distribution.
00008  */
00009 
00010 #ifndef log4c_layout_h
00011 #define log4c_layout_h
00012 
00025 #include <log4c/defs.h>
00026 #include <log4c/logging_event.h>
00027 #include <stdio.h>
00028 
00029 __LOG4C_BEGIN_DECLS
00030 
00031 struct __log4c_layout;
00032 
00036 typedef struct __log4c_layout log4c_layout_t;
00037 
00046 typedef struct log4c_layout_type {
00047     const char* name;
00048     const char* (*format) (const log4c_layout_t*, const log4c_logging_event_t*);
00049 } log4c_layout_type_t;
00050 
00058 extern const log4c_layout_type_t* log4c_layout_type_get(const char* a_name);
00059 
00066 extern const log4c_layout_type_t* log4c_layout_type_set(
00067     const log4c_layout_type_t* a_type);
00068 
00076 extern log4c_layout_t* log4c_layout_get(const char* a_name);
00077 
00081 extern log4c_layout_t* log4c_layout_new(const char* a_name);
00082 
00086 extern void log4c_layout_delete(log4c_layout_t* a_layout);
00087 
00092 extern const char* log4c_layout_get_name(const log4c_layout_t* a_layout);
00093 
00098 extern const log4c_layout_type_t* log4c_layout_get_type(
00099     const log4c_layout_t* a_layout);
00100 
00108 extern const log4c_layout_type_t* log4c_layout_set_type(
00109     log4c_layout_t* a_layout,
00110     const log4c_layout_type_t* a_type);
00111 
00116 extern void* log4c_layout_get_udata(const log4c_layout_t* a_layout);
00117 
00125 extern void* log4c_layout_set_udata(log4c_layout_t*     a_layout, 
00126                                     void*               a_udata);
00134 extern const char* log4c_layout_format(
00135     const log4c_layout_t*               a_layout,
00136     const log4c_logging_event_t*        a_event);
00137 
00143 extern void log4c_layout_print(
00144     const log4c_layout_t* a_layout, FILE* a_stream);
00145 
00152 #ifdef __GNUC__
00153 #   define log4c_layout_type_define(a_type) \
00154 static void __attribute__ ((constructor)) __log4c_init_layout_type_##a_type(void) \
00155 { log4c_layout_type_set(&a_type); }
00156 #else
00157 #   define log4c_layout_type_define(a_type)
00158 #endif
00159 
00163 struct __sd_factory;
00164 extern struct __sd_factory* log4c_layout_factory;
00165 
00166 __LOG4C_END_DECLS
00167 
00168 #endif

Generated on Sun Dec 12 05:16:43 2004 for log4c by  doxygen 1.3.9.1