/*
 *  array.h -- header file for Sequoia "array" type in Postgres
 *
 *	$Header: /home/postgres/mao/sequoia/retreat/RCS/array.h,v 1.1 1993/01/06 20:07:58 mao Exp $
 */

/*
 *  This is the fixed-length part of the structure only.  After the arr_ndims
 *  entry is a vector of arr_eltsize integers -- the dimensions of the array
 *  -- and then a null-terminated character string that's the array name.
 */

typedef struct _ARRAY {
	int	arr_varlen;
	char	arr_format[8];
	int	arr_eltsize;
	int	arr_ndims;
} ARRAY;

#define ARR_DIMS(a)	((int *) (((char *)(a)) + sizeof(ARRAY)))
#define ARR_NAME(a)	(((char *) (a)) + sizeof(ARRAY) + (sizeof(int) * (a)->arr_ndims))
