mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
webpmux: allow reading argument from a file
if a single text file name is supplied as argument (e.g.: 'webpmux my_long_list_of_frames.txt'), the command line arguments are actually parsed from this file. Tokenizer will remove space, tabs, LF, CR, returns, etc. + changed ImgIoUtilReadFile() to return a null-terminated data, for convenience. + misc clean-up in the code BUG=webp:355 Change-Id: I76796305641d660933de5881763d723006712fa9 ---
This commit is contained in:
@ -30,6 +30,9 @@ FILE* ImgIoUtilSetBinaryMode(FILE* file);
|
||||
// Allocates storage for entire file 'file_name' and returns contents and size
|
||||
// in 'data' and 'data_size'. Returns 1 on success, 0 otherwise. '*data' should
|
||||
// be deleted using free().
|
||||
// Note: for convenience, the data will be null-terminated with an extra byte
|
||||
// (not accounted for in *data_size), in case the file is text and intended
|
||||
// to be used as a C-string.
|
||||
// If 'file_name' is NULL or equal to "-", input is read from stdin by calling
|
||||
// the function ImgIoUtilReadFromStdin().
|
||||
int ImgIoUtilReadFile(const char* const file_name,
|
||||
|
Reference in New Issue
Block a user