2005-07-01 21:00:04 +00:00
|
|
|
/* Test/example program for the base library
|
|
|
|
|
|
|
|
Copyright (C) 2005 Free Software Foundation, Inc.
|
|
|
|
|
2005-07-15 22:51:23 +00:00
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
notice and this notice are preserved.
|
|
|
|
|
2005-07-01 21:00:04 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
*/
|
1996-04-16 21:32:15 +00:00
|
|
|
/* Test NXStringTable class. */
|
|
|
|
|
|
|
|
#include <objc/NXStringTable.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
id table;
|
|
|
|
int i, times;
|
2005-02-22 11:22:44 +00:00
|
|
|
|
1996-04-16 21:32:15 +00:00
|
|
|
if (argc < 2) {
|
|
|
|
fprintf(stderr, "Usage: table_test filename repeat\n");
|
|
|
|
fprintf(stderr, " filename is a stringtable format file.\n");
|
|
|
|
fprintf(stderr, " repeat is a number of times to loop\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (argc == 3)
|
|
|
|
times = atoi(argv[2]);
|
2005-02-22 11:22:44 +00:00
|
|
|
else
|
1996-04-16 21:32:15 +00:00
|
|
|
times = 1;
|
2005-02-22 11:22:44 +00:00
|
|
|
|
1996-04-16 21:32:15 +00:00
|
|
|
table = [[NXStringTable alloc] init];
|
|
|
|
|
|
|
|
for (i=0; i < times; i++) {
|
|
|
|
[table readFromFile:argv[1]];
|
|
|
|
printf("-----------------------------------------\n");
|
|
|
|
[table writeToStream:stdout];
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|