IO之Standard IO

原创
08/07 12:51
阅读数 83

欢迎关注VxWorks567

如转发,请标明出处!

VxWorks provides a standard I/O package (stdio.h) with full ANSI C support that is compatible with the UNIX and Windows standard I/O packages.
/* ANSI */
/* * open a file specified by name * r : open text file for reading * w : truncate to zero length or create text file for writing * a : append; open or create text file for writing at end-of-file * rb : open binary file for reading * wb : truncate to zero length or create binary file for writing * ab : append; open or create binary file for writing at end-of-file * r+ : open text file for update (reading and writing) * w+ : truncate to zero length or create text file for update. * a+ : append; open or create text file for update, writing at end-of-file * r+b: * rb+: open binary file for update (reading and writing) * w+b: * wb+: truncate to zero length or create binary file for update * a+b: * ab+: append; open or create binary file for update, writing at end-of-file */FILE *fopen(char *, char *mode);
/* used to attach the already-open streams to other files */FILE *freopen(char *, char *, FILE *);
/* close a stream */int fclose(FILE *);
/* read data into an array */size_t fread(void *, size_t, size_t, FILE *);
/* return the next character from a stream */int fgetc(FILE *);int getc(FILE *);/* return the next character from the standard input stream */int getchar();
/* read a specified number of characters from a stream */char *fgets(char *, int, FILE *);
/* read characters from the standard input stream */char *gets(char *);
/* write from a specified array */size_t fwrite(void *, size_t, size_t, FILE *);
/* write a character to a stream */int fputc(int, FILE *);int putc(int, FILE *);/* write a character to the standard output stream */int putchar(int);
/* write a string to a stream */int fputs(char *, FILE *);
/* write a string to the standard output stream */int puts(char *);
/* push a character back into an input stream */int ungetc(int, FILE *);
/* flush a stream */int fflush(FILE *);
/* set the file position indicator for a stream */int fseek(FILE *, long, int);
/* set the file position indicator to the beginning of a file */void rewind(FILE *);
/* return the current value of the file position indicator for a stream */long ftell(FILE *);
/* store the current value of the file position indicator for a stream */int fgetpos(FILE *, fpos_t *);
/* set the file position indicator for a stream */int fsetpos(FILE *, fpos_t *);
/* generate a temporary file name */char *tmpnam(char *);
/* test the end-of-file indicator for a stream */int feof(FILE *);
/* test the error indicator for a file pointer */int ferror(FILE *);
/* map an error number in `errno' to an error message */void perror(char *);
/* clear end-of-file and error flags for a stream */void clearerr(FILE *);
/* * specify buffering for a stream * * mode * _IOFBF : input/output is to be fully buffered. * _IOLBF :input/output is to be line buffered. * _IONBF :input/output is to be unbuffered. */int setvbuf(FILE *, char *, int mode, size_t);/* specify the buffering for a stream */void setbuf(FILE *, char *);
/* POSIX 1003 */
/* open a file specified by a file descriptor */FILE *fdopen(int, char *);
/* return the file descriptor for a stream */int fileno(FILE *);
/* change the name of a file */int rename (char *, char *);
/* WRS stdio functions declarations */
/* read the next word (32-bit integer) from a stream */int getw(FILE *);
/* write a word (32-bit integer) to a stream */int putw(int, FILE *);
/* specify buffering for a stream */void setbuffer(FILE *, char *, size_t);
/* set line buffering for standard output or standard error */int setlinebuf(FILE *);
/* return the standard input/output/error FILE of the current task */FILE *stdioFp(int std);
/* display file pointer internals */STATUS stdioShow(FILE * fp, int level);


我是泰山 专注VX 0x10

一起学习 共同进步

本文分享自微信公众号 - 这里只有VxWorks(VxWorks567)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部