📄 subcalls.par.lib
字号:
SUBCALLS - routines for system functions with error checking efopen fopen with error checkefreopen freopen with error checkefdopen fdopen with error checkepopen popen with error checkefclose fclose with error checkepclose pclose with error checkefflush fflush with error checkeremove remove with error checkerename rename with error checkefseek fseek with error checkefseeko fseeko with error checkeftell ftell with error checkeftello ftello with error checketmpfile tmpfile with error checkerewind rewind (dummy sub)emkstemp mkstemp with error checkemalloc malloc with error checkerealloc realloc with error checkecalloc calloc with error checkefgetpos fgetpos with error checkefsetpos fsetpos with error checkefread fread with error checkefwrite fwrite with error checkFunction Prototypes:FILE *efopen(const char *file, const char *mode);FILE *efreopen(const char *file, const char *mode, FILE *stream1);FILE *efdopen(int fd, const char *mode);FILE *epopen(char *command, char *type);int efclose(FILE *stream);int epclose(FILE *stream);int efflush(FILE *stream);int eremove(const char *file);int erename(const char *oldfile, const char* newfile);int efseek(FILE *stream, off_t offset, int origin);void erewind(FILE *stream);long eftell(FILE *stream);off_t eftello(FILE *streem);int efseek(FILE *stream, off_t offset, int origin);FILE *etmpfile(void);void *emalloc(size_t size);void *erealloc(void *memptr, size_t size);void *ecalloc(size_t count, size_t size);int efgetpos(FILE *stream, fpos_t *position);int efsetpos(FILE *stream, const fpos_t *position);size_t efread(void *bufptr, size_t size, size_t count, FILE *stream);size_t efwrite(void *bufptr, size_t size, size_t count, FILE *stream);Returns: All abort with message on errorefopen returns a FILE pointerefreopen returns a FILE pointerefdopen returns a FILE pointerefclose returns 0efflush returns 0eremove returns 0erename returns 0efseek returns 0efseeko returns 0erewind is voideftell returns file position indicatoreftello returns file position indicatoretmpfile returns a FILE pointeremalloc returns void pointer to allocated memoryerealloc returns void pointer to allocated memoryecalloc returns void pointer to allocated memoryefgetpos returns 0efsetpos returns 0efread returns number of items actually readefwrite returns number of items actually writtenNotes:Getting less than the number of bytes asked for on a freadis *not* a system subroutine error--usually it just meansend of file has been reached. However, it *might* be an errorin some application. Similarly coming up empty is not a systemerror, but might be an application error. It is left to the userto trap these instances. In particular, feof can be used to testfor end of file.References: Rochkind, "Advanced UNIX Programming"Kernighan and Pike, "The UNIX Programming Environment"Kernighan and Ritchie, "The C Programming Language"Mark Williams Company, "ANSI C--A Lexical Guide"Authors: SEP: Rick Ottolini, Ron, Jon Claerbout, Stew LevinCWP: Shuki Ronen, Jack Cohen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -