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

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


Author: ivaxer
Date: Thu Jul  1 07:36:13 2010
New Revision: 273309

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273309
Log:
new ast_storage design: added and fixed functions prototypes, changed
ast_storage_be

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=273309&r1=273308&r2=273309
==============================================================================
--- team/ivaxer/ast_storage/include/asterisk/storage.h (original)
+++ team/ivaxer/ast_storage/include/asterisk/storage.h Thu Jul  1 07:36:13 2010
@@ -58,7 +58,14 @@
 	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);
+	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);
+	size_t (*read)(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
+	size_t (*write)(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
 	struct ast_storage_dirobject *(*listdir)(struct ast_storage *st, const char *objectpath);
+	unsigned long (*tell)(struct ast_storage *st, struct ast_storage_fileinst *fi);
+	int (*seek)(struct ast_storage *st, struct ast_storage_fileinst *fi);
+	int (*copy)(struct ast_storage *st, struct ast_storage_fileobject *from, struct ast_storage_fileobject *to);
 	AST_RWLIST_ENTRY(ast_storage_be) list;
 	struct ast_module *module;
 };
@@ -77,7 +84,6 @@
 int ast_storage_engine_init(void);
 
 /*! \brief Retrieves an instance of a storage method
- * \param storage_type Name of the backend
  * \param uri Backend specific URI to the resource
  */
 struct ast_storage *ast_storage_request(const char *uri);
@@ -90,57 +96,37 @@
  * \param st Storage instance
  * \param objectname Logical name of the file
  * \param exts File extensions to retrieve
- * \param localfile Buffer in which to place the name of the resulting temporary file.
- * \param localfilesize Length of the above buffer
  */
-int ast_storage_get(struct ast_storage *st, const char *objectname, const char *exts, char *localfile, size_t localfilesize);
+struct ast_storage_fileobject *ast_storage_get(struct ast_storage *st, const char *objectname, const char *exts);
 
-#if 0
 /*! \brief Stores a file into the storage medium
  * \param st Storage instance
- * \param exts File extensions to store
+ * \param fo File object to store
  */
-int ast_storage_put(struct ast_storage *st, const char *exts);
-#endif
+int ast_storage_put(struct ast_storage *st, struct ast_storage_fileobject *fo);
 
 int ast_storage_open(struct ast_storage *st, struct ast_storage_fileinst *fi, mode_t mode);
 int ast_storage_close(struct ast_storage *st, struct ast_storage_fileinst *fi);
-void *ast_storage_read(struct ast_storage *st, struct ast_storage_fileinst *fi, size_t chunksize);
-int ast_storage_write(struct ast_storage *st, struct ast_storage_fileinst *fi, void *data, size_t chunksize);
+
+int ast_storage_read(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
+int ast_storage_write(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
 
 /*! \brief Removes a file from the storage medium
  * \param st Storage instance
- * \param exts File extensions to delete
+ * \param fo File object to delete
  */
-int ast_storage_del(struct ast_storage *st, const char *exts);
+int ast_storage_del(struct ast_storage *st, struct ast_storage_fileobject *fo);
 
-int ast_storage_copy(struct ast_storage *st, struct ast_storage_fileinst *from, struct ast_storage_fileinst *to);
+int ast_storage_copy(struct ast_storage *st, struct ast_storage_fileobject *from, struct ast_storage_fileobject *to);
 
 /*! \brief Starts retrieval of objects in a resource path
  * \param st Storage instance
  * \param pathname Logical name of the path
- * \return Pointer identifying this listing, or NULL on error.
  */
-void *ast_storage_opendir(struct ast_storage *st, const char *objectname);
+struct ast_storage_dirobject *ast_storage_listdir(struct ast_storage *st, const char *pathname);
 
-/*! \brief Retrieves an objectname from a previously opened path
- * \param st Storage instance
- * \param dirptr Pointer returned by ast_storage_opendir
- * \param dirent Pointer to a storage area for the object
- */
-int ast_storage_readdir(struct ast_storage *st, void *dirptr, struct ast_storage_dirent *dirent);
-
-/*! \brief Ends retrieval of objects in a resource path
- * \param st Storage instance
- * \param dirptr Pointer returned by ast_storage_opendir
- */
-int ast_storage_closedir(struct ast_storage *st, void *dirptr);
-
-/*! \brief Retrieves a count of objects at a particular path
- * \param st Storage instance
- * \param objectname Logical name of the file
- */
-int ast_storage_count(struct ast_storage *st, const char *objectname);
+unsigned long ast_storage_tell(struct ast_storage *st, struct ast_storage_fileinst *fi);
+int ast_storage_seek(struct ast_storage *st, struct ast_storage_fileinst *fi);
 
 /*! \brief Get storage engine by name
  * \param name Name of storage engine




More information about the asterisk-commits mailing list