[asterisk-commits] ivaxer: branch ivaxer/ast_storage r273308 - /team/ivaxer/ast_storage/include/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 1 07:35:38 CDT 2010


Author: ivaxer
Date: Thu Jul  1 07:35:34 2010
New Revision: 273308

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273308
Log:
fix ast_storage structures for new design

Modified:
    team/ivaxer/ast_storage/include/asterisk/storage.h

Modified: team/ivaxer/ast_storage/include/asterisk/storage.h
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/include/asterisk/storage.h?view=diff&rev=273308&r1=273307&r2=273308
==============================================================================
--- team/ivaxer/ast_storage/include/asterisk/storage.h (original)
+++ team/ivaxer/ast_storage/include/asterisk/storage.h Thu Jul  1 07:35:34 2010
@@ -31,49 +31,34 @@
 extern "C" {
 #endif
 
-struct ast_storage_dirent {
-	char name[PATH_MAX];
+struct ast_storage_fileinst {
 	int fd;
+	AST_RWLIST_ENTRY(ast_storage_fileinst) list;
+	char localpath[1];
 };
 
-/* XXX How are we going to handle metadata about the file?
- * Is there common metadata that we want/need to store?
- * examples: duration, time created
- */
-struct ast_storage_metadata {
-	time_t duration;
-	time_t created;
-};
-
-struct ast_storage_fileinst {
-	struct ast_storage_dirent *ent;
-	AST_RWLIST_ENTRY(ast_storage_fileinst) list;
-};
-
-struct ast_storage_filelist {
+struct ast_storage_fileobject {
 	char name[256];
-	struct ast_storage_metadata *metadata;
 	AST_RWLIST_HEAD(, ast_storage_fileinst) files;
 };
 
+struct ast_storage_fileobjectlist {
+	struct ast_storage_fileobject fileobject;
+	AST_RWLIST_ENTRY(ast_storage_fileobjectlist) list;
+};
+
+struct ast_storage_dirobject {
+	char objectpath[256];
+	AST_RWLIST_HEAD(, ast_storage_fileobjectlist) fileobjects;
+};
+
 struct ast_storage_be {
-	const char *name;
 	struct ast_storage *(*create)(const char *uri);
-	int (*free)(struct ast_storage *st);
-	int (*get)(struct ast_storage *st, const char *objectname, const char *exts, char *localfile, size_t localfilesize);
-#if 0
-	/* We don't need no stinkin' put() function. */
-	int (*put)(struct ast_storage *st, const char *exts);
-#endif
-	int (*open)(struct ast_storage *st, struct ast_storage_fileinst *fi, mode_t mode);
-	int (*close)(struct ast_storage *st, struct ast_storage_fileinst *fi);
-	void *(*read)(struct ast_storage *st, struct ast_storage_fileinst *fi, size_t chunksize);
-	int (*write)(struct ast_storage *st, struct ast_storage_fileinst *fi, void *data, size_t chunksize);
-	int (*del)(struct ast_storage *st, const char *exts);
-	void *(*opendir)(struct ast_storage *st, const char *objectpath);
-	int (*readdir)(struct ast_storage *st, void *dirptr, struct ast_storage_dirent *dirent);
-	int (*closedir)(struct ast_storage *st, void *dirptr);
-	int (*status)(struct ast_storage *st, int fd);
+	int (*release)(struct ast_storage *st);
+	struct ast_storage_fileobject *(*get)(struct ast_storage *st, const char *objectname, const char *exts);
+	int (*put)(struct ast_storage *st, ast_storage_fileobject *fo);
+	int (*del)(struct ast_storage *st, ast_storage_fileobject *fo);
+	struct ast_storage_dirobject *(*listdir)(struct ast_storage *st, const char *objectpath);
 	AST_RWLIST_ENTRY(ast_storage_be) list;
 	struct ast_module *module;
 };
@@ -81,9 +66,7 @@
 /* Most specific backends will have longer structures */
 struct ast_storage {
 	const struct ast_storage_be *be;
-	char path[PATH_MAX];
-	struct ast_storage_filelist *fl;
-	void **xst; /* Backend specific structure */
+	void *storage_pvt; /* Backend specific structure */
 };
 
 int __ast_register_storage(const struct ast_storage_be *e, struct ast_module *mod);




More information about the asterisk-commits mailing list