typedef void (*pakfire_log_function_t)(void* data, int priority, const char* file,
int line, const char* fn, const char* format, va_list args);
-typedef enum _pakfire_action_types {
- PAKFIRE_ACTION_NOOP = 0,
- PAKFIRE_ACTION_VERIFY = 1 << 0,
- PAKFIRE_ACTION_EXECUTE = 1 << 1,
- PAKFIRE_ACTION_PRETRANS = 1 << 2,
- PAKFIRE_ACTION_POSTTRANS = 1 << 3,
-} pakfire_action_type_t;
-
-typedef enum _pakfire_step_types {
- PAKFIRE_STEP_IGNORE = 0,
- PAKFIRE_STEP_INSTALL,
- PAKFIRE_STEP_REINSTALL,
- PAKFIRE_STEP_ERASE,
- PAKFIRE_STEP_UPGRADE,
- PAKFIRE_STEP_DOWNGRADE,
- PAKFIRE_STEP_OBSOLETE,
-} pakfire_step_type_t;
-
#endif /* PAKFIRE_TYPES_H */
size_t num;
};
-static pakfire_step_type_t pakfire_transaction_get_step_type(
+enum pakfire_actions {
+ PAKFIRE_ACTION_NOOP = 0,
+ PAKFIRE_ACTION_VERIFY,
+ PAKFIRE_ACTION_EXECUTE,
+ PAKFIRE_ACTION_PRETRANS,
+ PAKFIRE_ACTION_POSTTRANS,
+};
+
+enum pakfire_steps {
+ PAKFIRE_STEP_IGNORE = 0,
+ PAKFIRE_STEP_INSTALL,
+ PAKFIRE_STEP_REINSTALL,
+ PAKFIRE_STEP_ERASE,
+ PAKFIRE_STEP_UPGRADE,
+ PAKFIRE_STEP_DOWNGRADE,
+ PAKFIRE_STEP_OBSOLETE,
+};
+
+static enum pakfire_steps pakfire_transaction_get_step_type(
struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
int type = transaction_type(transaction->transaction, pakfire_package_id(pkg),
SOLVER_TRANSACTION_SHOW_ACTIVE|SOLVER_TRANSACTION_CHANGE_IS_REINSTALL);
return r;
}
-static const char* pakfire_action_type_string(pakfire_action_type_t type) {
+static const char* pakfire_action_type_string(enum pakfire_actions type) {
switch (type) {
case PAKFIRE_ACTION_NOOP:
return "NOOP";
}
static int pakfire_transaction_run_step(struct pakfire_transaction* transaction,
- struct pakfire_db* db, const pakfire_action_type_t action, struct pakfire_package* pkg, PakfireArchive archive) {
+ struct pakfire_db* db, const enum pakfire_actions action, struct pakfire_package* pkg, PakfireArchive archive) {
if (!pkg) {
errno = EINVAL;
return 1;
DEBUG(transaction->pakfire, "Running %s for %s\n",
pakfire_action_type_string(action), pakfire_package_get_nevra(pkg));
- pakfire_step_type_t type = pakfire_transaction_get_step_type(transaction, pkg);
+ enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
int r = 0;
switch (action) {
}
static int pakfire_transaction_run_steps(struct pakfire_transaction* transaction,
- struct pakfire_db* db, const pakfire_action_type_t action) {
+ struct pakfire_db* db, enum pakfire_actions action) {
int r = 0;
// Walk through all steps
struct pakfire_package* pkg = transaction->packages[i];
// Fetch the type
- pakfire_step_type_t type = pakfire_transaction_get_step_type(transaction, pkg);
+ enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
// Do we need the archive?
switch (type) {
static int pakfire_transaction_package_needs_download(
struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
- pakfire_step_type_t type = pakfire_transaction_get_step_type(transaction, pkg);
+ enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
switch (type) {
case PAKFIRE_STEP_INSTALL:
case PAKFIRE_STEP_REINSTALL: