initial
[prop.git] / include / AD / persist / pconfig.h
blobc8f67088f05e236930eb1070ed4531bfe1474fe9
1 //////////////////////////////////////////////////////////////////////////////
2 // NOTICE:
3 //
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are welcomed to incorporate any part of ADLib and Prop into
9 // your programs.
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
16 // code.
18 // This software is still under development and we welcome(read crave for)
19 // any suggestions and help from the users.
21 // Allen Leung
22 // 1994
23 //////////////////////////////////////////////////////////////////////////////
25 #ifndef persistent_configuration_h
26 #define persistent_configuration_h
28 //////////////////////////////////////////////////////////////////////////////
29 // Hardwired types with fixed sizes.
30 //////////////////////////////////////////////////////////////////////////////
31 typedef char P_char;
32 typedef unsigned char P_uchar;
33 typedef short P_int16;
34 typedef unsigned short P_uint16;
35 typedef long P_int32;
36 typedef unsigned long P_uint32;
37 typedef float P_real32;
38 typedef double P_real64;
40 typedef P_int32 P_OBJECT_TYPEID;
41 typedef P_int32 P_OBJECT_MARKER;
43 //////////////////////////////////////////////////////////////////////////////
44 // Special control tags
45 //////////////////////////////////////////////////////////////////////////////
46 #ifdef PSTREAM_IMPLEMENTATION
47 typedef P_int32 P_STREAM_TAG;
48 typedef P_uint32 P_ObjectAddr;
49 //typedef void * P_ObjectAddr;
51 #define P_VERSION_STRING "ADLIB persistent store format version 1.0"
52 #define P_GROUP_START_TAG P_STREAM_TAG(0xff00)
53 #define P_GROUP_END_TAG P_STREAM_TAG(0xff01)
54 #define P_VERSION_TAG P_STREAM_TAG(0xff02)
55 #define P_DOCUMENTATION_TAG P_STREAM_TAG(0xff03)
56 #define P_DATA_TAG P_STREAM_TAG(0xff04)
57 #define P_NEW_OBJECT_TAG P_STREAM_TAG(0xff05)
58 #define P_OBJECT_NAME_TAG P_STREAM_TAG(0xff11)
59 #define P_OBJECT_ID_TAG P_STREAM_TAG(0xff12)
60 #define P_STRING_TAG P_STREAM_TAG(0xff13)
61 #define P_NULL_STRING_TAG P_STREAM_TAG(0xff14)
63 #define P_FIRST_MARKER P_OBJECT_MARKER(-4096)
65 #define P_IS_MARKER(m) ((m) <= P_FIRST_MARKER)
66 #define P_IS_UNBOXED(p) (P_uint32(p) < -P_FIRST_MARKER)
67 #define P_IS_TYPEID(id) ((id) > 0)
68 #define P_IS_NEW_OBJECT(m) ((m) == P_NEW_OBJECT_TAG)
70 #define P_ADDR_MASK P_ObjectAddr(0xcdcdcdcd)
71 #define P_WRAP_ADDR(addr) (P_ObjectAddr(addr) ^ P_ADDR_MASK)
72 //#define P_WRAP_ADDR(addr) (P_ObjectAddr(addr))
73 #endif
75 #endif