From: Michael Vrable Date: Sat, 31 Oct 2009 17:56:08 +0000 (-0700) Subject: Split BlueSky include files into public and private parts. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=afdaf6a249027cccc296b8923dd95fd38736b70d;p=bluesky.git Split BlueSky include files into public and private parts. Actually sorting out what goes where still needs to be done. --- diff --git a/bluesky/bluesky-private.h b/bluesky/bluesky-private.h new file mode 100644 index 0000000..35616d7 --- /dev/null +++ b/bluesky/bluesky-private.h @@ -0,0 +1,28 @@ +/* Blue Sky: File Systems in the Cloud + * + * Copyright (C) 2009 The Regents of the University of California + * Written by Michael Vrable + * + * TODO: Licensing + */ + +/* Declarations internal to the BlueSky library. This header file should not + * be included by any users of the library (such as any filesystem + * proxy)--external users should only include bluesky.h. */ + +#ifndef _BLUESKY_PRIVATE_H +#define _BLUESKY_PRIVATE_H + +#include "bluesky.h" + +#ifdef __cplusplus +extern "C" { +#endif + +BlueSkyFS *bluesky_new_fs(gchar *name); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bluesky/bluesky.h b/bluesky/bluesky.h index 8eff412..6f919f4 100644 --- a/bluesky/bluesky.h +++ b/bluesky/bluesky.h @@ -188,7 +188,6 @@ typedef struct { BlueSkyRCStr *data; /* Pointer to data in memory if cached */ } BlueSkyBlock; -BlueSkyFS *bluesky_new_fs(gchar *name); BlueSkyFS *bluesky_init_fs(gchar *name, BlueSkyStore *store); void bluesky_superblock_flush(BlueSkyFS *fs); diff --git a/bluesky/crypto.c b/bluesky/crypto.c index fff4e0d..c40c15c 100644 --- a/bluesky/crypto.c +++ b/bluesky/crypto.c @@ -13,7 +13,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" static int DISABLE_CRYPTO = 1; diff --git a/bluesky/dir.c b/bluesky/dir.c index 724320a..44729b4 100644 --- a/bluesky/dir.c +++ b/bluesky/dir.c @@ -10,7 +10,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Core filesystem: handling of directories. */ diff --git a/bluesky/file.c b/bluesky/file.c index a144e25..fa4705a 100644 --- a/bluesky/file.c +++ b/bluesky/file.c @@ -10,7 +10,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Core filesystem: handling of regular files and caching of file data. */ diff --git a/bluesky/init.c b/bluesky/init.c index f12aae4..2693c90 100644 --- a/bluesky/init.c +++ b/bluesky/init.c @@ -11,7 +11,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* BlueSky library initialization. */ diff --git a/bluesky/inode.c b/bluesky/inode.c index cab49a6..5e91432 100644 --- a/bluesky/inode.c +++ b/bluesky/inode.c @@ -12,7 +12,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Core filesystem. Different proxies, such as the NFSv3 one, interface to * this, but the core actually tracks the data which is stored. So far we just diff --git a/bluesky/main.c b/bluesky/main.c index 29ef60b..03de1b9 100644 --- a/bluesky/main.c +++ b/bluesky/main.c @@ -12,7 +12,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Small test program for BlueSkyFS. Doesn't do much useful. */ diff --git a/bluesky/s3store.c b/bluesky/s3store.c index 4602136..f85a252 100644 --- a/bluesky/s3store.c +++ b/bluesky/s3store.c @@ -11,7 +11,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" #include "libs3.h" /* Interface to Amazon S3 storage. */ diff --git a/bluesky/serialize.c b/bluesky/serialize.c index 7f7f041..e243bd2 100644 --- a/bluesky/serialize.c +++ b/bluesky/serialize.c @@ -11,7 +11,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Serialization of in-memory filesystem data structures to bytestrings which * can be written to persistent storage. All data is stored in little-endian diff --git a/bluesky/store.c b/bluesky/store.c index 9e0fca1..50b47b0 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -10,7 +10,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Interaction with cloud storage. We expose very simple GET/PUT style * interface, which different backends can implement. Available backends diff --git a/bluesky/util.c b/bluesky/util.c index 6a36169..1f98990 100644 --- a/bluesky/util.c +++ b/bluesky/util.c @@ -11,7 +11,7 @@ #include #include -#include "bluesky.h" +#include "bluesky-private.h" /* Miscellaneous useful functions that don't really fit anywhere else. */ diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index 323c1b1..727011d 100644 --- a/nfs3/nfsd.c +++ b/nfs3/nfsd.c @@ -24,6 +24,7 @@ void register_rpc(); BlueSkyFS *fs; +BlueSkyStore *store; static uint8_t filesystem_key[16]; int main(int argc, char *argv[]) @@ -39,7 +40,8 @@ int main(int argc, char *argv[]) } printf("\n"); - fs = bluesky_new_fs("export"); + store = bluesky_store_new("file"); + fs = bluesky_init_fs("export", store); fs->encryption_key = filesystem_key; BlueSkyInode *root;