Commit ae7e1b7b authored by Sandrine Avakian's avatar Sandrine Avakian

Fixing read bug and documenting.

parent bdee27db
......@@ -937,8 +937,7 @@ void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filenam
ms_error("Could not open %s for write", realfilepath);
goto end;
}
fprintf(pFile->file, "%s", data);
bctbx_file_fprintf(pFile, 0, "%s",data);
bctbx_file_close(pFile);
end:
......
This diff is collapsed.
/*
sqlite3_bctbx_vfs.h
Copyright (C) 2016 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
......@@ -17,6 +36,7 @@
/**
* sqlite3_bctbx_file VFS file structure.
*/
typedef struct sqlite3_bctbx_file sqlite3_bctbx_file;
struct sqlite3_bctbx_file {
......@@ -27,18 +47,21 @@ struct sqlite3_bctbx_file {
/**
* Very simple VFS structure based on sqlite3_vfs.
* Only the Open function is implemented,
*/
typedef struct sqlite3_bctbx_vfs sqlite3_bctbx_vfs;
struct sqlite3_bctbx_vfs {
sqlite3_bctbx_vfs *pNext; /* Next registered VFS */
const char *vfsName; /* Virtual file system name */
int (*xOpen)(sqlite3_vfs* pVfs, const char *fName, sqlite3_file *pFile,int flags, int *pOutFlags);
// int (*xDelete)(bc_vfs*, const char *vfsName, int syncDir);
// int (*xFullPathname)(bc_vfs*, const char *vfsName, int nOut, char *zOut);
};
/****************************************************
VFS API to register this VFS to sqlite3 VFS
*****************************************************/
sqlite3_vfs *sqlite3_bctbx_vfs_create(void);
//int bctbx_file_read(bc_vfs_file* pFile, void *buf, int count, uint64_t offset);
//int bctbx_file_close(bc_vfs_file* pFile);
//bc_vfs_file* bctbx_file_open(sqlite3_vfs* pVfs, const char *fName, const char* mode);
void sqlite3_bctbx_vfs_register(int makeDefault);
void sqlite3_bctbx_vfs_unregister(void);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment