File: common.h

package info (click to toggle)
vzlogger 0.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,140 kB
  • sloc: cpp: 12,020; sh: 331; ansic: 157; makefile: 25
file content (39 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_CONFIG_HPP
#include "config.hpp" /* GNU buildsystem config */
#else
#include "../config.h" /* GNU buildsystem config */
#endif

#include <VZException.hpp>
#include <shared_ptr.hpp>

/* enumerations */
typedef enum {
	log_alert = 0,
	log_error = 1,
	log_warning = 3,
	log_info = 5,
	log_debug = 10,
	log_finest = 15
} log_level_t;

typedef enum { parity_8n1, parity_7n1, parity_7e1, parity_7o1 } parity_type_t;
/* types */

/* constants */
#define SUCCESS 0
#define ERR -1
#define ERR_NOT_FOUND -2
#define ERR_INVALID_TYPE -3

/* prototypes */
void print(log_level_t lvl, const char *format, const char *id, ...);

#endif /* _COMMON_H_ */