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
24
25#include <log4c/defs.h>
26#include <log4c/logging_event.h>
27#include <stdio.h>
28
29__LOG4C_BEGIN_DECLS
30
31struct __log4c_layout;
32
36typedef struct __log4c_layout log4c_layout_t;
37
46typedef struct log4c_layout_type {
47 const char* name;
48 const char* (*format) (const log4c_layout_t*, const log4c_logging_event_t*);
50
58LOG4C_API const log4c_layout_type_t* log4c_layout_type_get(const char* a_name);
59
81 const log4c_layout_type_t* a_type);
82
90LOG4C_API log4c_layout_t* log4c_layout_get(const char* a_name);
91
95LOG4C_API log4c_layout_t* log4c_layout_new(const char* a_name);
96
100LOG4C_API void log4c_layout_delete(log4c_layout_t* a_layout);
101
106LOG4C_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
131LOG4C_API void* log4c_layout_get_udata(const log4c_layout_t* a_layout);
132
140LOG4C_API void* log4c_layout_set_udata(log4c_layout_t* a_layout,
141 void* a_udata);
149LOG4C_API const char* log4c_layout_format(
150 const log4c_layout_t* a_layout,
151 const log4c_logging_event_t* a_event);
152
158LOG4C_API void log4c_layout_print(
159 const log4c_layout_t* a_layout, FILE* a_stream);
160
164LOG4C_API void log4c_layout_types_free(void);
165
171LOG4C_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
194struct __sd_factory;
195LOG4C_API struct __sd_factory* log4c_layout_factory;
196
197__LOG4C_END_DECLS
198
199#endif
const char * log4c_layout_get_name(const log4c_layout_t *a_layout)
Definition layout.c:141
void * log4c_layout_set_udata(log4c_layout_t *a_layout, void *a_udata)
Definition layout.c:174
const log4c_layout_type_t * log4c_layout_set_type(log4c_layout_t *a_layout, const log4c_layout_type_t *a_type)
Definition layout.c:153
void log4c_layout_print(const log4c_layout_t *a_layout, FILE *a_stream)
Definition layout.c:204
log4c_layout_t * log4c_layout_new(const char *a_name)
Definition layout.c:115
struct log4c_layout_type log4c_layout_type_t
log4c layout type class
void log4c_layout_types_print(FILE *fp)
Definition layout.c:48
log4c_layout_t * log4c_layout_get(const char *a_name)
Definition layout.c:95
const log4c_layout_type_t * log4c_layout_type_set(const log4c_layout_type_t *a_type)
Definition layout.c:77
const log4c_layout_type_t * log4c_layout_type_get(const char *a_name)
Definition layout.c:63
void log4c_layout_delete(log4c_layout_t *a_layout)
Definition layout.c:131
void log4c_layout_types_free(void)
Definition layout.c:41
const log4c_layout_type_t * log4c_layout_get_type(const log4c_layout_t *a_layout)
Definition layout.c:147
void * log4c_layout_get_udata(const log4c_layout_t *a_layout)
Definition layout.c:168
struct __log4c_layout log4c_layout_t
Definition layout.h:36
const char * log4c_layout_format(const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
Definition layout.c:187
the internal representation of logging events.
log4c layout type class
Definition layout.h:46
logging event object
Definition logging_event.h:50