⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winos.h

📁 在VC6环境下开发
💻 H
字号:
/*
** This header file (together with is companion C source-code file
** "os.c") attempt to abstract the underlying operating system so that
** the eDb library will work on both POSIX and windows systems.
*/
#ifndef _eDb_OS_H_
#define _eDb_OS_H_

#include <windows.h>
#include <winbase.h>
/*
** Temporary files are named starting with this prefix followed by 16 random
** alphanumeric characters, and no file extension. They are stored in the
** OS's standard temporary file directory, and are deleted prior to exit.
** If eDb is being embedded in another program, you may wish to change the
** prefix to reflect your program's name, so that if your program exits
** prematurely, old temporary files can be easily identified. This can be done
** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line.
*/
#ifndef TEMP_FILE_PREFIX
#define TEMP_FILE_PREFIX "eDb_"
#endif
typedef struct OsFile OsFile;
	struct OsFile {
		HANDLE h;               /* Handle for accessing the file */
		int locked;             /* 0: unlocked, <0: write lock, >0: read lock */
	};
# if defined(_MSC_VER) || defined(__BORLANDC__)
    typedef __int64 off_t;
# else
#  if !defined(_CYGWIN_TYPES_H)
     typedef long long off_t;
#    if defined(__MINGW32__)
#      define	_OFF_T_
#    endif
#  endif
# endif

# define eDb_TEMPNAME_SIZE (MAX_PATH+50)
# define eDb_MIN_SLEEP_MS 1

int eDbOsDelete(const char*);
int eDbOsFileExists(const char*);
int eDbOsFileRename(const char*, const char*);
int eDbOsOpenReadWrite(const char*, OsFile*, int*);
int eDbOsOpenExclusive(const char*, OsFile*, int);
int eDbOsOpenReadOnly(const char*, OsFile*);
int eDbOsOpenDirectory(const char*, OsFile*);
int eDbOsTempFileName(char*);
int eDbOsClose(OsFile*);
int eDbOsRead(OsFile*, void*, int amt);
int eDbOsWrite(OsFile*, const void*, int amt);
int eDbOsSeek(OsFile*, off_t offset);
int eDbOsSync(OsFile*);
int eDbOsTruncate(OsFile*, off_t size);
int eDbOsFileSize(OsFile*, off_t *pSize);
int eDbOsReadLock(OsFile*);
int eDbOsWriteLock(OsFile*);
int eDbOsUnlock(OsFile*);
int eDbOsRandomSeed(char*);
int eDbOsSleep(int ms);
int eDbOsCurrentTime(double*);
void eDbOsEnterMutex(void);
void eDbOsLeaveMutex(void);
char *eDbOsFullPathname(const char*);
void eDbRandomness(int N, void *pBuf);

#endif /* _eDb_OS_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -