Changeset: 6291e6d57506 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6291e6d57506
Modified Files:
        
Branch: headless
Log Message:

Merge with head


diffs (truncated from 1981 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -839,11 +839,6 @@
 #define GDKLIBRARY_HEADED      061024  /* BAT version (i.e. with head/tail) */
 #define GDKLIBRARY             061025
 
-typedef struct BATiter {
-       COL *b;
-       oid vid;
-} BATiter;
-
 typedef struct {
        /* static bat properties */
        bat batCacheid;         /* index into BBP */
@@ -860,13 +855,13 @@
         key:2,                 /* duplicates allowed? */
         dense:1, nonil:1,      /* nonil isn't propchecked yet */
         nil:1,                 /* nil is set when we found one nil (propcheck) 
*/
-        unused:2;
+        unused1:2;
        oid align;              /* OID for sync alignment */
        BUN nosorted_rev;       /* position that proves sorted_rev==FALSE */
        BUN nokey[2];           /* positions that prove key ==FALSE */
        BUN nosorted;           /* position that proves sorted==FALSE */
        BUN nodense;            /* position that proves dense==FALSE */
-       oid seq;                /* start of dense head sequence */
+       oid seqbase;            /* start of dense head sequence */
 
        Heap heap;              /* space for the column. */
        Heap *vheap;            /* space for the varsized data. */
@@ -885,7 +880,7 @@
         lview:1,               /* bat is a *logical* view on parentid */
         restricted:2,          /* access priviliges */
         persistence:2,         /* should the COL persist on disk? */
-        unused:21;             /* value=0 for now */
+        unused2:21;            /* value=0 for now */
        int sharecnt;           /* incoming view count */
        char map_buns;          /* mmap mode for bun heap */
        char map_heap;          /* mmap mode for atom heap */
@@ -898,6 +893,11 @@
        BUN capacity;           /* tuple capacity */
 } COL;
 
+typedef struct COLiter {
+       COL *b;
+       oid vid;
+} COLiter;
+
 typedef int (*GDKfcn) ();
 
 /*
@@ -1043,15 +1043,15 @@
 #define BATDELETE      (-9999)
 
 gdk_export COL *COLnew(int tp, BUN capacity);
-gdk_export COL *BATclone(COL *b, BUN capacity);
-gdk_export COL *BATextend(COL *b, BUN newcap);
+gdk_export COL *COLclone(COL *b, BUN capacity);
+gdk_export COL *COLextend(COL *b, BUN newcap);
 
 /* internal */
 gdk_export COL *COLcreatedesc(int tp, int heapnames);
-gdk_export int BATfree(COL *b);
-gdk_export void BATdestroy(COL *bs);
+gdk_export int COLfree(COL *b);
+gdk_export void COLdestroy(COL *bs);
 gdk_export chr ATOMelmshift(int sz);
-gdk_export void BATsetdims(COL *b);
+gdk_export void COLsetdims(COL *b);
 
 /*
  *
@@ -1080,9 +1080,9 @@
  * @item BUN
  * @tab BUNfnd (BAT *b, ptr head)
  * @item void
- * @tab BUNfndOID (BUN result, BATiter bi, oid *head)
+ * @tab BUNfndOID (BUN result, COLiter bi, oid *head)
  * @item void
- * @tab BUNfndSTD (BUN result, BATiter bi, ptr head)
+ * @tab BUNfndSTD (BUN result, COLiter bi, ptr head)
  * @item BUN
  * @tab BUNlocate (BAT *b, ptr head, ptr tail)
  * @item ptr
@@ -1258,10 +1258,10 @@
        do {                                            \
                fastins_nocheck(b, p, v, (b)->width);   \
                p++;                                    \
-               (b)->count++;                   \
+               (b)->count++;                           \
        } while (0)
 
-gdk_export int GDKupgradevarheap(COLrec *c, var_t v, int copyall);
+gdk_export int GDKupgradevarheap(COL *c, var_t v, int copyall);
 gdk_export COL *BUNfastins(COL *b, ptr p);
 gdk_export COL *BUNins(COL *b, ptr p, bit force);
 gdk_export COL *BUNappend(COL *b, ptr p, bit force);
@@ -1272,10 +1272,11 @@
 gdk_export COL *BATdel(COL *b, COL *c, bit force);
 
 gdk_export COL *BUNreplace(COL *b, ptr p, bit force);
-gdk_export COL *BUNinplace(COL *b, BUN p, ptr p, bit force);
+gdk_export COL *BUNinplace(COL *b, BUN p, ptr h, bit force);
 gdk_export COL *BATreplace(COL *b, COL *n, bit force);
 
 gdk_export BUN BUNlocate(COL *b, ptr p);
+gdk_export BUN BUNfnd(COL *b, ptr left);
 
 #define BUNfndVOID(p,bi,v)                                             \
        do {                                                            \
@@ -1288,7 +1289,7 @@
        } while (0)
 
 #define BUNfndOID(p,bi,v)                      \
-       if (BAThdense(bi.b)) {                  \
+       if (COLdense(bi.b)) {                   \
                BUNfndVOID(p,bi,v);             \
        } else {                                \
                HASHfnd_oid(p,bi,v);            \
@@ -1297,7 +1298,7 @@
 
 #define COLtype(b)     ((b)->type == TYPE_void && (b)->seqbase == oid_nil ?\
                                TYPE_void : ATOMtype((b)->type))
-#define BATstore(b)    (BATdense(b) ? TYPE_void : (b)->type)
+#define BATstore(b)    (COLdense(b) ? TYPE_void : (b)->type)
 #define base(b)                ((b)->vheap->base)
 
 #define size(b)                ((b)->width)
@@ -1359,10 +1360,10 @@
 #define BUNvar(bi,p)   
((bi).b->type?(base((bi).b)+BUNvaroff(bi,p)):BUNpos(bi,p))
 #define BUNhead(bi,p)  ((bi).b->varsized?BUNvar(bi,p):BUNloc(bi,p))
 
-static inline BATiter
-bat_iterator(COL *b)
+static inline COLiter
+col_iterator(COL *b)
 {
-       BATiter bi;
+       COLiter bi;
 
        bi.b = b;
        bi.vid = 0;
@@ -1460,11 +1461,11 @@
  * at the end of the BAT, but not to modify anything that already
  * was in there.
  */
-gdk_export str BATrename(BAT *b, const char *nme);
+gdk_export str COLrename(COL *b, const char *nme);
 #ifndef BATcount
-gdk_export BUN BATcount(COL *b);
+gdk_export BUN COLcount(COL *b);
 #endif
-gdk_export BUN BATcount_no_nil(COL *b);
+gdk_export BUN COLcount_no_nil(COL *b);
 gdk_export void BATsetcapacity(COL *b, BUN cnt);
 gdk_export void COLsetcount(COL *b, BUN cnt);
 gdk_export BUN BATbuncount(COL *b);
@@ -1552,9 +1553,9 @@
  * @item BAT *
  * @tab BATsave (BAT *b)
  * @item int
- * @tab BATmmap (BAT *b, int hb, int tb, int hh, int th, int force )
+ * @tab COLmmap (BAT *b, int hb, int tb, int hh, int th, int force )
  * @item int
- * @tab BATmadvise (BAT *b, int hb, int tb, int hh, int th )
+ * @tab COLmadvise (BAT *b, int hb, int tb, int hh, int th )
  * @item int
  * @tab BATdelete (BAT *b)
  * @end multitable
@@ -1575,12 +1576,12 @@
  *
  * The discriminative storage modes are memory-mapped, compressed, or
  * loaded in memory.
- * The @strong{BATmmap()} changes the storage mode of each heap associated to
+ * The @strong{COLmmap()} changes the storage mode of each heap associated to
  * a BAT.
  * As can be seen in the bat record, each BAT has one BUN-heap (@emph{bn}), and
  * possibly two heaps (@emph{hh} and @emph{th}) for variable-sized atoms.
  * @
- * The @%BATmadvise@ call works in the same way. Using the @%madvise()@ system
+ * The @%COLmadvise@ call works in the same way. Using the @%madvise()@ system
  * call it issues buffer management advice to the OS kernel, as for the
  * expected usage pattern of the memory in a heap.
  */
@@ -1615,8 +1616,8 @@
 #define BATaccessEnd(b,what,advice) COLaccess(b,what,advice,-1)
 gdk_export size_t COLaccess(COL *b, int what, int advice, int load);
 gdk_export COL *COLsave(COL *b);
-gdk_export int BATmmap(COL *b, int b, int h, int force);
-gdk_export int BATmadvise(COL *b, int b, int h);
+gdk_export int COLmmap(COL *c, int b, int h, int force);
+gdk_export int COLmadvise(COL *c, int b, int h);
 gdk_export int COLdelete(COL *b);
 gdk_export size_t BATvmsize(COL *b, int dirty);
 gdk_export size_t BATmemsize(COL *b, int dirty);
@@ -1657,7 +1658,7 @@
  */
 gdk_export int COLprint(COL *b);
 gdk_export int COLprintf(stream *f, COL *b);
-gdk_export int COLmultiprintf(stream *f, int argc, COL *argv[], int printoid, 
int order, int printorderby);
+gdk_export int COLmultiprintf(stream *f, int argc, COL *argv[]);
 
 /*
  *
@@ -1722,9 +1723,9 @@
 gdk_export int GDKssort_rev(void *h, void *t, void *base, size_t n, int s, int 
tpe);
 
 #define BATordered(b)  (((b)->type == TYPE_void)?GDK_SORTED:(b)->sorted)
-#define BATdense(b)    (BATvoid(b) && (b)->seqbase != oid_nil)
-#define BATvoid(b)     (((b)->dense&(b)->sorted&1) || (b)->type==TYPE_void)
-#define BATiskey(b)    (b->key != FALSE || BATdense(b))
+#define COLdense(b)    (COLvoid(b) && (b)->seqbase != oid_nil)
+#define COLvoid(b)     (((b)->dense&(b)->sorted&1) || (b)->type==TYPE_void)
+#define BATiskey(b)    (b->key != FALSE || COLdense(b))
 
 /* set some properties that are trivial to deduce */
 #define BATsettrivprop(b)                                              \
@@ -1736,7 +1737,7 @@
                }                                                       \
                if (trivial) {                                          \
                        oid sqbs;                                       \
-                       BATiter bi = bat_iterator(b);                   \
+                       COLiter bi = col_iterator(b);                   \
                        if (!(b)->dense &&                              \
                            (b)->type == TYPE_oid &&                    \
                            (sqbs = (b)->count == 0 ? 0 : * (oid *) BUNhead(bi, 
BUNfirst(b))) != oid_nil) { \
@@ -1870,7 +1871,7 @@
 gdk_export str BBPphysical(bat b, str buf);
 gdk_export int BBP_curstamp;
 gdk_export COL *BBPgetdesc(bat i);
-gdk_export BAT *BBPquickdesc(bat b, int delaccess);
+gdk_export COL *BBPquickdesc(bat b, int delaccess);
 
 /*
  *
@@ -2546,7 +2547,7 @@
 }
 
 static inline char *
-pos(BATiter * bi, BUN p)
+pos(COLiter * bi, BUN p)
 {
        bi->vid = bi->b->seqbase;
        if (bi->vid != oid_nil)
@@ -2686,7 +2687,7 @@
  * if the underlying BATs are read-only (often not the case when BATs
  * are being updated).  Otherwise, copies must be made anyway.
  */
-gdk_export COL *BATcommit(COL *b);
+gdk_export COL *COLcommit(COL *b);
 gdk_export COL *COLfakeCommit(COL *b);
 gdk_export COL *COLundo(COL *b);
 gdk_export COL *COLalpha(COL *b);
@@ -2758,7 +2759,7 @@
  */
 gdk_export int ALIGNsynced(COL *b1, COL *b2);
 
-gdk_export COL *BATpropcheck(COL *b, int mode);
+gdk_export COL *COLpropcheck(COL *b, int mode);
 
 #define BATPROPS_QUICK  0      /* only derive easy (non-resource consuming) 
properties */
 #define BATPROPS_ALL   1       /* derive all possible properties; no matter 
what cost (key=hash) */
@@ -2784,7 +2785,7 @@
 #define ALIGNinp(x,y,f) {if (!(f)) 
VIEWchk(x,y,COL_READ|COL_APPEND);(x)->talign=0; }
 #define ALIGNapp(x,y,f) {if (!(f)) VIEWchk(x,y,COL_READ);(x)->talign=0; }
 
-#define BATrestricted(b) (VIEWparent(b) ? BBP_cache(VIEWparent(b))->restricted 
: (b)->restricted)
+#define COLrestricted(b) (VIEWparent(b) ? BBP_cache(VIEWparent(b))->restricted 
: (b)->restricted)
 
 /* The restricted field indicates whether a BAT is readonly.
  * we have modes: BAT_WRITE  = all permitted
@@ -2892,7 +2893,7 @@
  * void
  * print_a_bat(BAT *b)
  * {
- *     BATiter bi = bat_iterator(b);
+ *     COLiter bi = col_iterator(b);
  *     BUN p, q;
  *
  *     BATloop(b, p, q)
@@ -3007,62 +3008,22 @@
        for (hb = h->hash[HASHprobe(h, v)]; hb != BUN_NONE; hb = h->link[hb]) \
                if (ATOMcmp(h->type, v, BUNhvar(bi, hb)) == 0)
 
-#define HASHloop_bit(bi,h,hb,v)                                                
\
-       for (hb = h->hash[hash_chr(h,v)]; hb != BUN_NONE; hb = h->link[hb]) \
-               if (simple_EQ(v, BUNhloc(bi, hb), bte))
+#define HASHloop_typed(bi,h,hb,v,TYPE)                                 \
+       for (hb = h->hash[hash_lng(h,v)]; hb != BUN_NONE; hb = h->link[hb]) \
+               if (simple_EQ(v, BUNhloc(bi, hb), TYPE))
 
-#define HASHloop_chr(bi,h,hb,v)                                                
\
-       for (hb = h->hash[hash_chr(h,v)]; hb != BUN_NONE; hb = h->link[hb]) \
-               if (simple_EQ(v, BUNhloc(bi, hb), chr))
-
-#define HASHloop_bte(bi,h,hb,v)                                                
\
-       for (hb = h->hash[hash_bte(h,v)]; hb != BUN_NONE; hb = h->link[hb]) \
-               if (simple_EQ(v, BUNhloc(bi, hb), bte))
-
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to