DBD-SQLite-Amalgamation
view release on metacpan or search on metacpan
sqlite-amalgamation.c view on Meta::CPAN
/* 133 */ "NotUsed_133",
/* 134 */ "NotUsed_134",
/* 135 */ "NotUsed_135",
/* 136 */ "NotUsed_136",
/* 137 */ "NotUsed_137",
/* 138 */ "ToText",
/* 139 */ "ToBlob",
/* 140 */ "ToNumeric",
/* 141 */ "ToInt",
/* 142 */ "ToReal",
};
return azName[i];
}
#endif
/************** End of opcodes.c *********************************************/
/************** Begin file os_os2.c ******************************************/
/*
** 2006 Feb 14
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains code that is specific to OS/2.
**
** $Id: os_os2.c,v 1.55 2008/07/29 18:49:29 pweilbacher Exp $
*/
#if SQLITE_OS_OS2
/*
** A Note About Memory Allocation:
**
** This driver uses malloc()/free() directly rather than going through
** the SQLite-wrappers sqlite3_malloc()/sqlite3_free(). Those wrappers
** are designed for use on embedded systems where memory is scarce and
** malloc failures happen frequently. OS/2 does not typically run on
** embedded systems, and when it does the developers normally have bigger
** problems to worry about than running out of memory. So there is not
** a compelling need to use the wrappers.
**
** But there is a good reason to not use the wrappers. If we use the
** wrappers then we will get simulated malloc() failures within this
** driver. And that causes all kinds of problems for our tests. We
** could enhance SQLite to deal with simulated malloc failures within
** the OS driver, but the code to deal with those failure would not
** be exercised on Linux (which does not need to malloc() in the driver)
** and so we would have difficulty writing coverage tests for that
** code. Better to leave the code out, we think.
**
** The point of this discussion is as follows: When creating a new
** OS layer for an embedded system, if you use this file as an example,
** avoid the use of malloc()/free(). Those routines work ok on OS/2
** desktops but not so well in embedded systems.
*/
/*
** Macros used to determine whether or not to use threads.
*/
#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE
# define SQLITE_OS2_THREADS 1
#endif
/*
** Include code that is common to all os_*.c files
*/
/************** Include os_common.h in the middle of os_os2.c ****************/
/************** Begin file os_common.h ***************************************/
/*
** 2004 May 22
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains macros and a little bit of code that is common to
** all of the platform-specific files (os_*.c) and is #included into those
** files.
**
** This file should be #included by the os_*.c files only. It is not a
** general purpose header file.
**
** $Id: os_common.h,v 1.37 2008/05/29 20:22:37 shane Exp $
*/
#ifndef _OS_COMMON_H_
#define _OS_COMMON_H_
/*
** At least two bugs have slipped in because we changed the MEMORY_DEBUG
** macro to SQLITE_DEBUG and some older makefiles have not yet made the
** switch. The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
/*
* When testing, this global variable stores the location of the
* pending-byte in the database file.
*/
#ifdef SQLITE_TEST
SQLITE_API unsigned int sqlite3_pending_byte = 0x40000000;
#endif
#ifdef SQLITE_DEBUG
SQLITE_PRIVATE int sqlite3OSTrace = 0;
#define OSTRACE1(X) if( sqlite3OSTrace ) sqlite3DebugPrintf(X)
#define OSTRACE2(X,Y) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y)
sqlite-amalgamation.c view on Meta::CPAN
}
#endif
#endif
sqlite3_vfs_register(&unixVfs, 1);
return SQLITE_OK;
}
/*
** Shutdown the operating system interface. This is a no-op for unix.
*/
SQLITE_API int sqlite3_os_end(void){
return SQLITE_OK;
}
#endif /* SQLITE_OS_UNIX */
/************** End of os_unix.c *********************************************/
/************** Begin file os_win.c ******************************************/
/*
** 2004 May 22
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains code that is specific to windows.
**
** $Id: os_win.c,v 1.132 2008/07/31 01:34:34 shane Exp $
*/
#if SQLITE_OS_WIN /* This file is used for windows only */
/*
** A Note About Memory Allocation:
**
** This driver uses malloc()/free() directly rather than going through
** the SQLite-wrappers sqlite3_malloc()/sqlite3_free(). Those wrappers
** are designed for use on embedded systems where memory is scarce and
** malloc failures happen frequently. Win32 does not typically run on
** embedded systems, and when it does the developers normally have bigger
** problems to worry about than running out of memory. So there is not
** a compelling need to use the wrappers.
**
** But there is a good reason to not use the wrappers. If we use the
** wrappers then we will get simulated malloc() failures within this
** driver. And that causes all kinds of problems for our tests. We
** could enhance SQLite to deal with simulated malloc failures within
** the OS driver, but the code to deal with those failure would not
** be exercised on Linux (which does not need to malloc() in the driver)
** and so we would have difficulty writing coverage tests for that
** code. Better to leave the code out, we think.
**
** The point of this discussion is as follows: When creating a new
** OS layer for an embedded system, if you use this file as an example,
** avoid the use of malloc()/free(). Those routines work ok on windows
** desktops but not so well in embedded systems.
*/
#include <winbase.h>
#ifdef __CYGWIN__
# include <sys/cygwin.h>
#endif
/*
** Macros used to determine whether or not to use threads.
*/
#if defined(THREADSAFE) && THREADSAFE
# define SQLITE_W32_THREADS 1
#endif
/*
** Include code that is common to all os_*.c files
*/
/************** Include os_common.h in the middle of os_win.c ****************/
/************** Begin file os_common.h ***************************************/
/*
** 2004 May 22
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains macros and a little bit of code that is common to
** all of the platform-specific files (os_*.c) and is #included into those
** files.
**
** This file should be #included by the os_*.c files only. It is not a
** general purpose header file.
**
** $Id: os_common.h,v 1.37 2008/05/29 20:22:37 shane Exp $
*/
#ifndef _OS_COMMON_H_
#define _OS_COMMON_H_
/*
** At least two bugs have slipped in because we changed the MEMORY_DEBUG
** macro to SQLITE_DEBUG and some older makefiles have not yet made the
** switch. The following code should catch this problem at compile-time.
*/
#ifdef MEMORY_DEBUG
# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
#endif
/*
* When testing, this global variable stores the location of the
* pending-byte in the database file.
*/
#ifdef SQLITE_TEST
SQLITE_API unsigned int sqlite3_pending_byte = 0x40000000;
( run in 1.748 second using v1.01-cache-2.11-cpan-13bb782fe5a )