1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Clean up th ecompile process by centralizing the include files

- code compile tested, but due to a yet unresolved problem with
          parse.h's creation, compile not completed...
This commit is contained in:
Marc G. Fournier
1996-08-28 07:27:54 +00:00
parent 907c884fe8
commit 870be9fa8e
195 changed files with 97 additions and 13583 deletions

View File

@ -1,62 +0,0 @@
/*-------------------------------------------------------------------------
*
* catalog_utils.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: catalog_utils.h,v 1.2 1996/07/29 20:49:02 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef CATALOG_UTILS_H
#define CATALOG_UTILS_H
#include "postgres.h"
#include "access/htup.h"
#include "utils/rel.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "utils/syscache.h"
typedef HeapTuple Type;
typedef HeapTuple Operator;
extern bool check_typeid(long id);
extern Type get_id_type(long id);
extern char *get_id_typname(long id);
extern Type type(char *);
extern Oid att_typeid(Relation rd, int attid);
extern int att_attnelems(Relation rd, int attid);
extern Oid typeid(Type tp);
extern int16 tlen(Type t);
extern bool tbyval(Type t);
extern char *tname(Type t);
extern int tbyvalue(Type t);
extern Oid oprid(Operator op);
extern Operator oper(char *op, int arg1, int arg2);
extern Operator right_oper(char *op, int arg);
extern Operator left_oper(char *op, int arg);
extern int varattno(Relation rd, char *a);
extern bool varisset(Relation rd, char *name);
extern int nf_varattno(Relation rd, char *a);
extern char *getAttrName(Relation rd, int attrno);
extern char *outstr(char *typename, char *value);
extern char *instr2(Type tp, char *string, int typlen);
extern char *instr1(TypeTupleForm tp, char *string, int typlen);
extern Oid GetArrayElementType(Oid typearray);
extern Oid funcid_get_rettype(Oid funcid);
extern bool func_get_detail(char *funcname, int nargs, Oid *oid_array,
Oid *funcid, Oid *rettype, bool *retset, Oid **true_typeids);
extern Oid typeid_get_retinfunc(int type_id);
extern Oid typeid_get_relid(int type_id);
extern Oid get_typrelid(Type typ);
extern Oid get_typelem(Oid type_id);
extern char FindDelimiter(char *typename);
extern void op_error(char *op, int arg1, int arg2);
extern void func_error(char *caller, char *funcname, int nargs, int *argtypes);
#endif /* CATALOG_UTILS_H */

View File

@ -1,28 +0,0 @@
/*-------------------------------------------------------------------------
*
* dbcommands.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: dbcommands.h,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef DBCOMMANDS_H
#define DBCOMMANDS_H
/*
* Originally from tmp/daemon.h. The functions declared in daemon.h does not
* exist; hence removed. -- AY 7/29/94
*/
#define SIGKILLDAEMON1 SIGINT
#define SIGKILLDAEMON2 SIGTERM
extern void createdb(char *dbname);
extern void destroydb(char *dbname);
void stop_vacuum(char *dbname);
#endif /* DBCOMMANDS_H */

View File

@ -1,25 +0,0 @@
/*-------------------------------------------------------------------------
*
* keywords.h--
* string,atom lookup thingy, reduces strcmp traffic greatly
* in the bowels of the system. Look for actual defs in lib/C/atoms.c
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: keywords.h,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef KEYWORDS_H
#define KEYWORDS_H
typedef struct ScanKeyword {
char *name;
int value;
} ScanKeyword;
extern ScanKeyword *ScanKeywordLookup(char *text);
extern char* AtomValueGetString(int atomval);
#endif /* KEYWORDS_H */

View File

