Namespace and share DEFINE_TRIVIAL_CLEANUP_FUNC via. rpmostree-util.h
This commit is contained in:
parent
b7dbabe065
commit
0e7ba9077f
@ -51,13 +51,6 @@ static GOptionEntry option_entries[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* FIXME: merge and put into libgsystem or rpmostree-utils */
|
|
||||||
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
|
|
||||||
static inline void func##p(type *p) { \
|
|
||||||
if (*p) \
|
|
||||||
func(*p); \
|
|
||||||
} \
|
|
||||||
struct __useless_struct_to_allow_trailing_semicolon__
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
header_free_p (gpointer data)
|
header_free_p (gpointer data)
|
||||||
@ -521,7 +514,7 @@ rpmrev_free (struct RpmRevisionData *ptr)
|
|||||||
g_free (ptr);
|
g_free (ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct RpmRevisionData *, rpmrev_free);
|
_RPMOSTREE_DEFINE_TRIVIAL_CLEANUP_FUNC(struct RpmRevisionData *, rpmrev_free);
|
||||||
|
|
||||||
#define _cleanup_rpmrev_ __attribute__((cleanup(rpmrev_freep)))
|
#define _cleanup_rpmrev_ __attribute__((cleanup(rpmrev_freep)))
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
#include "rpmostree-treepkgdiff.h"
|
#include "rpmostree-treepkgdiff.h"
|
||||||
|
#include "rpmostree-util.h"
|
||||||
#include <ostree.h>
|
#include <ostree.h>
|
||||||
|
|
||||||
#include <hawkey/packagelist.h>
|
#include <hawkey/packagelist.h>
|
||||||
@ -36,17 +37,9 @@
|
|||||||
|
|
||||||
#include "libgsystem.h"
|
#include "libgsystem.h"
|
||||||
|
|
||||||
/* Todo: move this to libgsystem */
|
_RPMOSTREE_DEFINE_TRIVIAL_CLEANUP_FUNC(HySack, hy_sack_free);
|
||||||
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
|
_RPMOSTREE_DEFINE_TRIVIAL_CLEANUP_FUNC(HyQuery, hy_query_free);
|
||||||
static inline void func##p(type *p) { \
|
_RPMOSTREE_DEFINE_TRIVIAL_CLEANUP_FUNC(HyPackageList, hy_packagelist_free);
|
||||||
if (*p) \
|
|
||||||
func(*p); \
|
|
||||||
} \
|
|
||||||
struct __useless_struct_to_allow_trailing_semicolon__
|
|
||||||
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(HySack, hy_sack_free);
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(HyQuery, hy_query_free);
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(HyPackageList, hy_packagelist_free);
|
|
||||||
|
|
||||||
#define _cleanup_hysack_ __attribute__((cleanup(hy_sack_freep)))
|
#define _cleanup_hysack_ __attribute__((cleanup(hy_sack_freep)))
|
||||||
#define _cleanup_hyquery_ __attribute__((cleanup(hy_query_freep)))
|
#define _cleanup_hyquery_ __attribute__((cleanup(hy_query_freep)))
|
||||||
|
@ -22,6 +22,14 @@
|
|||||||
|
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
|
|
||||||
|
#define _RPMOSTREE_DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
|
||||||
|
static inline void func##p(type *p) { \
|
||||||
|
if (*p) \
|
||||||
|
func(*p); \
|
||||||
|
} \
|
||||||
|
struct __useless_struct_to_allow_trailing_semicolon__
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_rpmostree_util_enumerate_directory_allow_noent (GFile *dirpath,
|
_rpmostree_util_enumerate_directory_allow_noent (GFile *dirpath,
|
||||||
const char *queryargs,
|
const char *queryargs,
|
||||||
|
Loading…
Reference in New Issue
Block a user