tldm-universe/Ardent/UV/gcidir/include/api_server.h
2024-09-09 17:51:08 -04:00

217 lines
5.9 KiB
C
Executable File

/******************************************************************************
*
* api_server.h - include file for the Intercall server
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 10/02/98 23765 CSM Bump up comms version
* 09/26/98 23727 DTM Added DataSet functionality - correct compiler warn.
* 09/25/98 23727 DTM Added DataSet functionality
* 04/01/98 22815 RJE Added Teminos security functionality
* 03/27/97 20104 DW Updated cs_version for NLS functionality.
* 08/06/96 18983 DJD Changed APIGA flag to GGA (for NY cancel)
* 06/14/96 18584 DJD Added support for lan pipes.
* 05/21/96 18451 DJD Port To NT
* 04/23/96 18115 DJD Added SERVERNAME token.
* 03/28/96 18208 AGM Fix EINTR error checking on read/write/select
* 03/27/96 18189 DJD Added new version stamps
* 03/02/95 18025 DJD Functions for ic_cancel support.
* 11/13/95 17162 DJD Sent COMMS & CS VERSION to correct setting.
* 11/08/95 17162 DJD Added changes for login code.
* 10/26/95 17162 DJD Changes needed for new execute.
* 08/18/95 17162 GMM Modified to add to main uniVerse source
* 11/21/94 16300 DJD Initial code creation.
*
******************************************************************************/
/* define our fileid/session id split */
#define PARSEHANDLE(Session, FileIDOnly, FID) ((Session) = ((FID) >> 16)), (FileIDOnly = ((FID)))
/* Execute define tokens */
#define ENDOFEXEC 1
#define APINORMAL 1
#define APIEND 2
#define APIINPUT 3
#define ICCANCEL 68
/* File type tokens */
#define HASHED 1
#define SEQ 2
/* Server token name */
#define SERVERNAME "uvcs"
#ifdef MSWIN
#define HOSTTYPE 2
#else
#define HOSTTYPE 1
#endif
/* DataSet tokens */
#define DS_BUF_SIZE 512
#define DS_FARRAY_SIZE 128
#define DS_FIELD_NUM 0
#define DS_FIELD_NAME 1
#define DS_READ_OP 1
#define DS_WRITE_OP 2
#define DS_SUCCESS_WITH_INFO 88888
/* Used to tack on a string to either the ReturnSet or StatusSet values */
#define ADDCODE( x, y, z ) {\
/* Tack on return code */\
while ( (x.len + 10) >= z )\
{\
z += DS_BUF_SIZE;\
x.text=(uchar*)Rrealloc(x.text, z);\
}\
/* If no return code, tack on known string */\
if ( !y )\
{\
x = STRcat( x, ZeroString );\
}\
else\
{\
/* Figure out what string should be */\
STRING code;\
code = uvitoa( y );\
retval = DS_SUCCESS_WITH_INFO;\
x = STRcat( x, code );\
}\
x = STRcat( x, SMSTR );\
}
#define ADDCODEPTR( x, y, z ) {\
/* Tack on return code */\
while ( (x->len + 10) >= z )\
{\
z += DS_BUF_SIZE;\
x->text= (uchar*)Rrealloc(x->text, z);\
}\
/* If no return code, tack on known string */\
if ( !y )\
{\
*x = STRcat( *x, ZeroString );\
}\
else\
{\
/* Figure out what string should be */\
STRING code;\
code = uvitoa( y );\
retval = DS_SUCCESS_WITH_INFO;\
*x = STRcat( *x, code );\
}\
*x = STRcat( *x, SMSTR );\
}
/* Command execution on login tokens */
#define MAX_COMMAND_LEN 512
#define EXEC_LOGIN_FILE "UVCSLoginCommand"
#define DEF_COMMAND_BUFF_SIZE 1024
typedef struct FileControl {
int slot;
int OpenType;
union {
DBFILE * HashPointer;
SEQFILE * SeqPointer;
} FilePtr;
} FILECONTROL;
typedef struct fieldStatusStruct {
int fieldNumber;
int status;
} FIELDARRAY;
/* define the go ahead (APIGA) token */
#define APIGA "GGA"
/* declare our global variables for using the RPC */
EXTERN int num_args_read;
EXTERN uvrpcdata args_read[MAX_NUM_RPC_ARGS];
EXTERN int connect_number;
EXTERN char *ProcName;
/* declare our global variables for the file table strcuctures/routines */
EXTERN int NextFileID;
EXTERN FILECONTROL *OpenFileTable;
EXTERN int GetNextFileID();
EXTERN int ICFileOpenCheck();
/* other prototypes */
#if COMPUTER == WINNT
EXTERN int clattach(int);
EXTERN STRING dyn_replace();
EXTERN STRING dyn_extract(STRING, int, int, int);
EXTERN STRING dyn_insert(STRING, int, int, int, STRING);
EXTERN STRING dyn_delete(STRING, int, int, int);
EXTERN STRING iconv(STRING, STRING, int*);
EXTERN STRING oconv(STRING, STRING, int*);
EXTERN STRING format(STRING, STRING, int*);
EXTERN STRING lower(STRING);
EXTERN STRING UVraise(STRING);
EXTERN STRING DBslock(DBFILE*, STRING, int*);
EXTERN char * res_list(STRING, int*, int*);
EXTERN void subr_store(PROGRAM*, DATUM*);
#else
EXTERN int clattach();
EXTERN STRING dyn_replace();
EXTERN STRING dyn_extract();
EXTERN STRING dyn_insert();
EXTERN STRING dyn_delete();
EXTERN STRING iconv();
EXTERN STRING oconv();
EXTERN STRING format();
EXTERN STRING lower();
EXTERN STRING UVraise();
EXTERN STRING DBslock();
EXTERN char * res_list();
EXTERN void subr_store();
EXTERN STRING get_data_pending();
#endif
EXTERN STRING DICT;
/* global defs */
EXTERN int connected;
EXTERN int status;
EXTERN int max_files;
EXTERN int MaxSelectEntries;
EXTERN long lProcessId;
EXTERN char inBuf[];
EXTERN char outBuf[];
EXTERN int bytesRead;
EXTERN int retCode;
EXTERN FILECONTROL * OpenFileTable;
EXTERN DBFILE **OldOpenFileTable;
EXTERN SELFILE **OpenSelectTable;
EXTERN uchar udict[];
EXTERN STRING DICT;
#define BASE_CS_VERSION 2
#define CS_VERSION 6
#define BASE_COMMS_VERSION 2
#define COMMS_VERSION 4
/* specific versions of CS_VERSION */
#define TEMENOS_VERS 5
/* specific versions of COMMS_VERSION */
#define DEV_LICENSING 4
/* End of File */