#ifndef PKG_H
#define PKG_H
-#include "config.h"
-
#include <sys/types.h>
#include <libubox/blob.h>
SF_MARKED = 64, /* temporary mark */
SF_FILELIST_CHANGED = 128, /* needs filelist written */
SF_USER = 256,
+ SF_NEED_DETAIL = 512,
SF_LAST_STATE_FLAG
};
typedef enum pkg_state_flag pkg_state_flag_t;
PKG_LOCAL_FILENAME,
PKG_VERSION,
PKG_REVISION,
- PKG_ARCHITECTURE,
- PKG_ARCH_PRIORITY,
PKG_DESCRIPTION,
PKG_MD5SUM,
PKG_SHA256SUM,
pkg_src_t *src;
pkg_dest_t *dest;
pkg_state_want_t state_want:3;
- pkg_state_flag_t state_flag:10;
+ pkg_state_flag_t state_flag:11;
pkg_state_status_t state_status:4;
abstract_pkg_t *parent;
still being used within an outer loop. */
int installed_files_ref_cnt;
- int essential:1;
+ unsigned int essential:1;
/* Adding this flag, to "force" opkg to choose a "provided_by_hand" package, if there are multiple choice */
- int provided_by_hand:1;
+ unsigned int provided_by_hand:1;
/* this flag specifies whether the package was installed to satisfy another
* package's dependancies */
- int auto_installed:1;
- int is_upgrade:1;
+ unsigned int auto_installed:1;
+ unsigned int is_upgrade:1;
+
+ unsigned int arch_index:3;
struct blob_buf blob;
};
static inline int pkg_set_int(pkg_t *pkg, int id, int val)
{
- return (intptr_t) pkg_set_raw(pkg, id, &val, sizeof(val));
+ int *res = pkg_set_raw(pkg, id, &val, sizeof(val));
+ return res ? *res : 0;
}
static inline int pkg_get_int(const pkg_t *pkg, int id)
{
- return (intptr_t) pkg_get_raw(pkg, id);
+ int *ptr = pkg_get_raw(pkg, id);
+ return ptr ? *ptr : 0;
}
char *pkg_set_string(pkg_t *pkg, int id, const char *s);
static inline void * pkg_set_ptr(pkg_t *pkg, int id, void *ptr)
{
- return ptr ? *(void **) pkg_set_raw(pkg, id, &ptr, sizeof(ptr)) : NULL;
+ void **res = pkg_set_raw(pkg, id, &ptr, sizeof(ptr));
+ return res ? *res : NULL;
}
static inline void * pkg_get_ptr(const pkg_t *pkg, int id)
return ptr ? *ptr : NULL;
}
+char *pkg_set_architecture(pkg_t *pkg, const char *architecture, ssize_t len);
+char *pkg_get_architecture(const pkg_t *pkg);
+int pkg_get_arch_priority(const pkg_t *pkg);
+
+char *pkg_get_md5(const pkg_t *pkg);
+char *pkg_set_md5(pkg_t *pkg, const char *cksum);
+
+char *pkg_get_sha256(const pkg_t *pkg);
+char *pkg_set_sha256(pkg_t *pkg, const char *cksum);
+
abstract_pkg_t *abstract_pkg_new(void);
/*