update.
[chise/xemacs-chise.git-] / src / lstream.h
index 357c820..127065c 100644 (file)
@@ -23,8 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Written by Ben Wing. */
 
-#ifndef _XEMACS_LSTREAM_H_
-#define _XEMACS_LSTREAM_H_
+#ifndef INCLUDED_lstream_h_
+#define INCLUDED_lstream_h_
 
 /************************************************************************/
 /*                     definition of Lstream object                     */
@@ -95,7 +95,7 @@ typedef struct lstream_implementation
   /* The omniscient mly, blinded by the irresistable thrall of Common
      Lisp, thinks that it is bogus that the types and implementations
      of input and output streams are the same. */
-  int (*reader) (Lstream *stream, unsigned char *data, size_t size);
+  ssize_t (*reader) (Lstream *stream, unsigned char *data, size_t size);
   /* Send some data to the stream's end.  Data to be sent is in DATA
      and is SIZE bytes.  Return the number of bytes sent.  This
      function can send and return fewer bytes than is passed in; in
@@ -106,7 +106,7 @@ typedef struct lstream_implementation
      data. (This is useful, e.g., of you're dealing with a
      non-blocking file descriptor and are getting EWOULDBLOCK errors.)
      This function can be NULL if the stream is input-only. */
-  int (*writer) (Lstream *stream, CONST unsigned char *data, size_t size);
+  ssize_t (*writer) (Lstream *stream, CONST unsigned char *data, size_t size);
   /* Return non-zero if the last write operation on the stream resulted
      in an attempt to block (EWOULDBLOCK). If this method does not
      exists, the implementation returns 0 */
@@ -209,8 +209,8 @@ int Lstream_flush_out (Lstream *lstr);
 int Lstream_fputc (Lstream *lstr, int c);
 int Lstream_fgetc (Lstream *lstr);
 void Lstream_fungetc (Lstream *lstr, int c);
-int Lstream_read (Lstream *lstr, void *data, size_t size);
-int Lstream_write (Lstream *lstr, CONST void *data, size_t size);
+ssize_t Lstream_read (Lstream *lstr, void *data, size_t size);
+ssize_t Lstream_write (Lstream *lstr, CONST void *data, size_t size);
 int Lstream_was_blocked_p (Lstream *lstr);
 void Lstream_unread (Lstream *lstr, CONST void *data, size_t size);
 int Lstream_rewind (Lstream *lstr);
@@ -265,7 +265,11 @@ void Lstream_set_character_mode (Lstream *str);
 #ifdef MULE
 
 #ifndef BYTE_ASCII_P
-#include "mule-charset.h"
+#include "multibyte.h"
+#endif
+
+#ifndef CHAR_ASCII_P
+#include "character.h"
 #endif
 
 INLINE Emchar Lstream_get_emchar (Lstream *stream);
@@ -339,10 +343,8 @@ int filedesc_stream_fd (Lstream *stream);
 Lisp_Object make_lisp_string_input_stream (Lisp_Object string,
                                           Bytecount offset,
                                           Bytecount len);
-Lisp_Object make_fixed_buffer_input_stream (CONST unsigned char *buf,
-                                           size_t size);
-Lisp_Object make_fixed_buffer_output_stream (unsigned char *buf,
-                                            size_t size);
+Lisp_Object make_fixed_buffer_input_stream (CONST void *buf, size_t size);
+Lisp_Object make_fixed_buffer_output_stream (void *buf, size_t size);
 CONST unsigned char *fixed_buffer_input_stream_ptr (Lstream *stream);
 unsigned char *fixed_buffer_output_stream_ptr (Lstream *stream);
 Lisp_Object make_resizing_buffer_output_stream (void);
@@ -356,4 +358,4 @@ Lisp_Object make_lisp_buffer_output_stream (struct buffer *buf, Bufpos pos,
                                            int flags);
 Bufpos lisp_buffer_stream_startpos (Lstream *stream);
 
-#endif /* _XEMACS_LSTREAM_H_ */
+#endif /* INCLUDED_lstream_h_ */