Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cc1b420

Browse files
author
Thomas G. Lockhart
committed
Add routines istrue() and isfalse() to directly evaluate boolean type.
1 parent 770352d commit cc1b420

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/backend/utils/adt/bool.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.9 1997/10/25 05:09:58 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.10 1997/10/30 16:45:12 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -116,3 +116,15 @@ boolgt(bool arg1, bool arg2)
116116
{
117117
return (arg1 > arg2);
118118
}
119+
120+
bool
121+
istrue(bool arg1)
122+
{
123+
return(arg1 == TRUE);
124+
} /* istrue() */
125+
126+
bool
127+
isfalse(bool arg1)
128+
{
129+
return(arg1 != TRUE);
130+
} /* istrue() */

src/include/catalog/pg_proc.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pg_proc.h,v 1.32 1997/10/25 05:29:48 thomas Exp $
9+
* $Id: pg_proc.h,v 1.33 1997/10/30 16:44:06 thomas Exp $
1010
*
1111
* NOTES
1212
* The script catalog/genbki.sh reads this file and generates .bki
@@ -729,6 +729,9 @@ DATA(insert OID = 947 ( oidnamene PGUID 11 f t f 2 f 16 "911 911" 100 0 0 1
729729
DATA(insert OID = 948 ( oidnamecmp PGUID 11 f t f 2 f 23 "911 911" 100 0 0 100 foo bar));
730730
DATA(insert OID = 949 ( mkoidname PGUID 11 f t f 2 f 911 "26 19" 100 0 0 100 foo bar));
731731

732+
DATA(insert OID = 950 ( istrue PGUID 11 f t f 1 f 16 "16" 100 0 0 100 foo bar ));
733+
DATA(insert OID = 951 ( isfalse PGUID 11 f t f 1 f 16 "16" 100 0 0 100 foo bar ));
734+
732735
DATA(insert OID = 952 ( lo_open PGUID 11 f t f 2 f 23 "26 23" 100 0 0 100 foo bar ));
733736
DATA(insert OID = 953 ( lo_close PGUID 11 f t f 1 f 23 "23" 100 0 0 100 foo bar ));
734737
DATA(insert OID = 954 ( loread PGUID 11 f t f 2 f 17 "23 23" 100 0 0 100 foo bar ));

src/include/utils/builtins.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: builtins.h,v 1.28 1997/10/25 05:40:43 thomas Exp $
9+
* $Id: builtins.h,v 1.29 1997/10/30 16:42:50 thomas Exp $
1010
*
1111
* NOTES
1212
* This should normally only be included by fmgr.h.
@@ -35,6 +35,8 @@ extern bool booleq(bool arg1, bool arg2);
3535
extern bool boolne(bool arg1, bool arg2);
3636
extern bool boollt(bool arg1, bool arg2);
3737
extern bool boolgt(bool arg1, bool arg2);
38+
extern bool istrue(bool arg1);
39+
extern bool isfalse(bool arg1);
3840

3941
/* char.c */
4042
extern int32 charin(char *ch);

0 commit comments

Comments
 (0)