@ -1,72 +0,0 @@
/*-------------------------------------------------------------------------
*
* parse_query.h--
* prototypes for parse_query.c.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_query.h,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PARSE_QUERY_H
#define PARSE_QUERY_H
#include "nodes/pg_list.h"
#include "nodes/parsenodes.h"
#include "parser/catalog_utils.h"
#include "parser/parse_state.h"
typedef struct QueryTreeList {
int len; /* number of queries */
Query** qtrees;
} QueryTreeList;
extern int RangeTablePosn(List *rtable, char *rangevar);
extern char *VarnoGetRelname(ParseState *pstate, int vnum);
extern RangeTblEntry *makeRangeTableEntry(char *relname, bool inh,
TimeRange *timeRange, char *refname);
extern List *expandAll(ParseState *pstate, char *relname, int *this_resno);
extern TimeQual makeTimeRange(char *datestring1, char *datestring2,
int timecode);
extern Expr *make_op(char *opname, Node *ltree, Node *rtree);
extern int find_atttype(Oid relid, char *attrname);
extern Var *make_var(ParseState *pstate,
char *relname, char *attrname, int *type_id);
extern ArrayRef *make_array_ref(Node *array, List *indirection);
extern ArrayRef *make_array_set(Expr *target_expr, List *upperIndexpr,
List *lowerIndexpr, Expr *expr);
extern Const *make_const(Value *value);
extern void param_type_init(Oid* typev, int nargs);
extern Oid param_type(int t);
/* parser.c (was ylib.c) */
extern QueryTreeList *parser(char *str, Oid *typev, int nargs);
extern Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
extern Node *parser_typecast2(Node *expr, int exprType, Type tp, int typlen);
extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
/*
* analyze.c
*/
#if 0
extern List *p_rtable;
extern int NumLevels;
#endif
Oid exprType(Node *expr);
ParseState* makeParseState();
QueryTreeList *parse_analyze(List *querytree_list);
/* define in parse_query.c, used in gram.y */
extern Oid *param_type_info;
extern int pfunc_num_args;
/* useful macros */
#define ISCOMPLEX(type) (typeid_get_relid((Oid)type) ? true : false)
#endif /* PARSE_QUERY_H */

View File

@ -1,27 +0,0 @@
/*-------------------------------------------------------------------------
*
* parse_state.h--
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_state.h,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PARSE_STATE_H
#define PARSE_STATE_H
/* state information used during parse analysis */
typedef struct ParseState {
int p_last_resno;
List *p_target_resnos;
Relation parser_current_rel;
List *p_rtable;
int p_query_is_rule;
int p_numAgg;
List *p_aggs;
} ParseState;
#endif /*PARSE_QUERY_H*/

View File

@ -1,80 +0,0 @@
/*-------------------------------------------------------------------------
*
* parsetree.h--
* Routines to access various components and subcomponents of
* parse trees.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parsetree.h,v 1.1.1.1 1996/07/09 06:21:41 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PARSETREE_H
#define PARSETREE_H /* include once only */
/* ----------------
* need pg_list.h for definitions of CAR(), etc. macros
* ----------------
*/
#include "nodes/pg_list.h"
#include "nodes/parsenodes.h"
/* ----------------
* range table macros
*
* parse tree:
* (root targetlist qual)
* ^^^^
* parse root:
* (numlevels cmdtype resrel rangetable priority ruleinfo nestdotinfo)
* ^^^^^^^^^^
* range table:
* (rtentry ...)
*
* rtentry:
* note: this might be wrong, I don't understand how
* rt_time / rt_archive_time work together. anyways it
* looks something like:
*
* (relname ? relid timestuff flags rulelocks)
* or (new/cur relname relid timestuff flags rulelocks)
*
* someone who knows more should correct this -cim 6/9/91
* ----------------
*/
#define rt_relname(rt_entry) \
((!strcmp(((rt_entry)->refname),"*CURRENT*") ||\
!strcmp(((rt_entry)->refname),"*NEW*")) ? ((rt_entry)->refname) : \
((char *)(rt_entry)->relname))
/*
* rt_fetch
* rt_store
*
* Access and (destructively) replace rangetable entries.
*
*/
#define rt_fetch(rangetable_index, rangetable) \
((RangeTblEntry*)nth((rangetable_index)-1, rangetable))
#define rt_store(rangetable_index, rangetable, rt) \
set_nth(rangetable, (rangetable_index)-1, rt)
/*
* getrelid
* getrelname
*
* Given the range index of a relation, return the corresponding
* relation id or relation name.
*/
#define getrelid(rangeindex,rangetable) \
((RangeTblEntry*)nth((rangeindex)-1, rangetable))->relid
#define getrelname(rangeindex, rangetable) \
rt_relname((RangeTblEntry*)nth((rangeindex)-1, rangetable))
#endif /* PARSETREE_H */

View File

@ -1,17 +0,0 @@
/*-------------------------------------------------------------------------
*
* scansup.h--
* scanner support routines. used by both the bootstrap lexer
* as well as the normal lexer
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: scansup.h,v 1.1.1.1 1996/07/09 06:21:41 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
extern char* scanstr(char *s);

View File

@ -1,10 +0,0 @@
/*-------------------------------------------------------------------------
*
* sysfunc.h--
* support for system functions
*
* -------------------------------------------------------------------------
*/
extern char *SystemFunctionHandler(char *funct);