mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Massive commit to run PGINDENT on all *.c and *.h files.
This commit is contained in:
@ -1,74 +1,74 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* bool.c--
|
||||
* Functions for the built-in type "bool".
|
||||
* Functions for the built-in type "bool".
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.4 1997/04/27 19:20:07 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.5 1997/09/07 04:49:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "utils/builtins.h" /* where the declarations go */
|
||||
#include "utils/builtins.h" /* where the declarations go */
|
||||
#include "utils/palloc.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* USER I/O ROUTINES *
|
||||
/*****************************************************************************
|
||||
* USER I/O ROUTINES *
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* boolin - converts "t" or "f" to 1 or 0
|
||||
* boolin - converts "t" or "f" to 1 or 0
|
||||
*/
|
||||
bool
|
||||
boolin(char *b)
|
||||
{
|
||||
if (b == NULL)
|
||||
elog(WARN, "Bad input string for type bool");
|
||||
return((bool) (*b == 't') || (*b == 'T'));
|
||||
if (b == NULL)
|
||||
elog(WARN, "Bad input string for type bool");
|
||||
return ((bool) (*b == 't') || (*b == 'T'));
|
||||
}
|
||||
|
||||
/*
|
||||
* boolout - converts 1 or 0 to "t" or "f"
|
||||
* boolout - converts 1 or 0 to "t" or "f"
|
||||
*/
|
||||
char *
|
||||
char *
|
||||
boolout(long b)
|
||||
{
|
||||
char *result = (char *) palloc(2);
|
||||
|
||||
*result = (b) ? 't' : 'f';
|
||||
result[1] = '\0';
|
||||
return(result);
|
||||
char *result = (char *) palloc(2);
|
||||
|
||||
*result = (b) ? 't' : 'f';
|
||||
result[1] = '\0';
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* PUBLIC ROUTINES *
|
||||
/*****************************************************************************
|
||||
* PUBLIC ROUTINES *
|
||||
*****************************************************************************/
|
||||
|
||||
bool
|
||||
booleq(int8 arg1, int8 arg2)
|
||||
{
|
||||
return(arg1 == arg2);
|
||||
}
|
||||
|
||||
bool
|
||||
boolne(int8 arg1, int8 arg2)
|
||||
booleq(int8 arg1, int8 arg2)
|
||||
{
|
||||
return(arg1 != arg2);
|
||||
return (arg1 == arg2);
|
||||
}
|
||||
|
||||
bool
|
||||
boollt(int8 arg1, int8 arg2)
|
||||
{
|
||||
return(arg1 < arg2);
|
||||
boolne(int8 arg1, int8 arg2)
|
||||
{
|
||||
return (arg1 != arg2);
|
||||
}
|
||||
|
||||
bool
|
||||
boolgt(int8 arg1, int8 arg2)
|
||||
{
|
||||
return(arg1 > arg2);
|
||||
boollt(int8 arg1, int8 arg2)
|
||||
{
|
||||
return (arg1 < arg2);
|
||||
}
|
||||
|
||||
bool
|
||||
boolgt(int8 arg1, int8 arg2)
|
||||
{
|
||||
return (arg1 > arg2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user