Blame src/test_multiplex.h

Packit 87b942
/*
Packit 87b942
** 2011 March 18
Packit 87b942
**
Packit 87b942
** The author disclaims copyright to this source code.  In place of
Packit 87b942
** a legal notice, here is a blessing:
Packit 87b942
**
Packit 87b942
**    May you do good and not evil.
Packit 87b942
**    May you find forgiveness for yourself and forgive others.
Packit 87b942
**    May you share freely, never taking more than you give.
Packit 87b942
**
Packit 87b942
*************************************************************************
Packit 87b942
**
Packit 87b942
** This file contains a VFS "shim" - a layer that sits in between the
Packit 87b942
** pager and the real VFS.
Packit 87b942
**
Packit 87b942
** This particular shim enforces a multiplex system on DB files.  
Packit 87b942
** This shim shards/partitions a single DB file into smaller 
Packit 87b942
** "chunks" such that the total DB file size may exceed the maximum
Packit 87b942
** file size of the underlying file system.
Packit 87b942
**
Packit 87b942
*/
Packit 87b942
Packit 87b942
#ifndef SQLITE_TEST_MULTIPLEX_H
Packit 87b942
#define SQLITE_TEST_MULTIPLEX_H
Packit 87b942
Packit 87b942
/*
Packit 87b942
** CAPI: File-control Operations Supported by Multiplex VFS
Packit 87b942
**
Packit 87b942
** Values interpreted by the xFileControl method of a Multiplex VFS db file-handle.
Packit 87b942
**
Packit 87b942
** MULTIPLEX_CTRL_ENABLE:
Packit 87b942
**   This file control is used to enable or disable the multiplex
Packit 87b942
**   shim.
Packit 87b942
**
Packit 87b942
** MULTIPLEX_CTRL_SET_CHUNK_SIZE:
Packit 87b942
**   This file control is used to set the maximum allowed chunk 
Packit 87b942
**   size for a multiplex file set.  The chunk size should be 
Packit 87b942
**   a multiple of SQLITE_MAX_PAGE_SIZE, and will be rounded up
Packit 87b942
**   if not.
Packit 87b942
**
Packit 87b942
** MULTIPLEX_CTRL_SET_MAX_CHUNKS:
Packit 87b942
**   This file control is used to set the maximum number of chunks
Packit 87b942
**   allowed to be used for a mutliplex file set.
Packit 87b942
*/
Packit 87b942
#define MULTIPLEX_CTRL_ENABLE          214014
Packit 87b942
#define MULTIPLEX_CTRL_SET_CHUNK_SIZE  214015
Packit 87b942
#define MULTIPLEX_CTRL_SET_MAX_CHUNKS  214016
Packit 87b942
Packit 87b942
#ifdef __cplusplus
Packit 87b942
extern "C" {
Packit 87b942
#endif
Packit 87b942
Packit 87b942
/*
Packit 87b942
** CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize()
Packit 87b942
**
Packit 87b942
** Use the VFS named zOrigVfsName as the VFS that does the actual work.  
Packit 87b942
** Use the default if zOrigVfsName==NULL.  
Packit 87b942
**
Packit 87b942
** The multiplex VFS shim is named "multiplex".  It will become the default
Packit 87b942
** VFS if makeDefault is non-zero.
Packit 87b942
**
Packit 87b942
** An auto-extension is registered which will make the function 
Packit 87b942
** multiplex_control() available to database connections.  This
Packit 87b942
** function gives access to the xFileControl interface of the 
Packit 87b942
** multiplex VFS shim.
Packit 87b942
**
Packit 87b942
** SELECT multiplex_control(<op>,<val>);
Packit 87b942
** 
Packit 87b942
**   <op>=1 MULTIPLEX_CTRL_ENABLE
Packit 87b942
**   <val>=0 disable
Packit 87b942
**   <val>=1 enable
Packit 87b942
** 
Packit 87b942
**   <op>=2 MULTIPLEX_CTRL_SET_CHUNK_SIZE
Packit 87b942
**   <val> int, chunk size
Packit 87b942
** 
Packit 87b942
**   <op>=3 MULTIPLEX_CTRL_SET_MAX_CHUNKS
Packit 87b942
**   <val> int, max chunks
Packit 87b942
**
Packit 87b942
** THIS ROUTINE IS NOT THREADSAFE.  Call this routine exactly once
Packit 87b942
** during start-up.
Packit 87b942
*/
Packit 87b942
extern int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault);
Packit 87b942
Packit 87b942
/*
Packit 87b942
** CAPI: Shutdown the multiplex system - sqlite3_multiplex_shutdown()
Packit 87b942
**
Packit 87b942
** All SQLite database connections must be closed before calling this
Packit 87b942
** routine.
Packit 87b942
**
Packit 87b942
** THIS ROUTINE IS NOT THREADSAFE.  Call this routine exactly once while
Packit 87b942
** shutting down in order to free all remaining multiplex groups.
Packit 87b942
*/
Packit 87b942
extern int sqlite3_multiplex_shutdown(int eForce);
Packit 87b942
Packit 87b942
#ifdef __cplusplus
Packit 87b942
}  /* End of the 'extern "C"' block */
Packit 87b942
#endif
Packit 87b942
Packit 87b942
#endif /* SQLITE_TEST_MULTIPLEX_H */