Main Page | Modules | File List | Globals

lwl.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of Log Writer Library (LWL).
00003  * Copyright (C) 2002, 2003, 2004, 2005 Nicolas Darnis <ndarnis@free.fr>
00004  *
00005  * The LWL library is free software; you can redistribute it and/or 
00006  * modify it under the terms of the GNU General Public License as 
00007  * published by the Free Software Foundation; either version 2 of
00008  * the License, or (at your option) any later version.
00009  *
00010  * The LWL library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with the LWL library; see the file COPYING.
00017  * If not, write to the Free Software Foundation, Inc., 
00018  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
00019  *
00020  * $RCSfile: lwl_8h-source.html,v $
00021  * $Revision: 1.1 $
00022  * $Date: 2005/01/05 16:05:21 $
00023  */
00024 
00025 #ifndef _LWL_H_
00026 #define _LWL_H_
00027 
00028 #include <stdio.h>
00029 
00030 
00031 #if defined (__cplusplus)
00032 extern "C" {
00033 #endif /* __cplusplus */
00034 
00035 
00049 typedef enum 
00050 {
00052   LWL_TAG_DONE = 0,
00053 
00055   LWL_TAG_LEVEL,
00056 
00058   LWL_TAG_PREFIX,
00059 
00061   LWL_TAG_OPTIONS,  
00062 
00064   LWL_TAG_FILE,
00065 
00067   LWL_TAG_FILE_EMERG,
00068 
00070   LWL_TAG_FILE_ALERT,
00071 
00073   LWL_TAG_FILE_CRIT,
00074 
00076   LWL_TAG_FILE_ERR,
00077 
00079   LWL_TAG_FILE_WARNING,
00080 
00082   LWL_TAG_FILE_NOTICE,
00083 
00085   LWL_TAG_FILE_INFO,
00086 
00088   LWL_TAG_FILE_DEBUG
00089 
00090 } lwl_tag_t;
00091 
00103 typedef enum 
00104 {
00106   LWL_OPT_NONE=0,
00107 
00109   LWL_OPT_PERROR=1,   
00110 
00112   LWL_OPT_PID=2,  
00113 
00115   LWL_OPT_DATE=4, 
00116 
00118   LWL_OPT_TIME=8, 
00119 
00121   LWL_OPT_IP=16, 
00122 
00124   LWL_OPT_ADR=32,  
00125 
00127   LWL_OPT_PRIORITY=64,  
00128 
00130   LWL_OPT_PREFIX=128, 
00131 
00133   LWL_OPT_NO_FLUSH=256,
00134 
00136   LWL_OPT_USE_LOCALE=512
00137 
00138 } lwl_option_t;
00139 
00147 typedef enum 
00148 {
00150   LWL_PRI_EMERG=0,
00151 
00153   LWL_PRI_ALERT=1,
00154 
00156   LWL_PRI_CRIT=2,
00157 
00159   LWL_PRI_ERR=3,
00160 
00162   LWL_PRI_WARNING=4,
00163 
00165   LWL_PRI_NOTICE=5,
00166 
00168   LWL_PRI_INFO=6,
00169 
00171   LWL_PRI_DEBUG=7
00172 
00173 } lwl_priority_t;
00174 
00181 typedef struct _lwl_handle *lwlh_t;
00182 
00202 extern lwlh_t 
00203 lwl_alloc (void);
00204 
00214 extern void
00215 lwl_free (lwlh_t HANDLE
00216       );
00217 
00247 extern void
00248 lwl_write_log (lwlh_t HANDLE,
00249            lwl_priority_t PRI,
00250            char *FORMAT,
00251            ...
00252            );
00253 
00279 extern int
00280 lwl_set_attributes (lwlh_t HANDLE,
00281             lwl_tag_t TAGS,
00282             ...
00283             );
00284 
00291 extern lwl_priority_t
00292 lwl_get_log_level (const lwlh_t HANDLE
00293            );
00294 
00301 extern FILE*
00302 lwl_get_default_log_file (const lwlh_t HANDLE
00303               );
00304 
00309 #define lwl_get_log_file(h) lwl_get_default_log_file(h)
00310 
00320 extern const char*
00321 lwl_get_hostname (lwlh_t HANDLE
00322           );
00323 
00324 
00325 /*
00326  * @}
00327  */
00328 
00329 
00330 #ifdef __cplusplus
00331 }
00332 #endif/* __cplusplus */
00333 
00334 
00335 #endif /* _LWL_H_ */
00336 

Generated on Wed Jan 5 16:54:39 2005 for LWL by doxygen 1.3.5