/************************************************************************
*                       - 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 _SQPORT_H
#define _SQPORT_H

#define INFOFLEX
#define SYSOWNER "informix"

/*
 *    Define File Manager being used
 *
 *        CISAM2    ==> CISAM version 2.04 (used with INFORMIX 3.3)
 *        CISAM3    ==> CISAM version 3.xx (used with INFORMIX SQL)
 *        DISAM2    ==> CISAM clone for version 2.04 developed by BYTE DESIGNS
 *        DISAM3    ==> CISAM clone for version 3.xx developed by BYTE DESIGNS
 *        DISAM4    ==> CISAM clone for version 3.xx developed by BYTE DESIGNS
 *			(does not use dec_t because of bug in deccvdbl (XENIX5))
 *        CTRIEVE   ==> ISAM server used in INTEGRA and marketed by Coromandel
 *        NETISAM   ==> NETISAM by Sun Computers
 *     MICROFOCUS   ==> MICROFOCUS Cobol
*/


/*
 *    Define target machine used on compiler command line or here:
 *
 *        ALTO586   ==> Altos 586, 986, 486 computers
 *        ALTO2086  ==> Altos 2000, 3086, 2086 computers using XENX.5
 *        ALTO386   ==> Altos 1000, 2000, 3000 computers using UNIX.5
 *        UNI6000   ==> UNISYS 6000 series (Convergent) computer using UNIX.5
 *        UNI5000   ==> UNISYS 5000 series (Convergent) computer using UNIX.5
 *                      5000-20 and 5000-40 are 68010 machines
 *                      5000-35 and 5000-55 5000-85 are 68020 machines
 *        ATT3B2    ==> ATT 3B2/300 and 3B2/400 computers
 *        HP9000    ==> HP 9000: 835,840 computers
 *        NCR       ==> NCR Tower Computer
 *        CPOINT    ==> CounterPoint Computer
 *        MPORT     ==> Microport UNIX
 *        SCOXENIX  ==> Santa Cruz XENIX 5
 *        INTERACT  ==> Interactive UNIX
 *        AEGIS     ==> AEGIS Apollo
 *        VAXVMS    ==> DEC VAX using VMS
 *        MSDOS3    ==> IBM DOS compatable
 */

/*
 *    Define version of operating system  based on target machine
 *
 *        MSDOS3 ==> PC-DOS 3.X
 *        XENIX3 ==> XENIX System 3
 *        XENIX5 ==> XENIX System 5
 *        UNIX_V ==> UNIX System V
 */

#ifdef UNIX68
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef UNIX86
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef ALPHA 
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef AEGIS
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef ALTO586
#   define XENIX3
#   define CPU8X086
#endif

#ifdef IBMAIX 
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef  SGI 
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef ALTO2086
#   define XENIX3
#   define CPU8X086
#endif

#ifdef ALTO386
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef SCOXENIX
#   include <memory.h>
#   define XENIX5
#   define CPU8X086
#endif

#ifdef SCOUNX
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef UNIXWARE
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef ATT3200
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef LINUX 
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU8X086
#   define _NFILE  NOFILE
#   define NOVALUEH
#   define MKSTEMP 
#endif

#ifdef INTERIX
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU8X086
#   define _NFILE  MAX_OPEN 
#   define NOVALUEH
#   define MKSTEMP 
#endif

#ifdef CYGWIN
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU8X086
#   define _NFILE  NOFILE
#   define NOVALUEH
#   define MKSTEMP 
#endif

#ifdef FREEBSD 
#   define UNIX_V
#   define CPU8X086
#   define NOVALUEH
#   define MKSTEMP 
#endif

#ifdef INTERACT
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef DATACHECK
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef UNI5000
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef UNI6000
#   define UNIX_V
#   define CPU8X086
#endif

#ifdef SUN3
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU680X0
#   define _NFILE  NOFILE
#endif

#ifdef SUNOS
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU680X0
#   define _NFILE  NOFILE
#   define iszero iszer0
#endif

#ifdef SUNSOLARIS
#   include <sys/param.h>
#   undef CMASK
#   define UNIX_V
#   define CPU680X0
#   define iszero iszer0
#endif

#ifdef ATT3B2
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef CPOINT
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef HP9800
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef HP9300
#   define UNIX_V
#   define CPU680X0
#endif


