- /* get database for record and record itself at pos */
- const char *db = Z3950_resultset_get (r, pos, "database", 0);
- int len;
- const char *rec = Z3950_resultset_get (r, pos, "render", &len);
- /* if rec is non-null, we got a record for display */
- if (rec)
- {
- printf ("%d %s\n", pos+1, (db ? db : "unknown"));
- if (rec)
- fwrite (rec, 1, len, stdout);
- putchar ('\n');
- }
+ ZOOM_record rec = ZOOM_resultset_record (r, pos);
+ if (rec)
+ {
+ /* get database for record and record itself at pos */
+ const char *db = ZOOM_record_get (rec, "database", 0);
+ int len;
+ const char *render = ZOOM_record_get (rec, "render", &len);
+ /* if rec is non-null, we got a record for display */
+ if (rec)
+ {
+ printf ("%d %s\n", pos+1, (db ? db : "unknown"));
+ if (render)
+ fwrite (render, 1, len, stdout);
+ printf ("\n");
+ }
+ }