cui nomen inditum est Victorius XXXII Aggiunte maschere senza handler statici, TAutomask Tolto file inutile libdefs.h Megafigata per un significativo speed-up dei TCursori git-svn-id: svn://10.65.10.50/trunk@6304 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			82 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
#ifndef __CCUSTIO_H
 | 
						|
#define __CCUSTIO_H
 | 
						|
 | 
						|
#ifndef DOS
 | 
						|
#include        <unistd.h>
 | 
						|
#include        <errno.h>
 | 
						|
#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 */
 |