Displaying 1 result from an estimated 1 matches for "guestfs_daemon_structs_cleanups_h_".
2017 Mar 10
2
[PATCH 1/2] daemon: generate cleanup handlers for structs
...+
+(* Generate structs-cleanups.h file. *)
+and generate_daemon_structs_cleanups_h () =
+ generate_header CStyle GPLv2plus;
+
+ pr "\
+/* These CLEANUP_* macros automatically free the struct or struct list
+ * pointed to by the local variable at the end of the current scope.
+ */
+
+#ifndef GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_
+#define GUESTFS_DAEMON_STRUCTS_CLEANUPS_H_
+
+#ifdef HAVE_ATTRIBUTE_CLEANUP
+";
+
+ List.iter (
+ fun { s_name = name } ->
+ pr "#define CLEANUP_FREE_%s \\\n" (String.uppercase_ascii name);
+ pr " __attribute__((cleanup(cleanup_free_int_%s)))\n" name;
+...