MySQL 9.1.0
Source Code Documentation
anonymous_namespace{my_fopen.cc} Namespace Reference

Functions

void make_ftype (char *to, int flag)
 Make a fopen() typestring from a open() type bitmap. More...
 

Variables

constexpr FILE * nullstream = nullptr
 

Function Documentation

◆ make_ftype()

void anonymous_namespace{my_fopen.cc}::make_ftype ( char *  to,
int  flag 
)

Make a fopen() typestring from a open() type bitmap.

This routine attempts to find the best possible match between a numeric option and a string option that could be fed to fopen. There is not a 1 to 1 mapping between the two.

MAPPING r == O_RDONLY w == O_WRONLY|O_TRUNC|O_CREAT a == O_WRONLY|O_APPEND|O_CREAT r+ == O_RDWR w+ == O_RDWR|O_TRUNC|O_CREAT a+ == O_RDWR|O_APPEND|O_CREAT

Parameters
toString for fopen() is stored here
flagFlag used by open()
Note
On Unix, O_RDONLY is usually 0

Variable Documentation

◆ nullstream

constexpr FILE* anonymous_namespace{my_fopen.cc}::nullstream = nullptr
constexpr