Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5208
Modified Files:
Tag: Release_0_9_5_stable
backend-risx.c
Log Message:
export url as link with type url
Index: backend-risx.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/backend-risx.c,v
retrieving revision 1.30.2.8
retrieving revision 1.30.2.9
diff -u -U2 -r1.30.2.8 -r1.30.2.9
--- backend-risx.c 6 Aug 2005 22:52:12 -0000 1.30.2.8
+++ backend-risx.c 11 Sep 2005 20:00:05 -0000 1.30.2.9
@@ -738,4 +738,5 @@
size_t buffer1_len;
int nhave_data = 0;
+ int i;
/* printf("in add_pubinfo_risx\n"); */
@@ -846,14 +847,40 @@
/*----------------------------------------------------------------*/
- /* URL */
- if ((item = get_refdb_url_copy(ptr_rendinfo->dbires)) != NULL) {
- nhave_data = 1;
- if (print_element_x(item, &buffer1, &buffer1_len, "url", NULL, NULL, ptr_indent) == NULL) {
- free((char*)item);
- free(buffer1);
+ /* URL, L1 through L4 */
+
+ /* loop over all link types */
+ for (i=0; i<5;i++) {
+ char ulink_type[10];
+ dbi_result dbires;
+
+ dbires = request_ulinks(conn, my_dbi_result_get_idval(ptr_rendinfo->dbires, "refdb_id"), 0 /* ref entry */, i /* link type */);
+ if (dbires == NULL) {
return NULL;
}
- free((char*)item);
- }
+
+ while ((item = get_ulink(dbires)) != NULL) {
+ if (i == 0) {
+ strcpy(ulink_type, "url");
+ }
+ else if (i == 1) {
+ strcpy(ulink_type, "pdf");
+ }
+ else if (i == 2) {
+ strcpy(ulink_type, "fulltext");
+ }
+ else if (i == 3) {
+ strcpy(ulink_type, "related");
+ }
+ else if (i == 4) {
+ strcpy(ulink_type, "image");
+ }
+ if (print_element_x(item, &buffer1, &buffer1_len, "link", "type", ulink_type, ptr_indent) == NULL) {
+ clean_request(dbires);
+ return NULL;
+ }
+ }
+
+ clean_request(dbires);
+ } /* end for */
/*----------------------------------------------------------------*/
|