/* tview.c */ /***********************************************************************/ /* */ /* Command-line program which will allows you to view any CRDE table. */ /* */ /* Usage: tview */ /* */ /* To compile this program requires the creation of a project file */ /* which should look something like */ /* */ /* tview */ /* crde.lib */ /* */ /***********************************************************************/ #include #include #include "crde.h" int tbuffers = 128; int main(int argc, char *argv[]) { TABLE *t; int i; if (argc < 2) { printf("usage: tview \n"); exit(1); } if ((t = topen(argv[1])) == NULL) { printf("Unable to open table (error code = %d).\n", terrno); exit(1); } clrscr(); gotoxy(3, 2); printf("Viewing table %s.", argv[1]); gotoxy(3, 3); printf("%ld rows found.", trows(t)); if (tview(t, NULL, NULL, 3, 4, 78, 23, 0x07, 0x07, 0x07, NULL) < 0) printf("Error %d occurred. Program aborted.", terrno); tclose(t); } /* end of tview.c */