-/* $Id: api.h,v 1.3 2004-11-29 21:55:25 adam Exp $
+/* $Id: api.h,v 1.4 2004-12-02 17:27:03 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
/* Browse */
YAZ_EXPORT int zebra_scan (ZebraHandle zh, ODR stream,
- Z_AttributesPlusTerm *zapt,
- oid_value attributeset,
- int *position, int *num_entries,
- ZebraScanEntry **list,
- int *is_partial);
+ Z_AttributesPlusTerm *zapt,
+ oid_value attributeset,
+ int *position, int *num_entries,
+ ZebraScanEntry **list,
+ int *is_partial);
int score;
} ZebraMetaRecord;
-YAZ_EXPORT ZebraMetaRecord *zebra_meta_records_create (ZebraHandle zh,
- const char *name,
- int num,
- zint *positions);
+YAZ_EXPORT
+ZebraMetaRecord *zebra_meta_records_create (ZebraHandle zh,
+ const char *name,
+ int num, zint *positions);
+
-YAZ_EXPORT void zebra_meta_records_destroy (ZebraHandle zh,
- ZebraMetaRecord *records, int num);
+YAZ_EXPORT
+ZebraMetaRecord *zebra_meta_records_create_range (ZebraHandle zh,
+ const char *name,
+ zint start, int num);
+
+YAZ_EXPORT
+void zebra_meta_records_destroy (ZebraHandle zh, ZebraMetaRecord *records,
+ int num);
YAZ_END_CDECL
#endif
-/* $Id: zebraapi.c,v 1.142 2004-11-29 21:55:27 adam Exp $
+/* $Id: zebraapi.c,v 1.143 2004-12-02 17:27:03 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
}
int zebra_records_retrieve (ZebraHandle zh, ODR stream,
- const char *setname, Z_RecordComposition *comp,
- oid_value input_format, int num_recs,
- ZebraRetrievalRecord *recs)
+ const char *setname, Z_RecordComposition *comp,
+ oid_value input_format, int num_recs,
+ ZebraRetrievalRecord *recs)
{
ZebraMetaRecord *poset;
int i, ret = 0;
-/* $Id: zsets.c,v 1.72 2004-11-29 21:55:28 adam Exp $
+/* $Id: zsets.c,v 1.73 2004-12-02 17:27:04 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
}
}
+ZebraMetaRecord *zebra_meta_records_create_range (ZebraHandle zh,
+ const char *name,
+ zint start, int num)
+{
+ zint pos_small[10];
+ zint *pos = pos_small;
+ ZebraMetaRecord *mr;
+ int i;
+
+ if (num > 10000 || num <= 0)
+ return 0;
+
+ if (num > 10)
+ pos = xmalloc(sizeof(*pos) * num);
+
+ for (i = 0; i<num; i++)
+ pos[i] = start+i;
+
+ mr = zebra_meta_records_create(zh, name, num, pos);
+
+ if (num > 10)
+ xfree(pos);
+ return mr;
+}
+
ZebraMetaRecord *zebra_meta_records_create (ZebraHandle zh, const char *name,
int num, zint *positions)
{