ReactOS 0.4.16-dev-2104-gb84fa49
fcons.c File Reference
#include "schilyio.h"
Include dependency graph for fcons.c:

Go to the source code of this file.

Functions

EXPORT FILE_fcons (FILE *fd, int f, int flag)
 

Variables

LOCAL charfmtab []
 

Function Documentation

◆ _fcons()

EXPORT FILE * _fcons ( FILE fd,
int  f,
int  flag 
)

Definition at line 53 of file fcons.c.

57{
58 int my_gflag = _io_glflag;
59
60 if (fd == (FILE *)NULL)
61 fd = fdopen(f,
63
64 if (fd != (FILE *)NULL) {
65 if (flag & FI_APPEND) {
66 (void) fseek(fd, (off_t)0, SEEK_END);
67 }
68 if (flag & FI_UNBUF) {
69 setbuf(fd, NULL);
70 my_gflag |= _JS_IOUNBUF;
71 }
72 set_my_flag(fd, my_gflag); /* must clear it if fd is reused */
73 return (fd);
74 }
75 if (flag & FI_CLOSE)
76 close(f);
77
78 return ((FILE *)NULL);
79}
#define close
Definition: acwin.h:98
#define SEEK_END
Definition: cabinet.c:29
#define NULL
Definition: types.h:112
int CDECL fseek(FILE *file, __msvcrt_long offset, int whence)
Definition: file.c:1610
void CDECL setbuf(FILE *file, char *buf)
Definition: file.c:5046
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl static FILE * fdopen(int fd, const char *mode)
Definition: stdio.h:480
__kernel_off_t off_t
Definition: linux.h:201
LOCAL char * fmtab[]
Definition: fcons.c:24
EXPORT int _io_glflag
Definition: flag.c:31
GLfloat f
Definition: glext.h:7540
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define FI_BINARY
Definition: schilyio.h:87
#define _JS_IOUNBUF
Definition: schilyio.h:100
#define FI_APPEND
Definition: schilyio.h:88
#define FI_READ
Definition: schilyio.h:85
#define set_my_flag(p, v)
Definition: schilyio.h:140
#define FI_UNBUF
Definition: schilyio.h:92
#define FI_CLOSE
Definition: schilyio.h:93
#define FI_WRITE
Definition: schilyio.h:86
static int fd
Definition: io.c:51

Referenced by fileopen().

Variable Documentation

◆ fmtab

LOCAL char* fmtab[]
Initial value:
= {
"",
"r",
"w",
"r+",
"b",
"rb",
"wb",
"r+b",
"",
"r",
"a",
"a+",
"b",
"rb",
"ab",
"a+b",
}

Definition at line 24 of file fcons.c.

Referenced by _fcons().