55{
56
57
58
59
60
61
62
63 typedef struct {
64#line 31 "pointer_to_struct.pgc"
65 struct varchar_2 {
int len;
char arr[ 50 ]; }
name ;
66
67#line 32 "pointer_to_struct.pgc"
68 int phone ;
69 } customer2 ;
70
71#line 33 "pointer_to_struct.pgc"
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90#line 27 "pointer_to_struct.pgc"
92
93#line 28 "pointer_to_struct.pgc"
95
96#line 34 "pointer_to_struct.pgc"
97 customer2 * custs2 = ( customer2 * )
malloc (
sizeof ( customer2 ) * 10 ) ;
98
99#line 40 "pointer_to_struct.pgc"
100 struct customer3 {
101#line 38 "pointer_to_struct.pgc"
103
104#line 39 "pointer_to_struct.pgc"
105 int phone ;
106 } * custs3 = (
struct customer3 * )
malloc (
sizeof (
struct customer3 ) * 10 ) ;
107
108#line 46 "pointer_to_struct.pgc"
109 struct customer4 {
110#line 44 "pointer_to_struct.pgc"
111 struct varchar_3 {
int len;
char arr[ 50 ]; }
name ;
112
113#line 45 "pointer_to_struct.pgc"
114 int phone ;
115 } * custs4 = (
struct customer4 * )
malloc (
sizeof (
struct customer4 ) ) ;
116
117#line 48 "pointer_to_struct.pgc"
118 int r ;
119
120#line 49 "pointer_to_struct.pgc"
121 struct varchar_4 {
int len;
char arr[ 50 ]; } onlyname [ 2 ] ;
122
123#line 50 "pointer_to_struct.pgc"
124
125
127
128 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
129#line 54 "pointer_to_struct.pgc"
130
132#line 54 "pointer_to_struct.pgc"
133
135#line 54 "pointer_to_struct.pgc"
136
137
139#line 56 "pointer_to_struct.pgc"
140
142#line 56 "pointer_to_struct.pgc"
143
145#line 56 "pointer_to_struct.pgc"
146
148#line 57 "pointer_to_struct.pgc"
149
151#line 57 "pointer_to_struct.pgc"
152
154#line 57 "pointer_to_struct.pgc"
155
157#line 57 "pointer_to_struct.pgc"
158
160#line 58 "pointer_to_struct.pgc"
161
163#line 58 "pointer_to_struct.pgc"
164
166#line 58 "pointer_to_struct.pgc"
167
169#line 58 "pointer_to_struct.pgc"
170
171
177#line 60 "pointer_to_struct.pgc"
178
180#line 60 "pointer_to_struct.pgc"
181
183#line 60 "pointer_to_struct.pgc"
184
186#line 60 "pointer_to_struct.pgc"
187
189 for (r = 0; r < 2; r++)
190 {
192 printf(
"phone - %d\n", custs1[r].phone );
193 }
194
196 ECPGt_varchar,&(custs2->name),(
long)50,(
long)-1,
sizeof( customer2 ),
198 ECPGt_int,&(custs2->phone),(
long)1,(
long)-1,
sizeof( customer2 ),
200#line 68 "pointer_to_struct.pgc"
201
203#line 68 "pointer_to_struct.pgc"
204
206#line 68 "pointer_to_struct.pgc"
207
209#line 68 "pointer_to_struct.pgc"
210
212 for (r = 0; r < 2; r++)
213 {
215 printf(
"phone - %d\n", custs2[r].phone );
216 }
217
219 ECPGt_char,&(custs3->name),(
long)50,(
long)-1,
sizeof(
struct customer3 ),
221 ECPGt_int,&(custs3->phone),(
long)1,(
long)-1,
sizeof(
struct customer3 ),
223#line 76 "pointer_to_struct.pgc"
224
226#line 76 "pointer_to_struct.pgc"
227
229#line 76 "pointer_to_struct.pgc"
230
232#line 76 "pointer_to_struct.pgc"
233
235 for (r = 0; r < 2; r++)
236 {
238 printf(
"phone - %d\n", custs3[r].phone );
239 }
240
242 ECPGt_varchar,&(custs4->name),(
long)50,(
long)-1,
sizeof(
struct customer4 ),
244 ECPGt_int,&(custs4->phone),(
long)1,(
long)-1,
sizeof(
struct customer4 ),
246#line 84 "pointer_to_struct.pgc"
247
249#line 84 "pointer_to_struct.pgc"
250
252#line 84 "pointer_to_struct.pgc"
253
255#line 84 "pointer_to_struct.pgc"
256
258 printf(
"name - %s\n", custs4->name.arr );
259 printf(
"phone - %d\n", custs4->phone );
260
262 ECPGt_varchar,(onlyname),(
long)50,(
long)2,
sizeof(
struct varchar_4),
264#line 89 "pointer_to_struct.pgc"
265
267#line 89 "pointer_to_struct.pgc"
268
270#line 89 "pointer_to_struct.pgc"
271
273#line 89 "pointer_to_struct.pgc"
274
276 for (r = 0; r < 2; r++)
277 {
278 printf(
"name - %s\n", onlyname[r].arr );
279 }
280
282#line 96 "pointer_to_struct.pgc"
283
285#line 96 "pointer_to_struct.pgc"
286
288#line 96 "pointer_to_struct.pgc"
289
290
291
292 return 0;
293}
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
struct customer::varchar_1 name