Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
attnum.h65 linesDownload Raw Back to access
1/*-------------------------------------------------------------------------2 *3 * attnum.h4 *	  POSTGRES attribute number definitions.5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/access/attnum.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef ATTNUM_H15#define ATTNUM_H16 17 18/*19 * user defined attribute numbers start at 1.   -ay 2/9520 */21typedef int16 AttrNumber;22 23#define InvalidAttrNumber		024#define MaxAttrNumber			3276725 26/* ----------------27 *		support macros28 * ----------------29 */30/*31 * AttributeNumberIsValid32 *		True iff the attribute number is valid.33 */34#define AttributeNumberIsValid(attributeNumber) \35	((bool) ((attributeNumber) != InvalidAttrNumber))36 37/*38 * AttrNumberIsForUserDefinedAttr39 *		True iff the attribute number corresponds to a user defined attribute.40 */41#define AttrNumberIsForUserDefinedAttr(attributeNumber) \42	((bool) ((attributeNumber) > 0))43 44/*45 * AttrNumberGetAttrOffset46 *		Returns the attribute offset for an attribute number.47 *48 * Note:49 *		Assumes the attribute number is for a user defined attribute.50 */51#define AttrNumberGetAttrOffset(attNum) \52( \53	AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)), \54	((attNum) - 1) \55)56 57/*58 * AttrOffsetGetAttrNumber59 *		Returns the attribute number for an attribute offset.60 */61#define AttrOffsetGetAttrNumber(attributeOffset) \62	 ((AttrNumber) (1 + (attributeOffset)))63 64#endif							/* ATTNUM_H */65 
codekingpro/portable-devtools · Team Ai