Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

fLmd.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef MbsLmdStruct
00017 #define MbsLmdStruct
00018 
00019 #include <stdio.h>
00020 
00021 #include "sMbs.h"
00022 
00023 #ifndef FILEONLY
00024 #include "f_stccomm.h"
00025 #endif
00026 
00027 #define LMD__SUCCESS        0
00028 #define LMD__FAILURE        1
00029 #define LMD__CLOSE_ERR      3
00030 #define GETLMD__NOFILE      2
00031 #define GETLMD__NOLMDFILE   4
00032 #define GETLMD__EOFILE      5
00033 #define GETLMD__NOMORE      6
00034 #define GETLMD__NOBUFFER    7
00035 #define GETLMD__TOOBIG      8
00036 #define GETLMD__OUTOF_RANGE 9
00037 #define GETLMD__SIZE_ERROR 10
00038 #define LMD__TIMEOUT        50
00039 #define PUTLMD__FILE_EXIST  101
00040 #define PUTLMD__TOOBIG      102
00041 #define PUTLMD__OPEN_ERR    103
00042 #define PUTLMD__EXCEED      104
00043 #define PORT__TRANS         6000
00044 #define PORT__STREAM        6002
00045 
00046 typedef struct
00047 {
00048   FILE    *fFile;         /* file descripter or server No.    */
00049   int16_t *pBuffer;       /* pointer to internal buffer  */
00050   uint32_t iBufferWords;  /* internal buffer size      */
00051   uint32_t iLeftWords;    /* left words in buffer */
00052   uint32_t iInternHeader; /* has intern allocated header buffer */
00053   uint32_t iInternBuffer; /* has intern allocated buffer */
00054   uint32_t iElements;     /* events since open     */
00055   uint64_t iBytes;        /* bytes since open  */
00056   char     cFile[512];    /* channel name */
00057   uint32_t iSwap;
00058   uint32_t iVerbose;
00059   char     *cHeader;      /* header data buffer */
00060   uint32_t *pOffset4;     /* offset table */
00061   lmdoff_t *pOffset8;     /* long offset table */
00062   lmdoff_t oTableOffset;  /* greater zero when Long offset in file */
00063   uint32_t iOffsetSize;   /* Offset size, 4 or 8 [bytes] */
00064   uint32_t iOffsetEntries;/* offset table length */
00065   sMbsFileHeader *pMbsFileHeader;
00066   sMbsHeader     *pMbsHeader;
00067   struct s_tcpcomm  *pTCP;
00068   uint32_t iTCP;
00069   uint32_t iPort;
00070   uint32_t iTcpTimeout;
00071 } sLmdControl;
00072 
00073 sLmdControl * fLmdAllocateControl();
00074 uint32_t   fLmdPutOpen(sLmdControl*,char*,sMbsFileHeader*,uint32_t,uint32_t,uint32_t,uint32_t);
00075 uint32_t   fLmdPutElement(sLmdControl*,sMbsHeader*);
00076 uint32_t   fLmdPutBuffer(sLmdControl*, sMbsHeader*,uint32_t);
00077 uint32_t   fLmdPutClose(sLmdControl*);
00078 #ifndef FILEONLY
00079 uint32_t   fLmdConnectMbs(sLmdControl*,char*,uint32_t,uint32_t*);
00080 uint32_t   fLmdInitMbs(sLmdControl*,char*,uint32_t,uint32_t,uint32_t,uint32_t,uint32_t);
00081 uint32_t   fLmdGetMbsBuffer(sLmdControl*,sMbsBufferHeader*,uint32_t,uint32_t*,uint32_t*);
00082 uint32_t   fLmdGetMbsEvent(sLmdControl*,sMbsHeader**);
00083 uint32_t   fLmdCloseMbs(sLmdControl*);
00084 #endif
00085 uint32_t   fLmdGetOpen(sLmdControl*,char*,sMbsFileHeader*,uint32_t,uint32_t);
00086 uint32_t   fLmdGetBuffer(sLmdControl*,sMbsHeader*,uint32_t,uint32_t*,uint32_t*);
00087 int32_t    fLmdReadBuffer(sLmdControl*,char*,uint32_t);
00088 uint32_t   fLmdGetElement(sLmdControl*,uint32_t,sMbsHeader**);
00089 uint32_t   fLmdGetClose(sLmdControl*);
00090 void       fLmdPrintBufferHeader(uint32_t,sMbsBufferHeader*);
00091 void       fLmdPrintFileHeader(uint32_t,sMbsFileHeader*);
00092 void       fLmdPrintHeader(uint32_t,sMbsHeader*);
00093 void       fLmdPrintEvent(uint32_t,sMbsEventHeader*);
00094 void       fLmdPrintControl(uint32_t,sLmdControl*);
00095 void       fLmdVerbose(sLmdControl*,uint32_t);
00096 void       fLmdSwap4(uint32_t*,uint32_t);
00097 void       fLmdSwap8(uint64_t*,uint32_t);
00098 void       fLmdSetWrittenEndian(sLmdControl *,uint32_t);
00099 uint32_t   fLmdGetWrittenEndian(sLmdControl *);
00100 uint32_t   fLmdGetSwap(sLmdControl *);
00101 uint64_t   fLmdGetBytesWritten(sLmdControl *);
00102 
00103 #endif
00104 
00105 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:32 2008 for Go4-v3.04-1 by  doxygen 1.4.2