]> granicus.if.org Git - postgresql/blobdiff - src/interfaces/ecpg/preproc/type.h
pgindent run for 8.3.
[postgresql] / src / interfaces / ecpg / preproc / type.h
index 7ce1e89287055fdac919d468adea60dac3a54f41..94c1e56f532c023eaf97cd8bdcca77797a84c145 100644 (file)
@@ -1,35 +1,39 @@
-#include <ecpgtype.h>
+#ifndef _ECPG_PREPROC_TYPE_H
+#define _ECPG_PREPROC_TYPE_H
+
+#include "ecpgtype.h"
 
 struct ECPGtype;
 struct ECPGstruct_member
 {
        char       *name;
-       struct ECPGtype *typ;
+       struct ECPGtype *type;
        struct ECPGstruct_member *next;
 };
 
 struct ECPGtype
 {
-       enum ECPGttype typ;
-       long            size;                   /* For array it is the number of elements.
-                                                                * For varchar it is the maxsize of the
-                                                                * area. */
+       enum ECPGttype type;
+       char       *size;                       /* For array it is the number of elements. For
+                                                                * varchar it is the maxsize of the area. */
+       char       *struct_sizeof;      /* For a struct this is the sizeof() type as
+                                                                * string */
        union
        {
-               struct ECPGtype *element;               /* For an array this is the type
-                                                                                * of the element */
-
-               struct ECPGstruct_member *members;
-               /* A pointer to a list of members. */
+               struct ECPGtype *element;               /* For an array this is the type of
+                                                                                * the element */
+               struct ECPGstruct_member *members;              /* A pointer to a list of
+                                                                                                * members. */
        }                       u;
+       int                     lineno;
 };
 
 /* Everything is malloced. */
 void           ECPGmake_struct_member(char *, struct ECPGtype *, struct ECPGstruct_member **);
-struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, long);
+struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, char *, int);
 struct ECPGtype *ECPGmake_varchar_type(enum ECPGttype, long);
-struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, long);
-struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype type);
+struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, char *);
+struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype, char *);
 struct ECPGstruct_member *ECPGstruct_member_dup(struct ECPGstruct_member *);
 
 /* Frees a type. */
@@ -46,16 +50,18 @@ void                ECPGfree_type(struct ECPGtype *);
    size is the maxsize in case it is a varchar. Otherwise it is the size of
           the variable (required to do array fetches of structs).
  */
-void           ECPGdump_a_type(FILE *, const char *, struct ECPGtype *, const char *, struct ECPGtype *, const char *, const char *);
+void ECPGdump_a_type(FILE *, const char *, struct ECPGtype *,
+                               const char *, struct ECPGtype *, const char *,
+                               const char *, char *, const char *, const char *);
 
 /* A simple struct to keep a variable and its type. */
 struct ECPGtemp_type
 {
-       struct ECPGtype *typ;
+       struct ECPGtype *type;
        const char *name;
 };
 
-extern const char *ECPGtype_name(enum ECPGttype typ);
+extern const char *ecpg_type_name(enum ECPGttype type);
 
 /* some stuff for whenever statements */
 enum WHEN_TYPE
@@ -78,17 +84,31 @@ struct when
 
 struct index
 {
-       int                     index1;
-       int                     index2;
+       char       *index1;
+       char       *index2;
        char       *str;
 };
 
+struct su_symbol
+{
+       char       *su;
+       char       *symbol;
+};
+
+struct prep
+{
+       char       *name;
+       char       *stmt;
+       char       *type;
+};
+
 struct this_type
 {
        enum ECPGttype type_enum;
        char       *type_str;
-       int                     type_dimension;
-       int                     type_index;
+       char       *type_dimension;
+       char       *type_index;
+       char       *type_sizeof;
 };
 
 struct _include_path
@@ -102,6 +122,7 @@ struct cursor
        char       *name;
        char       *command;
        char       *connection;
+       bool            opened;
        struct arguments *argsinsert;
        struct arguments *argsresult;
        struct cursor *next;
@@ -112,6 +133,7 @@ struct typedefs
        char       *name;
        struct this_type *type;
        struct ECPGstruct_member *struct_member_list;
+       int                     brace_level;
        struct typedefs *next;
 };
 
@@ -120,6 +142,7 @@ struct _defines
        char       *old;
        char       *new;
        int                     pertinent;
+       void       *used;
        struct _defines *next;
 };
 
@@ -155,7 +178,7 @@ struct assignment
 
 enum errortype
 {
-       ET_WARN, ET_ERROR, ET_FATAL
+       ET_WARNING, ET_ERROR, ET_FATAL
 };
 
 struct fetch_desc
@@ -163,3 +186,11 @@ struct fetch_desc
        char       *str;
        char       *name;
 };
+
+typedef struct ScanKeyword
+{
+       char       *name;
+       int                     value;
+} ScanKeyword;
+
+#endif   /* _ECPG_PREPROC_TYPE_H */