aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/variable.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-05-14 14:37:36 +0000
committerMichael Meskes <meskes@postgresql.org>2003-05-14 14:37:36 +0000
commit4e1ed3da9b3be389875f63e6c5656856290a72b3 (patch)
tree3427f6e7466411b9ed6f6810aafacc2e69963100 /src/interfaces/ecpg/preproc/variable.c
parent78b08584b43d2608a10eb41e5d9430baa4d6f52a (diff)
downloadpostgresql-4e1ed3da9b3be389875f63e6c5656856290a72b3.tar.gz
postgresql-4e1ed3da9b3be389875f63e6c5656856290a72b3.zip
- Added more compatibility functions.
- Accept CPP defines for type definitions. - Do not parse system include files automatically for Informix mode
Diffstat (limited to 'src/interfaces/ecpg/preproc/variable.c')
-rw-r--r--src/interfaces/ecpg/preproc/variable.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/interfaces/ecpg/preproc/variable.c b/src/interfaces/ecpg/preproc/variable.c
index 34504ccfece..e545ade5295 100644
--- a/src/interfaces/ecpg/preproc/variable.c
+++ b/src/interfaces/ecpg/preproc/variable.c
@@ -298,22 +298,22 @@ get_typedef(char *name)
}
void
-adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dimension, int type_index, int pointer_len)
+adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *type_dimension, char *type_index, int pointer_len)
{
- if (type_index >= 0)
+ if (atoi(type_index) >= 0)
{
- if (*length >= 0)
+ if (atoi(*length) >= 0)
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support");
*length = type_index;
}
- if (type_dimension >= 0)
+ if (atoi(type_dimension) >= 0)
{
- if (*dimension >= 0 && *length >= 0)
+ if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support");
- if (*dimension >= 0)
+ if (atoi(*dimension) >= 0)
*length = *dimension;
*dimension = type_dimension;
@@ -328,10 +328,10 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
if (pointer_len > 1 && type_enum != ECPGt_char && type_enum != ECPGt_unsigned_char)
mmerror(PARSE_ERROR, ET_FATAL, "No pointer to pointer supported for this type");
- if (pointer_len > 1 && (*length >= 0 || *dimension >= 0))
+ if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support");
- if (*length >= 0 && *dimension >= 0 && pointer_len)
+ if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support");
switch (type_enum)
@@ -342,23 +342,23 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
if (pointer_len)
{
*length = *dimension;
- *dimension = 0;
+ *dimension = make_str("0");
}
- if (*length >= 0)
+ if (atoi(*length) >= 0)
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support for structures");
break;
case ECPGt_varchar:
/* pointer has to get dimension 0 */
if (pointer_len)
- *dimension = 0;
+ *dimension = make_str("0");
/* one index is the string length */
- if (*length < 0)
+ if (atoi(*length) < 0)
{
*length = *dimension;
- *dimension = -1;
+ *dimension = make_str("-1");
}
break;
@@ -367,19 +367,19 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
/* char ** */
if (pointer_len == 2)
{
- *length = *dimension = 0;
+ *length = *dimension = make_str("0");
break;
}
/* pointer has to get length 0 */
if (pointer_len == 1)
- *length = 0;
+ *length = make_str("0");
/* one index is the string length */
- if (*length < 0)
+ if (atoi(*length) < 0)
{
- *length = (*dimension < 0) ? 1 : *dimension;
- *dimension = -1;
+ *length = (atoi(*dimension) < 0) ? make_str("1") : *dimension;
+ *dimension = make_str("-1");
}
break;
default:
@@ -387,10 +387,10 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim
if (pointer_len)
{
*length = *dimension;
- *dimension = 0;
+ *dimension = make_str("0");
}
- if (*length >= 0)
+ if (atoi(*length) >= 0)
mmerror(PARSE_ERROR, ET_FATAL, "No multi-dimensional array support for simple data types");
break;