File: constants.h

package info (click to toggle)
cdebconf 0.138lenny3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,184 kB
  • ctags: 1,371
  • sloc: ansic: 14,158; sh: 469; makefile: 429; sql: 51; perl: 13
file content (39 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (4)
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
/**
 *
 * @file common.h
 *
 * @brief Common constants.  Useful for plugin developers, therefor
 * split into its own file.  Also some useful macros
 *
 *
 */
#ifndef _CDEBCONF_CONSTANTS_H_
#define _CDEBCONF_CONSTANTS_H_

/**
 * @def DEBCONF_MAX_CONFIGPATH_LEN
 * @brief maximum length of a configuration path to a configuration
 */
#define DEBCONF_MAX_CONFIGPATH_LEN  128

#define DC_NOTOK	0
#define DC_OK		1
#define DC_NOTIMPL	2
#define DC_AUTHNEEDED	3
#define DC_REJECT	4

#define DC_GOBACK	30

#define DC_NO		0
#define DC_YES		1

#define INFO_ERROR	0
#define INFO_WARN	1
#define INFO_DEBUG	5
#define INFO_VERBOSE	20

#define NEW(type) (type *)malloc(sizeof(type))
#define DELETE(x) do { if (x) free(x); x = 0; } while (0)
#define CHOMP(s) do { if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0'; } while (0)

#endif /* CDEBCONF_CONSTANTS_H */