📄 plibc.h
字号:
#define S_IXGRP 0#define S_IWOTH 0#define S_IXOTH 0#define S_ISUID 0#define S_ISGID 0#define S_ISVTX 0#define S_IRWXG 0#define S_IRWXO 0#define SetErrnoFromWinError(e) _SetErrnoFromWinError(e, __FILE__, __LINE__)/** * @brief index() - same as strchr() */#define index(s, c) strchr(s, c) BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest); BOOL _plibc_DereferenceShortcut (char *pszShortcut); char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags); char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags); long QueryRegistry (HKEY hMainKey, char *pszKey, char *pszSubKey, char *pszBuffer, long *pdLength); BOOL __win_IsHandleMarkedAsBlocking (SOCKET hHandle); void __win_SetHandleBlockingMode (SOCKET s, BOOL bBlocking); void __win_DiscardHandleBlockingMode (SOCKET s); int _win_isSocketValid (int s); int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows); typedef void (*TPanicProc) (int, char *); void plibc_set_panic_proc (TPanicProc proc); int flock (int fd, int operation); int fsync (int fildes); int inet_pton (int af, const char *src, void *dst); int inet_pton4 (const char *src, u_char * dst, int pton);#if USE_IPV6 int inet_pton6 (const char *src, u_char * dst);#endif int truncate (const char *fname, int distance); int statfs (const char *path, struct statfs *buf); const char *hstrerror (int err); void gettimeofday (struct timeval *tp, void *tzp); int mkstemp (char *tmplate); char *strptime (const char *buf, const char *format, struct tm *tm); char *ctime (const time_t * clock); char *ctime_r (const time_t * clock, char *buf); int plibc_init (char *pszOrg, char *pszApp); void plibc_shutdown (); int plibc_initialized (); int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows, int derefLinks); void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine); void SetErrnoFromWinsockError (long lWinError); void SetHErrnoFromWinError (long lWinError); void SetErrnoFromHRESULT (HRESULT hRes); FILE *_win_fopen (const char *filename, const char *mode); DIR *_win_opendir (const char *dirname); int _win_open (const char *filename, int oflag, ...);#ifdef ENABLE_NLS char *_win_bindtextdomain (const char *domainname, const char *dirname);#endif int _win_chdir (const char *path); int _win_close (int fd); int _win_creat (const char *path, mode_t mode); int _win_fstat (int handle, struct stat *buffer); int _win_pipe (int *phandles); int _win_rmdir (const char *path); int _win_access (const char *path, int mode); int _win_chmod (const char *filename, int pmode); char *realpath (const char *file_name, char *resolved_name); long _win_random (void); int _win_remove (const char *path); int _win_rename (const char *oldname, const char *newname); int _win_stat (const char *path, struct stat *buffer); int _win_stat64 (const char *path, struct stat64 *buffer); int _win_unlink (const char *filename); int _win_write (int fildes, const void *buf, size_t nbyte); int _win_read (int fildes, void *buf, size_t nbyte); size_t _win_fwrite (const void *buffer, size_t size, size_t count, FILE * stream); size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream); int _win_symlink (const char *path1, const char *path2); void *_win_mmap (void *start, size_t len, int access, int flags, int fd, unsigned long long offset); int _win_munmap (void *start, size_t length); int _win_lstat (const char *path, struct stat *buf); int _win_lstat64 (const char *path, struct stat64 *buf); int _win_readlink (const char *path, char *buf, size_t bufsize); int _win_accept (SOCKET s, struct sockaddr *addr, int *addrlen); int _win_printf (const char *format, ...); int _win_fprintf (FILE * f, const char *format, ...); int _win_vprintf (const char *format, va_list ap); int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr); int _win_vsprintf (char *dest, const char *format, va_list arg_ptr); int _win_vsnprintf (char *str, size_t size, const char *format, va_list arg_ptr); int _win_snprintf (char *str, size_t size, const char *format, ...); int _win_sprintf (char *dest, const char *format, ...); int _win_vsscanf (const char *str, const char *format, va_list arg_ptr); int _win_sscanf (const char *str, const char *format, ...); int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr); int _win_vscanf (const char *format, va_list arg_ptr); int _win_scanf (const char *format, ...); int _win_fscanf (FILE * stream, const char *format, ...); pid_t _win_waitpid (pid_t pid, int *stat_loc, int options); int _win_bind (SOCKET s, const struct sockaddr *name, int namelen); int _win_connect (SOCKET s, const struct sockaddr *name, int namelen); int _win_getpeername (SOCKET s, struct sockaddr *name, int *namelen); int _win_getsockname (SOCKET s, struct sockaddr *name, int *namelen); int _win_getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen); int _win_listen (SOCKET s, int backlog); int _win_recv (SOCKET s, char *buf, int len, int flags); int _win_recvfrom (SOCKET s, void *buf, int len, int flags, struct sockaddr *from, int *fromlen); int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds, const struct timeval *tv); int _win_send (SOCKET s, const char *buf, int len, int flags); int _win_sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen); int _win_setsockopt (SOCKET s, int level, int optname, const void *optval, int optlen); int _win_shutdown (SOCKET s, int how); SOCKET _win_socket (int af, int type, int protocol); struct hostent *_win_gethostbyaddr (const char *addr, int len, int type); struct hostent *_win_gethostbyname (const char *name); char *_win_strerror (int errnum); int IsWinNT ();#if !HAVE_STRNDUP char *strndup (const char *s, size_t n);#endif#if !HAVE_STRNLEN size_t strnlen (const char *str, size_t maxlen);#endif#define strcasecmp(a, b) stricmp(a, b)#define strncasecmp(a, b, c) strnicmp(a, b, c)#endif /* WINDOWS */#ifndef WINDOWS#define DIR_SEPARATOR '/'#define DIR_SEPARATOR_STR "/"#define PATH_SEPARATOR ';'#define PATH_SEPARATOR_STR ";"#define NEWLINE "\n"#ifdef ENABLE_NLS#define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n)#endif#define CREAT(p, m) creat(p, m)#undef FOPEN#define FOPEN(f, m) fopen(f, m)#define OPENDIR(d) opendir(d)#define OPEN(f) open(f)#define CHDIR(d) chdir(d)#define CLOSE(f) close(f)#define RMDIR(f) rmdir(f)#define ACCESS(p, m) access(p, m)#define CHMOD(f, p) chmod(f, p)#define FSTAT(h, b) fstat(h, b)#define PIPE(h) pipe(h)#define REMOVE(p) remove(p)#define RENAME(o, n) rename(o, n)#define STAT(p, b) stat(p, b)#define STAT64(p, b) stat64(p, b)#define UNLINK(f) unlink(f)#define WRITE(f, b, n) write(f, b, n)#define READ(f, b, n) read(f, b, n)#define GN_FREAD(b, s, c, f) fread(b, s, c, f)#define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f)#define SYMLINK(a, b) symlink(a, b)#define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o)#define MUNMAP(s, l) munmap(s, l)#define STRERROR(i) strerror(i)#define RANDOM() random()#define READLINK(p, b, s) readlink(p, b, s)#define LSTAT(p, b) lstat(p, b)#define LSTAT64(p, b) lstat64(p, b)#define PRINTF printf#define FPRINTF fprintf#define VPRINTF(f, a) vprintf(f, a)#define VFPRINTF(s, f, a) vfprintf(s, f, a)#define VSPRINTF(d, f, a) vsprintf(d, f, a)#define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a)#define _REAL_SNPRINTF snprintf#define SPRINTF sprintf#define VSSCANF(s, f, a) vsscanf(s, f, a)#define SSCANF sscanf#define VFSCANF(s, f, a) vfscanf(s, f, a)#define VSCANF(f, a) vscanf(f, a)#define SCANF scanf#define FSCANF fscanf#define WAITPID(p, s, o) waitpid(p, s, o)#define ACCEPT(s, a, l) accept(s, a, l)#define BIND(s, n, l) bind(s, n, l)#define CONNECT(s, n, l) connect(s, n, l)#define GETPEERNAME(s, n, l) getpeername(s, n, l)#define GETSOCKNAME(s, n, l) getsockname(s, n, l)#define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p)#define LISTEN(s, b) listen(s, b)#define RECV(s, b, l, f) recv(s, b, l, f)#define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o)#define SELECT(n, r, w, e, t) select(n, r, w, e, t)#define SEND(s, b, l, f) send(s, b, l, f)#define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n)#define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n)#define SHUTDOWN(s, h) shutdown(s, h)#define SOCKET(a, t, p) socket(a, t, p)#define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t)#define GETHOSTBYNAME(n) gethostbyname(n)#else#define DIR_SEPARATOR '\\'#define DIR_SEPARATOR_STR "\\"#define PATH_SEPARATOR ':'#define PATH_SEPARATOR_STR ":"#define NEWLINE "\r\n"#ifdef ENABLE_NLS#define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n)#endif#define CREAT(p, m) _win_creat(p, m)#define FOPEN(f, m) _win_fopen(f, m)#define OPENDIR(d) _win_opendir(d)#define OPEN(f) _win_open(f)#define CHDIR(d) _win_chdir(d)#define CLOSE(f) _win_close(f)#define FSTAT(h, b) _win_fstat(h, b)#define RMDIR(f) _win_rmdir(f)#define ACCESS(p, m) _win_access(p, m)#define CHMOD(f, p) _win_chmod(f, p)#define PIPE(h) _win_pipe(h)#define RANDOM() _win_random()#define REMOVE(p) _win_remove(p)#define RENAME(o, n) _win_rename(o, n)#define STAT(p, b) _win_stat(p, b)#define STAT64(p, b) _win_stat64(p, b)#define UNLINK(f) _win_unlink(f)#define WRITE(f, b, n) _win_write(f, b, n)#define READ(f, b, n) _win_read(f, b, n)#define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f)#define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f)#define SYMLINK(a, b) _win_symlink(a, b)#define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o)#define MUNMAP(s, l) _win_munmap(s, l)#define STRERROR(i) _win_strerror(i)#define READLINK(p, b, s) _win_readlink(p, b, s)#define LSTAT(p, b) _win_lstat(p, b)#define LSTAT64(p, b) _win_lstat64(p, b)#define PRINTF(f, ...) _win_printf(f , __VA_ARGS__)#define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)#define VPRINTF(f, a) _win_vprintf(f, a)#define VFPRINTF(s, f, a) _win_vfprintf(s, f, a)#define VSPRINTF(d, f, a) _win_vsprintf(d, f, a)#define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a)#define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__)#define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__)#define VSSCANF(s, f, a) _win_vsscanf(s, f, a)#define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__)#define VFSCANF(s, f, a) _win_vfscanf(s, f, a)#define VSCANF(f, a) _win_vscanf(f, a)#define SCANF(f, ...) _win_scanf(f, __VA_ARGS__)#define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__)#define WAITPID(p, s, o) _win_waitpid(p, s, o)#define ACCEPT(s, a, l) _win_accept(s, a, l)#define BIND(s, n, l) _win_bind(s, n, l)#define CONNECT(s, n, l) _win_connect(s, n, l)#define GETPEERNAME(s, n, l) _win_getpeername(s, n, l)#define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l)#define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p)#define LISTEN(s, b) _win_listen(s, b)#define RECV(s, b, l, f) _win_recv(s, b, l, f)#define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o)#define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t)#define SEND(s, b, l, f) _win_send(s, b, l, f)#define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n)#define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n)#define SHUTDOWN(s, h) _win_shutdown(s, h)#define SOCKET(a, t, p) _win_socket(a, t, p)#define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t)#define GETHOSTBYNAME(n) _win_gethostbyname(n)#endif#ifdef __cplusplus}#endif#endif //_PLIBC_H_/* end of plibc.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -