summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-04-21 22:49:39 +0200
committerGuillem Jover <guillem@debian.org>2012-04-27 10:04:23 +0200
commit36b09198e3c0d01fab7b5fe677dcf231d82c71d7 (patch)
tree6f7a7c445a048598311a893385e0bc6f26880502
parente16fdfb6684ce9aa2457ac0241d601abc5366723 (diff)
downloaddpkg-36b09198e3c0d01fab7b5fe677dcf231d82c71d7.tar.gz
libdpkg: Namespace and uppercase enum pkg_format_type values
-rw-r--r--lib/dpkg/pkg-format.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/dpkg/pkg-format.c b/lib/dpkg/pkg-format.c
index 19acce432..4e059fc9f 100644
--- a/lib/dpkg/pkg-format.c
+++ b/lib/dpkg/pkg-format.c
@@ -34,9 +34,9 @@
#include <dpkg/pkg-format.h>
enum pkg_format_type {
- invalid,
- string,
- field,
+ PKG_FORMAT_INVALID,
+ PKG_FORMAT_STRING,
+ PKG_FORMAT_FIELD,
};
struct pkg_format_node {
@@ -54,7 +54,7 @@ pkg_format_node_new(void)
struct pkg_format_node *buf;
buf = m_malloc(sizeof(*buf));
- buf->type = invalid;
+ buf->type = PKG_FORMAT_INVALID;
buf->next = NULL;
buf->data = NULL;
buf->width = 0;
@@ -93,7 +93,7 @@ parsefield(struct pkg_format_node *cur, const char *fmt, const char *fmtend)
len = ws - fmt;
}
- cur->type = field;
+ cur->type = PKG_FORMAT_FIELD;
cur->data = m_malloc(len + 1);
memcpy(cur->data, fmt, len);
cur->data[len] = '\0';
@@ -109,7 +109,7 @@ parsestring(struct pkg_format_node *cur, const char *fmt, const char *fmtend)
len = fmtend - fmt + 1;
- cur->type = string;
+ cur->type = PKG_FORMAT_STRING;
write = cur->data = m_malloc(len + 1);
while (fmt <= fmtend) {
if (*fmt == '\\') {
@@ -321,10 +321,10 @@ pkg_format_show(const struct pkg_format_node *head,
else
strcpy(fmt, "%s");
- if (head->type == string) {
+ if (head->type == PKG_FORMAT_STRING) {
varbuf_printf(&fb, fmt, head->data);
ok = true;
- } else if (head->type == field) {
+ } else if (head->type == PKG_FORMAT_FIELD) {
const struct fieldinfo *fip;
fip = find_field_info(fieldinfos, head);