ReactOS 0.4.16-dev-329-g9223134
cvmod.c File Reference
#include "schilyio.h"
Include dependency graph for cvmod.c:

Go to the source code of this file.

Macros

#define O_BINARY   0
 
#define O_LARGEFILE   0
 

Functions

EXPORT int _cvmod (char *mode, int *omode, int *flag) const
 

Macro Definition Documentation

◆ O_BINARY

#define O_BINARY   0

Definition at line 20 of file cvmod.c.

◆ O_LARGEFILE

#define O_LARGEFILE   0

Definition at line 23 of file cvmod.c.

Function Documentation

◆ _cvmod()

EXPORT int _cvmod ( char mode,
int omode,
int flag 
) const

Definition at line 27 of file cvmod.c.

31{
32 while (*mode) {
33 switch (*mode) {
34
35 case 'r': *omode |= O_RDONLY; *flag |= FI_READ; break;
36 case 'w': *omode |= O_WRONLY; *flag |= FI_WRITE; break;
37 case 'e': *omode |= O_EXCL; break;
38 case 'c': *omode |= O_CREAT; *flag |= FI_CREATE; break;
39 case 't': *omode |= O_TRUNC; *flag |= FI_TRUNC; break;
40 case 'a': *omode |= O_APPEND; *flag |= FI_APPEND; break;
41 case 'u': *flag |= FI_UNBUF; break;
42 /* dummy on UNIX */
43 case 'b': *omode |= O_BINARY; *flag |= FI_BINARY; break;
44 /*
45 * XXX do we need this ?
46 * XXX May this be a problem?
47 */
48 case 'l': *omode |= O_LARGEFILE; break;
49 default: raisecond(_badmode, 0L);
50 return (0);
51 }
52 mode++;
53 }
54 if (*flag & FI_READ && *flag & FI_WRITE) {
55 *omode &= ~(O_RDONLY|O_WRONLY);
56 *omode |= O_RDWR;
57 }
58 return (1);
59}
#define O_WRONLY
Definition: acwin.h:111
#define O_CREAT
Definition: acwin.h:110
#define O_RDONLY
Definition: acwin.h:108
#define O_TRUNC
Definition: acwin.h:112
#define O_LARGEFILE
Definition: cvmod.c:23
#define O_BINARY
Definition: cvmod.c:20
char _badmode[]
Definition: dat.c:18
GLenum mode
Definition: glext.h:6217
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 O_EXCL
Definition: fcntl.h:40
#define O_RDWR
Definition: fcntl.h:36
#define O_APPEND
Definition: fcntl.h:37
#define L(x)
Definition: ntvdm.h:50
EXPORT void raisecond(char *signame, long arg2) const
Definition: raisecond.c:100
#define FI_BINARY
Definition: schilyio.h:87
#define FI_APPEND
Definition: schilyio.h:88
#define FI_TRUNC
Definition: schilyio.h:91
#define FI_READ
Definition: schilyio.h:85
#define FI_UNBUF
Definition: schilyio.h:92
#define FI_WRITE
Definition: schilyio.h:86
#define FI_CREATE
Definition: schilyio.h:90

Referenced by fileopen().