[pacman-dev] [PATCH 1/2] libalpm: take alpm_trans_t out of the public API
this type is only used internally by alpm --- lib/libalpm/alpm.h | 6 ------ lib/libalpm/handle.h | 1 + lib/libalpm/trans.h | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 101d686b..1413263b 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -113,12 +113,6 @@ typedef struct __alpm_db_t alpm_db_t; */ typedef struct __alpm_pkg_t alpm_pkg_t; -/** Transaction structure used internally by libalpm - * @ingroup libalpm_trans - * */ -typedef struct __alpm_trans_t alpm_trans_t; - - /** The time type used by libalpm. Represents a unix time stamp * @ingroup libalpm_misc */ typedef int64_t alpm_time_t; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index b1526c67..f2602057 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -26,6 +26,7 @@ #include "alpm_list.h" #include "alpm.h" +#include "trans.h" #ifdef HAVE_LIBCURL #include <curl/curl.h> diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index 9e7fcbd7..d2ec0223 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -36,7 +36,7 @@ typedef enum _alpm_transstate_t { } alpm_transstate_t; /* Transaction */ -struct __alpm_trans_t { +typedef struct _alpm_trans_t { /* bitfield of alpm_transflag_t flags */ int flags; alpm_transstate_t state; @@ -44,7 +44,7 @@ struct __alpm_trans_t { alpm_list_t *add; /* list of (alpm_pkg_t *) */ alpm_list_t *remove; /* list of (alpm_pkg_t *) */ alpm_list_t *skip_remove; /* list of (char *) */ -}; +} alpm_trans_t; void _alpm_trans_free(alpm_trans_t *trans); /* flags is a bitfield of alpm_transflag_t flags */ -- 2.31.1
__foo is reserved in c and should not be used. --- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/alpm_list.h | 6 +++--- lib/libalpm/db.h | 2 +- lib/libalpm/diskspace.h | 2 +- lib/libalpm/graph.h | 8 ++++---- lib/libalpm/handle.h | 2 +- lib/libalpm/package.h | 2 +- lib/libalpm/pkghash.h | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 1413263b..988ba691 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -78,7 +78,7 @@ extern "C" { * This struct represents an instance of libalpm. * @ingroup libalpm_handle */ -typedef struct __alpm_handle_t alpm_handle_t; +typedef struct _alpm_handle_t alpm_handle_t; /** A database. * @@ -98,7 +98,7 @@ typedef struct __alpm_handle_t alpm_handle_t; * Databases are automatically unregistered when the \link alpm_handle_t \endlink is released. * @ingroup libalpm_databases */ -typedef struct __alpm_db_t alpm_db_t; +typedef struct _alpm_db_t alpm_db_t; /** A package. @@ -111,7 +111,7 @@ typedef struct __alpm_db_t alpm_db_t; * to be added or removed from the system. * @ingroup libalpm_packages */ -typedef struct __alpm_pkg_t alpm_pkg_t; +typedef struct _alpm_pkg_t alpm_pkg_t; /** The time type used by libalpm. Represents a unix time stamp * @ingroup libalpm_misc */ diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h index 7f95feac..dd017b6e 100644 --- a/lib/libalpm/alpm_list.h +++ b/lib/libalpm/alpm_list.h @@ -48,13 +48,13 @@ extern "C" { */ /** A doubly linked list */ -typedef struct __alpm_list_t { +typedef struct _alpm_list_t { /** data held by the list node */ void *data; /** pointer to the previous node */ - struct __alpm_list_t *prev; + struct _alpm_list_t *prev; /** pointer to the next node */ - struct __alpm_list_t *next; + struct _alpm_list_t *next; } alpm_list_t; /** Frees a list and its contents */ diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 92c69ba7..57933b82 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -62,7 +62,7 @@ struct db_operations { }; /* Database */ -struct __alpm_db_t { +struct _alpm_db_t { alpm_handle_t *handle; char *treename; /* do not access directly, use _alpm_db_path(db) for lazy access */ diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index 8dac7bb6..5e2807cf 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -43,7 +43,7 @@ enum mount_fsinfo { MOUNT_FSINFO_FAIL, }; -typedef struct __alpm_mountpoint_t { +typedef struct _alpm_mountpoint_t { /* mount point information */ char *mount_dir; size_t mount_dir_len; diff --git a/lib/libalpm/graph.h b/lib/libalpm/graph.h index 8578d50d..321799ec 100644 --- a/lib/libalpm/graph.h +++ b/lib/libalpm/graph.h @@ -23,19 +23,19 @@ #include "alpm_list.h" -enum __alpm_graph_vertex_state { +enum _alpm_graph_vertex_state { ALPM_GRAPH_STATE_UNPROCESSED, ALPM_GRAPH_STATE_PROCESSING, ALPM_GRAPH_STATE_PROCESSED }; -typedef struct __alpm_graph_t { +typedef struct _alpm_graph_t { void *data; - struct __alpm_graph_t *parent; /* where did we come from? */ + struct _alpm_graph_t *parent; /* where did we come from? */ alpm_list_t *children; alpm_list_t *iterator; /* used for DFS without recursion */ off_t weight; /* weight of the node */ - enum __alpm_graph_vertex_state state; + enum _alpm_graph_vertex_state state; } alpm_graph_t; alpm_graph_t *_alpm_graph_new(void); diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index f2602057..2e85f283 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -51,7 +51,7 @@ do { \ } \ } while(0) -struct __alpm_handle_t { +struct _alpm_handle_t { /* internal usage */ alpm_db_t *db_local; /* local db pointer */ alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */ diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 9fd9be28..3332bbb3 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -85,7 +85,7 @@ struct pkg_operations { */ extern const struct pkg_operations default_pkg_ops; -struct __alpm_pkg_t { +struct _alpm_pkg_t { unsigned long name_hash; char *filename; char *base; diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h index ff61742c..49460550 100644 --- a/lib/libalpm/pkghash.h +++ b/lib/libalpm/pkghash.h @@ -32,7 +32,7 @@ * A combination of a hash table and a list, allowing for fast look-up * by package name but also iteration over the packages. */ -struct __alpm_pkghash_t { +struct _alpm_pkghash_t { /** data held by the hash table */ alpm_list_t **hash_table; /** head node of the hash table data in normal list format */ @@ -45,7 +45,7 @@ struct __alpm_pkghash_t { unsigned int limit; }; -typedef struct __alpm_pkghash_t alpm_pkghash_t; +typedef struct _alpm_pkghash_t alpm_pkghash_t; alpm_pkghash_t *_alpm_pkghash_create(unsigned int size); -- 2.31.1
On 3/5/21 8:58 pm, morganamilo wrote:
this type is only used internally by alpm ---
I think I agree with this... I do wonder if this will need to become public when we look to allow -S and -R in a single operation. Nevertheless, this has been public for ever, and it is too close to the 6.0 release to change this. I'll keep in my post-6.0 queue. Allan
lib/libalpm/alpm.h | 6 ------ lib/libalpm/handle.h | 1 + lib/libalpm/trans.h | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 101d686b..1413263b 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -113,12 +113,6 @@ typedef struct __alpm_db_t alpm_db_t; */ typedef struct __alpm_pkg_t alpm_pkg_t;
-/** Transaction structure used internally by libalpm - * @ingroup libalpm_trans - * */ -typedef struct __alpm_trans_t alpm_trans_t; - - /** The time type used by libalpm. Represents a unix time stamp * @ingroup libalpm_misc */ typedef int64_t alpm_time_t; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index b1526c67..f2602057 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -26,6 +26,7 @@
#include "alpm_list.h" #include "alpm.h" +#include "trans.h"
#ifdef HAVE_LIBCURL #include <curl/curl.h> diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index 9e7fcbd7..d2ec0223 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -36,7 +36,7 @@ typedef enum _alpm_transstate_t { } alpm_transstate_t;
/* Transaction */ -struct __alpm_trans_t { +typedef struct _alpm_trans_t { /* bitfield of alpm_transflag_t flags */ int flags; alpm_transstate_t state; @@ -44,7 +44,7 @@ struct __alpm_trans_t { alpm_list_t *add; /* list of (alpm_pkg_t *) */ alpm_list_t *remove; /* list of (alpm_pkg_t *) */ alpm_list_t *skip_remove; /* list of (char *) */ -}; +} alpm_trans_t;
void _alpm_trans_free(alpm_trans_t *trans); /* flags is a bitfield of alpm_transflag_t flags */
On 3/5/21 8:58 pm, morganamilo wrote:
this type is only used internally by alpm --- lib/libalpm/alpm.h | 6 ------ lib/libalpm/handle.h | 1 + lib/libalpm/trans.h | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-)
Thanks - on my post-6.0.1 branch. Allan
On 3/5/21 8:58 pm, morganamilo wrote:
__foo is reserved in c and should not be used.
OK. On my post-6.0.1 branch. A
--- lib/libalpm/alpm.h | 6 +++--- lib/libalpm/alpm_list.h | 6 +++--- lib/libalpm/db.h | 2 +- lib/libalpm/diskspace.h | 2 +- lib/libalpm/graph.h | 8 ++++---- lib/libalpm/handle.h | 2 +- lib/libalpm/package.h | 2 +- lib/libalpm/pkghash.h | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-)
participants (2)
-
Allan McRae
-
morganamilo