1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

Rename oid8 -> oidvector and int28 -> int2vector. Cleanup of *out functions.

This commit is contained in:
Bruce Momjian
2000-01-10 16:13:23 +00:00
parent 3f03f74f36
commit 6456b17bc1
27 changed files with 119 additions and 120 deletions

View File

@@ -7,14 +7,14 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.30 2000/01/10 15:41:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.31 2000/01/10 16:13:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* OLD COMMENTS
* I/O routines:
* int2in, int2out, int28in, int28out, int4in, int4out
* int2in, int2out, int2vectorin, int2vectorout, int4in, int4out
* Conversion routines:
* itoi, int2_text, int4_text
* Boolean operators:
@@ -71,13 +71,13 @@ int2out(int16 sh)
}
/*
* int28in - converts "num num ..." to internal form
* int2vectorin - converts "num num ..." to internal form
*
* Note:
* Fills any nonexistent digits with NULLs.
*/
int16 *
int28in(char *intString)
int2vectorin(char *intString)
{
int16 *result;
int slot;
@@ -99,7 +99,7 @@ int28in(char *intString)
while (*intString && isspace(*intString))
intString++;
if (*intString)
elog(ERROR,"int28 value has too many values");
elog(ERROR,"int2vector value has too many values");
while (slot < INDEX_MAX_KEYS)
result[slot++] = 0;
@@ -107,10 +107,10 @@ int28in(char *intString)
}
/*
* int28out - converts internal form to "num num ..."
* int2vectorout - converts internal form to "num num ..."
*/
char *
int28out(int16 *int2Array)
int2vectorout(int16 *int2Array)
{
int num, maxnum;
char *rp;
@@ -130,7 +130,7 @@ int28out(int16 *int2Array)
break;
/* assumes sign, 5 digits, ' ' */
rp = result = (char *) palloc(maxnum * 7 + 1);
rp = result = (char *) palloc((maxnum+1) * 7 + 1);
for (num = 0; num <= maxnum; num++)
{
if (num != 0)
@@ -168,7 +168,7 @@ int44in(char *input_string)
}
/*
* int28out - converts internal form to "num num ..."
* int2vectorout - converts internal form to "num num ..."
*/
char *
int44out(int32 *an_array)

View File

@@ -519,7 +519,7 @@ int84(int64 *val)
#if NOT_USED
int64 *
int28 (int16 val)
int2vector (int16 val)
{
int64 *result;
@@ -528,7 +528,7 @@ int28 (int16 val)
*result = val;
return result;
} /* int28() */
} /* int2vector() */
int16
int82(int64 *val)

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.31 2000/01/10 15:41:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.32 2000/01/10 16:13:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -22,13 +22,13 @@
*****************************************************************************/
/*
* oid8in - converts "num num ..." to internal form
* oidvectorin - converts "num num ..." to internal form
*
* Note:
* Fills any nonexistent digits with NULL oids.
*/
Oid *
oid8in(char *oidString)
oidvectorin(char *oidString)
{
Oid *result;
int slot;
@@ -50,7 +50,7 @@ oid8in(char *oidString)
while (*oidString && isspace(*oidString))
oidString++;
if (*oidString)
elog(ERROR,"oid8 value has too many values");
elog(ERROR,"oidvector value has too many values");
while (slot < INDEX_MAX_KEYS)
result[slot++] = 0;
@@ -58,10 +58,10 @@ oid8in(char *oidString)
}
/*
* oid8out - converts internal form to "num num ..."
* oidvectorout - converts internal form to "num num ..."
*/
char *
oid8out(Oid *oidArray)
oidvectorout(Oid *oidArray)
{
int num, maxnum;
char *rp;
@@ -81,7 +81,7 @@ oid8out(Oid *oidArray)
break;
/* assumes sign, 10 digits, ' ' */
rp = result = (char *) palloc(maxnum * 12 + 1);
rp = result = (char *) palloc((maxnum+1) * 12 + 1);
for (num = 0; num <= maxnum; num++)
{
if (num != 0)
@@ -127,19 +127,19 @@ oidne(Oid arg1, Oid arg2)
}
bool
oid8eq(Oid *arg1, Oid *arg2)
oidvectoreq(Oid *arg1, Oid *arg2)
{
return (bool) (memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) == 0);
}
bool
oid8ne(Oid *arg1, Oid *arg2)
oidvectorne(Oid *arg1, Oid *arg2)
{
return (bool) (memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) != 0);
}
bool
oid8lt(Oid *arg1, Oid *arg2)
oidvectorlt(Oid *arg1, Oid *arg2)
{
int i;
@@ -150,7 +150,7 @@ oid8lt(Oid *arg1, Oid *arg2)
}
bool
oid8le(Oid *arg1, Oid *arg2)
oidvectorle(Oid *arg1, Oid *arg2)
{
int i;
@@ -161,7 +161,7 @@ oid8le(Oid *arg1, Oid *arg2)
}
bool
oid8ge(Oid *arg1, Oid *arg2)
oidvectorge(Oid *arg1, Oid *arg2)
{
int i;
@@ -172,7 +172,7 @@ oid8ge(Oid *arg1, Oid *arg2)
}
bool
oid8gt(Oid *arg1, Oid *arg2)
oidvectorgt(Oid *arg1, Oid *arg2)
{
int i;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.47 1999/12/30 05:05:07 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.48 2000/01/10 16:13:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -233,7 +233,7 @@ regprocout(RegProcedure proid)
* int8typeout - converts int8 type oids to "typname" list
*/
text *
oid8types(Oid *oidArray)
oidvectortypes(Oid *oidArray)
{
HeapTuple typetup;
text *result;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.55 1999/12/16 22:19:54 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.56 2000/01/10 16:13:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -70,7 +70,7 @@ GlobalMemory CacheCxt; /* context in which caches are allocated */
static long eqproc[] = {
F_BOOLEQ, 0l, F_CHAREQ, F_NAMEEQ, 0l,
F_INT2EQ, F_KEYFIRSTEQ, F_INT4EQ, 0l, F_TEXTEQ,
F_OIDEQ, 0l, 0l, 0l, F_OID8EQ
F_OIDEQ, 0l, 0l, 0l, F_OIDVECTOREQ
};
#define EQPROC(SYSTEMTYPEOID) eqproc[(SYSTEMTYPEOID)-16]
@@ -191,14 +191,14 @@ CatalogCacheInitializeCache(struct catcache * cache,
/*
* Yoiks. The implementation of the hashing code and the
* implementation of int28's are at loggerheads. The right
* thing to do is to throw out the implementation of int28's
* implementation of int2vector's are at loggerheads. The right
* thing to do is to throw out the implementation of int2vector's
* altogether; until that happens, we do the right thing here
* to guarantee that the hash key generator doesn't try to
* dereference an int2 by mistake.
*/
if (tupdesc->attrs[cache->cc_key[i] - 1]->atttypid == INT28OID)
if (tupdesc->attrs[cache->cc_key[i] - 1]->atttypid == INT2VECTOROID)
cache->cc_klen[i] = sizeof(short);
else
cache->cc_klen[i] = tupdesc->attrs[cache->cc_key[i] - 1]->attlen;
@@ -851,7 +851,7 @@ SearchSelfReferences(struct catcache * cache)
{
HeapScanDesc sd;
MemoryContext oldcxt;
if (!CacheCxt)
CacheCxt = CreateGlobalMemory("Cache");
rel = heap_open(cache->relationId, AccessShareLock);
@@ -872,7 +872,7 @@ SearchSelfReferences(struct catcache * cache)
/* bootstrapping this requires preloading a range of rows. bjm */
static HeapTuple operatorSelfTuple[MAX_OIDCMP-MIN_OIDCMP+1];
Oid lookup_oid = (Oid)cache->cc_skey[0].sk_argument;
if (lookup_oid < MIN_OIDCMP || lookup_oid > MAX_OIDCMP)
return (HeapTuple)0;
@@ -880,7 +880,7 @@ SearchSelfReferences(struct catcache * cache)
{
HeapScanDesc sd;
MemoryContext oldcxt;
if (!CacheCxt)
CacheCxt = CreateGlobalMemory("Cache");
rel = heap_open(cache->relationId, AccessShareLock);