2000-05-28 13:40:48 +00:00
|
|
|
/*
|
2014-06-30 09:10:35 +00:00
|
|
|
** int fputs (const char* s, FILE* f);
|
|
|
|
**
|
|
|
|
** Ullrich von Bassewitz, 11.08.1998
|
|
|
|
*/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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"
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-10 20:45:16 +00:00
|
|
|
int __fastcall__ fputs (const char* s, register 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) {
|
2013-05-09 11:56:54 +00:00
|
|
|
return EOF;
|
2000-05-28 13:40:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Write the string */
|
|
|
|
return write (f->f_fd, s, strlen (s));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|