head 1.6; access; symbols release_4_2:1.6 aix_ok:1.5 Version_2_1:1.4 Version_2:1.3 C_Demo_1:1.3; locks; strict; comment @ * @; 1.6 date 94.02.07.11.46.43; author aoki; state Exp; branches; next 1.5; 1.5 date 91.11.12.20.24.42; author mer; state Exp; branches; next 1.4; 1.4 date 90.08.17.08.54.05; author cimarron; state Exp; branches; next 1.3; 1.3 date 89.09.05.17.10.57; author mao; state Version_2; branches; next 1.2; 1.2 date 89.02.02.18.01.48; author aoki; state Stab; branches; next 1.1; 1.1 date 89.01.17.05.54.43; author cimarron; state Exp; branches; next ; desc @@ 1.6 log @proto fixes @ text @#ifndef _PSORT_H_ #define _PSORT_H_ "$Header: /import/faerie/faerie/aoki/postgres/src/backend/utils/RCS/psort.h,v 1.5 1991/11/12 20:24:42 mer Exp aoki $" #define SORTMEM (1 << 18) /* 1/4 M - any static memory */ #define MAXTAPES 7 /* 7--See Fig. 70, p273 */ #define TAPEEXT "pg_psort.XXXXXX" /* TEMPDIR/TAPEEXT */ #define FREE(x) free((char *) x) struct tape { int tp_dummy; /* (D) */ int tp_fib; /* (A) */ FILE *tp_file; /* (TAPE) */ struct tape *tp_prev; }; struct cmplist { int cp_attn; /* attribute number */ int cp_num; /* comparison function code */ int cp_rev; /* invert comparison flag */ struct cmplist *cp_next; /* next in chain */ }; extern struct cmplist *CmpList; extern int SortMemory; /* free memory */ #ifdef EBUG #include #include "utils/log.h" #include "storage/buf.h" #include "storage/bufmgr.h" #define PDEBUG(PROC, S1)\ elog(DEBUG, "%s:%d>> PROC: %s.", __FILE__, __LINE__, S1) #define PDEBUG2(PROC, S1, D1)\ elog(DEBUG, "%s:%d>> PROC: %s %d.", __FILE__, __LINE__, S1, D1) #define PDEBUG4(PROC, S1, D1, S2, D2)\ elog(DEBUG, "%s:%d>> PROC: %s %d, %s %d.", __FILE__, __LINE__, S1, D1, S2, D2) #define VDEBUG(VAR, FMT)\ elog(DEBUG, "%s:%d>> VAR =FMT", __FILE__, __LINE__, VAR) #define ASSERT(EXPR, STR)\ if (!(EXPR)) elog(FATAL, "%s:%d>> %s", __FILE__, __LINE__, STR) #define TRACE(VAL, CODE)\ if (1) CODE; else #else #define PDEBUG(MSG) #define VDEBUG(VAR, FMT) #define ASSERT(EXPR, MSG) #define TRACE(VAL, CODE) #endif /* psort.c */ extern bool psort ARGS((Relation oldrel, Relation newrel, int nkeys, struct skey key[])); extern int initpsort ARGS((void)); extern int resetpsort ARGS((void)); extern int initialrun ARGS((Relation rdesc)); extern bool createrun ARGS((HeapScanDesc sdesc, FILE *file)); extern HeapTuple tuplecopy ARGS((HeapTuple tup, Relation rdesc, Buffer b)); extern FILE *mergeruns ARGS((void)); extern int merge ARGS((struct tape *dest)); extern int endpsort ARGS((Relation rdesc, FILE *file)); extern FILE *gettape ARGS((void)); extern int resettape ARGS((FILE *file)); extern int destroytape ARGS((FILE *file)); #endif @ 1.5 log @prototyping changes @ text @d2 1 a2 1 #define _PSORT_H_ "$Header: /users/mer/postgres/src/lib/H/utils/RCS/psort.h,v 1.4 1990/08/17 08:54:05 cimarron Exp mer $" d9 7 d58 12 a69 11 bool psort ARGS(( Relation oldrel, Relation newrel, int nkeys, struct skey key [] )); int initpsort ARGS((void )); int resetpsort ARGS((void )); HeapTuple tuplecopy ARGS((HeapTuple tup , Relation rdesc , Buffer b )); int merge ARGS((struct tape *dest )); int endpsort ARGS((Relation rdesc , FILE *file )); @ 1.4 log @added pathnames to #include statements @ text @d2 1 a2 1 #define _PSORT_H_ "$Header: RCS/psort.h,v 1.3 89/09/05 17:10:57 mao Version_2 Locker: cimarron $" d49 13 @ 1.3 log @Working version of C-only demo @ text @d2 1 a2 1 #define _PSORT_H_ "$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/psort.h,v 1.2 89/02/02 18:01:48 aoki Stab $" a19 1 #include d21 3 a23 2 #include #include @ 1.2 log @MERGE WITH OLD TREE @ text @d2 1 a2 1 #define _PSORT_H_ "$Header: psort.h,v 2.1 88/02/11 22:37:45 aoki Locked $" @ 1.1 log @Initial revision @ text @a0 27 ; /* ; * ; * POSTGRES Data Base Management System ; * ; * Copyright (c) 1988 Regents of the University of California ; * ; * Permission to use, copy, modify, and distribute this software and its ; * documentation for educational, research, and non-profit purposes and ; * without fee is hereby granted, provided that the above copyright ; * notice appear in all copies and that both that copyright notice and ; * this permission notice appear in supporting documentation, and that ; * the name of the University of California not be used in advertising ; * or publicity pertaining to distribution of the software without ; * specific, written prior permission. Permission to incorporate this ; * software into commercial products can be obtained from the Campus ; * Software Office, 295 Evans Hall, University of California, Berkeley, ; * Ca., 94720 provided only that the the requestor give the University ; * of California a free licence to any derived software for educational ; * and research purposes. The University of California makes no ; * representations about the suitability of this software for any ; * purpose. It is provided "as is" without express or implied warranty. ; * ; */ d2 1 a2 1 #define _PSORT_H_ "$Header: psort.h,v 1.1 88/11/11 16:42:21 postgres Exp $" @