]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/bio.h
ssh: document thumbfile options
[plan9front.git] / sys / include / bio.h
index 4782932e3da9b1dae3286a5c25193162610d5494..157e525c4b60fd169ae3e5a8573ddd5a50df7a70 100644 (file)
@@ -7,7 +7,7 @@ typedef struct  Biobufhdr       Biobufhdr;
 enum
 {
        Bsize           = 8*1024,
-       Bungetsize      = 4,            /* space for ungetc */
+       Bungetsize      = UTFmax+1,     /* space for ungetc */
        Bmagic          = 0x314159,
        Beof            = -1,
        Bbad            = -2,
@@ -32,6 +32,7 @@ struct        Biobufhdr
        uchar*  bbuf;           /* pointer to beginning of buffer */
        uchar*  ebuf;           /* pointer to end of buffer */
        uchar*  gbuf;           /* pointer to good data in buf */
+       void    (*errorf)(char *);      /* called on error if not nil */
 };
 
 struct Biobuf
@@ -58,6 +59,7 @@ int   Binits(Biobufhdr*, int, int, uchar*, int);
 int    Blinelen(Biobufhdr*);
 vlong  Boffset(Biobufhdr*);
 Biobuf*        Bopen(char*, int);
+Biobuf*        Bfdopen(int, int);
 int    Bprint(Biobufhdr*, char*, ...);
 int    Bvprint(Biobufhdr*, char*, va_list);
 int    Bputc(Biobufhdr*, int);
@@ -70,5 +72,8 @@ int   Bterm(Biobufhdr*);
 int    Bungetc(Biobufhdr*);
 int    Bungetrune(Biobufhdr*);
 long   Bwrite(Biobufhdr*, void*, long);
+void   Blethal(Biobufhdr*, void(*)(char*));
+void   Berror(Biobufhdr*, char*, ...);
 
 #pragma        varargck        argpos  Bprint  2
+#pragma        varargck        argpos  Berror  2