Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
53d8be3b
Commit
53d8be3b
authored
Mar 14, 1997
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Date/Time updates from Thomas...
parent
71fd8d4a
Changes
18
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
3375 additions
and
943 deletions
+3375
-943
src/backend/access/rtree/rtproc.c
src/backend/access/rtree/rtproc.c
+2
-2
src/backend/access/rtree/rtree.c
src/backend/access/rtree/rtree.c
+2
-2
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+10
-3
src/backend/bootstrap/bootstrap.c
src/backend/bootstrap/bootstrap.c
+2
-2
src/backend/utils/adt/Makefile
src/backend/utils/adt/Makefile
+4
-3
src/backend/utils/adt/bool.c
src/backend/utils/adt/bool.c
+5
-5
src/backend/utils/adt/char.c
src/backend/utils/adt/char.c
+58
-58
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+61
-82
src/backend/utils/adt/datetime.c
src/backend/utils/adt/datetime.c
+743
-0
src/backend/utils/adt/dt.c
src/backend/utils/adt/dt.c
+2161
-24
src/backend/utils/adt/geo_ops.c
src/backend/utils/adt/geo_ops.c
+2
-2
src/backend/utils/adt/geo_selfuncs.c
src/backend/utils/adt/geo_selfuncs.c
+2
-2
src/backend/utils/adt/int.c
src/backend/utils/adt/int.c
+26
-26
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/nabstime.c
+221
-656
src/backend/utils/adt/name.c
src/backend/utils/adt/name.c
+18
-18
src/backend/utils/adt/oid.c
src/backend/utils/adt/oid.c
+5
-5
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+33
-33
src/backend/utils/adt/varlena.c
src/backend/utils/adt/varlena.c
+20
-20
No files found.
src/backend/access/rtree/rtproc.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.
5 1996/11/10 02:58:53 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.
6 1997/03/14 23:17:41 scrappy
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include <postgres.h>
#include <postgres.h>
#include <utils/builtins.h>
#include <utils/builtins.h>
#include <utils/geo
-
decls.h>
#include <utils/geo
_
decls.h>
#ifndef HAVE_MEMMOVE
#ifndef HAVE_MEMMOVE
# include <regex/utils.h>
# include <regex/utils.h>
#else
#else
...
...
src/backend/access/rtree/rtree.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.1
1 1997/01/10 09:47:28 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.1
2 1997/03/14 23:17:46 scrappy
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include <storage/lmgr.h>
#include <storage/lmgr.h>
#include <access/rtree.h>
#include <access/rtree.h>
#include <storage/bufmgr.h>
#include <storage/bufmgr.h>
#include <utils/geo
-
decls.h>
#include <utils/geo
_
decls.h>
#include <executor/executor.h>
#include <executor/executor.h>
#include <access/heapam.h>
#include <access/heapam.h>
#include <fmgr.h>
#include <fmgr.h>
...
...
src/backend/access/transam/xact.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.
7 1997/03/12 20:41:14
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.
8 1997/03/14 23:18:16
scrappy Exp $
*
*
* NOTES
* NOTES
* Transaction aborts can now occur two ways:
* Transaction aborts can now occur two ways:
...
@@ -171,7 +171,14 @@ TransactionState CurrentTransactionState =
...
@@ -171,7 +171,14 @@ TransactionState CurrentTransactionState =
&
CurrentTransactionStateData
;
&
CurrentTransactionStateData
;
/* ----------------
/* ----------------
* info returned when the system is desabled
* info returned when the system is disabled
*
* Apparently a lot of this code is inherited from other prototype systems.
* For DisabledStartTime, use a symbolic value to make the relationships clearer.
* The old value of 1073741823 corresponds to a date in y2004, which is coming closer
* every day. It appears that if we return a value guaranteed larger than
* any real time associated with a transaction then comparisons in other
* modules will still be correct. Let's use BIG_ABSTIME for this. tgl 2/14/97
*
*
* Note: I have no idea what the significance of the
* Note: I have no idea what the significance of the
* 1073741823 in DisabledStartTime.. I just carried
* 1073741823 in DisabledStartTime.. I just carried
...
@@ -183,7 +190,7 @@ TransactionId DisabledTransactionId = (TransactionId)-1;
...
@@ -183,7 +190,7 @@ TransactionId DisabledTransactionId = (TransactionId)-1;
CommandId
DisabledCommandId
=
(
CommandId
)
-
1
;
CommandId
DisabledCommandId
=
(
CommandId
)
-
1
;
AbsoluteTime
DisabledStartTime
=
(
AbsoluteTime
)
1073741823
;
AbsoluteTime
DisabledStartTime
=
(
AbsoluteTime
)
BIG_ABSTIME
;
/* 1073741823; */
/* ----------------
/* ----------------
* overflow flag
* overflow flag
...
...
src/backend/bootstrap/bootstrap.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.1
6 1997/03/12 20:57:33
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.1
7 1997/03/14 23:18:32
scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
#include "catalog/catname.h"
#include "catalog/catname.h"
#include "utils/geo
-
decls.h"
#include "utils/geo
_
decls.h"
#include "utils/builtins.h"
#include "utils/builtins.h"
#include "catalog/index.h"
#include "catalog/index.h"
...
...
src/backend/utils/adt/Makefile
View file @
53d8be3b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
# Makefile for utils/adt
# Makefile for utils/adt
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.
6 1997/03/12 21:27:03
scrappy Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.
7 1997/03/14 23:19:50
scrappy Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -20,8 +20,9 @@ CFLAGS+=$(INCLUDE_OPT)
...
@@ -20,8 +20,9 @@ CFLAGS+=$(INCLUDE_OPT)
OBJS
=
acl.o arrayfuncs.o arrayutils.o bool.o char.o chunk.o date.o
\
OBJS
=
acl.o arrayfuncs.o arrayutils.o bool.o char.o chunk.o date.o
\
datum.o dt.o filename.o float.o geo_ops.o geo_selfuncs.o int.o
\
datum.o dt.o filename.o float.o geo_ops.o geo_selfuncs.o int.o
\
misc.o nabstime.o name.o not_in.o numutils.o oid.o
\
misc.o nabstime.o name.o not_in.o numutils.o oid.o
\
oidname.o oidint2.o oidint4.o oracle_compat.o regexp.o regproc.o selfuncs.o
\
oidname.o oidint2.o oidint4.o oracle_compat.o regexp.o regproc.o
\
tid.o varchar.o varlena.o sets.o datetimes.o like.o timestamp.o
selfuncs.o
\
tid.o varchar.o varlena.o sets.o datetime.o like.o timestamp.o
all
:
SUBSYS.o
all
:
SUBSYS.o
...
...
src/backend/utils/adt/bool.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.
2 1996/11/03 06:53:03
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.
3 1997/03/14 23:19:52
scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -24,12 +24,12 @@
...
@@ -24,12 +24,12 @@
/*
/*
* boolin - converts "t" or "f" to 1 or 0
* boolin - converts "t" or "f" to 1 or 0
*/
*/
int32
bool
boolin
(
char
*
b
)
boolin
(
char
*
b
)
{
{
if
(
b
==
NULL
)
if
(
b
==
NULL
)
elog
(
WARN
,
"Bad input string for type bool"
);
elog
(
WARN
,
"Bad input string for type bool"
);
return
((
int32
)
(
*
b
==
't'
)
||
(
*
b
==
'T'
));
return
((
bool
)
(
*
b
==
't'
)
||
(
*
b
==
'T'
));
}
}
/*
/*
...
@@ -49,13 +49,13 @@ boolout(long b)
...
@@ -49,13 +49,13 @@ boolout(long b)
* PUBLIC ROUTINES *
* PUBLIC ROUTINES *
*****************************************************************************/
*****************************************************************************/
int32
bool
booleq
(
int8
arg1
,
int8
arg2
)
booleq
(
int8
arg1
,
int8
arg2
)
{
{
return
(
arg1
==
arg2
);
return
(
arg1
==
arg2
);
}
}
int32
bool
boolne
(
int8
arg1
,
int8
arg2
)
boolne
(
int8
arg1
,
int8
arg2
)
{
{
return
(
arg1
!=
arg2
);
return
(
arg1
!=
arg2
);
...
...
src/backend/utils/adt/char.c
View file @
53d8be3b
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.
2 1996/09/10 06:41:3
4 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.
3 1997/03/14 23:19:5
4 scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -127,25 +127,25 @@ char *char16out(char *s)
...
@@ -127,25 +127,25 @@ char *char16out(char *s)
* PUBLIC ROUTINES *
* PUBLIC ROUTINES *
*****************************************************************************/
*****************************************************************************/
int32
chareq
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
chareq
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
==
arg2
);
}
int32
charne
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
!=
arg2
);
}
bool
charne
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
!=
arg2
);
}
#ifdef UNSIGNED_CHAR_TEXT
#ifdef UNSIGNED_CHAR_TEXT
int32
charlt
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
<
(
uint8
)
arg2
);
}
bool
charlt
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
<
(
uint8
)
arg2
);
}
int32
charle
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
<=
(
uint8
)
arg2
);
}
bool
charle
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
<=
(
uint8
)
arg2
);
}
int32
chargt
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
>
(
uint8
)
arg2
);
}
bool
chargt
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
>
(
uint8
)
arg2
);
}
int32
charge
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
>=
(
uint8
)
arg2
);
}
bool
charge
(
int8
arg1
,
int8
arg2
)
{
return
((
uint8
)
arg1
>=
(
uint8
)
arg2
);
}
#else
#else
int32
charlt
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
<
arg2
);
}
bool
charlt
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
<
arg2
);
}
int32
charle
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
<=
arg2
);
}
bool
charle
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
<=
arg2
);
}
int32
chargt
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
>
arg2
);
}
bool
chargt
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
>
arg2
);
}
int32
charge
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
>=
arg2
);
}
bool
charge
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
>=
arg2
);
}
#endif
#endif
int8
charpl
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
+
arg2
);
}
int8
charpl
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
+
arg2
);
}
int8
charmi
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
-
arg2
);
}
int8
charmi
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
-
arg2
);
}
int8
charmul
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
*
arg2
);
}
int8
charmul
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
*
arg2
);
}
int8
chardiv
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
/
arg2
);
}
int8
chardiv
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
/
arg2
);
}
int32
cideq
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
cideq
(
int8
arg1
,
int8
arg2
)
{
return
(
arg1
==
arg2
);
}
/*
/*
* char16eq - returns 1 iff arguments are equal
* char16eq - returns 1 iff arguments are equal
...
@@ -161,48 +161,48 @@ int32 cideq(int8 arg1, int8 arg2) { return(arg1 == arg2); }
...
@@ -161,48 +161,48 @@ int32 cideq(int8 arg1, int8 arg2) { return(arg1 == arg2); }
* char16ge - returns 1 iff a <= b
* char16ge - returns 1 iff a <= b
*
*
*/
*/
int32
char16eq
(
char
*
arg1
,
char
*
arg2
)
bool
char16eq
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
16
)
==
0
);
return
(
strncmp
(
arg1
,
arg2
,
16
)
==
0
);
}
}
int32
char16ne
(
char
*
arg1
,
char
*
arg2
)
bool
char16ne
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
16
)
!=
0
);
return
(
strncmp
(
arg1
,
arg2
,
16
)
!=
0
);
}
}
int32
char16lt
(
char
*
arg1
,
char
*
arg2
)
bool
char16lt
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
,
arg2
,
16
)
<
0
));
return
((
bool
)
(
strncmp
(
arg1
,
arg2
,
16
)
<
0
));
}
}
int32
char16le
(
char
*
arg1
,
char
*
arg2
)
bool
char16le
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
,
arg2
,
16
)
<=
0
));
return
((
bool
)
(
strncmp
(
arg1
,
arg2
,
16
)
<=
0
));
}
}
int32
char16gt
(
char
*
arg1
,
char
*
arg2
)
bool
char16gt
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
,
arg2
,
16
)
>
0
));
return
((
bool
)
(
strncmp
(
arg1
,
arg2
,
16
)
>
0
));
}
}
int32
char16ge
(
char
*
arg1
,
char
*
arg2
)
bool
char16ge
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
,
arg2
,
16
)
>=
0
));
return
((
bool
)
(
strncmp
(
arg1
,
arg2
,
16
)
>=
0
));
}
}
...
@@ -229,32 +229,32 @@ char *char2out(uint16 s)
...
@@ -229,32 +229,32 @@ char *char2out(uint16 s)
return
(
result
);
return
(
result
);
}
}
int32
char2eq
(
uint16
a
,
uint16
b
)
bool
char2eq
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
==
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
==
0
);
}
}
int32
char2ne
(
uint16
a
,
uint16
b
)
bool
char2ne
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
!=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
!=
0
);
}
}
int32
char2lt
(
uint16
a
,
uint16
b
)
bool
char2lt
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
<
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
<
0
);
}
}
int32
char2le
(
uint16
a
,
uint16
b
)
bool
char2le
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
<=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
<=
0
);
}
}
int32
char2gt
(
uint16
a
,
uint16
b
)
bool
char2gt
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
>
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
>
0
);
}
}
int32
char2ge
(
uint16
a
,
uint16
b
)
bool
char2ge
(
uint16
a
,
uint16
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
>=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
2
)
>=
0
);
}
}
...
@@ -289,32 +289,32 @@ char *char4out(s)
...
@@ -289,32 +289,32 @@ char *char4out(s)
return
(
result
);
return
(
result
);
}
}
int32
char4eq
(
uint32
a
,
uint32
b
)
bool
char4eq
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
==
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
==
0
);
}
}
int32
char4ne
(
uint32
a
,
uint32
b
)
bool
char4ne
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
!=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
!=
0
);
}
}
int32
char4lt
(
uint32
a
,
uint32
b
)
bool
char4lt
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
<
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
<
0
);
}
}
int32
char4le
(
uint32
a
,
uint32
b
)
bool
char4le
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
<=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
<=
0
);
}
}
int32
char4gt
(
uint32
a
,
uint32
b
)
bool
char4gt
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
>
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
>
0
);
}
}
int32
char4ge
(
uint32
a
,
uint32
b
)
bool
char4ge
(
uint32
a
,
uint32
b
)
{
{
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
>=
0
);
return
(
strncmp
((
char
*
)
&
a
,
(
char
*
)
&
b
,
4
)
>=
0
);
}
}
...
@@ -351,46 +351,46 @@ char *char8out(char *s)
...
@@ -351,46 +351,46 @@ char *char8out(char *s)
return
(
result
);
return
(
result
);
}
}
int32
char8eq
(
char
*
arg1
,
char
*
arg2
)
bool
char8eq
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
==
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
==
0
);
}
}
int32
char8ne
(
char
*
arg1
,
char
*
arg2
)
bool
char8ne
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
!=
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
!=
0
);
}
}
int32
char8lt
(
char
*
arg1
,
char
*
arg2
)
bool
char8lt
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
<
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
<
0
);
}
}
int32
char8le
(
char
*
arg1
,
char
*
arg2
)
bool
char8le
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
<=
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
<=
0
);
}
}
int32
char8gt
(
char
*
arg1
,
char
*
arg2
)
bool
char8gt
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
>
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
>
0
);
}
}
int32
char8ge
(
char
*
arg1
,
char
*
arg2
)
bool
char8ge
(
char
*
arg1
,
char
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
,
arg2
,
8
)
>=
0
);
return
(
(
bool
)
strncmp
(
arg1
,
arg2
,
8
)
>=
0
);
}
}
int32
char8cmp
(
char
*
arg1
,
char
*
arg2
)
int32
char8cmp
(
char
*
arg1
,
char
*
arg2
)
...
...
src/backend/utils/adt/date.c
View file @
53d8be3b
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
*
*
* date.c--
* date.c--
*
Functions for the built-in type "AbsoluteTime"
.
*
Utilities for the built-in type "AbsoluteTime" (defined in nabstime)
.
* Functions for the built-in type "RelativeTime".
* Functions for the built-in type "RelativeTime".
* Functions for the built-in type "TimeInterval".
* Functions for the built-in type "TimeInterval".
*
*
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.
5 1997/02/14 04:17:35 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.
6 1997/03/14 23:19:57 scrappy
Exp $
*
*
* NOTES
* NOTES
* This code is actually (almost) unused.
* This code is actually (almost) unused.
...
@@ -35,25 +35,11 @@
...
@@ -35,25 +35,11 @@
#include "access/xact.h"
#include "access/xact.h"
#include "utils/builtins.h"
/* where function declarations go */
#include "utils/builtins.h"
/* where function declarations go */
#include "utils/palloc.h"
#include "utils/palloc.h"
#include "utils/dt.h"
#define TM_YEAR_BASE 1900
/* compatible to UNIX time */
#ifndef USE_NEW_TIME_CODE
#define EPOCH_YEAR 1970
/* compatible to UNIX time */
#define USE_NEW_TIME_CODE 1
#define YEAR_MAX 2038
/* otherwise overflow */
#endif
#define YEAR_MIN 1902
/* otherwise overflow */
#define DAYS_PER_LYEAR 366
#define DAYS_PER_NYEAR 365
#define HOURS_PER_DAY 24
#define MINS_PER_HOUR 60
#define SECS_PER_MIN 60
#define MAX_LONG 2147483647
/* 2^31 */
/* absolute time definitions */
#define TIME_NOW_STR "now"
/* represents time now */
#define TIME_EPOCH_STR "epoch"
/* Jan 1 00:00:00 1970 GMT */
#define TIME_EPOCH_STR_LEN (sizeof(TIME_EPOCH_STR)-1)
#define INVALID_ABSTIME_STR "Undefined AbsTime"
#define INVALID_ABSTIME_STR_LEN (sizeof(INVALID_ABSTIME_STR)-1)
#define INVALID_RELTIME_STR "Undefined RelTime"
#define INVALID_RELTIME_STR "Undefined RelTime"
#define INVALID_RELTIME_STR_LEN (sizeof(INVALID_RELTIME_STR)-1)
#define INVALID_RELTIME_STR_LEN (sizeof(INVALID_RELTIME_STR)-1)
...
@@ -66,10 +52,7 @@
...
@@ -66,10 +52,7 @@
* sixty-eight years on either side of that.
* sixty-eight years on either side of that.
*/
*/
#define IsCharDigit(C) isdigit(C)
#define IsCharA_Z(C) isalpha(C)
#define IsSpace(C) ((C) == ' ')
#define IsSpace(C) ((C) == ' ')
#define IsNull(C) ((C) == NULL)
#define T_INTERVAL_INVAL 0
/* data represents no valid interval */
#define T_INTERVAL_INVAL 0
/* data represents no valid interval */
#define T_INTERVAL_VALID 1
/* data represents a valid interval */
#define T_INTERVAL_VALID 1
/* data represents a valid interval */
...
@@ -101,20 +84,13 @@ static int sec_tab[] = {
...
@@ -101,20 +84,13 @@ static int sec_tab[] = {
3600
,
3600
,
86400
,
86400
,
604800
,
604800
,
3600
,
3600
,
86400
,
86400
,
604800
,
604800
,
2592000
,
2592000
,
31536000
,
31536000
};
2592000
,
2592000
,
31536000
,
31536000
};
/* maximal values (in seconds) per unit which can be represented */
static
int
unit_max_quantity
[]
=
{
2144448000
,
2144448000
,
35740800
,
35740800
,
595680
,
595680
,
24820
,
24820
,
3545
,
3545
,
827
,
827
,
68
,
68
};
struct
timeb
*
TimeDifferenceFromGMT
=
NULL
;
/*
/*
* Function prototypes -- internal to this file only
* Function prototypes -- internal to this file only
*/
*/
static
int
correct_unit
(
char
unit
[],
int
*
unptr
);
static
int
correct_unit
(
char
unit
[],
int
*
unptr
);
static
int
correct_dir
(
char
direction
[],
int
*
signptr
);
static
int
correct_dir
(
char
direction
[],
int
*
signptr
);
static
int
istinterval
(
char
*
i_string
,
static
int
istinterval
(
char
*
i_string
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_end
);
AbsoluteTime
*
i_end
);
...
@@ -126,41 +102,45 @@ static int istinterval(char *i_string,
...
@@ -126,41 +102,45 @@ static int istinterval(char *i_string,
/*
/*
* reltimein - converts a reltime string in an internal format
* reltimein - converts a reltime string in an internal format
*/
*/
int32
/* RelativeTime */
RelativeTime
reltimein
(
char
*
timestring
)
reltimein
(
char
*
str
)
{
{
int
error
;
RelativeTime
result
;
int32
/* RelativeTime */
timeinsec
;
int
sign
,
unitnr
;
long
quantity
;
error
=
isreltime
(
timestring
,
&
sign
,
&
quantity
,
&
unitnr
);
struct
tm
tt
,
*
tm
=
&
tt
;
double
fsec
;
int
dtype
;
char
*
field
[
MAXDATEFIELDS
];
int
nf
,
ftype
[
MAXDATEFIELDS
];
char
lowstr
[
MAXDATELEN
+
1
];
#ifdef DATEDEBUG
if
(
!
PointerIsValid
(
str
))
elog
(
DEBUG
,
"reltimein: isreltime(%s) returns error=%d, %d, %d, %d"
,
elog
(
WARN
,
"Bad (null) date external representation"
,
NULL
);
timestring
,
error
,
sign
,
quantity
,
unitnr
);
#endif
/* !DATEDEBUG */
if
(
strlen
(
str
)
>
MAXDATELEN
)
elog
(
WARN
,
"Bad (length) reltime external representation '%s'"
,
str
);
if
((
ParseDateTime
(
str
,
lowstr
,
field
,
ftype
,
MAXDATEFIELDS
,
&
nf
)
!=
0
)
||
(
DecodeDateDelta
(
field
,
ftype
,
nf
,
&
dtype
,
tm
,
&
fsec
)
!=
0
))
elog
(
WARN
,
"Bad reltime external representation '%s'"
,
str
);
if
(
error
!=
1
)
{
timeinsec
=
INVALID_RELTIME
;
/*invalid time representation */
}
else
{
/* this check is necessary, while no control on overflow */
if
(
quantity
>
unit_max_quantity
[
unitnr
]
||
quantity
<
0
)
{
#ifdef DATEDEBUG
elog
(
DEBUG
,
"reltimein: illegal quantity %d (< %d)"
,
quantity
,
unit_max_quantity
[
unitnr
]);
#endif
/* DATEDEBUG */
timeinsec
=
INVALID_RELTIME
;
/* illegal quantity */
}
else
{
timeinsec
=
sign
*
quantity
*
sec_tab
[
unitnr
];
#ifdef DATEDEBUG
#ifdef DATEDEBUG
elog
(
DEBUG
,
"reltimein: computed timeinsec %d"
,
printf
(
"reltimein- %d fields are type %d (DTK_DATE=%d)
\n
"
,
nf
,
dtype
,
DTK_DATE
);
timeinsec
);
#endif
#endif
/* DATEDEBUG */
}
switch
(
dtype
)
{
}
case
DTK_DELTA
:
return
(
timeinsec
);
result
=
((((
tm
->
tm_hour
*
60
)
+
tm
->
tm_min
)
*
60
)
+
tm
->
tm_sec
);
}
result
+=
(((
tm
->
tm_year
*
365
)
+
(
tm
->
tm_mon
*
30
)
+
tm
->
tm_mday
)
*
(
24
*
60
*
60
));
return
(
result
);
default:
return
(
INVALID_RELTIME
);
};
elog
(
WARN
,
"Bad reltime (internal coding error) '%s'"
,
str
);
return
(
INVALID_RELTIME
);
}
/* reltimein() */
/*
/*
...
@@ -379,42 +359,42 @@ AbsoluteTime timenow()
...
@@ -379,42 +359,42 @@ AbsoluteTime timenow()
* reltimele - returns 1, iff t1 less than or equal to t2
* reltimele - returns 1, iff t1 less than or equal to t2
* reltimege - returns 1, iff t1 greater than or equal to t2
* reltimege - returns 1, iff t1 greater than or equal to t2
*/
*/
int32
reltimeeq
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimeeq
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
return
(
t1
==
t2
);
return
(
t1
==
t2
);
}
}
int32
reltimene
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimene
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
return
(
t1
!=
t2
);
return
(
t1
!=
t2
);
}
}
int32
reltimelt
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimelt
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
return
(
t1
<
t2
);
return
(
t1
<
t2
);
}
}
int32
reltimegt
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimegt
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
return
(
t1
>
t2
);
return
(
t1
>
t2
);
}
}
int32
reltimele
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimele
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
return
(
t1
<=
t2
);
return
(
t1
<=
t2
);
}
}
int32
reltimege
(
RelativeTime
t1
,
RelativeTime
t2
)
bool
reltimege
(
RelativeTime
t1
,
RelativeTime
t2
)
{
{
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
if
(
t1
==
INVALID_RELTIME
||
t2
==
INVALID_RELTIME
)
return
0
;
return
0
;
...
@@ -425,7 +405,7 @@ int32 reltimege(RelativeTime t1, RelativeTime t2)
...
@@ -425,7 +405,7 @@ int32 reltimege(RelativeTime t1, RelativeTime t2)
/*
/*
* intervaleq - returns 1, iff interval i1 is equal to interval i2
* intervaleq - returns 1, iff interval i1 is equal to interval i2
*/
*/
int32
intervaleq
(
TimeInterval
i1
,
TimeInterval
i2
)
bool
intervaleq
(
TimeInterval
i1
,
TimeInterval
i2
)
{
{
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
return
(
0
);
/* invalid interval */
return
(
0
);
/* invalid interval */
...
@@ -437,7 +417,7 @@ int32 intervaleq(TimeInterval i1, TimeInterval i2)
...
@@ -437,7 +417,7 @@ int32 intervaleq(TimeInterval i1, TimeInterval i2)
* intervalleneq - returns 1, iff length of interval i is equal to
* intervalleneq - returns 1, iff length of interval i is equal to
* reltime t
* reltime t
*/
*/
int32
intervalleneq
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervalleneq
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -451,7 +431,7 @@ int32 intervalleneq(TimeInterval i, RelativeTime t)
...
@@ -451,7 +431,7 @@ int32 intervalleneq(TimeInterval i, RelativeTime t)
* intervallenne - returns 1, iff length of interval i is not equal
* intervallenne - returns 1, iff length of interval i is not equal
* to reltime t
* to reltime t
*/
*/
int32
intervallenne
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervallenne
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -465,7 +445,7 @@ int32 intervallenne(TimeInterval i, RelativeTime t)
...
@@ -465,7 +445,7 @@ int32 intervallenne(TimeInterval i, RelativeTime t)
* intervallenlt - returns 1, iff length of interval i is less than
* intervallenlt - returns 1, iff length of interval i is less than
* reltime t
* reltime t
*/
*/
int32
intervallenlt
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervallenlt
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -479,7 +459,7 @@ int32 intervallenlt(TimeInterval i, RelativeTime t)
...
@@ -479,7 +459,7 @@ int32 intervallenlt(TimeInterval i, RelativeTime t)
* intervallengt - returns 1, iff length of interval i is greater than
* intervallengt - returns 1, iff length of interval i is greater than
* reltime t
* reltime t
*/
*/
int32
intervallengt
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervallengt
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -493,7 +473,7 @@ int32 intervallengt(TimeInterval i, RelativeTime t)
...
@@ -493,7 +473,7 @@ int32 intervallengt(TimeInterval i, RelativeTime t)
* intervallenle - returns 1, iff length of interval i is less or equal
* intervallenle - returns 1, iff length of interval i is less or equal
* than reltime t
* than reltime t
*/
*/
int32
intervallenle
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervallenle
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -507,7 +487,7 @@ int32 intervallenle(TimeInterval i, RelativeTime t)
...
@@ -507,7 +487,7 @@ int32 intervallenle(TimeInterval i, RelativeTime t)
* intervallenge - returns 1, iff length of interval i is greater or
* intervallenge - returns 1, iff length of interval i is greater or
* equal than reltime t
* equal than reltime t
*/
*/
int32
intervallenge
(
TimeInterval
i
,
RelativeTime
t
)
bool
intervallenge
(
TimeInterval
i
,
RelativeTime
t
)
{
{
RelativeTime
rt
;
RelativeTime
rt
;
...
@@ -520,7 +500,7 @@ int32 intervallenge(TimeInterval i, RelativeTime t)
...
@@ -520,7 +500,7 @@ int32 intervallenge(TimeInterval i, RelativeTime t)
/*
/*
* intervalct - returns 1, iff interval i1 contains interval i2
* intervalct - returns 1, iff interval i1 contains interval i2
*/
*/
int32
intervalct
(
TimeInterval
i1
,
TimeInterval
i2
)
bool
intervalct
(
TimeInterval
i1
,
TimeInterval
i2
)
{
{
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
return
(
0
);
return
(
0
);
...
@@ -531,7 +511,7 @@ int32 intervalct(TimeInterval i1, TimeInterval i2)
...
@@ -531,7 +511,7 @@ int32 intervalct(TimeInterval i1, TimeInterval i2)
/*
/*
* intervalov - returns 1, iff interval i1 (partially) overlaps i2
* intervalov - returns 1, iff interval i1 (partially) overlaps i2
*/
*/
int32
intervalov
(
TimeInterval
i1
,
TimeInterval
i2
)
bool
intervalov
(
TimeInterval
i1
,
TimeInterval
i2
)
{
{
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
if
(
i1
->
status
==
T_INTERVAL_INVAL
||
i2
->
status
==
T_INTERVAL_INVAL
)
return
(
0
);
return
(
0
);
...
@@ -736,7 +716,6 @@ static int correct_dir(char direction[], int *signptr)
...
@@ -736,7 +716,6 @@ static int correct_dir(char direction[], int *signptr)
return
(
0
);
/* invalid direction descriptor */
return
(
0
);
/* invalid direction descriptor */
}
}
/*
/*
* istinterval - returns 1, iff i_string is a valid interval descr.
* istinterval - returns 1, iff i_string is a valid interval descr.
* 0, iff i_string is NOT a valid interval desc.
* 0, iff i_string is NOT a valid interval desc.
...
...
src/backend/utils/adt/datetime
s
.c
→
src/backend/utils/adt/datetime.c
View file @
53d8be3b
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/dt.c
View file @
53d8be3b
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/geo_ops.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.
1 1997/03/09 20:40:55 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.
2 1997/03/14 23:20:15 scrappy
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "postgres.h"
#include "postgres.h"
#include "utils/geo
-
decls.h"
#include "utils/geo
_
decls.h"
#include "utils/palloc.h"
#include "utils/palloc.h"
#define LDELIM '('
#define LDELIM '('
...
...
src/backend/utils/adt/geo_selfuncs.c
View file @
53d8be3b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_selfuncs.c,v 1.
1 1997/03/09 20:40:57 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_selfuncs.c,v 1.
2 1997/03/14 23:20:20 scrappy
Exp $
*
*
* XXX These are totally bogus.
* XXX These are totally bogus.
*
*
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include "postgres.h"
#include "postgres.h"
#include "access/attnum.h"
#include "access/attnum.h"
#include "utils/geo
-
decls.h"
/* where function declarations go */
#include "utils/geo
_
decls.h"
/* where function declarations go */
#include "utils/palloc.h"
#include "utils/palloc.h"
#include "utils/builtins.h"
#include "utils/builtins.h"
...
...
src/backend/utils/adt/int.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.
3 1996/11/06 10:30:55
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.
4 1997/03/14 23:20:26
scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -225,36 +225,36 @@ int16 i4toi2(int32 arg1)
...
@@ -225,36 +225,36 @@ int16 i4toi2(int32 arg1)
* intgt - returns 1 iff arg1 > arg2
* intgt - returns 1 iff arg1 > arg2
* intge - returns 1 iff arg1 >= arg2
* intge - returns 1 iff arg1 >= arg2
*/
*/
int32
int4eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
int4eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
int32
int4ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
bool
int4ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
int32
int4lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
bool
int4lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
int32
int4le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
bool
int4le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
int32
int4gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
bool
int4gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
int32
int4ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
bool
int4ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
int32
int2eq
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
int2eq
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
==
arg2
);
}
int32
int2ne
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
!=
arg2
);
}
bool
int2ne
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
!=
arg2
);
}
int32
int2lt
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
<
arg2
);
}
bool
int2lt
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
<
arg2
);
}
int32
int2le
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
<=
arg2
);
}
bool
int2le
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
<=
arg2
);
}
int32
int2gt
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
>
arg2
);
}
bool
int2gt
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
>
arg2
);
}
int32
int2ge
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
>=
arg2
);
}
bool
int2ge
(
int16
arg1
,
int16
arg2
)
{
return
(
arg1
>=
arg2
);
}
int32
int24eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
int24eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
int32
int24ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
bool
int24ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
int32
int24lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
bool
int24lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
int32
int24le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
bool
int24le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
int32
int24gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
bool
int24gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
int32
int24ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
bool
int24ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
int32
int42eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
bool
int42eq
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
==
arg2
);
}
int32
int42ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
bool
int42ne
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
!=
arg2
);
}
int32
int42lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
bool
int42lt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<
arg2
);
}
int32
int42le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
bool
int42le
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
<=
arg2
);
}
int32
int42gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
bool
int42gt
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>
arg2
);
}
int32
int42ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
bool
int42ge
(
int32
arg1
,
int32
arg2
)
{
return
(
arg1
>=
arg2
);
}
int32
keyfirsteq
(
int16
*
arg1
,
int16
arg2
)
{
return
(
*
arg1
==
arg2
);
}
bool
keyfirsteq
(
int16
*
arg1
,
int16
arg2
)
{
return
(
*
arg1
==
arg2
);
}
/*
/*
* int[24]pl - returns arg1 + arg2
* int[24]pl - returns arg1 + arg2
...
...
src/backend/utils/adt/nabstime.c
View file @
53d8be3b
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/name.c
View file @
53d8be3b
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.
1.1.1 1996/07/09 06:22:04
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.
2 1997/03/14 23:20:43
scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -74,49 +74,49 @@ char *nameout(NameData *s)
...
@@ -74,49 +74,49 @@ char *nameout(NameData *s)
* namege - returns 1 iff a <= b
* namege - returns 1 iff a <= b
*
*
*/
*/
int32
nameeq
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
nameeq
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
!
arg1
||
!
arg2
)
if
(
!
arg1
||
!
arg2
)
return
0
;
return
0
;
else
else
return
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
==
0
);
return
(
(
bool
)
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
==
0
);
}
}
int32
namene
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
namene
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
!=
0
);
return
(
(
bool
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
!=
0
)
);
}
}
int32
namelt
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
namelt
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
<
0
));
return
((
bool
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
<
0
));
}
}
int32
namele
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
namele
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
<=
0
));
return
((
bool
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
<=
0
));
}
}
int32
namegt
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
namegt
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
>
0
));
return
((
bool
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
>
0
));
}
}
int32
namege
(
NameData
*
arg1
,
NameData
*
arg2
)
bool
namege
(
NameData
*
arg1
,
NameData
*
arg2
)
{
{
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
>=
0
));
return
((
bool
)
(
strncmp
(
arg1
->
data
,
arg2
->
data
,
NAMEDATALEN
)
>=
0
));
}
}
...
...
src/backend/utils/adt/oid.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.
5 1997/03/12 21:09:15
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.
6 1997/03/14 23:20:52
scrappy Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -100,19 +100,19 @@ char *oidout(Oid o)
...
@@ -100,19 +100,19 @@ char *oidout(Oid o)
* PUBLIC ROUTINES *
* PUBLIC ROUTINES *
*****************************************************************************/
*****************************************************************************/
int32
oideq
(
Oid
arg1
,
Oid
arg2
)
bool
oideq
(
Oid
arg1
,
Oid
arg2
)
{
{
return
(
arg1
==
arg2
);
return
(
arg1
==
arg2
);
}
}
int32
oidne
(
Oid
arg1
,
Oid
arg2
)
bool
oidne
(
Oid
arg1
,
Oid
arg2
)
{
{
return
(
arg1
!=
arg2
);
return
(
arg1
!=
arg2
);
}
}
int32
oid8eq
(
Oid
arg1
[],
Oid
arg2
[])
bool
oid8eq
(
Oid
arg1
[],
Oid
arg2
[])
{
{
return
(
int32
)(
memcmp
(
arg1
,
arg2
,
8
*
sizeof
(
Oid
))
==
0
);
return
(
bool
)(
memcmp
(
arg1
,
arg2
,
8
*
sizeof
(
Oid
))
==
0
);
}
}
bool
oideqint4
(
Oid
arg1
,
int32
arg2
)
bool
oideqint4
(
Oid
arg1
,
int32
arg2
)
...
...
src/backend/utils/adt/varchar.c
View file @
53d8be3b
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/varlena.c
View file @
53d8be3b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.1
0 1997/01/16 03:53:51 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.1
1 1997/03/14 23:21:12 scrappy
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -255,16 +255,16 @@ textcat(text* t1, text* t2)
...
@@ -255,16 +255,16 @@ textcat(text* t1, text* t2)
* texteq - returns 1 iff arguments are equal
* texteq - returns 1 iff arguments are equal
* textne - returns 1 iff arguments are not equal
* textne - returns 1 iff arguments are not equal
*/
*/
int32
bool
texteq
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
texteq
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
register
int
len
;
register
int
len
;
register
char
*
a1p
,
*
a2p
;
register
char
*
a1p
,
*
a2p
;
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
NULL
);
return
((
bool
)
NULL
);
if
((
len
=
arg1
->
vl_len
)
!=
arg2
->
vl_len
)
if
((
len
=
arg1
->
vl_len
)
!=
arg2
->
vl_len
)
return
((
int32
)
0
);
return
((
bool
)
0
);
a1p
=
arg1
->
vl_dat
;
a1p
=
arg1
->
vl_dat
;
a2p
=
arg2
->
vl_dat
;
a2p
=
arg2
->
vl_dat
;
/*
/*
...
@@ -275,17 +275,17 @@ texteq(struct varlena *arg1, struct varlena *arg2)
...
@@ -275,17 +275,17 @@ texteq(struct varlena *arg1, struct varlena *arg2)
len
-=
sizeof
(
int32
);
len
-=
sizeof
(
int32
);
while
(
len
--
!=
0
)
while
(
len
--
!=
0
)
if
(
*
a1p
++
!=
*
a2p
++
)
if
(
*
a1p
++
!=
*
a2p
++
)
return
((
int32
)
0
);
return
((
bool
)
0
);
return
((
int32
)
1
);
return
((
bool
)
1
);
}
}
int32
bool
textne
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
textne
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
return
((
int32
)
!
texteq
(
arg1
,
arg2
));
return
((
bool
)
!
texteq
(
arg1
,
arg2
));
}
}
int32
bool
text_lt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
text_lt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
int
len
;
int
len
;
...
@@ -295,7 +295,7 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
...
@@ -295,7 +295,7 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
char
*
a1p
,
*
a2p
;
char
*
a1p
,
*
a2p
;
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
...
@@ -311,12 +311,12 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
...
@@ -311,12 +311,12 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
len
--
;
len
--
;
}
}
if
(
len
)
if
(
len
)
return
(
int32
)
(
*
a1p
<
*
a2p
);
return
(
bool
)
(
*
a1p
<
*
a2p
);
else
else
return
(
int32
)
(
arg1
->
vl_len
<
arg2
->
vl_len
);
return
(
bool
)
(
arg1
->
vl_len
<
arg2
->
vl_len
);
}
}
int32
bool
text_le
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
text_le
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
int
len
;
int
len
;
...
@@ -326,7 +326,7 @@ text_le(struct varlena *arg1, struct varlena *arg2)
...
@@ -326,7 +326,7 @@ text_le(struct varlena *arg1, struct varlena *arg2)
char
*
a1p
,
*
a2p
;
char
*
a1p
,
*
a2p
;
if
(
arg1
==
NULL
||
arg2
==
NULL
)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
int32
)
0
);
return
((
bool
)
0
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
...
@@ -342,21 +342,21 @@ text_le(struct varlena *arg1, struct varlena *arg2)
...
@@ -342,21 +342,21 @@ text_le(struct varlena *arg1, struct varlena *arg2)
len
--
;
len
--
;
}
}
if
(
len
)
if
(
len
)
return
(
int32
)
(
*
a1p
<
*
a2p
);
return
(
bool
)
(
*
a1p
<
*
a2p
);
else
else
return
((
int32
)
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
));
return
((
bool
)
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
));
}
}
int32
bool
text_gt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
text_gt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
return
((
int32
)
!
text_le
(
arg1
,
arg2
));
return
((
bool
)
!
text_le
(
arg1
,
arg2
));
}
}
int32
bool
text_ge
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
text_ge
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
{
return
((
int32
)
!
text_lt
(
arg1
,
arg2
));
return
((
bool
)
!
text_lt
(
arg1
,
arg2
));
}
}
/*-------------------------------------------------------------
/*-------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment