123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- #ifndef log4c_layout_h
- #define log4c_layout_h
- #include <log4c/defs.h>
- #include <log4c/logging_event.h>
- #include <stdio.h>
- __LOG4C_BEGIN_DECLS
- struct __log4c_layout;
- typedef struct __log4c_layout log4c_layout_t;
- typedef struct log4c_layout_type {
- const char* name;
- const char* (*format) (const log4c_layout_t*, const log4c_logging_event_t*);
- } log4c_layout_type_t;
- LOG4C_API const log4c_layout_type_t* log4c_layout_type_get(const char* a_name);
- LOG4C_API const log4c_layout_type_t* log4c_layout_type_set(
- const log4c_layout_type_t* a_type);
- LOG4C_API log4c_layout_t* log4c_layout_get(const char* a_name);
- LOG4C_API log4c_layout_t* log4c_layout_new(const char* a_name);
- LOG4C_API void log4c_layout_delete(log4c_layout_t* a_layout);
- LOG4C_API const char* log4c_layout_get_name(const log4c_layout_t* a_layout);
- LOG4C_API const log4c_layout_type_t* log4c_layout_get_type(
- const log4c_layout_t* a_layout);
- LOG4C_API const log4c_layout_type_t* log4c_layout_set_type(
- log4c_layout_t* a_layout,
- const log4c_layout_type_t* a_type);
- LOG4C_API void* log4c_layout_get_udata(const log4c_layout_t* a_layout);
- LOG4C_API void* log4c_layout_set_udata(log4c_layout_t* a_layout,
- void* a_udata);
- LOG4C_API const char* log4c_layout_format(
- const log4c_layout_t* a_layout,
- const log4c_logging_event_t* a_event);
- LOG4C_API void log4c_layout_print(
- const log4c_layout_t* a_layout, FILE* a_stream);
-
- LOG4C_API void log4c_layout_types_print(FILE *fp);
- LOG4C_API void log4c_layout_delete_global();
- #ifdef __GNUC__
- # define log4c_layout_type_define(a_type) \
- typedef int log4c_layout_type_define_##a_type __attribute__((deprecated)); \
- static log4c_layout_type_define_##a_type __unsused_var __attribute__((unused));
- #else
- # define log4c_layout_type_define(a_type)
- #endif
- struct __sd_factory;
- LOG4C_API struct __sd_factory* log4c_layout_factory;
- __LOG4C_END_DECLS
- #endif
|