ReactOS 0.4.16-dev-106-g10b08aa
fstream_stdio.cpp File Reference
#include <fstream>
#include <cstdio>
#include <sys/stat.h>
Include dependency graph for fstream_stdio.cpp:

Go to the source code of this file.

Macros

#define FOPEN   fopen
 
#define FSEEK   fseek
 
#define FSTAT   fstat
 
#define STAT   stat
 
#define FTELL   ftell
 

Functions

static _STLP_MOVE_TO_PRIV_NAMESPACE bool __is_regular_file (_STLP_fd fd)
 
static streamoff __file_size (_STLP_fd fd)
 

Variables

const _STLP_fd INVALID_STLP_FD = -1
 

Macro Definition Documentation

◆ FOPEN

#define FOPEN   fopen

Definition at line 111 of file fstream_stdio.cpp.

◆ FSEEK

#define FSEEK   fseek

Definition at line 112 of file fstream_stdio.cpp.

◆ FSTAT

#define FSTAT   fstat

Definition at line 113 of file fstream_stdio.cpp.

◆ FTELL

#define FTELL   ftell

Definition at line 115 of file fstream_stdio.cpp.

◆ STAT

#define STAT   stat

Definition at line 114 of file fstream_stdio.cpp.

Function Documentation

◆ __file_size()

static streamoff __file_size ( _STLP_fd  fd)
static

Definition at line 134 of file fstream_stdio.cpp.

134 {
135 streamoff ret = 0;
136
137 struct STAT buf;
138 if (FSTAT(fd, &buf) == 0 && (buf.st_mode & S_IFREG) != 0)
139 ret = buf.st_size > 0 ? buf.st_size : 0;
140
141 return ret;
142}
off_t streamoff
Definition: char_traits.h:74
#define S_IFREG
Definition: ext2fs.h:361
#define STAT
#define FSTAT
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static int fd
Definition: io.c:51
int ret

Referenced by _Filebuf_base::_M_file_size().

◆ __is_regular_file()

static _STLP_MOVE_TO_PRIV_NAMESPACE bool __is_regular_file ( _STLP_fd  fd)
static

Definition at line 128 of file fstream_stdio.cpp.

128 {
129 struct STAT buf;
130 return FSTAT(fd, &buf) == 0 && (buf.st_mode & S_IFREG) != 0 ;
131}

Referenced by _Filebuf_base::_M_open().

Variable Documentation

◆ INVALID_STLP_FD

const _STLP_fd INVALID_STLP_FD = -1

Definition at line 85 of file fstream_stdio.cpp.