.TH "layout.h" 3 "Mon May 2 2011" "Version 1.2.1" "log4c" \" -*- nroff -*- .ad l .nh .SH NAME layout.h \- .PP Interface for user specific layout format of log4c_logging_event events. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBlog4c_layout_type\fP" .br .RI "\fIlog4c layout type class \fP" .in -1c .SS "Defines" .in +1c .ti -1c .RI "#define \fBlog4c_layout_type_define\fP(a_type)" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct __log4c_layout \fBlog4c_layout_t\fP" .br .ti -1c .RI "typedef struct \fBlog4c_layout_type\fP \fBlog4c_layout_type_t\fP" .br .RI "\fIlog4c layout type class \fP" .in -1c .SS "Functions" .in +1c .ti -1c .RI "LOG4C_API const \fBlog4c_layout_type_t\fP * \fBlog4c_layout_type_get\fP (const char *a_name)" .br .ti -1c .RI "LOG4C_API const \fBlog4c_layout_type_t\fP * \fBlog4c_layout_type_set\fP (const \fBlog4c_layout_type_t\fP *a_type)" .br .ti -1c .RI "LOG4C_API \fBlog4c_layout_t\fP * \fBlog4c_layout_get\fP (const char *a_name)" .br .ti -1c .RI "LOG4C_API \fBlog4c_layout_t\fP * \fBlog4c_layout_new\fP (const char *a_name)" .br .ti -1c .RI "LOG4C_API void \fBlog4c_layout_delete\fP (\fBlog4c_layout_t\fP *a_layout)" .br .ti -1c .RI "LOG4C_API const char * \fBlog4c_layout_get_name\fP (const \fBlog4c_layout_t\fP *a_layout)" .br .ti -1c .RI "LOG4C_API const \fBlog4c_layout_type_t\fP * \fBlog4c_layout_get_type\fP (const \fBlog4c_layout_t\fP *a_layout)" .br .ti -1c .RI "LOG4C_API const \fBlog4c_layout_type_t\fP * \fBlog4c_layout_set_type\fP (\fBlog4c_layout_t\fP *a_layout, const \fBlog4c_layout_type_t\fP *a_type)" .br .ti -1c .RI "LOG4C_API void * \fBlog4c_layout_get_udata\fP (const \fBlog4c_layout_t\fP *a_layout)" .br .ti -1c .RI "LOG4C_API void * \fBlog4c_layout_set_udata\fP (\fBlog4c_layout_t\fP *a_layout, void *a_udata)" .br .ti -1c .RI "LOG4C_API const char * \fBlog4c_layout_format\fP (const \fBlog4c_layout_t\fP *a_layout, const \fBlog4c_logging_event_t\fP *a_event)" .br .ti -1c .RI "LOG4C_API void \fBlog4c_layout_print\fP (const \fBlog4c_layout_t\fP *a_layout, FILE *a_stream)" .br .ti -1c .RI "LOG4C_API void \fBlog4c_layout_types_print\fP (FILE *fp)" .br .in -1c .SH "Detailed Description" .PP Interface for user specific layout format of log4c_logging_event events. \fBTodo\fP .RS 4 the layout interface needs a better configuration system depending on the layout type. The udata field is a just a trick. .RE .PP .PP \fBTodo\fP .RS 4 a pattern layout would be welcomed !! .RE .PP .SH "Define Documentation" .PP .SS "#define log4c_layout_type_define(a_type)"Helper macro to define static layout types. .PP \fBParameters:\fP .RS 4 \fIa_type\fP the log4c_layout_type_t object to define .RE .PP \fBWarning:\fP .RS 4 needs GCC support: otherwise this macro does nothing .RE .PP \fBDeprecated\fP .RS 4 This macro, and the static initialialization of layouts in general, is deprecated. Use rather the \fBlog4c_layout_type_set()\fP function to initialize your appenders before calling \fBlog4c_init()\fP .RE .PP .SH "Typedef Documentation" .PP .SS "typedef struct __log4c_layout \fBlog4c_layout_t\fP"log4c layout class .SS "typedef struct \fBlog4c_layout_type\fP \fBlog4c_layout_type_t\fP" .PP log4c layout type class Attributes description: .PP .PD 0 .IP "\(bu" 2 \fCname\fP layout type name .IP "\(bu" 2 \fCformat\fP .PP .SH "Function Documentation" .PP .SS "LOG4C_API void log4c_layout_delete (\fBlog4c_layout_t\fP *a_layout)"Destructor for layout. .SS "LOG4C_API const char* log4c_layout_format (const \fBlog4c_layout_t\fP *a_layout, const \fBlog4c_logging_event_t\fP *a_event)"format a log4c_logging_event events to a string. .PP \fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .br \fIa_event\fP a logging_event_t object .RE .PP \fBReturns:\fP .RS 4 an appendable string. .RE .PP .SS "LOG4C_API \fBlog4c_layout_t\fP* log4c_layout_get (const char *a_name)"Get a pointer to an existing layout. .PP \fBParameters:\fP .RS 4 \fIa_name\fP the name of the layout to return. .RE .PP \fBReturns:\fP .RS 4 a pointer to an existing layout, or NULL if no layout with the specfied name exists. .RE .PP .SS "LOG4C_API const char* log4c_layout_get_name (const \fBlog4c_layout_t\fP *a_layout)"\fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .RE .PP \fBReturns:\fP .RS 4 the layout name .RE .PP .SS "LOG4C_API const \fBlog4c_layout_type_t\fP* log4c_layout_get_type (const \fBlog4c_layout_t\fP *a_layout)"\fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .RE .PP \fBReturns:\fP .RS 4 a log4c_layout_type_t object .RE .PP .SS "LOG4C_API void* log4c_layout_get_udata (const \fBlog4c_layout_t\fP *a_layout)"\fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .RE .PP \fBReturns:\fP .RS 4 the layout user data .RE .PP .SS "LOG4C_API \fBlog4c_layout_t\fP* log4c_layout_new (const char *a_name)"Constructor for layout. .SS "LOG4C_API void log4c_layout_print (const \fBlog4c_layout_t\fP *a_layout, FILE *a_stream)"prints the layout on a stream .PP \fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .br \fIa_stream\fP the stream .RE .PP .SS "LOG4C_API const \fBlog4c_layout_type_t\fP* log4c_layout_set_type (\fBlog4c_layout_t\fP *a_layout, const \fBlog4c_layout_type_t\fP *a_type)"sets the layout type .PP \fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .br \fIa_type\fP the new layout type .RE .PP \fBReturns:\fP .RS 4 the previous layout type .RE .PP .SS "LOG4C_API void* log4c_layout_set_udata (\fBlog4c_layout_t\fP *a_layout, void *a_udata)"sets the layout user data .PP \fBParameters:\fP .RS 4 \fIa_layout\fP the log4c_layout_t object .br \fIa_udata\fP the new layout user data .RE .PP \fBReturns:\fP .RS 4 the previous layout user data .RE .PP .SS "LOG4C_API const \fBlog4c_layout_type_t\fP* log4c_layout_type_get (const char *a_name)"Get a pointer to an existing layout type. .PP \fBParameters:\fP .RS 4 \fIa_name\fP the name of the layout type to return. .RE .PP \fBReturns:\fP .RS 4 a pointer to an existing layout type, or NULL if no layout type with the specified name exists. .RE .PP .SS "LOG4C_API const \fBlog4c_layout_type_t\fP* log4c_layout_type_set (const \fBlog4c_layout_type_t\fP *a_type)"Use this function to register a layout type with log4c. Once this is done you may refer to this type by name both programatically and in the log4c configuration file. .PP \fBParameters:\fP .RS 4 \fIa_type\fP a pointer to the new layout type to set. .RE .PP \fBReturns:\fP .RS 4 a pointer to the previous layout type of same name. .RE .PP Example code fragment: .PP .nf const log4c_layout_type_t log4c_layout_type_xml = { 's13_xml', xml_format, }; log4c_layout_type_set(&log4c_layout_type_xml); .fi .PP .SS "LOG4C_API void log4c_layout_types_print (FILE *fp)"prints all the current registered layout types on a stream .PP \fBParameters:\fP .RS 4 \fIfp\fP the stream .RE .PP .SH "Author" .PP Generated automatically by Doxygen for log4c from the source code.