tabletostruct - convert a table to C structure
SYNOPSIS
DESCRIPTION
tabletostruct
converts a standard
/rdb
table into a C language structure declaration.
tag
is the structure tag for reference by other declarations and
name
is the structure name used to reference the structure members.
This command is useful for writing table driven code.
EXAMPLE
$ cat mathtable
a b c
- - -
1 2 3
4 5 6
7 8 9
$ tabletostruct Table table < mathtable > table.h
$ cat table.h
struct Table
{
char *a;
char *b;
char *c;
} table [] =
{ "1","2","3" }
,{ "4","5","6" }
,{ "7","8","9" }
;
SEE ALSO