]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fastbuf.c
Table: renamed table_col_order[_by_name] -> table_set_col_order[_by_name]
[libucw.git] / ucw / fastbuf.c
index a66d712b2902a1c564cbff5fb3636356941dea3d..22501f43ed87cba8ff3e1529da0ebe2b57038b8c 100644 (file)
@@ -9,11 +9,11 @@
 
 #undef LOCAL_DEBUG
 
 
 #undef LOCAL_DEBUG
 
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
-#include "ucw/resource.h"
-#include "ucw/trans.h"
-#include "ucw/stkstring.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
+#include <ucw/resource.h>
+#include <ucw/trans.h>
+#include <ucw/stkstring.h>
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -108,7 +108,7 @@ static void do_seek(struct fastbuf *f, ucw_off_t pos, int whence)
     ASSERT(btell(f) >= 0);
 }
 
     ASSERT(btell(f) >= 0);
 }
 
-inline void bsetpos(struct fastbuf *f, ucw_off_t pos)
+void bsetpos(struct fastbuf *f, ucw_off_t pos)
 {
   /* We can optimize seeks only when reading */
   if (f->bptr < f->bstop && pos <= f->pos && pos >= f->pos - (f->bstop - f->buffer)) /* If bptr == bstop, then [buffer, bstop] may be undefined */
 {
   /* We can optimize seeks only when reading */
   if (f->bptr < f->bstop && pos <= f->pos && pos >= f->pos - (f->bstop - f->buffer)) /* If bptr == bstop, then [buffer, bstop] may be undefined */
@@ -164,19 +164,19 @@ int beof_slow(struct fastbuf *f)
   return f->bptr >= f->bstop && !brefill(f, 1);
 }
 
   return f->bptr >= f->bstop && !brefill(f, 1);
 }
 
-void bputc_slow(struct fastbuf *f, uns c)
+void bputc_slow(struct fastbuf *f, uint c)
 {
   if (f->bptr >= f->bufend)
     bspout(f);
   *f->bptr++ = c;
 }
 
 {
   if (f->bptr >= f->bufend)
     bspout(f);
   *f->bptr++ = c;
 }
 
-uns bread_slow(struct fastbuf *f, void *b, uns l, uns check)
+uint bread_slow(struct fastbuf *f, void *b, uint l, uint check)
 {
 {
-  uns total = 0;
+  uint total = 0;
   while (l)
     {
   while (l)
     {
-      uns k = f->bstop - f->bptr;
+      uint k = f->bstop - f->bptr;
 
       if (!k)
        {
 
       if (!k)
        {
@@ -198,11 +198,11 @@ uns bread_slow(struct fastbuf *f, void *b, uns l, uns check)
   return total;
 }
 
   return total;
 }
 
-void bwrite_slow(struct fastbuf *f, const void *b, uns l)
+void bwrite_slow(struct fastbuf *f, const void *b, uint l)
 {
   while (l)
     {
 {
   while (l)
     {
-      uns k = f->bufend - f->bptr;
+      uint k = f->bufend - f->bptr;
 
       if (!k)
        {
 
       if (!k)
        {
@@ -218,12 +218,12 @@ void bwrite_slow(struct fastbuf *f, const void *b, uns l)
     }
 }
 
     }
 }
 
-void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uns l)
+void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uint l)
 {
   while (l)
     {
       byte *fptr, *tptr;
 {
   while (l)
     {
       byte *fptr, *tptr;
-      uns favail, tavail, n;
+      uint favail, tavail, n;
 
       favail = bdirect_read_prepare(f, &fptr);
       if (!favail)
 
       favail = bdirect_read_prepare(f, &fptr);
       if (!favail)
@@ -243,7 +243,7 @@ void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uns l)
     }
 }
 
     }
 }
 
-int bconfig(struct fastbuf *f, uns item, int value)
+int bconfig(struct fastbuf *f, uint item, int value)
 {
   return (f->config && !(f->flags & FB_DEAD)) ? f->config(f, item, value) : -1;
 }
 {
   return (f->config && !(f->flags & FB_DEAD)) ? f->config(f, item, value) : -1;
 }
@@ -254,12 +254,12 @@ void brewind(struct fastbuf *f)
   bsetpos(f, 0);
 }
 
   bsetpos(f, 0);
 }
 
-int bskip_slow(struct fastbuf *f, uns len)
+int bskip_slow(struct fastbuf *f, uint len)
 {
   while (len)
     {
       byte *buf;
 {
   while (len)
     {
       byte *buf;
-      uns l = bdirect_read_prepare(f, &buf);
+      uint l = bdirect_read_prepare(f, &buf);
       if (!l)
        return 0;
       l = MIN(l, len);
       if (!l)
        return 0;
       l = MIN(l, len);
@@ -299,7 +299,7 @@ static void fb_res_free(struct resource *r)
   bclose(f);
 }
 
   bclose(f);
 }
 
-static void fb_res_dump(struct resource *r, uns indent UNUSED)
+static void fb_res_dump(struct resource *r, uint indent UNUSED)
 {
   struct fastbuf *f = r->priv;
   printf(" name=%s\n", f->name);
 {
   struct fastbuf *f = r->priv;
   printf(" name=%s\n", f->name);