#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.8 1996/07/20 08:34:08 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.9 1996/07/22 21:54:49 scrappy Exp $
#
# NOTES
# This is seen by any Makefiles that include mk/postgres.mk. To
LEX = flex
LDADD+= -L/usr/local/lib -lfl
-# Uncomment the following to bring in changes by OpenLink
-# See README.OPENLINK for applied patches
-# CFLAGS+= -DOPENLINK_PATCHES
-
# POSTGRESLOGIN is the login name of the user who gets special
# privileges within the database. By default it is "postgres", but
# you can change it to any existing login name (such as your own
# enable patches to array update code
CFLAGS += -DARRAY_PATCH
-
+# enable patches to null insert/update code
+CFLAGS += -DNULL_PATCH
+# enable patches to array escape conversion code
+CFLAGS += -DESCAPE_PATCH
+# enable patches for varchar and fsync
+CFLAGS += -DOPENLINK_PATCHES
+
##############################################################################
#
# Miscellaneous configuration
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
#
# NOTES
# Passes any -D options on to cpp prior to generating the list
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
+ * $Id: Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
*
* NOTES
* ******************************
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.2 1996/07/16 07:13:25 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh,v 1.3 1996/07/22 21:55:40 scrappy Exp $
*
* NOTES
*
#ifdef WIN32
#include <limits.h>
#else
-# if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
+# if defined(PORTNAME_BSD44_derived) || \
+ defined(PORTNAME_bsdi) || \
+ defined(PORTNAME_bsdi_2_1)
# include <machine/limits.h>
# define MAXINT INT_MAX
# else
# include <values.h> /* for MAXINT */
-# endif /* PORTNAME_BSD44_derived || PORTNAME_bsdi || PORTNAME_bsdi_2_1 */
+# endif /* bsd descendents */
#endif /* WIN32 */
#include "utils/fmgrtab.h"
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.2 1996/07/20 07:58:44 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.3 1996/07/22 21:56:00 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
bool done = false;
while (!done) {
switch (*q) {
+#ifdef ESCAPE_PATCH
+ case '\\':
+ /* skip escaped characters (\ and ") inside strings */
+ if (scanning_string && *(q+1)) {
+ q++;
+ }
+ break;
+#endif
case '\"':
scanning_string = ! scanning_string;
break;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/geo-ops.c,v 1.2 1996/07/22 21:56:01 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
int i, j;
LSEG seg1, seg2;
- b1.xh = b1.yh = b2.xh = b2.yh = DBL_MAX;
- b1.xl = b1.yl = b2.xl = b2.yl = -DBL_MAX;
+ b1.xh = b1.yh = b2.xh = b2.yh = (double)DBL_MAX;
+ b1.xl = b1.yl = b2.xl = b2.yl = -(double)DBL_MAX;
for (i = 0; i < p1->npts; ++i) {
b1.xh = Max(p1->p[i].x, b1.xh);
b1.yh = Max(p1->p[i].y, b1.yh);
result = PALLOCTYPE(double);
if (point_vert(pt1, pt2))
- *result = DBL_MAX;
+ *result = (double)DBL_MAX;
else
*result = (pt1->y - pt2->y) / (pt1->x - pt1->x);
return(result);
double point_sl(Point *pt1, Point *pt2)
{
return( point_vert(pt1, pt2)
- ? DBL_MAX
+ ? (double)DBL_MAX
: (pt1->y - pt2->y) / (pt1->x - pt2->x) );
}
*result = 0.0;
return(result);
}
- *result = DBL_MAX;
+ *result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2);
*result = Min(*result, *d);
PFREE(d);
if (lseg_intersect(l1, l2))
return(0.0);
- result = DBL_MAX;
+ result = (double)DBL_MAX;
d = dist_ps(&l1->p[0], l2);
result = Min(result, *d);
PFREE(d);
if (lseg->p[1].x == lseg->p[0].x)
m = 0;
else if (lseg->p[1].y == lseg->p[0].y) /* slope is infinite */
- m = DBL_MAX;
+ m = (double)DBL_MAX;
else m = (-1) * (lseg->p[1].y - lseg->p[0].y) /
(lseg->p[1].x - lseg->p[0].x);
ln = line_construct_pm(pt, m);
*/
long on_ps(Point *pt, LSEG *lseg)
{
- return( point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1])
- == point_dt(&lseg->p[0], &lseg->p[1]) );
+ return( FPeq (point_dt(pt, &lseg->p[0]) + point_dt(pt, &lseg->p[1]),
+ point_dt(&lseg->p[0], &lseg->p[1])) );
}
long on_pb(Point *pt, BOX *box)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.2 1996/07/16 07:13:33 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.3 1996/07/22 21:56:02 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include "catalog/pg_type.h"
#include "utils/builtins.h"
-#if !defined(PORTNAME_linux) && !defined(PORTNAME_BSD44_derived) && \
- !defined(PORTNAME_irix5) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1) && !defined(PORTNAME_aix)
+#if !defined(PORTNAME_aix) && \
+ !defined(PORTNAME_BSD44_derived) && \
+ !defined(PORTNAME_bsdi) && \
+ !defined(PORTNAME_bsdi_2_1) && \
+ !defined(PORTNAME_irix5) && \
+ !defined(PORTNAME_linux)
extern int random();
extern int srandom(unsigned);
#endif
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.2 1996/07/20 08:36:19 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
(void) ftime(&now);
*tzp = now.timezone;
#else /* USE_POSIX_TIME */
-#if defined(PORTNAME_hpux) || \
- defined(PORTNAME_aix) || \
+#if defined(PORTNAME_aix) || \
+ defined(PORTNAME_hpux) || \
+ defined(PORTNAME_i386_solaris) || \
defined(PORTNAME_irix5) || \
- defined(WIN32) || \
- defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris)
+ defined(PORTNAME_sparc_solaris) || \
+ defined(WIN32)
tzset();
#ifndef WIN32
*tzp = timezone / 60; /* this is an X/Open-ism */
#else
*tzp = _timezone / 60; /* this is an X/Open-ism */
#endif /* WIN32 */
-#else /* PORTNAME_hpux || PORTNAME_aix || PORTNAME_sparc_solaris || PORTNAME_irix5 */
+#else /* PORTNAME_aix || PORTNAME_hpux || ... */
time_t now = time((time_t *) NULL);
struct tm *tmnow = localtime(&now);
*tzp = - tmnow->tm_gmtoff / 60; /* tm_gmtoff is Sun/DEC-ism */
-#endif /* PORTNAME_hpux || PORTNAME_aix */
+#endif /* PORTNAME_aix || PORTNAME_hpux || ... */
#endif /* USE_POSIX_TIME */
tm->tm_mday = tm->tm_mon = tm->tm_year = -1; /* mandatory */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.2 1996/07/16 07:13:35 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.3 1996/07/22 21:56:03 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
int
ftoa(double value, char *ascii, int width, int prec1, char format)
{
-#if defined(PORTNAME_BSD44_derived) || defined(PORTNAME_bsdi) || defined(PORTNAME_bsdi_2_1)
+#if defined(PORTNAME_BSD44_derived) || \
+ defined(PORTNAME_bsdi) || \
+ defined(PORTNAME_bsdi_2_1)
char out[256];
char fmt[256];
int ret;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.3 1996/07/19 07:14:14 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.4 1996/07/22 21:56:04 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
* takes two text* and returns a text* that is the concatentation of
* the two
*/
+
+/*
+ * Rewrited by Sapa, sapa@hq.icb.chel.su. 8-Jul-96.
+ */
+
text*
textcat(text* t1, text* t2)
{
int len1, len2, newlen;
+ char *ptr;
text* result;
+ /* Check for NULL strings... */
if (t1 == NULL) return t2;
if (t2 == NULL) return t1;
- len1 = textlen (t1);
- len2 = textlen (t2);
- newlen = len1 + len2 + VARHDRSZ;
- result = (text*) palloc (newlen);
+ /* Check for ZERO-LENGTH strings... */
+ /* I use <= instead of == , I know - it's paranoia, but... */
+ if((len1 = VARSIZE(t1) - VARHDRSZ) <= 0) return t2;
+ if((len2 = VARSIZE(t2) - VARHDRSZ) <= 0) return t1;
+
+ result = (text *)palloc(newlen = len1 + len2 + VARHDRSZ);
+
+ /* Fill data field of result string... */
+ memcpy(ptr = VARDATA(result), VARDATA(t1), len1);
+ memcpy(ptr + len1, VARDATA(t2), len2);
+ /* Set size of result string... */
VARSIZE(result) = newlen;
- memcpy (VARDATA(result), VARDATA(t1), len1);
- memcpy (VARDATA(result) + len1, VARDATA(t2), len2);
return result;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.4 1996/07/22 21:58:26 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
char buf[ELOG_MAXLEN], line[ELOG_MAXLEN];
register char *bp, *cp;
extern int errno, sys_nerr;
-#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
+#if !defined(PORTNAME_BSD44_derived) && \
+ !defined(PORTNAME_bsdi) && \
+ !defined(PORTNAME_bsdi_2_1)
extern char *sys_errlist[];
-#endif /* !PORTNAME_BSD44_derived */
+#endif /* bsd derived */
#ifndef PG_STANDALONE
extern FILE *Pfout;
#endif /* !PG_STANDALONE */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.2 1996/07/16 07:13:49 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.3 1996/07/22 21:58:28 scrappy Exp $
*
* NOTE
* XXX this code needs improvement--check for state violations and
{
extern int errno;
extern int sys_nerr;
-#if !defined(PORTNAME_BSD44_derived) && !defined(PORTNAME_bsdi) && !defined(PORTNAME_bsdi_2_1)
+#if !defined(PORTNAME_BSD44_derived) && \
+ !defined(PORTNAME_bsdi) && \
+ !defined(PORTNAME_bsdi_2_1)
extern char *sys_errlist[];
-#endif /* !PORTNAME_BSD44_derived */
+#endif /* ! bsd_derived */
#ifdef lint
data = data;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: exc.h,v 1.1.1.1 1996/07/09 06:22:01 scrappy Exp $
+ * $Id: exc.h,v 1.2 1996/07/22 21:55:41 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
* ExcMessage and Exception are now defined in c.h
*/
-#if defined(PORTNAME_linux) \
-|| defined(PORTNAME_hpux) \
-|| defined(PORTNAME_next)\
-|| defined(WIN32)
+#if defined(PORTNAME_hpux) || \
+ defined(PORTNAME_linux) || \
+ defined(PORTNAME_next) || \
+ defined(WIN32)
typedef jmp_buf ExcContext;
#else
typedef sigjmp_buf ExcContext;