X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib.h;h=54d6cb5832763afa73d36416a3a88c061d89428e;hb=75e5efe798c0d0e83c709ff3a802fa48096fc776;hp=ef08e96e5ac1952e5ad6fce0f53973bce7362bf0;hpb=4cdfe1f65507e3647b37f11c19202c99cce11f77;p=wimlib diff --git a/include/wimlib.h b/include/wimlib.h index ef08e96e..54d6cb58 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -3564,6 +3564,24 @@ wimlib_join_with_progress(const wimlib_tchar * const *swms, wimlib_progress_func_t progfunc, void *progctx); +/** + * @ingroup G_general + * + * Load a UTF-8 or UTF-16LE encoded text file into memory. + * + * @param path + * The path to the file, or NULL or "-" to use standard input. + * @param tstr_ret + * On success, a buffer containing the file's text as a "wimlib_tchar" + * string is returned here. The buffer must be freed using free(). + * @param tstr_nchars_ret + * On success, the length of the text in "wimlib_tchar"s is returned here. + * + * @return 0 on success; a ::wimlib_error_code value on failure. + */ +WIMLIBAPI int +wimlib_load_text_file(const wimlib_tchar *path, + wimlib_tchar **tstr_ret, size_t *tstr_nchars_ret); /** * @ingroup G_mounting_wim_images