1
- /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.245 2003/07/08 12:11:32 meskes Exp $ */
1
+ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.246 2003/07/09 14:53:18 meskes Exp $ */
2
2
3
3
/* Copyright comment */
4
4
%{
@@ -202,7 +202,7 @@ adjust_informix(struct arguments *list)
202
202
203
203
for (ptr = list; ptr != NULL ; ptr = ptr->next )
204
204
{
205
- char temp[sizeof ( int )+ sizeof ( " , &() " )];
205
+ char temp[20 ]; /* this should be sufficient unless you have 8 byte integers */
206
206
char *original_var;
207
207
208
208
/* change variable name to "ECPG_informix_get_var(<counter>)" */
@@ -221,6 +221,27 @@ adjust_informix(struct arguments *list)
221
221
sprintf (temp, " %d, &(" , ecpg_informix_var++);
222
222
}
223
223
result = cat_str (5 , result, make_str (" ECPG_informix_set_var(" ), mm_strdup (temp), mm_strdup (original_var), make_str (" ), __LINE__);\n " ));
224
+
225
+ /* now the indicator if there is one */
226
+ if (ptr->indicator ->type ->type != ECPGt_NO_INDICATOR)
227
+ {
228
+ /* change variable name to "ECPG_informix_get_var(<counter>)" */
229
+ original_var = ptr->indicator ->name ;
230
+ sprintf (temp, " %d))" , ecpg_informix_var);
231
+
232
+ /* create call to "ECPG_informix_set_var(<counter>, <pointer>. <linen number>)" */
233
+ if (atoi (ptr->indicator ->type ->size ) > 1 )
234
+ {
235
+ ptr->indicator = new_variable (cat_str (4 , make_str (" (" ), mm_strdup (ECPGtype_name (ptr->indicator ->type ->type )), make_str (" *)(ECPG_informix_get_var(" ), mm_strdup (temp)), ECPGmake_simple_type (ptr->indicator ->type ->type , ptr->indicator ->type ->size ), 0 );
236
+ sprintf (temp, " %d, (" , ecpg_informix_var++);
237
+ }
238
+ else
239
+ {
240
+ ptr->indicator = new_variable (cat_str (4 , make_str (" *(" ), mm_strdup (ECPGtype_name (ptr->indicator ->type ->type )), make_str (" *)(ECPG_informix_get_var(" ), mm_strdup (temp)), ECPGmake_simple_type (ptr->indicator ->type ->type , ptr->indicator ->type ->size ), 0 );
241
+ sprintf (temp, " %d, &(" , ecpg_informix_var++);
242
+ }
243
+ result = cat_str (5 , result, make_str (" ECPG_informix_set_var(" ), mm_strdup (temp), mm_strdup (original_var), make_str (" ), __LINE__);\n " ));
244
+ }
224
245
}
225
246
226
247
return result;
@@ -6097,7 +6118,7 @@ c_args: /*EMPTY*/ { $$ = EMPTY; }
6097
6118
coutputvariable : CVARIABLE indicator
6098
6119
{ add_variable(&argsresult, find_variable($1 ), find_variable($2 )); }
6099
6120
| CVARIABLE
6100
- { add_variable(&argsresult, find_variable($1 ), &no_indicator); }
6121
+ { add_variable(&argsresult, find_variable($1 ), &no_indicator); }
6101
6122
;
6102
6123
6103
6124
0 commit comments