~ubuntu-branches/ubuntu/wily/sqlite3/wily

« back to all changes in this revision

Viewing changes to src/test_quota.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-05-23 00:22:02 UTC
  • mfrom: (0.32.1) (1.6.4) (9.1.35 sid)
  • Revision ID: package-import@ubuntu.com-20120523002202-fueloshwtj57cadf
Tags: 3.7.12.1-1
New upstream release (closes: #674078).

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef _QUOTA_H_
30
30
#include "sqlite3.h"
31
31
#include <stdio.h>
 
32
#include <sys/types.h>
 
33
#include <sys/stat.h>
 
34
#if SQLITE_OS_UNIX
 
35
# include <unistd.h>
 
36
#endif
 
37
#if SQLITE_OS_WIN
 
38
# include <windows.h>
 
39
#endif
32
40
 
33
41
/* Make this callable from C++ */
34
42
#ifdef __cplusplus
183
191
long sqlite3_quota_ftell(quota_FILE*);
184
192
 
185
193
/*
 
194
** Truncate a file previously opened by sqlite3_quota_fopen().  Return
 
195
** zero on success and non-zero on any kind of failure.
 
196
**
 
197
** The newSize argument must be less than or equal to the current file size.
 
198
** Any attempt to "truncate" a file to a larger size results in 
 
199
** undefined behavior.
 
200
*/
 
201
int sqlite3_quota_ftrunate(quota_FILE*, sqlite3_int64 newSize);
 
202
 
 
203
/*
 
204
** Return the last modification time of the opened file, in seconds
 
205
** since 1970.
 
206
*/
 
207
int sqlite3_quota_file_mtime(quota_FILE*, time_t *pTime);
 
208
 
 
209
/*
 
210
** Return the size of the file as it is known to the quota system.
 
211
**
 
212
** This size might be different from the true size of the file on
 
213
** disk if some outside process has modified the file without using the
 
214
** quota mechanism, or if calls to sqlite3_quota_fwrite() have occurred
 
215
** which have increased the file size, but those writes have not yet been
 
216
** forced to disk using sqlite3_quota_fflush().
 
217
**
 
218
** Return -1 if the file is not participating in quota management.
 
219
*/
 
220
sqlite3_int64 sqlite3_quota_file_size(quota_FILE*);
 
221
 
 
222
/*
 
223
** Return the true size of the file.
 
224
**
 
225
** The true size should be the same as the size of the file as known
 
226
** to the quota system, however the sizes might be different if the
 
227
** file has been extended or truncated via some outside process or if
 
228
** pending writes have not yet been flushed to disk.
 
229
**
 
230
** Return -1 if the file does not exist or if the size of the file
 
231
** cannot be determined for some reason.
 
232
*/
 
233
sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE*);
 
234
 
 
235
/*
186
236
** Delete a file from the disk, if that file is under quota management.
187
237
** Adjust quotas accordingly.
188
238
**