14
|
1 /* vi:set ts=8 sts=4 sw=4:
|
|
2 *
|
|
3 * MzScheme interface for Vim, wrapper around scheme.h
|
|
4 */
|
|
5 #ifndef _IF_MZSCH_H_
|
|
6 #define _IF_MZSCH_H_
|
|
7 #ifdef __MINGW32__
|
|
8 /* Hack to engage Cygwin-specific settings */
|
|
9 # define __CYGWIN32__
|
|
10 #endif
|
|
11
|
|
12 #include <scheme.h>
|
|
13
|
|
14 #ifdef __MINGW32__
|
|
15 # undef __CYGWIN32__
|
|
16 #endif
|
|
17
|
|
18 #if MZSCHEME_VERSION_MAJOR >= 299
|
|
19 /* macros to be compatible with 20x versions */
|
|
20 # define scheme_config scheme_current_config()
|
|
21 # define scheme_make_string scheme_make_byte_string
|
|
22 # define scheme_make_string_output_port scheme_make_byte_string_output_port
|
|
23 # define scheme_get_sized_string_output scheme_get_sized_byte_string_output
|
|
24 # define scheme_write_string scheme_write_byte_string
|
|
25 # define scheme_make_sized_string scheme_make_sized_byte_string
|
|
26
|
|
27 # define SCHEME_STRINGP(obj) (SCHEME_BYTE_STRINGP(obj) || SCHEME_CHAR_STRINGP(obj))
|
|
28 # define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL( \
|
|
29 (SCHEME_BYTE_STRINGP(obj) ? obj : scheme_char_string_to_byte_string(obj)))
|
|
30 # define GUARANTEE_STRING(fname, argnum) GUARANTEE_TYPE(fname, argnum, SCHEME_STRINGP, "string")
|
|
31
|
|
32 # ifdef scheme_format
|
|
33 # undef scheme_format
|
|
34 # endif
|
|
35 # define scheme_format scheme_format_utf8
|
|
36
|
|
37 # define GET_BYTE_STRING(obj) (SCHEME_BYTE_STRINGP(obj) ? obj : \
|
|
38 scheme_char_string_to_byte_string(obj))
|
|
39 #else
|
|
40 # define GET_BYTE_STRING(obj) (obj)
|
|
41 # define SCHEME_BYTE_STRLEN_VAL SCHEME_STRLEN_VAL
|
|
42 # define SCHEME_BYTE_STR_VAL SCHEME_STR_VAL
|
|
43 #endif
|
|
44
|
|
45 #endif /* _IF_MZSCH_H_ */
|