1 /*===========================================================================
2 *
3 *                            PUBLIC DOMAIN NOTICE
4 *               National Center for Biotechnology Information
5 *
6 *  This software/database is a "United States Government Work" under the
7 *  terms of the United States Copyright Act.  It was written as part of
8 *  the author's official duties as a United States Government employee and
9 *  thus cannot be copyrighted.  This software/database is freely available
10 *  to the public for use. The National Library of Medicine and the U.S.
11 *  Government have not placed any restriction on its use or reproduction.
12 *
13 *  Although all reasonable efforts have been taken to ensure the accuracy
14 *  and reliability of the software and data, the NLM and the U.S.
15 *  Government do not and cannot warrant the performance or results that
16 *  may be obtained by using this software or data. The NLM and the U.S.
17 *  Government disclaim all warranties, express or implied, including
18 *  warranties of performance, merchantability or fitness for any particular
19 *  purpose.
20 *
21 *  Please cite the author in any work or product based on this material.
22 *
23 * ===========================================================================
24 *
25 */
26 
27 #ifndef _hpp_vdb3_kfc_defs_
28 #define _hpp_vdb3_kfc_defs_
29 
30 #include <stddef.h>
31 #include <stdint.h>
32 #include <stdarg.h>
33 #include <assert.h>
34 
35 namespace vdb3
36 {
37 
38     // raw integer number types
39     typedef int8_t I8;
40     typedef int16_t I16;
41     typedef int32_t I32;
42     typedef int64_t I64;
43 
44     // raw natural number types
45     typedef uint8_t U8;
46     typedef uint16_t U16;
47     typedef uint32_t U32;
48     typedef uint64_t U64;
49 
50     // raw real number types
51     typedef float F32;
52     typedef double F64;
53 
54     // raw character types
55     typedef char ascii, UTF8;
56     typedef U32 UTF32;
57 
58     // raw capabilities
59     typedef U64 caps_t;
60     typedef U64 rcaps_t;
61 
62     // an item count
63     typedef U64 count_t;
64 
65     // an ordinal index
66     typedef I64 index_t;
67 
68     // size of an item in bits
69     class bitsz_t;
70 
71     // size of an item in bytes
72     class bytes_t;
73 
74     // a timeout
75     class timeout_t;
76 
77     // a data type
78     class type_t;
79 
80     // a multi-part version number
81     class vers_t;
82 
83     // even though I generally hate this kind of thing,
84     // it will make some portions of the code more readable
85     // look for interface declarations and implementations
86 #undef interface
87 #define interface struct
88 #undef implements
89 #define implements public
90 }
91 
92 // turn the value of a pp-symbol into a string
93 #define stringize( tok ) tok_to_string ( tok )
94 #define tok_to_string( tok ) # tok
95 
96 // generate string values for SrcLoc
97 #if ! defined __mod__ && defined __mod_path__
98 #define __mod__ stringize ( __mod_path__ )
99 #endif
100 
101 #if ! defined __file__ && defined __file_name__
102 #define __file__ stringize ( __file_name__ )
103 #endif
104 
105 #if ! defined __fext__ && defined __file_ext__
106 #define __fext__ stringize ( __file_ext__ )
107 #endif
108 
109 #ifndef _hpp_vdb3_kfc_integer_
110 #include "integer.hpp"
111 #endif
112 
113 #endif // _hpp_vdb3_kfc_defs_
114