6 /* Copyright (C) 1995,1996,2000,2001,2002, 2006, 2008 Free Software Foundation, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "libguile/__scm.h"
31 #define SCM_STRPORTP(x) (!SCM_IMP (x) && \
32 (SCM_TYP16 (x) == scm_tc16_strport))
33 #define SCM_OPSTRPORTP(x) (SCM_STRPORTP (x) && \
34 (SCM_CELL_WORD_0 (x) & SCM_OPN))
35 #define SCM_OPINSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
36 (SCM_CELL_WORD_0 (x) & SCM_RDNG))
37 #define SCM_OPOUTSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
38 (SCM_CELL_WORD_0 (x) & SCM_WRTNG))
42 SCM_API scm_t_bits scm_tc16_strport
;
46 SCM_API SCM
scm_mkstrport (SCM pos
, SCM str
, long modes
, const char * caller
);
47 SCM_INTERNAL SCM
scm_i_mkstrport (SCM pos
, const char *locale_str
, size_t str_len
,
48 long modes
, const char *caller
);
49 SCM_API SCM
scm_strport_to_string (SCM port
);
50 SCM_API SCM
scm_strport_to_locale_u8vector (SCM port
);
51 SCM_API SCM
scm_object_to_string (SCM obj
, SCM printer
);
52 SCM_API SCM
scm_call_with_output_string (SCM proc
);
53 SCM_API SCM
scm_call_with_output_locale_u8vector (SCM proc
);
54 SCM_API SCM
scm_call_with_input_string (SCM str
, SCM proc
);
55 SCM_API SCM
scm_open_input_string (SCM str
);
56 SCM_API SCM
scm_open_input_locale_u8vector (SCM str
);
57 SCM_API SCM
scm_open_output_string (void);
58 SCM_API SCM
scm_get_output_string (SCM port
);
59 SCM_API SCM
scm_get_output_locale_u8vector (SCM port
);
60 SCM_API SCM
scm_c_read_string (const char *expr
);
61 SCM_API SCM
scm_c_eval_string (const char *expr
);
62 SCM_API SCM
scm_c_eval_string_in_module (const char *expr
, SCM module
);
63 SCM_API SCM
scm_eval_string (SCM string
);
64 SCM_API SCM
scm_eval_string_in_module (SCM string
, SCM module
);
65 SCM_INTERNAL
void scm_init_strports (void);
67 #endif /* SCM_STRPORTS_H */