log4c  1.2.1
layout.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * layout.h
4  *
5  * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
6  *
7  * See the COPYING file for the terms of usage and distribution.
8  */
9 
10 #ifndef log4c_layout_h
11 #define log4c_layout_h
12 
25 #include <log4c/defs.h>
26 #include <log4c/logging_event.h>
27 #include <stdio.h>
28 
29 __LOG4C_BEGIN_DECLS
30 
31 struct __log4c_layout;
32 
36 typedef struct __log4c_layout log4c_layout_t;
37 
46 typedef struct log4c_layout_type {
47  const char* name;
48  const char* (*format) (const log4c_layout_t*, const log4c_logging_event_t*);
50 
58 LOG4C_API const log4c_layout_type_t* log4c_layout_type_get(const char* a_name);
59 
81  const log4c_layout_type_t* a_type);
82 
90 LOG4C_API log4c_layout_t* log4c_layout_get(const char* a_name);
91 
95 LOG4C_API log4c_layout_t* log4c_layout_new(const char* a_name);
96 
100 LOG4C_API void log4c_layout_delete(log4c_layout_t* a_layout);
101 
106 LOG4C_API const char* log4c_layout_get_name(const log4c_layout_t* a_layout);
107 
113  const log4c_layout_t* a_layout);
114 
124  log4c_layout_t* a_layout,
125  const log4c_layout_type_t* a_type);
126 
131 LOG4C_API void* log4c_layout_get_udata(const log4c_layout_t* a_layout);
132 
140 LOG4C_API void* log4c_layout_set_udata(log4c_layout_t* a_layout,
141  void* a_udata);
149 LOG4C_API const char* log4c_layout_format(
150  const log4c_layout_t* a_layout,
151  const log4c_logging_event_t* a_event);
152 
158 LOG4C_API void log4c_layout_print(
159  const log4c_layout_t* a_layout, FILE* a_stream);
160 
166 LOG4C_API void log4c_layout_types_print(FILE *fp);
167 
178 #ifdef __GNUC__
179 # define log4c_layout_type_define(a_type) \
180  typedef int log4c_layout_type_define_##a_type __attribute__((deprecated)); \
181  static log4c_layout_type_define_##a_type __unsused_var __attribute__((unused));
182 #else
183 # define log4c_layout_type_define(a_type)
184 #endif
185 
189 struct __sd_factory;
190 LOG4C_API struct __sd_factory* log4c_layout_factory;
191 
192 __LOG4C_END_DECLS
193 
194 #endif
LOG4C_API void log4c_layout_print(const log4c_layout_t *a_layout, FILE *a_stream)
Definition: layout.c:203
LOG4C_API const log4c_layout_type_t * log4c_layout_get_type(const log4c_layout_t *a_layout)
Definition: layout.c:146
LOG4C_API void * log4c_layout_set_udata(log4c_layout_t *a_layout, void *a_udata)
Definition: layout.c:173
LOG4C_API log4c_layout_t * log4c_layout_new(const char *a_name)
Definition: layout.c:114
LOG4C_API log4c_layout_t * log4c_layout_get(const char *a_name)
Definition: layout.c:94
LOG4C_API const log4c_layout_type_t * log4c_layout_type_set(const log4c_layout_type_t *a_type)
Definition: layout.c:76
the internal representation of logging events.
LOG4C_API const char * log4c_layout_get_name(const log4c_layout_t *a_layout)
Definition: layout.c:140
LOG4C_API const log4c_layout_type_t * log4c_layout_set_type(log4c_layout_t *a_layout, const log4c_layout_type_t *a_type)
Definition: layout.c:152
LOG4C_API void log4c_layout_delete(log4c_layout_t *a_layout)
Definition: layout.c:130
struct __log4c_layout log4c_layout_t
Definition: layout.h:36
logging event object
Definition: logging_event.h:49
LOG4C_API void * log4c_layout_get_udata(const log4c_layout_t *a_layout)
Definition: layout.c:167
LOG4C_API const char * log4c_layout_format(const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
Definition: layout.c:186
LOG4C_API void log4c_layout_types_print(FILE *fp)
Definition: layout.c:47
LOG4C_API const log4c_layout_type_t * log4c_layout_type_get(const char *a_name)
Definition: layout.c:62
struct log4c_layout_type log4c_layout_type_t
log4c layout type class
log4c layout type class
Definition: layout.h:46