summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-08-10 14:50:55 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-08-10 14:50:55 +0300
commite38e9c2db7db666605ef914fb481397e784eb7d8 (patch)
tree33c50ba4e2bb69d2c5207d66368eac5bbd7d0f1e
parent679cadbe809bdf5436b4f7c48d9722c08a59ab59 (diff)
downloadsquark-e38e9c2db7db666605ef914fb481397e784eb7d8.tar.bz2
squark-e38e9c2db7db666605ef914fb481397e784eb7d8.tar.xz
squarkdb: use stdint.h defined typedefs
u_int32_t is not standard, use uint32_t from stdint.h instead.
-rw-r--r--squarkdb.c4
-rw-r--r--squarkdb.h25
2 files changed, 15 insertions, 14 deletions
diff --git a/squarkdb.c b/squarkdb.c
index a62ea61..543cbb1 100644
--- a/squarkdb.c
+++ b/squarkdb.c
@@ -85,7 +85,7 @@ void sqdb_close(struct sqdb *db)
close(db->fd);
}
-void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size)
+void *sqdb_section_create(struct sqdb *db, int id, uint32_t size)
{
struct sqdb_header *hdr;
size_t pos;
@@ -106,7 +106,7 @@ void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size)
return db->mmap_base + pos;
}
-void *sqdb_section_get(struct sqdb *db, int id, u_int32_t *size)
+void *sqdb_section_get(struct sqdb *db, int id, uint32_t *size)
{
struct sqdb_header *hdr = db->mmap_base;
diff --git a/squarkdb.h b/squarkdb.h
index 2f96155..3733ec1 100644
--- a/squarkdb.h
+++ b/squarkdb.h
@@ -1,6 +1,7 @@
#ifndef SQUARKDB_H
#define SQUARKDB_H
+#include <stddef.h>
#include <stdint.h>
#define SQDB_SECTION_STRINGS 0
@@ -18,24 +19,24 @@ struct sqdb {
};
struct sqdb_section {
- u_int32_t offset;
- u_int32_t length;
+ uint32_t offset;
+ uint32_t length;
};
struct sqdb_header {
char description[116];
- u_int32_t num_sections;
- u_int32_t version;
- u_int32_t magic;
+ uint32_t num_sections;
+ uint32_t version;
+ uint32_t magic;
struct sqdb_section section[SQDB_SECTION_MAX];
};
struct sqdb_index_entry {
- u_int32_t has_subdomains : 1;
- u_int32_t has_paths : 1;
- u_int32_t category : 6;
- u_int32_t parent : 24;
- u_int32_t component;
+ uint32_t has_subdomains : 1;
+ uint32_t has_paths : 1;
+ uint32_t category : 6;
+ uint32_t parent : 24;
+ uint32_t component;
};
const char *sqdb_section_names[SQDB_SECTION_MAX];
@@ -44,7 +45,7 @@ int sqdb_create(struct sqdb *db, const char *fn);
int sqdb_open(struct sqdb *db, const char *fn);
void sqdb_close(struct sqdb *db);
-void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size);
-void *sqdb_section_get(struct sqdb *db, int id, u_int32_t *size);
+void *sqdb_section_create(struct sqdb *db, int id, uint32_t size);
+void *sqdb_section_get(struct sqdb *db, int id, uint32_t *size);
#endif