#ifndef __CCUSTIO_H #define __CCUSTIO_H #ifndef DOS #include #include #endif #ifndef __CCOMMON_H #include "ccommon.h" #endif #ifndef __GENCONST_H #include "genconst.h" #endif #define BlockLenIO 512 #define Valid 0 #define Deleted 1 typedef char *FileName; typedef char *RecType; typedef long RecNoType; typedef struct { int F; FILE *Fd; int IOR; int LenRec; int BaseFil; unsigned LockMode; RecNoType lpos; PathSt name; /* @(!) 2.3.01.325 */ RecNoType lkpos; /* @(:) 2.3.01.325 */ } SecDef ; #ifdef DOS #define TESTLOCK(x) ((x) == 13 || (x) == 11) #define DEADLOCK(x) ((x) == EDEADLOCK) #else #define TESTLOCK(x) (((x) == EACCES) || ((x) == EGAIN) || ((x) == ENOLCK)) #define DEADLOCK(x) (((x) == EDEADLOCK) || ((x) == EDEADLK)) #endif #define BLOCKEXT(len,rec) (((((RecNoType) (len)) * ((RecNoType) (rec))) / BlockLenIO) + 1) /* @(!) 2.3.01.325 */ #ifdef DOS //#define ASPETTA(x) (sleep_dos(x)) #else //#define ASPETTA(x) (sleep(x)) #endif /* @(:) 2.3.01.325 */ #ifdef __cplusplus extern "C" { #endif void CLockRec(SecDef *, RecNoType, unsigned); void CVerify(SecDef *,char *); void COpen(SecDef *,char *, unsigned, unsigned, unsigned); void CCreate(SecDef *,char *,unsigned ,unsigned ,RecNoType); void CChsize(SecDef *,char *,unsigned ,unsigned ,RecNoType); void CClose(SecDef *); void CDelete(SecDef *,char *); void CRead(SecDef *,RecType,RecNoType ,unsigned ); void CWrite(SecDef *,RecType,RecNoType ,unsigned ); void IDeleteRec(RecType); void IRecallRec(RecType); BOOLEAN IRecIsDeleted(RecType); BOOLEAN ITestLock(int ); /* @(!) 2.3.01.325 modificata int excllock(char *,BOOLEAN);*/ /* @(!) 2.3.01.325 modificata int exclunlock(char *,BOOLEAN);*/ int excllock(char *,int); int exclunlock(char *,int); int sleep_dos(int); /* @(:) 2.3.01.325 */ BOOLEAN test_share(void); #ifdef __cplusplus }; #endif #endif /* __CCUSTIO_H */