static bool lzfZipCol(int i, cr_t *cr, cz_t *cz, uint32 *tlen, uint32 *mtlen) { INCRBY(*tlen, cr->slens[i]); uint32 mlen = MAX(4, cr->slens[i] + 4); uint32 n = cz->lzf_n; cz->lzf_s[n] = malloc(mlen); /* FREE ME 034 */ cz->lzf_l[n] = lzf_compress(cr->strs[i], cr->slens[i], cz->lzf_s[n], mlen); if (!cz->lzf_l[n]) return 0; cz->lsocl[n] = _cr8Icol(cr->slens[i], &ucdum, &cz->socl[n]); INCRBY(*mtlen, (cz->lsocl[cz->lzf_n] + cz->lzf_l[cz->lzf_n])); INCR(cz->lzf_n) return 1; }
static void wUCol(uchar **row, uchar sflag, ulong icol, bool isi) { if (!sflag) return; if (sflag == COL_1BYTE_INT) { **row = (char)icol; INCR(*row); } else if (sflag == COL_2BYTE_INT) { memcpy(*row, &icol, 2); INCRBY(*row, 2); } else if (sflag == COL_4BYTE_INT) { memcpy(*row, &icol, 4); INCRBY(*row, 4); } else { if (isi) { /* INT */ **row = COL_5BYTE_INT; INCR(*row); memcpy(*row, &icol, 4); INCRBY(*row, 4); } else if (sflag == COL_6BYTE_INT) { /* LONG */ memcpy(*row, &icol, 6); INCRBY(*row, 6); } else if (sflag == COL_8BYTE_INT) { memcpy(*row, &icol, 8); INCRBY(*row, 8); } else { **row = COL_9BYTE_INT; INCR(*row); memcpy(*row, &icol, 8); INCRBY(*row, 8); } } }
// U160 U160 U160 U160 U160 U160 U160 U160 U160 U160 U160 U160 U160 U160 void writeU160Col(uchar **row, uint160 ycol) { memcpy(*row, &ycol, AS_DIGEST_KEY_SZ); INCRBY(*row, AS_DIGEST_KEY_SZ); }
// STREAM_U128_COL STREAM_U128_COL STREAM_U128_COL STREAM_U128_COL //TODO U128's can be packed as 2 StreamUlongs - probably not needed void writeU128Col(uchar **row, uint128 xcol) { memcpy(*row, &xcol, 16); INCRBY(*row, 16); }