MCPcopy Create free account
hub / github.com/Singular/Singular / myfopen

Function myfopen

resources/feFopen.cc:167–192  ·  view source on GitHub ↗

Make sure that mode contains binary option

Source from the content-addressed store, hash-verified

165
166// Make sure that mode contains binary option
167FILE* myfopen(const char *path, const char *mode)
168{
169#if (defined(__CUGWIN__))
170 char mmode[4];
171 int i;
172 int done = 0;
173
174 for (i=0;;i++)
175 {
176 mmode[i] = mode[i];
177 if (mode[i] == '\0') break;
178 if (mode[i] == 'w') done = 1;
179 if (mode[i] == 'a') done = 1;
180 if (mode[i] == 'b') done = 1;
181 }
182
183 if (! done)
184 {
185 mmode[i] = 'b';
186 mmode[i+1] = '\0';
187 }
188 return fopen(path, mmode);
189#else
190 return fopen(path, mode);
191#endif
192}
193// replace "\r\n" by " \n" and "\r" by "\n"
194
195size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)

Callers 4

feFopenFunction · 0.85
monitorFunction · 0.85
ssiOpenFunction · 0.85
slOpenAsciiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected