aboutsummaryrefslogtreecommitdiffstats
path: root/lib/blkid/cache.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2003-01-26 01:54:39 -0500
committerTheodore Ts'o <tytso@mit.edu>2003-01-26 01:54:39 -0500
commit7a603aa89fcffb8798eca34ca3858db6f0393046 (patch)
treec5ea7fbca8452e45126d32f09c39e3b6ea12bf9a /lib/blkid/cache.c
parent0f3ac480c76d4574b9274de22784e76fd627ad6a (diff)
downloadandroid_external_e2fsprogs-7a603aa89fcffb8798eca34ca3858db6f0393046.tar.gz
android_external_e2fsprogs-7a603aa89fcffb8798eca34ca3858db6f0393046.tar.bz2
android_external_e2fsprogs-7a603aa89fcffb8798eca34ca3858db6f0393046.zip
Separate public and private interfaces into separate header files.
Start separating internal implementation details from the publically exported interface of the blkid library.
Diffstat (limited to 'lib/blkid/cache.c')
-rw-r--r--lib/blkid/cache.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c
index 74321443..188dc82c 100644
--- a/lib/blkid/cache.c
+++ b/lib/blkid/cache.c
@@ -10,7 +10,7 @@
*/
#include <stdlib.h>
-#include "blkid/blkid.h"
+#include "blkidP.h"
#ifdef DEBUG_CACHE
#include <stdio.h>
@@ -19,11 +19,11 @@
#define DBG(x)
#endif
-blkid_cache *blkid_new_cache(void)
+blkid_cache blkid_new_cache(void)
{
- blkid_cache *cache;
+ blkid_cache cache;
- if (!(cache = (blkid_cache *)calloc(1, sizeof(blkid_cache))))
+ if (!(cache = (blkid_cache) calloc(1, sizeof(struct blkid_struct_cache))))
return NULL;
INIT_LIST_HEAD(&cache->bic_devs);
@@ -32,7 +32,7 @@ blkid_cache *blkid_new_cache(void)
return cache;
}
-void blkid_free_cache(blkid_cache *cache)
+void blkid_free_cache(blkid_cache cache)
{
if (!cache)
return;
@@ -41,18 +41,21 @@ void blkid_free_cache(blkid_cache *cache)
/* DEB_DUMP_CACHE(cache); */
while (!list_empty(&cache->bic_devs)) {
- blkid_dev *dev = list_entry(cache->bic_devs.next, blkid_dev,
+ blkid_dev dev = list_entry(cache->bic_devs.next,
+ struct blkid_struct_dev,
bid_devs);
blkid_free_dev(dev);
}
while (!list_empty(&cache->bic_tags)) {
- blkid_tag *tag = list_entry(cache->bic_tags.next, blkid_tag,
- bit_tags);
+ blkid_tag tag = list_entry(cache->bic_tags.next,
+ struct blkid_struct_tag,
+ bit_tags);
while (!list_empty(&tag->bit_names)) {
- blkid_tag *bad = list_entry(tag->bit_names.next,
- blkid_tag, bit_names);
+ blkid_tag bad = list_entry(tag->bit_names.next,
+ struct blkid_struct_tag,
+ bit_names);
DBG(printf("warning: unfreed tag %s=%s\n",
bad->bit_name, bad->bit_val));
@@ -66,7 +69,7 @@ void blkid_free_cache(blkid_cache *cache)
#ifdef TEST_PROGRAM
int main(int argc, char** argv)
{
- blkid_cache *cache = NULL;
+ blkid_cache cache = NULL;
int ret;
if ((argc > 2)) {