+ * do_recordType: Return record type (if any) at position.
+ */
+static int do_recordType (void *o, Tcl_Interp *interp, int argc, char **argv)
+{
+ IrTcl_SetObj *obj = o;
+ int offset;
+ IrTcl_RecordList *rl;
+ char *cp;
+
+ if (argc == 0)
+ {
+ return TCL_OK;
+ }
+ else if (argc == -1)
+ {
+ return TCL_OK;
+ }
+ if (argc < 3)
+ {
+ sprintf (interp->result, "wrong # args");
+ return TCL_ERROR;
+ }
+ if (Tcl_GetInt (interp, argv[2], &offset)==TCL_ERROR)
+ return TCL_ERROR;
+ rl = find_IR_record (obj, offset);
+ if (!rl)
+ return TCL_OK;
+ if (rl->which != Z_NamePlusRecord_databaseRecord)
+ {
+ Tcl_AppendResult (interp, "No DB record at #", argv[2], NULL);
+ return TCL_ERROR;
+ }
+ switch (rl->u.dbrec.type)
+ {
+ case VAL_UNIMARC:
+ cp = "UNIMARC";
+ break;
+ case VAL_INTERMARC:
+ cp = "INTERMARC";
+ break;
+ case VAL_CCF:
+ cp = "CCF";
+ break;
+ case VAL_USMARC:
+ cp = "USMARC";
+ break;
+ case VAL_UKMARC:
+ cp = "UKMARC";
+ break;
+ case VAL_NORMARC:
+ cp = "NORMARC";
+ break;
+ case VAL_LIBRISMARC:
+ cp = "LIBRISMARC";
+ break;
+ case VAL_DANMARC:
+ cp = "DANMARC";
+ break;
+ case VAL_FINMARC:
+ cp = "FINMARC";
+ break;
+ case VAL_MAB:
+ cp = "MAB";
+ break;
+ case VAL_CANMARC:
+ cp = "CANMARC";
+ break;
+ case VAL_SBN:
+ cp = "SBN";
+ break;
+ case VAL_PICAMARC:
+ cp = "PICAMARC";
+ break;
+ case VAL_AUSMARC:
+ cp = "AUSMARC";
+ break;
+ case VAL_IBERMARC:
+ cp = "IBERMARC";
+ break;
+ case VAL_SUTRS:
+ cp = "SUTRS";
+ break;
+ default:
+ cp = "";
+ }
+ Tcl_AppendElement (interp, cp);
+ return TCL_OK;
+}
+
+/*