]> wimlib.net Git - wimlib/blobdiff - include/wimlib.h
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / include / wimlib.h
index b4f145b3d626aebb828921b0bcb2abc899811ac9..84f1e2eca6742dafb8bad725a02beaf6efdfcd39 100644 (file)
@@ -11,7 +11,7 @@
 /**
  * @mainpage
  *
- * This is the documentation for the library interface of wimlib 1.13.6, a C
+ * This is the documentation for the library interface of wimlib 1.14.4, a C
  * library for creating, modifying, extracting, and mounting files in the
  * Windows Imaging (WIM) format.  This documentation is intended for developers
  * only.  If you have installed wimlib and want to know how to use the @b
@@ -30,9 +30,8 @@
  * @subsection Windows
  *
  * Download the Windows binary distribution with the appropriate architecture
- * (i686 or x86_64 --- also called "x86" and "amd64" respectively) from
- * https://wimlib.net.  Link your program with libwim-15.dll.  If needed by your
- * programming language or development environment, the import library
+ * from https://wimlib.net.  Link your program with libwim-15.dll.  If needed by
+ * your programming language or development environment, the import library
  * libwim.lib and C/C++ header wimlib.h can be found in the directory "devel" in
  * the ZIP file.
  *
 #include <time.h>
 
 #ifdef BUILDING_WIMLIB
+  /*
+   * On i386, gcc assumes that the stack is 16-byte aligned at function entry.
+   * However, some compilers (e.g. MSVC) and programming languages (e.g. Delphi)
+   * only guarantee 4-byte alignment when calling functions.  This is mainly an
+   * issue on Windows, but it can occur on Linux too.  Work around this ABI
+   * incompatibility by realigning the stack pointer when entering the library.
+   * This prevents crashes in SSE/AVX code.
+   */
+#  if defined(__GNUC__) && defined(__i386__)
+#    define WIMLIB_ALIGN_STACK  __attribute__((force_align_arg_pointer))
+#  else
+#    define WIMLIB_ALIGN_STACK
+#  endif
 #  ifdef _WIN32
-#    define WIMLIBAPI __declspec(dllexport)
+#    define WIMLIBAPI __declspec(dllexport) WIMLIB_ALIGN_STACK
 #  else
-#    define WIMLIBAPI __attribute__((visibility("default")))
+#    define WIMLIBAPI __attribute__((visibility("default"))) WIMLIB_ALIGN_STACK
 #  endif
 #else
 #  define WIMLIBAPI
 #define WIMLIB_MAJOR_VERSION 1
 
 /** Minor version of the library (for example, the 2 in 1.2.5). */
-#define WIMLIB_MINOR_VERSION 13
+#define WIMLIB_MINOR_VERSION 14
 
 /** Patch version of the library (for example, the 5 in 1.2.5). */
-#define WIMLIB_PATCH_VERSION 6
+#define WIMLIB_PATCH_VERSION 4
 
 #ifdef __cplusplus
 extern "C" {
@@ -3552,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