Function equivalents of the above macros.
Lstream_data_count Lstream_read (Lstream *stream, void *data,
- Lstream_data_count size)
+ Lstream_data_count size)
Read SIZE bytes of DATA from the stream. Return the number of
bytes read. 0 means EOF. -1 means an error occurred and no
bytes were read.
Lstream_data_count Lstream_write (Lstream *stream, void *data,
- Lstream_data_count size)
+ Lstream_data_count size)
Write SIZE bytes of DATA to the stream. Return the number of
bytes written. -1 means an error occurred and no bytes were
written.
print_lstream(Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
lstream_t lstr = XLSTREAM(obj);
- char buf[200];
-
- sprintf(buf, "#<INTERNAL OBJECT (SXEmacs bug?) (%s lstream) 0x%lx>",
- lstr->imp->name, (long)lstr);
- write_c_string(buf, printcharfun);
+ write_fmt_string(printcharfun, "#<INTERNAL OBJECT (SXEmacs bug?) (%s lstream) 0x%lx>",
+ lstr->imp->name, (long)lstr);
}
static void finalize_lstream(void *header, int for_disksave)
{
return ALIGN_SIZE(offsetof(struct lstream_s, data) +
lstream_type_specific_size,
- ALIGNOF(max_align_t));
+ ALIGNOF(sxe_max_align_t));
}
static inline size_t
#if defined HAVE_BDWGC && defined EF_USE_BDWGC
static void
-lstr_finaliser(void *obj, void *UNUSED(data))
+lstr_finaliser(void *obj, void *SXE_UNUSED(data))
{
finalize_lstream(obj, 0);
return;
make_filedesc_stream_1(int filedesc, int offset, int count, int flags,
const char *mode)
{
- Lisp_Object obj;
+ Lisp_Object obj = Qnil;
+ if (filedesc < 0)
+ return obj;
lstream_t lstr = Lstream_new(lstream_filedesc, mode);
filedesc_stream_t fstr = FILEDESC_STREAM_DATA(lstr);