diff options
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/catcache.c | 30 | ||||
-rw-r--r-- | src/backend/utils/cache/fcache.c | 8 | ||||
-rw-r--r-- | src/backend/utils/cache/inval.c | 10 | ||||
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 16 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 44 | ||||
-rw-r--r-- | src/backend/utils/cache/syscache.c | 38 |
6 files changed, 73 insertions, 73 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 4820eff2224..ebc263d8a2c 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.32 1998/08/19 02:03:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.33 1998/09/01 03:26:25 momjian Exp $ * * Notes: * XXX This needs to use exception.h to handle recovery when @@ -181,7 +181,7 @@ CatalogCacheInitializeCache(struct catcache * cache, */ Assert(RelationIsValid(relation)); cache->relationId = RelationGetRelid(relation); - tupdesc = cache->cc_tupdesc = RelationGetTupleDescriptor(relation); + tupdesc = cache->cc_tupdesc = RelationGetDescr(relation); CACHE3_elog(DEBUG, "CatalogCacheInitializeCache: relid %d, %d keys", cache->relationId, cache->cc_nkeys); @@ -240,7 +240,7 @@ CatalogCacheInitializeCache(struct catcache * cache, */ if (cache->cc_indname != NULL && cache->indexId == InvalidOid) { - if (RelationGetRelationTupleForm(relation)->relhasindex) + if (RelationGetForm(relation)->relhasindex) { /* @@ -301,7 +301,7 @@ comphash(long l, char *v) case 1: case 2: case 4: - return ((long) v); + return (long) v; } if (l == NAMEDATALEN) @@ -322,7 +322,7 @@ comphash(long l, char *v) i = 0; while (l--) i += *v++; - return (i); + return i; } /* -------------------------------- @@ -365,7 +365,7 @@ CatalogCacheComputeHashIndex(struct catcache * cacheInP) break; } hashIndex %= cacheInP->cc_size; - return (hashIndex); + return hashIndex; } /* -------------------------------- @@ -389,7 +389,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP, ? (Datum) tuple->t_oid : fastgetattr(tuple, cacheInOutP->cc_key[3], - RelationGetTupleDescriptor(relation), + RelationGetDescr(relation), &isNull); Assert(!isNull); /* FALLTHROUGH */ @@ -399,7 +399,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP, ? (Datum) tuple->t_oid : fastgetattr(tuple, cacheInOutP->cc_key[2], - RelationGetTupleDescriptor(relation), + RelationGetDescr(relation), &isNull); Assert(!isNull); /* FALLTHROUGH */ @@ -409,7 +409,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP, ? (Datum) tuple->t_oid : fastgetattr(tuple, cacheInOutP->cc_key[1], - RelationGetTupleDescriptor(relation), + RelationGetDescr(relation), &isNull); Assert(!isNull); /* FALLTHROUGH */ @@ -419,7 +419,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP, ? (Datum) tuple->t_oid : fastgetattr(tuple, cacheInOutP->cc_key[0], - RelationGetTupleDescriptor(relation), + RelationGetDescr(relation), &isNull); Assert(!isNull); break; @@ -675,7 +675,7 @@ InitSysCache(char *relname, char *iname, int id, int nkeys, - int key[], + int *key, HeapTuple (*iScanfuncP) ()) { CatCache *cp; @@ -801,7 +801,7 @@ InitSysCache(char *relname, * ---------------- */ MemoryContextSwitchTo(oldcxt); - return (cp); + return cp; } @@ -896,7 +896,7 @@ SearchSysCache(struct catcache * cache, heap_close(relation); #endif /* CACHEDEBUG */ - return (ct->ct_tup); + return ct->ct_tup; } /* ---------------- @@ -913,7 +913,7 @@ SearchSysCache(struct catcache * cache, if (DisableCache) { elog(ERROR, "SearchSysCache: Called while cache disabled"); - return ((HeapTuple) NULL); + return (HeapTuple) NULL; } /* ---------------- @@ -943,7 +943,7 @@ SearchSysCache(struct catcache * cache, CACHE2_elog(DEBUG, "SearchSysCache: performing scan (override==%d)", heapisoverride()); - if ((RelationGetRelationTupleForm(relation))->relhasindex + if ((RelationGetForm(relation))->relhasindex && !IsBootstrapProcessingMode()) { /* ---------- diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c index 89351db8c82..8933c664412 100644 --- a/src/backend/utils/cache/fcache.c +++ b/src/backend/utils/cache/fcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.16 1998/08/24 01:13:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.17 1998/09/01 03:26:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ init_fcache(Oid foid, HeapTuple procedureTuple; HeapTuple typeTuple; Form_pg_proc procedureStruct; - TypeTupleForm typeStruct; + Form_pg_type typeStruct; FunctionCachePtr retval; text *tmp; int nargs; @@ -140,7 +140,7 @@ init_fcache(Oid foid, * save the information in our one element cache. * ---------------- */ - typeStruct = (TypeTupleForm) GETSTRUCT(typeTuple); + typeStruct = (Form_pg_type) GETSTRUCT(typeTuple); retval->typlen = (typeStruct)->typlen; if ((typeStruct)->typrelid == InvalidOid) @@ -292,7 +292,7 @@ init_fcache(Oid foid, retval->func.fn_addr = (func_ptr) NULL; - return (retval); + return retval; } void diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index cd327632a87..631fc2a18c9 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.14 1998/08/20 22:07:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.15 1998/09/01 03:26:29 momjian Exp $ * * Note - this code is real crufty... * @@ -103,7 +103,7 @@ InvalidationEntryAllocate(uint16 size) entryDataP = (InvalidationEntryData *) malloc(sizeof(char *) + size); /* XXX alignment */ entryDataP->nextP = NULL; - return ((Pointer) &entryDataP->userData); + return (Pointer) &entryDataP->userData; } /* -------------------------------- @@ -120,7 +120,7 @@ LocalInvalidRegister(LocalInvalid invalid, ((InvalidationUserData *) entry)->dataP[-1] = (InvalidationUserData *) invalid; - return (entry); + return entry; } /* -------------------------------- @@ -485,7 +485,7 @@ RelationInvalidateRelationCache(Relation relation, if (relationId == MyRelationRelationId) objectId = tuple->t_oid; else if (relationId == MyAttributeRelationId) - objectId = ((AttributeTupleForm) GETSTRUCT(tuple))->attrelid; + objectId = ((Form_pg_attribute) GETSTRUCT(tuple))->attrelid; else if (relationId == MyAMRelationId) objectId = tuple->t_oid; else if (relationId == MyAMOPRelationId) @@ -621,7 +621,7 @@ RelationInvalidateHeapTuple(Relation relation, HeapTuple tuple) * this only works for system relations now * ---------------- */ - if (!IsSystemRelationName(RelationGetRelationTupleForm(relation)->relname.data)) + if (!IsSystemRelationName(RelationGetForm(relation)->relname.data)) return; /* ---------------- diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 38c29fd2749..7189f16c6e3 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.20 1998/08/19 02:03:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.21 1998/09/01 03:26:30 momjian Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -111,7 +111,7 @@ get_attnum(Oid relid, char *attname) Oid get_atttype(Oid relid, AttrNumber attnum) { - AttributeTupleForm att_tup = (AttributeTupleForm) palloc(sizeof(*att_tup)); + Form_pg_attribute att_tup = (Form_pg_attribute) palloc(sizeof(*att_tup)); if (SearchSysCacheStruct(ATTNUM, (char *) att_tup, ObjectIdGetDatum(relid), @@ -131,7 +131,7 @@ get_attisset(Oid relid, char *attname) { HeapTuple tuple; AttrNumber attno; - AttributeTupleForm att_tup; + Form_pg_attribute att_tup; attno = get_attnum(relid, attname); @@ -146,7 +146,7 @@ get_attisset(Oid relid, char *attname) return false; else { - att_tup = (AttributeTupleForm) GETSTRUCT(tuple); + att_tup = (Form_pg_attribute) GETSTRUCT(tuple); return att_tup->attisset; } } @@ -415,7 +415,7 @@ get_rel_name(Oid relid) int16 get_typlen(Oid typid) { - TypeTupleFormData typtup; + FormData_pg_type typtup; if (SearchSysCacheStruct(TYPOID, (char *) &typtup, ObjectIdGetDatum(typid), @@ -435,7 +435,7 @@ get_typlen(Oid typid) bool get_typbyval(Oid typid) { - TypeTupleFormData typtup; + FormData_pg_type typtup; if (SearchSysCacheStruct(TYPOID, (char *) &typtup, ObjectIdGetDatum(typid), @@ -456,7 +456,7 @@ get_typbyval(Oid typid) char get_typalign(Oid typid) { - TypeTupleFormData typtup; + FormData_pg_type typtup; if (SearchSysCacheStruct(TYPOID, (char *) &typtup, ObjectIdGetDatum(typid), @@ -495,7 +495,7 @@ get_typdefault(Oid typid) char get_typtype(Oid typid) { - TypeTupleFormData typtup; + FormData_pg_type typtup; if (SearchSysCacheStruct(TYPOID, (char *) &typtup, ObjectIdGetDatum(typid), diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 5d30836a41f..078f532c959 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.48 1998/08/28 03:36:28 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.49 1998/09/01 03:26:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -235,7 +235,7 @@ do { \ /* non-export function prototypes */ static void formrdesc(char *relationName, u_int natts, - FormData_pg_attribute att[]); + FormData_pg_attribute *att); #if 0 /* See comments at line 1304 */ static void RelationFlushIndexes(Relation *r, Oid accessMethodId); @@ -324,9 +324,9 @@ ScanPgRelation(RelationBuildDescInfo buildinfo) */ if (IsBootstrapProcessingMode()) - return (scan_pg_rel_seq(buildinfo)); + return scan_pg_rel_seq(buildinfo); else - return (scan_pg_rel_ind(buildinfo)); + return scan_pg_rel_ind(buildinfo); } static HeapTuple @@ -454,16 +454,16 @@ AllocateRelationDesc(u_int natts, Form_pg_class relp) { Relation relation; Size len; - Form_pg_class relationTupleForm; + Form_pg_class relationForm; /* ---------------- * allocate space for the relation tuple form * ---------------- */ - relationTupleForm = (Form_pg_class) + relationForm = (Form_pg_class) palloc((Size) (sizeof(FormData_pg_class))); - memmove((char *) relationTupleForm, (char *) relp, CLASS_TUPLE_SIZE); + memmove((char *) relationForm, (char *) relp, CLASS_TUPLE_SIZE); /* ---------------- * allocate space for new relation descriptor @@ -482,7 +482,7 @@ AllocateRelationDesc(u_int natts, Form_pg_class relp) relation->rd_att = CreateTemplateTupleDesc(natts); /* and initialize relation tuple form */ - relation->rd_rel = relationTupleForm; + relation->rd_rel = relationForm; return relation; } @@ -520,7 +520,7 @@ build_tupdesc_seq(RelationBuildDescInfo buildinfo, HeapTuple pg_attribute_tuple; Relation pg_attribute_desc; HeapScanDesc pg_attribute_scan; - AttributeTupleForm attp; + Form_pg_attribute attp; ScanKeyData key; int need; @@ -549,12 +549,12 @@ build_tupdesc_seq(RelationBuildDescInfo buildinfo, pg_attribute_tuple = heap_getnext(pg_attribute_scan, 0); while (HeapTupleIsValid(pg_attribute_tuple) && need > 0) { - attp = (AttributeTupleForm) GETSTRUCT(pg_attribute_tuple); + attp = (Form_pg_attribute) GETSTRUCT(pg_attribute_tuple); if (attp->attnum > 0) { relation->rd_att->attrs[attp->attnum - 1] = - (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); + (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); memmove((char *) (relation->rd_att->attrs[attp->attnum - 1]), (char *) attp, @@ -583,7 +583,7 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo, { Relation attrel; HeapTuple atttup; - AttributeTupleForm attp; + Form_pg_attribute attp; TupleConstr *constr = (TupleConstr *) palloc(sizeof(TupleConstr)); AttrDefault *attrdef = NULL; int ndef = 0; @@ -601,10 +601,10 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo, if (!HeapTupleIsValid(atttup)) elog(ERROR, "cannot find attribute %d of relation %s", i, relation->rd_rel->relname.data); - attp = (AttributeTupleForm) GETSTRUCT(atttup); + attp = (Form_pg_attribute) GETSTRUCT(atttup); relation->rd_att->attrs[i - 1] = - (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); + (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); memmove((char *) (relation->rd_att->attrs[i - 1]), (char *) attp, @@ -708,7 +708,7 @@ RelationBuildRuleLock(Relation relation) */ pg_rewrite_desc = heap_openr(RewriteRelationName); pg_rewrite_scan = heap_beginscan(pg_rewrite_desc, 0, SnapshotNow, 1, &key); - pg_rewrite_tupdesc = RelationGetTupleDescriptor(pg_rewrite_desc); + pg_rewrite_tupdesc = RelationGetDescr(pg_rewrite_desc); /* ---------------- * add attribute data to relation->rd_att @@ -880,7 +880,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo) if (OidIsValid(relam)) { relation->rd_am = (Form_pg_am) - AccessMethodObjectIdGetAccessMethodTupleForm(relam); + AccessMethodObjectIdGetForm(relam); } /* ---------------- @@ -1000,7 +1000,7 @@ IndexedAccessMethodInitialize(Relation relation) static void formrdesc(char *relationName, u_int natts, - FormData_pg_attribute att[]) + FormData_pg_attribute *att) { Relation relation; Size len; @@ -1072,7 +1072,7 @@ formrdesc(char *relationName, for (i = 0; i < natts; i++) { relation->rd_att->attrs[i] = - (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); + (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE); MemSet((char *) relation->rd_att->attrs[i], 0, ATTRIBUTE_TUPLE_SIZE); @@ -1138,7 +1138,7 @@ RelationIdCacheGetRelation(Oid relationId) } - return (rd); + return rd; } /* -------------------------------- @@ -1171,7 +1171,7 @@ RelationNameCacheGetRelation(char *relationName) } - return (rd); + return rd; } /* -------------------------------- @@ -1337,7 +1337,7 @@ RelationFlushRelation(Relation *relationPtr, #endif pfree(RelationGetLockInfo(relation)); - pfree(RelationGetRelationTupleForm(relation)); + pfree(RelationGetForm(relation)); pfree(relation); MemoryContextSwitchTo(oldcxt); @@ -1955,7 +1955,7 @@ init_irels(void) return; } - ird->rd_att->attrs[i] = (AttributeTupleForm) palloc(len); + ird->rd_att->attrs[i] = (Form_pg_attribute) palloc(len); if ((nread = FileRead(fd, (char *) ird->rd_att->attrs[i], len)) != len) { diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 7b4a411d172..cebbe28ac1b 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.20 1998/08/19 02:03:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.21 1998/09/01 03:26:33 momjian Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -205,7 +205,7 @@ static struct cachedesc cacheinfo[] = { 0, 0 }, - offsetof(TypeTupleFormData, typalign) +sizeof(char), + offsetof(FormData_pg_type, typalign) +sizeof(char), TypeNameIndex, TypeNameIndexScan}, {TypeRelationName, /* TYPOID */ @@ -216,7 +216,7 @@ static struct cachedesc cacheinfo[] = { 0, 0 }, - offsetof(TypeTupleFormData, typalign) +sizeof(char), + offsetof(FormData_pg_type, typalign) +sizeof(char), TypeOidIndex, TypeOidIndexScan}, {AccessMethodRelationName, /* AMNAME */ @@ -484,7 +484,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */ if (cacheId < 0 || cacheId >= SysCacheSize) { elog(ERROR, "SearchSysCacheTuple: Bad cache id %d", cacheId); - return ((HeapTuple) NULL); + return (HeapTuple) NULL; } Assert(AMI_OVERRIDE || PointerIsValid(SysCache[cacheId])); @@ -514,9 +514,9 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */ cacheinfo[cacheId].name, cacheId, key1, key2, key3, key4); #endif - return ((HeapTuple) NULL); + return (HeapTuple) NULL; } - return (tp); + return tp; } /* @@ -543,13 +543,13 @@ SearchSysCacheStruct(int cacheId, /* cache selection code */ if (!PointerIsValid(returnStruct)) { elog(ERROR, "SearchSysCacheStruct: No receiving struct"); - return (0); + return 0; } tp = SearchSysCacheTuple(cacheId, key1, key2, key3, key4); if (!HeapTupleIsValid(tp)) - return (0); + return 0; memmove(returnStruct, (char *) GETSTRUCT(tp), cacheinfo[cacheId].size); - return (1); + return 1; } @@ -589,7 +589,7 @@ SearchSysCacheGetAttribute(int cacheId, "SearchSysCacheGetAttribute: Lookup in %s(%d) failed", cacheName, cacheId); #endif /* defined(CACHEDEBUG) */ - return (NULL); + return NULL; } relation = heap_openr(cacheName); @@ -613,12 +613,12 @@ SearchSysCacheGetAttribute(int cacheId, elog(ERROR, "SearchSysCacheGetAttribute: Bad attr # %d in %s(%d)", attributeNumber, cacheName, cacheId); - return (NULL); + return NULL; } attributeValue = heap_getattr(tp, attributeNumber, - RelationGetTupleDescriptor(relation), + RelationGetDescr(relation), &isNull); if (isNull) @@ -627,7 +627,7 @@ SearchSysCacheGetAttribute(int cacheId, * Used to be an elog(DEBUG, ...) here and a claim that it should * be a FATAL error, I don't think either is warranted -mer 6/9/92 */ - return (NULL); + return NULL; } if (attributeByValue) @@ -645,7 +645,7 @@ SearchSysCacheGetAttribute(int cacheId, } heap_close(relation); - return (returnValue); + return returnValue; } /* @@ -665,7 +665,7 @@ void * TypeDefaultRetrieve(Oid typId) { HeapTuple typeTuple; - TypeTupleForm type; + Form_pg_type type; int32 typByVal, typLen; struct varlena *typDefault; @@ -682,10 +682,10 @@ TypeDefaultRetrieve(Oid typId) elog(DEBUG, "TypeDefaultRetrieve: Lookup in %s(%d) failed", cacheinfo[TYPOID].name, TYPOID); #endif /* defined(CACHEDEBUG) */ - return (NULL); + return NULL; } - type = (TypeTupleForm) GETSTRUCT(typeTuple); + type = (Form_pg_type) GETSTRUCT(typeTuple); typByVal = type->typbyval; typLen = type->typlen; @@ -701,7 +701,7 @@ TypeDefaultRetrieve(Oid typId) elog(DEBUG, "TypeDefaultRetrieve: No extractable typdefault in %s(%d)", cacheinfo[TYPOID].name, TYPOID); #endif /* defined(CACHEDEBUG) */ - return (NULL); + return NULL; } dataSize = VARSIZE(typDefault) - VARHDRSZ; @@ -746,5 +746,5 @@ TypeDefaultRetrieve(Oid typId) } } - return (returnValue); + return returnValue; } |