annotate lib-src/mule/fakelisp.h @ 140:585fb297b004 r20-2b4

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