-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUIFtest.cpp
More file actions
79 lines (58 loc) · 1.67 KB
/
UIFtest.cpp
File metadata and controls
79 lines (58 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//---------------------------------------------------------------------------
#include <stdio.h>
#include "flat.h"
#include "uif_draw.h"
#include "uif.h"
#include "macros.h"
//==============================================================================
void error(void *);
void DumpV(vector<string>);
//==============================================================================
int main(int argc, char* argv[])
{
printf("Hello, world .. %d arguments\n",argc);
UIF_DRAW c2;
if (argc<=1) {
printf("No supplied arguments");
return 0;
}
vector<UIF_DRAW::DC> stuff;
FILE * f = fopen("ping.pong","w");
if (f==0) printf("Cannot open dump target file\n");
c2.SetOFP(f);
for (int i=1;i<argc;i++) {
printf("Playing with %s.....\n",argv[i]);
c2.Add(string(argv[1]));
c2.Geometry();
c2.Draw(stuff,c2.Root());
// c2.Dump();
}
WALKVECTOR(UIF_DRAW::DC,stuff,i) (*i).Dump(f);
fclose(f);
/*
UIF cli;
cli.Add(argv[1]);
cli.Save("stuff.txt");
UIF cli0(argc,argv);
cli0.Dump("ping.pong");
cli0.Save("ding.dong");
*/
return 0;
}
//------------------------------------------------------------------------------
void error(void * p)
{
static int count = 0; // Count the errors
printf("Error count now %d\n",++count);
UIF * pN = static_cast<UIF *>(p); // Find and dump the error token
pN->Td.Dump();
printf("-------------------------\n");
}
//------------------------------------------------------------------------------
void DumpV(vector<string> ss)
{
printf("-------------------------\n");
WALKVECTOR(string,ss,i) printf("%s\n",(*i).c_str());
printf("-------------------------\n");
}
//------------------------------------------------------------------------------