mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
examples: warn on invalid numeric parameters
add ExUtilGet[U]Int / ExUtilGetFloat which print an error message on parse failure. fixes issue #219. Change-Id: Ie537f5aebd138925bf1a48289b6b5e261b3af2ca
This commit is contained in:
@ -20,6 +20,19 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// String parsing
|
||||
|
||||
// Parses 'v' using strto(ul|l|d)(). If error is non-NULL, '*error' is set to
|
||||
// true on failure while on success it is left unmodified to allow chaining of
|
||||
// calls. An error is only printed on the first occurrence.
|
||||
uint32_t ExUtilGetUInt(const char* const v, int base, int* const error);
|
||||
int ExUtilGetInt(const char* const v, int base, int* const error);
|
||||
float ExUtilGetFloat(const char* const v, int* const error);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// File I/O
|
||||
|
||||
// Reopen file in binary (O_BINARY) mode.
|
||||
// Returns 'file' on success, NULL otherwise.
|
||||
FILE* ExUtilSetBinaryMode(FILE* file);
|
||||
|
Reference in New Issue
Block a user