EAScanf provides a portable version of the C scanf family of functions which improves on the C family in the following ways:
The primary disadvantages of EAScanf are:
EAScanf doesn't attempt to solve the locale formatting problem because users really are better off using serious locale libraries for such things rather than using the meager support provided by the C standard library. The EALocale library attempts to provide such functionality.
EAScanf provides the following functions in 8 and 16 bit versions:
int Cscanf(ReadFunction8 pReadFunction8, void* pContext, const char8_t* pFormat, ...);
int Fscanf(FILE* pFile, const char8_t* pFormat, ...);
int Scanf(const char8_t* pFormat, ...);
int Sscanf(const char8_t* pTextBuffer, const char8_t* pFormat, ...);
int Cscanf(ReadFunction16 pReadFunction16, void* pContext, const char16_t* pFormat, ...);
int Fscanf(FILE* pFile, const char16_t* pFormat, ...);
int Scanf(const char16_t* pFormat, ...);
int Sscanf(const char16_t* pTextBuffer, const char16_t* pFormat, ...);
int Vcscanf(ReadFunction8 pReadFunction8, void* pContext, const char8_t* pFormat, va_list arguments);
int Vfscanf(FILE* pFile, const char8_t* pFormat, va_list arguments);
int Vscanf(const char8_t* pFormat, va_list arguments);
int Vsscanf(const char8_t* pTextBuffer, const char8_t* pFormat, va_list arguments);
int Vcscanf(ReadFunction16 pReadFunction16, void* pContext, const char16_t* pFormat, va_list arguments);
int Vfscanf(FILE* pFile, const char16_t* pFormat, va_list arguments);
int Vscanf(const char16_t* pFormat, va_list arguments);
int Vsscanf(const char16_t* pTextBuffer, const char16_t* pFormat, va_list arguments);
EAPrintf provides extended format functionality not found in the C99 standard but which is useful nevertheless:
| Format | Description | Example | Example output |
| b | Binary output field type (joins d, i, x, o, etc.). | sscanf("11111111", "%b", &integer); | integer == 0xff |
| I8 | 8 bit integer field modifier. | sscanf("0xff", "%I8d", &int8); | int8 == 0xff |
| I16 | 16 bit integer field modifier. | sscanf("0xffff", "%I16u", &uint16); | uint16 == 0xffff |
| I32 | 32 bit integer field modifier. | sscanf("0xffffffff", "%I32d", &int32); | int32 == 0xffffffff |
| I64 | 64 bit integer field modifier. | sscanf("0xffffffffffffffff", "%I64u", &int64); | int64 == -1 |
| I128 | 128 bit integer field modifier. | sscanf("0xffffffffffffffffffffffffffffffff", "%I128d", &int128); | int128 = -1 |
To do.