# appender.h

Go to the documentation of this file.

    00001 /* $Id$
    00002  *
    00003  * appender.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_appender_h
    00011 #define log4c_appender_h
    00012
    00023 #include <log4c/defs.h>
    00024 #include <log4c/layout.h>
    00025 #include <stdio.h>
    00026
    00027 __LOG4C_BEGIN_DECLS
    00028
    00029 struct __log4c_appender;
    00030
    00034 typedef struct __log4c_appender log4c_appender_t;
    00035
    00046 typedef struct log4c_appender_type {
    00047     const char*   name;
    00048     int (*open)   (log4c_appender_t*);
    00049     int (*append) (log4c_appender_t*, const log4c_logging_event_t*);
    00050     int (*close)  (log4c_appender_t*);
    00051 } log4c_appender_type_t;
    00052
    00060 LOG4C_API const log4c_appender_type_t* log4c_appender_type_get(const char* a_name);
    00061
    00084 LOG4C_API const log4c_appender_type_t* log4c_appender_type_set(
    00085     const log4c_appender_type_t* a_type);
    00086
    00094 LOG4C_API log4c_appender_t* log4c_appender_get(const char* a_name);
    00095
    00099 LOG4C_API log4c_appender_t* log4c_appender_new(const char* a_name);
    00100
    00104 LOG4C_API void log4c_appender_delete(log4c_appender_t* a_appender);
    00105
    00110 LOG4C_API const char* log4c_appender_get_name(const log4c_appender_t* a_appender);
    00111
    00116 LOG4C_API const log4c_appender_type_t* log4c_appender_get_type(
    00117     const log4c_appender_t* a_appender);
    00118
    00123 LOG4C_API const log4c_layout_t* log4c_appender_get_layout(
    00124     const log4c_appender_t* a_appender);
    00125
    00130 LOG4C_API void* log4c_appender_get_udata(const log4c_appender_t* a_appender);
    00131
    00139 LOG4C_API const log4c_appender_type_t* log4c_appender_set_type(
    00140     log4c_appender_t* a_appender,
    00141     const log4c_appender_type_t* a_type);
    00142
    00150 LOG4C_API void* log4c_appender_set_udata(log4c_appender_t*      a_appender,
    00151                                       void* a_udata);
    00152
    00160 LOG4C_API const log4c_layout_t* log4c_appender_set_layout(
    00161     log4c_appender_t* a_appender,
    00162     const log4c_layout_t* a_layout);
    00163
    00169 LOG4C_API int log4c_appender_open(log4c_appender_t* a_appender);
    00170
    00177 LOG4C_API int log4c_appender_append(
    00178     log4c_appender_t* a_appender,
    00179     log4c_logging_event_t* a_event);
    00180
    00187 LOG4C_API int log4c_appender_close(log4c_appender_t* a_appender);
    00188
    00195 LOG4C_API void log4c_appender_print(const log4c_appender_t* a_appender,
    00196                                  FILE* a_stream);
    00197
    00203 LOG4C_API void log4c_appender_types_print(FILE *fp);
    00204
    00216 #ifdef __GNUC__
    00217 #   define log4c_appender_type_define(a_type) \
    00218     typedef int log4c_appender_type_define_##a_type __attribute__((deprecated)); \
    00219     static log4c_appender_type_define_##a_type __unsused_var __attribute__ ((unused));
    00220 #else
    00221 #   define log4c_appender_type_define(a_type)
    00222 #endif
    00223
    00227 struct __sd_factory;
    00228 LOG4C_API struct __sd_factory* log4c_appender_factory;
    00229
    00230 __LOG4C_END_DECLS
    00231
    00232 #endif