diff --git a/.gitignore b/.gitignore
index 940794e..c326d62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,13 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+# Backup files
+*.bak
+
+# Translation files
+*translated.txt
+*spellcheck.txt
+
# User-specific files
*.suo
*.user
@@ -24,6 +31,9 @@ bld/
[Oo]bj/
[Ll]og/
+# vcpkg
+vcpkg_installed*/
+
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
diff --git a/code/MeOS-orig.sln b/code/MeOS-orig.sln
new file mode 100644
index 0000000..9853837
--- /dev/null
+++ b/code/MeOS-orig.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34330.188
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeOS", "MeOS.vcxproj", "{60BC59CB-8987-4A39-B866-403066F59B0F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x64.ActiveCfg = Debug|x64
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x64.Build.0 = Debug|x64
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x86.ActiveCfg = Debug|Win32
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x86.Build.0 = Debug|Win32
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x64.ActiveCfg = Release|x64
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x64.Build.0 = Release|x64
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x86.ActiveCfg = Release|Win32
+ {60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {0AA159AF-578B-49E9-8D52-50F9272169DB}
+ EndGlobalSection
+EndGlobal
diff --git a/code/MeOS-orig.vcxproj b/code/MeOS-orig.vcxproj
new file mode 100644
index 0000000..948b839
--- /dev/null
+++ b/code/MeOS-orig.vcxproj
@@ -0,0 +1,381 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 17.0
+ {60BC59CB-8987-4A39-B866-403066F59B0F}
+ Win32Proj
+ MeOS
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ Unicode
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ Level3
+ stdcpp17
+ true
+ ./libharu;%(AdditionalIncludeDirectories)
+ 4267;4244;4018
+
+
+ true
+ Windows
+ ./lib_db
+ Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
+
+
+ meos_dpi_manifest.xml %(AdditionalManifestFiles)
+
+
+
+
+ _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ Level3
+ stdcpp17
+ 4267;4244;4018
+ true
+ ./libharu;%(AdditionalIncludeDirectories)
+
+
+ true
+ Windows
+ Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
+ ./lib64_db
+
+
+ meos_dpi_manifest.xml %(AdditionalManifestFiles)
+
+
+
+
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ Level3
+ true
+ stdcpp17
+ 4267;4244;4018
+ ./libharu;%(AdditionalIncludeDirectories)
+
+
+ true
+ Windows
+ true
+ true
+ ./lib
+ Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
+
+
+ meos_dpi_manifest.xml %(AdditionalManifestFiles)
+
+
+
+
+ NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ Level3
+ 4267;4244;4018
+ true
+ ./libharu;%(AdditionalIncludeDirectories)
+ stdcpp17
+ true
+
+
+ true
+ Windows
+ true
+ true
+ Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
+ ./lib64
+
+
+ meos_dpi_manifest.xml %(AdditionalManifestFiles)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/code/MeOS.vcxproj b/code/MeOS.vcxproj
index b6356ae..b456b84 100644
--- a/code/MeOS.vcxproj
+++ b/code/MeOS.vcxproj
@@ -22,6 +22,7 @@
17.0{60BC59CB-8987-4A39-B866-403066F59B0F}Win32Proj
+ MeOS10.0
@@ -48,8 +49,8 @@
Applicationfalsev143
- Unicodetrue
+ Unicode
@@ -69,99 +70,66 @@
-
- true
- false
-
-
- true
-
-
- true
-
-
- true
+
+ true
+ Level3
+ trueWIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- Level3
- stdcpp17
- true
- ./libharu;%(AdditionalIncludeDirectories)
- 4267;4244;4018
+ true
- trueWindows
- ./lib_db
- Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
-
-
- meos_dpi_manifest.xml %(AdditionalManifestFiles)
-
-
-
-
- _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- Level3
- stdcpp17
- 4267;4244;4018
- true
- ./libharu;%(AdditionalIncludeDirectories)
-
-
true
- Windows
- Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
- ./lib64_db
-
- meos_dpi_manifest.xml %(AdditionalManifestFiles)
-
- WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)Level3
- true
- stdcpp17
- 4267;4244;4018
- ./libharu;%(AdditionalIncludeDirectories)
+ true
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
- trueWindowstruetrue
- ./lib
- Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ Msimg32.lib;comctl32.lib;winmm.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)
-
- meos_dpi_manifest.xml %(AdditionalManifestFiles)
-
- NDEBUG;_WINDOWS;%(PreprocessorDefinitions)Level3
- 4267;4244;4018
- true
- ./libharu;%(AdditionalIncludeDirectories)
- stdcpp17
- true
+ true
+ true
+ true
+ NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
- trueWindowstruetrue
- Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)
- ./lib64
+ true
+ Msimg32.lib;comctl32.lib;winmm.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)
-
- meos_dpi_manifest.xml %(AdditionalManifestFiles)
-
diff --git a/code/_DELETE_ME_.bat b/code/_DELETE_ME_.bat
new file mode 100644
index 0000000..e46fb17
--- /dev/null
+++ b/code/_DELETE_ME_.bat
@@ -0,0 +1,26 @@
+:: Remove packaged libraries (replaced by vcpkg)
+RMDIR /s/q %~dp0dll
+RMDIR /s/q %~dp0dll64
+RMDIR /s/q %~dp0dll_debug
+RMDIR /s/q %~dp0lib
+RMDIR /s/q %~dp0lib64
+RMDIR /s/q %~dp0libharu
+RMDIR /s/q %~dp0lib_db
+RMDIR /s/q %~dp0lib64_db
+RMDIR /s/q %~dp0minizip
+RMDIR /s/q %~dp0mysql
+RMDIR /s/q %~dp0png
+RMDIR /s/q %~dp0restbed
+::RMDIR /s/q %~dp0sound
+
+:: Old Solution Files
+DEL %~dp0meos*vc15*
+
+:: Remove VStudio compilation folders
+RMDIR /s/q %~dp0.vs
+RMDIR /s/q %~dp0bin
+RMDIR /s/q %~dp0vcpkg_installed
+RMDIR /s/q %~dp0obj
+RMDIR /s/q %~dp0x86
+RMDIR /s/q %~dp0x64
+
diff --git a/code/dll/libharu.dll b/code/dll/libharu.dll
deleted file mode 100644
index 1782cb6..0000000
Binary files a/code/dll/libharu.dll and /dev/null differ
diff --git a/code/dll/libmySQL.dll b/code/dll/libmySQL.dll
deleted file mode 100644
index d78216c..0000000
Binary files a/code/dll/libmySQL.dll and /dev/null differ
diff --git a/code/dll64/libharu.dll b/code/dll64/libharu.dll
deleted file mode 100644
index 3b5e194..0000000
Binary files a/code/dll64/libharu.dll and /dev/null differ
diff --git a/code/dll64/libmysql.dll b/code/dll64/libmysql.dll
deleted file mode 100644
index dcc3fb0..0000000
Binary files a/code/dll64/libmysql.dll and /dev/null differ
diff --git a/code/dll_debug/libharu.dll b/code/dll_debug/libharu.dll
deleted file mode 100644
index bbb2967..0000000
Binary files a/code/dll_debug/libharu.dll and /dev/null differ
diff --git a/code/lib/RestBed.lib b/code/lib/RestBed.lib
deleted file mode 100644
index 3ac99e2..0000000
Binary files a/code/lib/RestBed.lib and /dev/null differ
diff --git a/code/lib/libhpdf.lib b/code/lib/libhpdf.lib
deleted file mode 100644
index 672956c..0000000
Binary files a/code/lib/libhpdf.lib and /dev/null differ
diff --git a/code/lib/libmysql.lib b/code/lib/libmysql.lib
deleted file mode 100644
index 62a71e3..0000000
Binary files a/code/lib/libmysql.lib and /dev/null differ
diff --git a/code/lib/libpng.lib b/code/lib/libpng.lib
deleted file mode 100644
index b2b7367..0000000
Binary files a/code/lib/libpng.lib and /dev/null differ
diff --git a/code/lib/zlibstat_vc15.lib b/code/lib/zlibstat_vc15.lib
deleted file mode 100644
index fd54dfd..0000000
Binary files a/code/lib/zlibstat_vc15.lib and /dev/null differ
diff --git a/code/lib64/RestBed.lib b/code/lib64/RestBed.lib
deleted file mode 100644
index 2fd30cd..0000000
Binary files a/code/lib64/RestBed.lib and /dev/null differ
diff --git a/code/lib64/libharu.lib b/code/lib64/libharu.lib
deleted file mode 100644
index 3323cf6..0000000
Binary files a/code/lib64/libharu.lib and /dev/null differ
diff --git a/code/lib64/libmysql.lib b/code/lib64/libmysql.lib
deleted file mode 100644
index e325a34..0000000
Binary files a/code/lib64/libmysql.lib and /dev/null differ
diff --git a/code/lib64/libpng.lib b/code/lib64/libpng.lib
deleted file mode 100644
index c720d21..0000000
Binary files a/code/lib64/libpng.lib and /dev/null differ
diff --git a/code/lib64/zlibstat.lib b/code/lib64/zlibstat.lib
deleted file mode 100644
index 3edc5f4..0000000
Binary files a/code/lib64/zlibstat.lib and /dev/null differ
diff --git a/code/lib64_db/RestBed.lib b/code/lib64_db/RestBed.lib
deleted file mode 100644
index 71d9729..0000000
Binary files a/code/lib64_db/RestBed.lib and /dev/null differ
diff --git a/code/lib64_db/libharu.lib b/code/lib64_db/libharu.lib
deleted file mode 100644
index 3323cf6..0000000
Binary files a/code/lib64_db/libharu.lib and /dev/null differ
diff --git a/code/lib64_db/libmysql.lib b/code/lib64_db/libmysql.lib
deleted file mode 100644
index e325a34..0000000
Binary files a/code/lib64_db/libmysql.lib and /dev/null differ
diff --git a/code/lib64_db/libpng.lib b/code/lib64_db/libpng.lib
deleted file mode 100644
index c720d21..0000000
Binary files a/code/lib64_db/libpng.lib and /dev/null differ
diff --git a/code/lib64_db/zlibstat.lib b/code/lib64_db/zlibstat.lib
deleted file mode 100644
index 3edc5f4..0000000
Binary files a/code/lib64_db/zlibstat.lib and /dev/null differ
diff --git a/code/lib_db/RestBed.lib b/code/lib_db/RestBed.lib
deleted file mode 100644
index 4f76b64..0000000
Binary files a/code/lib_db/RestBed.lib and /dev/null differ
diff --git a/code/lib_db/libhpdf.lib b/code/lib_db/libhpdf.lib
deleted file mode 100644
index 9a905dc..0000000
Binary files a/code/lib_db/libhpdf.lib and /dev/null differ
diff --git a/code/lib_db/libmysql.lib b/code/lib_db/libmysql.lib
deleted file mode 100644
index 62a71e3..0000000
Binary files a/code/lib_db/libmysql.lib and /dev/null differ
diff --git a/code/lib_db/libpng.lib b/code/lib_db/libpng.lib
deleted file mode 100644
index b2b7367..0000000
Binary files a/code/lib_db/libpng.lib and /dev/null differ
diff --git a/code/lib_db/zlibstat_vc15.lib b/code/lib_db/zlibstat_vc15.lib
deleted file mode 100644
index 186e6b0..0000000
Binary files a/code/lib_db/zlibstat_vc15.lib and /dev/null differ
diff --git a/code/libharu/hpdf.h b/code/libharu/hpdf.h
deleted file mode 100644
index e369f67..0000000
--- a/code/libharu/hpdf.h
+++ /dev/null
@@ -1,1567 +0,0 @@
-/*
- * << Haru Free PDF Library 2.0.8 >> -- hpdf.h
- *
- * URL http://libharu.org/
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_H
-#define _HPDF_H
-
-#include "hpdf_config.h"
-#include "hpdf_version.h"
-
-#define HPDF_UNUSED(a) ((void)(a))
-
-#ifdef HPDF_DLL_MAKE
-# define HPDF_EXPORT(A) __declspec(dllexport) A __stdcall
-#else
-# ifdef HPDF_DLL_MAKE_CDECL
-# define HPDF_EXPORT(A) __declspec(dllexport) A
-# else
-# ifdef HPDF_SHARED_MAKE
-# define HPDF_EXPORT(A) extern A
-# endif /* HPDF_SHARED_MAKE */
-# endif /* HPDF_DLL_MAKE_CDECL */
-#endif /* HPDF_DLL_MAKE */
-
-#ifdef HPDF_DLL
-# define HPDF_SHARED
-# define HPDF_EXPORT(A) __declspec(dllimport) A __stdcall
-#else
-# ifdef HPDF_DLL_CDECL
-# define HPDF_SHARED
-# define HPDF_EXPORT(A) __declspec(dllimport) A
-# endif /* HPDF_DLL_CDECL */
-#endif /* HPDF_DLL */
-
-#ifdef HPDF_SHARED
-
-#ifndef HPDF_EXPORT
-#define HPDF_EXPORT(A) extern A
-#endif /* HPDF_EXPORT */
-
-#include "hpdf_consts.h"
-#include "hpdf_types.h"
-
-typedef void *HPDF_HANDLE;
-typedef HPDF_HANDLE HPDF_Doc;
-typedef HPDF_HANDLE HPDF_Page;
-typedef HPDF_HANDLE HPDF_Pages;
-typedef HPDF_HANDLE HPDF_Stream;
-typedef HPDF_HANDLE HPDF_Image;
-typedef HPDF_HANDLE HPDF_Font;
-typedef HPDF_HANDLE HPDF_Outline;
-typedef HPDF_HANDLE HPDF_Encoder;
-typedef HPDF_HANDLE HPDF_3DMeasure;
-typedef HPDF_HANDLE HPDF_ExData;
-typedef HPDF_HANDLE HPDF_Destination;
-typedef HPDF_HANDLE HPDF_XObject;
-typedef HPDF_HANDLE HPDF_Annotation;
-typedef HPDF_HANDLE HPDF_ExtGState;
-typedef HPDF_HANDLE HPDF_FontDef;
-typedef HPDF_HANDLE HPDF_U3D;
-typedef HPDF_HANDLE HPDF_JavaScript;
-typedef HPDF_HANDLE HPDF_Error;
-typedef HPDF_HANDLE HPDF_MMgr;
-typedef HPDF_HANDLE HPDF_Dict;
-typedef HPDF_HANDLE HPDF_EmbeddedFile;
-typedef HPDF_HANDLE HPDF_OutputIntent;
-typedef HPDF_HANDLE HPDF_Xref;
-
-#else
-
-#ifndef HPDF_EXPORT
-#define HPDF_EXPORT(A) A
-#endif /* HPDF_EXPORT */
-
-#include "hpdf_consts.h"
-#include "hpdf_doc.h"
-#include "hpdf_error.h"
-#include "hpdf_pdfa.h"
-
-#endif /* HPDF_SHARED */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_EXPORT(const char *)
-HPDF_GetVersion (void);
-
-
-HPDF_EXPORT(HPDF_Doc)
-HPDF_NewEx (HPDF_Error_Handler user_error_fn,
- HPDF_Alloc_Func user_alloc_fn,
- HPDF_Free_Func user_free_fn,
- HPDF_UINT mem_pool_buf_size,
- void *user_data);
-
-HPDF_EXPORT(HPDF_Doc)
-HPDF_New (HPDF_Error_Handler user_error_fn,
- void *user_data);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetErrorHandler (HPDF_Doc pdf,
- HPDF_Error_Handler user_error_fn);
-
-
-HPDF_EXPORT(void)
-HPDF_Free (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_NewDoc (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(void)
-HPDF_FreeDoc (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_BOOL)
-HPDF_HasDoc (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(void)
-HPDF_FreeDocAll (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SaveToStream (HPDF_Doc pdf);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_GetContents (HPDF_Doc pdf,
- HPDF_BYTE *buf,
- HPDF_UINT32 *size);
-
-HPDF_EXPORT(HPDF_UINT32)
-HPDF_GetStreamSize (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ReadFromStream (HPDF_Doc pdf,
- HPDF_BYTE *buf,
- HPDF_UINT32 *size);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ResetStream (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SaveToFile (HPDF_Doc pdf,
- const char *file_name);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_GetError (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_GetErrorDetail (HPDF_Doc pdf);
-
-HPDF_EXPORT(void)
-HPDF_ResetError (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_CheckError (HPDF_Error error);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetPagesConfiguration (HPDF_Doc pdf,
- HPDF_UINT page_per_pages);
-
-
-HPDF_EXPORT(HPDF_Page)
-HPDF_GetPageByIndex (HPDF_Doc pdf,
- HPDF_UINT index);
-
-
-/*---------------------------------------------------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_PageLayout)
-HPDF_GetPageLayout (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetPageLayout (HPDF_Doc pdf,
- HPDF_PageLayout layout);
-
-
-HPDF_EXPORT(HPDF_PageMode)
-HPDF_GetPageMode (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetPageMode (HPDF_Doc pdf,
- HPDF_PageMode mode);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_GetViewerPreference (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetViewerPreference (HPDF_Doc pdf,
- HPDF_UINT value);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetOpenAction (HPDF_Doc pdf,
- HPDF_Destination open_action);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- page handling -------------------------------------------------------*/
-
-
-HPDF_EXPORT(HPDF_Page)
-HPDF_GetCurrentPage (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_Page)
-HPDF_AddPage (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_Page)
-HPDF_InsertPage (HPDF_Doc pdf,
- HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetWidth (HPDF_Page page,
- HPDF_REAL value);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetHeight (HPDF_Page page,
- HPDF_REAL value);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetSize (HPDF_Page page,
- HPDF_PageSizes size,
- HPDF_PageDirection direction);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetRotate (HPDF_Page page,
- HPDF_UINT16 angle);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetZoom (HPDF_Page page,
- HPDF_REAL zoom);
-
-/*---------------------------------------------------------------------------*/
-/*----- font handling -------------------------------------------------------*/
-
-
-HPDF_EXPORT(HPDF_Font)
-HPDF_GetFont (HPDF_Doc pdf,
- const char *font_name,
- const char *encoding_name);
-
-
-HPDF_EXPORT(const char*)
-HPDF_LoadType1FontFromFile (HPDF_Doc pdf,
- const char *afm_file_name,
- const char *data_file_name);
-
-
-HPDF_EXPORT(HPDF_FontDef)
-HPDF_GetTTFontDefFromFile (HPDF_Doc pdf,
- const char *file_name,
- HPDF_BOOL embedding);
-
-HPDF_EXPORT(const char*)
-HPDF_LoadTTFontFromFile (HPDF_Doc pdf,
- const char *file_name,
- HPDF_BOOL embedding);
-
-
-HPDF_EXPORT(const char*)
-HPDF_LoadTTFontFromFile2 (HPDF_Doc pdf,
- const char *file_name,
- HPDF_UINT index,
- HPDF_BOOL embedding);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_AddPageLabel (HPDF_Doc pdf,
- HPDF_UINT page_num,
- HPDF_PageNumStyle style,
- HPDF_UINT first_page,
- const char *prefix);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseJPFonts (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseKRFonts (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseCNSFonts (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseCNTFonts (HPDF_Doc pdf);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- outline ------------------------------------------------------------*/
-
-
-HPDF_EXPORT(HPDF_Outline)
-HPDF_CreateOutline (HPDF_Doc pdf,
- HPDF_Outline parent,
- const char *title,
- HPDF_Encoder encoder);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Outline_SetOpened (HPDF_Outline outline,
- HPDF_BOOL opened);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Outline_SetDestination (HPDF_Outline outline,
- HPDF_Destination dst);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- destination --------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_Destination)
-HPDF_Page_CreateDestination (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetXYZ (HPDF_Destination dst,
- HPDF_REAL left,
- HPDF_REAL top,
- HPDF_REAL zoom);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFit (HPDF_Destination dst);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitH (HPDF_Destination dst,
- HPDF_REAL top);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitV (HPDF_Destination dst,
- HPDF_REAL left);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitR (HPDF_Destination dst,
- HPDF_REAL left,
- HPDF_REAL bottom,
- HPDF_REAL right,
- HPDF_REAL top);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitB (HPDF_Destination dst);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitBH (HPDF_Destination dst,
- HPDF_REAL top);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Destination_SetFitBV (HPDF_Destination dst,
- HPDF_REAL left);
-
-/*--------------------------------------------------------------------------*/
-/*----- encoder ------------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_Encoder)
-HPDF_GetEncoder (HPDF_Doc pdf,
- const char *encoding_name);
-
-
-HPDF_EXPORT(HPDF_Encoder)
-HPDF_GetCurrentEncoder (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetCurrentEncoder (HPDF_Doc pdf,
- const char *encoding_name);
-
-
-HPDF_EXPORT(HPDF_EncoderType)
-HPDF_Encoder_GetType (HPDF_Encoder encoder);
-
-
-HPDF_EXPORT(HPDF_ByteType)
-HPDF_Encoder_GetByteType (HPDF_Encoder encoder,
- const char *text,
- HPDF_UINT index);
-
-
-HPDF_EXPORT(HPDF_UNICODE)
-HPDF_Encoder_GetUnicode (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-
-HPDF_EXPORT(HPDF_WritingMode)
-HPDF_Encoder_GetWritingMode (HPDF_Encoder encoder);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseJPEncodings (HPDF_Doc pdf);
-
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseKREncodings (HPDF_Doc pdf);
-
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseCNSEncodings (HPDF_Doc pdf);
-
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseCNTEncodings (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_UseUTFEncodings (HPDF_Doc pdf);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- annotation ---------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_Create3DAnnot (HPDF_Page page,
- HPDF_Rect rect,
- HPDF_U3D u3d);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateTextAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateFreeTextAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateLineAnnot (HPDF_Page page,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateLinkAnnot (HPDF_Page page,
- HPDF_Rect rect,
- HPDF_Destination dst);
-
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateURILinkAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *uri);
-
-
-HPDF_Annotation
-HPDF_Page_CreateTextMarkupAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder,
- HPDF_AnnotType subType);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateHighlightAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateUnderlineAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateSquigglyAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateStrikeOutAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreatePopupAnnot ( HPDF_Page page,
- HPDF_Rect rect,
- HPDF_Annotation parent);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateStampAnnot ( HPDF_Page page,
- HPDF_Rect rect,
- HPDF_StampAnnotName name,
- const char* text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateProjectionAnnot(HPDF_Page page,
- HPDF_Rect rect,
- const char* text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateSquareAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_Annotation)
-HPDF_Page_CreateCircleAnnot (HPDF_Page page,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_LinkAnnot_SetHighlightMode (HPDF_Annotation annot,
- HPDF_AnnotHighlightMode mode);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_LinkAnnot_SetBorderStyle (HPDF_Annotation annot,
- HPDF_REAL width,
- HPDF_UINT16 dash_on,
- HPDF_UINT16 dash_off);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_TextAnnot_SetIcon (HPDF_Annotation annot,
- HPDF_AnnotIcon icon);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_TextAnnot_SetOpened (HPDF_Annotation annot,
- HPDF_BOOL opened);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annot_SetRGBColor (HPDF_Annotation annot, HPDF_RGBColor color);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annot_SetCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annot_SetNoColor (HPDF_Annotation annot);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetTitle (HPDF_Annotation annot, const char* name);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetSubject (HPDF_Annotation annot, const char* name);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetCreationDate (HPDF_Annotation annot, HPDF_Date value);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetTransparency (HPDF_Annotation annot, HPDF_REAL value);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetIntent (HPDF_Annotation annot, HPDF_AnnotIntent intent);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetPopup (HPDF_Annotation annot, HPDF_Annotation popup);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetRectDiff (HPDF_Annotation annot, HPDF_Rect rect); /* RD entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity); /* BE entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetInteriorRGBColor (HPDF_Annotation annot, HPDF_RGBColor color); /* IC with RGB entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetInteriorCMYKColor (HPDF_Annotation annot, HPDF_CMYKColor color); /* IC with CMYK entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetInteriorGrayColor (HPDF_Annotation annot, HPDF_REAL color); /* IC with Gray entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_MarkupAnnot_SetInteriorTransparent (HPDF_Annotation annot); /* IC with No Color entry */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_TextMarkupAnnot_SetQuadPoints ( HPDF_Annotation annot, HPDF_Point lb, HPDF_Point rb, HPDF_Point rt, HPDF_Point lt); /* l-left, r-right, b-bottom, t-top positions */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annot_Set3DView ( HPDF_MMgr mmgr,
- HPDF_Annotation annot,
- HPDF_Annotation annot3d,
- HPDF_Dict view);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_PopupAnnot_SetOpened (HPDF_Annotation annot,
- HPDF_BOOL opened);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_FreeTextAnnot_SetLineEndingStyle (HPDF_Annotation annot, HPDF_LineAnnotEndingStyle startStyle, HPDF_LineAnnotEndingStyle endStyle);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_FreeTextAnnot_Set3PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point kneePoint, HPDF_Point endPoint); /* Callout line will be in default user space */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_FreeTextAnnot_Set2PointCalloutLine (HPDF_Annotation annot, HPDF_Point startPoint, HPDF_Point endPoint); /* Callout line will be in default user space */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_FreeTextAnnot_SetDefaultStyle (HPDF_Annotation annot, const char* style);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_LineAnnot_SetPosition (HPDF_Annotation annot,
- HPDF_Point startPoint, HPDF_LineAnnotEndingStyle startStyle,
- HPDF_Point endPoint, HPDF_LineAnnotEndingStyle endStyle);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_LineAnnot_SetLeader (HPDF_Annotation annot, HPDF_INT leaderLen, HPDF_INT leaderExtLen, HPDF_INT leaderOffsetLen);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_LineAnnot_SetCaption (HPDF_Annotation annot, HPDF_BOOL showCaption, HPDF_LineAnnotCapPosition position, HPDF_INT horzOffset, HPDF_INT vertOffset);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Annotation_SetBorderStyle (HPDF_Annotation annot,
- HPDF_BSSubtype subtype,
- HPDF_REAL width,
- HPDF_UINT16 dash_on,
- HPDF_UINT16 dash_off,
- HPDF_UINT16 dash_phase);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ProjectionAnnot_SetExData(HPDF_Annotation annot, HPDF_ExData exdata);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- 3D Measure ---------------------------------------------------------*/
-HPDF_EXPORT(HPDF_3DMeasure)
-HPDF_Page_Create3DC3DMeasure(HPDF_Page page,
- HPDF_Point3D firstanchorpoint,
- HPDF_Point3D textanchorpoint
- );
-
-HPDF_EXPORT(HPDF_3DMeasure)
-HPDF_Page_CreatePD33DMeasure(HPDF_Page page,
- HPDF_Point3D annotationPlaneNormal,
- HPDF_Point3D firstAnchorPoint,
- HPDF_Point3D secondAnchorPoint,
- HPDF_Point3D leaderLinesDirection,
- HPDF_Point3D measurementValuePoint,
- HPDF_Point3D textYDirection,
- HPDF_REAL value,
- const char* unitsString
- );
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DMeasure_SetName(HPDF_3DMeasure measure,
- const char* name);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DMeasure_SetColor(HPDF_3DMeasure measure,
- HPDF_RGBColor color);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DMeasure_SetTextSize(HPDF_3DMeasure measure,
- HPDF_REAL textsize);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DC3DMeasure_SetTextBoxSize(HPDF_3DMeasure measure,
- HPDF_INT32 x,
- HPDF_INT32 y);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DC3DMeasure_SetText(HPDF_3DMeasure measure,
- const char* text,
- HPDF_Encoder encoder);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DC3DMeasure_SetProjectionAnotation(HPDF_3DMeasure measure,
- HPDF_Annotation projectionanotation);
-
-/*--------------------------------------------------------------------------*/
-/*----- External Data ---------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_ExData)
-HPDF_Page_Create3DAnnotExData(HPDF_Page page );
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DAnnotExData_Set3DMeasurement(HPDF_ExData exdata, HPDF_3DMeasure measure);
-
-/*--------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------*/
-/*----- 3D View ---------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_Dict)
-HPDF_Page_Create3DView (HPDF_Page page,
- HPDF_U3D u3d,
- HPDF_Annotation annot3d,
- const char *name);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_3DView_Add3DC3DMeasure(HPDF_Dict view,
- HPDF_3DMeasure measure);
-
-/*--------------------------------------------------------------------------*/
-/*----- image data ---------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadPngImageFromMem (HPDF_Doc pdf,
- const HPDF_BYTE *buffer,
- HPDF_UINT size);
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadPngImageFromFile (HPDF_Doc pdf,
- const char *filename);
-
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadPngImageFromFile2 (HPDF_Doc pdf,
- const char *filename);
-
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadJpegImageFromFile (HPDF_Doc pdf,
- const char *filename);
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadJpegImageFromMem (HPDF_Doc pdf,
- const HPDF_BYTE *buffer,
- HPDF_UINT size);
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadU3DFromFile (HPDF_Doc pdf,
- const char *filename);
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadU3DFromMem (HPDF_Doc pdf,
- const HPDF_BYTE *buffer,
- HPDF_UINT size);
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf,
- const HPDF_BYTE *buf,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_UINT line_width,
- HPDF_BOOL black_is1,
- HPDF_BOOL top_is_first);
-
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadRawImageFromFile (HPDF_Doc pdf,
- const char *filename,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_ColorSpace color_space);
-
-
-HPDF_EXPORT(HPDF_Image)
-HPDF_LoadRawImageFromMem (HPDF_Doc pdf,
- const HPDF_BYTE *buf,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_ColorSpace color_space,
- HPDF_UINT bits_per_component);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Image_AddSMask (HPDF_Image image,
- HPDF_Image smask);
-
-HPDF_EXPORT(HPDF_Point)
-HPDF_Image_GetSize (HPDF_Image image);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Image_GetSize2 (HPDF_Image image, HPDF_Point *size);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Image_GetWidth (HPDF_Image image);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Image_GetHeight (HPDF_Image image);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Image_GetBitsPerComponent (HPDF_Image image);
-
-
-HPDF_EXPORT(const char*)
-HPDF_Image_GetColorSpace (HPDF_Image image);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Image_SetColorMask (HPDF_Image image,
- HPDF_UINT rmin,
- HPDF_UINT rmax,
- HPDF_UINT gmin,
- HPDF_UINT gmax,
- HPDF_UINT bmin,
- HPDF_UINT bmax);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Image_SetMaskImage (HPDF_Image image,
- HPDF_Image mask_image);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- info dictionary ----------------------------------------------------*/
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetInfoAttr (HPDF_Doc pdf,
- HPDF_InfoType type,
- const char *value);
-
-
-HPDF_EXPORT(const char*)
-HPDF_GetInfoAttr (HPDF_Doc pdf,
- HPDF_InfoType type);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetInfoDateAttr (HPDF_Doc pdf,
- HPDF_InfoType type,
- HPDF_Date value);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- encryption ---------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetPassword (HPDF_Doc pdf,
- const char *owner_passwd,
- const char *user_passwd);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetPermission (HPDF_Doc pdf,
- HPDF_UINT permission);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetEncryptionMode (HPDF_Doc pdf,
- HPDF_EncryptMode mode,
- HPDF_UINT key_len);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- compression --------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_SetCompressionMode (HPDF_Doc pdf,
- HPDF_UINT mode);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- font ---------------------------------------------------------------*/
-
-HPDF_EXPORT(const char*)
-HPDF_Font_GetFontName (HPDF_Font font);
-
-
-HPDF_EXPORT(const char*)
-HPDF_Font_GetEncodingName (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_INT)
-HPDF_Font_GetUnicodeWidth (HPDF_Font font,
- HPDF_UNICODE code);
-
-HPDF_EXPORT(HPDF_Box)
-HPDF_Font_GetBBox (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_INT)
-HPDF_Font_GetAscent (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_INT)
-HPDF_Font_GetDescent (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Font_GetXHeight (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Font_GetCapHeight (HPDF_Font font);
-
-
-HPDF_EXPORT(HPDF_TextWidth)
-HPDF_Font_TextWidth (HPDF_Font font,
- const HPDF_BYTE *text,
- HPDF_UINT len);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Font_MeasureText (HPDF_Font font,
- const HPDF_BYTE *text,
- HPDF_UINT len,
- HPDF_REAL width,
- HPDF_REAL font_size,
- HPDF_REAL char_space,
- HPDF_REAL word_space,
- HPDF_BOOL wordwrap,
- HPDF_REAL *real_width);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- attachements -------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_EmbeddedFile)
-HPDF_AttachFile (HPDF_Doc pdf,
- const char *file);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- extended graphics state --------------------------------------------*/
-
-HPDF_EXPORT(HPDF_ExtGState)
-HPDF_CreateExtGState (HPDF_Doc pdf);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ExtGState_SetAlphaStroke (HPDF_ExtGState ext_gstate,
- HPDF_REAL value);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ExtGState_SetAlphaFill (HPDF_ExtGState ext_gstate,
- HPDF_REAL value);
-
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_ExtGState_SetBlendMode (HPDF_ExtGState ext_gstate,
- HPDF_BlendMode mode);
-
-
-/*--------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_TextWidth (HPDF_Page page,
- const char *text);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Page_MeasureText (HPDF_Page page,
- const char *text,
- HPDF_REAL width,
- HPDF_BOOL wordwrap,
- HPDF_REAL *real_width);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetWidth (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetHeight (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_UINT16)
-HPDF_Page_GetGMode (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_Point)
-HPDF_Page_GetCurrentPos (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_GetCurrentPos2 (HPDF_Page page,
- HPDF_Point *pos);
-
-
-HPDF_EXPORT(HPDF_Point)
-HPDF_Page_GetCurrentTextPos (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_GetCurrentTextPos2 (HPDF_Page page,
- HPDF_Point *pos);
-
-
-HPDF_EXPORT(HPDF_Font)
-HPDF_Page_GetCurrentFont (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetCurrentFontSize (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_TransMatrix)
-HPDF_Page_GetTransMatrix (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetLineWidth (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_LineCap)
-HPDF_Page_GetLineCap (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_LineJoin)
-HPDF_Page_GetLineJoin (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetMiterLimit (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_DashMode)
-HPDF_Page_GetDash (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetFlat (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetCharSpace (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetWordSpace (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetHorizontalScalling (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetTextLeading (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_TextRenderingMode)
-HPDF_Page_GetTextRenderingMode (HPDF_Page page);
-
-
-/* This function is obsolete. Use HPDF_Page_GetTextRise. */
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetTextRaise (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetTextRise (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_RGBColor)
-HPDF_Page_GetRGBFill (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_RGBColor)
-HPDF_Page_GetRGBStroke (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_CMYKColor)
-HPDF_Page_GetCMYKFill (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_CMYKColor)
-HPDF_Page_GetCMYKStroke (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetGrayFill (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_REAL)
-HPDF_Page_GetGrayStroke (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_ColorSpace)
-HPDF_Page_GetStrokingColorSpace (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_ColorSpace)
-HPDF_Page_GetFillingColorSpace (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_TransMatrix)
-HPDF_Page_GetTextMatrix (HPDF_Page page);
-
-
-HPDF_EXPORT(HPDF_UINT)
-HPDF_Page_GetGStateDepth (HPDF_Page page);
-
-
-/*--------------------------------------------------------------------------*/
-/*----- GRAPHICS OPERATORS -------------------------------------------------*/
-
-
-/*--- General graphics state ---------------------------------------------*/
-
-/* w */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetLineWidth (HPDF_Page page,
- HPDF_REAL line_width);
-
-/* J */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetLineCap (HPDF_Page page,
- HPDF_LineCap line_cap);
-
-/* j */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetLineJoin (HPDF_Page page,
- HPDF_LineJoin line_join);
-
-/* M */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetMiterLimit (HPDF_Page page,
- HPDF_REAL miter_limit);
-
-/* d */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetDash (HPDF_Page page,
- const HPDF_UINT16 *dash_ptn,
- HPDF_UINT num_param,
- HPDF_UINT phase);
-
-
-
-/* ri --not implemented yet */
-
-/* i */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetFlat (HPDF_Page page,
- HPDF_REAL flatness);
-
-/* gs */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetExtGState (HPDF_Page page,
- HPDF_ExtGState ext_gstate);
-
-
-/*--- Special graphic state operator --------------------------------------*/
-
-/* q */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_GSave (HPDF_Page page);
-
-/* Q */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_GRestore (HPDF_Page page);
-
-/* cm */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Concat (HPDF_Page page,
- HPDF_REAL a,
- HPDF_REAL b,
- HPDF_REAL c,
- HPDF_REAL d,
- HPDF_REAL x,
- HPDF_REAL y);
-
-/*--- Path construction operator ------------------------------------------*/
-
-/* m */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_MoveTo (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y);
-
-/* l */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_LineTo (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y);
-
-/* c */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_CurveTo (HPDF_Page page,
- HPDF_REAL x1,
- HPDF_REAL y1,
- HPDF_REAL x2,
- HPDF_REAL y2,
- HPDF_REAL x3,
- HPDF_REAL y3);
-
-/* v */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_CurveTo2 (HPDF_Page page,
- HPDF_REAL x2,
- HPDF_REAL y2,
- HPDF_REAL x3,
- HPDF_REAL y3);
-
-/* y */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_CurveTo3 (HPDF_Page page,
- HPDF_REAL x1,
- HPDF_REAL y1,
- HPDF_REAL x3,
- HPDF_REAL y3);
-
-/* h */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ClosePath (HPDF_Page page);
-
-/* re */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Rectangle (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y,
- HPDF_REAL width,
- HPDF_REAL height);
-
-
-/*--- Path painting operator ---------------------------------------------*/
-
-/* S */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Stroke (HPDF_Page page);
-
-/* s */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ClosePathStroke (HPDF_Page page);
-
-/* f */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Fill (HPDF_Page page);
-
-/* f* */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Eofill (HPDF_Page page);
-
-/* B */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_FillStroke (HPDF_Page page);
-
-/* B* */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_EofillStroke (HPDF_Page page);
-
-/* b */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ClosePathFillStroke (HPDF_Page page);
-
-/* b* */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ClosePathEofillStroke (HPDF_Page page);
-
-/* n */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_EndPath (HPDF_Page page);
-
-
-/*--- Clipping paths operator --------------------------------------------*/
-
-/* W */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Clip (HPDF_Page page);
-
-/* W* */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Eoclip (HPDF_Page page);
-
-
-/*--- Text object operator -----------------------------------------------*/
-
-/* BT */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_BeginText (HPDF_Page page);
-
-/* ET */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_EndText (HPDF_Page page);
-
-/*--- Text state ---------------------------------------------------------*/
-
-/* Tc */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetCharSpace (HPDF_Page page,
- HPDF_REAL value);
-
-/* Tw */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetWordSpace (HPDF_Page page,
- HPDF_REAL value);
-
-/* Tz */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetHorizontalScalling (HPDF_Page page,
- HPDF_REAL value);
-
-/* TL */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetTextLeading (HPDF_Page page,
- HPDF_REAL value);
-
-/* Tf */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetFontAndSize (HPDF_Page page,
- HPDF_Font font,
- HPDF_REAL size);
-
-/* Tr */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetTextRenderingMode (HPDF_Page page,
- HPDF_TextRenderingMode mode);
-
-/* Ts */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetTextRise (HPDF_Page page,
- HPDF_REAL value);
-
-/* This function is obsolete. Use HPDF_Page_SetTextRise. */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetTextRaise (HPDF_Page page,
- HPDF_REAL value);
-
-/*--- Text positioning ---------------------------------------------------*/
-
-/* Td */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_MoveTextPos (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y);
-
-/* TD */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_MoveTextPos2 (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y);
-
-/* Tm */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetTextMatrix (HPDF_Page page,
- HPDF_REAL a,
- HPDF_REAL b,
- HPDF_REAL c,
- HPDF_REAL d,
- HPDF_REAL x,
- HPDF_REAL y);
-
-
-/* T* */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_MoveToNextLine (HPDF_Page page);
-
-/*--- Text showing -------------------------------------------------------*/
-
-/* Tj */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ShowText (HPDF_Page page,
- const char *text);
-
-/* TJ */
-
-/* ' */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ShowTextNextLine (HPDF_Page page,
- const char *text);
-
-/* " */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ShowTextNextLineEx (HPDF_Page page,
- HPDF_REAL word_space,
- HPDF_REAL char_space,
- const char *text);
-
-
-/*--- Color showing ------------------------------------------------------*/
-
-/* cs --not implemented yet */
-/* CS --not implemented yet */
-/* sc --not implemented yet */
-/* scn --not implemented yet */
-/* SC --not implemented yet */
-/* SCN --not implemented yet */
-
-/* g */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetGrayFill (HPDF_Page page,
- HPDF_REAL gray);
-
-/* G */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetGrayStroke (HPDF_Page page,
- HPDF_REAL gray);
-
-/* rg */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetRGBFill (HPDF_Page page,
- HPDF_REAL r,
- HPDF_REAL g,
- HPDF_REAL b);
-
-/* RG */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetRGBStroke (HPDF_Page page,
- HPDF_REAL r,
- HPDF_REAL g,
- HPDF_REAL b);
-
-/* k */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetCMYKFill (HPDF_Page page,
- HPDF_REAL c,
- HPDF_REAL m,
- HPDF_REAL y,
- HPDF_REAL k);
-
-/* K */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetCMYKStroke (HPDF_Page page,
- HPDF_REAL c,
- HPDF_REAL m,
- HPDF_REAL y,
- HPDF_REAL k);
-
-/*--- Shading patterns ---------------------------------------------------*/
-
-/* sh --not implemented yet */
-
-/*--- In-line images -----------------------------------------------------*/
-
-/* BI --not implemented yet */
-/* ID --not implemented yet */
-/* EI --not implemented yet */
-
-/*--- XObjects -----------------------------------------------------------*/
-
-/* Do */
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_ExecuteXObject (HPDF_Page page,
- HPDF_XObject obj);
-
-/*--- Content streams ----------------------------------------------------*/
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_New_Content_Stream (HPDF_Page page,
- HPDF_Dict* new_stream);
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page,
- HPDF_Dict shared_stream);
-
-
-/*--- Marked content -----------------------------------------------------*/
-
-/* BMC --not implemented yet */
-/* BDC --not implemented yet */
-/* EMC --not implemented yet */
-/* MP --not implemented yet */
-/* DP --not implemented yet */
-
-/*--- Compatibility ------------------------------------------------------*/
-
-/* BX --not implemented yet */
-/* EX --not implemented yet */
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_DrawImage (HPDF_Page page,
- HPDF_Image image,
- HPDF_REAL x,
- HPDF_REAL y,
- HPDF_REAL width,
- HPDF_REAL height);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Circle (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y,
- HPDF_REAL ray);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Ellipse (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y,
- HPDF_REAL xray,
- HPDF_REAL yray);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_Arc (HPDF_Page page,
- HPDF_REAL x,
- HPDF_REAL y,
- HPDF_REAL ray,
- HPDF_REAL ang1,
- HPDF_REAL ang2);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_TextOut (HPDF_Page page,
- HPDF_REAL xpos,
- HPDF_REAL ypos,
- const char *text);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_TextRect (HPDF_Page page,
- HPDF_REAL left,
- HPDF_REAL top,
- HPDF_REAL right,
- HPDF_REAL bottom,
- const char *text,
- HPDF_TextAlignment align,
- HPDF_UINT *len);
-
-
-HPDF_EXPORT(HPDF_STATUS)
-HPDF_Page_SetSlideShow (HPDF_Page page,
- HPDF_TransitionStyle type,
- HPDF_REAL disp_time,
- HPDF_REAL trans_time);
-
-
-HPDF_EXPORT(HPDF_OutputIntent)
-HPDF_ICC_LoadIccFromMem (HPDF_Doc pdf,
- HPDF_MMgr mmgr,
- HPDF_Stream iccdata,
- HPDF_Xref xref,
- int numcomponent);
-
-HPDF_EXPORT(HPDF_OutputIntent)
-HPDF_LoadIccProfileFromFile (HPDF_Doc pdf,
- const char* icc_file_name,
- int numcomponent);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_H */
-
diff --git a/code/libharu/hpdf_3dmeasure.h b/code/libharu/hpdf_3dmeasure.h
deleted file mode 100644
index 1f3d8ba..0000000
--- a/code/libharu/hpdf_3dmeasure.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_annotation.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_3DMEASURE_H
-#define _HPDF_3DMEASURE_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*------ HPDF_3DMeasure -----------------------------------------------------*/
-
-
-HPDF_3DMeasure
-HPDF_3DC3DMeasure_New(HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Point3D firstanchorpoint,
- HPDF_Point3D textanchorpoint
- );
-
-HPDF_3DMeasure
-HPDF_PD33DMeasure_New(HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Point3D annotationPlaneNormal,
- HPDF_Point3D firstAnchorPoint,
- HPDF_Point3D secondAnchorPoint,
- HPDF_Point3D leaderLinesDirection,
- HPDF_Point3D measurementValuePoint,
- HPDF_Point3D textYDirection,
- HPDF_REAL value,
- const char* unitsString
- );
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_3DMEASURE_H */
-
diff --git a/code/libharu/hpdf_annotation.h b/code/libharu/hpdf_annotation.h
deleted file mode 100644
index febd1f8..0000000
--- a/code/libharu/hpdf_annotation.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_annotation.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_ANNOTATION_H
-#define _HPDF_ANNOTATION_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*------ HPDF_Annotation -----------------------------------------------------*/
-
-
-HPDF_Annotation
-HPDF_Annotation_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_AnnotType type,
- HPDF_Rect rect);
-
-
-HPDF_Annotation
-HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- HPDF_Destination dst);
-
-
-HPDF_Annotation
-HPDF_URILinkAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- const char *uri);
-
-
-HPDF_Annotation
-HPDF_3DAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- HPDF_U3D u3d);
-
-HPDF_Annotation
-HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- const char *text,
- HPDF_Encoder encoder,
- HPDF_AnnotType subtype);
-
-HPDF_Annotation
-HPDF_PopupAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- HPDF_Annotation parent);
-
-HPDF_Annotation
-HPDF_StampAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- HPDF_StampAnnotName name,
- const char* text,
- HPDF_Encoder encoder);
-
-HPDF_Annotation
-HPDF_ProjectionAnnot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_Rect rect,
- const char* text,
- HPDF_Encoder encoder);
-
-HPDF_BOOL
-HPDF_Annotation_Validate (HPDF_Annotation annot);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_ANNOTATION_H */
-
diff --git a/code/libharu/hpdf_catalog.h b/code/libharu/hpdf_catalog.h
deleted file mode 100644
index 91ad034..0000000
--- a/code/libharu/hpdf_catalog.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_catalog.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_CATALOG_H
-#define _HPDF_CATALOG_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef HPDF_Dict HPDF_Catalog;
-
-HPDF_Catalog
-HPDF_Catalog_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-HPDF_NameDict
-HPDF_Catalog_GetNames (HPDF_Catalog catalog);
-
-
-HPDF_STATUS
-HPDF_Catalog_SetNames (HPDF_Catalog catalog,
- HPDF_NameDict dict);
-
-
-HPDF_Pages
-HPDF_Catalog_GetRoot (HPDF_Catalog catalog);
-
-
-HPDF_PageLayout
-HPDF_Catalog_GetPageLayout (HPDF_Catalog catalog);
-
-
-HPDF_STATUS
-HPDF_Catalog_SetPageLayout (HPDF_Catalog catalog,
- HPDF_PageLayout layout);
-
-
-HPDF_PageMode
-HPDF_Catalog_GetPageMode (HPDF_Catalog catalog);
-
-
-HPDF_STATUS
-HPDF_Catalog_SetPageMode (HPDF_Catalog catalog,
- HPDF_PageMode mode);
-
-
-HPDF_STATUS
-HPDF_Catalog_SetOpenAction (HPDF_Catalog catalog,
- HPDF_Destination open_action);
-
-
-HPDF_STATUS
-HPDF_Catalog_AddPageLabel (HPDF_Catalog catalog,
- HPDF_UINT page_num,
- HPDF_Dict page_label);
-
-
-HPDF_UINT
-HPDF_Catalog_GetViewerPreference (HPDF_Catalog catalog);
-
-
-HPDF_STATUS
-HPDF_Catalog_SetViewerPreference (HPDF_Catalog catalog,
- HPDF_UINT value);
-
-
-HPDF_BOOL
-HPDF_Catalog_Validate (HPDF_Catalog catalog);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_CATALOG_H */
-
diff --git a/code/libharu/hpdf_conf.h b/code/libharu/hpdf_conf.h
deleted file mode 100644
index e216910..0000000
--- a/code/libharu/hpdf_conf.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_conf.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_CONF_H
-#define _HPDF_CONF_H
-
-#include
-#include
-#if defined(_MSC_VER)
-#ifndef _USE_MATH_DEFINES
-#define _USE_MATH_DEFINES 1
-#endif /* _USE_MATH_DEFINES */
-#endif
-#ifndef __USE_XOPEN
-#define __USE_XOPEN /* for M_PI */
-#endif /* __USE_XOPEN */
-#include
-
-/*----------------------------------------------------------------------------*/
-/*----- standard C library functions -----------------------------------------*/
-
-#define HPDF_FOPEN fopen
-#define HPDF_FCLOSE fclose
-#define HPDF_FREAD fread
-#define HPDF_FWRITE fwrite
-#define HPDF_FFLUSH fflush
-#define HPDF_FSEEK fseek
-#define HPDF_FTELL ftell
-#define HPDF_FEOF feof
-#define HPDF_FERROR ferror
-#define HPDF_MALLOC malloc
-#define HPDF_FREE free
-#define HPDF_FILEP FILE*
-#define HPDF_TIME time
-#define HPDF_PRINTF printf
-#define HPDF_SIN sin
-#define HPDF_COS cos
-
-/*----------------------------------------------------------------------------*/
-/*----- parameters in relation to performance --------------------------------*/
-
-/* default buffer size of memory-stream-object */
-#define HPDF_STREAM_BUF_SIZ 4096
-
-/* default array size of list-object */
-#define HPDF_DEF_ITEMS_PER_BLOCK 20
-
-/* default array size of cross-reference-table */
-#define HPDF_DEFALUT_XREF_ENTRY_NUM 1024
-
-/* default array size of widths-table of cid-fontdef */
-#define HPDF_DEF_CHAR_WIDTHS_NUM 128
-
-/* default array size of page-list-tablef */
-#define HPDF_DEF_PAGE_LIST_NUM 256
-
-/* default array size of range-table of cid-fontdef */
-#define HPDF_DEF_RANGE_TBL_NUM 128
-
-/* default buffer size of memory-pool-object */
-#define HPDF_MPOOL_BUF_SIZ 8192
-#define HPDF_MIN_MPOOL_BUF_SIZ 256
-#define HPDF_MAX_MPOOL_BUF_SIZ 1048576
-
-/* alignment size of memory-pool-object
- */
-#define HPDF_ALIGN_SIZ sizeof int;
-
-
-#endif /* _HPDF_CONF_H */
-
diff --git a/code/libharu/hpdf_config.h b/code/libharu/hpdf_config.h
deleted file mode 100644
index 242d503..0000000
--- a/code/libharu/hpdf_config.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* include/hpdf_config.h.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if you have the header file. */
-#undef LIBHPDF_HAVE_DLFCN_H
-
-/* Define to 1 if you have the header file. */
-#undef LIBHPDF_HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `png' library (-lpng). */
-#define LIBHPDF_HAVE_LIBPNG 1
-
-/* Define to 1 if you have the `z' library (-lz). */
-#define LIBHPDF_HAVE_LIBZ 1
-
-/* Define to 1 if you have the header file. */
-#undef LIBHPDF_HAVE_MEMORY_H
-
-/* Define to 1 if you have the header file. */
-#undef LIBHPDF_HAVE_STDINT_H
-
-/* Define to 1 if you have the header file. */
-#define LIBHPDF_HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the header file. */
-#define LIBHPDF_HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the header file. */
-#define LIBHPDF_HAVE_STRING_H 1
-
-/* Define to 1 if you have the header file. */
-#define LIBHPDF_HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the header file. */
-#undef LIBHPDF_HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the header file. */
-#define LIBHPDF_HAVE_UNISTD_H 1
-
-/* define pi */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif /* M_PI */
-
-/* debug build */
-#undef LIBHPDF_DEBUG
-
-/* debug trace enabled */
-#undef LIBHPDF_DEBUG_TRACE
-
-/* libpng is not available */
-#undef LIBHPDF_HAVE_NOPNGLIB
-
-/* zlib is not available */
-#undef LIBHPDF_HAVE_NOZLIB
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef LIBHPDF_PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef LIBHPDF_PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#define LIBHPDF_PACKAGE_STRING "libhpdf 2.2.0"
-
-/* Define to the one symbol short name of this package. */
-#undef LIBHPDF_PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#define LIBHPDF_PACKAGE_VERSION "2.2.0"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define LIBHPDF_STDC_HEADERS 1
-
-/* Define to `unsigned int' if does not define. */
-#undef size_t
diff --git a/code/libharu/hpdf_consts.h b/code/libharu/hpdf_consts.h
deleted file mode 100644
index d080f8d..0000000
--- a/code/libharu/hpdf_consts.h
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_consts.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-
-#ifndef _HPDF_CONSTS_H
-#define _HPDF_CONSTS_H
-
-/*----------------------------------------------------------------------------*/
-
-#define HPDF_TRUE 1
-#define HPDF_FALSE 0
-
-#define HPDF_OK 0
-#define HPDF_NOERROR 0
-
-/*----- default values -------------------------------------------------------*/
-
-/* buffer size which is required when we convert to character string. */
-#define HPDF_TMP_BUF_SIZ 512
-#define HPDF_SHORT_BUF_SIZ 32
-#define HPDF_REAL_LEN 11
-#define HPDF_INT_LEN 11
-#define HPDF_TEXT_DEFAULT_LEN 256
-#define HPDF_UNICODE_HEADER_LEN 2
-#define HPDF_DATE_TIME_STR_LEN 23
-
-/* length of each item defined in PDF */
-#define HPDF_BYTE_OFFSET_LEN 10
-#define HPDF_OBJ_ID_LEN 7
-#define HPDF_GEN_NO_LEN 5
-
-/* default value of Graphic State */
-#define HPDF_DEF_FONT "Helvetica"
-#define HPDF_DEF_PAGE_LAYOUT HPDF_PAGE_LAYOUT_SINGLE
-#define HPDF_DEF_PAGE_MODE HPDF_PAGE_MODE_USE_NONE
-#define HPDF_DEF_WORDSPACE 0
-#define HPDF_DEF_CHARSPACE 0
-#define HPDF_DEF_FONTSIZE 10
-#define HPDF_DEF_HSCALING 100
-#define HPDF_DEF_LEADING 0
-#define HPDF_DEF_RENDERING_MODE HPDF_FILL
-#define HPDF_DEF_RISE 0
-#define HPDF_DEF_RAISE HPDF_DEF_RISE
-#define HPDF_DEF_LINEWIDTH 1
-#define HPDF_DEF_LINECAP HPDF_BUTT_END
-#define HPDF_DEF_LINEJOIN HPDF_MITER_JOIN
-#define HPDF_DEF_MITERLIMIT 10
-#define HPDF_DEF_FLATNESS 1
-#define HPDF_DEF_PAGE_NUM 1
-
-#define HPDF_BS_DEF_WIDTH 1
-
-/* defalt page-size */
-#define HPDF_DEF_PAGE_WIDTH 595.276F
-#define HPDF_DEF_PAGE_HEIGHT 841.89F
-
-/*---------------------------------------------------------------------------*/
-/*----- compression mode ----------------------------------------------------*/
-
-#define HPDF_COMP_NONE 0x00
-#define HPDF_COMP_TEXT 0x01
-#define HPDF_COMP_IMAGE 0x02
-#define HPDF_COMP_METADATA 0x04
-#define HPDF_COMP_ALL 0x0F
-/* #define HPDF_COMP_BEST_COMPRESS 0x10
- * #define HPDF_COMP_BEST_SPEED 0x20
- */
-#define HPDF_COMP_MASK 0xFF
-
-
-/*----------------------------------------------------------------------------*/
-/*----- permission flags (only Revision 2 is supported)-----------------------*/
-
-#define HPDF_ENABLE_READ 0
-#define HPDF_ENABLE_PRINT 4
-#define HPDF_ENABLE_EDIT_ALL 8
-#define HPDF_ENABLE_COPY 16
-#define HPDF_ENABLE_EDIT 32
-
-
-/*----------------------------------------------------------------------------*/
-/*------ viewer preferences definitions --------------------------------------*/
-
-#define HPDF_HIDE_TOOLBAR 1
-#define HPDF_HIDE_MENUBAR 2
-#define HPDF_HIDE_WINDOW_UI 4
-#define HPDF_FIT_WINDOW 8
-#define HPDF_CENTER_WINDOW 16
-#define HPDF_PRINT_SCALING_NONE 32
-
-
-/*---------------------------------------------------------------------------*/
-/*------ limitation of object implementation (PDF1.4) -----------------------*/
-
-#define HPDF_LIMIT_MAX_INT 2147483647
-#define HPDF_LIMIT_MIN_INT -2147483647
-
-#define HPDF_LIMIT_MAX_REAL 32767
-#define HPDF_LIMIT_MIN_REAL -32767
-
-#define HPDF_LIMIT_MAX_STRING_LEN 65535
-#define HPDF_LIMIT_MAX_NAME_LEN 127
-
-#define HPDF_LIMIT_MAX_ARRAY 32767
-#define HPDF_LIMIT_MAX_DICT_ELEMENT 4095
-#define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607
-#define HPDF_LIMIT_MAX_GSTATE 28
-#define HPDF_LIMIT_MAX_DEVICE_N 8
-#define HPDF_LIMIT_MAX_DEVICE_N_V15 32
-#define HPDF_LIMIT_MAX_CID 65535
-#define HPDF_MAX_GENERATION_NUM 65535
-
-#define HPDF_MIN_PAGE_HEIGHT 3
-#define HPDF_MIN_PAGE_WIDTH 3
-#define HPDF_MAX_PAGE_HEIGHT 14400
-#define HPDF_MAX_PAGE_WIDTH 14400
-#define HPDF_MIN_MAGNIFICATION_FACTOR 8
-#define HPDF_MAX_MAGNIFICATION_FACTOR 3200
-
-/*---------------------------------------------------------------------------*/
-/*------ limitation of various properties -----------------------------------*/
-
-#define HPDF_MIN_PAGE_SIZE 3
-#define HPDF_MAX_PAGE_SIZE 14400
-#define HPDF_MIN_HORIZONTALSCALING 10
-#define HPDF_MAX_HORIZONTALSCALING 300
-#define HPDF_MIN_WORDSPACE -30
-#define HPDF_MAX_WORDSPACE 300
-#define HPDF_MIN_CHARSPACE -30
-#define HPDF_MAX_CHARSPACE 300
-#define HPDF_MAX_FONTSIZE 600
-#define HPDF_MAX_ZOOMSIZE 10
-#define HPDF_MAX_LEADING 300
-#define HPDF_MAX_LINEWIDTH 100
-#define HPDF_MAX_DASH_PATTERN 100
-
-#define HPDF_MAX_JWW_NUM 128
-
-/*----------------------------------------------------------------------------*/
-/*----- country code definition ----------------------------------------------*/
-
-#define HPDF_COUNTRY_AF "AF" /* AFGHANISTAN */
-#define HPDF_COUNTRY_AL "AL" /* ALBANIA */
-#define HPDF_COUNTRY_DZ "DZ" /* ALGERIA */
-#define HPDF_COUNTRY_AS "AS" /* AMERICAN SAMOA */
-#define HPDF_COUNTRY_AD "AD" /* ANDORRA */
-#define HPDF_COUNTRY_AO "AO" /* ANGOLA */
-#define HPDF_COUNTRY_AI "AI" /* ANGUILLA */
-#define HPDF_COUNTRY_AQ "AQ" /* ANTARCTICA */
-#define HPDF_COUNTRY_AG "AG" /* ANTIGUA AND BARBUDA */
-#define HPDF_COUNTRY_AR "AR" /* ARGENTINA */
-#define HPDF_COUNTRY_AM "AM" /* ARMENIA */
-#define HPDF_COUNTRY_AW "AW" /* ARUBA */
-#define HPDF_COUNTRY_AU "AU" /* AUSTRALIA */
-#define HPDF_COUNTRY_AT "AT" /* AUSTRIA */
-#define HPDF_COUNTRY_AZ "AZ" /* AZERBAIJAN */
-#define HPDF_COUNTRY_BS "BS" /* BAHAMAS */
-#define HPDF_COUNTRY_BH "BH" /* BAHRAIN */
-#define HPDF_COUNTRY_BD "BD" /* BANGLADESH */
-#define HPDF_COUNTRY_BB "BB" /* BARBADOS */
-#define HPDF_COUNTRY_BY "BY" /* BELARUS */
-#define HPDF_COUNTRY_BE "BE" /* BELGIUM */
-#define HPDF_COUNTRY_BZ "BZ" /* BELIZE */
-#define HPDF_COUNTRY_BJ "BJ" /* BENIN */
-#define HPDF_COUNTRY_BM "BM" /* BERMUDA */
-#define HPDF_COUNTRY_BT "BT" /* BHUTAN */
-#define HPDF_COUNTRY_BO "BO" /* BOLIVIA */
-#define HPDF_COUNTRY_BA "BA" /* BOSNIA AND HERZEGOWINA */
-#define HPDF_COUNTRY_BW "BW" /* BOTSWANA */
-#define HPDF_COUNTRY_BV "BV" /* BOUVET ISLAND */
-#define HPDF_COUNTRY_BR "BR" /* BRAZIL */
-#define HPDF_COUNTRY_IO "IO" /* BRITISH INDIAN OCEAN TERRITORY */
-#define HPDF_COUNTRY_BN "BN" /* BRUNEI DARUSSALAM */
-#define HPDF_COUNTRY_BG "BG" /* BULGARIA */
-#define HPDF_COUNTRY_BF "BF" /* BURKINA FASO */
-#define HPDF_COUNTRY_BI "BI" /* BURUNDI */
-#define HPDF_COUNTRY_KH "KH" /* CAMBODIA */
-#define HPDF_COUNTRY_CM "CM" /* CAMEROON */
-#define HPDF_COUNTRY_CA "CA" /* CANADA */
-#define HPDF_COUNTRY_CV "CV" /* CAPE VERDE */
-#define HPDF_COUNTRY_KY "KY" /* CAYMAN ISLANDS */
-#define HPDF_COUNTRY_CF "CF" /* CENTRAL AFRICAN REPUBLIC */
-#define HPDF_COUNTRY_TD "TD" /* CHAD */
-#define HPDF_COUNTRY_CL "CL" /* CHILE */
-#define HPDF_COUNTRY_CN "CN" /* CHINA */
-#define HPDF_COUNTRY_CX "CX" /* CHRISTMAS ISLAND */
-#define HPDF_COUNTRY_CC "CC" /* COCOS (KEELING) ISLANDS */
-#define HPDF_COUNTRY_CO "CO" /* COLOMBIA */
-#define HPDF_COUNTRY_KM "KM" /* COMOROS */
-#define HPDF_COUNTRY_CG "CG" /* CONGO */
-#define HPDF_COUNTRY_CK "CK" /* COOK ISLANDS */
-#define HPDF_COUNTRY_CR "CR" /* COSTA RICA */
-#define HPDF_COUNTRY_CI "CI" /* COTE D'IVOIRE */
-#define HPDF_COUNTRY_HR "HR" /* CROATIA (local name: Hrvatska) */
-#define HPDF_COUNTRY_CU "CU" /* CUBA */
-#define HPDF_COUNTRY_CY "CY" /* CYPRUS */
-#define HPDF_COUNTRY_CZ "CZ" /* CZECH REPUBLIC */
-#define HPDF_COUNTRY_DK "DK" /* DENMARK */
-#define HPDF_COUNTRY_DJ "DJ" /* DJIBOUTI */
-#define HPDF_COUNTRY_DM "DM" /* DOMINICA */
-#define HPDF_COUNTRY_DO "DO" /* DOMINICAN REPUBLIC */
-#define HPDF_COUNTRY_TP "TP" /* EAST TIMOR */
-#define HPDF_COUNTRY_EC "EC" /* ECUADOR */
-#define HPDF_COUNTRY_EG "EG" /* EGYPT */
-#define HPDF_COUNTRY_SV "SV" /* EL SALVADOR */
-#define HPDF_COUNTRY_GQ "GQ" /* EQUATORIAL GUINEA */
-#define HPDF_COUNTRY_ER "ER" /* ERITREA */
-#define HPDF_COUNTRY_EE "EE" /* ESTONIA */
-#define HPDF_COUNTRY_ET "ET" /* ETHIOPIA */
-#define HPDF_COUNTRY_FK "FK" /* FALKLAND ISLANDS (MALVINAS) */
-#define HPDF_COUNTRY_FO "FO" /* FAROE ISLANDS */
-#define HPDF_COUNTRY_FJ "FJ" /* FIJI */
-#define HPDF_COUNTRY_FI "FI" /* FINLAND */
-#define HPDF_COUNTRY_FR "FR" /* FRANCE */
-#define HPDF_COUNTRY_FX "FX" /* FRANCE, METROPOLITAN */
-#define HPDF_COUNTRY_GF "GF" /* FRENCH GUIANA */
-#define HPDF_COUNTRY_PF "PF" /* FRENCH POLYNESIA */
-#define HPDF_COUNTRY_TF "TF" /* FRENCH SOUTHERN TERRITORIES */
-#define HPDF_COUNTRY_GA "GA" /* GABON */
-#define HPDF_COUNTRY_GM "GM" /* GAMBIA */
-#define HPDF_COUNTRY_GE "GE" /* GEORGIA */
-#define HPDF_COUNTRY_DE "DE" /* GERMANY */
-#define HPDF_COUNTRY_GH "GH" /* GHANA */
-#define HPDF_COUNTRY_GI "GI" /* GIBRALTAR */
-#define HPDF_COUNTRY_GR "GR" /* GREECE */
-#define HPDF_COUNTRY_GL "GL" /* GREENLAND */
-#define HPDF_COUNTRY_GD "GD" /* GRENADA */
-#define HPDF_COUNTRY_GP "GP" /* GUADELOUPE */
-#define HPDF_COUNTRY_GU "GU" /* GUAM */
-#define HPDF_COUNTRY_GT "GT" /* GUATEMALA */
-#define HPDF_COUNTRY_GN "GN" /* GUINEA */
-#define HPDF_COUNTRY_GW "GW" /* GUINEA-BISSAU */
-#define HPDF_COUNTRY_GY "GY" /* GUYANA */
-#define HPDF_COUNTRY_HT "HT" /* HAITI */
-#define HPDF_COUNTRY_HM "HM" /* HEARD AND MC DONALD ISLANDS */
-#define HPDF_COUNTRY_HN "HN" /* HONDURAS */
-#define HPDF_COUNTRY_HK "HK" /* HONG KONG */
-#define HPDF_COUNTRY_HU "HU" /* HUNGARY */
-#define HPDF_COUNTRY_IS "IS" /* ICELAND */
-#define HPDF_COUNTRY_IN "IN" /* INDIA */
-#define HPDF_COUNTRY_ID "ID" /* INDONESIA */
-#define HPDF_COUNTRY_IR "IR" /* IRAN (ISLAMIC REPUBLIC OF) */
-#define HPDF_COUNTRY_IQ "IQ" /* IRAQ */
-#define HPDF_COUNTRY_IE "IE" /* IRELAND */
-#define HPDF_COUNTRY_IL "IL" /* ISRAEL */
-#define HPDF_COUNTRY_IT "IT" /* ITALY */
-#define HPDF_COUNTRY_JM "JM" /* JAMAICA */
-#define HPDF_COUNTRY_JP "JP" /* JAPAN */
-#define HPDF_COUNTRY_JO "JO" /* JORDAN */
-#define HPDF_COUNTRY_KZ "KZ" /* KAZAKHSTAN */
-#define HPDF_COUNTRY_KE "KE" /* KENYA */
-#define HPDF_COUNTRY_KI "KI" /* KIRIBATI */
-#define HPDF_COUNTRY_KP "KP" /* KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF */
-#define HPDF_COUNTRY_KR "KR" /* KOREA, REPUBLIC OF */
-#define HPDF_COUNTRY_KW "KW" /* KUWAIT */
-#define HPDF_COUNTRY_KG "KG" /* KYRGYZSTAN */
-#define HPDF_COUNTRY_LA "LA" /* LAO PEOPLE'S DEMOCRATIC REPUBLIC */
-#define HPDF_COUNTRY_LV "LV" /* LATVIA */
-#define HPDF_COUNTRY_LB "LB" /* LEBANON */
-#define HPDF_COUNTRY_LS "LS" /* LESOTHO */
-#define HPDF_COUNTRY_LR "LR" /* LIBERIA */
-#define HPDF_COUNTRY_LY "LY" /* LIBYAN ARAB JAMAHIRIYA */
-#define HPDF_COUNTRY_LI "LI" /* LIECHTENSTEIN */
-#define HPDF_COUNTRY_LT "LT" /* LITHUANIA */
-#define HPDF_COUNTRY_LU "LU" /* LUXEMBOURG */
-#define HPDF_COUNTRY_MO "MO" /* MACAU */
-#define HPDF_COUNTRY_MK "MK" /* MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF */
-#define HPDF_COUNTRY_MG "MG" /* MADAGASCAR */
-#define HPDF_COUNTRY_MW "MW" /* MALAWI */
-#define HPDF_COUNTRY_MY "MY" /* MALAYSIA */
-#define HPDF_COUNTRY_MV "MV" /* MALDIVES */
-#define HPDF_COUNTRY_ML "ML" /* MALI */
-#define HPDF_COUNTRY_MT "MT" /* MALTA */
-#define HPDF_COUNTRY_MH "MH" /* MARSHALL ISLANDS */
-#define HPDF_COUNTRY_MQ "MQ" /* MARTINIQUE */
-#define HPDF_COUNTRY_MR "MR" /* MAURITANIA */
-#define HPDF_COUNTRY_MU "MU" /* MAURITIUS */
-#define HPDF_COUNTRY_YT "YT" /* MAYOTTE */
-#define HPDF_COUNTRY_MX "MX" /* MEXICO */
-#define HPDF_COUNTRY_FM "FM" /* MICRONESIA, FEDERATED STATES OF */
-#define HPDF_COUNTRY_MD "MD" /* MOLDOVA, REPUBLIC OF */
-#define HPDF_COUNTRY_MC "MC" /* MONACO */
-#define HPDF_COUNTRY_MN "MN" /* MONGOLIA */
-#define HPDF_COUNTRY_MS "MS" /* MONTSERRAT */
-#define HPDF_COUNTRY_MA "MA" /* MOROCCO */
-#define HPDF_COUNTRY_MZ "MZ" /* MOZAMBIQUE */
-#define HPDF_COUNTRY_MM "MM" /* MYANMAR */
-#define HPDF_COUNTRY_NA "NA" /* NAMIBIA */
-#define HPDF_COUNTRY_NR "NR" /* NAURU */
-#define HPDF_COUNTRY_NP "NP" /* NEPAL */
-#define HPDF_COUNTRY_NL "NL" /* NETHERLANDS */
-#define HPDF_COUNTRY_AN "AN" /* NETHERLANDS ANTILLES */
-#define HPDF_COUNTRY_NC "NC" /* NEW CALEDONIA */
-#define HPDF_COUNTRY_NZ "NZ" /* NEW ZEALAND */
-#define HPDF_COUNTRY_NI "NI" /* NICARAGUA */
-#define HPDF_COUNTRY_NE "NE" /* NIGER */
-#define HPDF_COUNTRY_NG "NG" /* NIGERIA */
-#define HPDF_COUNTRY_NU "NU" /* NIUE */
-#define HPDF_COUNTRY_NF "NF" /* NORFOLK ISLAND */
-#define HPDF_COUNTRY_MP "MP" /* NORTHERN MARIANA ISLANDS */
-#define HPDF_COUNTRY_NO "NO" /* NORWAY */
-#define HPDF_COUNTRY_OM "OM" /* OMAN */
-#define HPDF_COUNTRY_PK "PK" /* PAKISTAN */
-#define HPDF_COUNTRY_PW "PW" /* PALAU */
-#define HPDF_COUNTRY_PA "PA" /* PANAMA */
-#define HPDF_COUNTRY_PG "PG" /* PAPUA NEW GUINEA */
-#define HPDF_COUNTRY_PY "PY" /* PARAGUAY */
-#define HPDF_COUNTRY_PE "PE" /* PERU */
-#define HPDF_COUNTRY_PH "PH" /* PHILIPPINES */
-#define HPDF_COUNTRY_PN "PN" /* PITCAIRN */
-#define HPDF_COUNTRY_PL "PL" /* POLAND */
-#define HPDF_COUNTRY_PT "PT" /* PORTUGAL */
-#define HPDF_COUNTRY_PR "PR" /* PUERTO RICO */
-#define HPDF_COUNTRY_QA "QA" /* QATAR */
-#define HPDF_COUNTRY_RE "RE" /* REUNION */
-#define HPDF_COUNTRY_RO "RO" /* ROMANIA */
-#define HPDF_COUNTRY_RU "RU" /* RUSSIAN FEDERATION */
-#define HPDF_COUNTRY_RW "RW" /* RWANDA */
-#define HPDF_COUNTRY_KN "KN" /* SAINT KITTS AND NEVIS */
-#define HPDF_COUNTRY_LC "LC" /* SAINT LUCIA */
-#define HPDF_COUNTRY_VC "VC" /* SAINT VINCENT AND THE GRENADINES */
-#define HPDF_COUNTRY_WS "WS" /* SAMOA */
-#define HPDF_COUNTRY_SM "SM" /* SAN MARINO */
-#define HPDF_COUNTRY_ST "ST" /* SAO TOME AND PRINCIPE */
-#define HPDF_COUNTRY_SA "SA" /* SAUDI ARABIA */
-#define HPDF_COUNTRY_SN "SN" /* SENEGAL */
-#define HPDF_COUNTRY_SC "SC" /* SEYCHELLES */
-#define HPDF_COUNTRY_SL "SL" /* SIERRA LEONE */
-#define HPDF_COUNTRY_SG "SG" /* SINGAPORE */
-#define HPDF_COUNTRY_SK "SK" /* SLOVAKIA (Slovak Republic) */
-#define HPDF_COUNTRY_SI "SI" /* SLOVENIA */
-#define HPDF_COUNTRY_SB "SB" /* SOLOMON ISLANDS */
-#define HPDF_COUNTRY_SO "SO" /* SOMALIA */
-#define HPDF_COUNTRY_ZA "ZA" /* SOUTH AFRICA */
-#define HPDF_COUNTRY_ES "ES" /* SPAIN */
-#define HPDF_COUNTRY_LK "LK" /* SRI LANKA */
-#define HPDF_COUNTRY_SH "SH" /* ST. HELENA */
-#define HPDF_COUNTRY_PM "PM" /* ST. PIERRE AND MIQUELON */
-#define HPDF_COUNTRY_SD "SD" /* SUDAN */
-#define HPDF_COUNTRY_SR "SR" /* SURINAME */
-#define HPDF_COUNTRY_SJ "SJ" /* SVALBARD AND JAN MAYEN ISLANDS */
-#define HPDF_COUNTRY_SZ "SZ" /* SWAZILAND */
-#define HPDF_COUNTRY_SE "SE" /* SWEDEN */
-#define HPDF_COUNTRY_CH "CH" /* SWITZERLAND */
-#define HPDF_COUNTRY_SY "SY" /* SYRIAN ARAB REPUBLIC */
-#define HPDF_COUNTRY_TW "TW" /* TAIWAN, PROVINCE OF CHINA */
-#define HPDF_COUNTRY_TJ "TJ" /* TAJIKISTAN */
-#define HPDF_COUNTRY_TZ "TZ" /* TANZANIA, UNITED REPUBLIC OF */
-#define HPDF_COUNTRY_TH "TH" /* THAILAND */
-#define HPDF_COUNTRY_TG "TG" /* TOGO */
-#define HPDF_COUNTRY_TK "TK" /* TOKELAU */
-#define HPDF_COUNTRY_TO "TO" /* TONGA */
-#define HPDF_COUNTRY_TT "TT" /* TRINIDAD AND TOBAGO */
-#define HPDF_COUNTRY_TN "TN" /* TUNISIA */
-#define HPDF_COUNTRY_TR "TR" /* TURKEY */
-#define HPDF_COUNTRY_TM "TM" /* TURKMENISTAN */
-#define HPDF_COUNTRY_TC "TC" /* TURKS AND CAICOS ISLANDS */
-#define HPDF_COUNTRY_TV "TV" /* TUVALU */
-#define HPDF_COUNTRY_UG "UG" /* UGANDA */
-#define HPDF_COUNTRY_UA "UA" /* UKRAINE */
-#define HPDF_COUNTRY_AE "AE" /* UNITED ARAB EMIRATES */
-#define HPDF_COUNTRY_GB "GB" /* UNITED KINGDOM */
-#define HPDF_COUNTRY_US "US" /* UNITED STATES */
-#define HPDF_COUNTRY_UM "UM" /* UNITED STATES MINOR OUTLYING ISLANDS */
-#define HPDF_COUNTRY_UY "UY" /* URUGUAY */
-#define HPDF_COUNTRY_UZ "UZ" /* UZBEKISTAN */
-#define HPDF_COUNTRY_VU "VU" /* VANUATU */
-#define HPDF_COUNTRY_VA "VA" /* VATICAN CITY STATE (HOLY SEE) */
-#define HPDF_COUNTRY_VE "VE" /* VENEZUELA */
-#define HPDF_COUNTRY_VN "VN" /* VIET NAM */
-#define HPDF_COUNTRY_VG "VG" /* VIRGIN ISLANDS (BRITISH) */
-#define HPDF_COUNTRY_VI "VI" /* VIRGIN ISLANDS (U.S.) */
-#define HPDF_COUNTRY_WF "WF" /* WALLIS AND FUTUNA ISLANDS */
-#define HPDF_COUNTRY_EH "EH" /* WESTERN SAHARA */
-#define HPDF_COUNTRY_YE "YE" /* YEMEN */
-#define HPDF_COUNTRY_YU "YU" /* YUGOSLAVIA */
-#define HPDF_COUNTRY_ZR "ZR" /* ZAIRE */
-#define HPDF_COUNTRY_ZM "ZM" /* ZAMBIA */
-#define HPDF_COUNTRY_ZW "ZW" /* ZIMBABWE */
-
-/*----------------------------------------------------------------------------*/
-/*----- lang code definition -------------------------------------------------*/
-
-#define HPDF_LANG_AA "aa" /* Afar */
-#define HPDF_LANG_AB "ab" /* Abkhazian */
-#define HPDF_LANG_AF "af" /* Afrikaans */
-#define HPDF_LANG_AM "am" /* Amharic */
-#define HPDF_LANG_AR "ar" /* Arabic */
-#define HPDF_LANG_AS "as" /* Assamese */
-#define HPDF_LANG_AY "ay" /* Aymara */
-#define HPDF_LANG_AZ "az" /* Azerbaijani */
-#define HPDF_LANG_BA "ba" /* Bashkir */
-#define HPDF_LANG_BE "be" /* Byelorussian */
-#define HPDF_LANG_BG "bg" /* Bulgarian */
-#define HPDF_LANG_BH "bh" /* Bihari */
-#define HPDF_LANG_BI "bi" /* Bislama */
-#define HPDF_LANG_BN "bn" /* Bengali Bangla */
-#define HPDF_LANG_BO "bo" /* Tibetan */
-#define HPDF_LANG_BR "br" /* Breton */
-#define HPDF_LANG_CA "ca" /* Catalan */
-#define HPDF_LANG_CO "co" /* Corsican */
-#define HPDF_LANG_CS "cs" /* Czech */
-#define HPDF_LANG_CY "cy" /* Welsh */
-#define HPDF_LANG_DA "da" /* Danish */
-#define HPDF_LANG_DE "de" /* German */
-#define HPDF_LANG_DZ "dz" /* Bhutani */
-#define HPDF_LANG_EL "el" /* Greek */
-#define HPDF_LANG_EN "en" /* English */
-#define HPDF_LANG_EO "eo" /* Esperanto */
-#define HPDF_LANG_ES "es" /* Spanish */
-#define HPDF_LANG_ET "et" /* Estonian */
-#define HPDF_LANG_EU "eu" /* Basque */
-#define HPDF_LANG_FA "fa" /* Persian */
-#define HPDF_LANG_FI "fi" /* Finnish */
-#define HPDF_LANG_FJ "fj" /* Fiji */
-#define HPDF_LANG_FO "fo" /* Faeroese */
-#define HPDF_LANG_FR "fr" /* French */
-#define HPDF_LANG_FY "fy" /* Frisian */
-#define HPDF_LANG_GA "ga" /* Irish */
-#define HPDF_LANG_GD "gd" /* Scots Gaelic */
-#define HPDF_LANG_GL "gl" /* Galician */
-#define HPDF_LANG_GN "gn" /* Guarani */
-#define HPDF_LANG_GU "gu" /* Gujarati */
-#define HPDF_LANG_HA "ha" /* Hausa */
-#define HPDF_LANG_HI "hi" /* Hindi */
-#define HPDF_LANG_HR "hr" /* Croatian */
-#define HPDF_LANG_HU "hu" /* Hungarian */
-#define HPDF_LANG_HY "hy" /* Armenian */
-#define HPDF_LANG_IA "ia" /* Interlingua */
-#define HPDF_LANG_IE "ie" /* Interlingue */
-#define HPDF_LANG_IK "ik" /* Inupiak */
-#define HPDF_LANG_IN "in" /* Indonesian */
-#define HPDF_LANG_IS "is" /* Icelandic */
-#define HPDF_LANG_IT "it" /* Italian */
-#define HPDF_LANG_IW "iw" /* Hebrew */
-#define HPDF_LANG_JA "ja" /* Japanese */
-#define HPDF_LANG_JI "ji" /* Yiddish */
-#define HPDF_LANG_JW "jw" /* Javanese */
-#define HPDF_LANG_KA "ka" /* Georgian */
-#define HPDF_LANG_KK "kk" /* Kazakh */
-#define HPDF_LANG_KL "kl" /* Greenlandic */
-#define HPDF_LANG_KM "km" /* Cambodian */
-#define HPDF_LANG_KN "kn" /* Kannada */
-#define HPDF_LANG_KO "ko" /* Korean */
-#define HPDF_LANG_KS "ks" /* Kashmiri */
-#define HPDF_LANG_KU "ku" /* Kurdish */
-#define HPDF_LANG_KY "ky" /* Kirghiz */
-#define HPDF_LANG_LA "la" /* Latin */
-#define HPDF_LANG_LN "ln" /* Lingala */
-#define HPDF_LANG_LO "lo" /* Laothian */
-#define HPDF_LANG_LT "lt" /* Lithuanian */
-#define HPDF_LANG_LV "lv" /* Latvian,Lettish */
-#define HPDF_LANG_MG "mg" /* Malagasy */
-#define HPDF_LANG_MI "mi" /* Maori */
-#define HPDF_LANG_MK "mk" /* Macedonian */
-#define HPDF_LANG_ML "ml" /* Malayalam */
-#define HPDF_LANG_MN "mn" /* Mongolian */
-#define HPDF_LANG_MO "mo" /* Moldavian */
-#define HPDF_LANG_MR "mr" /* Marathi */
-#define HPDF_LANG_MS "ms" /* Malay */
-#define HPDF_LANG_MT "mt" /* Maltese */
-#define HPDF_LANG_MY "my" /* Burmese */
-#define HPDF_LANG_NA "na" /* Nauru */
-#define HPDF_LANG_NE "ne" /* Nepali */
-#define HPDF_LANG_NL "nl" /* Dutch */
-#define HPDF_LANG_NO "no" /* Norwegian */
-#define HPDF_LANG_OC "oc" /* Occitan */
-#define HPDF_LANG_OM "om" /* (Afan)Oromo */
-#define HPDF_LANG_OR "or" /* Oriya */
-#define HPDF_LANG_PA "pa" /* Punjabi */
-#define HPDF_LANG_PL "pl" /* Polish */
-#define HPDF_LANG_PS "ps" /* Pashto,Pushto */
-#define HPDF_LANG_PT "pt" /* Portuguese */
-#define HPDF_LANG_QU "qu" /* Quechua */
-#define HPDF_LANG_RM "rm" /* Rhaeto-Romance */
-#define HPDF_LANG_RN "rn" /* Kirundi */
-#define HPDF_LANG_RO "ro" /* Romanian */
-#define HPDF_LANG_RU "ru" /* Russian */
-#define HPDF_LANG_RW "rw" /* Kinyarwanda */
-#define HPDF_LANG_SA "sa" /* Sanskrit */
-#define HPDF_LANG_SD "sd" /* Sindhi */
-#define HPDF_LANG_SG "sg" /* Sangro */
-#define HPDF_LANG_SH "sh" /* Serbo-Croatian */
-#define HPDF_LANG_SI "si" /* Singhalese */
-#define HPDF_LANG_SK "sk" /* Slovak */
-#define HPDF_LANG_SL "sl" /* Slovenian */
-#define HPDF_LANG_SM "sm" /* Samoan */
-#define HPDF_LANG_SN "sn" /* Shona */
-#define HPDF_LANG_SO "so" /* Somali */
-#define HPDF_LANG_SQ "sq" /* Albanian */
-#define HPDF_LANG_SR "sr" /* Serbian */
-#define HPDF_LANG_SS "ss" /* Siswati */
-#define HPDF_LANG_ST "st" /* Sesotho */
-#define HPDF_LANG_SU "su" /* Sundanese */
-#define HPDF_LANG_SV "sv" /* Swedish */
-#define HPDF_LANG_SW "sw" /* Swahili */
-#define HPDF_LANG_TA "ta" /* Tamil */
-#define HPDF_LANG_TE "te" /* Tegulu */
-#define HPDF_LANG_TG "tg" /* Tajik */
-#define HPDF_LANG_TH "th" /* Thai */
-#define HPDF_LANG_TI "ti" /* Tigrinya */
-#define HPDF_LANG_TK "tk" /* Turkmen */
-#define HPDF_LANG_TL "tl" /* Tagalog */
-#define HPDF_LANG_TN "tn" /* Setswanato Tonga */
-#define HPDF_LANG_TR "tr" /* Turkish */
-#define HPDF_LANG_TS "ts" /* Tsonga */
-#define HPDF_LANG_TT "tt" /* Tatar */
-#define HPDF_LANG_TW "tw" /* Twi */
-#define HPDF_LANG_UK "uk" /* Ukrainian */
-#define HPDF_LANG_UR "ur" /* Urdu */
-#define HPDF_LANG_UZ "uz" /* Uzbek */
-#define HPDF_LANG_VI "vi" /* Vietnamese */
-#define HPDF_LANG_VO "vo" /* Volapuk */
-#define HPDF_LANG_WO "wo" /* Wolof */
-#define HPDF_LANG_XH "xh" /* Xhosa */
-#define HPDF_LANG_YO "yo" /* Yoruba */
-#define HPDF_LANG_ZH "zh" /* Chinese */
-#define HPDF_LANG_ZU "zu" /* Zulu */
-
-
-/*----------------------------------------------------------------------------*/
-/*----- Graphis mode ---------------------------------------------------------*/
-
-#define HPDF_GMODE_PAGE_DESCRIPTION 0x0001
-#define HPDF_GMODE_PATH_OBJECT 0x0002
-#define HPDF_GMODE_TEXT_OBJECT 0x0004
-#define HPDF_GMODE_CLIPPING_PATH 0x0008
-#define HPDF_GMODE_SHADING 0x0010
-#define HPDF_GMODE_INLINE_IMAGE 0x0020
-#define HPDF_GMODE_EXTERNAL_OBJECT 0x0040
-
-
-/*----------------------------------------------------------------------------*/
-
-#endif /* _HPDF_CONSTS_H */
diff --git a/code/libharu/hpdf_destination.h b/code/libharu/hpdf_destination.h
deleted file mode 100644
index d7ec27a..0000000
--- a/code/libharu/hpdf_destination.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_destination.c
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_DESTINATION_H
-#define _HPDF_DESTINATION_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_Destination -----------------------------------------------------*/
-
-HPDF_Destination
-HPDF_Destination_New (HPDF_MMgr mmgr,
- HPDF_Page target,
- HPDF_Xref xref);
-
-
-HPDF_BOOL
-HPDF_Destination_Validate (HPDF_Destination dst);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_DESTINATION_H */
-
diff --git a/code/libharu/hpdf_doc.h b/code/libharu/hpdf_doc.h
deleted file mode 100644
index 89779c0..0000000
--- a/code/libharu/hpdf_doc.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_doc.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-
-#ifndef _HPDF_DOC_H
-#define _HPDF_DOC_H
-
-#define HPDF_SIG_BYTES 0x41504446L
-
-#include "hpdf_catalog.h"
-#include "hpdf_image.h"
-#include "hpdf_pages.h"
-#include "hpdf_outline.h"
-#include "hpdf_ext_gstate.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define HPDF_VER_DEFAULT HPDF_VER_12
-
-typedef struct _HPDF_Doc_Rec {
- HPDF_UINT32 sig_bytes;
- HPDF_PDFVer pdf_version;
-
- HPDF_MMgr mmgr;
- HPDF_Catalog catalog;
- HPDF_Outline outlines;
- HPDF_Xref xref;
- HPDF_Pages root_pages;
- HPDF_Pages cur_pages;
- HPDF_Page cur_page;
- HPDF_List page_list;
- HPDF_Error_Rec error;
- HPDF_Dict info;
- HPDF_Dict trailer;
-
- HPDF_List font_mgr;
- HPDF_BYTE ttfont_tag[6];
-
- /* list for loaded fontdefs */
- HPDF_List fontdef_list;
-
- /* list for loaded encodings */
- HPDF_List encoder_list;
-
- HPDF_Encoder cur_encoder;
-
- /* default compression mode */
- HPDF_BOOL compression_mode;
-
- HPDF_BOOL encrypt_on;
- HPDF_EncryptDict encrypt_dict;
-
- HPDF_Encoder def_encoder;
-
- HPDF_UINT page_per_pages;
- HPDF_UINT cur_page_num;
-
- /* buffer for saving into memory stream */
- HPDF_Stream stream;
-} HPDF_Doc_Rec;
-
-typedef struct _HPDF_Doc_Rec *HPDF_Doc;
-
-
-HPDF_Encoder
-HPDF_Doc_FindEncoder (HPDF_Doc pdf,
- const char *encoding_name);
-
-
-HPDF_FontDef
-HPDF_Doc_FindFontDef (HPDF_Doc pdf,
- const char *font_name);
-
-
-HPDF_Font
-HPDF_Doc_FindFont (HPDF_Doc pdf,
- const char *font_name,
- const char *encoding_name);
-
-
-HPDF_BOOL
-HPDF_Doc_Validate (HPDF_Doc pdf);
-
-
-/*----- page handling -------------------------------------------------------*/
-
-HPDF_Pages
-HPDF_Doc_GetCurrentPages (HPDF_Doc pdf);
-
-
-HPDF_Pages
-HPDF_Doc_AddPagesTo (HPDF_Doc pdf,
- HPDF_Pages parent);
-
-
-HPDF_STATUS
-HPDF_Doc_SetCurrentPages (HPDF_Doc pdf,
- HPDF_Pages pages);
-
-
-HPDF_STATUS
-HPDF_Doc_SetCurrentPage (HPDF_Doc pdf,
- HPDF_Page page);
-
-
-
-
-/*----- font handling -------------------------------------------------------*/
-
-HPDF_FontDef
-HPDF_GetFontDef (HPDF_Doc pdf,
- const char *font_name);
-
-
-HPDF_STATUS
-HPDF_Doc_RegisterFontDef (HPDF_Doc pdf,
- HPDF_FontDef fontdef);
-
-
-/*----- encoding handling ---------------------------------------------------*/
-
-HPDF_STATUS
-HPDF_Doc_RegisterEncoder (HPDF_Doc pdf,
- HPDF_Encoder encoder);
-
-
-
-/*----- encryptio------------------------------------------------------------*/
-
-HPDF_STATUS
-HPDF_Doc_SetEncryptOn (HPDF_Doc pdf);
-
-
-HPDF_STATUS
-HPDF_Doc_SetEncryptOff (HPDF_Doc pdf);
-
-
-HPDF_STATUS
-HPDF_Doc_PrepareEncryption (HPDF_Doc pdf);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_DOC_H */
-
diff --git a/code/libharu/hpdf_encoder.h b/code/libharu/hpdf_encoder.h
deleted file mode 100644
index 411d78d..0000000
--- a/code/libharu/hpdf_encoder.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_encoder.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_ENCODER_H
-#define _HPDF_ENCODER_H
-
-#include "hpdf_consts.h"
-#include "hpdf_streams.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*-- HPDF_Encoder ---------------------------------------*/
-
-#define HPDF_ENCODER_SIG_BYTES 0x454E4344L
-
-/*----------------------------------------------------------------------------*/
-/*------ predefined font encodings -------------------------------------------*/
-
-#define HPDF_ENCODING_FONT_SPECIFIC "FontSpecific"
-#define HPDF_ENCODING_STANDARD "StandardEncoding"
-#define HPDF_ENCODING_MAC_ROMAN "MacRomanEncoding"
-#define HPDF_ENCODING_WIN_ANSI "WinAnsiEncoding"
-#define HPDF_ENCODING_ISO8859_2 "ISO8859-2"
-#define HPDF_ENCODING_ISO8859_3 "ISO8859-3"
-#define HPDF_ENCODING_ISO8859_4 "ISO8859-4"
-#define HPDF_ENCODING_ISO8859_5 "ISO8859-5"
-#define HPDF_ENCODING_ISO8859_6 "ISO8859-6"
-#define HPDF_ENCODING_ISO8859_7 "ISO8859-7"
-#define HPDF_ENCODING_ISO8859_8 "ISO8859-8"
-#define HPDF_ENCODING_ISO8859_9 "ISO8859-9"
-#define HPDF_ENCODING_ISO8859_10 "ISO8859-10"
-#define HPDF_ENCODING_ISO8859_11 "ISO8859-11"
-#define HPDF_ENCODING_ISO8859_13 "ISO8859-13"
-#define HPDF_ENCODING_ISO8859_14 "ISO8859-14"
-#define HPDF_ENCODING_ISO8859_15 "ISO8859-15"
-#define HPDF_ENCODING_ISO8859_16 "ISO8859-16"
-#define HPDF_ENCODING_CP1250 "CP1250"
-#define HPDF_ENCODING_CP1251 "CP1251"
-#define HPDF_ENCODING_CP1252 "CP1252"
-#define HPDF_ENCODING_CP1253 "CP1253"
-#define HPDF_ENCODING_CP1254 "CP1254"
-#define HPDF_ENCODING_CP1255 "CP1255"
-#define HPDF_ENCODING_CP1256 "CP1256"
-#define HPDF_ENCODING_CP1257 "CP1257"
-#define HPDF_ENCODING_CP1258 "CP1258"
-#define HPDF_ENCODING_KOI8_R "KOI8-R"
-
-/*----------------------------------------------------------------------------*/
-/*----- definition for font encoding -----------------------------------------*/
-
-#define char_NOTDEF ".notdef"
-
-typedef enum _HPDF_EncodingType {
- HPDF_STANDARD_ENCODING = 0,
- HPDF_MAC_ROMAN_ENCODING,
- HPDF_WIN_ANSI_ENCODING,
- HPDF_FONT_SPECIFIC,
- HPDF_ENCODING_EOF
-} HPDF_EncodingType;
-
-
-typedef struct _HPDF_ParseText_Rec {
- const HPDF_BYTE *text;
- HPDF_UINT index;
- HPDF_UINT len;
- HPDF_ByteType byte_type;
-} HPDF_ParseText_Rec;
-
-
-typedef struct _HPDF_Encoder_Rec *HPDF_Encoder;
-
-typedef HPDF_ByteType
-(*HPDF_Encoder_ByteType_Func) (HPDF_Encoder encoder,
- HPDF_ParseText_Rec *state);
-
-typedef HPDF_UNICODE
-(*HPDF_Encoder_ToUnicode_Func) (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-typedef char *
-(*HPDF_Encoder_EncodeText_Func) (HPDF_Encoder encoder,
- const char *text,
- HPDF_UINT len,
- HPDF_UINT *encoded_length);
-
-typedef HPDF_STATUS
-(*HPDF_Encoder_Write_Func) (HPDF_Encoder encoder,
- HPDF_Stream out);
-
-
-typedef HPDF_STATUS
-(*HPDF_Encoder_Init_Func) (HPDF_Encoder encoder);
-
-
-typedef void
-(*HPDF_Encoder_Free_Func) (HPDF_Encoder encoder);
-
-
-typedef struct _HPDF_Encoder_Rec {
- HPDF_UINT32 sig_bytes;
- char name[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_EncoderType type;
-
- HPDF_Encoder_ByteType_Func byte_type_fn;
- HPDF_Encoder_ToUnicode_Func to_unicode_fn;
- HPDF_Encoder_EncodeText_Func encode_text_fn;
- HPDF_Encoder_Write_Func write_fn;
- HPDF_Encoder_Free_Func free_fn;
- HPDF_Encoder_Init_Func init_fn;
- /*
- char lang_code[3];
- char country_code[3];
- */
- void *attr;
-} HPDF_Encoder_Rec;
-
-
-typedef enum _HPDF_BaseEncodings {
- HPDF_BASE_ENCODING_STANDARD,
- HPDF_BASE_ENCODING_WIN_ANSI,
- HPDF_BASE_ENCODING_MAC_ROMAN,
- HPDF_BASE_ENCODING_FONT_SPECIFIC,
- HPDF_BASE_ENCODING_EOF
-} HPDF_BaseEncodings;
-
-HPDF_STATUS
-HPDF_Encoder_Validate (HPDF_Encoder encoder);
-
-void
-HPDF_Encoder_SetParseText (HPDF_Encoder encoder,
- HPDF_ParseText_Rec *state,
- const HPDF_BYTE *text,
- HPDF_UINT len);
-
-HPDF_ByteType
-HPDF_Encoder_ByteType (HPDF_Encoder encoder,
- HPDF_ParseText_Rec *state);
-
-
-
-HPDF_UNICODE
-HPDF_Encoder_ToUnicode (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-
-void
-HPDF_Encoder_Free (HPDF_Encoder encoder);
-
-/*-- HPDF_BasicEncoder ----------------------------------*/
-
-
-typedef struct _HPDF_BasicEncoderAttr_Rec *HPDF_BasicEncoderAttr;
-
-typedef struct _HPDF_BasicEncoderAttr_Rec {
- char base_encoding[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_BYTE first_char;
- HPDF_BYTE last_char;
- HPDF_UNICODE unicode_map[256];
- HPDF_BOOL has_differences;
- HPDF_BYTE differences[256];
-} HPDF_BasicEncoderAttr_Rec;
-
-
-HPDF_Encoder
-HPDF_BasicEncoder_New (HPDF_MMgr mmgr,
- const char *encoding_name);
-
-
-void
-HPDF_BasicEncoder_Free (HPDF_Encoder encoder);
-
-
-HPDF_STATUS
-HPDF_BasicEncoder_Write (HPDF_Encoder encoder,
- HPDF_Stream out);
-
-
-HPDF_UNICODE
-HPDF_BasicEncoder_ToUnicode (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-/*-- HPDF_CMapEncoder ----------------------------------*/
-
-typedef HPDF_BOOL
-(*HPDF_CMapEncoder_ByteType_Func) (HPDF_Encoder encoder,
- HPDF_BYTE b);
-
-typedef struct _HPDF_CidRange_Rec {
- HPDF_UINT16 from;
- HPDF_UINT16 to;
- HPDF_UINT16 cid;
-} HPDF_CidRange_Rec;
-
-
-typedef struct _HPDF_UnicodeMap_Rec {
- HPDF_UINT16 code;
- HPDF_UINT16 unicode;
-} HPDF_UnicodeMap_Rec;
-
-typedef struct _HPDF_CMapEncoderAttr_Rec *HPDF_CMapEncoderAttr;
-
-typedef struct _HPDF_CMapEncoderAttr_Rec {
- HPDF_UNICODE unicode_map[256][256];
- HPDF_UINT16 cid_map[256][256];
- HPDF_UINT16 jww_line_head[HPDF_MAX_JWW_NUM];
- HPDF_List cmap_range;
- HPDF_List notdef_range;
- HPDF_List code_space_range;
- HPDF_WritingMode writing_mode;
- char registry[HPDF_LIMIT_MAX_NAME_LEN + 1];
- char ordering[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_INT suppliment;
- HPDF_CMapEncoder_ByteType_Func is_lead_byte_fn;
- HPDF_CMapEncoder_ByteType_Func is_trial_byte_fn;
- HPDF_INT uid_offset;
- HPDF_UINT xuid[3];
-} HPDF_CMapEncoderAttr_Rec;
-
-
-HPDF_Encoder
-HPDF_CMapEncoder_New (HPDF_MMgr mmgr,
- char *name,
- HPDF_Encoder_Init_Func init_fn);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_InitAttr (HPDF_Encoder encoder);
-
-
-void
-HPDF_CMapEncoder_Free (HPDF_Encoder encoder);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_Write (HPDF_Encoder encoder,
- HPDF_Stream out);
-
-
-HPDF_UNICODE
-HPDF_CMapEncoder_ToUnicode (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-HPDF_UINT16
-HPDF_CMapEncoder_ToCID (HPDF_Encoder encoder,
- HPDF_UINT16 code);
-
-HPDF_STATUS
-HPDF_CMapEncoder_SetParseText (HPDF_Encoder encoder,
- HPDF_ParseText_Rec *state,
- const HPDF_BYTE *text,
- HPDF_UINT len);
-
-HPDF_ByteType
-HPDF_CMapEncoder_ByteType (HPDF_Encoder encoder,
- HPDF_ParseText_Rec *state);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_AddCMap (HPDF_Encoder encoder,
- const HPDF_CidRange_Rec *range);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_AddNotDefRange (HPDF_Encoder encoder,
- HPDF_CidRange_Rec range);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_AddCodeSpaceRange (HPDF_Encoder encoder,
- HPDF_CidRange_Rec range);
-
-
-void
-HPDF_CMapEncoder_SetUnicodeArray (HPDF_Encoder encoder,
- const HPDF_UnicodeMap_Rec *array1);
-
-
-HPDF_STATUS
-HPDF_CMapEncoder_AddJWWLineHead (HPDF_Encoder encoder,
- const HPDF_UINT16 *code);
-
-HPDF_BOOL
-HPDF_Encoder_CheckJWWLineHead (HPDF_Encoder encoder,
- const HPDF_UINT16 code);
-
-/*-- utility functions ----------------------------------*/
-
-const char*
-HPDF_UnicodeToGryphName (HPDF_UNICODE unicode);
-
-
-HPDF_UNICODE
-HPDF_GryphNameToUnicode (const char *gryph_name);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_ENCODER_H */
-
diff --git a/code/libharu/hpdf_encrypt.h b/code/libharu/hpdf_encrypt.h
deleted file mode 100644
index f9fddb8..0000000
--- a/code/libharu/hpdf_encrypt.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_encrypt.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- *------------------------------------------------------------------------------
- *
- * The code implements MD5 message-digest algorithm is based on the code
- * written by Colin Plumb.
- * The copyright of it is as follows.
- *
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef HPDF_ENCRYPT_H
-#define HPDF_ENCRYPT_H
-
-#include "hpdf_mmgr.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*----- encrypt-dict ---------------------------------------------------------*/
-
-#define HPDF_ID_LEN 16
-#define HPDF_PASSWD_LEN 32
-#define HPDF_ENCRYPT_KEY_MAX 16
-#define HPDF_MD5_KEY_LEN 16
-#define HPDF_PERMISSION_PAD 0xFFFFFFC0
-#define HPDF_ARC4_BUF_SIZE 256
-
-
-typedef struct HPDF_MD5Context
-{
- HPDF_UINT32 buf[4];
- HPDF_UINT32 bits[2];
- HPDF_BYTE in[64];
-} HPDF_MD5_CTX;
-
-
-typedef struct _HPDF_ARC4_Ctx_Rec {
- HPDF_BYTE idx1;
- HPDF_BYTE idx2;
- HPDF_BYTE state[HPDF_ARC4_BUF_SIZE];
-} HPDF_ARC4_Ctx_Rec;
-
-
-typedef struct _HPDF_Encrypt_Rec *HPDF_Encrypt;
-
-typedef struct _HPDF_Encrypt_Rec {
- HPDF_EncryptMode mode;
-
- /* key_len must be a multiple of 8, and between 40 to 128 */
- HPDF_UINT key_len;
-
- /* owner-password (not encrypted) */
- HPDF_BYTE owner_passwd[HPDF_PASSWD_LEN];
-
- /* user-password (not encrypted) */
- HPDF_BYTE user_passwd[HPDF_PASSWD_LEN];
-
- /* owner-password (encrypted) */
- HPDF_BYTE owner_key[HPDF_PASSWD_LEN];
-
- /* user-password (encrypted) */
- HPDF_BYTE user_key[HPDF_PASSWD_LEN];
-
- HPDF_INT permission;
- HPDF_BYTE encrypt_id[HPDF_ID_LEN];
- HPDF_BYTE encryption_key[HPDF_MD5_KEY_LEN + 5];
- HPDF_BYTE md5_encryption_key[HPDF_MD5_KEY_LEN];
- HPDF_ARC4_Ctx_Rec arc4ctx;
-} HPDF_Encrypt_Rec;
-
-
-void
-HPDF_MD5Init (struct HPDF_MD5Context *ctx);
-
-
-void
-HPDF_MD5Update (struct HPDF_MD5Context *ctx,
- const HPDF_BYTE *buf,
- HPDF_UINT32 len);
-
-
-void
-HPDF_MD5Final (HPDF_BYTE digest[16],
- struct HPDF_MD5Context *ctx);
-
-void
-HPDF_PadOrTrancatePasswd (const char *pwd,
- HPDF_BYTE *new_pwd);
-
-
-void
-HPDF_Encrypt_Init (HPDF_Encrypt attr);
-
-
-void
-HPDF_Encrypt_CreateUserKey (HPDF_Encrypt attr);
-
-
-void
-HPDF_Encrypt_CreateOwnerKey (HPDF_Encrypt attr);
-
-
-void
-HPDF_Encrypt_CreateEncryptionKey (HPDF_Encrypt attr);
-
-
-void
-HPDF_Encrypt_InitKey (HPDF_Encrypt attr,
- HPDF_UINT32 object_id,
- HPDF_UINT16 gen_no);
-
-
-void
-HPDF_Encrypt_Reset (HPDF_Encrypt attr);
-
-
-void
-HPDF_Encrypt_CryptBuf (HPDF_Encrypt attr,
- const HPDF_BYTE *src,
- HPDF_BYTE *dst,
- HPDF_UINT len);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_ENCRYPT_H */
-
-
diff --git a/code/libharu/hpdf_encryptdict.h b/code/libharu/hpdf_encryptdict.h
deleted file mode 100644
index 433eb67..0000000
--- a/code/libharu/hpdf_encryptdict.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_encryptdict.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_ENCRYPTDICT_H
-#define _HPDF_ENCRYPTDICT_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*---------------------------------------------------------------------------*/
-/*------ HPDF_EncryptDict ---------------------------------------------------*/
-
-HPDF_EncryptDict
-HPDF_EncryptDict_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-void
-HPDF_EncryptDict_CreateID (HPDF_EncryptDict dict,
- HPDF_Dict info,
- HPDF_Xref xref);
-
-
-void
-HPDF_EncryptDict_OnFree (HPDF_Dict obj);
-
-
-HPDF_STATUS
-HPDF_EncryptDict_SetPassword (HPDF_EncryptDict dict,
- const char *owner_passwd,
- const char *user_passwd);
-
-
-HPDF_BOOL
-HPDF_EncryptDict_Validate (HPDF_EncryptDict dict);
-
-
-HPDF_STATUS
-HPDF_EncryptDict_Prepare (HPDF_EncryptDict dict,
- HPDF_Dict info,
- HPDF_Xref xref);
-
-
-HPDF_Encrypt
-HPDF_EncryptDict_GetAttr (HPDF_EncryptDict dict);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_ENCRYPTDICT_H */
-
diff --git a/code/libharu/hpdf_error.h b/code/libharu/hpdf_error.h
deleted file mode 100644
index 49374fe..0000000
--- a/code/libharu/hpdf_error.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_error.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_ERROR_H
-#define _HPDF_ERROR_H
-
-#include "hpdf_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* error-code */
-#define HPDF_ARRAY_COUNT_ERR 0x1001
-#define HPDF_ARRAY_ITEM_NOT_FOUND 0x1002
-#define HPDF_ARRAY_ITEM_UNEXPECTED_TYPE 0x1003
-#define HPDF_BINARY_LENGTH_ERR 0x1004
-#define HPDF_CANNOT_GET_PALLET 0x1005
-#define HPDF_DICT_COUNT_ERR 0x1007
-#define HPDF_DICT_ITEM_NOT_FOUND 0x1008
-#define HPDF_DICT_ITEM_UNEXPECTED_TYPE 0x1009
-#define HPDF_DICT_STREAM_LENGTH_NOT_FOUND 0x100A
-#define HPDF_DOC_ENCRYPTDICT_NOT_FOUND 0x100B
-#define HPDF_DOC_INVALID_OBJECT 0x100C
-/* 0x100D */
-#define HPDF_DUPLICATE_REGISTRATION 0x100E
-#define HPDF_EXCEED_JWW_CODE_NUM_LIMIT 0x100F
-/* 0x1010 */
-#define HPDF_ENCRYPT_INVALID_PASSWORD 0x1011
-/* 0x1012 */
-#define HPDF_ERR_UNKNOWN_CLASS 0x1013
-#define HPDF_EXCEED_GSTATE_LIMIT 0x1014
-#define HPDF_FAILD_TO_ALLOC_MEM 0x1015
-#define HPDF_FILE_IO_ERROR 0x1016
-#define HPDF_FILE_OPEN_ERROR 0x1017
-/* 0x1018 */
-#define HPDF_FONT_EXISTS 0x1019
-#define HPDF_FONT_INVALID_WIDTHS_TABLE 0x101A
-#define HPDF_INVALID_AFM_HEADER 0x101B
-#define HPDF_INVALID_ANNOTATION 0x101C
-/* 0x101D */
-#define HPDF_INVALID_BIT_PER_COMPONENT 0x101E
-#define HPDF_INVALID_CHAR_MATRICS_DATA 0x101F
-#define HPDF_INVALID_COLOR_SPACE 0x1020
-#define HPDF_INVALID_COMPRESSION_MODE 0x1021
-#define HPDF_INVALID_DATE_TIME 0x1022
-#define HPDF_INVALID_DESTINATION 0x1023
-/* 0x1024 */
-#define HPDF_INVALID_DOCUMENT 0x1025
-#define HPDF_INVALID_DOCUMENT_STATE 0x1026
-#define HPDF_INVALID_ENCODER 0x1027
-#define HPDF_INVALID_ENCODER_TYPE 0x1028
-/* 0x1029 */
-/* 0x102A */
-#define HPDF_INVALID_ENCODING_NAME 0x102B
-#define HPDF_INVALID_ENCRYPT_KEY_LEN 0x102C
-#define HPDF_INVALID_FONTDEF_DATA 0x102D
-#define HPDF_INVALID_FONTDEF_TYPE 0x102E
-#define HPDF_INVALID_FONT_NAME 0x102F
-#define HPDF_INVALID_IMAGE 0x1030
-#define HPDF_INVALID_JPEG_DATA 0x1031
-#define HPDF_INVALID_N_DATA 0x1032
-#define HPDF_INVALID_OBJECT 0x1033
-#define HPDF_INVALID_OBJ_ID 0x1034
-#define HPDF_INVALID_OPERATION 0x1035
-#define HPDF_INVALID_OUTLINE 0x1036
-#define HPDF_INVALID_PAGE 0x1037
-#define HPDF_INVALID_PAGES 0x1038
-#define HPDF_INVALID_PARAMETER 0x1039
-/* 0x103A */
-#define HPDF_INVALID_PNG_IMAGE 0x103B
-#define HPDF_INVALID_STREAM 0x103C
-#define HPDF_MISSING_FILE_NAME_ENTRY 0x103D
-/* 0x103E */
-#define HPDF_INVALID_TTC_FILE 0x103F
-#define HPDF_INVALID_TTC_INDEX 0x1040
-#define HPDF_INVALID_WX_DATA 0x1041
-#define HPDF_ITEM_NOT_FOUND 0x1042
-#define HPDF_LIBPNG_ERROR 0x1043
-#define HPDF_NAME_INVALID_VALUE 0x1044
-#define HPDF_NAME_OUT_OF_RANGE 0x1045
-/* 0x1046 */
-/* 0x1047 */
-#define HPDF_PAGE_INVALID_PARAM_COUNT 0x1048
-#define HPDF_PAGES_MISSING_KIDS_ENTRY 0x1049
-#define HPDF_PAGE_CANNOT_FIND_OBJECT 0x104A
-#define HPDF_PAGE_CANNOT_GET_ROOT_PAGES 0x104B
-#define HPDF_PAGE_CANNOT_RESTORE_GSTATE 0x104C
-#define HPDF_PAGE_CANNOT_SET_PARENT 0x104D
-#define HPDF_PAGE_FONT_NOT_FOUND 0x104E
-#define HPDF_PAGE_INVALID_FONT 0x104F
-#define HPDF_PAGE_INVALID_FONT_SIZE 0x1050
-#define HPDF_PAGE_INVALID_GMODE 0x1051
-#define HPDF_PAGE_INVALID_INDEX 0x1052
-#define HPDF_PAGE_INVALID_ROTATE_VALUE 0x1053
-#define HPDF_PAGE_INVALID_SIZE 0x1054
-#define HPDF_PAGE_INVALID_XOBJECT 0x1055
-#define HPDF_PAGE_OUT_OF_RANGE 0x1056
-#define HPDF_REAL_OUT_OF_RANGE 0x1057
-#define HPDF_STREAM_EOF 0x1058
-#define HPDF_STREAM_READLN_CONTINUE 0x1059
-/* 0x105A */
-#define HPDF_STRING_OUT_OF_RANGE 0x105B
-#define HPDF_THIS_FUNC_WAS_SKIPPED 0x105C
-#define HPDF_TTF_CANNOT_EMBEDDING_FONT 0x105D
-#define HPDF_TTF_INVALID_CMAP 0x105E
-#define HPDF_TTF_INVALID_FOMAT 0x105F
-#define HPDF_TTF_MISSING_TABLE 0x1060
-#define HPDF_UNSUPPORTED_FONT_TYPE 0x1061
-#define HPDF_UNSUPPORTED_FUNC 0x1062
-#define HPDF_UNSUPPORTED_JPEG_FORMAT 0x1063
-#define HPDF_UNSUPPORTED_TYPE1_FONT 0x1064
-#define HPDF_XREF_COUNT_ERR 0x1065
-#define HPDF_ZLIB_ERROR 0x1066
-#define HPDF_INVALID_PAGE_INDEX 0x1067
-#define HPDF_INVALID_URI 0x1068
-#define HPDF_PAGE_LAYOUT_OUT_OF_RANGE 0x1069
-#define HPDF_PAGE_MODE_OUT_OF_RANGE 0x1070
-#define HPDF_PAGE_NUM_STYLE_OUT_OF_RANGE 0x1071
-#define HPDF_ANNOT_INVALID_ICON 0x1072
-#define HPDF_ANNOT_INVALID_BORDER_STYLE 0x1073
-#define HPDF_PAGE_INVALID_DIRECTION 0x1074
-#define HPDF_INVALID_FONT 0x1075
-#define HPDF_PAGE_INSUFFICIENT_SPACE 0x1076
-#define HPDF_PAGE_INVALID_DISPLAY_TIME 0x1077
-#define HPDF_PAGE_INVALID_TRANSITION_TIME 0x1078
-#define HPDF_INVALID_PAGE_SLIDESHOW_TYPE 0x1079
-#define HPDF_EXT_GSTATE_OUT_OF_RANGE 0x1080
-#define HPDF_INVALID_EXT_GSTATE 0x1081
-#define HPDF_EXT_GSTATE_READ_ONLY 0x1082
-#define HPDF_INVALID_U3D_DATA 0x1083
-#define HPDF_NAME_CANNOT_GET_NAMES 0x1084
-#define HPDF_INVALID_ICC_COMPONENT_NUM 0x1085
-
-/*---------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Error ----------------------------------------------------------*/
-
-typedef struct _HPDF_Error_Rec *HPDF_Error;
-
-typedef struct _HPDF_Error_Rec {
- HPDF_STATUS error_no;
- HPDF_STATUS detail_no;
- HPDF_Error_Handler error_fn;
- void *user_data;
-} HPDF_Error_Rec;
-
-
-/* HPDF_Error_init
- *
- * if error_fn is NULL, the default-handlers are set as error-handler.
- * user_data is used to identify the object which threw an error.
- *
- */
-void
-HPDF_Error_Init (HPDF_Error error,
- void *user_data);
-
-
-void
-HPDF_Error_Reset (HPDF_Error error);
-
-
-HPDF_STATUS
-HPDF_Error_GetCode (HPDF_Error error);
-
-
-HPDF_STATUS
-HPDF_Error_GetDetailCode (HPDF_Error error);
-
-
-HPDF_STATUS
-HPDF_SetError (HPDF_Error error,
- HPDF_STATUS error_no,
- HPDF_STATUS detail_no);
-
-
-HPDF_STATUS
-HPDF_RaiseError (HPDF_Error error,
- HPDF_STATUS error_no,
- HPDF_STATUS detail_no);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_ERROR_H */
-
diff --git a/code/libharu/hpdf_exdata.h b/code/libharu/hpdf_exdata.h
deleted file mode 100644
index e14245f..0000000
--- a/code/libharu/hpdf_exdata.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_annotation.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_EXDATA_H
-#define _HPDF_EXDATA_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*------ HPDF_ExData -----------------------------------------------------*/
-
-HPDF_ExData
-HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
- HPDF_Xref xref );
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_EXDATA_H */
-
diff --git a/code/libharu/hpdf_ext_gstate.h b/code/libharu/hpdf_ext_gstate.h
deleted file mode 100644
index 415f117..0000000
--- a/code/libharu/hpdf_ext_gstate.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_ext_gstate.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_EXT_GSTATE_H
-#define _HPDF_EXT_GSTATE_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_Dict
-HPDF_ExtGState_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-HPDF_BOOL
-HPDF_ExtGState_Validate (HPDF_ExtGState ext_gstate);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_EXT_GSTATE_H */
-
diff --git a/code/libharu/hpdf_font.h b/code/libharu/hpdf_font.h
deleted file mode 100644
index 140e128..0000000
--- a/code/libharu/hpdf_font.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_font.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_FONT_H
-#define _HPDF_FONT_H
-
-#include "hpdf_fontdef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*----------------------------------------------------------------------------*/
-/*----- Writing Mode ---------------------------------------------------------*/
-
-typedef enum _HPDF_FontType {
- HPDF_FONT_TYPE1 = 0,
- HPDF_FONT_TRUETYPE,
- HPDF_FONT_TYPE3,
- HPDF_FONT_TYPE0_CID,
- HPDF_FONT_TYPE0_TT,
- HPDF_FONT_CID_TYPE0,
- HPDF_FONT_CID_TYPE2,
- HPDF_FONT_MMTYPE1
-} HPDF_FontType;
-
-
-typedef HPDF_Dict HPDF_Font;
-
-
-typedef HPDF_TextWidth
-(*HPDF_Font_TextWidths_Func) (HPDF_Font font,
- const HPDF_BYTE *text,
- HPDF_UINT len);
-
-
-typedef HPDF_UINT
-(*HPDF_Font_MeasureText_Func) (HPDF_Font font,
- const HPDF_BYTE *text,
- HPDF_UINT len,
- HPDF_REAL width,
- HPDF_REAL fontsize,
- HPDF_REAL charspace,
- HPDF_REAL wordspace,
- HPDF_BOOL wordwrap,
- HPDF_REAL *real_width);
-
-
-typedef struct _HPDF_FontAttr_Rec *HPDF_FontAttr;
-
-typedef struct _HPDF_FontAttr_Rec {
- HPDF_FontType type;
- HPDF_WritingMode writing_mode;
- HPDF_Font_TextWidths_Func text_width_fn;
- HPDF_Font_MeasureText_Func measure_text_fn;
- HPDF_FontDef fontdef;
- HPDF_Encoder encoder;
-
- /* if the encoding-type is HPDF_ENCODER_TYPE_SINGLE_BYTE, the width of
- * each charactors are cashed in 'widths'.
- * when HPDF_ENCODER_TYPE_DOUBLE_BYTE the width is calculate each time.
- */
- HPDF_INT16* widths;
- HPDF_BYTE* used;
-
- HPDF_Xref xref;
- HPDF_Font descendant_font;
- HPDF_Dict map_stream;
- HPDF_Dict cmap_stream;
-} HPDF_FontAttr_Rec;
-
-
-HPDF_Font
-HPDF_Type1Font_New (HPDF_MMgr mmgr,
- HPDF_FontDef fontdef,
- HPDF_Encoder encoder,
- HPDF_Xref xref);
-
-HPDF_Font
-HPDF_TTFont_New (HPDF_MMgr mmgr,
- HPDF_FontDef fontdef,
- HPDF_Encoder encoder,
- HPDF_Xref xref);
-
-HPDF_Font
-HPDF_Type0Font_New (HPDF_MMgr mmgr,
- HPDF_FontDef fontdef,
- HPDF_Encoder encoder,
- HPDF_Xref xref);
-
-
-HPDF_BOOL
-HPDF_Font_Validate (HPDF_Font font);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_FONT_H */
-
diff --git a/code/libharu/hpdf_fontdef.h b/code/libharu/hpdf_fontdef.h
deleted file mode 100644
index 27679b5..0000000
--- a/code/libharu/hpdf_fontdef.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_fontdef.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_FONTDEF_H
-#define _HPDF_FONTDEF_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define HPDF_FONTDEF_SIG_BYTES 0x464F4E54L
-
-/*------ collection of flags for defining characteristics. ---*/
-
-#define HPDF_FONT_FIXED_WIDTH 1
-#define HPDF_FONT_SERIF 2
-#define HPDF_FONT_SYMBOLIC 4
-#define HPDF_FONT_SCRIPT 8
- /* Reserved 16 */
-#define HPDF_FONT_STD_CHARSET 32
-#define HPDF_FONT_ITALIC 64
- /* Reserved 128
- Reserved 256
- Reserved 512
- Reserved 1024
- Reserved 2048
- Reserved 4096
- Reserved 8192
- Reserved 16384
- Reserved 32768 */
-#define HPDF_FONT_ALL_CAP 65536
-#define HPDF_FONT_SMALL_CAP 131072
-#define HPDF_FONT_FOURCE_BOLD 262144
-
-#define HPDF_CID_W_TYPE_FROM_TO 0
-#define HPDF_CID_W_TYPE_FROM_ARRAY 1
-
-/*-- HPDF_FontDef ---------------------------------------*/
-
-typedef struct _HPDF_CharData {
- HPDF_INT16 char_cd;
- HPDF_UNICODE unicode;
- HPDF_INT16 width;
-} HPDF_CharData;
-
-typedef enum _HPDF_FontDefType {
- HPDF_FONTDEF_TYPE_TYPE1,
- HPDF_FONTDEF_TYPE_TRUETYPE,
- HPDF_FONTDEF_TYPE_CID,
- HPDF_FONTDEF_TYPE_UNINITIALIZED,
- HPDF_FONTDEF_TYPE_EOF
-} HPDF_FontDefType;
-
-typedef struct _HPDF_CID_Width {
- HPDF_UINT16 cid;
- HPDF_INT16 width;
-} HPDF_CID_Width;
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_FontDef ---------------------------------------------------------*/
-
-typedef struct _HPDF_FontDef_Rec *HPDF_FontDef;
-
-typedef void (*HPDF_FontDef_FreeFunc) (HPDF_FontDef fontdef);
-
-typedef void (*HPDF_FontDef_CleanFunc) (HPDF_FontDef fontdef);
-
-typedef HPDF_STATUS (*HPDF_FontDef_InitFunc) (HPDF_FontDef fontdef);
-
-typedef struct _HPDF_FontDef_Rec {
- HPDF_UINT32 sig_bytes;
- char base_font[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_FontDefType type;
- HPDF_FontDef_CleanFunc clean_fn;
- HPDF_FontDef_FreeFunc free_fn;
- HPDF_FontDef_InitFunc init_fn;
-
- HPDF_INT16 ascent;
- HPDF_INT16 descent;
- HPDF_UINT flags;
- HPDF_Box font_bbox;
- HPDF_INT16 italic_angle;
- HPDF_UINT16 stemv;
- HPDF_INT16 avg_width;
- HPDF_INT16 max_width;
- HPDF_INT16 missing_width;
- HPDF_UINT16 stemh;
- HPDF_UINT16 x_height;
- HPDF_UINT16 cap_height;
-
- /* the initial value of descriptor entry is NULL.
- * when first font-object besed on the fontdef object is created,
- * the font-descriptor object is created and descriptor entry is set.
- */
- HPDF_Dict descriptor;
- HPDF_Stream data;
-
- HPDF_BOOL valid;
- void *attr;
-} HPDF_FontDef_Rec;
-
-
-void
-HPDF_FontDef_Free (HPDF_FontDef fontdef);
-
-
-void
-HPDF_FontDef_Cleanup (HPDF_FontDef fontdef);
-
-
-HPDF_BOOL
-HPDF_FontDef_Validate (HPDF_FontDef fontdef);
-
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_Type1FontDef ---------------------------------------------------*/
-
-typedef struct _HPDF_Type1FontDefAttrRec *HPDF_Type1FontDefAttr;
-
-typedef struct _HPDF_Type1FontDefAttrRec {
- HPDF_BYTE first_char; /* Required */
- HPDF_BYTE last_char; /* Required */
- HPDF_CharData *widths; /* Required */
- HPDF_UINT widths_count;
-
- HPDF_INT16 leading;
- char *char_set;
- char encoding_scheme[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_UINT length1;
- HPDF_UINT length2;
- HPDF_UINT length3;
- HPDF_BOOL is_base14font;
- HPDF_BOOL is_fixed_pitch;
-
- HPDF_Stream font_data;
-} HPDF_Type1FontDefAttr_Rec;
-
-
-
-HPDF_FontDef
-HPDF_Type1FontDef_New (HPDF_MMgr mmgr);
-
-
-HPDF_FontDef
-HPDF_Type1FontDef_Load (HPDF_MMgr mmgr,
- HPDF_Stream afm,
- HPDF_Stream font_data);
-
-
-HPDF_FontDef
-HPDF_Type1FontDef_Duplicate (HPDF_MMgr mmgr,
- HPDF_FontDef src);
-
-
-HPDF_STATUS
-HPDF_Type1FontDef_SetWidths (HPDF_FontDef fontdef,
- const HPDF_CharData *widths);
-
-
-HPDF_INT16
-HPDF_Type1FontDef_GetWidthByName (HPDF_FontDef fontdef,
- const char *gryph_name);
-
-
-HPDF_INT16
-HPDF_Type1FontDef_GetWidth (HPDF_FontDef fontdef,
- HPDF_UNICODE unicode);
-
-
-HPDF_FontDef
-HPDF_Base14FontDef_New (HPDF_MMgr mmgr,
- const char *font_name);
-
-
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_TTFontDef ------------------------------------------------------*/
-
-#define HPDF_TTF_FONT_TAG_LEN 6
-
-typedef struct _HPDF_TTF_Table {
- char tag[4];
- HPDF_UINT32 check_sum;
- HPDF_UINT32 offset;
- HPDF_UINT32 length;
-} HPDF_TTFTable;
-
-
-typedef struct _HPDF_TTF_OffsetTbl {
- HPDF_UINT32 sfnt_version;
- HPDF_UINT16 num_tables;
- HPDF_UINT16 search_range;
- HPDF_UINT16 entry_selector;
- HPDF_UINT16 range_shift;
- HPDF_TTFTable *table;
-} HPDF_TTF_OffsetTbl;
-
-
-typedef struct _HPDF_TTF_CmapRange {
- HPDF_UINT16 format;
- HPDF_UINT16 length;
- HPDF_UINT16 language;
- HPDF_UINT16 seg_count_x2;
- HPDF_UINT16 search_range;
- HPDF_UINT16 entry_selector;
- HPDF_UINT16 range_shift;
- HPDF_UINT16 *end_count;
- HPDF_UINT16 reserved_pad;
- HPDF_UINT16 *start_count;
- HPDF_INT16 *id_delta;
- HPDF_UINT16 *id_range_offset;
- HPDF_UINT16 *glyph_id_array;
- HPDF_UINT glyph_id_array_count;
-} HPDF_TTF_CmapRange;
-
-
-typedef struct _HPDF_TTF_GryphOffsets {
- HPDF_UINT32 base_offset;
- HPDF_UINT32 *offsets;
- HPDF_BYTE *flgs; /* 0: unused, 1: used */
-} HPDF_TTF_GryphOffsets;
-
-
-typedef struct _HPDF_TTF_LongHorMetric {
- HPDF_UINT16 advance_width;
- HPDF_INT16 lsb;
-} HPDF_TTF_LongHorMetric;
-
-
-typedef struct _HPDF_TTF_FontHeader {
- HPDF_BYTE version_number[4];
- HPDF_UINT32 font_revision;
- HPDF_UINT32 check_sum_adjustment;
- HPDF_UINT32 magic_number;
- HPDF_UINT16 flags;
- HPDF_UINT16 units_per_em;
- HPDF_BYTE created[8];
- HPDF_BYTE modified[8];
- HPDF_INT16 x_min;
- HPDF_INT16 y_min;
- HPDF_INT16 x_max;
- HPDF_INT16 y_max;
- HPDF_UINT16 mac_style;
- HPDF_UINT16 lowest_rec_ppem;
- HPDF_INT16 font_direction_hint;
- HPDF_INT16 index_to_loc_format;
- HPDF_INT16 glyph_data_format;
-} HPDF_TTF_FontHeader;
-
-
-typedef struct _HPDF_TTF_NameRecord {
- HPDF_UINT16 platform_id;
- HPDF_UINT16 encoding_id;
- HPDF_UINT16 language_id;
- HPDF_UINT16 name_id;
- HPDF_UINT16 length;
- HPDF_UINT16 offset;
-} HPDF_TTF_NameRecord;
-
-
-typedef struct _HPDF_TTF_NamingTable {
- HPDF_UINT16 format;
- HPDF_UINT16 count;
- HPDF_UINT16 string_offset;
- HPDF_TTF_NameRecord *name_records;
-} HPDF_TTF_NamingTable;
-
-
-typedef struct _HPDF_TTFontDefAttr_Rec *HPDF_TTFontDefAttr;
-
-typedef struct _HPDF_TTFontDefAttr_Rec {
- char base_font[HPDF_LIMIT_MAX_NAME_LEN + 1];
- HPDF_BYTE first_char;
- HPDF_BYTE last_char;
- char *char_set;
- char tag_name[HPDF_TTF_FONT_TAG_LEN + 1];
- char tag_name2[(HPDF_TTF_FONT_TAG_LEN + 1) * 2];
- HPDF_TTF_FontHeader header;
- HPDF_TTF_GryphOffsets glyph_tbl;
- HPDF_UINT16 num_glyphs;
- HPDF_TTF_NamingTable name_tbl;
- HPDF_TTF_LongHorMetric *h_metric;
- HPDF_UINT16 num_h_metric;
- HPDF_TTF_OffsetTbl offset_tbl;
- HPDF_TTF_CmapRange cmap;
- HPDF_UINT16 fs_type;
- HPDF_BYTE sfamilyclass[2];
- HPDF_BYTE panose[10];
- HPDF_UINT32 code_page_range1;
- HPDF_UINT32 code_page_range2;
-
- HPDF_UINT length1;
-
- HPDF_BOOL embedding;
- HPDF_BOOL is_cidfont;
-
- HPDF_Stream stream;
-} HPDF_TTFontDefAttr_Rec;
-
-
-
-HPDF_FontDef
-HPDF_TTFontDef_New (HPDF_MMgr mmgr);
-
-
-HPDF_FontDef
-HPDF_TTFontDef_Load (HPDF_MMgr mmgr,
- HPDF_Stream stream,
- HPDF_BOOL embedding);
-
-
-HPDF_FontDef
-HPDF_TTFontDef_Load2 (HPDF_MMgr mmgr,
- HPDF_Stream stream,
- HPDF_UINT index,
- HPDF_BOOL embedding);
-
-
-HPDF_UINT16
-HPDF_TTFontDef_GetGlyphid (HPDF_FontDef fontdef,
- HPDF_UINT16 unicode);
-
-
-HPDF_INT16
-HPDF_TTFontDef_GetCharWidth (HPDF_FontDef fontdef,
- HPDF_UINT16 unicode);
-
-
-HPDF_INT16
-HPDF_TTFontDef_GetGidWidth (HPDF_FontDef fontdef,
- HPDF_UINT16 gid);
-
-
-HPDF_STATUS
-HPDF_TTFontDef_SaveFontData (HPDF_FontDef fontdef,
- HPDF_Stream stream);
-
-
-HPDF_Box
-HPDF_TTFontDef_GetCharBBox (HPDF_FontDef fontdef,
- HPDF_UINT16 unicode);
-
-
-void
-HPDF_TTFontDef_SetTagName (HPDF_FontDef fontdef,
- char *tag);
-
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_CIDFontDef -----------------------------------------------------*/
-
-typedef struct _HPDF_CIDFontDefAttrRec *HPDF_CIDFontDefAttr;
-
-typedef struct _HPDF_CIDFontDefAttrRec {
- HPDF_List widths;
- HPDF_INT16 DW;
- HPDF_INT16 DW2[2];
-} HPDF_CIDFontDefAttr_Rec;
-
-
-HPDF_FontDef
-HPDF_CIDFontDef_New (HPDF_MMgr mmgr,
- char *name,
- HPDF_FontDef_InitFunc init_fn);
-
-
-HPDF_STATUS
-HPDF_CIDFontDef_AddWidth (HPDF_FontDef fontdef,
- const HPDF_CID_Width *widths);
-
-
-HPDF_INT16
-HPDF_CIDFontDef_GetCIDWidth (HPDF_FontDef fontdef,
- HPDF_UINT16 cid);
-
-
-
-HPDF_STATUS
-HPDF_CIDFontDef_ChangeStyle (HPDF_FontDef fontdef,
- HPDF_BOOL bold,
- HPDF_BOOL italic);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_FONTDEF_H */
diff --git a/code/libharu/hpdf_gstate.h b/code/libharu/hpdf_gstate.h
deleted file mode 100644
index 8f120ac..0000000
--- a/code/libharu/hpdf_gstate.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_gstate.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_GSTATE_H
-#define _HPDF_GSTATE_H
-
-#include "hpdf_font.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*----------------------------------------------------------------------------*/
-/*------ graphic state stack -------------------------------------------------*/
-
-typedef struct _HPDF_GState_Rec *HPDF_GState;
-
-typedef struct _HPDF_GState_Rec {
- HPDF_TransMatrix trans_matrix;
- HPDF_REAL line_width;
- HPDF_LineCap line_cap;
- HPDF_LineJoin line_join;
- HPDF_REAL miter_limit;
- HPDF_DashMode dash_mode;
- HPDF_REAL flatness;
-
- HPDF_REAL char_space;
- HPDF_REAL word_space;
- HPDF_REAL h_scalling;
- HPDF_REAL text_leading;
- HPDF_TextRenderingMode rendering_mode;
- HPDF_REAL text_rise;
-
- HPDF_ColorSpace cs_fill;
- HPDF_ColorSpace cs_stroke;
- HPDF_RGBColor rgb_fill;
- HPDF_RGBColor rgb_stroke;
- HPDF_CMYKColor cmyk_fill;
- HPDF_CMYKColor cmyk_stroke;
- HPDF_REAL gray_fill;
- HPDF_REAL gray_stroke;
-
- HPDF_Font font;
- HPDF_REAL font_size;
- HPDF_WritingMode writing_mode;
-
- HPDF_GState prev;
- HPDF_UINT depth;
-} HPDF_GState_Rec;
-
-/*----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------*/
-
-HPDF_GState
-HPDF_GState_New (HPDF_MMgr mmgr,
- HPDF_GState current);
-
-
-HPDF_GState
-HPDF_GState_Free (HPDF_MMgr mmgr,
- HPDF_GState gstate);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_GSTATE_H */
-
diff --git a/code/libharu/hpdf_image.h b/code/libharu/hpdf_image.h
deleted file mode 100644
index 909c8fe..0000000
--- a/code/libharu/hpdf_image.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_image.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_IMAGE_H
-#define _HPDF_IMAGE_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_Image
-HPDF_Image_Load1BitImageFromMem (HPDF_MMgr mmgr,
- const HPDF_BYTE *buf,
- HPDF_Xref xref,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_UINT line_width,
- HPDF_BOOL top_is_first
- );
-
-
-#ifndef LIBHPDF_HAVE_NOPNGLIB
-
-HPDF_Image
-HPDF_Image_LoadPngImage (HPDF_MMgr mmgr,
- HPDF_Stream png_data,
- HPDF_Xref xref,
- HPDF_BOOL delayed_loading);
-
-#endif
-
-HPDF_Image
-HPDF_Image_LoadJpegImage (HPDF_MMgr mmgr,
- HPDF_Stream jpeg_data,
- HPDF_Xref xref);
-
-HPDF_Image
-HPDF_Image_LoadJpegImageFromMem (HPDF_MMgr mmgr,
- const HPDF_BYTE *buf,
- HPDF_UINT size,
- HPDF_Xref xref);
-
-HPDF_Image
-HPDF_Image_LoadRawImage (HPDF_MMgr mmgr,
- HPDF_Stream stream,
- HPDF_Xref xref,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_ColorSpace color_space);
-
-
-HPDF_Image
-HPDF_Image_LoadRawImageFromMem (HPDF_MMgr mmgr,
- const HPDF_BYTE *buf,
- HPDF_Xref xref,
- HPDF_UINT width,
- HPDF_UINT height,
- HPDF_ColorSpace color_space,
- HPDF_UINT bits_per_component);
-
-
-HPDF_BOOL
-HPDF_Image_Validate (HPDF_Image image);
-
-
-HPDF_STATUS
-HPDF_Image_SetMask (HPDF_Image image,
- HPDF_BOOL mask);
-
-HPDF_STATUS
-HPDF_Image_SetColorSpace (HPDF_Image image,
- HPDF_Array colorspace);
-
-HPDF_STATUS
-HPDF_Image_SetRenderingIntent (HPDF_Image image,
- const char* intent);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_XOBJECTS_H */
-
diff --git a/code/libharu/hpdf_info.h b/code/libharu/hpdf_info.h
deleted file mode 100644
index 9fb2a7f..0000000
--- a/code/libharu/hpdf_info.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_info.c
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-
-#ifndef _HPDF_INFO_H
-#define _HPDF_INFO_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-HPDF_STATUS
-HPDF_Info_SetInfoAttr (HPDF_Dict info,
- HPDF_InfoType type,
- const char *value,
- HPDF_Encoder encoder);
-
-
-const char*
-HPDF_Info_GetInfoAttr (HPDF_Dict info,
- HPDF_InfoType type);
-
-
-HPDF_STATUS
-HPDF_Info_SetInfoDateAttr (HPDF_Dict info,
- HPDF_InfoType type,
- HPDF_Date value);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_INFO_H */
-
diff --git a/code/libharu/hpdf_list.h b/code/libharu/hpdf_list.h
deleted file mode 100644
index 09a7047..0000000
--- a/code/libharu/hpdf_list.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_list.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_LIST_H
-#define _HPDF_LIST_H
-
-#include "hpdf_error.h"
-#include "hpdf_mmgr.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _HPDF_List_Rec *HPDF_List;
-
-typedef struct _HPDF_List_Rec {
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_UINT block_siz;
- HPDF_UINT items_per_block;
- HPDF_UINT count;
- void **obj;
-} HPDF_List_Rec;
-
-
-HPDF_List
-HPDF_List_New (HPDF_MMgr mmgr,
- HPDF_UINT items_per_block);
-
-
-void
-HPDF_List_Free (HPDF_List list);
-
-
-HPDF_STATUS
-HPDF_List_Add (HPDF_List list,
- void *item);
-
-
-HPDF_STATUS
-HPDF_List_Insert (HPDF_List list,
- void *target,
- void *item);
-
-
-HPDF_STATUS
-HPDF_List_Remove (HPDF_List list,
- void *item);
-
-
-void*
-HPDF_List_RemoveByIndex (HPDF_List list,
- HPDF_UINT index);
-
-
-void*
-HPDF_List_ItemAt (HPDF_List list,
- HPDF_UINT index);
-
-
-HPDF_INT32
-HPDF_List_Find (HPDF_List list,
- void *item);
-
-
-void
-HPDF_List_Clear (HPDF_List list);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_LIST_H */
-
diff --git a/code/libharu/hpdf_mmgr.h b/code/libharu/hpdf_mmgr.h
deleted file mode 100644
index 11ec9b8..0000000
--- a/code/libharu/hpdf_mmgr.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_mmgr.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_MMGR_H
-#define _HPDF_MMGR_H
-
-#include "hpdf_types.h"
-#include "hpdf_error.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _HPDF_MPool_Node_Rec *HPDF_MPool_Node;
-
-typedef struct _HPDF_MPool_Node_Rec {
- HPDF_BYTE* buf;
- HPDF_UINT size;
- HPDF_UINT used_size;
- HPDF_MPool_Node next_node;
-} HPDF_MPool_Node_Rec;
-
-
-typedef struct _HPDF_MMgr_Rec *HPDF_MMgr;
-
-typedef struct _HPDF_MMgr_Rec {
- HPDF_Error error;
- HPDF_Alloc_Func alloc_fn;
- HPDF_Free_Func free_fn;
- HPDF_MPool_Node mpool;
- HPDF_UINT buf_size;
-
-#ifdef HPDF_MEM_DEBUG
- HPDF_UINT alloc_cnt;
- HPDF_UINT free_cnt;
-#endif
-} HPDF_MMgr_Rec;
-
-
-/* HPDF_mpool_new
- *
- * create new HPDF_mpool object. when memory allocation goes wrong,
- * it returns NULL and error handling function will be called.
- * if buf_size is non-zero, mmgr is configured to be using memory-pool
- */
-HPDF_MMgr
-HPDF_MMgr_New (HPDF_Error error,
- HPDF_UINT buf_size,
- HPDF_Alloc_Func alloc_fn,
- HPDF_Free_Func free_fn);
-
-
-void
-HPDF_MMgr_Free (HPDF_MMgr mmgr);
-
-
-void*
-HPDF_GetMem (HPDF_MMgr mmgr,
- HPDF_UINT size);
-
-
-void
-HPDF_FreeMem (HPDF_MMgr mmgr,
- void *aptr);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_MMGR_H */
-
diff --git a/code/libharu/hpdf_namedict.h b/code/libharu/hpdf_namedict.h
deleted file mode 100644
index 5632f99..0000000
--- a/code/libharu/hpdf_namedict.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_namedict.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_NAMEDICT_H
-#define _HPDF_NAMEDICT_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-HPDF_NameDict
-HPDF_NameDict_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-HPDF_NameTree
-HPDF_NameDict_GetNameTree (HPDF_NameDict namedict,
- HPDF_NameDictKey key);
-
-HPDF_STATUS
-HPDF_NameDict_SetNameTree (HPDF_NameDict namedict,
- HPDF_NameDictKey key,
- HPDF_NameTree tree);
-
-HPDF_BOOL
-HPDF_NameDict_Validate (HPDF_NameDict namedict);
-
-
-/*------- NameTree -------*/
-
-HPDF_NameTree
-HPDF_NameTree_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-HPDF_STATUS
-HPDF_NameTree_Add (HPDF_NameTree tree,
- HPDF_String name,
- void *obj);
-
-HPDF_BOOL
-HPDF_NameTree_Validate (HPDF_NameTree tree);
-
-
-/*------- EmbeddedFile -------*/
-
-HPDF_EmbeddedFile
-HPDF_EmbeddedFile_New (HPDF_MMgr mmgr,
- HPDF_Xref xref,
- const char *file);
-
-HPDF_BOOL
-HPDF_EmbeddedFile_Validate (HPDF_EmbeddedFile emfile);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_NAMEDICT_H */
-
diff --git a/code/libharu/hpdf_objects.h b/code/libharu/hpdf_objects.h
deleted file mode 100644
index 74fc445..0000000
--- a/code/libharu/hpdf_objects.h
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_objects.c
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_OBJECTS_H
-#define _HPDF_OBJECTS_H
-
-#include "hpdf_encoder.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* if HPDF_OTYPE_DIRECT bit is set, the object owned by other container
- * object. if HPDF_OTYPE_INDIRECT bit is set, the object managed by xref.
- */
-
-#define HPDF_OTYPE_NONE 0x00000000
-#define HPDF_OTYPE_DIRECT 0x80000000
-#define HPDF_OTYPE_INDIRECT 0x40000000
-#define HPDF_OTYPE_ANY (HPDF_OTYPE_DIRECT | HPDF_OTYPE_INDIRECT)
-#define HPDF_OTYPE_HIDDEN 0x10000000
-
-#define HPDF_OCLASS_UNKNOWN 0x0001
-#define HPDF_OCLASS_NULL 0x0002
-#define HPDF_OCLASS_BOOLEAN 0x0003
-#define HPDF_OCLASS_NUMBER 0x0004
-#define HPDF_OCLASS_REAL 0x0005
-#define HPDF_OCLASS_NAME 0x0006
-#define HPDF_OCLASS_STRING 0x0007
-#define HPDF_OCLASS_BINARY 0x0008
-#define HPDF_OCLASS_ARRAY 0x0010
-#define HPDF_OCLASS_DICT 0x0011
-#define HPDF_OCLASS_PROXY 0x0012
-#define HPDF_OCLASS_ANY 0x00FF
-
-#define HPDF_OSUBCLASS_FONT 0x0100
-#define HPDF_OSUBCLASS_CATALOG 0x0200
-#define HPDF_OSUBCLASS_PAGES 0x0300
-#define HPDF_OSUBCLASS_PAGE 0x0400
-#define HPDF_OSUBCLASS_XOBJECT 0x0500
-#define HPDF_OSUBCLASS_OUTLINE 0x0600
-#define HPDF_OSUBCLASS_DESTINATION 0x0700
-#define HPDF_OSUBCLASS_ANNOTATION 0x0800
-#define HPDF_OSUBCLASS_ENCRYPT 0x0900
-#define HPDF_OSUBCLASS_EXT_GSTATE 0x0A00
-#define HPDF_OSUBCLASS_EXT_GSTATE_R 0x0B00 /* read only object */
-#define HPDF_OSUBCLASS_NAMEDICT 0x0C00
-#define HPDF_OSUBCLASS_NAMETREE 0x0D00
-
-
-
-/*----------------------------------------------------------------------------*/
-/*------ Values related xref -------------------------------------------------*/
-
-#define HPDF_FREE_ENTRY 'f'
-#define HPDF_IN_USE_ENTRY 'n'
-
-
-/*
- * structure of Object-ID
- *
- * 1 direct-object
- * 2 indirect-object
- * 3 reserved
- * 4 shadow-object
- * 5-8 reserved
- * 9-32 object-idi0-8388607j
- *
- * the real Object-ID is described "obj_id & 0x00FFFFFF"
- */
-
-typedef struct _HPDF_Obj_Header {
- HPDF_UINT32 obj_id;
- HPDF_UINT16 gen_no;
- HPDF_UINT16 obj_class;
-} HPDF_Obj_Header;
-
-
-
-HPDF_STATUS
-HPDF_Obj_WriteValue (void *obj,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-HPDF_STATUS
-HPDF_Obj_Write (void *obj,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-void
-HPDF_Obj_Free (HPDF_MMgr mmgr,
- void *obj);
-
-
-void
-HPDF_Obj_ForceFree (HPDF_MMgr mmgr,
- void *obj);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Null -----------------------------------------------------------*/
-
-typedef struct _HPDF_Null_Rec *HPDF_Null;
-
-typedef struct _HPDF_Null_Rec {
- HPDF_Obj_Header header;
-} HPDF_Null_Rec;
-
-
-
-HPDF_Null
-HPDF_Null_New (HPDF_MMgr mmgr);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Boolean --------------------------------------------------------*/
-
-typedef struct _HPDF_Boolean_Rec *HPDF_Boolean;
-
-typedef struct _HPDF_Boolean_Rec {
- HPDF_Obj_Header header;
- HPDF_BOOL value;
-} HPDF_Boolean_Rec;
-
-
-
-HPDF_Boolean
-HPDF_Boolean_New (HPDF_MMgr mmgr,
- HPDF_BOOL value);
-
-
-HPDF_STATUS
-HPDF_Boolean_Write (HPDF_Boolean obj,
- HPDF_Stream stream);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Number ---------------------------------------------------------*/
-
-typedef struct _HPDF_Number_Rec *HPDF_Number;
-
-typedef struct _HPDF_Number_Rec {
- HPDF_Obj_Header header;
- HPDF_INT32 value;
-} HPDF_Number_Rec;
-
-
-
-HPDF_Number
-HPDF_Number_New (HPDF_MMgr mmgr,
- HPDF_INT32 value);
-
-
-void
-HPDF_Number_SetValue (HPDF_Number obj,
- HPDF_INT32 value);
-
-
-HPDF_STATUS
-HPDF_Number_Write (HPDF_Number obj,
- HPDF_Stream stream);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Real -----------------------------------------------------------*/
-
-typedef struct _HPDF_Real_Rec *HPDF_Real;
-
-typedef struct _HPDF_Real_Rec {
- HPDF_Obj_Header header;
- HPDF_Error error;
- HPDF_REAL value;
-} HPDF_Real_Rec;
-
-
-
-HPDF_Real
-HPDF_Real_New (HPDF_MMgr mmgr,
- HPDF_REAL value);
-
-
-HPDF_STATUS
-HPDF_Real_Write (HPDF_Real obj,
- HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_Real_SetValue (HPDF_Real obj,
- HPDF_REAL value);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Name -----------------------------------------------------------*/
-
-typedef struct _HPDF_Name_Rec *HPDF_Name;
-
-typedef struct _HPDF_Name_Rec {
- HPDF_Obj_Header header;
- HPDF_Error error;
- char value[HPDF_LIMIT_MAX_NAME_LEN + 1];
-} HPDF_Name_Rec;
-
-
-
-HPDF_Name
-HPDF_Name_New (HPDF_MMgr mmgr,
- const char *value);
-
-
-HPDF_STATUS
-HPDF_Name_SetValue (HPDF_Name obj,
- const char *value);
-
-
-HPDF_STATUS
-HPDF_Name_Write (HPDF_Name obj,
- HPDF_Stream stream);
-
-const char*
-HPDF_Name_GetValue (HPDF_Name obj);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_String ---------------------------------------------------------*/
-
-typedef struct _HPDF_String_Rec *HPDF_String;
-
-typedef struct _HPDF_String_Rec {
- HPDF_Obj_Header header;
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_Encoder encoder;
- HPDF_BYTE *value;
- HPDF_UINT len;
-} HPDF_String_Rec;
-
-
-
-HPDF_String
-HPDF_String_New (HPDF_MMgr mmgr,
- const char *value,
- HPDF_Encoder encoder);
-
-
-HPDF_STATUS
-HPDF_String_SetValue (HPDF_String obj,
- const char *value);
-
-
-void
-HPDF_String_Free (HPDF_String obj);
-
-
-HPDF_STATUS
-HPDF_String_Write (HPDF_String obj,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-HPDF_INT32
-HPDF_String_Cmp (HPDF_String s1,
- HPDF_String s2);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Binary ---------------------------------------------------------*/
-
-typedef struct _HPDF_Binary_Rec *HPDF_Binary;
-
-typedef struct _HPDF_Binary_Rec {
- HPDF_Obj_Header header;
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_BYTE *value;
- HPDF_UINT len;
-} HPDF_Binary_Rec;
-
-
-
-HPDF_Binary
-HPDF_Binary_New (HPDF_MMgr mmgr,
- HPDF_BYTE *value,
- HPDF_UINT len);
-
-
-HPDF_STATUS
-HPDF_Binary_SetValue (HPDF_Binary obj,
- HPDF_BYTE *value,
- HPDF_UINT len);
-
-
-HPDF_BYTE*
-HPDF_Binary_GetValue (HPDF_Binary obj);
-
-
-void
-HPDF_Binary_Free (HPDF_Binary obj);
-
-
-HPDF_STATUS
-HPDF_Binary_Write (HPDF_Binary obj,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-HPDF_UINT
-HPDF_Binary_GetLen (HPDF_Binary obj);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Array ----------------------------------------------------------*/
-
-typedef struct _HPDF_Array_Rec *HPDF_Array;
-
-typedef struct _HPDF_Array_Rec {
- HPDF_Obj_Header header;
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_List list;
-} HPDF_Array_Rec;
-
-
-HPDF_Array
-HPDF_Array_New (HPDF_MMgr mmgr);
-
-
-HPDF_Array
-HPDF_Box_Array_New (HPDF_MMgr mmgr,
- HPDF_Box box);
-
-
-void
-HPDF_Array_Free (HPDF_Array array);
-
-
-HPDF_STATUS
-HPDF_Array_Write (HPDF_Array array,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-HPDF_STATUS
-HPDF_Array_Add (HPDF_Array array,
- void *obj);
-
-
-HPDF_STATUS
-HPDF_Array_Insert (HPDF_Array array,
- void *target,
- void *obj);
-
-
-void*
-HPDF_Array_GetItem (HPDF_Array array,
- HPDF_UINT index,
- HPDF_UINT16 obj_class);
-
-
-HPDF_STATUS
-HPDF_Array_AddNumber (HPDF_Array array,
- HPDF_INT32 value);
-
-
-HPDF_STATUS
-HPDF_Array_AddReal (HPDF_Array array,
- HPDF_REAL value);
-
-
-HPDF_STATUS
-HPDF_Array_AddName (HPDF_Array array,
- const char *value);
-
-void
-HPDF_Array_Clear (HPDF_Array array);
-
-
-HPDF_UINT
-HPDF_Array_Items (HPDF_Array array);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Dict -----------------------------------------------------------*/
-
-typedef struct _HPDF_Xref_Rec *HPDF_Xref;
-
-typedef struct _HPDF_Dict_Rec *HPDF_Dict;
-
-typedef void
-(*HPDF_Dict_FreeFunc) (HPDF_Dict obj);
-
-typedef HPDF_STATUS
-(*HPDF_Dict_BeforeWriteFunc) (HPDF_Dict obj);
-
-typedef HPDF_STATUS
-(*HPDF_Dict_AfterWriteFunc) (HPDF_Dict obj);
-
-typedef HPDF_STATUS
-(*HPDF_Dict_OnWriteFunc) (HPDF_Dict obj,
- HPDF_Stream stream);
-
-typedef struct _HPDF_Dict_Rec {
- HPDF_Obj_Header header;
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_List list;
- HPDF_Dict_BeforeWriteFunc before_write_fn;
- HPDF_Dict_OnWriteFunc write_fn;
- HPDF_Dict_AfterWriteFunc after_write_fn;
- HPDF_Dict_FreeFunc free_fn;
- HPDF_Stream stream;
- HPDF_UINT filter;
- HPDF_Dict filterParams;
- void *attr;
-} HPDF_Dict_Rec;
-
-
-typedef struct _HPDF_DictElement_Rec *HPDF_DictElement;
-
-typedef struct _HPDF_DictElement_Rec {
- char key[HPDF_LIMIT_MAX_NAME_LEN + 1];
- void *value;
-} HPDF_DictElement_Rec;
-
-
-HPDF_Dict
-HPDF_Dict_New (HPDF_MMgr mmgr);
-
-
-HPDF_Dict
-HPDF_DictStream_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-void
-HPDF_Dict_Free (HPDF_Dict dict);
-
-
-HPDF_STATUS
-HPDF_Dict_Write (HPDF_Dict dict,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-const char*
-HPDF_Dict_GetKeyByObj (HPDF_Dict dict,
- void *obj);
-
-
-HPDF_STATUS
-HPDF_Dict_Add (HPDF_Dict dict,
- const char *key,
- void *obj);
-
-
-void*
-HPDF_Dict_GetItem (HPDF_Dict dict,
- const char *key,
- HPDF_UINT16 obj_class);
-
-
-HPDF_STATUS
-HPDF_Dict_AddName (HPDF_Dict dict,
- const char *key,
- const char *value);
-
-
-HPDF_STATUS
-HPDF_Dict_AddNumber (HPDF_Dict dict,
- const char *key,
- HPDF_INT32 value);
-
-
-HPDF_STATUS
-HPDF_Dict_AddReal (HPDF_Dict dict,
- const char *key,
- HPDF_REAL value);
-
-
-HPDF_STATUS
-HPDF_Dict_AddBoolean (HPDF_Dict dict,
- const char *key,
- HPDF_BOOL value);
-
-
-HPDF_STATUS
-HPDF_Dict_RemoveElement (HPDF_Dict dict,
- const char *key);
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_ProxyObject ----------------------------------------------------*/
-
-
-
-typedef struct _HPDF_Proxy_Rec *HPDF_Proxy;
-
-typedef struct _HPDF_Proxy_Rec {
- HPDF_Obj_Header header;
- void *obj;
-} HPDF_Proxy_Rec;
-
-
-HPDF_Proxy
-HPDF_Proxy_New (HPDF_MMgr mmgr,
- void *obj);
-
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_Xref -----------------------------------------------------------*/
-
-typedef struct _HPDF_XrefEntry_Rec *HPDF_XrefEntry;
-
-typedef struct _HPDF_XrefEntry_Rec {
- char entry_typ;
- HPDF_UINT byte_offset;
- HPDF_UINT16 gen_no;
- void* obj;
-} HPDF_XrefEntry_Rec;
-
-
-typedef struct _HPDF_Xref_Rec {
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_UINT32 start_offset;
- HPDF_List entries;
- HPDF_UINT addr;
- HPDF_Xref prev;
- HPDF_Dict trailer;
-} HPDF_Xref_Rec;
-
-
-HPDF_Xref
-HPDF_Xref_New (HPDF_MMgr mmgr,
- HPDF_UINT32 offset);
-
-
-void
-HPDF_Xref_Free (HPDF_Xref xref);
-
-
-HPDF_STATUS
-HPDF_Xref_Add (HPDF_Xref xref,
- void *obj);
-
-
-HPDF_XrefEntry
-HPDF_Xref_GetEntry (HPDF_Xref xref,
- HPDF_UINT index);
-
-
-HPDF_STATUS
-HPDF_Xref_WriteToStream (HPDF_Xref xref,
- HPDF_Stream stream,
- HPDF_Encrypt e);
-
-
-HPDF_XrefEntry
-HPDF_Xref_GetEntryByObjectId (HPDF_Xref xref,
- HPDF_UINT obj_id);
-
-
-
-typedef HPDF_Dict HPDF_EmbeddedFile;
-typedef HPDF_Dict HPDF_NameDict;
-typedef HPDF_Dict HPDF_NameTree;
-typedef HPDF_Dict HPDF_Pages;
-typedef HPDF_Dict HPDF_Page;
-typedef HPDF_Dict HPDF_Annotation;
-typedef HPDF_Dict HPDF_3DMeasure;
-typedef HPDF_Dict HPDF_ExData;
-typedef HPDF_Dict HPDF_XObject;
-typedef HPDF_Dict HPDF_Image;
-typedef HPDF_Dict HPDF_Outline;
-typedef HPDF_Dict HPDF_EncryptDict;
-typedef HPDF_Dict HPDF_Action;
-typedef HPDF_Dict HPDF_ExtGState;
-typedef HPDF_Array HPDF_Destination;
-typedef HPDF_Dict HPDF_U3D;
-typedef HPDF_Dict HPDF_OutputIntent;
-typedef HPDF_Dict HPDF_JavaScript;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_OBJECTS_H */
-
diff --git a/code/libharu/hpdf_outline.h b/code/libharu/hpdf_outline.h
deleted file mode 100644
index 840f5b0..0000000
--- a/code/libharu/hpdf_outline.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_outline.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_OUTLINE_H
-#define _HPDF_OUTLINE_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_Outline ---------------------------------------------------------*/
-
-HPDF_Outline
-HPDF_OutlineRoot_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-HPDF_Outline
-HPDF_Outline_New (HPDF_MMgr mmgr,
- HPDF_Outline parent,
- const char *title,
- HPDF_Encoder encoder,
- HPDF_Xref xref);
-
-
-HPDF_Outline
-HPDF_Outline_GetFirst (HPDF_Outline outline);
-
-
-HPDF_Outline
-HPDF_Outline_GetLast (HPDF_Outline outline);
-
-
-HPDF_Outline
-HPDF_Outline_GetPrev(HPDF_Outline outline);
-
-
-HPDF_Outline
-HPDF_Outline_GetNext (HPDF_Outline outline);
-
-
-HPDF_Outline
-HPDF_Outline_GetParent (HPDF_Outline outline);
-
-
-HPDF_BOOL
-HPDF_Outline_GetOpened (HPDF_Outline outline);
-
-
-
-HPDF_BOOL
-HPDF_Outline_Validate (HPDF_Outline obj);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_OUTLINE_H */
-
diff --git a/code/libharu/hpdf_page_label.h b/code/libharu/hpdf_page_label.h
deleted file mode 100644
index 077a354..0000000
--- a/code/libharu/hpdf_page_label.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_page_label.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_PAGE_LABEL_H
-#define _HPDF_PAGE_LABEL_H
-
-#include "hpdf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_Dict
-HPDF_PageLabel_New (HPDF_Doc pdf,
- HPDF_PageNumStyle style,
- HPDF_INT first_page,
- const char *prefix);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
-
diff --git a/code/libharu/hpdf_pages.h b/code/libharu/hpdf_pages.h
deleted file mode 100644
index dc42062..0000000
--- a/code/libharu/hpdf_pages.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_pages.c
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_PAGES_H
-#define _HPDF_PAGES_H
-
-#include "hpdf_gstate.h"
-#include "hpdf_ext_gstate.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_Pages -----------------------------------------------------------*/
-
-HPDF_Pages
-HPDF_Pages_New (HPDF_MMgr mmgr,
- HPDF_Pages parent,
- HPDF_Xref xref);
-
-
-HPDF_BOOL
-HPDF_Pages_Validate (HPDF_Pages pages);
-
-
-HPDF_STATUS
-HPDF_Pages_AddKids (HPDF_Pages parent,
- HPDF_Dict kid);
-
-
-HPDF_STATUS
-HPDF_Page_InsertBefore (HPDF_Page page,
- HPDF_Page target);
-
-
-typedef struct _HPDF_PageAttr_Rec *HPDF_PageAttr;
-
-typedef struct _HPDF_PageAttr_Rec {
- HPDF_Pages parent;
- HPDF_Dict fonts;
- HPDF_Dict xobjects;
- HPDF_Dict ext_gstates;
- HPDF_GState gstate;
- HPDF_Point str_pos;
- HPDF_Point cur_pos;
- HPDF_Point text_pos;
- HPDF_TransMatrix text_matrix;
- HPDF_UINT16 gmode;
- HPDF_Dict contents;
- HPDF_Stream stream;
- HPDF_Xref xref;
- HPDF_UINT compression_mode;
- HPDF_PDFVer *ver;
-} HPDF_PageAttr_Rec;
-
-
-/*----------------------------------------------------------------------------*/
-/*----- HPDF_Page ------------------------------------------------------------*/
-
-HPDF_BOOL
-HPDF_Page_Validate (HPDF_Page page);
-
-
-HPDF_Page
-HPDF_Page_New (HPDF_MMgr mmgr,
- HPDF_Xref xref);
-
-
-void*
-HPDF_Page_GetInheritableItem (HPDF_Page page,
- const char *key,
- HPDF_UINT16 obj_class);
-
-
-const char*
-HPDF_Page_GetXObjectName (HPDF_Page page,
- HPDF_XObject xobj);
-
-
-const char*
-HPDF_Page_GetLocalFontName (HPDF_Page page,
- HPDF_Font font);
-
-
-const char*
-HPDF_Page_GetExtGStateName (HPDF_Page page,
- HPDF_ExtGState gstate);
-
-
-HPDF_Box
-HPDF_Page_GetMediaBox (HPDF_Page page);
-
-
-HPDF_STATUS
-HPDF_Page_SetBoxValue (HPDF_Page page,
- const char *name,
- HPDF_UINT index,
- HPDF_REAL value);
-
-
-void
-HPDF_Page_SetFilter (HPDF_Page page,
- HPDF_UINT filter);
-
-
-HPDF_STATUS
-HPDF_Page_CheckState (HPDF_Page page,
- HPDF_UINT mode);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_PAGES_H */
-
diff --git a/code/libharu/hpdf_pdfa.h b/code/libharu/hpdf_pdfa.h
deleted file mode 100644
index e3e5b08..0000000
--- a/code/libharu/hpdf_pdfa.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_pdfa.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_PDFA_H
-#define _HPDF_PDFA_H
-
-#include "hpdf_doc.h"
-#include "hpdf_objects.h"
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_STATUS
-HPDF_PDFA_AppendOutputIntents(HPDF_Doc pdf, const char *iccname, HPDF_Dict iccdict);
-
-HPDF_STATUS
-HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,
- HPDF_PDFAType pdfatype);
-
-HPDF_STATUS
-HPDF_PDFA_GenerateID(HPDF_Doc);
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/libharu/hpdf_streams.h b/code/libharu/hpdf_streams.h
deleted file mode 100644
index 18336f0..0000000
--- a/code/libharu/hpdf_streams.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_streams.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- * 2005.12.20 Created.
- *
- */
-
-#ifndef _HPDF_STREAMS_H
-#define _HPDF_STREAMS_H
-
-#include "hpdf_list.h"
-#include "hpdf_encrypt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define HPDF_STREAM_SIG_BYTES 0x5354524DL
-
-typedef enum _HPDF_StreamType {
- HPDF_STREAM_UNKNOWN = 0,
- HPDF_STREAM_CALLBACK,
- HPDF_STREAM_FILE,
- HPDF_STREAM_MEMORY
-} HPDF_StreamType;
-
-#define HPDF_STREAM_FILTER_NONE 0x0000
-#define HPDF_STREAM_FILTER_ASCIIHEX 0x0100
-#define HPDF_STREAM_FILTER_ASCII85 0x0200
-#define HPDF_STREAM_FILTER_FLATE_DECODE 0x0400
-#define HPDF_STREAM_FILTER_DCT_DECODE 0x0800
-#define HPDF_STREAM_FILTER_CCITT_DECODE 0x1000
-
-typedef enum _HPDF_WhenceMode {
- HPDF_SEEK_SET = 0,
- HPDF_SEEK_CUR,
- HPDF_SEEK_END
-} HPDF_WhenceMode;
-
-typedef struct _HPDF_Stream_Rec *HPDF_Stream;
-
-typedef HPDF_STATUS
-(*HPDF_Stream_Write_Func) (HPDF_Stream stream,
- const HPDF_BYTE *ptr,
- HPDF_UINT siz);
-
-
-typedef HPDF_STATUS
-(*HPDF_Stream_Read_Func) (HPDF_Stream stream,
- HPDF_BYTE *ptr,
- HPDF_UINT *siz);
-
-
-typedef HPDF_STATUS
-(*HPDF_Stream_Seek_Func) (HPDF_Stream stream,
- HPDF_INT pos,
- HPDF_WhenceMode mode);
-
-
-typedef HPDF_INT32
-(*HPDF_Stream_Tell_Func) (HPDF_Stream stream);
-
-
-typedef void
-(*HPDF_Stream_Free_Func) (HPDF_Stream stream);
-
-
-typedef HPDF_UINT32
-(*HPDF_Stream_Size_Func) (HPDF_Stream stream);
-
-
-typedef struct _HPDF_MemStreamAttr_Rec *HPDF_MemStreamAttr;
-
-
-typedef struct _HPDF_MemStreamAttr_Rec {
- HPDF_List buf;
- HPDF_UINT buf_siz;
- HPDF_UINT w_pos;
- HPDF_BYTE *w_ptr;
- HPDF_UINT r_ptr_idx;
- HPDF_UINT r_pos;
- HPDF_BYTE *r_ptr;
-} HPDF_MemStreamAttr_Rec;
-
-
-typedef struct _HPDF_Stream_Rec {
- HPDF_UINT32 sig_bytes;
- HPDF_StreamType type;
- HPDF_MMgr mmgr;
- HPDF_Error error;
- HPDF_UINT size;
- HPDF_Stream_Write_Func write_fn;
- HPDF_Stream_Read_Func read_fn;
- HPDF_Stream_Seek_Func seek_fn;
- HPDF_Stream_Free_Func free_fn;
- HPDF_Stream_Tell_Func tell_fn;
- HPDF_Stream_Size_Func size_fn;
- void* attr;
-} HPDF_Stream_Rec;
-
-
-
-HPDF_Stream
-HPDF_MemStream_New (HPDF_MMgr mmgr,
- HPDF_UINT buf_siz);
-
-
-HPDF_BYTE*
-HPDF_MemStream_GetBufPtr (HPDF_Stream stream,
- HPDF_UINT index,
- HPDF_UINT *length);
-
-
-HPDF_UINT
-HPDF_MemStream_GetBufSize (HPDF_Stream stream);
-
-
-HPDF_UINT
-HPDF_MemStream_GetBufCount (HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_MemStream_Rewrite (HPDF_Stream stream,
- HPDF_BYTE *buf,
- HPDF_UINT size);
-
-
-void
-HPDF_MemStream_FreeData (HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteToStream (HPDF_Stream src,
- HPDF_Stream dst,
- HPDF_UINT filter,
- HPDF_Encrypt e);
-
-
-HPDF_Stream
-HPDF_FileReader_New (HPDF_MMgr mmgr,
- const char *fname);
-
-
-HPDF_Stream
-HPDF_FileWriter_New (HPDF_MMgr mmgr,
- const char *fname);
-
-
-HPDF_Stream
-HPDF_CallbackReader_New (HPDF_MMgr mmgr,
- HPDF_Stream_Read_Func read_fn,
- HPDF_Stream_Seek_Func seek_fn,
- HPDF_Stream_Tell_Func tell_fn,
- HPDF_Stream_Size_Func size_fn,
- void* data);
-
-
-HPDF_Stream
-HPDF_CallbackWriter_New (HPDF_MMgr mmgr,
- HPDF_Stream_Write_Func write_fn,
- void* data);
-
-
-void
-HPDF_Stream_Free (HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteChar (HPDF_Stream stream,
- char value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteStr (HPDF_Stream stream,
- const char *value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteUChar (HPDF_Stream stream,
- HPDF_BYTE value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteInt (HPDF_Stream stream,
- HPDF_INT value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteUInt (HPDF_Stream stream,
- HPDF_UINT value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteReal (HPDF_Stream stream,
- HPDF_REAL value);
-
-
-HPDF_STATUS
-HPDF_Stream_Write (HPDF_Stream stream,
- const HPDF_BYTE *ptr,
- HPDF_UINT size);
-
-
-HPDF_STATUS
-HPDF_Stream_Read (HPDF_Stream stream,
- HPDF_BYTE *ptr,
- HPDF_UINT *size);
-
-HPDF_STATUS
-HPDF_Stream_ReadLn (HPDF_Stream stream,
- char *s,
- HPDF_UINT *size);
-
-
-HPDF_INT32
-HPDF_Stream_Tell (HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_Stream_Seek (HPDF_Stream stream,
- HPDF_INT pos,
- HPDF_WhenceMode mode);
-
-
-HPDF_BOOL
-HPDF_Stream_EOF (HPDF_Stream stream);
-
-
-HPDF_UINT32
-HPDF_Stream_Size (HPDF_Stream stream);
-
-HPDF_STATUS
-HPDF_Stream_Flush (HPDF_Stream stream);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteEscapeName (HPDF_Stream stream,
- const char *value);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteEscapeText2 (HPDF_Stream stream,
- const char *text,
- HPDF_UINT len);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteEscapeText (HPDF_Stream stream,
- const char *text);
-
-
-HPDF_STATUS
-HPDF_Stream_WriteBinary (HPDF_Stream stream,
- const HPDF_BYTE *data,
- HPDF_UINT len,
- HPDF_Encrypt e);
-
-
-HPDF_STATUS
-HPDF_Stream_Validate (HPDF_Stream stream);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_STREAMS_H */
diff --git a/code/libharu/hpdf_types.h b/code/libharu/hpdf_types.h
deleted file mode 100644
index b9c4589..0000000
--- a/code/libharu/hpdf_types.h
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_types.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_TYPES_H
-#define _HPDF_TYPES_H
-
-#ifndef HPDF_STDCALL
-#ifdef HPDF_DLL_MAKE
-#define HPDF_STDCALL __stdcall
-#else
-#ifdef HPDF_DLL
-#define HPDF_STDCALL __stdcall
-#else
-#define HPDF_STDCALL
-#endif
-#endif
-#endif
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*----------------------------------------------------------------------------*/
-/*----- type definition ------------------------------------------------------*/
-
-
-/* native OS integer types */
-typedef signed int HPDF_INT;
-typedef unsigned int HPDF_UINT;
-
-
-/* 32bit integer types
- */
-typedef signed int HPDF_INT32;
-typedef unsigned int HPDF_UINT32;
-
-
-/* 16bit integer types
- */
-typedef signed short HPDF_INT16;
-typedef unsigned short HPDF_UINT16;
-
-
-/* 8bit integer types
- */
-typedef signed char HPDF_INT8;
-typedef unsigned char HPDF_UINT8;
-
-
-/* 8bit binary types
- */
-typedef unsigned char HPDF_BYTE;
-
-
-/* float type (32bit IEEE754)
- */
-typedef float HPDF_REAL;
-
-
-/* double type (64bit IEEE754)
- */
-typedef double HPDF_DOUBLE;
-
-
-/* boolean type (0: False, !0: True)
- */
-typedef signed int HPDF_BOOL;
-
-
-/* error-no type (32bit unsigned integer)
- */
-typedef unsigned long HPDF_STATUS;
-
-
-/* charactor-code type (16bit)
- */
-typedef HPDF_UINT16 HPDF_CID;
-typedef HPDF_UINT16 HPDF_UNICODE;
-
-
-/* HPDF_Point struct
- */
-typedef struct _HPDF_Point {
- HPDF_REAL x;
- HPDF_REAL y;
-} HPDF_Point;
-
-typedef struct _HPDF_Rect {
- HPDF_REAL left;
- HPDF_REAL bottom;
- HPDF_REAL right;
- HPDF_REAL top;
-} HPDF_Rect;
-
-/* HPDF_Point3D struct
-*/
-typedef struct _HPDF_Point3D {
- HPDF_REAL x;
- HPDF_REAL y;
- HPDF_REAL z;
-} HPDF_Point3D;
-
-typedef struct _HPDF_Rect HPDF_Box;
-
-/* HPDF_Date struct
- */
-typedef struct _HPDF_Date {
- HPDF_INT year;
- HPDF_INT month;
- HPDF_INT day;
- HPDF_INT hour;
- HPDF_INT minutes;
- HPDF_INT seconds;
- char ind;
- HPDF_INT off_hour;
- HPDF_INT off_minutes;
-} HPDF_Date;
-
-
-typedef enum _HPDF_InfoType {
- /* date-time type parameters */
- HPDF_INFO_CREATION_DATE = 0,
- HPDF_INFO_MOD_DATE,
-
- /* string type parameters */
- HPDF_INFO_AUTHOR,
- HPDF_INFO_CREATOR,
- HPDF_INFO_PRODUCER,
- HPDF_INFO_TITLE,
- HPDF_INFO_SUBJECT,
- HPDF_INFO_KEYWORDS,
- HPDF_INFO_TRAPPED,
- HPDF_INFO_GTS_PDFX,
- HPDF_INFO_EOF
-} HPDF_InfoType;
-
-/* PDF-A Types */
-
-typedef enum _HPDF_PDFA_TYPE
-{
- HPDF_PDFA_1A = 0,
- HPDF_PDFA_1B = 1
-} HPDF_PDFAType;
-
-
-typedef enum _HPDF_PdfVer {
- HPDF_VER_12 = 0,
- HPDF_VER_13,
- HPDF_VER_14,
- HPDF_VER_15,
- HPDF_VER_16,
- HPDF_VER_17,
- HPDF_VER_EOF
-} HPDF_PDFVer;
-
-typedef enum _HPDF_EncryptMode {
- HPDF_ENCRYPT_R2 = 2,
- HPDF_ENCRYPT_R3 = 3
-} HPDF_EncryptMode;
-
-
-typedef void
-(HPDF_STDCALL *HPDF_Error_Handler) (HPDF_STATUS error_no,
- HPDF_STATUS detail_no,
- void *user_data);
-
-typedef void*
-(HPDF_STDCALL *HPDF_Alloc_Func) (HPDF_UINT size);
-
-
-typedef void
-(HPDF_STDCALL *HPDF_Free_Func) (void *aptr);
-
-
-/*---------------------------------------------------------------------------*/
-/*------ text width struct --------------------------------------------------*/
-
-typedef struct _HPDF_TextWidth {
- HPDF_UINT numchars;
-
- /* don't use this value (it may be change in the feature).
- use numspace as alternated. */
- HPDF_UINT numwords;
-
- HPDF_UINT width;
- HPDF_UINT numspace;
-} HPDF_TextWidth;
-
-
-/*---------------------------------------------------------------------------*/
-/*------ dash mode ----------------------------------------------------------*/
-
-typedef struct _HPDF_DashMode {
- HPDF_UINT16 ptn[8];
- HPDF_UINT num_ptn;
- HPDF_UINT phase;
-} HPDF_DashMode;
-
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_TransMatrix struct ---------------------------------------------*/
-
-typedef struct _HPDF_TransMatrix {
- HPDF_REAL a;
- HPDF_REAL b;
- HPDF_REAL c;
- HPDF_REAL d;
- HPDF_REAL x;
- HPDF_REAL y;
-} HPDF_TransMatrix;
-
-
-/*---------------------------------------------------------------------------*/
-
-typedef enum _HPDF_ColorSpace {
- HPDF_CS_DEVICE_GRAY = 0,
- HPDF_CS_DEVICE_RGB,
- HPDF_CS_DEVICE_CMYK,
- HPDF_CS_CAL_GRAY,
- HPDF_CS_CAL_RGB,
- HPDF_CS_LAB,
- HPDF_CS_ICC_BASED,
- HPDF_CS_SEPARATION,
- HPDF_CS_DEVICE_N,
- HPDF_CS_INDEXED,
- HPDF_CS_PATTERN,
- HPDF_CS_EOF
-} HPDF_ColorSpace;
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_RGBColor struct ------------------------------------------------*/
-
-typedef struct _HPDF_RGBColor {
- HPDF_REAL r;
- HPDF_REAL g;
- HPDF_REAL b;
-} HPDF_RGBColor;
-
-/*---------------------------------------------------------------------------*/
-/*----- HPDF_CMYKColor struct -----------------------------------------------*/
-
-typedef struct _HPDF_CMYKColor {
- HPDF_REAL c;
- HPDF_REAL m;
- HPDF_REAL y;
- HPDF_REAL k;
-} HPDF_CMYKColor;
-
-/*---------------------------------------------------------------------------*/
-/*------ The line cap style -------------------------------------------------*/
-
-typedef enum _HPDF_LineCap {
- HPDF_BUTT_END = 0,
- HPDF_ROUND_END,
- HPDF_PROJECTING_SCUARE_END,
- HPDF_LINECAP_EOF
-} HPDF_LineCap;
-
-/*----------------------------------------------------------------------------*/
-/*------ The line join style -------------------------------------------------*/
-
-typedef enum _HPDF_LineJoin {
- HPDF_MITER_JOIN = 0,
- HPDF_ROUND_JOIN,
- HPDF_BEVEL_JOIN,
- HPDF_LINEJOIN_EOF
-} HPDF_LineJoin;
-
-/*----------------------------------------------------------------------------*/
-/*------ The text rendering mode ---------------------------------------------*/
-
-typedef enum _HPDF_TextRenderingMode {
- HPDF_FILL = 0,
- HPDF_STROKE,
- HPDF_FILL_THEN_STROKE,
- HPDF_INVISIBLE,
- HPDF_FILL_CLIPPING,
- HPDF_STROKE_CLIPPING,
- HPDF_FILL_STROKE_CLIPPING,
- HPDF_CLIPPING,
- HPDF_RENDERING_MODE_EOF
-} HPDF_TextRenderingMode;
-
-
-typedef enum _HPDF_WritingMode {
- HPDF_WMODE_HORIZONTAL = 0,
- HPDF_WMODE_VERTICAL,
- HPDF_WMODE_EOF
-} HPDF_WritingMode;
-
-
-typedef enum _HPDF_PageLayout {
- HPDF_PAGE_LAYOUT_SINGLE = 0,
- HPDF_PAGE_LAYOUT_ONE_COLUMN,
- HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT,
- HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT,
- HPDF_PAGE_LAYOUT_TWO_PAGE_LEFT,
- HPDF_PAGE_LAYOUT_TWO_PAGE_RIGHT,
- HPDF_PAGE_LAYOUT_EOF
-} HPDF_PageLayout;
-
-
-typedef enum _HPDF_PageMode {
- HPDF_PAGE_MODE_USE_NONE = 0,
- HPDF_PAGE_MODE_USE_OUTLINE,
- HPDF_PAGE_MODE_USE_THUMBS,
- HPDF_PAGE_MODE_FULL_SCREEN,
-/* HPDF_PAGE_MODE_USE_OC,
- HPDF_PAGE_MODE_USE_ATTACHMENTS,
- */
- HPDF_PAGE_MODE_EOF
-} HPDF_PageMode;
-
-
-typedef enum _HPDF_PageNumStyle {
- HPDF_PAGE_NUM_STYLE_DECIMAL = 0,
- HPDF_PAGE_NUM_STYLE_UPPER_ROMAN,
- HPDF_PAGE_NUM_STYLE_LOWER_ROMAN,
- HPDF_PAGE_NUM_STYLE_UPPER_LETTERS,
- HPDF_PAGE_NUM_STYLE_LOWER_LETTERS,
- HPDF_PAGE_NUM_STYLE_EOF
-} HPDF_PageNumStyle;
-
-
-typedef enum _HPDF_DestinationType {
- HPDF_XYZ = 0,
- HPDF_FIT,
- HPDF_FIT_H,
- HPDF_FIT_V,
- HPDF_FIT_R,
- HPDF_FIT_B,
- HPDF_FIT_BH,
- HPDF_FIT_BV,
- HPDF_DST_EOF
-} HPDF_DestinationType;
-
-
-typedef enum _HPDF_AnnotType {
- HPDF_ANNOT_TEXT_NOTES,
- HPDF_ANNOT_LINK,
- HPDF_ANNOT_SOUND,
- HPDF_ANNOT_FREE_TEXT,
- HPDF_ANNOT_STAMP,
- HPDF_ANNOT_SQUARE,
- HPDF_ANNOT_CIRCLE,
- HPDF_ANNOT_STRIKE_OUT,
- HPDF_ANNOT_HIGHTLIGHT,
- HPDF_ANNOT_UNDERLINE,
- HPDF_ANNOT_INK,
- HPDF_ANNOT_FILE_ATTACHMENT,
- HPDF_ANNOT_POPUP,
- HPDF_ANNOT_3D,
- HPDF_ANNOT_SQUIGGLY,
- HPDF_ANNOT_LINE,
- HPDF_ANNOT_PROJECTION
-} HPDF_AnnotType;
-
-
-typedef enum _HPDF_AnnotFlgs {
- HPDF_ANNOT_INVISIBLE,
- HPDF_ANNOT_HIDDEN,
- HPDF_ANNOT_PRINT,
- HPDF_ANNOT_NOZOOM,
- HPDF_ANNOT_NOROTATE,
- HPDF_ANNOT_NOVIEW,
- HPDF_ANNOT_READONLY
-} HPDF_AnnotFlgs;
-
-
-typedef enum _HPDF_AnnotHighlightMode {
- HPDF_ANNOT_NO_HIGHTLIGHT = 0,
- HPDF_ANNOT_INVERT_BOX,
- HPDF_ANNOT_INVERT_BORDER,
- HPDF_ANNOT_DOWN_APPEARANCE,
- HPDF_ANNOT_HIGHTLIGHT_MODE_EOF
-} HPDF_AnnotHighlightMode;
-
-
-typedef enum _HPDF_AnnotIcon {
- HPDF_ANNOT_ICON_COMMENT = 0,
- HPDF_ANNOT_ICON_KEY,
- HPDF_ANNOT_ICON_NOTE,
- HPDF_ANNOT_ICON_HELP,
- HPDF_ANNOT_ICON_NEW_PARAGRAPH,
- HPDF_ANNOT_ICON_PARAGRAPH,
- HPDF_ANNOT_ICON_INSERT,
- HPDF_ANNOT_ICON_EOF
-} HPDF_AnnotIcon;
-
-typedef enum _HPDF_AnnotIntent {
- HPDF_ANNOT_INTENT_FREETEXTCALLOUT = 0,
- HPDF_ANNOT_INTENT_FREETEXTTYPEWRITER,
- HPDF_ANNOT_INTENT_LINEARROW,
- HPDF_ANNOT_INTENT_LINEDIMENSION,
- HPDF_ANNOT_INTENT_POLYGONCLOUD,
- HPDF_ANNOT_INTENT_POLYLINEDIMENSION,
- HPDF_ANNOT_INTENT_POLYGONDIMENSION
-} HPDF_AnnotIntent;
-
-typedef enum _HPDF_LineAnnotEndingStyle {
- HPDF_LINE_ANNOT_NONE = 0,
- HPDF_LINE_ANNOT_SQUARE,
- HPDF_LINE_ANNOT_CIRCLE,
- HPDF_LINE_ANNOT_DIAMOND,
- HPDF_LINE_ANNOT_OPENARROW,
- HPDF_LINE_ANNOT_CLOSEDARROW,
- HPDF_LINE_ANNOT_BUTT,
- HPDF_LINE_ANNOT_ROPENARROW,
- HPDF_LINE_ANNOT_RCLOSEDARROW,
- HPDF_LINE_ANNOT_SLASH
-} HPDF_LineAnnotEndingStyle;
-
-typedef enum _HPDF_LineAnnotCapPosition{
- HPDF_LINE_ANNOT_CAP_INLINE = 0,
- HPDF_LINE_ANNOT_CAP_TOP
-} HPDF_LineAnnotCapPosition;
-
-typedef enum _HPDF_StampAnnotName{
- HPDF_STAMP_ANNOT_APPROVED = 0,
- HPDF_STAMP_ANNOT_EXPERIMENTAL,
- HPDF_STAMP_ANNOT_NOTAPPROVED,
- HPDF_STAMP_ANNOT_ASIS,
- HPDF_STAMP_ANNOT_EXPIRED,
- HPDF_STAMP_ANNOT_NOTFORPUBLICRELEASE,
- HPDF_STAMP_ANNOT_CONFIDENTIAL,
- HPDF_STAMP_ANNOT_FINAL,
- HPDF_STAMP_ANNOT_SOLD,
- HPDF_STAMP_ANNOT_DEPARTMENTAL,
- HPDF_STAMP_ANNOT_FORCOMMENT,
- HPDF_STAMP_ANNOT_TOPSECRET,
- HPDF_STAMP_ANNOT_DRAFT,
- HPDF_STAMP_ANNOT_FORPUBLICRELEASE
-} HPDF_StampAnnotName;
-
-/*----------------------------------------------------------------------------*/
-/*------ border stype --------------------------------------------------------*/
-
-typedef enum _HPDF_BSSubtype {
- HPDF_BS_SOLID,
- HPDF_BS_DASHED,
- HPDF_BS_BEVELED,
- HPDF_BS_INSET,
- HPDF_BS_UNDERLINED
-} HPDF_BSSubtype;
-
-
-/*----- blend modes ----------------------------------------------------------*/
-
-typedef enum _HPDF_BlendMode {
- HPDF_BM_NORMAL,
- HPDF_BM_MULTIPLY,
- HPDF_BM_SCREEN,
- HPDF_BM_OVERLAY,
- HPDF_BM_DARKEN,
- HPDF_BM_LIGHTEN,
- HPDF_BM_COLOR_DODGE,
- HPDF_BM_COLOR_BUM,
- HPDF_BM_HARD_LIGHT,
- HPDF_BM_SOFT_LIGHT,
- HPDF_BM_DIFFERENCE,
- HPDF_BM_EXCLUSHON,
- HPDF_BM_EOF
-} HPDF_BlendMode;
-
-/*----- slide show -----------------------------------------------------------*/
-
-typedef enum _HPDF_TransitionStyle {
- HPDF_TS_WIPE_RIGHT = 0,
- HPDF_TS_WIPE_UP,
- HPDF_TS_WIPE_LEFT,
- HPDF_TS_WIPE_DOWN,
- HPDF_TS_BARN_DOORS_HORIZONTAL_OUT,
- HPDF_TS_BARN_DOORS_HORIZONTAL_IN,
- HPDF_TS_BARN_DOORS_VERTICAL_OUT,
- HPDF_TS_BARN_DOORS_VERTICAL_IN,
- HPDF_TS_BOX_OUT,
- HPDF_TS_BOX_IN,
- HPDF_TS_BLINDS_HORIZONTAL,
- HPDF_TS_BLINDS_VERTICAL,
- HPDF_TS_DISSOLVE,
- HPDF_TS_GLITTER_RIGHT,
- HPDF_TS_GLITTER_DOWN,
- HPDF_TS_GLITTER_TOP_LEFT_TO_BOTTOM_RIGHT,
- HPDF_TS_REPLACE,
- HPDF_TS_EOF
-} HPDF_TransitionStyle;
-
-/*----------------------------------------------------------------------------*/
-
-typedef enum _HPDF_PageSizes {
- HPDF_PAGE_SIZE_LETTER = 0,
- HPDF_PAGE_SIZE_LEGAL,
- HPDF_PAGE_SIZE_A3,
- HPDF_PAGE_SIZE_A4,
- HPDF_PAGE_SIZE_A5,
- HPDF_PAGE_SIZE_B4,
- HPDF_PAGE_SIZE_B5,
- HPDF_PAGE_SIZE_EXECUTIVE,
- HPDF_PAGE_SIZE_US4x6,
- HPDF_PAGE_SIZE_US4x8,
- HPDF_PAGE_SIZE_US5x7,
- HPDF_PAGE_SIZE_COMM10,
- HPDF_PAGE_SIZE_EOF
-} HPDF_PageSizes;
-
-
-typedef enum _HPDF_PageDirection {
- HPDF_PAGE_PORTRAIT = 0,
- HPDF_PAGE_LANDSCAPE
-} HPDF_PageDirection;
-
-
-typedef enum _HPDF_EncoderType {
- HPDF_ENCODER_TYPE_SINGLE_BYTE,
- HPDF_ENCODER_TYPE_DOUBLE_BYTE,
- HPDF_ENCODER_TYPE_UNINITIALIZED,
- HPDF_ENCODER_UNKNOWN
-} HPDF_EncoderType;
-
-
-typedef enum _HPDF_ByteType {
- HPDF_BYTE_TYPE_SINGLE = 0,
- HPDF_BYTE_TYPE_LEAD,
- HPDF_BYTE_TYPE_TRIAL,
- HPDF_BYTE_TYPE_UNKNOWN
-} HPDF_ByteType;
-
-
-typedef enum _HPDF_TextAlignment {
- HPDF_TALIGN_LEFT = 0,
- HPDF_TALIGN_RIGHT,
- HPDF_TALIGN_CENTER,
- HPDF_TALIGN_JUSTIFY
-} HPDF_TextAlignment;
-
-/*----------------------------------------------------------------------------*/
-
-/* Name Dictionary values -- see PDF reference section 7.7.4 */
-typedef enum _HPDF_NameDictKey {
- HPDF_NAME_EMBEDDED_FILES = 0, /* TODO the rest */
- HPDF_NAME_EOF
-} HPDF_NameDictKey;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_TYPES_H */
-
diff --git a/code/libharu/hpdf_u3d.h b/code/libharu/hpdf_u3d.h
deleted file mode 100644
index 9a3dba8..0000000
--- a/code/libharu/hpdf_u3d.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- hpdf_u3d.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_U3D_H
-#define _HPDF_U3D_H
-
-#include "hpdf_objects.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *code);
-
-
-HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename);
-HPDF_EXPORT(HPDF_Image) HPDF_LoadU3DFromMem (HPDF_Doc pdf, const HPDF_BYTE *buffer, HPDF_UINT size);
-HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name);
-HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view);
-HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name);
-HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_AddOnInstanciate(HPDF_U3D u3d, HPDF_JavaScript javaScript);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, const char *name, HPDF_REAL opacity, HPDF_BOOL visible);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *scheme);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetPerspectiveProjection(HPDF_Dict view, HPDF_REAL fov);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetOrthogonalProjection(HPDF_Dict view, HPDF_REAL mag);
-HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, HPDF_REAL cooy, HPDF_REAL cooz, HPDF_REAL c2cx, HPDF_REAL c2cy, HPDF_REAL c2cz, HPDF_REAL roo, HPDF_REAL roll);
-
-HPDF_Dict
-HPDF_3DView_New ( HPDF_MMgr mmgr,
- HPDF_Xref xref,
- HPDF_U3D u3d,
- const char *name);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _HPDF_U3D_H */
-
diff --git a/code/libharu/hpdf_utils.h b/code/libharu/hpdf_utils.h
deleted file mode 100644
index 690ed6c..0000000
--- a/code/libharu/hpdf_utils.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * << Haru Free PDF Library >> -- fpdf_utils.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno
- * Copyright (c) 2007-2009 Antony Dovgal
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef _HPDF_UTILS_H
-#define _HPDF_UTILS_H
-
-#include "hpdf_config.h"
-#include "hpdf_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-HPDF_INT
-HPDF_AToI (const char* s);
-
-
-HPDF_DOUBLE
-HPDF_AToF (const char* s);
-
-
-char*
-HPDF_IToA (char* s,
- HPDF_INT32 val,
- char* eptr);
-
-
-char*
-HPDF_IToA2 (char *s,
- HPDF_UINT32 val,
- HPDF_UINT len);
-
-
-char*
-HPDF_FToA (char *s,
- HPDF_REAL val,
- char *eptr);
-
-
-HPDF_BYTE*
-HPDF_MemCpy (HPDF_BYTE* out,
- const HPDF_BYTE* in,
- HPDF_UINT n);
-
-
-HPDF_BYTE*
-HPDF_StrCpy (char* out,
- const char* in,
- char* eptr);
-
-
-HPDF_INT
-HPDF_MemCmp (const HPDF_BYTE* s1,
- const HPDF_BYTE* s2,
- HPDF_UINT n);
-
-
-HPDF_INT
-HPDF_StrCmp (const char* s1,
- const char* s2);
-
-
-const char*
-HPDF_StrStr (const char *s1,
- const char *s2,
- HPDF_UINT maxlen);
-
-
-void*
-HPDF_MemSet (void* s,
- HPDF_BYTE c,
- HPDF_UINT n);
-
-
-HPDF_UINT
-HPDF_StrLen (const char* s,
- HPDF_INT maxlen);
-
-
-HPDF_Box
-HPDF_ToBox (HPDF_INT16 left,
- HPDF_INT16 bottom,
- HPDF_INT16 right,
- HPDF_INT16 top);
-
-
-HPDF_Point
-HPDF_ToPoint (HPDF_INT16 x,
- HPDF_INT16 y);
-
-
-HPDF_Rect
-HPDF_ToRect (HPDF_REAL left,
- HPDF_REAL bottom,
- HPDF_REAL right,
- HPDF_REAL top);
-
-
-void
-HPDF_UInt16Swap (HPDF_UINT16 *value);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#define HPDF_NEEDS_ESCAPE(c) (c < 0x20 || \
- c > 0x7e || \
- c == '\\' || \
- c == '%' || \
- c == '#' || \
- c == '/' || \
- c == '(' || \
- c == ')' || \
- c == '<' || \
- c == '>' || \
- c == '[' || \
- c == ']' || \
- c == '{' || \
- c == '}' ) \
-
-#define HPDF_IS_WHITE_SPACE(c) (c == 0x00 || \
- c == 0x09 || \
- c == 0x0A || \
- c == 0x0C || \
- c == 0x0D || \
- c == 0x20 ) \
-
-/*----------------------------------------------------------------------------*/
-/*----- macros for debug -----------------------------------------------------*/
-
-#ifdef LIBHPDF_DEBUG_TRACE
-#ifndef HPDF_PTRACE_ON
-#define HPDF_PTRACE_ON
-#endif /* HPDF_PTRACE_ON */
-#endif /* LIBHPDF_DEBUG_TRACE */
-
-#ifdef HPDF_PTRACE_ON
-#define HPDF_PTRACE(ARGS) HPDF_PRINTF ARGS
-#else
-#define HPDF_PTRACE(ARGS) /* do nothing */
-#endif /* HPDF_PTRACE */
-
-#ifdef LIBHPDF_DEBUG
-#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) HPDF_PrintBinary(BUF, LEN, CAPTION)
-#else
-#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) /* do nothing */
-#endif
-
-#endif /* _HPDF_UTILS_H */
-
diff --git a/code/libharu/hpdf_version.h b/code/libharu/hpdf_version.h
deleted file mode 100644
index b7906e7..0000000
--- a/code/libharu/hpdf_version.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* automatically generated by configure */
-/* edit configure.in to change version number */
-#define HPDF_MAJOR_VERSION 2
-#define HPDF_MINOR_VERSION 3
-#define HPDF_BUGFIX_VERSION 0
-#define HPDF_EXTRA_VERSION "RC2"
-#define HPDF_VERSION_TEXT "2.3.0RC2"
-#define HPDF_VERSION_ID 20300
diff --git a/code/minizip/crc32.h b/code/minizip/crc32.h
deleted file mode 100644
index 5de49bc..0000000
--- a/code/minizip/crc32.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/* crc32.h -- tables for rapid CRC calculation
- * Generated automatically by crc32.c
- */
-
-local const unsigned long FAR crc_table[TBLS][256] =
-{
- {
- 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
- 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
- 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
- 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
- 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
- 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
- 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
- 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
- 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
- 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
- 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
- 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
- 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
- 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
- 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
- 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
- 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
- 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
- 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
- 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
- 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
- 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
- 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
- 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
- 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
- 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
- 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
- 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
- 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
- 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
- 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
- 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
- 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
- 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
- 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
- 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
- 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
- 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
- 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
- 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
- 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
- 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
- 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
- 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
- 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
- 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
- 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
- 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
- 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
- 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
- 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
- 0x2d02ef8dUL
-#ifdef BYFOUR
- },
- {
- 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
- 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
- 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
- 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
- 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
- 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
- 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
- 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
- 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
- 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
- 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
- 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
- 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
- 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
- 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
- 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
- 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
- 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
- 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
- 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
- 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
- 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
- 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
- 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
- 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
- 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
- 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
- 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
- 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
- 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
- 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
- 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
- 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
- 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
- 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
- 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
- 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
- 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
- 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
- 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
- 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
- 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
- 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
- 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
- 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
- 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
- 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
- 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
- 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
- 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
- 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
- 0x9324fd72UL
- },
- {
- 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
- 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
- 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
- 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
- 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
- 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
- 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
- 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
- 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
- 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
- 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
- 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
- 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
- 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
- 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
- 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
- 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
- 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
- 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
- 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
- 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
- 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
- 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
- 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
- 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
- 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
- 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
- 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
- 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
- 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
- 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
- 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
- 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
- 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
- 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
- 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
- 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
- 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
- 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
- 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
- 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
- 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
- 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
- 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
- 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
- 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
- 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
- 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
- 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
- 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
- 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
- 0xbe9834edUL
- },
- {
- 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
- 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
- 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
- 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
- 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
- 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
- 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
- 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
- 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
- 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
- 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
- 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
- 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
- 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
- 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
- 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
- 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
- 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
- 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
- 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
- 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
- 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
- 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
- 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
- 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
- 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
- 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
- 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
- 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
- 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
- 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
- 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
- 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
- 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
- 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
- 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
- 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
- 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
- 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
- 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
- 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
- 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
- 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
- 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
- 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
- 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
- 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
- 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
- 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
- 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
- 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
- 0xde0506f1UL
- },
- {
- 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
- 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
- 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
- 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
- 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
- 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
- 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
- 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
- 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
- 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
- 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
- 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
- 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
- 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
- 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
- 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
- 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
- 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
- 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
- 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
- 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
- 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
- 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
- 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
- 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
- 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
- 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
- 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
- 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
- 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
- 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
- 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
- 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
- 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
- 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
- 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
- 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
- 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
- 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
- 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
- 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
- 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
- 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
- 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
- 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
- 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
- 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
- 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
- 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
- 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
- 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
- 0x8def022dUL
- },
- {
- 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
- 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
- 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
- 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
- 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
- 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
- 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
- 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
- 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
- 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
- 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
- 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
- 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
- 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
- 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
- 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
- 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
- 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
- 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
- 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
- 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
- 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
- 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
- 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
- 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
- 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
- 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
- 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
- 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
- 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
- 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
- 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
- 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
- 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
- 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
- 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
- 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
- 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
- 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
- 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
- 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
- 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
- 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
- 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
- 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
- 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
- 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
- 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
- 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
- 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
- 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
- 0x72fd2493UL
- },
- {
- 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
- 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
- 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
- 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
- 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
- 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
- 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
- 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
- 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
- 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
- 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
- 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
- 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
- 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
- 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
- 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
- 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
- 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
- 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
- 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
- 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
- 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
- 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
- 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
- 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
- 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
- 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
- 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
- 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
- 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
- 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
- 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
- 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
- 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
- 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
- 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
- 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
- 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
- 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
- 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
- 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
- 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
- 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
- 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
- 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
- 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
- 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
- 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
- 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
- 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
- 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
- 0xed3498beUL
- },
- {
- 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
- 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
- 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
- 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
- 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
- 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
- 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
- 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
- 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
- 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
- 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
- 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
- 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
- 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
- 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
- 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
- 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
- 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
- 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
- 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
- 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
- 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
- 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
- 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
- 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
- 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
- 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
- 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
- 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
- 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
- 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
- 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
- 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
- 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
- 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
- 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
- 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
- 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
- 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
- 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
- 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
- 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
- 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
- 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
- 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
- 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
- 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
- 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
- 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
- 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
- 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
- 0xf10605deUL
-#endif
- }
-};
diff --git a/code/minizip/crypt.h b/code/minizip/crypt.h
deleted file mode 100644
index 8d818ac..0000000
--- a/code/minizip/crypt.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* crypt.h -- base code for crypt/uncrypt ZIPfile
-
-
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-
- This code is a modified version of crypting code in Infozip distribution
-
- The encryption/decryption parts of this source code (as opposed to the
- non-echoing password parts) were originally written in Europe. The
- whole source package can be freely distributed, including from the USA.
- (Prior to January 2000, re-export from the US was a violation of US law.)
-
- This encryption code is a direct transcription of the algorithm from
- Roger Schlafly, described by Phil Katz in the file appnote.txt. This
- file (appnote.txt) is distributed with the PKZIP program (even in the
- version without encryption capabilities).
-
- If you don't need crypting in your application, just define symbols
- NOCRYPT and NOUNCRYPT.
-
- This code support the "Traditional PKWARE Encryption".
-
- The new AES encryption added on Zip format by Winzip (see the page
- http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
- Encryption is not supported.
-*/
-
-#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
-
-/***********************************************************************
- * Return the next byte in the pseudo-random sequence
- */
-static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
-{
- unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
- * unpredictable manner on 16-bit systems; not a problem
- * with any known compiler so far, though */
-
- temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
- return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
-}
-
-/***********************************************************************
- * Update the encryption keys with the next byte of plain text
- */
-static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
-{
- (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
- (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
- (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
- {
- register int keyshift = (int)((*(pkeys+1)) >> 24);
- (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
- }
- return c;
-}
-
-
-/***********************************************************************
- * Initialize the encryption keys and the random header according to
- * the given password.
- */
-static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
-{
- *(pkeys+0) = 305419896L;
- *(pkeys+1) = 591751049L;
- *(pkeys+2) = 878082192L;
- while (*passwd != '\0') {
- update_keys(pkeys,pcrc_32_tab,(int)*passwd);
- passwd++;
- }
-}
-
-#define zdecode(pkeys,pcrc_32_tab,c) \
- (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
-
-#define zencode(pkeys,pcrc_32_tab,c,t) \
- (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
-
-#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
-
-#define RAND_HEAD_LEN 12
- /* "last resort" source for second part of crypt seed pattern */
-# ifndef ZCR_SEED2
-# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
-# endif
-
-static int crypthead(const char* passwd, /* password string */
- unsigned char* buf, /* where to write header */
- int bufSize,
- unsigned long* pkeys,
- const unsigned long* pcrc_32_tab,
- unsigned long crcForCrypting)
-{
- int n; /* index in random header */
- int t; /* temporary */
- int c; /* random byte */
- unsigned char header[RAND_HEAD_LEN-2]; /* random header */
- static unsigned calls = 0; /* ensure different random header each time */
-
- if (bufSize> 7) & 0xff;
- header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
- }
- /* Encrypt random header (last two bytes is high word of crc) */
- init_keys(passwd, pkeys, pcrc_32_tab);
- for (n = 0; n < RAND_HEAD_LEN-2; n++)
- {
- buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
- }
- buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
- buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
- return n;
-}
-
-#endif
diff --git a/code/minizip/deflate.h b/code/minizip/deflate.h
deleted file mode 100644
index e9044c1..0000000
--- a/code/minizip/deflate.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/* deflate.h -- internal compression state
- * Copyright (C) 1995-2010 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef DEFLATE_H
-#define DEFLATE_H
-
-#include "zutil.h"
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer creation by deflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip encoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GZIP
-#endif
-
-/* ===========================================================================
- * Internal compression state.
- */
-
-#define LENGTH_CODES 29
-/* number of length codes, not counting the special END_BLOCK code */
-
-#define LITERALS 256
-/* number of literal bytes 0..255 */
-
-#define L_CODES (LITERALS+1+LENGTH_CODES)
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-#define D_CODES 30
-/* number of distance codes */
-
-#define BL_CODES 19
-/* number of codes used to transfer the bit lengths */
-
-#define HEAP_SIZE (2*L_CODES+1)
-/* maximum heap size */
-
-#define MAX_BITS 15
-/* All codes must not exceed MAX_BITS bits */
-
-#define INIT_STATE 42
-#define EXTRA_STATE 69
-#define NAME_STATE 73
-#define COMMENT_STATE 91
-#define HCRC_STATE 103
-#define BUSY_STATE 113
-#define FINISH_STATE 666
-/* Stream status */
-
-
-/* Data structure describing a single value and its code string. */
-typedef struct ct_data_s {
- union {
- ush freq; /* frequency count */
- ush code; /* bit string */
- } fc;
- union {
- ush dad; /* father node in Huffman tree */
- ush len; /* length of bit string */
- } dl;
-} FAR ct_data;
-
-#define Freq fc.freq
-#define Code fc.code
-#define Dad dl.dad
-#define Len dl.len
-
-typedef struct static_tree_desc_s static_tree_desc;
-
-typedef struct tree_desc_s {
- ct_data *dyn_tree; /* the dynamic tree */
- int max_code; /* largest code with non zero frequency */
- static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
-
-typedef ush Pos;
-typedef Pos FAR Posf;
-typedef unsigned IPos;
-
-/* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. IPos is used only for parameter passing.
- */
-
-typedef struct internal_state {
- z_streamp strm; /* pointer back to this zlib stream */
- int status; /* as the name implies */
- Bytef *pending_buf; /* output still pending */
- ulg pending_buf_size; /* size of pending_buf */
- Bytef *pending_out; /* next pending byte to output to the stream */
- uInt pending; /* nb of bytes in the pending buffer */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- gz_headerp gzhead; /* gzip header information to write */
- uInt gzindex; /* where in extra, name, or comment */
- Byte method; /* STORED (for zip only) or DEFLATED */
- int last_flush; /* value of flush param for previous deflate call */
-
- /* used by deflate.c: */
-
- uInt w_size; /* LZ77 window size (32K by default) */
- uInt w_bits; /* log2(w_size) (8..16) */
- uInt w_mask; /* w_size - 1 */
-
- Bytef *window;
- /* Sliding window. Input bytes are read into the second half of the window,
- * and move to the first half later to keep a dictionary of at least wSize
- * bytes. With this organization, matches are limited to a distance of
- * wSize-MAX_MATCH bytes, but this ensures that IO is always
- * performed with a length multiple of the block size. Also, it limits
- * the window size to 64K, which is quite useful on MSDOS.
- * To do: use the user input buffer as sliding window.
- */
-
- ulg window_size;
- /* Actual size of window: 2*wSize, except when the user input buffer
- * is directly used as sliding window.
- */
-
- Posf *prev;
- /* Link to older string with same hash index. To limit the size of this
- * array to 64K, this link is maintained only for the last 32K strings.
- * An index in this array is thus a window index modulo 32K.
- */
-
- Posf *head; /* Heads of the hash chains or NIL. */
-
- uInt ins_h; /* hash index of string to be inserted */
- uInt hash_size; /* number of elements in hash table */
- uInt hash_bits; /* log2(hash_size) */
- uInt hash_mask; /* hash_size-1 */
-
- uInt hash_shift;
- /* Number of bits by which ins_h must be shifted at each input
- * step. It must be such that after MIN_MATCH steps, the oldest
- * byte no longer takes part in the hash key, that is:
- * hash_shift * MIN_MATCH >= hash_bits
- */
-
- long block_start;
- /* Window position at the beginning of the current output block. Gets
- * negative when the window is moved backwards.
- */
-
- uInt match_length; /* length of best match */
- IPos prev_match; /* previous match */
- int match_available; /* set if previous match exists */
- uInt strstart; /* start of string to insert */
- uInt match_start; /* start of matching string */
- uInt lookahead; /* number of valid bytes ahead in window */
-
- uInt prev_length;
- /* Length of the best match at previous step. Matches not greater than this
- * are discarded. This is used in the lazy match evaluation.
- */
-
- uInt max_chain_length;
- /* To speed up deflation, hash chains are never searched beyond this
- * length. A higher limit improves compression ratio but degrades the
- * speed.
- */
-
- uInt max_lazy_match;
- /* Attempt to find a better match only when the current match is strictly
- * smaller than this value. This mechanism is used only for compression
- * levels >= 4.
- */
-# define max_insert_length max_lazy_match
- /* Insert new strings in the hash table only if the match length is not
- * greater than this length. This saves time but degrades compression.
- * max_insert_length is used only for compression levels <= 3.
- */
-
- int level; /* compression level (1..9) */
- int strategy; /* favor or force Huffman coding*/
-
- uInt good_match;
- /* Use a faster search when the previous match is longer than this */
-
- int nice_match; /* Stop searching when current match exceeds this */
-
- /* used by trees.c: */
- /* Didn't use ct_data typedef below to supress compiler warning */
- struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
- struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
- struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
-
- struct tree_desc_s l_desc; /* desc. for literal tree */
- struct tree_desc_s d_desc; /* desc. for distance tree */
- struct tree_desc_s bl_desc; /* desc. for bit length tree */
-
- ush bl_count[MAX_BITS+1];
- /* number of codes at each bit length for an optimal tree */
-
- int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
- int heap_len; /* number of elements in the heap */
- int heap_max; /* element of largest frequency */
- /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
- * The same heap array is used to build all trees.
- */
-
- uch depth[2*L_CODES+1];
- /* Depth of each subtree used as tie breaker for trees of equal frequency
- */
-
- uchf *l_buf; /* buffer for literals or lengths */
-
- uInt lit_bufsize;
- /* Size of match buffer for literals/lengths. There are 4 reasons for
- * limiting lit_bufsize to 64K:
- * - frequencies can be kept in 16 bit counters
- * - if compression is not successful for the first block, all input
- * data is still in the window so we can still emit a stored block even
- * when input comes from standard input. (This can also be done for
- * all blocks if lit_bufsize is not greater than 32K.)
- * - if compression is not successful for a file smaller than 64K, we can
- * even emit a stored file instead of a stored block (saving 5 bytes).
- * This is applicable only for zip (not gzip or zlib).
- * - creating new Huffman trees less frequently may not provide fast
- * adaptation to changes in the input data statistics. (Take for
- * example a binary file with poorly compressible code followed by
- * a highly compressible string table.) Smaller buffer sizes give
- * fast adaptation but have of course the overhead of transmitting
- * trees more frequently.
- * - I can't count above 4
- */
-
- uInt last_lit; /* running index in l_buf */
-
- ushf *d_buf;
- /* Buffer for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
-
- ulg opt_len; /* bit length of current block with optimal trees */
- ulg static_len; /* bit length of current block with static trees */
- uInt matches; /* number of string matches in current block */
- int last_eob_len; /* bit length of EOB code for last block */
-
-#ifdef DEBUG
- ulg compressed_len; /* total bit length of compressed file mod 2^32 */
- ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
-#endif
-
- ush bi_buf;
- /* Output buffer. bits are inserted starting at the bottom (least
- * significant bits).
- */
- int bi_valid;
- /* Number of valid bits in bi_buf. All bits above the last valid bit
- * are always zero.
- */
-
- ulg high_water;
- /* High water mark offset in window for initialized bytes -- bytes above
- * this are set to zero in order to avoid memory check warnings when
- * longest match routines access bytes past the input. This is then
- * updated to the new high water mark.
- */
-
-} FAR deflate_state;
-
-/* Output a byte on the stream.
- * IN assertion: there is enough room in pending_buf.
- */
-#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
-/* In order to simplify the code, particularly on 16 bit machines, match
- * distances are limited to MAX_DIST instead of WSIZE.
- */
-
-#define WIN_INIT MAX_MATCH
-/* Number of bytes after end of data in window to initialize in order to avoid
- memory checker errors from longest match routines */
-
- /* in trees.c */
-void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
-int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
- ulg stored_len, int last));
-void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
-void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
- ulg stored_len, int last));
-
-#define d_code(dist) \
- ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. _dist_code[256] and _dist_code[257] are never
- * used.
- */
-
-#ifndef DEBUG
-/* Inline versions of _tr_tally for speed: */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
- extern uch ZLIB_INTERNAL _length_code[];
- extern uch ZLIB_INTERNAL _dist_code[];
-#else
- extern const uch ZLIB_INTERNAL _length_code[];
- extern const uch ZLIB_INTERNAL _dist_code[];
-#endif
-
-# define _tr_tally_lit(s, c, flush) \
- { uch cc = (c); \
- s->d_buf[s->last_lit] = 0; \
- s->l_buf[s->last_lit++] = cc; \
- s->dyn_ltree[cc].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-# define _tr_tally_dist(s, distance, length, flush) \
- { uch len = (length); \
- ush dist = (distance); \
- s->d_buf[s->last_lit] = dist; \
- s->l_buf[s->last_lit++] = len; \
- dist--; \
- s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
- s->dyn_dtree[d_code(dist)].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-#else
-# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
-# define _tr_tally_dist(s, distance, length, flush) \
- flush = _tr_tally(s, distance, length)
-#endif
-
-#endif /* DEFLATE_H */
diff --git a/code/minizip/gzguts.h b/code/minizip/gzguts.h
deleted file mode 100644
index 7ff93a8..0000000
--- a/code/minizip/gzguts.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#ifdef _LARGEFILE64_SOURCE
-# ifndef _LARGEFILE_SOURCE
-# define _LARGEFILE_SOURCE 1
-# endif
-# ifdef _FILE_OFFSET_BITS
-# undef _FILE_OFFSET_BITS
-# endif
-#endif
-
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
-# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-# define ZLIB_INTERNAL
-#endif
-
-#include
-#include "zlib.h"
-#ifdef STDC
-# include
-# include
-# include
-#endif
-#include
-
-#ifdef NO_DEFLATE /* for compatibility with old definition */
-# define NO_GZCOMPRESS
-#endif
-
-#ifdef _MSC_VER
-# include
-# define vsnprintf _vsnprintf
-#endif
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-/* gz* functions always use library allocation functions */
-#ifndef STDC
- extern voidp malloc OF((uInt size));
- extern void free OF((voidpf ptr));
-#endif
-
-/* get errno and strerror definition */
-#if defined UNDER_CE
-# include
-# define zstrerror() gz_strwinerror((DWORD)GetLastError())
-#else
-# ifdef STDC
-# include
-# define zstrerror() strerror(errno)
-# else
-# define zstrerror() "stdio error (consult errno)"
-# endif
-#endif
-
-/* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
-#endif
-
-/* default i/o buffer size -- double this for output when reading */
-#define GZBUFSIZE 8192
-
-/* gzip modes, also provide a little integrity check on the passed structure */
-#define GZ_NONE 0
-#define GZ_READ 7247
-#define GZ_WRITE 31153
-#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
-
-/* values for gz_state how */
-#define LOOK 0 /* look for a gzip header */
-#define COPY 1 /* copy input directly */
-#define GZIP 2 /* decompress a gzip stream */
-
-/* internal gzip file state data structure */
-typedef struct {
- /* used for both reading and writing */
- int mode; /* see gzip modes above */
- int fd; /* file descriptor */
- char *path; /* path or fd for error messages */
- z_off64_t pos; /* current position in uncompressed data */
- unsigned size; /* buffer size, zero if not allocated yet */
- unsigned want; /* requested buffer size, default is GZBUFSIZE */
- unsigned char *in; /* input buffer */
- unsigned char *out; /* output buffer (double-sized when reading) */
- unsigned char *next; /* next output data to deliver or write */
- /* just for reading */
- unsigned have; /* amount of output data unused at next */
- int eof; /* true if end of input file reached */
- z_off64_t start; /* where the gzip data started, for rewinding */
- z_off64_t raw; /* where the raw data started, for seeking */
- int how; /* 0: get header, 1: copy, 2: decompress */
- int direct; /* true if last read direct, false if gzip */
- /* just for writing */
- int level; /* compression level */
- int strategy; /* compression strategy */
- /* seek request */
- z_off64_t skip; /* amount to skip (already rewound if backwards) */
- int seek; /* true if seek request pending */
- /* error information */
- int err; /* error code */
- char *msg; /* error message */
- /* zlib inflate or deflate stream */
- z_stream strm; /* stream structure in-place (not a pointer) */
-} gz_state;
-typedef gz_state FAR *gz_statep;
-
-/* shared functions */
-void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
-#if defined UNDER_CE
-char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
-#endif
-
-/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
- value -- needed when comparing unsigned to z_off64_t, which is signed
- (possible z_off64_t types off_t, off64_t, and long are all signed) */
-#ifdef INT_MAX
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
-#else
-unsigned ZLIB_INTERNAL gz_intmax OF((void));
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
-#endif
diff --git a/code/minizip/inffast.h b/code/minizip/inffast.h
deleted file mode 100644
index e1e6db4..0000000
--- a/code/minizip/inffast.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/code/minizip/inffixed.h b/code/minizip/inffixed.h
deleted file mode 100644
index 423d5c5..0000000
--- a/code/minizip/inffixed.h
+++ /dev/null
@@ -1,94 +0,0 @@
- /* inffixed.h -- table for decoding fixed codes
- * Generated automatically by makefixed().
- */
-
- /* WARNING: this file should *not* be used by applications. It
- is part of the implementation of the compression library and
- is subject to change. Applications should only use zlib.h.
- */
-
- static const code lenfix[512] = {
- {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
- {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
- {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
- {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
- {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
- {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
- {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
- {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
- {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
- {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
- {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
- {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
- {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
- {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
- {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
- {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
- {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
- {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
- {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
- {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
- {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
- {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
- {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
- {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
- {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
- {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
- {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
- {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
- {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
- {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
- {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
- {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
- {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
- {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
- {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
- {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
- {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
- {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
- {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
- {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
- {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
- {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
- {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
- {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
- {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
- {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
- {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
- {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
- {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
- {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
- {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
- {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
- {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
- {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
- {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
- {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
- {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
- {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
- {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
- {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
- {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
- {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
- {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
- {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
- {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
- {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
- {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
- {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
- {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
- {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
- {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
- {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
- {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
- {0,9,255}
- };
-
- static const code distfix[32] = {
- {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
- {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
- {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
- {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
- {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
- {22,5,193},{64,5,0}
- };
diff --git a/code/minizip/inflate.h b/code/minizip/inflate.h
deleted file mode 100644
index a8ef428..0000000
--- a/code/minizip/inflate.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2009 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip decoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GUNZIP
-#endif
-
-/* Possible inflate modes between inflate() calls */
-typedef enum {
- HEAD, /* i: waiting for magic header */
- FLAGS, /* i: waiting for method and flags (gzip) */
- TIME, /* i: waiting for modification time (gzip) */
- OS, /* i: waiting for extra flags and operating system (gzip) */
- EXLEN, /* i: waiting for extra length (gzip) */
- EXTRA, /* i: waiting for extra bytes (gzip) */
- NAME, /* i: waiting for end of file name (gzip) */
- COMMENT, /* i: waiting for end of comment (gzip) */
- HCRC, /* i: waiting for header crc (gzip) */
- DICTID, /* i: waiting for dictionary check value */
- DICT, /* waiting for inflateSetDictionary() call */
- TYPE, /* i: waiting for type bits, including last-flag bit */
- TYPEDO, /* i: same, but skip check to exit inflate on new block */
- STORED, /* i: waiting for stored size (length and complement) */
- COPY_, /* i/o: same as COPY below, but only first time in */
- COPY, /* i/o: waiting for input or output to copy stored block */
- TABLE, /* i: waiting for dynamic block table lengths */
- LENLENS, /* i: waiting for code length code lengths */
- CODELENS, /* i: waiting for length/lit and distance code lengths */
- LEN_, /* i: same as LEN below, but only first time in */
- LEN, /* i: waiting for length/lit/eob code */
- LENEXT, /* i: waiting for length extra bits */
- DIST, /* i: waiting for distance code */
- DISTEXT, /* i: waiting for distance extra bits */
- MATCH, /* o: waiting for output space to copy string */
- LIT, /* o: waiting for output space to write literal */
- CHECK, /* i: waiting for 32-bit check value */
- LENGTH, /* i: waiting for 32-bit length (gzip) */
- DONE, /* finished check, done -- remain here until reset */
- BAD, /* got a data error -- remain here until reset */
- MEM, /* got an inflate() memory error -- remain here until reset */
- SYNC /* looking for synchronization bytes to restart inflate() */
-} inflate_mode;
-
-/*
- State transitions between above modes -
-
- (most modes can go to BAD or MEM on error -- not shown for clarity)
-
- Process header:
- HEAD -> (gzip) or (zlib) or (raw)
- (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
- HCRC -> TYPE
- (zlib) -> DICTID or TYPE
- DICTID -> DICT -> TYPE
- (raw) -> TYPEDO
- Read deflate blocks:
- TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
- STORED -> COPY_ -> COPY -> TYPE
- TABLE -> LENLENS -> CODELENS -> LEN_
- LEN_ -> LEN
- Read deflate codes in fixed or dynamic block:
- LEN -> LENEXT or LIT or TYPE
- LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
- LIT -> LEN
- Process trailer:
- CHECK -> LENGTH -> DONE
- */
-
-/* state maintained between inflate() calls. Approximately 10K bytes. */
-struct inflate_state {
- inflate_mode mode; /* current inflate mode */
- int last; /* true if processing last block */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- int havedict; /* true if dictionary provided */
- int flags; /* gzip header method and flags (0 if zlib) */
- unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
- unsigned long check; /* protected copy of check value */
- unsigned long total; /* protected copy of output count */
- gz_headerp head; /* where to save gzip header information */
- /* sliding window */
- unsigned wbits; /* log base 2 of requested window size */
- unsigned wsize; /* window size or zero if not using window */
- unsigned whave; /* valid bytes in the window */
- unsigned wnext; /* window write index */
- unsigned char FAR *window; /* allocated sliding window, if needed */
- /* bit accumulator */
- unsigned long hold; /* input bit accumulator */
- unsigned bits; /* number of bits in "in" */
- /* for string and stored block copying */
- unsigned length; /* literal or length of data to copy */
- unsigned offset; /* distance back to copy string from */
- /* for table and code decoding */
- unsigned extra; /* extra bits needed */
- /* fixed and dynamic code tables */
- code const FAR *lencode; /* starting table for length/literal codes */
- code const FAR *distcode; /* starting table for distance codes */
- unsigned lenbits; /* index bits for lencode */
- unsigned distbits; /* index bits for distcode */
- /* dynamic table building */
- unsigned ncode; /* number of code length code lengths */
- unsigned nlen; /* number of length code lengths */
- unsigned ndist; /* number of distance code lengths */
- unsigned have; /* number of code lengths in lens[] */
- code FAR *next; /* next available space in codes[] */
- unsigned short lens[320]; /* temporary storage for code lengths */
- unsigned short work[288]; /* work area for code table building */
- code codes[ENOUGH]; /* space for code tables */
- int sane; /* if false, allow invalid distance too far */
- int back; /* bits back of last unprocessed length/lit */
- unsigned was; /* initial length of match */
-};
diff --git a/code/minizip/inftrees.h b/code/minizip/inftrees.h
deleted file mode 100644
index a685d8c..0000000
--- a/code/minizip/inftrees.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* Structure for decoding tables. Each entry provides either the
- information needed to do the operation requested by the code that
- indexed that table entry, or it provides a pointer to another
- table that indexes more bits of the code. op indicates whether
- the entry is a pointer to another table, a literal, a length or
- distance, an end-of-block, or an invalid code. For a table
- pointer, the low four bits of op is the number of index bits of
- that table. For a length or distance, the low four bits of op
- is the number of extra bits to get after the code. bits is
- the number of bits in this code or part of the code to drop off
- of the bit buffer. val is the actual byte to output in the case
- of a literal, the base length or distance, or the offset from
- the current table to the next table. Each entry is four bytes. */
-typedef struct {
- unsigned char op; /* operation, extra bits, table bits */
- unsigned char bits; /* bits in this part of the code */
- unsigned short val; /* offset in table or code value */
-} code;
-
-/* op values as set by inflate_table():
- 00000000 - literal
- 0000tttt - table link, tttt != 0 is the number of table index bits
- 0001eeee - length or distance, eeee is the number of extra bits
- 01100000 - end of block
- 01000000 - invalid code
- */
-
-/* Maximum size of the dynamic table. The maximum number of code structures is
- 1444, which is the sum of 852 for literal/length codes and 592 for distance
- codes. These values were found by exhaustive searches using the program
- examples/enough.c found in the zlib distribtution. The arguments to that
- program are the number of symbols, the initial root table size, and the
- maximum bit length of a code. "enough 286 9 15" for literal/length codes
- returns returns 852, and "enough 30 6 15" for distance codes returns 592.
- The initial root table size (9 or 6) is found in the fifth argument of the
- inflate_table() calls in inflate.c and infback.c. If the root table size is
- changed, then these maximum sizes would be need to be recalculated and
- updated. */
-#define ENOUGH_LENS 852
-#define ENOUGH_DISTS 592
-#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
-
-/* Type of code to build for inflate_table() */
-typedef enum {
- CODES,
- LENS,
- DISTS
-} codetype;
-
-int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
- unsigned codes, code FAR * FAR *table,
- unsigned FAR *bits, unsigned short FAR *work));
diff --git a/code/minizip/ioapi.h b/code/minizip/ioapi.h
deleted file mode 100644
index a54c0d3..0000000
--- a/code/minizip/ioapi.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* ioapi.h -- IO base function header for compress/uncompress .zip
- part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
-
- Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
-
- Modifications for Zip64 support
- Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
-
- For more info read MiniZip_info.txt
-
- Changes
-
- Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
- Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
- More if/def section may be needed to support other platforms
- Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
- (but you should use iowin32.c for windows instead)
-
-*/
-
-#ifndef _ZLIBIOAPI64_H
-#define _ZLIBIOAPI64_H
-
-#if (!defined(_WIN32)) && (!defined(WIN32))
-
- // Linux needs this to support file operation on files larger then 4+GB
- // But might need better if/def to select just the platforms that needs them.
-
- #ifndef __USE_FILE_OFFSET64
- #define __USE_FILE_OFFSET64
- #endif
- #ifndef __USE_LARGEFILE64
- #define __USE_LARGEFILE64
- #endif
- #ifndef _LARGEFILE64_SOURCE
- #define _LARGEFILE64_SOURCE
- #endif
- #ifndef _FILE_OFFSET_BIT
- #define _FILE_OFFSET_BIT 64
- #endif
-#endif
-
-#include
-#include
-#include "zlib.h"
-
-#if defined(USE_FILE32API)
-#define fopen64 fopen
-#define ftello64 ftell
-#define fseeko64 fseek
-#else
-#ifdef _MSC_VER
- #define fopen64 _wfopen
- #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
- #define ftello64 _ftelli64
- #define fseeko64 _fseeki64
- #else // old MSC
- #define ftello64 ftell
- #define fseeko64 fseek
- #endif
-#endif
-#endif
-
-/*
-#ifndef ZPOS64_T
- #ifdef _WIN32
- #define ZPOS64_T fpos_t
- #else
- #include
- #define ZPOS64_T uint64_t
- #endif
-#endif
-*/
-
-#ifdef HAVE_MINIZIP64_CONF_H
-#include "mz64conf.h"
-#endif
-
-/* a type choosen by DEFINE */
-#ifdef HAVE_64BIT_INT_CUSTOM
-typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
-#else
-#ifdef HAS_STDINT_H
-#include "stdint.h"
-typedef uint64_t ZPOS64_T;
-#else
-
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-typedef unsigned __int64 ZPOS64_T;
-#else
-typedef unsigned long long int ZPOS64_T;
-#endif
-#endif
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define ZLIB_FILEFUNC_SEEK_CUR (1)
-#define ZLIB_FILEFUNC_SEEK_END (2)
-#define ZLIB_FILEFUNC_SEEK_SET (0)
-
-#define ZLIB_FILEFUNC_MODE_READ (1)
-#define ZLIB_FILEFUNC_MODE_WRITE (2)
-#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
-
-#define ZLIB_FILEFUNC_MODE_EXISTING (4)
-#define ZLIB_FILEFUNC_MODE_CREATE (8)
-
-
-#ifndef ZCALLBACK
- #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
- #define ZCALLBACK CALLBACK
- #else
- #define ZCALLBACK
- #endif
-#endif
-
-
-
-
-typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
-typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
-typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
-typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
-typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
-
-typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
-typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
-
-
-/* here is the "old" 32 bits structure structure */
-typedef struct zlib_filefunc_def_s
-{
- open_file_func zopen_file;
- read_file_func zread_file;
- write_file_func zwrite_file;
- tell_file_func ztell_file;
- seek_file_func zseek_file;
- close_file_func zclose_file;
- testerror_file_func zerror_file;
- voidpf opaque;
-} zlib_filefunc_def;
-
-typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
-typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
-typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
-
-typedef struct zlib_filefunc64_def_s
-{
- open64_file_func zopen64_file;
- read_file_func zread_file;
- write_file_func zwrite_file;
- tell64_file_func ztell64_file;
- seek64_file_func zseek64_file;
- close_file_func zclose_file;
- testerror_file_func zerror_file;
- voidpf opaque;
-} zlib_filefunc64_def;
-
-void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
-void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
-
-/* now internal definition, only for zip.c and unzip.h */
-typedef struct zlib_filefunc64_32_def_s
-{
- zlib_filefunc64_def zfile_func64;
- open_file_func zopen32_file;
- tell_file_func ztell32_file;
- seek_file_func zseek32_file;
-} zlib_filefunc64_32_def;
-
-
-#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
-#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
-//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
-//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
-#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
-#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
-
-voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
-long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
-ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
-
-void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
-
-#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
-#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
-#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/minizip/iowin32.h b/code/minizip/iowin32.h
deleted file mode 100644
index 69c01ba..0000000
--- a/code/minizip/iowin32.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* iowin32.h -- IO base function header for compress/uncompress .zip
- Version 1.1, February 14h, 2010
- part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
-
- Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
-
- Modifications for Zip64 support
- Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
-
- For more info read MiniZip_info.txt
-
-*/
-
-#include
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
-void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def));
-void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def));
-void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def));
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/code/minizip/mztools.h b/code/minizip/mztools.h
deleted file mode 100644
index ec556ea..0000000
--- a/code/minizip/mztools.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Additional tools for Minizip
- Code: Xavier Roche '2004
- License: Same as ZLIB (www.gzip.org)
-*/
-
-#ifndef _zip_tools_H
-#define _zip_tools_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#include "unzip.h"
-
-/* Repair a ZIP file (missing central directory)
- file: file to recover
- fileOut: output file after recovery
- fileOutTmp: temporary file name used for recovery
-*/
-extern int ZEXPORT unzRepair(const char* file,
- const char* fileOut,
- const char* fileOutTmp,
- uLong* nRecovered,
- uLong* bytesRecovered);
-
-#endif
diff --git a/code/minizip/trees.h b/code/minizip/trees.h
deleted file mode 100644
index ce8f620..0000000
--- a/code/minizip/trees.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* header created automatically with -DGEN_TREES_H */
-
-local const ct_data static_ltree[L_CODES+2] = {
-{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
-{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
-{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
-{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
-{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
-{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
-{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
-{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
-{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
-{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
-{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
-{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
-{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
-{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
-{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
-{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
-{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
-{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
-{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
-{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
-{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
-{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
-{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
-{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
-{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
-{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
-{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
-{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
-{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
-{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
-{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
-{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
-{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
-{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
-{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
-{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
-{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
-{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
-{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
-{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
-{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
-{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
-{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
-{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
-{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
-{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
-{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
-{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
-{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
-{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
-{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
-{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
-{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
-{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
-{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
-{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
-{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
-{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
-};
-
-local const ct_data static_dtree[D_CODES] = {
-{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
-{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
-{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
-{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
-{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
-{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
-};
-
-const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
- 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
-10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
-18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
-};
-
-const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
-13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
-19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
-};
-
-local const int base_length[LENGTH_CODES] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
-64, 80, 96, 112, 128, 160, 192, 224, 0
-};
-
-local const int base_dist[D_CODES] = {
- 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
- 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
- 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
-};
-
diff --git a/code/minizip/unzip.h b/code/minizip/unzip.h
deleted file mode 100644
index f34d6ac..0000000
--- a/code/minizip/unzip.h
+++ /dev/null
@@ -1,437 +0,0 @@
-/* unzip.h -- IO for uncompress .zip files using zlib
- Version 1.1, February 14h, 2010
- part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
-
- Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
-
- Modifications of Unzip for Zip64
- Copyright (C) 2007-2008 Even Rouault
-
- Modifications for Zip64 support on both zip and unzip
- Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
-
- For more info read MiniZip_info.txt
-
- ---------------------------------------------------------------------------------
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- ---------------------------------------------------------------------------------
-
- Changes
-
- See header of unzip64.c
-
-*/
-
-#ifndef _unz64_H
-#define _unz64_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#ifndef _ZLIBIOAPI_H
-#include "ioapi.h"
-#endif
-
-#ifdef HAVE_BZIP2
-#include "bzlib.h"
-#endif
-
-#define Z_BZIP2ED 12
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO (Z_ERRNO)
-#define UNZ_EOF (0)
-#define UNZ_PARAMERROR (-102)
-#define UNZ_BADZIPFILE (-103)
-#define UNZ_INTERNALERROR (-104)
-#define UNZ_CRCERROR (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
- These data comes from the end of central dir */
-typedef struct unz_global_info64_s
-{
- ZPOS64_T number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
-} unz_global_info64;
-
-typedef struct unz_global_info_s
-{
- uLong number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
-} unz_global_info;
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info64_s
-{
- uLong version; /* version made by 2 bytes */
- uLong version_needed; /* version needed to extract 2 bytes */
- uLong flag; /* general purpose bit flag 2 bytes */
- uLong compression_method; /* compression method 2 bytes */
- uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
- uLong crc; /* crc-32 4 bytes */
- ZPOS64_T compressed_size; /* compressed size 8 bytes */
- ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
- uLong size_filename; /* filename length 2 bytes */
- uLong size_file_extra; /* extra field length 2 bytes */
- uLong size_file_comment; /* file comment length 2 bytes */
-
- uLong disk_num_start; /* disk number start 2 bytes */
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-
- tm_unz tmu_date;
-} unz_file_info64;
-
-typedef struct unz_file_info_s
-{
- uLong version; /* version made by 2 bytes */
- uLong version_needed; /* version needed to extract 2 bytes */
- uLong flag; /* general purpose bit flag 2 bytes */
- uLong compression_method; /* compression method 2 bytes */
- uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
- uLong crc; /* crc-32 4 bytes */
- uLong compressed_size; /* compressed size 4 bytes */
- uLong uncompressed_size; /* uncompressed size 4 bytes */
- uLong size_filename; /* filename length 2 bytes */
- uLong size_file_extra; /* extra field length 2 bytes */
- uLong size_file_comment; /* file comment length 2 bytes */
-
- uLong disk_num_start; /* disk number start 2 bytes */
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-
- tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
- const char* fileName2,
- int iCaseSensitivity));
-/*
- Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
- If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((const char *path));
-extern unzFile ZEXPORT unzOpen64 OF((const void *path));
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
- "zlib/zlib113.zip".
- If the zipfile cannot be opened (file don't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
- the "64" function take a const void* pointer, because the path is just the
- value passed to the open64_file_func callback.
- Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
- is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
- does not describe the reality
-*/
-
-
-extern unzFile ZEXPORT unzOpen2 OF((const char *path,
- zlib_filefunc_def* pzlib_filefunc_def));
-/*
- Open a Zip file, like unzOpen, but provide a set of file low level API
- for read/write the zip file (see ioapi.h)
-*/
-
-extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
- zlib_filefunc64_def* pzlib_filefunc_def));
-/*
- Open a Zip file, like unz64Open, but provide a set of file low level API
- for read/write the zip file (see ioapi.h)
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
- unz_global_info *pglobal_info));
-
-extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
- unz_global_info64 *pglobal_info));
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
- char *szComment,
- uLong uSizeBuf));
-/*
- Get the global comment string of the ZipFile, in the szComment buffer.
- uSizeBuf is the size of the szComment buffer.
- return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file,
- const char *szFileName,
- int iCaseSensitivity));
-/*
- Try locate the file szFileName in the zipfile.
- For the iCaseSensitivity signification, see unzStringFileNameCompare
-
- return value :
- UNZ_OK if the file is found. It becomes the current file.
- UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-/* ****************************************** */
-/* Ryan supplied functions */
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_pos_s
-{
- uLong pos_in_zip_directory; /* offset in zip file directory */
- uLong num_of_file; /* # of file */
-} unz_file_pos;
-
-extern int ZEXPORT unzGetFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-extern int ZEXPORT unzGoToFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-typedef struct unz64_file_pos_s
-{
- ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
- ZPOS64_T num_of_file; /* # of file */
-} unz64_file_pos;
-
-extern int ZEXPORT unzGetFilePos64(
- unzFile file,
- unz64_file_pos* file_pos);
-
-extern int ZEXPORT unzGoToFilePos64(
- unzFile file,
- const unz64_file_pos* file_pos);
-
-/* ****************************************** */
-
-extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
- unz_file_info64 *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize));
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize));
-/*
- Get Info about the current file
- if pfile_info!=NULL, the *pfile_info structure will contain somes info about
- the current file
- if szFileName!=NULL, the filemane string will be copied in szFileName
- (fileNameBufferSize is the size of the buffer)
- if extraField!=NULL, the extra field information will be copied in extraField
- (extraFieldBufferSize is the size of the buffer).
- This is the Central-header version of the extra field
- if szComment!=NULL, the comment string of the file will be copied in szComment
- (commentBufferSize is the size of the buffer)
-*/
-
-
-/** Addition for GDAL : START */
-
-extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
-
-/** Addition for GDAL : END */
-
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
- from it, and close it (you can close it before reading all the file)
- */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
- Open for reading data the current file in the zipfile.
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
- const char* password));
-/*
- Open for reading data the current file in the zipfile.
- password is a crypting password
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
- int* method,
- int* level,
- int raw));
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
- int* method,
- int* level,
- int raw,
- const char* password));
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
- Close the file in zip opened with unzOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read bytes from the current file (opened by unzOpenCurrentFile)
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-
-extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
-/*
- Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
- return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read extra field from the current file (opened by unzOpenCurrentFile)
- This is the local-header version of the extra field (sometimes, there is
- more info in the local-header version than in the central-header)
-
- if buf==NULL, it return the size of the local extra field
-
- if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
-*/
-
-/***************************************************************************/
-
-/* Get the current file offset */
-extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
-extern uLong ZEXPORT unzGetOffset (unzFile file);
-
-/* Set the current file offset */
-extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz64_H */
diff --git a/code/minizip/zconf.h b/code/minizip/zconf.h
deleted file mode 100644
index 88f90f9..0000000
--- a/code/minizip/zconf.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- * Even better than compiling with -DZ_PREFIX would be to use configure to set
- * this permanently in zconf.h using "./configure --zprefix".
- */
-#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
-
-/* all linked symbols */
-# define _dist_code z__dist_code
-# define _length_code z__length_code
-# define _tr_align z__tr_align
-# define _tr_flush_block z__tr_flush_block
-# define _tr_init z__tr_init
-# define _tr_stored_block z__tr_stored_block
-# define _tr_tally z__tr_tally
-# define adler32 z_adler32
-# define adler32_combine z_adler32_combine
-# define adler32_combine64 z_adler32_combine64
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define crc32 z_crc32
-# define crc32_combine z_crc32_combine
-# define crc32_combine64 z_crc32_combine64
-# define deflate z_deflate
-# define deflateBound z_deflateBound
-# define deflateCopy z_deflateCopy
-# define deflateEnd z_deflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateInit_ z_deflateInit_
-# define deflateParams z_deflateParams
-# define deflatePrime z_deflatePrime
-# define deflateReset z_deflateReset
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateSetHeader z_deflateSetHeader
-# define deflateTune z_deflateTune
-# define deflate_copyright z_deflate_copyright
-# define get_crc_table z_get_crc_table
-# define gz_error z_gz_error
-# define gz_intmax z_gz_intmax
-# define gz_strwinerror z_gz_strwinerror
-# define gzbuffer z_gzbuffer
-# define gzclearerr z_gzclearerr
-# define gzclose z_gzclose
-# define gzclose_r z_gzclose_r
-# define gzclose_w z_gzclose_w
-# define gzdirect z_gzdirect
-# define gzdopen z_gzdopen
-# define gzeof z_gzeof
-# define gzerror z_gzerror
-# define gzflush z_gzflush
-# define gzgetc z_gzgetc
-# define gzgets z_gzgets
-# define gzoffset z_gzoffset
-# define gzoffset64 z_gzoffset64
-# define gzopen z_gzopen
-# define gzopen64 z_gzopen64
-# define gzprintf z_gzprintf
-# define gzputc z_gzputc
-# define gzputs z_gzputs
-# define gzread z_gzread
-# define gzrewind z_gzrewind
-# define gzseek z_gzseek
-# define gzseek64 z_gzseek64
-# define gzsetparams z_gzsetparams
-# define gztell z_gztell
-# define gztell64 z_gztell64
-# define gzungetc z_gzungetc
-# define gzwrite z_gzwrite
-# define inflate z_inflate
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define inflateBackInit_ z_inflateBackInit_
-# define inflateCopy z_inflateCopy
-# define inflateEnd z_inflateEnd
-# define inflateGetHeader z_inflateGetHeader
-# define inflateInit2_ z_inflateInit2_
-# define inflateInit_ z_inflateInit_
-# define inflateMark z_inflateMark
-# define inflatePrime z_inflatePrime
-# define inflateReset z_inflateReset
-# define inflateReset2 z_inflateReset2
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateUndermine z_inflateUndermine
-# define inflate_copyright z_inflate_copyright
-# define inflate_fast z_inflate_fast
-# define inflate_table z_inflate_table
-# define uncompress z_uncompress
-# define zError z_zError
-# define zcalloc z_zcalloc
-# define zcfree z_zcfree
-# define zlibCompileFlags z_zlibCompileFlags
-# define zlibVersion z_zlibVersion
-
-/* all zlib typedefs in zlib.h and zconf.h */
-# define Byte z_Byte
-# define Bytef z_Bytef
-# define alloc_func z_alloc_func
-# define charf z_charf
-# define free_func z_free_func
-# define gzFile z_gzFile
-# define gz_header z_gz_header
-# define gz_headerp z_gz_headerp
-# define in_func z_in_func
-# define intf z_intf
-# define out_func z_out_func
-# define uInt z_uInt
-# define uIntf z_uIntf
-# define uLong z_uLong
-# define uLongf z_uLongf
-# define voidp z_voidp
-# define voidpc z_voidpc
-# define voidpf z_voidpf
-
-/* all zlib structs in zlib.h and zconf.h */
-# define gz_header_s z_gz_header_s
-# define internal_state z_internal_state
-
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_UNISTD_H
-#endif
-
-#ifdef STDC
-# include /* for off_t */
-#endif
-
-/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
- * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
- * though the former does not conform to the LFS document), but considering
- * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
- * equivalently requesting no 64-bit operations
- */
-#if -_LARGEFILE64_SOURCE - -1 == 1
-# undef _LARGEFILE64_SOURCE
-#endif
-
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-# include /* for SEEK_* and off_t */
-# ifdef VMS
-# include /* for off_t */
-# endif
-# ifndef z_off_t
-# define z_off_t off_t
-# endif
-#endif
-
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
-# define z_off64_t off64_t
-#else
-# define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
- #pragma map(deflateInit_,"DEIN")
- #pragma map(deflateInit2_,"DEIN2")
- #pragma map(deflateEnd,"DEEND")
- #pragma map(deflateBound,"DEBND")
- #pragma map(inflateInit_,"ININ")
- #pragma map(inflateInit2_,"ININ2")
- #pragma map(inflateEnd,"INEND")
- #pragma map(inflateSync,"INSY")
- #pragma map(inflateSetDictionary,"INSEDI")
- #pragma map(compressBound,"CMBND")
- #pragma map(inflate_table,"INTABL")
- #pragma map(inflate_fast,"INFA")
- #pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/code/minizip/zip.h b/code/minizip/zip.h
deleted file mode 100644
index ca9aaff..0000000
--- a/code/minizip/zip.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* zip.h -- IO on .zip files using zlib
- Version 1.1, February 14h, 2010
- part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
-
- Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
-
- Modifications for Zip64 support
- Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
-
- For more info read MiniZip_info.txt
-
- ---------------------------------------------------------------------------
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- ---------------------------------------------------------------------------
-
- Changes
-
- See header of zip.h
-
-*/
-
-#ifndef _zip12_H
-#define _zip12_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//#define HAVE_BZIP2
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#ifndef _ZLIBIOAPI_H
-#include "ioapi.h"
-#endif
-
-#ifdef HAVE_BZIP2
-#include "bzlib.h"
-#endif
-
-#define Z_BZIP2ED 12
-
-#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagzipFile__ { int unused; } zipFile__;
-typedef zipFile__ *zipFile;
-#else
-typedef voidp zipFile;
-#endif
-
-#define ZIP_OK (0)
-#define ZIP_EOF (0)
-#define ZIP_ERRNO (Z_ERRNO)
-#define ZIP_PARAMERROR (-102)
-#define ZIP_BADZIPFILE (-103)
-#define ZIP_INTERNALERROR (-104)
-
-#ifndef DEF_MEM_LEVEL
-# if MAX_MEM_LEVEL >= 8
-# define DEF_MEM_LEVEL 8
-# else
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL
-# endif
-#endif
-/* default memLevel */
-
-/* tm_zip contain date/time info */
-typedef struct tm_zip_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_zip;
-
-typedef struct
-{
- tm_zip tmz_date; /* date in understandable format */
- uLong dosDate; /* if dos_date == 0, tmu_date is used */
-/* uLong flag; */ /* general purpose bit flag 2 bytes */
-
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-} zip_fileinfo;
-
-typedef const char* zipcharpc;
-
-
-#define APPEND_STATUS_CREATE (0)
-#define APPEND_STATUS_CREATEAFTER (1)
-#define APPEND_STATUS_ADDINZIP (2)
-
-extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
-extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
-/*
- Create a zipfile.
- pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
- an Unix computer "zlib/zlib113.zip".
- if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
- will be created at the end of the file.
- (useful if the file contain a self extractor code)
- if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
- add files in existing zip (be sure you don't add file that doesn't exist)
- If the zipfile cannot be opened, the return value is NULL.
- Else, the return value is a zipFile Handle, usable with other function
- of this zip package.
-*/
-
-/* Note : there is no delete function into a zipfile.
- If you want delete file into a zipfile, you must open a zipfile, and create another
- Of couse, you can use RAW reading and writing to copy the file you did not want delte
-*/
-
-extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
- int append,
- zipcharpc* globalcomment,
- zlib_filefunc_def* pzlib_filefunc_def));
-
-extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
- int append,
- zipcharpc* globalcomment,
- zlib_filefunc64_def* pzlib_filefunc_def));
-
-extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level));
-
-extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int zip64));
-
-/*
- Open a file in the ZIP for writing.
- filename : the filename in zip (if NULL, '-' without quote will be used
- *zipfi contain supplemental information
- if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
- contains the extrafield data the the local header
- if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
- contains the extrafield data the the local header
- if comment != NULL, comment contain the comment string
- method contain the compression method (0 for store, Z_DEFLATED for deflate)
- level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
- zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
- this MUST be '1' if the uncompressed size is >= 0xffffffff.
-
-*/
-
-
-extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw));
-
-
-extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw,
- int zip64));
-/*
- Same than zipOpenNewFileInZip, except if raw=1, we write raw file
- */
-
-extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw,
- int windowBits,
- int memLevel,
- int strategy,
- const char* password,
- uLong crcForCrypting));
-
-extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw,
- int windowBits,
- int memLevel,
- int strategy,
- const char* password,
- uLong crcForCrypting,
- int zip64
- ));
-
-/*
- Same than zipOpenNewFileInZip2, except
- windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
- password : crypting password (NULL for no crypting)
- crcForCrypting : crc of file to compress (needed for crypting)
- */
-
-extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw,
- int windowBits,
- int memLevel,
- int strategy,
- const char* password,
- uLong crcForCrypting,
- uLong versionMadeBy,
- uLong flagBase
- ));
-
-
-extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level,
- int raw,
- int windowBits,
- int memLevel,
- int strategy,
- const char* password,
- uLong crcForCrypting,
- uLong versionMadeBy,
- uLong flagBase,
- int zip64
- ));
-/*
- Same than zipOpenNewFileInZip4, except
- versionMadeBy : value for Version made by field
- flag : value for flag field (compression level info will be added)
- */
-
-
-extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
- const void* buf,
- unsigned len));
-/*
- Write data in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
-/*
- Close the current file in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
- uLong uncompressed_size,
- uLong crc32));
-
-extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
- ZPOS64_T uncompressed_size,
- uLong crc32));
-
-/*
- Close the current file in the zipfile, for file opened with
- parameter raw=1 in zipOpenNewFileInZip2
- uncompressed_size and crc32 are value for the uncompressed size
-*/
-
-extern int ZEXPORT zipClose OF((zipFile file,
- const char* global_comment));
-/*
- Close the zipfile
-*/
-
-
-extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
-/*
- zipRemoveExtraInfoBlock - Added by Mathias Svensson
-
- Remove extra information block from a extra information data for the local file header or central directory header
-
- It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
-
- 0x0001 is the signature header for the ZIP64 extra information blocks
-
- usage.
- Remove ZIP64 Extra information from a central director extra field data
- zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
-
- Remove ZIP64 Extra information from a Local File Header extra field data
- zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _zip64_H */
diff --git a/code/minizip/zlib.h b/code/minizip/zlib.h
deleted file mode 100644
index cba7ab2..0000000
--- a/code/minizip/zlib.h
+++ /dev/null
@@ -1,1613 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.5, April 19th, 2010
-
- Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.5"
-#define ZLIB_VERNUM 0x1250
-#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 5
-#define ZLIB_VER_SUBREVISION 0
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed data.
- This version of the library supports only one compression method (deflation)
- but other algorithms will be added later and will have the same stream
- interface.
-
- Compression can be done in a single step if the buffers are large enough,
- or can be done by repeated calls of the compression function. In the latter
- case, the application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never crash
- even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: binary or text */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- gzip header information passed to and from zlib routines. See RFC 1952
- for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
- int text; /* true if compressed data believed to be text */
- uLong time; /* modification time */
- int xflags; /* extra flags (not used when writing a gzip file) */
- int os; /* operating system */
- Bytef *extra; /* pointer to extra field or Z_NULL if none */
- uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
- uInt extra_max; /* space at extra (only when reading header) */
- Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
- uInt name_max; /* space at name (only when reading header) */
- Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
- uInt comm_max; /* space at comment (only when reading header) */
- int hcrc; /* true if there was or will be a header crc */
- int done; /* true when done reading gzip header (not used
- when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
- The application must update next_in and avail_in when avail_in has dropped
- to zero. It must update next_out and avail_out when avail_out has dropped
- to zero. The application must initialize zalloc, zfree and opaque before
- calling the init function. All other fields are set by the compression
- library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this if
- the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
- returned by zalloc for objects of exactly 65536 bytes *must* have their
- offset normalized to zero. The default allocation function provided by this
- library ensures this (see zutil.c). To reduce memory requirements and avoid
- any allocation of 64K objects, at the expense of compression ratio, compile
- the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or progress
- reports. After compression, total_in holds the total size of the
- uncompressed data and may be saved for use in the decompressor (particularly
- if the decompressor wants to decompress everything in a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-#define Z_TREES 6
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is not
- compatible with the zlib.h header file used by the application. This check
- is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller. If
- zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
- allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at all
- (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
- requests a default compromise between speed and compression (currently
- equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if level is not a valid compression level, or
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION). msg is set to null
- if there is no error message. deflateInit does not perform any compression:
- this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications). Some
- output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating avail_in or avail_out accordingly; avail_out should
- never be zero before the call. The application can consume the compressed
- output when it wants, for example when the output buffer is full (avail_out
- == 0), or after each call of deflate(). If deflate returns Z_OK and with
- zero avail_out, it must be called again after making room in the output
- buffer because there might be more output pending.
-
- Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumulate before producing output, in order to
- maximize compression.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In
- particular avail_in is zero after the call if enough output space has been
- provided before the call.) Flushing may degrade compression for some
- compression algorithms and so it should be used only when necessary. This
- completes the current deflate block and follows it with an empty stored block
- that is three bits plus filler bits to the next byte, followed by four bytes
- (00 00 ff ff).
-
- If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
- output buffer, but the output is not aligned to a byte boundary. All of the
- input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
- This completes the current deflate block and follows it with an empty fixed
- codes block that is 10 bits long. This assures that enough bytes are output
- in order for the decompressor to finish the block before the empty fixed code
- block.
-
- If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
- for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
- seven bits of the current block are held to be written as the next byte after
- the next deflate block is completed. In this case, the decompressor may not
- be provided enough bits at this point in order to complete decompression of
- the data provided so far to the compressor. It may need to wait for the next
- block to be emitted. This is for advanced applications that need to control
- the emission of deflate blocks.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there was
- enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the stream
- are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least the
- value returned by deflateBound (see below). If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect the
- compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
- fatal, and deflate() can be called again with more input and more output
- space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case, msg
- may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the
- exact value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit() does not process any header information -- that is deferred
- until inflate() is called.
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing will
- resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there is
- no more input data or no more space in the output buffer (see below about
- the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating the next_* and avail_* values accordingly. The
- application can consume the uncompressed output when it wants, for example
- when the output buffer is full (avail_out == 0), or after each call of
- inflate(). If inflate returns Z_OK and with zero avail_out, it must be
- called again after making room in the output buffer because there might be
- more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
- Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate()
- stop if and when it gets to the next deflate block boundary. When decoding
- the zlib or gzip format, this will cause inflate() to return immediately
- after the header and before the first block. When doing a raw inflate,
- inflate() will go ahead and process the first block, and will return when it
- gets to the end of that block, or when it runs out of data.
-
- The Z_BLOCK option assists in appending to or combining deflate streams.
- Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64 if
- inflate() is currently decoding the last block in the deflate stream, plus
- 128 if inflate() returned immediately after decoding an end-of-block code or
- decoding the complete header up to just before the first byte of the deflate
- stream. The end-of-block will not be indicated until all of the uncompressed
- data from that block has been written to strm->next_out. The number of
- unused bits may in general be greater than seven, except when bit 7 of
- data_type is set, in which case the number of unused bits will be less than
- eight. data_type is set as noted here every time inflate() returns for all
- flush options, and so can be used to determine the amount of currently
- consumed input in bits.
-
- The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
- end of each deflate block header is reached, before any actual data in that
- block is decoded. This allows the caller to determine the length of the
- deflate block header for later use in random access within a deflate block.
- 256 is added to the value of strm->data_type when inflate() returns
- immediately after reaching the end of the deflate block header.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step (a
- single call of inflate), the parameter flush should be set to Z_FINISH. In
- this case all pending input is processed and all pending output is flushed;
- avail_out must be large enough to hold all the uncompressed data. (The size
- of the uncompressed data may have been saved by the compressor for this
- purpose.) The next operation on this stream must be inflateEnd to deallocate
- the decompression state. The use of Z_FINISH is never required, but can be
- used to inform inflate that a faster approach may be used for the single
- inflate() call.
-
- In this implementation, inflate() always flushes as much output as
- possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
- is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK or Z_TREES is used.
-
- If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the adler32 checksum of the dictionary
- chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the adler32 checksum of all output produced so far (that is,
- total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
- checksum is equal to that saved by the compressor and returns Z_STREAM_END
- only if the checksum is correct.
-
- inflate() can decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically, if requested when
- initializing with inflateInit2(). Any information contained in the gzip
- header is not retained, so applications that need that information should
- instead use raw inflate, see inflateInit2() below, or inflateBack() and
- perform their own processing of the gzip header and trailer.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect check
- value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
- inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may
- then call inflateSync() to look for a good compression block if a partial
- recovery of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by the
- caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
- with no zlib header or trailer, and will not compute an adler32 check value.
-
- windowBits can also be greater than 15 for optional gzip encoding. Add
- 16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero), no
- header crc, and the operating system will be set to 255 (unknown). If a
- gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but is
- slow and reduces compression ratio; memLevel=9 uses maximum memory for
- optimal speed. The default value is 8. See zconf.h for total memory usage
- as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
- coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
- fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
- strategy parameter only affects the compression ratio but not the
- correctness of the compressed output even if it is not set appropriately.
- Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
- decoder for special applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
- method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
- incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
- set to null if there is no error message. deflateInit2 does not perform any
- compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any call
- of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size
- provided in deflateInit or deflateInit2. Thus the strings most likely to be
- useful should be put at the end of the dictionary, not at the front. In
- addition, the current implementation of deflate will use at most the window
- size minus 262 bytes of the provided dictionary.
-
- Upon return of this function, strm->adler is set to the adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.) If a raw deflate was requested, then the
- adler32 value is not computed and strm->adler is not set.
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and can
- consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state. The
- stream will keep the same compression level and any other attributes that
- may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different strategy.
- If the compression level is changed, the input available so far is
- compressed with the old level (and may be flushed); the new level will take
- effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to be
- compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
- strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
-/*
- Fine tune deflate's internal compression parameters. This should only be
- used by someone who understands the algorithm used by zlib's deflate for
- searching for the best matching string, and even then only by the most
- fanatic optimizer trying to squeeze out the last compressed bit for their
- specific input data. Read the deflate.c source code for the meaning of the
- max_lazy, good_length, nice_length, and max_chain parameters.
-
- deflateTune() can be called after deflateInit() or deflateInit2(), and
- returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
-/*
- deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit() or
- deflateInit2(), and after deflateSetHeader(), if used. This would be used
- to allocate an output buffer for deflation in a single pass, and so would be
- called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the bits
- leftover from a previous deflate stream when appending to it. As such, this
- function can only be used for raw deflate, and must be used before the first
- deflate() call after a deflateInit2() or deflateReset(). bits must be less
- than or equal to 16, and that many of the least significant bits of value
- will be inserted in the output.
-
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- deflateSetHeader() provides gzip header information for when a gzip
- stream is requested by deflateInit2(). deflateSetHeader() may be called
- after deflateInit2() or deflateReset() and before the first call of
- deflate(). The text, time, os, extra field, name, and comment information
- in the provided gz_header structure are written to the gzip header (xflag is
- ignored -- the extra flags are set according to the compression level). The
- caller must assure that, if not Z_NULL, name and comment are terminated with
- a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
- available there. If hcrc is true, a gzip header crc is included. Note that
- the current versions of the command-line version of gzip (up through version
- 1.3.x) do not support header crc's, and will report that it is a "multi-part
- gzip file" and give up.
-
- If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
-
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
- provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
- size is given as input, inflate() will return with the error code
- Z_DATA_ERROR instead of trying to allocate a larger window.
-
- windowBits can also be zero to request that inflate use the window size in
- the zlib header of the compressed stream.
-
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
- not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
- is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
- format is developed using the raw deflate format for compressed data, it is
- recommended that a check value such as an adler32 or a crc32 be applied to
- the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
- above on the use in deflateInit2() applies to the magnitude of windowBits.
-
- windowBits can also be greater than 15 for optional gzip decoding. Add
- 32 to windowBits to enable zlib and gzip decoding with automatic header
- detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
- crc32 instead of an adler32.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit2 does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit2() does not process any header information -- that is
- deferred until inflate() is called.
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the adler32 value returned by that call of inflate.
- The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called
- immediately after inflateInit2() or inflateReset() and before any call of
- inflate() to set the dictionary. The application must insure that the
- dictionary that was used for compression is provided.
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been
- found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the
- success case, the application may save the current current value of total_in
- which indicates where valid compressed data was found. In the error case,
- the application may repeatedly call inflateSync, providing more input each
- time, until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when randomly accessing a large stream. The
- first pass through the stream can periodically record the inflate state,
- allowing restarting inflate at those points when randomly accessing the
- stream.
-
- inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state. The
- stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
- int windowBits));
-/*
- This function is the same as inflateReset, but it also permits changing
- the wrap and window size requests. The windowBits parameter is interpreted
- the same as it is for inflateInit2.
-
- inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL), or if
- the windowBits parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- If bits is negative, then the input stream bit buffer is emptied. Then
- inflatePrime() can be called again to put bits in the buffer. This is used
- to clear out bits leftover after feeding inflate a block description prior
- to feeding inflate codes.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
-/*
- This function returns two values, one in the lower 16 bits of the return
- value, and the other in the remaining upper bits, obtained by shifting the
- return value down 16 bits. If the upper value is -1 and the lower value is
- zero, then inflate() is currently decoding information outside of a block.
- If the upper value is -1 and the lower value is non-zero, then inflate is in
- the middle of a stored block, with the lower value equaling the number of
- bytes from the input remaining to copy. If the upper value is not -1, then
- it is the number of bits back from the current bit position in the input of
- the code (literal or length/distance pair) currently being processed. In
- that case the lower value is the number of bytes already emitted for that
- code.
-
- A code is being processed if inflate is waiting for more input to complete
- decoding of the code, or if it has completed decoding but is waiting for
- more output space to write the literal or match data.
-
- inflateMark() is used to mark locations in the input data for random
- access, which may be at bit positions, and to note those cases where the
- output of a code may span boundaries of random access blocks. The current
- location in the input stream can be determined from avail_in and data_type
- as noted in the description for the Z_BLOCK flush parameter for inflate.
-
- inflateMark returns the value noted above or -1 << 16 if the provided
- source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- inflateGetHeader() requests that gzip header information be stored in the
- provided gz_header structure. inflateGetHeader() may be called after
- inflateInit2() or inflateReset(), and before the first call of inflate().
- As inflate() processes the gzip stream, head->done is zero until the header
- is completed, at which time head->done is set to one. If a zlib stream is
- being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
- used to force inflate() to return immediately after header processing is
- complete and before any actual data is decompressed.
-
- The text, time, xflags, and os fields are filled in with the gzip header
- contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
- contains the maximum number of bytes to write to extra. Once done is true,
- extra_len contains the actual extra field length, and extra contains the
- extra field, or that field truncated if extra_max is less than extra_len.
- If name is not Z_NULL, then up to name_max characters are written there,
- terminated with a zero unless the length is greater than name_max. If
- comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When any
- of extra, name, or comment are not Z_NULL and the respective field is not
- present in the header, then that field is set to Z_NULL to signal its
- absence. This allows the use of deflateSetHeader() with the returned
- structure to duplicate the header. However if those fields are set to
- allocated memory, then the application will need to save those pointers
- elsewhere so that they can be eventually freed.
-
- If inflateGetHeader is not used, then the header information is simply
- discarded. The header is always checked for validity, including the header
- CRC if present. inflateReset() will reset the process to discard the header
- information. The application would need to call inflateGetHeader() again to
- retrieve the header from the next gzip stream.
-
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-
- Initialize the internal stream state for decompression using inflateBack()
- calls. The fields zalloc, zfree and opaque in strm must be initialized
- before the call. If zalloc and zfree are Z_NULL, then the default library-
- derived memory allocation routines are used. windowBits is the base two
- logarithm of the window size, in the range 8..15. window is a caller
- supplied buffer of that size. Except for special applications where it is
- assured that deflate was used with small window sizes, windowBits must be 15
- and a 32K byte window must be supplied to be able to decompress general
- deflate streams.
-
- See inflateBack() for the usage of these routines.
-
- inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
- allocated, or Z_VERSION_ERROR if the version of the library does not match
- the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-/*
- inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is more efficient than inflate() for
- file i/o applications in that it avoids copying between the output and the
- sliding window by simply making the window itself the output buffer. This
- function trusts the application to not change the output buffer passed by
- the output function, at least until inflateBack() returns.
-
- inflateBackInit() must be called first to allocate the internal state
- and to initialize the state with the user-provided window buffer.
- inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free the
- allocated state.
-
- A raw deflate stream is one with no zlib or gzip header or trailer.
- This routine would normally be used in a utility that reads zip or gzip
- files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects only
- the raw deflate stream to decompress. This is different from the normal
- behavior of inflate(), which expects either a zlib or gzip header and
- trailer around the deflate stream.
-
- inflateBack() uses two subroutines supplied by the caller that are then
- called by inflateBack() for input and output. inflateBack() calls those
- routines until it reads a complete deflate stream and writes out all of the
- uncompressed data, or until it encounters an error. The function's
- parameters and return types are defined above in the in_func and out_func
- typedefs. inflateBack() will call in(in_desc, &buf) which should return the
- number of bytes of provided input, and a pointer to that input in buf. If
- there is no input available, in() must return zero--buf is ignored in that
- case--and inflateBack() will return a buffer error. inflateBack() will call
- out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
- should return zero on success, or non-zero on failure. If out() returns
- non-zero, inflateBack() will return with an error. Neither in() nor out()
- are permitted to change the contents of the window provided to
- inflateBackInit(), which is also the buffer that out() uses to write from.
- The length written by out() will be at most the window size. Any non-zero
- amount of input may be provided by in().
-
- For convenience, inflateBack() can be provided input on the first call by
- setting strm->next_in and strm->avail_in. If that input is exhausted, then
- in() will be called. Therefore strm->next_in must be initialized before
- calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
- immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
- must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
- The in_desc and out_desc parameters of inflateBack() is passed as the
- first parameter of in() and out() respectively when they are called. These
- descriptors can be optionally used to pass any information that the caller-
- supplied in() and out() functions need to do their job.
-
- On return, inflateBack() will set strm->next_in and strm->avail_in to
- pass back any unused input that was provided by the last in() call. The
- return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format error
- in the deflate stream (in which case strm->msg is set to indicate the nature
- of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
- In the case of Z_BUF_ERROR, an input or output error can be distinguished
- using strm->next_in which will be Z_NULL only if in() returned an error. If
- strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
- non-zero. (in() will always be called before out(), so strm->next_in is
- assured to be defined if out() returns non-zero.) Note that inflateBack()
- cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
- All memory allocated by inflateBackInit() is freed.
-
- inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
- state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
- Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
- 1.0: size of uInt
- 3.2: size of uLong
- 5.4: size of voidpf (pointer)
- 7.6: size of z_off_t
-
- Compiler, assembler, and debug options:
- 8: DEBUG
- 9: ASMV or ASMINF -- use ASM code
- 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
- 11: 0 (reserved)
-
- One-time table building (smaller code, but not thread-safe if true):
- 12: BUILDFIXED -- build static block decoding tables when needed
- 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
- 14,15: 0 (reserved)
-
- Library content (indicates missing functionality):
- 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
- deflate code when not needed)
- 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
- and decode gzip streams (to avoid linking crc code)
- 18-19: 0 (reserved)
-
- Operation variations (changes in library functionality):
- 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
- 21: FASTEST -- deflate algorithm with only one, lowest compression level
- 22,23: 0 (reserved)
-
- The sprintf variant used by gzprintf (zero is best):
- 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
- 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
- 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
- Remainder:
- 27-31: 0 (reserved)
- */
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the basic
- stream-oriented functions. To simplify the interface, some default options
- are assumed (compression level and memory usage, standard memory allocation
- functions). The source code of these utility functions can be modified if
- you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
- compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before a
- compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be large enough to hold the entire
- uncompressed data. (The size of the uncompressed data must have been saved
- previously by the compressor and transmitted to the decompressor by some
- mechanism outside the scope of this compression library.) Upon exit, destLen
- is the actual size of the uncompressed buffer.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
- /* gzip file access functions */
-
-/*
- This library supports reading and writing files in gzip (.gz) format with
- an interface similar to that of stdio, using the functions that start with
- "gz". The gzip format is different from the zlib format. gzip is a gzip
- wrapper, documented in RFC 1952, wrapped around a deflate stream.
-*/
-
-typedef voidp gzFile; /* opaque gzip file descriptor */
-
-/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-
- Opens a gzip (.gz) file for reading or writing. The mode parameter is as
- in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
- a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
- compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
- for fixed code compression as in "wb9F". (See the description of
- deflateInit2 for more information about the strategy parameter.) Also "a"
- can be used instead of "w" to request that the gzip stream that will be
- written be appended to the file. "+" will result in an error, since reading
- and writing to the same gzip file is not supported.
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened, if there was
- insufficient memory to allocate the gzFile state, or if an invalid mode was
- specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
- errno can be checked to determine if the reason gzopen failed was that the
- file could not be opened.
-*/
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen associates a gzFile with the file descriptor fd. File descriptors
- are obtained from calls like open, dup, creat, pipe or fileno (if the file
- has been previously opened with fopen). The mode parameter is as in gzopen.
-
- The next call of gzclose on the returned gzFile will also close the file
- descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
- fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
- mode);. The duplicated descriptor should be saved to avoid a leak, since
- gzdopen does not close fd if it fails.
-
- gzdopen returns NULL if there was insufficient memory to allocate the
- gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
- provided, or '+' was provided), or if fd is -1. The file descriptor is not
- used until the next gz* read, write, seek, or close operation, so gzdopen
- will not detect if fd is invalid (unless fd is -1).
-*/
-
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
-/*
- Set the internal buffer size used by this library's functions. The
- default buffer size is 8192 bytes. This function must be called after
- gzopen() or gzdopen(), and before any other calls that read or write the
- file. The buffer memory allocation is always deferred to the first read or
- write. Two buffers are allocated, either both of the specified size when
- writing, or one of the specified size and the other twice that size when
- reading. A larger buffer size of, for example, 64K or 128K bytes will
- noticeably increase the speed of decompression (reading).
-
- The new buffer size also affects the maximum length for gzprintf().
-
- gzbuffer() returns 0 on success, or -1 on failure, such as being called
- too late.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
-
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file. If
- the input file was not in gzip format, gzread copies the given number of
- bytes into the buffer.
-
- After reaching the end of a gzip stream in the input, gzread will continue
- to read, looking for another gzip stream, or failing that, reading the rest
- of the input file directly without decompression. The entire input file
- will be read if gzread is called until it returns less than the requested
- len.
-
- gzread returns the number of uncompressed bytes actually read, less than
- len for end of file, or -1 for error.
-*/
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes written or 0 in case of
- error.
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the arguments to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written, or 0 in case of error. The number of
- uncompressed bytes written is limited to 8191, or one less than the buffer
- size given to gzbuffer(). The caller should assure that this limit is not
- exceeded. If it is exceeded, then gzprintf() will return an error (0) with
- nothing written. In this case, there may also be a buffer overflow with
- unpredictable consequences, which is possible only if zlib was compiled with
- the insecure functions sprintf() or vsprintf() because the secure snprintf()
- or vsnprintf() functions were not available. This can be determined using
- zlibCompileFlags().
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
-
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or a
- newline character is read and transferred to buf, or an end-of-file
- condition is encountered. If any characters are read or if len == 1, the
- string is terminated with a null character. If no characters are read due
- to an end-of-file or len < 1, then the buffer is left untouched.
-
- gzgets returns buf which is a null-terminated string, or it returns NULL
- for end-of-file or in case of error. If there was an error, the contents at
- buf are indeterminate.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file. gzputc
- returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte or -1
- in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
- Push one character back onto the stream to be read as the first character
- on the next read. At least one character of push-back is allowed.
- gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
- fail if c is -1, and may fail if a character has been pushed but not read
- yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
- output buffer size of pushed characters is allowed. (See gzbuffer above.)
- The pushed character will be discarded if the stream is repositioned with
- gzseek() or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter flush
- is as in the deflate() function. The return value is the zlib error number
- (see function gzerror below). gzflush is only permitted when writing.
-
- If the flush parameter is Z_FINISH, the remaining data is written and the
- gzip stream is completed in the output. If gzwrite() is called again, a new
- gzip stream will be started in the output. gzread() is able to read such
- concatented gzip streams.
-
- gzflush should be called only when strictly necessary because it will
- degrade compression if called too often.
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-
- Sets the starting position for the next gzread or gzwrite on the given
- compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
-
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-
- Returns the starting position for the next gzread or gzwrite on the given
- compressed file. This position represents a number of bytes in the
- uncompressed data stream, and is zero when starting, even if appending or
- reading a gzip stream from the middle of a file using gzdopen().
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
-
- Returns the current offset in the file being read or written. This offset
- includes the count of bytes that precede the gzip stream, for example when
- appending or when using gzdopen() for reading. When reading, the offset
- does not include as yet unused buffered input. This information can be used
- for a progress indicator. On error, gzoffset() returns -1.
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns true (1) if the end-of-file indicator has been set while reading,
- false (0) otherwise. Note that the end-of-file indicator is set only if the
- read tried to go past the end of the input, but came up short. Therefore,
- just like feof(), gzeof() may return false even if there is no more data to
- read, in the event that the last read request was for the exact number of
- bytes remaining in the input file. This will happen if the input file size
- is an exact multiple of the buffer size.
-
- If gzeof() returns true, then the read functions will return no more data,
- unless the end-of-file indicator is reset by gzclearerr() and the input file
- has grown since the previous end of file was detected.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
- Returns true (1) if file is being copied directly while reading, or false
- (0) if file is a gzip stream being decompressed. This state can change from
- false to true while reading the input file if the end of a gzip stream is
- reached, but is followed by data that is not another gzip stream.
-
- If the input file is empty, gzdirect() will return true, since the input
- does not contain a gzip stream.
-
- If gzdirect() is used immediately after gzopen() or gzdopen() it will
- cause buffers to be allocated to allow reading the file to determine if it
- is a gzip file. Therefore if gzbuffer() is used, it should be called before
- gzdirect().
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file and
- deallocates the (de)compression state. Note that once file is closed, you
- cannot call gzerror with file, since its structures have been deallocated.
- gzclose must not be called more than once on the same file, just as free
- must not be called more than once on the same allocation.
-
- gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
- file operation error, or Z_OK on success.
-*/
-
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
-/*
- Same as gzclose(), but gzclose_r() is only for use when reading, and
- gzclose_w() is only for use when writing or appending. The advantage to
- using these instead of gzclose() is that they avoid linking in zlib
- compression or decompression code that is not used when only reading or only
- writing respectively. If gzclose() is used, then both compression and
- decompression code will be included the application when linking to a static
- zlib library.
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the given
- compressed file. errnum is set to zlib error number. If an error occurred
- in the file system and not in the compression library, errnum is set to
- Z_ERRNO and the application may consult errno to get the exact error code.
-
- The application must not modify the returned string. Future calls to
- this function may invalidate the previously returned string. If file is
- closed, then the string previously returned by gzerror will no longer be
- available.
-
- gzerror() should be used to distinguish errors from end-of-file for those
- functions above that do not distinguish those cases in their return values.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
- file that is being written concurrently.
-*/
-
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the compression
- library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is Z_NULL, this function returns the
- required initial value for the checksum.
-
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster.
-
- Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
-
- Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
- and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
- each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is Z_NULL, this function returns the required
- initial value for the for the crc. Pre- and post-conditioning (one's
- complement) is performed within this function so it shouldn't be done by the
- application.
-
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
- Combine two CRC-32 check values into one. For two sequences of bytes,
- seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
- calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
- check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
- inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
-
-/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
- * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
- * both are true, the application gets the *64 functions, and the regular
- * functions are changed to 64 bits) -- in case these are set on systems
- * without large file support, _LFS64_LARGEFILE must also be true
- */
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
-#endif
-
-#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
-# define gzopen gzopen64
-# define gzseek gzseek64
-# define gztell gztell64
-# define gzoffset gzoffset64
-# define adler32_combine adler32_combine64
-# define crc32_combine crc32_combine64
-# ifdef _LARGEFILE64_SOURCE
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-# endif
-#else
- ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-#endif
-
-/* hack for buggy compilers */
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;};
-#endif
-
-/* undocumented functions */
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/code/minizip/zutil.h b/code/minizip/zutil.h
deleted file mode 100644
index a36a406..0000000
--- a/code/minizip/zutil.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZUTIL_H
-#define ZUTIL_H
-
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
-# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-# define ZLIB_INTERNAL
-#endif
-
-#include "zlib.h"
-
-#ifdef STDC
-# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
-# include
-# endif
-# include
-# include
-#endif
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long ulg;
-
-extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
-/* (size given to avoid silly warnings with Visual C++) */
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-
-#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
- /* common constants */
-
-#ifndef DEF_WBITS
-# define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-# define DEF_MEM_LEVEL 8
-#else
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES 2
-/* The three kinds of block type */
-
-#define MIN_MATCH 3
-#define MAX_MATCH 258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
- /* target dependencies */
-
-#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
-# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
-# else
-# include
-# endif
-# else /* MSC or DJGPP */
-# include
-# endif
-#endif
-
-#ifdef AMIGA
-# define OS_CODE 0x01
-#endif
-
-#if defined(VAXC) || defined(VMS)
-# define OS_CODE 0x02
-# define F_OPEN(name, mode) \
- fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
-#endif
-
-#if defined(ATARI) || defined(atarist)
-# define OS_CODE 0x05
-#endif
-
-#ifdef OS2
-# define OS_CODE 0x06
-# ifdef M_I86
-# include
-# endif
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-#endif
-
-#ifdef TOPS20
-# define OS_CODE 0x0a
-#endif
-
-#ifdef WIN32
-# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
-# define OS_CODE 0x0b
-# endif
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-# define OS_CODE 0x0f
-#endif
-
-#if defined(_BEOS_) || defined(RISCOS)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
-# if defined(_WIN32_WCE)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# ifndef _PTRDIFF_T_DEFINED
- typedef int ptrdiff_t;
-# define _PTRDIFF_T_DEFINED
-# endif
-# else
-# define fdopen(fd,type) _fdopen(fd,type)
-# endif
-#endif
-
-#if defined(__BORLANDC__)
- #pragma warn -8004
- #pragma warn -8008
- #pragma warn -8066
-#endif
-
-/* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-#endif
-
- /* common defaults */
-
-#ifndef OS_CODE
-# define OS_CODE 0x03 /* assume Unix */
-#endif
-
-#ifndef F_OPEN
-# define F_OPEN(name, mode) fopen((name), (mode))
-#endif
-
- /* functions */
-
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#if defined(__CYGWIN__)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#ifndef HAVE_VSNPRINTF
-# ifdef MSDOS
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
-# define NO_vsnprintf
-# endif
-# ifdef __TURBOC__
-# define NO_vsnprintf
-# endif
-# ifdef WIN32
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-# if !defined(vsnprintf) && !defined(NO_vsnprintf)
-# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-# define vsnprintf _vsnprintf
-# endif
-# endif
-# endif
-# ifdef __SASC
-# define NO_vsnprintf
-# endif
-#endif
-#ifdef VMS
-# define NO_vsnprintf
-#endif
-
-#if defined(pyr)
-# define NO_MEMCPY
-#endif
-#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
- * You may have to use the same strategy for Borland C (untested).
- * The __SC__ check is for Symantec.
- */
-# define NO_MEMCPY
-#endif
-#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
-# define HAVE_MEMCPY
-#endif
-#ifdef HAVE_MEMCPY
-# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
-# define zmemcpy _fmemcpy
-# define zmemcmp _fmemcmp
-# define zmemzero(dest, len) _fmemset(dest, 0, len)
-# else
-# define zmemcpy memcpy
-# define zmemcmp memcmp
-# define zmemzero(dest, len) memset(dest, 0, len)
-# endif
-#else
- void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
-#endif
-
-/* Diagnostic functions */
-#ifdef DEBUG
-# include
- extern int ZLIB_INTERNAL z_verbose;
- extern void ZLIB_INTERNAL z_error OF((char *m));
-# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-# define Trace(x) {if (z_verbose>=0) fprintf x ;}
-# define Tracev(x) {if (z_verbose>0) fprintf x ;}
-# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
-#endif
-
-
-voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
- unsigned size));
-void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
-
-#define ZALLOC(strm, items, size) \
- (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
-#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-
-#endif /* ZUTIL_H */
diff --git a/code/mysql/big_endian.h b/code/mysql/big_endian.h
deleted file mode 100644
index ef36402..0000000
--- a/code/mysql/big_endian.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include
-
-/*
- Data in big-endian format.
-*/
-static inline void float4store(uchar *T, float A)
-{ *(T)= ((uchar *) &A)[3];
- *((T)+1)=(char) ((uchar *) &A)[2];
- *((T)+2)=(char) ((uchar *) &A)[1];
- *((T)+3)=(char) ((uchar *) &A)[0]; }
-
-static inline void float4get (float *V, const uchar *M)
-{ float def_temp;
- ((uchar*) &def_temp)[0]=(M)[3];
- ((uchar*) &def_temp)[1]=(M)[2];
- ((uchar*) &def_temp)[2]=(M)[1];
- ((uchar*) &def_temp)[3]=(M)[0];
- (*V)=def_temp; }
-
-static inline void float8store(uchar *T, double V)
-{ *(T)= ((uchar *) &V)[7];
- *((T)+1)=(char) ((uchar *) &V)[6];
- *((T)+2)=(char) ((uchar *) &V)[5];
- *((T)+3)=(char) ((uchar *) &V)[4];
- *((T)+4)=(char) ((uchar *) &V)[3];
- *((T)+5)=(char) ((uchar *) &V)[2];
- *((T)+6)=(char) ((uchar *) &V)[1];
- *((T)+7)=(char) ((uchar *) &V)[0]; }
-
-static inline void float8get (double *V, const uchar *M)
-{ double def_temp;
- ((uchar*) &def_temp)[0]=(M)[7];
- ((uchar*) &def_temp)[1]=(M)[6];
- ((uchar*) &def_temp)[2]=(M)[5];
- ((uchar*) &def_temp)[3]=(M)[4];
- ((uchar*) &def_temp)[4]=(M)[3];
- ((uchar*) &def_temp)[5]=(M)[2];
- ((uchar*) &def_temp)[6]=(M)[1];
- ((uchar*) &def_temp)[7]=(M)[0];
- (*V) = def_temp; }
-
-static inline void ushortget(uint16 *V, const uchar *pM)
-{ *V = (uint16) (((uint16) ((uchar) (pM)[1]))+
- ((uint16) ((uint16) (pM)[0]) << 8)); }
-static inline void shortget (int16 *V, const uchar *pM)
-{ *V = (short) (((short) ((uchar) (pM)[1]))+
- ((short) ((short) (pM)[0]) << 8)); }
-static inline void longget (int32 *V, const uchar *pM)
-{ int32 def_temp;
- ((uchar*) &def_temp)[0]=(pM)[0];
- ((uchar*) &def_temp)[1]=(pM)[1];
- ((uchar*) &def_temp)[2]=(pM)[2];
- ((uchar*) &def_temp)[3]=(pM)[3];
- (*V)=def_temp; }
-static inline void ulongget (uint32 *V, const uchar *pM)
-{ uint32 def_temp;
- ((uchar*) &def_temp)[0]=(pM)[0];
- ((uchar*) &def_temp)[1]=(pM)[1];
- ((uchar*) &def_temp)[2]=(pM)[2];
- ((uchar*) &def_temp)[3]=(pM)[3];
- (*V)=def_temp; }
-static inline void shortstore(uchar *T, int16 A)
-{ uint def_temp=(uint) (A) ;
- *(((char*)T)+1)=(char)(def_temp);
- *(((char*)T)+0)=(char)(def_temp >> 8); }
-static inline void longstore (uchar *T, int32 A)
-{ *(((char*)T)+3)=((A));
- *(((char*)T)+2)=(((A) >> 8));
- *(((char*)T)+1)=(((A) >> 16));
- *(((char*)T)+0)=(((A) >> 24)); }
-
-static inline void floatget(float *V, const uchar *M)
-{
- memcpy(V, (M), sizeof(float));
-}
-
-static inline void floatstore(uchar *T, float V)
-{
- memcpy((T), (&V), sizeof(float));
-}
-
-static inline void doubleget(double *V, const uchar *M)
-{
- memcpy(V, (M), sizeof(double));
-}
-
-static inline void doublestore(uchar *T, double V)
-{
- memcpy((T), &V, sizeof(double));
-}
-
-static inline void longlongget(longlong *V, const uchar *M)
-{
- memcpy(V, (M), sizeof(ulonglong));
-}
-static inline void longlongstore(uchar *T, longlong V)
-{
- memcpy((T), &V, sizeof(ulonglong));
-}
diff --git a/code/mysql/binary_log_types.h b/code/mysql/binary_log_types.h
deleted file mode 100644
index 7d04c55..0000000
--- a/code/mysql/binary_log_types.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file binary_log_types.h
-
- @brief This file contains the field type.
-
-
- @note This file can be imported both from C and C++ code, so the
- definitions have to be constructed to support this.
-*/
-
-#ifndef BINARY_LOG_TYPES_INCLUDED
-#define BINARY_LOG_TYPES_INCLUDED
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/*
- * Constants exported from this package.
- */
-
-typedef enum enum_field_types {
- MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
- MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
- MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
- MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
- MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
- MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
- MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
- MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
- MYSQL_TYPE_BIT,
- MYSQL_TYPE_TIMESTAMP2,
- MYSQL_TYPE_DATETIME2,
- MYSQL_TYPE_TIME2,
- MYSQL_TYPE_JSON=245,
- MYSQL_TYPE_NEWDECIMAL=246,
- MYSQL_TYPE_ENUM=247,
- MYSQL_TYPE_SET=248,
- MYSQL_TYPE_TINY_BLOB=249,
- MYSQL_TYPE_MEDIUM_BLOB=250,
- MYSQL_TYPE_LONG_BLOB=251,
- MYSQL_TYPE_BLOB=252,
- MYSQL_TYPE_VAR_STRING=253,
- MYSQL_TYPE_STRING=254,
- MYSQL_TYPE_GEOMETRY=255
-} enum_field_types;
-
-#define DATETIME_MAX_DECIMALS 6
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif /* BINARY_LOG_TYPES_INCLUDED */
diff --git a/code/mysql/byte_order_generic.h b/code/mysql/byte_order_generic.h
deleted file mode 100644
index dbf0f5c..0000000
--- a/code/mysql/byte_order_generic.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- Endianness-independent definitions for architectures other
- than the x86 architecture.
-*/
-static inline int16 sint2korr(const uchar *A)
-{
- return
- (int16) (((int16) (A[0])) +
- ((int16) (A[1]) << 8))
- ;
-}
-
-static inline int32 sint4korr(const uchar *A)
-{
- return
- (int32) (((int32) (A[0])) +
- (((int32) (A[1]) << 8)) +
- (((int32) (A[2]) << 16)) +
- (((int32) (A[3]) << 24)))
- ;
-}
-
-static inline uint16 uint2korr(const uchar *A)
-{
- return
- (uint16) (((uint16) (A[0])) +
- ((uint16) (A[1]) << 8))
- ;
-}
-
-static inline uint32 uint4korr(const uchar *A)
-{
- return
- (uint32) (((uint32) (A[0])) +
- (((uint32) (A[1])) << 8) +
- (((uint32) (A[2])) << 16) +
- (((uint32) (A[3])) << 24))
- ;
-}
-
-static inline ulonglong uint8korr(const uchar *A)
-{
- return
- ((ulonglong)(((uint32) (A[0])) +
- (((uint32) (A[1])) << 8) +
- (((uint32) (A[2])) << 16) +
- (((uint32) (A[3])) << 24)) +
- (((ulonglong) (((uint32) (A[4])) +
- (((uint32) (A[5])) << 8) +
- (((uint32) (A[6])) << 16) +
- (((uint32) (A[7])) << 24))) <<
- 32))
- ;
-}
-
-static inline longlong sint8korr(const uchar *A)
-{
- return (longlong) uint8korr(A);
-}
-
-static inline void int2store(uchar *T, uint16 A)
-{
- uint def_temp= A ;
- *(T)= (uchar)(def_temp);
- *(T+1)= (uchar)(def_temp >> 8);
-}
-
-static inline void int4store(uchar *T, uint32 A)
-{
- *(T)= (uchar) (A);
- *(T+1)=(uchar) (A >> 8);
- *(T+2)=(uchar) (A >> 16);
- *(T+3)=(uchar) (A >> 24);
-}
-
-static inline void int8store(uchar *T, ulonglong A)
-{
- uint def_temp= (uint) A,
- def_temp2= (uint) (A >> 32);
- int4store(T, def_temp);
- int4store(T+4,def_temp2);
-}
diff --git a/code/mysql/byte_order_generic_x86.h b/code/mysql/byte_order_generic_x86.h
deleted file mode 100644
index 57e5e3e..0000000
--- a/code/mysql/byte_order_generic_x86.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- Optimized functions for the x86 architecture (_WIN32 included).
-
- x86 handles misaligned reads and writes just fine, so suppress
- UBSAN warnings for these functions.
-*/
-static inline int16 sint2korr(const uchar *A) SUPPRESS_UBSAN;
-static inline int16 sint2korr(const uchar *A) { return *((int16*) A); }
-
-static inline int32 sint4korr(const uchar *A) SUPPRESS_UBSAN;
-static inline int32 sint4korr(const uchar *A) { return *((int32*) A); }
-
-static inline uint16 uint2korr(const uchar *A) SUPPRESS_UBSAN;
-static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); }
-
-static inline uint32 uint4korr(const uchar *A) SUPPRESS_UBSAN;
-static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); }
-
-static inline ulonglong uint8korr(const uchar *A) SUPPRESS_UBSAN;
-static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);}
-
-static inline longlong sint8korr(const uchar *A) SUPPRESS_UBSAN;
-static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); }
-
-static inline void int2store(uchar *T, uint16 A) SUPPRESS_UBSAN;
-static inline void int2store(uchar *T, uint16 A)
-{
- *((uint16*) T)= A;
-}
-
-static inline void int4store(uchar *T, uint32 A) SUPPRESS_UBSAN;
-static inline void int4store(uchar *T, uint32 A)
-{
- *((uint32*) T)= A;
-}
-
-static inline void int8store(uchar *T, ulonglong A) SUPPRESS_UBSAN;
-static inline void int8store(uchar *T, ulonglong A)
-{
- *((ulonglong*) T)= A;
-}
diff --git a/code/mysql/decimal.h b/code/mysql/decimal.h
deleted file mode 100644
index f89a333..0000000
--- a/code/mysql/decimal.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef DECIMAL_INCLUDED
-#define DECIMAL_INCLUDED
-
-typedef enum
-{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
- decimal_round_mode;
-typedef int32 decimal_digit_t;
-
-/**
- intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
- before the point
- frac is the number of decimal digits after the point
- len is the length of buf (length of allocated space) in decimal_digit_t's,
- not in bytes
- sign false means positive, true means negative
- buf is an array of decimal_digit_t's
- */
-typedef struct st_decimal_t {
- int intg, frac, len;
- my_bool sign;
- decimal_digit_t *buf;
-} decimal_t;
-
-#ifndef MYSQL_ABI_CHECK
-int internal_str2dec(const char *from, decimal_t *to, char **end,
- my_bool fixed);
-int decimal2string(const decimal_t *from, char *to, int *to_len,
- int fixed_precision, int fixed_decimals,
- char filler);
-int decimal2ulonglong(decimal_t *from, ulonglong *to);
-int ulonglong2decimal(ulonglong from, decimal_t *to);
-int decimal2longlong(decimal_t *from, longlong *to);
-int longlong2decimal(longlong from, decimal_t *to);
-int decimal2double(const decimal_t *from, double *to);
-int double2decimal(double from, decimal_t *to);
-int decimal_actual_fraction(decimal_t *from);
-int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
-int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
-
-/**
- Convert decimal to lldiv_t.
- The integer part is stored in to->quot.
- The fractional part is multiplied to 10^9 and stored to to->rem.
- @param from Decimal value
- @param to lldiv_t value
- @retval 0 on success
- @retval !0 in error
-*/
-int decimal2lldiv_t(const decimal_t *from, lldiv_t *to);
-
-/**
- Convert doube to lldiv_t.
- The integer part is stored in to->quot.
- The fractional part is multiplied to 10^9 and stored to to->rem.
- @param from Decimal value
- @param to lldiv_t value
- @retval 0 on success
- @retval !0 in error
-*/
-
-int double2lldiv_t(double from, lldiv_t *to);
-int decimal_size(int precision, int scale);
-int decimal_bin_size(int precision, int scale);
-int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
- int param);
-
-int decimal_intg(const decimal_t *from);
-int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
-int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
-int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
-int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
-int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
- int scale_incr);
-int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
-int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
- decimal_round_mode mode);
-int decimal_is_zero(const decimal_t *from);
-void max_decimal(int precision, int frac, decimal_t *to);
-
-#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
-#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
-
-/* set a decimal_t to zero */
-
-#define decimal_make_zero(dec) do { \
- (dec)->buf[0]=0; \
- (dec)->intg=1; \
- (dec)->frac=0; \
- (dec)->sign=0; \
- } while(0)
-
-/*
- returns the length of the buffer to hold string representation
- of the decimal (including decimal dot, possible sign and \0)
-*/
-
-#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
- (dec)->frac + ((dec)->frac > 0) + 2)
-
-/*
- conventions:
-
- decimal_smth() == 0 -- everything's ok
- decimal_smth() <= 1 -- result is usable, but precision loss is possible
- decimal_smth() <= 2 -- result can be unusable, most significant digits
- could've been lost
- decimal_smth() > 2 -- no result was generated
-*/
-
-#define E_DEC_OK 0
-#define E_DEC_TRUNCATED 1
-#define E_DEC_OVERFLOW 2
-#define E_DEC_DIV_ZERO 4
-#define E_DEC_BAD_NUM 8
-#define E_DEC_OOM 16
-
-#define E_DEC_ERROR 31
-#define E_DEC_FATAL_ERROR 30
-
-#endif // !MYSQL_ABI_CHECK
-
-#endif
diff --git a/code/mysql/errmsg.h b/code/mysql/errmsg.h
deleted file mode 100644
index 3029435..0000000
--- a/code/mysql/errmsg.h
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef ERRMSG_INCLUDED
-#define ERRMSG_INCLUDED
-
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/* Error messages for MySQL clients */
-/* (Error messages for the daemon are in sql/share/errmsg.txt) */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void init_client_errs(void);
-void finish_client_errs(void);
-extern const char *client_errors[]; /* Error messages */
-#ifdef __cplusplus
-}
-#endif
-
-#define CR_MIN_ERROR 2000 /* For easier client code */
-#define CR_MAX_ERROR 2999
-#if !defined(ER)
-#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
- client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
-
-#endif
-#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
-
-/* Do not add error numbers before CR_ERROR_FIRST. */
-/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
-#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
-#define CR_UNKNOWN_ERROR 2000
-#define CR_SOCKET_CREATE_ERROR 2001
-#define CR_CONNECTION_ERROR 2002
-#define CR_CONN_HOST_ERROR 2003
-#define CR_IPSOCK_ERROR 2004
-#define CR_UNKNOWN_HOST 2005
-#define CR_SERVER_GONE_ERROR 2006
-#define CR_VERSION_ERROR 2007
-#define CR_OUT_OF_MEMORY 2008
-#define CR_WRONG_HOST_INFO 2009
-#define CR_LOCALHOST_CONNECTION 2010
-#define CR_TCP_CONNECTION 2011
-#define CR_SERVER_HANDSHAKE_ERR 2012
-#define CR_SERVER_LOST 2013
-#define CR_COMMANDS_OUT_OF_SYNC 2014
-#define CR_NAMEDPIPE_CONNECTION 2015
-#define CR_NAMEDPIPEWAIT_ERROR 2016
-#define CR_NAMEDPIPEOPEN_ERROR 2017
-#define CR_NAMEDPIPESETSTATE_ERROR 2018
-#define CR_CANT_READ_CHARSET 2019
-#define CR_NET_PACKET_TOO_LARGE 2020
-#define CR_EMBEDDED_CONNECTION 2021
-#define CR_PROBE_SLAVE_STATUS 2022
-#define CR_PROBE_SLAVE_HOSTS 2023
-#define CR_PROBE_SLAVE_CONNECT 2024
-#define CR_PROBE_MASTER_CONNECT 2025
-#define CR_SSL_CONNECTION_ERROR 2026
-#define CR_MALFORMED_PACKET 2027
-#define CR_WRONG_LICENSE 2028
-
-/* new 4.1 error codes */
-#define CR_NULL_POINTER 2029
-#define CR_NO_PREPARE_STMT 2030
-#define CR_PARAMS_NOT_BOUND 2031
-#define CR_DATA_TRUNCATED 2032
-#define CR_NO_PARAMETERS_EXISTS 2033
-#define CR_INVALID_PARAMETER_NO 2034
-#define CR_INVALID_BUFFER_USE 2035
-#define CR_UNSUPPORTED_PARAM_TYPE 2036
-
-#define CR_SHARED_MEMORY_CONNECTION 2037
-#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
-#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
-#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
-#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
-#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
-#define CR_SHARED_MEMORY_MAP_ERROR 2043
-#define CR_SHARED_MEMORY_EVENT_ERROR 2044
-#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
-#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
-#define CR_CONN_UNKNOW_PROTOCOL 2047
-#define CR_INVALID_CONN_HANDLE 2048
-#define CR_UNUSED_1 2049
-#define CR_FETCH_CANCELED 2050
-#define CR_NO_DATA 2051
-#define CR_NO_STMT_METADATA 2052
-#define CR_NO_RESULT_SET 2053
-#define CR_NOT_IMPLEMENTED 2054
-#define CR_SERVER_LOST_EXTENDED 2055
-#define CR_STMT_CLOSED 2056
-#define CR_NEW_STMT_METADATA 2057
-#define CR_ALREADY_CONNECTED 2058
-#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
-#define CR_DUPLICATE_CONNECTION_ATTR 2060
-#define CR_AUTH_PLUGIN_ERR 2061
-#define CR_INSECURE_API_ERR 2062
-#define CR_ERROR_LAST /*Copy last error nr:*/ 2062
-/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
-
-#endif /* ERRMSG_INCLUDED */
diff --git a/code/mysql/keycache.h b/code/mysql/keycache.h
deleted file mode 100644
index 78fc389..0000000
--- a/code/mysql/keycache.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/* Key cache variable structures */
-
-#ifndef _keycache_h
-#define _keycache_h
-
-#include "my_sys.h" /* flush_type */
-
-C_MODE_START
-
-/* declare structures that is used by st_key_cache */
-
-struct st_block_link;
-typedef struct st_block_link BLOCK_LINK;
-struct st_hash_link;
-typedef struct st_hash_link HASH_LINK;
-
-/* Thread specific variables */
-typedef struct st_keycache_thread_var
-{
- mysql_cond_t suspend;
- struct st_keycache_thread_var *next,**prev;
- void *opt_info;
-} st_keycache_thread_var;
-
-/* info about requests in a waiting queue */
-typedef struct st_keycache_wqueue
-{
- st_keycache_thread_var *last_thread; /* circular list of waiting threads */
-} KEYCACHE_WQUEUE;
-
-#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
-
-/*
- The key cache structure
- It also contains read-only statistics parameters.
-*/
-
-typedef struct st_key_cache
-{
- my_bool key_cache_inited;
- my_bool in_resize; /* true during resize operation */
- my_bool resize_in_flush; /* true during flush of resize operation */
- my_bool can_be_used; /* usage of cache for read/write is allowed */
- size_t key_cache_mem_size; /* specified size of the cache memory */
- uint key_cache_block_size; /* size of the page buffer of a cache block */
- ulonglong min_warm_blocks; /* min number of warm blocks; */
- ulonglong age_threshold; /* age threshold for hot blocks */
- ulonglong keycache_time; /* total number of block link operations */
- uint hash_entries; /* max number of entries in the hash table */
- int hash_links; /* max number of hash links */
- int hash_links_used; /* number of hash links currently used */
- int disk_blocks; /* max number of blocks in the cache */
- ulong blocks_used; /* maximum number of concurrently used blocks */
- ulong blocks_unused; /* number of currently unused blocks */
- ulong blocks_changed; /* number of currently dirty blocks */
- ulong warm_blocks; /* number of blocks in warm sub-chain */
- ulong cnt_for_resize_op; /* counter to block resize operation */
- long blocks_available; /* number of blocks available in the LRU chain */
- HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
- HASH_LINK *hash_link_root; /* memory for hash table links */
- HASH_LINK *free_hash_list; /* list of free hash links */
- BLOCK_LINK *free_block_list; /* list of free blocks */
- BLOCK_LINK *block_root; /* memory for block links */
- uchar *block_mem; /* memory for block buffers */
- BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
- BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
- mysql_mutex_t cache_lock; /* to lock access to the cache structure */
- KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
- /*
- Waiting for a zero resize count. Using a queue for symmetry though
- only one thread can wait here.
- */
- KEYCACHE_WQUEUE waiting_for_resize_cnt;
- KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
- KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */
- BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/
- BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/
-
- /*
- The following variables are and variables used to hold parameters for
- initializing the key cache.
- */
-
- ulonglong param_buff_size; /* size the memory allocated for the cache */
- ulonglong param_block_size; /* size of the blocks in the key cache */
- ulonglong param_division_limit; /* min. percentage of warm blocks */
- ulonglong param_age_threshold; /* determines when hot block is downgraded */
-
- /* Statistics variables. These are reset in reset_key_cache_counters(). */
- ulong global_blocks_changed; /* number of currently dirty blocks */
- ulonglong global_cache_w_requests;/* number of write requests (write hits) */
- ulonglong global_cache_write; /* number of writes from cache to files */
- ulonglong global_cache_r_requests;/* number of read requests (read hits) */
- ulonglong global_cache_read; /* number of reads from files to cache */
-
- int blocks; /* max number of blocks in the cache */
- my_bool in_init; /* Set to 1 in MySQL during init/resize */
-} KEY_CACHE;
-
-/* The default key cache */
-extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
-
-extern int init_key_cache(KEY_CACHE *keycache, ulonglong key_cache_block_size,
- size_t use_mem, ulonglong division_limit,
- ulonglong age_threshold);
-extern int resize_key_cache(KEY_CACHE *keycache,
- st_keycache_thread_var *thread_var,
- ulonglong key_cache_block_size,
- size_t use_mem, ulonglong division_limit,
- ulonglong age_threshold);
-extern uchar *key_cache_read(KEY_CACHE *keycache,
- st_keycache_thread_var *thread_var,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length,int return_buffer);
-extern int key_cache_insert(KEY_CACHE *keycache,
- st_keycache_thread_var *thread_var,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length);
-extern int key_cache_write(KEY_CACHE *keycache,
- st_keycache_thread_var *thread_var,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length,int force_write);
-extern int flush_key_blocks(KEY_CACHE *keycache,
- st_keycache_thread_var *thread_var,
- int file, enum flush_type type);
-extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
-
-/* Functions to handle multiple key caches */
-extern my_bool multi_keycache_init(void);
-extern void multi_keycache_free(void);
-extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
-extern my_bool multi_key_cache_set(const uchar *key, uint length,
- KEY_CACHE *key_cache);
-extern void multi_key_cache_change(KEY_CACHE *old_data,
- KEY_CACHE *new_data);
-extern int reset_key_cache_counters(const char *name,
- KEY_CACHE *key_cache);
-C_MODE_END
-#endif /* _keycache_h */
diff --git a/code/mysql/little_endian.h b/code/mysql/little_endian.h
deleted file mode 100644
index 2bccb22..0000000
--- a/code/mysql/little_endian.h
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef LITTLE_ENDIAN_INCLUDED
-#define LITTLE_ENDIAN_INCLUDED
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- Data in little-endian format.
-*/
-
-#include
-
-static inline void float4get (float *V, const uchar *M)
-{
- memcpy(V, (M), sizeof(float));
-}
-
-static inline void float4store(uchar *V, float M)
-{
- memcpy(V, (&M), sizeof(float));
-}
-
-static inline void float8get (double *V, const uchar *M)
-{
- memcpy(V, M, sizeof(double));
-}
-
-static inline void float8store(uchar *V, double M)
-{
- memcpy(V, &M, sizeof(double));
-}
-
-static inline void floatget (float *V, const uchar *M) { float4get(V, M); }
-static inline void floatstore (uchar *V, float M) { float4store(V, M); }
-
-/* Bi-endian hardware.... */
-#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
-static inline void doublestore(uchar *T, double V)
-{ *(((char*)T)+0)=(char) ((uchar *) &V)[4];
- *(((char*)T)+1)=(char) ((uchar *) &V)[5];
- *(((char*)T)+2)=(char) ((uchar *) &V)[6];
- *(((char*)T)+3)=(char) ((uchar *) &V)[7];
- *(((char*)T)+4)=(char) ((uchar *) &V)[0];
- *(((char*)T)+5)=(char) ((uchar *) &V)[1];
- *(((char*)T)+6)=(char) ((uchar *) &V)[2];
- *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }
-static inline void doubleget(double *V, const uchar *M)
-{ double def_temp;
- ((uchar*) &def_temp)[0]=(M)[4];
- ((uchar*) &def_temp)[1]=(M)[5];
- ((uchar*) &def_temp)[2]=(M)[6];
- ((uchar*) &def_temp)[3]=(M)[7];
- ((uchar*) &def_temp)[4]=(M)[0];
- ((uchar*) &def_temp)[5]=(M)[1];
- ((uchar*) &def_temp)[6]=(M)[2];
- ((uchar*) &def_temp)[7]=(M)[3];
- (*V) = def_temp; }
-
-#else /* Bi-endian hardware.... */
-
-static inline void doublestore(uchar *T, double V) { memcpy(T, &V, sizeof(double)); }
-static inline void doubleget (double *V, const uchar *M) { memcpy(V, M, sizeof(double)); }
-
-#endif /* Bi-endian hardware.... */
-
-static inline void ushortget(uint16 *V, const uchar *pM) { *V= uint2korr(pM); }
-static inline void shortget (int16 *V, const uchar *pM) { *V= sint2korr(pM); }
-static inline void longget (int32 *V, const uchar *pM) { *V= sint4korr(pM); }
-static inline void ulongget (uint32 *V, const uchar *pM) { *V= uint4korr(pM); }
-static inline void shortstore(uchar *T, int16 V) { int2store(T, V); }
-static inline void longstore (uchar *T, int32 V) { int4store(T, V); }
-
-static inline void longlongget(longlong *V, const uchar *M)
-{
- memcpy(V, (M), sizeof(ulonglong));
-}
-static inline void longlongstore(uchar *T, longlong V)
-{
- memcpy((T), &V, sizeof(ulonglong));
-}
-
-#endif /* LITTLE_ENDIAN_INCLUDED */
diff --git a/code/mysql/m_ctype.h b/code/mysql/m_ctype.h
deleted file mode 100644
index 6d9a1a4..0000000
--- a/code/mysql/m_ctype.h
+++ /dev/null
@@ -1,813 +0,0 @@
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- A better inplementation of the UNIX ctype(3) library.
-*/
-
-#ifndef _m_ctype_h
-#define _m_ctype_h
-
-#include "my_global.h" /* uint16, uchar */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MY_CS_NAME_SIZE 32
-#define MY_CS_CTYPE_TABLE_SIZE 257
-#define MY_CS_TO_LOWER_TABLE_SIZE 256
-#define MY_CS_TO_UPPER_TABLE_SIZE 256
-#define MY_CS_SORT_ORDER_TABLE_SIZE 256
-#define MY_CS_TO_UNI_TABLE_SIZE 256
-
-#define CHARSET_DIR "charsets/"
-
-#define my_wc_t ulong
-
-#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD
-
-/*
- On i386 we store Unicode->CS conversion tables for
- some character sets using Big-endian order,
- to copy two bytes at onces.
- This gives some performance improvement.
-*/
-#ifdef __i386__
-#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8))
-#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); }
-#else
-#define MB2(x) (x)
-#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
-#endif
-
-
-
-typedef struct unicase_info_char_st
-{
- uint32 toupper;
- uint32 tolower;
- uint32 sort;
-} MY_UNICASE_CHARACTER;
-
-
-typedef struct unicase_info_st
-{
- my_wc_t maxchar;
- const MY_UNICASE_CHARACTER **page;
-} MY_UNICASE_INFO;
-
-
-extern MY_UNICASE_INFO my_unicase_default;
-extern MY_UNICASE_INFO my_unicase_turkish;
-extern MY_UNICASE_INFO my_unicase_mysql500;
-extern MY_UNICASE_INFO my_unicase_unicode520;
-
-#define MY_UCA_MAX_CONTRACTION 6
-#define MY_UCA_MAX_WEIGHT_SIZE 8
-#define MY_UCA_WEIGHT_LEVELS 1
-
-typedef struct my_contraction_t
-{
- my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */
- uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
- my_bool with_context;
-} MY_CONTRACTION;
-
-
-
-typedef struct my_contraction_list_t
-{
- size_t nitems; /* Number of items in the list */
- MY_CONTRACTION *item; /* List of contractions */
- char *flags; /* Character flags, e.g. "is contraction head") */
-} MY_CONTRACTIONS;
-
-
-my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc);
-my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc);
-uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c,
- my_wc_t wc1, my_wc_t wc2);
-
-
-/* Collation weights on a single level (e.g. primary, secondary, tertiarty) */
-typedef struct my_uca_level_info_st
-{
- my_wc_t maxchar;
- uchar *lengths;
- uint16 **weights;
- MY_CONTRACTIONS contractions;
-} MY_UCA_WEIGHT_LEVEL;
-
-
-typedef struct uca_info_st
-{
- MY_UCA_WEIGHT_LEVEL level[MY_UCA_WEIGHT_LEVELS];
-
- /* Logical positions */
- my_wc_t first_non_ignorable;
- my_wc_t last_non_ignorable;
- my_wc_t first_primary_ignorable;
- my_wc_t last_primary_ignorable;
- my_wc_t first_secondary_ignorable;
- my_wc_t last_secondary_ignorable;
- my_wc_t first_tertiary_ignorable;
- my_wc_t last_tertiary_ignorable;
- my_wc_t first_trailing;
- my_wc_t last_trailing;
- my_wc_t first_variable;
- my_wc_t last_variable;
-
-} MY_UCA_INFO;
-
-
-
-extern MY_UCA_INFO my_uca_v400;
-
-
-typedef struct uni_ctype_st
-{
- uchar pctype;
- uchar *ctype;
-} MY_UNI_CTYPE;
-
-extern MY_UNI_CTYPE my_uni_ctype[256];
-
-/* wm_wc and wc_mb return codes */
-#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
-#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
-#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
-#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
-#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
-/* These following three are currently not really used */
-#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
-#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
-#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
-/* A helper macros for "need at least n bytes" */
-#define MY_CS_TOOSMALLN(n) (-100-(n))
-
-#define MY_SEQ_INTTAIL 1
-#define MY_SEQ_SPACES 2
-
- /* My charsets_list flags */
-#define MY_CS_COMPILED 1 /* compiled-in sets */
-#define MY_CS_CONFIG 2 /* sets that have a *.conf file */
-#define MY_CS_INDEX 4 /* sets listed in the Index file */
-#define MY_CS_LOADED 8 /* sets that are currently loaded */
-#define MY_CS_BINSORT 16 /* if binary sort order */
-#define MY_CS_PRIMARY 32 /* if primary collation */
-#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
-#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */
-#define MY_CS_READY 256 /* if a charset is initialized */
-#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
-#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
-#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
-#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
-#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
-#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
-#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
-#define MY_CHARSET_UNDEFINED 0
-
-/* Character repertoire flags */
-#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
-#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
-#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
-
-/* Flags for strxfrm */
-#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */
-#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */
-#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */
-#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */
-#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */
-#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */
-#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */
-#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/
-
-#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */
-#define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */
-
-#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */
-#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */
-#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */
-#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */
-#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */
-#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */
-#define MY_STRXFRM_DESC_SHIFT 8
-
-#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */
-#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */
-
-#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */
-#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */
-#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */
-#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */
-#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */
-#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
-#define MY_STRXFRM_REVERSE_SHIFT 16
-
-
-typedef struct my_uni_idx_st
-{
- uint16 from;
- uint16 to;
- const uchar *tab;
-} MY_UNI_IDX;
-
-typedef struct
-{
- uint beg;
- uint end;
- uint mb_len;
-} my_match_t;
-
-struct charset_info_st;
-
-typedef struct my_charset_loader_st
-{
- char error[128];
- void *(*once_alloc)(size_t);
- void *(*mem_malloc)(size_t);
- void *(*mem_realloc)(void *, size_t);
- void (*mem_free)(void *);
- void (*reporter)(enum loglevel, const char *format, ...);
- int (*add_collation)(struct charset_info_st *cs);
-} MY_CHARSET_LOADER;
-
-
-extern int (*my_string_stack_guard)(int);
-
-/* See strings/CHARSET_INFO.txt for information about this structure */
-typedef struct my_collation_handler_st
-{
- my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *);
- /* Collation routines */
- int (*strnncoll)(const struct charset_info_st *,
- const uchar *, size_t, const uchar *, size_t, my_bool);
- int (*strnncollsp)(const struct charset_info_st *,
- const uchar *, size_t, const uchar *, size_t,
- my_bool diff_if_only_endspace_difference);
- size_t (*strnxfrm)(const struct charset_info_st *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
- size_t (*strnxfrmlen)(const struct charset_info_st *, size_t);
- my_bool (*like_range)(const struct charset_info_st *,
- const char *s, size_t s_length,
- pchar w_prefix, pchar w_one, pchar w_many,
- size_t res_length,
- char *min_str, char *max_str,
- size_t *min_len, size_t *max_len);
- int (*wildcmp)(const struct charset_info_st *,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape,int w_one, int w_many);
-
- int (*strcasecmp)(const struct charset_info_st *, const char *,
- const char *);
-
- uint (*instr)(const struct charset_info_st *,
- const char *b, size_t b_length,
- const char *s, size_t s_length,
- my_match_t *match, uint nmatch);
-
- /* Hash calculation */
- void (*hash_sort)(const struct charset_info_st *cs, const uchar *key,
- size_t len, ulong *nr1, ulong *nr2);
- my_bool (*propagate)(const struct charset_info_st *cs, const uchar *str,
- size_t len);
-} MY_COLLATION_HANDLER;
-
-extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
-extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
-extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
-extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
-
-/* Some typedef to make it easy for C++ to make function pointers */
-typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st *,
- my_wc_t *, const uchar *, const uchar *);
-typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st *, my_wc_t,
- uchar *, uchar *);
-typedef size_t (*my_charset_conv_case)(const struct charset_info_st *,
- char *, size_t, char *, size_t);
-
-
-/* See strings/CHARSET_INFO.txt about information on this structure */
-typedef struct my_charset_handler_st
-{
- my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader);
- /* Multibyte routines */
- uint (*ismbchar)(const struct charset_info_st *, const char *,
- const char *);
- uint (*mbcharlen)(const struct charset_info_st *, uint c);
- size_t (*numchars)(const struct charset_info_st *, const char *b,
- const char *e);
- size_t (*charpos)(const struct charset_info_st *, const char *b,
- const char *e, size_t pos);
- size_t (*well_formed_len)(const struct charset_info_st *,
- const char *b,const char *e,
- size_t nchars, int *error);
- size_t (*lengthsp)(const struct charset_info_st *, const char *ptr,
- size_t length);
- size_t (*numcells)(const struct charset_info_st *, const char *b,
- const char *e);
-
- /* Unicode conversion */
- my_charset_conv_mb_wc mb_wc;
- my_charset_conv_wc_mb wc_mb;
-
- /* CTYPE scanner */
- int (*ctype)(const struct charset_info_st *cs, int *ctype,
- const uchar *s, const uchar *e);
-
- /* Functions for case and sort conversion */
- size_t (*caseup_str)(const struct charset_info_st *, char *);
- size_t (*casedn_str)(const struct charset_info_st *, char *);
-
- my_charset_conv_case caseup;
- my_charset_conv_case casedn;
-
- /* Charset dependant snprintf() */
- size_t (*snprintf)(const struct charset_info_st *, char *to, size_t n,
- const char *fmt,
- ...) MY_ATTRIBUTE((format(printf, 4, 5)));
- size_t (*long10_to_str)(const struct charset_info_st *, char *to, size_t n,
- int radix, long int val);
- size_t (*longlong10_to_str)(const struct charset_info_st *, char *to,
- size_t n, int radix, longlong val);
-
- void (*fill)(const struct charset_info_st *, char *to, size_t len,
- int fill);
-
- /* String-to-number conversion routines */
- long (*strntol)(const struct charset_info_st *, const char *s,
- size_t l, int base, char **e, int *err);
- ulong (*strntoul)(const struct charset_info_st *, const char *s,
- size_t l, int base, char **e, int *err);
- longlong (*strntoll)(const struct charset_info_st *, const char *s,
- size_t l, int base, char **e, int *err);
- ulonglong (*strntoull)(const struct charset_info_st *, const char *s,
- size_t l, int base, char **e, int *err);
- double (*strntod)(const struct charset_info_st *, char *s,
- size_t l, char **e, int *err);
- longlong (*strtoll10)(const struct charset_info_st *cs,
- const char *nptr, char **endptr, int *error);
- ulonglong (*strntoull10rnd)(const struct charset_info_st *cs,
- const char *str, size_t length,
- int unsigned_fl,
- char **endptr, int *error);
- size_t (*scan)(const struct charset_info_st *, const char *b,
- const char *e, int sq);
-} MY_CHARSET_HANDLER;
-
-extern MY_CHARSET_HANDLER my_charset_8bit_handler;
-extern MY_CHARSET_HANDLER my_charset_ascii_handler;
-extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
-
-
-/*
- We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
- typedef in hash.c, which will cause a compiler error.
-*/
-#define CHARSET_INFO_DEFINED
-
-/* See strings/CHARSET_INFO.txt about information on this structure */
-typedef struct charset_info_st
-{
- uint number;
- uint primary_number;
- uint binary_number;
- uint state;
- const char *csname;
- const char *name;
- const char *comment;
- const char *tailoring;
- const uchar *ctype;
- const uchar *to_lower;
- const uchar *to_upper;
- const uchar *sort_order;
- MY_UCA_INFO *uca; /* This can be changed in apply_one_rule() */
- const uint16 *tab_to_uni;
- const MY_UNI_IDX *tab_from_uni;
- const MY_UNICASE_INFO *caseinfo;
- const struct lex_state_maps_st *state_maps; /* parser internal data */
- const uchar *ident_map; /* parser internal data */
- uint strxfrm_multiply;
- uchar caseup_multiply;
- uchar casedn_multiply;
- uint mbminlen;
- uint mbmaxlen;
- uint mbmaxlenlen;
- my_wc_t min_sort_char;
- my_wc_t max_sort_char; /* For LIKE optimization */
- uchar pad_char;
- my_bool escape_with_backslash_is_dangerous;
- uchar levels_for_compare;
- uchar levels_for_order;
-
- MY_CHARSET_HANDLER *cset;
- MY_COLLATION_HANDLER *coll;
-
-} CHARSET_INFO;
-#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
-
-
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
-
-extern CHARSET_INFO my_charset_big5_chinese_ci;
-extern CHARSET_INFO my_charset_big5_bin;
-extern CHARSET_INFO my_charset_cp932_japanese_ci;
-extern CHARSET_INFO my_charset_cp932_bin;
-extern CHARSET_INFO my_charset_cp1250_czech_ci;
-extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
-extern CHARSET_INFO my_charset_eucjpms_bin;
-extern CHARSET_INFO my_charset_euckr_korean_ci;
-extern CHARSET_INFO my_charset_euckr_bin;
-extern CHARSET_INFO my_charset_gb2312_chinese_ci;
-extern CHARSET_INFO my_charset_gb2312_bin;
-extern CHARSET_INFO my_charset_gbk_chinese_ci;
-extern CHARSET_INFO my_charset_gbk_bin;
-extern CHARSET_INFO my_charset_gb18030_chinese_ci;
-extern CHARSET_INFO my_charset_gb18030_bin;
-extern CHARSET_INFO my_charset_latin1_german2_ci;
-extern CHARSET_INFO my_charset_latin1_bin;
-extern CHARSET_INFO my_charset_latin2_czech_ci;
-extern CHARSET_INFO my_charset_sjis_japanese_ci;
-extern CHARSET_INFO my_charset_sjis_bin;
-extern CHARSET_INFO my_charset_tis620_thai_ci;
-extern CHARSET_INFO my_charset_tis620_bin;
-extern CHARSET_INFO my_charset_ucs2_general_ci;
-extern CHARSET_INFO my_charset_ucs2_bin;
-extern CHARSET_INFO my_charset_ucs2_unicode_ci;
-extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci;
-extern CHARSET_INFO my_charset_ujis_japanese_ci;
-extern CHARSET_INFO my_charset_ujis_bin;
-extern CHARSET_INFO my_charset_utf16_bin;
-extern CHARSET_INFO my_charset_utf16_general_ci;
-extern CHARSET_INFO my_charset_utf16_unicode_ci;
-extern CHARSET_INFO my_charset_utf16le_bin;
-extern CHARSET_INFO my_charset_utf16le_general_ci;
-extern CHARSET_INFO my_charset_utf32_bin;
-extern CHARSET_INFO my_charset_utf32_general_ci;
-extern CHARSET_INFO my_charset_utf32_unicode_ci;
-
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci;
-extern CHARSET_INFO my_charset_utf8_tolower_ci;
-extern CHARSET_INFO my_charset_utf8_unicode_ci;
-extern CHARSET_INFO my_charset_utf8_bin;
-extern CHARSET_INFO my_charset_utf8_general_mysql500_ci;
-extern CHARSET_INFO my_charset_utf8mb4_bin;
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci;
-extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
-#define MY_UTF8MB3 "utf8"
-#define MY_UTF8MB4 "utf8mb4"
-
-
-/* declarations for simple charsets */
-extern size_t my_strnxfrm_simple(const CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t);
-extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t,
- const uchar *, size_t, my_bool);
-
-extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t,
- const uchar *, size_t,
- my_bool diff_if_only_endspace_difference);
-
-extern void my_hash_sort_simple(const CHARSET_INFO *cs,
- const uchar *key, size_t len,
- ulong *nr1, ulong *nr2);
-
-extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr,
- size_t length);
-
-extern uint my_instr_simple(const struct charset_info_st *,
- const char *b, size_t b_length,
- const char *s, size_t s_length,
- my_match_t *match, uint nmatch);
-
-
-/* Functions for 8bit */
-extern size_t my_caseup_str_8bit(const CHARSET_INFO *, char *);
-extern size_t my_casedn_str_8bit(const CHARSET_INFO *, char *);
-extern size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-
-extern int my_strcasecmp_8bit(const CHARSET_INFO * cs, const char *,
- const char *);
-
-int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,
- const uchar *e);
-int my_wc_mb_8bit(const CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
-
-int my_mb_ctype_8bit(const CHARSET_INFO *,int *, const uchar *,const uchar *);
-int my_mb_ctype_mb(const CHARSET_INFO *,int *, const uchar *,const uchar *);
-
-size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e,
- int sq);
-
-size_t my_snprintf_8bit(const struct charset_info_st *, char *to, size_t n,
- const char *fmt, ...)
- MY_ATTRIBUTE((format(printf, 4, 5)));
-
-long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l,
- int base, char **e, int *err);
-ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l,
- int base, char **e, int *err);
-longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l,
- int base, char **e, int *err);
-ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l,
- int base, char **e, int *err);
-double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, char **e,
- int *err);
-size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
- int radix, long int val);
-size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
- int radix, longlong val);
-
-longlong my_strtoll10_8bit(const CHARSET_INFO *cs,
- const char *nptr, char **endptr, int *error);
-longlong my_strtoll10_ucs2(const CHARSET_INFO *cs,
- const char *nptr, char **endptr, int *error);
-
-ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs,
- const char *str, size_t length, int
- unsigned_fl, char **endptr, int *error);
-ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs,
- const char *str, size_t length,
- int unsigned_fl, char **endptr, int *error);
-
-void my_fill_8bit(const CHARSET_INFO *cs, char* to, size_t l, int fill);
-
-/* For 8-bit character set */
-my_bool my_like_range_simple(const CHARSET_INFO *cs,
- const char *ptr, size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str, char *max_str,
- size_t *min_length, size_t *max_length);
-
-/* For ASCII-based multi-byte character sets with mbminlen=1 */
-my_bool my_like_range_mb(const CHARSET_INFO *cs,
- const char *ptr, size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str, char *max_str,
- size_t *min_length, size_t *max_length);
-
-/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
-my_bool my_like_range_generic(const CHARSET_INFO *cs,
- const char *ptr, size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str, char *max_str,
- size_t *min_length, size_t *max_length);
-
-int my_wildcmp_8bit(const CHARSET_INFO *,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many);
-
-int my_wildcmp_bin(const CHARSET_INFO *,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many);
-
-size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e);
-size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e);
-size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e,
- size_t pos);
-size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b,
- const char *e, size_t pos, int *error);
-uint my_mbcharlen_8bit(const CHARSET_INFO *, uint c);
-
-
-/* Functions for multibyte charsets */
-extern size_t my_caseup_str_mb(const CHARSET_INFO *, char *);
-extern size_t my_casedn_str_mb(const CHARSET_INFO *, char *);
-extern size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src,
- size_t srclen, char *dst, size_t dstlen);
-extern size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src,
- size_t srclen, char *dst, size_t dstlen);
-extern size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern int my_strcasecmp_mb(const CHARSET_INFO * cs,const char *,
- const char *);
-
-int my_wildcmp_mb(const CHARSET_INFO *,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many);
-size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e);
-size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e);
-size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e,
- size_t pos);
-size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b,
- const char *e, size_t pos, int *error);
-uint my_instr_mb(const struct charset_info_st *,
- const char *b, size_t b_length,
- const char *s, size_t s_length,
- my_match_t *match, uint nmatch);
-
-int my_strnncoll_mb_bin(const CHARSET_INFO * cs,
- const uchar *s, size_t slen,
- const uchar *t, size_t tlen,
- my_bool t_is_prefix);
-
-int my_strnncollsp_mb_bin(const CHARSET_INFO *cs,
- const uchar *a, size_t a_length,
- const uchar *b, size_t b_length,
- my_bool diff_if_only_endspace_difference);
-
-int my_wildcmp_mb_bin(const CHARSET_INFO *cs,
- const char *str,const char *str_end,
- const char *wildstr,const char *wildend,
- int escape, int w_one, int w_many);
-
-int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
- const char *s, const char *t);
-
-void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
- const uchar *key, size_t len,ulong *nr1, ulong *nr2);
-
-size_t my_strnxfrm_mb(const CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-
-size_t my_strnxfrm_unicode(const CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-
-size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t);
-
-int my_wildcmp_unicode(const CHARSET_INFO *cs,
- const char *str, const char *str_end,
- const char *wildstr, const char *wildend,
- int escape, int w_one, int w_many,
- const MY_UNICASE_INFO *weights);
-
-extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader,
- const char *buf, size_t buflen);
-extern char *my_strchr(const CHARSET_INFO *cs, const char *str,
- const char *end, pchar c);
-extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str,
- const char *end, const char *reject,
- size_t reject_length);
-
-my_bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str,
- size_t len);
-my_bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str,
- size_t len);
-
-
-uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len);
-my_bool my_charset_is_ascii_based(const CHARSET_INFO *cs);
-my_bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs);
-uint my_charset_repertoire(const CHARSET_INFO *cs);
-
-
-uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
-void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
- uint flags, uint level);
-size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs,
- uchar *str, uchar *frmend, uchar *strend,
- uint nweights, uint flags, uint level);
-
-my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs);
-
-const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs,
- int level);
-
-extern size_t my_vsnprintf_ex(const CHARSET_INFO *cs, char *to, size_t n,
- const char* fmt, va_list ap);
-
-size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
- const char *from, size_t from_length,
- const CHARSET_INFO *from_cs, uint *errors);
-
-uint my_mbcharlen_ptr(const CHARSET_INFO *cs, const char *s, const char *e);
-
-#define _MY_U 01 /* Upper case */
-#define _MY_L 02 /* Lower case */
-#define _MY_NMR 04 /* Numeral (digit) */
-#define _MY_SPC 010 /* Spacing character */
-#define _MY_PNT 020 /* Punctuation */
-#define _MY_CTR 040 /* Control character */
-#define _MY_B 0100 /* Blank */
-#define _MY_X 0200 /* heXadecimal digit */
-
-
-#define my_isascii(c) (!((c) & ~0177))
-#define my_toascii(c) ((c) & 0177)
-#define my_tocntrl(c) ((c) & 31)
-#define my_toprint(c) ((c) | 64)
-#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
-#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
-#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
-#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
-#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
-#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
-#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
-#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
-#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
-#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
-#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
-#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
-#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
-
-/* Some macros that should be cleaned up a little */
-#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
-#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
-
-#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
-#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
-#define my_strnxfrm(cs, d, dl, s, sl) \
- ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_WITH_SPACE))
-#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
-#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
- ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
-#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
-#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
-#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
-
-
-#define use_mb(s) ((s)->cset->ismbchar != NULL)
-#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
-#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
-/**
- Get the length of gb18030 code by the given two leading bytes
-
- @param[in] s charset_info
- @param[in] a first byte of gb18030 code
- @param[in] b second byte of gb18030 code
- @return the length of gb18030 code starting with given two bytes,
- the length would be 2 or 4 for valid gb18030 code,
- or 0 for invalid gb18030 code
-*/
-#define my_mbcharlen_2(s, a, b) ((s)->cset->mbcharlen((s),((((a) & 0xFF) << 8) + ((b) & 0xFF))))
-/**
- Get the maximum length of leading bytes needed to determine the length of a
- multi-byte gb18030 code
-
- @param[in] s charset_info
- @return number of leading bytes we need, would be 2 for gb18030
- and 1 for all other charsets
-*/
-#define my_mbmaxlenlen(s) ((s)->mbmaxlenlen)
-/**
- Judge if the given byte is a possible leading byte for a charset.
- For gb18030 whose mbmaxlenlen is 2, we can't determine the length of
- a multi-byte character by looking at the first byte only
-
- @param[in] s charset_info
- @param[in] i possible leading byte
- @return true if it is, otherwise false
-*/
-#define my_ismb1st(s, i) \
- (my_mbcharlen((s), (i)) > 1 || \
- (my_mbmaxlenlen((s)) == 2 && my_mbcharlen((s), (i)) == 0))
-
-#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
-#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
-#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
-#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
-#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
-#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
-#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _m_ctype_h */
diff --git a/code/mysql/m_string.h b/code/mysql/m_string.h
deleted file mode 100644
index eb6d13a..0000000
--- a/code/mysql/m_string.h
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _m_string_h
-#define _m_string_h
-
-#include "my_global.h" /* HAVE_* */
-
-#include
-
-#define bfill please_use_memset_rather_than_bfill
-#define bzero please_use_memset_rather_than_bzero
-#define bmove please_use_memmove_rather_than_bmove
-#define strmov please_use_my_stpcpy_or_my_stpmov_rather_than_strmov
-#define strnmov please_use_my_stpncpy_or_my_stpnmov_rather_than_strnmov
-
-#include "mysql/service_my_snprintf.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-/*
- my_str_malloc(), my_str_realloc() and my_str_free() are assigned to
- implementations in strings/alloc.c, but can be overridden in
- the calling program.
- */
-extern void *(*my_str_malloc)(size_t);
-extern void *(*my_str_realloc)(void *, size_t);
-extern void (*my_str_free)(void *);
-
-/* Declared in int2str() */
-extern char _dig_vec_upper[];
-extern char _dig_vec_lower[];
-
- /* Prototypes for string functions */
-
-extern void bchange(uchar *dst,size_t old_len,const uchar *src,
- size_t new_len,size_t tot_len);
-extern void strappend(char *s,size_t len,pchar fill);
-extern char *strend(const char *s);
-extern char *strcend(const char *, pchar);
-extern char *strfill(char * s,size_t len,pchar fill);
-extern char *strmake(char *dst,const char *src,size_t length);
-
-extern char *my_stpmov(char *dst,const char *src);
-extern char *my_stpnmov(char *dst, const char *src, size_t n);
-extern char *strcont(const char *src, const char *set);
-extern char *strxmov(char *dst, const char *src, ...);
-extern char *strxnmov(char *dst, size_t len, const char *src, ...);
-
-/**
- Copy a string from src to dst until (and including) terminating null byte.
-
- @param dst Destination
- @param src Source
-
- @note src and dst cannot overlap.
- Use my_stpmov() if src and dst overlaps.
-
- @note Unsafe, consider using my_stpnpy() instead.
-
- @return pointer to terminating null byte.
-*/
-static inline char *my_stpcpy(char *dst, const char *src)
-{
-#if defined(HAVE_BUILTIN_STPCPY)
- return __builtin_stpcpy(dst, src);
-#elif defined(HAVE_STPCPY)
- return stpcpy(dst, src);
-#else
- /* Fallback to implementation supporting overlap. */
- return my_stpmov(dst, src);
-#endif
-}
-
-/**
- Copy fixed-size string from src to dst.
-
- @param dst Destination
- @param src Source
- @param n Maximum number of characters to copy.
-
- @note src and dst cannot overlap
- Use my_stpnmov() if src and dst overlaps.
-
- @return pointer to terminating null byte.
-*/
-static inline char *my_stpncpy(char *dst, const char *src, size_t n)
-{
-#if defined(HAVE_STPNCPY)
- return stpncpy(dst, src, n);
-#else
- /* Fallback to implementation supporting overlap. */
- return my_stpnmov(dst, src, n);
-#endif
-}
-
-static inline longlong my_strtoll(const char *nptr, char **endptr, int base)
-{
-#if defined _WIN32
- return _strtoi64(nptr, endptr, base);
-#else
- return strtoll(nptr, endptr, base);
-#endif
-}
-
-static inline ulonglong my_strtoull(const char *nptr, char **endptr, int base)
-{
-#if defined _WIN32
- return _strtoui64(nptr, endptr, base);
-#else
- return strtoull(nptr, endptr, base);
-#endif
-}
-
-static inline char *my_strtok_r(char *str, const char *delim, char **saveptr)
-{
-#if defined _WIN32
- return strtok_s(str, delim, saveptr);
-#else
- return strtok_r(str, delim, saveptr);
-#endif
-}
-
-/* native_ rather than my_ since my_strcasecmp already exists */
-static inline int native_strcasecmp(const char *s1, const char *s2)
-{
-#if defined _WIN32
- return _stricmp(s1, s2);
-#else
- return strcasecmp(s1, s2);
-#endif
-}
-
-/* native_ rather than my_ for consistency with native_strcasecmp */
-static inline int native_strncasecmp(const char *s1, const char *s2, size_t n)
-{
-#if defined _WIN32
- return _strnicmp(s1, s2, n);
-#else
- return strncasecmp(s1, s2, n);
-#endif
-}
-
-/* Prototypes of normal stringfunctions (with may ours) */
-#ifndef HAVE_STRNLEN
-extern size_t strnlen(const char *s, size_t n);
-#endif
-
-extern int is_prefix(const char *, const char *);
-
-/* Conversion routines */
-typedef enum {
- MY_GCVT_ARG_FLOAT,
- MY_GCVT_ARG_DOUBLE
-} my_gcvt_arg_type;
-
-double my_strtod(const char *str, char **end, int *error);
-double my_atof(const char *nptr);
-size_t my_fcvt(double x, int precision, char *to, my_bool *error);
-size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
- my_bool *error);
-
-#define NOT_FIXED_DEC 31
-
-/*
- The longest string my_fcvt can return is 311 + "precision" bytes.
- Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC
- (+ 1 byte for the terminating '\0').
-*/
-#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
-
-/*
- We want to use the 'e' format in some cases even if we have enough space
- for the 'f' one just to mimic sprintf("%.15g") behavior for large integers,
- and to improve it for numbers < 10^(-4).
- That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require
- it to be integer and be <= 10^DBL_DIG for the 'f' format to be used.
- We don't lose precision, but make cases like "1e200" or "0.00001" look nicer.
-*/
-#define MAX_DECPT_FOR_F_FORMAT DBL_DIG
-
-/*
- The maximum possible field width for my_gcvt() conversion.
- (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
- MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
-*/
-#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + MY_MAX(5, MAX_DECPT_FOR_F_FORMAT)) \
-
-extern char *llstr(longlong value,char *buff);
-extern char *ullstr(longlong value,char *buff);
-
-extern char *int2str(long val, char *dst, int radix, int upcase);
-extern char *int10_to_str(long val,char *dst,int radix);
-extern char *str2int(const char *src,int radix,long lower,long upper,
- long *val);
-longlong my_strtoll10(const char *nptr, char **endptr, int *error);
-#if SIZEOF_LONG == SIZEOF_LONG_LONG
-#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
-#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
-#undef strtoll
-#define strtoll(A,B,C) strtol((A),(B),(C))
-#define strtoull(A,B,C) strtoul((A),(B),(C))
-#else
-extern char *ll2str(longlong val,char *dst,int radix, int upcase);
-extern char *longlong10_to_str(longlong val,char *dst,int radix);
-#endif
-#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
-
-#if defined(__cplusplus)
-}
-#endif
-
-/*
- LEX_STRING -- a pair of a C-string and its length.
- (it's part of the plugin API as a MYSQL_LEX_STRING)
- Ditto LEX_CSTRING/MYSQL_LEX_CSTRING.
-*/
-
-#include
-typedef struct st_mysql_lex_string LEX_STRING;
-typedef struct st_mysql_const_lex_string LEX_CSTRING;
-
-#define STRING_WITH_LEN(X) (X), ((sizeof(X) - 1))
-#define USTRING_WITH_LEN(X) ((uchar*) X), ((sizeof(X) - 1))
-#define C_STRING_WITH_LEN(X) ((char *) (X)), ((sizeof(X) - 1))
-
-
-/**
- Skip trailing space.
-
- On most systems reading memory in larger chunks (ideally equal to the size of
- the chinks that the machine physically reads from memory) causes fewer memory
- access loops and hence increased performance.
- This is why the 'int' type is used : it's closest to that (according to how
- it's defined in C).
- So when we determine the amount of whitespace at the end of a string we do
- the following :
- 1. We divide the string into 3 zones :
- a) from the start of the string (__start) to the first multiple
- of sizeof(int) (__start_words)
- b) from the end of the string (__end) to the last multiple of sizeof(int)
- (__end_words)
- c) a zone that is aligned to sizeof(int) and can be safely accessed
- through an int *
- 2. We start comparing backwards from (c) char-by-char. If all we find is
- space then we continue
- 3. If there are elements in zone (b) we compare them as unsigned ints to a
- int mask (SPACE_INT) consisting of all spaces
- 4. Finally we compare the remaining part (a) of the string char by char.
- This covers for the last non-space unsigned int from 3. (if any)
-
- This algorithm works well for relatively larger strings, but it will slow
- the things down for smaller strings (because of the additional calculations
- and checks compared to the naive method). Thus the barrier of length 20
- is added.
-
- @param ptr pointer to the input string
- @param len the length of the string
- @return the last non-space character
-*/
-#if defined(__sparc) || defined(__sparcv9)
-static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
-{
- /* SPACE_INT is a word that contains only spaces */
-#if SIZEOF_INT == 4
- const unsigned SPACE_INT= 0x20202020U;
-#elif SIZEOF_INT == 8
- const unsigned SPACE_INT= 0x2020202020202020ULL;
-#else
-#error define the appropriate constant for a word full of spaces
-#endif
-
- const uchar *end= ptr + len;
-
- if (len > 20)
- {
- const uchar *end_words= (const uchar *)(intptr)
- (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT);
- const uchar *start_words= (const uchar *)(intptr)
- ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT);
-
- DBUG_ASSERT(end_words > ptr);
- while (end > end_words && end[-1] == 0x20)
- end--;
- if (end[-1] == 0x20 && start_words < end_words)
- while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT)
- end -= SIZEOF_INT;
- }
- while (end > ptr && end[-1] == 0x20)
- end--;
- return (end);
-}
-#else
-/*
- Reads 8 bytes at a time, ignoring alignment.
- We use uint8korr, which is fast (it simply reads a *ulonglong)
- on all platforms, except sparc.
-*/
-static inline const uchar *skip_trailing_space(const uchar *ptr, size_t len)
-{
- const uchar *end= ptr + len;
- while (end - ptr >= 8)
- {
- if (uint8korr(end-8) != 0x2020202020202020ULL)
- break;
- end-= 8;
- }
- while (end > ptr && end[-1] == 0x20)
- end--;
- return (end);
-}
-#endif
-
-static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
-{
- lex_str->str= (char *) c_str;
- lex_str->length= strlen(c_str);
-}
-
-static inline void lex_cstring_set(LEX_CSTRING *lex_str, const char *c_str)
-{
- lex_str->str= c_str;
- lex_str->length= strlen(c_str);
-}
-
-#endif
diff --git a/code/mysql/my_alloc.h b/code/mysql/my_alloc.h
deleted file mode 100644
index d1084c2..0000000
--- a/code/mysql/my_alloc.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- Data structures for mysys/my_alloc.c (root memory allocator)
-*/
-
-#ifndef _my_alloc_h
-#define _my_alloc_h
-
-#define ALLOC_MAX_BLOCK_TO_DROP 4096
-#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
-
-/* PSI_memory_key */
-#include "mysql/psi/psi_memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct st_used_mem
-{ /* struct for once_alloc (block) */
- struct st_used_mem *next; /* Next block in use */
- unsigned int left; /* memory left in block */
- unsigned int size; /* size of block */
-} USED_MEM;
-
-
-typedef struct st_mem_root
-{
- USED_MEM *free; /* blocks with free memory in it */
- USED_MEM *used; /* blocks almost without free memory */
- USED_MEM *pre_alloc; /* preallocated block */
- /* if block have less memory it will be put in 'used' list */
- size_t min_malloc;
- size_t block_size; /* initial block size */
- unsigned int block_num; /* allocated blocks counter */
- /*
- first free block in queue test counter (if it exceed
- MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
- */
- unsigned int first_block_usage;
-
- /*
- Maximum amount of memory this mem_root can hold. A value of 0
- implies there is no limit.
- */
- size_t max_capacity;
-
- /* Allocated size for this mem_root */
-
- size_t allocated_size;
-
- /* Enable this for error reporting if capacity is exceeded */
- my_bool error_for_capacity_exceeded;
-
- void (*error_handler)(void);
-
- PSI_memory_key m_psi_key;
-} MEM_ROOT;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/my_byteorder.h b/code/mysql/my_byteorder.h
deleted file mode 100644
index c37ab12..0000000
--- a/code/mysql/my_byteorder.h
+++ /dev/null
@@ -1,225 +0,0 @@
-#ifndef MY_BYTEORDER_INCLUDED
-#define MY_BYTEORDER_INCLUDED
-
-/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-
-/*
- Functions for reading and storing in machine independent
- format (low byte first). There are 'korr' (assume 'corrector') variants
- for integer types, but 'get' (assume 'getter') for floating point types.
-*/
-#if defined(__i386__) || defined(_WIN32) || defined(__x86_64__)
-#include "byte_order_generic_x86.h"
-#else
-#include "byte_order_generic.h"
-#endif
-
-static inline int32 sint3korr(const uchar *A)
-{
- return
- ((int32) (((A[2]) & 128) ?
- (((uint32) 255L << 24) |
- (((uint32) A[2]) << 16) |
- (((uint32) A[1]) << 8) |
- ((uint32) A[0])) :
- (((uint32) A[2]) << 16) |
- (((uint32) A[1]) << 8) |
- ((uint32) A[0])))
- ;
-}
-
-static inline uint32 uint3korr(const uchar *A)
-{
- return
- (uint32) (((uint32) (A[0])) +
- (((uint32) (A[1])) << 8) +
- (((uint32) (A[2])) << 16))
- ;
-}
-
-static inline ulonglong uint5korr(const uchar *A)
-{
- return
- ((ulonglong)(((uint32) (A[0])) +
- (((uint32) (A[1])) << 8) +
- (((uint32) (A[2])) << 16) +
- (((uint32) (A[3])) << 24)) +
- (((ulonglong) (A[4])) << 32))
- ;
-}
-
-static inline ulonglong uint6korr(const uchar *A)
-{
- return
- ((ulonglong)(((uint32) (A[0])) +
- (((uint32) (A[1])) << 8) +
- (((uint32) (A[2])) << 16) +
- (((uint32) (A[3])) << 24)) +
- (((ulonglong) (A[4])) << 32) +
- (((ulonglong) (A[5])) << 40))
- ;
-}
-
-static inline void int3store(uchar *T, uint A)
-{
- *(T)= (uchar) (A);
- *(T+1)= (uchar) (A >> 8);
- *(T+2)= (uchar) (A >> 16);
-}
-
-static inline void int5store(uchar *T, ulonglong A)
-{
- *(T)= (uchar) (A);
- *(T+1)= (uchar) (A >> 8);
- *(T+2)= (uchar) (A >> 16);
- *(T+3)= (uchar) (A >> 24);
- *(T+4)= (uchar) (A >> 32);
-}
-
-static inline void int6store(uchar *T, ulonglong A)
-{
- *(T)= (uchar) (A);
- *(T+1)= (uchar) (A >> 8);
- *(T+2)= (uchar) (A >> 16);
- *(T+3)= (uchar) (A >> 24);
- *(T+4)= (uchar) (A >> 32);
- *(T+5)= (uchar) (A >> 40);
-}
-
-#ifdef __cplusplus
-
-static inline int16 sint2korr(const char *pT)
-{
- return sint2korr(static_cast(static_cast(pT)));
-}
-
-static inline uint16 uint2korr(const char *pT)
-{
- return uint2korr(static_cast(static_cast(pT)));
-}
-
-static inline uint32 uint3korr(const char *pT)
-{
- return uint3korr(static_cast(static_cast(pT)));
-}
-
-static inline int32 sint3korr(const char *pT)
-{
- return sint3korr(static_cast(static_cast(pT)));
-}
-
-static inline uint32 uint4korr(const char *pT)
-{
- return uint4korr(static_cast(static_cast(pT)));
-}
-
-static inline int32 sint4korr(const char *pT)
-{
- return sint4korr(static_cast(static_cast(pT)));
-}
-
-static inline ulonglong uint6korr(const char *pT)
-{
- return uint6korr(static_cast(static_cast(pT)));
-}
-
-static inline ulonglong uint8korr(const char *pT)
-{
- return uint8korr(static_cast(static_cast(pT)));
-}
-
-static inline longlong sint8korr(const char *pT)
-{
- return sint8korr(static_cast(static_cast(pT)));
-}
-
-
-static inline void int2store(char *pT, uint16 A)
-{
- int2store(static_cast(static_cast(pT)), A);
-}
-
-static inline void int3store(char *pT, uint A)
-{
- int3store(static_cast(static_cast(pT)), A);
-}
-
-static inline void int4store(char *pT, uint32 A)
-{
- int4store(static_cast(static_cast(pT)), A);
-}
-
-static inline void int5store(char *pT, ulonglong A)
-{
- int5store(static_cast(static_cast(pT)), A);
-}
-
-static inline void int6store(char *pT, ulonglong A)
-{
- int6store(static_cast(static_cast(pT)), A);
-}
-
-static inline void int8store(char *pT, ulonglong A)
-{
- int8store(static_cast(static_cast(pT)), A);
-}
-
-#endif /* __cplusplus */
-
-/*
- Functions for reading and storing in machine format from/to
- short/long to/from some place in memory V should be a variable
- and M a pointer to byte.
-*/
-#ifdef WORDS_BIGENDIAN
-#include "big_endian.h"
-#else
-#include "little_endian.h"
-#endif
-
-#ifdef __cplusplus
-
-static inline void float4store(char *V, float M)
-{
- float4store(static_cast(static_cast(V)), M);
-}
-
-static inline void float8get(double *V, const char *M)
-{
- float8get(V, static_cast(static_cast(M)));
-}
-
-static inline void float8store(char *V, double M)
-{
- float8store(static_cast(static_cast(V)), M);
-}
-
-#endif /* __cplusplus */
-
-#endif /* MY_BYTEORDER_INCLUDED */
diff --git a/code/mysql/my_command.h b/code/mysql/my_command.h
deleted file mode 100644
index f60331c..0000000
--- a/code/mysql/my_command.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License, version 2.0,
-as published by the Free Software Foundation.
-
-This program is also distributed with certain software (including
-but not limited to OpenSSL) that is licensed under separate terms,
-as designated in a particular file or component or in included license
-documentation. The authors of MySQL hereby grant you an additional
-permission to link the program and your derivative works with the
-separately licensed software that they have included with MySQL.
-
-Without limiting anything contained in the foregoing, this file,
-which is part of C Driver for MySQL (Connector/C), is also subject to the
-Universal FOSS Exception, version 1.0, a copy of which can be found at
-http://oss.oracle.com/licenses/universal-foss-exception.
-
-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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _mysql_command_h
-#define _mysql_command_h
-
-/**
- @enum enum_server_command
- @brief You should add new commands to the end of this list, otherwise old
- servers won't be able to handle them as 'unsupported'.
-*/
-enum enum_server_command
-{
- COM_SLEEP,
- COM_QUIT,
- COM_INIT_DB,
- COM_QUERY,
- COM_FIELD_LIST,
- COM_CREATE_DB,
- COM_DROP_DB,
- COM_REFRESH,
- COM_SHUTDOWN,
- COM_STATISTICS,
- COM_PROCESS_INFO,
- COM_CONNECT,
- COM_PROCESS_KILL,
- COM_DEBUG,
- COM_PING,
- COM_TIME,
- COM_DELAYED_INSERT,
- COM_CHANGE_USER,
- COM_BINLOG_DUMP,
- COM_TABLE_DUMP,
- COM_CONNECT_OUT,
- COM_REGISTER_SLAVE,
- COM_STMT_PREPARE,
- COM_STMT_EXECUTE,
- COM_STMT_SEND_LONG_DATA,
- COM_STMT_CLOSE,
- COM_STMT_RESET,
- COM_SET_OPTION,
- COM_STMT_FETCH,
- COM_DAEMON,
- COM_BINLOG_DUMP_GTID,
- COM_RESET_CONNECTION,
- /* don't forget to update const char *command_name[] in sql_parse.cc */
-
- /* Must be last */
- COM_END
-};
-
-#endif /* _mysql_command_h */
diff --git a/code/mysql/my_compiler.h b/code/mysql/my_compiler.h
deleted file mode 100644
index 2c3daee..0000000
--- a/code/mysql/my_compiler.h
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef MY_COMPILER_INCLUDED
-#define MY_COMPILER_INCLUDED
-
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- Header for compiler-dependent features.
-
- Intended to contain a set of reusable wrappers for preprocessor
- macros, attributes, pragmas, and any other features that are
- specific to a target compiler.
-*/
-
-#include /* size_t */
-
-#if defined __GNUC__
-/*
- Convenience macro to test the minimum required GCC version.
- These should be used with care as Clang also sets __GNUC__ and
- __GNUC_MINOR__ (currently to 4.2). Prefer using feature specific
- CMake checks in configure.cmake instead.
-*/
-# define MY_GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#else
-# define MY_GNUC_PREREQ(maj, min) (0)
-#endif
-
-/*
- The macros below are borrowed from include/linux/compiler.h in the
- Linux kernel. Use them to indicate the likelyhood of the truthfulness
- of a condition. This serves two purposes - newer versions of gcc will be
- able to optimize for branch predication, which could yield siginficant
- performance gains in frequently executed sections of the code, and the
- other reason to use them is for documentation
-*/
-#ifdef HAVE_BUILTIN_EXPECT
-
-// likely/unlikely are likely to clash with other symbols, do not #define
-#if defined(__cplusplus)
-inline bool likely(bool expr)
-{
- return __builtin_expect(expr, true);
-}
-inline bool unlikely(bool expr)
-{
- return __builtin_expect(expr, false);
-}
-#else
-# define likely(x) __builtin_expect((x),1)
-# define unlikely(x) __builtin_expect((x),0)
-#endif
-
-#else /* HAVE_BUILTIN_EXPECT */
-
-#if defined(__cplusplus)
-inline bool likely(bool expr)
-{
- return expr;
-}
-inline bool unlikely(bool expr)
-{
- return expr;
-}
-#else
-# define likely(x) (x)
-# define unlikely(x) (x)
-#endif
-
-#endif /* HAVE_BUILTIN_EXPECT */
-
-/* Comunicate to the compiler the unreachability of the code. */
-#ifdef HAVE_BUILTIN_UNREACHABLE
-# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
-#else
-# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
-#endif
-
-#if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC
-/* Specifies the minimum alignment of a type. */
-# define MY_ALIGNOF(type) __alignof__(type)
-/* Determine the alignment requirement of a type. */
-# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
-/* Microsoft Visual C++ */
-#elif defined _MSC_VER
-# define MY_ALIGNOF(type) __alignof(type)
-# define MY_ALIGNED(n) __declspec(align(n))
-#else /* Make sure they are defined for other compilers. */
-# define MY_ALIGNOF(type)
-# define MY_ALIGNED(size)
-#endif
-
-/* Visual Studio requires '__inline' for C code */
-#if !defined(__cplusplus) && defined(_MSC_VER)
-# define inline __inline
-#endif
-
-/* Provide __func__ macro definition for Visual Studio. */
-#if defined(_MSC_VER)
-# define __func__ __FUNCTION__
-#endif
-
-/**
- C++ Type Traits
-*/
-#ifdef __cplusplus
-
-/**
- Opaque storage with a particular alignment.
- Partial specialization used due to MSVC++.
-*/
-template struct my_alignment_imp;
-template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
-template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
-template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
-template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
-template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
-
-/**
- A POD type with a given size and alignment.
-
- @remark If the compiler does not support a alignment attribute
- (MY_ALIGN macro), the default alignment of a double is
- used instead.
-
- @tparam size The minimum size.
- @tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
-*/
-template
-struct my_aligned_storage
-{
- union
- {
- char data[size];
- my_alignment_imp align;
- };
-};
-
-#endif /* __cplusplus */
-
-/*
- Disable MY_ATTRIBUTE for Sun Studio and Visual Studio.
- Note that Sun Studio supports some __attribute__ variants,
- but not format or unused which we use quite a lot.
-*/
-#ifndef MY_ATTRIBUTE
-#if defined(__GNUC__)
-# define MY_ATTRIBUTE(A) __attribute__(A)
-#else
-# define MY_ATTRIBUTE(A)
-#endif
-#endif
-
-#ifndef __has_attribute
-# define __has_attribute(x) 0
-#endif
-
-#if __has_attribute(no_sanitize_undefined)
-# define SUPPRESS_UBSAN __attribute__((no_sanitize_undefined))
-#else
-# define SUPPRESS_UBSAN
-#endif
-
-#endif /* MY_COMPILER_INCLUDED */
diff --git a/code/mysql/my_config.h b/code/mysql/my_config.h
deleted file mode 100644
index 3a77601..0000000
--- a/code/mysql/my_config.h
+++ /dev/null
@@ -1,468 +0,0 @@
-/* Copyright (c) 2009, 2020, Oracle and/or its affiliates.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MY_CONFIG_H
-#define MY_CONFIG_H
-
-/*
- * From configure.cmake, in order of appearance
- */
-/* #undef HAVE_LLVM_LIBCPP */
-#define _LARGEFILE_SOURCE 1
-
-/* Libraries */
-/* #undef HAVE_LIBM */
-/* #undef HAVE_LIBNSL */
-/* #undef HAVE_LIBCRYPT */
-/* #undef HAVE_LIBSOCKET */
-/* #undef HAVE_LIBDL */
-/* #undef HAVE_LIBRT */
-/* #undef HAVE_LIBWRAP */
-/* #undef HAVE_LIBWRAP_PROTOTYPES */
-
-/* Header files */
-/* #undef HAVE_ALLOCA_H */
-/* #undef HAVE_ARPA_INET_H */
-/* #undef HAVE_CRYPT_H */
-/* #undef HAVE_DLFCN_H */
-/* #undef HAVE_EXECINFO_H */
-/* #undef HAVE_FPU_CONTROL_H */
-/* #undef HAVE_GRP_H */
-/* #undef HAVE_IEEEFP_H */
-/* #undef HAVE_LANGINFO_H */
-#define HAVE_MALLOC_H 1
-/* #undef HAVE_NETINET_IN_H */
-/* #undef HAVE_POLL_H */
-/* #undef HAVE_PWD_H */
-/* #undef HAVE_STRINGS_H */
-/* #undef HAVE_SYS_CDEFS_H */
-/* #undef HAVE_SYS_IOCTL_H */
-/* #undef HAVE_SYS_MMAN_H */
-/* #undef HAVE_SYS_RESOURCE_H */
-/* #undef HAVE_SYS_SELECT_H */
-/* #undef HAVE_SYS_SOCKET_H */
-/* #undef HAVE_TERM_H */
-/* #undef HAVE_TERMIOS_H */
-/* #undef HAVE_TERMIO_H */
-/* #undef HAVE_UNISTD_H */
-/* #undef HAVE_SYS_WAIT_H */
-/* #undef HAVE_SYS_PARAM_H */
-/* #undef HAVE_FNMATCH_H */
-/* #undef HAVE_SYS_UN_H */
-/* #undef HAVE_SASL_SASL_H */
-
-/* Libevent */
-/* #undef HAVE_DEVPOLL */
-/* #undef HAVE_SYS_DEVPOLL_H */
-/* #undef HAVE_SYS_EPOLL_H */
-/* #undef HAVE_TAILQFOREACH */
-
-/* Functions */
-#define HAVE_ALIGNED_MALLOC 1
-/* #undef HAVE_BACKTRACE */
-/* #undef HAVE_PRINTSTACK */
-/* #undef HAVE_INDEX */
-/* #undef HAVE_CLOCK_GETTIME */
-/* #undef HAVE_CUSERID */
-/* #undef HAVE_DIRECTIO */
-/* #undef HAVE_FTRUNCATE */
-#define HAVE_COMPRESS 1
-/* #undef HAVE_CRYPT */
-/* #undef HAVE_DLOPEN */
-/* #undef HAVE_FCHMOD */
-/* #undef HAVE_FCNTL */
-/* #undef HAVE_FDATASYNC */
-/* #undef HAVE_DECL_FDATASYNC */
-/* #undef HAVE_FEDISABLEEXCEPT */
-/* #undef HAVE_FSEEKO */
-/* #undef HAVE_FSYNC */
-/* #undef HAVE_GETHOSTBYADDR_R */
-/* #undef HAVE_GETHRTIME */
-/* #undef HAVE_GETNAMEINFO */
-/* #undef HAVE_GETPASS */
-/* #undef HAVE_GETPASSPHRASE */
-/* #undef HAVE_GETPWNAM */
-/* #undef HAVE_GETPWUID */
-/* #undef HAVE_GETRLIMIT */
-/* #undef HAVE_GETRUSAGE */
-/* #undef HAVE_INITGROUPS */
-/* #undef HAVE_ISSETUGID */
-/* #undef HAVE_GETUID */
-/* #undef HAVE_GETEUID */
-/* #undef HAVE_GETGID */
-/* #undef HAVE_GETEGID */
-/* #undef HAVE_LSTAT */
-/* #undef HAVE_MADVISE */
-/* #undef HAVE_MALLOC_INFO */
-/* #undef HAVE_MEMRCHR */
-/* #undef HAVE_MLOCK */
-/* #undef HAVE_MLOCKALL */
-/* #undef HAVE_MMAP64 */
-/* #undef HAVE_POLL */
-/* #undef HAVE_POSIX_FALLOCATE */
-/* #undef HAVE_POSIX_MEMALIGN */
-/* #undef HAVE_PREAD */
-/* #undef HAVE_PTHREAD_CONDATTR_SETCLOCK */
-/* #undef HAVE_PTHREAD_SIGMASK */
-/* #undef HAVE_READLINK */
-/* #undef HAVE_REALPATH */
-/* #undef HAVE_SETFD */
-/* #undef HAVE_SIGACTION */
-/* #undef HAVE_SLEEP */
-/* #undef HAVE_STPCPY */
-/* #undef HAVE_STPNCPY */
-/* #undef HAVE_STRLCPY */
-#define HAVE_STRNLEN 1
-/* #undef HAVE_STRLCAT */
-/* #undef HAVE_STRSIGNAL */
-/* #undef HAVE_FGETLN */
-/* #undef HAVE_STRSEP */
-#define HAVE_TELL 1
-/* #undef HAVE_VASPRINTF */
-/* #undef HAVE_MEMALIGN */
-/* #undef HAVE_NL_LANGINFO */
-/* #undef HAVE_HTONLL */
-/* #undef DNS_USE_CPU_CLOCK_FOR_ID */
-/* #undef HAVE_EPOLL */
-/* #undef HAVE_EVENT_PORTS */
-/* #undef HAVE_INET_NTOP */
-/* #undef HAVE_WORKING_KQUEUE */
-/* #undef HAVE_TIMERADD */
-/* #undef HAVE_TIMERCLEAR */
-/* #undef HAVE_TIMERCMP */
-/* #undef HAVE_TIMERISSET */
-
-/* WL2373 */
-/* #undef HAVE_SYS_TIME_H */
-/* #undef HAVE_SYS_TIMES_H */
-/* #undef HAVE_TIMES */
-/* #undef HAVE_GETTIMEOFDAY */
-
-/* Symbols */
-/* #undef HAVE_LRAND48 */
-/* #undef GWINSZ_IN_SYS_IOCTL */
-/* #undef FIONREAD_IN_SYS_IOCTL */
-/* #undef FIONREAD_IN_SYS_FILIO */
-/* #undef HAVE_SIGEV_THREAD_ID */
-/* #undef HAVE_SIGEV_PORT */
-#define HAVE_LOG2 1
-
-#define HAVE_ISINF 1
-
-/* #undef HAVE_KQUEUE_TIMERS */
-/* #undef HAVE_POSIX_TIMERS */
-
-/* Endianess */
-/* #undef WORDS_BIGENDIAN */
-
-/* Type sizes */
-#define SIZEOF_VOIDP 4
-#define SIZEOF_CHARP 4
-#define SIZEOF_LONG 4
-#define SIZEOF_SHORT 2
-#define SIZEOF_INT 4
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_OFF_T 4
-#define SIZEOF_TIME_T 8
-/* #undef HAVE_UINT */
-/* #undef HAVE_ULONG */
-/* #undef HAVE_U_INT32_T */
-/* #undef HAVE_STRUCT_TIMESPEC */
-
-/* Support for tagging symbols with __attribute__((visibility("hidden"))) */
-/* #undef HAVE_VISIBILITY_HIDDEN */
-
-/* Code tests*/
-#define STACK_DIRECTION -1
-/* #undef TIME_WITH_SYS_TIME */
-#define NO_FCNTL_NONBLOCK 1
-/* #undef HAVE_PAUSE_INSTRUCTION */
-/* #undef HAVE_FAKE_PAUSE_INSTRUCTION */
-/* #undef HAVE_HMT_PRIORITY_INSTRUCTION */
-/* #undef HAVE_ABI_CXA_DEMANGLE */
-/* #undef HAVE_BUILTIN_UNREACHABLE */
-/* #undef HAVE_BUILTIN_EXPECT */
-/* #undef HAVE_BUILTIN_STPCPY */
-/* #undef HAVE_GCC_ATOMIC_BUILTINS */
-/* #undef HAVE_GCC_SYNC_BUILTINS */
-/* #undef HAVE_VALGRIND */
-/* #undef HAVE_PTHREAD_THREADID_NP */
-
-/* IPV6 */
-/* #undef HAVE_NETINET_IN6_H */
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-#define HAVE_STRUCT_IN6_ADDR 1
-#define HAVE_IPV6 1
-
-/* #undef ss_family */
-/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
-/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
-
-/*
- * Platform specific CMake files
- */
-#define MACHINE_TYPE "AMD64"
-/* #undef HAVE_LINUX_LARGE_PAGES */
-/* #undef HAVE_SOLARIS_LARGE_PAGES */
-/* #undef HAVE_SOLARIS_ATOMIC */
-/* #undef HAVE_SOLARIS_STYLE_GETHOST */
-#define SYSTEM_TYPE "Win32"
-/* Windows stuff, mostly functions, that have Posix analogs but named differently */
-/* #undef IPPROTO_IPV6 */
-/* #undef IPV6_V6ONLY */
-/* This should mean case insensitive file system */
-#define FN_NO_CASE_SENSE 1
-
-/*
- * From main CMakeLists.txt
- */
-#define MAX_INDEXES 64U
-/* #undef WITH_INNODB_MEMCACHED */
-/* #undef ENABLE_MEMCACHED_SASL */
-/* #undef ENABLE_MEMCACHED_SASL_PWDB */
-#define ENABLED_PROFILING 1
-/* #undef HAVE_ASAN */
-#define ENABLED_LOCAL_INFILE 1
-#define OPTIMIZER_TRACE 1
-#define DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server 5.7"
-#define SHAREDIR "share"
-#define DEFAULT_BASEDIR "C:/Program Files/MySQL/MySQL Server 5.7"
-#define MYSQL_DATADIR "C:/Program Files/MySQL/MySQL Server 5.7/data"
-#define MYSQL_KEYRINGDIR "C:/Program Files/MySQL/MySQL Server 5.7/keyring"
-#define DEFAULT_CHARSET_HOME "C:/Program Files/MySQL/MySQL Server 5.7"
-#define PLUGINDIR "C:/Program Files/MySQL/MySQL Server 5.7/lib/plugin"
-/* #undef DEFAULT_SYSCONFDIR */
-#define DEFAULT_TMPDIR ""
-#define INSTALL_SBINDIR "/bin"
-#define INSTALL_BINDIR "/bin"
-#define INSTALL_MYSQLSHAREDIR "/share"
-#define INSTALL_SHAREDIR "/share"
-#define INSTALL_PLUGINDIR "/lib/plugin"
-#define INSTALL_INCLUDEDIR "/include"
-#define INSTALL_SCRIPTDIR "/scripts"
-#define INSTALL_MYSQLDATADIR "/data"
-#define INSTALL_MYSQLKEYRINGDIR "/keyring"
-/* #undef INSTALL_PLUGINTESTDIR */
-#define INSTALL_INFODIR "/docs"
-#define INSTALL_MYSQLTESTDIR "/mysql-test"
-#define INSTALL_DOCREADMEDIR "/."
-#define INSTALL_DOCDIR "/docs"
-#define INSTALL_MANDIR "/man"
-#define INSTALL_SUPPORTFILESDIR "/support-files"
-#define INSTALL_LIBDIR "/lib"
-
-/*
- * Readline
- */
-/* #undef HAVE_MBSTATE_T */
-/* #undef HAVE_LANGINFO_CODESET */
-/* #undef HAVE_WCSDUP */
-/* #undef HAVE_WCHAR_T */
-/* #undef HAVE_WINT_T */
-/* #undef HAVE_CURSES_H */
-/* #undef HAVE_NCURSES_H */
-/* #undef USE_LIBEDIT_INTERFACE */
-/* #undef HAVE_HIST_ENTRY */
-/* #undef USE_NEW_EDITLINE_INTERFACE */
-/* #undef EDITLINE_HAVE_COMPLETION_CHAR */
-/* #undef EDITLINE_HAVE_COMPLETION_INT */
-
-/*
- * Libedit
- */
-/* #undef HAVE_GETLINE */
-/* #undef HAVE___SECURE_GETENV */
-/* #undef HAVE_SECURE_GETENV */
-/* #undef HAVE_VIS */
-/* #undef HAVE_UNVIS */
-/* #undef HAVE_GETPW_R_DRAFT */
-/* #undef HAVE_GETPW_R_POSIX */
-
-/*
- * DTrace
- */
-/* #undef HAVE_DTRACE */
-
-/*
- * Character sets
- */
-#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
-#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
-#define HAVE_CHARSET_armscii8 1
-#define HAVE_CHARSET_ascii 1
-#define HAVE_CHARSET_big5 1
-#define HAVE_CHARSET_cp1250 1
-#define HAVE_CHARSET_cp1251 1
-#define HAVE_CHARSET_cp1256 1
-#define HAVE_CHARSET_cp1257 1
-#define HAVE_CHARSET_cp850 1
-#define HAVE_CHARSET_cp852 1
-#define HAVE_CHARSET_cp866 1
-#define HAVE_CHARSET_cp932 1
-#define HAVE_CHARSET_dec8 1
-#define HAVE_CHARSET_eucjpms 1
-#define HAVE_CHARSET_euckr 1
-#define HAVE_CHARSET_gb2312 1
-#define HAVE_CHARSET_gbk 1
-#define HAVE_CHARSET_gb18030 1
-#define HAVE_CHARSET_geostd8 1
-#define HAVE_CHARSET_greek 1
-#define HAVE_CHARSET_hebrew 1
-#define HAVE_CHARSET_hp8 1
-#define HAVE_CHARSET_keybcs2 1
-#define HAVE_CHARSET_koi8r 1
-#define HAVE_CHARSET_koi8u 1
-#define HAVE_CHARSET_latin1 1
-#define HAVE_CHARSET_latin2 1
-#define HAVE_CHARSET_latin5 1
-#define HAVE_CHARSET_latin7 1
-#define HAVE_CHARSET_macce 1
-#define HAVE_CHARSET_macroman 1
-#define HAVE_CHARSET_sjis 1
-#define HAVE_CHARSET_swe7 1
-#define HAVE_CHARSET_tis620 1
-#define HAVE_CHARSET_ucs2 1
-#define HAVE_CHARSET_ujis 1
-#define HAVE_CHARSET_utf8mb4 1
-/* #undef HAVE_CHARSET_utf8mb3 */
-#define HAVE_CHARSET_utf8 1
-#define HAVE_CHARSET_utf16 1
-#define HAVE_CHARSET_utf32 1
-#define HAVE_UCA_COLLATIONS 1
-
-/*
- * Feature set
- */
-#define WITH_PARTITION_STORAGE_ENGINE 1
-
-/*
- * Performance schema
- */
-#define WITH_PERFSCHEMA_STORAGE_ENGINE 1
-/* #undef DISABLE_PSI_THREAD */
-/* #undef DISABLE_PSI_MUTEX */
-/* #undef DISABLE_PSI_RWLOCK */
-/* #undef DISABLE_PSI_COND */
-/* #undef DISABLE_PSI_FILE */
-/* #undef DISABLE_PSI_TABLE */
-/* #undef DISABLE_PSI_SOCKET */
-/* #undef DISABLE_PSI_STAGE */
-/* #undef DISABLE_PSI_STATEMENT */
-/* #undef DISABLE_PSI_SP */
-/* #undef DISABLE_PSI_PS */
-/* #undef DISABLE_PSI_IDLE */
-/* #undef DISABLE_PSI_STATEMENT_DIGEST */
-/* #undef DISABLE_PSI_METADATA */
-/* #undef DISABLE_PSI_MEMORY */
-/* #undef DISABLE_PSI_TRANSACTION */
-
-/*
- * syscall
-*/
-/* #undef HAVE_SYS_THREAD_SELFID */
-/* #undef HAVE_SYS_GETTID */
-/* #undef HAVE_PTHREAD_GETTHREADID_NP */
-/* #undef HAVE_PTHREAD_SETNAME_NP */
-/* #undef HAVE_INTEGER_PTHREAD_SELF */
-
-/* Platform-specific C++ compiler behaviors we rely upon */
-
-/*
- This macro defines whether the compiler in use needs a 'typename' keyword
- to access the types defined inside a class template, such types are called
- dependent types. Some compilers require it, some others forbid it, and some
- others may work with or without it. For example, GCC requires the 'typename'
- keyword whenever needing to access a type inside a template, but msvc
- forbids it.
- */
-#define HAVE_IMPLICIT_DEPENDENT_NAME_TYPING 1
-
-
-/*
- * MySQL version
- */
-#define DOT_FRM_VERSION 6
-#define MYSQL_VERSION_MAJOR 5
-#define MYSQL_VERSION_MINOR 7
-#define MYSQL_VERSION_PATCH 31
-#define MYSQL_VERSION_EXTRA ""
-#define PACKAGE "mysql"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "MySQL Server"
-#define PACKAGE_STRING "MySQL Server 5.7.31"
-#define PACKAGE_TARNAME "mysql"
-#define PACKAGE_VERSION "5.7.31"
-#define VERSION "5.7.31"
-#define PROTOCOL_VERSION 10
-
-/*
- * CPU info
- */
-#define CPU_LEVEL1_DCACHE_LINESIZE 64
-
-/*
- * NDB
- */
-/* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */
-/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
-
-/*
- * Other
- */
-/* #undef EXTRA_DEBUG */
-/* #undef HAVE_CHOWN */
-
-/*
- * Hardcoded values needed by libevent/NDB/memcached
- */
-#define HAVE_FCNTL_H 1
-#define HAVE_GETADDRINFO 1
-#define HAVE_INTTYPES_H 1
-/* libevent's select.c is not Windows compatible */
-#ifndef _WIN32
-#define HAVE_SELECT 1
-#endif
-#define HAVE_SIGNAL_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRDUP 1
-#define HAVE_STRTOK_R 1
-#define HAVE_STRTOLL 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TYPES_H 1
-#define SIZEOF_CHAR 1
-
-/*
- * Needed by libevent
- */
-/* #undef HAVE_SOCKLEN_T */
-
-/* For --secure-file-priv */
-#define DEFAULT_SECURE_FILE_PRIV_DIR "NULL"
-#define DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR "NULL"
-/* #undef HAVE_LIBNUMA */
-
-/* For default value of --early_plugin_load */
-/* #undef DEFAULT_EARLY_PLUGIN_LOAD */
-
-#endif
diff --git a/code/mysql/my_dbug.h b/code/mysql/my_dbug.h
deleted file mode 100644
index 7911c19..0000000
--- a/code/mysql/my_dbug.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MY_DBUG_INCLUDED
-#define MY_DBUG_INCLUDED
-
-#include "my_global.h" /* MYSQL_PLUGIN_IMPORT */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if !defined(DBUG_OFF)
-
-struct _db_stack_frame_ {
- const char *func; /* function name of the previous stack frame */
- const char *file; /* filename of the function of previous frame */
- uint level; /* this nesting level, highest bit enables tracing */
- struct _db_stack_frame_ *prev; /* pointer to the previous frame */
-};
-
-struct _db_code_state_;
-extern MYSQL_PLUGIN_IMPORT my_bool _dbug_on_;
-extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
-extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
-extern int _db_explain_init_(char *buf, size_t len);
-extern int _db_is_pushed_(void);
-extern void _db_setjmp_(void);
-extern void _db_longjmp_(void);
-extern void _db_process_(const char *name);
-extern void _db_push_(const char *control);
-extern void _db_pop_(void);
-extern void _db_set_(const char *control);
-extern void _db_set_init_(const char *control);
-extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
- struct _db_stack_frame_ *_stack_frame_);
-extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
-extern void _db_pargs_(uint _line_,const char *keyword);
-extern int _db_enabled_();
-extern void _db_doprnt_(const char *format,...)
- MY_ATTRIBUTE((format(printf, 1, 2)));
-extern void _db_doputs_(const char *log);
-extern void _db_dump_(uint _line_,const char *keyword,
- const unsigned char *memory, size_t length);
-extern void _db_end_(void);
-extern void _db_lock_file_(void);
-extern void _db_unlock_file_(void);
-extern FILE *_db_fp_(void);
-extern void _db_flush_();
-extern const char* _db_get_func_(void);
-
-#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
- _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
-#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_)
-#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
-#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
-#define DBUG_EXECUTE(keyword,a1) \
- do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
-#define DBUG_EXECUTE_IF(keyword,a1) \
- do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
-#define DBUG_EVALUATE(keyword,a1,a2) \
- (_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
-#define DBUG_EVALUATE_IF(keyword,a1,a2) \
- (_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
-#define DBUG_PRINT(keyword,arglist) \
- do \
- { \
- if (_dbug_on_) \
- { \
- _db_pargs_(__LINE__,keyword); \
- if (_db_enabled_()) \
- { \
- _db_doprnt_ arglist; \
- } \
- } \
- } while(0)
-
-/*
- An alternate to DBUG_PRINT() macro, which takes a single string
- as the second argument.
-*/
-#define DBUG_PUTS(keyword,arg) \
- do \
- { \
- if (_dbug_on_) \
- { \
- _db_pargs_(__LINE__,keyword); \
- if (_db_enabled_()) \
- { \
- _db_doputs_(arg); \
- } \
- } \
- } while(0)
-
-#define DBUG_PUSH(a1) _db_push_ (a1)
-#define DBUG_POP() _db_pop_ ()
-#define DBUG_SET(a1) _db_set_ (a1)
-#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
-#define DBUG_PROCESS(a1) _db_process_(a1)
-#define DBUG_FILE _db_fp_()
-#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
-#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
-#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
-#define DBUG_END() _db_end_ ()
-#define DBUG_LOCK_FILE _db_lock_file_()
-#define DBUG_UNLOCK_FILE _db_unlock_file_()
-#define DBUG_ASSERT(A) assert(A)
-#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
-#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
-#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
-#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
-#ifndef _WIN32
-#define DBUG_ABORT() (_db_flush_(), abort())
-#else
-/*
- Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
- call abort() instead of _exit(2) (now it would cause a "test signal" popup).
-*/
-#include
-#define DBUG_ABORT() (_db_flush_(),\
- (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
- (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
- _exit(2))
-#endif
-#define DBUG_CHECK_CRASH(func, op) \
- do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
- DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
-#define DBUG_CRASH_ENTER(func) \
- DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
-#define DBUG_CRASH_RETURN(val) \
- DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
-#define DBUG_CRASH_VOID_RETURN \
- DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
-
-/*
- Make the program fail, without creating a core file.
- abort() will send SIGABRT which (most likely) generates core.
- Use SIGKILL instead, which cannot be caught.
- We also pause the current thread, until the signal is actually delivered.
- An alternative would be to use _exit(EXIT_FAILURE),
- but then valgrind would report lots of memory leaks.
- */
-#ifdef _WIN32
-#define DBUG_SUICIDE() DBUG_ABORT()
-#else
-extern void _db_suicide_();
-extern void _db_flush_gcov_();
-#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
-#endif
-
-#else /* No debugger */
-
-#define DBUG_ENTER(a1)
-#define DBUG_LEAVE
-#define DBUG_RETURN(a1) do { return(a1); } while(0)
-#define DBUG_VOID_RETURN do { return; } while(0)
-#define DBUG_EXECUTE(keyword,a1) do { } while(0)
-#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
-#define DBUG_EVALUATE(keyword,a1,a2) (a2)
-#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
-#define DBUG_PRINT(keyword,arglist) do { } while(0)
-#define DBUG_PUTS(keyword,arg) do { } while(0)
-#define DBUG_LOG(keyword,arglist) do { } while(0)
-#define DBUG_PUSH(a1) do { } while(0)
-#define DBUG_SET(a1) do { } while(0)
-#define DBUG_SET_INITIAL(a1) do { } while(0)
-#define DBUG_POP() do { } while(0)
-#define DBUG_PROCESS(a1) do { } while(0)
-#define DBUG_SETJMP(a1) setjmp(a1)
-#define DBUG_LONGJMP(a1) longjmp(a1)
-#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
-#define DBUG_END() do { } while(0)
-#define DBUG_ASSERT(A) do { } while(0)
-#define DBUG_LOCK_FILE do { } while(0)
-#define DBUG_FILE (stderr)
-#define DBUG_UNLOCK_FILE do { } while(0)
-#define DBUG_EXPLAIN(buf,len)
-#define DBUG_EXPLAIN_INITIAL(buf,len)
-#define DEBUGGER_OFF do { } while(0)
-#define DEBUGGER_ON do { } while(0)
-#define DBUG_ABORT() do { } while(0)
-#define DBUG_CRASH_ENTER(func)
-#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
-#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
-#define DBUG_SUICIDE() do { } while(0)
-
-#endif
-
-#ifdef EXTRA_DEBUG
-/**
- Sync points allow us to force the server to reach a certain line of code
- and block there until the client tells the server it is ok to go on.
- The client tells the server to block with SELECT GET_LOCK()
- and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
- concurrency problems
-*/
-#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
- debug_sync_point(lock_name,lock_timeout)
-void debug_sync_point(const char* lock_name, uint lock_timeout);
-#else
-#define DBUG_SYNC_POINT(lock_name,lock_timeout)
-#endif /* EXTRA_DEBUG */
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-#if !defined(DBUG_OFF)
-#include
-
-/*
- A C++ interface to the DBUG_PUTS macro. The DBUG_LOG macro also
- takes two arguments. The first argument is the keyword, as that of the
- DBUG_PRINT. The 2nd argument 'v' will be passed to a C++ output stream.
- This enables the use of C++ style output stream operator. In the code, it
- will be used as follows:
-
- DBUG_LOG("blob", "space: " << space_id);
-
- Note: DBUG_PRINT() has a limitation of 1024 bytes for a single
- print out. This limitation is not there for DBUG_PUTS and DBUG_LOG
- macros.
-*/
-
-#define DBUG_LOG(keyword, v) do { \
- std::ostringstream sout; \
- sout << v; \
- DBUG_PUTS(keyword, sout.str().c_str()); \
-} while(0)
-#endif /* DBUG_OFF */
-#endif /* __cplusplus */
-
-#endif /* MY_DBUG_INCLUDED */
diff --git a/code/mysql/my_dir.h b/code/mysql/my_dir.h
deleted file mode 100644
index 3fb3e54..0000000
--- a/code/mysql/my_dir.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MY_DIR_H
-#define MY_DIR_H
-
-#include "my_global.h"
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /* Defines for my_dir and my_stat */
-
-#ifdef _WIN32
-#define S_IROTH _S_IREAD
-#define S_IFIFO _S_IFIFO
-#endif
-
-#define MY_S_IFMT S_IFMT /* type of file */
-#define MY_S_IFDIR S_IFDIR /* directory */
-#define MY_S_IFCHR S_IFCHR /* character special */
-#define MY_S_IFBLK S_IFBLK /* block special */
-#define MY_S_IFREG S_IFREG /* regular */
-#define MY_S_IFIFO S_IFIFO /* fifo */
-#define MY_S_ISUID S_ISUID /* set user id on execution */
-#define MY_S_ISGID S_ISGID /* set group id on execution */
-#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */
-#define MY_S_IREAD S_IREAD /* read permission, owner */
-#define MY_S_IWRITE S_IWRITE /* write permission, owner */
-#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */
-
-#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR)
-#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR)
-#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK)
-#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG)
-#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO)
-
-#define MY_DONT_SORT 512 /* my_lib; Don't sort files */
-#define MY_WANT_STAT 1024 /* my_lib; stat files */
-
- /* typedefs for my_dir & my_stat */
-
-#if(_MSC_VER)
-#define MY_STAT struct _stati64 /* 64 bit file size */
-#else
-#define MY_STAT struct stat /* Orginal struct have what we need */
-#endif
-
-/* Struct describing one file returned from my_dir */
-typedef struct fileinfo
-{
- char *name;
- MY_STAT *mystat;
-} FILEINFO;
-
-typedef struct st_my_dir /* Struct returned from my_dir */
-{
- /*
- These members are just copies of parts of DYNAMIC_ARRAY structure,
- which is allocated right after the end of MY_DIR structure (MEM_ROOT
- for storing names is also resides there). We've left them here because
- we don't want to change code that uses my_dir.
- */
- struct fileinfo *dir_entry;
- uint number_off_files;
-} MY_DIR;
-
-extern MY_DIR *my_dir(const char *path,myf MyFlags);
-extern void my_dirend(MY_DIR *buffer);
-extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
-extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MY_DIR_H */
-
diff --git a/code/mysql/my_getopt.h b/code/mysql/my_getopt.h
deleted file mode 100644
index d64aa75..0000000
--- a/code/mysql/my_getopt.h
+++ /dev/null
@@ -1,156 +0,0 @@
- /*
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _my_getopt_h
-#define _my_getopt_h
-
-#include "my_sys.h" /* loglevel */
-
-C_MODE_START
-
-#define GET_NO_ARG 1
-#define GET_BOOL 2
-#define GET_INT 3
-#define GET_UINT 4
-#define GET_LONG 5
-#define GET_ULONG 6
-#define GET_LL 7
-#define GET_ULL 8
-#define GET_STR 9
-#define GET_STR_ALLOC 10
-#define GET_DISABLED 11
-#define GET_ENUM 12
-#define GET_SET 13
-#define GET_DOUBLE 14
-#define GET_FLAGSET 15
-#define GET_PASSWORD 16
-
-#if SIZEOF_INT == 4
-#define GET_INT32 GET_INT
-#define GET_UINT32 GET_UINT
-#elif SIZEOF_LONG == 4
-#define GET_INT32 GET_LONG
-#define GET_UINT32 GET_ULONG
-#else
-#error Neither int or long is of 4 bytes width
-#endif
-
-#define GET_ASK_ADDR 128
-#define GET_TYPE_MASK 127
-
-/**
- Enumeration of the my_option::arg_type attributes.
- It should be noted that for historical reasons variables with the combination
- arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
- arguments. This is someone counter intuitive and care should be taken
- if the code is refactored.
-*/
-enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
-
-struct st_typelib;
-
-struct my_option
-{
- const char *name; /**< Name of the option. name=NULL
- marks the end of the my_option[]
- array.
- */
- int id; /**< For 0255 no short option
- is created, but a long option still
- can be identified uniquely in the
- my_get_one_option() callback.
- If an opton needs neither special
- treatment in the my_get_one_option()
- nor one-letter short equivalent
- use id=0.
- id=-1 is a special case and is used
- to generate deprecation warnings for
- plugin options. It should not be
- used for anything else.
- */
- const char *comment; /**< option comment, for autom. --help.
- if it's NULL the option is not
- visible in --help.
- */
- void *value; /**< A pointer to the variable value */
- void *u_max_value; /**< The user def. max variable value */
- struct st_typelib *typelib; /**< Pointer to possible values */
- ulong var_type; /**< GET_BOOL, GET_ULL, etc */
- enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
- longlong def_value; /**< Default value */
- longlong min_value; /**< Min allowed value (for numbers) */
- ulonglong max_value; /**< Max allowed value (for numbers) */
- longlong sub_size; /**< Unused */
- long block_size; /**< Value should be a mult. of this (for numbers) */
- void *app_type; /**< To be used by an application */
-};
-
-
-typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
-/**
- Used to retrieve a reference to the object (variable) that holds the value
- for the given option. For example, if var_type is GET_UINT, the function
- must return a pointer to a variable of type uint. A argument is stored in
- the location pointed to by the returned pointer.
-*/
-typedef void *(*my_getopt_value)(const char *, size_t, const struct my_option *,
- int *);
-
-
-extern char *disabled_my_option;
-extern my_bool my_getopt_print_errors;
-extern my_bool my_getopt_skip_unknown;
-extern my_error_reporter my_getopt_error_reporter;
-
-extern int handle_options (int *argc, char ***argv,
- const struct my_option *longopts, my_get_one_option);
-extern int my_handle_options (int *argc, char ***argv,
- const struct my_option *longopts,
- my_get_one_option,
- const char **command_list, my_bool ignore_unknown_option);
-extern void print_cmdline_password_warning();
-extern void my_cleanup_options(const struct my_option *options);
-extern void my_cleanup_options(const struct my_option *options);
-extern void my_print_help(const struct my_option *options);
-extern void my_print_variables(const struct my_option *options);
-extern void my_print_variables_ex(const struct my_option *options, FILE* file);
-extern void my_getopt_register_get_addr(my_getopt_value);
-
-ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
- my_bool *fix);
-longlong getopt_ll_limit_value(longlong, const struct my_option *,
- my_bool *fix);
-double getopt_double_limit_value(double num, const struct my_option *optp,
- my_bool *fix);
-my_bool getopt_compare_strings(const char *s, const char *t, uint length);
-ulonglong max_of_int_range(int var_type);
-
-ulonglong getopt_double2ulonglong(double);
-double getopt_ulonglong2double(ulonglong);
-
-C_MODE_END
-
-#endif /* _my_getopt_h */
-
diff --git a/code/mysql/my_global.h b/code/mysql/my_global.h
deleted file mode 100644
index 8bbc080..0000000
--- a/code/mysql/my_global.h
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MY_GLOBAL_INCLUDED
-#define MY_GLOBAL_INCLUDED
-
-/*
- This include file should be included first in every header file.
-
- This makes sure my_config.h is included to get platform specific
- symbols defined and it makes sure a lot of platform/compiler
- differences are mitigated.
-*/
-
-#include "my_config.h"
-
-#define __STDC_LIMIT_MACROS /* Enable C99 limit macros */
-#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */
-#define _USE_MATH_DEFINES /* Get access to M_PI, M_E, etc. in math.h */
-
-#ifdef _WIN32
-/* Include common headers.*/
-# include
-# include /* SOCKET */
-# include /* access(), chmod() */
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include /* Recommended by debian */
-#include
-
-#ifdef HAVE_SYS_SOCKET_H
-#include
-#endif
-#if !defined(_WIN32)
-#include
-#endif
-#ifdef MY_MSCRT_DEBUG
-#include
-#endif
-
-/*
- A lot of our programs uses asserts, so better to always include it
- This also fixes a problem when people uses DBUG_ASSERT without including
- assert.h
-*/
-#include
-
-/* Include standard definitions of operator new and delete. */
-#ifdef __cplusplus
-# include
-#endif
-
-#include "my_compiler.h"
-
-
-/*
- InnoDB depends on some MySQL internals which other plugins should not
- need. This is because of InnoDB's foreign key support, "safe" binlog
- truncation, and other similar legacy features.
-
- We define accessors for these internals unconditionally, but do not
- expose them in mysql/plugin.h. They are declared in ha_innodb.h for
- InnoDB's use.
-*/
-#define INNODB_COMPATIBILITY_HOOKS
-
-/* Macros to make switching between C and C++ mode easier */
-#ifdef __cplusplus
-#define C_MODE_START extern "C" {
-#define C_MODE_END }
-#else
-#define C_MODE_START
-#define C_MODE_END
-#endif
-
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
-#define HAVE_PSI_INTERFACE
-#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
-
-/* Make it easier to add conditional code in _expressions_ */
-#ifdef _WIN32
-#define IF_WIN(A,B) A
-#else
-#define IF_WIN(A,B) B
-#endif
-
-#if defined (_WIN32)
-/*
- off_t is 32 bit long. We do not use C runtime functions
- with off_t but native Win32 file IO APIs, that work with
- 64 bit offsets.
-*/
-#undef SIZEOF_OFF_T
-#define SIZEOF_OFF_T 8
-
-static inline void sleep(unsigned long seconds)
-{
- Sleep(seconds * 1000);
-}
-
-/* Define missing access() modes. */
-#define F_OK 0
-#define W_OK 2
-#define R_OK 4 /* Test for read permission. */
-
-/* Define missing file locking constants. */
-#define F_RDLCK 1
-#define F_WRLCK 2
-#define F_UNLCK 3
-#define F_TO_EOF 0x3FFFFFFF
-
-#define O_NONBLOCK 1 /* For emulation of fcntl() */
-
-/*
- SHUT_RDWR is called SD_BOTH in windows and
- is defined to 2 in winsock2.h
- #define SD_BOTH 0x02
-*/
-#define SHUT_RDWR 0x02
-
-/* Shared memory and named pipe connections are supported. */
-#define shared_memory_buffer_length 16000
-#define default_shared_memory_base_name "MYSQL"
-#endif /* _WIN32*/
-
-/**
- Cast a member of a structure to the structure that contains it.
-
- @param ptr Pointer to the member.
- @param type Type of the structure that contains the member.
- @param member Name of the member within the structure.
-*/
-#define my_container_of(ptr, type, member) \
- ((type *)((char *)ptr - offsetof(type, member)))
-
-/* an assert that works at compile-time. only for constant expression */
-#define compile_time_assert(X) \
- do \
- { \
- typedef char compile_time_assert[(X) ? 1 : -1] MY_ATTRIBUTE((unused)); \
- } while(0)
-
-#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
-#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
-
-#ifdef _WIN32
-#define SO_EXT ".dll"
-#elif defined(__APPLE__)
-#define SO_EXT ".dylib"
-#else
-#define SO_EXT ".so"
-#endif
-
-#if !defined(HAVE_UINT)
-typedef unsigned int uint;
-typedef unsigned short ushort;
-#endif
-
-#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
-#define MY_TEST(a) ((a) ? 1 : 0)
-#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
-#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
-#define test_all_bits(a,b) (((a) & (b)) == (b))
-#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
-
-/* Define some general constants */
-#ifndef TRUE
-#define TRUE (1) /* Logical true */
-#define FALSE (0) /* Logical false */
-#endif
-
-/* Some types that is different between systems */
-
-typedef int File; /* File descriptor */
-#ifdef _WIN32
-typedef SOCKET my_socket;
-#else
-typedef int my_socket; /* File descriptor for sockets */
-#define INVALID_SOCKET -1
-#endif
-C_MODE_START
-typedef void (*sig_return)();/* Returns type from signal */
-C_MODE_END
-#if defined(__GNUC__)
-typedef char pchar; /* Mixed prototypes can take char */
-typedef char pbool; /* Mixed prototypes can take char */
-#else
-typedef int pchar; /* Mixed prototypes can't take char */
-typedef int pbool; /* Mixed prototypes can't take char */
-#endif
-C_MODE_START
-typedef int (*qsort_cmp)(const void *,const void *);
-typedef int (*qsort_cmp2)(const void*, const void *,const void *);
-C_MODE_END
-#ifdef _WIN32
-typedef int socket_len_t;
-typedef int sigset_t;
-typedef int mode_t;
-typedef SSIZE_T ssize_t;
-#else
-typedef socklen_t socket_len_t;
-#endif
-typedef socket_len_t SOCKET_SIZE_TYPE; /* Used by NDB */
-
-/* file create flags */
-
-#ifndef O_SHARE /* Probably not windows */
-#define O_SHARE 0 /* Flag to my_open for shared files */
-#ifndef O_BINARY
-#define O_BINARY 0 /* Flag to my_open for binary files */
-#endif
-#ifndef FILE_BINARY
-#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */
-#endif
-#ifdef HAVE_FCNTL
-#define HAVE_FCNTL_LOCK
-#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
-#endif
-#endif /* O_SHARE */
-
-#ifndef O_TEMPORARY
-#define O_TEMPORARY 0
-#endif
-#ifndef O_SHORT_LIVED
-#define O_SHORT_LIVED 0
-#endif
-#ifndef O_NOFOLLOW
-#define O_NOFOLLOW 0
-#endif
-
-/* additional file share flags for win32 */
-#ifdef _WIN32
-#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
-#define _SH_DENYWRD 0x120 /* deny write mode & delete */
-#define _SH_DENYRDD 0x130 /* deny read mode & delete */
-#define _SH_DENYDEL 0x140 /* deny delete only */
-#endif /* _WIN32 */
-
-
-/* General constants */
-#define FN_LEN 256 /* Max file name len */
-#define FN_HEADLEN 253 /* Max length of filepart of file name */
-#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
-#define FN_REFLEN 512 /* Max length of full path-name */
-#define FN_REFLEN_SE 4000 /* Max length of full path-name in SE */
-#define FN_EXTCHAR '.'
-#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
-#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
-#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
-
-#ifdef _WIN32
-#define FN_LIBCHAR '\\'
-#define FN_LIBCHAR2 '/'
-#define FN_DIRSEP "/\\" /* Valid directory separators */
-#define FN_EXEEXT ".exe"
-#define FN_SOEXT ".dll"
-#define FN_ROOTDIR "\\"
-#define FN_DEVCHAR ':'
-#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
-#else
-#define FN_LIBCHAR '/'
-/*
- FN_LIBCHAR2 is not defined on !Windows. Use is_directory_separator().
-*/
-#define FN_DIRSEP "/" /* Valid directory separators */
-#define FN_EXEEXT ""
-#define FN_SOEXT ".so"
-#define FN_ROOTDIR "/"
-#endif
-
-static inline int is_directory_separator(char c)
-{
-#ifdef _WIN32
- return c == FN_LIBCHAR || c == FN_LIBCHAR2;
-#else
- return c == FN_LIBCHAR;
-#endif
-}
-
-/*
- MY_FILE_MIN is Windows speciality and is used to quickly detect
- the mismatch of CRT and mysys file IO usage on Windows at runtime.
- CRT file descriptors can be in the range 0-2047, whereas descriptors returned
- by my_open() will start with 2048. If a file descriptor with value less then
- MY_FILE_MIN is passed to mysys IO function, chances are it stemms from
- open()/fileno() and not my_open()/my_fileno.
-
- For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN
- is logically 0.
-*/
-
-#ifdef _WIN32
-#define MY_FILE_MIN 2048
-#else
-#define MY_FILE_MIN 0
-#endif
-
-/*
- MY_NFILE is the default size of my_file_info array.
-
- It is larger on Windows, because it all file handles are stored in my_file_info
- Default size is 16384 and this should be enough for most cases.If it is not
- enough, --max-open-files with larger value can be used.
-
- For Posix , my_file_info array is only used to store filenames for
- error reporting and its size is not a limitation for number of open files.
-*/
-#ifdef _WIN32
-#define MY_NFILE (16384 + MY_FILE_MIN)
-#else
-#define MY_NFILE 64
-#endif
-
-#define OS_FILE_LIMIT UINT_MAX
-
-/*
- Io buffer size; Must be a power of 2 and a multiple of 512. May be
- smaller what the disk page size. This influences the speed of the
- isam btree library. eg to big to slow.
-*/
-#define IO_SIZE 4096
-/*
- How much overhead does malloc have. The code often allocates
- something like 1024-MALLOC_OVERHEAD bytes
-*/
-#define MALLOC_OVERHEAD 8
-
- /* get memory in huncs */
-#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
- /* Typical record cash */
-#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
- /* Typical key cash */
-#define KEY_CACHE_SIZE (uint) (8*1024*1024)
- /* Default size of a key cache block */
-#define KEY_CACHE_BLOCK_SIZE (uint) 1024
-
-
-/* Some defines of functions for portability */
-
-#if (_WIN32)
-#if !defined(_WIN64)
-inline double my_ulonglong2double(unsigned long long value)
-{
- long long nr=(long long) value;
- if (nr >= 0)
- return (double) nr;
- return (18446744073709551616.0 + (double) nr);
-}
-#define ulonglong2double my_ulonglong2double
-#define my_off_t2double my_ulonglong2double
-#endif /* _WIN64 */
-inline unsigned long long my_double2ulonglong(double d)
-{
- double t= d - (double) 0x8000000000000000ULL;
-
- if (t >= 0)
- return ((unsigned long long) t) + 0x8000000000000000ULL;
- return (unsigned long long) d;
-}
-#define double2ulonglong my_double2ulonglong
-#endif /* _WIN32 */
-
-#ifndef ulonglong2double
-#define ulonglong2double(A) ((double) (ulonglong) (A))
-#define my_off_t2double(A) ((double) (my_off_t) (A))
-#endif
-#ifndef double2ulonglong
-#define double2ulonglong(A) ((ulonglong) (double) (A))
-#endif
-
-#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
-#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL
-#define INT_MIN32 (~0x7FFFFFFFL)
-#define INT_MAX32 0x7FFFFFFFL
-#define UINT_MAX32 0xFFFFFFFFL
-#define INT_MIN24 (~0x007FFFFF)
-#define INT_MAX24 0x007FFFFF
-#define UINT_MAX24 0x00FFFFFF
-#define INT_MIN16 (~0x7FFF)
-#define INT_MAX16 0x7FFF
-#define UINT_MAX16 0xFFFF
-#define INT_MIN8 (~0x7F)
-#define INT_MAX8 0x7F
-#define UINT_MAX8 0xFF
-
-#ifndef SIZE_T_MAX
-#define SIZE_T_MAX (~((size_t) 0))
-#endif
-
-// Our ifdef trickery for my_isfinite does not work with gcc/solaris unless we:
-#ifdef HAVE_IEEEFP_H
-#include
-#endif
-
-#if (__cplusplus >= 201103L)
- /* For C++11 use the new std functions rather than C99 macros. */
- #include
- #define my_isfinite(X) std::isfinite(X)
- #define my_isnan(X) std::isnan(X)
- #define my_isinf(X) std::isinf(X)
-#else
- #ifdef HAVE_LLVM_LIBCPP /* finite is deprecated in libc++ */
- #define my_isfinite(X) isfinite(X)
- #elif defined _WIN32
- #define my_isfinite(X) _finite(X)
- #else
- #define my_isfinite(X) finite(X)
- #endif
- #define my_isnan(X) isnan(X)
- #ifdef HAVE_ISINF
- /* System-provided isinf() is available and safe to use */
- #define my_isinf(X) isinf(X)
- #else /* !HAVE_ISINF */
- #define my_isinf(X) (!my_isfinite(X) && !my_isnan(X))
- #endif
-#endif /* __cplusplus >= 201103L */
-
-/*
- Max size that must be added to a so that we know Size to make
- adressable obj.
-*/
-#if SIZEOF_CHARP == 4
-typedef long my_ptrdiff_t;
-#else
-typedef long long my_ptrdiff_t;
-#endif
-
-#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
-#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
-/* Size to make adressable obj. */
-#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
-#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
-
-/*
- Custom version of standard offsetof() macro which can be used to get
- offsets of members in class for non-POD types (according to the current
- version of C++ standard offsetof() macro can't be used in such cases and
- attempt to do so causes warnings to be emitted, OTOH in many cases it is
- still OK to assume that all instances of the class has the same offsets
- for the same members).
-
- This is temporary solution which should be removed once File_parser class
- and related routines are refactored.
-*/
-
-#define my_offsetof(TYPE, MEMBER) \
- ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
-
-#define NullS (char *) 0
-
-#ifdef _WIN32
-#define STDCALL __stdcall
-#else
-#define STDCALL
-#endif
-
-/* Typdefs for easyier portability */
-
-typedef unsigned char uchar; /* Short for unsigned char */
-typedef signed char int8; /* Signed integer >= 8 bits */
-typedef unsigned char uint8; /* Unsigned integer >= 8 bits */
-typedef short int16;
-typedef unsigned short uint16;
-#if SIZEOF_INT == 4
-typedef int int32;
-typedef unsigned int uint32;
-#elif SIZEOF_LONG == 4
-typedef long int32;
-typedef unsigned long uint32;
-#else
-#error Neither int or long is of 4 bytes width
-#endif
-
-#if !defined(HAVE_ULONG)
-typedef unsigned long ulong; /* Short for unsigned long */
-#endif
-/*
- Using [unsigned] long long is preferable as [u]longlong because we use
- [unsigned] long long unconditionally in many places,
- for example in constants with [U]LL suffix.
-*/
-typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
-typedef long long int longlong;
-typedef longlong int64;
-typedef ulonglong uint64;
-
-#if defined (_WIN32)
-typedef unsigned __int64 my_ulonglong;
-#else
-typedef unsigned long long my_ulonglong;
-#endif
-
-#if SIZEOF_CHARP == SIZEOF_INT
-typedef int intptr;
-#elif SIZEOF_CHARP == SIZEOF_LONG
-typedef long intptr;
-#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
-typedef long long intptr;
-#else
-#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
-#endif
-
-#define MY_ERRPTR ((void*)(intptr)1)
-
-#if defined(_WIN32)
-typedef unsigned long long my_off_t;
-typedef unsigned long long os_off_t;
-#else
-typedef off_t os_off_t;
-#if SIZEOF_OFF_T > 4
-typedef ulonglong my_off_t;
-#else
-typedef unsigned long my_off_t;
-#endif
-#endif /*_WIN32*/
-#define MY_FILEPOS_ERROR (~(my_off_t) 0)
-
-/*
- TODO Convert these to use Bitmap class.
- */
-typedef ulonglong table_map; /* Used for table bits in join */
-typedef ulonglong nesting_map; /* Used for flags of nesting constructs */
-
-#if defined(_WIN32)
-#define socket_errno WSAGetLastError()
-#define SOCKET_EINTR WSAEINTR
-#define SOCKET_EAGAIN WSAEINPROGRESS
-#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
-#define SOCKET_EADDRINUSE WSAEADDRINUSE
-#define SOCKET_ETIMEDOUT WSAETIMEDOUT
-#define SOCKET_ECONNRESET WSAECONNRESET
-#define SOCKET_ENFILE ENFILE
-#define SOCKET_EMFILE EMFILE
-#else /* Unix */
-#define socket_errno errno
-#define closesocket(A) close(A)
-#define SOCKET_EINTR EINTR
-#define SOCKET_EAGAIN EAGAIN
-#define SOCKET_EWOULDBLOCK EWOULDBLOCK
-#define SOCKET_EADDRINUSE EADDRINUSE
-#define SOCKET_ETIMEDOUT ETIMEDOUT
-#define SOCKET_ECONNRESET ECONNRESET
-#define SOCKET_ENFILE ENFILE
-#define SOCKET_EMFILE EMFILE
-#endif
-
-typedef int myf; /* Type of MyFlags in my_funcs */
-typedef char my_bool; /* Small bool */
-
-/* Macros for converting *constants* to the right type */
-#define MYF(v) (myf) (v)
-
-/* Some helper macros */
-#define YESNO(X) ((X) ? "yes" : "no")
-
-#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
-
-#include
-
-#ifdef HAVE_CHARSET_utf8
-#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
-#else
-#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
-#endif
-
-#if defined(_WIN32)
-#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
-#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
-#define dlclose(lib) FreeLibrary((HMODULE)lib)
-#ifndef HAVE_DLOPEN
-#define HAVE_DLOPEN
-#endif
-#define DLERROR_GENERATE(errmsg, error_number) \
- char win_errormsg[2048]; \
- if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, \
- 0, error_number, 0, win_errormsg, 2048, NULL)) \
- { \
- char *ptr; \
- for (ptr= &win_errormsg[0] + strlen(win_errormsg) - 1; \
- ptr >= &win_errormsg[0] && strchr("\r\n\t\0x20", *ptr); \
- ptr--) \
- *ptr= 0; \
- errmsg= win_errormsg; \
- } \
- else \
- errmsg= ""
-#define dlerror() ""
-#define dlopen_errno GetLastError()
-
-#else /* _WIN32 */
-#define DLERROR_GENERATE(errmsg, error_number) errmsg= dlerror()
-#define dlopen_errno errno
-#endif /* _WIN32 */
-
-/* Length of decimal number represented by INT32. */
-#define MY_INT32_NUM_DECIMAL_DIGITS 11U
-
-/* Length of decimal number represented by INT64. */
-#define MY_INT64_NUM_DECIMAL_DIGITS 21U
-
-/* Define some useful general macros (should be done after all headers). */
-#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
-
-#if !defined(__cplusplus) && !defined(bool)
-#define bool In_C_you_should_use_my_bool_instead()
-#endif
-
-/*
- MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
- (i.e variables) for usage in storage engine loadable plugins.
- Outside of Windows, it is dummy.
-*/
-#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
-#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
-#else
-#define MYSQL_PLUGIN_IMPORT
-#endif
-
-#include
-
-#ifdef EMBEDDED_LIBRARY
-#define NO_EMBEDDED_ACCESS_CHECKS
-/* Things we don't need in the embedded version of MySQL */
-#undef HAVE_OPENSSL
-#endif /* EMBEDDED_LIBRARY */
-
-
-enum loglevel {
- ERROR_LEVEL= 0,
- WARNING_LEVEL= 1,
- INFORMATION_LEVEL= 2
-};
-
-
-#ifdef _WIN32
-/****************************************************************************
-** Replacements for localtime_r and gmtime_r
-****************************************************************************/
-
-static inline struct tm *localtime_r(const time_t *timep, struct tm *tmp)
-{
- localtime_s(tmp, timep);
- return tmp;
-}
-
-static inline struct tm *gmtime_r(const time_t *clock, struct tm *res)
-{
- gmtime_s(res, clock);
- return res;
-}
-#endif /* _WIN32 */
-
-#ifndef HAVE_STRUCT_TIMESPEC /* Windows before VS2015 */
-/*
- Declare a union to make sure FILETIME is properly aligned
- so it can be used directly as a 64 bit value. The value
- stored is in 100ns units.
-*/
-union ft64 {
- FILETIME ft;
- __int64 i64;
- };
-
-struct timespec {
- union ft64 tv;
- /* The max timeout value in millisecond for native_cond_timedwait */
- long max_timeout_msec;
-};
-
-#endif /* !HAVE_STRUCT_TIMESPEC */
-
-C_MODE_START
-extern ulonglong my_getsystime(void);
-C_MODE_END
-
-static inline void set_timespec_nsec(struct timespec *abstime, ulonglong nsec)
-{
-#ifdef HAVE_STRUCT_TIMESPEC
- ulonglong now= my_getsystime() + (nsec / 100);
- ulonglong tv_sec= now / 10000000ULL;
-#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
- /* Ensure that the number of seconds don't overflow. */
- tv_sec= MY_MIN(tv_sec, ((ulonglong)INT_MAX32));
-#endif
- abstime->tv_sec= (time_t)tv_sec;
- abstime->tv_nsec= (now % 10000000ULL) * 100 + (nsec % 100);
-#else /* !HAVE_STRUCT_TIMESPEC */
- ulonglong max_timeout_msec= (nsec / 1000000);
- union ft64 tv;
- GetSystemTimeAsFileTime(&tv.ft);
- abstime->tv.i64= tv.i64 + (__int64)(nsec / 100);
-#if SIZEOF_LONG < SIZEOF_LONG_LONG
- /* Ensure that the msec value doesn't overflow. */
- max_timeout_msec= MY_MIN(max_timeout_msec, ((ulonglong)INT_MAX32));
-#endif
- abstime->max_timeout_msec= (long)max_timeout_msec;
-#endif /* !HAVE_STRUCT_TIMESPEC */
-}
-
-static inline void set_timespec(struct timespec *abstime, ulonglong sec)
-{
- set_timespec_nsec(abstime, sec * 1000000000ULL);
-}
-
-/**
- Compare two timespec structs.
-
- @retval 1 If ts1 ends after ts2.
- @retval -1 If ts1 ends before ts2.
- @retval 0 If ts1 is equal to ts2.
-*/
-static inline int cmp_timespec(struct timespec *ts1, struct timespec *ts2)
-{
-#ifdef HAVE_STRUCT_TIMESPEC
- if (ts1->tv_sec > ts2->tv_sec ||
- (ts1->tv_sec == ts2->tv_sec && ts1->tv_nsec > ts2->tv_nsec))
- return 1;
- if (ts1->tv_sec < ts2->tv_sec ||
- (ts1->tv_sec == ts2->tv_sec && ts1->tv_nsec < ts2->tv_nsec))
- return -1;
-#else
- if (ts1->tv.i64 > ts2->tv.i64)
- return 1;
- if (ts1->tv.i64 < ts2->tv.i64)
- return -1;
-#endif
- return 0;
-}
-
-static inline ulonglong diff_timespec(struct timespec *ts1, struct timespec *ts2)
-{
-#ifdef HAVE_STRUCT_TIMESPEC
- return (ts1->tv_sec - ts2->tv_sec) * 1000000000ULL +
- ts1->tv_nsec - ts2->tv_nsec;
-#else
- return (ts1->tv.i64 - ts2->tv.i64) * 100;
-#endif
-}
-
-#ifdef _WIN32
-typedef int MY_MODE;
-#else
-typedef mode_t MY_MODE;
-#endif /* _WIN32 */
-
-/* File permissions */
-#define USER_READ (1L << 0)
-#define USER_WRITE (1L << 1)
-#define USER_EXECUTE (1L << 2)
-#define GROUP_READ (1L << 3)
-#define GROUP_WRITE (1L << 4)
-#define GROUP_EXECUTE (1L << 5)
-#define OTHERS_READ (1L << 6)
-#define OTHERS_WRITE (1L << 7)
-#define OTHERS_EXECUTE (1L << 8)
-#define USER_RWX USER_READ | USER_WRITE | USER_EXECUTE
-#define GROUP_RWX GROUP_READ | GROUP_WRITE | GROUP_EXECUTE
-#define OTHERS_RWX OTHERS_READ | OTHERS_WRITE | OTHERS_EXECUTE
-
-/* Defaults */
-#define DEFAULT_SSL_CA_CERT "ca.pem"
-#define DEFAULT_SSL_CA_KEY "ca-key.pem"
-#define DEFAULT_SSL_SERVER_CERT "server-cert.pem"
-#define DEFAULT_SSL_SERVER_KEY "server-key.pem"
-
-#if defined(_WIN32) || defined(_WIN64)
- #define strcasecmp _stricmp
-#endif
-#endif // MY_GLOBAL_INCLUDED
diff --git a/code/mysql/my_list.h b/code/mysql/my_list.h
deleted file mode 100644
index 9432d44..0000000
--- a/code/mysql/my_list.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _list_h_
-#define _list_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct st_list {
- struct st_list *prev,*next;
- void *data;
-} LIST;
-
-typedef int (*list_walk_action)(void *,void *);
-
-extern LIST *list_add(LIST *root,LIST *element);
-extern LIST *list_delete(LIST *root,LIST *element);
-extern LIST *list_cons(void *data,LIST *root);
-extern LIST *list_reverse(LIST *root);
-extern void list_free(LIST *root,unsigned int free_data);
-extern unsigned int list_length(LIST *);
-extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
-
-#define list_rest(a) ((a)->next)
-#define list_push(a,b) (a)=list_cons((b),(a))
-#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/code/mysql/my_sys.h b/code/mysql/my_sys.h
deleted file mode 100644
index 77d028d..0000000
--- a/code/mysql/my_sys.h
+++ /dev/null
@@ -1,992 +0,0 @@
-/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _my_sys_h
-#define _my_sys_h
-
-#include "my_global.h" /* C_MODE_START, C_MODE_END */
-#include "m_ctype.h" /* for CHARSET_INFO */
-
-#include "my_thread.h" /* Needed for psi.h */
-#include "mysql/psi/psi.h"
-#include "mysql/service_mysql_alloc.h"
-#include "mysql/psi/mysql_memory.h"
-#include "mysql/psi/mysql_thread.h"
-
-#ifdef HAVE_ALLOCA_H
-#include
-#endif
-#ifdef _WIN32
-#include
-#endif
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-#include
-
-C_MODE_START
-
-#ifdef HAVE_VALGRIND
-# include
-# define MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4) VALGRIND_MALLOCLIKE_BLOCK(p1, p2, p3, p4)
-# define MEM_FREELIKE_BLOCK(p1, p2) VALGRIND_FREELIKE_BLOCK(p1, p2)
-# include
-# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
-# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
-# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
-#else /* HAVE_VALGRIND */
-# define MEM_MALLOCLIKE_BLOCK(p1, p2, p3, p4) do {} while (0)
-# define MEM_FREELIKE_BLOCK(p1, p2) do {} while (0)
-# define MEM_UNDEFINED(a,len) ((void) 0)
-# define MEM_NOACCESS(a,len) ((void) 0)
-# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
-#endif /* HAVE_VALGRIND */
-
-#include
-
-#define MY_INIT(name) { my_progname= name; my_init(); }
-
-/**
- Max length of an error message generated by mysys utilities.
- Some mysys functions produce error messages. These mostly go
- to stderr.
- This constant defines the size of the buffer used to format
- the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
- since sometimes mysys errors are stored in the server diagnostics
- area, and we would like to avoid unexpected truncation.
-*/
-#define MYSYS_ERRMSG_SIZE (512)
-#define MYSYS_STRERROR_SIZE (128)
-
-#define MY_FILE_ERROR ((size_t) -1)
-
- /* General bitmaps for my_func's */
-#define MY_FFNF 1 /* Fatal if file not found */
-#define MY_FNABP 2 /* Fatal if not all bytes read/writen */
-#define MY_NABP 4 /* Error if not all bytes read/writen */
-#define MY_FAE 8 /* Fatal if any error */
-#define MY_WME 16 /* Write message on error */
-#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
-#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
-#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */
-#define MY_UNUSED 64 /* Unused (was support for RAID) */
-#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
-#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
-#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
-#define MY_COPYTIME 64 /* my_redel() copys time */
-#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
-#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
-#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
-#define MY_REDEL_MAKE_BACKUP 256
-#define MY_REDEL_NO_COPY_STAT 512 /* my_redel() doesn't call my_copystat() */
-#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
-#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
-#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
-#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
-#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
-#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
-#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
-#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
-#define MY_SYNC 4096 /* my_copy(): sync dst file */
-
-#define MYF_RW MYF(MY_WME+MY_NABP) /* For my_read & my_write */
-
-#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
-#define MY_GIVE_INFO 2 /* Give time info about process*/
-#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
-
-/* Flags for my_error() */
-#define ME_BELL 4 /* DEPRECATED: Ring bell then printing message */
-#define ME_ERRORLOG 64 /* Write the error message to error log */
-#define ME_FATALERROR 1024 /* Fatal statement error */
-
- /* Bits in last argument to fn_format */
-#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
-#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */
-#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */
-#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */
-#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */
-#define MY_RETURN_REAL_PATH 32 /* return full path for file */
-#define MY_SAFE_PATH 64 /* Return NULL if too long path */
-#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
-#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/
-
-
- /* My seek flags */
-#define MY_SEEK_SET 0
-#define MY_SEEK_CUR 1
-#define MY_SEEK_END 2
-
- /* Some constants */
-#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */
-#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */
-#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */
-#define DFLT_INIT_HITS 3
-
- /* root_alloc flags */
-#define MY_KEEP_PREALLOC 1
-#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */
-
- /* Internal error numbers (for assembler functions) */
-#define MY_ERRNO_EDOM 33
-#define MY_ERRNO_ERANGE 34
-
- /* Bits for get_date timeflag */
-#define GETDATE_DATE_TIME 1
-#define GETDATE_SHORT_DATE 2
-#define GETDATE_HHMMSSTIME 4
-#define GETDATE_GMT 8
-#define GETDATE_FIXEDLENGTH 16
-#define GETDATE_T_DELIMITER 32
-#define GETDATE_SHORT_DATE_FULL_YEAR 64
-
- /* defines when allocating data */
-extern void *my_multi_malloc(PSI_memory_key key, myf flags, ...);
-
-/*
- Switch to my_malloc() if the memory block to be allocated is bigger than
- max_alloca_sz.
-*/
-extern PSI_memory_key key_memory_max_alloca;
-#define my_safe_alloca(size, max_alloca_sz) ((size <= max_alloca_sz) ? \
- my_alloca(size) : \
- my_malloc(key_memory_max_alloca, size, MYF(0)))
-#define my_safe_afree(ptr, size, max_alloca_sz) if (size > max_alloca_sz) \
- my_free(ptr)
-
-#if !defined(DBUG_OFF) || defined(HAVE_VALGRIND)
-/**
- Put bad content in memory to be sure it will segfault if dereferenced.
- With Valgrind, verify that memory is addressable, and mark it undefined.
- We cache value of B because if B is expression which depends on A, memset()
- trashes value of B.
-*/
-#define TRASH(A,B) do { \
- void *p = (A); \
- const size_t l= (B); \
- MEM_CHECK_ADDRESSABLE(A, l); \
- memset(p, 0x8F, l); \
- MEM_UNDEFINED(A, l); \
- } while (0)
-#else
-#define TRASH(A,B) do {} while(0)
-#endif
-#if defined(ENABLED_DEBUG_SYNC)
-extern void (*debug_sync_C_callback_ptr)(const char *, size_t);
-#define DEBUG_SYNC_C(_sync_point_name_) do { \
- if (debug_sync_C_callback_ptr != NULL) \
- (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \
- while(0)
-#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) do { \
- if (debug_sync_C_callback_ptr != NULL && thd) \
- (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \
- while(0)
-#else
-#define DEBUG_SYNC_C(_sync_point_name_)
-#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_)
-#endif /* defined(ENABLED_DEBUG_SYNC) */
-
-#ifdef HAVE_LINUX_LARGE_PAGES
-extern uint my_get_large_page_size(void);
-extern uchar * my_large_malloc(PSI_memory_key key, size_t size, myf my_flags);
-extern void my_large_free(uchar *ptr);
-extern my_bool my_use_large_pages;
-extern uint my_large_page_size;
-#else
-#define my_get_large_page_size() (0)
-#define my_large_malloc(A,B,C) my_malloc((A),(B),(C))
-#define my_large_free(A) my_free((A))
-#endif /* HAVE_LINUX_LARGE_PAGES */
-
-#define my_alloca(SZ) alloca((size_t) (SZ))
-
-#include /* errno is a define */
-
-extern char *home_dir; /* Home directory for user */
-extern const char *my_progname; /* program-name (printed in errors) */
-extern char curr_dir[]; /* Current directory for user */
-extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
-extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
- myf MyFlags);
-extern void (*local_message_hook)(enum loglevel ll,
- const char *format, va_list args);
-extern uint my_file_limit;
-extern MYSQL_PLUGIN_IMPORT ulong my_thread_stack_size;
-
-/*
- Hooks for reporting execution stage information. The server implementation
- of these will also set THD::current_cond/current_mutex.
- By having hooks, we avoid direct dependencies on server code.
-*/
-extern void (*enter_cond_hook)(void *opaque_thd,
- mysql_cond_t *cond,
- mysql_mutex_t *mutex,
- const PSI_stage_info *stage,
- PSI_stage_info *old_stage,
- const char *src_function,
- const char *src_file,
- int src_line);
-
-extern void (*exit_cond_hook)(void *opaque_thd,
- const PSI_stage_info *stage,
- const char *src_function,
- const char *src_file,
- int src_line);
-
-/*
- Hook for checking if the thread has been killed.
-*/
-extern int (*is_killed_hook)(const void *opaque_thd);
-
-/* charsets */
-#define MY_ALL_CHARSETS_SIZE 2048
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
-extern CHARSET_INFO compiled_charsets[];
-
-/* statistics */
-extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
-extern ulong my_file_total_opened;
-extern my_bool my_init_done;
-
-extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
-extern int my_umask_dir;
-
-extern ulong my_default_record_cache_size;
-extern my_bool my_disable_locking,
- my_enable_symlinks;
-extern char wild_many,wild_one,wild_prefix;
-extern const char *charsets_dir;
-
-enum cache_type
-{
- TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
- SEQ_READ_APPEND /* sequential read or append */,
- READ_FIFO, READ_NET,WRITE_NET};
-
-enum flush_type
-{
- FLUSH_KEEP, /* flush block and keep it in the cache */
- FLUSH_RELEASE, /* flush block and remove it from the cache */
- FLUSH_IGNORE_CHANGED, /* remove block from the cache */
- /*
- As my_disable_flush_pagecache_blocks is always 0, the following option
- is strictly equivalent to FLUSH_KEEP
- */
- FLUSH_FORCE_WRITE
-};
-
-enum file_type
-{
- UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
- FILE_BY_MKSTEMP, FILE_BY_DUP
-};
-
-struct st_my_file_info
-{
- char *name;
-#ifdef _WIN32
- HANDLE fhandle; /* win32 file handle */
- int oflag; /* open flags, e.g O_APPEND */
-#endif
- enum file_type type;
-};
-
-extern struct st_my_file_info *my_file_info;
-
-/* needed for client-only build */
-#ifndef PSI_FILE_KEY_DEFINED
-typedef unsigned int PSI_file_key;
-#define PSI_FILE_KEY_DEFINED
-#endif
-
-typedef struct st_dynamic_array
-{
- uchar *buffer;
- uint elements,max_element;
- uint alloc_increment;
- uint size_of_element;
- PSI_memory_key m_psi_key;
-} DYNAMIC_ARRAY;
-
-typedef struct st_my_tmpdir
-{
- char **list;
- uint cur, max;
- mysql_mutex_t mutex;
-} MY_TMPDIR;
-
-typedef struct st_dynamic_string
-{
- char *str;
- size_t length,max_length,alloc_increment;
-} DYNAMIC_STRING;
-
-struct st_io_cache;
-typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
-
-typedef struct st_io_cache_share
-{
- mysql_mutex_t mutex; /* To sync on reads into buffer. */
- mysql_cond_t cond; /* To wait for signals. */
- mysql_cond_t cond_writer; /* For a synchronized writer. */
- /* Offset in file corresponding to the first byte of buffer. */
- my_off_t pos_in_file;
- /* If a synchronized write cache is the source of the data. */
- struct st_io_cache *source_cache;
- uchar *buffer; /* The read buffer. */
- uchar *read_end; /* Behind last valid byte of buffer. */
- int running_threads; /* threads not in lock. */
- int total_threads; /* threads sharing the cache. */
- int error; /* Last error. */
-} IO_CACHE_SHARE;
-
-typedef struct st_io_cache /* Used when cacheing files */
-{
- /* Offset in file corresponding to the first byte of uchar* buffer. */
- my_off_t pos_in_file;
- /*
- The offset of end of file for READ_CACHE and WRITE_CACHE.
- For SEQ_READ_APPEND it the maximum of the actual end of file and
- the position represented by read_end.
- */
- my_off_t end_of_file;
- /* Points to current read position in the buffer */
- uchar *read_pos;
- /* the non-inclusive boundary in the buffer for the currently valid read */
- uchar *read_end;
- uchar *buffer; /* The read buffer */
- /* Used in ASYNC_IO */
- uchar *request_pos;
-
- /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
- uchar *write_buffer;
- /*
- Only used in SEQ_READ_APPEND, and points to the current read position
- in the write buffer. Note that reads in SEQ_READ_APPEND caches can
- happen from both read buffer (uchar* buffer) and write buffer
- (uchar* write_buffer).
- */
- uchar *append_read_pos;
- /* Points to current write position in the write buffer */
- uchar *write_pos;
- /* The non-inclusive boundary of the valid write area */
- uchar *write_end;
-
- /*
- Current_pos and current_end are convenience variables used by
- my_b_tell() and other routines that need to know the current offset
- current_pos points to &write_pos, and current_end to &write_end in a
- WRITE_CACHE, and &read_pos and &read_end respectively otherwise
- */
- uchar **current_pos, **current_end;
-
- /*
- The lock is for append buffer used in SEQ_READ_APPEND cache
- need mutex copying from append buffer to read buffer.
- */
- mysql_mutex_t append_buffer_lock;
- /*
- The following is used when several threads are reading the
- same file in parallel. They are synchronized on disk
- accesses reading the cached part of the file asynchronously.
- It should be set to NULL to disable the feature. Only
- READ_CACHE mode is supported.
- */
- IO_CACHE_SHARE *share;
-
- /*
- A caller will use my_b_read() macro to read from the cache
- if the data is already in cache, it will be simply copied with
- memcpy() and internal variables will be accordinging updated with
- no functions invoked. However, if the data is not fully in the cache,
- my_b_read() will call read_function to fetch the data. read_function
- must never be invoked directly.
- */
- int (*read_function)(struct st_io_cache *,uchar *,size_t);
- /*
- Same idea as in the case of read_function, except my_b_write() needs to
- be replaced with my_b_append() for a SEQ_READ_APPEND cache
- */
- int (*write_function)(struct st_io_cache *,const uchar *,size_t);
- /*
- Specifies the type of the cache. Depending on the type of the cache
- certain operations might not be available and yield unpredicatable
- results. Details to be documented later
- */
- enum cache_type type;
- /*
- Callbacks when the actual read I/O happens. These were added and
- are currently used for binary logging of LOAD DATA INFILE - when a
- block is read from the file, we create a block create/append event, and
- when IO_CACHE is closed, we create an end event. These functions could,
- of course be used for other things
- */
- IO_CACHE_CALLBACK pre_read;
- IO_CACHE_CALLBACK post_read;
- IO_CACHE_CALLBACK pre_close;
- /*
- Counts the number of times, when we were forced to use disk. We use it to
- increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status
- variables.
- */
- ulong disk_writes;
- void* arg; /* for use by pre/post_read */
- char *file_name; /* if used with 'open_cached_file' */
- char *dir,*prefix;
- File file; /* file descriptor */
- PSI_file_key file_key; /* instrumented file key */
-
- /*
- seek_not_done is set by my_b_seek() to inform the upcoming read/write
- operation that a seek needs to be preformed prior to the actual I/O
- error is 0 if the cache operation was successful, -1 if there was a
- "hard" error, and the actual number of I/O-ed bytes if the read/write was
- partial.
- */
- int seek_not_done,error;
- /* buffer_length is memory size allocated for buffer or write_buffer */
- size_t buffer_length;
- /* read_length is the same as buffer_length except when we use async io */
- size_t read_length;
- myf myflags; /* Flags used to my_read/my_write */
- /*
- alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
- 0 if it was supplied by the user.
- Currently READ_NET is the only one that will use a buffer allocated
- somewhere else
- */
- my_bool alloced_buffer;
-} IO_CACHE;
-
-typedef int (*qsort2_cmp)(const void *, const void *, const void *);
-
-/*
- Subset of struct stat fields filled by stat/lstat/fstat that uniquely
- identify a file
-*/
-typedef struct st_file_id
-{
- dev_t st_dev;
- ino_t st_ino;
-} ST_FILE_ID;
-
-typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
- MY_ATTRIBUTE((format(printf, 2, 3)));
-
-extern my_error_reporter my_charset_error_reporter;
-
-/* defines for mf_iocache */
-extern PSI_file_key key_file_io_cache;
-
-/* Test if buffer is inited */
-#define my_b_clear(info) (info)->buffer=0
-#define my_b_inited(info) (info)->buffer
-#define my_b_EOF INT_MIN
-
-#define my_b_read(info,Buffer,Count) \
- ((info)->read_pos + (Count) <= (info)->read_end ?\
- (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \
- ((info)->read_pos+=(Count)),0) :\
- (*(info)->read_function)((info),Buffer,Count))
-
-#define my_b_write(info,Buffer,Count) \
- ((info)->write_pos + (Count) <=(info)->write_end ?\
- (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
- ((info)->write_pos+=(Count)),0) : \
- (*(info)->write_function)((info),(uchar *)(Buffer),(Count)))
-
-#define my_b_get(info) \
- ((info)->read_pos != (info)->read_end ?\
- ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\
- _my_b_get(info))
-
-#define my_b_tell(info) ((info)->pos_in_file + \
- (size_t) (*(info)->current_pos - (info)->request_pos))
-
-#define my_b_get_buffer_start(info) (info)->request_pos
-#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \
- (char*) my_b_get_buffer_start(info)
-#define my_b_get_pos_in_file(info) (info)->pos_in_file
-
-/* tell write offset in the SEQ_APPEND cache */
-int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
-my_off_t my_b_append_tell(IO_CACHE* info);
-my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
-
-#define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \
- *(info)->current_pos)
-
-typedef uint32 ha_checksum;
-
-#include
-
-
- /* Prototypes for mysys and my_func functions */
-
-extern int my_copy(const char *from,const char *to,myf MyFlags);
-extern int my_delete(const char *name,myf MyFlags);
-extern int my_getwd(char * buf,size_t size,myf MyFlags);
-extern int my_setwd(const char *dir,myf MyFlags);
-extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
-extern void *my_once_alloc(size_t Size,myf MyFlags);
-extern void my_once_free(void);
-extern char *my_once_strdup(const char *src,myf myflags);
-extern void *my_once_memdup(const void *src, size_t len, myf myflags);
-extern File my_open(const char *FileName,int Flags,myf MyFlags);
-extern File my_register_filename(File fd, const char *FileName,
- enum file_type type_of_file,
- uint error_message_number, myf MyFlags);
-extern File my_create(const char *FileName,int CreateFlags,
- int AccessFlags, myf MyFlags);
-extern int my_close(File Filedes,myf MyFlags);
-extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
-extern int my_readlink(char *to, const char *filename, myf MyFlags);
-extern int my_is_symlink(const char *filename, ST_FILE_ID *file_id);
-extern int my_realpath(char *to, const char *filename, myf MyFlags);
-extern int my_is_same_file(File file, const ST_FILE_ID *file_id);
-extern File my_create_with_symlink(const char *linkname, const char *filename,
- int createflags, int access_flags,
- myf MyFlags);
-extern int my_delete_with_symlink(const char *name, myf MyFlags);
-extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
-extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
-extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
-extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
- myf MyFlags);
-extern int my_rename(const char *from,const char *to,myf MyFlags);
-extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
-extern my_off_t my_tell(File fd,myf MyFlags);
-extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
- myf MyFlags);
-extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
- my_off_t offset,myf MyFlags);
-extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags);
-extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
- myf MyFlags);
-extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
-extern my_off_t my_ftell(FILE *stream,myf MyFlags);
-
-/* implemented in my_syslog.c */
-
-// Maximum size of message that will be logged.
-#define MAX_SYSLOG_MESSAGE_SIZE 1024
-
-/* Platform-independent SysLog support */
-
-/* facilities on unixoid syslog. harmless on systemd / Win platforms. */
-typedef struct st_syslog_facility { int id; const char *name; } SYSLOG_FACILITY;
-extern SYSLOG_FACILITY syslog_facility[];
-
-enum my_syslog_options { MY_SYSLOG_PIDS= 1 };
-
-int my_openlog(const char *eventSourceName, int option, int facility);
-int my_closelog();
-int my_syslog(const CHARSET_INFO *cs, enum loglevel level, const char *msg);
-
-/* implemented in my_memmem.c */
-extern void *my_memmem(const void *haystack, size_t haystacklen,
- const void *needle, size_t needlelen);
-
-
-#ifdef _WIN32
-extern int my_access(const char *path, int amode);
-#else
-#define my_access access
-#endif
-
-extern int check_if_legal_filename(const char *path);
-extern int check_if_legal_tablename(const char *path);
-
-#ifdef _WIN32
-extern my_bool is_filename_allowed(const char *name, size_t length,
- my_bool allow_current_dir);
-#else /* _WIN32 */
-# define is_filename_allowed(name, length, allow_cwd) (TRUE)
-#endif /* _WIN32 */
-
-#ifdef _WIN32
-extern int nt_share_delete(const char *name,myf MyFlags);
-#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags))
-#else
-#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags))
-#endif
-
-#ifdef _WIN32
-/* Windows-only functions (CRT equivalents)*/
-extern HANDLE my_get_osfhandle(File fd);
-extern void my_osmaperr(unsigned long last_error);
-#endif
-
-extern const char* get_global_errmsg(int nr);
-extern void wait_for_free_space(const char *filename, int errors);
-extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
-extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
-extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
-extern int my_fclose(FILE *fd,myf MyFlags);
-extern File my_fileno(FILE *fd);
-extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
-extern void thr_set_sync_wait_callback(void (*before_sync)(void),
- void (*after_sync)(void));
-extern int my_sync(File fd, myf my_flags);
-extern int my_sync_dir(const char *dir_name, myf my_flags);
-extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
-extern char *my_strerror(char *buf, size_t len, int errnum);
-extern const char *my_get_err_msg(int nr);
-extern void my_error(int nr,myf MyFlags, ...);
-extern void my_printf_error(uint my_err, const char *format,
- myf MyFlags, ...)
- MY_ATTRIBUTE((format(printf, 2, 4)));
-extern void my_printv_error(uint error, const char *format, myf MyFlags,
- va_list ap);
-extern int my_error_register(const char* (*get_errmsg) (int),
- int first, int last);
-extern my_bool my_error_unregister(int first, int last);
-extern void my_message(uint my_err, const char *str,myf MyFlags);
-extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
-void my_message_local_stderr(enum loglevel ll,
- const char *format, va_list args);
-extern void my_message_local(enum loglevel ll, const char *format, ...);
-extern my_bool my_init(void);
-extern void my_end(int infoflag);
-extern int my_redel(const char *from, const char *to, int MyFlags);
-extern int my_copystat(const char *from, const char *to, int MyFlags);
-extern char * my_filename(File fd);
-extern MY_MODE get_file_perm(ulong perm_flags);
-extern my_bool my_chmod(const char *filename, ulong perm_flags, myf my_flags);
-
-#ifdef EXTRA_DEBUG
-void my_print_open_files(void);
-#else
-#define my_print_open_files()
-#endif
-
-extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
-extern char *my_tmpdir(MY_TMPDIR *tmpdir);
-extern void free_tmpdir(MY_TMPDIR *tmpdir);
-
-extern size_t dirname_part(char * to,const char *name, size_t *to_res_length);
-extern size_t dirname_length(const char *name);
-#define base_name(A) (A+dirname_length(A))
-extern int test_if_hard_path(const char *dir_name);
-extern my_bool has_path(const char *name);
-extern char *convert_dirname(char *to, const char *from, const char *from_end);
-extern void to_unix_path(char * name);
-extern char * fn_ext(const char *name);
-extern char * fn_same(char * toname,const char *name,int flag);
-extern char * fn_format(char * to,const char *name,const char *dir,
- const char *form, uint flag);
-extern size_t strlength(const char *str);
-extern void pack_dirname(char * to,const char *from);
-extern size_t normalize_dirname(char * to, const char *from);
-extern size_t unpack_dirname(char * to,const char *from);
-extern size_t cleanup_dirname(char * to,const char *from);
-extern size_t system_filename(char * to,const char *from);
-extern size_t unpack_filename(char * to,const char *from);
-extern char * intern_filename(char * to,const char *from);
-extern int pack_filename(char * to, const char *name, size_t max_length);
-extern char * my_path(char * to,const char *progname,
- const char *own_pathname_part);
-extern char * my_load_path(char * to, const char *path,
- const char *own_path_prefix);
-extern int wild_compare(const char *str,const char *wildstr,
- pbool str_is_pattern);
-extern my_bool array_append_string_unique(const char *str,
- const char **array, size_t size);
-extern void get_date(char * to,int timeflag,time_t use_time);
-extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
- pbool remove_garbage);
-
-extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element);
-extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
- size_t size_of_element,uchar *buffer[]);
-extern void my_qsort(void *base_ptr, size_t total_elems, size_t size,
- qsort_cmp cmp);
-extern void my_qsort2(void *base_ptr, size_t total_elems, size_t size,
- qsort2_cmp cmp, const void *cmp_argument);
-void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
-my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
-extern int init_io_cache_ext(IO_CACHE *info,File file,size_t cachesize,
- enum cache_type type,my_off_t seek_offset,
- pbool use_async_io, myf cache_myflags,
- PSI_file_key file_key);
-extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
- enum cache_type type,my_off_t seek_offset,
- pbool use_async_io, myf cache_myflags);
-extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
- my_off_t seek_offset,pbool use_async_io,
- pbool clear_cache);
-extern void setup_io_cache(IO_CACHE* info);
-extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
-extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
-extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
- IO_CACHE *write_cache, uint num_threads);
-extern void remove_io_thread(IO_CACHE *info);
-extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
-extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
-extern int _my_b_get(IO_CACHE *info);
-extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
-extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count);
-extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
-
-extern int my_block_write(IO_CACHE *info, const uchar *Buffer,
- size_t Count, my_off_t pos);
-extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
-
-#define flush_io_cache(info) my_b_flush_io_cache((info),1)
-
-extern int end_io_cache(IO_CACHE *info);
-extern size_t my_b_fill(IO_CACHE *info);
-extern void my_b_seek(IO_CACHE *info,my_off_t pos);
-extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
-extern my_off_t my_b_filelength(IO_CACHE *info);
-extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...)
- MY_ATTRIBUTE((format(printf, 2, 3)));
-extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
-extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
- const char *prefix, size_t cache_size,
- myf cache_myflags);
-extern my_bool real_open_cached_file(IO_CACHE *cache);
-extern void close_cached_file(IO_CACHE *cache);
-File create_temp_file(char *to, const char *dir, const char *pfx,
- int mode, myf MyFlags);
-
-// Use Prealloced_array or std::vector or something similar in C++
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern my_bool my_init_dynamic_array(DYNAMIC_ARRAY *array,
- PSI_memory_key key,
- uint element_size,
- void *init_buffer,
- uint init_alloc,
- uint alloc_increment);
-/* init_dynamic_array() function is deprecated */
-extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc, uint alloc_increment);
-#define dynamic_element(array,array_index,type) \
- ((type)((array)->buffer) +(array_index))
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Some functions are still in use in C++, because HASH uses DYNAMIC_ARRAY */
-extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element);
-extern void *alloc_dynamic(DYNAMIC_ARRAY *array);
-extern void *pop_dynamic(DYNAMIC_ARRAY*);
-extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, uint array_index);
-extern void claim_dynamic(DYNAMIC_ARRAY *array);
-extern void delete_dynamic(DYNAMIC_ARRAY *array);
-extern void freeze_size(DYNAMIC_ARRAY *array);
-static inline void reset_dynamic(DYNAMIC_ARRAY *array)
-{
- array->elements= 0;
-}
-
-extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
- size_t init_alloc,size_t alloc_increment);
-extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
-my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
- size_t length);
-extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
- ...);
-extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
-extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
-extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
-extern void dynstr_free(DYNAMIC_STRING *str);
-#define alloc_root_inited(A) ((A)->min_malloc != 0)
-#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
-#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
-extern void init_alloc_root(PSI_memory_key key,
- MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size);
-extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
-extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
-extern void claim_root(MEM_ROOT *root);
-extern void free_root(MEM_ROOT *root, myf MyFLAGS);
-extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
- size_t prealloc_size);
-extern char *strdup_root(MEM_ROOT *root,const char *str);
-static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
-{
- return str ? strdup_root(root, str) : 0;
-}
-extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
-extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
-extern void set_memroot_max_capacity(MEM_ROOT *mem_root, size_t size);
-extern void set_memroot_error_reporting(MEM_ROOT *mem_root,
- my_bool report_error);
-extern my_bool my_compress(uchar *, size_t *, size_t *);
-extern my_bool my_uncompress(uchar *, size_t , size_t *);
-extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
- size_t *complen);
-extern int packfrm(uchar *, size_t, uchar **, size_t *);
-extern int unpackfrm(uchar **, size_t *, const uchar *);
-
-extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
- size_t count);
-
-/* Wait a given number of microseconds */
-static inline void my_sleep(time_t m_seconds)
-{
-#if defined(_WIN32)
- Sleep((DWORD)m_seconds/1000+1); /* Sleep() has millisecond arg */
-#else
- struct timeval t;
- t.tv_sec= m_seconds / 1000000L;
- t.tv_usec= m_seconds % 1000000L;
- select(0,0,0,0,&t); /* sleep */
-#endif
-}
-
-extern ulong crc32(ulong crc, const uchar *buf, uint len);
-extern uint my_set_max_open_files(uint files);
-void my_free_open_file_info(void);
-
-extern time_t my_time(myf flags);
-extern ulonglong my_getsystime(void);
-extern ulonglong my_micro_time();
-extern my_bool my_gethwaddr(uchar *to);
-
-#ifdef HAVE_SYS_MMAN_H
-#include
-
-#ifndef MAP_NOSYNC
-#define MAP_NOSYNC 0
-#endif
-
-/*
- Not defined in FreeBSD 11.
- Was never implemented in FreeBSD, so we just set it to 0.
-*/
-#ifndef MAP_NORESERVE
-#define MAP_NORESERVE 0
-#endif
-
-#ifdef HAVE_MMAP64
-#define my_mmap(a,b,c,d,e,f) mmap64(a,b,c,d,e,f)
-#else
-#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
-#endif
-#define my_munmap(a,b) munmap((a),(b))
-
-#else
-/* not a complete set of mmap() flags, but only those that nesessary */
-#define PROT_READ 1
-#define PROT_WRITE 2
-#define MAP_NORESERVE 0
-#define MAP_SHARED 0x0001
-#define MAP_PRIVATE 0x0002
-#define MAP_NOSYNC 0x0800
-#define MAP_FAILED ((void *)-1)
-#define MS_SYNC 0x0000
-
-void *my_mmap(void *, size_t, int, int, int, my_off_t);
-int my_munmap(void *, size_t);
-#endif
-
-/* my_getpagesize */
-static inline int my_getpagesize()
-{
-#ifndef _WIN32
- return getpagesize();
-#else
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- return (int)si.dwPageSize;
-#endif
-}
-
-int my_msync(int, void *, size_t, int);
-
-/* character sets */
-extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader);
-extern uint get_charset_number(const char *cs_name, uint cs_flags);
-extern uint get_collation_number(const char *name);
-extern const char *get_charset_name(uint cs_number);
-
-extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
-extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
-extern CHARSET_INFO *my_collation_get_by_name(MY_CHARSET_LOADER *loader,
- const char *name, myf flags);
-extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
- uint cs_flags, myf my_flags);
-extern CHARSET_INFO *my_charset_get_by_name(MY_CHARSET_LOADER *loader,
- const char *name,
- uint cs_flags, myf my_flags);
-extern my_bool resolve_charset(const char *cs_name,
- const CHARSET_INFO *default_cs,
- const CHARSET_INFO **cs);
-extern my_bool resolve_collation(const char *cl_name,
- const CHARSET_INFO *default_cl,
- const CHARSET_INFO **cl);
-extern void free_charsets(void);
-extern char *get_charsets_dir(char *buf);
-extern my_bool my_charset_same(const CHARSET_INFO *cs1,
- const CHARSET_INFO *cs2);
-extern my_bool init_compiled_charsets(myf flags);
-extern void add_compiled_collation(CHARSET_INFO *cs);
-extern size_t escape_string_for_mysql(const CHARSET_INFO *charset_info,
- char *to, size_t to_length,
- const char *from, size_t length);
-#ifdef _WIN32
-/* File system character set */
-extern CHARSET_INFO *fs_character_set(void);
-#endif
-extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
- char *to, size_t to_length,
- const char *from, size_t length, char quote);
-#ifdef _WIN32
-extern my_bool have_tcpip; /* Is set if tcpip is used */
-
-/* implemented in my_windac.c */
-
-int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
- DWORD owner_rights, DWORD everybody_rights);
-
-void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
-
-/* implemented in my_conio.c */
-my_bool my_win_is_console(FILE *file);
-char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize,
- size_t *nread);
-void my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t datalen);
-void my_win_console_fputs(const CHARSET_INFO *cs, const char *data);
-void my_win_console_putc(const CHARSET_INFO *cs, int c);
-void my_win_console_vfprintf(const CHARSET_INFO *cs, const char *fmt, va_list args);
-int my_win_translate_command_line_args(const CHARSET_INFO *cs, int *ac, char ***av);
-#endif /* _WIN32 */
-
-#ifdef HAVE_PSI_INTERFACE
-extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook;
-extern void set_psi_server(PSI *psi);
-void my_init_mysys_psi_keys(void);
-#endif
-
-struct st_mysql_file;
-extern struct st_mysql_file *mysql_stdin;
-
-C_MODE_END
-#endif /* _my_sys_h */
diff --git a/code/mysql/my_thread.h b/code/mysql/my_thread.h
deleted file mode 100644
index a9d9316..0000000
--- a/code/mysql/my_thread.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-
-/* Defines to make different thread packages compatible */
-
-#ifndef MY_THREAD_INCLUDED
-#define MY_THREAD_INCLUDED
-
-#include "my_global.h" /* my_bool */
-
-#if !defined(_WIN32)
-#include
-#endif
-
-#ifndef ETIME
-#define ETIME ETIMEDOUT /* For FreeBSD */
-#endif
-
-#ifndef ETIMEDOUT
-#define ETIMEDOUT 145 /* Win32 doesn't have this */
-#endif
-
-/*
- MySQL can survive with 32K, but some glibc libraries require > 128K stack
- To resolve hostnames. Also recursive stored procedures needs stack.
-*/
-#if defined(__sparc) && (defined(__SUNPRO_CC) || defined(__SUNPRO_C))
-#define STACK_MULTIPLIER 2UL
-#else
-#define STACK_MULTIPLIER 1UL
-#endif
-
-#if SIZEOF_CHARP > 4
-#define DEFAULT_THREAD_STACK (STACK_MULTIPLIER * 256UL * 1024UL)
-#else
-#define DEFAULT_THREAD_STACK (STACK_MULTIPLIER * 192UL * 1024UL)
-#endif
-
-#ifdef __cplusplus
-#define EXTERNC extern "C"
-#else
-#define EXTERNC
-#endif
-
-C_MODE_START
-
-#ifdef _WIN32
-typedef volatile LONG my_thread_once_t;
-typedef DWORD my_thread_t;
-typedef struct thread_attr
-{
- DWORD dwStackSize;
- int detachstate;
-} my_thread_attr_t;
-#define MY_THREAD_CREATE_JOINABLE 0
-#define MY_THREAD_CREATE_DETACHED 1
-typedef void * (__cdecl *my_start_routine)(void *);
-#define MY_THREAD_ONCE_INIT 0
-#define MY_THREAD_ONCE_INPROGRESS 1
-#define MY_THREAD_ONCE_DONE 2
-#else
-typedef pthread_once_t my_thread_once_t;
-typedef pthread_t my_thread_t;
-typedef pthread_attr_t my_thread_attr_t;
-#define MY_THREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
-#define MY_THREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
-typedef void *(* my_start_routine)(void *);
-#define MY_THREAD_ONCE_INIT PTHREAD_ONCE_INIT
-#endif
-
-typedef struct st_my_thread_handle
-{
- my_thread_t thread;
-#ifdef _WIN32
- HANDLE handle;
-#endif
-} my_thread_handle;
-
-int my_thread_once(my_thread_once_t *once_control, void (*init_routine)(void));
-
-static inline my_thread_t my_thread_self()
-{
-#ifdef _WIN32
- return GetCurrentThreadId();
-#else
- return pthread_self();
-#endif
-}
-
-static inline int my_thread_equal(my_thread_t t1, my_thread_t t2)
-{
-#ifdef _WIN32
- return t1 == t2;
-#else
- return pthread_equal(t1, t2);
-#endif
-}
-
-static inline int my_thread_attr_init(my_thread_attr_t *attr)
-{
-#ifdef _WIN32
- attr->dwStackSize= 0;
- /* Set to joinable by default to match Linux */
- attr->detachstate= MY_THREAD_CREATE_JOINABLE;
- return 0;
-#else
- return pthread_attr_init(attr);
-#endif
-}
-
-static inline int my_thread_attr_destroy(my_thread_attr_t *attr)
-{
-#ifdef _WIN32
- attr->dwStackSize= 0;
- /* Set to joinable by default to match Linux */
- attr->detachstate= MY_THREAD_CREATE_JOINABLE;
- return 0;
-#else
- return pthread_attr_destroy(attr);
-#endif
-}
-
-static inline int my_thread_attr_setstacksize(my_thread_attr_t *attr,
- size_t stacksize)
-{
-#ifdef _WIN32
- attr->dwStackSize= (DWORD)stacksize;
- return 0;
-#else
- return pthread_attr_setstacksize(attr, stacksize);
-#endif
-}
-
-static inline int my_thread_attr_setdetachstate(my_thread_attr_t *attr,
- int detachstate)
-{
-#ifdef _WIN32
- attr->detachstate= detachstate;
- return 0;
-#else
- return pthread_attr_setdetachstate(attr, detachstate);
-#endif
-}
-
-static inline int my_thread_attr_getstacksize(my_thread_attr_t *attr,
- size_t *stacksize)
-{
-#ifdef _WIN32
- *stacksize= (size_t)attr->dwStackSize;
- return 0;
-#else
- return pthread_attr_getstacksize(attr, stacksize);
-#endif
-}
-
-static inline void my_thread_yield()
-{
-#ifdef _WIN32
- SwitchToThread();
-#else
- sched_yield();
-#endif
-}
-
-int my_thread_create(my_thread_handle *thread, const my_thread_attr_t *attr,
- my_start_routine func, void *arg);
-int my_thread_join(my_thread_handle *thread, void **value_ptr);
-int my_thread_cancel(my_thread_handle *thread);
-void my_thread_exit(void *value_ptr);
-
-
-extern my_bool my_thread_global_init();
-extern void my_thread_global_reinit();
-extern void my_thread_global_end();
-extern my_bool my_thread_init();
-extern void my_thread_end();
-
-C_MODE_END
-
-#endif /* MY_THREAD_INCLUDED */
diff --git a/code/mysql/my_thread_local.h b/code/mysql/my_thread_local.h
deleted file mode 100644
index 0b19a6d..0000000
--- a/code/mysql/my_thread_local.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-
-#ifndef MY_THREAD_LOCAL_INCLUDED
-#define MY_THREAD_LOCAL_INCLUDED
-
-#ifndef _WIN32
-#include
-#endif
-
-struct _db_code_state_;
-typedef uint32 my_thread_id;
-
-C_MODE_START
-
-#ifdef _WIN32
-typedef DWORD thread_local_key_t;
-#else
-typedef pthread_key_t thread_local_key_t;
-#endif
-
-static inline int my_create_thread_local_key(thread_local_key_t *key,
- void (*destructor)(void *))
-{
-#ifdef _WIN32
- *key= TlsAlloc();
- return (*key == TLS_OUT_OF_INDEXES);
-#else
- return pthread_key_create(key, destructor);
-#endif
-}
-
-static inline int my_delete_thread_local_key(thread_local_key_t key)
-{
-#ifdef _WIN32
- return !TlsFree(key);
-#else
- return pthread_key_delete(key);
-#endif
-}
-
-static inline void* my_get_thread_local(thread_local_key_t key)
-{
-#ifdef _WIN32
- return TlsGetValue(key);
-#else
- return pthread_getspecific(key);
-#endif
-}
-
-static inline int my_set_thread_local(thread_local_key_t key,
- void *value)
-{
-#ifdef _WIN32
- return !TlsSetValue(key, value);
-#else
- return pthread_setspecific(key, value);
-#endif
-}
-
-/**
- Retrieve the MySQL thread-local storage variant of errno.
-*/
-int my_errno();
-
-/**
- Set the MySQL thread-local storage variant of errno.
-*/
-void set_my_errno(int my_errno);
-
-#ifdef _WIN32
-/*
- thr_winerr is used for returning the original OS error-code in Windows,
- my_osmaperr() returns EINVAL for all unknown Windows errors, hence we
- preserve the original Windows Error code in thr_winerr.
-*/
-int thr_winerr();
-
-void set_thr_winerr(int winerr);
-
-#endif
-
-#ifndef DBUG_OFF
-/* Return pointer to DBUG for holding current state */
-struct _db_code_state_ **my_thread_var_dbug();
-
-my_thread_id my_thread_var_id();
-
-void set_my_thread_var_id(my_thread_id id);
-
-#endif
-
-C_MODE_END
-
-#endif // MY_THREAD_LOCAL_INCLUDED
diff --git a/code/mysql/my_xml.h b/code/mysql/my_xml.h
deleted file mode 100644
index 3d6d335..0000000
--- a/code/mysql/my_xml.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-
-
-#ifndef _my_xml_h
-#define _my_xml_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#define MY_XML_OK 0
-#define MY_XML_ERROR 1
-
-/*
- A flag whether to use absolute tag names in call-back functions,
- like "a", "a.b" and "a.b.c" (used in character set file parser),
- or relative names like "a", "b" and "c".
-*/
-#define MY_XML_FLAG_RELATIVE_NAMES 1
-
-/*
- A flag whether to skip normilization of text values before calling
- call-back functions: i.e. skip leading/trailing spaces,
- \r, \n, \t characters.
-*/
-#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2
-
-enum my_xml_node_type
-{
- MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */
- MY_XML_NODE_ATTR, /* can have TEXT children */
- MY_XML_NODE_TEXT /* cannot have children */
-};
-
-typedef struct xml_stack_st
-{
- int flags;
- enum my_xml_node_type current_node_type;
- char errstr[128];
-
- struct {
- char static_buffer[128];
- char *buffer;
- size_t buffer_size;
- char *start;
- char *end;
- } attr;
-
- const char *beg;
- const char *cur;
- const char *end;
- void *user_data;
- int (*enter)(struct xml_stack_st *st,const char *val, size_t len);
- int (*value)(struct xml_stack_st *st,const char *val, size_t len);
- int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len);
-} MY_XML_PARSER;
-
-void my_xml_parser_create(MY_XML_PARSER *st);
-void my_xml_parser_free(MY_XML_PARSER *st);
-int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len);
-
-void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
- const char *,
- size_t len));
-void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
- const char *,
- size_t len));
-void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
- const char *,
- size_t len));
-void my_xml_set_user_data(MY_XML_PARSER *st, void *);
-
-size_t my_xml_error_pos(MY_XML_PARSER *st);
-uint my_xml_error_lineno(MY_XML_PARSER *st);
-
-const char *my_xml_error_string(MY_XML_PARSER *st);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _my_xml_h */
diff --git a/code/mysql/mysql.h b/code/mysql/mysql.h
deleted file mode 100644
index 1260d97..0000000
--- a/code/mysql/mysql.h
+++ /dev/null
@@ -1,741 +0,0 @@
-/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
- This file defines the client API to MySQL and also the ABI of the
- dynamically linked libmysqlclient.
-
- The ABI should never be changed in a released product of MySQL,
- thus you need to take great care when changing the file. In case
- the file is changed so the ABI is broken, you must also update
- the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake
-*/
-
-#ifndef _mysql_h
-#define _mysql_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef MY_GLOBAL_INCLUDED /* If not standard header */
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-typedef char my_bool;
-#if !defined(_WIN32)
-#define STDCALL
-#else
-#define STDCALL __stdcall
-#endif
-
-#ifndef my_socket_defined
-#ifdef _WIN32
-#include
-#ifdef WIN32_LEAN_AND_MEAN
-#include
-#endif
-#define my_socket SOCKET
-#else
-typedef int my_socket;
-#endif /* _WIN32 */
-#endif /* my_socket_defined */
-#endif /* MY_GLOBAL_INCLUDED */
-
-#include "mysql_version.h"
-#include "mysql_com.h"
-#include "mysql_time.h"
-
-#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
-
-/* Include declarations of plug-in API */
-#include "mysql/client_plugin.h"
-
-extern unsigned int mysql_port;
-extern char *mysql_unix_port;
-
-#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
-#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
-
-#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
-#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
-#define IS_BLOB(n) ((n) & BLOB_FLAG)
-/**
- Returns true if the value is a number which does not need quotes for
- the sql_lex.cc parser to parse correctly.
-*/
-#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
-#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)
-
-
-typedef struct st_mysql_field {
- char *name; /* Name of column */
- char *org_name; /* Original column name, if an alias */
- char *table; /* Table of column if column was a field */
- char *org_table; /* Org table name, if table was an alias */
- char *db; /* Database for table */
- char *catalog; /* Catalog for table */
- char *def; /* Default value (set by mysql_list_fields) */
- unsigned long length; /* Width of column (create length) */
- unsigned long max_length; /* Max width for selected set */
- unsigned int name_length;
- unsigned int org_name_length;
- unsigned int table_length;
- unsigned int org_table_length;
- unsigned int db_length;
- unsigned int catalog_length;
- unsigned int def_length;
- unsigned int flags; /* Div flags */
- unsigned int decimals; /* Number of decimals in field */
- unsigned int charsetnr; /* Character set */
- enum enum_field_types type; /* Type of field. See mysql_com.h for types */
- void *extension;
-} MYSQL_FIELD;
-
-typedef char **MYSQL_ROW; /* return data as array of strings */
-typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
-
-#ifndef MY_GLOBAL_INCLUDED
-#if defined (_WIN32)
-typedef unsigned __int64 my_ulonglong;
-#else
-typedef unsigned long long my_ulonglong;
-#endif
-#endif
-
-#include "typelib.h"
-
-#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
-
-/* backward compatibility define - to be removed eventually */
-#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
-
-typedef struct st_mysql_rows {
- struct st_mysql_rows *next; /* list of rows */
- MYSQL_ROW data;
- unsigned long length;
-} MYSQL_ROWS;
-
-typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
-
-#include "my_alloc.h"
-
-typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
-typedef struct st_mysql_data {
- MYSQL_ROWS *data;
- struct embedded_query_result *embedded_info;
- MEM_ROOT alloc;
- my_ulonglong rows;
- unsigned int fields;
- /* extra info for embedded library */
- void *extension;
-} MYSQL_DATA;
-
-enum mysql_option
-{
- MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
- MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
- MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
- MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
- MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
- MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
- MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
- MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
- MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
- MYSQL_OPT_BIND,
- MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
- MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
- MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
- MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD,
- MYSQL_OPT_CONNECT_ATTR_DELETE,
- MYSQL_SERVER_PUBLIC_KEY,
- MYSQL_ENABLE_CLEARTEXT_PLUGIN,
- MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
- MYSQL_OPT_SSL_ENFORCE,
- MYSQL_OPT_MAX_ALLOWED_PACKET, MYSQL_OPT_NET_BUFFER_LENGTH,
- MYSQL_OPT_TLS_VERSION,
- MYSQL_OPT_SSL_MODE,
- MYSQL_OPT_GET_SERVER_PUBLIC_KEY
-};
-
-/**
- @todo remove the "extension", move st_mysql_options completely
- out of mysql.h
-*/
-struct st_mysql_options_extention;
-
-struct st_mysql_options {
- unsigned int connect_timeout, read_timeout, write_timeout;
- unsigned int port, protocol;
- unsigned long client_flag;
- char *host,*user,*password,*unix_socket,*db;
- struct st_dynamic_array *init_commands;
- char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
- char *ssl_key; /* PEM key file */
- char *ssl_cert; /* PEM cert file */
- char *ssl_ca; /* PEM CA file */
- char *ssl_capath; /* PEM directory of CA-s? */
- char *ssl_cipher; /* cipher to use */
- char *shared_memory_base_name;
- unsigned long max_allowed_packet;
- my_bool use_ssl; /* Deprecated ! Former use_ssl */
- my_bool compress,named_pipe;
- my_bool unused1;
- my_bool unused2;
- my_bool unused3;
- my_bool unused4;
- enum mysql_option methods_to_use;
- union {
- /*
- The ip/hostname to use when authenticating
- client against embedded server built with
- grant tables - only used in embedded server
- */
- char *client_ip;
-
- /*
- The local address to bind when connecting to
- remote server - not used in embedded server
- */
- char *bind_address;
- } ci;
- my_bool unused5;
- /* 0 - never report, 1 - always report (default) */
- my_bool report_data_truncation;
-
- /* function pointers for local infile support */
- int (*local_infile_init)(void **, const char *, void *);
- int (*local_infile_read)(void *, char *, unsigned int);
- void (*local_infile_end)(void *);
- int (*local_infile_error)(void *, char *, unsigned int);
- void *local_infile_userdata;
- struct st_mysql_options_extention *extension;
-};
-
-enum mysql_status
-{
- MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
- MYSQL_STATUS_STATEMENT_GET_RESULT
-};
-
-enum mysql_protocol_type
-{
- MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
- MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
-};
-
-enum mysql_ssl_mode
-{
- SSL_MODE_DISABLED= 1, SSL_MODE_PREFERRED, SSL_MODE_REQUIRED,
- SSL_MODE_VERIFY_CA, SSL_MODE_VERIFY_IDENTITY
-};
-
-typedef struct character_set
-{
- unsigned int number; /* character set number */
- unsigned int state; /* character set state */
- const char *csname; /* collation name */
- const char *name; /* character set name */
- const char *comment; /* comment */
- const char *dir; /* character set directory */
- unsigned int mbminlen; /* min. length for multibyte strings */
- unsigned int mbmaxlen; /* max. length for multibyte strings */
-} MY_CHARSET_INFO;
-
-struct st_mysql_methods;
-struct st_mysql_stmt;
-
-typedef struct st_mysql
-{
- NET net; /* Communication parameters */
- unsigned char *connector_fd; /* ConnectorFd for SSL */
- char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
- char *info, *db;
- struct charset_info_st *charset;
- MYSQL_FIELD *fields;
- MEM_ROOT field_alloc;
- my_ulonglong affected_rows;
- my_ulonglong insert_id; /* id if insert on table with NEXTNR */
- my_ulonglong extra_info; /* Not used */
- unsigned long thread_id; /* Id for connection in server */
- unsigned long packet_length;
- unsigned int port;
- unsigned long client_flag,server_capabilities;
- unsigned int protocol_version;
- unsigned int field_count;
- unsigned int server_status;
- unsigned int server_language;
- unsigned int warning_count;
- struct st_mysql_options options;
- enum mysql_status status;
- my_bool free_me; /* If free in mysql_close */
- my_bool reconnect; /* set to 1 if automatic reconnect */
-
- /* session-wide random string */
- char scramble[SCRAMBLE_LENGTH+1];
- my_bool unused1;
- void *unused2, *unused3, *unused4, *unused5;
-
- LIST *stmts; /* list of all statements */
- const struct st_mysql_methods *methods;
- void *thd;
- /*
- Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
- from mysql_stmt_close if close had to cancel result set of this object.
- */
- my_bool *unbuffered_fetch_owner;
- /* needed for embedded server - no net buffer to store the 'info' */
- char *info_buffer;
- void *extension;
-} MYSQL;
-
-
-typedef struct st_mysql_res {
- my_ulonglong row_count;
- MYSQL_FIELD *fields;
- MYSQL_DATA *data;
- MYSQL_ROWS *data_cursor;
- unsigned long *lengths; /* column lengths of current row */
- MYSQL *handle; /* for unbuffered reads */
- const struct st_mysql_methods *methods;
- MYSQL_ROW row; /* If unbuffered read */
- MYSQL_ROW current_row; /* buffer to current row */
- MEM_ROOT field_alloc;
- unsigned int field_count, current_field;
- my_bool eof; /* Used by mysql_fetch_row */
- /* mysql_stmt_close() had to cancel this result */
- my_bool unbuffered_fetch_cancelled;
- void *extension;
-} MYSQL_RES;
-
-
-#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
-#define MYSQL_CLIENT
-#endif
-
-/*
- Set up and bring down the server; to ensure that applications will
- work when linked against either the standard client library or the
- embedded server library, these functions should be called.
-*/
-int STDCALL mysql_server_init(int argc, char **argv, char **groups);
-void STDCALL mysql_server_end(void);
-
-/*
- mysql_server_init/end need to be called when using libmysqld or
- libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
- you don't need to call it explicitely; but you need to call
- mysql_server_end() to free memory). The names are a bit misleading
- (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
- names which suit well whether you're using libmysqld or libmysqlclient. We
- intend to promote these aliases over the mysql_server* ones.
-*/
-#define mysql_library_init mysql_server_init
-#define mysql_library_end mysql_server_end
-
-
-/*
- Set up and bring down a thread; these function should be called
- for each thread in an application which opens at least one MySQL
- connection. All uses of the connection(s) should be between these
- function calls.
-*/
-my_bool STDCALL mysql_thread_init(void);
-void STDCALL mysql_thread_end(void);
-
-/*
- Functions to get information from the MYSQL and MYSQL_RES structures
- Should definitely be used if one uses shared libraries.
-*/
-
-my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
-unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
-my_bool STDCALL mysql_eof(MYSQL_RES *res);
-MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
- unsigned int fieldnr);
-MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
-MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);
-MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);
-
-unsigned int STDCALL mysql_field_count(MYSQL *mysql);
-my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
-my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
-unsigned int STDCALL mysql_errno(MYSQL *mysql);
-const char * STDCALL mysql_error(MYSQL *mysql);
-const char *STDCALL mysql_sqlstate(MYSQL *mysql);
-unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
-const char * STDCALL mysql_info(MYSQL *mysql);
-unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
-const char * STDCALL mysql_character_set_name(MYSQL *mysql);
-int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
-
-MYSQL * STDCALL mysql_init(MYSQL *mysql);
-my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
- const char *cert, const char *ca,
- const char *capath, const char *cipher);
-const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
-my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
- const char *passwd, const char *db);
-MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
- const char *user,
- const char *passwd,
- const char *db,
- unsigned int port,
- const char *unix_socket,
- unsigned long clientflag);
-int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
-int STDCALL mysql_query(MYSQL *mysql, const char *q);
-int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
-int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
- unsigned long length);
-MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
-MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
-
-void STDCALL mysql_get_character_set_info(MYSQL *mysql,
- MY_CHARSET_INFO *charset);
-
-int STDCALL mysql_session_track_get_first(MYSQL *mysql,
- enum enum_session_state_type type,
- const char **data,
- size_t *length);
-int STDCALL mysql_session_track_get_next(MYSQL *mysql,
- enum enum_session_state_type type,
- const char **data,
- size_t *length);
-/* local infile support */
-
-#define LOCAL_INFILE_ERROR_LEN 512
-
-void
-mysql_set_local_infile_handler(MYSQL *mysql,
- int (*local_infile_init)(void **, const char *,
- void *),
- int (*local_infile_read)(void *, char *,
- unsigned int),
- void (*local_infile_end)(void *),
- int (*local_infile_error)(void *, char*,
- unsigned int),
- void *);
-
-void
-mysql_set_local_infile_default(MYSQL *mysql);
-
-int STDCALL mysql_shutdown(MYSQL *mysql,
- enum mysql_enum_shutdown_level
- shutdown_level);
-int STDCALL mysql_dump_debug_info(MYSQL *mysql);
-int STDCALL mysql_refresh(MYSQL *mysql,
- unsigned int refresh_options);
-int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
-int STDCALL mysql_set_server_option(MYSQL *mysql,
- enum enum_mysql_set_option
- option);
-int STDCALL mysql_ping(MYSQL *mysql);
-const char * STDCALL mysql_stat(MYSQL *mysql);
-const char * STDCALL mysql_get_server_info(MYSQL *mysql);
-const char * STDCALL mysql_get_client_info(void);
-unsigned long STDCALL mysql_get_client_version(void);
-const char * STDCALL mysql_get_host_info(MYSQL *mysql);
-unsigned long STDCALL mysql_get_server_version(MYSQL *mysql);
-unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql);
-MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
-MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
-MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
-int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
- const void *arg);
-int STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
- const void *arg1, const void *arg2);
-int STDCALL mysql_get_option(MYSQL *mysql, enum mysql_option option,
- const void *arg);
-void STDCALL mysql_free_result(MYSQL_RES *result);
-void STDCALL mysql_data_seek(MYSQL_RES *result,
- my_ulonglong offset);
-MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result,
- MYSQL_ROW_OFFSET offset);
-MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
- MYSQL_FIELD_OFFSET offset);
-MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result);
-unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
-MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result);
-MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
- const char *wild);
-unsigned long STDCALL mysql_escape_string(char *to,const char *from,
- unsigned long from_length);
-unsigned long STDCALL mysql_hex_string(char *to,const char *from,
- unsigned long from_length);
-unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
- char *to,const char *from,
- unsigned long length);
-unsigned long STDCALL mysql_real_escape_string_quote(MYSQL *mysql,
- char *to, const char *from,
- unsigned long length, char quote);
-void STDCALL mysql_debug(const char *debug);
-void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
-unsigned int STDCALL mysql_thread_safe(void);
-my_bool STDCALL mysql_embedded(void);
-my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
-int STDCALL mysql_reset_connection(MYSQL *mysql);
-
-/*
- The following definitions are added for the enhanced
- client-server protocol
-*/
-
-/* statement state */
-enum enum_mysql_stmt_state
-{
- MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE,
- MYSQL_STMT_FETCH_DONE
-};
-
-
-/*
- This structure is used to define bind information, and
- internally by the client library.
- Public members with their descriptions are listed below
- (conventionally `On input' refers to the binds given to
- mysql_stmt_bind_param, `On output' refers to the binds given
- to mysql_stmt_bind_result):
-
- buffer_type - One of the MYSQL_* types, used to describe
- the host language type of buffer.
- On output: if column type is different from
- buffer_type, column value is automatically converted
- to buffer_type before it is stored in the buffer.
- buffer - On input: points to the buffer with input data.
- On output: points to the buffer capable to store
- output data.
- The type of memory pointed by buffer must correspond
- to buffer_type. See the correspondence table in
- the comment to mysql_stmt_bind_param.
-
- The two above members are mandatory for any kind of bind.
-
- buffer_length - the length of the buffer. You don't have to set
- it for any fixed length buffer: float, double,
- int, etc. It must be set however for variable-length
- types, such as BLOBs or STRINGs.
-
- length - On input: in case when lengths of input values
- are different for each execute, you can set this to
- point at a variable containining value length. This
- way the value length can be different in each execute.
- If length is not NULL, buffer_length is not used.
- Note, length can even point at buffer_length if
- you keep bind structures around while fetching:
- this way you can change buffer_length before
- each execution, everything will work ok.
- On output: if length is set, mysql_stmt_fetch will
- write column length into it.
-
- is_null - On input: points to a boolean variable that should
- be set to TRUE for NULL values.
- This member is useful only if your data may be
- NULL in some but not all cases.
- If your data is never NULL, is_null should be set to 0.
- If your data is always NULL, set buffer_type
- to MYSQL_TYPE_NULL, and is_null will not be used.
-
- is_unsigned - On input: used to signify that values provided for one
- of numeric types are unsigned.
- On output describes signedness of the output buffer.
- If, taking into account is_unsigned flag, column data
- is out of range of the output buffer, data for this column
- is regarded truncated. Note that this has no correspondence
- to the sign of result set column, if you need to find it out
- use mysql_stmt_result_metadata.
- error - where to write a truncation error if it is present.
- possible error value is:
- 0 no truncation
- 1 value is out of range or buffer is too small
-
- Please note that MYSQL_BIND also has internals members.
-*/
-
-typedef struct st_mysql_bind
-{
- unsigned long *length; /* output length pointer */
- my_bool *is_null; /* Pointer to null indicator */
- void *buffer; /* buffer to get/put data */
- /* set this if you want to track data truncations happened during fetch */
- my_bool *error;
- unsigned char *row_ptr; /* for the current data position */
- void (*store_param_func)(NET *net, struct st_mysql_bind *param);
- void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
- void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
- /* output buffer length, must be set when fetching str/binary */
- unsigned long buffer_length;
- unsigned long offset; /* offset position for char/binary fetch */
- unsigned long length_value; /* Used if length is 0 */
- unsigned int param_number; /* For null count and error messages */
- unsigned int pack_length; /* Internal length for packed data */
- enum enum_field_types buffer_type; /* buffer type */
- my_bool error_value; /* used if error is 0 */
- my_bool is_unsigned; /* set if integer type is unsigned */
- my_bool long_data_used; /* If used with mysql_send_long_data */
- my_bool is_null_value; /* Used if is_null is 0 */
- void *extension;
-} MYSQL_BIND;
-
-
-struct st_mysql_stmt_extension;
-
-/* statement handler */
-typedef struct st_mysql_stmt
-{
- MEM_ROOT mem_root; /* root allocations */
- LIST list; /* list to keep track of all stmts */
- MYSQL *mysql; /* connection handle */
- MYSQL_BIND *params; /* input parameters */
- MYSQL_BIND *bind; /* output parameters */
- MYSQL_FIELD *fields; /* result set metadata */
- MYSQL_DATA result; /* cached result set */
- MYSQL_ROWS *data_cursor; /* current row in cached result */
- /*
- mysql_stmt_fetch() calls this function to fetch one row (it's different
- for buffered, unbuffered and cursor fetch).
- */
- int (*read_row_func)(struct st_mysql_stmt *stmt,
- unsigned char **row);
- /* copy of mysql->affected_rows after statement execution */
- my_ulonglong affected_rows;
- my_ulonglong insert_id; /* copy of mysql->insert_id */
- unsigned long stmt_id; /* Id for prepared statement */
- unsigned long flags; /* i.e. type of cursor to open */
- unsigned long prefetch_rows; /* number of rows per one COM_FETCH */
- /*
- Copied from mysql->server_status after execute/fetch to know
- server-side cursor status for this statement.
- */
- unsigned int server_status;
- unsigned int last_errno; /* error code */
- unsigned int param_count; /* input parameter count */
- unsigned int field_count; /* number of columns in result set */
- enum enum_mysql_stmt_state state; /* statement state */
- char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
- char sqlstate[SQLSTATE_LENGTH+1];
- /* Types of input parameters should be sent to server */
- my_bool send_types_to_server;
- my_bool bind_param_done; /* input buffers were supplied */
- unsigned char bind_result_done; /* output buffers were supplied */
- /* mysql_stmt_close() had to cancel this result */
- my_bool unbuffered_fetch_cancelled;
- /*
- Is set to true if we need to calculate field->max_length for
- metadata fields when doing mysql_stmt_store_result.
- */
- my_bool update_max_length;
- struct st_mysql_stmt_extension *extension;
-} MYSQL_STMT;
-
-enum enum_stmt_attr_type
-{
- /*
- When doing mysql_stmt_store_result calculate max_length attribute
- of statement metadata. This is to be consistent with the old API,
- where this was done automatically.
- In the new API we do that only by request because it slows down
- mysql_stmt_store_result sufficiently.
- */
- STMT_ATTR_UPDATE_MAX_LENGTH,
- /*
- unsigned long with combination of cursor flags (read only, for update,
- etc)
- */
- STMT_ATTR_CURSOR_TYPE,
- /*
- Amount of rows to retrieve from server per one fetch if using cursors.
- Accepts unsigned long attribute in the range 1 - ulong_max
- */
- STMT_ATTR_PREFETCH_ROWS
-};
-
-
-MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
-int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
- unsigned long length);
-int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
-int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
-int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg,
- unsigned int column,
- unsigned long offset);
-int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
-unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
-my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
- enum enum_stmt_attr_type attr_type,
- const void *attr);
-my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
- enum enum_stmt_attr_type attr_type,
- void *attr);
-my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
-my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
-my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
-my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt,
- unsigned int param_number,
- const char *data,
- unsigned long length);
-MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
-MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
-unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
-const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
-const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
-MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt,
- MYSQL_ROW_OFFSET offset);
-MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
-void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
-my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt);
-my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
-my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt);
-unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);
-
-my_bool STDCALL mysql_commit(MYSQL * mysql);
-my_bool STDCALL mysql_rollback(MYSQL * mysql);
-my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
-my_bool STDCALL mysql_more_results(MYSQL *mysql);
-int STDCALL mysql_next_result(MYSQL *mysql);
-int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
-void STDCALL mysql_close(MYSQL *sock);
-
-
-/* status return codes */
-#define MYSQL_NO_DATA 100
-#define MYSQL_DATA_TRUNCATED 101
-
-#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
-
-#define HAVE_MYSQL_REAL_CONNECT
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _mysql_h */
diff --git a/code/mysql/mysql/client_authentication.h b/code/mysql/mysql/client_authentication.h
deleted file mode 100644
index 94a408b..0000000
--- a/code/mysql/mysql/client_authentication.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#ifndef CLIENT_AUTHENTICATION_H
-#define CLIENT_AUTHENTICATION_H
-#include
-#include "mysql.h"
-#include "mysql/client_plugin.h"
-
-C_MODE_START
-int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
-int sha256_password_init(char *, size_t, int, va_list);
-int sha256_password_deinit(void);
-int caching_sha2_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
-int caching_sha2_password_init(char *, size_t, int, va_list);
-int caching_sha2_password_deinit(void);
-C_MODE_END
-
-#endif
-
diff --git a/code/mysql/mysql/client_plugin.h b/code/mysql/mysql/client_plugin.h
deleted file mode 100644
index 2b7fc95..0000000
--- a/code/mysql/mysql/client_plugin.h
+++ /dev/null
@@ -1,214 +0,0 @@
-#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
-
- MySQL Client Plugin API
-
- This file defines the API for plugins that work on the client side
-*/
-#define MYSQL_CLIENT_PLUGIN_INCLUDED
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#include
-#endif
-
-/*
- On Windows, exports from DLL need to be declared.
- Also, plugin needs to be declared as extern "C" because MSVC
- unlike other compilers, uses C++ mangling for variables not only
- for functions.
-*/
-
-#undef MYSQL_PLUGIN_EXPORT
-
-#if defined(_MSC_VER)
-#if defined(MYSQL_DYNAMIC_PLUGIN)
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
- #else
- #define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
- #endif
-#else /* MYSQL_DYNAMIC_PLUGIN */
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C"
- #else
- #define MYSQL_PLUGIN_EXPORT
- #endif
-#endif /*MYSQL_DYNAMIC_PLUGIN */
-#else /*_MSC_VER */
-#define MYSQL_PLUGIN_EXPORT
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* known plugin types */
-#define MYSQL_CLIENT_reserved1 0
-#define MYSQL_CLIENT_reserved2 1
-#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2
-#define MYSQL_CLIENT_TRACE_PLUGIN 3
-
-#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100
-#define MYSQL_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0100
-
-#define MYSQL_CLIENT_MAX_PLUGINS 4
-
-#define mysql_declare_client_plugin(X) \
- MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
- _mysql_client_plugin_declaration_ = { \
- MYSQL_CLIENT_ ## X ## _PLUGIN, \
- MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
-#define mysql_end_client_plugin }
-
-/* generic plugin header structure */
-#define MYSQL_CLIENT_PLUGIN_HEADER \
- int type; \
- unsigned int interface_version; \
- const char *name; \
- const char *author; \
- const char *desc; \
- unsigned int version[3]; \
- const char *license; \
- void *mysql_api; \
- int (*init)(char *, size_t, int, va_list); \
- int (*deinit)(void); \
- int (*options)(const char *option, const void *);
-
-struct st_mysql_client_plugin
-{
- MYSQL_CLIENT_PLUGIN_HEADER
-};
-
-struct st_mysql;
-
-/******** authentication plugin specific declarations *********/
-#include "plugin_auth_common.h"
-
-struct st_mysql_client_plugin_AUTHENTICATION
-{
- MYSQL_CLIENT_PLUGIN_HEADER
- int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
-};
-
-/******** using plugins ************/
-
-/**
- loads a plugin and initializes it
-
- @param mysql MYSQL structure.
- @param name a name of the plugin to load
- @param type type of plugin that should be loaded, -1 to disable type check
- @param argc number of arguments to pass to the plugin initialization
- function
- @param ... arguments for the plugin initialization function
-
- @retval
- a pointer to the loaded plugin, or NULL in case of a failure
-*/
-struct st_mysql_client_plugin *
-mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
- int argc, ...);
-
-/**
- loads a plugin and initializes it, taking va_list as an argument
-
- This is the same as mysql_load_plugin, but take va_list instead of
- a list of arguments.
-
- @param mysql MYSQL structure.
- @param name a name of the plugin to load
- @param type type of plugin that should be loaded, -1 to disable type check
- @param argc number of arguments to pass to the plugin initialization
- function
- @param args arguments for the plugin initialization function
-
- @retval
- a pointer to the loaded plugin, or NULL in case of a failure
-*/
-struct st_mysql_client_plugin *
-mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
- int argc, va_list args);
-
-/**
- finds an already loaded plugin by name, or loads it, if necessary
-
- @param mysql MYSQL structure.
- @param name a name of the plugin to load
- @param type type of plugin that should be loaded
-
- @retval
- a pointer to the plugin, or NULL in case of a failure
-*/
-struct st_mysql_client_plugin *
-mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
-
-/**
- adds a plugin structure to the list of loaded plugins
-
- This is useful if an application has the necessary functionality
- (for example, a special load data handler) statically linked into
- the application binary. It can use this function to register the plugin
- directly, avoiding the need to factor it out into a shared object.
-
- @param mysql MYSQL structure. It is only used for error reporting
- @param plugin an st_mysql_client_plugin structure to register
-
- @retval
- a pointer to the plugin, or NULL in case of a failure
-*/
-struct st_mysql_client_plugin *
-mysql_client_register_plugin(struct st_mysql *mysql,
- struct st_mysql_client_plugin *plugin);
-
-/**
- set plugin options
-
- Can be used to set extra options and affect behavior for a plugin.
- This function may be called multiple times to set several options
-
- @param plugin an st_mysql_client_plugin structure
- @param option a string which specifies the option to set
- @param value value for the option.
-
- @retval 0 on success, 1 in case of failure
-**/
-int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
- const char *option, const void *value);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/code/mysql/mysql/client_plugin.h.pp b/code/mysql/mysql/client_plugin.h.pp
deleted file mode 100644
index 47e760a..0000000
--- a/code/mysql/mysql/client_plugin.h.pp
+++ /dev/null
@@ -1,39 +0,0 @@
-struct st_mysql_client_plugin
-{
- int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *);
-};
-struct st_mysql;
-#include "plugin_auth_common.h"
-typedef struct st_plugin_vio_info
-{
- enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
- MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
- int socket;
-} MYSQL_PLUGIN_VIO_INFO;
-typedef struct st_plugin_vio
-{
- int (*read_packet)(struct st_plugin_vio *vio,
- unsigned char **buf);
- int (*write_packet)(struct st_plugin_vio *vio,
- const unsigned char *packet,
- int packet_len);
- void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
-} MYSQL_PLUGIN_VIO;
-struct st_mysql_client_plugin_AUTHENTICATION
-{
- int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(void); int (*options)(const char *option, const void *);
- int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
-};
-struct st_mysql_client_plugin *
-mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
- int argc, ...);
-struct st_mysql_client_plugin *
-mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
- int argc, va_list args);
-struct st_mysql_client_plugin *
-mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
-struct st_mysql_client_plugin *
-mysql_client_register_plugin(struct st_mysql *mysql,
- struct st_mysql_client_plugin *plugin);
-int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
- const char *option, const void *value);
diff --git a/code/mysql/mysql/com_data.h b/code/mysql/mysql/com_data.h
deleted file mode 100644
index 9fc465e..0000000
--- a/code/mysql/mysql/com_data.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51
- Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#ifndef PLUGIN_PROTOCOL_INCLUDED
-#define PLUGIN_PROTOCOL_INCLUDED
-
-#ifndef MYSQL_ABI_CHECK
-#include "my_global.h" /* Needed for my_bool in mysql_com.h */
-#include "mysql_com.h" /* mysql_enum_shutdown_level */
-#endif
-
-
-/**
-@file
- Definition of COM_DATA to be used with the Command service as data input
- structure.
-*/
-
-
-typedef struct st_com_init_db_data
-{
- const char *db_name;
- unsigned long length;
-} COM_INIT_DB_DATA;
-
-typedef struct st_com_refresh_data
-{
- unsigned char options;
-} COM_REFRESH_DATA;
-
-typedef struct st_com_shutdown_data
-{
- enum mysql_enum_shutdown_level level;
-} COM_SHUTDOWN_DATA;
-
-typedef struct st_com_kill_data
-{
- unsigned long id;
-} COM_KILL_DATA;
-
-typedef struct st_com_set_option_data
-{
- unsigned int opt_command;
-} COM_SET_OPTION_DATA;
-
-typedef struct st_com_stmt_execute_data
-{
- unsigned long stmt_id;
- unsigned long flags;
- unsigned char *params;
- unsigned long params_length;
-} COM_STMT_EXECUTE_DATA;
-
-typedef struct st_com_stmt_fetch_data
-{
- unsigned long stmt_id;
- unsigned long num_rows;
-} COM_STMT_FETCH_DATA;
-
-typedef struct st_com_stmt_send_long_data_data
-{
- unsigned long stmt_id;
- unsigned int param_number;
- unsigned char *longdata;
- unsigned long length;
-} COM_STMT_SEND_LONG_DATA_DATA;
-
-typedef struct st_com_stmt_prepare_data
-{
- const char *query;
- unsigned int length;
-} COM_STMT_PREPARE_DATA;
-
-typedef struct st_stmt_close_data
-{
- unsigned int stmt_id;
-} COM_STMT_CLOSE_DATA;
-
-typedef struct st_com_stmt_reset_data
-{
- unsigned int stmt_id;
-} COM_STMT_RESET_DATA;
-
-typedef struct st_com_query_data
-{
- const char *query;
- unsigned int length;
-} COM_QUERY_DATA;
-
-typedef struct st_com_field_list_data
-{
- unsigned char *table_name;
- unsigned int table_name_length;
- const unsigned char *query;
- unsigned int query_length;
-} COM_FIELD_LIST_DATA;
-
-union COM_DATA {
- COM_INIT_DB_DATA com_init_db;
- COM_REFRESH_DATA com_refresh;
- COM_SHUTDOWN_DATA com_shutdown;
- COM_KILL_DATA com_kill;
- COM_SET_OPTION_DATA com_set_option;
- COM_STMT_EXECUTE_DATA com_stmt_execute;
- COM_STMT_FETCH_DATA com_stmt_fetch;
- COM_STMT_SEND_LONG_DATA_DATA com_stmt_send_long_data;
- COM_STMT_PREPARE_DATA com_stmt_prepare;
- COM_STMT_CLOSE_DATA com_stmt_close;
- COM_STMT_RESET_DATA com_stmt_reset;
- COM_QUERY_DATA com_query;
- COM_FIELD_LIST_DATA com_field_list;
-};
-
-#endif /* PLUGIN_PROTOCOL_INCLUDED */
diff --git a/code/mysql/mysql/get_password.h b/code/mysql/mysql/get_password.h
deleted file mode 100644
index 5b89ee1..0000000
--- a/code/mysql/mysql/get_password.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/*
-** Ask for a password from tty
-** This is an own file to avoid conflicts with curses
-*/
-
-#ifndef MYSQL_GET_PASSWORD_H_INCLUDED
-#define MYSQL_GET_PASSWORD_H_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef char *(* strdup_handler_t)(const char *, int);
-char *get_tty_password_ext(const char *opt_message,
- strdup_handler_t strdup_function);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ! MYSQL_GET_PASSWORD_H_INCLUDED */
diff --git a/code/mysql/mysql/group_replication_priv.h b/code/mysql/mysql/group_replication_priv.h
deleted file mode 100644
index 6ded84f..0000000
--- a/code/mysql/mysql/group_replication_priv.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef GROUP_REPLICATION_PRIV_INCLUDE
-#define GROUP_REPLICATION_PRIV_INCLUDE
-
-#ifndef MYSQL_SERVER
-#define MYSQL_SERVER
-#endif
-
-#ifndef HAVE_REPLICATION
-#define HAVE_REPLICATION
-#endif
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-/**
- Server side initializations.
-*/
-int group_replication_init();
-
-
-/**
- Returns the server connection attribute
-
- @Note This method implementation is on sql_class.cc
-
- @return the pthread for the connection attribute.
-*/
-my_thread_attr_t *get_connection_attrib();
-
-/**
- Returns the server hostname, port and uuid.
-
- @param[out] hostname
- @param[out] port
- @param[out] uuid
- @param[out] server_version
- @param[out] server_ssl_variables
-
-*/
-void get_server_parameters(char **hostname, uint *port, char **uuid,
- unsigned int *server_version,
- st_server_ssl_variables* server_ssl_variables);
-
-/**
- Returns the server_id.
-
- @return server_id
-*/
-ulong get_server_id();
-
-/**
- Returns the server auto_increment_increment
-
- @return auto_increment_increment
-*/
-ulong get_auto_increment_increment();
-
-
-/**
- Returns the server auto_increment_offset
-
- @return auto_increment_offset
-*/
-ulong get_auto_increment_offset();
-
-
-/**
- Set server auto_increment_increment
-
- @param[in] auto_increment_increment
-*/
-void set_auto_increment_increment(ulong auto_increment_increment);
-
-
-/**
- Set server auto_increment_offset
-
- @param[in] auto_increment_offset
-*/
-void set_auto_increment_offset(ulong auto_increment_offset);
-
-
-/**
- Returns a struct containing all server startup information needed to evaluate
- if one has conditions to proceed executing master-master replication.
-
- @param[out] requirements
-
- @param[in] has_lock Caller should set this to true if the calling
- thread holds gtid_mode_lock; otherwise set it to false.
-*/
-void get_server_startup_prerequirements(Trans_context_info& requirements,
- bool has_lock);
-
-
-/**
- Returns the server GTID_EXECUTED encoded as a binary string.
-
- @note Memory allocated to encoded_gtid_executed must be release by caller.
-
- @param[out] encoded_gtid_executed binary string
- @param[out] length binary string length
-*/
-bool get_server_encoded_gtid_executed(uchar **encoded_gtid_executed,
- size_t *length);
-
-#if !defined(DBUG_OFF)
-/**
- Returns a text representation of a encoded GTID set.
-
- @note Memory allocated to returned pointer must be release by caller.
-
- @param[in] encoded_gtid_set binary string
- @param[in] length binary string length
-
- @return a pointer to text representation of the encoded set
-*/
-char* encoded_gtid_set_to_string(uchar *encoded_gtid_set, size_t length);
-#endif
-
-
-/**
- Return last gno for a given sidno, see
- Gtid_state::get_last_executed_gno() for details.
-*/
-rpl_gno get_last_executed_gno(rpl_sidno sidno);
-
-
-/**
- Return sidno for a given sid, see Sid_map::add_sid() for details.
-*/
-rpl_sidno get_sidno_from_global_sid_map(rpl_sid sid);
-
-
-/**
- Set slave thread default options.
-
- @param[in] thd The thread
-*/
-void set_slave_thread_options(THD* thd);
-
-
-/**
- Add thread to Global_THD_manager singleton.
-
- @param[in] thd The thread
-*/
-void global_thd_manager_add_thd(THD *thd);
-
-
-/**
- Remove thread from Global_THD_manager singleton.
-
- @param[in] thd The thread
-*/
-void global_thd_manager_remove_thd(THD *thd);
-
-/**
- Function that returns the write set extraction algorithm name.
-
- @param[in] algorithm The algorithm value
-
- @return the algorithm name
-*/
-const char* get_write_set_algorithm_string(unsigned int algorithm);
-
-/**
- Returns the value of slave_max_allowed_packet.
-
- @return slave_max_allowed_packet
-*/
-unsigned long get_slave_max_allowed_packet();
-
-#endif /* GROUP_REPLICATION_PRIV_INCLUDE */
-
diff --git a/code/mysql/mysql/innodb_priv.h b/code/mysql/mysql/innodb_priv.h
deleted file mode 100644
index 834bebc..0000000
--- a/code/mysql/mysql/innodb_priv.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-
-#ifndef INNODB_PRIV_INCLUDED
-#define INNODB_PRIV_INCLUDED
-
-/** @file Declaring server-internal functions that are used by InnoDB. */
-
-class THD;
-
-int get_quote_char_for_identifier(THD *thd, const char *name, size_t length);
-bool schema_table_store_record(THD *thd, TABLE *table);
-void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
-bool check_global_access(THD *thd, ulong want_access);
-size_t strconvert(CHARSET_INFO *from_cs, const char *from,
- CHARSET_INFO *to_cs, char *to, size_t to_length,
- uint *errors);
-void sql_print_error(const char *format, ...);
-
-/**
- Store record to I_S table, convert HEAP table to InnoDB table if necessary.
-
- @param[in] thd thread handler
- @param[in] table Information schema table to be updated
- @param[in] make_ondisk if true, convert heap table to on disk table.
- default value is true.
- @return 0 on success
- @return error code on failure.
-*/
-int schema_table_store_record2(THD *thd, TABLE *table, bool make_ondisk);
-
-/**
- Convert HEAP table to InnoDB table if necessary
-
- @param[in] thd thread handler
- @param[in] table Information schema table to be converted.
- @param[in] error the error code returned previously.
- @return false on success, true on error.
-*/
-bool convert_heap_table_to_ondisk(THD *thd, TABLE *table, int error);
-
-
-#endif /* INNODB_PRIV_INCLUDED */
diff --git a/code/mysql/mysql/mysql_lex_string.h b/code/mysql/mysql/mysql_lex_string.h
deleted file mode 100644
index 801e0f9..0000000
--- a/code/mysql/mysql/mysql_lex_string.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_LEX_STRING_INCLUDED
-#define MYSQL_LEX_STRING_INCLUDED
-
-struct st_mysql_lex_string
-{
- char *str;
- size_t length;
-};
-typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
-
-struct st_mysql_const_lex_string
-{
- const char *str;
- size_t length;
-};
-typedef struct st_mysql_const_lex_string MYSQL_LEX_CSTRING;
-
-#endif // MYSQL_LEX_STRING_INCLUDED
diff --git a/code/mysql/mysql/plugin.h b/code/mysql/mysql/plugin.h
deleted file mode 100644
index 0ee1b67..0000000
--- a/code/mysql/mysql/plugin.h
+++ /dev/null
@@ -1,752 +0,0 @@
-/* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _my_plugin_h
-#define _my_plugin_h
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#include "mysql_version.h" /* MYSQL_VERSION_ID */
-#endif
-
-/*
- On Windows, exports from DLL need to be declared.
- Also, plugin needs to be declared as extern "C" because MSVC
- unlike other compilers, uses C++ mangling for variables not only
- for functions.
-*/
-#if defined(_MSC_VER)
-#if defined(MYSQL_DYNAMIC_PLUGIN)
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
- #else
- #define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
- #endif
-#else /* MYSQL_DYNAMIC_PLUGIN */
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C"
- #else
- #define MYSQL_PLUGIN_EXPORT
- #endif
-#endif /*MYSQL_DYNAMIC_PLUGIN */
-#else /*_MSC_VER */
-#define MYSQL_PLUGIN_EXPORT
-#endif
-
-#ifdef __cplusplus
-class THD;
-class Item;
-#define MYSQL_THD THD*
-#else
-#define MYSQL_THD void*
-#endif
-
-typedef void * MYSQL_PLUGIN;
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#define MYSQL_XIDDATASIZE 128
-/**
- struct st_mysql_xid is binary compatible with the XID structure as
- in the X/Open CAE Specification, Distributed Transaction Processing:
- The XA Specification, X/Open Company Ltd., 1991.
- http://www.opengroup.org/bookstore/catalog/c193.htm
-
- @see XID in sql/handler.h
-*/
-struct st_mysql_xid {
- long formatID;
- long gtrid_length;
- long bqual_length;
- char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */
-};
-typedef struct st_mysql_xid MYSQL_XID;
-
-/*************************************************************************
- Plugin API. Common for all plugin types.
-*/
-
-#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0107
-
-/*
- The allowable types of plugins
-*/
-#define MYSQL_UDF_PLUGIN 0 /* User-defined function */
-#define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */
-#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
-#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */
-#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
-#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
-#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
-#define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */
-#define MYSQL_VALIDATE_PASSWORD_PLUGIN 8 /* validate password plugin type */
-#define MYSQL_GROUP_REPLICATION_PLUGIN 9 /* The Group Replication plugin */
-#define MYSQL_KEYRING_PLUGIN 10 /* The Keyring plugin type */
-#define MYSQL_MAX_PLUGIN_TYPE_NUM 11 /* The number of plugin types */
-
-/* We use the following strings to define licenses for plugins */
-#define PLUGIN_LICENSE_PROPRIETARY 0
-#define PLUGIN_LICENSE_GPL 1
-#define PLUGIN_LICENSE_BSD 2
-
-#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
-#define PLUGIN_LICENSE_GPL_STRING "GPL"
-#define PLUGIN_LICENSE_BSD_STRING "BSD"
-
-/*
- Macros for beginning and ending plugin declarations. Between
- mysql_declare_plugin and mysql_declare_plugin_end there should
- be a st_mysql_plugin struct for each plugin to be declared.
-*/
-
-
-#ifndef MYSQL_DYNAMIC_PLUGIN
-#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
-MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
-MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \
-MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= {
-#else
-#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
-MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
-MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
-MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
-#endif
-
-#define mysql_declare_plugin(NAME) \
-__MYSQL_DECLARE_PLUGIN(NAME, \
- builtin_ ## NAME ## _plugin_interface_version, \
- builtin_ ## NAME ## _sizeof_struct_st_plugin, \
- builtin_ ## NAME ## _plugin)
-
-#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
-
-/**
- Declarations for SHOW STATUS support in plugins
-*/
-enum enum_mysql_show_type
-{
- SHOW_UNDEF, SHOW_BOOL,
- SHOW_INT, ///< shown as _unsigned_ int
- SHOW_LONG, ///< shown as _unsigned_ long
- SHOW_LONGLONG, ///< shown as _unsigned_ longlong
- SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
-#ifdef MYSQL_SERVER
- /*
- This include defines server-only values of the enum.
- Using them in plugins is not supported.
- */
- #include "sql_plugin_enum.h"
-#endif
-};
-
-/**
- Status variable scope.
- Only GLOBAL status variable scope is available in plugins.
-*/
-enum enum_mysql_show_scope
-{
- SHOW_SCOPE_UNDEF,
- SHOW_SCOPE_GLOBAL
-#ifdef MYSQL_SERVER
- /* Server-only values. Not supported in plugins. */
- ,
- SHOW_SCOPE_SESSION,
- SHOW_SCOPE_ALL
-#endif
-};
-
-/**
- SHOW STATUS Server status variable
-*/
-struct st_mysql_show_var
-{
- const char *name;
- char *value;
- enum enum_mysql_show_type type;
- enum enum_mysql_show_scope scope;
-};
-
-#define SHOW_VAR_MAX_NAME_LEN 64
-#define SHOW_VAR_FUNC_BUFF_SIZE 1024
-typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *);
-
-
-/*
- Constants for plugin flags.
- */
-
-#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
-#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
-
-
-/*
- declarations for server variables and command line options
-*/
-
-
-#define PLUGIN_VAR_BOOL 0x0001
-#define PLUGIN_VAR_INT 0x0002
-#define PLUGIN_VAR_LONG 0x0003
-#define PLUGIN_VAR_LONGLONG 0x0004
-#define PLUGIN_VAR_STR 0x0005
-#define PLUGIN_VAR_ENUM 0x0006
-#define PLUGIN_VAR_SET 0x0007
-#define PLUGIN_VAR_DOUBLE 0x0008
-#define PLUGIN_VAR_UNSIGNED 0x0080
-#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */
-#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
-#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */
-#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */
-#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
-#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
-#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
-#define PLUGIN_VAR_NODEFAULT 0x4000 /* SET DEFAULT is prohibited */
-#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
-#define PLUGIN_VAR_INVISIBLE 0x10000 /* Variable should not be shown */
-
-struct st_mysql_sys_var;
-struct st_mysql_value;
-
-/*
- SYNOPSIS
- (*mysql_var_check_func)()
- thd thread handle
- var dynamic variable being altered
- save pointer to temporary storage
- value user provided value
- RETURN
- 0 user provided value is OK and the update func may be called.
- any other value indicates error.
-
- This function should parse the user provided value and store in the
- provided temporary storage any data as required by the update func.
- There is sufficient space in the temporary storage to store a double.
- Note that the update func may not be called if any other error occurs
- so any memory allocated should be thread-local so that it may be freed
- automatically at the end of the statement.
-*/
-
-typedef int (*mysql_var_check_func)(MYSQL_THD thd,
- struct st_mysql_sys_var *var,
- void *save, struct st_mysql_value *value);
-
-/*
- SYNOPSIS
- (*mysql_var_update_func)()
- thd thread handle
- var dynamic variable being altered
- var_ptr pointer to dynamic variable
- save pointer to temporary storage
- RETURN
- NONE
-
- This function should use the validated value stored in the temporary store
- and persist it in the provided pointer to the dynamic variable.
- For example, strings may require memory to be allocated.
-*/
-typedef void (*mysql_var_update_func)(MYSQL_THD thd,
- struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-
-
-/* the following declarations are for internal use only */
-
-
-#define PLUGIN_VAR_MASK \
- (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \
- PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \
- PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC | \
- PLUGIN_VAR_NODEFAULT | PLUGIN_VAR_INVISIBLE)
-
-#define MYSQL_PLUGIN_VAR_HEADER \
- int flags; \
- const char *name; \
- const char *comment; \
- mysql_var_check_func check; \
- mysql_var_update_func update
-
-#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name
-#define MYSQL_SYSVAR(name) \
- ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name)))
-
-/*
- for global variables, the value pointer is the first
- element after the header, the default value is the second.
- for thread variables, the value offset is the first
- element after the header, the default value is the second.
-*/
-
-
-#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- type *value; \
- const type def_val; \
-} MYSQL_SYSVAR_NAME(name)
-
-#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- type *value; type def_val; \
- type min_val; type max_val; \
- type blk_sz; \
-} MYSQL_SYSVAR_NAME(name)
-
-#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- type *value; type def_val; \
- TYPELIB *typelib; \
-} MYSQL_SYSVAR_NAME(name)
-
-#define DECLARE_THDVAR_FUNC(type) \
- type *(*resolve)(MYSQL_THD thd, int offset)
-
-#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- int offset; \
- const type def_val; \
- DECLARE_THDVAR_FUNC(type); \
-} MYSQL_SYSVAR_NAME(name)
-
-#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- int offset; \
- type def_val; type min_val; \
- type max_val; type blk_sz; \
- DECLARE_THDVAR_FUNC(type); \
-} MYSQL_SYSVAR_NAME(name)
-
-#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \
- MYSQL_PLUGIN_VAR_HEADER; \
- int offset; \
- type def_val; \
- DECLARE_THDVAR_FUNC(type); \
- TYPELIB *typelib; \
-} MYSQL_SYSVAR_NAME(name)
-
-
-/*
- the following declarations are for use by plugin implementors
-*/
-
-#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
-DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \
- PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def}
-
-#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
-DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
- PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def}
-
-#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
- PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
- PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
- PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
- PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
- PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
- PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
-DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
- PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, typelib }
-
-#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
-DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
- PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, typelib }
-
-#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
- PLUGIN_VAR_DOUBLE | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, &varname, def, min, max, blk }
-
-#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
-DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \
- PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, NULL}
-
-#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
-DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
- PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, NULL}
-
-#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
- PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
- PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
- PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
- PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
- PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
- PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
-DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
- PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, NULL, typelib }
-
-#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
-DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
- PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, NULL, typelib }
-
-#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, blk) \
-DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
- PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
- #name, comment, check, update, -1, def, min, max, blk, NULL }
-
-/* accessor macros */
-
-#define SYSVAR(name) \
- (*(MYSQL_SYSVAR_NAME(name).value))
-
-/* when thd == null, result points to global value */
-#define THDVAR(thd, name) \
- (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
-
-
-/*
- Plugin description structure.
-*/
-
-struct st_mysql_plugin
-{
- int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- void *info; /* pointer to type-specific plugin descriptor */
- const char *name; /* plugin name */
- const char *author; /* plugin author (for I_S.PLUGINS) */
- const char *descr; /* general descriptive text (for I_S.PLUGINS) */
- int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
- int (*init)(MYSQL_PLUGIN); /* the function to invoke when plugin is loaded */
- int (*deinit)(MYSQL_PLUGIN);/* the function to invoke when plugin is unloaded */
- unsigned int version; /* plugin version (for I_S.PLUGINS) */
- struct st_mysql_show_var *status_vars;
- struct st_mysql_sys_var **system_vars;
- void * __reserved1; /* reserved for dependency checking */
- unsigned long flags; /* flags for plugin */
-};
-
-/*************************************************************************
- API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
-*/
-#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0101
-
-/*************************************************************************
- API for Query Rewrite plugin. (MYSQL_QUERY_REWRITE_PLUGIN)
-*/
-
-#define MYSQL_REWRITE_PRE_PARSE_INTERFACE_VERSION 0x0010
-#define MYSQL_REWRITE_POST_PARSE_INTERFACE_VERSION 0x0010
-
-/*************************************************************************
- API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN)
-*/
-
-/* handlertons of different MySQL releases are incompatible */
-#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
-
-/*
- Here we define only the descriptor structure, that is referred from
- st_mysql_plugin.
-*/
-
-struct st_mysql_daemon
-{
- int interface_version;
-};
-
-
-/*************************************************************************
- API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN)
-*/
-
-/* handlertons of different MySQL releases are incompatible */
-#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
-
-/*
- Here we define only the descriptor structure, that is referred from
- st_mysql_plugin.
-*/
-
-struct st_mysql_information_schema
-{
- int interface_version;
-};
-
-
-/*************************************************************************
- API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN)
-*/
-
-/* handlertons of different MySQL releases are incompatible */
-#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
-
-/*
- The real API is in the sql/handler.h
- Here we define only the descriptor structure, that is referred from
- st_mysql_plugin.
-*/
-
-struct st_mysql_storage_engine
-{
- int interface_version;
-};
-
-struct handlerton;
-
-
-/*
- API for Replication plugin. (MYSQL_REPLICATION_PLUGIN)
-*/
- #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0400
-
- /**
- Replication plugin descriptor
- */
- struct Mysql_replication {
- int interface_version;
- };
-
-/*************************************************************************
- st_mysql_value struct for reading values from mysqld.
- Used by server variables framework to parse user-provided values.
- Will be used for arguments when implementing UDFs.
-
- Note that val_str() returns a string in temporary memory
- that will be freed at the end of statement. Copy the string
- if you need it to persist.
-*/
-
-#define MYSQL_VALUE_TYPE_STRING 0
-#define MYSQL_VALUE_TYPE_REAL 1
-#define MYSQL_VALUE_TYPE_INT 2
-
-struct st_mysql_value
-{
- int (*value_type)(struct st_mysql_value *);
- const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
- int (*val_real)(struct st_mysql_value *, double *realbuf);
- int (*val_int)(struct st_mysql_value *, long long *intbuf);
- int (*is_unsigned)(struct st_mysql_value *);
-};
-
-
-/*************************************************************************
- Miscellaneous functions for plugin implementors
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int thd_in_lock_tables(const MYSQL_THD thd);
-int thd_tablespace_op(const MYSQL_THD thd);
-long long thd_test_options(const MYSQL_THD thd, long long test_options);
-int thd_sql_command(const MYSQL_THD thd);
-const char *set_thd_proc_info(MYSQL_THD thd, const char *info,
- const char *calling_func,
- const char *calling_file,
- const unsigned int calling_line);
-void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
-void thd_storage_lock_wait(MYSQL_THD thd, long long value);
-int thd_tx_isolation(const MYSQL_THD thd);
-int thd_tx_is_read_only(const MYSQL_THD thd);
-MYSQL_THD thd_tx_arbitrate(MYSQL_THD requestor, MYSQL_THD holder);
-int thd_tx_priority(const MYSQL_THD thd);
-int thd_tx_is_dd_trx(const MYSQL_THD thd);
-char *thd_security_context(MYSQL_THD thd, char *buffer, size_t length,
- size_t max_query_len);
-/* Increments the row counter, see THD::row_count */
-void thd_inc_row_count(MYSQL_THD thd);
-int thd_allow_batch(MYSQL_THD thd);
-
-
-/**
- Mark transaction to rollback and mark error as fatal to a
- sub-statement if in sub statement mode.
-
- @param thd user thread connection handle
- @param all if all != 0, rollback the main transaction
-*/
-
-void thd_mark_transaction_to_rollback(MYSQL_THD thd, int all);
-
-/**
- Create a temporary file.
-
- @details
- The temporary file is created in a location specified by the mysql
- server configuration (--tmpdir option). The caller does not need to
- delete the file, it will be deleted automatically.
-
- @param prefix prefix for temporary file name
- @retval -1 error
- @retval >= 0 a file handle that can be passed to dup or my_close
-*/
-int mysql_tmpfile(const char *prefix);
-
-/**
- Check the killed state of a connection
-
- @details
- In MySQL support for the KILL statement is cooperative. The KILL
- statement only sets a "killed" flag. This function returns the value
- of that flag. A thread should check it often, especially inside
- time-consuming loops, and gracefully abort the operation if it is
- non-zero.
-
- @param thd user thread connection handle
- @retval 0 the connection is active
- @retval 1 the connection has been killed
-*/
-int thd_killed(const MYSQL_THD thd);
-
-/**
- Set the killed status of the current statement.
-
- @param thd user thread connection handle
-*/
-void thd_set_kill_status(const MYSQL_THD thd);
-
-/**
- Get binary log position for latest written entry.
-
- @note The file variable will be set to a buffer holding the name of
- the file name currently, but this can change if a rotation
- occur. Copy the string if you want to retain it.
-
- @param thd Use thread connection handle
- @param file_var Pointer to variable that will hold the file name.
- @param pos_var Pointer to variable that will hold the file position.
- */
-void thd_binlog_pos(const MYSQL_THD thd,
- const char **file_var,
- unsigned long long *pos_var);
-
-/**
- Return the thread id of a user thread
-
- @param thd user thread connection handle
- @return thread id
-*/
-unsigned long thd_get_thread_id(const MYSQL_THD thd);
-
-/**
- Get the XID for this connection's transaction
-
- @param thd user thread connection handle
- @param xid location where identifier is stored
-*/
-void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);
-
-/**
- Invalidate the query cache for a given table.
-
- @param thd user thread connection handle
- @param key databasename/tablename in the canonical format.
- @param key_length length of key in bytes, including the PATH separator
- @param using_trx flag: TRUE if using transactions, FALSE otherwise
-*/
-void mysql_query_cache_invalidate4(MYSQL_THD thd,
- const char *key, unsigned int key_length,
- int using_trx);
-
-
-/**
- Provide a handler data getter to simplify coding
-*/
-void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
-
-
-/**
- Provide a handler data setter to simplify coding
-
- @details
- Set ha_data pointer (storage engine per-connection information).
-
- To avoid unclean deactivation (uninstall) of storage engine plugin
- in the middle of transaction, additional storage engine plugin
- lock is acquired.
-
- If ha_data is not null and storage engine plugin was not locked
- by thd_set_ha_data() in this connection before, storage engine
- plugin gets locked.
-
- If ha_data is null and storage engine plugin was locked by
- thd_set_ha_data() in this connection before, storage engine
- plugin lock gets released.
-
- If handlerton::close_connection() didn't reset ha_data, server does
- it immediately after calling handlerton::close_connection().
-*/
-void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
- const void *ha_data);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _my_plugin_h */
diff --git a/code/mysql/mysql/plugin_audit.h b/code/mysql/mysql/plugin_audit.h
deleted file mode 100644
index 606bfbf..0000000
--- a/code/mysql/mysql/plugin_audit.h
+++ /dev/null
@@ -1,565 +0,0 @@
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _my_audit_h
-#define _my_audit_h
-
-#include "plugin.h"
-#include "mysql/mysql_lex_string.h"
-#ifndef MYSQL_ABI_CHECK
-#include "m_string.h"
-#endif
-#include "my_command.h"
-#include "my_sqlcommand.h"
-
-#define MYSQL_AUDIT_INTERFACE_VERSION 0x0401
-
-/**
- @enum mysql_event_class_t
-
- Audit event classes.
-*/
-typedef enum
-{
- MYSQL_AUDIT_GENERAL_CLASS = 0,
- MYSQL_AUDIT_CONNECTION_CLASS = 1,
- MYSQL_AUDIT_PARSE_CLASS = 2,
- MYSQL_AUDIT_AUTHORIZATION_CLASS = 3,
- MYSQL_AUDIT_TABLE_ACCESS_CLASS = 4,
- MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS = 5,
- MYSQL_AUDIT_SERVER_STARTUP_CLASS = 6,
- MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS = 7,
- MYSQL_AUDIT_COMMAND_CLASS = 8,
- MYSQL_AUDIT_QUERY_CLASS = 9,
- MYSQL_AUDIT_STORED_PROGRAM_CLASS = 10,
- /* This item must be last in the list. */
- MYSQL_AUDIT_CLASS_MASK_SIZE
-} mysql_event_class_t;
-
-/**
- @struct st_mysql_audit
-
- The descriptor structure that is referred from st_mysql_plugin.
-*/
-struct st_mysql_audit
-{
- /**
- Interface version.
- */
- int interface_version;
-
- /**
- Event occurs when the event class consumer is to be
- disassociated from the specified THD.This would typically occur
- before some operation which may require sleeping - such as when
- waiting for the next query from the client.
- */
- void (*release_thd)(MYSQL_THD);
-
- /**
- Invoked whenever an event occurs which is of any
- class for which the plugin has interest.The second argument
- indicates the specific event class and the third argument is data
- as required for that class.
- */
- int (*event_notify)(MYSQL_THD, mysql_event_class_t, const void *);
-
- /**
- An array of bits used to indicate what event classes
- that this plugin wants to receive.
- */
- unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
-};
-
-/**
- @typedef enum_sql_command_t
-
- SQL command type definition.
-*/
-typedef enum enum_sql_command enum_sql_command_t;
-
-/**
- @enum mysql_event_general_subclass_t
-
- Events for the MYSQL_AUDIT_GENERAL_CLASS event class.
-*/
-typedef enum
-{
- /** occurs before emitting to the general query log. */
- MYSQL_AUDIT_GENERAL_LOG = 1 << 0,
- /** occurs before transmitting errors to the user. */
- MYSQL_AUDIT_GENERAL_ERROR = 1 << 1,
- /** occurs after transmitting a resultset to the user. */
- MYSQL_AUDIT_GENERAL_RESULT = 1 << 2,
- /** occurs after transmitting a resultset or errors */
- MYSQL_AUDIT_GENERAL_STATUS = 1 << 3
-} mysql_event_general_subclass_t;
-
-#define MYSQL_AUDIT_GENERAL_ALL (MYSQL_AUDIT_GENERAL_LOG | \
- MYSQL_AUDIT_GENERAL_ERROR | \
- MYSQL_AUDIT_GENERAL_RESULT | \
- MYSQL_AUDIT_GENERAL_STATUS)
-/**
- @struct mysql_event_general
-
- Structure for the MYSQL_AUDIT_GENERAL_CLASS event class.
-*/
-struct mysql_event_general
-{
- mysql_event_general_subclass_t event_subclass;
- int general_error_code;
- unsigned long general_thread_id;
- MYSQL_LEX_CSTRING general_user;
- MYSQL_LEX_CSTRING general_command;
- MYSQL_LEX_CSTRING general_query;
- struct charset_info_st *general_charset;
- unsigned long long general_time;
- unsigned long long general_rows;
- MYSQL_LEX_CSTRING general_host;
- MYSQL_LEX_CSTRING general_sql_command;
- MYSQL_LEX_CSTRING general_external_user;
- MYSQL_LEX_CSTRING general_ip;
-};
-
-/**
- @enum mysql_event_connection_subclass_t
-
- Events for MYSQL_AUDIT_CONNECTION_CLASS event class.
-*/
-typedef enum
-{
- /** occurs after authentication phase is completed. */
- MYSQL_AUDIT_CONNECTION_CONNECT = 1 << 0,
- /** occurs after connection is terminated. */
- MYSQL_AUDIT_CONNECTION_DISCONNECT = 1 << 1,
- /** occurs after COM_CHANGE_USER RPC is completed. */
- MYSQL_AUDIT_CONNECTION_CHANGE_USER = 1 << 2,
- /** occurs before authentication. */
- MYSQL_AUDIT_CONNECTION_PRE_AUTHENTICATE = 1 << 3
-} mysql_event_connection_subclass_t;
-
-#define MYSQL_AUDIT_CONNECTION_ALL (MYSQL_AUDIT_CONNECTION_CONNECT | \
- MYSQL_AUDIT_CONNECTION_DISCONNECT | \
- MYSQL_AUDIT_CONNECTION_CHANGE_USER | \
- MYSQL_AUDIT_CONNECTION_PRE_AUTHENTICATE)
-/**
- @struct mysql_event_connection
-
- Structure for the MYSQL_AUDIT_CONNECTION_CLASS event class.
-*/
-struct mysql_event_connection
-{
- /** Event subclass. */
- mysql_event_connection_subclass_t event_subclass;
- /** Current status of the connection. */
- int status;
- /** Connection id. */
- unsigned long connection_id;
- /** User name of this connection. */
- MYSQL_LEX_CSTRING user;
- /** Priv user name. */
- MYSQL_LEX_CSTRING priv_user;
- /** External user name. */
- MYSQL_LEX_CSTRING external_user;
- /** Proxy user used for this connection. */
- MYSQL_LEX_CSTRING proxy_user;
- /** Connection host. */
- MYSQL_LEX_CSTRING host;
- /** IP of the connection. */
- MYSQL_LEX_CSTRING ip;
- /** Database name specified at connection time. */
- MYSQL_LEX_CSTRING database;
- /** Connection type:
- - 0 Undefined
- - 1 TCP/IP
- - 2 Socket
- - 3 Named pipe
- - 4 SSL
- - 5 Shared memory
- */
- int connection_type;
-};
-
-/**
-@enum mysql_event_parse_subclass_t
-
-Events for MYSQL_AUDIT_PARSE_CLASS event class.
-*/
-typedef enum
-{
- /** occurs before the query parsing. */
- MYSQL_AUDIT_PARSE_PREPARSE = 1 << 0,
- /** occurs after the query parsing. */
- MYSQL_AUDIT_PARSE_POSTPARSE = 1 << 1
-} mysql_event_parse_subclass_t;
-
-#define MYSQL_AUDIT_PARSE_ALL (MYSQL_AUDIT_PARSE_PREPARSE | \
- MYSQL_AUDIT_PARSE_POSTPARSE)
-
-typedef enum
-{
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_NONE = 0,
- /// mysql_event_parse::flags Must be set by a plugin if the query is rewritten.
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_QUERY_REWRITTEN = 1 << 0,
- /// mysql_event_parse::flags Is set by the server if the query is prepared statement.
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_IS_PREPARED_STATEMENT = 1 << 1
-} mysql_event_parse_rewrite_plugin_flag;
-
-/** Data for the MYSQL_AUDIT_PARSE events */
-struct mysql_event_parse
-{
- /** MYSQL_AUDIT_[PRE|POST]_PARSE event id */
- mysql_event_parse_subclass_t event_subclass;
-
- /** one of FLAG_REWRITE_PLUGIN_* */
- mysql_event_parse_rewrite_plugin_flag *flags;
-
- /** input: the original query text */
- MYSQL_LEX_CSTRING query;
-
- /** output: returns the null-terminated rewriten query allocated by my_malloc() */
- MYSQL_LEX_CSTRING *rewritten_query;
-};
-
-/**
- @enum mysql_event_authorization_subclass_t
-
- Events for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
-*/
-typedef enum
-{
- MYSQL_AUDIT_AUTHORIZATION_USER = 1 << 0,
- /** Occurs when database privilege is checked. */
- MYSQL_AUDIT_AUTHORIZATION_DB = 1 << 1,
- /** Occurs when table privilege is checked. */
- MYSQL_AUDIT_AUTHORIZATION_TABLE = 1 << 2,
- /** Occurs when column privilege is checked. */
- MYSQL_AUDIT_AUTHORIZATION_COLUMN = 1 << 3,
- /** Occurs when procedure privilege is checked. */
- MYSQL_AUDIT_AUTHORIZATION_PROCEDURE = 1 << 4,
- /** Occurs when proxy privilege is checked. */
- MYSQL_AUDIT_AUTHORIZATION_PROXY = 1 << 5
-} mysql_event_authorization_subclass_t;
-
-#define MYSQL_AUDIT_AUTHORIZATION_ALL (MYSQL_AUDIT_AUTHORIZATION_USER | \
- MYSQL_AUDIT_AUTHORIZATION_DB | \
- MYSQL_AUDIT_AUTHORIZATION_TABLE | \
- MYSQL_AUDIT_AUTHORIZATION_COLUMN | \
- MYSQL_AUDIT_AUTHORIZATION_PROCEDURE | \
- MYSQL_AUDIT_AUTHORIZATION_PROXY)
-/**
- @struct mysql_event_authorization
-
- Structure for MYSQL_AUDIT_AUTHORIZATION_CLASS event class.
-*/
-struct mysql_event_authorization
-{
- /** Event subclass. */
- mysql_event_authorization_subclass_t event_subclass;
- /** Event status. */
- int status;
- /** Connection id. */
- unsigned int connection_id;
- /** SQL command id. */
- enum_sql_command_t sql_command_id;
- /** SQL query text. */
- MYSQL_LEX_CSTRING query;
- /** SQL query charset. */
- const struct charset_info_st *query_charset;
- /** Database name. */
- MYSQL_LEX_CSTRING database;
- /** Table name. */
- MYSQL_LEX_CSTRING table;
- /** Other name associated with the event. */
- MYSQL_LEX_CSTRING object;
- /** Requested authorization privileges. */
- unsigned long requested_privilege;
- /** Currently granted authorization privileges. */
- unsigned long granted_privilege;
-};
-
-/**
- @enum mysql_event_table_row_access_subclass_t
-
- Events for MYSQL_AUDIT_TABLE_ACCES_CLASS event class.
-*/
-typedef enum
-{
- /** Occurs when table data are read. */
- MYSQL_AUDIT_TABLE_ACCESS_READ = 1 << 0,
- /** Occurs when table data are inserted. */
- MYSQL_AUDIT_TABLE_ACCESS_INSERT = 1 << 1,
- /** Occurs when table data are updated. */
- MYSQL_AUDIT_TABLE_ACCESS_UPDATE = 1 << 2,
- /** Occurs when table data are deleted. */
- MYSQL_AUDIT_TABLE_ACCESS_DELETE = 1 << 3
-} mysql_event_table_access_subclass_t;
-
-#define MYSQL_AUDIT_TABLE_ACCESS_ALL (MYSQL_AUDIT_TABLE_ACCESS_READ | \
- MYSQL_AUDIT_TABLE_ACCESS_INSERT | \
- MYSQL_AUDIT_TABLE_ACCESS_UPDATE | \
- MYSQL_AUDIT_TABLE_ACCESS_DELETE)
-
-/**
- @struct mysql_event_table_row_access
-
- Structure for MYSQL_AUDIT_TABLE_ACCES_CLASS event class.
-*/
-struct mysql_event_table_access
-{
- /** Event subclass. */
- mysql_event_table_access_subclass_t event_subclass;
- /** Connection id. */
- unsigned long connection_id;
- /** SQL command id. */
- enum_sql_command_t sql_command_id;
- /** SQL query. */
- MYSQL_LEX_CSTRING query;
- /** SQL query charset. */
- const struct charset_info_st *query_charset;
- /** Database name. */
- MYSQL_LEX_CSTRING table_database;
- /** Table name. */
- MYSQL_LEX_CSTRING table_name;
-};
-
-/**
- @enum mysql_event_global_variable_subclass_t
-
- Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class.
-*/
-typedef enum
-{
- /** Occurs when global variable is retrieved. */
- MYSQL_AUDIT_GLOBAL_VARIABLE_GET = 1 << 0,
- /** Occurs when global variable is set. */
- MYSQL_AUDIT_GLOBAL_VARIABLE_SET = 1 << 1
-} mysql_event_global_variable_subclass_t;
-
-#define MYSQL_AUDIT_GLOBAL_VARIABLE_ALL (MYSQL_AUDIT_GLOBAL_VARIABLE_GET | \
- MYSQL_AUDIT_GLOBAL_VARIABLE_SET)
-
-/** Events for MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS event class. */
-struct mysql_event_global_variable
-{
- /** Event subclass. */
- mysql_event_global_variable_subclass_t event_subclass;
- /** Connection id. */
- unsigned long connection_id;
- /** SQL command id. */
- enum_sql_command_t sql_command_id;
- /** Variable name. */
- MYSQL_LEX_CSTRING variable_name;
- /** Variable value. */
- MYSQL_LEX_CSTRING variable_value;
-};
-
-/**
- @enum mysql_event_server_startup_subclass_t
-
- Events for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
-*/
-typedef enum
-{
- /** Occurs after all subsystem are initialized during system start. */
- MYSQL_AUDIT_SERVER_STARTUP_STARTUP = 1 << 0
-} mysql_event_server_startup_subclass_t;
-
-#define MYSQL_AUDIT_SERVER_STARTUP_ALL (MYSQL_AUDIT_SERVER_STARTUP_STARTUP)
-
-/**
- @struct mysql_event_server_startup
-
- Structure for MYSQL_AUDIT_SERVER_STARTUP_CLASS event class.
-*/
-struct mysql_event_server_startup
-{
- /** Event subclass. */
- mysql_event_server_startup_subclass_t event_subclass;
- /** Command line arguments. */
- const char **argv;
- /** Command line arguments count. */
- unsigned int argc;
-};
-
-/**
- @enum mysql_event_server_shutdown_subclass_t
-
- Events for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
-*/
-typedef enum
-{
- /** Occurs when global variable is set. */
- MYSQL_AUDIT_SERVER_SHUTDOWN_SHUTDOWN = 1 << 0
-} mysql_event_server_shutdown_subclass_t;
-
-#define MYSQL_AUDIT_SERVER_SHUTDOWN_ALL (MYSQL_AUDIT_SERVER_SHUTDOWN_SHUTDOWN)
-
-/**
- @enum mysql_server_shutdown_reason_t
-
- Server shutdown reason.
-*/
-typedef enum
-{
- /** User requested shut down. */
- MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_SHUTDOWN,
- /** The server aborts. */
- MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_ABORT
-} mysql_server_shutdown_reason_t;
-
-/**
- @struct mysql_event_server_shutdown
-
- Structure for MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS event class.
-*/
-struct mysql_event_server_shutdown
-{
- /** Shutdown event. */
- mysql_event_server_shutdown_subclass_t event_subclass;
- /** Exit code associated with the shutdown event. */
- int exit_code;
- /** Shutdown reason. */
- mysql_server_shutdown_reason_t reason;
-};
-
-/**
- @enum mysql_event_command_subclass_t
-
- Events for MYSQL_AUDIT_COMMAND_CLASS event class.
-*/
-typedef enum
-{
- /** Command start event. */
- MYSQL_AUDIT_COMMAND_START = 1 << 0,
- /** Command end event. */
- MYSQL_AUDIT_COMMAND_END = 1 << 1
-} mysql_event_command_subclass_t;
-
-#define MYSQL_AUDIT_COMMAND_ALL (MYSQL_AUDIT_COMMAND_START | \
- MYSQL_AUDIT_COMMAND_END)
-/**
- @typedef enum_server_command_t
-
- Server command type definition.
-*/
-typedef enum enum_server_command enum_server_command_t;
-
-/**
- @struct mysql_event_command
-
- Event for MYSQL_AUDIT_COMMAND_CLASS event class.
- Events generated as a result of RPC command requests.
-*/
-struct mysql_event_command
-{
- /** Command event subclass. */
- mysql_event_command_subclass_t event_subclass;
- /** Command event status. */
- int status;
- /** Connection id. */
- unsigned long connection_id;
- /** Command id. */
- enum_server_command_t command_id;
-};
-
-/**
- @enum mysql_event_query_subclass_t
-
- Events for MYSQL_AUDIT_QUERY_CLASS event class.
-*/
-typedef enum
-{
- /** Query start event. */
- MYSQL_AUDIT_QUERY_START = 1 << 0,
- /** Nested query start event. */
- MYSQL_AUDIT_QUERY_NESTED_START = 1 << 1,
- /** Query post parse event. */
- MYSQL_AUDIT_QUERY_STATUS_END = 1 << 2,
- /** Nested query status end event. */
- MYSQL_AUDIT_QUERY_NESTED_STATUS_END = 1 << 3
-} mysql_event_query_subclass_t;
-
-#define MYSQL_AUDIT_QUERY_ALL (MYSQL_AUDIT_QUERY_START | \
- MYSQL_AUDIT_QUERY_NESTED_START | \
- MYSQL_AUDIT_QUERY_STATUS_END | \
- MYSQL_AUDIT_QUERY_NESTED_STATUS_END)
-/**
- @struct mysql_event_command
-
- Event for MYSQL_AUDIT_COMMAND_CLASS event class.
-*/
-struct mysql_event_query
-{
- /** Event subclass. */
- mysql_event_query_subclass_t event_subclass;
- /** Event status. */
- int status;
- /** Connection id. */
- unsigned long connection_id;
- /** SQL command id. */
- enum_sql_command_t sql_command_id;
- /** SQL query. */
- MYSQL_LEX_CSTRING query;
- /** SQL query charset. */
- const struct charset_info_st *query_charset;
-};
-
-/**
- @enum mysql_event_stored_program_subclass_t
-
- Events for MYSQL_AUDIT_STORED_PROGRAM_CLASS event class.
-*/
-typedef enum
-{
- /** Stored program execution event. */
- MYSQL_AUDIT_STORED_PROGRAM_EXECUTE = 1 << 0
-} mysql_event_stored_program_subclass_t;
-
-#define MYSQL_AUDIT_STORED_PROGRAM_ALL (MYSQL_AUDIT_STORED_PROGRAM_EXECUTE)
-
-/**
- @struct mysql_event_command
-
-Event for MYSQL_AUDIT_COMMAND_CLASS event class.
-*/
-struct mysql_event_stored_program
-{
- /** Event subclass. */
- mysql_event_stored_program_subclass_t event_subclass;
- /** Connection id. */
- unsigned long connection_id;
- /** SQL command id. */
- enum_sql_command_t sql_command_id;
- /** SQL query text. */
- MYSQL_LEX_CSTRING query;
- /** SQL query charset. */
- const struct charset_info_st *query_charset;
- /** The Database the procedure is defined in. */
- MYSQL_LEX_CSTRING database;
- /** Name of the stored program. */
- MYSQL_LEX_CSTRING name;
- /** Stored program parameters. */
- void *parameters;
-};
-
-#endif
diff --git a/code/mysql/mysql/plugin_audit.h.pp b/code/mysql/mysql/plugin_audit.h.pp
deleted file mode 100644
index 5c6597e..0000000
--- a/code/mysql/mysql/plugin_audit.h.pp
+++ /dev/null
@@ -1,514 +0,0 @@
-#include "plugin.h"
-typedef void * MYSQL_PLUGIN;
-struct st_mysql_xid {
- long formatID;
- long gtrid_length;
- long bqual_length;
- char data[128];
-};
-typedef struct st_mysql_xid MYSQL_XID;
-enum enum_mysql_show_type
-{
- SHOW_UNDEF, SHOW_BOOL,
- SHOW_INT,
- SHOW_LONG,
- SHOW_LONGLONG,
- SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
-};
-enum enum_mysql_show_scope
-{
- SHOW_SCOPE_UNDEF,
- SHOW_SCOPE_GLOBAL
-};
-struct st_mysql_show_var
-{
- const char *name;
- char *value;
- enum enum_mysql_show_type type;
- enum enum_mysql_show_scope scope;
-};
-typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
-struct st_mysql_sys_var;
-struct st_mysql_value;
-typedef int (*mysql_var_check_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *save, struct st_mysql_value *value);
-typedef void (*mysql_var_update_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-struct st_mysql_plugin
-{
- int type;
- void *info;
- const char *name;
- const char *author;
- const char *descr;
- int license;
- int (*init)(MYSQL_PLUGIN);
- int (*deinit)(MYSQL_PLUGIN);
- unsigned int version;
- struct st_mysql_show_var *status_vars;
- struct st_mysql_sys_var **system_vars;
- void * __reserved1;
- unsigned long flags;
-};
-struct st_mysql_daemon
-{
- int interface_version;
-};
-struct st_mysql_information_schema
-{
- int interface_version;
-};
-struct st_mysql_storage_engine
-{
- int interface_version;
-};
-struct handlerton;
- struct Mysql_replication {
- int interface_version;
- };
-struct st_mysql_value
-{
- int (*value_type)(struct st_mysql_value *);
- const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
- int (*val_real)(struct st_mysql_value *, double *realbuf);
- int (*val_int)(struct st_mysql_value *, long long *intbuf);
- int (*is_unsigned)(struct st_mysql_value *);
-};
-int thd_in_lock_tables(const void* thd);
-int thd_tablespace_op(const void* thd);
-long long thd_test_options(const void* thd, long long test_options);
-int thd_sql_command(const void* thd);
-const char *set_thd_proc_info(void* thd, const char *info,
- const char *calling_func,
- const char *calling_file,
- const unsigned int calling_line);
-void **thd_ha_data(const void* thd, const struct handlerton *hton);
-void thd_storage_lock_wait(void* thd, long long value);
-int thd_tx_isolation(const void* thd);
-int thd_tx_is_read_only(const void* thd);
-void* thd_tx_arbitrate(void* requestor, void* holder);
-int thd_tx_priority(const void* thd);
-int thd_tx_is_dd_trx(const void* thd);
-char *thd_security_context(void* thd, char *buffer, size_t length,
- size_t max_query_len);
-void thd_inc_row_count(void* thd);
-int thd_allow_batch(void* thd);
-void thd_mark_transaction_to_rollback(void* thd, int all);
-int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
-void thd_set_kill_status(const void* thd);
-void thd_binlog_pos(const void* thd,
- const char **file_var,
- unsigned long long *pos_var);
-unsigned long thd_get_thread_id(const void* thd);
-void thd_get_xid(const void* thd, MYSQL_XID *xid);
-void mysql_query_cache_invalidate4(void* thd,
- const char *key, unsigned int key_length,
- int using_trx);
-void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
-void thd_set_ha_data(void* thd, const struct handlerton *hton,
- const void *ha_data);
-#include "mysql/mysql_lex_string.h"
-struct st_mysql_lex_string
-{
- char *str;
- size_t length;
-};
-typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
-struct st_mysql_const_lex_string
-{
- const char *str;
- size_t length;
-};
-typedef struct st_mysql_const_lex_string MYSQL_LEX_CSTRING;
-#include "my_command.h"
-enum enum_server_command
-{
- COM_SLEEP,
- COM_QUIT,
- COM_INIT_DB,
- COM_QUERY,
- COM_FIELD_LIST,
- COM_CREATE_DB,
- COM_DROP_DB,
- COM_REFRESH,
- COM_SHUTDOWN,
- COM_STATISTICS,
- COM_PROCESS_INFO,
- COM_CONNECT,
- COM_PROCESS_KILL,
- COM_DEBUG,
- COM_PING,
- COM_TIME,
- COM_DELAYED_INSERT,
- COM_CHANGE_USER,
- COM_BINLOG_DUMP,
- COM_TABLE_DUMP,
- COM_CONNECT_OUT,
- COM_REGISTER_SLAVE,
- COM_STMT_PREPARE,
- COM_STMT_EXECUTE,
- COM_STMT_SEND_LONG_DATA,
- COM_STMT_CLOSE,
- COM_STMT_RESET,
- COM_SET_OPTION,
- COM_STMT_FETCH,
- COM_DAEMON,
- COM_BINLOG_DUMP_GTID,
- COM_RESET_CONNECTION,
- COM_END
-};
-#include "my_sqlcommand.h"
-enum enum_sql_command {
- SQLCOM_SELECT,
- SQLCOM_CREATE_TABLE,
- SQLCOM_CREATE_INDEX,
- SQLCOM_ALTER_TABLE,
- SQLCOM_UPDATE,
- SQLCOM_INSERT,
- SQLCOM_INSERT_SELECT,
- SQLCOM_DELETE,
- SQLCOM_TRUNCATE,
- SQLCOM_DROP_TABLE,
- SQLCOM_DROP_INDEX,
- SQLCOM_SHOW_DATABASES,
- SQLCOM_SHOW_TABLES,
- SQLCOM_SHOW_FIELDS,
- SQLCOM_SHOW_KEYS,
- SQLCOM_SHOW_VARIABLES,
- SQLCOM_SHOW_STATUS,
- SQLCOM_SHOW_ENGINE_LOGS,
- SQLCOM_SHOW_ENGINE_STATUS,
- SQLCOM_SHOW_ENGINE_MUTEX,
- SQLCOM_SHOW_PROCESSLIST,
- SQLCOM_SHOW_MASTER_STAT,
- SQLCOM_SHOW_SLAVE_STAT,
- SQLCOM_SHOW_GRANTS,
- SQLCOM_SHOW_CREATE,
- SQLCOM_SHOW_CHARSETS,
- SQLCOM_SHOW_COLLATIONS,
- SQLCOM_SHOW_CREATE_DB,
- SQLCOM_SHOW_TABLE_STATUS,
- SQLCOM_SHOW_TRIGGERS,
- SQLCOM_LOAD,
- SQLCOM_SET_OPTION,
- SQLCOM_LOCK_TABLES,
- SQLCOM_UNLOCK_TABLES,
- SQLCOM_GRANT,
- SQLCOM_CHANGE_DB,
- SQLCOM_CREATE_DB,
- SQLCOM_DROP_DB,
- SQLCOM_ALTER_DB,
- SQLCOM_REPAIR,
- SQLCOM_REPLACE,
- SQLCOM_REPLACE_SELECT,
- SQLCOM_CREATE_FUNCTION,
- SQLCOM_DROP_FUNCTION,
- SQLCOM_REVOKE,
- SQLCOM_OPTIMIZE,
- SQLCOM_CHECK,
- SQLCOM_ASSIGN_TO_KEYCACHE,
- SQLCOM_PRELOAD_KEYS,
- SQLCOM_FLUSH,
- SQLCOM_KILL,
- SQLCOM_ANALYZE,
- SQLCOM_ROLLBACK,
- SQLCOM_ROLLBACK_TO_SAVEPOINT,
- SQLCOM_COMMIT,
- SQLCOM_SAVEPOINT,
- SQLCOM_RELEASE_SAVEPOINT,
- SQLCOM_SLAVE_START,
- SQLCOM_SLAVE_STOP,
- SQLCOM_START_GROUP_REPLICATION,
- SQLCOM_STOP_GROUP_REPLICATION,
- SQLCOM_BEGIN,
- SQLCOM_CHANGE_MASTER,
- SQLCOM_CHANGE_REPLICATION_FILTER,
- SQLCOM_RENAME_TABLE,
- SQLCOM_RESET,
- SQLCOM_PURGE,
- SQLCOM_PURGE_BEFORE,
- SQLCOM_SHOW_BINLOGS,
- SQLCOM_SHOW_OPEN_TABLES,
- SQLCOM_HA_OPEN,
- SQLCOM_HA_CLOSE,
- SQLCOM_HA_READ,
- SQLCOM_SHOW_SLAVE_HOSTS,
- SQLCOM_DELETE_MULTI,
- SQLCOM_UPDATE_MULTI,
- SQLCOM_SHOW_BINLOG_EVENTS,
- SQLCOM_DO,
- SQLCOM_SHOW_WARNS,
- SQLCOM_EMPTY_QUERY,
- SQLCOM_SHOW_ERRORS,
- SQLCOM_SHOW_STORAGE_ENGINES,
- SQLCOM_SHOW_PRIVILEGES,
- SQLCOM_HELP,
- SQLCOM_CREATE_USER,
- SQLCOM_DROP_USER,
- SQLCOM_RENAME_USER,
- SQLCOM_REVOKE_ALL,
- SQLCOM_CHECKSUM,
- SQLCOM_CREATE_PROCEDURE,
- SQLCOM_CREATE_SPFUNCTION,
- SQLCOM_CALL,
- SQLCOM_DROP_PROCEDURE,
- SQLCOM_ALTER_PROCEDURE,
- SQLCOM_ALTER_FUNCTION,
- SQLCOM_SHOW_CREATE_PROC,
- SQLCOM_SHOW_CREATE_FUNC,
- SQLCOM_SHOW_STATUS_PROC,
- SQLCOM_SHOW_STATUS_FUNC,
- SQLCOM_PREPARE,
- SQLCOM_EXECUTE,
- SQLCOM_DEALLOCATE_PREPARE,
- SQLCOM_CREATE_VIEW,
- SQLCOM_DROP_VIEW,
- SQLCOM_CREATE_TRIGGER,
- SQLCOM_DROP_TRIGGER,
- SQLCOM_XA_START,
- SQLCOM_XA_END,
- SQLCOM_XA_PREPARE,
- SQLCOM_XA_COMMIT,
- SQLCOM_XA_ROLLBACK,
- SQLCOM_XA_RECOVER,
- SQLCOM_SHOW_PROC_CODE,
- SQLCOM_SHOW_FUNC_CODE,
- SQLCOM_ALTER_TABLESPACE,
- SQLCOM_INSTALL_PLUGIN,
- SQLCOM_UNINSTALL_PLUGIN,
- SQLCOM_BINLOG_BASE64_EVENT,
- SQLCOM_SHOW_PLUGINS,
- SQLCOM_CREATE_SERVER,
- SQLCOM_DROP_SERVER,
- SQLCOM_ALTER_SERVER,
- SQLCOM_CREATE_EVENT,
- SQLCOM_ALTER_EVENT,
- SQLCOM_DROP_EVENT,
- SQLCOM_SHOW_CREATE_EVENT,
- SQLCOM_SHOW_EVENTS,
- SQLCOM_SHOW_CREATE_TRIGGER,
- SQLCOM_ALTER_DB_UPGRADE,
- SQLCOM_SHOW_PROFILE,
- SQLCOM_SHOW_PROFILES,
- SQLCOM_SIGNAL,
- SQLCOM_RESIGNAL,
- SQLCOM_SHOW_RELAYLOG_EVENTS,
- SQLCOM_GET_DIAGNOSTICS,
- SQLCOM_ALTER_USER,
- SQLCOM_EXPLAIN_OTHER,
- SQLCOM_SHOW_CREATE_USER,
- SQLCOM_SHUTDOWN,
- SQLCOM_ALTER_INSTANCE,
- SQLCOM_END
-};
-typedef enum
-{
- MYSQL_AUDIT_GENERAL_CLASS = 0,
- MYSQL_AUDIT_CONNECTION_CLASS = 1,
- MYSQL_AUDIT_PARSE_CLASS = 2,
- MYSQL_AUDIT_AUTHORIZATION_CLASS = 3,
- MYSQL_AUDIT_TABLE_ACCESS_CLASS = 4,
- MYSQL_AUDIT_GLOBAL_VARIABLE_CLASS = 5,
- MYSQL_AUDIT_SERVER_STARTUP_CLASS = 6,
- MYSQL_AUDIT_SERVER_SHUTDOWN_CLASS = 7,
- MYSQL_AUDIT_COMMAND_CLASS = 8,
- MYSQL_AUDIT_QUERY_CLASS = 9,
- MYSQL_AUDIT_STORED_PROGRAM_CLASS = 10,
- MYSQL_AUDIT_CLASS_MASK_SIZE
-} mysql_event_class_t;
-struct st_mysql_audit
-{
- int interface_version;
- void (*release_thd)(void*);
- int (*event_notify)(void*, mysql_event_class_t, const void *);
- unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
-};
-typedef enum enum_sql_command enum_sql_command_t;
-typedef enum
-{
- MYSQL_AUDIT_GENERAL_LOG = 1 << 0,
- MYSQL_AUDIT_GENERAL_ERROR = 1 << 1,
- MYSQL_AUDIT_GENERAL_RESULT = 1 << 2,
- MYSQL_AUDIT_GENERAL_STATUS = 1 << 3
-} mysql_event_general_subclass_t;
-struct mysql_event_general
-{
- mysql_event_general_subclass_t event_subclass;
- int general_error_code;
- unsigned long general_thread_id;
- MYSQL_LEX_CSTRING general_user;
- MYSQL_LEX_CSTRING general_command;
- MYSQL_LEX_CSTRING general_query;
- struct charset_info_st *general_charset;
- unsigned long long general_time;
- unsigned long long general_rows;
- MYSQL_LEX_CSTRING general_host;
- MYSQL_LEX_CSTRING general_sql_command;
- MYSQL_LEX_CSTRING general_external_user;
- MYSQL_LEX_CSTRING general_ip;
-};
-typedef enum
-{
- MYSQL_AUDIT_CONNECTION_CONNECT = 1 << 0,
- MYSQL_AUDIT_CONNECTION_DISCONNECT = 1 << 1,
- MYSQL_AUDIT_CONNECTION_CHANGE_USER = 1 << 2,
- MYSQL_AUDIT_CONNECTION_PRE_AUTHENTICATE = 1 << 3
-} mysql_event_connection_subclass_t;
-struct mysql_event_connection
-{
- mysql_event_connection_subclass_t event_subclass;
- int status;
- unsigned long connection_id;
- MYSQL_LEX_CSTRING user;
- MYSQL_LEX_CSTRING priv_user;
- MYSQL_LEX_CSTRING external_user;
- MYSQL_LEX_CSTRING proxy_user;
- MYSQL_LEX_CSTRING host;
- MYSQL_LEX_CSTRING ip;
- MYSQL_LEX_CSTRING database;
- int connection_type;
-};
-typedef enum
-{
- MYSQL_AUDIT_PARSE_PREPARSE = 1 << 0,
- MYSQL_AUDIT_PARSE_POSTPARSE = 1 << 1
-} mysql_event_parse_subclass_t;
-typedef enum
-{
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_NONE = 0,
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_QUERY_REWRITTEN = 1 << 0,
- MYSQL_AUDIT_PARSE_REWRITE_PLUGIN_IS_PREPARED_STATEMENT = 1 << 1
-} mysql_event_parse_rewrite_plugin_flag;
-struct mysql_event_parse
-{
- mysql_event_parse_subclass_t event_subclass;
- mysql_event_parse_rewrite_plugin_flag *flags;
- MYSQL_LEX_CSTRING query;
- MYSQL_LEX_CSTRING *rewritten_query;
-};
-typedef enum
-{
- MYSQL_AUDIT_AUTHORIZATION_USER = 1 << 0,
- MYSQL_AUDIT_AUTHORIZATION_DB = 1 << 1,
- MYSQL_AUDIT_AUTHORIZATION_TABLE = 1 << 2,
- MYSQL_AUDIT_AUTHORIZATION_COLUMN = 1 << 3,
- MYSQL_AUDIT_AUTHORIZATION_PROCEDURE = 1 << 4,
- MYSQL_AUDIT_AUTHORIZATION_PROXY = 1 << 5
-} mysql_event_authorization_subclass_t;
-struct mysql_event_authorization
-{
- mysql_event_authorization_subclass_t event_subclass;
- int status;
- unsigned int connection_id;
- enum_sql_command_t sql_command_id;
- MYSQL_LEX_CSTRING query;
- const struct charset_info_st *query_charset;
- MYSQL_LEX_CSTRING database;
- MYSQL_LEX_CSTRING table;
- MYSQL_LEX_CSTRING object;
- unsigned long requested_privilege;
- unsigned long granted_privilege;
-};
-typedef enum
-{
- MYSQL_AUDIT_TABLE_ACCESS_READ = 1 << 0,
- MYSQL_AUDIT_TABLE_ACCESS_INSERT = 1 << 1,
- MYSQL_AUDIT_TABLE_ACCESS_UPDATE = 1 << 2,
- MYSQL_AUDIT_TABLE_ACCESS_DELETE = 1 << 3
-} mysql_event_table_access_subclass_t;
-struct mysql_event_table_access
-{
- mysql_event_table_access_subclass_t event_subclass;
- unsigned long connection_id;
- enum_sql_command_t sql_command_id;
- MYSQL_LEX_CSTRING query;
- const struct charset_info_st *query_charset;
- MYSQL_LEX_CSTRING table_database;
- MYSQL_LEX_CSTRING table_name;
-};
-typedef enum
-{
- MYSQL_AUDIT_GLOBAL_VARIABLE_GET = 1 << 0,
- MYSQL_AUDIT_GLOBAL_VARIABLE_SET = 1 << 1
-} mysql_event_global_variable_subclass_t;
-struct mysql_event_global_variable
-{
- mysql_event_global_variable_subclass_t event_subclass;
- unsigned long connection_id;
- enum_sql_command_t sql_command_id;
- MYSQL_LEX_CSTRING variable_name;
- MYSQL_LEX_CSTRING variable_value;
-};
-typedef enum
-{
- MYSQL_AUDIT_SERVER_STARTUP_STARTUP = 1 << 0
-} mysql_event_server_startup_subclass_t;
-struct mysql_event_server_startup
-{
- mysql_event_server_startup_subclass_t event_subclass;
- const char **argv;
- unsigned int argc;
-};
-typedef enum
-{
- MYSQL_AUDIT_SERVER_SHUTDOWN_SHUTDOWN = 1 << 0
-} mysql_event_server_shutdown_subclass_t;
-typedef enum
-{
- MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_SHUTDOWN,
- MYSQL_AUDIT_SERVER_SHUTDOWN_REASON_ABORT
-} mysql_server_shutdown_reason_t;
-struct mysql_event_server_shutdown
-{
- mysql_event_server_shutdown_subclass_t event_subclass;
- int exit_code;
- mysql_server_shutdown_reason_t reason;
-};
-typedef enum
-{
- MYSQL_AUDIT_COMMAND_START = 1 << 0,
- MYSQL_AUDIT_COMMAND_END = 1 << 1
-} mysql_event_command_subclass_t;
-typedef enum enum_server_command enum_server_command_t;
-struct mysql_event_command
-{
- mysql_event_command_subclass_t event_subclass;
- int status;
- unsigned long connection_id;
- enum_server_command_t command_id;
-};
-typedef enum
-{
- MYSQL_AUDIT_QUERY_START = 1 << 0,
- MYSQL_AUDIT_QUERY_NESTED_START = 1 << 1,
- MYSQL_AUDIT_QUERY_STATUS_END = 1 << 2,
- MYSQL_AUDIT_QUERY_NESTED_STATUS_END = 1 << 3
-} mysql_event_query_subclass_t;
-struct mysql_event_query
-{
- mysql_event_query_subclass_t event_subclass;
- int status;
- unsigned long connection_id;
- enum_sql_command_t sql_command_id;
- MYSQL_LEX_CSTRING query;
- const struct charset_info_st *query_charset;
-};
-typedef enum
-{
- MYSQL_AUDIT_STORED_PROGRAM_EXECUTE = 1 << 0
-} mysql_event_stored_program_subclass_t;
-struct mysql_event_stored_program
-{
- mysql_event_stored_program_subclass_t event_subclass;
- unsigned long connection_id;
- enum_sql_command_t sql_command_id;
- MYSQL_LEX_CSTRING query;
- const struct charset_info_st *query_charset;
- MYSQL_LEX_CSTRING database;
- MYSQL_LEX_CSTRING name;
- void *parameters;
-};
diff --git a/code/mysql/mysql/plugin_auth.h b/code/mysql/mysql/plugin_auth.h
deleted file mode 100644
index 0e2ac99..0000000
--- a/code/mysql/mysql/plugin_auth.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
-/* Copyright (c) 2010, 2016 Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
-
- Authentication Plugin API.
-
- This file defines the API for server authentication plugins.
-*/
-
-#define MYSQL_PLUGIN_AUTH_INCLUDED
-
-#include
-
-#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0101
-
-#include "plugin_auth_common.h"
-
-/* defines for MYSQL_SERVER_AUTH_INFO.password_used */
-
-#define PASSWORD_USED_NO 0
-#define PASSWORD_USED_YES 1
-#define PASSWORD_USED_NO_MENTION 2
-
-/* Authentication flags */
-
-#define AUTH_FLAG_PRIVILEGED_USER_FOR_PASSWORD_CHANGE (1L << 0)
-#define AUTH_FLAG_USES_INTERNAL_STORAGE (1L << 1)
-
-/**
- Provides server plugin access to authentication information
-*/
-typedef struct st_mysql_server_auth_info
-{
- /**
- User name as sent by the client and shown in USER().
- NULL if the client packet with the user name was not received yet.
- */
- char *user_name;
-
- /**
- Length of user_name
- */
- unsigned int user_name_length;
-
- /**
- A corresponding column value from the mysql.user table for the
- matching account name
- */
- const char *auth_string;
-
- /**
- Length of auth_string
- */
- unsigned long auth_string_length;
-
- /**
- Matching account name as found in the mysql.user table.
- A plugin can override it with another name that will be
- used by MySQL for authorization, and shown in CURRENT_USER()
- */
- char authenticated_as[MYSQL_USERNAME_LENGTH+1];
-
-
- /**
- The unique user name that was used by the plugin to authenticate.
- Plugins should put null-terminated UTF-8 here.
- Available through the @@EXTERNAL_USER variable.
- */
- char external_user[512];
-
- /**
- This only affects the "Authentication failed. Password used: %s"
- error message. has the following values :
- 0 : %s will be NO.
- 1 : %s will be YES.
- 2 : there will be no %s.
- Set it as appropriate or ignore at will.
- */
- int password_used;
-
- /**
- Set to the name of the connected client host, if it can be resolved,
- or to its IP address otherwise.
- */
- const char *host_or_ip;
-
- /**
- Length of host_or_ip
- */
- unsigned int host_or_ip_length;
-
-} MYSQL_SERVER_AUTH_INFO;
-
-/**
- Server authentication plugin descriptor
-*/
-struct st_mysql_auth
-{
- int interface_version; /** version plugin uses */
- /**
- A plugin that a client must use for authentication with this server
- plugin. Can be NULL to mean "any plugin".
- */
- const char *client_auth_plugin;
- /**
- Function provided by the plugin which should perform authentication (using
- the vio functions if necessary) and return 0 if successful. The plugin can
- also fill the info.authenticated_as field if a different username should be
- used for authorization.
- */
- int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
- /**
- New plugin API to generate password digest out of authentication string.
- This function will first invoke a service to check for validity of the
- password based on the policies defined and then generate encrypted hash
-
- @param[OUT] outbuf A buffer provided by server which will hold the
- authentication string generated by plugin.
- @param[INOUT] outbuflen Length of server provided buffer as IN param and
- length of plugin generated string as OUT param.
- @param[IN] inbuf auth string provided by user.
- @param[IN] inbuflen auth string length.
-
- @retval 0 OK
- 1 ERROR
-
- */
- int (*generate_authentication_string)(char *outbuf,
- unsigned int *outbuflen, const char *inbuf, unsigned int inbuflen);
- /**
- Plugin API to validate password digest.
-
- @param[IN] inbuf hash string to be validated.
- @param[IN] buflen hash string length.
-
- @retval 0 OK
- 1 ERROR
-
- */
- int (*validate_authentication_string)(char* const inbuf, unsigned int buflen);
- /**
- Plugin API to convert scrambled password to binary form
- based on scramble type.
-
- @param[IN] password The password hash containing the salt.
- @param[IN] password_len The length of the password hash.
- @param[INOUT] salt Used as password hash based on the
- authentication plugin.
- @param[INOUT] salt_len The length of salt.
-
- @retval 0 OK
- 1 ERROR
-
- */
- int (*set_salt)(const char *password, unsigned int password_len,
- unsigned char* salt, unsigned char *salt_len);
- /**
- Authentication plugin capabilities
- */
- const unsigned long authentication_flags;
-};
-#endif
-
diff --git a/code/mysql/mysql/plugin_auth.h.pp b/code/mysql/mysql/plugin_auth.h.pp
deleted file mode 100644
index c2ad973..0000000
--- a/code/mysql/mysql/plugin_auth.h.pp
+++ /dev/null
@@ -1,153 +0,0 @@
-#include
-typedef void * MYSQL_PLUGIN;
-struct st_mysql_xid {
- long formatID;
- long gtrid_length;
- long bqual_length;
- char data[128];
-};
-typedef struct st_mysql_xid MYSQL_XID;
-enum enum_mysql_show_type
-{
- SHOW_UNDEF, SHOW_BOOL,
- SHOW_INT,
- SHOW_LONG,
- SHOW_LONGLONG,
- SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
-};
-enum enum_mysql_show_scope
-{
- SHOW_SCOPE_UNDEF,
- SHOW_SCOPE_GLOBAL
-};
-struct st_mysql_show_var
-{
- const char *name;
- char *value;
- enum enum_mysql_show_type type;
- enum enum_mysql_show_scope scope;
-};
-typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
-struct st_mysql_sys_var;
-struct st_mysql_value;
-typedef int (*mysql_var_check_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *save, struct st_mysql_value *value);
-typedef void (*mysql_var_update_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-struct st_mysql_plugin
-{
- int type;
- void *info;
- const char *name;
- const char *author;
- const char *descr;
- int license;
- int (*init)(MYSQL_PLUGIN);
- int (*deinit)(MYSQL_PLUGIN);
- unsigned int version;
- struct st_mysql_show_var *status_vars;
- struct st_mysql_sys_var **system_vars;
- void * __reserved1;
- unsigned long flags;
-};
-struct st_mysql_daemon
-{
- int interface_version;
-};
-struct st_mysql_information_schema
-{
- int interface_version;
-};
-struct st_mysql_storage_engine
-{
- int interface_version;
-};
-struct handlerton;
- struct Mysql_replication {
- int interface_version;
- };
-struct st_mysql_value
-{
- int (*value_type)(struct st_mysql_value *);
- const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
- int (*val_real)(struct st_mysql_value *, double *realbuf);
- int (*val_int)(struct st_mysql_value *, long long *intbuf);
- int (*is_unsigned)(struct st_mysql_value *);
-};
-int thd_in_lock_tables(const void* thd);
-int thd_tablespace_op(const void* thd);
-long long thd_test_options(const void* thd, long long test_options);
-int thd_sql_command(const void* thd);
-const char *set_thd_proc_info(void* thd, const char *info,
- const char *calling_func,
- const char *calling_file,
- const unsigned int calling_line);
-void **thd_ha_data(const void* thd, const struct handlerton *hton);
-void thd_storage_lock_wait(void* thd, long long value);
-int thd_tx_isolation(const void* thd);
-int thd_tx_is_read_only(const void* thd);
-void* thd_tx_arbitrate(void* requestor, void* holder);
-int thd_tx_priority(const void* thd);
-int thd_tx_is_dd_trx(const void* thd);
-char *thd_security_context(void* thd, char *buffer, size_t length,
- size_t max_query_len);
-void thd_inc_row_count(void* thd);
-int thd_allow_batch(void* thd);
-void thd_mark_transaction_to_rollback(void* thd, int all);
-int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
-void thd_set_kill_status(const void* thd);
-void thd_binlog_pos(const void* thd,
- const char **file_var,
- unsigned long long *pos_var);
-unsigned long thd_get_thread_id(const void* thd);
-void thd_get_xid(const void* thd, MYSQL_XID *xid);
-void mysql_query_cache_invalidate4(void* thd,
- const char *key, unsigned int key_length,
- int using_trx);
-void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
-void thd_set_ha_data(void* thd, const struct handlerton *hton,
- const void *ha_data);
-#include "plugin_auth_common.h"
-typedef struct st_plugin_vio_info
-{
- enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
- MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
- int socket;
-} MYSQL_PLUGIN_VIO_INFO;
-typedef struct st_plugin_vio
-{
- int (*read_packet)(struct st_plugin_vio *vio,
- unsigned char **buf);
- int (*write_packet)(struct st_plugin_vio *vio,
- const unsigned char *packet,
- int packet_len);
- void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
-} MYSQL_PLUGIN_VIO;
-typedef struct st_mysql_server_auth_info
-{
- char *user_name;
- unsigned int user_name_length;
- const char *auth_string;
- unsigned long auth_string_length;
- char authenticated_as[96 +1];
- char external_user[512];
- int password_used;
- const char *host_or_ip;
- unsigned int host_or_ip_length;
-} MYSQL_SERVER_AUTH_INFO;
-struct st_mysql_auth
-{
- int interface_version;
- const char *client_auth_plugin;
- int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
- int (*generate_authentication_string)(char *outbuf,
- unsigned int *outbuflen, const char *inbuf, unsigned int inbuflen);
- int (*validate_authentication_string)(char* const inbuf, unsigned int buflen);
- int (*set_salt)(const char *password, unsigned int password_len,
- unsigned char* salt, unsigned char *salt_len);
- const unsigned long authentication_flags;
-};
diff --git a/code/mysql/mysql/plugin_auth_common.h b/code/mysql/mysql/plugin_auth_common.h
deleted file mode 100644
index 6300a81..0000000
--- a/code/mysql/mysql/plugin_auth_common.h
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
-
- This file defines constants and data structures that are the same for
- both client- and server-side authentication plugins.
-*/
-#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
-
-/** the max allowed length for a user name */
-#define MYSQL_USERNAME_LENGTH 96
-
-/**
- return values of the plugin authenticate_user() method.
-*/
-
-/**
- Authentication failed, plugin internal error.
- An error occurred in the authentication plugin itself.
- These errors are reported in table performance_schema.host_cache,
- column COUNT_AUTH_PLUGIN_ERRORS.
-*/
-#define CR_AUTH_PLUGIN_ERROR 3
-/**
- Authentication failed, client server handshake.
- An error occurred during the client server handshake.
- These errors are reported in table performance_schema.host_cache,
- column COUNT_HANDSHAKE_ERRORS.
-*/
-#define CR_AUTH_HANDSHAKE 2
-/**
- Authentication failed, user credentials.
- For example, wrong passwords.
- These errors are reported in table performance_schema.host_cache,
- column COUNT_AUTHENTICATION_ERRORS.
-*/
-#define CR_AUTH_USER_CREDENTIALS 1
-/**
- Authentication failed. Additionally, all other CR_xxx values
- (libmysql error code) can be used too.
-
- The client plugin may set the error code and the error message directly
- in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error
- code was returned, an error message in the MYSQL structure will be
- overwritten. If CR_ERROR is returned without setting the error in MYSQL,
- CR_UNKNOWN_ERROR will be user.
-*/
-#define CR_ERROR 0
-/**
- Authentication (client part) was successful. It does not mean that the
- authentication as a whole was successful, usually it only means
- that the client was able to send the user name and the password to the
- server. If CR_OK is returned, the libmysql reads the next packet expecting
- it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
-*/
-#define CR_OK -1
-/**
- Authentication was successful.
- It means that the client has done its part successfully and also that
- a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN).
- In this case, libmysql will not read a packet from the server,
- but it will use the data at mysql->net.read_pos.
-
- A plugin may return this value if the number of roundtrips in the
- authentication protocol is not known in advance, and the client plugin
- needs to read one packet more to determine if the authentication is finished
- or not.
-*/
-#define CR_OK_HANDSHAKE_COMPLETE -2
-
-/**
-Flag to be passed back to server from authentication plugins via
-authenticated_as when proxy mapping should be done by the server.
-*/
-#define PROXY_FLAG 0
-
-/*
- We need HANDLE definition if on Windows. Define WIN32_LEAN_AND_MEAN (if
- not already done) to minimize amount of imported declarations.
-*/
-#ifdef _WIN32
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include
-#endif
-
-typedef struct st_plugin_vio_info
-{
- enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
- MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
- int socket; /**< it's set, if the protocol is SOCKET or TCP */
-#ifdef _WIN32
- HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */
-#endif
-} MYSQL_PLUGIN_VIO_INFO;
-
-/**
- Provides plugin access to communication channel
-*/
-typedef struct st_plugin_vio
-{
- /**
- Plugin provides a pointer reference and this function sets it to the
- contents of any incoming packet. Returns the packet length, or -1 if
- the plugin should terminate.
- */
- int (*read_packet)(struct st_plugin_vio *vio,
- unsigned char **buf);
-
- /**
- Plugin provides a buffer with data and the length and this
- function sends it as a packet. Returns 0 on success, 1 on failure.
- */
- int (*write_packet)(struct st_plugin_vio *vio,
- const unsigned char *packet,
- int packet_len);
-
- /**
- Fills in a st_plugin_vio_info structure, providing the information
- about the connection.
- */
- void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
-
-} MYSQL_PLUGIN_VIO;
-
-#endif
-
diff --git a/code/mysql/mysql/plugin_ftparser.h b/code/mysql/mysql/plugin_ftparser.h
deleted file mode 100644
index e96834f..0000000
--- a/code/mysql/mysql/plugin_ftparser.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef _my_plugin_ftparser_h
-#define _my_plugin_ftparser_h
-
-#include "plugin.h"
-
-/*************************************************************************
- API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
-*/
-
-
-/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */
-enum enum_ftparser_mode
-{
-/*
- Fast and simple mode. This mode is used for indexing, and natural
- language queries.
-
- The parser is expected to return only those words that go into the
- index. Stopwords or too short/long words should not be returned. The
- 'boolean_info' argument of mysql_add_word() does not have to be set.
-*/
- MYSQL_FTPARSER_SIMPLE_MODE= 0,
-
-/*
- Parse with stopwords mode. This mode is used in boolean searches for
- "phrase matching."
-
- The parser is not allowed to ignore words in this mode. Every word
- should be returned, including stopwords and words that are too short
- or long. The 'boolean_info' argument of mysql_add_word() does not
- have to be set.
-*/
- MYSQL_FTPARSER_WITH_STOPWORDS= 1,
-
-/*
- Parse in boolean mode. This mode is used to parse a boolean query string.
-
- The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO
- structure in the 'boolean_info' argument to mysql_add_word().
- Usually that means that the parser should recognize boolean operators
- in the parsing stream and set appropriate fields in
- MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for
- MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored.
- Instead, use FT_TOKEN_STOPWORD for the token type of such a word.
-*/
- MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
-};
-
-/*
- Token types for boolean mode searching (used for the type member of
- MYSQL_FTPARSER_BOOLEAN_INFO struct)
-
- FT_TOKEN_EOF: End of data.
- FT_TOKEN_WORD: Regular word.
- FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression).
- FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression).
- FT_TOKEN_STOPWORD: Stopword.
-*/
-
-enum enum_ft_token_type
-{
- FT_TOKEN_EOF= 0,
- FT_TOKEN_WORD= 1,
- FT_TOKEN_LEFT_PAREN= 2,
- FT_TOKEN_RIGHT_PAREN= 3,
- FT_TOKEN_STOPWORD= 4
-};
-
-/*
- This structure is used in boolean search mode only. It conveys
- boolean-mode metadata to the MySQL search engine for every word in
- the search query. A valid instance of this structure must be filled
- in by the plugin parser and passed as an argument in the call to
- mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM
- structure) when a query is parsed in boolean mode.
-
- type: The token type. Should be one of the enum_ft_token_type values.
-
- yesno: Whether the word must be present for a match to occur:
- >0 Must be present
- <0 Must not be present
- 0 Neither; the word is optional but its presence increases the relevance
- With the default settings of the ft_boolean_syntax system variable,
- >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator,
- and 0 means neither operator was used.
-
- weight_adjust: A weighting factor that determines how much a match
- for the word counts. Positive values increase, negative - decrease the
- relative word's importance in the query.
-
- wasign: The sign of the word's weight in the query. If it's non-negative
- the match for the word will increase document relevance, if it's
- negative - decrease (the word becomes a "noise word", the less of it the
- better).
-
- trunc: Corresponds to the '*' operator in the default setting of the
- ft_boolean_syntax system variable.
-
- position: Start position in bytes of the word in the document, used by InnoDB FTS.
-*/
-
-typedef struct st_mysql_ftparser_boolean_info
-{
- enum enum_ft_token_type type;
- int yesno;
- int weight_adjust;
- char wasign;
- char trunc;
- int position;
- /* These are parser state and must be removed. */
- char prev;
- char *quot;
-} MYSQL_FTPARSER_BOOLEAN_INFO;
-
-/*
- The following flag means that buffer with a string (document, word)
- may be overwritten by the caller before the end of the parsing (that is
- before st_mysql_ftparser::deinit() call). If one needs the string
- to survive between two successive calls of the parsing function, she
- needs to save a copy of it. The flag may be set by MySQL before calling
- st_mysql_ftparser::parse(), or it may be set by a plugin before calling
- st_mysql_ftparser_param::mysql_parse() or
- st_mysql_ftparser_param::mysql_add_word().
-*/
-#define MYSQL_FTFLAGS_NEED_COPY 1
-
-/*
- An argument of the full-text parser plugin. This structure is
- filled in by MySQL server and passed to the parsing function of the
- plugin as an in/out parameter.
-
- mysql_parse: A pointer to the built-in parser implementation of the
- server. It's set by the server and can be used by the parser plugin
- to invoke the MySQL default parser. If plugin's role is to extract
- textual data from .doc, .pdf or .xml content, it might extract
- plaintext from the content, and then pass the text to the default
- MySQL parser to be parsed.
-
- mysql_add_word: A server callback to add a new word. When parsing
- a document, the server sets this to point at a function that adds
- the word to MySQL full-text index. When parsing a search query,
- this function will add the new word to the list of words to search
- for. The boolean_info argument can be NULL for all cases except
- when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO.
-
- ftparser_state: A generic pointer. The plugin can set it to point
- to information to be used internally for its own purposes.
-
- mysql_ftparam: This is set by the server. It is used by MySQL functions
- called via mysql_parse() and mysql_add_word() callback. The plugin
- should not modify it.
-
- cs: Information about the character set of the document or query string.
-
- doc: A pointer to the document or query string to be parsed.
-
- length: Length of the document or query string, in bytes.
-
- flags: See MYSQL_FTFLAGS_* constants above.
-
- mode: The parsing mode. With boolean operators, with stopwords, or
- nothing. See enum_ftparser_mode above.
-*/
-
-typedef struct st_mysql_ftparser_param
-{
- int (*mysql_parse)(struct st_mysql_ftparser_param *,
- char *doc, int doc_len);
- int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
- void *ftparser_state;
- void *mysql_ftparam;
- const struct charset_info_st *cs;
- char *doc;
- int length;
- int flags;
- enum enum_ftparser_mode mode;
-} MYSQL_FTPARSER_PARAM;
-
-/*
- Full-text parser descriptor.
-
- interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION.
- The parsing, initialization, and deinitialization functions are
- invoked per SQL statement for which the parser is used.
-*/
-
-struct st_mysql_ftparser
-{
- int interface_version;
- int (*parse)(MYSQL_FTPARSER_PARAM *param);
- int (*init)(MYSQL_FTPARSER_PARAM *param);
- int (*deinit)(MYSQL_FTPARSER_PARAM *param);
-};
-
-
-#endif
-
diff --git a/code/mysql/mysql/plugin_ftparser.h.pp b/code/mysql/mysql/plugin_ftparser.h.pp
deleted file mode 100644
index 2e5db9e..0000000
--- a/code/mysql/mysql/plugin_ftparser.h.pp
+++ /dev/null
@@ -1,160 +0,0 @@
-#include "plugin.h"
-typedef void * MYSQL_PLUGIN;
-struct st_mysql_xid {
- long formatID;
- long gtrid_length;
- long bqual_length;
- char data[128];
-};
-typedef struct st_mysql_xid MYSQL_XID;
-enum enum_mysql_show_type
-{
- SHOW_UNDEF, SHOW_BOOL,
- SHOW_INT,
- SHOW_LONG,
- SHOW_LONGLONG,
- SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
-};
-enum enum_mysql_show_scope
-{
- SHOW_SCOPE_UNDEF,
- SHOW_SCOPE_GLOBAL
-};
-struct st_mysql_show_var
-{
- const char *name;
- char *value;
- enum enum_mysql_show_type type;
- enum enum_mysql_show_scope scope;
-};
-typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
-struct st_mysql_sys_var;
-struct st_mysql_value;
-typedef int (*mysql_var_check_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *save, struct st_mysql_value *value);
-typedef void (*mysql_var_update_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-struct st_mysql_plugin
-{
- int type;
- void *info;
- const char *name;
- const char *author;
- const char *descr;
- int license;
- int (*init)(MYSQL_PLUGIN);
- int (*deinit)(MYSQL_PLUGIN);
- unsigned int version;
- struct st_mysql_show_var *status_vars;
- struct st_mysql_sys_var **system_vars;
- void * __reserved1;
- unsigned long flags;
-};
-struct st_mysql_daemon
-{
- int interface_version;
-};
-struct st_mysql_information_schema
-{
- int interface_version;
-};
-struct st_mysql_storage_engine
-{
- int interface_version;
-};
-struct handlerton;
- struct Mysql_replication {
- int interface_version;
- };
-struct st_mysql_value
-{
- int (*value_type)(struct st_mysql_value *);
- const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
- int (*val_real)(struct st_mysql_value *, double *realbuf);
- int (*val_int)(struct st_mysql_value *, long long *intbuf);
- int (*is_unsigned)(struct st_mysql_value *);
-};
-int thd_in_lock_tables(const void* thd);
-int thd_tablespace_op(const void* thd);
-long long thd_test_options(const void* thd, long long test_options);
-int thd_sql_command(const void* thd);
-const char *set_thd_proc_info(void* thd, const char *info,
- const char *calling_func,
- const char *calling_file,
- const unsigned int calling_line);
-void **thd_ha_data(const void* thd, const struct handlerton *hton);
-void thd_storage_lock_wait(void* thd, long long value);
-int thd_tx_isolation(const void* thd);
-int thd_tx_is_read_only(const void* thd);
-void* thd_tx_arbitrate(void* requestor, void* holder);
-int thd_tx_priority(const void* thd);
-int thd_tx_is_dd_trx(const void* thd);
-char *thd_security_context(void* thd, char *buffer, size_t length,
- size_t max_query_len);
-void thd_inc_row_count(void* thd);
-int thd_allow_batch(void* thd);
-void thd_mark_transaction_to_rollback(void* thd, int all);
-int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
-void thd_set_kill_status(const void* thd);
-void thd_binlog_pos(const void* thd,
- const char **file_var,
- unsigned long long *pos_var);
-unsigned long thd_get_thread_id(const void* thd);
-void thd_get_xid(const void* thd, MYSQL_XID *xid);
-void mysql_query_cache_invalidate4(void* thd,
- const char *key, unsigned int key_length,
- int using_trx);
-void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
-void thd_set_ha_data(void* thd, const struct handlerton *hton,
- const void *ha_data);
-enum enum_ftparser_mode
-{
- MYSQL_FTPARSER_SIMPLE_MODE= 0,
- MYSQL_FTPARSER_WITH_STOPWORDS= 1,
- MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
-};
-enum enum_ft_token_type
-{
- FT_TOKEN_EOF= 0,
- FT_TOKEN_WORD= 1,
- FT_TOKEN_LEFT_PAREN= 2,
- FT_TOKEN_RIGHT_PAREN= 3,
- FT_TOKEN_STOPWORD= 4
-};
-typedef struct st_mysql_ftparser_boolean_info
-{
- enum enum_ft_token_type type;
- int yesno;
- int weight_adjust;
- char wasign;
- char trunc;
- int position;
- char prev;
- char *quot;
-} MYSQL_FTPARSER_BOOLEAN_INFO;
-typedef struct st_mysql_ftparser_param
-{
- int (*mysql_parse)(struct st_mysql_ftparser_param *,
- char *doc, int doc_len);
- int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
- void *ftparser_state;
- void *mysql_ftparam;
- const struct charset_info_st *cs;
- char *doc;
- int length;
- int flags;
- enum enum_ftparser_mode mode;
-} MYSQL_FTPARSER_PARAM;
-struct st_mysql_ftparser
-{
- int interface_version;
- int (*parse)(MYSQL_FTPARSER_PARAM *param);
- int (*init)(MYSQL_FTPARSER_PARAM *param);
- int (*deinit)(MYSQL_FTPARSER_PARAM *param);
-};
diff --git a/code/mysql/mysql/plugin_group_replication.h b/code/mysql/mysql/plugin_group_replication.h
deleted file mode 100644
index 0f427be..0000000
--- a/code/mysql/mysql/plugin_group_replication.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED
-#define MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED
-
-/* API for Group Peplication plugin. (MYSQL_GROUP_REPLICATION_PLUGIN) */
-
-#include
-#define MYSQL_GROUP_REPLICATION_INTERFACE_VERSION 0x0101
-
-/*
- Callbacks for get_connection_status_info function.
-
- context field can have NULL value, plugin will always pass it
- through all callbacks, independent of its value.
- Its value will not be used by plugin.
-
- All callbacks are mandatory.
-*/
-typedef struct st_group_replication_connection_status_callbacks
-{
- void* const context;
- void (*set_channel_name)(void* const context, const char& value, size_t length);
- void (*set_group_name)(void* const context, const char& value, size_t length);
- void (*set_source_uuid)(void* const context, const char& value, size_t length);
- void (*set_service_state)(void* const context, bool state);
-} GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS;
-
-/*
- Callbacks for get_group_members_info function.
-
- context field can have NULL value, plugin will always pass it
- through all callbacks, independent of its value.
- Its value will not be used by plugin.
-
- All callbacks are mandatory.
-*/
-typedef struct st_group_replication_group_members_callbacks
-{
- void* const context;
- void (*set_channel_name)(void* const context, const char& value, size_t length);
- void (*set_member_id)(void* const context, const char& value, size_t length);
- void (*set_member_host)(void* const context, const char& value, size_t length);
- void (*set_member_port)(void* const context, unsigned int value);
- void (*set_member_state)(void* const context, const char& value, size_t length);
-} GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS;
-
-/*
- Callbacks for get_group_member_stats_info function.
-
- context field can have NULL value, plugin will always pass it
- through all callbacks, independent of its value.
- Its value will not be used by plugin.
-
- All callbacks are mandatory.
-*/
-typedef struct st_group_replication_member_stats_callbacks
-{
- void* const context;
- void (*set_channel_name)(void* const context, const char& value, size_t length);
- void (*set_view_id)(void* const context, const char& value, size_t length);
- void (*set_member_id)(void* const context, const char& value, size_t length);
- void (*set_transactions_committed)(void* const context, const char& value, size_t length);
- void (*set_last_conflict_free_transaction)(void* const context, const char& value, size_t length);
- void (*set_transactions_in_queue)(void* const context, unsigned long long int value);
- void (*set_transactions_certified)(void* const context, unsigned long long int value);
- void (*set_transactions_conflicts_detected)(void* const context, unsigned long long int value);
- void (*set_transactions_rows_in_validation)(void* const context, unsigned long long int value);
-} GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS;
-
-struct st_mysql_group_replication
-{
- int interface_version;
-
- /*
- This function is used to start the group replication.
- */
- int (*start)();
- /*
- This function is used to stop the group replication.
- */
- int (*stop)();
- /*
- This function is used to get the current group replication running status.
- */
- bool (*is_running)();
- /*
- This function initializes conflict checking module with info received
- from group on this member.
-
- @param info View_change_log_event with conflict checking info.
- */
- int (*set_retrieved_certification_info)(void* info);
-
- /*
- This function is used to fetch information for group replication kernel stats.
-
- @param callbacks The set of callbacks and its context used to set the
- information on caller.
-
- @note The caller is responsible to free memory from the info structure and
- from all its fields.
- */
- bool (*get_connection_status_info)
- (const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS& callbacks);
-
- /*
- This function is used to fetch information for group replication members.
-
- @param callbacks The set of callbacks and its context used to set the
- information on caller.
-
- @note The caller is responsible to free memory from the info structure and
- from all its fields.
- */
- bool (*get_group_members_info)
- (unsigned int index,
- const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS& callbacks);
-
- /*
- This function is used to fetch information for group replication members statistics.
-
- @param callbacks The set of callbacks and its context used to set the
- information on caller.
-
- @note The caller is responsible to free memory from the info structure and
- from all its fields.
- */
- bool (*get_group_member_stats_info)
- (const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS& callbacks);
-
- /*
- Get number of group replication members.
- */
- unsigned int (*get_members_number_info)();
-};
-
-#endif
-
diff --git a/code/mysql/mysql/plugin_keyring.h b/code/mysql/mysql/plugin_keyring.h
deleted file mode 100644
index df04084..0000000
--- a/code/mysql/mysql/plugin_keyring.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_PLUGIN_KEYRING_INCLUDED
-#define MYSQL_PLUGIN_KEYRING_INCLUDED
-
-/**
- API for keyring plugin. (MYSQL_KEYRING_PLUGIN)
-*/
-
-#include "plugin.h"
-#define MYSQL_KEYRING_INTERFACE_VERSION 0x0101
-
-/**
- The descriptor structure for the plugin, that is referred from
- st_mysql_plugin.
-*/
-
-struct st_mysql_keyring
-{
- int interface_version;
- /*!
- Add key to the keyring.
-
- Obfuscates and adds the key to the keyring. The key is associated with
- key_id and user_id (unique key identifier).
-
- @param[in] key_id id of the key to store
- @param[in] key_type type of the key to store
- @param[in] user_id id of the owner of the key
- @param[in] key the key itself to be stored. The memory of the key is
- copied by the keyring, thus the key itself can be freed
- after it was stored in the keyring.
- @param[in] key_len the length of the key to be stored
-
- @return Operation status
- @retval 0 OK
- @retval 1 ERROR
- */
- my_bool (*mysql_key_store)(const char *key_id, const char *key_type,
- const char* user_id, const void *key, size_t key_len);
- /*!
- Fetches key from the keyring.
-
- De-obfuscates and retrieves key associated with key_id and user_id from the
- keyring.
-
- @param[in] key_id id of the key to fetch
- @param[out] key_type type of the fetched key
- @param[in] user_id id of the owner of the key
- @param[out] key the fetched key itself. The memory for this key is
- allocated by the keyring and needs to be freed by the
- user when no longer needed. Prior to freeing the memory
- it needs to be obfuscated or zeroed.
- @param[out] key_len the length of the fetched key
-
- @return Operation status
- @retval 0 OK
- @retval 1 ERROR
- */
- my_bool (*mysql_key_fetch)(const char *key_id, char **key_type,
- const char *user_id, void **key, size_t *key_len);
-
- /*!
- Removes key from the keyring.
-
- Removes the key associated with key_id and user_id from the
- keyring.
-
- @param[in] key_id id of the key to remove
- @param[in] user_id id of the owner of the key to remove
-
- @return Operation status
- @retval 0 OK
- @retval 1 ERROR
- */
- my_bool (*mysql_key_remove)(const char *key_id, const char *user_id);
-
- /*!
- Generates and stores the key.
-
- Generates a random key of length key_len, associates it with key_id, user_id
- and stores it in the keyring.
-
- @param[in] key_id id of the key to generate
- @param[in] key_type type of the key to generate
- @param[in] user_id id of the owner of the generated key
- @param[in] key_len length of the key to generate
-
- @return Operation status
- @retval 0 OK
- @retval 1 ERROR
- */
- my_bool (*mysql_key_generate)(const char *key_id, const char *key_type,
- const char *user_id, size_t key_len);
-
- /**
- Keys_iterator object refers to an iterator which is used to iterate
- on a list which refers to Key_metadata. Key_metadata hold information
- about individual keys keyd_id and user_id. Keys_iterator should be used
- in following sequence only.
-
- void* iterator_ptr;
- char key_id[64]= { 0 };
- char user_id[64]= { 0 };
-
- plugin_handle->mysql_key_iterator_init(&iterator_ptr);
-
- if (iterator_ptr == NULL)
- report error;
-
- while (!(plugin_handle->mysql_key_iterator_get_key(iterator_ptr,
- key_id, user_id)))
- {
- Fetch the keys.
- Perform operations on the fetched keys.
- ..
- }
- plugin_handle->mysql_key_iterator_deinit(iterator_ptr);
-
- init() method accepts a void pointer which is the made to point to
- Keys_iterator instance. Keys_iterator instance internal pointer points
- to Key_metadata list. This list holds information about all keys stored
- in the backed end data store of keyring plugin. After call to init()
- please check iterator_ptr.
-
- get_key() method accepts the above iterator_ptr as IN param and then
- fills the passes in key_id and user_id with valid values. This can be
- used to fetch actual key information. Every call to this method will
- change internal pointers to advance to next position, so that the next
- call will fetch the next key.
-
- deinit() method frees all internal pointers along with iterator_ptr.
- */
- /**
- Initialize an iterator.
-
- @param[out] key_iterator Iterator used to fetch individual keys
- from key_container.
-
- @return VOID
- */
- void (*mysql_key_iterator_init)(void** key_iterator);
-
- /**
- Deinitialize an iterator.
-
- @param[in] key_iterator Iterator used to fetch individual keys
- from key_container.
-
- @return VOID
- */
- void (*mysql_key_iterator_deinit)(void* key_iterator);
-
- /**
- Get details of key. Every call to this service will change
- internal pointers to advance to next position, so that the next call
- will fetch the next key. In case iterator moves to the end, this service
- will return error.
-
- @param[in] key_iterator Iterator used to fetch individual keys
- from key_container.
- @param[out] key_id id of the key
- @param[out] user_id id of the owner
-
- @return Operation status
- @retval 0 OK
- @retval 1 ERROR
- */
- bool (*mysql_key_iterator_get_key)(void* key_iterator, char *key_id, char *user_id);
-};
-#endif
diff --git a/code/mysql/mysql/plugin_keyring.h.pp b/code/mysql/mysql/plugin_keyring.h.pp
deleted file mode 100644
index c975320..0000000
--- a/code/mysql/mysql/plugin_keyring.h.pp
+++ /dev/null
@@ -1,127 +0,0 @@
-#include "plugin.h"
-typedef void * MYSQL_PLUGIN;
-struct st_mysql_xid {
- long formatID;
- long gtrid_length;
- long bqual_length;
- char data[128];
-};
-typedef struct st_mysql_xid MYSQL_XID;
-enum enum_mysql_show_type
-{
- SHOW_UNDEF, SHOW_BOOL,
- SHOW_INT,
- SHOW_LONG,
- SHOW_LONGLONG,
- SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
-};
-enum enum_mysql_show_scope
-{
- SHOW_SCOPE_UNDEF,
- SHOW_SCOPE_GLOBAL
-};
-struct st_mysql_show_var
-{
- const char *name;
- char *value;
- enum enum_mysql_show_type type;
- enum enum_mysql_show_scope scope;
-};
-typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
-struct st_mysql_sys_var;
-struct st_mysql_value;
-typedef int (*mysql_var_check_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *save, struct st_mysql_value *value);
-typedef void (*mysql_var_update_func)(void* thd,
- struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-struct st_mysql_plugin
-{
- int type;
- void *info;
- const char *name;
- const char *author;
- const char *descr;
- int license;
- int (*init)(MYSQL_PLUGIN);
- int (*deinit)(MYSQL_PLUGIN);
- unsigned int version;
- struct st_mysql_show_var *status_vars;
- struct st_mysql_sys_var **system_vars;
- void * __reserved1;
- unsigned long flags;
-};
-struct st_mysql_daemon
-{
- int interface_version;
-};
-struct st_mysql_information_schema
-{
- int interface_version;
-};
-struct st_mysql_storage_engine
-{
- int interface_version;
-};
-struct handlerton;
- struct Mysql_replication {
- int interface_version;
- };
-struct st_mysql_value
-{
- int (*value_type)(struct st_mysql_value *);
- const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
- int (*val_real)(struct st_mysql_value *, double *realbuf);
- int (*val_int)(struct st_mysql_value *, long long *intbuf);
- int (*is_unsigned)(struct st_mysql_value *);
-};
-int thd_in_lock_tables(const void* thd);
-int thd_tablespace_op(const void* thd);
-long long thd_test_options(const void* thd, long long test_options);
-int thd_sql_command(const void* thd);
-const char *set_thd_proc_info(void* thd, const char *info,
- const char *calling_func,
- const char *calling_file,
- const unsigned int calling_line);
-void **thd_ha_data(const void* thd, const struct handlerton *hton);
-void thd_storage_lock_wait(void* thd, long long value);
-int thd_tx_isolation(const void* thd);
-int thd_tx_is_read_only(const void* thd);
-void* thd_tx_arbitrate(void* requestor, void* holder);
-int thd_tx_priority(const void* thd);
-int thd_tx_is_dd_trx(const void* thd);
-char *thd_security_context(void* thd, char *buffer, size_t length,
- size_t max_query_len);
-void thd_inc_row_count(void* thd);
-int thd_allow_batch(void* thd);
-void thd_mark_transaction_to_rollback(void* thd, int all);
-int mysql_tmpfile(const char *prefix);
-int thd_killed(const void* thd);
-void thd_set_kill_status(const void* thd);
-void thd_binlog_pos(const void* thd,
- const char **file_var,
- unsigned long long *pos_var);
-unsigned long thd_get_thread_id(const void* thd);
-void thd_get_xid(const void* thd, MYSQL_XID *xid);
-void mysql_query_cache_invalidate4(void* thd,
- const char *key, unsigned int key_length,
- int using_trx);
-void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
-void thd_set_ha_data(void* thd, const struct handlerton *hton,
- const void *ha_data);
-struct st_mysql_keyring
-{
- int interface_version;
- my_bool (*mysql_key_store)(const char *key_id, const char *key_type,
- const char* user_id, const void *key, size_t key_len);
- my_bool (*mysql_key_fetch)(const char *key_id, char **key_type,
- const char *user_id, void **key, size_t *key_len);
- my_bool (*mysql_key_remove)(const char *key_id, const char *user_id);
- my_bool (*mysql_key_generate)(const char *key_id, const char *key_type,
- const char *user_id, size_t key_len);
- void (*mysql_key_iterator_init)(void** key_iterator);
- void (*mysql_key_iterator_deinit)(void* key_iterator);
- bool (*mysql_key_iterator_get_key)(void* key_iterator, char *key_id, char *user_id);
-};
diff --git a/code/mysql/mysql/plugin_trace.h b/code/mysql/mysql/plugin_trace.h
deleted file mode 100644
index 8b03d1d..0000000
--- a/code/mysql/mysql/plugin_trace.h
+++ /dev/null
@@ -1,356 +0,0 @@
-/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef PLUGIN_TRACE_INCLUDED
-#define PLUGIN_TRACE_INCLUDED
-/**
- @file
-
- ========================================================================
- Declarations for client-side plugins of type MYSQL_CLIENT_TRACE_PLUGIN
- ========================================================================
-
- See libmysql/mysql_trace.c for a brief description of the client-side
- protocol tracing infrastructure.
-*/
-
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- Lists of protocol stages and trace events
- =========================================
-
- These lists are defined with PROTOCOL_STAGE_LIST() and TRACE_EVENT_LIST(),
- respectively. Macros accept a disposition name as an argument.
-
- For example, to process list of protocol stages using disposition "foo",
- define protocol_stage_foo(Stage) macro and then put
-
- PROTOCOL_STAGE_LIST(foo)
-
- in your code. This will expand to sequence of protocol_stage_foo(X)
- macros where X ranges over the list of protocol stages, and these macros
- should generate the actual code. See below how this technique is used
- to generate protocol_stage and trace_events enums.
-*/
-
-/**
- Protocol stages
- ---------------
-
- A client following the MySQL protocol goes through several stages of it. Each
- stage determines what packets can be expected from the server or can be send
- by the client.
-
- Upon receiving each trace event, trace plugin will be notified of the current
- protocol stage so that it can correctly interpret the event.
-
- These are the possible protocol stages and the transitions between them.
-
- .. digraph:: protocol_stages
-
- CONNECTING -> WAIT_FOR_INIT_PACKET;
- CONNECTING -> DISCONNECTED [ label = "failed connection" ];
-
- WAIT_FOR_INIT_PACKET -> AUTHENTICATE;
- WAIT_FOR_INIT_PACKET -> SSL_NEGOTIATION -> AUTHENTICATE;
-
- AUTHENTICATE -> READY_FOR_COMMAND [ label = "accepted" ];
- AUTHENTICATE -> DISCONNECTED [ label = "rejected" ];
-
- READY_FOR_COMMAND -> DISCONNECTED [ label = "COM_QUIT" ];
- READY_FOR_COMMAND -> AUTHENTICATE [ label="after change user" ];
- READY_FOR_COMMAND -> WAIT_FOR_PACKET
- [ label="wait for a single packet after, e.g., COM_STATISTICS" ];
- READY_FOR_COMMAND -> WAIT_FOR_RESULT;
- READY_FOR_COMMAND -> WAIT_FOR_PS_DESCRIPTION
- [ label="after prepare command" ];
-
- WAIT_FOR_PACKET -> READY_FOR_COMAND;
-
- WAIT_FOR_RESULT -> READY_FOR_COMMAND [ label="simple reply" ];
- WAIT_FOR_RESULT -> WAIT_FOR_FIELD_DEF;
- WAIT_FOR_RESULT -> FILE_REQUEST;
-
- WAIT_FOR_FIELD_DEF -> WAIT_FOR_ROW [ label="in a resultset" ];
- WAIT_FOR_FIELD_DEF -> READY_FOR_COMMAND
- [ label="after describe table or prepare command" ];
-
- WAIT_FOR_ROW -> READY_FOR_COMMAND;
- WAIT_FOR_ROW -> WAIT_FOR_RESULT [ label="multi-resultset" ];
-
- WAIT_FOR_PS_DESCRIPTION -> WAIT_FOR_PARAM_DEF;
- WAIT_FOR_PS_DESCRIPTION -> READY_FOR_COMMAND
- [ label="no params and result" ];
- WAIT_FOR_PS_DESCRIPTION -> WAIT_FOR_FIELD_DEF [ label="no params" ];
-
- WAIT_FOR_PARAM_DEF -> WAIT_FOR_FIELD_DEF;
- WAIT_FOR_PARAM_DEF -> READY_FOR_COMMAND [ label="no result" ];
-
- FILE_REQUEST -> WAIT_FOR_RESULT [label="when whole file sent"];
-*/
-
-#define PROTOCOL_STAGE_LIST(X) \
- protocol_stage_ ## X(CONNECTING) \
- protocol_stage_ ## X(WAIT_FOR_INIT_PACKET) \
- protocol_stage_ ## X(AUTHENTICATE) \
- protocol_stage_ ## X(SSL_NEGOTIATION) \
- protocol_stage_ ## X(READY_FOR_COMMAND) \
- protocol_stage_ ## X(WAIT_FOR_PACKET) \
- protocol_stage_ ## X(WAIT_FOR_RESULT) \
- protocol_stage_ ## X(WAIT_FOR_FIELD_DEF) \
- protocol_stage_ ## X(WAIT_FOR_ROW) \
- protocol_stage_ ## X(FILE_REQUEST) \
- protocol_stage_ ## X(WAIT_FOR_PS_DESCRIPTION) \
- protocol_stage_ ## X(WAIT_FOR_PARAM_DEF) \
- protocol_stage_ ## X(DISCONNECTED)
-
-/**
- Trace events
- ------------
-
- The following events are generated during the various stages of the
- client-server conversation.
-
- ---------------------- -----------------------------------------------------
- Connection events
- ---------------------- -----------------------------------------------------
- CONNECTING Client is connecting to the server.
- CONNECTED Physical connection has been established.
- DISCONNECTED Connection with server was broken.
- ---------------------- -----------------------------------------------------
- SSL events
- ---------------------- -----------------------------------------------------
- SEND_SSL_REQUEST Client is sending SSL connection request.
- SSL_CONNECT Client is initiating SSL handshake.
- SSL_CONNECTED SSL connection has been established.
- ---------------------- -----------------------------------------------------
- Authentication events
- ---------------------- -----------------------------------------------------
- CHALLENGE_RECEIVED Client received authentication challenge.
- AUTH_PLUGIN Client selects an authentication plugin to be used
- in the following authentication exchange.
- SEND_AUTH_RESPONSE Client sends response to the authentication
- challenge.
- SEND_AUTH_DATA Client sends extra authentication data packet.
- AUTHENTICATED Server has accepted connection.
- ---------------------- -----------------------------------------------------
- Command phase events
- ---------------------- -----------------------------------------------------
- SEND_COMMAND Client is sending a command to the server.
- SEND_FILE Client is sending local file contents to the server.
- ---------------------- -----------------------------------------------------
- General events
- ---------------------- -----------------------------------------------------
- READ_PACKET Client starts waiting for a packet from server.
- PACKET_RECEIVED A packet from server has been received.
- PACKET_SENT After successful sending of a packet to the server.
- ERROR Client detected an error.
- ---------------------- -----------------------------------------------------
-*/
-
-#define TRACE_EVENT_LIST(X) \
- trace_event_ ## X(ERROR) \
- trace_event_ ## X(CONNECTING) \
- trace_event_ ## X(CONNECTED) \
- trace_event_ ## X(DISCONNECTED) \
- trace_event_ ## X(SEND_SSL_REQUEST) \
- trace_event_ ## X(SSL_CONNECT) \
- trace_event_ ## X(SSL_CONNECTED) \
- trace_event_ ## X(INIT_PACKET_RECEIVED) \
- trace_event_ ## X(AUTH_PLUGIN) \
- trace_event_ ## X(SEND_AUTH_RESPONSE) \
- trace_event_ ## X(SEND_AUTH_DATA) \
- trace_event_ ## X(AUTHENTICATED) \
- trace_event_ ## X(SEND_COMMAND) \
- trace_event_ ## X(SEND_FILE) \
- trace_event_ ## X(READ_PACKET) \
- trace_event_ ## X(PACKET_RECEIVED) \
- trace_event_ ## X(PACKET_SENT)
-
-/**
- Some trace events have additional arguments. These are stored in
- st_trace_event_args structure. Various events store their arguments in the
- structure as follows. Unused members are set to 0/NULL.
-
- AUTH_PLUGIN
- ------------- ----------------------------------
- plugin_name the name of the plugin
- ------------- ----------------------------------
-
- SEND_COMMAND
- ------------- ----------------------------------
- cmd the command code
- hdr pointer to command packet header
- hdr_len length of the header
- pkt pointer to command arguments
- pkt_len length of arguments
- ------------- ----------------------------------
-
- Other SEND_* and *_RECEIVED events
- ------------- ----------------------------------
- pkt the data sent or received
- pkt_len length of the data
- ------------- ----------------------------------
-
- PACKET_SENT
- ------------- ----------------------------------
- pkt_len number of bytes sent
- ------------- ----------------------------------
-*/
-
-struct st_trace_event_args
-{
- const char *plugin_name;
- int cmd;
- const unsigned char *hdr;
- size_t hdr_len;
- const unsigned char *pkt;
- size_t pkt_len;
-};
-
-
-/* Definitions of protocol_stage and trace_event enums. */
-
-#define protocol_stage_enum(X) PROTOCOL_STAGE_ ## X,
-
-enum protocol_stage {
- PROTOCOL_STAGE_LIST(enum)
- PROTOCOL_STAGE_LAST
-};
-
-#define trace_event_enum(X) TRACE_EVENT_ ## X,
-
-enum trace_event {
- TRACE_EVENT_LIST(enum)
- TRACE_EVENT_LAST
-};
-
-
-/*
- Trace plugin methods
- ====================
-*/
-
-struct st_mysql_client_plugin_TRACE;
-struct st_mysql;
-
-/**
- Trace plugin tracing_start() method.
-
- Called when tracing with this plugin starts on a connection. A trace
- plugin might want to maintain per-connection information. It can
- return a pointer to memory area holding such information. It will be
- stored in a connection handle and passed to other plugin methods.
-
- @param self pointer to the plugin instance
- @param connection_handle
- @param stage protocol stage in which tracing has started - currently
- it is always CONNECTING stage.
-
- @return A pointer to plugin-specific, per-connection data if any.
-*/
-
-typedef
-void* (tracing_start_callback)(struct st_mysql_client_plugin_TRACE *self,
- struct st_mysql *connection_handle,
- enum protocol_stage stage);
-
-/**
- Trace plugin tracing_stop() method.
-
- Called when tracing of the connection has ended. If a plugin
- allocated any per-connection resources, it should de-allocate them
- here.
-
- @param self pointer to the plugin instance
- @param connection_handle
- @param plugin_data pointer to plugin's per-connection data.
-*/
-
-typedef
-void (tracing_stop_callback)(struct st_mysql_client_plugin_TRACE *self,
- struct st_mysql *connection_handle,
- void *plugin_data);
-
-/**
- Trace plugin trace_event() method.
-
- Called when a trace event occurs. Plugin can decide to stop tracing
- this connection by returning non-zero value.
-
- @param self pointer to the plugin instance
- @param plugin_data pointer to plugin's per-connection data
- @param connection_handle
- @param stage current protocol stage
- @param event the trace event
- @param args trace event arguments
-
- @return Non-zero if tracing of the connection should end here.
-*/
-
-typedef
-int (trace_event_handler)(struct st_mysql_client_plugin_TRACE *self,
- void *plugin_data,
- struct st_mysql *connection_handle,
- enum protocol_stage stage,
- enum trace_event event,
- struct st_trace_event_args args);
-
-
-struct st_mysql_client_plugin_TRACE
-{
- MYSQL_CLIENT_PLUGIN_HEADER
- tracing_start_callback *tracing_start;
- tracing_stop_callback *tracing_stop;
- trace_event_handler *trace_event;
-};
-
-/**
- The global trace_plugin pointer. If it is not NULL, it points at a
- loaded trace plugin which should be used to trace all connections made
- to the server.
-*/
-extern
-struct st_mysql_client_plugin_TRACE *trace_plugin;
-
-#ifndef DBUG_OFF
-
-/*
- Functions for getting names of trace events and protocol
- stages for debugging purposes.
-*/
-const char* protocol_stage_name(enum protocol_stage stage);
-const char* trace_event_name(enum trace_event ev);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/plugin_validate_password.h b/code/mysql/mysql/plugin_validate_password.h
deleted file mode 100644
index e7a1a25..0000000
--- a/code/mysql/mysql/plugin_validate_password.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
-#define MYSQL_PLUGIN_VALIDATE_PASSWORD_INCLUDED
-
-/* API for validate_password plugin. (MYSQL_VALIDATE_PASSWORD_PLUGIN) */
-
-#include
-#define MYSQL_VALIDATE_PASSWORD_INTERFACE_VERSION 0x0100
-
-/*
- The descriptor structure for the plugin, that is referred from
- st_mysql_plugin.
-*/
-
-typedef void* mysql_string_handle;
-
-struct st_mysql_validate_password
-{
- int interface_version;
- /*
- This function retuns TRUE for passwords which satisfy the password
- policy (as choosen by plugin variable) and FALSE for all other
- password
- */
- int (*validate_password)(mysql_string_handle password);
- /*
- This function returns the password strength (0-100) depending
- upon the policies
- */
- int (*get_password_strength)(mysql_string_handle password);
-};
-#endif
diff --git a/code/mysql/mysql/psi/mysql_file.h b/code/mysql/mysql/psi/mysql_file.h
deleted file mode 100644
index a7d0bcb..0000000
--- a/code/mysql/mysql/psi/mysql_file.h
+++ /dev/null
@@ -1,1440 +0,0 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_FILE_H
-#define MYSQL_FILE_H
-
-#include
-
-/* For strlen() */
-#include
-/* For MY_STAT */
-#include
-/* For my_chsize */
-#include
-
-/**
- @file mysql/psi/mysql_file.h
- Instrumentation helpers for mysys file io.
- This header file provides the necessary declarations
- to use the mysys file API with the performance schema instrumentation.
- In some compilers (SunStudio), 'static inline' functions, when declared
- but not used, are not optimized away (because they are unused) by default,
- so that including a static inline function from a header file does
- create unwanted dependencies, causing unresolved symbols at link time.
- Other compilers, like gcc, optimize these dependencies by default.
-
- Since the instrumented APIs declared here are wrapper on top
- of mysys file io APIs, including mysql/psi/mysql_file.h assumes that
- the dependency on my_sys already exists.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_FILE_CALL
-#define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup File_instrumentation File Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_file_register(P1, P2, P3)
- File registration.
-*/
-#define mysql_file_register(P1, P2, P3) \
- inline_mysql_file_register(P1, P2, P3)
-
-/**
- @def mysql_file_fgets(P1, P2, F)
- Instrumented fgets.
- @c mysql_file_fgets is a replacement for @c fgets.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fgets(P1, P2, F) \
- inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F)
-#else
- #define mysql_file_fgets(P1, P2, F) \
- inline_mysql_file_fgets(P1, P2, F)
-#endif
-
-/**
- @def mysql_file_fgetc(F)
- Instrumented fgetc.
- @c mysql_file_fgetc is a replacement for @c fgetc.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F)
-#else
- #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F)
-#endif
-
-/**
- @def mysql_file_fputs(P1, F)
- Instrumented fputs.
- @c mysql_file_fputs is a replacement for @c fputs.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fputs(P1, F) \
- inline_mysql_file_fputs(__FILE__, __LINE__, P1, F)
-#else
- #define mysql_file_fputs(P1, F)\
- inline_mysql_file_fputs(P1, F)
-#endif
-
-/**
- @def mysql_file_fputc(P1, F)
- Instrumented fputc.
- @c mysql_file_fputc is a replacement for @c fputc.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fputc(P1, F) \
- inline_mysql_file_fputc(__FILE__, __LINE__, P1, F)
-#else
- #define mysql_file_fputc(P1, F) \
- inline_mysql_file_fputc(P1, F)
-#endif
-
-/**
- @def mysql_file_fprintf
- Instrumented fprintf.
- @c mysql_file_fprintf is a replacement for @c fprintf.
-*/
-#define mysql_file_fprintf inline_mysql_file_fprintf
-
-/**
- @def mysql_file_vfprintf(F, P1, P2)
- Instrumented vfprintf.
- @c mysql_file_vfprintf is a replacement for @c vfprintf.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_vfprintf(F, P1, P2) \
- inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2)
-#else
- #define mysql_file_vfprintf(F, P1, P2) \
- inline_mysql_file_vfprintf(F, P1, P2)
-#endif
-
-/**
- @def mysql_file_fflush(F, P1, P2)
- Instrumented fflush.
- @c mysql_file_fflush is a replacement for @c fflush.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fflush(F) \
- inline_mysql_file_fflush(__FILE__, __LINE__, F)
-#else
- #define mysql_file_fflush(F) \
- inline_mysql_file_fflush(F)
-#endif
-
-/**
- @def mysql_file_feof(F)
- Instrumented feof.
- @c mysql_file_feof is a replacement for @c feof.
-*/
-#define mysql_file_feof(F) inline_mysql_file_feof(F)
-
-/**
- @def mysql_file_fstat(FN, S, FL)
- Instrumented fstat.
- @c mysql_file_fstat is a replacement for @c my_fstat.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fstat(FN, S, FL) \
- inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL)
-#else
- #define mysql_file_fstat(FN, S, FL) \
- inline_mysql_file_fstat(FN, S, FL)
-#endif
-
-/**
- @def mysql_file_stat(K, FN, S, FL)
- Instrumented stat.
- @c mysql_file_stat is a replacement for @c my_stat.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_stat(K, FN, S, FL) \
- inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL)
-#else
- #define mysql_file_stat(K, FN, S, FL) \
- inline_mysql_file_stat(FN, S, FL)
-#endif
-
-/**
- @def mysql_file_chsize(F, P1, P2, P3)
- Instrumented chsize.
- @c mysql_file_chsize is a replacement for @c my_chsize.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_chsize(F, P1, P2, P3) \
- inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3)
-#else
- #define mysql_file_chsize(F, P1, P2, P3) \
- inline_mysql_file_chsize(F, P1, P2, P3)
-#endif
-
-/**
- @def mysql_file_fopen(K, N, F1, F2)
- Instrumented fopen.
- @c mysql_file_fopen is a replacement for @c my_fopen.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fopen(K, N, F1, F2) \
- inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2)
-#else
- #define mysql_file_fopen(K, N, F1, F2) \
- inline_mysql_file_fopen(N, F1, F2)
-#endif
-
-/**
- @def mysql_file_fclose(FD, FL)
- Instrumented fclose.
- @c mysql_file_fclose is a replacement for @c my_fclose.
- Without the instrumentation, this call will have the same behavior as the
- undocumented and possibly platform specific my_fclose(NULL, ...) behavior.
- With the instrumentation, mysql_fclose(NULL, ...) will safely return 0,
- which is an extension compared to my_fclose and is therefore compliant.
- mysql_fclose is on purpose *not* implementing
- @code DBUG_ASSERT(file != NULL) @endcode,
- since doing so could introduce regressions.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fclose(FD, FL) \
- inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL)
-#else
- #define mysql_file_fclose(FD, FL) \
- inline_mysql_file_fclose(FD, FL)
-#endif
-
-/**
- @def mysql_file_fread(FD, P1, P2, P3)
- Instrumented fread.
- @c mysql_file_fread is a replacement for @c my_fread.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fread(FD, P1, P2, P3) \
- inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3)
-#else
- #define mysql_file_fread(FD, P1, P2, P3) \
- inline_mysql_file_fread(FD, P1, P2, P3)
-#endif
-
-/**
- @def mysql_file_fwrite(FD, P1, P2, P3)
- Instrumented fwrite.
- @c mysql_file_fwrite is a replacement for @c my_fwrite.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fwrite(FD, P1, P2, P3) \
- inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3)
-#else
- #define mysql_file_fwrite(FD, P1, P2, P3) \
- inline_mysql_file_fwrite(FD, P1, P2, P3)
-#endif
-
-/**
- @def mysql_file_fseek(FD, P, W, F)
- Instrumented fseek.
- @c mysql_file_fseek is a replacement for @c my_fseek.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_fseek(FD, P, W, F) \
- inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F)
-#else
- #define mysql_file_fseek(FD, P, W, F) \
- inline_mysql_file_fseek(FD, P, W, F)
-#endif
-
-/**
- @def mysql_file_ftell(FD, F)
- Instrumented ftell.
- @c mysql_file_ftell is a replacement for @c my_ftell.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_ftell(FD, F) \
- inline_mysql_file_ftell(__FILE__, __LINE__, FD, F)
-#else
- #define mysql_file_ftell(FD, F) \
- inline_mysql_file_ftell(FD, F)
-#endif
-
-/**
- @def mysql_file_create(K, N, F1, F2, F3)
- Instrumented create.
- @c mysql_file_create is a replacement for @c my_create.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_create(K, N, F1, F2, F3) \
- inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3)
-#else
- #define mysql_file_create(K, N, F1, F2, F3) \
- inline_mysql_file_create(N, F1, F2, F3)
-#endif
-
-/**
- @def mysql_file_create_temp(K, T, D, P, M, F)
- Instrumented create_temp_file.
- @c mysql_file_create_temp is a replacement for @c create_temp_file.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_create_temp(K, T, D, P, M, F) \
- inline_mysql_file_create_temp(K, __FILE__, __LINE__, T, D, P, M, F)
-#else
- #define mysql_file_create_temp(K, T, D, P, M, F) \
- inline_mysql_file_create_temp(T, D, P, M, F)
-#endif
-
-/**
- @def mysql_file_open(K, N, F1, F2)
- Instrumented open.
- @c mysql_file_open is a replacement for @c my_open.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_open(K, N, F1, F2) \
- inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2)
-#else
- #define mysql_file_open(K, N, F1, F2) \
- inline_mysql_file_open(N, F1, F2)
-#endif
-
-/**
- @def mysql_file_close(FD, F)
- Instrumented close.
- @c mysql_file_close is a replacement for @c my_close.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_close(FD, F) \
- inline_mysql_file_close(__FILE__, __LINE__, FD, F)
-#else
- #define mysql_file_close(FD, F) \
- inline_mysql_file_close(FD, F)
-#endif
-
-/**
- @def mysql_file_read(FD, B, S, F)
- Instrumented read.
- @c mysql_read is a replacement for @c my_read.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_read(FD, B, S, F) \
- inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F)
-#else
- #define mysql_file_read(FD, B, S, F) \
- inline_mysql_file_read(FD, B, S, F)
-#endif
-
-/**
- @def mysql_file_write(FD, B, S, F)
- Instrumented write.
- @c mysql_file_write is a replacement for @c my_write.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_write(FD, B, S, F) \
- inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F)
-#else
- #define mysql_file_write(FD, B, S, F) \
- inline_mysql_file_write(FD, B, S, F)
-#endif
-
-/**
- @def mysql_file_pread(FD, B, S, O, F)
- Instrumented pread.
- @c mysql_pread is a replacement for @c my_pread.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_pread(FD, B, S, O, F) \
- inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F)
-#else
- #define mysql_file_pread(FD, B, S, O, F) \
- inline_mysql_file_pread(FD, B, S, O, F)
-#endif
-
-/**
- @def mysql_file_pwrite(FD, B, S, O, F)
- Instrumented pwrite.
- @c mysql_file_pwrite is a replacement for @c my_pwrite.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_pwrite(FD, B, S, O, F) \
- inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F)
-#else
- #define mysql_file_pwrite(FD, B, S, O, F) \
- inline_mysql_file_pwrite(FD, B, S, O, F)
-#endif
-
-/**
- @def mysql_file_seek(FD, P, W, F)
- Instrumented seek.
- @c mysql_file_seek is a replacement for @c my_seek.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_seek(FD, P, W, F) \
- inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F)
-#else
- #define mysql_file_seek(FD, P, W, F) \
- inline_mysql_file_seek(FD, P, W, F)
-#endif
-
-/**
- @def mysql_file_tell(FD, F)
- Instrumented tell.
- @c mysql_file_tell is a replacement for @c my_tell.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_tell(FD, F) \
- inline_mysql_file_tell(__FILE__, __LINE__, FD, F)
-#else
- #define mysql_file_tell(FD, F) \
- inline_mysql_file_tell(FD, F)
-#endif
-
-/**
- @def mysql_file_delete(K, P1, P2)
- Instrumented delete.
- @c mysql_file_delete is a replacement for @c my_delete.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_delete(K, P1, P2) \
- inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2)
-#else
- #define mysql_file_delete(K, P1, P2) \
- inline_mysql_file_delete(P1, P2)
-#endif
-
-/**
- @def mysql_file_rename(K, P1, P2, P3)
- Instrumented rename.
- @c mysql_file_rename is a replacement for @c my_rename.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_rename(K, P1, P2, P3) \
- inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3)
-#else
- #define mysql_file_rename(K, P1, P2, P3) \
- inline_mysql_file_rename(P1, P2, P3)
-#endif
-
-/**
- @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5)
- Instrumented create with symbolic link.
- @c mysql_file_create_with_symlink is a replacement
- for @c my_create_with_symlink.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \
- inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \
- P1, P2, P3, P4, P5)
-#else
- #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \
- inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5)
-#endif
-
-/**
- @def mysql_file_delete_with_symlink(K, P1, P2)
- Instrumented delete with symbolic link.
- @c mysql_file_delete_with_symlink is a replacement
- for @c my_delete_with_symlink.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_delete_with_symlink(K, P1, P2) \
- inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2)
-#else
- #define mysql_file_delete_with_symlink(K, P1, P2) \
- inline_mysql_file_delete_with_symlink(P1, P2)
-#endif
-
-/**
- @def mysql_file_rename_with_symlink(K, P1, P2, P3)
- Instrumented rename with symbolic link.
- @c mysql_file_rename_with_symlink is a replacement
- for @c my_rename_with_symlink.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_rename_with_symlink(K, P1, P2, P3) \
- inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
-#else
- #define mysql_file_rename_with_symlink(K, P1, P2, P3) \
- inline_mysql_file_rename_with_symlink(P1, P2, P3)
-#endif
-
-/**
- @def mysql_file_sync(P1, P2)
- Instrumented file sync.
- @c mysql_file_sync is a replacement for @c my_sync.
-*/
-#ifdef HAVE_PSI_FILE_INTERFACE
- #define mysql_file_sync(P1, P2) \
- inline_mysql_file_sync(__FILE__, __LINE__, P1, P2)
-#else
- #define mysql_file_sync(P1, P2) \
- inline_mysql_file_sync(P1, P2)
-#endif
-
-/**
- An instrumented FILE structure.
- @sa MYSQL_FILE
-*/
-struct st_mysql_file
-{
- /** The real file. */
- FILE *m_file;
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c MYSQL_FILE interface.
- */
- struct PSI_file *m_psi;
-};
-
-/**
- Type of an instrumented file.
- @c MYSQL_FILE is a drop-in replacement for @c FILE.
- @sa mysql_file_open
-*/
-typedef struct st_mysql_file MYSQL_FILE;
-
-static inline void inline_mysql_file_register(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *category,
- PSI_file_info *info,
- int count
-#else
- const char *category MY_ATTRIBUTE ((unused)),
- void *info MY_ATTRIBUTE ((unused)),
- int count MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_FILE_CALL(register_file)(category, info, count);
-#endif
-}
-
-static inline char *
-inline_mysql_file_fgets(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- char *str, int size, MYSQL_FILE *file)
-{
- char *result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_READ);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) size, src_file, src_line);
- result= fgets(str, size, file->m_file);
- PSI_FILE_CALL(end_file_wait)(locker, result ? strlen(result) : 0);
- return result;
- }
-#endif
-
- result= fgets(str, size, file->m_file);
- return result;
-}
-
-static inline int
-inline_mysql_file_fgetc(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_READ);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
- result= fgetc(file->m_file);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1);
- return result;
- }
-#endif
-
- result= fgetc(file->m_file);
- return result;
-}
-
-static inline int
-inline_mysql_file_fputs(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- const char *str, MYSQL_FILE *file)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- bytes= str ? strlen(str) : 0;
- PSI_FILE_CALL(start_file_wait)(locker, bytes, src_file, src_line);
- result= fputs(str, file->m_file);
- PSI_FILE_CALL(end_file_wait)(locker, bytes);
- return result;
- }
-#endif
-
- result= fputs(str, file->m_file);
- return result;
-}
-
-static inline int
-inline_mysql_file_fputc(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- char c, MYSQL_FILE *file)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line);
- result= fputc(c, file->m_file);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1);
- return result;
- }
-#endif
-
- result= fputc(c, file->m_file);
- return result;
-}
-
-static inline int
-inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...)
-{
- /*
- TODO: figure out how to pass src_file and src_line from the caller.
- */
- int result;
- va_list args;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, __FILE__, __LINE__);
- va_start(args, format);
- result= vfprintf(file->m_file, format, args);
- va_end(args);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) result);
- return result;
- }
-#endif
-
- va_start(args, format);
- result= vfprintf(file->m_file, format, args);
- va_end(args);
- return result;
-}
-
-static inline int
-inline_mysql_file_vfprintf(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, const char *format, va_list args)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= vfprintf(file->m_file, format, args);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) result);
- return result;
- }
-#endif
-
- result= vfprintf(file->m_file, format, args);
- return result;
-}
-
-static inline int
-inline_mysql_file_fflush(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_FLUSH);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= fflush(file->m_file);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= fflush(file->m_file);
- return result;
-}
-
-static inline int inline_mysql_file_feof(MYSQL_FILE *file)
-{
- /* Not instrumented, there is no wait involved */
- return feof(file->m_file);
-}
-
-static inline int
-inline_mysql_file_fstat(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- int filenr, MY_STAT *stat_area, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, filenr, PSI_FILE_FSTAT);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_fstat(filenr, stat_area, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_fstat(filenr, stat_area, flags);
- return result;
-}
-
-static inline MY_STAT *
-inline_mysql_file_stat(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *path, MY_STAT *stat_area, myf flags)
-{
- MY_STAT *result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_STAT, path, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
- result= my_stat(path, stat_area, flags);
- PSI_FILE_CALL(end_file_open_wait)(locker, result);
- return result;
- }
-#endif
-
- result= my_stat(path, stat_area, flags);
- return result;
-}
-
-static inline int
-inline_mysql_file_chsize(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, my_off_t newlength, int filler, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_CHSIZE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) newlength, src_file,
- src_line);
- result= my_chsize(file, newlength, filler, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) newlength);
- return result;
- }
-#endif
-
- result= my_chsize(file, newlength, filler, flags);
- return result;
-}
-
-static inline MYSQL_FILE*
-inline_mysql_file_fopen(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *filename, int flags, myf myFlags)
-{
- MYSQL_FILE *that;
- that= (MYSQL_FILE*) my_malloc(PSI_NOT_INSTRUMENTED,
- sizeof(MYSQL_FILE), MYF(MY_WME));
- if (likely(that != NULL))
- {
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_STREAM_OPEN, filename, that);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)
- (locker, src_file, src_line);
- that->m_file= my_fopen(filename, flags, myFlags);
- that->m_psi= PSI_FILE_CALL(end_file_open_wait)(locker, that->m_file);
- if (unlikely(that->m_file == NULL))
- {
- my_free(that);
- return NULL;
- }
- return that;
- }
-#endif
-
- that->m_psi= NULL;
- that->m_file= my_fopen(filename, flags, myFlags);
- if (unlikely(that->m_file == NULL))
- {
- my_free(that);
- return NULL;
- }
- }
- return that;
-}
-
-static inline int
-inline_mysql_file_fclose(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, myf flags)
-{
- int result= 0;
- if (likely(file != NULL))
- {
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_STREAM_CLOSE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
- result= my_fclose(file->m_file, flags);
- PSI_FILE_CALL(end_file_close_wait)(locker, result);
- my_free(file);
- return result;
- }
-#endif
-
- result= my_fclose(file->m_file, flags);
- my_free(file);
- }
- return result;
-}
-
-static inline size_t
-inline_mysql_file_fread(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, uchar *buffer, size_t count, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_read;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_READ);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_fread(file->m_file, buffer, count, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_read= (result == 0) ? count : 0;
- else
- bytes_read= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
- return result;
- }
-#endif
-
- result= my_fread(file->m_file, buffer, count, flags);
- return result;
-}
-
-static inline size_t
-inline_mysql_file_fwrite(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_written;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_fwrite(file->m_file, buffer, count, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_written= (result == 0) ? count : 0;
- else
- bytes_written= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
- return result;
- }
-#endif
-
- result= my_fwrite(file->m_file, buffer, count, flags);
- return result;
-}
-
-static inline my_off_t
-inline_mysql_file_fseek(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, my_off_t pos, int whence, myf flags)
-{
- my_off_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_SEEK);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_fseek(file->m_file, pos, whence, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_fseek(file->m_file, pos, whence, flags);
- return result;
-}
-
-static inline my_off_t
-inline_mysql_file_ftell(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_FILE *file, myf flags)
-{
- my_off_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_stream_locker)
- (&state, file->m_psi, PSI_FILE_TELL);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_ftell(file->m_file, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_ftell(file->m_file, flags);
- return result;
-}
-
-static inline File
-inline_mysql_file_create(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *filename, int create_flags, int access_flags, myf myFlags)
-{
- File file;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_CREATE, filename, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
- file= my_create(filename, create_flags, access_flags, myFlags);
- PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
- return file;
- }
-#endif
-
- file= my_create(filename, create_flags, access_flags, myFlags);
- return file;
-}
-
-static inline File
-inline_mysql_file_create_temp(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- char *to, const char *dir, const char *pfx, int mode, myf myFlags)
-{
- File file;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_CREATE, NULL, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
- /* The file name is generated by create_temp_file(). */
- file= create_temp_file(to, dir, pfx, mode, myFlags);
- PSI_FILE_CALL(end_temp_file_open_wait_and_bind_to_descriptor)(locker, file, (const char*)to);
- return file;
- }
-#endif
-
- file= create_temp_file(to, dir, pfx, mode, myFlags);
- return file;
-}
-
-static inline File
-inline_mysql_file_open(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *filename, int flags, myf myFlags)
-{
- File file;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_OPEN, filename, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
- file= my_open(filename, flags, myFlags);
- PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
- return file;
- }
-#endif
-
- file= my_open(filename, flags, myFlags);
- return file;
-}
-
-static inline int
-inline_mysql_file_close(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_CLOSE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
- result= my_close(file, flags);
- PSI_FILE_CALL(end_file_close_wait)(locker, result);
- return result;
- }
-#endif
-
- result= my_close(file, flags);
- return result;
-}
-
-static inline size_t
-inline_mysql_file_read(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, uchar *buffer, size_t count, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_read;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_READ);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_read(file, buffer, count, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_read= (result == 0) ? count : 0;
- else
- bytes_read= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
- return result;
- }
-#endif
-
- result= my_read(file, buffer, count, flags);
- return result;
-}
-
-static inline size_t
-inline_mysql_file_write(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, const uchar *buffer, size_t count, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_written;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_write(file, buffer, count, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_written= (result == 0) ? count : 0;
- else
- bytes_written= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
- return result;
- }
-#endif
-
- result= my_write(file, buffer, count, flags);
- return result;
-}
-
-static inline size_t
-inline_mysql_file_pread(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, uchar *buffer, size_t count, my_off_t offset, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_read;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_READ);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_pread(file, buffer, count, offset, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_read= (result == 0) ? count : 0;
- else
- bytes_read= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_read);
- return result;
- }
-#endif
-
- result= my_pread(file, buffer, count, offset, flags);
- return result;
-}
-
-static inline size_t
-inline_mysql_file_pwrite(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, const uchar *buffer, size_t count, my_off_t offset, myf flags)
-{
- size_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- size_t bytes_written;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_WRITE);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line);
- result= my_pwrite(file, buffer, count, offset, flags);
- if (flags & (MY_NABP | MY_FNABP))
- bytes_written= (result == 0) ? count : 0;
- else
- bytes_written= (result != MY_FILE_ERROR) ? result : 0;
- PSI_FILE_CALL(end_file_wait)(locker, bytes_written);
- return result;
- }
-#endif
-
- result= my_pwrite(file, buffer, count, offset, flags);
- return result;
-}
-
-static inline my_off_t
-inline_mysql_file_seek(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, my_off_t pos, int whence, myf flags)
-{
- my_off_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_SEEK);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_seek(file, pos, whence, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_seek(file, pos, whence, flags);
- return result;
-}
-
-static inline my_off_t
-inline_mysql_file_tell(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File file, myf flags)
-{
- my_off_t result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, file, PSI_FILE_TELL);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_tell(file, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_tell(file, flags);
- return result;
-}
-
-static inline int
-inline_mysql_file_delete(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *name, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_DELETE, name, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
- result= my_delete(name, flags);
- PSI_FILE_CALL(end_file_close_wait)(locker, result);
- return result;
- }
-#endif
-
- result= my_delete(name, flags);
- return result;
-}
-
-static inline int
-inline_mysql_file_rename(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *from, const char *to, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_RENAME, from, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_rename(from, to, flags);
- PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
- return result;
- }
-#endif
-
- result= my_rename(from, to, flags);
- return result;
-}
-
-static inline File
-inline_mysql_file_create_with_symlink(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *linkname, const char *filename, int create_flags,
- int access_flags, myf flags)
-{
- File file;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_CREATE, filename, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line);
- file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
- flags);
- PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file);
- return file;
- }
-#endif
-
- file= my_create_with_symlink(linkname, filename, create_flags, access_flags,
- flags);
- return file;
-}
-
-static inline int
-inline_mysql_file_delete_with_symlink(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *name, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_DELETE, name, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
- result= my_delete_with_symlink(name, flags);
- PSI_FILE_CALL(end_file_close_wait)(locker, result);
- return result;
- }
-#endif
-
- result= my_delete_with_symlink(name, flags);
- return result;
-}
-
-static inline int
-inline_mysql_file_rename_with_symlink(
-#ifdef HAVE_PSI_FILE_INTERFACE
- PSI_file_key key, const char *src_file, uint src_line,
-#endif
- const char *from, const char *to, myf flags)
-{
- int result;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_name_locker)
- (&state, key, PSI_FILE_RENAME, from, &locker);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_rename_with_symlink(from, to, flags);
- PSI_FILE_CALL(end_file_rename_wait)(locker, from, to, result);
- return result;
- }
-#endif
-
- result= my_rename_with_symlink(from, to, flags);
- return result;
-}
-
-static inline int
-inline_mysql_file_sync(
-#ifdef HAVE_PSI_FILE_INTERFACE
- const char *src_file, uint src_line,
-#endif
- File fd, myf flags)
-{
- int result= 0;
-#ifdef HAVE_PSI_FILE_INTERFACE
- struct PSI_file_locker *locker;
- PSI_file_locker_state state;
- locker= PSI_FILE_CALL(get_thread_file_descriptor_locker)
- (&state, fd, PSI_FILE_SYNC);
- if (likely(locker != NULL))
- {
- PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line);
- result= my_sync(fd, flags);
- PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0);
- return result;
- }
-#endif
-
- result= my_sync(fd, flags);
- return result;
-}
-
-/** @} (end of group File_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_idle.h b/code/mysql/mysql/psi/mysql_idle.h
deleted file mode 100644
index 662de59..0000000
--- a/code/mysql/mysql/psi/mysql_idle.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_IDLE_H
-#define MYSQL_IDLE_H
-
-/**
- @file mysql/psi/mysql_idle.h
- Instrumentation helpers for idle waits.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_IDLE_CALL
-#define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Idle_instrumentation Idle Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def MYSQL_START_IDLE_WAIT
- Instrumentation helper for table io_waits.
- This instrumentation marks the start of a wait event.
- @param LOCKER the locker
- @param STATE the locker state
- @sa MYSQL_END_IDLE_WAIT.
-*/
-#ifdef HAVE_PSI_IDLE_INTERFACE
- #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
- LOCKER= inline_mysql_start_idle_wait(STATE, __FILE__, __LINE__)
-#else
- #define MYSQL_START_IDLE_WAIT(LOCKER, STATE) \
- do {} while (0)
-#endif
-
-/**
- @def MYSQL_END_IDLE_WAIT
- Instrumentation helper for idle waits.
- This instrumentation marks the end of a wait event.
- @param LOCKER the locker
- @sa MYSQL_START_IDLE_WAIT.
-*/
-#ifdef HAVE_PSI_IDLE_INTERFACE
- #define MYSQL_END_IDLE_WAIT(LOCKER) \
- inline_mysql_end_idle_wait(LOCKER)
-#else
- #define MYSQL_END_IDLE_WAIT(LOCKER) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_IDLE_INTERFACE
-/**
- Instrumentation calls for MYSQL_START_IDLE_WAIT.
- @sa MYSQL_END_IDLE_WAIT.
-*/
-static inline struct PSI_idle_locker *
-inline_mysql_start_idle_wait(PSI_idle_locker_state *state,
- const char *src_file, int src_line)
-{
- struct PSI_idle_locker *locker;
- locker= PSI_IDLE_CALL(start_idle_wait)(state, src_file, src_line);
- return locker;
-}
-
-/**
- Instrumentation calls for MYSQL_END_IDLE_WAIT.
- @sa MYSQL_START_IDLE_WAIT.
-*/
-static inline void
-inline_mysql_end_idle_wait(struct PSI_idle_locker *locker)
-{
- if (likely(locker != NULL))
- PSI_IDLE_CALL(end_idle_wait)(locker);
-}
-#endif
-
-/** @} (end of group Idle_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_mdl.h b/code/mysql/mysql/psi/mysql_mdl.h
deleted file mode 100644
index 0db0160..0000000
--- a/code/mysql/mysql/psi/mysql_mdl.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_MDL_H
-#define MYSQL_MDL_H
-
-/**
- @file mysql/psi/mysql_mdl.h
- Instrumentation helpers for metadata locks.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_METADATA_CALL
-#define PSI_METADATA_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Thread_instrumentation Metadata Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_mdl_create(K, M, A)
- Instrumented metadata lock creation.
- @param I Metadata lock identity
- @param K Metadata key
- @param T Metadata lock type
- @param D Metadata lock duration
- @param S Metadata lock status
- @param F request source file
- @param L request source line
-*/
-
-#ifdef HAVE_PSI_METADATA_INTERFACE
- #define mysql_mdl_create(I, K, T, D, S, F, L) \
- inline_mysql_mdl_create(I, K, T, D, S, F, L)
-#else
- #define mysql_mdl_create(I, K, T, D, S, F, L) NULL
-#endif
-
-#ifdef HAVE_PSI_METADATA_INTERFACE
- #define mysql_mdl_set_status(L, S) \
- inline_mysql_mdl_set_status(L, S)
-#else
- #define mysql_mdl_set_status(L, S) \
- do {} while (0)
-#endif
-
-
-/**
- @def mysql_mdl_destroy(M)
- Instrumented metadata lock destruction.
- @param M Metadata lock
-*/
-#ifdef HAVE_PSI_METADATA_INTERFACE
- #define mysql_mdl_destroy(M) \
- inline_mysql_mdl_destroy(M, __FILE__, __LINE__)
-#else
- #define mysql_mdl_destroy(M) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_METADATA_INTERFACE
-
-static inline PSI_metadata_lock *
-inline_mysql_mdl_create(void *identity,
- const MDL_key *mdl_key,
- enum_mdl_type mdl_type,
- enum_mdl_duration mdl_duration,
- MDL_ticket::enum_psi_status mdl_status,
- const char *src_file, uint src_line)
-{
- PSI_metadata_lock *result;
-
- /* static_cast: Fit a round C++ enum peg into a square C int hole ... */
- result= PSI_METADATA_CALL(create_metadata_lock)
- (identity,
- mdl_key,
- static_cast (mdl_type),
- static_cast (mdl_duration),
- static_cast (mdl_status),
- src_file, src_line);
-
- return result;
-}
-
-static inline void inline_mysql_mdl_set_status(
- PSI_metadata_lock *psi,
- MDL_ticket::enum_psi_status mdl_status)
-{
- if (psi != NULL)
- PSI_METADATA_CALL(set_metadata_lock_status)(psi, mdl_status);
-}
-
-static inline void inline_mysql_mdl_destroy(
- PSI_metadata_lock *psi,
- const char *src_file, uint src_line)
-{
- if (psi != NULL)
- PSI_METADATA_CALL(destroy_metadata_lock)(psi);
-}
-#endif /* HAVE_PSI_METADATA_INTERFACE */
-
-/** @} (end of group Metadata_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_memory.h b/code/mysql/mysql/psi/mysql_memory.h
deleted file mode 100644
index 2955c9d..0000000
--- a/code/mysql/mysql/psi/mysql_memory.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_MEMORY_H
-#define MYSQL_MEMORY_H
-
-/**
- @file mysql/psi/mysql_memory.h
- Instrumentation helpers for memory allocation.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_MEMORY_CALL
-#define PSI_MEMORY_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Memory_instrumentation Memory Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_memory_register(P1, P2, P3)
- Memory registration.
-*/
-#define mysql_memory_register(P1, P2, P3) \
- inline_mysql_memory_register(P1, P2, P3)
-
-static inline void inline_mysql_memory_register(
-#ifdef HAVE_PSI_MEMORY_INTERFACE
- const char *category,
- PSI_memory_info *info,
- int count)
-#else
- const char *category MY_ATTRIBUTE((unused)),
- void *info MY_ATTRIBUTE((unused)),
- int count MY_ATTRIBUTE((unused)))
-#endif
-{
-#ifdef HAVE_PSI_MEMORY_INTERFACE
- PSI_MEMORY_CALL(register_memory)(category, info, count);
-#endif
-}
-
-/** @} (end of group Memory_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_ps.h b/code/mysql/mysql/psi/mysql_ps.h
deleted file mode 100644
index e68994d..0000000
--- a/code/mysql/mysql/psi/mysql_ps.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_PS_H
-#define MYSQL_PS_H
-
-/**
- @file mysql/psi/mysql_ps.h
- Instrumentation helpers for prepared statements.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_PS_CALL
-#define PSI_PS_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifdef HAVE_PSI_PS_INTERFACE
- #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
- inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH)
- #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
- inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT)
- #define MYSQL_DESTROY_PS(PREPARED_STMT) \
- inline_mysql_destroy_prepared_stmt(PREPARED_STMT)
- #define MYSQL_REPREPARE_PS(PREPARED_STMT) \
- inline_mysql_reprepare_prepared_stmt(PREPARED_STMT)
- #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \
- inline_mysql_set_prepared_stmt_text(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH)
-#else
- #define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
- NULL
- #define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
- do {} while (0)
- #define MYSQL_DESTROY_PS(PREPARED_STMT) \
- do {} while (0)
- #define MYSQL_REPREPARE_PS(PREPARED_STMT) \
- do {} while (0)
- #define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_PS_INTERFACE
-static inline struct PSI_prepared_stmt*
-inline_mysql_create_prepared_stmt(void *identity, uint stmt_id,
- PSI_statement_locker *locker,
- const char *stmt_name, size_t stmt_name_length,
- const char *sqltext, size_t sqltext_length)
-{
- if (locker == NULL)
- return NULL;
- return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id,
- locker,
- stmt_name, stmt_name_length,
- sqltext, sqltext_length);
-}
-
-static inline void
-inline_mysql_execute_prepared_stmt(PSI_statement_locker *locker,
- PSI_prepared_stmt* prepared_stmt)
-{
- if (prepared_stmt != NULL && locker != NULL)
- PSI_PS_CALL(execute_prepared_stmt)(locker, prepared_stmt);
-}
-
-static inline void
-inline_mysql_destroy_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
-{
- if (prepared_stmt != NULL)
- PSI_PS_CALL(destroy_prepared_stmt)(prepared_stmt);
-}
-
-static inline void
-inline_mysql_reprepare_prepared_stmt(PSI_prepared_stmt *prepared_stmt)
-{
- if (prepared_stmt != NULL)
- PSI_PS_CALL(reprepare_prepared_stmt)(prepared_stmt);
-}
-
-static inline void
-inline_mysql_set_prepared_stmt_text(PSI_prepared_stmt *prepared_stmt,
- const char *text,
- uint text_len)
-{
- if (prepared_stmt != NULL)
- {
- PSI_PS_CALL(set_prepared_stmt_text)(prepared_stmt, text, text_len);
- }
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/psi/mysql_socket.h b/code/mysql/mysql/psi/mysql_socket.h
deleted file mode 100644
index 94e17c4..0000000
--- a/code/mysql/mysql/psi/mysql_socket.h
+++ /dev/null
@@ -1,1261 +0,0 @@
-/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License, version 2.0,
-as published by the Free Software Foundation.
-
-This program is also distributed with certain software (including
-but not limited to OpenSSL) that is licensed under separate terms,
-as designated in a particular file or component or in included license
-documentation. The authors of MySQL hereby grant you an additional
-permission to link the program and your derivative works with the
-separately licensed software that they have included with MySQL.
-
-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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA
-*/
-
-#ifndef MYSQL_SOCKET_H
-#define MYSQL_SOCKET_H
-
-/* For strlen() */
-#include
-/* For MY_STAT */
-#include
-/* For my_chsize */
-#include
-/* For socket api */
-#ifdef _WIN32
- #include
- #include
- #include
- #define SOCKBUF_T char
-#else
- #include
- #define SOCKBUF_T void
-#endif
-/**
- @file mysql/psi/mysql_socket.h
-[...]
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_SOCKET_CALL
-#define PSI_SOCKET_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Socket_instrumentation Socket Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_socket_register(P1, P2, P3)
- Socket registration.
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_register(P1, P2, P3) \
- inline_mysql_socket_register(P1, P2, P3)
-#else
- #define mysql_socket_register(P1, P2, P3) \
- do {} while (0)
-#endif
-
-/** An instrumented socket. */
-struct st_mysql_socket
-{
- /** The real socket descriptor. */
- my_socket fd;
-
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c MYSQL_SOCKET interface.
- */
- struct PSI_socket *m_psi;
-};
-
-/**
- An instrumented socket.
- @c MYSQL_SOCKET is a replacement for @c my_socket.
-*/
-typedef struct st_mysql_socket MYSQL_SOCKET;
-
-
-/**
- @def MYSQL_INVALID_SOCKET
- MYSQL_SOCKET initial value.
-*/
-//MYSQL_SOCKET MYSQL_INVALID_SOCKET= {INVALID_SOCKET, NULL};
-#define MYSQL_INVALID_SOCKET mysql_socket_invalid()
-
-/**
- MYSQL_SOCKET helper. Initialize instrumented socket.
- @sa mysql_socket_getfd
- @sa mysql_socket_setfd
-*/
-static inline MYSQL_SOCKET
-mysql_socket_invalid()
-{
- MYSQL_SOCKET mysql_socket= {INVALID_SOCKET, NULL};
- return mysql_socket;
-}
-
-/**
- Set socket descriptor and address.
- @param socket nstrumented socket
- @param addr unformatted socket address
- @param addr_len length of socket addres
-*/
-
-static inline void
-mysql_socket_set_address(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- MYSQL_SOCKET socket,
- const struct sockaddr *addr,
- socklen_t addr_len
-#else
- MYSQL_SOCKET socket MY_ATTRIBUTE ((unused)),
- const struct sockaddr *addr MY_ATTRIBUTE ((unused)),
- socklen_t addr_len MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (socket.m_psi != NULL)
- PSI_SOCKET_CALL(set_socket_info)(socket.m_psi, NULL, addr, addr_len);
-#endif
-}
-
-/**
- Set socket descriptor and address.
- @param socket instrumented socket
-*/
-static inline void
-mysql_socket_set_thread_owner(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
-MYSQL_SOCKET socket
-#else
-MYSQL_SOCKET socket MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (socket.m_psi != NULL)
- PSI_SOCKET_CALL(set_socket_thread_owner)(socket.m_psi);
-#endif
-}
-
-/**
- MYSQL_SOCKET helper. Get socket descriptor.
- @param mysql_socket Instrumented socket
- @sa mysql_socket_setfd
-*/
-static inline my_socket
-mysql_socket_getfd(MYSQL_SOCKET mysql_socket)
-{
- return mysql_socket.fd;
-}
-
-/**
- MYSQL_SOCKET helper. Set socket descriptor.
- @param mysql_socket Instrumented socket
- @param fd Socket descriptor
- @sa mysql_socket_getfd
-*/
-static inline void
-mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd)
-{
- if (likely(mysql_socket != NULL))
- mysql_socket->fd= fd;
-}
-
-/**
- @def MYSQL_SOCKET_WAIT_VARIABLES
- Instrumentation helper for socket waits.
- This instrumentation declares local variables.
- Do not use a ';' after this macro
- @param LOCKER locker
- @param STATE locker state
- @sa MYSQL_START_SOCKET_WAIT.
- @sa MYSQL_END_SOCKET_WAIT.
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE) \
- struct PSI_socket_locker* LOCKER; \
- PSI_socket_locker_state STATE;
-#else
- #define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE)
-#endif
-
-/**
- @def MYSQL_START_SOCKET_WAIT
- Instrumentation helper for socket waits.
- This instrumentation marks the start of a wait event.
- @param LOCKER locker
- @param STATE locker state
- @param SOCKET instrumented socket
- @param OP The socket operation to be performed
- @param COUNT bytes to be written/read
- @sa MYSQL_END_SOCKET_WAIT.
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
- LOCKER= inline_mysql_start_socket_wait(STATE, SOCKET, OP, COUNT,\
- __FILE__, __LINE__)
-#else
- #define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
- do {} while (0)
-#endif
-
-/**
- @def MYSQL_END_SOCKET_WAIT
- Instrumentation helper for socket waits.
- This instrumentation marks the end of a wait event.
- @param LOCKER locker
- @param COUNT actual bytes written/read, or -1
- @sa MYSQL_START_SOCKET_WAIT.
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
- inline_mysql_end_socket_wait(LOCKER, COUNT)
-#else
- #define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
- do {} while (0)
-#endif
-
-/**
- @def MYSQL_SOCKET_SET_STATE
- Set the state (IDLE, ACTIVE) of an instrumented socket.
- @param SOCKET the instrumented socket
- @param STATE the new state
- @sa PSI_socket_state
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
- inline_mysql_socket_set_state(SOCKET, STATE)
-#else
- #define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
-/**
- Instrumentation calls for MYSQL_START_SOCKET_WAIT.
- @sa MYSQL_START_SOCKET_WAIT.
-*/
-static inline struct PSI_socket_locker*
-inline_mysql_start_socket_wait(PSI_socket_locker_state *state,
- MYSQL_SOCKET mysql_socket,
- enum PSI_socket_operation op,
- size_t byte_count,
- const char *src_file, int src_line)
-{
- struct PSI_socket_locker *locker;
- if (mysql_socket.m_psi != NULL)
- {
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (state, mysql_socket.m_psi, op, byte_count, src_file, src_line);
- }
- else
- locker= NULL;
- return locker;
-}
-
-/**
- Instrumentation calls for MYSQL_END_SOCKET_WAIT.
- @sa MYSQL_END_SOCKET_WAIT.
-*/
-static inline void
-inline_mysql_end_socket_wait(struct PSI_socket_locker *locker, size_t byte_count)
-{
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, byte_count);
-}
-
-/**
- Set the state (IDLE, ACTIVE) of an instrumented socket.
- @param socket the instrumented socket
- @param state the new state
- @sa PSI_socket_state
-*/
-static inline void
-inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state)
-{
- if (socket.m_psi != NULL)
- PSI_SOCKET_CALL(set_socket_state)(socket.m_psi, state);
-}
-#endif /* HAVE_PSI_SOCKET_INTERFACE */
-
-/**
- @def mysql_socket_socket(K, D, T, P)
- Create a socket.
- @c mysql_socket_socket is a replacement for @c socket.
- @param K PSI_socket_key for this instrumented socket
- @param D Socket domain
- @param T Protocol type
- @param P Transport protocol
-*/
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_socket(K, D, T, P) \
- inline_mysql_socket_socket(K, D, T, P)
-#else
- #define mysql_socket_socket(K, D, T, P) \
- inline_mysql_socket_socket(D, T, P)
-#endif
-
-/**
- @def mysql_socket_bind(FD, AP, L)
- Bind a socket to a local port number and IP address
- @c mysql_socket_bind is a replacement for @c bind.
- @param FD Instrumented socket descriptor returned by socket()
- @param AP Pointer to local port number and IP address in sockaddr structure
- @param L Length of sockaddr structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_bind(FD, AP, L) \
- inline_mysql_socket_bind(__FILE__, __LINE__, FD, AP, L)
-#else
- #define mysql_socket_bind(FD, AP, L) \
- inline_mysql_socket_bind(FD, AP, L)
-#endif
-
-/**
- @def mysql_socket_getsockname(FD, AP, LP)
- Return port number and IP address of the local host
- @c mysql_socket_getsockname is a replacement for @c getsockname.
- @param FD Instrumented socket descriptor returned by socket()
- @param AP Pointer to returned address of local host in @c sockaddr structure
- @param LP Pointer to length of @c sockaddr structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_getsockname(FD, AP, LP) \
- inline_mysql_socket_getsockname(__FILE__, __LINE__, FD, AP, LP)
-#else
- #define mysql_socket_getsockname(FD, AP, LP) \
- inline_mysql_socket_getsockname(FD, AP, LP)
-#endif
-
-/**
- @def mysql_socket_connect(FD, AP, L)
- Establish a connection to a remote host.
- @c mysql_socket_connect is a replacement for @c connect.
- @param FD Instrumented socket descriptor returned by socket()
- @param AP Pointer to target address in sockaddr structure
- @param L Length of sockaddr structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_connect(FD, AP, L) \
- inline_mysql_socket_connect(__FILE__, __LINE__, FD, AP, L)
-#else
- #define mysql_socket_connect(FD, AP, L) \
- inline_mysql_socket_connect(FD, AP, L)
-#endif
-
-/**
- @def mysql_socket_getpeername(FD, AP, LP)
- Get port number and IP address of remote host that a socket is connected to.
- @c mysql_socket_getpeername is a replacement for @c getpeername.
- @param FD Instrumented socket descriptor returned by socket() or accept()
- @param AP Pointer to returned address of remote host in sockaddr structure
- @param LP Pointer to length of sockaddr structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_getpeername(FD, AP, LP) \
- inline_mysql_socket_getpeername(__FILE__, __LINE__, FD, AP, LP)
-#else
- #define mysql_socket_getpeername(FD, AP, LP) \
- inline_mysql_socket_getpeername(FD, AP, LP)
-#endif
-
-/**
- @def mysql_socket_send(FD, B, N, FL)
- Send data from the buffer, B, to a connected socket.
- @c mysql_socket_send is a replacement for @c send.
- @param FD Instrumented socket descriptor returned by socket() or accept()
- @param B Buffer to send
- @param N Number of bytes to send
- @param FL Control flags
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_send(FD, B, N, FL) \
- inline_mysql_socket_send(__FILE__, __LINE__, FD, B, N, FL)
-#else
- #define mysql_socket_send(FD, B, N, FL) \
- inline_mysql_socket_send(FD, B, N, FL)
-#endif
-
-/**
- @def mysql_socket_recv(FD, B, N, FL)
- Receive data from a connected socket.
- @c mysql_socket_recv is a replacement for @c recv.
- @param FD Instrumented socket descriptor returned by socket() or accept()
- @param B Buffer to receive to
- @param N Maximum bytes to receive
- @param FL Control flags
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_recv(FD, B, N, FL) \
- inline_mysql_socket_recv(__FILE__, __LINE__, FD, B, N, FL)
-#else
- #define mysql_socket_recv(FD, B, N, FL) \
- inline_mysql_socket_recv(FD, B, N, FL)
-#endif
-
-/**
- @def mysql_socket_sendto(FD, B, N, FL, AP, L)
- Send data to a socket at the specified address.
- @c mysql_socket_sendto is a replacement for @c sendto.
- @param FD Instrumented socket descriptor returned by socket()
- @param B Buffer to send
- @param N Number of bytes to send
- @param FL Control flags
- @param AP Pointer to destination sockaddr structure
- @param L Size of sockaddr structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_sendto(FD, B, N, FL, AP, L) \
- inline_mysql_socket_sendto(__FILE__, __LINE__, FD, B, N, FL, AP, L)
-#else
- #define mysql_socket_sendto(FD, B, N, FL, AP, L) \
- inline_mysql_socket_sendto(FD, B, N, FL, AP, L)
-#endif
-
-/**
- @def mysql_socket_recvfrom(FD, B, N, FL, AP, L)
- Receive data from a socket and return source address information
- @c mysql_socket_recvfrom is a replacement for @c recvfrom.
- @param FD Instrumented socket descriptor returned by socket()
- @param B Buffer to receive to
- @param N Maximum bytes to receive
- @param FL Control flags
- @param AP Pointer to source address in sockaddr_storage structure
- @param LP Size of sockaddr_storage structure
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
- inline_mysql_socket_recvfrom(__FILE__, __LINE__, FD, B, N, FL, AP, LP)
-#else
- #define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
- inline_mysql_socket_recvfrom(FD, B, N, FL, AP, LP)
-#endif
-
-/**
- @def mysql_socket_getsockopt(FD, LV, ON, OP, OL)
- Get a socket option for the specified socket.
- @c mysql_socket_getsockopt is a replacement for @c getsockopt.
- @param FD Instrumented socket descriptor returned by socket()
- @param LV Protocol level
- @param ON Option to query
- @param OP Buffer which will contain the value for the requested option
- @param OL Pointer to length of OP
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
- inline_mysql_socket_getsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
-#else
- #define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
- inline_mysql_socket_getsockopt(FD, LV, ON, OP, OL)
-#endif
-
-/**
- @def mysql_socket_setsockopt(FD, LV, ON, OP, OL)
- Set a socket option for the specified socket.
- @c mysql_socket_setsockopt is a replacement for @c setsockopt.
- @param FD Instrumented socket descriptor returned by socket()
- @param LV Protocol level
- @param ON Option to modify
- @param OP Buffer containing the value for the specified option
- @param OL Pointer to length of OP
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
- inline_mysql_socket_setsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
-#else
- #define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
- inline_mysql_socket_setsockopt(FD, LV, ON, OP, OL)
-#endif
-
-/**
- @def mysql_sock_set_nonblocking
- Set socket to non-blocking.
- @param FD instrumented socket descriptor
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_sock_set_nonblocking(FD) \
- inline_mysql_sock_set_nonblocking(__FILE__, __LINE__, FD)
-#else
- #define mysql_sock_set_nonblocking(FD) \
- inline_mysql_sock_set_nonblocking(FD)
-#endif
-
-/**
- @def mysql_socket_listen(FD, N)
- Set socket state to listen for an incoming connection.
- @c mysql_socket_listen is a replacement for @c listen.
- @param FD Instrumented socket descriptor, bound and connected
- @param N Maximum number of pending connections allowed.
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_listen(FD, N) \
- inline_mysql_socket_listen(__FILE__, __LINE__, FD, N)
-#else
- #define mysql_socket_listen(FD, N) \
- inline_mysql_socket_listen(FD, N)
-#endif
-
-/**
- @def mysql_socket_accept(K, FD, AP, LP)
- Accept a connection from any remote host; TCP only.
- @c mysql_socket_accept is a replacement for @c accept.
- @param K PSI_socket_key for this instrumented socket
- @param FD Instrumented socket descriptor, bound and placed in a listen state
- @param AP Pointer to sockaddr structure with returned IP address and port of connected host
- @param LP Pointer to length of valid information in AP
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_accept(K, FD, AP, LP) \
- inline_mysql_socket_accept(__FILE__, __LINE__, K, FD, AP, LP)
-#else
- #define mysql_socket_accept(K, FD, AP, LP) \
- inline_mysql_socket_accept(FD, AP, LP)
-#endif
-
-/**
- @def mysql_socket_close(FD)
- Close a socket and sever any connections.
- @c mysql_socket_close is a replacement for @c close.
- @param FD Instrumented socket descriptor returned by socket() or accept()
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_close(FD) \
- inline_mysql_socket_close(__FILE__, __LINE__, FD)
-#else
- #define mysql_socket_close(FD) \
- inline_mysql_socket_close(FD)
-#endif
-
-/**
- @def mysql_socket_shutdown(FD, H)
- Disable receives and/or sends on a socket.
- @c mysql_socket_shutdown is a replacement for @c shutdown.
- @param FD Instrumented socket descriptor returned by socket() or accept()
- @param H Specifies which operations to shutdown
-*/
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- #define mysql_socket_shutdown(FD, H) \
- inline_mysql_socket_shutdown(__FILE__, __LINE__, FD, H)
-#else
- #define mysql_socket_shutdown(FD, H) \
- inline_mysql_socket_shutdown(FD, H)
-#endif
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
-static inline void inline_mysql_socket_register(
- const char *category,
- PSI_socket_info *info,
- int count)
-{
- PSI_SOCKET_CALL(register_socket)(category, info, count);
-}
-#endif
-
-/** mysql_socket_socket */
-
-static inline MYSQL_SOCKET
-inline_mysql_socket_socket
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- PSI_socket_key key,
-#endif
- int domain, int type, int protocol)
-{
- MYSQL_SOCKET mysql_socket= MYSQL_INVALID_SOCKET;
- mysql_socket.fd= socket(domain, type, protocol);
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (likely(mysql_socket.fd != INVALID_SOCKET))
- {
- mysql_socket.m_psi= PSI_SOCKET_CALL(init_socket)
- (key, (const my_socket*)&mysql_socket.fd, NULL, 0);
- }
-#endif
- return mysql_socket;
-}
-
-/** mysql_socket_bind */
-
-static inline int
-inline_mysql_socket_bind
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker_state state;
- PSI_socket_locker *locker;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= bind(mysql_socket.fd, addr, len);
-
- /* Instrumentation end */
- if (result == 0)
- PSI_SOCKET_CALL(set_socket_info)(mysql_socket.m_psi, NULL, addr, len);
-
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= bind(mysql_socket.fd, addr, len);
- return result;
-}
-
-/** mysql_socket_getsockname */
-
-static inline int
-inline_mysql_socket_getsockname
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= getsockname(mysql_socket.fd, addr, len);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= getsockname(mysql_socket.fd, addr, len);
-
- return result;
-}
-
-/** mysql_socket_connect */
-
-static inline int
-inline_mysql_socket_connect
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= connect(mysql_socket.fd, addr, len);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= connect(mysql_socket.fd, addr, len);
-
- return result;
-}
-
-/** mysql_socket_getpeername */
-
-static inline int
-inline_mysql_socket_getpeername
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_BIND, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= getpeername(mysql_socket.fd, addr, len);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= getpeername(mysql_socket.fd, addr, len);
-
- return result;
-}
-
-/** mysql_socket_send */
-
-static inline ssize_t
-inline_mysql_socket_send
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags)
-{
- ssize_t result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_SEND, n, src_file, src_line);
-
- /* Instrumented code */
- result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
-
- /* Instrumentation end */
- if (locker != NULL)
- {
- size_t bytes_written;
- bytes_written= (result > -1) ? result : 0;
- PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
- }
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
-
- return result;
-}
-
-/** mysql_socket_recv */
-
-static inline ssize_t
-inline_mysql_socket_recv
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags)
-{
- ssize_t result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_RECV, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
-
- /* Instrumentation end */
- if (locker != NULL)
- {
- size_t bytes_read;
- bytes_read= (result > -1) ? result : 0;
- PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
- }
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
-
- return result;
-}
-
-/** mysql_socket_sendto */
-
-static inline ssize_t
-inline_mysql_socket_sendto
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags, const struct sockaddr *addr, socklen_t addr_len)
-{
- ssize_t result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_SEND, n, src_file, src_line);
-
- /* Instrumented code */
- result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
-
- /* Instrumentation end */
- if (locker != NULL)
- {
- size_t bytes_written;
- bytes_written = (result > -1) ? result : 0;
- PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_written);
- }
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
-
- return result;
-}
-
-/** mysql_socket_recvfrom */
-
-static inline ssize_t
-inline_mysql_socket_recvfrom
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags,
- struct sockaddr *addr, socklen_t *addr_len)
-{
- ssize_t result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_RECV, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
-
- /* Instrumentation end */
- if (locker != NULL)
- {
- size_t bytes_read;
- bytes_read = (result > -1) ? result : 0;
- PSI_SOCKET_CALL(end_socket_wait)(locker, bytes_read);
- }
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
-
- return result;
-}
-
-/** mysql_socket_getsockopt */
-
-static inline int
-inline_mysql_socket_getsockopt
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, int level, int optname, SOCKBUF_T *optval, socklen_t *optlen)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_OPT, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= getsockopt(mysql_socket.fd, level, optname, optval, optlen);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= getsockopt(mysql_socket.fd, level, optname, optval, optlen);
-
- return result;
-}
-
-/** mysql_socket_setsockopt */
-
-static inline int
-inline_mysql_socket_setsockopt
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, int level, int optname, const SOCKBUF_T *optval,
- socklen_t optlen)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_OPT, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= setsockopt(mysql_socket.fd, level, optname, optval, optlen);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= setsockopt(mysql_socket.fd, level, optname, optval, optlen);
-
- return result;
-}
-
-/** set_socket_nonblock */
-static inline int
-set_socket_nonblock(my_socket fd)
-{
- int ret= 0;
-#ifdef _WIN32
- {
- u_long nonblocking= 1;
- ret= ioctlsocket(fd, FIONBIO, &nonblocking);
- }
-#else
- {
- int fd_flags;
- fd_flags= fcntl(fd, F_GETFL, 0);
- if (fd_flags < 0)
- return errno;
-#if defined(O_NONBLOCK)
- fd_flags |= O_NONBLOCK;
-#elif defined(O_NDELAY)
- fd_flags |= O_NDELAY;
-#elif defined(O_FNDELAY)
- fd_flags |= O_FNDELAY;
-#else
-#error "No definition of non-blocking flag found."
-#endif /* O_NONBLOCK */
- if (fcntl(fd, F_SETFL, fd_flags) == -1)
- ret= errno;
- }
-#endif /* _WIN32 */
- return ret;
-}
-
-/** mysql_socket_set_nonblocking */
-
-static inline int
-inline_mysql_sock_set_nonblocking
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket
-)
-{
- int result= 0;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_OPT,
- (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= set_socket_nonblock(mysql_socket.fd);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= set_socket_nonblock(mysql_socket.fd);
-
- return result;
-}
-
-/** mysql_socket_listen */
-
-static inline int
-inline_mysql_socket_listen
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, int backlog)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= listen(mysql_socket.fd, backlog);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= listen(mysql_socket.fd, backlog);
-
- return result;
-}
-
-/** mysql_socket_accept */
-
-static inline MYSQL_SOCKET
-inline_mysql_socket_accept
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line, PSI_socket_key key,
-#endif
- MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
-{
- MYSQL_SOCKET socket_accept= MYSQL_INVALID_SOCKET;
- socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (socket_listen.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, socket_listen.m_psi, PSI_SOCKET_CONNECT, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
- }
- else
-#endif
- {
- /* Non instrumented code */
- socket_accept.fd= accept(socket_listen.fd, addr, &addr_length);
- }
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (likely(socket_accept.fd != INVALID_SOCKET))
- {
- /* Initialize the instrument with the new socket descriptor and address */
- socket_accept.m_psi= PSI_SOCKET_CALL(init_socket)
- (key, (const my_socket*)&socket_accept.fd, addr, addr_length);
- }
-#endif
-
- return socket_accept;
-}
-
-/** mysql_socket_close */
-
-static inline int
-inline_mysql_socket_close
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket)
-{
- int result;
-
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_CLOSE, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
- result= closesocket(mysql_socket.fd);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
- /* Remove the instrumentation for this socket. */
- if (mysql_socket.m_psi != NULL)
- PSI_SOCKET_CALL(destroy_socket)(mysql_socket.m_psi);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= closesocket(mysql_socket.fd);
-
- return result;
-}
-
-/** mysql_socket_shutdown */
-
-static inline int
-inline_mysql_socket_shutdown
-(
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- const char *src_file, uint src_line,
-#endif
- MYSQL_SOCKET mysql_socket, int how)
-{
- int result;
-
-#ifdef _WIN32
- static LPFN_DISCONNECTEX DisconnectEx = NULL;
- if (DisconnectEx == NULL)
- {
- DWORD dwBytesReturned;
- GUID guidDisconnectEx = WSAID_DISCONNECTEX;
- WSAIoctl(mysql_socket.fd, SIO_GET_EXTENSION_FUNCTION_POINTER,
- &guidDisconnectEx, sizeof(GUID),
- &DisconnectEx, sizeof(DisconnectEx),
- &dwBytesReturned, NULL, NULL);
- }
-#endif
-
-/* Instrumentation start */
-#ifdef HAVE_PSI_SOCKET_INTERFACE
- if (mysql_socket.m_psi != NULL)
- {
- PSI_socket_locker *locker;
- PSI_socket_locker_state state;
- locker= PSI_SOCKET_CALL(start_socket_wait)
- (&state, mysql_socket.m_psi, PSI_SOCKET_SHUTDOWN, (size_t)0, src_file, src_line);
-
- /* Instrumented code */
-#ifdef _WIN32
- if (DisconnectEx)
- result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL,
- (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1;
- else
-#endif
- result= shutdown(mysql_socket.fd, how);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_SOCKET_CALL(end_socket_wait)(locker, (size_t)0);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
-#ifdef _WIN32
- if (DisconnectEx)
- result= (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED) NULL,
- (DWORD) 0, (DWORD) 0) == TRUE) ? 0 : -1;
- else
-#endif
- result= shutdown(mysql_socket.fd, how);
-
- return result;
-}
-
-/** @} (end of group Socket_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_sp.h b/code/mysql/mysql/psi/mysql_sp.h
deleted file mode 100644
index 5eeea37..0000000
--- a/code/mysql/mysql/psi/mysql_sp.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SP_H
-#define MYSQL_SP_H
-
-/**
- @file mysql/psi/mysql_sp.h
- Instrumentation helpers for stored programs.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_SP_CALL
-#define PSI_SP_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifdef HAVE_PSI_SP_INTERFACE
- #define MYSQL_START_SP(STATE, SP_SHARE) \
- inline_mysql_start_sp(STATE, SP_SHARE)
-#else
- #define MYSQL_START_SP(STATE, SP_SHARE) \
- NULL
-#endif
-
-
-#ifdef HAVE_PSI_SP_INTERFACE
- #define MYSQL_END_SP(LOCKER) \
- inline_mysql_end_sp(LOCKER)
-#else
- #define MYSQL_END_SP(LOCKER) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_SP_INTERFACE
- #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
- inline_mysql_drop_sp(OT, SN, SNL, ON, ONL)
-#else
- #define MYSQL_DROP_SP(OT, SN, SNL, ON, ONL) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_SP_INTERFACE
- #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
- inline_mysql_get_sp_share(OT, SN, SNL, ON, ONL)
-#else
- #define MYSQL_GET_SP_SHARE(OT, SN, SNL, ON, ONL) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_SP_INTERFACE
-static inline struct PSI_sp_locker*
-inline_mysql_start_sp(PSI_sp_locker_state *state, PSI_sp_share *sp_share)
-{
- return PSI_SP_CALL(start_sp)(state, sp_share);
-}
-
-static inline void inline_mysql_end_sp(PSI_sp_locker *locker)
-{
- if (likely(locker != NULL))
- PSI_SP_CALL(end_sp)(locker);
-}
-
-static inline void
-inline_mysql_drop_sp(uint sp_type,
- const char* schema_name, uint shcema_name_length,
- const char* object_name, uint object_name_length)
-{
- PSI_SP_CALL(drop_sp)(sp_type,
- schema_name, shcema_name_length,
- object_name, object_name_length);
-}
-
-static inline PSI_sp_share*
-inline_mysql_get_sp_share(uint sp_type,
- const char* schema_name, uint shcema_name_length,
- const char* object_name, uint object_name_length)
-{
- return PSI_SP_CALL(get_sp_share)(sp_type,
- schema_name, shcema_name_length,
- object_name, object_name_length);
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/psi/mysql_stage.h b/code/mysql/mysql/psi/mysql_stage.h
deleted file mode 100644
index fa6dbc2..0000000
--- a/code/mysql/mysql/psi/mysql_stage.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_STAGE_H
-#define MYSQL_STAGE_H
-
-/**
- @file mysql/psi/mysql_stage.h
- Instrumentation helpers for stages.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_STAGE_CALL
-#define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Stage_instrumentation Stage Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_stage_register(P1, P2, P3)
- Stage registration.
-*/
-#ifdef HAVE_PSI_STAGE_INTERFACE
-#define mysql_stage_register(P1, P2, P3) \
- inline_mysql_stage_register(P1, P2, P3)
-#else
-#define mysql_stage_register(P1, P2, P3) \
- do {} while (0)
-#endif
-
-/**
- @def MYSQL_SET_STAGE
- Set the current stage.
- Use this API when the file and line
- is passed from the caller.
- @param K the stage key
- @param F the source file name
- @param L the source file line
- @return the current stage progress
-*/
-#ifdef HAVE_PSI_STAGE_INTERFACE
- #define MYSQL_SET_STAGE(K, F, L) \
- inline_mysql_set_stage(K, F, L)
-#else
- #define MYSQL_SET_STAGE(K, F, L) \
- NULL
-#endif
-
-/**
- @def mysql_set_stage
- Set the current stage.
- @param K the stage key
- @return the current stage progress
-*/
-#ifdef HAVE_PSI_STAGE_INTERFACE
- #define mysql_set_stage(K) \
- inline_mysql_set_stage(K, __FILE__, __LINE__)
-#else
- #define mysql_set_stage(K) \
- NULL
-#endif
-
-/**
- @def mysql_end_stage
- End the last stage
-*/
-#ifdef HAVE_PSI_STAGE_INTERFACE
- #define mysql_end_stage \
- inline_mysql_end_stage
-#else
- #define mysql_end_stage \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline void inline_mysql_stage_register(
- const char *category, PSI_stage_info **info, int count)
-{
- PSI_STAGE_CALL(register_stage)(category, info, count);
-}
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline PSI_stage_progress*
-inline_mysql_set_stage(PSI_stage_key key,
- const char *src_file, int src_line)
-{
- return PSI_STAGE_CALL(start_stage)(key, src_file, src_line);
-}
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline void
-inline_mysql_end_stage()
-{
- PSI_STAGE_CALL(end_stage)();
-}
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-#define mysql_stage_set_work_completed(P1, P2) \
- inline_mysql_stage_set_work_completed(P1, P2)
-
-#define mysql_stage_get_work_completed(P1) \
- inline_mysql_stage_get_work_completed(P1)
-#else
-#define mysql_stage_set_work_completed(P1, P2) \
- do {} while (0)
-
-#define mysql_stage_get_work_completed(P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-#define mysql_stage_inc_work_completed(P1, P2) \
- inline_mysql_stage_inc_work_completed(P1, P2)
-#else
-#define mysql_stage_inc_work_completed(P1, P2) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-#define mysql_stage_set_work_estimated(P1, P2) \
- inline_mysql_stage_set_work_estimated(P1, P2)
-
-#define mysql_stage_get_work_estimated(P1) \
- inline_mysql_stage_get_work_estimated(P1)
-#else
-#define mysql_stage_set_work_estimated(P1, P2) \
- do {} while (0)
-
-#define mysql_stage_get_work_estimated(P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline void
-inline_mysql_stage_set_work_completed(PSI_stage_progress *progress,
- ulonglong val)
-{
- if (progress != NULL)
- progress->m_work_completed= val;
-}
-
-static inline ulonglong
-inline_mysql_stage_get_work_completed(PSI_stage_progress *progress)
-{
- return progress->m_work_completed;
-}
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline void
-inline_mysql_stage_inc_work_completed(PSI_stage_progress *progress,
- ulonglong val)
-{
- if (progress != NULL)
- progress->m_work_completed+= val;
-}
-#endif
-
-#ifdef HAVE_PSI_STAGE_INTERFACE
-static inline void
-inline_mysql_stage_set_work_estimated(PSI_stage_progress *progress,
- ulonglong val)
-{
- if (progress != NULL)
- progress->m_work_estimated= val;
-}
-
-static inline ulonglong
-inline_mysql_stage_get_work_estimated(PSI_stage_progress *progress)
-{
- return progress->m_work_estimated;
-}
-#endif
-
-/** @} (end of group Stage_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_statement.h b/code/mysql/mysql/psi/mysql_statement.h
deleted file mode 100644
index 597d152..0000000
--- a/code/mysql/mysql/psi/mysql_statement.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_STATEMENT_H
-#define MYSQL_STATEMENT_H
-
-/**
- @file mysql/psi/mysql_statement.h
- Instrumentation helpers for statements.
-*/
-
-#include "mysql/psi/psi.h"
-
-class Diagnostics_area;
-typedef struct charset_info_st CHARSET_INFO;
-
-#ifndef PSI_STATEMENT_CALL
-#define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifndef PSI_DIGEST_CALL
-#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Statement_instrumentation Statement Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def mysql_statement_register(P1, P2, P3)
- Statement registration.
-*/
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
-#define mysql_statement_register(P1, P2, P3) \
- inline_mysql_statement_register(P1, P2, P3)
-#else
-#define mysql_statement_register(P1, P2, P3) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
- #define MYSQL_DIGEST_START(LOCKER) \
- inline_mysql_digest_start(LOCKER)
-#else
- #define MYSQL_DIGEST_START(LOCKER) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
- #define MYSQL_DIGEST_END(LOCKER, DIGEST) \
- inline_mysql_digest_end(LOCKER, DIGEST)
-#else
- #define MYSQL_DIGEST_END(LOCKER, DIGEST) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
- inline_mysql_start_statement(STATE, K, DB, DB_LEN, CS, SPS, __FILE__, __LINE__)
-#else
- #define MYSQL_START_STATEMENT(STATE, K, DB, DB_LEN, CS, SPS) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_REFINE_STATEMENT(LOCKER, K) \
- inline_mysql_refine_statement(LOCKER, K)
-#else
- #define MYSQL_REFINE_STATEMENT(LOCKER, K) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
- inline_mysql_set_statement_text(LOCKER, P1, P2)
-#else
- #define MYSQL_SET_STATEMENT_TEXT(LOCKER, P1, P2) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
- inline_mysql_set_statement_lock_time(LOCKER, P1)
-#else
- #define MYSQL_SET_STATEMENT_LOCK_TIME(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
- inline_mysql_set_statement_rows_sent(LOCKER, P1)
-#else
- #define MYSQL_SET_STATEMENT_ROWS_SENT(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
- inline_mysql_set_statement_rows_examined(LOCKER, P1)
-#else
- #define MYSQL_SET_STATEMENT_ROWS_EXAMINED(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
- #define MYSQL_END_STATEMENT(LOCKER, DA) \
- inline_mysql_end_statement(LOCKER, DA)
-#else
- #define MYSQL_END_STATEMENT(LOCKER, DA) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_INTERFACE
-static inline void inline_mysql_statement_register(
- const char *category, PSI_statement_info *info, int count)
-{
- PSI_STATEMENT_CALL(register_statement)(category, info, count);
-}
-
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-static inline struct PSI_digest_locker *
-inline_mysql_digest_start(PSI_statement_locker *locker)
-{
- PSI_digest_locker* digest_locker= NULL;
-
- if (likely(locker != NULL))
- digest_locker= PSI_DIGEST_CALL(digest_start)(locker);
- return digest_locker;
-}
-#endif
-
-#ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-static inline void
-inline_mysql_digest_end(PSI_digest_locker *locker, const sql_digest_storage *digest)
-{
- if (likely(locker != NULL))
- PSI_DIGEST_CALL(digest_end)(locker, digest);
-}
-#endif
-
-static inline struct PSI_statement_locker *
-inline_mysql_start_statement(PSI_statement_locker_state *state,
- PSI_statement_key key,
- const char *db, uint db_len,
- const CHARSET_INFO *charset,
- PSI_sp_share *sp_share,
- const char *src_file, int src_line)
-{
- PSI_statement_locker *locker;
- locker= PSI_STATEMENT_CALL(get_thread_statement_locker)(state, key, charset,
- sp_share);
- if (likely(locker != NULL))
- PSI_STATEMENT_CALL(start_statement)(locker, db, db_len, src_file, src_line);
- return locker;
-}
-
-static inline struct PSI_statement_locker *
-inline_mysql_refine_statement(PSI_statement_locker *locker,
- PSI_statement_key key)
-{
- if (likely(locker != NULL))
- {
- locker= PSI_STATEMENT_CALL(refine_statement)(locker, key);
- }
- return locker;
-}
-
-static inline void
-inline_mysql_set_statement_text(PSI_statement_locker *locker,
- const char *text, uint text_len)
-{
- if (likely(locker != NULL))
- {
- PSI_STATEMENT_CALL(set_statement_text)(locker, text, text_len);
- }
-}
-
-static inline void
-inline_mysql_set_statement_lock_time(PSI_statement_locker *locker,
- ulonglong count)
-{
- if (likely(locker != NULL))
- {
- PSI_STATEMENT_CALL(set_statement_lock_time)(locker, count);
- }
-}
-
-static inline void
-inline_mysql_set_statement_rows_sent(PSI_statement_locker *locker,
- ulonglong count)
-{
- if (likely(locker != NULL))
- {
- PSI_STATEMENT_CALL(set_statement_rows_sent)(locker, count);
- }
-}
-
-static inline void
-inline_mysql_set_statement_rows_examined(PSI_statement_locker *locker,
- ulonglong count)
-{
- if (likely(locker != NULL))
- {
- PSI_STATEMENT_CALL(set_statement_rows_examined)(locker, count);
- }
-}
-
-static inline void
-inline_mysql_end_statement(struct PSI_statement_locker *locker,
- Diagnostics_area *stmt_da)
-{
- PSI_STAGE_CALL(end_stage)();
- if (likely(locker != NULL))
- PSI_STATEMENT_CALL(end_statement)(locker, stmt_da);
-}
-#endif
-
-/** @} (end of group Statement_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_table.h b/code/mysql/mysql/psi/mysql_table.h
deleted file mode 100644
index bad0ae3..0000000
--- a/code/mysql/mysql/psi/mysql_table.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_TABLE_H
-#define MYSQL_TABLE_H
-
-/**
- @file mysql/psi/mysql_table.h
- Instrumentation helpers for table io.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_TABLE_CALL
-#define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Table_instrumentation Table Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- @def MYSQL_TABLE_WAIT_VARIABLES
- Instrumentation helper for table waits.
- This instrumentation declares local variables.
- Do not use a ';' after this macro
- @param LOCKER the locker
- @param STATE the locker state
- @sa MYSQL_START_TABLE_IO_WAIT.
- @sa MYSQL_END_TABLE_IO_WAIT.
- @sa MYSQL_START_TABLE_LOCK_WAIT.
- @sa MYSQL_END_TABLE_LOCK_WAIT.
-*/
-#ifdef HAVE_PSI_TABLE_INTERFACE
- #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \
- struct PSI_table_locker* LOCKER; \
- PSI_table_locker_state STATE;
-#else
- #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE)
-#endif
-
-/**
- @def MYSQL_START_TABLE_LOCK_WAIT
- Instrumentation helper for table lock waits.
- This instrumentation marks the start of a wait event.
- @param LOCKER the locker
- @param STATE the locker state
- @param PSI the instrumented table
- @param OP the table operation to be performed
- @param FLAGS per table operation flags.
- @sa MYSQL_END_TABLE_LOCK_WAIT.
-*/
-#ifdef HAVE_PSI_TABLE_INTERFACE
- #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
- LOCKER= inline_mysql_start_table_lock_wait(STATE, PSI, \
- OP, FLAGS, __FILE__, __LINE__)
-#else
- #define MYSQL_START_TABLE_LOCK_WAIT(LOCKER, STATE, PSI, OP, FLAGS) \
- do {} while (0)
-#endif
-
-/**
- @def MYSQL_END_TABLE_LOCK_WAIT
- Instrumentation helper for table lock waits.
- This instrumentation marks the end of a wait event.
- @param LOCKER the locker
- @sa MYSQL_START_TABLE_LOCK_WAIT.
-*/
-#ifdef HAVE_PSI_TABLE_INTERFACE
- #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
- inline_mysql_end_table_lock_wait(LOCKER)
-#else
- #define MYSQL_END_TABLE_LOCK_WAIT(LOCKER) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TABLE_INTERFACE
- #define MYSQL_UNLOCK_TABLE(T) \
- inline_mysql_unlock_table(T)
-#else
- #define MYSQL_UNLOCK_TABLE(T) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TABLE_INTERFACE
-/**
- Instrumentation calls for MYSQL_START_TABLE_LOCK_WAIT.
- @sa MYSQL_END_TABLE_LOCK_WAIT.
-*/
-static inline struct PSI_table_locker *
-inline_mysql_start_table_lock_wait(PSI_table_locker_state *state,
- struct PSI_table *psi,
- enum PSI_table_lock_operation op,
- ulong flags, const char *src_file, int src_line)
-{
- if (psi != NULL)
- {
- struct PSI_table_locker *locker;
- locker= PSI_TABLE_CALL(start_table_lock_wait)
- (state, psi, op, flags, src_file, src_line);
- return locker;
- }
- return NULL;
-}
-
-/**
- Instrumentation calls for MYSQL_END_TABLE_LOCK_WAIT.
- @sa MYSQL_START_TABLE_LOCK_WAIT.
-*/
-static inline void
-inline_mysql_end_table_lock_wait(struct PSI_table_locker *locker)
-{
- if (locker != NULL)
- PSI_TABLE_CALL(end_table_lock_wait)(locker);
-}
-
-static inline void
-inline_mysql_unlock_table(struct PSI_table *table)
-{
- if (table != NULL)
- PSI_TABLE_CALL(unlock_table)(table);
-}
-#endif
-
-/** @} (end of group Table_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_thread.h b/code/mysql/mysql/psi/mysql_thread.h
deleted file mode 100644
index 7f87192..0000000
--- a/code/mysql/mysql/psi/mysql_thread.h
+++ /dev/null
@@ -1,1330 +0,0 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_THREAD_H
-#define MYSQL_THREAD_H
-
-/**
- @file mysql/psi/mysql_thread.h
- Instrumentation helpers for mysys threads, mutexes,
- read write locks and conditions.
- This header file provides the necessary declarations
- to use the mysys thread API with the performance schema instrumentation.
- In some compilers (SunStudio), 'static inline' functions, when declared
- but not used, are not optimized away (because they are unused) by default,
- so that including a static inline function from a header file does
- create unwanted dependencies, causing unresolved symbols at link time.
- Other compilers, like gcc, optimize these dependencies by default.
-
- Since the instrumented APIs declared here are wrapper on top
- of my_thread / safemutex / etc APIs,
- including mysql/psi/mysql_thread.h assumes that
- the dependency on my_thread and safemutex already exists.
-*/
-/*
- Note: there are several orthogonal dimensions here.
-
- Dimension 1: Instrumentation
- HAVE_PSI_INTERFACE is defined when the instrumentation is compiled in.
- This may happen both in debug or production builds.
-
- Dimension 2: Debug
- SAFE_MUTEX is defined when debug is compiled in.
- This may happen both with and without instrumentation.
-
- Dimension 3: Platform
- Mutexes are implemented with one of:
- - the pthread library
- - fast mutexes
- - window apis
- This is implemented by various macro definitions in my_thread.h
-
- This causes complexity with '#ifdef'-ery that can't be avoided.
-*/
-
-#include "my_thread.h"
-#include "my_thread_local.h"
-#include "thr_mutex.h"
-#include "thr_rwlock.h"
-#include "mysql/psi/psi.h"
-#ifdef MYSQL_SERVER
-#ifndef MYSQL_DYNAMIC_PLUGIN
-#include "pfs_thread_provider.h"
-#endif
-#endif
-
-#ifndef PSI_MUTEX_CALL
-#define PSI_MUTEX_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifndef PSI_RWLOCK_CALL
-#define PSI_RWLOCK_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifndef PSI_COND_CALL
-#define PSI_COND_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-#ifndef PSI_THREAD_CALL
-#define PSI_THREAD_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Thread_instrumentation Thread Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- An instrumented mutex structure.
- @sa mysql_mutex_t
-*/
-struct st_mysql_mutex
-{
- /** The real mutex. */
- my_mutex_t m_mutex;
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c mysql_mutex_t interface.
- */
- struct PSI_mutex *m_psi;
-};
-
-/**
- Type of an instrumented mutex.
- @c mysql_mutex_t is a drop-in replacement for @c my_mutex_t.
- @sa mysql_mutex_assert_owner
- @sa mysql_mutex_assert_not_owner
- @sa mysql_mutex_init
- @sa mysql_mutex_lock
- @sa mysql_mutex_unlock
- @sa mysql_mutex_destroy
-*/
-typedef struct st_mysql_mutex mysql_mutex_t;
-
-/**
- An instrumented rwlock structure.
- @sa mysql_rwlock_t
-*/
-struct st_mysql_rwlock
-{
- /** The real rwlock */
- native_rw_lock_t m_rwlock;
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c mysql_rwlock_t interface.
- */
- struct PSI_rwlock *m_psi;
-};
-
-/**
- An instrumented prlock structure.
- @sa mysql_prlock_t
-*/
-struct st_mysql_prlock
-{
- /** The real prlock */
- rw_pr_lock_t m_prlock;
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c mysql_rwlock_t interface.
- */
- struct PSI_rwlock *m_psi;
-};
-
-/**
- Type of an instrumented rwlock.
- @c mysql_rwlock_t is a drop-in replacement for @c pthread_rwlock_t.
- @sa mysql_rwlock_init
- @sa mysql_rwlock_rdlock
- @sa mysql_rwlock_tryrdlock
- @sa mysql_rwlock_wrlock
- @sa mysql_rwlock_trywrlock
- @sa mysql_rwlock_unlock
- @sa mysql_rwlock_destroy
-*/
-typedef struct st_mysql_rwlock mysql_rwlock_t;
-
-/**
- Type of an instrumented prlock.
- A prlock is a read write lock that 'prefers readers' (pr).
- @c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t.
- @sa mysql_prlock_init
- @sa mysql_prlock_rdlock
- @sa mysql_prlock_wrlock
- @sa mysql_prlock_unlock
- @sa mysql_prlock_destroy
-*/
-typedef struct st_mysql_prlock mysql_prlock_t;
-
-/**
- An instrumented cond structure.
- @sa mysql_cond_t
-*/
-struct st_mysql_cond
-{
- /** The real condition */
- native_cond_t m_cond;
- /**
- The instrumentation hook.
- Note that this hook is not conditionally defined,
- for binary compatibility of the @c mysql_cond_t interface.
- */
- struct PSI_cond *m_psi;
-};
-
-/**
- Type of an instrumented condition.
- @c mysql_cond_t is a drop-in replacement for @c native_cond_t.
- @sa mysql_cond_init
- @sa mysql_cond_wait
- @sa mysql_cond_timedwait
- @sa mysql_cond_signal
- @sa mysql_cond_broadcast
- @sa mysql_cond_destroy
-*/
-typedef struct st_mysql_cond mysql_cond_t;
-
-/*
- Consider the following code:
- static inline void foo() { bar(); }
- when foo() is never called.
-
- With gcc, foo() is a local static function, so the dependencies
- are optimized away at compile time, and there is no dependency on bar().
- With other compilers (HP, Sun Studio), the function foo() implementation
- is compiled, and bar() needs to be present to link.
-
- Due to the existing header dependencies in MySQL code, this header file
- is sometime used when it is not needed, which in turn cause link failures
- on some platforms.
- The proper fix would be to cut these extra dependencies in the calling code.
- DISABLE_MYSQL_THREAD_H is a work around to limit dependencies.
- DISABLE_MYSQL_PRLOCK_H is similar, and is used to disable specifically
- the prlock wrappers.
-*/
-#ifndef DISABLE_MYSQL_THREAD_H
-
-/**
- @def mysql_mutex_assert_owner(M)
- Wrapper, to use safe_mutex_assert_owner with instrumented mutexes.
- @c mysql_mutex_assert_owner is a drop-in replacement
- for @c safe_mutex_assert_owner.
-*/
-#ifdef SAFE_MUTEX
-#define mysql_mutex_assert_owner(M) \
- safe_mutex_assert_owner(&(M)->m_mutex);
-#else
-#define mysql_mutex_assert_owner(M) { }
-#endif
-
-/**
- @def mysql_mutex_assert_not_owner(M)
- Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes.
- @c mysql_mutex_assert_not_owner is a drop-in replacement
- for @c safe_mutex_assert_not_owner.
-*/
-#ifdef SAFE_MUTEX
-#define mysql_mutex_assert_not_owner(M) \
- safe_mutex_assert_not_owner(&(M)->m_mutex);
-#else
-#define mysql_mutex_assert_not_owner(M) { }
-#endif
-
-/**
- @def mysql_prlock_assert_write_owner(M)
- Drop-in replacement
- for @c rw_pr_lock_assert_write_owner.
-*/
-#define mysql_prlock_assert_write_owner(M) \
- rw_pr_lock_assert_write_owner(&(M)->m_prlock)
-
-/**
- @def mysql_prlock_assert_not_write_owner(M)
- Drop-in replacement
- for @c rw_pr_lock_assert_not_write_owner.
-*/
-#define mysql_prlock_assert_not_write_owner(M) \
- rw_pr_lock_assert_not_write_owner(&(M)->m_prlock)
-
-/**
- @def mysql_mutex_register(P1, P2, P3)
- Mutex registration.
-*/
-#define mysql_mutex_register(P1, P2, P3) \
- inline_mysql_mutex_register(P1, P2, P3)
-
-/**
- @def mysql_mutex_init(K, M, A)
- Instrumented mutex_init.
- @c mysql_mutex_init is a replacement for @c pthread_mutex_init.
- @param K The PSI_mutex_key for this instrumented mutex
- @param M The mutex to initialize
- @param A Mutex attributes
-*/
-
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- #ifdef SAFE_MUTEX
- #define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__)
- #else
- #define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(K, M, A)
- #endif
-#else
- #ifdef SAFE_MUTEX
- #define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(M, A, __FILE__, __LINE__)
- #else
- #define mysql_mutex_init(K, M, A) \
- inline_mysql_mutex_init(M, A)
- #endif
-#endif
-
-/**
- @def mysql_mutex_destroy(M)
- Instrumented mutex_destroy.
- @c mysql_mutex_destroy is a drop-in replacement
- for @c pthread_mutex_destroy.
-*/
-#ifdef SAFE_MUTEX
- #define mysql_mutex_destroy(M) \
- inline_mysql_mutex_destroy(M, __FILE__, __LINE__)
-#else
- #define mysql_mutex_destroy(M) \
- inline_mysql_mutex_destroy(M)
-#endif
-
-/**
- @def mysql_mutex_lock(M)
- Instrumented mutex_lock.
- @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock.
- @param M The mutex to lock
-*/
-
-#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
- #define mysql_mutex_lock(M) \
- inline_mysql_mutex_lock(M, __FILE__, __LINE__)
-#else
- #define mysql_mutex_lock(M) \
- inline_mysql_mutex_lock(M)
-#endif
-
-/**
- @def mysql_mutex_trylock(M)
- Instrumented mutex_lock.
- @c mysql_mutex_trylock is a drop-in replacement
- for @c my_mutex_trylock.
-*/
-
-#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
- #define mysql_mutex_trylock(M) \
- inline_mysql_mutex_trylock(M, __FILE__, __LINE__)
-#else
- #define mysql_mutex_trylock(M) \
- inline_mysql_mutex_trylock(M)
-#endif
-
-/**
- @def mysql_mutex_unlock(M)
- Instrumented mutex_unlock.
- @c mysql_mutex_unlock is a drop-in replacement for @c pthread_mutex_unlock.
-*/
-#ifdef SAFE_MUTEX
- #define mysql_mutex_unlock(M) \
- inline_mysql_mutex_unlock(M, __FILE__, __LINE__)
-#else
- #define mysql_mutex_unlock(M) \
- inline_mysql_mutex_unlock(M)
-#endif
-
-/**
- @def mysql_rwlock_register(P1, P2, P3)
- Rwlock registration.
-*/
-#define mysql_rwlock_register(P1, P2, P3) \
- inline_mysql_rwlock_register(P1, P2, P3)
-
-/**
- @def mysql_rwlock_init(K, RW)
- Instrumented rwlock_init.
- @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init.
- Note that pthread_rwlockattr_t is not supported in MySQL.
- @param K The PSI_rwlock_key for this instrumented rwlock
- @param RW The rwlock to initialize
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW)
-#else
- #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW)
-#endif
-
-/**
- @def mysql_prlock_init(K, RW)
- Instrumented rw_pr_init.
- @c mysql_prlock_init is a replacement for @c rw_pr_init.
- @param K The PSI_rwlock_key for this instrumented prlock
- @param RW The prlock to initialize
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW)
-#else
- #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW)
-#endif
-
-/**
- @def mysql_rwlock_destroy(RW)
- Instrumented rwlock_destroy.
- @c mysql_rwlock_destroy is a drop-in replacement
- for @c pthread_rwlock_destroy.
-*/
-#define mysql_rwlock_destroy(RW) inline_mysql_rwlock_destroy(RW)
-
-/**
- @def mysql_prlock_destroy(RW)
- Instrumented rw_pr_destroy.
- @c mysql_prlock_destroy is a drop-in replacement
- for @c rw_pr_destroy.
-*/
-#define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW)
-
-/**
- @def mysql_rwlock_rdlock(RW)
- Instrumented rwlock_rdlock.
- @c mysql_rwlock_rdlock is a drop-in replacement
- for @c pthread_rwlock_rdlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_rwlock_rdlock(RW) \
- inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_rwlock_rdlock(RW) \
- inline_mysql_rwlock_rdlock(RW)
-#endif
-
-/**
- @def mysql_prlock_rdlock(RW)
- Instrumented rw_pr_rdlock.
- @c mysql_prlock_rdlock is a drop-in replacement
- for @c rw_pr_rdlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_prlock_rdlock(RW) \
- inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_prlock_rdlock(RW) \
- inline_mysql_prlock_rdlock(RW)
-#endif
-
-/**
- @def mysql_rwlock_wrlock(RW)
- Instrumented rwlock_wrlock.
- @c mysql_rwlock_wrlock is a drop-in replacement
- for @c pthread_rwlock_wrlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_rwlock_wrlock(RW) \
- inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_rwlock_wrlock(RW) \
- inline_mysql_rwlock_wrlock(RW)
-#endif
-
-/**
- @def mysql_prlock_wrlock(RW)
- Instrumented rw_pr_wrlock.
- @c mysql_prlock_wrlock is a drop-in replacement
- for @c rw_pr_wrlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_prlock_wrlock(RW) \
- inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_prlock_wrlock(RW) \
- inline_mysql_prlock_wrlock(RW)
-#endif
-
-/**
- @def mysql_rwlock_tryrdlock(RW)
- Instrumented rwlock_tryrdlock.
- @c mysql_rwlock_tryrdlock is a drop-in replacement
- for @c pthread_rwlock_tryrdlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_rwlock_tryrdlock(RW) \
- inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_rwlock_tryrdlock(RW) \
- inline_mysql_rwlock_tryrdlock(RW)
-#endif
-
-/**
- @def mysql_rwlock_trywrlock(RW)
- Instrumented rwlock_trywrlock.
- @c mysql_rwlock_trywrlock is a drop-in replacement
- for @c pthread_rwlock_trywrlock.
-*/
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- #define mysql_rwlock_trywrlock(RW) \
- inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_rwlock_trywrlock(RW) \
- inline_mysql_rwlock_trywrlock(RW)
-#endif
-
-/**
- @def mysql_rwlock_unlock(RW)
- Instrumented rwlock_unlock.
- @c mysql_rwlock_unlock is a drop-in replacement
- for @c pthread_rwlock_unlock.
-*/
-#define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW)
-
-/**
- @def mysql_prlock_unlock(RW)
- Instrumented rw_pr_unlock.
- @c mysql_prlock_unlock is a drop-in replacement
- for @c rw_pr_unlock.
-*/
-#define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW)
-
-/**
- @def mysql_cond_register(P1, P2, P3)
- Cond registration.
-*/
-#define mysql_cond_register(P1, P2, P3) \
- inline_mysql_cond_register(P1, P2, P3)
-
-/**
- @def mysql_cond_init(K, C)
- Instrumented cond_init.
- @c mysql_cond_init is a replacement for @c pthread_cond_init.
- Note that pthread_condattr_t is not supported in MySQL.
- @param C The cond to initialize
- @param K The PSI_cond_key for this instrumented cond
-
-*/
-#ifdef HAVE_PSI_COND_INTERFACE
- #define mysql_cond_init(K, C) inline_mysql_cond_init(K, C)
-#else
- #define mysql_cond_init(K, C) inline_mysql_cond_init(C)
-#endif
-
-/**
- @def mysql_cond_destroy(C)
- Instrumented cond_destroy.
- @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destroy.
-*/
-#define mysql_cond_destroy(C) inline_mysql_cond_destroy(C)
-
-/**
- @def mysql_cond_wait(C)
- Instrumented cond_wait.
- @c mysql_cond_wait is a drop-in replacement for @c native_cond_wait.
-*/
-#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
- #define mysql_cond_wait(C, M) \
- inline_mysql_cond_wait(C, M, __FILE__, __LINE__)
-#else
- #define mysql_cond_wait(C, M) \
- inline_mysql_cond_wait(C, M)
-#endif
-
-/**
- @def mysql_cond_timedwait(C, M, W)
- Instrumented cond_timedwait.
- @c mysql_cond_timedwait is a drop-in replacement
- for @c native_cond_timedwait.
-*/
-#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
- #define mysql_cond_timedwait(C, M, W) \
- inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__)
-#else
- #define mysql_cond_timedwait(C, M, W) \
- inline_mysql_cond_timedwait(C, M, W)
-#endif
-
-/**
- @def mysql_cond_signal(C)
- Instrumented cond_signal.
- @c mysql_cond_signal is a drop-in replacement for @c pthread_cond_signal.
-*/
-#define mysql_cond_signal(C) inline_mysql_cond_signal(C)
-
-/**
- @def mysql_cond_broadcast(C)
- Instrumented cond_broadcast.
- @c mysql_cond_broadcast is a drop-in replacement
- for @c pthread_cond_broadcast.
-*/
-#define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C)
-
-/**
- @def mysql_thread_register(P1, P2, P3)
- Thread registration.
-*/
-#define mysql_thread_register(P1, P2, P3) \
- inline_mysql_thread_register(P1, P2, P3)
-
-/**
- @def mysql_thread_create(K, P1, P2, P3, P4)
- Instrumented my_thread_create.
- This function creates both the thread instrumentation and a thread.
- @c mysql_thread_create is a replacement for @c my_thread_create.
- The parameter P4 (or, if it is NULL, P1) will be used as the
- instrumented thread "indentity".
- Providing a P1 / P4 parameter with a different value for each call
- will on average improve performances, since this thread identity value
- is used internally to randomize access to data and prevent contention.
- This is optional, and the improvement is not guaranteed, only statistical.
- @param K The PSI_thread_key for this instrumented thread
- @param P1 my_thread_create parameter 1
- @param P2 my_thread_create parameter 2
- @param P3 my_thread_create parameter 3
- @param P4 my_thread_create parameter 4
-*/
-#ifdef HAVE_PSI_THREAD_INTERFACE
- #define mysql_thread_create(K, P1, P2, P3, P4) \
- inline_mysql_thread_create(K, P1, P2, P3, P4)
-#else
- #define mysql_thread_create(K, P1, P2, P3, P4) \
- my_thread_create(P1, P2, P3, P4)
-#endif
-
-/**
- @def mysql_thread_set_psi_id(I)
- Set the thread identifier for the instrumentation.
- @param I The thread identifier
-*/
-#ifdef HAVE_PSI_THREAD_INTERFACE
- #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I)
-#else
- #define mysql_thread_set_psi_id(I) do {} while (0)
-#endif
-
-/**
- @def mysql_thread_set_psi_THD(T)
- Set the thread sql session for the instrumentation.
- @param I The thread identifier
-*/
-#ifdef HAVE_PSI_THREAD_INTERFACE
- #define mysql_thread_set_psi_THD(T) inline_mysql_thread_set_psi_THD(T)
-#else
- #define mysql_thread_set_psi_THD(T) do {} while (0)
-#endif
-
-static inline void inline_mysql_mutex_register(
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- const char *category,
- PSI_mutex_info *info,
- int count
-#else
- const char *category MY_ATTRIBUTE ((unused)),
- void *info MY_ATTRIBUTE ((unused)),
- int count MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- PSI_MUTEX_CALL(register_mutex)(category, info, count);
-#endif
-}
-
-static inline int inline_mysql_mutex_init(
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- PSI_mutex_key key,
-#endif
- mysql_mutex_t *that,
- const native_mutexattr_t *attr
-#ifdef SAFE_MUTEX
- , const char *src_file, uint src_line
-#endif
- )
-{
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- that->m_psi= PSI_MUTEX_CALL(init_mutex)(key, &that->m_mutex);
-#else
- that->m_psi= NULL;
-#endif
- return my_mutex_init(&that->m_mutex, attr
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-}
-
-static inline int inline_mysql_mutex_destroy(
- mysql_mutex_t *that
-#ifdef SAFE_MUTEX
- , const char *src_file, uint src_line
-#endif
- )
-{
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- if (that->m_psi != NULL)
- {
- PSI_MUTEX_CALL(destroy_mutex)(that->m_psi);
- that->m_psi= NULL;
- }
-#endif
- return my_mutex_destroy(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-}
-
-static inline int inline_mysql_mutex_lock(
- mysql_mutex_t *that
-#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_mutex_locker *locker;
- PSI_mutex_locker_state state;
- locker= PSI_MUTEX_CALL(start_mutex_wait)(&state, that->m_psi,
- PSI_MUTEX_LOCK, src_file, src_line);
-
- /* Instrumented code */
- result= my_mutex_lock(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_MUTEX_CALL(end_mutex_wait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= my_mutex_lock(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- return result;
-}
-
-static inline int inline_mysql_mutex_trylock(
- mysql_mutex_t *that
-#if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE)
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_mutex_locker *locker;
- PSI_mutex_locker_state state;
- locker= PSI_MUTEX_CALL(start_mutex_wait)(&state, that->m_psi,
- PSI_MUTEX_TRYLOCK, src_file, src_line);
-
- /* Instrumented code */
- result= my_mutex_trylock(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_MUTEX_CALL(end_mutex_wait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= my_mutex_trylock(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- return result;
-}
-
-static inline int inline_mysql_mutex_unlock(
- mysql_mutex_t *that
-#ifdef SAFE_MUTEX
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_MUTEX_INTERFACE
- if (that->m_psi != NULL)
- PSI_MUTEX_CALL(unlock_mutex)(that->m_psi);
-#endif
-
- result= my_mutex_unlock(&that->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- return result;
-}
-
-static inline void inline_mysql_rwlock_register(
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- const char *category,
- PSI_rwlock_info *info,
- int count
-#else
- const char *category MY_ATTRIBUTE ((unused)),
- void *info MY_ATTRIBUTE ((unused)),
- int count MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- PSI_RWLOCK_CALL(register_rwlock)(category, info, count);
-#endif
-}
-
-static inline int inline_mysql_rwlock_init(
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- PSI_rwlock_key key,
-#endif
- mysql_rwlock_t *that)
-{
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_rwlock);
-#else
- that->m_psi= NULL;
-#endif
- return native_rw_init(&that->m_rwlock);
-}
-
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_init(
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- PSI_rwlock_key key,
-#endif
- mysql_prlock_t *that)
-{
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_prlock);
-#else
- that->m_psi= NULL;
-#endif
- return rw_pr_init(&that->m_prlock);
-}
-#endif
-
-static inline int inline_mysql_rwlock_destroy(
- mysql_rwlock_t *that)
-{
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi);
- that->m_psi= NULL;
- }
-#endif
- return native_rw_destroy(&that->m_rwlock);
-}
-
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_destroy(
- mysql_prlock_t *that)
-{
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi);
- that->m_psi= NULL;
- }
-#endif
- return rw_pr_destroy(&that->m_prlock);
-}
-#endif
-
-static inline int inline_mysql_rwlock_rdlock(
- mysql_rwlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi,
- PSI_RWLOCK_READLOCK, src_file, src_line);
-
- /* Instrumented code */
- result= native_rw_rdlock(&that->m_rwlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= native_rw_rdlock(&that->m_rwlock);
-
- return result;
-}
-
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_rdlock(
- mysql_prlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi,
- PSI_RWLOCK_READLOCK, src_file, src_line);
-
- /* Instrumented code */
- result= rw_pr_rdlock(&that->m_prlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= rw_pr_rdlock(&that->m_prlock);
-
- return result;
-}
-#endif
-
-static inline int inline_mysql_rwlock_wrlock(
- mysql_rwlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi,
- PSI_RWLOCK_WRITELOCK, src_file, src_line);
-
- /* Instrumented code */
- result= native_rw_wrlock(&that->m_rwlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= native_rw_wrlock(&that->m_rwlock);
-
- return result;
-}
-
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_wrlock(
- mysql_prlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi,
- PSI_RWLOCK_WRITELOCK, src_file, src_line);
-
- /* Instrumented code */
- result= rw_pr_wrlock(&that->m_prlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= rw_pr_wrlock(&that->m_prlock);
-
- return result;
-}
-#endif
-
-static inline int inline_mysql_rwlock_tryrdlock(
- mysql_rwlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi,
- PSI_RWLOCK_TRYREADLOCK, src_file, src_line);
-
- /* Instrumented code */
- result= native_rw_tryrdlock(&that->m_rwlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= native_rw_tryrdlock(&that->m_rwlock);
-
- return result;
-}
-
-static inline int inline_mysql_rwlock_trywrlock(
- mysql_rwlock_t *that
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_rwlock_locker *locker;
- PSI_rwlock_locker_state state;
- locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi,
- PSI_RWLOCK_TRYWRITELOCK, src_file, src_line);
-
- /* Instrumented code */
- result= native_rw_trywrlock(&that->m_rwlock);
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= native_rw_trywrlock(&that->m_rwlock);
-
- return result;
-}
-
-static inline int inline_mysql_rwlock_unlock(
- mysql_rwlock_t *that)
-{
- int result;
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi);
-#endif
- result= native_rw_unlock(&that->m_rwlock);
- return result;
-}
-
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_unlock(
- mysql_prlock_t *that)
-{
- int result;
-#ifdef HAVE_PSI_RWLOCK_INTERFACE
- if (that->m_psi != NULL)
- PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi);
-#endif
- result= rw_pr_unlock(&that->m_prlock);
- return result;
-}
-#endif
-
-static inline void inline_mysql_cond_register(
-#ifdef HAVE_PSI_COND_INTERFACE
- const char *category,
- PSI_cond_info *info,
- int count
-#else
- const char *category MY_ATTRIBUTE ((unused)),
- void *info MY_ATTRIBUTE ((unused)),
- int count MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_COND_INTERFACE
- PSI_COND_CALL(register_cond)(category, info, count);
-#endif
-}
-
-static inline int inline_mysql_cond_init(
-#ifdef HAVE_PSI_COND_INTERFACE
- PSI_cond_key key,
-#endif
- mysql_cond_t *that)
-{
-#ifdef HAVE_PSI_COND_INTERFACE
- that->m_psi= PSI_COND_CALL(init_cond)(key, &that->m_cond);
-#else
- that->m_psi= NULL;
-#endif
- return native_cond_init(&that->m_cond);
-}
-
-static inline int inline_mysql_cond_destroy(
- mysql_cond_t *that)
-{
-#ifdef HAVE_PSI_COND_INTERFACE
- if (that->m_psi != NULL)
- {
- PSI_COND_CALL(destroy_cond)(that->m_psi);
- that->m_psi= NULL;
- }
-#endif
- return native_cond_destroy(&that->m_cond);
-}
-
-static inline int inline_mysql_cond_wait(
- mysql_cond_t *that,
- mysql_mutex_t *mutex
-#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_COND_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_cond_locker *locker;
- PSI_cond_locker_state state;
- locker= PSI_COND_CALL(start_cond_wait)(&state, that->m_psi, mutex->m_psi,
- PSI_COND_WAIT, src_file, src_line);
-
- /* Instrumented code */
- result= my_cond_wait(&that->m_cond, &mutex->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_COND_CALL(end_cond_wait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= my_cond_wait(&that->m_cond, &mutex->m_mutex
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- return result;
-}
-
-static inline int inline_mysql_cond_timedwait(
- mysql_cond_t *that,
- mysql_mutex_t *mutex,
- const struct timespec *abstime
-#if defined(SAFE_MUTEX) || defined(HAVE_PSI_COND_INTERFACE)
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-
-#ifdef HAVE_PSI_COND_INTERFACE
- if (that->m_psi != NULL)
- {
- /* Instrumentation start */
- PSI_cond_locker *locker;
- PSI_cond_locker_state state;
- locker= PSI_COND_CALL(start_cond_wait)(&state, that->m_psi, mutex->m_psi,
- PSI_COND_TIMEDWAIT, src_file, src_line);
-
- /* Instrumented code */
- result= my_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- /* Instrumentation end */
- if (locker != NULL)
- PSI_COND_CALL(end_cond_wait)(locker, result);
-
- return result;
- }
-#endif
-
- /* Non instrumented code */
- result= my_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime
-#ifdef SAFE_MUTEX
- , src_file, src_line
-#endif
- );
-
- return result;
-}
-
-static inline int inline_mysql_cond_signal(
- mysql_cond_t *that)
-{
- int result;
-#ifdef HAVE_PSI_COND_INTERFACE
- if (that->m_psi != NULL)
- PSI_COND_CALL(signal_cond)(that->m_psi);
-#endif
- result= native_cond_signal(&that->m_cond);
- return result;
-}
-
-static inline int inline_mysql_cond_broadcast(
- mysql_cond_t *that)
-{
- int result;
-#ifdef HAVE_PSI_COND_INTERFACE
- if (that->m_psi != NULL)
- PSI_COND_CALL(broadcast_cond)(that->m_psi);
-#endif
- result= native_cond_broadcast(&that->m_cond);
- return result;
-}
-
-static inline void inline_mysql_thread_register(
-#ifdef HAVE_PSI_THREAD_INTERFACE
- const char *category,
- PSI_thread_info *info,
- int count
-#else
- const char *category MY_ATTRIBUTE ((unused)),
- void *info MY_ATTRIBUTE ((unused)),
- int count MY_ATTRIBUTE ((unused))
-#endif
-)
-{
-#ifdef HAVE_PSI_THREAD_INTERFACE
- PSI_THREAD_CALL(register_thread)(category, info, count);
-#endif
-}
-
-#ifdef HAVE_PSI_THREAD_INTERFACE
-static inline int inline_mysql_thread_create(
- PSI_thread_key key,
- my_thread_handle *thread, const my_thread_attr_t *attr,
- my_start_routine start_routine, void *arg)
-{
- int result;
- result= PSI_THREAD_CALL(spawn_thread)(key, thread, attr, start_routine, arg);
- return result;
-}
-
-static inline void inline_mysql_thread_set_psi_id(my_thread_id id)
-{
- struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)();
- PSI_THREAD_CALL(set_thread_id)(psi, id);
-}
-
-#ifdef __cplusplus
-class THD;
-static inline void inline_mysql_thread_set_psi_THD(THD *thd)
-{
- struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)();
- PSI_THREAD_CALL(set_thread_THD)(psi, thd);
-}
-#endif /* __cplusplus */
-
-#endif
-
-#endif /* DISABLE_MYSQL_THREAD_H */
-
-/** @} (end of group Thread_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/mysql_transaction.h b/code/mysql/mysql/psi/mysql_transaction.h
deleted file mode 100644
index 4162939..0000000
--- a/code/mysql/mysql/psi/mysql_transaction.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_TRANSACTION_H
-#define MYSQL_TRANSACTION_H
-
-/**
- @file mysql/psi/mysql_transaction.h
- Instrumentation helpers for transactions.
-*/
-
-#include "mysql/psi/psi.h"
-
-#ifndef PSI_TRANSACTION_CALL
-#define PSI_TRANSACTION_CALL(M) PSI_DYNAMIC_CALL(M)
-#endif
-
-/**
- @defgroup Transaction_instrumentation Transaction Instrumentation
- @ingroup Instrumentation_interface
- @{
-*/
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
- inline_mysql_start_transaction(STATE, XID, TRXID, ISO, RO, AC, __FILE__, __LINE__)
-#else
- #define MYSQL_START_TRANSACTION(STATE, XID, TRXID, ISO, RO, AC) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
- inline_mysql_set_transaction_gtid(LOCKER, P1, P2)
-#else
- #define MYSQL_SET_TRANSACTION_GTID(LOCKER, P1, P2) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
- inline_mysql_set_transaction_xid(LOCKER, P1, P2)
-#else
- #define MYSQL_SET_TRANSACTION_XID(LOCKER, P1, P2) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
- inline_mysql_set_transaction_xa_state(LOCKER, P1)
-#else
- #define MYSQL_SET_TRANSACTION_XA_STATE(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
- inline_mysql_set_transaction_trxid(LOCKER, P1)
-#else
- #define MYSQL_SET_TRANSACTION_TRXID(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
- inline_mysql_inc_transaction_savepoints(LOCKER, P1)
-#else
- #define MYSQL_INC_TRANSACTION_SAVEPOINTS(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
- inline_mysql_inc_transaction_rollback_to_savepoint(LOCKER, P1)
-#else
- #define MYSQL_INC_TRANSACTION_ROLLBACK_TO_SAVEPOINT(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
- inline_mysql_inc_transaction_release_savepoint(LOCKER, P1)
-#else
- #define MYSQL_INC_TRANSACTION_RELEASE_SAVEPOINT(LOCKER, P1) \
- do {} while (0)
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
- inline_mysql_rollback_transaction(LOCKER)
-#else
- #define MYSQL_ROLLBACK_TRANSACTION(LOCKER) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
- #define MYSQL_COMMIT_TRANSACTION(LOCKER) \
- inline_mysql_commit_transaction(LOCKER)
-#else
- #define MYSQL_COMMIT_TRANSACTION(LOCKER) \
- NULL
-#endif
-
-#ifdef HAVE_PSI_TRANSACTION_INTERFACE
-static inline struct PSI_transaction_locker *
-inline_mysql_start_transaction(PSI_transaction_locker_state *state,
- const void *xid,
- const ulonglong *trxid,
- int isolation_level,
- my_bool read_only,
- my_bool autocommit,
- const char *src_file, int src_line)
-{
- PSI_transaction_locker *locker;
- locker= PSI_TRANSACTION_CALL(get_thread_transaction_locker)(state,
- xid, trxid,
- isolation_level,
- read_only,
- autocommit);
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(start_transaction)(locker, src_file, src_line);
- return locker;
-}
-
-static inline void
-inline_mysql_set_transaction_gtid(PSI_transaction_locker *locker,
- const void *sid,
- const void *gtid_spec)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(set_transaction_gtid)(locker, sid, gtid_spec);
-}
-
-static inline void
-inline_mysql_set_transaction_xid(PSI_transaction_locker *locker,
- const void *xid,
- int xa_state)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(set_transaction_xid)(locker, xid, xa_state);
-}
-
-static inline void
-inline_mysql_set_transaction_xa_state(PSI_transaction_locker *locker,
- int xa_state)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(set_transaction_xa_state)(locker, xa_state);
-}
-
-static inline void
-inline_mysql_set_transaction_trxid(PSI_transaction_locker *locker,
- const ulonglong *trxid)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(set_transaction_trxid)(locker, trxid);
-}
-
-static inline void
-inline_mysql_inc_transaction_savepoints(PSI_transaction_locker *locker,
- ulong count)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(inc_transaction_savepoints)(locker, count);
-}
-
-static inline void
-inline_mysql_inc_transaction_rollback_to_savepoint(PSI_transaction_locker *locker,
- ulong count)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(inc_transaction_rollback_to_savepoint)(locker, count);
-}
-
-static inline void
-inline_mysql_inc_transaction_release_savepoint(PSI_transaction_locker *locker,
- ulong count)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(inc_transaction_release_savepoint)(locker, count);
-}
-
-static inline void
-inline_mysql_rollback_transaction(struct PSI_transaction_locker *locker)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(end_transaction)(locker, false);
-}
-
-static inline void
-inline_mysql_commit_transaction(struct PSI_transaction_locker *locker)
-{
- if (likely(locker != NULL))
- PSI_TRANSACTION_CALL(end_transaction)(locker, true);
-}
-#endif
-
-/** @} (end of group Transaction_instrumentation) */
-
-#endif
-
diff --git a/code/mysql/mysql/psi/psi.h b/code/mysql/mysql/psi/psi.h
deleted file mode 100644
index 34422d3..0000000
--- a/code/mysql/mysql/psi/psi.h
+++ /dev/null
@@ -1,3011 +0,0 @@
-/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H
-#define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H
-
-#ifdef EMBEDDED_LIBRARY
-#define DISABLE_ALL_PSI
-#endif /* EMBEDDED_LIBRARY */
-
-#ifndef MY_GLOBAL_INCLUDED
-/*
- Make sure a .c or .cc file contains an include to my_global.h first.
- When this include is missing, all the #ifdef HAVE_XXX have no effect,
- and the resulting binary won't build, or won't link,
- or will crash at runtime
- since various structures will have different binary definitions.
-*/
-#error "You must include my_global.h in the code for the build to be correct."
-#endif
-
-#include "psi_base.h"
-#include "psi_memory.h"
-
-/*
- MAINTAINER:
- The following pattern:
- typedef struct XYZ XYZ;
- is not needed in C++, but required for C.
-*/
-
-C_MODE_START
-
-/** @sa MDL_key. */
-struct MDL_key;
-typedef struct MDL_key MDL_key;
-
-/** @sa enum_mdl_type. */
-typedef int opaque_mdl_type;
-
-/** @sa enum_mdl_duration. */
-typedef int opaque_mdl_duration;
-
-/** @sa MDL_wait::enum_wait_status. */
-typedef int opaque_mdl_status;
-
-/** @sa enum_vio_type. */
-typedef int opaque_vio_type;
-
-struct TABLE_SHARE;
-
-struct sql_digest_storage;
-
-#ifdef __cplusplus
- class THD;
-#else
- /*
- Phony declaration when compiling C code.
- This is ok, because the C code will never have a THD anyway.
- */
- struct opaque_THD
- {
- int dummy;
- };
- typedef struct opaque_THD THD;
-#endif
-
-/**
- @file mysql/psi/psi.h
- Performance schema instrumentation interface.
-
- @defgroup Instrumentation_interface Instrumentation Interface
- @ingroup Performance_schema
- @{
-*/
-
-/**
- Interface for an instrumented mutex.
- This is an opaque structure.
-*/
-struct PSI_mutex;
-typedef struct PSI_mutex PSI_mutex;
-
-/**
- Interface for an instrumented rwlock.
- This is an opaque structure.
-*/
-struct PSI_rwlock;
-typedef struct PSI_rwlock PSI_rwlock;
-
-/**
- Interface for an instrumented condition.
- This is an opaque structure.
-*/
-struct PSI_cond;
-typedef struct PSI_cond PSI_cond;
-
-/**
- Interface for an instrumented table share.
- This is an opaque structure.
-*/
-struct PSI_table_share;
-typedef struct PSI_table_share PSI_table_share;
-
-/**
- Interface for an instrumented table handle.
- This is an opaque structure.
-*/
-struct PSI_table;
-typedef struct PSI_table PSI_table;
-
-/**
- Interface for an instrumented thread.
- This is an opaque structure.
-*/
-struct PSI_thread;
-typedef struct PSI_thread PSI_thread;
-
-/**
- Interface for an instrumented file handle.
- This is an opaque structure.
-*/
-struct PSI_file;
-typedef struct PSI_file PSI_file;
-
-/**
- Interface for an instrumented socket descriptor.
- This is an opaque structure.
-*/
-struct PSI_socket;
-typedef struct PSI_socket PSI_socket;
-
-/**
- Interface for an instrumented prepared statement.
- This is an opaque structure.
-*/
-struct PSI_prepared_stmt;
-typedef struct PSI_prepared_stmt PSI_prepared_stmt;
-
-/**
- Interface for an instrumented table operation.
- This is an opaque structure.
-*/
-struct PSI_table_locker;
-typedef struct PSI_table_locker PSI_table_locker;
-
-/**
- Interface for an instrumented statement.
- This is an opaque structure.
-*/
-struct PSI_statement_locker;
-typedef struct PSI_statement_locker PSI_statement_locker;
-
-/**
- Interface for an instrumented transaction.
- This is an opaque structure.
-*/
-struct PSI_transaction_locker;
-typedef struct PSI_transaction_locker PSI_transaction_locker;
-
-/**
- Interface for an instrumented idle operation.
- This is an opaque structure.
-*/
-struct PSI_idle_locker;
-typedef struct PSI_idle_locker PSI_idle_locker;
-
-/**
- Interface for an instrumented statement digest operation.
- This is an opaque structure.
-*/
-struct PSI_digest_locker;
-typedef struct PSI_digest_locker PSI_digest_locker;
-
-/**
- Interface for an instrumented stored procedure share.
- This is an opaque structure.
-*/
-struct PSI_sp_share;
-typedef struct PSI_sp_share PSI_sp_share;
-
-/**
- Interface for an instrumented stored program.
- This is an opaque structure.
-*/
-struct PSI_sp_locker;
-typedef struct PSI_sp_locker PSI_sp_locker;
-
-/**
- Interface for an instrumented metadata lock.
- This is an opaque structure.
-*/
-struct PSI_metadata_lock;
-typedef struct PSI_metadata_lock PSI_metadata_lock;
-
-/**
- Interface for an instrumented stage progress.
- This is a public structure, for efficiency.
-*/
-struct PSI_stage_progress
-{
- ulonglong m_work_completed;
- ulonglong m_work_estimated;
-};
-typedef struct PSI_stage_progress PSI_stage_progress;
-
-/** IO operation performed on an instrumented table. */
-enum PSI_table_io_operation
-{
- /** Row fetch. */
- PSI_TABLE_FETCH_ROW= 0,
- /** Row write. */
- PSI_TABLE_WRITE_ROW= 1,
- /** Row update. */
- PSI_TABLE_UPDATE_ROW= 2,
- /** Row delete. */
- PSI_TABLE_DELETE_ROW= 3
-};
-typedef enum PSI_table_io_operation PSI_table_io_operation;
-
-/**
- State data storage for @c start_table_io_wait_v1_t,
- @c start_table_lock_wait_v1_t.
- This structure provide temporary storage to a table locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_table_io_wait_v1_t
- @sa start_table_lock_wait_v1_t
-*/
-struct PSI_table_locker_state
-{
- /** Internal state. */
- uint m_flags;
- /** Current io operation. */
- enum PSI_table_io_operation m_io_operation;
- /** Current table handle. */
- struct PSI_table *m_table;
- /** Current table share. */
- struct PSI_table_share *m_table_share;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
- /**
- Implementation specific.
- For table io, the table io index.
- For table lock, the lock type.
- */
- uint m_index;
-};
-typedef struct PSI_table_locker_state PSI_table_locker_state;
-
-/** Entry point for the performance schema interface. */
-struct PSI_bootstrap
-{
- /**
- ABI interface finder.
- Calling this method with an interface version number returns either
- an instance of the ABI for this version, or NULL.
- @param version the interface version number to find
- @return a versioned interface (PSI_v1, PSI_v2 or PSI)
- @sa PSI_VERSION_1
- @sa PSI_v1
- @sa PSI_VERSION_2
- @sa PSI_v2
- @sa PSI_CURRENT_VERSION
- @sa PSI
- */
- void* (*get_interface)(int version);
-};
-typedef struct PSI_bootstrap PSI_bootstrap;
-
-#ifdef HAVE_PSI_INTERFACE
-
-#ifdef DISABLE_ALL_PSI
-
-#ifndef DISABLE_PSI_THREAD
-#define DISABLE_PSI_THREAD
-#endif
-
-#ifndef DISABLE_PSI_MUTEX
-#define DISABLE_PSI_MUTEX
-#endif
-
-#ifndef DISABLE_PSI_RWLOCK
-#define DISABLE_PSI_RWLOCK
-#endif
-
-#ifndef DISABLE_PSI_COND
-#define DISABLE_PSI_COND
-#endif
-
-#ifndef DISABLE_PSI_FILE
-#define DISABLE_PSI_FILE
-#endif
-
-#ifndef DISABLE_PSI_TABLE
-#define DISABLE_PSI_TABLE
-#endif
-
-#ifndef DISABLE_PSI_SOCKET
-#define DISABLE_PSI_SOCKET
-#endif
-
-#ifndef DISABLE_PSI_STAGE
-#define DISABLE_PSI_STAGE
-#endif
-
-#ifndef DISABLE_PSI_STATEMENT
-#define DISABLE_PSI_STATEMENT
-#endif
-
-#ifndef DISABLE_PSI_SP
-#define DISABLE_PSI_SP
-#endif
-
-#ifndef DISABLE_PSI_IDLE
-#define DISABLE_PSI_IDLE
-#endif
-
-#ifndef DISABLE_PSI_STATEMENT_DIGEST
-#define DISABLE_PSI_STATEMENT_DIGEST
-#endif
-
-#ifndef DISABLE_PSI_METADATA
-#define DISABLE_PSI_METADATA
-#endif
-
-#ifndef DISABLE_PSI_MEMORY
-#define DISABLE_PSI_MEMORY
-#endif
-
-#ifndef DISABLE_PSI_TRANSACTION
-#define DISABLE_PSI_TRANSACTION
-#endif
-
-#ifndef DISABLE_PSI_SP
-#define DISABLE_PSI_SP
-#endif
-
-#ifndef DISABLE_PSI_PS
-#define DISABLE_PSI_PS
-#endif
-
-#endif
-
-/**
- @def DISABLE_PSI_MUTEX
- Compiling option to disable the mutex instrumentation.
- This option is mostly intended to be used during development,
- when doing special builds with only a subset of the performance schema instrumentation,
- for code analysis / profiling / performance tuning of a specific instrumentation alone.
- @sa DISABLE_PSI_RWLOCK
- @sa DISABLE_PSI_COND
- @sa DISABLE_PSI_FILE
- @sa DISABLE_PSI_THREAD
- @sa DISABLE_PSI_TABLE
- @sa DISABLE_PSI_STAGE
- @sa DISABLE_PSI_STATEMENT
- @sa DISABLE_PSI_SP
- @sa DISABLE_PSI_STATEMENT_DIGEST
- @sa DISABLE_PSI_SOCKET
- @sa DISABLE_PSI_MEMORY
- @sa DISABLE_PSI_IDLE
- @sa DISABLE_PSI_METADATA
- @sa DISABLE PSI_TRANSACTION
-*/
-
-#ifndef DISABLE_PSI_MUTEX
-#define HAVE_PSI_MUTEX_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_RWLOCK
- Compiling option to disable the rwlock instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_RWLOCK
-#define HAVE_PSI_RWLOCK_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_COND
- Compiling option to disable the cond instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_COND
-#define HAVE_PSI_COND_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_FILE
- Compiling option to disable the file instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_FILE
-#define HAVE_PSI_FILE_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_THREAD
- Compiling option to disable the thread instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-#ifndef DISABLE_PSI_THREAD
-#define HAVE_PSI_THREAD_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_TABLE
- Compiling option to disable the table instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_TABLE
-#define HAVE_PSI_TABLE_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_STAGE
- Compiling option to disable the stage instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_STAGE
-#define HAVE_PSI_STAGE_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_STATEMENT
- Compiling option to disable the statement instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_STATEMENT
-#define HAVE_PSI_STATEMENT_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_SP
- Compiling option to disable the stored program instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-#ifndef DISABLE_PSI_SP
-#define HAVE_PSI_SP_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_PS
- Compiling option to disable the prepared statement instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-#ifndef DISABLE_PSI_STATEMENT
-#ifndef DISABLE_PSI_PS
-#define HAVE_PSI_PS_INTERFACE
-#endif
-#endif
-
-/**
- @def DISABLE_PSI_STATEMENT_DIGEST
- Compiling option to disable the statement digest instrumentation.
-*/
-
-#ifndef DISABLE_PSI_STATEMENT
-#ifndef DISABLE_PSI_STATEMENT_DIGEST
-#define HAVE_PSI_STATEMENT_DIGEST_INTERFACE
-#endif
-#endif
-
-/**
- @def DISABLE_PSI_TRANSACTION
- Compiling option to disable the transaction instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_TRANSACTION
-#define HAVE_PSI_TRANSACTION_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_SOCKET
- Compiling option to disable the statement instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_SOCKET
-#define HAVE_PSI_SOCKET_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_MEMORY
- Compiling option to disable the memory instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_MEMORY
-#define HAVE_PSI_MEMORY_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_IDLE
- Compiling option to disable the idle instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_IDLE
-#define HAVE_PSI_IDLE_INTERFACE
-#endif
-
-/**
- @def DISABLE_PSI_METADATA
- Compiling option to disable the metadata instrumentation.
- @sa DISABLE_PSI_MUTEX
-*/
-
-#ifndef DISABLE_PSI_METADATA
-#define HAVE_PSI_METADATA_INTERFACE
-#endif
-
-/**
- @def PSI_VERSION_1
- Performance Schema Interface number for version 1.
- This version is supported.
-*/
-#define PSI_VERSION_1 1
-
-/**
- @def PSI_VERSION_2
- Performance Schema Interface number for version 2.
- This version is not implemented, it's a placeholder.
-*/
-#define PSI_VERSION_2 2
-
-/**
- @def PSI_CURRENT_VERSION
- Performance Schema Interface number for the most recent version.
- The most current version is @c PSI_VERSION_1
-*/
-#define PSI_CURRENT_VERSION 1
-
-#ifndef USE_PSI_2
-#ifndef USE_PSI_1
-#define USE_PSI_1
-#endif
-#endif
-
-/**
- Interface for an instrumented mutex operation.
- This is an opaque structure.
-*/
-struct PSI_mutex_locker;
-typedef struct PSI_mutex_locker PSI_mutex_locker;
-
-/**
- Interface for an instrumented rwlock operation.
- This is an opaque structure.
-*/
-struct PSI_rwlock_locker;
-typedef struct PSI_rwlock_locker PSI_rwlock_locker;
-
-/**
- Interface for an instrumented condition operation.
- This is an opaque structure.
-*/
-struct PSI_cond_locker;
-typedef struct PSI_cond_locker PSI_cond_locker;
-
-/**
- Interface for an instrumented file operation.
- This is an opaque structure.
-*/
-struct PSI_file_locker;
-typedef struct PSI_file_locker PSI_file_locker;
-
-/**
- Interface for an instrumented socket operation.
- This is an opaque structure.
-*/
-struct PSI_socket_locker;
-typedef struct PSI_socket_locker PSI_socket_locker;
-
-/**
- Interface for an instrumented MDL operation.
- This is an opaque structure.
-*/
-struct PSI_metadata_locker;
-typedef struct PSI_metadata_locker PSI_metadata_locker;
-
-/** Operation performed on an instrumented mutex. */
-enum PSI_mutex_operation
-{
- /** Lock. */
- PSI_MUTEX_LOCK= 0,
- /** Lock attempt. */
- PSI_MUTEX_TRYLOCK= 1
-};
-typedef enum PSI_mutex_operation PSI_mutex_operation;
-
-/**
- Operation performed on an instrumented rwlock.
- For basic READ / WRITE lock,
- operations are "READ" or "WRITE".
- For SX-locks, operations are "SHARED", "SHARED-EXCLUSIVE" or "EXCLUSIVE".
-*/
-enum PSI_rwlock_operation
-{
- /** Read lock. */
- PSI_RWLOCK_READLOCK= 0,
- /** Write lock. */
- PSI_RWLOCK_WRITELOCK= 1,
- /** Read lock attempt. */
- PSI_RWLOCK_TRYREADLOCK= 2,
- /** Write lock attempt. */
- PSI_RWLOCK_TRYWRITELOCK= 3,
-
- /** Shared lock. */
- PSI_RWLOCK_SHAREDLOCK= 4,
- /** Shared Exclusive lock. */
- PSI_RWLOCK_SHAREDEXCLUSIVELOCK= 5,
- /** Exclusive lock. */
- PSI_RWLOCK_EXCLUSIVELOCK= 6,
- /** Shared lock attempt. */
- PSI_RWLOCK_TRYSHAREDLOCK= 7,
- /** Shared Exclusive lock attempt. */
- PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK= 8,
- /** Exclusive lock attempt. */
- PSI_RWLOCK_TRYEXCLUSIVELOCK= 9
-
-};
-typedef enum PSI_rwlock_operation PSI_rwlock_operation;
-
-/** Operation performed on an instrumented condition. */
-enum PSI_cond_operation
-{
- /** Wait. */
- PSI_COND_WAIT= 0,
- /** Wait, with timeout. */
- PSI_COND_TIMEDWAIT= 1
-};
-typedef enum PSI_cond_operation PSI_cond_operation;
-
-/** Operation performed on an instrumented file. */
-enum PSI_file_operation
-{
- /** File creation, as in @c create(). */
- PSI_FILE_CREATE= 0,
- /** Temporary file creation, as in @c create_temp_file(). */
- PSI_FILE_CREATE_TMP= 1,
- /** File open, as in @c open(). */
- PSI_FILE_OPEN= 2,
- /** File open, as in @c fopen(). */
- PSI_FILE_STREAM_OPEN= 3,
- /** File close, as in @c close(). */
- PSI_FILE_CLOSE= 4,
- /** File close, as in @c fclose(). */
- PSI_FILE_STREAM_CLOSE= 5,
- /**
- Generic file read, such as @c fgets(), @c fgetc(), @c fread(), @c read(),
- @c pread().
- */
- PSI_FILE_READ= 6,
- /**
- Generic file write, such as @c fputs(), @c fputc(), @c fprintf(),
- @c vfprintf(), @c fwrite(), @c write(), @c pwrite().
- */
- PSI_FILE_WRITE= 7,
- /** Generic file seek, such as @c fseek() or @c seek(). */
- PSI_FILE_SEEK= 8,
- /** Generic file tell, such as @c ftell() or @c tell(). */
- PSI_FILE_TELL= 9,
- /** File flush, as in @c fflush(). */
- PSI_FILE_FLUSH= 10,
- /** File stat, as in @c stat(). */
- PSI_FILE_STAT= 11,
- /** File stat, as in @c fstat(). */
- PSI_FILE_FSTAT= 12,
- /** File chsize, as in @c my_chsize(). */
- PSI_FILE_CHSIZE= 13,
- /** File delete, such as @c my_delete() or @c my_delete_with_symlink(). */
- PSI_FILE_DELETE= 14,
- /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). */
- PSI_FILE_RENAME= 15,
- /** File sync, as in @c fsync() or @c my_sync(). */
- PSI_FILE_SYNC= 16
-};
-typedef enum PSI_file_operation PSI_file_operation;
-
-/** Lock operation performed on an instrumented table. */
-enum PSI_table_lock_operation
-{
- /** Table lock, in the server layer. */
- PSI_TABLE_LOCK= 0,
- /** Table lock, in the storage engine layer. */
- PSI_TABLE_EXTERNAL_LOCK= 1
-};
-typedef enum PSI_table_lock_operation PSI_table_lock_operation;
-
-/** State of an instrumented socket. */
-enum PSI_socket_state
-{
- /** Idle, waiting for the next command. */
- PSI_SOCKET_STATE_IDLE= 1,
- /** Active, executing a command. */
- PSI_SOCKET_STATE_ACTIVE= 2
-};
-typedef enum PSI_socket_state PSI_socket_state;
-
-/** Operation performed on an instrumented socket. */
-enum PSI_socket_operation
-{
- /** Socket creation, as in @c socket() or @c socketpair(). */
- PSI_SOCKET_CREATE= 0,
- /** Socket connection, as in @c connect(), @c listen() and @c accept(). */
- PSI_SOCKET_CONNECT= 1,
- /** Socket bind, as in @c bind(), @c getsockname() and @c getpeername(). */
- PSI_SOCKET_BIND= 2,
- /** Socket close, as in @c shutdown(). */
- PSI_SOCKET_CLOSE= 3,
- /** Socket send, @c send(). */
- PSI_SOCKET_SEND= 4,
- /** Socket receive, @c recv(). */
- PSI_SOCKET_RECV= 5,
- /** Socket send, @c sendto(). */
- PSI_SOCKET_SENDTO= 6,
- /** Socket receive, @c recvfrom). */
- PSI_SOCKET_RECVFROM= 7,
- /** Socket send, @c sendmsg(). */
- PSI_SOCKET_SENDMSG= 8,
- /** Socket receive, @c recvmsg(). */
- PSI_SOCKET_RECVMSG= 9,
- /** Socket seek, such as @c fseek() or @c seek(). */
- PSI_SOCKET_SEEK= 10,
- /** Socket options, as in @c getsockopt() and @c setsockopt(). */
- PSI_SOCKET_OPT= 11,
- /** Socket status, as in @c sockatmark() and @c isfdtype(). */
- PSI_SOCKET_STAT= 12,
- /** Socket shutdown, as in @c shutdown(). */
- PSI_SOCKET_SHUTDOWN= 13,
- /** Socket select, as in @c select() and @c poll(). */
- PSI_SOCKET_SELECT= 14
-};
-typedef enum PSI_socket_operation PSI_socket_operation;
-
-/**
- Instrumented mutex key.
- To instrument a mutex, a mutex key must be obtained using @c register_mutex.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_mutex_key;
-
-/**
- Instrumented rwlock key.
- To instrument a rwlock, a rwlock key must be obtained
- using @c register_rwlock.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_rwlock_key;
-
-/**
- Instrumented cond key.
- To instrument a condition, a condition key must be obtained
- using @c register_cond.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_cond_key;
-
-/**
- Instrumented thread key.
- To instrument a thread, a thread key must be obtained
- using @c register_thread.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_thread_key;
-
-/**
- Instrumented file key.
- To instrument a file, a file key must be obtained using @c register_file.
- Using a zero key always disable the instrumentation.
-*/
-#ifndef PSI_FILE_KEY_DEFINED
-typedef unsigned int PSI_file_key;
-#define PSI_FILE_KEY_DEFINED
-#endif
-
-/**
- Instrumented stage key.
- To instrument a stage, a stage key must be obtained using @c register_stage.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_stage_key;
-
-/**
- Instrumented statement key.
- To instrument a statement, a statement key must be obtained using @c register_statement.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_statement_key;
-
-/**
- Instrumented socket key.
- To instrument a socket, a socket key must be obtained using @c register_socket.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_socket_key;
-
-#ifdef HAVE_PSI_1
-
-/**
- @defgroup Group_PSI_v1 Application Binary Interface, version 1
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- Mutex information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented mutex.
-*/
-struct PSI_mutex_info_v1
-{
- /**
- Pointer to the key assigned to the registered mutex.
- */
- PSI_mutex_key *m_key;
- /**
- The name of the mutex to register.
- */
- const char *m_name;
- /**
- The flags of the mutex to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_mutex_info_v1 PSI_mutex_info_v1;
-
-/**
- Rwlock information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented rwlock.
-*/
-struct PSI_rwlock_info_v1
-{
- /**
- Pointer to the key assigned to the registered rwlock.
- */
- PSI_rwlock_key *m_key;
- /**
- The name of the rwlock to register.
- */
- const char *m_name;
- /**
- The flags of the rwlock to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_rwlock_info_v1 PSI_rwlock_info_v1;
-
-/**
- Condition information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented cond.
-*/
-struct PSI_cond_info_v1
-{
- /**
- Pointer to the key assigned to the registered cond.
- */
- PSI_cond_key *m_key;
- /**
- The name of the cond to register.
- */
- const char *m_name;
- /**
- The flags of the cond to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_cond_info_v1 PSI_cond_info_v1;
-
-/**
- Thread instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented thread.
-*/
-struct PSI_thread_info_v1
-{
- /**
- Pointer to the key assigned to the registered thread.
- */
- PSI_thread_key *m_key;
- /**
- The name of the thread instrument to register.
- */
- const char *m_name;
- /**
- The flags of the thread to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_thread_info_v1 PSI_thread_info_v1;
-
-/**
- File instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented file.
-*/
-struct PSI_file_info_v1
-{
- /**
- Pointer to the key assigned to the registered file.
- */
- PSI_file_key *m_key;
- /**
- The name of the file instrument to register.
- */
- const char *m_name;
- /**
- The flags of the file instrument to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_file_info_v1 PSI_file_info_v1;
-
-/**
- Stage instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented stage.
-*/
-struct PSI_stage_info_v1
-{
- /** The registered stage key. */
- PSI_stage_key m_key;
- /** The name of the stage instrument to register. */
- const char *m_name;
- /** The flags of the stage instrument to register. */
- int m_flags;
-};
-typedef struct PSI_stage_info_v1 PSI_stage_info_v1;
-
-/**
- Statement instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented statement.
-*/
-struct PSI_statement_info_v1
-{
- /** The registered statement key. */
- PSI_statement_key m_key;
- /** The name of the statement instrument to register. */
- const char *m_name;
- /** The flags of the statement instrument to register. */
- int m_flags;
-};
-typedef struct PSI_statement_info_v1 PSI_statement_info_v1;
-
-/**
- Socket instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented socket.
-*/
-struct PSI_socket_info_v1
-{
- /**
- Pointer to the key assigned to the registered socket.
- */
- PSI_socket_key *m_key;
- /**
- The name of the socket instrument to register.
- */
- const char *m_name;
- /**
- The flags of the socket instrument to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_socket_info_v1 PSI_socket_info_v1;
-
-/**
- State data storage for @c start_idle_wait_v1_t.
- This structure provide temporary storage to an idle locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_idle_wait_v1_t.
-*/
-struct PSI_idle_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state_v1;
-
-/**
- State data storage for @c start_mutex_wait_v1_t.
- This structure provide temporary storage to a mutex locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_mutex_wait_v1_t
-*/
-struct PSI_mutex_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current operation. */
- enum PSI_mutex_operation m_operation;
- /** Current mutex. */
- struct PSI_mutex *m_mutex;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state_v1;
-
-/**
- State data storage for @c start_rwlock_rdwait_v1_t, @c start_rwlock_wrwait_v1_t.
- This structure provide temporary storage to a rwlock locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_rwlock_rdwait_v1_t
- @sa start_rwlock_wrwait_v1_t
-*/
-struct PSI_rwlock_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current operation. */
- enum PSI_rwlock_operation m_operation;
- /** Current rwlock. */
- struct PSI_rwlock *m_rwlock;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state_v1;
-
-/**
- State data storage for @c start_cond_wait_v1_t.
- This structure provide temporary storage to a condition locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_cond_wait_v1_t
-*/
-struct PSI_cond_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current operation. */
- enum PSI_cond_operation m_operation;
- /** Current condition. */
- struct PSI_cond *m_cond;
- /** Current mutex. */
- struct PSI_mutex *m_mutex;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state_v1;
-
-/**
- State data storage for @c get_thread_file_name_locker_v1_t.
- This structure provide temporary storage to a file locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa get_thread_file_name_locker_v1_t
- @sa get_thread_file_stream_locker_v1_t
- @sa get_thread_file_descriptor_locker_v1_t
-*/
-struct PSI_file_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current operation. */
- enum PSI_file_operation m_operation;
- /** Current file. */
- struct PSI_file *m_file;
- /** Current file name. */
- const char *m_name;
- /** Current file class. */
- void *m_class;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Operation number of bytes. */
- size_t m_number_of_bytes;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_file_locker_state_v1 PSI_file_locker_state_v1;
-
-/**
- State data storage for @c start_metadata_wait_v1_t.
- This structure provide temporary storage to a metadata locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_metadata_wait_v1_t
-*/
-struct PSI_metadata_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current metadata lock. */
- struct PSI_metadata_lock *m_metadata_lock;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state_v1;
-
-/* Duplicate of NAME_LEN, to avoid dependency on mysql_com.h */
-#define PSI_SCHEMA_NAME_LEN (64 * 3)
-
-/**
- State data storage for @c get_thread_statement_locker_v1_t,
- @c get_thread_statement_locker_v1_t.
- This structure provide temporary storage to a statement locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa get_thread_statement_locker_v1_t
-*/
-struct PSI_statement_locker_state_v1
-{
- /** Discarded flag. */
- my_bool m_discarded;
- /** In prepare flag. */
- my_bool m_in_prepare;
- /** Metric, no index used flag. */
- uchar m_no_index_used;
- /** Metric, no good index used flag. */
- uchar m_no_good_index_used;
- /** Internal state. */
- uint m_flags;
- /** Instrumentation class. */
- void *m_class;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_statement;
- /** Locked time. */
- ulonglong m_lock_time;
- /** Rows sent. */
- ulonglong m_rows_sent;
- /** Rows examined. */
- ulonglong m_rows_examined;
- /** Metric, temporary tables created on disk. */
- ulong m_created_tmp_disk_tables;
- /** Metric, temporary tables created. */
- ulong m_created_tmp_tables;
- /** Metric, number of select full join. */
- ulong m_select_full_join;
- /** Metric, number of select full range join. */
- ulong m_select_full_range_join;
- /** Metric, number of select range. */
- ulong m_select_range;
- /** Metric, number of select range check. */
- ulong m_select_range_check;
- /** Metric, number of select scan. */
- ulong m_select_scan;
- /** Metric, number of sort merge passes. */
- ulong m_sort_merge_passes;
- /** Metric, number of sort merge. */
- ulong m_sort_range;
- /** Metric, number of sort rows. */
- ulong m_sort_rows;
- /** Metric, number of sort scans. */
- ulong m_sort_scan;
- /** Statement digest. */
- const struct sql_digest_storage *m_digest;
- /** Current schema name. */
- char m_schema_name[PSI_SCHEMA_NAME_LEN];
- /** Length in bytes of @c m_schema_name. */
- uint m_schema_name_length;
- /** Statement character set number. */
- uint m_cs_number;
- PSI_sp_share *m_parent_sp_share;
- PSI_prepared_stmt *m_parent_prepared_stmt;
-};
-typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state_v1;
-
-/**
- State data storage for @c get_thread_transaction_locker_v1_t,
- @c get_thread_transaction_locker_v1_t.
- This structure provide temporary storage to a transaction locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa get_thread_transaction_locker_v1_t
-*/
-struct PSI_transaction_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Instrumentation class. */
- void *m_class;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Internal data. */
- void *m_transaction;
- /** True if read-only transaction, false if read-write. */
- my_bool m_read_only;
- /** True if transaction is autocommit. */
- my_bool m_autocommit;
- /** Number of statements. */
- ulong m_statement_count;
- /** Total number of savepoints. */
- ulong m_savepoint_count;
- /** Number of rollback_to_savepoint. */
- ulong m_rollback_to_savepoint_count;
- /** Number of release_savepoint. */
- ulong m_release_savepoint_count;
-};
-
-typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state_v1;
-
-/**
- State data storage for @c start_socket_wait_v1_t.
- This structure provide temporary storage to a socket locker.
- The content of this structure is considered opaque,
- the fields are only hints of what an implementation
- of the psi interface can use.
- This memory is provided by the instrumented code for performance reasons.
- @sa start_socket_wait_v1_t
-*/
-struct PSI_socket_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current socket. */
- struct PSI_socket *m_socket;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Operation number of bytes. */
- size_t m_number_of_bytes;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Current operation. */
- enum PSI_socket_operation m_operation;
- /** Source file. */
- const char* m_src_file;
- /** Source line number. */
- int m_src_line;
- /** Internal data. */
- void *m_wait;
-};
-typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state_v1;
-
-struct PSI_sp_locker_state_v1
-{
- /** Internal state. */
- uint m_flags;
- /** Current thread. */
- struct PSI_thread *m_thread;
- /** Timer start. */
- ulonglong m_timer_start;
- /** Timer function. */
- ulonglong (*m_timer)(void);
- /** Stored Procedure share. */
- PSI_sp_share* m_sp_share;
-};
-typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state_v1;
-
-/* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */
-
-/**
- Mutex registration API.
- @param category a category name (typically a plugin name)
- @param info an array of mutex info to register
- @param count the size of the info array
-*/
-typedef void (*register_mutex_v1_t)
- (const char *category, struct PSI_mutex_info_v1 *info, int count);
-
-/**
- Rwlock registration API.
- @param category a category name (typically a plugin name)
- @param info an array of rwlock info to register
- @param count the size of the info array
-*/
-typedef void (*register_rwlock_v1_t)
- (const char *category, struct PSI_rwlock_info_v1 *info, int count);
-
-/**
- Cond registration API.
- @param category a category name (typically a plugin name)
- @param info an array of cond info to register
- @param count the size of the info array
-*/
-typedef void (*register_cond_v1_t)
- (const char *category, struct PSI_cond_info_v1 *info, int count);
-
-/**
- Thread registration API.
- @param category a category name (typically a plugin name)
- @param info an array of thread info to register
- @param count the size of the info array
-*/
-typedef void (*register_thread_v1_t)
- (const char *category, struct PSI_thread_info_v1 *info, int count);
-
-/**
- File registration API.
- @param category a category name (typically a plugin name)
- @param info an array of file info to register
- @param count the size of the info array
-*/
-typedef void (*register_file_v1_t)
- (const char *category, struct PSI_file_info_v1 *info, int count);
-
-/**
- Stage registration API.
- @param category a category name
- @param info an array of stage info to register
- @param count the size of the info array
-*/
-typedef void (*register_stage_v1_t)
- (const char *category, struct PSI_stage_info_v1 **info, int count);
-
-/**
- Statement registration API.
- @param category a category name
- @param info an array of stage info to register
- @param count the size of the info array
-*/
-typedef void (*register_statement_v1_t)
- (const char *category, struct PSI_statement_info_v1 *info, int count);
-
-/**
- Socket registration API.
- @param category a category name (typically a plugin name)
- @param info an array of socket info to register
- @param count the size of the info array
-*/
-typedef void (*register_socket_v1_t)
- (const char *category, struct PSI_socket_info_v1 *info, int count);
-
-/**
- Mutex instrumentation initialisation API.
- @param key the registered mutex key
- @param identity the address of the mutex itself
- @return an instrumented mutex
-*/
-typedef struct PSI_mutex* (*init_mutex_v1_t)
- (PSI_mutex_key key, const void *identity);
-
-/**
- Mutex instrumentation destruction API.
- @param mutex the mutex to destroy
-*/
-typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex);
-
-/**
- Rwlock instrumentation initialisation API.
- @param key the registered rwlock key
- @param identity the address of the rwlock itself
- @return an instrumented rwlock
-*/
-typedef struct PSI_rwlock* (*init_rwlock_v1_t)
- (PSI_rwlock_key key, const void *identity);
-
-/**
- Rwlock instrumentation destruction API.
- @param rwlock the rwlock to destroy
-*/
-typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock);
-
-/**
- Cond instrumentation initialisation API.
- @param key the registered key
- @param identity the address of the rwlock itself
- @return an instrumented cond
-*/
-typedef struct PSI_cond* (*init_cond_v1_t)
- (PSI_cond_key key, const void *identity);
-
-/**
- Cond instrumentation destruction API.
- @param cond the rcond to destroy
-*/
-typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond);
-
-/**
- Socket instrumentation initialisation API.
- @param key the registered mutex key
- @param socket descriptor
- @param addr the socket ip address
- @param addr_len length of socket ip address
- @return an instrumented socket
-*/
-typedef struct PSI_socket* (*init_socket_v1_t)
- (PSI_socket_key key, const my_socket *fd,
- const struct sockaddr *addr, socklen_t addr_len);
-
-/**
- socket instrumentation destruction API.
- @param socket the socket to destroy
-*/
-typedef void (*destroy_socket_v1_t)(struct PSI_socket *socket);
-
-/**
- Acquire a table share instrumentation.
- @param temporary True for temporary tables
- @param share The SQL layer table share
- @return a table share instrumentation, or NULL
-*/
-typedef struct PSI_table_share* (*get_table_share_v1_t)
- (my_bool temporary, struct TABLE_SHARE *share);
-
-/**
- Release a table share.
- @param info the table share to release
-*/
-typedef void (*release_table_share_v1_t)(struct PSI_table_share *share);
-
-/**
- Drop a table share.
- @param temporary True for temporary tables
- @param schema_name the table schema name
- @param schema_name_length the table schema name length
- @param table_name the table name
- @param table_name_length the table name length
-*/
-typedef void (*drop_table_share_v1_t)
- (my_bool temporary, const char *schema_name, int schema_name_length,
- const char *table_name, int table_name_length);
-
-/**
- Open an instrumentation table handle.
- @param share the table to open
- @param identity table handle identity
- @return a table handle, or NULL
-*/
-typedef struct PSI_table* (*open_table_v1_t)
- (struct PSI_table_share *share, const void *identity);
-
-/**
- Unbind a table handle from the current thread.
- This operation happens when an opened table is added to the open table cache.
- @param table the table to unbind
-*/
-typedef void (*unbind_table_v1_t)
- (struct PSI_table *table);
-
-/**
- Rebind a table handle to the current thread.
- This operation happens when a table from the open table cache
- is reused for a thread.
- @param table the table to unbind
-*/
-typedef PSI_table* (*rebind_table_v1_t)
- (PSI_table_share *share, const void *identity, PSI_table *table);
-
-/**
- Close an instrumentation table handle.
- Note that the table handle is invalid after this call.
- @param table the table handle to close
-*/
-typedef void (*close_table_v1_t)(struct TABLE_SHARE *server_share,
- struct PSI_table *table);
-
-/**
- Create a file instrumentation for a created file.
- This method does not create the file itself, but is used to notify the
- instrumentation interface that a file was just created.
- @param key the file instrumentation key for this file
- @param name the file name
- @param file the file handle
-*/
-typedef void (*create_file_v1_t)(PSI_file_key key, const char *name,
- File file);
-
-/**
- Spawn a thread.
- This method creates a new thread, with instrumentation.
- @param key the instrumentation key for this thread
- @param thread the resulting thread
- @param attr the thread attributes
- @param start_routine the thread start routine
- @param arg the thread start routine argument
-*/
-typedef int (*spawn_thread_v1_t)(PSI_thread_key key,
- my_thread_handle *thread,
- const my_thread_attr_t *attr,
- void *(*start_routine)(void*), void *arg);
-
-/**
- Create instrumentation for a thread.
- @param key the registered key
- @param identity an address typical of the thread
- @return an instrumented thread
-*/
-typedef struct PSI_thread* (*new_thread_v1_t)
- (PSI_thread_key key, const void *identity, ulonglong thread_id);
-
-/**
- Assign a THD to an instrumented thread.
- @param thread the instrumented thread
- @param THD the sql layer THD to assign
-*/
-typedef void (*set_thread_THD_v1_t)(struct PSI_thread *thread,
- THD *thd);
-
-/**
- Assign an id to an instrumented thread.
- @param thread the instrumented thread
- @param id the id to assign
-*/
-typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread,
- ulonglong id);
-
-/**
- Assign the current operating system thread id to an instrumented thread.
- The operating system task id is obtained from @c gettid()
- @param thread the instrumented thread
-*/
-typedef void (*set_thread_os_id_v1_t)(struct PSI_thread *thread);
-
-/**
- Get the instrumentation for the running thread.
- For this function to return a result,
- the thread instrumentation must have been attached to the
- running thread using @c set_thread()
- @return the instrumentation for the running thread
-*/
-typedef struct PSI_thread* (*get_thread_v1_t)(void);
-
-/**
- Assign a user name to the instrumented thread.
- @param user the user name
- @param user_len the user name length
-*/
-typedef void (*set_thread_user_v1_t)(const char *user, int user_len);
-
-/**
- Assign a user name and host name to the instrumented thread.
- @param user the user name
- @param user_len the user name length
- @param host the host name
- @param host_len the host name length
-*/
-typedef void (*set_thread_account_v1_t)(const char *user, int user_len,
- const char *host, int host_len);
-
-/**
- Assign a current database to the instrumented thread.
- @param db the database name
- @param db_len the database name length
-*/
-typedef void (*set_thread_db_v1_t)(const char* db, int db_len);
-
-/**
- Assign a current command to the instrumented thread.
- @param command the current command
-*/
-typedef void (*set_thread_command_v1_t)(int command);
-
-/**
- Assign a connection type to the instrumented thread.
- @param conn_type the connection type
-*/
-typedef void (*set_connection_type_v1_t)(opaque_vio_type conn_type);
-
-
-/**
- Assign a start time to the instrumented thread.
- @param start_time the thread start time
-*/
-typedef void (*set_thread_start_time_v1_t)(time_t start_time);
-
-/**
- Assign a state to the instrumented thread.
- @param state the thread state
-*/
-typedef void (*set_thread_state_v1_t)(const char* state);
-
-/**
- Assign a process info to the instrumented thread.
- @param info the process into string
- @param info_len the process into string length
-*/
-typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
-
-/**
- Attach a thread instrumentation to the running thread.
- In case of thread pools, this method should be called when
- a worker thread picks a work item and runs it.
- Also, this method should be called if the instrumented code does not
- keep the pointer returned by @c new_thread() and relies on @c get_thread()
- instead.
- @param thread the thread instrumentation
-*/
-typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
-
-/** Delete the current thread instrumentation. */
-typedef void (*delete_current_thread_v1_t)(void);
-
-/** Delete a thread instrumentation. */
-typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
-
-/**
- Get a file instrumentation locker, for opening or creating a file.
- @param state data storage for the locker
- @param key the file instrumentation key
- @param op the operation to perform
- @param name the file name
- @param identity a pointer representative of this file.
- @return a file locker, or NULL
-*/
-typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
- (struct PSI_file_locker_state_v1 *state,
- PSI_file_key key, enum PSI_file_operation op, const char *name,
- const void *identity);
-
-/**
- Get a file stream instrumentation locker.
- @param state data storage for the locker
- @param file the file stream to access
- @param op the operation to perform
- @return a file locker, or NULL
-*/
-typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
- (struct PSI_file_locker_state_v1 *state,
- struct PSI_file *file, enum PSI_file_operation op);
-
-/**
- Get a file instrumentation locker.
- @param state data storage for the locker
- @param file the file descriptor to access
- @param op the operation to perform
- @return a file locker, or NULL
-*/
-typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
- (struct PSI_file_locker_state_v1 *state,
- File file, enum PSI_file_operation op);
-
-/**
- Record a mutex instrumentation unlock event.
- @param mutex the mutex instrumentation
-*/
-typedef void (*unlock_mutex_v1_t)
- (struct PSI_mutex *mutex);
-
-/**
- Record a rwlock instrumentation unlock event.
- @param rwlock the rwlock instrumentation
-*/
-typedef void (*unlock_rwlock_v1_t)
- (struct PSI_rwlock *rwlock);
-
-/**
- Record a condition instrumentation signal event.
- @param cond the cond instrumentation
-*/
-typedef void (*signal_cond_v1_t)
- (struct PSI_cond *cond);
-
-/**
- Record a condition instrumentation broadcast event.
- @param cond the cond instrumentation
-*/
-typedef void (*broadcast_cond_v1_t)
- (struct PSI_cond *cond);
-
-/**
- Record an idle instrumentation wait start event.
- @param state data storage for the locker
- @param file the source file name
- @param line the source line number
- @return an idle locker, or NULL
-*/
-typedef struct PSI_idle_locker* (*start_idle_wait_v1_t)
- (struct PSI_idle_locker_state_v1 *state, const char *src_file, uint src_line);
-
-/**
- Record an idle instrumentation wait end event.
- @param locker a thread locker for the running thread
-*/
-typedef void (*end_idle_wait_v1_t)
- (struct PSI_idle_locker *locker);
-
-/**
- Record a mutex instrumentation wait start event.
- @param state data storage for the locker
- @param mutex the instrumented mutex to lock
- @param op the operation to perform
- @param file the source file name
- @param line the source line number
- @return a mutex locker, or NULL
-*/
-typedef struct PSI_mutex_locker* (*start_mutex_wait_v1_t)
- (struct PSI_mutex_locker_state_v1 *state,
- struct PSI_mutex *mutex,
- enum PSI_mutex_operation op,
- const char *src_file, uint src_line);
-
-/**
- Record a mutex instrumentation wait end event.
- @param locker a thread locker for the running thread
- @param rc the wait operation return code
-*/
-typedef void (*end_mutex_wait_v1_t)
- (struct PSI_mutex_locker *locker, int rc);
-
-/**
- Record a rwlock instrumentation read wait start event.
- @param locker a thread locker for the running thread
- @param must must block: 1 for lock, 0 for trylock
-*/
-typedef struct PSI_rwlock_locker* (*start_rwlock_rdwait_v1_t)
- (struct PSI_rwlock_locker_state_v1 *state,
- struct PSI_rwlock *rwlock,
- enum PSI_rwlock_operation op,
- const char *src_file, uint src_line);
-
-/**
- Record a rwlock instrumentation read wait end event.
- @param locker a thread locker for the running thread
- @param rc the wait operation return code
-*/
-typedef void (*end_rwlock_rdwait_v1_t)
- (struct PSI_rwlock_locker *locker, int rc);
-
-/**
- Record a rwlock instrumentation write wait start event.
- @param locker a thread locker for the running thread
- @param must must block: 1 for lock, 0 for trylock
-*/
-typedef struct PSI_rwlock_locker* (*start_rwlock_wrwait_v1_t)
- (struct PSI_rwlock_locker_state_v1 *state,
- struct PSI_rwlock *rwlock,
- enum PSI_rwlock_operation op,
- const char *src_file, uint src_line);
-
-/**
- Record a rwlock instrumentation write wait end event.
- @param locker a thread locker for the running thread
- @param rc the wait operation return code
-*/
-typedef void (*end_rwlock_wrwait_v1_t)
- (struct PSI_rwlock_locker *locker, int rc);
-
-/**
- Record a condition instrumentation wait start event.
- @param locker a thread locker for the running thread
- @param must must block: 1 for wait, 0 for timedwait
-*/
-typedef struct PSI_cond_locker* (*start_cond_wait_v1_t)
- (struct PSI_cond_locker_state_v1 *state,
- struct PSI_cond *cond,
- struct PSI_mutex *mutex,
- enum PSI_cond_operation op,
- const char *src_file, uint src_line);
-
-/**
- Record a condition instrumentation wait end event.
- @param locker a thread locker for the running thread
- @param rc the wait operation return code
-*/
-typedef void (*end_cond_wait_v1_t)
- (struct PSI_cond_locker *locker, int rc);
-
-/**
- Record a table instrumentation io wait start event.
- @param locker a table locker for the running thread
- @param file the source file name
- @param line the source line number
-*/
-typedef struct PSI_table_locker* (*start_table_io_wait_v1_t)
- (struct PSI_table_locker_state *state,
- struct PSI_table *table,
- enum PSI_table_io_operation op,
- uint index,
- const char *src_file, uint src_line);
-
-/**
- Record a table instrumentation io wait end event.
- @param locker a table locker for the running thread
- @param numrows the number of rows involved in io
-*/
-typedef void (*end_table_io_wait_v1_t)
- (struct PSI_table_locker *locker,
- ulonglong numrows);
-
-/**
- Record a table instrumentation lock wait start event.
- @param locker a table locker for the running thread
- @param file the source file name
- @param line the source line number
-*/
-typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t)
- (struct PSI_table_locker_state *state,
- struct PSI_table *table,
- enum PSI_table_lock_operation op,
- ulong flags,
- const char *src_file, uint src_line);
-
-/**
- Record a table instrumentation lock wait end event.
- @param locker a table locker for the running thread
-*/
-typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker);
-
-typedef void (*unlock_table_v1_t)(struct PSI_table *table);
-
-/**
- Start a file instrumentation open operation.
- @param locker the file locker
- @param op the operation to perform
- @param src_file the source file name
- @param src_line the source line number
-*/
-typedef void (*start_file_open_wait_v1_t)
- (struct PSI_file_locker *locker, const char *src_file, uint src_line);
-
-/**
- End a file instrumentation open operation, for file streams.
- @param locker the file locker.
- @param result the opened file (NULL indicates failure, non NULL success).
- @return an instrumented file handle
-*/
-typedef struct PSI_file* (*end_file_open_wait_v1_t)
- (struct PSI_file_locker *locker, void *result);
-
-/**
- End a file instrumentation open operation, for non stream files.
- @param locker the file locker.
- @param file the file number assigned by open() or create() for this file.
-*/
-typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t)
- (struct PSI_file_locker *locker, File file);
-
-/**
- End a file instrumentation open operation, for non stream temporary files.
- @param locker the file locker.
- @param file the file number assigned by open() or create() for this file.
- @param filename the file name generated during temporary file creation.
-*/
-typedef void (*end_temp_file_open_wait_and_bind_to_descriptor_v1_t)
- (struct PSI_file_locker *locker, File file, const char *filename);
-
-/**
- Record a file instrumentation start event.
- @param locker a file locker for the running thread
- @param op file operation to be performed
- @param count the number of bytes requested, or 0 if not applicable
- @param src_file the source file name
- @param src_line the source line number
-*/
-typedef void (*start_file_wait_v1_t)
- (struct PSI_file_locker *locker, size_t count,
- const char *src_file, uint src_line);
-
-/**
- Record a file instrumentation end event.
- Note that for file close operations, the instrumented file handle
- associated with the file (which was provided to obtain a locker)
- is invalid after this call.
- @param locker a file locker for the running thread
- @param count the number of bytes actually used in the operation,
- or 0 if not applicable, or -1 if the operation failed
- @sa get_thread_file_name_locker
- @sa get_thread_file_stream_locker
- @sa get_thread_file_descriptor_locker
-*/
-typedef void (*end_file_wait_v1_t)
- (struct PSI_file_locker *locker, size_t count);
-
-/**
- Start a file instrumentation close operation.
- @param locker the file locker
- @param op the operation to perform
- @param src_file the source file name
- @param src_line the source line number
-*/
-typedef void (*start_file_close_wait_v1_t)
- (struct PSI_file_locker *locker, const char *src_file, uint src_line);
-
-/**
- End a file instrumentation close operation.
- @param locker the file locker.
- @param rc the close operation return code (0 for success).
- @return an instrumented file handle
-*/
-typedef void (*end_file_close_wait_v1_t)
- (struct PSI_file_locker *locker, int rc);
-
-/**
- Rename a file instrumentation close operation.
- @param locker the file locker.
- @param old_name name of the file to be renamed.
- @param new_name name of the file after rename.
- @param rc the rename operation return code (0 for success).
-*/
-typedef void (*end_file_rename_wait_v1_t)
- (struct PSI_file_locker *locker, const char *old_name,
- const char *new_name, int rc);
-
-/**
- Start a new stage, and implicitly end the previous stage.
- @param key the key of the new stage
- @param src_file the source file name
- @param src_line the source line number
- @return the new stage progress
-*/
-typedef PSI_stage_progress* (*start_stage_v1_t)
- (PSI_stage_key key, const char *src_file, int src_line);
-
-typedef PSI_stage_progress* (*get_current_stage_progress_v1_t)(void);
-
-/** End the current stage. */
-typedef void (*end_stage_v1_t) (void);
-
-/**
- Get a statement instrumentation locker.
- @param state data storage for the locker
- @param key the statement instrumentation key
- @param charset client character set
- @return a statement locker, or NULL
-*/
-typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t)
- (struct PSI_statement_locker_state_v1 *state,
- PSI_statement_key key, const void *charset, PSI_sp_share *sp_share);
-
-/**
- Refine a statement locker to a more specific key.
- Note that only events declared mutable can be refined.
- @param the statement locker for the current event
- @param key the new key for the event
- @sa PSI_FLAG_MUTABLE
-*/
-typedef struct PSI_statement_locker* (*refine_statement_v1_t)
- (struct PSI_statement_locker *locker,
- PSI_statement_key key);
-
-/**
- Start a new statement event.
- @param locker the statement locker for this event
- @param db the active database name for this statement
- @param db_length the active database name length for this statement
- @param src_file source file name
- @param src_line source line number
-*/
-typedef void (*start_statement_v1_t)
- (struct PSI_statement_locker *locker,
- const char *db, uint db_length,
- const char *src_file, uint src_line);
-
-/**
- Set the statement text for a statement event.
- @param locker the current statement locker
- @param text the statement text
- @param text_len the statement text length
-*/
-typedef void (*set_statement_text_v1_t)
- (struct PSI_statement_locker *locker,
- const char *text, uint text_len);
-
-/**
- Set a statement event lock time.
- @param locker the statement locker
- @param lock_time the locked time, in microseconds
-*/
-typedef void (*set_statement_lock_time_t)
- (struct PSI_statement_locker *locker, ulonglong lock_time);
-
-/**
- Set a statement event rows sent metric.
- @param locker the statement locker
- @param count the number of rows sent
-*/
-typedef void (*set_statement_rows_sent_t)
- (struct PSI_statement_locker *locker, ulonglong count);
-
-/**
- Set a statement event rows examined metric.
- @param locker the statement locker
- @param count the number of rows examined
-*/
-typedef void (*set_statement_rows_examined_t)
- (struct PSI_statement_locker *locker, ulonglong count);
-
-/**
- Increment a statement event "created tmp disk tables" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_created_tmp_disk_tables_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "created tmp tables" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_created_tmp_tables_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "select full join" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_select_full_join_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "select full range join" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_select_full_range_join_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "select range join" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_select_range_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "select range check" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_select_range_check_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "select scan" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_select_scan_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "sort merge passes" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_sort_merge_passes_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "sort range" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_sort_range_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "sort rows" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_sort_rows_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Increment a statement event "sort scan" metric.
- @param locker the statement locker
- @param count the metric increment value
-*/
-typedef void (*inc_statement_sort_scan_t)
- (struct PSI_statement_locker *locker, ulong count);
-
-/**
- Set a statement event "no index used" metric.
- @param locker the statement locker
- @param count the metric value
-*/
-typedef void (*set_statement_no_index_used_t)
- (struct PSI_statement_locker *locker);
-
-/**
- Set a statement event "no good index used" metric.
- @param locker the statement locker
- @param count the metric value
-*/
-typedef void (*set_statement_no_good_index_used_t)
- (struct PSI_statement_locker *locker);
-
-/**
- End a statement event.
- @param locker the statement locker
- @param stmt_da the statement diagnostics area.
- @sa Diagnostics_area
-*/
-typedef void (*end_statement_v1_t)
- (struct PSI_statement_locker *locker, void *stmt_da);
-
-/**
- Get a transaction instrumentation locker.
- @param state data storage for the locker
- @param xid the xid for this transaction
- @param trxid the InnoDB transaction id
- @param iso_level isolation level for this transaction
- @param read_only true if transaction access mode is read-only
- @param autocommit true if transaction is autocommit
- @return a transaction locker, or NULL
-*/
-typedef struct PSI_transaction_locker* (*get_thread_transaction_locker_v1_t)
- (struct PSI_transaction_locker_state_v1 *state, const void *xid,
- const ulonglong *trxid, int isolation_level, my_bool read_only,
- my_bool autocommit);
-
-/**
- Start a new transaction event.
- @param locker the transaction locker for this event
- @param src_file source file name
- @param src_line source line number
-*/
-typedef void (*start_transaction_v1_t)
- (struct PSI_transaction_locker *locker,
- const char *src_file, uint src_line);
-
-/**
- Set the transaction xid.
- @param locker the transaction locker for this event
- @param xid the id of the XA transaction
- #param xa_state is the state of the XA transaction
-*/
-typedef void (*set_transaction_xid_v1_t)
- (struct PSI_transaction_locker *locker,
- const void *xid, int xa_state);
-
-/**
- Set the state of the XA transaction.
- @param locker the transaction locker for this event
- @param xa_state the new state of the xa transaction
-*/
-typedef void (*set_transaction_xa_state_v1_t)
- (struct PSI_transaction_locker *locker,
- int xa_state);
-
-/**
- Set the transaction gtid.
- @param locker the transaction locker for this event
- @param sid the source id for the transaction, mapped from sidno
- @param gtid_spec the gtid specifier for the transaction
-*/
-typedef void (*set_transaction_gtid_v1_t)
- (struct PSI_transaction_locker *locker,
- const void *sid, const void *gtid_spec);
-
-/**
- Set the transaction trx_id.
- @param locker the transaction locker for this event
- @param trxid the storage engine transaction ID
-*/
-typedef void (*set_transaction_trxid_v1_t)
- (struct PSI_transaction_locker *locker,
- const ulonglong *trxid);
-
-/**
- Increment a transaction event savepoint count.
- @param locker the transaction locker
- @param count the increment value
-*/
-typedef void (*inc_transaction_savepoints_v1_t)
- (struct PSI_transaction_locker *locker, ulong count);
-
-/**
- Increment a transaction event rollback to savepoint count.
- @param locker the transaction locker
- @param count the increment value
-*/
-typedef void (*inc_transaction_rollback_to_savepoint_v1_t)
- (struct PSI_transaction_locker *locker, ulong count);
-
-/**
- Increment a transaction event release savepoint count.
- @param locker the transaction locker
- @param count the increment value
-*/
-typedef void (*inc_transaction_release_savepoint_v1_t)
- (struct PSI_transaction_locker *locker, ulong count);
-
-/**
- Commit or rollback the transaction.
- @param locker the transaction locker for this event
- @param commit true if transaction was committed, false if rolled back
-*/
-typedef void (*end_transaction_v1_t)
- (struct PSI_transaction_locker *locker,
- my_bool commit);
-
-/**
- Record a socket instrumentation start event.
- @param locker a socket locker for the running thread
- @param op socket operation to be performed
- @param count the number of bytes requested, or 0 if not applicable
- @param src_file the source file name
- @param src_line the source line number
-*/
-typedef struct PSI_socket_locker* (*start_socket_wait_v1_t)
- (struct PSI_socket_locker_state_v1 *state,
- struct PSI_socket *socket,
- enum PSI_socket_operation op,
- size_t count,
- const char *src_file, uint src_line);
-
-/**
- Record a socket instrumentation end event.
- Note that for socket close operations, the instrumented socket handle
- associated with the socket (which was provided to obtain a locker)
- is invalid after this call.
- @param locker a socket locker for the running thread
- @param count the number of bytes actually used in the operation,
- or 0 if not applicable, or -1 if the operation failed
- @sa get_thread_socket_locker
-*/
-typedef void (*end_socket_wait_v1_t)
- (struct PSI_socket_locker *locker, size_t count);
-
-/**
- Set the socket state for an instrumented socket.
- @param socket the instrumented socket
- @param state socket state
- */
-typedef void (*set_socket_state_v1_t)(struct PSI_socket *socket,
- enum PSI_socket_state state);
-
-/**
- Set the socket info for an instrumented socket.
- @param socket the instrumented socket
- @param fd the socket descriptor
- @param addr the socket ip address
- @param addr_len length of socket ip address
- @param thread_id associated thread id
-*/
-typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
- const my_socket *fd,
- const struct sockaddr *addr,
- socklen_t addr_len);
-
-/**
- Bind a socket to the thread that owns it.
- @param socket instrumented socket
-*/
-typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
-
-/**
- Get a prepare statement.
- @param locker a statement locker for the running thread.
-*/
-typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t)
- (void *identity, uint stmt_id, PSI_statement_locker *locker,
- const char *stmt_name, size_t stmt_name_length,
- const char *name, size_t length);
-
-/**
- destroy a prepare statement.
- @param prepared_stmt prepared statement.
-*/
-typedef void (*destroy_prepared_stmt_v1_t)
- (PSI_prepared_stmt *prepared_stmt);
-
-/**
- repreare a prepare statement.
- @param prepared_stmt prepared statement.
-*/
-typedef void (*reprepare_prepared_stmt_v1_t)
- (PSI_prepared_stmt *prepared_stmt);
-
-/**
- Record a prepare statement instrumentation execute event.
- @param locker a statement locker for the running thread.
- @param prepared_stmt prepared statement.
-*/
-typedef void (*execute_prepared_stmt_v1_t)
- (PSI_statement_locker *locker, PSI_prepared_stmt* prepared_stmt);
-
-/**
- Set the statement text for a prepared statment event.
- @param prepared_stmt prepared statement.
- @param text the prepared statement text
- @param text_len the prepared statement text length
-*/
-typedef void (*set_prepared_stmt_text_v1_t)(PSI_prepared_stmt *prepared_stmt,
- const char *text,
- uint text_len);
-/**
- Get a digest locker for the current statement.
- @param locker a statement locker for the running thread
-*/
-typedef struct PSI_digest_locker * (*digest_start_v1_t)
- (struct PSI_statement_locker *locker);
-
-/**
- Add a token to the current digest instrumentation.
- @param locker a digest locker for the current statement
- @param token the lexical token to add
- @param yylval the lexical token attributes
-*/
-typedef void (*digest_end_v1_t)
- (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest);
-
-typedef PSI_sp_locker* (*start_sp_v1_t)
- (struct PSI_sp_locker_state_v1 *state, struct PSI_sp_share* sp_share);
-
-typedef void (*end_sp_v1_t)
- (struct PSI_sp_locker *locker);
-
-typedef void (*drop_sp_v1_t)
- (uint object_type,
- const char *schema_name, uint schema_name_length,
- const char *object_name, uint object_name_length);
-
-/**
- Acquire a sp share instrumentation.
- @param type of stored program
- @param schema name of stored program
- @param name of stored program
- @return a stored program share instrumentation, or NULL
-*/
-typedef struct PSI_sp_share* (*get_sp_share_v1_t)
- (uint object_type,
- const char *schema_name, uint schema_name_length,
- const char *object_name, uint object_name_length);
-
-/**
- Release a stored program share.
- @param info the stored program share to release
-*/
-typedef void (*release_sp_share_v1_t)(struct PSI_sp_share *share);
-
-typedef PSI_metadata_lock* (*create_metadata_lock_v1_t)
- (void *identity,
- const MDL_key *key,
- opaque_mdl_type mdl_type,
- opaque_mdl_duration mdl_duration,
- opaque_mdl_status mdl_status,
- const char *src_file,
- uint src_line);
-
-typedef void (*set_metadata_lock_status_v1_t)(PSI_metadata_lock *lock,
- opaque_mdl_status mdl_status);
-
-typedef void (*destroy_metadata_lock_v1_t)(PSI_metadata_lock *lock);
-
-typedef struct PSI_metadata_locker* (*start_metadata_wait_v1_t)
- (struct PSI_metadata_locker_state_v1 *state,
- struct PSI_metadata_lock *mdl,
- const char *src_file, uint src_line);
-
-typedef void (*end_metadata_wait_v1_t)
- (struct PSI_metadata_locker *locker, int rc);
-
-/**
- Stores an array of connection attributes
- @param buffer char array of length encoded connection attributes
- in network format
- @param length length of the data in buffer
- @param from_cs charset in which @c buffer is encoded
- @return state
- @retval non_0 attributes truncated
- @retval 0 stored the attribute
-*/
-typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length,
- const void *from_cs);
-
-/**
- Performance Schema Interface, version 1.
- @since PSI_VERSION_1
-*/
-struct PSI_v1
-{
- /** @sa register_mutex_v1_t. */
- register_mutex_v1_t register_mutex;
- /** @sa register_rwlock_v1_t. */
- register_rwlock_v1_t register_rwlock;
- /** @sa register_cond_v1_t. */
- register_cond_v1_t register_cond;
- /** @sa register_thread_v1_t. */
- register_thread_v1_t register_thread;
- /** @sa register_file_v1_t. */
- register_file_v1_t register_file;
- /** @sa register_stage_v1_t. */
- register_stage_v1_t register_stage;
- /** @sa register_statement_v1_t. */
- register_statement_v1_t register_statement;
- /** @sa register_socket_v1_t. */
- register_socket_v1_t register_socket;
- /** @sa init_mutex_v1_t. */
- init_mutex_v1_t init_mutex;
- /** @sa destroy_mutex_v1_t. */
- destroy_mutex_v1_t destroy_mutex;
- /** @sa init_rwlock_v1_t. */
- init_rwlock_v1_t init_rwlock;
- /** @sa destroy_rwlock_v1_t. */
- destroy_rwlock_v1_t destroy_rwlock;
- /** @sa init_cond_v1_t. */
- init_cond_v1_t init_cond;
- /** @sa destroy_cond_v1_t. */
- destroy_cond_v1_t destroy_cond;
- /** @sa init_socket_v1_t. */
- init_socket_v1_t init_socket;
- /** @sa destroy_socket_v1_t. */
- destroy_socket_v1_t destroy_socket;
-
- /** @sa get_table_share_v1_t. */
- get_table_share_v1_t get_table_share;
- /** @sa release_table_share_v1_t. */
- release_table_share_v1_t release_table_share;
- /** @sa drop_table_share_v1_t. */
- drop_table_share_v1_t drop_table_share;
- /** @sa open_table_v1_t. */
- open_table_v1_t open_table;
- /** @sa unbind_table_v1_t. */
- unbind_table_v1_t unbind_table;
- /** @sa rebind_table_v1_t. */
- rebind_table_v1_t rebind_table;
- /** @sa close_table_v1_t. */
- close_table_v1_t close_table;
- /** @sa create_file_v1_t. */
- create_file_v1_t create_file;
- /** @sa spawn_thread_v1_t. */
- spawn_thread_v1_t spawn_thread;
- /** @sa new_thread_v1_t. */
- new_thread_v1_t new_thread;
- /** @sa set_thread_id_v1_t. */
- set_thread_id_v1_t set_thread_id;
- /** @sa set_thread_THD_v1_t. */
- set_thread_THD_v1_t set_thread_THD;
- /** @sa set_thread_os_id_v1_t. */
- set_thread_os_id_v1_t set_thread_os_id;
- /** @sa get_thread_v1_t. */
- get_thread_v1_t get_thread;
- /** @sa set_thread_user_v1_t. */
- set_thread_user_v1_t set_thread_user;
- /** @sa set_thread_account_v1_t. */
- set_thread_account_v1_t set_thread_account;
- /** @sa set_thread_db_v1_t. */
- set_thread_db_v1_t set_thread_db;
- /** @sa set_thread_command_v1_t. */
- set_thread_command_v1_t set_thread_command;
- /** @sa set_connection_type_v1_t. */
- set_connection_type_v1_t set_connection_type;
- /** @sa set_thread_start_time_v1_t. */
- set_thread_start_time_v1_t set_thread_start_time;
- /** @sa set_thread_state_v1_t. */
- set_thread_state_v1_t set_thread_state;
- /** @sa set_thread_info_v1_t. */
- set_thread_info_v1_t set_thread_info;
- /** @sa set_thread_v1_t. */
- set_thread_v1_t set_thread;
- /** @sa delete_current_thread_v1_t. */
- delete_current_thread_v1_t delete_current_thread;
- /** @sa delete_thread_v1_t. */
- delete_thread_v1_t delete_thread;
- /** @sa get_thread_file_name_locker_v1_t. */
- get_thread_file_name_locker_v1_t get_thread_file_name_locker;
- /** @sa get_thread_file_stream_locker_v1_t. */
- get_thread_file_stream_locker_v1_t get_thread_file_stream_locker;
- /** @sa get_thread_file_descriptor_locker_v1_t. */
- get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker;
- /** @sa unlock_mutex_v1_t. */
- unlock_mutex_v1_t unlock_mutex;
- /** @sa unlock_rwlock_v1_t. */
- unlock_rwlock_v1_t unlock_rwlock;
- /** @sa signal_cond_v1_t. */
- signal_cond_v1_t signal_cond;
- /** @sa broadcast_cond_v1_t. */
- broadcast_cond_v1_t broadcast_cond;
- /** @sa start_idle_wait_v1_t. */
- start_idle_wait_v1_t start_idle_wait;
- /** @sa end_idle_wait_v1_t. */
- end_idle_wait_v1_t end_idle_wait;
- /** @sa start_mutex_wait_v1_t. */
- start_mutex_wait_v1_t start_mutex_wait;
- /** @sa end_mutex_wait_v1_t. */
- end_mutex_wait_v1_t end_mutex_wait;
- /** @sa start_rwlock_rdwait_v1_t. */
- start_rwlock_rdwait_v1_t start_rwlock_rdwait;
- /** @sa end_rwlock_rdwait_v1_t. */
- end_rwlock_rdwait_v1_t end_rwlock_rdwait;
- /** @sa start_rwlock_wrwait_v1_t. */
- start_rwlock_wrwait_v1_t start_rwlock_wrwait;
- /** @sa end_rwlock_wrwait_v1_t. */
- end_rwlock_wrwait_v1_t end_rwlock_wrwait;
- /** @sa start_cond_wait_v1_t. */
- start_cond_wait_v1_t start_cond_wait;
- /** @sa end_cond_wait_v1_t. */
- end_cond_wait_v1_t end_cond_wait;
- /** @sa start_table_io_wait_v1_t. */
- start_table_io_wait_v1_t start_table_io_wait;
- /** @sa end_table_io_wait_v1_t. */
- end_table_io_wait_v1_t end_table_io_wait;
- /** @sa start_table_lock_wait_v1_t. */
- start_table_lock_wait_v1_t start_table_lock_wait;
- /** @sa end_table_lock_wait_v1_t. */
- end_table_lock_wait_v1_t end_table_lock_wait;
- /** @sa start_file_open_wait_v1_t. */
- start_file_open_wait_v1_t start_file_open_wait;
- /** @sa end_file_open_wait_v1_t. */
- end_file_open_wait_v1_t end_file_open_wait;
- /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */
- end_file_open_wait_and_bind_to_descriptor_v1_t
- end_file_open_wait_and_bind_to_descriptor;
- /** @sa end_temp_file_open_wait_and_bind_to_descriptor_v1_t. */
- end_temp_file_open_wait_and_bind_to_descriptor_v1_t
- end_temp_file_open_wait_and_bind_to_descriptor;
- /** @sa start_file_wait_v1_t. */
- start_file_wait_v1_t start_file_wait;
- /** @sa end_file_wait_v1_t. */
- end_file_wait_v1_t end_file_wait;
- /** @sa start_file_close_wait_v1_t. */
- start_file_close_wait_v1_t start_file_close_wait;
- /** @sa end_file_close_wait_v1_t. */
- end_file_close_wait_v1_t end_file_close_wait;
- /** @sa rename_file_close_wait_v1_t. */
- end_file_rename_wait_v1_t end_file_rename_wait;
- /** @sa start_stage_v1_t. */
- start_stage_v1_t start_stage;
- /** @sa get_current_stage_progress_v1_t. */
- get_current_stage_progress_v1_t get_current_stage_progress;
- /** @sa end_stage_v1_t. */
- end_stage_v1_t end_stage;
- /** @sa get_thread_statement_locker_v1_t. */
- get_thread_statement_locker_v1_t get_thread_statement_locker;
- /** @sa refine_statement_v1_t. */
- refine_statement_v1_t refine_statement;
- /** @sa start_statement_v1_t. */
- start_statement_v1_t start_statement;
- /** @sa set_statement_text_v1_t. */
- set_statement_text_v1_t set_statement_text;
- /** @sa set_statement_lock_time_t. */
- set_statement_lock_time_t set_statement_lock_time;
- /** @sa set_statement_rows_sent_t. */
- set_statement_rows_sent_t set_statement_rows_sent;
- /** @sa set_statement_rows_examined_t. */
- set_statement_rows_examined_t set_statement_rows_examined;
- /** @sa inc_statement_created_tmp_disk_tables. */
- inc_statement_created_tmp_disk_tables_t inc_statement_created_tmp_disk_tables;
- /** @sa inc_statement_created_tmp_tables. */
- inc_statement_created_tmp_tables_t inc_statement_created_tmp_tables;
- /** @sa inc_statement_select_full_join. */
- inc_statement_select_full_join_t inc_statement_select_full_join;
- /** @sa inc_statement_select_full_range_join. */
- inc_statement_select_full_range_join_t inc_statement_select_full_range_join;
- /** @sa inc_statement_select_range. */
- inc_statement_select_range_t inc_statement_select_range;
- /** @sa inc_statement_select_range_check. */
- inc_statement_select_range_check_t inc_statement_select_range_check;
- /** @sa inc_statement_select_scan. */
- inc_statement_select_scan_t inc_statement_select_scan;
- /** @sa inc_statement_sort_merge_passes. */
- inc_statement_sort_merge_passes_t inc_statement_sort_merge_passes;
- /** @sa inc_statement_sort_range. */
- inc_statement_sort_range_t inc_statement_sort_range;
- /** @sa inc_statement_sort_rows. */
- inc_statement_sort_rows_t inc_statement_sort_rows;
- /** @sa inc_statement_sort_scan. */
- inc_statement_sort_scan_t inc_statement_sort_scan;
- /** @sa set_statement_no_index_used. */
- set_statement_no_index_used_t set_statement_no_index_used;
- /** @sa set_statement_no_good_index_used. */
- set_statement_no_good_index_used_t set_statement_no_good_index_used;
- /** @sa end_statement_v1_t. */
- end_statement_v1_t end_statement;
- /** @sa get_thread_transaction_locker_v1_t. */
- get_thread_transaction_locker_v1_t get_thread_transaction_locker;
- /** @sa start_transaction_v1_t. */
- start_transaction_v1_t start_transaction;
- /** @sa set_transaction_xid_v1_t. */
- set_transaction_xid_v1_t set_transaction_xid;
- /** @sa set_transaction_xa_state_v1_t. */
- set_transaction_xa_state_v1_t set_transaction_xa_state;
- /** @sa set_transaction_gtid_v1_t. */
- set_transaction_gtid_v1_t set_transaction_gtid;
- /** @sa set_transaction_trxid_v1_t. */
- set_transaction_trxid_v1_t set_transaction_trxid;
- /** @sa inc_transaction_savepoints_v1_t. */
- inc_transaction_savepoints_v1_t inc_transaction_savepoints;
- /** @sa inc_transaction_rollback_to_savepoint_v1_t. */
- inc_transaction_rollback_to_savepoint_v1_t inc_transaction_rollback_to_savepoint;
- /** @sa inc_transaction_release_savepoint_v1_t. */
- inc_transaction_release_savepoint_v1_t inc_transaction_release_savepoint;
- /** @sa end_transaction_v1_t. */
- end_transaction_v1_t end_transaction;
- /** @sa start_socket_wait_v1_t. */
- start_socket_wait_v1_t start_socket_wait;
- /** @sa end_socket_wait_v1_t. */
- end_socket_wait_v1_t end_socket_wait;
- /** @sa set_socket_state_v1_t. */
- set_socket_state_v1_t set_socket_state;
- /** @sa set_socket_info_v1_t. */
- set_socket_info_v1_t set_socket_info;
- /** @sa set_socket_thread_owner_v1_t. */
- set_socket_thread_owner_v1_t set_socket_thread_owner;
- /** @sa create_prepared_stmt_v1_t. */
- create_prepared_stmt_v1_t create_prepared_stmt;
- /** @sa destroy_prepared_stmt_v1_t. */
- destroy_prepared_stmt_v1_t destroy_prepared_stmt;
- /** @sa reprepare_prepared_stmt_v1_t. */
- reprepare_prepared_stmt_v1_t reprepare_prepared_stmt;
- /** @sa execute_prepared_stmt_v1_t. */
- execute_prepared_stmt_v1_t execute_prepared_stmt;
- /** @sa set_prepared_stmt_text_v1_t. */
- set_prepared_stmt_text_v1_t set_prepared_stmt_text;
- /** @sa digest_start_v1_t. */
- digest_start_v1_t digest_start;
- /** @sa digest_end_v1_t. */
- digest_end_v1_t digest_end;
- /** @sa set_thread_connect_attrs_v1_t. */
- set_thread_connect_attrs_v1_t set_thread_connect_attrs;
- /** @sa start_sp_v1_t. */
- start_sp_v1_t start_sp;
- /** @sa start_sp_v1_t. */
- end_sp_v1_t end_sp;
- /** @sa drop_sp_v1_t. */
- drop_sp_v1_t drop_sp;
- /** @sa get_sp_share_v1_t. */
- get_sp_share_v1_t get_sp_share;
- /** @sa release_sp_share_v1_t. */
- release_sp_share_v1_t release_sp_share;
- /** @sa register_memory_v1_t. */
- register_memory_v1_t register_memory;
- /** @sa memory_alloc_v1_t. */
- memory_alloc_v1_t memory_alloc;
- /** @sa memory_realloc_v1_t. */
- memory_realloc_v1_t memory_realloc;
- /** @sa memory_claim_v1_t. */
- memory_claim_v1_t memory_claim;
- /** @sa memory_free_v1_t. */
- memory_free_v1_t memory_free;
-
- unlock_table_v1_t unlock_table;
-
- create_metadata_lock_v1_t create_metadata_lock;
- set_metadata_lock_status_v1_t set_metadata_lock_status;
- destroy_metadata_lock_v1_t destroy_metadata_lock;
-
- start_metadata_wait_v1_t start_metadata_wait;
- end_metadata_wait_v1_t end_metadata_wait;
-};
-
-/** @} (end of group Group_PSI_v1) */
-
-#endif /* HAVE_PSI_1 */
-
-#ifdef USE_PSI_2
-#define HAVE_PSI_2
-#endif
-
-#ifdef HAVE_PSI_2
-
-/**
- @defgroup Group_PSI_v2 Application Binary Interface, version 2
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- Performance Schema Interface, version 2.
- This is a placeholder, this interface is not defined yet.
- @since PSI_VERSION_2
-*/
-struct PSI_v2
-{
- /** Placeholder */
- int placeholder;
- /* ... extended interface ... */
-};
-
-/** Placeholder */
-struct PSI_mutex_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_rwlock_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_cond_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_thread_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_file_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_stage_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_statement_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_transaction_info_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_idle_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_mutex_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_rwlock_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_cond_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_file_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_statement_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_transaction_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-/** Placeholder */
-struct PSI_socket_locker_state_v2
-{
- /** Placeholder */
- int placeholder;
-};
-
-struct PSI_metadata_locker_state_v2
-{
- int placeholder;
-};
-
-/** @} (end of group Group_PSI_v2) */
-
-#endif /* HAVE_PSI_2 */
-
-/**
- @typedef PSI
- The instrumentation interface for the current version.
- @sa PSI_CURRENT_VERSION
-*/
-
-/**
- @typedef PSI_mutex_info
- The mutex information structure for the current version.
-*/
-
-/**
- @typedef PSI_rwlock_info
- The rwlock information structure for the current version.
-*/
-
-/**
- @typedef PSI_cond_info
- The cond information structure for the current version.
-*/
-
-/**
- @typedef PSI_thread_info
- The thread information structure for the current version.
-*/
-
-/**
- @typedef PSI_file_info
- The file information structure for the current version.
-*/
-
-/* Export the required version */
-#ifdef USE_PSI_1
-typedef struct PSI_v1 PSI;
-typedef struct PSI_mutex_info_v1 PSI_mutex_info;
-typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
-typedef struct PSI_cond_info_v1 PSI_cond_info;
-typedef struct PSI_thread_info_v1 PSI_thread_info;
-typedef struct PSI_file_info_v1 PSI_file_info;
-typedef struct PSI_stage_info_v1 PSI_stage_info;
-typedef struct PSI_statement_info_v1 PSI_statement_info;
-typedef struct PSI_transaction_info_v1 PSI_transaction_info;
-typedef struct PSI_socket_info_v1 PSI_socket_info;
-typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state;
-typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state;
-typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state;
-typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state;
-typedef struct PSI_file_locker_state_v1 PSI_file_locker_state;
-typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state;
-typedef struct PSI_transaction_locker_state_v1 PSI_transaction_locker_state;
-typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state;
-typedef struct PSI_sp_locker_state_v1 PSI_sp_locker_state;
-typedef struct PSI_metadata_locker_state_v1 PSI_metadata_locker_state;
-#endif
-
-#ifdef USE_PSI_2
-typedef struct PSI_v2 PSI;
-typedef struct PSI_mutex_info_v2 PSI_mutex_info;
-typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
-typedef struct PSI_cond_info_v2 PSI_cond_info;
-typedef struct PSI_thread_info_v2 PSI_thread_info;
-typedef struct PSI_file_info_v2 PSI_file_info;
-typedef struct PSI_stage_info_v2 PSI_stage_info;
-typedef struct PSI_statement_info_v2 PSI_statement_info;
-typedef struct PSI_transaction_info_v2 PSI_transaction_info;
-typedef struct PSI_socket_info_v2 PSI_socket_info;
-typedef struct PSI_idle_locker_state_v2 PSI_idle_locker_state;
-typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state;
-typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state;
-typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state;
-typedef struct PSI_file_locker_state_v2 PSI_file_locker_state;
-typedef struct PSI_statement_locker_state_v2 PSI_statement_locker_state;
-typedef struct PSI_transaction_locker_state_v2 PSI_transaction_locker_state;
-typedef struct PSI_socket_locker_state_v2 PSI_socket_locker_state;
-typedef struct PSI_sp_locker_state_v2 PSI_sp_locker_state;
-typedef struct PSI_metadata_locker_state_v2 PSI_metadata_locker_state;
-#endif
-
-#else /* HAVE_PSI_INTERFACE */
-
-/**
- Dummy structure, used to declare PSI_server when no instrumentation
- is available.
- The content does not matter, since PSI_server will be NULL.
-*/
-struct PSI_none
-{
- int opaque;
-};
-typedef struct PSI_none PSI;
-
-/**
- Stage instrument information.
- @since PSI_VERSION_1
- This structure is used to register an instrumented stage.
-*/
-struct PSI_stage_info_none
-{
- /** Unused stage key. */
- unsigned int m_key;
- /** The name of the stage instrument. */
- const char *m_name;
- /** Unused stage flags. */
- int m_flags;
-};
-
-/**
- The stage instrumentation has to co exist with the legacy
- THD::set_proc_info instrumentation.
- To avoid duplication of the instrumentation in the server,
- the common PSI_stage_info structure is used,
- so we export it here, even when not building
- with HAVE_PSI_INTERFACE.
-*/
-typedef struct PSI_stage_info_none PSI_stage_info;
-
-#endif /* HAVE_PSI_INTERFACE */
-
-extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
-
-/*
- Allow to override PSI_XXX_CALL at compile time
- with more efficient implementations, if available.
- If nothing better is available,
- make a dynamic call using the PSI_server function pointer.
-*/
-
-#define PSI_DYNAMIC_CALL(M) PSI_server->M
-
-/** @} */
-
-C_MODE_END
-#endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */
-
diff --git a/code/mysql/mysql/psi/psi_base.h b/code/mysql/mysql/psi/psi_base.h
deleted file mode 100644
index d9f2520..0000000
--- a/code/mysql/mysql/psi/psi_base.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_PSI_BASE_H
-#define MYSQL_PSI_BASE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- @file mysql/psi/psi_base.h
- Performance schema instrumentation interface.
-
- @defgroup Instrumentation_interface Instrumentation Interface
- @ingroup Performance_schema
- @{
-*/
-
-#define PSI_INSTRUMENT_ME 0
-
-#define PSI_NOT_INSTRUMENTED 0
-
-/**
- Global flag.
- This flag indicate that an instrumentation point is a global variable,
- or a singleton.
-*/
-#define PSI_FLAG_GLOBAL (1 << 0)
-
-/**
- Mutable flag.
- This flag indicate that an instrumentation point is a general placeholder,
- that can mutate into a more specific instrumentation point.
-*/
-#define PSI_FLAG_MUTABLE (1 << 1)
-
-#define PSI_FLAG_THREAD (1 << 2)
-
-/**
- Stage progress flag.
- This flag apply to the stage instruments only.
- It indicates the instrumentation provides progress data.
-*/
-#define PSI_FLAG_STAGE_PROGRESS (1 << 3)
-
-/**
- Shared Exclusive flag.
- Indicates that rwlock support the shared exclusive state.
-*/
-#define PSI_RWLOCK_FLAG_SX (1 << 4)
-
-/**
- Transferable flag.
- This flag indicate that an instrumented object can
- be created by a thread and destroyed by another thread.
-*/
-#define PSI_FLAG_TRANSFER (1 << 5)
-
-/**
- Volatility flag.
- This flag indicate that an instrumented object
- has a volatility (life cycle) comparable
- to the volatility of a session.
-*/
-#define PSI_FLAG_VOLATILITY_SESSION (1 << 6)
-
-#ifdef HAVE_PSI_INTERFACE
-
-/**
- @def PSI_VERSION_1
- Performance Schema Interface number for version 1.
- This version is supported.
-*/
-#define PSI_VERSION_1 1
-
-/**
- @def PSI_VERSION_2
- Performance Schema Interface number for version 2.
- This version is not implemented, it's a placeholder.
-*/
-#define PSI_VERSION_2 2
-
-/**
- @def PSI_CURRENT_VERSION
- Performance Schema Interface number for the most recent version.
- The most current version is @c PSI_VERSION_1
-*/
-#define PSI_CURRENT_VERSION 1
-
-/**
- @def USE_PSI_1
- Define USE_PSI_1 to use the interface version 1.
-*/
-
-/**
- @def USE_PSI_2
- Define USE_PSI_2 to use the interface version 2.
-*/
-
-/**
- @def HAVE_PSI_1
- Define HAVE_PSI_1 if the interface version 1 needs to be compiled in.
-*/
-
-/**
- @def HAVE_PSI_2
- Define HAVE_PSI_2 if the interface version 2 needs to be compiled in.
-*/
-
-#ifndef USE_PSI_2
-#ifndef USE_PSI_1
-#define USE_PSI_1
-#endif
-#endif
-
-#ifdef USE_PSI_1
-#define HAVE_PSI_1
-#endif
-
-#ifdef USE_PSI_2
-#define HAVE_PSI_2
-#endif
-
-/*
- Allow to override PSI_XXX_CALL at compile time
- with more efficient implementations, if available.
- If nothing better is available,
- make a dynamic call using the PSI_server function pointer.
-*/
-
-#define PSI_DYNAMIC_CALL(M) PSI_server->M
-
-#endif /* HAVE_PSI_INTERFACE */
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MYSQL_PSI_BASE_H */
-
diff --git a/code/mysql/mysql/psi/psi_memory.h b/code/mysql/mysql/psi/psi_memory.h
deleted file mode 100644
index d6915a1..0000000
--- a/code/mysql/mysql/psi/psi_memory.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- Without limiting anything contained in the foregoing, this file,
- which is part of C Driver for MySQL (Connector/C), is also subject to the
- Universal FOSS Exception, version 1.0, a copy of which can be found at
- http://oss.oracle.com/licenses/universal-foss-exception.
-
- 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, version 2.0, 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,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef MYSQL_PSI_MEMORY_H
-#define MYSQL_PSI_MEMORY_H
-
-#include "psi_base.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- @file mysql/psi/psi_memory.h
- Performance schema instrumentation interface.
-
- @defgroup Instrumentation_interface Instrumentation Interface
- @ingroup Performance_schema
- @{
-*/
-
-#ifdef HAVE_PSI_INTERFACE
-#ifndef DISABLE_ALL_PSI
-#ifndef DISABLE_PSI_MEMORY
-#define HAVE_PSI_MEMORY_INTERFACE
-#endif /* DISABLE_PSI_MEMORY */
-#endif /* DISABLE_ALL_PSI */
-#endif /* HAVE_PSI_INTERFACE */
-
-struct PSI_thread;
-
-/**
- Instrumented memory key.
- To instrument memory, a memory key must be obtained using @c register_memory.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_memory_key;
-
-#ifdef HAVE_PSI_1
-
-/**
- @defgroup Group_PSI_v1 Application Binary Interface, version 1
- @ingroup Instrumentation_interface
- @{
-*/
-
-/**
- Memory instrument information.
- @since PSI_VERSION_1
- This structure is used to register instrumented memory.
-*/
-struct PSI_memory_info_v1
-{
- /** Pointer to the key assigned to the registered memory. */
- PSI_memory_key *m_key;
- /** The name of the memory instrument to register. */
- const char *m_name;
- /**
- The flags of the socket instrument to register.
- @sa PSI_FLAG_GLOBAL
- */
- int m_flags;
-};
-typedef struct PSI_memory_info_v1 PSI_memory_info_v1;
-
-/**
- Memory registration API.
- @param category a category name (typically a plugin name)
- @param info an array of memory info to register
- @param count the size of the info array
-*/
-typedef void (*register_memory_v1_t)
- (const char *category, struct PSI_memory_info_v1 *info, int count);
-
-/**
- Instrument memory allocation.
- @param key the memory instrument key
- @param size the size of memory allocated
- @param[out] owner the memory owner
- @return the effective memory instrument key
-*/
-typedef PSI_memory_key (*memory_alloc_v1_t)
- (PSI_memory_key key, size_t size, struct PSI_thread ** owner);
-
-/**
- Instrument memory re allocation.
- @param key the memory instrument key
- @param old_size the size of memory previously allocated
- @param new_size the size of memory re allocated
- @param[in, out] owner the memory owner
- @return the effective memory instrument key
-*/
-typedef PSI_memory_key (*memory_realloc_v1_t)
- (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread ** owner);
-
-/**
- Instrument memory claim.
- @param key the memory instrument key
- @param size the size of memory allocated
- @param[in, out] owner the memory owner
- @return the effective memory instrument key
-*/
-typedef PSI_memory_key (*memory_claim_v1_t)
- (PSI_memory_key key, size_t size, struct PSI_thread ** owner);
-
-/**
- Instrument memory free.
- @param key the memory instrument key
- @param size the size of memory allocated
- @param owner the memory owner
-*/
-typedef void (*memory_free_v1_t)
- (PSI_memory_key key, size_t size, struct PSI_thread * owner);
-
-/** @} (end of group Group_PSI_v1) */
-
-#endif /* HAVE_PSI_1 */
-
-#ifdef HAVE_PSI_2
-struct PSI_memory_info_v2
-{
- int placeholder;
-};
-
-#endif /* HAVE_PSI_2 */
-
-#ifdef USE_PSI_1
-typedef struct PSI_memory_info_v1 PSI_memory_info;
-#endif
-
-#ifdef USE_PSI_2
-typedef struct PSI_memory_info_v2 PSI_memory_info;
-#endif
-
-/** @} (end of group Instrumentation_interface) */
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* MYSQL_PSI_MEMORY_H */
-
diff --git a/code/mysql/mysql/service_command.h b/code/mysql/mysql/service_command.h
deleted file mode 100644
index 45521a7..0000000
--- a/code/mysql/mysql/service_command.h
+++ /dev/null
@@ -1,442 +0,0 @@
-#ifndef MYSQL_SERVICE_COMMAND_INCLUDED
-#define MYSQL_SERVICE_COMMAND_INCLUDED
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
- Header file for the Command service. This service is to provide means
- of executing different commands, like COM_QUERY, COM_STMT_PREPARE,
- in the server.
-*/
-
-#include "mysql/service_srv_session.h"
-#include "mysql/com_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "mysql_time.h"
-#include "decimal.h"
-#ifndef MYSQL_ABI_CHECK
-#include "m_ctype.h"
-#include /* uint32_t */
-#endif
-
-/* POD structure for the field metadata from the server */
-struct st_send_field
-{
- const char *db_name;
- const char *table_name;
- const char *org_table_name;
- const char *col_name;
- const char *org_col_name;
- unsigned long length;
- unsigned int charsetnr;
- unsigned int flags;
- unsigned int decimals;
- enum_field_types type;
-};
-
-
-struct st_command_service_cbs
-{
- /*
- For a statement that returns a result, the flow of called callbacks will be:
-
- start_result_metadata()
- field_metadata()
- ....
- end_result_metadata() (in the classic protocol this generates an EOF packet)
- start_row()
- get_xxx()
- ...
- end_row()
- start_row()
- get_xxx()
- ...
- end_row()
- handle_ok() (with data for an EOF packet)
-
- For a statement that does NOT return a result, but only status, like
- INSERT, UPDATE, DELETE, REPLACE, TRUNCATE, CREATE, DROP, ALTER, etc. only
- handle_ok() will be invoked, in case of success.
-
- All statements that result in an error will invoke handle_error().
-
- For statements that return a result set, handle_error() might be invoked
- even after metadata was sent. This will indicate an error during the
- execution of the statement.
- */
-
- /*** Getting metadata ***/
- /**
- Indicates beginning of metadata for the result set
-
- @param ctx Plugin's context
- @param num_cols Number of fields being sent
- @param flags Flags to alter the metadata sending
- @param resultcs Charset of the result set
-
- @note resultcs is the charset in which the data should be encoded before
- sent to the client. This is the value of the session variable
- character_set_results. The implementor most probably will need to save
- this value in the context and use it as "to" charset in get_string().
-
- In case of CS_BINARY_REPRESENTATION, get_string() receives as a parameter
- the charset of the string, as it is stored on disk.
-
- In case of CS_TEXT_REPRESENTATION, the string value might be already a
- stringified value or non-string data, which is in character_set_results.
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*start_result_metadata)(void *ctx, uint num_cols, uint flags,
- const CHARSET_INFO *resultcs);
-
- /**
- Field metadata is provided via this callback
-
- @param ctx Plugin's context
- @param field Field's metadata (see field.h)
- @param charset Field's charset
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*field_metadata)(void *ctx, struct st_send_field *field,
- const CHARSET_INFO *charset);
-
- /**
- Indicates end of metadata for the result set
-
- @param ctx Plugin's context
- @param server_status Status of server (see mysql_com.h, SERVER_STATUS_*)
- @param warn_count Number of warnings generated during execution to the
- moment when the metadata is sent.
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*end_result_metadata)(void *ctx, uint server_status,
- uint warn_count);
-
- /**
- Indicates the beginning of a new row in the result set/metadata
-
- @param ctx Plugin's context
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*start_row)(void *ctx);
-
- /**
- Indicates the end of the current row in the result set/metadata
-
- @param ctx Plugin's context
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*end_row)(void *ctx);
-
- /**
- An error occured during execution
-
- @details This callback indicates that an error occured during command
- execution and the partial row should be dropped. Server will raise error
- and return.
-
- @param ctx Plugin's context
-
- @returns
- true an error occured, server will abort the command
- false ok
-
- */
- void (*abort_row)(void *ctx);
-
- /**
- Return client's capabilities (see mysql_com.h, CLIENT_*)
-
- @param ctx Plugin's context
-
- @return Bitmap of client's capabilities
- */
- ulong (*get_client_capabilities)(void *ctx);
-
- /****** Getting data ******/
- /**
- Receive NULL value from server
-
- @param ctx Plugin's context
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_null)(void * ctx);
-
- /**
- Receive TINY/SHORT/LONG value from server
-
- @param ctx Plugin's context
- @param value Value received
-
- @note In order to know which type exactly was received, the plugin must
- track the metadata that was sent just prior to the result set.
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_integer)(void * ctx, longlong value);
-
- /**
- Get LONGLONG value from server
-
- @param ctx Plugin's context
- @param value Value received
- @param is_unsigned TRUE <=> value is unsigned
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_longlong)(void * ctx, longlong value, uint is_unsigned);
-
- /**
- Receive DECIMAL value from server
-
- @param ctx Plugin's context
- @param value Value received
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_decimal)(void * ctx, const decimal_t * value);
-
- /**
- Receive FLOAT/DOUBLE from server
-
- @param ctx Plugin's context
- @param value Value received
- @param decimals Number of decimals
-
- @note In order to know which type exactly was received, the plugin must
- track the metadata that was sent just prior to the result set.
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_double)(void * ctx, double value, uint32_t decimals);
-
- /**
- Get DATE value from server
-
- @param ctx Plugin's context
- @param value Value received
-
- @returns
- 1 an error occured during storing, server will abort the command
- 0 ok
- */
- int (*get_date)(void * ctx, const MYSQL_TIME * value);
-
- /**
- Receive TIME value from server
-
- @param ctx Plugin's context
- @param value Value received
- @param decimals Number of decimals
-
- @returns
- 1 an error occured during storing, server will abort the command
- 0 ok
- */
- int (*get_time)(void * ctx, const MYSQL_TIME * value, uint decimals);
-
- /**
- Receive DATETIME value from server
-
- @param ctx Plugin's context
- @param value Value received
- @param decimals Number of decimals
-
- @returns
- 1 an error occured during storing, server will abort the command
- 0 ok
- */
- int (*get_datetime)(void * ctx, const MYSQL_TIME * value, uint decimals);
-
- /**
- Get STRING value from server
-
- @param ctx Plugin's context
- @param value Data
- @param length Data length
- @param valuecs Data charset
-
- @note In case of CS_BINARY_REPRESENTATION, get_string() receives as
- a parameter the charset of the string, as it is stored on disk.
-
- In case of CS_TEXT_REPRESENTATION, the string value might be already a
- stringified value or non-string data, which is in character_set_results.
-
- @see start_result_metadata()
-
- @returns
- 1 an error occured, server will abort the command
- 0 ok
- */
- int (*get_string)(void * ctx, const char * value, size_t length,
- const CHARSET_INFO * valuecs);
-
- /****** Getting execution status ******/
- /**
- Command ended with success
-
- @param ctx Plugin's context
- @param server_status Status of server (see mysql_com.h,
- SERVER_STATUS_*)
- @param statement_warn_count Number of warnings thrown during execution
- @param affected_rows Number of rows affected by the command
- @param last_insert_id Last insert id being assigned during execution
- @param message A message from server
- */
- void (*handle_ok)(void * ctx,
- uint server_status, uint statement_warn_count,
- ulonglong affected_rows, ulonglong last_insert_id,
- const char * message);
-
- /**
- Command ended with ERROR
-
- @param ctx Plugin's context
- @param sql_errno Error code
- @param err_msg Error message
- @param sqlstate SQL state correspongin to the error code
- */
- void (*handle_error)(void * ctx, uint sql_errno, const char * err_msg,
- const char * sqlstate);
-
- /**
- Callback for shutdown notification from the server.
-
- @param ctx Plugin's context
- @param server_shutdown Whether this is a normal connection shutdown (0) or
- server shutdown (1).
- */
- void (*shutdown)(void *ctx, int server_shutdown);
-};
-
-enum cs_text_or_binary
-{
- CS_TEXT_REPRESENTATION= 1, /* Let the server convert everything to string */
- CS_BINARY_REPRESENTATION= 2, /* Let the server use native types */
-};
-
-extern struct command_service_st {
- int (*run_command)(MYSQL_SESSION session,
- enum enum_server_command command,
- const union COM_DATA * data,
- const CHARSET_INFO * client_cs,
- const struct st_command_service_cbs * callbacks,
- enum cs_text_or_binary text_or_binary,
- void * service_callbacks_ctx);
-} *command_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define command_service_run_command(t, command, data, cset, cbs, t_or_b, ctx) \
- command_service->run_command((t), (command), (data), (cset), \
- (cbs), (t_or_b), (ctx))
-#else
-
-
-/**
- Executes a server command in a session.
-
-
- There are two cases. Execution in a physical thread :
- 1. initialized by the srv_session service
- 2. NOT initialized by the srv_session service
-
- In case of 1, if there is currently attached session, and it is
- different from the passed one, the former will be automatically
- detached. The session to be used for the execution will then be
- attached. After the command is executed, the attached session will
- not be detached. It will be detached by a next call to run_command()
- with another session as parameter. In other words, for all sessions
- used in a physical thread, there will be at most one in attached
- state.
-
- In case of 2, the current state (current_thd) will be
- preserved. Then the given session will move to attached state and
- the command will be executed. After the execution the state of the
- session will be changed to detached and the preserved state
- (current_thd) will be restored.
-
- The client charset is used for commands like COM_QUERY and
- COM_STMT_PREPARE to know how to threat the char* fields. This
- charset will be used until the next call of run_command when it may
- be changed again.
-
- @param session The session
- @param command The command to be executed.
- @param data The data needed for the command to be executed
- @param client_cs The charset for the string data input(COM_QUERY for example)
- @param callbacks Callbacks to be used by the server to encode data and
- to communicate with the client (plugin) side.
- @param text_or_binary Select which representation the server will use for the
- data passed to the callbacks. For more information
- @see cs_text_or_binary enum
- @param service_callbacks_ctx Context passed to the command service callbacks
-
- @return
- 0 success
- 1 failure
-*/
-int command_service_run_command(MYSQL_SESSION session,
- enum enum_server_command command,
- const union COM_DATA * data,
- const CHARSET_INFO * client_cs,
- const struct st_command_service_cbs * callbacks,
- enum cs_text_or_binary text_or_binary,
- void * service_callbacks_ctx);
-
-#endif /* MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/service_locking.h b/code/mysql/mysql/service_locking.h
deleted file mode 100644
index 7bb331b..0000000
--- a/code/mysql/mysql/service_locking.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef SERVICE_LOCKING_INCLUDED
-#define SERVICE_LOCKING_INCLUDED
-
-/*
- This service provides support for taking read/write locks.
- It is intended for use with fabric, but it is still a general
- service. The locks are in a separate namespace from other
- locks in the server, and there is also no interactions with
- transactions (i.e. locks are not released on commit/abort).
-
- These locks are implemented using the metadata lock (MDL) subsystem
- and thus deadlocks involving locking service locks and other types
- of metadata will be detected using the MDL deadlock detector.
-*/
-
-#ifdef __cplusplus
-class THD;
-#define MYSQL_THD THD*
-#else
-#define MYSQL_THD void*
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- Types of locking service locks.
- LOCKING_SERVICE_READ is compatible with LOCKING_SERVICE_READ.
- All other combinations are incompatible.
-*/
-enum enum_locking_service_lock_type
-{ LOCKING_SERVICE_READ, LOCKING_SERVICE_WRITE };
-
-extern struct mysql_locking_service_st {
- /**
- Acquire locking service locks.
-
- @param opaque_thd Thread handle. If NULL, current_thd will be used.
- @param lock_namespace Namespace of the locks to acquire.
- @param lock_names Array of names of the locks to acquire.
- @param lock_num Number of elements in 'lock_names'.
- @param lock_type Lock type to acquire. LOCKING_SERVICE_READ or _WRITE.
- @param lock_timeout Number of seconds to wait before giving up.
-
- @retval 1 Acquisition failed, error has been reported.
- @retval 0 Acquisition successful, all locks acquired.
-
- @note both lock_namespace and lock_names are limited to 64 characters max.
- Names are compared using binary comparison.
- */
- int (*mysql_acquire_locks)(MYSQL_THD opaque_thd, const char* lock_namespace,
- const char**lock_names, size_t lock_num,
- enum enum_locking_service_lock_type lock_type,
- unsigned long lock_timeout);
-
- /**
- Release all lock service locks taken by the given connection
- in the given namespace.
-
- @param opaque_thd Thread handle. If NULL, current_thd will be used.
- @param lock_namespace Namespace of the locks to release.
-
- @retval 1 Release failed, error has been reported.
- @retval 0 Release successful, all locks acquired.
- */
- int (*mysql_release_locks)(MYSQL_THD opaque_thd, const char* lock_namespace);
-} *mysql_locking_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define mysql_acquire_locking_service_locks(_THD, _NAMESPACE, _NAMES, _NUM, \
- _TYPE, _TIMEOUT) \
- mysql_locking_service->mysql_acquire_locks(_THD, _NAMESPACE, _NAMES, _NUM, \
- _TYPE, _TIMEOUT)
-#define mysql_release_locking_service_locks(_THD, _NAMESPACE) \
- mysql_locking_service->mysql_release_locks(_THD, _NAMESPACE)
-
-#else
-
-int mysql_acquire_locking_service_locks(MYSQL_THD opaque_thd,
- const char* lock_namespace,
- const char**lock_names,
- size_t lock_num,
- enum enum_locking_service_lock_type lock_type,
- unsigned long lock_timeout);
-
-int mysql_release_locking_service_locks(MYSQL_THD opaque_thd,
- const char* lock_namespace);
-
-#endif /* MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SERVICE_LOCKING_INCLUDED */
diff --git a/code/mysql/mysql/service_my_plugin_log.h b/code/mysql/mysql/service_my_plugin_log.h
deleted file mode 100644
index 88bb0be..0000000
--- a/code/mysql/mysql/service_my_plugin_log.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
- This service provides functions to report error conditions and log to
- mysql error log.
-*/
-
-#ifndef MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
-#define MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-/* keep in sync with the loglevel enum in my_sys.h */
-enum plugin_log_level
-{
- MY_ERROR_LEVEL,
- MY_WARNING_LEVEL,
- MY_INFORMATION_LEVEL
-};
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct my_plugin_log_service
-{
- /** write a message to the log */
- int (*my_plugin_log_message)(MYSQL_PLUGIN *, enum plugin_log_level, const char *, ...);
-} *my_plugin_log_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_plugin_log_message my_plugin_log_service->my_plugin_log_message
-
-#else
-
-int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level,
- const char *format, ...);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/service_my_snprintf.h b/code/mysql/mysql/service_my_snprintf.h
deleted file mode 100644
index 1b44492..0000000
--- a/code/mysql/mysql/service_my_snprintf.h
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
-#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
- my_snprintf service
-
- Portable and limited vsnprintf() implementation.
-
- This is a portable, limited vsnprintf() implementation, with some
- extra features. "Portable" means that it'll produce identical result
- on all platforms (for example, on Windows and Linux system printf %e
- formats the exponent differently, on different systems %p either
- prints leading 0x or not, %s may accept null pointer or crash on
- it). "Limited" means that it does not support all the C89 features.
- But it supports few extensions, not in any standard.
-
- my_vsnprintf(to, n, fmt, ap)
-
- @param[out] to A buffer to store the result in
- @param[in] n Store up to n-1 characters, followed by an end 0
- @param[in] fmt printf-like format string
- @param[in] ap Arguments
-
- @return a number of bytes written to a buffer *excluding* terminating '\0'
-
- @post
- The syntax of a format string is generally the same:
- %
- where everithing but the format is optional.
-
- Three one-character flags are recognized:
- '0' has the standard zero-padding semantics;
- '-' is parsed, but silently ignored;
- '`' (backtick) is only supported for strings (%s) and means that the
- string will be quoted according to MySQL identifier quoting rules.
-
- Both and can be specified as numbers or '*'.
- If an asterisk is used, an argument of type int is consumed.
-
- can be 'l', 'll', or 'z'.
-
- Supported formats are 's' (null pointer is accepted, printed as
- "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
- 'X', 'p' (works as 0x%x).
-
- Standard syntax for positional arguments $n is supported.
-
- Extensions:
-
- Flag '`' (backtick): see above.
-
- Format 'b': binary buffer, prints exactly bytes from the
- argument, without stopping at '\0'.
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#include
-#endif
-
-extern struct my_snprintf_service_st {
- size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
- size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
-} *my_snprintf_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
-#define my_snprintf my_snprintf_service->my_snprintf_type
-
-#else
-
-size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
-size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* #define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED */
diff --git a/code/mysql/mysql/service_mysql_alloc.h b/code/mysql/mysql/service_mysql_alloc.h
deleted file mode 100644
index 99bf2ad..0000000
--- a/code/mysql/mysql/service_mysql_alloc.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED
-#define MYSQL_SERVICE_MYSQL_ALLOC_INCLUDED
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-/* PSI_memory_key */
-#include "mysql/psi/psi_memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* myf */
-typedef int myf_t;
-
-typedef void * (*mysql_malloc_t)(PSI_memory_key key, size_t size, myf_t flags);
-typedef void * (*mysql_realloc_t)(PSI_memory_key key, void *ptr, size_t size, myf_t flags);
-typedef void (*mysql_claim_t)(void *ptr);
-typedef void (*mysql_free_t)(void *ptr);
-typedef void * (*my_memdup_t)(PSI_memory_key key, const void *from, size_t length, myf_t flags);
-typedef char * (*my_strdup_t)(PSI_memory_key key, const char *from, myf_t flags);
-typedef char * (*my_strndup_t)(PSI_memory_key key, const char *from, size_t length, myf_t flags);
-
-struct mysql_malloc_service_st
-{
- mysql_malloc_t mysql_malloc;
- mysql_realloc_t mysql_realloc;
- mysql_claim_t mysql_claim;
- mysql_free_t mysql_free;
- my_memdup_t my_memdup;
- my_strdup_t my_strdup;
- my_strndup_t my_strndup;
-};
-
-extern struct mysql_malloc_service_st *mysql_malloc_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_malloc mysql_malloc_service->mysql_malloc
-#define my_realloc mysql_malloc_service->mysql_realloc
-#define my_claim mysql_malloc_service->mysql_claim
-#define my_free mysql_malloc_service->mysql_free
-#define my_memdup mysql_malloc_service->my_memdup
-#define my_strdup mysql_malloc_service->my_strdup
-#define my_strndup mysql_malloc_service->my_strndup
-
-#else
-
-extern void * my_malloc(PSI_memory_key key, size_t size, myf_t flags);
-extern void * my_realloc(PSI_memory_key key, void *ptr, size_t size, myf_t flags);
-extern void my_claim(void *ptr);
-extern void my_free(void *ptr);
-extern void * my_memdup(PSI_memory_key key, const void *from, size_t length, myf_t flags);
-extern char * my_strdup(PSI_memory_key key, const char *from, myf_t flags);
-extern char * my_strndup(PSI_memory_key key, const char *from, size_t length, myf_t flags);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/code/mysql/mysql/service_mysql_keyring.h b/code/mysql/mysql/service_mysql_keyring.h
deleted file mode 100644
index 40f3cef..0000000
--- a/code/mysql/mysql/service_mysql_keyring.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_MYSQL_PLUGIN_KEYRING_INCLUDED
-#define MYSQL_SERVICE_MYSQL_PLUGIN_KEYRING_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct mysql_keyring_service_st
-{
- int (*my_key_store_func)(const char *, const char *, const char *,
- const void *, size_t);
- int (*my_key_fetch_func)(const char *, char **, const char *, void **,
- size_t *);
- int (*my_key_remove_func)(const char *, const char *);
- int (*my_key_generate_func)(const char *, const char *, const char *,
- size_t);
-} *mysql_keyring_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_key_store(key_id, key_type, user_id, key, key_len) \
- mysql_keyring_service->my_key_store_func(key_id, key_type, user_id, key, \
- key_len)
-#define my_key_fetch(key_id, key_type, user_id, key, key_len) \
- mysql_keyring_service->my_key_fetch_func(key_id, key_type, user_id, key, \
- key_len)
-#define my_key_remove(key_id, user_id) \
- mysql_keyring_service->my_key_remove_func(key_id, user_id)
-#define my_key_generate(key_id, key_type, user_id, key_len) \
- mysql_keyring_service->my_key_generate_func(key_id, key_type, user_id, \
- key_len)
-#else
-
-int my_key_store(const char *, const char *, const char *, const void *, size_t);
-int my_key_fetch(const char *, char **, const char *, void **,
- size_t *);
-int my_key_remove(const char *, const char *);
-int my_key_generate(const char *, const char *, const char *, size_t);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //MYSQL_SERVICE_MYSQL_PLUGIN_KEYRING_INCLUDED
-
diff --git a/code/mysql/mysql/service_mysql_password_policy.h b/code/mysql/mysql/service_mysql_password_policy.h
deleted file mode 100644
index ef2f37d..0000000
--- a/code/mysql/mysql/service_mysql_password_policy.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_MYSQL_PLUGIN_AUTH_INCLUDED
-#define MYSQL_SERVICE_MYSQL_PLUGIN_AUTH_INCLUDED
-
-/**
- @file include/mysql/service_mysql_plugin_auth.h
- This service provides functions to validatete password, check for strength
- of password based on common policy.
-
- SYNOPSIS
- my_validate_password_policy() - function to validate password
- based on defined policy
- const char* buffer holding the password value
- unsigned int buffer length
-
- my_calculate_password_strength() - function to calculate strength
- of the password based on the policies defined.
- const char* buffer holding the password value
- unsigned int buffer length
-
- Both the service function returns 0 on SUCCESS and 1 incase input password does not
- match against the policy rules defined.
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct mysql_password_policy_service_st {
- int (*my_validate_password_policy_func)(const char *, unsigned int);
- int (*my_calculate_password_strength_func)(const char *, unsigned int);
-} *mysql_password_policy_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_validate_password_policy(buffer, length) \
- mysql_password_policy_service->my_validate_password_policy_func(buffer, length)
-#define my_calculate_password_strength(buffer, length) \
- mysql_password_policy_service->my_calculate_password_strength_func(buffer, length)
-
-#else
-
-int my_validate_password_policy(const char *, unsigned int);
-int my_calculate_password_strength(const char *, unsigned int);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/service_mysql_string.h b/code/mysql/mysql/service_mysql_string.h
deleted file mode 100644
index 3221195..0000000
--- a/code/mysql/mysql/service_mysql_string.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/* This service provides functions to parse mysql String */
-
-#ifndef MYSQL_SERVICE_MYSQL_STRING_INCLUDED
-#define MYSQL_SERVICE_MYSQL_STRING_INCLUDED
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *mysql_string_iterator_handle;
-typedef void *mysql_string_handle;
-
-extern struct mysql_string_service_st {
- int (*mysql_string_convert_to_char_ptr_type)
- (mysql_string_handle, const char *, char *, unsigned int, int *);
- mysql_string_iterator_handle (*mysql_string_get_iterator_type)
- (mysql_string_handle);
- int (*mysql_string_iterator_next_type)(mysql_string_iterator_handle);
- int (*mysql_string_iterator_isupper_type)(mysql_string_iterator_handle);
- int (*mysql_string_iterator_islower_type)(mysql_string_iterator_handle);
- int (*mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle);
- mysql_string_handle (*mysql_string_to_lowercase_type)(mysql_string_handle);
- void (*mysql_string_free_type)(mysql_string_handle);
- void (*mysql_string_iterator_free_type)(mysql_string_iterator_handle);
-} *mysql_string_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define mysql_string_convert_to_char_ptr(string_handle, charset_name, \
- buffer, buffer_size, error) \
- mysql_string_service->mysql_string_convert_to_char_ptr_type \
- (string_handle, charset_name, buffer, \
- buffer_size, error)
-
-#define mysql_string_get_iterator(string_handle) \
- mysql_string_service->mysql_string_get_iterator_type(string_handle)
-
-#define mysql_string_iterator_next(iterator_handle) \
- mysql_string_service->mysql_string_iterator_next_type(iterator_handle)
-
-#define mysql_string_iterator_isupper(iterator_handle) \
- mysql_string_service->mysql_string_iterator_isupper_type \
- (iterator_handle)
-
-#define mysql_string_iterator_islower(iterator_handle) \
- mysql_string_service->mysql_string_iterator_islower_type \
- (iterator_handle)
-
-#define mysql_string_iterator_isdigit(iterator_handle) \
- mysql_string_service->mysql_string_iterator_isdigit_type \
- (iterator_handle)
-
-#define mysql_string_to_lowercase(string_handle) \
- mysql_string_service->mysql_string_to_lowercase_type(string_handle)
-
-#define mysql_string_free(mysql_string_handle) \
- mysql_string_service->mysql_string_free_type(mysql_string_handle)
-
-#define mysql_string_iterator_free(mysql_string_iterator_handle) \
- mysql_string_service->mysql_string_iterator_free_type \
- (mysql_string_iterator_handle)
-#else
-
-/* This service function convert string into given character set */
-int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle,
- const char *charset_name, char *buffer,
- unsigned int buffer_size, int *error);
-
-/* This service function returns the beginning of the iterator handle */
-mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle
- string_handle);
-/*
- This service function gets the next iterator handle
- returns 0 if reached the end else return 1
-*/
-int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle);
-
-/*
- This service function return 1 if current iterator handle points to a
- uppercase character else return 0 for client character set.
-*/
-int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle);
-
-/*
- This service function return 1 if current iterator handle points to a
- lowercase character else return 0 for client character set.
-*/
-int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle);
-
-/*
- This service function return 1 if current iterator handle points to a digit
- else return 0 for client character sets.
-*/
-int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle);
-
-/* convert string_handle into lowercase */
-mysql_string_handle mysql_string_to_lowercase(mysql_string_handle
- string_handle);
-
-/* It deallocates the string created on server side during plugin operations */
-void mysql_string_free(mysql_string_handle);
-
-/*
- It deallocates the string iterator created on server side
- during plugin operations
-*/
-void mysql_string_iterator_free(mysql_string_iterator_handle);
-
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/service_parser.h b/code/mysql/mysql/service_parser.h
deleted file mode 100644
index 66b6740..0000000
--- a/code/mysql/mysql/service_parser.h
+++ /dev/null
@@ -1,292 +0,0 @@
-#ifndef MYSQL_SERVICE_PARSER_INCLUDED
-#define MYSQL_SERVICE_PARSER_INCLUDED
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include "my_md5_size.h"
-#include
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#ifdef __cplusplus
-class THD;
-class Item;
-#define MYSQL_THD THD*
-typedef Item* MYSQL_ITEM;
-#else
-#define MYSQL_THD void*
-typedef void* MYSQL_ITEM;
-#endif /* __cplusplus */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- @file service_parser
-
- Plugin service that provides access to the parser and some operations on the
- parse tree.
-*/
-
-#define PARSER_SERVICE_DIGEST_LENGTH MD5_HASH_SIZE
-
-#define STATEMENT_TYPE_SELECT 1
-#define STATEMENT_TYPE_OTHER 2
-
-typedef
-int (*parse_node_visit_function)(MYSQL_ITEM item, unsigned char* arg);
-
-
-typedef
-int (*sql_condition_handler_function)(int sql_errno,
- const char* sqlstate,
- const char* msg,
- void *state);
-
-struct st_my_thread_handle;
-
-extern struct mysql_parser_service_st {
-
- MYSQL_THD (*mysql_current_session)();
-
- MYSQL_THD (*mysql_open_session)();
-
- void (*mysql_start_thread)(MYSQL_THD thd, void *(*callback_fun)(void*),
- void *arg,
- struct st_my_thread_handle *thread_handle);
-
- void (*mysql_join_thread)(struct st_my_thread_handle *thread_handle);
-
- void (*mysql_set_current_database)(MYSQL_THD thd, const MYSQL_LEX_STRING db);
-
- /**
- Parses the query.
-
- @param thd The session in which to parse.
-
- @param query The query to parse.
-
- @param is_prepared If non-zero, the query will be parsed as a prepared
- statement and won't throw errors when the query string contains '?'.
-
- @param handle_condition Callback function that is called if a condition is
- raised during the preparation, parsing or cleanup after parsing. If this
- argument is non-NULL, the diagnostics area will be cleared before this
- function returns.
-
- @param condition_handler_state Will be passed to handle_condition when
- called. Otherwise ignored.
-
- @retval 0 Success.
- @retval 1 Parse error.
- */
- int (*mysql_parse)(MYSQL_THD thd, const MYSQL_LEX_STRING query,
- unsigned char is_prepared,
- sql_condition_handler_function handle_condition,
- void *condition_handler_state);
-
- int (*mysql_get_statement_type)(MYSQL_THD thd);
-
- /**
- Returns the digest of the last parsed statement in the session.
-
- @param thd The session in which the statement was parsed.
-
- @param digest[out] An area of at least size PARSER_SERVICE_DIGEST_LENGTH,
- where the digest is written.
-
- @retval 0 Success.
- @retval 1 Parse error.
- */
- int (*mysql_get_statement_digest)(MYSQL_THD thd, unsigned char *digest);
-
-
- /**
- Returns the number of parameters ('?') in the parsed query.
- This works only if the last query was parsed as a prepared statement.
-
- @param thd The session in which the query was parsed.
-
- @return The number of parameter markers.
- */
- int (*mysql_get_number_params)(MYSQL_THD thd);
-
-
- /**
- Stores in 'positions' the positions in the last parsed query of each
- parameter marker('?'). Positions must be an already allocated array of at
- least mysql_parser_service_st::mysql_get_number_params() size. This works
- only if the last query was parsed as a prepared statement.
-
- @param thd The session in which the query was parsed.
-
- @param positions An already allocated array of at least
- mysql_parser_service_st::mysql_get_number_params() size.
-
- @return The number of parameter markers and hence number of written
- positions.
- */
- int (*mysql_extract_prepared_params)(MYSQL_THD thd, int *positions);
-
-
- /**
- Walks the tree depth first and applies a user defined function on each
- literal.
-
- @param thd The session in which the query was parsed.
-
- @param processor Will be called for each literal in the parse tree.
-
- @param arg Will be passed as argument to each call to 'processor'.
- */
- int (*mysql_visit_tree)(MYSQL_THD thd, parse_node_visit_function processor,
- unsigned char* arg);
-
-
- /**
- Renders the MYSQL_ITEM as a string and returns a reference in the form of
- a MYSQL_LEX_STRING. The string buffer is allocated by the server and must
- be freed by mysql_free_string().
-
- @param item The literal to print.
-
- @return The result of printing the literal.
-
- @see mysql_parser_service_st::mysql_free_string().
- */
- MYSQL_LEX_STRING (*mysql_item_string)(MYSQL_ITEM item);
-
-
- /**
- Frees a string buffer allocated by the server.
-
- @param The string whose buffer will be freed.
- */
- void (*mysql_free_string)(MYSQL_LEX_STRING string);
-
-
- /**
- Returns the current query string. This string is managed by the server and
- should @b not be freed by a plugin.
-
- @param thd The session in which the query was submitted.
-
- @return The query string.
- */
- MYSQL_LEX_STRING (*mysql_get_query)(MYSQL_THD thd);
-
-
- /**
- Returns the current query in normalized form. This string is managed by
- the server and should @b not be freed by a plugin.
-
- @param thd The session in which the query was submitted.
-
- @return The query string normalized.
- */
- MYSQL_LEX_STRING (*mysql_get_normalized_query)(MYSQL_THD thd);
-} *mysql_parser_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define mysql_parser_current_session() \
- mysql_parser_service->mysql_current_session()
-
-#define mysql_parser_open_session() \
- mysql_parser_service->mysql_open_session()
-
-#define mysql_parser_start_thread(thd, func, arg, thread_handle) \
- mysql_parser_service->mysql_start_thread(thd, func, arg, thread_handle)
-
-#define mysql_parser_join_thread(thread_handle) \
- mysql_parser_service->mysql_join_thread(thread_handle)
-
-#define mysql_parser_set_current_database(thd, db) \
- mysql_parser_service->mysql_set_current_database(thd, db)
-
-#define mysql_parser_parse(thd, query, is_prepared, \
- condition_handler, condition_handler_state) \
- mysql_parser_service->mysql_parse(thd, query, is_prepared, \
- condition_handler, \
- condition_handler_state)
-
-#define mysql_parser_get_statement_type(thd) \
- mysql_parser_service->mysql_get_statement_type(thd)
-
-#define mysql_parser_get_statement_digest(thd, digest) \
- mysql_parser_service->mysql_get_statement_digest(thd, digest)
-
-#define mysql_parser_get_number_params(thd) \
- mysql_parser_service->mysql_get_number_params(thd)
-
-#define mysql_parser_extract_prepared_params(thd, positions) \
- mysql_parser_service->mysql_extract_prepared_params(thd, positions)
-
-#define mysql_parser_visit_tree(thd, processor, arg) \
- mysql_parser_service->mysql_visit_tree(thd, processor, arg)
-
-#define mysql_parser_item_string(item) \
- mysql_parser_service->mysql_item_string(item)
-
-#define mysql_parser_free_string(string) \
- mysql_parser_service->mysql_free_string(string)
-
-#define mysql_parser_get_query(thd) \
- mysql_parser_service->mysql_get_query(thd)
-
-#define mysql_parser_get_normalized_query(thd) \
- mysql_parser_service->mysql_get_normalized_query(thd)
-
-#else
-typedef void *(*callback_function)(void*);
-MYSQL_THD mysql_parser_current_session();
-MYSQL_THD mysql_parser_open_session();
-void mysql_parser_start_thread(MYSQL_THD thd, callback_function fun, void *arg,
- struct st_my_thread_handle *thread_handle);
-void mysql_parser_join_thread(struct st_my_thread_handle *thread_handle);
-void mysql_parser_set_current_database(MYSQL_THD thd,
- const MYSQL_LEX_STRING db);
-int mysql_parser_parse(MYSQL_THD thd, const MYSQL_LEX_STRING query,
- unsigned char is_prepared,
- sql_condition_handler_function handle_condition,
- void *condition_handler_state);
-int mysql_parser_get_statement_type(MYSQL_THD thd);
-int mysql_parser_get_statement_digest(MYSQL_THD thd, unsigned char *digest);
-int mysql_parser_get_number_params(MYSQL_THD thd);
-int mysql_parser_extract_prepared_params(MYSQL_THD thd, int *positions);
-int mysql_parser_visit_tree(MYSQL_THD thd, parse_node_visit_function processor,
- unsigned char* arg);
-MYSQL_LEX_STRING mysql_parser_item_string(MYSQL_ITEM item);
-void mysql_parser_free_string(MYSQL_LEX_STRING string);
-MYSQL_LEX_STRING mysql_parser_get_query(MYSQL_THD thd);
-MYSQL_LEX_STRING mysql_parser_get_normalized_query(MYSQL_THD thd);
-
-#endif /* MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MYSQL_SERVICE_PARSER_INCLUDED */
diff --git a/code/mysql/mysql/service_rpl_transaction_ctx.h b/code/mysql/mysql/service_rpl_transaction_ctx.h
deleted file mode 100644
index 8351b82..0000000
--- a/code/mysql/mysql/service_rpl_transaction_ctx.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_RPL_TRANSACTION_CTX_INCLUDED
-
-/**
- @file include/mysql/service_rpl_transaction_ctx.h
- This service provides a function for plugins to report if a transaction of a
- given THD should continue or be aborted.
-
- SYNOPSIS
- set_transaction_ctx()
- should be called during RUN_HOOK macro, on which we know that thread is
- on plugin context and it is before
- Rpl_transaction_ctx::is_transaction_rollback() check.
-*/
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct st_transaction_termination_ctx
-{
- unsigned long m_thread_id;
- unsigned int m_flags; // reserved
-
- /*
- If the instruction is to rollback the transaction,
- then this flag is set to false.
- Note: type is char like on my_bool.
- */
- char m_rollback_transaction;
-
- /*
- If the plugin has generated a GTID, then the follwoing
- fields MUST be set.
- Note: type is char like on my_bool.
- */
- char m_generated_gtid;
- int m_sidno;
- long long int m_gno;
-};
-typedef struct st_transaction_termination_ctx Transaction_termination_ctx;
-
-extern struct rpl_transaction_ctx_service_st {
- int (*set_transaction_ctx)(Transaction_termination_ctx transaction_termination_ctx);
-} *rpl_transaction_ctx_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define set_transaction_ctx(transaction_termination_ctx) \
- (rpl_transaction_ctx_service->set_transaction_ctx((transaction_termination_ctx)))
-
-#else
-
-int set_transaction_ctx(Transaction_termination_ctx transaction_termination_ctx);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#define MYSQL_SERVICE_RPL_TRANSACTION_CTX_INCLUDED
-#endif
diff --git a/code/mysql/mysql/service_rpl_transaction_write_set.h b/code/mysql/mysql/service_rpl_transaction_write_set.h
deleted file mode 100644
index 854842f..0000000
--- a/code/mysql/mysql/service_rpl_transaction_write_set.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_TRANSACTION_WRITE_SET_INCLUDED
-
-/**
- @file include/mysql/service_rpl_transaction_write_set.h
- This service provides a function for plugins to get the write set of a given
- transaction.
-
- SYNOPSIS
- get_transaction_write_set()
- This service is used to fetch the write_set extracted for the currently
- executing transaction by passing the thread_id as an input parameter for
- the method.
-
- @param [in] - thread_id - It is the thread identifier of the currently
- executing thread.
-
- In the current implementation it is being called during RUN_HOOK macro,
- on which we know that thread is on plugin context.
-
- Cleanup :
- The service caller must take of the memory allocated during the service
- call to prevent memory leaks.
-*/
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- This structure is used to keep the list of the hash values of the records
- changed in the transaction.
-*/
-struct st_trans_write_set
-{
- unsigned int m_flags; // reserved
- unsigned long write_set_size; // Size of the PKE set of the transaction.
- unsigned long long* write_set; // A pointer to the PKE set.
-};
-typedef struct st_trans_write_set Transaction_write_set;
-
-extern struct transaction_write_set_service_st {
- Transaction_write_set* (*get_transaction_write_set)(unsigned long m_thread_id);
-} *transaction_write_set_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define get_transaction_write_set(m_thread_id) \
- (transaction_write_set_service->get_transaction_write_set((m_thread_id)))
-
-#else
-
-Transaction_write_set* get_transaction_write_set(unsigned long m_thread_id);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#define MYSQL_SERVICE_TRANSACTION_WRITE_SET_INCLUDED
-#endif
diff --git a/code/mysql/mysql/service_rules_table.h b/code/mysql/mysql/service_rules_table.h
deleted file mode 100644
index 574a20c..0000000
--- a/code/mysql/mysql/service_rules_table.h
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifdef __cplusplus
-#ifndef SERVICE_RULES_TABLE_INCLUDED
-#define SERVICE_RULES_TABLE_INCLUDED
-
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include
-#include
-#include
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-
-/**
- @file service_rules_table.h
-
- Plugin service that provides access to the rewrite rules table that is used
- by the Rewriter plugin. No other use intended.
-*/
-
-class THD;
-struct TABLE_LIST;
-class Field;
-
-namespace rules_table_service
-{
-
-
-/**
- There must be one function of this kind in order for the symbols in the
- server's dynamic library to be visible to plugins.
-*/
-int dummy_function_to_ensure_we_are_linked_into_the_server();
-
-
-/**
- Frees a const char pointer allocated in the server's dynamic library using
- new[].
-*/
-void free_string(const char *str);
-
-
-/**
- Writable cursor that allows reading and updating of rows in a persistent
- table.
-*/
-class Cursor
-{
-public:
- typedef int column_id;
-
- static const column_id ILLEGAL_COLUMN_ID= -1;
-
- /**
- Creates a cursor to an already-opened table. The constructor is kept
- explicit because of implicit conversions from void*.
- */
- explicit Cursor(THD *thd);
-
- /// Creates a past-the-end cursor.
- Cursor() :
- m_thd(NULL), m_table_list(NULL), m_is_finished(true)
- {}
-
- column_id pattern_column() const { return m_pattern_column; }
- column_id pattern_database_column() const
- {
- return m_pattern_database_column;
- }
- column_id replacement_column() const { return m_replacement_column; }
- column_id enabled_column() const { return m_enabled_column; }
- column_id message_column() const { return m_message_column; }
- column_id pattern_digest_column() const { return m_pattern_digest_column; }
- column_id normalized_pattern_column() const {
- return m_normalized_pattern_column;
- }
-
- /**
- True if the table does not contain columns named 'pattern', 'replacement',
- 'enabled' and 'message'. In this case the cursor is equal to any
- past-the-end Cursor.
- */
- bool table_is_malformed() { return m_table_is_malformed; }
-
- /**
- Fetches the value of the column with the given number as a C string.
-
- This interface is meant for crossing dynamic library boundaries, hence the
- use of C-style const char*. The function casts a column value to a C
- string and returns a copy, allocated in the callee's DL. The pointer
- must be freed using free_string().
-
- @param fieldno One of PATTERN_COLUMN, REPLACEMENT_COLUMN, ENABLED_COLUMN
- or MESSAGE_COLUMN.
- */
- const char *fetch_string(int fieldno);
-
- /**
- Equality operator. The only cursors that are equal are past-the-end
- cursors.
- */
- bool operator== (const Cursor &other)
- {
- return (m_is_finished == other.m_is_finished);
- }
-
- /**
- Inequality operator. All cursors are considered different except
- past-the-end cursors.
- */
- bool operator!= (const Cursor &other) { return !(*this == other); }
-
- /**
- Advances this Cursor. Read errors are kept, and had_serious_read_error()
- will tell if there was an unexpected error (e.g. not EOF) while reading.
- */
- Cursor &operator++ ()
- {
- if (!m_is_finished)
- read();
- return *this;
- }
-
- /// Prepares the write buffer for updating the current row.
- void make_writeable();
-
- /**
- Sets the value of column colno to a string value.
-
- @param colno The column number.
- @param str The string.
- @param length The string's length.
- */
- void set(int colno, const char* str, size_t length);
-
- /// Writes the row in the write buffer to the table at the current row.
- int write();
-
- /// True if there was an unexpected error while reading, e.g. other than EOF.
- bool had_serious_read_error() const;
-
- /// Closes the table scan if initiated and commits the transaction.
- ~Cursor();
-
-private:
- int field_index(const char *field_name);
-
- int m_pattern_column;
- int m_pattern_database_column;
- int m_replacement_column;
- int m_enabled_column;
- int m_message_column;
- int m_pattern_digest_column;
- int m_normalized_pattern_column;
-
- THD *m_thd;
- TABLE_LIST *m_table_list;
-
- bool m_is_finished;
- bool m_table_is_malformed;
- int m_last_read_status;
-
- int read();
-};
-
-
-/**
- A past-the-end Cursor. All past-the-end cursors are considered equal
- when compared with operator ==.
-*/
-Cursor end();
-
-}
-
-#endif // SERVICE_RULES_TABLE_INCLUDED
-#endif // __cplusplus
diff --git a/code/mysql/mysql/service_security_context.h b/code/mysql/mysql/service_security_context.h
deleted file mode 100644
index 2527c0d..0000000
--- a/code/mysql/mysql/service_security_context.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_SECURITY_CONTEXT
-#define MYSQL_SERVICE_SECURITY_CONTEXT
-
-/**
- @file include/mysql/service_security_context.h
-
- This service provides functions for plugins and storage engines to
- manipulate the thread's security context.
-*/
-
-#ifdef __cplusplus
-class Security_context;
-#define MYSQL_SECURITY_CONTEXT Security_context*
-#else
-#define MYSQL_SECURITY_CONTEXT void*
-#endif
-typedef char my_svc_bool;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct security_context_service_st {
- my_svc_bool (*thd_get_security_context)(MYSQL_THD, MYSQL_SECURITY_CONTEXT *out_ctx);
- my_svc_bool (*thd_set_security_context)(MYSQL_THD, MYSQL_SECURITY_CONTEXT in_ctx);
-
- my_svc_bool (*security_context_create)(MYSQL_SECURITY_CONTEXT *out_ctx);
- my_svc_bool (*security_context_destroy)(MYSQL_SECURITY_CONTEXT);
- my_svc_bool (*security_context_copy)(MYSQL_SECURITY_CONTEXT in_ctx, MYSQL_SECURITY_CONTEXT *out_ctx);
-
- my_svc_bool (*security_context_lookup)(MYSQL_SECURITY_CONTEXT ctx,
- const char *user, const char *host,
- const char *ip, const char *db);
-
- my_svc_bool (*security_context_get_option)(MYSQL_SECURITY_CONTEXT, const char *name, void *inout_pvalue);
- my_svc_bool (*security_context_set_option)(MYSQL_SECURITY_CONTEXT, const char *name, void *pvalue);
-} *security_context_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define thd_get_security_context(_THD, _CTX) \
- security_context_service->thd_get_security_context(_THD, _CTX)
-#define thd_set_security_context(_THD, _CTX) \
- security_context_service->thd_set_security_context(_THD, _CTX)
-
-#define security_context_create(_CTX) \
- security_context_service->security_context_create(_CTX)
-#define security_context_destroy(_CTX) \
- security_context_service->security_context_destroy(_CTX)
-#define security_context_copy(_CTX1, _CTX2) \
- security_context_service->security_context_copy(_CTX1,_CTX2)
-
-#define security_context_lookup(_CTX, _U, _H, _IP, _DB) \
- security_context_service->security_context_lookup(_CTX, _U, _H, _IP, _DB)
-
-#define security_context_get_option(_SEC_CTX, _NAME, _VALUE) \
- security_context_service->security_context_get_option(_SEC_CTX, _NAME, _VALUE)
-#define security_context_set_option(_SEC_CTX, _NAME, _VALUE) \
- security_context_service->security_context_set_option(_SEC_CTX, _NAME, _VALUE)
-#else
- my_svc_bool thd_get_security_context(MYSQL_THD, MYSQL_SECURITY_CONTEXT *out_ctx);
- my_svc_bool thd_set_security_context(MYSQL_THD, MYSQL_SECURITY_CONTEXT in_ctx);
-
- my_svc_bool security_context_create(MYSQL_SECURITY_CONTEXT *out_ctx);
- my_svc_bool security_context_destroy(MYSQL_SECURITY_CONTEXT ctx);
- my_svc_bool security_context_copy(MYSQL_SECURITY_CONTEXT in_ctx, MYSQL_SECURITY_CONTEXT *out_ctx);
-
- my_svc_bool security_context_lookup(MYSQL_SECURITY_CONTEXT ctx,
- const char *user, const char *host,
- const char *ip, const char *db);
-
- my_svc_bool security_context_get_option(MYSQL_SECURITY_CONTEXT, const char *name, void *inout_pvalue);
- my_svc_bool security_context_set_option(MYSQL_SECURITY_CONTEXT, const char *name, void *pvalue);
-#endif /* !MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-}
-#endif /* _cplusplus */
-
-#endif /* !MYSQL_SERVICE_SECURITY_CONTEXT */
diff --git a/code/mysql/mysql/service_srv_session.h b/code/mysql/mysql/service_srv_session.h
deleted file mode 100644
index 2461827..0000000
--- a/code/mysql/mysql/service_srv_session.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#ifndef MYSQL_SRV_SESSION_SERVICE_INCLUDED
-#define MYSQL_SRV_SESSION_SERVICE_INCLUDED
-
-/**
- @file
- Header file for the Server session service. This service is to provide
- of creating sessions with the server. These sessions can be furtherly used
- together with the Command service to execute commands in the server.
-*/
-
-
-#ifdef __cplusplus
-class Srv_session;
-typedef class Srv_session* MYSQL_SESSION;
-#else
-struct Srv_session;
-typedef struct Srv_session* MYSQL_SESSION;
-#endif
-
-#ifndef MYSQL_ABI_CHECK
-#include "mysql/plugin.h" /* MYSQL_THD */
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*srv_session_error_cb)(void *ctx,
- unsigned int sql_errno,
- const char *err_msg);
-
-extern struct srv_session_service_st
-{
- int (*init_session_thread)(const void *plugin);
-
- void (*deinit_session_thread)();
-
- MYSQL_SESSION (*open_session)(srv_session_error_cb error_cb,
- void *plugix_ctx);
-
- int (*detach_session)(MYSQL_SESSION session);
-
- int (*close_session)(MYSQL_SESSION session);
-
- int (*server_is_available)();
-} *srv_session_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define srv_session_init_thread(plugin) \
- srv_session_service->init_session_thread((plugin))
-
-#define srv_session_deinit_thread() \
- srv_session_service->deinit_session_thread()
-
-#define srv_session_open(cb, ctx) \
- srv_session_service->open_session((cb), (ctx))
-
-#define srv_session_detach(session) \
- srv_session_service->detach_session((session))
-
-#define srv_session_close(session) \
- srv_session_service->close_session((session))
-
-#define srv_session_server_is_available() \
- srv_session_service->server_is_available()
-
-#else
-
-/**
- Initializes the current physical thread to use with session service.
-
- Call this function ONLY in physical threads which are not initialized in
- any way by the server.
-
- @param plugin Pointer to the plugin structure, passed to the plugin over
- the plugin init function.
-
- @return
- 0 success
- 1 failure
-*/
-int srv_session_init_thread(const void *plugin);
-
-/**
- Deinitializes the current physical thread to use with session service.
-
-
- Call this function ONLY in physical threads which were initialized using
- srv_session_init_thread().
-*/
-void srv_session_deinit_thread();
-
-/**
- Opens a server session.
-
- In a thread not initialized by the server itself, this function should be
- called only after srv_session_init_thread() has already been called.
-
- @param error_cb Default completion callback
- @param plugin_ctx Plugin's context, opaque pointer that would
- be provided to callbacks. Might be NULL.
- @return
- session on success
- NULL on failure
-*/
-MYSQL_SESSION srv_session_open(srv_session_error_cb cb, void *plugix_ctx);
-
-/**
- Detaches a session from current physical thread.
-
- Detaches a previously attached session. Sessions are automatically attached
- when they are used with the Command service (command_service_run_command()).
- If the session is opened in a spawned thread, then it will stay attached
- after command_service_run_command() until another session is used in the
- same physical thread. The command services will detach the previously used
- session and attach the one to be used for execution.
-
- This function should be called in case the session has to be used in
- different physical thread. It will unbound the session from the current
- physical thread. After that the session can be used in a different thread.
-
- @param session Session to detach
-
- @returns
- 0 success
- 1 failure
-*/
-int srv_session_detach(MYSQL_SESSION session);
-
-/**
- Closes a previously opened session.
-
- @param session Session to close
-
- @return
- 0 success
- 1 failure
-*/
-int srv_session_close(MYSQL_SESSION session);
-
-/**
- Returns if the server is available (not booting or shutting down)
-
- @return
- 0 not available
- 1 available
-*/
-int srv_session_server_is_available();
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MYSQL_SRV_SESSION_SERVICE_INCLUDED */
diff --git a/code/mysql/mysql/service_srv_session_info.h b/code/mysql/mysql/service_srv_session_info.h
deleted file mode 100644
index 336e7a0..0000000
--- a/code/mysql/mysql/service_srv_session_info.h
+++ /dev/null
@@ -1,180 +0,0 @@
-#ifndef MYSQL_SERVICE_SRV_SESSION_INFO_INCLUDED
-#define MYSQL_SERVICE_SRV_SESSION_INFO_INCLUDED
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
- Service providing setters and getters for some properties of a session
-*/
-
-
-#include "mysql/service_srv_session.h"
-#ifndef MYSQL_ABI_CHECK
-#include "my_thread.h" /* my_thread_id */
-#include "m_string.h" /* LEX_CSTRING */
-#include "plugin.h" /* MYSQL_THD */
-#include "mysql_com.h" /* Vio for violite.h */
-#include "violite.h" /* enum_vio_type */
-#include /* uint16_t */
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct srv_session_info_service_st {
- MYSQL_THD (*get_thd)(MYSQL_SESSION session);
-
- my_thread_id (*get_session_id)(MYSQL_SESSION session);
-
- LEX_CSTRING (*get_current_db)(MYSQL_SESSION session);
-
- uint16_t (*get_client_port)(MYSQL_SESSION session);
- int (*set_client_port)(MYSQL_SESSION session, uint16_t port);
-
- int (*set_connection_type)(MYSQL_SESSION session, enum enum_vio_type type);
-
- int (*killed)(MYSQL_SESSION session);
-
- unsigned int (*session_count)();
- unsigned int (*thread_count)(const void *plugin);
-} *srv_session_info_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define srv_session_info_get_thd(session) srv_session_info_service->get_thd((session))
-#define srv_session_info_get_session_id(sess) srv_session_info_service->get_session_id((sess))
-#define srv_session_info_get_current_db(sess) srv_session_info_service->get_current_db((sess))
-#define srv_session_info_get_client_port(sess) srv_session_info_service->get_client_port((sess))
-#define srv_session_info_set_client_port(sess, port) srv_session_info_service->set_client_port((sess), (port))
-#define srv_session_info_set_connection_type(sess, type) srv_session_info_service->set_connection_type((sess), (type))
-#define srv_session_info_killed(sess) srv_session_info_service->killed((sess))
-#define srv_session_info_session_count(sess) srv_session_info_service->session_count(sess)
-#define srv_session_info_thread_count(plugin) srv_session_info_service->thread_count(plugin)
-
-#else
-
-/**
- Returns the THD of a session.
-
- @param session Session
-
- @returns
- address of the THD
-*/
-MYSQL_THD srv_session_info_get_thd(MYSQL_SESSION session);
-
-/**
- Returns the ID of a session.
-
- @param session Session
-*/
-my_thread_id srv_session_info_get_session_id(MYSQL_SESSION session);
-
-/**
- Returns the current database of a session.
-
- @note {NULL, 0} is returned case of no current database or session is NULL
-
-
- @param session Session
-*/
-LEX_CSTRING srv_session_info_get_current_db(MYSQL_SESSION session);
-
-/**
- Returns the client port of a session.
-
- @note The client port in SHOW PROCESSLIST, INFORMATION_SCHEMA.PROCESSLIST.
- This port is NOT shown in PERFORMANCE_SCHEMA.THREADS.
-
- @param session Session
-*/
-uint16_t srv_session_info_get_client_port(MYSQL_SESSION session);
-
-/**
- Sets the client port of a session.
-
- @note The client port in SHOW PROCESSLIST, INFORMATION_SCHEMA.PROCESSLIST.
- This port is NOT shown in PERFORMANCE_SCHEMA.THREADS.
-
- @param session Session
- @param port Port number
-
- @return
- 0 success
- 1 failure
-*/
-int srv_session_info_set_client_port(MYSQL_SESSION session, uint16_t port);
-
-/**
- Sets the connection type of a session.
-
- @see enum_vio_type
-
- @note The type is shown in PERFORMANCE_SCHEMA.THREADS. The value is translated
- from the enum to a string according to @see vio_type_names array
- in vio/vio.c
-
- @note If NO_VIO_TYPE passed as type the call will fail.
-
- @return
- 0 success
- 1 failure
-*/
-int srv_session_info_set_connection_type(MYSQL_SESSION session,
- enum enum_vio_type type);
-
-/**
- Returns whether the session was killed
-
- @param session Session
-
- @return
- 0 not killed
- 1 killed
-*/
-int srv_session_info_killed(MYSQL_SESSION session);
-
-/**
- Returns the number opened sessions in thread initialized by srv_session
- service.
-*/
-unsigned int srv_session_info_session_count();
-
-
-/**
- Returns the number opened sessions in thread initialized by srv_session
- service.
-
- @param plugin Pointer to the plugin structure, passed to the plugin over
- the plugin init function.
-*/
-unsigned int srv_session_info_thread_count(const void *plugin);
-
-#endif /* MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* MYSQL_SERVICE_SRV_SESSION_INFO_INCLUDED */
diff --git a/code/mysql/mysql/service_ssl_wrapper.h b/code/mysql/mysql/service_ssl_wrapper.h
deleted file mode 100644
index 6f29464..0000000
--- a/code/mysql/mysql/service_ssl_wrapper.h
+++ /dev/null
@@ -1,180 +0,0 @@
-#ifndef SSL_WRAPPER_INCLUDED
-#define SSL_WRAPPER_INCLUDED
-
-/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include "violite.h"
-
-namespace ssl_wrappe_service
-{
-
-int MY_ATTRIBUTE((visibility("default")))
-dummy_function_to_ensure_we_are_linked_into_the_server();
-
-} // ssl_wrappe_service
-
-/**
- Return version of SSL used in currect connection
-
- @param vio VIO connection descriptor
- @param buffer Character buffer in which the version is going to be placed
- @param buffer_size Size of the character buffer
-*/
-extern "C"
-void ssl_wrapper_version(Vio *vio, char *version, const size_t version_size);
-
-/**
- Return cipher used in current connection
-
- @param vio VIO connection descriptor
- @param buffer Character buffer in which the cipher name is going to be placed
- @param buffer_size Size of the character buffer
-*/
-extern "C"
-void ssl_wrapper_cipher(Vio *vio, char *cipher, const size_t cipher_size);
-
-/**
- Return cipher list that can be used for SSL
-
- @param vio VIO connection descriptor
- @param clipher_list Pointer to an array of c-strings
- @param maximun_num_of_elements Size of the pointer array
-*/
-extern "C"
-long ssl_wrapper_cipher_list(Vio *vio, const char **clipher_list, const size_t maximun_num_of_elements);
-
-/**
- Return the verification depth limit set in SSL
-
- @param vio VIO connection descriptor
-
- @return
- -1 default values should be used
- >0 verification depth
-*/
-extern "C"
-long ssl_wrapper_verify_depth(Vio *vio);
-
-/**
- Return the verification mode set in SSL
-
- @param vio VIO connection descriptor
-
- @return
- -1 default values should be used
- >0 verification mode
-*/
-extern "C"
-long ssl_wrapper_verify_mode(Vio *vio);
-
-/**
- Return issuer name form peers ssl certificate
-
- @param vio VIO connection descriptor
- @param issuer Character buffer in which the issuer name is going to be placed
- @param issuer_size Size of character buffer for the issuer name
-*/
-extern "C"
-void ssl_wrapper_get_peer_certificate_issuer(Vio *vio, char *issuer, const size_t issuer_size);
-
-/**
- Return subject field form peers ssl certificate
-
- @param vio VIO connection descriptor
- @param subject Character buffer in which the subject is going to be placed
- @param subject_size Size of character buffer for the subject
-*/
-extern "C"
-void ssl_wrapper_get_peer_certificate_subject(Vio *vio, char *subject, const size_t subject_size);
-
-/**
- Check is peer certificate is present and try to verify it
-
- @param vio VIO connection descriptor
-
- @return
- X509_V_OK verification of peer certificate succeeded
- -1 verification failed
-*/
-extern "C"
-long ssl_wrapper_get_verify_result_and_cert(Vio *vio);
-
-/**
- Return the verification depth limit set in SSL context
-
- @param vio_ssl VIO SSL contex descriptor
-
- @return
- -1 default values should be used
- >0 verification depth
-*/
-extern "C"
-long ssl_wrapper_ctx_verify_depth(struct st_VioSSLFd *vio_ssl);
-
-/**
- Return the verification mode set in SSL context
-
- @param vio_ssl VIO SSL contex descriptor
-
- @return
- -1 default values should be used
- >0 verification mode
-*/
-extern "C"
-long ssl_wrapper_ctx_verify_mode(struct st_VioSSLFd *vio_ssl);
-
-/**
- Return the last day the server certificate is valid
-
- @param vio_ssl VIO SSL contex descriptor
- @param no_after Character buffer for to be filed with the date in human readble format
- @param no_after_size Size of the character buffer
-*/
-extern "C"
-void ssl_wrapper_ctx_server_not_after(struct st_VioSSLFd *vio_ssl, char *no_after, const size_t no_after_size);
-
-/**
- Return the first day the server certificate is valid
-
- @param vio_ssl VIO SSL contex descriptor
- @param no_before Character buffer for to be filed with the date in human readble format
- @param no_before_size Size of the character buffer
-*/
-extern "C"
-void ssl_wrapper_ctx_server_not_before(struct st_VioSSLFd *vio_ssl, char *no_before, const size_t no_before_size);
-
-extern "C"
-void ssl_wrapper_thread_cleanup();
-
-extern "C"
-long ssl_wrapper_sess_accept(struct st_VioSSLFd *vio_ssl);
-
-/**
- Cleanup data allocated by SSL on thread stack
-
-*/
-extern "C"
-long ssl_wrapper_sess_accept_good(struct st_VioSSLFd *vio_ssl);
-
-#endif /* SSL_WRAPPER_INCLUDED */
-
diff --git a/code/mysql/mysql/service_thd_alloc.h b/code/mysql/mysql/service_thd_alloc.h
deleted file mode 100644
index 9a843d1..0000000
--- a/code/mysql/mysql/service_thd_alloc.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-/**
- @file
- This service provdes functions to allocate memory in a connection local
- memory pool. The memory allocated there will be automatically freed at the
- end of the statement, don't use it for allocations that should live longer
- than that. For short living allocations this is more efficient than
- using my_malloc and friends, and automatic "garbage collection" allows not
- to think about memory leaks.
-
- The pool is best for small to medium objects, don't use it for large
- allocations - they are better served with my_malloc.
-*/
-
-#ifndef MYSQL_ABI_CHECK
-#include
-#endif
-
-#ifdef __cplusplus
-class THD;
-#define MYSQL_THD THD*
-#else
-#define MYSQL_THD void*
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include
-
-extern struct thd_alloc_service_st {
- void *(*thd_alloc_func)(MYSQL_THD, size_t);
- void *(*thd_calloc_func)(MYSQL_THD, size_t);
- char *(*thd_strdup_func)(MYSQL_THD, const char *);
- char *(*thd_strmake_func)(MYSQL_THD, const char *, size_t);
- void *(*thd_memdup_func)(MYSQL_THD, const void*, size_t);
- MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *,
- const char *, size_t, int);
-} *thd_alloc_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size)))
-
-#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size)))
-
-#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str)))
-
-#define thd_strmake(thd,str,size) \
- (thd_alloc_service->thd_strmake_func((thd), (str), (size)))
-
-#define thd_memdup(thd,str,size) \
- (thd_alloc_service->thd_memdup_func((thd), (str), (size)))
-
-#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \
- (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \
- (size), (allocate_lex_string)))
-
-#else
-
-/**
- Allocate memory in the connection's local memory pool
-
- @details
- When properly used in place of @c my_malloc(), this can significantly
- improve concurrency. Don't use this or related functions to allocate
- large chunks of memory. Use for temporary storage only. The memory
- will be freed automatically at the end of the statement; no explicit
- code is required to prevent memory leaks.
-
- @see alloc_root()
-*/
-void *thd_alloc(MYSQL_THD thd, size_t size);
-/**
- @see thd_alloc()
-*/
-void *thd_calloc(MYSQL_THD thd, size_t size);
-/**
- @see thd_alloc()
-*/
-char *thd_strdup(MYSQL_THD thd, const char *str);
-/**
- @see thd_alloc()
-*/
-char *thd_strmake(MYSQL_THD thd, const char *str, size_t size);
-/**
- @see thd_alloc()
-*/
-void *thd_memdup(MYSQL_THD thd, const void* str, size_t size);
-
-/**
- Create a LEX_STRING in this connection's local memory pool
-
- @param thd user thread connection handle
- @param lex_str pointer to LEX_STRING object to be initialized
- @param str initializer to be copied into lex_str
- @param size length of str, in bytes
- @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
- instead of using lex_str value
- @return NULL on failure, or pointer to the LEX_STRING object
-
- @see thd_alloc()
-*/
-MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
- const char *str, size_t size,
- int allocate_lex_string);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#define MYSQL_SERVICE_THD_ALLOC_INCLUDED
-#endif
-
diff --git a/code/mysql/mysql/service_thd_engine_lock.h b/code/mysql/mysql/service_thd_engine_lock.h
deleted file mode 100644
index 73aca0a..0000000
--- a/code/mysql/mysql/service_thd_engine_lock.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
-#define MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
-
-/**
- @file include/mysql/service_thd_engine_lock.h
- This service provides functions for storage engines to report
- lock related activities.
-
- SYNOPSIS
- thd_row_lock_wait() - call it just when the engine find a transaction should wait
- another transaction to realease a row lock
- thd The session which is waiting for the row lock to release.
- thd_wait_for The session which is holding the row lock.
-*/
-
-#ifdef __cplusplus
-class THD;
-#else
-#define THD void
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- void thd_report_row_lock_wait(THD* self, THD *wait_for);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/code/mysql/mysql/service_thd_wait.h b/code/mysql/mysql/service_thd_wait.h
deleted file mode 100644
index d498afe..0000000
--- a/code/mysql/mysql/service_thd_wait.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#ifndef MYSQL_SERVICE_THD_WAIT_INCLUDED
-#define MYSQL_SERVICE_THD_WAIT_INCLUDED
-
-/**
- @file include/mysql/service_thd_wait.h
- This service provides functions for plugins and storage engines to report
- when they are going to sleep/stall.
-
- SYNOPSIS
- thd_wait_begin() - call just before a wait begins
- thd Thread object
- Use NULL if the thd is NOT known.
- wait_type Type of wait
- 1 -- short wait (e.g. for mutex)
- 2 -- medium wait (e.g. for disk io)
- 3 -- large wait (e.g. for locked row/table)
- NOTES
- This is used by the threadpool to have better knowledge of which
- threads that currently are actively running on CPUs. When a thread
- reports that it's going to sleep/stall, the threadpool scheduler is
- free to start another thread in the pool most likely. The expected wait
- time is simply an indication of how long the wait is expected to
- become, the real wait time could be very different.
-
- thd_wait_end() called immediately after the wait is complete
-
- thd_wait_end() MUST be called if thd_wait_begin() was called.
-
- Using thd_wait_...() service is optional but recommended. Using it will
- improve performance as the thread pool will be more active at managing the
- thread workload.
-*/
-
-#ifdef __cplusplus
-class THD;
-#define MYSQL_THD THD*
-#else
-#define MYSQL_THD void*
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- One should only report wait events that could potentially block for a
- long time. A mutex wait is too short of an event to report. The reason
- is that an event which is reported leads to a new thread starts
- executing a query and this has a negative impact of usage of CPU caches
- and thus the expected gain of starting a new thread must be higher than
- the expected cost of lost performance due to starting a new thread.
-
- Good examples of events that should be reported are waiting for row locks
- that could easily be for many milliseconds or even seconds and the same
- holds true for global read locks, table locks and other meta data locks.
- Another event of interest is going to sleep for an extended time.
-
- Note that user-level locks no longer use THD_WAIT_USER_LOCK wait type.
- Since their implementation relies on metadata locks manager it uses
- THD_WAIT_META_DATA_LOCK instead.
-*/
-typedef enum _thd_wait_type_e {
- THD_WAIT_SLEEP= 1,
- THD_WAIT_DISKIO= 2,
- THD_WAIT_ROW_LOCK= 3,
- THD_WAIT_GLOBAL_LOCK= 4,
- THD_WAIT_META_DATA_LOCK= 5,
- THD_WAIT_TABLE_LOCK= 6,
- THD_WAIT_USER_LOCK= 7,
- THD_WAIT_BINLOG= 8,
- THD_WAIT_GROUP_COMMIT= 9,
- THD_WAIT_SYNC= 10,
- THD_WAIT_LAST= 11
-} thd_wait_type;
-
-extern struct thd_wait_service_st {
- void (*thd_wait_begin_func)(MYSQL_THD, int);
- void (*thd_wait_end_func)(MYSQL_THD);
-} *thd_wait_service;
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define thd_wait_begin(_THD, _WAIT_TYPE) \
- thd_wait_service->thd_wait_begin_func(_THD, _WAIT_TYPE)
-#define thd_wait_end(_THD) thd_wait_service->thd_wait_end_func(_THD)
-
-#else
-
-void thd_wait_begin(MYSQL_THD thd, int wait_type);
-void thd_wait_end(MYSQL_THD thd);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/code/mysql/mysql/service_thread_scheduler.h b/code/mysql/mysql/service_thread_scheduler.h
deleted file mode 100644
index ac05e75..0000000
--- a/code/mysql/mysql/service_thread_scheduler.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED
-#define SERVICE_THREAD_SCHEDULER_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Connection_handler_functions;
-struct THD_event_functions;
-
-extern struct my_thread_scheduler_service {
- int (*connection_handler_set)(struct Connection_handler_functions *,
- struct THD_event_functions *);
- int (*connection_handler_reset)();
-} *my_thread_scheduler_service;
-
-
-#ifdef MYSQL_DYNAMIC_PLUGIN
-
-#define my_connection_handler_set(F, M) \
- my_thread_scheduler_service->connection_handler_set((F), (M))
-#define my_connection_handler_reset() \
- my_thread_scheduler_service->connection_handler_reset()
-
-#else
-
-/**
- Instantiates Plugin_connection_handler based on the supplied
- Conection_handler_functions and sets it as the current
- connection handler.
-
- Also sets the THD_event_functions functions which will
- be called by the server when e.g. begining a wait.
-
- Remembers the existing connection handler so that it can be restored later.
-
- @param chf struct with functions to be called when e.g. handling
- new clients.
- @param tef struct with functions to be called when events
- (e.g. lock wait) happens.
-
- @note Both pointers (i.e. not the structs themselves) will be copied,
- so the structs must not disappear.
-
- @note We don't support dynamically loading more than one connection handler.
-
- @retval 1 failure
- @retval 0 success
-*/
-int my_connection_handler_set(struct Connection_handler_functions *chf,
- struct THD_event_functions *tef);
-
-/**
- Destroys the current connection handler and restores the previous.
- Should only be called after calling my_connection_handler_set().
-
- @retval 1 failure
- @retval 0 success
-*/
-int my_connection_handler_reset();
-
-#endif /* MYSQL_DYNAMIC_PLUGIN */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */
diff --git a/code/mysql/mysql/services.h b/code/mysql/mysql/services.h
deleted file mode 100644
index f11298f..0000000
--- a/code/mysql/mysql/services.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef MYSQL_SERVICES_INCLUDED
-/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License, version 2.0,
- as published by the Free Software Foundation.
-
- This program is also distributed with certain software (including
- but not limited to OpenSSL) that is licensed under separate terms,
- as designated in a particular file or component or in included license
- documentation. The authors of MySQL hereby grant you an additional
- permission to link the program and your derivative works with the
- separately licensed software that they have included with MySQL.
-
- 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, version 2.0, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-
-/*
- Out of extern because of inclusion of files which include my_compiler.h
- which in turn complains about C-linkage of templates.
- service_srv_session.h and service_command.h use proper extern "C" for
- their exported symbols.
-*/
-#ifndef EMBEDDED_LIBRARY
-#include
-#include
-#include
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include
-#include
-#include
-#include