AryaWu/sqlite
0
1/*2** 2011 March 183**4** The author disclaims copyright to this source code. In place of5** a legal notice, here is a blessing:6**7** May you do good and not evil.8** May you find forgiveness for yourself and forgive others.9** May you share freely, never taking more than you give.10**11*************************************************************************12**13** This file contains a VFS "shim" - a layer that sits in between the14** pager and the real VFS.15**16** This particular shim enforces a multiplex system on DB files. 17** This shim shards/partitions a single DB file into smaller18** "chunks" such that the total DB file size may exceed the maximum19** file size of the underlying file system.20**21*/22 23#ifndef SQLITE_TEST_MULTIPLEX_H24#define SQLITE_TEST_MULTIPLEX_H25 26/*27** CAPI: File-control Operations Supported by Multiplex VFS28**29** Values interpreted by the xFileControl method of a Multiplex VFS db file-handle.30**31** MULTIPLEX_CTRL_ENABLE:32** This file control is used to enable or disable the multiplex33** shim.34**35** MULTIPLEX_CTRL_SET_CHUNK_SIZE:36** This file control is used to set the maximum allowed chunk37** size for a multiplex file set. The chunk size should be38** a multiple of SQLITE_MAX_PAGE_SIZE, and will be rounded up39** if not.40**41** MULTIPLEX_CTRL_SET_MAX_CHUNKS:42** This file control is used to set the maximum number of chunks43** allowed to be used for a multiplex file set.44*/45#define MULTIPLEX_CTRL_ENABLE 21401446#define MULTIPLEX_CTRL_SET_CHUNK_SIZE 21401547#define MULTIPLEX_CTRL_SET_MAX_CHUNKS 21401648 49#ifdef __cplusplus50extern "C" {51#endif52 53/*54** CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize()55**56** Use the VFS named zOrigVfsName as the VFS that does the actual work. 57** Use the default if zOrigVfsName==NULL. 58**59** The multiplex VFS shim is named "multiplex". It will become the default60** VFS if makeDefault is non-zero.61**62** An auto-extension is registered which will make the function63** multiplex_control() available to database connections. This64** function gives access to the xFileControl interface of the65** multiplex VFS shim.66**67** SELECT multiplex_control(<op>,<val>);68**69** <op>=1 MULTIPLEX_CTRL_ENABLE70** <val>=0 disable71** <val>=1 enable72**73** <op>=2 MULTIPLEX_CTRL_SET_CHUNK_SIZE74** <val> int, chunk size75**76** <op>=3 MULTIPLEX_CTRL_SET_MAX_CHUNKS77** <val> int, max chunks78**79** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once80** during start-up.81*/82extern int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault);83 84/*85** CAPI: Shutdown the multiplex system - sqlite3_multiplex_shutdown()86**87** All SQLite database connections must be closed before calling this88** routine.89**90** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once while91** shutting down in order to free all remaining multiplex groups.92*/93extern int sqlite3_multiplex_shutdown(int eForce);94 95#ifdef __cplusplus96} /* End of the 'extern "C"' block */97#endif98 99#endif /* SQLITE_TEST_MULTIPLEX_H */100 