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>
|
2003-06-12 18:08:23 +00:00
|
|
|
#include <unistd.h>
|
2000-05-28 13:40:48 +00:00
|
|
|
#include "_file.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-14 00:02:47 +00:00
|
|
|
int __fastcall__ 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));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|