2000-05-28 13:40:48 +00:00
|
|
|
/*
|
|
|
|
* int fputs (const char* s, FILE* f);
|
|
|
|
*
|
|
|
|
* Ullrich von Bassewitz, 11.08.1998
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include "_file.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-08-13 16:16:49 +00:00
|
|
|
int fputs (const char* s, FILE* f)
|
2000-05-28 13:40:48 +00:00
|
|
|
{
|
|
|
|
/* Check if the file is open or if there is an error condition */
|
|
|
|
if ((f->f_flags & _FOPEN) == 0 || (f->f_flags & (_FERROR | _FEOF)) != 0) {
|
2002-03-24 13:26:18 +00:00
|
|
|
return EOF;
|
2000-05-28 13:40:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Write the string */
|
|
|
|
return write (f->f_fd, s, strlen (s));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|