aboutsummaryrefslogtreecommitdiffstats
path: root/src/apk_provider_data.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-29 11:26:12 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-29 11:26:12 +0200
commit2f66295fc7ca65e5706b647971559aaddb5dfa55 (patch)
tree4e12e858065df56f76058600125ee4128c2f5353 /src/apk_provider_data.h
parent15adb0475f49d461b21f4826f9f0e1a1b8562205 (diff)
downloadaports-2f66295fc7ca65e5706b647971559aaddb5dfa55.tar.bz2
aports-2f66295fc7ca65e5706b647971559aaddb5dfa55.tar.xz
solver: merge apk_name_state to apk_name
apk_name_state is now quite small; and we avoid overhead of two pointers (+ malloc overhead) when we just make it part of apk_name. It also fixes some problems (that got introduced) where apk_name_state was not allocated.
Diffstat (limited to 'src/apk_provider_data.h')
-rw-r--r--src/apk_provider_data.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/apk_provider_data.h b/src/apk_provider_data.h
new file mode 100644
index 0000000000..15fba5cd3f
--- /dev/null
+++ b/src/apk_provider_data.h
@@ -0,0 +1,27 @@
+/* apk_provider_data.h - Alpine Package Keeper (APK)
+ *
+ * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
+ * Copyright (C) 2008-2012 Timo Teräs <timo.teras@iki.fi>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation. See http://www.gnu.org/ for details.
+ */
+
+#ifndef APK_PROVIDER_DATA_H
+#define APK_PROVIDER_DATA_H
+
+#include "apk_defines.h"
+#include "apk_blob.h"
+
+struct apk_provider {
+ struct apk_package *pkg;
+ apk_blob_t *version;
+};
+APK_ARRAY(apk_provider_array, struct apk_provider);
+
+#define PROVIDER_FMT "%s%s"BLOB_FMT
+#define PROVIDER_PRINTF(n,p) (n)->name, (p)->version->len ? "-" : "", BLOB_PRINTF(*(p)->version)
+
+#endif