27 char *
next = strpbrk(++
str,
".-["),
37 for (; members; members = members->
next)
39 if (strcmp(members->
name,
str) == 0)
66 for (count = 1, end =
next + 1; count; end++)
209 for (count = 1, end =
next + 1; count; end++)
235 switch (p->
type->u.element->type)
265 for (p = prev =
types; p;)
283 p = prev ? prev->
next : NULL;
306 for (ptr =
cur; ptr != NULL; ptr = ptr->
next)
311 for (varptr = prevvar = ptr->
argsinsert; varptr != NULL; varptr = varptr->
next)
322 for (varptr = prevvar = ptr->
argsresult; varptr != NULL; varptr = varptr->
next)
347 p = prev ? prev->
next : NULL;
398 new->indicator =
ind;
455 list->indicator->name,
list->indicator->type,
list->indicator->brace_level,
456 NULL, NULL, str_zero, NULL, NULL);
503 for (
this =
types;
this != NULL;
this = this->
next)
505 if (strcmp(this->name,
name) == 0)
516 adjust_array(
enum ECPGttype type_enum,
char **dimension,
char **length,
char *type_dimension,
char *type_index,
int pointer_len,
bool type_definition)
518 if (atoi(type_index) >= 0)
520 if (atoi(*length) >= 0)
523 *length = type_index;
526 if (atoi(type_dimension) >= 0)
528 if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
531 if (atoi(*dimension) >= 0)
532 *length = *dimension;
534 *dimension = type_dimension;
539 "multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len),
545 if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
548 if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
558 *length = *dimension;
562 if (atoi(*length) >= 0)
573 if (atoi(*length) < 0)
575 *length = *dimension;
584 if (pointer_len == 2)
591 if (pointer_len == 1)
595 if (atoi(*length) < 0)
601 if (atoi(*dimension) < 0 && !type_definition)
608 else if (strcmp(*dimension,
"0") == 0)
611 *length = *dimension;
620 *length = *dimension;
624 if (atoi(*length) >= 0)
625 mmfatal(
PARSE_ERROR,
"multidimensional arrays for simple data types are not supported");
#define ngettext(s, p, n)
@ ECPGt_unsigned_long_long
static struct variable * allvariables
struct variable * find_variable(char *name)
void add_variable_to_tail(struct arguments **list, struct variable *var, struct variable *ind)
void dump_variables(struct arguments *list, int mode)
void adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *type_dimension, char *type_index, int pointer_len, bool type_definition)
static struct variable * find_struct(char *name, char *next, char *end)
void reset_variables(void)
static struct variable * find_simple(char *name)
void remove_variables(int brace_level)
struct arguments * argsresult
void remove_variable_from_list(struct arguments **list, struct variable *var)
static struct variable * find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int brace_level)
void add_variable_to_head(struct arguments **list, struct variable *var, struct variable *ind)
struct arguments * argsinsert
struct typedefs * get_typedef(const char *name, bool noerror)
void remove_typedefs(int brace_level)
void check_indicator(struct ECPGtype *var)
struct variable * new_variable(const char *name, struct ECPGtype *type, int brace_level)
static PgChecksumMode mode
void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3
char * mm_strdup(const char *string)
void void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2
void * mm_alloc(size_t size)
struct ECPGstruct_member * next
struct ECPGstruct_member * members
struct ECPGtype * element
struct variable * indicator
struct variable * variable
struct arguments * argsinsert
struct arguments * argsresult
struct ECPGstruct_member * struct_member_list
struct ECPGtype * ECPGmake_array_type(struct ECPGtype *type, char *size)
struct ECPGtype * ECPGmake_simple_type(enum ECPGttype type, char *size, int counter)
void ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype *type, const int brace_level, const char *ind_name, struct ECPGtype *ind_type, const int ind_brace_level, const char *prefix, const char *ind_prefix, char *arr_str_size, const char *struct_sizeof, const char *ind_struct_sizeof)
struct ECPGtype * ECPGmake_struct_type(struct ECPGstruct_member *rm, enum ECPGttype type, char *type_name, char *struct_sizeof)
void ECPGfree_type(struct ECPGtype *type)