1996-04-10 06:49:32 +00:00
|
|
|
/*
|
1996-04-18 04:25:17 +00:00
|
|
|
* Copyright (c) 1995 Andrew McRae. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1995-08-24 09:03:04 +00:00
|
|
|
*/
|
1997-10-06 11:36:08 +00:00
|
|
|
|
|
|
|
#ifndef lint
|
|
|
|
static const char rcsid[] =
|
1999-08-28 01:35:59 +00:00
|
|
|
"$FreeBSD$";
|
1997-10-06 11:36:08 +00:00
|
|
|
#endif /* not lint */
|
|
|
|
|
2000-04-26 15:36:43 +00:00
|
|
|
/*
|
|
|
|
* Code cleanup, bug-fix and extension
|
|
|
|
* by Tatsumi Hosokawa <hosokawa@mt.cs.keio.ac.jp>
|
|
|
|
*/
|
|
|
|
|
1997-10-06 11:36:08 +00:00
|
|
|
#include <err.h>
|
1995-08-24 09:03:04 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1997-10-06 11:36:08 +00:00
|
|
|
#include <unistd.h>
|
1995-08-24 09:03:04 +00:00
|
|
|
|
2009-02-15 03:21:37 +00:00
|
|
|
#include "cardinfo.h"
|
|
|
|
#include "cis.h"
|
1995-08-24 09:03:04 +00:00
|
|
|
#include "readcis.h"
|
|
|
|
|
1996-06-18 21:58:55 +00:00
|
|
|
static int ck_linktarget(int, off_t, int);
|
|
|
|
static struct tuple_list *read_one_tuplelist(int, int, off_t);
|
|
|
|
static struct tuple_list *read_tuples(int);
|
|
|
|
static struct tuple *find_tuple_in_list(struct tuple_list *, unsigned char);
|
|
|
|
static struct tuple_info *get_tuple_info(unsigned char);
|
|
|
|
|
|
|
|
static struct tuple_info tuple_info[] = {
|
2008-11-20 08:30:15 +00:00
|
|
|
{"Null tuple", CIS_NULL, 0},
|
|
|
|
{"Common memory descriptor", CIS_MEM_COMMON, 255},
|
|
|
|
{"Long link to next chain for CardBus", CIS_LONGLINK_CB, 255},
|
|
|
|
{"Indirect access", CIS_INDIRECT, 255},
|
|
|
|
{"Configuration map for CardBus", CIS_CONF_MAP_CB, 255},
|
|
|
|
{"Configuration entry for CardBus", CIS_CONFIG_CB, 255},
|
|
|
|
{"Long link to next chain for MFC", CIS_LONGLINK_MFC, 255},
|
|
|
|
{"Base address register for CardBus", CIS_BAR, 6},
|
|
|
|
{"Checksum", CIS_CHECKSUM, 5},
|
|
|
|
{"Long link to attribute memory", CIS_LONGLINK_A, 4},
|
|
|
|
{"Long link to common memory", CIS_LONGLINK_C, 4},
|
|
|
|
{"Link target", CIS_LINKTARGET, 3},
|
|
|
|
{"No link", CIS_NOLINK, 0},
|
|
|
|
{"Version 1 info", CIS_INFO_V1, 255},
|
|
|
|
{"Alternate language string", CIS_ALTSTR, 255},
|
|
|
|
{"Attribute memory descriptor", CIS_MEM_ATTR, 255},
|
|
|
|
{"JEDEC descr for common memory", CIS_JEDEC_C, 255},
|
|
|
|
{"JEDEC descr for attribute memory", CIS_JEDEC_A, 255},
|
|
|
|
{"Configuration map", CIS_CONF_MAP, 255},
|
|
|
|
{"Configuration entry", CIS_CONFIG, 255},
|
|
|
|
{"Other conditions for common memory", CIS_DEVICE_OC, 255},
|
|
|
|
{"Other conditions for attribute memory", CIS_DEVICE_OA, 255},
|
|
|
|
{"Geometry info for common memory", CIS_DEVICEGEO, 255},
|
|
|
|
{"Geometry info for attribute memory", CIS_DEVICEGEO_A, 255},
|
|
|
|
{"Manufacturer ID", CIS_MANUF_ID, 4},
|
|
|
|
{"Functional ID", CIS_FUNC_ID, 2},
|
|
|
|
{"Functional EXT", CIS_FUNC_EXT, 255},
|
|
|
|
{"Software interleave", CIS_SW_INTERLV, 2},
|
|
|
|
{"Version 2 Info", CIS_VERS_2, 255},
|
|
|
|
{"Data format", CIS_FORMAT, 255},
|
|
|
|
{"Geometry", CIS_GEOMETRY, 4},
|
|
|
|
{"Byte order", CIS_BYTEORDER, 2},
|
|
|
|
{"Card init date", CIS_DATE, 4},
|
|
|
|
{"Battery replacement", CIS_BATTERY, 4},
|
|
|
|
{"Organization", CIS_ORG, 255},
|
|
|
|
{"Terminator", CIS_END, 0},
|
1996-04-10 06:49:32 +00:00
|
|
|
{0, 0, 0}
|
|
|
|
};
|
1995-08-24 09:03:04 +00:00
|
|
|
|
2008-11-17 22:46:29 +00:00
|
|
|
static void *
|
|
|
|
xmalloc(int sz)
|
|
|
|
{
|
|
|
|
void *p;
|
|
|
|
|
|
|
|
sz = (sz + 7) & ~7;
|
|
|
|
p = malloc(sz);
|
|
|
|
if (p)
|
|
|
|
bzero(p, sz);
|
|
|
|
else
|
|
|
|
errx(1, "malloc");
|
|
|
|
return (p);
|
|
|
|
}
|
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* After reading the tuples, decode the relevant ones.
|
|
|
|
*/
|
2008-11-20 08:12:26 +00:00
|
|
|
struct tuple_list *
|
1995-08-24 09:03:04 +00:00
|
|
|
readcis(int fd)
|
|
|
|
{
|
|
|
|
|
2008-11-20 08:12:26 +00:00
|
|
|
return (read_tuples(fd));
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* free_cis - delete cis entry.
|
|
|
|
*/
|
|
|
|
void
|
2008-11-20 08:12:26 +00:00
|
|
|
freecis(struct tuple_list *tlist)
|
1995-08-24 09:03:04 +00:00
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple_list *tl;
|
2008-11-20 08:12:26 +00:00
|
|
|
struct tuple *tp;
|
1996-04-10 06:49:32 +00:00
|
|
|
|
2008-11-20 08:12:26 +00:00
|
|
|
while ((tl = tlist) != 0) {
|
|
|
|
tlist = tl->next;
|
1996-04-10 06:49:32 +00:00
|
|
|
while ((tp = tl->tuples) != 0) {
|
1995-08-24 09:03:04 +00:00
|
|
|
tl->tuples = tp->next;
|
2008-11-20 08:12:26 +00:00
|
|
|
free(tp->data);
|
|
|
|
free(tp);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
2008-11-20 08:12:26 +00:00
|
|
|
free(tl);
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
2000-04-26 15:36:43 +00:00
|
|
|
/*
|
|
|
|
* Parse variable length value.
|
|
|
|
*/
|
|
|
|
u_int
|
|
|
|
parse_num(int sz, u_char *p, u_char **q, int ofs)
|
|
|
|
{
|
|
|
|
u_int num = 0;
|
|
|
|
|
|
|
|
switch (sz) {
|
|
|
|
case 0:
|
|
|
|
case 0x10:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 0x11:
|
|
|
|
num = (*p++) + ofs;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 0x12:
|
|
|
|
num = tpl16(p) + ofs;
|
|
|
|
p += 2;
|
|
|
|
break;
|
|
|
|
case 0x13:
|
|
|
|
num = tpl24(p) + ofs;
|
|
|
|
p += 3;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 0x14:
|
|
|
|
num = tpl32(p) + ofs;
|
|
|
|
p += 4;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (q)
|
|
|
|
*q = p;
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* Read the tuples from the card.
|
|
|
|
* The processing of tuples is as follows:
|
|
|
|
* - Read tuples at attribute memory, offset 0.
|
|
|
|
* - If a CIS_END is the first tuple, look for
|
|
|
|
* a tuple list at common memory offset 0; this list
|
|
|
|
* must start with a LINKTARGET.
|
|
|
|
* - If a long link tuple was encountered, execute the long
|
|
|
|
* link.
|
|
|
|
* - If a no-link tuple was seen, terminate processing.
|
|
|
|
* - If no no-link tuple exists, and no long link tuple
|
|
|
|
* exists while processing the primary tuple list,
|
|
|
|
* then look for a LINKTARGET tuple in common memory.
|
|
|
|
* - If a long link tuple is found in any list, then process
|
|
|
|
* it. Only one link is allowed per list.
|
|
|
|
*/
|
|
|
|
static struct tuple_list *tlist;
|
|
|
|
|
1996-06-18 21:58:55 +00:00
|
|
|
static struct tuple_list *
|
1995-08-24 09:03:04 +00:00
|
|
|
read_tuples(int fd)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple_list *tl = 0, *last_tl;
|
|
|
|
struct tuple *tp;
|
|
|
|
int flag;
|
|
|
|
off_t offs;
|
1995-08-24 09:03:04 +00:00
|
|
|
|
|
|
|
tlist = 0;
|
1996-04-10 06:49:32 +00:00
|
|
|
last_tl = tlist = read_one_tuplelist(fd, MDF_ATTR, (off_t) 0);
|
|
|
|
|
|
|
|
/* Now start processing the links (if any). */
|
|
|
|
do {
|
1995-08-24 09:03:04 +00:00
|
|
|
flag = MDF_ATTR;
|
|
|
|
tp = find_tuple_in_list(last_tl, CIS_LONGLINK_A);
|
1996-04-10 06:49:32 +00:00
|
|
|
if (tp == 0) {
|
1995-08-24 09:03:04 +00:00
|
|
|
flag = 0;
|
|
|
|
tp = find_tuple_in_list(last_tl, CIS_LONGLINK_C);
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
|
|
|
if (tp && tp->length == 4) {
|
2000-04-26 15:36:43 +00:00
|
|
|
offs = tpl32(tp->data);
|
1995-08-24 09:03:04 +00:00
|
|
|
#ifdef DEBUG
|
2008-11-20 08:12:26 +00:00
|
|
|
printf("Checking long link at %zd (%s memory)\n",
|
1996-04-10 06:49:32 +00:00
|
|
|
offs, flag ? "Attribute" : "Common");
|
1995-08-24 09:03:04 +00:00
|
|
|
#endif
|
1996-04-10 06:49:32 +00:00
|
|
|
/* If a link was found, read the tuple list from it. */
|
|
|
|
if (ck_linktarget(fd, offs, flag)) {
|
1995-08-24 09:03:04 +00:00
|
|
|
tl = read_one_tuplelist(fd, flag, offs);
|
|
|
|
last_tl->next = tl;
|
|
|
|
last_tl = tl;
|
|
|
|
}
|
1998-04-19 18:41:45 +00:00
|
|
|
} else
|
|
|
|
tl = 0;
|
1996-04-10 06:49:32 +00:00
|
|
|
} while (tl);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the primary list had no NOLINK tuple, and no LINKTARGET,
|
|
|
|
* then try to read a tuple list at common memory (offset 0).
|
|
|
|
*/
|
2008-11-20 08:30:15 +00:00
|
|
|
if (find_tuple_in_list(tlist, CIS_NOLINK) == 0 &&
|
|
|
|
find_tuple_in_list(tlist, CIS_LINKTARGET) == 0 &&
|
1996-04-10 06:49:32 +00:00
|
|
|
ck_linktarget(fd, (off_t) 0, 0)) {
|
2008-11-20 08:12:26 +00:00
|
|
|
offs = 0;
|
1995-08-24 09:03:04 +00:00
|
|
|
#ifdef DEBUG
|
2008-11-20 08:12:26 +00:00
|
|
|
printf("Reading long link at %zd (%s memory)\n",
|
1996-04-10 06:49:32 +00:00
|
|
|
offs, flag ? "Attribute" : "Common");
|
1995-08-24 09:03:04 +00:00
|
|
|
#endif
|
2008-11-20 08:12:26 +00:00
|
|
|
tlist->next = read_one_tuplelist(fd, 0, offs);
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
|
|
|
return (tlist);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* Read one tuple list from the card.
|
|
|
|
*/
|
1996-06-18 21:58:55 +00:00
|
|
|
static struct tuple_list *
|
1995-08-24 09:03:04 +00:00
|
|
|
read_one_tuplelist(int fd, int flags, off_t offs)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple *tp, *last_tp = 0;
|
|
|
|
struct tuple_list *tl;
|
|
|
|
struct tuple_info *tinfo;
|
|
|
|
int total = 0;
|
|
|
|
unsigned char code, length;
|
1995-08-24 09:03:04 +00:00
|
|
|
|
1996-04-10 06:49:32 +00:00
|
|
|
/* Check to see if this memory has already been scanned. */
|
1995-08-24 09:03:04 +00:00
|
|
|
for (tl = tlist; tl; tl = tl->next)
|
|
|
|
if (tl->offs == offs && tl->flags == (flags & MDF_ATTR))
|
1996-04-10 06:49:32 +00:00
|
|
|
return (0);
|
1995-08-24 09:03:04 +00:00
|
|
|
tl = xmalloc(sizeof(*tl));
|
|
|
|
tl->offs = offs;
|
|
|
|
tl->flags = flags & MDF_ATTR;
|
2008-11-20 08:20:53 +00:00
|
|
|
ioctl(fd, PIOCRWFLAG, &flags);
|
1995-08-24 09:03:04 +00:00
|
|
|
lseek(fd, offs, SEEK_SET);
|
1996-04-10 06:49:32 +00:00
|
|
|
do {
|
2008-11-17 22:46:29 +00:00
|
|
|
if (read(fd, &code, 1) != 1) {
|
1997-10-06 11:36:08 +00:00
|
|
|
warn("CIS code read");
|
1995-08-24 09:03:04 +00:00
|
|
|
break;
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
1995-08-24 09:03:04 +00:00
|
|
|
total++;
|
|
|
|
if (code == CIS_NULL)
|
|
|
|
continue;
|
|
|
|
tp = xmalloc(sizeof(*tp));
|
|
|
|
tp->code = code;
|
2000-04-26 15:36:43 +00:00
|
|
|
if (code == CIS_END)
|
|
|
|
length = 0;
|
|
|
|
else {
|
2008-11-17 22:46:29 +00:00
|
|
|
if (read(fd, &length, 1) != 1) {
|
2000-04-26 15:36:43 +00:00
|
|
|
warn("CIS len read");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
total++;
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
1995-08-24 09:03:04 +00:00
|
|
|
tp->length = length;
|
|
|
|
#ifdef DEBUG
|
1997-01-06 08:35:06 +00:00
|
|
|
printf("Tuple code = 0x%x, len = %d\n", code, length);
|
1995-08-24 09:03:04 +00:00
|
|
|
#endif
|
1996-04-10 06:49:32 +00:00
|
|
|
if (length == 0xFF) {
|
1995-08-24 09:03:04 +00:00
|
|
|
length = tp->length = 0;
|
|
|
|
code = CIS_END;
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
|
|
|
if (length != 0) {
|
1995-08-24 09:03:04 +00:00
|
|
|
total += length;
|
|
|
|
tp->data = xmalloc(length);
|
2008-11-17 22:46:29 +00:00
|
|
|
if (read(fd, tp->data, length) != length) {
|
1997-10-06 11:36:08 +00:00
|
|
|
warn("CIS read");
|
1995-08-24 09:03:04 +00:00
|
|
|
break;
|
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check the tuple, and ignore it if it isn't in the table
|
|
|
|
* or the length is illegal.
|
|
|
|
*/
|
1995-08-24 09:03:04 +00:00
|
|
|
tinfo = get_tuple_info(code);
|
2003-03-14 13:17:35 +00:00
|
|
|
if (tinfo != NULL && (tinfo->length != 255 && tinfo->length > length)) {
|
2008-11-20 08:12:26 +00:00
|
|
|
printf("code %s (%d) ignored\n", tuple_name(code), code);
|
1995-08-24 09:03:04 +00:00
|
|
|
tp->code = CIS_NULL;
|
1996-04-10 06:49:32 +00:00
|
|
|
}
|
2000-04-26 15:36:43 +00:00
|
|
|
if (tl->tuples == NULL)
|
1995-08-24 09:03:04 +00:00
|
|
|
tl->tuples = tp;
|
|
|
|
else
|
|
|
|
last_tp->next = tp;
|
|
|
|
last_tp = tp;
|
1996-04-10 06:49:32 +00:00
|
|
|
} while (code != CIS_END && total < 1024);
|
|
|
|
return (tl);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* return true if the offset points to a LINKTARGET tuple.
|
|
|
|
*/
|
1996-06-18 21:58:55 +00:00
|
|
|
static int
|
1995-08-24 09:03:04 +00:00
|
|
|
ck_linktarget(int fd, off_t offs, int flag)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
char blk[5];
|
1995-08-24 09:03:04 +00:00
|
|
|
|
|
|
|
ioctl(fd, PIOCRWFLAG, &flag);
|
|
|
|
lseek(fd, offs, SEEK_SET);
|
2008-11-17 22:46:29 +00:00
|
|
|
if (read(fd, blk, 5) != 5)
|
1996-04-10 06:49:32 +00:00
|
|
|
return (0);
|
2008-11-20 08:30:15 +00:00
|
|
|
if (blk[0] == CIS_LINKTARGET &&
|
1995-08-24 09:03:04 +00:00
|
|
|
blk[1] == 0x3 &&
|
|
|
|
blk[2] == 'C' &&
|
|
|
|
blk[3] == 'I' &&
|
|
|
|
blk[4] == 'S')
|
1996-04-10 06:49:32 +00:00
|
|
|
return (1);
|
|
|
|
return (0);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* find_tuple_in_list - find a tuple within a
|
|
|
|
* single tuple list.
|
|
|
|
*/
|
1996-06-18 21:58:55 +00:00
|
|
|
static struct tuple *
|
1995-08-24 09:03:04 +00:00
|
|
|
find_tuple_in_list(struct tuple_list *tl, unsigned char code)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple *tp;
|
1995-08-24 09:03:04 +00:00
|
|
|
|
|
|
|
for (tp = tl->tuples; tp; tp = tp->next)
|
|
|
|
if (tp->code == code)
|
|
|
|
break;
|
1996-04-10 06:49:32 +00:00
|
|
|
return (tp);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
1995-08-24 09:03:04 +00:00
|
|
|
/*
|
|
|
|
* return table entry for code.
|
|
|
|
*/
|
1996-06-18 21:58:55 +00:00
|
|
|
static struct tuple_info *
|
1995-08-24 09:03:04 +00:00
|
|
|
get_tuple_info(unsigned char code)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple_info *tp;
|
1995-08-24 09:03:04 +00:00
|
|
|
|
|
|
|
for (tp = tuple_info; tp->name; tp++)
|
|
|
|
if (tp->code == code)
|
1996-04-10 06:49:32 +00:00
|
|
|
return (tp);
|
|
|
|
return (0);
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|
1996-04-10 06:49:32 +00:00
|
|
|
|
2008-11-17 22:46:29 +00:00
|
|
|
const char *
|
1995-08-24 09:03:04 +00:00
|
|
|
tuple_name(unsigned char code)
|
|
|
|
{
|
1996-04-10 06:49:32 +00:00
|
|
|
struct tuple_info *tp;
|
1995-08-24 09:03:04 +00:00
|
|
|
|
|
|
|
tp = get_tuple_info(code);
|
|
|
|
if (tp)
|
1996-04-10 06:49:32 +00:00
|
|
|
return (tp->name);
|
|
|
|
return ("Unknown");
|
1995-08-24 09:03:04 +00:00
|
|
|
}
|