]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.h
Added secondary sorting (i.e., breaking ties when two documents have the same Q)
[libucw.git] / lib / fastbuf.h
index eb30d09cf0a38d98faa40799f49b290cd11e6c29..a796a3c749b4ced91e835907359c7c9e2b343bbd 100644 (file)
@@ -103,10 +103,10 @@ static inline void bputc(struct fastbuf *f, byte c)
     bputc_slow(f, c);
 }
 
-word bgetw_slow(struct fastbuf *f);
-static inline word bgetw(struct fastbuf *f)
+int bgetw_slow(struct fastbuf *f);
+static inline int bgetw(struct fastbuf *f)
 {
-  word w;
+  int w;
   if (f->bptr + 2 <= f->bstop)
     {
       w = GET_U16(f->bptr);
@@ -266,6 +266,16 @@ bputsn(struct fastbuf *f, byte *b)
   bputc(f, '\n');
 }
 
+/* I/O on addr_int_t */
+
+#ifdef CPU_64BIT_POINTERS
+#define bputa(x,p) bputq(x,p)
+#define bgeta(x) bgetq(x)
+#else
+#define bputa(x,p) bputl(x,p)
+#define bgeta(x) bgetl(x)
+#endif
+
 /* Direct I/O on buffers */
 
 int bdirect_read(struct fastbuf *f, byte **buf);