From cc1b420cfdd5066bc2c80c01971f567950c894e4 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Thu, 30 Oct 1997 16:45:12 +0000 Subject: [PATCH] Add routines istrue() and isfalse() to directly evaluate boolean type. --- src/backend/utils/adt/bool.c | 14 +++++++++++++- src/include/catalog/pg_proc.h | 5 ++++- src/include/utils/builtins.h | 4 +++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/backend/utils/adt/bool.c b/src/backend/utils/adt/bool.c index dd1a2da1cb..3ceca94ccb 100644 --- a/src/backend/utils/adt/bool.c +++ b/src/backend/utils/adt/bool.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.9 1997/10/25 05:09:58 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.10 1997/10/30 16:45:12 thomas Exp $ * *------------------------------------------------------------------------- */ @@ -116,3 +116,15 @@ boolgt(bool arg1, bool arg2) { return (arg1 > arg2); } + +bool +istrue(bool arg1) +{ + return(arg1 == TRUE); +} /* istrue() */ + +bool +isfalse(bool arg1) +{ + return(arg1 != TRUE); +} /* istrue() */ diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 8793caf693..c9d81efebb 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.32 1997/10/25 05:29:48 thomas Exp $ + * $Id: pg_proc.h,v 1.33 1997/10/30 16:44:06 thomas Exp $ * * NOTES * 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 DATA(insert OID = 948 ( oidnamecmp PGUID 11 f t f 2 f 23 "911 911" 100 0 0 100 foo bar)); DATA(insert OID = 949 ( mkoidname PGUID 11 f t f 2 f 911 "26 19" 100 0 0 100 foo bar)); +DATA(insert OID = 950 ( istrue PGUID 11 f t f 1 f 16 "16" 100 0 0 100 foo bar )); +DATA(insert OID = 951 ( isfalse PGUID 11 f t f 1 f 16 "16" 100 0 0 100 foo bar )); + DATA(insert OID = 952 ( lo_open PGUID 11 f t f 2 f 23 "26 23" 100 0 0 100 foo bar )); DATA(insert OID = 953 ( lo_close PGUID 11 f t f 1 f 23 "23" 100 0 0 100 foo bar )); DATA(insert OID = 954 ( loread PGUID 11 f t f 2 f 17 "23 23" 100 0 0 100 foo bar )); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 250354b04c..a02f3addf0 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.28 1997/10/25 05:40:43 thomas Exp $ + * $Id: builtins.h,v 1.29 1997/10/30 16:42:50 thomas Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -35,6 +35,8 @@ extern bool booleq(bool arg1, bool arg2); extern bool boolne(bool arg1, bool arg2); extern bool boollt(bool arg1, bool arg2); extern bool boolgt(bool arg1, bool arg2); +extern bool istrue(bool arg1); +extern bool isfalse(bool arg1); /* char.c */ extern int32 charin(char *ch);