]> rtime.felk.cvut.cz Git - ulut.git/blob - ulut/ul_logbuf.c
added support for logging, conditional compilation of ulcintf
[ulut.git] / ulut / ul_logbuf.c
1 /*******************************************************************
2   uLan Utilities Library - C library of basic reusable constructions
3
4   ul_logbuf.c   - circular log buffer
5
6   (C) Copyright 2006 by Pavel Pisa - Originator
7
8   The uLan utilities library can be used, copied and modified under
9   next licenses
10     - GPL - GNU General Public License
11     - LGPL - GNU Lesser General Public License
12     - MPL - Mozilla Public License
13     - and other licenses added by project originators
14   Code can be modified and re-distributed under any combination
15   of the above listed licenses. If contributor does not agree with
16   some of the licenses, he/she can delete appropriate line.
17   Warning, if you delete all lines, you are not allowed to
18   distribute source code and/or binaries utilizing code.
19   
20   See files COPYING and README for details.
21
22  *******************************************************************/
23
24 #ifndef __RTL__
25
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <sys/types.h>
29 #include <stdarg.h>
30
31 #else /*__RTL__*/
32
33 #include <rtl.h>
34 #include <string.h>
35 #include <signal.h>
36 #include <posix/unistd.h>
37
38 #endif /*__RTL__*/
39
40 #include "ul_utdefs.h"
41 #include "ul_logbase.h"
42
43 typedef struct ul_log_buff {
44   unsigned char *buf_beg;
45   unsigned char *buf_end;
46   unsigned char *ip;
47   unsigned char *op;
48 } ul_log_buff_t;
49
50
51 ul_log_domain_t *domain