pr_glob.h
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:7k
- /*
- * pr_glob.h - file with some constants, data types definitions
- * and functions prototypes used by all components
- * of GNU SQL compiler
- *
- * This file is a part of GNU SQL Server
- *
- * Copyright (c) 1996, 1997, Free Software Foundation, Inc
- * Developed at the Institute of System Programming
- * This file is written by Konstantin Dyshlevoj
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contacts: gss@ispras.ru
- *
- */
- /* $Id: pr_glob.h,v 1.246 1997/04/24 17:41:43 kml Exp $ */
- #ifndef __PR_GLOB_H__
- #define __PR_GLOB_H__
- #include "setup_os.h"
- #if TIME_WITH_SYS_TIME
- # include <sys/time.h>
- # include <time.h>
- #else
- # if HAVE_SYS_TIME_H
- # include <sys/time.h>
- # else
- # include <time.h>
- # endif
- #endif
- #include "sql.h"
- #include "type.h"
- #include "typecpi.h"
- #include "typepi.h"
- #ifdef __INTERPR__
- #include "typepi.h"
- #include "typeif.h"
- #endif
- #define TY_EST long
- typedef i4_t TYPE_VARI;
- typedef char TYPE_VW;
- extern i4_t PRCD_DEBUG;
- typedef struct {
- void *SHPls;
- i2_t TbNum;
- i4_t Cnt;
- i4_t *Trees;
- } SetPls;
- #define UNKNOWN_VALUE 0
- #define REGULAR_VALUE 1
- #define NULL_VALUE 2
- #define NOT_CONVERTED 3
- /* determination of code of value *
- * (UNKNOWN_VALUE, REGULAR_VALUE or NULL_VALUE) : */
- #define TRN_FINISH exit(0)
- #define IE (1L<<4) /* there is some index */
- #define IC (1L<<5) /* clustered index */
- #define IU (1L<<6) /* unique index */
- #define IJ (1L<<7) /* composite index */
- #define GET_MEMC(name,n) (name *)xmalloc(sizeof(name)*n);
- #define SIZES(x) sizeof(struct x)
- #define CH_ASC 'A'
- #define CH_DES 'D'
- #define FN_COUNT 1
- #define FN_AVG 2
- #define FN_MAX 3
- #define FN_MIN 4
- #define FN_SUMM 5
- #define FN_DT_COUNT 6
- #define FN_DT_AVG 7
- #define FN_DT_SUMM 10
- #define BitOR(x,y) ((x)|(y))
- #define BitAND(x,y) ((x)&(y))
- #define BitNOT(x) (~(x))
- #define SZ_SU sizeof(StackUnit)
- #define SZ_DU sizeof(DataUnit)
- #define MK_UN_OPER(op, arg)
- {
- DtPush; DtCurEl = (arg);
- error = oper (op, 1);
- DtPop;
- if (error < 0)
- return error;
- }
- #define MK_BIN_OPER(op, arg1, arg2)
- {
- DtPush; DtCurEl = (arg1);
- DtPush; DtCurEl = (arg2);
- error = oper (op, 2);
- DtPop;
- if (error < 0)
- return error;
- }
- #define COMP_RESULT LngNext
- #define OPER_RESULT DtNextEl
- /* curdate - put current date to string *
- * (8 simbols &