/* Try to either setup on-demand paging (using FP as backing
file), or in case that doesn't work (FP not seekable) slurps in
all pages and deactivates paging. */
-static void
+void
read_or_setup_pages (FILE *fp, Attrstore *s)
{
unsigned int blobsz;
};
void add_attr_from_file (Attrstore *s, unsigned entry, Id name, int type, Id *idmap, unsigned maxid, FILE *fp);
+void read_or_setup_pages (FILE *fp, Attrstore *s);
#define get_num(ptr,val) do { \
typedef int __wrong_buf__[(1-sizeof((ptr)[0])) * (sizeof((ptr)[0])-1)];\
case TYPE_ID:
read_id(fp, numid + numrel); /* just check Id */
break;
- case TYPE_ATTR_CHUNK:
- read_id(fp, 0);
- /* Fallthrough. */
- case TYPE_ATTR_INT:
- read_id(fp, 0);
- break;
case TYPE_U32:
read_u32(fp);
break;
while ((read_u8(fp) & 0xc0) != 0)
;
break;
+ case TYPE_ATTR_CHUNK:
+ read_id(fp, 0);
+ /* Fallthrough. */
+ case TYPE_ATTR_INT:
+ read_id(fp, 0);
+ break;
case TYPE_ATTR_INTLIST:
case TYPE_ATTR_LOCALIDS:
while (read_id(fp, 0) != 0)
if (embedded_store)
{
attr_store_pack (embedded_store);
+ /* If we have any attributes we also have pages. */
+ read_or_setup_pages (fp, embedded_store);
repo_add_attrstore (repo, embedded_store);
}
xfree(idmap);