53 const char *
next = strpbrk(++
str,
".-["),
62 for (; members; members = members->
next)
64 if (strcmp(members->
name, field) == 0)
90 for (count = 1, end =
next + 1; count; end++)
177 mmfatal(
PARSE_ERROR,
"variable \"%s\" is not a pointer to a structure or a union", prefix);
198 mmfatal(
PARSE_ERROR,
"variable \"%s\" is not a pointer to a structure or a union", prefix);
252 for (count = 1, end =
next + 1; count; end++)
289 switch (p->
type->u.element->type)
323 for (p =
types, prev = NULL; p; p =
next)
365 for (ptr =
cur; ptr != NULL; ptr = ptr->
next)
371 for (varptr = ptr->
argsinsert, prevvar = NULL;
372 varptr != NULL; varptr = nextvar)
374 nextvar = varptr->
next;
379 prevvar->
next = nextvar;
387 for (varptr = ptr->
argsresult, prevvar = NULL;
388 varptr != NULL; varptr = nextvar)
390 nextvar = varptr->
next;
395 prevvar->
next = nextvar;
474 new->indicator =
ind;
532 list->indicator->name,
list->indicator->type,
list->indicator->brace_level,
533 NULL, NULL, str_zero, NULL, NULL);
580 for (
this =
types;
this != NULL;
this = this->
next)
582 if (strcmp(this->name,
name) == 0)
594 const char **dimension,
const char **length,
595 const char *type_dimension,
const char *type_index,
596 int pointer_len,
bool type_definition)
598 if (atoi(type_index) >= 0)
600 if (atoi(*length) >= 0)
603 *length = type_index;
606 if (atoi(type_dimension) >= 0)
608 if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
611 if (atoi(*dimension) >= 0)
612 *length = *dimension;
614 *dimension = type_dimension;
619 "multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len),
625 if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
628 if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
638 *length = *dimension;
642 if (atoi(*length) >= 0)
653 if (atoi(*length) < 0)
655 *length = *dimension;
664 if (pointer_len == 2)
666 *length = *dimension =
"0";
671 if (pointer_len == 1)
675 if (atoi(*length) < 0)
681 if (atoi(*dimension) < 0 && !type_definition)
688 else if (strcmp(*dimension,
"0") == 0)
691 *length = *dimension;
700 *length = *dimension;
704 if (atoi(*length) >= 0)
705 mmfatal(
PARSE_ERROR,
"multidimensional arrays for simple data types are not supported");
#define ngettext(s, p, n)
@ ECPGt_unsigned_long_long
struct variable * new_variable(const char *name, struct ECPGtype *type, int brace_level)
static struct variable * allvariables
static struct variable * find_struct_member(const char *name, const char *str, struct ECPGstruct_member *members, int brace_level)
static struct variable * find_struct(const char *name, const char *next, const char *end)
void add_variable_to_tail(struct arguments **list, struct variable *var, struct variable *ind)
void dump_variables(struct arguments *list, int mode)
static struct variable * find_simple(const char *name)
void adjust_array(enum ECPGttype type_enum, const char **dimension, const char **length, const char *type_dimension, const char *type_index, int pointer_len, bool type_definition)
struct typedefs * get_typedef(const char *name, bool noerror)
void reset_variables(void)
void remove_variables(int brace_level)
struct arguments * argsresult
void remove_variable_from_list(struct arguments **list, struct variable *var)
void add_variable_to_head(struct arguments **list, struct variable *var, struct variable *ind)
struct arguments * argsinsert
static char * loc_nstrdup(const char *in, size_t len)
void remove_typedefs(int brace_level)
void check_indicator(struct ECPGtype *var)
struct variable * find_variable(const char *name)
static PgChecksumMode mode
void * loc_alloc(size_t size)
char * mm_strdup(const char *string)
void pg_noreturn void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2
void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3
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_simple_type(enum ECPGttype type, const 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)
void ECPGfree_struct_member(struct ECPGstruct_member *rm)
void ECPGfree_type(struct ECPGtype *type)
struct ECPGtype * ECPGmake_array_type(struct ECPGtype *type, const char *size)
struct ECPGtype * ECPGmake_struct_type(struct ECPGstruct_member *rm, enum ECPGttype type, const char *type_name, const char *struct_sizeof)