mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
locking on scm_c_read, scm_getc
* libguile/ports.c (scm_c_read_unlocked, scm_c_read, scm_getc_unlocked) (scm_getc): Split getc and read operations into locked and unlocked variants. Change most uses to use the _unlocked version.
This commit is contained in:
parent
0d959103f9
commit
be632904ca
6 changed files with 65 additions and 39 deletions
|
@ -832,14 +832,14 @@ read_decimal_integer (SCM port, int c, ssize_t *resp)
|
||||||
if (c == '-')
|
if (c == '-')
|
||||||
{
|
{
|
||||||
sign = -1;
|
sign = -1;
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ('0' <= c && c <= '9')
|
while ('0' <= c && c <= '9')
|
||||||
{
|
{
|
||||||
res = 10*res + c-'0';
|
res = 10*res + c-'0';
|
||||||
got_it = 1;
|
got_it = 1;
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (got_it)
|
if (got_it)
|
||||||
|
@ -870,7 +870,7 @@ scm_i_read_array (SCM port, int c)
|
||||||
*/
|
*/
|
||||||
if (c == 'f')
|
if (c == 'f')
|
||||||
{
|
{
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if (c != '3' && c != '6')
|
if (c != '3' && c != '6')
|
||||||
{
|
{
|
||||||
if (c != EOF)
|
if (c != EOF)
|
||||||
|
@ -899,7 +899,7 @@ scm_i_read_array (SCM port, int c)
|
||||||
&& tag_len < sizeof tag_buf / sizeof tag_buf[0])
|
&& tag_len < sizeof tag_buf / sizeof tag_buf[0])
|
||||||
{
|
{
|
||||||
tag_buf[tag_len++] = c;
|
tag_buf[tag_len++] = c;
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
}
|
}
|
||||||
if (tag_len == 0)
|
if (tag_len == 0)
|
||||||
tag = SCM_BOOL_T;
|
tag = SCM_BOOL_T;
|
||||||
|
@ -924,7 +924,7 @@ scm_i_read_array (SCM port, int c)
|
||||||
|
|
||||||
if (c == '@')
|
if (c == '@')
|
||||||
{
|
{
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
c = read_decimal_integer (port, c, &lbnd);
|
c = read_decimal_integer (port, c, &lbnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +932,7 @@ scm_i_read_array (SCM port, int c)
|
||||||
|
|
||||||
if (c == ':')
|
if (c == ':')
|
||||||
{
|
{
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
c = read_decimal_integer (port, c, &len);
|
c = read_decimal_integer (port, c, &len);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
scm_i_input_error (NULL, port,
|
scm_i_input_error (NULL, port,
|
||||||
|
|
|
@ -1226,7 +1226,7 @@ swap_buffer (void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
scm_c_read (SCM port, void *buffer, size_t size)
|
scm_c_read_unlocked (SCM port, void *buffer, size_t size)
|
||||||
#define FUNC_NAME "scm_c_read"
|
#define FUNC_NAME "scm_c_read"
|
||||||
{
|
{
|
||||||
scm_t_port *pt;
|
scm_t_port *pt;
|
||||||
|
@ -1329,6 +1329,18 @@ scm_c_read (SCM port, void *buffer, size_t size)
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
size_t
|
||||||
|
scm_c_read (SCM port, void *buffer, size_t size)
|
||||||
|
{
|
||||||
|
size_t ret;
|
||||||
|
|
||||||
|
scm_c_lock_port (port);
|
||||||
|
ret = scm_c_read_unlocked (port, buffer, size);
|
||||||
|
scm_c_unlock_port (port);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Update the line and column number of PORT after consumption of C. */
|
/* Update the line and column number of PORT after consumption of C. */
|
||||||
static inline void
|
static inline void
|
||||||
update_port_lf (scm_t_wchar c, SCM port)
|
update_port_lf (scm_t_wchar c, SCM port)
|
||||||
|
@ -1633,7 +1645,7 @@ get_codepoint (SCM port, scm_t_wchar *codepoint,
|
||||||
|
|
||||||
/* Read a codepoint from PORT and return it. */
|
/* Read a codepoint from PORT and return it. */
|
||||||
scm_t_wchar
|
scm_t_wchar
|
||||||
scm_getc (SCM port)
|
scm_getc_unlocked (SCM port)
|
||||||
#define FUNC_NAME "scm_getc"
|
#define FUNC_NAME "scm_getc"
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
@ -1651,6 +1663,18 @@ scm_getc (SCM port)
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
scm_t_wchar
|
||||||
|
scm_getc (SCM port)
|
||||||
|
{
|
||||||
|
scm_t_wchar ret;
|
||||||
|
|
||||||
|
scm_c_lock_port (port);
|
||||||
|
ret = scm_getc_unlocked (port);
|
||||||
|
scm_c_unlock_port (port);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0,
|
SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0,
|
||||||
(SCM port),
|
(SCM port),
|
||||||
"Return the next character available from @var{port}, updating\n"
|
"Return the next character available from @var{port}, updating\n"
|
||||||
|
@ -1666,7 +1690,7 @@ SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0,
|
||||||
if (SCM_UNBNDP (port))
|
if (SCM_UNBNDP (port))
|
||||||
port = scm_current_input_port ();
|
port = scm_current_input_port ();
|
||||||
SCM_VALIDATE_OPINPORT (1, port);
|
SCM_VALIDATE_OPINPORT (1, port);
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if (EOF == c)
|
if (EOF == c)
|
||||||
return SCM_EOF_VAL;
|
return SCM_EOF_VAL;
|
||||||
return SCM_MAKE_CHAR (c);
|
return SCM_MAKE_CHAR (c);
|
||||||
|
|
|
@ -310,7 +310,9 @@ SCM_API int scm_peek_byte_or_eof (SCM port);
|
||||||
SCM_INLINE int scm_get_byte_or_eof_unlocked (SCM port);
|
SCM_INLINE int scm_get_byte_or_eof_unlocked (SCM port);
|
||||||
SCM_INLINE int scm_peek_byte_or_eof_unlocked (SCM port);
|
SCM_INLINE int scm_peek_byte_or_eof_unlocked (SCM port);
|
||||||
SCM_API size_t scm_c_read (SCM port, void *buffer, size_t size);
|
SCM_API size_t scm_c_read (SCM port, void *buffer, size_t size);
|
||||||
|
SCM_API size_t scm_c_read_unlocked (SCM port, void *buffer, size_t size);
|
||||||
SCM_API scm_t_wchar scm_getc (SCM port);
|
SCM_API scm_t_wchar scm_getc (SCM port);
|
||||||
|
SCM_API scm_t_wchar scm_getc_unlocked (SCM port);
|
||||||
SCM_API SCM scm_read_char (SCM port);
|
SCM_API SCM scm_read_char (SCM port);
|
||||||
|
|
||||||
/* Pushback. */
|
/* Pushback. */
|
||||||
|
|
|
@ -475,7 +475,7 @@ SCM_DEFINE (scm_get_bytevector_n, "get-bytevector-n", 2, 0, 0,
|
||||||
|
|
||||||
if (SCM_LIKELY (c_count > 0))
|
if (SCM_LIKELY (c_count > 0))
|
||||||
/* XXX: `scm_c_read ()' does not update the port position. */
|
/* XXX: `scm_c_read ()' does not update the port position. */
|
||||||
c_read = scm_c_read (port, c_bv, c_count);
|
c_read = scm_c_read_unlocked (port, c_bv, c_count);
|
||||||
else
|
else
|
||||||
/* Don't invoke `scm_c_read ()' since it may block. */
|
/* Don't invoke `scm_c_read ()' since it may block. */
|
||||||
c_read = 0;
|
c_read = 0;
|
||||||
|
@ -522,7 +522,7 @@ SCM_DEFINE (scm_get_bytevector_n_x, "get-bytevector-n!", 4, 0, 0,
|
||||||
scm_out_of_range (FUNC_NAME, count);
|
scm_out_of_range (FUNC_NAME, count);
|
||||||
|
|
||||||
if (SCM_LIKELY (c_count > 0))
|
if (SCM_LIKELY (c_count > 0))
|
||||||
c_read = scm_c_read (port, c_bv + c_start, c_count);
|
c_read = scm_c_read_unlocked (port, c_bv + c_start, c_count);
|
||||||
else
|
else
|
||||||
/* Don't invoke `scm_c_read ()' since it may block. */
|
/* Don't invoke `scm_c_read ()' since it may block. */
|
||||||
c_read = 0;
|
c_read = 0;
|
||||||
|
@ -577,7 +577,7 @@ SCM_DEFINE (scm_get_bytevector_some, "get-bytevector-some", 1, 0, 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We can't use `scm_c_read ()' since it blocks. */
|
/* We can't use `scm_c_read ()' since it blocks. */
|
||||||
c_chr = scm_getc (port);
|
c_chr = scm_getc_unlocked (port);
|
||||||
if (c_chr != EOF)
|
if (c_chr != EOF)
|
||||||
{
|
{
|
||||||
c_bv[c_total] = (char) c_chr;
|
c_bv[c_total] = (char) c_chr;
|
||||||
|
@ -642,7 +642,7 @@ SCM_DEFINE (scm_get_bytevector_all, "get-bytevector-all", 1, 0, 0,
|
||||||
|
|
||||||
/* `scm_c_read ()' blocks until C_COUNT bytes are available or EOF is
|
/* `scm_c_read ()' blocks until C_COUNT bytes are available or EOF is
|
||||||
reached. */
|
reached. */
|
||||||
c_read = scm_c_read (port, c_bv + c_total, c_count);
|
c_read = scm_c_read_unlocked (port, c_bv + c_total, c_count);
|
||||||
c_total += c_read, c_count -= c_read;
|
c_total += c_read, c_count -= c_read;
|
||||||
}
|
}
|
||||||
while (!SCM_EOF_OBJECT_P (scm_peek_char (port)));
|
while (!SCM_EOF_OBJECT_P (scm_peek_char (port)));
|
||||||
|
@ -1231,7 +1231,7 @@ SCM_DEFINE (scm_get_string_n_x,
|
||||||
|
|
||||||
for (j = c_start; j < c_end; j++)
|
for (j = c_start; j < c_end; j++)
|
||||||
{
|
{
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
{
|
{
|
||||||
size_t chars_read = j - c_start;
|
size_t chars_read = j - c_start;
|
||||||
|
|
|
@ -79,7 +79,7 @@ SCM_DEFINE (scm_read_delimited_x, "%read-delimited!", 3, 3, 0,
|
||||||
{
|
{
|
||||||
size_t k;
|
size_t k;
|
||||||
|
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
for (k = 0; k < num_delims; k++)
|
for (k = 0; k < num_delims; k++)
|
||||||
{
|
{
|
||||||
if (scm_i_string_ref (delims, k) == c)
|
if (scm_i_string_ref (delims, k) == c)
|
||||||
|
@ -149,7 +149,7 @@ SCM_DEFINE (scm_read_line, "%read-line", 0, 1, 0,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf[index] = scm_getc (port);
|
buf[index] = scm_getc_unlocked (port);
|
||||||
switch (buf[index])
|
switch (buf[index])
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
|
|
|
@ -288,7 +288,7 @@ flush_ws (SCM port, const char *eoferr)
|
||||||
{
|
{
|
||||||
register scm_t_wchar c;
|
register scm_t_wchar c;
|
||||||
while (1)
|
while (1)
|
||||||
switch (c = scm_getc (port))
|
switch (c = scm_getc_unlocked (port))
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
goteof:
|
goteof:
|
||||||
|
@ -303,7 +303,7 @@ flush_ws (SCM port, const char *eoferr)
|
||||||
|
|
||||||
case ';':
|
case ';':
|
||||||
lp:
|
lp:
|
||||||
switch (c = scm_getc (port))
|
switch (c = scm_getc_unlocked (port))
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
goto goteof;
|
goto goteof;
|
||||||
|
@ -315,7 +315,7 @@ flush_ws (SCM port, const char *eoferr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '#':
|
case '#':
|
||||||
switch (c = scm_getc (port))
|
switch (c = scm_getc_unlocked (port))
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
eoferr = "read_sharp";
|
eoferr = "read_sharp";
|
||||||
|
@ -442,7 +442,7 @@ scm_read_sexp (scm_t_wchar chr, SCM port)
|
||||||
c = 0; \
|
c = 0; \
|
||||||
while (i < ndigits) \
|
while (i < ndigits) \
|
||||||
{ \
|
{ \
|
||||||
a = scm_getc (port); \
|
a = scm_getc_unlocked (port); \
|
||||||
if (a == EOF) \
|
if (a == EOF) \
|
||||||
goto str_eof; \
|
goto str_eof; \
|
||||||
if (terminator \
|
if (terminator \
|
||||||
|
@ -472,7 +472,7 @@ skip_intraline_whitespace (SCM port)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ scm_read_string (int chr, SCM port)
|
||||||
scm_t_wchar c;
|
scm_t_wchar c;
|
||||||
|
|
||||||
str = scm_i_make_string (READER_STRING_BUFFER_SIZE, NULL, 0);
|
str = scm_i_make_string (READER_STRING_BUFFER_SIZE, NULL, 0);
|
||||||
while ('"' != (c = scm_getc (port)))
|
while ('"' != (c = scm_getc_unlocked (port)))
|
||||||
{
|
{
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
{
|
{
|
||||||
|
@ -511,7 +511,7 @@ scm_read_string (int chr, SCM port)
|
||||||
|
|
||||||
if (c == '\\')
|
if (c == '\\')
|
||||||
{
|
{
|
||||||
switch (c = scm_getc (port))
|
switch (c = scm_getc_unlocked (port))
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
goto str_eof;
|
goto str_eof;
|
||||||
|
@ -762,7 +762,7 @@ scm_read_quote (int chr, SCM port)
|
||||||
{
|
{
|
||||||
scm_t_wchar c;
|
scm_t_wchar c;
|
||||||
|
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if ('@' == c)
|
if ('@' == c)
|
||||||
p = scm_sym_uq_splicing;
|
p = scm_sym_uq_splicing;
|
||||||
else
|
else
|
||||||
|
@ -812,7 +812,7 @@ scm_read_syntax (int chr, SCM port)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
c = scm_getc (port);
|
c = scm_getc_unlocked (port);
|
||||||
if ('@' == c)
|
if ('@' == c)
|
||||||
p = sym_unsyntax_splicing;
|
p = sym_unsyntax_splicing;
|
||||||
else
|
else
|
||||||
|
@ -901,7 +901,7 @@ scm_read_character (scm_t_wchar chr, SCM port)
|
||||||
|
|
||||||
if (bytes_read == 0)
|
if (bytes_read == 0)
|
||||||
{
|
{
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
if (chr == EOF)
|
if (chr == EOF)
|
||||||
scm_i_input_error (FUNC_NAME, port, "unexpected end of file "
|
scm_i_input_error (FUNC_NAME, port, "unexpected end of file "
|
||||||
"while reading character", SCM_EOL);
|
"while reading character", SCM_EOL);
|
||||||
|
@ -1028,15 +1028,15 @@ scm_read_srfi4_vector (int chr, SCM port)
|
||||||
static SCM
|
static SCM
|
||||||
scm_read_bytevector (scm_t_wchar chr, SCM port)
|
scm_read_bytevector (scm_t_wchar chr, SCM port)
|
||||||
{
|
{
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
if (chr != 'u')
|
if (chr != 'u')
|
||||||
goto syntax;
|
goto syntax;
|
||||||
|
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
if (chr != '8')
|
if (chr != '8')
|
||||||
goto syntax;
|
goto syntax;
|
||||||
|
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
if (chr != '(')
|
if (chr != '(')
|
||||||
goto syntax;
|
goto syntax;
|
||||||
|
|
||||||
|
@ -1056,9 +1056,9 @@ scm_read_guile_bit_vector (scm_t_wchar chr, SCM port)
|
||||||
terribly inefficient but who cares? */
|
terribly inefficient but who cares? */
|
||||||
SCM s_bits = SCM_EOL;
|
SCM s_bits = SCM_EOL;
|
||||||
|
|
||||||
for (chr = scm_getc (port);
|
for (chr = scm_getc_unlocked (port);
|
||||||
(chr != EOF) && ((chr == '0') || (chr == '1'));
|
(chr != EOF) && ((chr == '0') || (chr == '1'));
|
||||||
chr = scm_getc (port))
|
chr = scm_getc_unlocked (port))
|
||||||
{
|
{
|
||||||
s_bits = scm_cons ((chr == '0') ? SCM_BOOL_F : SCM_BOOL_T, s_bits);
|
s_bits = scm_cons ((chr == '0') ? SCM_BOOL_F : SCM_BOOL_T, s_bits);
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1076,7 @@ scm_read_scsh_block_comment (scm_t_wchar chr, SCM port)
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
int c = scm_getc (port);
|
int c = scm_getc_unlocked (port);
|
||||||
|
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
scm_i_input_error ("skip_block_comment", port,
|
scm_i_input_error ("skip_block_comment", port,
|
||||||
|
@ -1134,7 +1134,7 @@ scm_read_r6rs_block_comment (scm_t_wchar chr, SCM port)
|
||||||
nested. So care must be taken. */
|
nested. So care must be taken. */
|
||||||
int nesting_level = 1;
|
int nesting_level = 1;
|
||||||
|
|
||||||
int a = scm_getc (port);
|
int a = scm_getc_unlocked (port);
|
||||||
|
|
||||||
if (a == EOF)
|
if (a == EOF)
|
||||||
scm_i_input_error ("scm_read_r6rs_block_comment", port,
|
scm_i_input_error ("scm_read_r6rs_block_comment", port,
|
||||||
|
@ -1142,7 +1142,7 @@ scm_read_r6rs_block_comment (scm_t_wchar chr, SCM port)
|
||||||
|
|
||||||
while (nesting_level > 0)
|
while (nesting_level > 0)
|
||||||
{
|
{
|
||||||
int b = scm_getc (port);
|
int b = scm_getc_unlocked (port);
|
||||||
|
|
||||||
if (b == EOF)
|
if (b == EOF)
|
||||||
scm_i_input_error ("scm_read_r6rs_block_comment", port,
|
scm_i_input_error ("scm_read_r6rs_block_comment", port,
|
||||||
|
@ -1193,7 +1193,7 @@ scm_read_extended_symbol (scm_t_wchar chr, SCM port)
|
||||||
|
|
||||||
buf = scm_i_string_start_writing (buf);
|
buf = scm_i_string_start_writing (buf);
|
||||||
|
|
||||||
while ((chr = scm_getc (port)) != EOF)
|
while ((chr = scm_getc_unlocked (port)) != EOF)
|
||||||
{
|
{
|
||||||
if (saw_brace)
|
if (saw_brace)
|
||||||
{
|
{
|
||||||
|
@ -1220,7 +1220,7 @@ scm_read_extended_symbol (scm_t_wchar chr, SCM port)
|
||||||
that the extended read syntax would never put a `\' before
|
that the extended read syntax would never put a `\' before
|
||||||
an `x'. For now, we just ignore other instances of
|
an `x'. For now, we just ignore other instances of
|
||||||
backslash in the string. */
|
backslash in the string. */
|
||||||
switch ((chr = scm_getc (port)))
|
switch ((chr = scm_getc_unlocked (port)))
|
||||||
{
|
{
|
||||||
case EOF:
|
case EOF:
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -1307,7 +1307,7 @@ scm_read_sharp (scm_t_wchar chr, SCM port)
|
||||||
{
|
{
|
||||||
SCM result;
|
SCM result;
|
||||||
|
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
|
|
||||||
result = scm_read_sharp_extension (chr, port);
|
result = scm_read_sharp_extension (chr, port);
|
||||||
if (!scm_is_eq (result, SCM_UNSPECIFIED))
|
if (!scm_is_eq (result, SCM_UNSPECIFIED))
|
||||||
|
@ -1398,7 +1398,7 @@ scm_read_expression (SCM port)
|
||||||
{
|
{
|
||||||
register scm_t_wchar chr;
|
register scm_t_wchar chr;
|
||||||
|
|
||||||
chr = scm_getc (port);
|
chr = scm_getc_unlocked (port);
|
||||||
|
|
||||||
switch (chr)
|
switch (chr)
|
||||||
{
|
{
|
||||||
|
@ -1621,7 +1621,7 @@ scm_i_scan_for_encoding (SCM port)
|
||||||
if (SCM_FPORTP (port) && !SCM_FDES_RANDOM_P (SCM_FPORT_FDES (port)))
|
if (SCM_FPORTP (port) && !SCM_FDES_RANDOM_P (SCM_FPORT_FDES (port)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
bytes_read = scm_c_read (port, header, SCM_ENCODING_SEARCH_SIZE);
|
bytes_read = scm_c_read_unlocked (port, header, SCM_ENCODING_SEARCH_SIZE);
|
||||||
header[bytes_read] = '\0';
|
header[bytes_read] = '\0';
|
||||||
scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET));
|
scm_seek (port, scm_from_int (0), scm_from_int (SEEK_SET));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue