-FILE* fdopen (int handle, const char* /*mode*/)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+FILE* __fastcall__ fdopen (int handle, const char* /*mode*/)
{
FILE* f;
-int fgetc (FILE* f)
+int __fastcall__ fgetc (FILE* f)
{
unsigned char c;
*/
+
#include <stdio.h>
-int fgetpos(FILE* f, fpos_t *pos)
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+int __fastcall__ fgetpos (FILE* f, fpos_t* pos)
{
*pos = ftell (f);
if (*pos != -1)
return 0;
- return 1;
+ return -1;
}
-char* fgets (char* s, unsigned size, FILE* f)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+char* __fastcall__ fgets (char* s, unsigned size, FILE* f)
{
int i = 0;
int c;
-int fputc (int c, FILE* f)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+int __fastcall__ fputc (int c, FILE* f)
{
/* 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) {
-FILE* freopen (const char* name, const char* mode, FILE* f)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+FILE* __fastcall__ freopen (const char* name, const char* mode, FILE* f)
{
/* Check if the file is open, if so, close it */
if ((f->f_flags & _FOPEN) == 0) {
*/
+
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "_file.h"
+
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
-int fseek(FILE* f, long offset, int whence)
+int __fastcall__ fseek (FILE* f, long offset, int whence)
{
long res;
/* Is the file open? */
if ((f->f_flags & _FOPEN) == 0) {
_errno = EINVAL; /* File not open */
- return 1;
+ return -1;
}
res = lseek(f->f_fd, offset, whence);
- if (res == -1L) return 1;
+ if (res == -1L) return -1;
return 0;
}
*/
+
#include <stdio.h>
-int fsetpos(FILE* f, const fpos_t *pos)
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+int __fastcall__ fsetpos (FILE* f, const fpos_t *pos)
{
return fseek (f, (fpos_t)*pos, SEEK_SET);
}
+
*/
+
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "_file.h"
-long ftell(FILE* f)
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+long __fastcall__ ftell (FILE* f)
{
long pos;
#include <stdio.h>
+#undef getchar /* This is usually declared as a macro */
-/* This is usually declared as a macro */
-#undef getchar
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
-int getchar (void)
+
+
+int __fastcall__ getchar (void)
{
return fgetc (stdin);
}
-char* gets (char* s)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+char* __fastcall__ gets (char* s)
{
int c;
int i = 0;
+
#include <stdio.h>
+#undef putchar /* This is usually declared as a macro */
-/* This is usually declared as a macro */
-#undef putchar
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
-int putchar (int c)
+
+
+int __fastcall__ putchar (int c)
{
return fputc (c, stdout);
}
-int puts (const char* s)
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+int __fastcall__ puts (const char* s)
{
static char nl = '\n';
*/
+
#include <stdio.h>
-void rewind(FILE* f)
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+void __fastcall__ rewind (FILE* f)
{
fseek(f, 0L, SEEK_SET);
clearerr(f);
}
+
#include <stdio.h>
#include "_scanf.h"
-
+
/*****************************************************************************/
-int vsscanf (const char* str, const char* format, va_list ap)
+int __fastcall__ vsscanf (const char* str, const char* format, va_list ap)
/* Standard C function */
{
struct indesc id;