sample_os.h

来自「1. 8623L平台」· C头文件 代码 · 共 99 行

H
99
字号
#ifdef UNDER_CE#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <Winsock2.h>#define O_CREAT     1#define O_TRUNC     2#define O_WRONLY    4#define O_RDONLY    8#define O_LARGEFILE 0#define O_EXCL		0#define S_IRUSR		0#define S_IWUSR		0#define S_IRGRP		0#define S_IROTH		0#define S_IREAD		0#define S_IWRITE	0#define S_IRWXG		0#define S_IRWXO		0#define S_IRWXU		0// The following defines are used by access function below.#define R_OK        10 // check if the file has read permission#define W_OK        11 // check if the file has write permission#define X_OK        12 // check if the file has execute permission#define F_OK        13 // check if the file exists#define OPEN_FILE_FLAGS O_RDONLYint open(char *fileName, int flags, ...);int close(int fd);int write(int fd, void* buf, int size);int read(int fd, void* buf, int size);int lseek(int fd, long offset, int pos);int sleep(unsigned long sec);int usleep(unsigned long microsec);int gettimeofday(struct timeval *tv, struct timezone *tz);int access(char *binFileName, int mode);int strcasecmp(const char *s1, const char *s2);char *getenv(const char *name);#define fsync(x)#define assert(x) ASSERT(x)#define perror(x)#define bcmp(x,y,seed) strcmp(x,y)#define OUTPUT_DEBUG_STRING(x) OutputDebugString(x)#define snprintf(x)#define STDIN_FILENO 0#define fdopen _wfdopen#elif defined(WIN32)#include <stdio.h>#include <io.h>#include <FCNTL.H>#define O_LARGEFILE 0#define S_IRUSR		0#define S_IWUSR		0#define S_IRGRP		0#define S_IROTH		0#define S_IRWXU		0#define S_IRWXG		0#define S_IRWXO		0#include <stdlib.h>#include <string.h>#define OPEN_FILE_FLAGS (O_RDONLY | _O_BINARY)#define fsync(x)int sleep(int sec);int usleep(int microsec);int gettimeofday(struct timeval *tv, struct timezone *tz);int mkstemp(char *templt);#define snprintf	_snprintf#define write		_writestruct timeval {	long tv_sec;	long tv_usec;};#else#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <sys/time.h>#include <assert.h>#include <errno.h>#define OPEN_FILE_FLAGS (O_RDONLY)#endif

⌨️ 快捷键说明

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