/************************************************************************
*                       - INFOFLEX System -
* This source code is CONFIDENTIAL and PROPRIETARY to CUSTOMWARE COMPUTING,
* INC. (CWC). The information contained herein may not be used, copied or
* disclosed in whole or in part except as permitted by written agreement
* signed by an officer of CWC.
*
* COPYRIGHT (c) 1986 CUSTOMWARE COMPUTING, INC., BURLINGAME, CALIFORNIA.
* ALL RIGHTS RESERVED.
*************************************************************************/

#ifndef SQMACRO_H
#define SQMACRO_H

#define dclrfld( A)             dclrrng(A, A)

#define getndhp( A)             ghdhead.hdDhptr[ (A)]
#define getrdfp( A, B)          ((A)->dhDbfield + B)

#define getfvtlen(f)	 getvtlen( (f)->dfType, (int) (f)->dfBytes, (int) (f)->dfDecimal)

#define fxtolower(c)		(('A' <= c && c <= 'Z') ? c | 040 : c)
#define fxtoupper(c)		(('a' <= c && c <= 'z') ? c & 0137 : c)

#define maxfunc(x,y)		(x > y ? x : y )
#define minfunc(x,y)		(x < y ? x : y )

#define fxmalloc( A, B)		malloc( A)
#define fxcalloc( A, B, C)	calloc( A, B)
#define fxrealloc( A, B, C)	realloc( A, B)
#define fxfree( A, B)           if ( A != NULL ) free( A)

#define MEMPAD 10
#define xfxmalloc( A, B)	fxmalloc( (unsigned) A + MEMPAD, B)
#define xmalloc( A)		malloc( (unsigned) A + MEMPAD)

#define prmsg()			rwputs( 1, msgbuf)
#define prerr()			rwputs( 2, msgbuf)

#endif
