TOC PREV NEXT INDEX

Put your logo here!


A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z

5 INCLUDE FILES

5.1 dxf.h

#ifndef DXF_H
#define DXF_H
/*******************************************************************************
* E.S.O. - VLT project
#
# "@(#) $Id: dxf.h,v 2.51 2004/11/22 13:55:28 vltsccm Exp $"
*
* dxf.h
*
* who when what
* ------------ -------- ----------------------------------------------
* E. Allaert &
* J. Knudstrup 21/03/94 Preliminary version.
* J. Knudstrup 08.04.94 Included compression facility (Lemp.-Ziv).
* J. Knudstrup 27.04.94 Introduced changes decided on dxf SW Design Review
* Meeting (26.04.94).
* J. Knudstrup 06.07.94 Introduced compression subroutine "dxfFinCompress()"/
* "dxfFinDecompress()".
* J. Knudstrup 18.01.95 Changed interface + protocol for dxf (version 2.0),
* to include support of Header and Trailer Data.
* J. Knudstrup 04.05.95 Omitted usage of static variables in dxfSendData().
*/

/************************************************************************
* This file is the interface file for the INS Common Software
*
* Data Transfer Library - dxf
*
*----------------------------------------------------------------------
*/

#ifdef __cplusplus
extern "C" {
#endif

/* Header files
*/
#include "msg.h"

/* Macro definitions
*/
#define dxfMODULE_NAME "dxf"
#define dxfMAX_NO_EMPTY_MSG 50
#define dxfMAX_PAR_TRANS 10
#define dxfCON_CREATION_TIMEOUT 10000
#define dxfMSG_TRANSFER_SIZE 10000 /* Must be dividable through 8 (B) */

/* For "dxfFinCompress()"/"dxfFinDecompress()"
*/
#define INDEX(p1,p2) (((unsigned)(unsigned char)p1<<7)^(unsigned char)p2)

/* Size (in bytes) of the overall dxf fixed compression header. This does not
* include possible headers for the compressed data
*/
#define dxfCOMPR_HD_SIZE (5 * sizeof(vltINT32))

#define dxfCOMPR_BUF_HD_ROOM 1.25 /* 25 % head room for the compressed data */
/* buffer */

#undef __FILE_LINE__
#ifndef __FILE_LINE__
#define _dxf_tostr(a) #a
#define _dxf_tostr_pass2(a) _dxf_tostr(a)
#define __FILE_LINE__ __FILE__ ":" _dxf_tostr_pass2(__LINE__)
#endif


/* structures and defines for socket connection */
/*#define msgSOCK_SIZE 32768
#define msgCONNECT_CMD "MSGOCON" */

/* Data types
*/
typedef struct {
char hostName[128];
ccsENVNAME envName;
ccsPROCNAME procName;
} dxfCON_HANDLE;

typedef struct {
msgPROCESSID orgId; /* Command originator's process ID */
msgCMDID commandId; /* Originating command ID */
msgCMD command; /* Originating command */
msgTIMEOUT receiveTimeout; /* Timeout in milliseconds used by the caller
in dxfRecvData() */
vltLOGICAL useTimeout; /* Flag if receiveTimeout should be used. If
FALSE, it is set to dxfCON_CREATION_TIMEOUT */
} dxfORGCALL;

typedef enum {
dxfDO_COMPRESSION = 0, /* Decompress the data */
/* Used by the dxfLempZiv() subrou- */
/* tine and it MUST be 0!! */
dxfDO_DECOMPRESSION = 1 /* Compress the data */
/* Used by the dxfLempZiv() subrou- */
/* tine and it MUST be 1!! */
} dxfCOMPR_DECOMPR;

typedef enum {
dxfDONT_DECOMPRESS = 1, /* Do not decompress a compressed */
/* data buffer received */
dxfDECOMPRESS /* Decompress a compressed data buf- */
/* fer received */
} dxfDECOMPR_PERMIS;

typedef enum {
dxfFORWARD_COMPR = 1, /* Indicates for dxfSendData() that */
/* data is already compressed and */
/* should just be forwarded compressed */
dxfNOT_DEF = 2, /* Indicates that a compression indication */
/* variable has not yet been defined */
dxfPSEUDO_COMPR = 3, /* Indicates that data was tried */
/* compressed, but was not compressed */
/* anyway so data was sent uncompressed */
/* just with the compression header added */
dxfSEVERAL = 4, /* Indicates that several compression */
/* methods have been used */
dxfSHORT = 5, /* Yields best size-compression */
dxfFAST = 6, /* The quickest one */
dxfNO_COMPR = 7, /* No compression used */
dxfLEMP_ZIV = 100, /* A Lempel-Ziv algorithm based */
/* compressordecompressor */
dxfFIN_COMPR = 101 /* A public domain compressor - */
/* method unknown */
} dxfCOMPR_TYPE;

typedef enum {
dxfALL_DATA_TYPES = 1,
dxfINDIVIDUAL
} dxfDATA_TYPE;

typedef enum {
dxfSINGLE_MSG = 1,
dxfALL_MSG
} dxfDATA_RECEP_TYPE;

/* Structure type definitions
*/

typedef struct {
dxfCOMPR_TYPE request; /* Requested compression */
dxfCOMPR_TYPE done; /* Compression algorithm employed */
vltUINT32 unComprSize; /* Size of the uncompressed data */
vltUINT32 comprSize; /* Size of the compressed data, */
/* including the various compression */
/* headers */
} dxfCOMPRESS;

/* Structure to handle Header Data Info
*/
typedef struct {
char *buffer; /* Buffer to data to send/received */
vltLOGICAL send; /* Indicates if trailer should be */
/* send or not (ccsTRUE = send) */
vltUINT32 bufLen; /* Bytes to send/received */
vltLOGICAL done; /* Indicates if the reception of the */
/* Trailer Message has been completed */
} dxfHEADER_INFO;


/* Structure to handle Send Data Info
*/
typedef struct {
char *buffer; /* Pointer to buffer to send */
vltUINT32 bufLen; /* Length of buffer to send */
vltUINT32 totalBufLen; /* Total amount of data to send */
dxfCOMPRESS compressInfo; /* Information about compression to */
/* use */
} dxfSEND_DATA_INFO;

/* Structure to handle Receive Data Info
*/
typedef struct {
dxfDECOMPR_PERMIS deCompress; /* Indicates if data can be */
/* decompressed */
dxfDATA_RECEP_TYPE recvType; /* Receive single messages or all in */
/* one batch */
vltLOGICAL done; /* Indicates if the reception of data */
/* has been completed */
vltUINT32 expLen; /* Expected length of data */
/* (uncompressed) */
vltUINT32 lenRecv; /* Length received so far */
/* (uncompressed) */
char *buffer; /* Pointer to buffer containing */
/* uncompressed data */
vltUINT32 bufLen; /* Length of uncompressed data */
char *comprBuf; /* Points to buffer containing */
/* possible compressed data */
vltUINT32 comprBufLen; /* Length of compressed buffer */
dxfCOMPRESS compressInfo; /* Indicates type of compression used */
} dxfRECV_DATA_INFO;

/* Structure to handle Trailer Data Info
*/
typedef struct {
char *buffer; /* Buffer to data to send/received */
vltLOGICAL send; /* Indicates if trailer should be */
/* send or not (ccsTRUE = send) */
vltUINT32 bufLen; /* Length of postfix buffer */
vltLOGICAL done; /* Indicates if the reception of the */
/* Trailer Message has been completed */
} dxfTRAILER_INFO;

/* Structure used by dxfSendData() to handle several, parallel data transfers
* (needed on the LCU since static variables are global)
*/
typedef struct {
vltUINT8 inUse;

msgSOCK_DESC sockDesc;
msgPROCESSID orgId;

vltUINT8 dataBlock;
vltUINT8 sendHeader;
vltUINT8 sendTrailer;
vltUINT8 dataSending;
vltUINT32 dataBytesSent;
vltUINT32 dataBytesToSend;

dxfHEADER_INFO headerMsg;
dxfSEND_DATA_INFO data;
dxfTRAILER_INFO trailerMsg;
} dxfTRANS_ADMIN;

/* Function prototyping
*/
ccsCOMPL_STAT dxfSendData(dxfDATA_TYPE transferType,
dxfHEADER_INFO *headerMsg,
dxfSEND_DATA_INFO *data,
dxfTRAILER_INFO *trailerMsg,
dxfORGCALL *origCaller,
ccsERROR *error);

ccsCOMPL_STAT dxfRecvData(dxfDATA_TYPE transferType,
dxfHEADER_INFO *headerMsg,
dxfRECV_DATA_INFO *data,
dxfTRAILER_INFO *trailerMsg,
msgTIMEOUT timeOut,
vltLOGICAL *done,
dxfCON_HANDLE *conHandle,
ccsERROR *error);

ccsCOMPL_STAT dxfCompress(dxfCOMPRESS *compressInfo,
char *unComprBuf,
char *comprBuf,
ccsERROR *error);


ccsCOMPL_STAT dxfDecompress(dxfCOMPRESS *compressInfo,
dxfDECOMPR_PERMIS deCompress,
char *comprBuf,
char *unComprBuf,
ccsERROR *error);

long dxfLempZiv(char *InIma,
char *OutIma,
long length,
short do_decomp);

msgLENGTH dxfFinCompress(char *inputBuf,
msgLENGTH inputBufLen,
char *outputBuf);

msgLENGTH dxfFinDecompress(char *inputBuf,
msgLENGTH inputBufLen,
char *outputBuf);


#ifdef __cplusplus
}
#endif

#endif /*!DXF_H*/
















5.2 dxfFileTransfer.h

#ifndef dxfFileTransfer_H
#define dxfFileTransfer_H
/*******************************************************************************
* E.S.O. - VLT project
*
* "@(#) $Id: dxfFileTransfer.h,v 2.42 2002/02/01 17:07:57 vltsccm Exp $"
*
* who when what
* -------- -------- ----------------------------------------------
* dimarcan 23/01/00 created
*/

/************************************************************************
*
*----------------------------------------------------------------------
*/

#ifdef __cplusplus
extern "C" {
#endif



ccsCOMPL_STAT dxfFileTransfer (const char * sourceFile,
const char * destEnv,
const char * destFile,
const char * sourcePath,
const char * destPath,
ccsERROR * error);

#ifdef __cplusplus
}
#endif

#endif /*!dxfFileTransfer_H*/




Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX