MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / open_as_stdin

Function open_as_stdin

tools/tokenizer/libtoken.c:279–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279int open_as_stdin(const char *file)
280{
281 filename = file;
282 if (!freopen(filename, "r", stdin)) {
283 if (!nowarn)
284 fprintf(stderr, "(W): Cannot read file %s.\n", filename);
285 return -1;
286 }
287 return set_or_detect_lang(0);
288}
289
290/* Deal with DOS (\r \n) and classic Mac OS (\r) (physical) line endings.
291 In case of CR LF skip (but count) the CR and return LF.

Callers

nothing calls this directly

Calls 1

set_or_detect_langFunction · 0.85

Tested by

no test coverage detected