annotate src/tests.c @ 450:98528da0b7fc r21-2-40

Import from CVS: tag r21-2-40
author cvs
date Mon, 13 Aug 2007 11:39:20 +0200
parents 74fd4e045ea6
children 4a8bb4aa9740
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
1 /* C support for testing XEmacs - see tests/automated/c-tests.el
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
2 Copyright (C) 2000 Martin Buchholz
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
3
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
4 This file is part of XEmacs.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
5
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
9 later version.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
10
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
14 for more details.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
15
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
20
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
21 /* Author: Martin Buchholz
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
22
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
23 This file provides support for running tests for XEmacs that cannot
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
24 be written entirely in Lisp. These tests are run automatically via
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
25 tests/automated/c-tests.el, or can be run by hand using M-x */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
26
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
27
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
28 #include <config.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
29 #include "lisp.h"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
30 #include "buffer.h"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
31 #include "lstream.h"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
32 #include "opaque.h"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
33
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
34 static Lisp_Object Vtest_function_list;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
35
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
36
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
37 DEFUN ("test-data-format-conversion", Ftest_data_format_conversion, 0, 0, "", /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
38 Test TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT()
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
39 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
40 ())
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
41 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
42 void *ptr; size_t len;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
43 Lisp_Object string, opaque;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
44
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
45 Bufbyte int_foo[] = "\n\nfoo\nbar";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
46 Extbyte ext_unix[]= "\n\nfoo\nbar";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
47
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
48 Extbyte ext_dos[] = "\r\n\r\nfoo\r\nbar";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
49 Extbyte ext_mac[] = "\r\rfoo\rbar";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
50 Lisp_Object opaque_dos = make_opaque (ext_dos, sizeof (ext_dos) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
51 Lisp_Object string_foo = make_string (int_foo, sizeof (int_foo) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
52
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
53 Extbyte ext_latin[] = "f\372b\343\340";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
54 Bufbyte int_latin1[] = "f\201\372b\201\343\201\340";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
55 Bufbyte int_latin2[] = "f\202\372b\202\343\202\340";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
56 #ifdef MULE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
57 Extbyte ext_latin12[]= "f\033-A\372b\343\340\033-B";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
58 Extbyte ext_tilde[] = "f~b~~";
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
59 Lisp_Object string_latin2 = make_string (int_latin2, sizeof (int_latin2) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
60 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
61 Lisp_Object opaque_latin = make_opaque (ext_latin, sizeof (ext_latin) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
62 Lisp_Object opaque0_latin = make_opaque (ext_latin, sizeof (ext_latin));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
63 Lisp_Object string_latin1 = make_string (int_latin1, sizeof (int_latin1) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
64
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
65 /* Check for expected strings before and after conversion.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
66 Conversions depend on whether MULE is defined,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
67 and on whether FILE_CODING is defined. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
68 #ifdef MULE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
69 #define DFC_CHECK_DATA_COND_MULE(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
70 constant_string_mule, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
71 constant_string_non_mule) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
72 DFC_CHECK_DATA (ptr, len, constant_string_mule)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
73 #define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
74 constant_string_mule, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
75 constant_string_non_mule) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
76 DFC_CHECK_DATA_NUL (ptr, len, constant_string_mule)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
77 #else
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
78 #define DFC_CHECK_DATA_COND_MULE(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
79 constant_string_mule, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
80 constant_string_non_mule) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
81 DFC_CHECK_DATA (ptr, len, constant_string_non_mule)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
82 #define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
83 constant_string_mule, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
84 constant_string_non_mule) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
85 DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_mule)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
86 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
87
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
88 #ifdef FILE_CODING
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
89 #define DFC_CHECK_DATA_COND_EOL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
90 constant_string_eol, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
91 constant_string_non_eol) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
92 DFC_CHECK_DATA (ptr, len, constant_string_eol)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
93 #define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
94 constant_string_eol, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
95 constant_string_non_eol) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
96 DFC_CHECK_DATA_NUL (ptr, len, constant_string_eol)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
97 #else
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
98 #define DFC_CHECK_DATA_COND_EOL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
99 constant_string_eol, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
100 constant_string_non_eol) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
101 DFC_CHECK_DATA (ptr, len, constant_string_non_eol)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
102 #define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
103 constant_string_eol, \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
104 constant_string_non_eol) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
105 DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_eol)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
106 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
107
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
108 /* Check for expected strings before and after conversion. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
109 #define DFC_CHECK_DATA(ptr,len, constant_string) do { \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
110 assert ((len) == sizeof (constant_string) - 1); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
111 assert (!memcmp (ptr, constant_string, len)); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
112 } while (0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
113
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
114 /* Macro version that includes the trailing NULL byte. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
115 #define DFC_CHECK_DATA_NUL(ptr,len,constant_string) do {\
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
116 assert ((len) == sizeof (constant_string)); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
117 assert (!memcmp (ptr, constant_string, len)); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
118 } while (0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
119
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
120 #ifdef MULE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
121 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
122 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
123 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
124 Fget_coding_system (intern ("iso-8859-2")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
125 DFC_CHECK_DATA_NUL (ptr, len, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
126
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
127 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
128 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin2,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
129 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
130 Fget_coding_system (intern ("iso-8859-2")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
131 DFC_CHECK_DATA (ptr, len, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
132
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
133 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
134 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
135 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
136 Fget_coding_system (intern ("iso-8859-2")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
137 DFC_CHECK_DATA (ptr, len, ext_latin12);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
138
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
139 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
140 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
141 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
142 Fget_coding_system (intern ("iso-8859-2")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
143 DFC_CHECK_DATA (ptr, len, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
144 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
145
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
146 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
147 LISP_OPAQUE, opaque,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
148 Fget_coding_system (intern ("iso-8859-2")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
149 DFC_CHECK_DATA (XOPAQUE_DATA (opaque), XOPAQUE_SIZE (opaque), ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
150
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
151 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
152 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
153 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
154 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
155 DFC_CHECK_DATA (ptr, len, int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
156
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
157 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
158 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
159 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
160 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
161 DFC_CHECK_DATA (ptr, len, int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
162 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
163
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
164 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
165 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
166 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
167 DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
168
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
169 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
170 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
171 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
172 DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
173
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
174 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
175 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
176 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
177 DFC_CHECK_DATA_NUL (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
178
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
179 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
180 LISP_BUFFER, Fcurrent_buffer(),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
181 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
182 DFC_CHECK_DATA_NUL (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
183 sizeof (int_latin2), int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
184
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
185 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
186 LISP_BUFFER, Fcurrent_buffer(),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
187 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
188 DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
189 sizeof (int_latin1) - 1, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
190
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
191 TO_INTERNAL_FORMAT (DATA, (ext_latin12, sizeof (ext_latin12) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
192 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
193 intern ("iso-8859-2"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
194 DFC_CHECK_DATA (ptr, len, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
195
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
196 #endif /* MULE */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
197
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
198 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
199 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
200 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
201 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
202 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
203
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
204 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
205 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
206 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
207 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
208 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
209
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
210 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
211 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
212 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
213 Fget_coding_system (Qbinary));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
214 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_tilde, int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
215
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
216 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
217 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
218 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
219 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
220 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
221
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
222
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
223 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
224 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
225 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
226 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
227 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
228
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
229 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
230 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
231 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
232 Fget_coding_system (Qbinary));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
233 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
234
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
235 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
236 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
237 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
238 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
239 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
240
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
241 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
242 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
243 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
244 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
245 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
246 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
247
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
248 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
249 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
250 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
251 Fget_coding_system (Qbinary));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
252 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_tilde, int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
253 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
254
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
255 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
256 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
257 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
258 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
259 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
260 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
261
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
262 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
263 LISP_OPAQUE, opaque,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
264 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
265 DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
266 XOPAQUE_SIZE (opaque), ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
267
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
268 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
269 LISP_OPAQUE, opaque,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
270 Fget_coding_system (Qbinary));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
271 DFC_CHECK_DATA_COND_MULE_NUL (XOPAQUE_DATA (opaque),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
272 XOPAQUE_SIZE (opaque), ext_tilde, int_latin2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
273
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
274 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
275 LISP_OPAQUE, opaque,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
276 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
277 DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
278 XOPAQUE_SIZE (opaque), ext_latin, int_latin1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
279
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
280 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
281 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
282 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
283 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
284 DFC_CHECK_DATA_COND_MULE (ptr, len, int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
285
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
286 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
287 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
288 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
289 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
290 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
291
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
292 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
293 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
294 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
295 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
296 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
297 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
298
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
299 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
300 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
301 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
302 Qnil);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
303 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
304 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
305
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
306 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
307 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
308 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
309 DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
310 XSTRING_LENGTH (string), int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
311
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
312 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
313 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
314 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
315 DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
316 XSTRING_LENGTH (string), int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
317
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
318 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
319 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
320 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
321 DFC_CHECK_DATA_COND_MULE_NUL (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
322 XSTRING_LENGTH (string), int_latin1, ext_latin);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
323
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
324
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
325 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
326 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
327 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
328 Fget_coding_system (Qbinary));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
329 DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
330 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
331
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
332 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
333 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
334 LISP_OPAQUE, opaque,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
335 intern ("raw-text-mac"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
336 DFC_CHECK_DATA_COND_EOL (XOPAQUE_DATA (opaque),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
337 XOPAQUE_SIZE (opaque), ext_mac, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
338
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
339 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
340 TO_EXTERNAL_FORMAT (LISP_STRING, string_foo,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
341 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
342 intern ("raw-text-dos"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
343 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
344
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
345 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
346 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
347 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
348 intern ("raw-text-unix"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
349 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_unix, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
350
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
351 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
352 TO_EXTERNAL_FORMAT (LISP_STRING, string_foo,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
353 MALLOC, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
354 intern ("no-conversion-mac"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
355 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_mac, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
356 xfree (ptr);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
357
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
358 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
359 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
360 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
361 Fget_coding_system (intern ("no-conversion-dos")));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
362 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
363
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
364 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
365 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
366 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
367 intern ("no-conversion-unix"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
368 DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
369
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
370 #ifdef FILE_CODING
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
371 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_dos,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
372 LISP_BUFFER, Fcurrent_buffer(),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
373 intern ("undecided"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
374 DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
375 sizeof (int_foo) - 1, int_foo);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
376
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
377 #endif /* FILE_CODING */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
378
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
379 TO_INTERNAL_FORMAT (DATA, (ext_mac, sizeof (ext_mac) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
380 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
381 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
382 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
383 XSTRING_LENGTH (string), int_foo, ext_mac);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
384
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
385 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
386 Lisp_Object stream =
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
387 make_fixed_buffer_input_stream (ext_dos, sizeof (ext_dos) - 1);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
388 TO_INTERNAL_FORMAT (LISP_LSTREAM, stream,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
389 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
390 intern ("iso-8859-1"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
391 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
392 XSTRING_LENGTH (string), int_foo, ext_dos);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
393 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
394
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
395 TO_INTERNAL_FORMAT (DATA, (ext_unix, sizeof (ext_unix) - 1),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
396 LISP_STRING, string,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
397 intern ("no-conversion"));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
398 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
399 XSTRING_LENGTH (string), int_foo, ext_unix);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
400
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
401
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
402 ptr = NULL, len = rand();
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
403 TO_EXTERNAL_FORMAT (LISP_OPAQUE, opaque_dos,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
404 ALLOCA, (ptr, len),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
405 Qbinary);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
406 DFC_CHECK_DATA (ptr, len, ext_dos);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
407
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
408 return intern ("PASS");
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
409 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
410
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
411
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
412
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
413 #define TESTS_DEFSUBR(Fname) do { \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
414 DEFSUBR (Fname); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
415 Vtest_function_list = \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
416 Fcons (intern (subr_name (&S##Fname)), \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
417 Vtest_function_list); \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
418 } while (0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
419
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
420 void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
421 syms_of_tests (void)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
422 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
423 Vtest_function_list = Qnil;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
424
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
425 TESTS_DEFSUBR (Ftest_data_format_conversion);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
426 /* Add other test functions here with TESTS_DEFSUBR */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
427 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
428
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
429 void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
430 vars_of_tests (void)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
431 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
432 DEFVAR_LISP ("test-function-list", &Vtest_function_list /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
433 List of all test functions defined in tests.c.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
434 For use by the automated test suite. See tests/automated/c-tests.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
435 */ );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
436 }