annotate lib-src/fakelisp.h @ 9:6f2bbbbbe05a

Added tag r19-15b5 for changeset 4b173ad71786
author cvs
date Mon, 13 Aug 2007 08:47:36 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 #ifndef _FAKELISP_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 #define _FAKELISP_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 /* Cancel substitutions made by config.h for Emacs. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 #undef open
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 #undef read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 #undef write
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 #undef close
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 /* We used to test for `BSTRING' here, but only GCC and Emacs define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 `BSTRING', as far as I know, and neither of them use this code. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 #if HAVE_STRING_H || STDC_HEADERS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 #include <string.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 #ifndef bcmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 #ifndef bcopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 #define bcopy(s, d, n) memcpy ((d), (s), (n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 #ifndef bzero
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #define bzero(s, n) memset ((s), 0, (n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include <strings.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 typedef unsigned int Lisp_Object;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 enum Lisp_Type {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 Lisp_Int,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 Lisp_Symbol,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 Lisp_String,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Lisp_Vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #ifndef VALBITS /* hir, 1994.12.19 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #define VALBITS 24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #define VALMASK ((1 << VALBITS) - 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #define XTYPE(x) ((enum Lisp_Type)((x)>>VALBITS))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 struct Lisp_Vector {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 int size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 Lisp_Object *contents;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 struct Lisp_String {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 int size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 unsigned char *data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 struct Lisp_Symbol {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 unsigned char *name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 Lisp_Object value;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #define Qnil (Lisp_Object)(Lisp_Symbol << VALBITS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 #define Qt (Lisp_Object)((Lisp_Symbol << VALBITS) | 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define XFASTINT(x) (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #define XVECTOR(x) ((struct Lisp_Vector *)Lisp_Object_Table[(x)&VALMASK])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #define XSTRING(x) ((struct Lisp_String *)Lisp_Object_Table[(x)&VALMASK])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #define XSYMBOL(x) ((struct Lisp_Symbol *)Lisp_Object_Table[(x)&VALMASK])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 extern void *Lisp_Object_Table[4096];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 extern Lisp_Object make_vector(), make_string(), make_symbol();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 extern Lisp_Object Fsymbol_value();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #define GLYPH unsigned int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 #endif /* _FAKELISP_H */