xref: /netbsd-src/external/bsd/ntp/dist/sntp/libopts/autoopts/project.h (revision e61202360d5611414dd6f6115934a96aa1f50b1a)
1 /*	$NetBSD: project.h,v 1.1.1.1 2012/01/31 21:27:58 kardel Exp $	*/
2 
3 
4 #ifndef AUTOGEN_PROJECT_H
5 #define AUTOGEN_PROJECT_H
6 
7 #include "config.h"
8 
9 /*
10  *  Procedure success codes
11  *
12  *  USAGE:  define procedures to return "tSuccess".  Test their results
13  *          with the SUCCEEDED, FAILED and HADGLITCH macros.
14  *
15  *  Microsoft sticks its nose into user space here, so for Windows' sake,
16  *  make sure all of these are undefined.
17  */
18 #undef  SUCCESS
19 #undef  FAILURE
20 #undef  PROBLEM
21 #undef  SUCCEEDED
22 #undef  SUCCESSFUL
23 #undef  FAILED
24 #undef  HADGLITCH
25 
26 #define SUCCESS  ((tSuccess) 0)
27 #define FAILURE  ((tSuccess)-1)
28 #define PROBLEM  ((tSuccess) 1)
29 
30 typedef int tSuccess;
31 
32 #define SUCCEEDED(p)    ((p) == SUCCESS)
33 #define SUCCESSFUL(p)   SUCCEEDED(p)
34 #define FAILED(p)       ((p) <  SUCCESS)
35 #define HADGLITCH(p)    ((p) >  SUCCESS)
36 
37 #ifndef STR
38 #  define __STR(s)      #s
39 #  define STR(s)        __STR(s)
40 #endif
41 
42 #define STRSIZE(s)      (sizeof(s)-1)
43 
44 #ifdef DEFINING
45 #  define VALUE(s)      = s
46 #  define MODE
47 #else
48 #  define VALUE(s)
49 #  define MODE extern
50 #endif
51 
52 #endif /* AUTOGEN_PROJECT_H */
53