|
2 | 2 | // All Rights Reserved.
|
3 | 3 | // Author: renn
|
4 | 4 | //
|
5 |
| -// Contains file io functions (mainly for file parsing), that might not be |
6 |
| -// available, on embedded devices, or that have an incomplete implementation |
7 |
| -// there. |
8 |
| -// |
9 | 5 | // Licensed under the Apache License, Version 2.0 (the "License");
|
10 | 6 | // you may not use this file except in compliance with the License.
|
11 | 7 | // You may obtain a copy of the License at
|
|
19 | 15 | #ifndef TESSERACT_CCUTIL_SCANUTILS_H_
|
20 | 16 | #define TESSERACT_CCUTIL_SCANUTILS_H_
|
21 | 17 |
|
22 |
| -#include <cstdint> |
23 |
| -#include <cstddef> |
24 |
| -#include <cstdio> |
25 |
| -#include <sys/stat.h> |
| 18 | +#include <cstdio> // for FILE |
26 | 19 |
|
27 | 20 | /**
|
28 | 21 | * fscanf variant to ensure correct reading regardless of locale.
|
|
36 | 29 | */
|
37 | 30 | int tfscanf(FILE* stream, const char *format, ...);
|
38 | 31 |
|
39 |
| -#ifdef EMBEDDED |
40 |
| - |
41 |
| -// Attempts to parse the given file stream s as an integer of the base |
42 |
| -// 'base'. Returns the first successfully parsed integer as a uintmax_t, or |
43 |
| -// 0, if none was found. |
44 |
| -uintmax_t streamtoumax(FILE* s, int base); |
45 |
| - |
46 |
| -// Parse a file stream according to the given format. See the fscanf manpage |
47 |
| -// for more information, as this function attempts to mimic its behavior. |
48 |
| -// Note that scientific floating-point notation is not supported. |
49 |
| -int fscanf(FILE* stream, const char *format, ...); |
50 |
| - |
51 |
| -// Parse a file stream according to the given format. See the fscanf manpage |
52 |
| -// for more information, as this function attempts to mimic its behavior. |
53 |
| -// Note that scientific floating-point notation is not supported. |
54 |
| -int vfscanf(FILE* stream, const char *format, va_list ap); |
55 |
| - |
56 |
| -// Create a file at the specified path. See the creat manpage for more |
57 |
| -// information, as this function attempts to mimic its behavior. |
58 |
| -int creat(const char *pathname, mode_t mode); |
59 |
| - |
60 |
| -#endif // EMBEDDED |
61 |
| - |
62 | 32 | #endif // TESSERACT_CCUTIL_SCANUTILS_H_
|
0 commit comments