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++)
142 mmfatal(
PARSE_ERROR,
"variable \"%s\" is not a pointer to a structure or a union", name);
167 mmfatal(
PARSE_ERROR,
"variable \"%s\" is not a pointer to a structure or a union", name);
182 for (p = allvariables; p; p = p->
next)
184 if (strcmp(p->
name, name) == 0)
201 next = strpbrk(name,
".[-");
210 for (count = 1, end = next + 1; count; end++)
236 switch (p->
type->u.element->type)
266 for (p = prev =
types; p;)
284 p = prev ? prev->
next : NULL;
300 for (p = prev = allvariables; p;)
307 for (ptr =
cur; ptr != NULL; ptr = ptr->
next)
312 for (varptr = prevvar = ptr->
argsinsert; varptr != NULL; varptr = varptr->
next)
323 for (varptr = prevvar = ptr->
argsresult; varptr != NULL; varptr = varptr->
next)
337 if (p == allvariables)
338 prev = allvariables = p->
next;
345 if (prev == allvariables)
348 p = prev ? prev->
next : NULL;
396 for (p = *list; p && p->
next; p = p->
next);
399 new->indicator = ind;
415 for (p = *list; p; p = p->
next)
457 NULL, NULL, str_zero, NULL, NULL);
504 for (
this =
types;
this && strcmp(this->name, name) != 0;
this = this->
next);
512 adjust_array(
enum ECPGttype type_enum,
char **dimension,
char **length,
char *type_dimension,
char *type_index,
int pointer_len,
bool type_definition)
514 if (atoi(type_index) >= 0)
516 if (atoi(*length) >= 0)
519 *length = type_index;
522 if (atoi(type_dimension) >= 0)
524 if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
527 if (atoi(*dimension) >= 0)
528 *length = *dimension;
530 *dimension = type_dimension;
535 "multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len),
541 if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
544 if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
554 *length = *dimension;
558 if (atoi(*length) >= 0)
569 if (atoi(*length) < 0)
571 *length = *dimension;
580 if (pointer_len == 2)
587 if (pointer_len == 1)
591 if (atoi(*length) < 0)
597 if (atoi(*dimension) < 0 && !type_definition)
604 else if (strcmp(*dimension,
"0") == 0)
607 *length = *dimension;
616 *length = *dimension;
620 if (atoi(*length) >= 0)
621 mmfatal(
PARSE_ERROR,
"multidimensional arrays for simple data types are not supported");
static PgChecksumMode mode
void dump_variables(struct arguments *list, int mode)
struct typedefs * get_typedef(char *name)
struct variable * find_variable(char *name)
struct ECPGstruct_member * members
void void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2
static struct variable * find_struct(char *name, char *next, char *end)
struct arguments * argsinsert
struct ECPGtype * ECPGmake_array_type(struct ECPGtype *type, char *size)
struct variable * indicator
struct arguments * argsresult
void remove_typedefs(int brace_level)
struct ECPGtype * ECPGmake_simple_type(enum ECPGttype type, char *size, int counter)
char * mm_strdup(const char *)
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)
static struct variable * find_simple(char *name)
struct arguments * argsinsert
struct ECPGtype * element
static struct variable * allvariables
void add_variable_to_head(struct arguments **list, struct variable *var, struct variable *ind)
static struct variable * find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int brace_level)
struct variable * new_variable(const char *name, struct ECPGtype *type, int brace_level)
#define ngettext(s, p, n)
void adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *type_dimension, char *type_index, int pointer_len, bool type_definition)
struct arguments * argsresult
void ECPGfree_type(struct ECPGtype *type)
void reset_variables(void)
void add_variable_to_tail(struct arguments **list, struct variable *var, struct variable *ind)
void remove_variables(int brace_level)
void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3
struct ECPGtype * ECPGmake_struct_type(struct ECPGstruct_member *rm, enum ECPGttype type, char *type_name, char *struct_sizeof)
struct variable * variable
void check_indicator(struct ECPGtype *var)
struct ECPGstruct_member * struct_member_list
void remove_variable_from_list(struct arguments **list, struct variable *var)
struct ECPGstruct_member * next