As was forewarned in the comment, stop exporting these functions
outside the library.
---
generator/c.ml | 8 --------
src/guestfs-internal-frontend.h | 23 -----------------------
src/guestfs-internal.h | 20 ++++++++++++++++++++
3 files changed, 20 insertions(+), 31 deletions(-)
diff --git a/generator/c.ml b/generator/c.ml
index e6287ed..c432356 100644
--- a/generator/c.ml
+++ b/generator/c.ml
@@ -2187,14 +2187,6 @@ and generate_linker_script () =
"guestfs_set_private";
"guestfs_set_progress_callback";
"guestfs_set_subprocess_quit_callback";
-
- (* Unofficial parts of the API: the bindings code use these
- * functions, so it is useful to export them.
- *)
- "guestfs_int_safe_calloc";
- "guestfs_int_safe_malloc";
- "guestfs_int_safe_strdup";
- "guestfs_int_safe_memdup";
] in
let functions =
List.flatten (
diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h
index 2aaca9a..7f10906 100644
--- a/src/guestfs-internal-frontend.h
+++ b/src/guestfs-internal-frontend.h
@@ -72,29 +72,6 @@
#define CLEANUP_PCLOSE
#endif
-/* NB: At some point we will stop exporting these safe_* allocation
- * functions outside the library, so don't use them in new tools or
- * bindings code.
- */
-extern GUESTFS_DLL_PUBLIC void *guestfs_int_safe_malloc (guestfs_h *g, size_t nbytes);
-extern GUESTFS_DLL_PUBLIC void *guestfs_int_safe_calloc (guestfs_h *g, size_t n, size_t
s);
-extern GUESTFS_DLL_PUBLIC char *guestfs_int_safe_strdup (guestfs_h *g, const char *str);
-extern GUESTFS_DLL_PUBLIC void *guestfs_int_safe_memdup (guestfs_h *g, const void *ptr,
size_t size);
-extern void *guestfs_int_safe_realloc (guestfs_h *g, void *ptr, size_t nbytes);
-extern char *guestfs_int_safe_strdup (guestfs_h *g, const char *str);
-extern char *guestfs_int_safe_strndup (guestfs_h *g, const char *str, size_t n);
-extern void *guestfs_int_safe_memdup (guestfs_h *g, const void *ptr, size_t size);
-extern char *guestfs_int_safe_asprintf (guestfs_h *g, const char *fs, ...)
- __attribute__((format (printf,2,3)));
-
-#define safe_calloc guestfs_int_safe_calloc
-#define safe_malloc guestfs_int_safe_malloc
-#define safe_realloc guestfs_int_safe_realloc
-#define safe_strdup guestfs_int_safe_strdup
-#define safe_strndup guestfs_int_safe_strndup
-#define safe_memdup guestfs_int_safe_memdup
-#define safe_asprintf guestfs_int_safe_asprintf
-
/* utils.c */
extern void guestfs_int_free_string_list (char **);
extern size_t guestfs_int_count_strings (char *const *);
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 6e441e4..22b6c6c 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -626,6 +626,26 @@ struct guestfs_progress;
/* handle.c */
extern int guestfs_int_get_backend_setting_bool (guestfs_h *g, const char *name);
+/* alloc.c */
+extern void *guestfs_int_safe_malloc (guestfs_h *g, size_t nbytes);
+extern void *guestfs_int_safe_calloc (guestfs_h *g, size_t n, size_t s);
+extern char *guestfs_int_safe_strdup (guestfs_h *g, const char *str);
+extern void *guestfs_int_safe_memdup (guestfs_h *g, const void *ptr, size_t size);
+extern void *guestfs_int_safe_realloc (guestfs_h *g, void *ptr, size_t nbytes);
+extern char *guestfs_int_safe_strdup (guestfs_h *g, const char *str);
+extern char *guestfs_int_safe_strndup (guestfs_h *g, const char *str, size_t n);
+extern void *guestfs_int_safe_memdup (guestfs_h *g, const void *ptr, size_t size);
+extern char *guestfs_int_safe_asprintf (guestfs_h *g, const char *fs, ...)
+ __attribute__((format (printf,2,3)));
+
+#define safe_calloc guestfs_int_safe_calloc
+#define safe_malloc guestfs_int_safe_malloc
+#define safe_realloc guestfs_int_safe_realloc
+#define safe_strdup guestfs_int_safe_strdup
+#define safe_strndup guestfs_int_safe_strndup
+#define safe_memdup guestfs_int_safe_memdup
+#define safe_asprintf guestfs_int_safe_asprintf
+
/* errors.c */
extern void guestfs_int_init_error_handler (guestfs_h *g);
--
2.5.0