log4c  1.2.4
layout.h
Go to the documentation of this file.
1 /* $Id: layout.h,v 1.8 2013/04/06 13:04:53 valtri Exp $
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 
164 LOG4C_API void log4c_layout_types_free(void);
165 
171 LOG4C_API void log4c_layout_types_print(FILE *fp);
172 
183 #ifdef __GNUC__
184 # define log4c_layout_type_define(a_type) \
185  typedef int log4c_layout_type_define_##a_type __attribute__((deprecated)); \
186  static log4c_layout_type_define_##a_type __unsused_var __attribute__((unused));
187 #else
188 # define log4c_layout_type_define(a_type)
189 #endif
190 
194 struct __sd_factory;
195 LOG4C_API struct __sd_factory* log4c_layout_factory;
196 
197 __LOG4C_END_DECLS
198 
199 #endif
const log4c_layout_type_t * log4c_layout_type_get(const char *a_name)
Definition: layout.c:64
const char * log4c_layout_format(const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
Definition: layout.c:188
const char * log4c_layout_get_name(const log4c_layout_t *a_layout)
Definition: layout.c:142
void log4c_layout_print(const log4c_layout_t *a_layout, FILE *a_stream)
Definition: layout.c:205
struct log4c_layout_type log4c_layout_type_t
log4c layout type class
void log4c_layout_types_print(FILE *fp)
Definition: layout.c:49
log4c_layout_t * log4c_layout_new(const char *a_name)
Definition: layout.c:116
void * log4c_layout_set_udata(log4c_layout_t *a_layout, void *a_udata)
Definition: layout.c:175
void log4c_layout_delete(log4c_layout_t *a_layout)
Definition: layout.c:132
log4c_layout_t * log4c_layout_get(const char *a_name)
Definition: layout.c:96
const log4c_layout_type_t * log4c_layout_get_type(const log4c_layout_t *a_layout)
Definition: layout.c:148
void * log4c_layout_get_udata(const log4c_layout_t *a_layout)
Definition: layout.c:169
void log4c_layout_types_free(void)
Definition: layout.c:42
const log4c_layout_type_t * log4c_layout_type_set(const log4c_layout_type_t *a_type)
Definition: layout.c:78
struct __log4c_layout log4c_layout_t
Definition: layout.h:36
const log4c_layout_type_t * log4c_layout_set_type(log4c_layout_t *a_layout, const log4c_layout_type_t *a_type)
Definition: layout.c:154
the internal representation of logging events.
log4c layout type class
Definition: layout.h:46
logging event object
Definition: logging_event.h:50