From 6649418220ea771f13092190d38dcb95383d6a78 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Fri, 20 May 2016 16:15:09 +0200 Subject: [PATCH] Cosmetic - renaming fun, moving doc . --- coreapi/lpconfig.c | 12 ++++++------ coreapi/sqlite3_bctbx_vfs.c | 32 +------------------------------- coreapi/sqlite3_bctbx_vfs.h | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index 39c2f9d7f..6e7606adf 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -432,7 +432,7 @@ LpConfig *lp_config_new_with_factory(const char *config_filename, const char *fa #endif /*_WIN32*/ /*open with r+ to check if we can write on it later*/ - pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs,lpconfig->filename, "r+"); + pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,lpconfig->filename, "r+"); fd = pFile->fd; lpconfig->pFile = pFile; @@ -464,7 +464,7 @@ fail: int lp_config_read_file(LpConfig *lpconfig, const char *filename){ char* path = lp_realpath(filename, NULL); int fd=-1; - bctbx_vfs_file_t* pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs, path, "r"); + bctbx_vfs_file_t* pFile = bctbx_file_open(lpconfig->g_bctbx_vfs, path, "r"); fd = pFile->fd; if (fd != -1){ ms_message("Reading config information from %s", path); @@ -761,7 +761,7 @@ int lp_config_sync(LpConfig *lpconfig){ /* don't create group/world-accessible files */ (void) umask(S_IRWXG | S_IRWXO); #endif - pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs,lpconfig->tmpfilename, "w"); + pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,lpconfig->tmpfilename, "w"); lpconfig->pFile = pFile; fd = pFile->fd; if (fd == -1 ){ @@ -902,7 +902,7 @@ bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *file if(realfilepath == NULL) return FALSE; - pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs,realfilepath, "r"); + pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,realfilepath, "r"); ms_free(realfilepath); if (pFile->fd != -1) { bctbx_file_close(pFile); @@ -935,7 +935,7 @@ void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filenam goto end; } - pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs,realfilepath, "w"); + pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,realfilepath, "w"); fd = pFile->fd; if(fd == -1) { @@ -971,7 +971,7 @@ int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename, goto err; } - pFile = bctbx_file_create_and_open(lpconfig->g_bctbx_vfs,realfilepath,"r"); + pFile = bctbx_file_open(lpconfig->g_bctbx_vfs,realfilepath,"r"); if (pFile !=NULL) fd = pFile->fd; diff --git a/coreapi/sqlite3_bctbx_vfs.c b/coreapi/sqlite3_bctbx_vfs.c index 00de686d6..79512172e 100644 --- a/coreapi/sqlite3_bctbx_vfs.c +++ b/coreapi/sqlite3_bctbx_vfs.c @@ -273,27 +273,7 @@ static int sqlite3bctbx_Open(sqlite3_vfs *pVfs, const char *fName, sqlite3_file return SQLITE_OK; } -/** - * Returns a sqlite3_vfs pointer to the VFS named sqlite3bctbx_vfs - * implemented in this file. - * Methods not implemented: - * xDelete - * xAccess - * xFullPathname - * xDlOpen - * xDlError - * xDlSym - * xDlClose - * xRandomness - * xSleep - * xCurrentTime , xCurrentTimeInt64, - * xGetLastError - * xGetSystemCall - * xSetSystemCall - * xNextSystemCall - * To make the VFS available to SQLite - * @return Pointer to bctbx_vfs. - */ + sqlite3_vfs *sqlite3_bctbx_vfs_create(void){ static sqlite3_vfs bctbx_vfs = { @@ -319,13 +299,6 @@ sqlite3_vfs *sqlite3_bctbx_vfs_create(void){ } -/** - * Registers sqlite3bctbx_vfs to SQLite VFS. If makeDefault is 1, - * the VFS will be used by default. - * Methods not implemented by sqlite3_bctbx_vfs are initialized to the one - * used by the unix-none VFS where all locking file operations are no-ops. - * @param makeDefault set to 1 to make the newly registered VFS be the default one, set to 0 instead. - */ void sqlite3_bctbx_vfs_register( int makeDefault){ sqlite3_vfs* pVfsToUse = sqlite3_bctbx_vfs_create(); sqlite3_vfs* pDefault = sqlite3_vfs_find("unix-none"); @@ -353,9 +326,6 @@ void sqlite3_bctbx_vfs_register( int makeDefault){ } -/** - * Unregisters sqlite3bctbx_vfs from SQLite. - */ void sqlite3_bctbx_vfs_unregister(void) { sqlite3_vfs* pVfs = sqlite3_vfs_find("sqlite3bctbx_vfs"); diff --git a/coreapi/sqlite3_bctbx_vfs.h b/coreapi/sqlite3_bctbx_vfs.h index d1e533a27..701e5f975 100644 --- a/coreapi/sqlite3_bctbx_vfs.h +++ b/coreapi/sqlite3_bctbx_vfs.h @@ -63,8 +63,43 @@ struct sqlite3_bctbx_vfs { /**************************************************** VFS API to register this VFS to sqlite3 VFS *****************************************************/ + +/** + * Returns a sqlite3_vfs pointer to the VFS named sqlite3bctbx_vfs + * implemented in this file. + * Methods not implemented: + * xDelete + * xAccess + * xFullPathname + * xDlOpen + * xDlError + * xDlSym + * xDlClose + * xRandomness + * xSleep + * xCurrentTime , xCurrentTimeInt64, + * xGetLastError + * xGetSystemCall + * xSetSystemCall + * xNextSystemCall + * To make the VFS available to SQLite + * @return Pointer to bctbx_vfs. + */ sqlite3_vfs *sqlite3_bctbx_vfs_create(void); + +/** + * Registers sqlite3bctbx_vfs to SQLite VFS. If makeDefault is 1, + * the VFS will be used by default. + * Methods not implemented by sqlite3_bctbx_vfs are initialized to the one + * used by the unix-none VFS where all locking file operations are no-ops. + * @param makeDefault set to 1 to make the newly registered VFS be the default one, set to 0 instead. + */ void sqlite3_bctbx_vfs_register(int makeDefault); + + +/** + * Unregisters sqlite3bctbx_vfs from SQLite. + */ void sqlite3_bctbx_vfs_unregister(void); #endif