layout.h
Go to the documentation of this file.
/* $Id: layout.h,v 1.8 2013/04/06 13:04:53 valtri Exp $
*
* layout.h
*
* Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#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_free(void);
LOG4C_API void log4c_layout_types_print(FILE *fp);
#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
log4c_layout_get_name
const char * log4c_layout_get_name(const log4c_layout_t *a_layout)
Definition layout.c:142
log4c_layout_set_udata
void * log4c_layout_set_udata(log4c_layout_t *a_layout, void *a_udata)
Definition layout.c:175
log4c_layout_set_type
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
log4c_layout_print
void log4c_layout_print(const log4c_layout_t *a_layout, FILE *a_stream)
Definition layout.c:205
log4c_layout_new
log4c_layout_t * log4c_layout_new(const char *a_name)
Definition layout.c:116
log4c_layout_type_t
struct log4c_layout_type log4c_layout_type_t
log4c layout type class
log4c_layout_types_print
void log4c_layout_types_print(FILE *fp)
Definition layout.c:49
log4c_layout_get
log4c_layout_t * log4c_layout_get(const char *a_name)
Definition layout.c:96
log4c_layout_type_set
const log4c_layout_type_t * log4c_layout_type_set(const log4c_layout_type_t *a_type)
Definition layout.c:78
log4c_layout_type_get
const log4c_layout_type_t * log4c_layout_type_get(const char *a_name)
Definition layout.c:64
log4c_layout_delete
void log4c_layout_delete(log4c_layout_t *a_layout)
Definition layout.c:132
log4c_layout_types_free
void log4c_layout_types_free(void)
Definition layout.c:42
log4c_layout_get_type
const log4c_layout_type_t * log4c_layout_get_type(const log4c_layout_t *a_layout)
Definition layout.c:148
log4c_layout_get_udata
void * log4c_layout_get_udata(const log4c_layout_t *a_layout)
Definition layout.c:169
log4c_layout_t
struct __log4c_layout log4c_layout_t
Definition layout.h:36
log4c_layout_format
const char * log4c_layout_format(const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
Definition layout.c:188
logging_event.h
the internal representation of logging events.
log4c_layout_type
log4c layout type class
Definition layout.h:46
log4c_logging_event_t
logging event object
Definition logging_event.h:50