+static int nativesyntax_to_type(struct session_database *sdb, char *type,
+ ZOOM_record rec);
+
+static void client_show_immediate(
+ ZOOM_resultset resultset, struct session_database *sdb, int position,
+ void *data,
+ void (*error_handler)(void *data, const char *addinfo),
+ void (*record_handler)(void *data, const char *buf, size_t sz),
+ int binary)
+{
+ ZOOM_record rec = 0;
+ char type[80];
+ const char *buf;
+ int len;
+
+ if (!resultset)
+ {
+ error_handler(data, "no resultset");
+ return;
+ }
+ rec = ZOOM_resultset_record(resultset, position-1);
+ if (!rec)
+ {
+ error_handler(data, "no record");
+ return;
+ }
+ if (binary)
+ strcpy(type, "raw");
+ else
+ nativesyntax_to_type(sdb, type, rec);
+ buf = ZOOM_record_get(rec, type, &len);
+ if (!buf)
+ {
+ error_handler(data, "no record");
+ return;
+ }
+ record_handler(data, buf, len);
+}
+