6 /* Copyright (C) 1995,1996,2000 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
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "libguile/__scm.h"
27 #include "libguile/options.h"
30 /* SCM_LINE_INCREMENTORS are the characters which cause the line count to
31 * be incremented for the purposes of error reporting. This feature
32 * is only used for scheme code loaded from files.
34 * SCM_WHITE_SPACES are other characters which should be treated like spaces
38 #define SCM_LINE_INCREMENTORS '\n'
41 # define SCM_SINGLE_SPACES ' ':case '\r':case '\f': case 26
43 # define SCM_SINGLE_SPACES ' ':case '\r':case '\f'
46 #define SCM_WHITE_SPACES SCM_SINGLE_SPACES: case '\t'
48 SCM_API scm_t_option scm_read_opts
[];
50 #define SCM_COPY_SOURCE_P scm_read_opts[0].val
51 #define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
52 #define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
53 #define SCM_KEYWORD_STYLE scm_read_opts[3].val
54 #define SCM_N_READ_OPTIONS 4
58 SCM_API SCM scm_sym_dot
;
60 SCM_API SCM
scm_read_options (SCM setting
);
61 SCM_API SCM
scm_read (SCM port
);
62 SCM_API
char * scm_grow_tok_buf (SCM
* tok_buf
);
63 SCM_API
int scm_flush_ws (SCM port
, const char *eoferr
);
64 SCM_API
int scm_casei_streq (char * s1
, char * s2
);
65 SCM_API SCM
scm_lreadr (SCM
* tok_buf
, SCM port
, SCM
*copy
);
66 SCM_API
size_t scm_read_token (int ic
, SCM
* tok_buf
, SCM port
, int weird
);
67 SCM_API SCM
scm_lreadparen (SCM
* tok_buf
, SCM port
, char *name
, SCM
*copy
68 #ifdef SCM_ELISP_READ_EXTENSIONS
70 #define SCM_ELISP_CLOSE , ')'
72 #define SCM_ELISP_CLOSE
75 SCM_API SCM
scm_lreadrecparen (SCM
* tok_buf
, SCM port
, char *name
, SCM
*copy
);
76 SCM_API SCM
scm_read_hash_extend (SCM chr
, SCM proc
);
77 SCM_API
void scm_init_read (void);
79 #endif /* SCM_READ_H */