/****************************************************************************
 *
 *                               GBase.
 *
 *                           PROPRIETARY DATA
 *
 * Licensed Material - Property Of GBase
 *
 * "Restricted Materials of GBase"
 *
 * GBase Client SDK
 *
 * (c)  Copyright GBASE  2002. All rights reserved.
 *
 *  Title:	varchar.h
 *  Description:
 *		header file for varying length character data type
 *
 ***************************************************************************
 */
#ifndef VARCHAR_H_INCLUDED
#define VARCHAR_H_INCLUDED

#define ldvc(p) ((int4)(((p)[0]<<8)+((p)[1]&0xFF)))
#define stvc(i,p) ((p)[0]=(char)((i)>>8),\
                 (p)[1]=(char)(i))

/*
 * VARCHAR macros
 */

#define VCOFFSET        (2)
#define MAXVCLEN		(0xffff)
#define VCLENGTH(len)		(VCMAX(len)+VCOFFSET)
#define VCMIN(size)		(((size) >> 16) & 0xffff)
#define VCMAX(size)		((size) & 0xffff)
#define VCSIZ(max, min)		((((min) << 16) & 0xffff0000) + ((max) & 0xffff))

#endif /* VARCHAR_H_INCLUDED */