#ifdef NCR
#   define UNIX_V
#   define CPU680X0
#endif

#ifdef VAXC /* defined by VAX compiler */
    /* since most functions of vax C are similar to UNIX V define
     * UNIX V and handle exceptions with ifdef's within UNIX blocks
    */
#   define UNIX_V
#   define VAXVMS
#   define CPU8X086
#endif


#ifdef MSDOS3
#   undef MSDOS
#   define MSDOS
#   define CPU8X086
#endif

/*
 *    Define operating system based on operating system and machine:
 *
 *        MSDOS  ==> MS-DOS, PC-DOS, clones
 *        UNIX   ==> UNIX, XENIX, clones
 */


#ifdef XENIX3
#    ifndef UNIX
#    define UNIX
#    define LPCOMMAND "lpr"
#    endif
#endif

#ifdef XENIX5
#    ifndef UNIX
#    define UNIX
#    define MEMEXIST
#    endif
#endif

#ifdef UNIX_V
#    ifndef UNIX
#    define UNIX
#    endif
#    define MEMEXIST
#endif



#ifdef UNIX
#   ifdef VAXVMS
#        define CATCOMMAND "type"
#        define EDCOMMAND "edt"
#        define CPCOMMAND "copy"
#        define LPCOMMAND "print"
#        define TMP_DIR   "\0"
#        define unlink( A )  delete( A )
#   else
#        define CATCOMMAND "cat"
#        define EDCOMMAND "vi"
#        define CPCOMMAND "cp"
#        ifndef LPCOMMAND
#            define LPCOMMAND "lp"
#        endif
#        define TMP_DIR   "/tmp"
#   endif
#   ifndef PATHSLASH
#   define PATHSLASH "/"
#   endif
#   ifndef PATHDELIM
#   define PATHDELIM ':'
#   endif
#   ifndef O_BINARY
#       define O_BINARY 0x0000    /* meaningless for UNIX/XENIX  */
#   endif
#   define MODE_RAW 0666  /*  file creation mode (permission bits) */
#endif

#ifdef MSDOS
#   define CATCOMMAND "type"
#   define EDCOMMAND "e"
#   define CPCOMMAND "copy"
#   define TMP_DIR   "\0"
#   define MEMEXIST
#   define FMFLUSH    /* force flush upon saving - Data Entry Screens only */
#   ifndef PATHSLASH
#   define PATHSLASH "\\"
#   endif
#   ifndef PATHDELIM
#   define PATHDELIM ';'
#   endif
/* see fcntl.h for macro O_BINARY value */
#   define MODE_RAW  (0000200 | 0000400) /*  file creation mode Microsoft PCDOS only! */
                 /* see stat.h for macros (S_IREAD | S_IWRITE) values */
/* #  define MODE_RAW 0x8002 */    /*  Lattice with PCDOS only! */
#endif


#ifndef CMASK
#define CMASK 0377
#endif

#ifndef SHORTMASK
#define SHORTMASK 0177777
#endif

#ifndef SIGN_EXT
#define SIGN_EXT (CMASK != '\0377')    /* TRUE if sign-extension occurs */
#endif

#define MENUSHELL /* Define this so user may run shell commands from the menu */


#ifdef UNIX
#define CWPICSIZE 180000  /* this size is for LARGE size programs */
#endif
#ifdef MSDOS
#define CWPICSIZE 63000  /* this size is for LARGE size programs */
#endif
#define MAX_IDX  20 
#ifdef M_I86MM   /* MSDOS/SCO/ALTOS -  DEFAULT FOR MEDIUM COMPILER */
#   undef CWPICSIZE
#   define CWPICSIZE 19000  /* this size is for MEDIUM size programs */
#   undef MAX_IDX
#   define MAX_IDX  10
#endif

/* Maximum number of MAX/MIN aggregates allowed in a single SELECT list.
 */
#define MAX_MAXMIN	10

#ifdef FREEBSD
#include <stdlib.h>
#else
#include <malloc.h>
#endif

/* multi-threading */
#if defined( MSDOS ) || defined( ISDOSMSC )
    /* DOS/Windows */
#   ifdef _MT
        /* Thread Local Storage (TLS) macro */
#	define M_TLS  __declspec(thread)
#   else
#	define M_TLS
#   endif
#else
#   define M_TLS
#endif

#endif /* _SQPORT_H */
