summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:14:44 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:14:44 (EST)
commit371254054431baca18545c4e02c9e588e7d95a66 (patch)
tree1bf460e61c8754c4be7291546fde14b3b0069499
parent079a631d12f3d6ae6f33aef318a51799ea78027c (diff)
opkg: add more attributes to opkg_package_t
git-svn-id: http://opkg.googlecode.com/svn/trunk@98 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--configure.ac2
-rw-r--r--libopkg/opkg.c8
-rw-r--r--libopkg/opkg.h4
3 files changed, 10 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index a935749..aae0e63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script
AC_INIT(libopkg/libopkg.c)
-AM_INIT_AUTOMAKE([opkg], [0.1.1])
+AM_INIT_AUTOMAKE([opkg], [0.1.2])
AM_CONFIG_HEADER(libopkg/config.h)
AC_CANONICAL_HOST
diff --git a/libopkg/opkg.c b/libopkg/opkg.c
index adbb2c2..630b243 100644
--- a/libopkg/opkg.c
+++ b/libopkg/opkg.c
@@ -45,7 +45,7 @@ struct _opkg_t
__FILE__, __LINE__, __PRETTY_FUNCTION__, # expr); abort (); }
#define progress(d, p) d.percentage = p; if (progress_callback) progress_callback (opkg, &d, user_data);
-#define OLD_PKG_TO_NEW(pkg) opkg_package_new_with_values (pkg->name, pkg->version, pkg->architecture, pkg->description, pkg->tags, (pkg->state_status == SS_INSTALLED));
+#define OLD_PKG_TO_NEW(pkg) opkg_package_new_with_values (pkg->name, pkg->version, pkg->architecture, pkg->description, pkg->tags, pkg->url, (pkg->size ? atoi (pkg->size) : 0), (pkg->state_status == SS_INSTALLED));
/** Private Functions ***/
@@ -145,7 +145,7 @@ opkg_package_new ()
opkg_package_t *
opkg_package_new_with_values (const char *name, const char *version,
- const char *arch, const char *desc, const char *tags, int installed)
+ const char *arch, const char *desc, const char *tags, const char *url, int size, int installed)
{
opkg_package_t *package;
package = opkg_package_new ();
@@ -157,6 +157,9 @@ opkg_package_new_with_values (const char *name, const char *version,
package->architecture = sstrdup (arch);
package->description = sstrdup (desc);
package->tags = sstrdup (tags);
+ package->url = sstrdup (url);
+
+ package->size = size;
package->installed = (installed != 0);
return package;
@@ -170,6 +173,7 @@ opkg_package_free (opkg_package_t *p)
free (p->architecture);
free (p->description);
free (p->tags);
+ free (p->url);
free (p);
}
diff --git a/libopkg/opkg.h b/libopkg/opkg.h
index 1295f51..c352331 100644
--- a/libopkg/opkg.h
+++ b/libopkg/opkg.h
@@ -37,6 +37,8 @@ struct _opkg_package_t
char *repository;
char *description;
char *tags;
+ char *url;
+ int size;
int installed;
};
@@ -48,7 +50,7 @@ struct _opkg_progress_data_t
};
opkg_package_t* opkg_package_new ();
-opkg_package_t* opkg_package_new_with_values (const char *name, const char *version, const char *arch, const char *desc, const char *tags, int installed);
+opkg_package_t* opkg_package_new_with_values (const char *name, const char *version, const char *arch, const char *desc, const char *tags, const char *url, int size, int installed);
void opkg_package_free (opkg_package_t *package);
opkg_t* opkg_new ();