diff --git a/changelog.txt b/changelog.txt index 11f7008383..c3c180c44f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,12 +6,17 @@ Version 1.10.1 - release: update to build libffi 3.4.4 - this is needed to work with newer mingw-w64 based toolchains for gcc 11.x and up - emscripten/fbc: in debug version of fbc (__FB_DEBUG__<>0) allow wchar conversion on win32 host to allow building and testing of the test-suite - github #421: fbc: win32/win64: pass '-fno-ident' to gcc to help prevent identification strings from accumulating in the final binary +- updated bindings: PostgreSQL to 14.0 +- updated bindings: sqlite to 3.39.4 +- updated bindings: curl to 7.85.0 +- updated bindings: BASS to 2.4.17.0 [added] - release: add recipes for building fbc distros using gcc-11.2 and gcc-12.2 Mingw-w64 project toolchains - release: add recipe for building fbc distros using winlibs-gcc-11.2/3/4 toolchain - fbc: '-fbgfx' command line option to link against correct libfbgfx variant, for platforms (emscripten) where it's not automatic due to missing objinfo support - basic-macros: better support for zstring and wstring conversion in evaluation of compile time arguments in __fb_query_symbol__, __fb_arg_extract__, __fb_iif__ +- added bindings: MariaDB 3.3.1 [fixed] - sf.net #982: Array descriptors emitted incorrectly in gcc backend diff --git a/inc/bass.bi b/inc/bass.bi index 4df37813fd..93ec308a86 100644 --- a/inc/bass.bi +++ b/inc/bass.bi @@ -2,7 +2,7 @@ '' '' based on the C header files: '' BASS 2.4 C/C++ header file -'' Copyright (c) 1999-2019 Un4seen Developments Ltd. +'' Copyright (c) 1999-2022 Un4seen Developments Ltd. '' '' See the BASS.CHM file for more detailed documentation '' @@ -25,7 +25,7 @@ '' package are the property of their respective owners. '' '' translated to FreeBASIC by: -'' Copyright © 2020 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once @@ -92,6 +92,7 @@ const BASS_ERROR_POSITION = 7 const BASS_ERROR_INIT = 8 const BASS_ERROR_START = 9 const BASS_ERROR_SSL = 10 +const BASS_ERROR_REINIT = 11 const BASS_ERROR_ALREADY = 14 const BASS_ERROR_NOTAUDIO = 17 const BASS_ERROR_NOCHAN = 18 @@ -119,6 +120,8 @@ const BASS_ERROR_CODEC = 44 const BASS_ERROR_ENDED = 45 const BASS_ERROR_BUSY = 46 const BASS_ERROR_UNSTREAMABLE = 47 +const BASS_ERROR_PROTOCOL = 48 +const BASS_ERROR_DENIED = 49 const BASS_ERROR_UNKNOWN = -1 const BASS_CONFIG_BUFFER = 0 const BASS_CONFIG_UPDATEPERIOD = 1 @@ -170,19 +173,31 @@ const BASS_CONFIG_ANDROID_SESSIONID = 62 const BASS_CONFIG_WASAPI_PERSIST = 65 const BASS_CONFIG_REC_WASAPI = 66 const BASS_CONFIG_ANDROID_AAUDIO = 67 +const BASS_CONFIG_SAMPLE_ONEHANDLE = 69 +const BASS_CONFIG_NET_META = 71 +const BASS_CONFIG_NET_RESTRATE = 72 +const BASS_CONFIG_REC_DEFAULT = 73 +const BASS_CONFIG_NORAMP = 74 const BASS_CONFIG_NET_AGENT = 16 const BASS_CONFIG_NET_PROXY = 17 const BASS_CONFIG_IOS_NOTIFY = 46 const BASS_CONFIG_LIBSSL = 64 +const BASS_CONFIG_FILENAME = 75 +const BASS_CONFIG_THREAD = &h40000000 const BASS_IOS_SESSION_MIX = 1 const BASS_IOS_SESSION_DUCK = 2 const BASS_IOS_SESSION_AMBIENT = 4 const BASS_IOS_SESSION_SPEAKER = 8 const BASS_IOS_SESSION_DISABLE = 16 +const BASS_IOS_SESSION_DEACTIVATE = 32 +const BASS_IOS_SESSION_AIRPLAY = 64 +const BASS_IOS_SESSION_BTHFP = 128 +const BASS_IOS_SESSION_BTA2DP = &h100 const BASS_DEVICE_8BITS = 1 const BASS_DEVICE_MONO = 2 const BASS_DEVICE_3D = 4 const BASS_DEVICE_16BITS = 8 +const BASS_DEVICE_REINIT = 128 const BASS_DEVICE_LATENCY = &h100 const BASS_DEVICE_CPSPEAKERS = &h400 const BASS_DEVICE_SPEAKERS = &h800 @@ -193,6 +208,7 @@ const BASS_DEVICE_STEREO = &h8000 const BASS_DEVICE_HOG = &h10000 const BASS_DEVICE_AUDIOTRACK = &h20000 const BASS_DEVICE_DSOUND = &h40000 +const BASS_DEVICE_SOFTWARE = &h80000 const BASS_OBJECT_DS = 1 const BASS_OBJECT_DS3DL = 2 @@ -206,6 +222,7 @@ const BASS_DEVICE_ENABLED = 1 const BASS_DEVICE_DEFAULT = 2 const BASS_DEVICE_INIT = 4 const BASS_DEVICE_LOOPBACK = 8 +const BASS_DEVICE_DEFAULTCOM = 128 const BASS_DEVICE_TYPE_MASK = &hff000000 const BASS_DEVICE_TYPE_NETWORK = &h01000000 const BASS_DEVICE_TYPE_SPEAKERS = &h02000000 @@ -237,13 +254,9 @@ type BASS_INFO freq as DWORD end type -const DSCAPS_CONTINUOUSRATE = &h00000010 const DSCAPS_EMULDRIVER = &h00000020 const DSCAPS_CERTIFIED = &h00000040 -const DSCAPS_SECONDARYMONO = &h00000100 -const DSCAPS_SECONDARYSTEREO = &h00000200 -const DSCAPS_SECONDARY8BIT = &h00000400 -const DSCAPS_SECONDARY16BIT = &h00000800 +const DSCAPS_HARDWARE = &h80000000 type BASS_RECORDINFO flags as DWORD @@ -336,7 +349,7 @@ const BASS_MUSIC_NOSAMPLE = &h100000 const BASS_SPEAKER_FRONT = &h1000000 const BASS_SPEAKER_REAR = &h2000000 const BASS_SPEAKER_CENLFE = &h3000000 -const BASS_SPEAKER_REAR2 = &h4000000 +const BASS_SPEAKER_SIDE = &h4000000 #define BASS_SPEAKER_N(n) ((n) shl 24) const BASS_SPEAKER_LEFT = &h10000000 const BASS_SPEAKER_RIGHT = &h20000000 @@ -346,13 +359,16 @@ const BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR or BASS_SPEAKER_LEFT const BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR or BASS_SPEAKER_RIGHT const BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE or BASS_SPEAKER_LEFT const BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE or BASS_SPEAKER_RIGHT -const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_LEFT -const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_RIGHT +const BASS_SPEAKER_SIDELEFT = BASS_SPEAKER_SIDE or BASS_SPEAKER_LEFT +const BASS_SPEAKER_SIDERIGHT = BASS_SPEAKER_SIDE or BASS_SPEAKER_RIGHT +const BASS_SPEAKER_REAR2 = BASS_SPEAKER_SIDE +const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_SIDELEFT +const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_SIDERIGHT const BASS_ASYNCFILE = &h40000000 const BASS_UNICODE = &h80000000 -const BASS_RECORD_PAUSE = &h8000 const BASS_RECORD_ECHOCANCEL = &h2000 const BASS_RECORD_AGC = &h4000 +const BASS_RECORD_PAUSE = &h8000 const BASS_VAM_HARDWARE = 1 const BASS_VAM_SOFTWARE = 2 const BASS_VAM_TERM_TIME = 4 @@ -383,6 +399,7 @@ const BASS_CTYPE_STREAM_AIFF = &h10006 const BASS_CTYPE_STREAM_CA = &h10007 const BASS_CTYPE_STREAM_MF = &h10008 const BASS_CTYPE_STREAM_AM = &h10009 +const BASS_CTYPE_STREAM_SAMPLE = &h1000a const BASS_CTYPE_STREAM_DUMMY = &h18000 const BASS_CTYPE_STREAM_DEVICE = &h18001 const BASS_CTYPE_STREAM_WAV = &h40000 @@ -394,6 +411,7 @@ const BASS_CTYPE_MUSIC_S3M = &h20002 const BASS_CTYPE_MUSIC_XM = &h20003 const BASS_CTYPE_MUSIC_IT = &h20004 const BASS_CTYPE_MUSIC_MO3 = &h00100 +const BASS_PLUGIN_PROC = 1 type BASS_PLUGINFORM ctype as DWORD @@ -420,63 +438,8 @@ const BASS_3DALG_DEFAULT = 0 const BASS_3DALG_OFF = 1 const BASS_3DALG_FULL = 2 const BASS_3DALG_LIGHT = 3 - -enum - EAX_ENVIRONMENT_GENERIC - EAX_ENVIRONMENT_PADDEDCELL - EAX_ENVIRONMENT_ROOM - EAX_ENVIRONMENT_BATHROOM - EAX_ENVIRONMENT_LIVINGROOM - EAX_ENVIRONMENT_STONEROOM - EAX_ENVIRONMENT_AUDITORIUM - EAX_ENVIRONMENT_CONCERTHALL - EAX_ENVIRONMENT_CAVE - EAX_ENVIRONMENT_ARENA - EAX_ENVIRONMENT_HANGAR - EAX_ENVIRONMENT_CARPETEDHALLWAY - EAX_ENVIRONMENT_HALLWAY - EAX_ENVIRONMENT_STONECORRIDOR - EAX_ENVIRONMENT_ALLEY - EAX_ENVIRONMENT_FOREST - EAX_ENVIRONMENT_CITY - EAX_ENVIRONMENT_MOUNTAINS - EAX_ENVIRONMENT_QUARRY - EAX_ENVIRONMENT_PLAIN - EAX_ENVIRONMENT_PARKINGLOT - EAX_ENVIRONMENT_SEWERPIPE - EAX_ENVIRONMENT_UNDERWATER - EAX_ENVIRONMENT_DRUGGED - EAX_ENVIRONMENT_DIZZY - EAX_ENVIRONMENT_PSYCHOTIC - EAX_ENVIRONMENT_COUNT -end enum - -#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC, 0.5f, 1.493f, 0.5f -#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL, 0.25f, 0.1f, 0.0f -#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM, 0.417f, 0.4f, 0.666f -#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM, 0.653f, 1.499f, 0.166f -#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM, 0.208f, 0.478f, 0.0f -#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM, 0.5f, 2.309f, 0.888f -#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM, 0.403f, 4.279f, 0.5f -#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL, 0.5f, 3.961f, 0.5f -#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE, 0.5f, 2.886f, 1.304f -#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA, 0.361f, 7.284f, 0.332f -#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR, 0.5f, 10.0f, 0.3f -#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153f, 0.259f, 2.0f -#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY, 0.361f, 1.493f, 0.0f -#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR, 0.444f, 2.697f, 0.638f -#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY, 0.25f, 1.752f, 0.776f -#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST, 0.111f, 3.145f, 0.472f -#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY, 0.111f, 2.767f, 0.224f -#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS, 0.194f, 7.841f, 0.472f -#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY, 1.0f, 1.499f, 0.5f -#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN, 0.097f, 2.767f, 0.224f -#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT, 0.208f, 1.652f, 1.5f -#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE, 0.652f, 2.886f, 0.25f -#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER, 1.0f, 1.499f, 0.0f -#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED, 0.875f, 8.392f, 1.388f -#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY, 0.139f, 17.234f, 0.666f -#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC, 0.486f, 7.563f, 0.806f +const BASS_SAMCHAN_NEW = 1 +const BASS_SAMCHAN_STREAM = 2 const BASS_STREAMPROC_END = &h80000000 const STREAMPROC_DUMMY = cptr(function(byval handle as HSTREAM, byval buffer as any ptr, byval length as DWORD, byval user as any ptr) as DWORD, 0) const STREAMPROC_PUSH = cptr(function(byval handle as HSTREAM, byval buffer as any ptr, byval length as DWORD, byval user as any ptr) as DWORD, -1) @@ -505,6 +468,7 @@ const BASS_FILEPOS_SOCKET = 6 const BASS_FILEPOS_ASYNCBUF = 7 const BASS_FILEPOS_SIZE = 8 const BASS_FILEPOS_BUFFERING = 9 +const BASS_FILEPOS_AVAILABLE = 10 const BASS_SYNC_POS = 0 const BASS_SYNC_END = 2 const BASS_SYNC_META = 4 @@ -541,6 +505,12 @@ const BASS_ATTRIB_NORAMP = 11 const BASS_ATTRIB_BITRATE = 12 const BASS_ATTRIB_BUFFER = 13 const BASS_ATTRIB_GRANULE = 14 +const BASS_ATTRIB_USER = 15 +const BASS_ATTRIB_TAIL = 16 +const BASS_ATTRIB_PUSH_LIMIT = 17 +const BASS_ATTRIB_DOWNLOADPROC = 18 +const BASS_ATTRIB_VOLDSP = 19 +const BASS_ATTRIB_VOLDSP_PRIORITY = 20 const BASS_ATTRIB_MUSIC_AMPLIFY = &h100 const BASS_ATTRIB_MUSIC_PANSEP = &h101 const BASS_ATTRIB_MUSIC_PSCALER = &h102 @@ -552,6 +522,7 @@ const BASS_ATTRIB_MUSIC_VOL_CHAN = &h200 const BASS_ATTRIB_MUSIC_VOL_INST = &h300 const BASS_SLIDE_LOG = &h1000000 const BASS_DATA_AVAILABLE = 0 +const BASS_DATA_NOREMOVE = &h10000000 const BASS_DATA_FIXED = &h20000000 const BASS_DATA_FLOAT = &h40000000 const BASS_DATA_FFT256 = &h80000000 @@ -571,6 +542,7 @@ const BASS_LEVEL_MONO = 1 const BASS_LEVEL_STEREO = 2 const BASS_LEVEL_RMS = 4 const BASS_LEVEL_VOLPAN = 8 +const BASS_LEVEL_NOREMOVE = 16 const BASS_TAG_ID3 = 0 const BASS_TAG_ID3V2 = 1 const BASS_TAG_OGG = 2 @@ -585,8 +557,10 @@ const BASS_TAG_LYRICS3 = 10 const BASS_TAG_CA_CODEC = 11 const BASS_TAG_MF = 13 const BASS_TAG_WAVEFORMAT = 14 -const BASS_TAG_AM_MIME = 15 const BASS_TAG_AM_NAME = 16 +const BASS_TAG_ID3V2_2 = 17 +const BASS_TAG_AM_MIME = 18 +const BASS_TAG_LOCATION = 19 const BASS_TAG_RIFF_INFO = &h100 const BASS_TAG_RIFF_BEXT = &h101 const BASS_TAG_RIFF_CART = &h102 @@ -599,6 +573,7 @@ const BASS_TAG_MUSIC_MESSAGE = &h10001 const BASS_TAG_MUSIC_ORDERS = &h10002 const BASS_TAG_MUSIC_AUTH = &h10003 const BASS_TAG_MUSIC_INST = &h10100 +const BASS_TAG_MUSIC_CHAN = &h10200 const BASS_TAG_MUSIC_SAMPLE = &h10300 type TAG_ID3 @@ -722,6 +697,9 @@ end type const BASS_POS_BYTE = 0 const BASS_POS_MUSIC_ORDER = 1 const BASS_POS_OGG = 3 +const BASS_POS_END = &h10 +const BASS_POS_LOOP = &h11 +const BASS_POS_FLUSH = &h1000000 const BASS_POS_RESET = &h2000000 const BASS_POS_RELATIVE = &h4000000 const BASS_POS_INEXACT = &h8000000 @@ -850,50 +828,43 @@ const BASS_IOSNOTIFY_INTERRUPT_END = 2 declare function BASS_SetConfig(byval option as DWORD, byval value as DWORD) as BOOL declare function BASS_GetConfig(byval option as DWORD) as DWORD declare function BASS_SetConfigPtr(byval option as DWORD, byval value as const any ptr) as BOOL -declare function BASS_GetConfigPtr(byval option as DWORD) as any ptr +declare function BASS_GetConfigPtr(byval option as DWORD) as const any ptr declare function BASS_GetVersion() as DWORD declare function BASS_ErrorGetCode() as long declare function BASS_GetDeviceInfo(byval device as DWORD, byval info as BASS_DEVICEINFO ptr) as BOOL #ifdef __FB_WIN32__ - declare function BASS_Init(byval device as long, byval freq as DWORD, byval flags as DWORD, byval win as HWND, byval dsguid as const GUID ptr) as BOOL + declare function BASS_Init(byval device as long, byval freq as DWORD, byval flags as DWORD, byval win as HWND, byval dsguid as const any ptr) as BOOL #else - declare function BASS_Init(byval device as long, byval freq as DWORD, byval flags as DWORD, byval win as any ptr, byval dsguid as any ptr) as BOOL + declare function BASS_Init(byval device as long, byval freq as DWORD, byval flags as DWORD, byval win as any ptr, byval dsguid as const any ptr) as BOOL #endif +declare function BASS_Free() as BOOL declare function BASS_SetDevice(byval device as DWORD) as BOOL declare function BASS_GetDevice() as DWORD -declare function BASS_Free() as BOOL - -#ifdef __FB_WIN32__ - declare function BASS_GetDSoundObject(byval object as DWORD) as any ptr -#endif - declare function BASS_GetInfo(byval info as BASS_INFO ptr) as BOOL -declare function BASS_Update(byval length as DWORD) as BOOL -declare function BASS_GetCPU() as single declare function BASS_Start() as BOOL declare function BASS_Stop() as BOOL declare function BASS_Pause() as BOOL -declare function BASS_IsStarted() as BOOL +declare function BASS_IsStarted() as DWORD +declare function BASS_Update(byval length as DWORD) as BOOL +declare function BASS_GetCPU() as single declare function BASS_SetVolume(byval volume as single) as BOOL declare function BASS_GetVolume() as single -declare function BASS_PluginLoad(byval file as const zstring ptr, byval flags as DWORD) as HPLUGIN -declare function BASS_PluginFree(byval handle as HPLUGIN) as BOOL -declare function BASS_PluginGetInfo(byval handle as HPLUGIN) as const BASS_PLUGININFO ptr + +#ifdef __FB_WIN32__ + declare function BASS_GetDSoundObject(byval object as DWORD) as any ptr +#endif + declare function BASS_Set3DFactors(byval distf as single, byval rollf as single, byval doppf as single) as BOOL declare function BASS_Get3DFactors(byval distf as single ptr, byval rollf as single ptr, byval doppf as single ptr) as BOOL declare function BASS_Set3DPosition(byval pos as const BASS_3DVECTOR ptr, byval vel as const BASS_3DVECTOR ptr, byval front as const BASS_3DVECTOR ptr, byval top as const BASS_3DVECTOR ptr) as BOOL declare function BASS_Get3DPosition(byval pos as BASS_3DVECTOR ptr, byval vel as BASS_3DVECTOR ptr, byval front as BASS_3DVECTOR ptr, byval top as BASS_3DVECTOR ptr) as BOOL declare sub BASS_Apply3D() - -#ifdef __FB_WIN32__ - declare function BASS_SetEAXParameters(byval env as long, byval vol as single, byval decay as single, byval damp as single) as BOOL - declare function BASS_GetEAXParameters(byval env as DWORD ptr, byval vol as single ptr, byval decay as single ptr, byval damp as single ptr) as BOOL -#endif - -declare function BASS_MusicLoad(byval mem as BOOL, byval file as const any ptr, byval offset as QWORD, byval length as DWORD, byval flags as DWORD, byval freq as DWORD) as HMUSIC -declare function BASS_MusicFree(byval handle as HMUSIC) as BOOL +declare function BASS_PluginLoad(byval file as const zstring ptr, byval flags as DWORD) as HPLUGIN +declare function BASS_PluginFree(byval handle as HPLUGIN) as BOOL +declare function BASS_PluginEnable(byval handle as HPLUGIN, byval enable as BOOL) as BOOL +declare function BASS_PluginGetInfo(byval handle as HPLUGIN) as const BASS_PLUGININFO ptr declare function BASS_SampleLoad(byval mem as BOOL, byval file as const any ptr, byval offset as QWORD, byval length as DWORD, byval max as DWORD, byval flags as DWORD) as HSAMPLE declare function BASS_SampleCreate(byval length as DWORD, byval freq as DWORD, byval chans as DWORD, byval max as DWORD, byval flags as DWORD) as HSAMPLE declare function BASS_SampleFree(byval handle as HSAMPLE) as BOOL @@ -901,7 +872,7 @@ declare function BASS_SampleSetData(byval handle as HSAMPLE, byval buffer as con declare function BASS_SampleGetData(byval handle as HSAMPLE, byval buffer as any ptr) as BOOL declare function BASS_SampleGetInfo(byval handle as HSAMPLE, byval info as BASS_SAMPLE ptr) as BOOL declare function BASS_SampleSetInfo(byval handle as HSAMPLE, byval info as const BASS_SAMPLE ptr) as BOOL -declare function BASS_SampleGetChannel(byval handle as HSAMPLE, byval onlynew as BOOL) as HCHANNEL +declare function BASS_SampleGetChannel(byval handle as HSAMPLE, byval flags as DWORD) as DWORD declare function BASS_SampleGetChannels(byval handle as HSAMPLE, byval channels as HCHANNEL ptr) as DWORD declare function BASS_SampleStop(byval handle as HSAMPLE) as BOOL declare function BASS_StreamCreate(byval freq as DWORD, byval chans as DWORD, byval flags as DWORD, byval proc as function(byval handle as HSTREAM, byval buffer as any ptr, byval length as DWORD, byval user as any ptr) as DWORD, byval user as any ptr) as HSTREAM @@ -912,11 +883,13 @@ declare function BASS_StreamFree(byval handle as HSTREAM) as BOOL declare function BASS_StreamGetFilePosition(byval handle as HSTREAM, byval mode as DWORD) as QWORD declare function BASS_StreamPutData(byval handle as HSTREAM, byval buffer as const any ptr, byval length as DWORD) as DWORD declare function BASS_StreamPutFileData(byval handle as HSTREAM, byval buffer as const any ptr, byval length as DWORD) as DWORD +declare function BASS_MusicLoad(byval mem as BOOL, byval file as const zstring ptr, byval offset as QWORD, byval length as DWORD, byval flags as DWORD, byval freq as DWORD) as HMUSIC +declare function BASS_MusicFree(byval handle as HMUSIC) as BOOL declare function BASS_RecordGetDeviceInfo(byval device as DWORD, byval info as BASS_DEVICEINFO ptr) as BOOL declare function BASS_RecordInit(byval device as long) as BOOL +declare function BASS_RecordFree() as BOOL declare function BASS_RecordSetDevice(byval device as DWORD) as BOOL declare function BASS_RecordGetDevice() as DWORD -declare function BASS_RecordFree() as BOOL declare function BASS_RecordGetInfo(byval info as BASS_RECORDINFO ptr) as BOOL declare function BASS_RecordGetInputName(byval input as long) as const zstring ptr declare function BASS_RecordSetInput(byval input as long, byval flags as DWORD, byval volume as single) as BOOL @@ -930,11 +903,13 @@ declare function BASS_ChannelIsActive(byval handle as DWORD) as DWORD declare function BASS_ChannelGetInfo(byval handle as DWORD, byval info as BASS_CHANNELINFO ptr) as BOOL declare function BASS_ChannelGetTags(byval handle as DWORD, byval tags as DWORD) as const zstring ptr declare function BASS_ChannelFlags(byval handle as DWORD, byval flags as DWORD, byval mask as DWORD) as DWORD -declare function BASS_ChannelUpdate(byval handle as DWORD, byval length as DWORD) as BOOL declare function BASS_ChannelLock(byval handle as DWORD, byval lock as BOOL) as BOOL +declare function BASS_ChannelFree(byval handle as DWORD) as BOOL declare function BASS_ChannelPlay(byval handle as DWORD, byval restart as BOOL) as BOOL +declare function BASS_ChannelStart(byval handle as DWORD) as BOOL declare function BASS_ChannelStop(byval handle as DWORD) as BOOL declare function BASS_ChannelPause(byval handle as DWORD) as BOOL +declare function BASS_ChannelUpdate(byval handle as DWORD, byval length as DWORD) as BOOL declare function BASS_ChannelSetAttribute(byval handle as DWORD, byval attrib as DWORD, byval value as single) as BOOL declare function BASS_ChannelGetAttribute(byval handle as DWORD, byval attrib as DWORD, byval value as single ptr) as BOOL declare function BASS_ChannelSlideAttribute(byval handle as DWORD, byval attrib as DWORD, byval value as single, byval time as DWORD) as BOOL @@ -953,15 +928,15 @@ declare function BASS_ChannelGetLevelEx(byval handle as DWORD, byval levels as s declare function BASS_ChannelGetData(byval handle as DWORD, byval buffer as any ptr, byval length as DWORD) as DWORD declare function BASS_ChannelSetSync(byval handle as DWORD, byval type as DWORD, byval param as QWORD, byval proc as sub(byval handle as HSYNC, byval channel as DWORD, byval data as DWORD, byval user as any ptr), byval user as any ptr) as HSYNC declare function BASS_ChannelRemoveSync(byval handle as DWORD, byval sync as HSYNC) as BOOL -declare function BASS_ChannelSetDSP(byval handle as DWORD, byval proc as sub(byval handle as HDSP, byval channel as DWORD, byval buffer as any ptr, byval length as DWORD, byval user as any ptr), byval user as any ptr, byval priority as long) as HDSP -declare function BASS_ChannelRemoveDSP(byval handle as DWORD, byval dsp as HDSP) as BOOL declare function BASS_ChannelSetLink(byval handle as DWORD, byval chan as DWORD) as BOOL declare function BASS_ChannelRemoveLink(byval handle as DWORD, byval chan as DWORD) as BOOL +declare function BASS_ChannelSetDSP(byval handle as DWORD, byval proc as sub(byval handle as HDSP, byval channel as DWORD, byval buffer as any ptr, byval length as DWORD, byval user as any ptr), byval user as any ptr, byval priority as long) as HDSP +declare function BASS_ChannelRemoveDSP(byval handle as DWORD, byval dsp as HDSP) as BOOL declare function BASS_ChannelSetFX(byval handle as DWORD, byval type as DWORD, byval priority as long) as HFX declare function BASS_ChannelRemoveFX(byval handle as DWORD, byval fx as HFX) as BOOL declare function BASS_FXSetParameters(byval handle as HFX, byval params as const any ptr) as BOOL declare function BASS_FXGetParameters(byval handle as HFX, byval params as any ptr) as BOOL -declare function BASS_FXReset(byval handle as HFX) as BOOL declare function BASS_FXSetPriority(byval handle as HFX, byval priority as long) as BOOL +declare function BASS_FXReset(byval handle as DWORD) as BOOL end extern diff --git a/inc/curl.bi b/inc/curl.bi index d4075bd5aa..89dbafe343 100644 --- a/inc/curl.bi +++ b/inc/curl.bi @@ -1,7 +1,7 @@ -'' FreeBASIC binding for curl-7.73.0 +'' FreeBASIC binding for curl-7.85.0 '' '' based on the C header files: -'' Copyright (c) 1996 - 2020, Daniel Stenberg, , and many +'' Copyright (c) 1996 - 2022, Daniel Stenberg, , and many '' contributors, see the THANKS file. '' '' All rights reserved. @@ -23,7 +23,7 @@ '' in this Software without prior written authorization of the copyright holder. '' '' translated to FreeBASIC by: -'' Copyright © 2020 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once @@ -51,13 +51,13 @@ extern "C" #define CURLINC_CURL_H #define CURLINC_CURLVER_H -#define LIBCURL_COPYRIGHT "1996 - 2020 Daniel Stenberg, ." -#define LIBCURL_VERSION "7.73.0" +#define LIBCURL_COPYRIGHT "1996 - 2022 Daniel Stenberg, ." +#define LIBCURL_VERSION "7.85.0" const LIBCURL_VERSION_MAJOR = 7 -const LIBCURL_VERSION_MINOR = 73 +const LIBCURL_VERSION_MINOR = 85 const LIBCURL_VERSION_PATCH = 0 -const LIBCURL_VERSION_NUM = &h074900 -#define LIBCURL_TIMESTAMP "2020-10-14" +const LIBCURL_VERSION_NUM = &h075500 +#define LIBCURL_TIMESTAMP "2022-08-31" #define CURL_VERSION_BITS(x, y, z) ((((x) shl 16) or ((y) shl 8)) or (z)) #define CURL_AT_LEAST_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) #define CURLINC_SYSTEM_H @@ -117,6 +117,7 @@ enum CURLSSLBACKEND_MBEDTLS = 11 CURLSSLBACKEND_MESALINK = 12 CURLSSLBACKEND_BEARSSL = 13 + CURLSSLBACKEND_RUSTLS = 14 end enum const CURLSSLBACKEND_LIBRESSL = CURLSSLBACKEND_OPENSSL @@ -286,6 +287,9 @@ enum end enum type curl_debug_callback as function(byval handle as CURL ptr, byval type as curl_infotype, byval data as zstring ptr, byval size as uinteger, byval userptr as any ptr) as long +type curl_prereq_callback as function(byval clientp as any ptr, byval conn_primary_ip as zstring ptr, byval conn_local_ip as zstring ptr, byval conn_primary_port as long, byval conn_local_port as long) as long +const CURL_PREREQFUNC_OK = 0 +const CURL_PREREQFUNC_ABORT = 1 type CURLcode as long enum @@ -338,7 +342,7 @@ enum CURLE_OBSOLETE46 CURLE_TOO_MANY_REDIRECTS CURLE_UNKNOWN_OPTION - CURLE_TELNET_OPTION_SYNTAX + CURLE_SETOPT_OPTION_SYNTAX CURLE_OBSOLETE50 CURLE_OBSOLETE51 CURLE_GOT_NOTHING @@ -351,7 +355,7 @@ enum CURLE_SSL_CIPHER CURLE_PEER_FAILED_VERIFICATION CURLE_BAD_CONTENT_ENCODING - CURLE_LDAP_INVALID_URL + CURLE_OBSOLETE62 CURLE_FILESIZE_EXCEEDED CURLE_USE_SSL_FAILED CURLE_SEND_FAIL_REWIND @@ -364,8 +368,8 @@ enum CURLE_TFTP_UNKNOWNID CURLE_REMOTE_FILE_EXISTS CURLE_TFTP_NOSUCHUSER - CURLE_CONV_FAILED - CURLE_CONV_REQD + CURLE_OBSOLETE75 + CURLE_OBSOLETE76 CURLE_SSL_CACERT_BADFILE CURLE_REMOTE_FILE_NOT_FOUND CURLE_SSH @@ -387,6 +391,8 @@ enum CURLE_HTTP3 CURLE_QUIC_CONNECT_ERROR CURLE_PROXY + CURLE_SSL_CLIENTCERT + CURLE_UNRECOVERABLE_POLL CURL_LAST end enum @@ -396,6 +402,7 @@ const CURLE_OBSOLETE12 = CURLE_FTP_ACCEPT_TIMEOUT const CURLE_FTP_WEIRD_SERVER_REPLY = CURLE_WEIRD_SERVER_REPLY const CURLE_SSL_CACERT = CURLE_PEER_FAILED_VERIFICATION const CURLE_UNKNOWN_TELNET_OPTION = CURLE_UNKNOWN_OPTION +const CURLE_TELNET_OPTION_SYNTAX = CURLE_SETOPT_OPTION_SYNTAX const CURLE_SSL_PEER_CERTIFICATE = CURLE_PEER_FAILED_VERIFICATION const CURLE_OBSOLETE = CURLE_OBSOLETE50 const CURLE_BAD_PASSWORD_ENTERED = CURLE_OBSOLETE46 @@ -423,6 +430,9 @@ const CURLE_HTTP_PORT_FAILED = CURLE_INTERFACE_FAILED const CURLE_FTP_COULDNT_STOR_FILE = CURLE_UPLOAD_FAILED const CURLE_FTP_PARTIAL_FILE = CURLE_PARTIAL_FILE const CURLE_FTP_BAD_DOWNLOAD_RESUME = CURLE_BAD_DOWNLOAD_RESUME +const CURLE_LDAP_INVALID_URL = CURLE_OBSOLETE62 +const CURLE_CONV_REQD = CURLE_OBSOLETE76 +const CURLE_CONV_FAILED = CURLE_OBSOLETE75 const CURLE_ALREADY_COMPLETE = 99999 type CURLproxycode as long @@ -488,6 +498,7 @@ const CURLAUTH_NTLM = cast(culong, 1) shl 3 const CURLAUTH_DIGEST_IE = cast(culong, 1) shl 4 const CURLAUTH_NTLM_WB = cast(culong, 1) shl 5 const CURLAUTH_BEARER = cast(culong, 1) shl 6 +const CURLAUTH_AWS_SIGV4 = cast(culong, 1) shl 7 const CURLAUTH_ONLY = cast(culong, 1) shl 31 const CURLAUTH_ANY = not CURLAUTH_DIGEST_IE const CURLAUTH_ANYSAFE = not (CURLAUTH_BASIC or CURLAUTH_DIGEST_IE) @@ -540,6 +551,7 @@ enum end enum type curl_sshkeycallback as function(byval easy as CURL ptr, byval knownkey as const curl_khkey ptr, byval foundkey as const curl_khkey ptr, byval as curl_khmatch, byval clientp as any ptr) as long +type curl_sshhostkeycallback as function(byval clientp as any ptr, byval keytype as long, byval key as const zstring ptr, byval keylen as uinteger) as long type curl_usessl as long enum @@ -555,6 +567,7 @@ const CURLSSLOPT_NO_REVOKE = 1 shl 1 const CURLSSLOPT_NO_PARTIALCHAIN = 1 shl 2 const CURLSSLOPT_REVOKE_BEST_EFFORT = 1 shl 3 const CURLSSLOPT_NATIVE_CA = 1 shl 4 +const CURLSSLOPT_AUTO_CLIENT_CERT = 1 shl 5 const CURL_HET_DEFAULT = cast(clong, 200) const CURL_UPKEEP_INTERVAL_DEFAULT = cast(clong, 60000) const CURLFTPSSL_NONE = CURLUSESSL_NONE @@ -599,11 +612,34 @@ end enum const CURLHEADER_UNIFIED = 0 const CURLHEADER_SEPARATE = 1 shl 0 -const CURLALTSVC_IMMEDIATELY = 1 shl 0 const CURLALTSVC_READONLYFILE = 1 shl 2 const CURLALTSVC_H1 = 1 shl 3 const CURLALTSVC_H2 = 1 shl 4 const CURLALTSVC_H3 = 1 shl 5 + +type curl_hstsentry + name as zstring ptr + namelen as uinteger + includeSubDomains : 1 as ulong + expire as zstring * 18 +end type + +type curl_index + index as uinteger + total as uinteger +end type + +type CURLSTScode as long +enum + CURLSTS_OK + CURLSTS_DONE + CURLSTS_FAIL +end enum + +type curl_hstsread_callback as function(byval easy as CURL ptr, byval e as curl_hstsentry ptr, byval userp as any ptr) as CURLSTScode +type curl_hstswrite_callback as function(byval easy as CURL ptr, byval e as curl_hstsentry ptr, byval i as curl_index ptr, byval userp as any ptr) as CURLSTScode +const CURLHSTS_ENABLE = cast(clong, 1 shl 0) +const CURLHSTS_READONLYFILE = cast(clong, 1 shl 1) const CURLPROTO_HTTP = 1 shl 0 const CURLPROTO_HTTPS = 1 shl 1 const CURLPROTO_FTP = 1 shl 2 @@ -633,6 +669,7 @@ const CURLPROTO_GOPHER = 1 shl 25 const CURLPROTO_SMB = 1 shl 26 const CURLPROTO_SMBS = 1 shl 27 const CURLPROTO_MQTT = 1 shl 28 +const CURLPROTO_GOPHERS = 1 shl 29 const CURLPROTO_ALL = not 0 const CURLOPTTYPE_LONG = 0 const CURLOPTTYPE_OBJECTPOINT = 10000 @@ -749,7 +786,7 @@ enum CURLOPT_SSL_CTX_DATA = CURLOPTTYPE_OBJECTPOINT + 109 CURLOPT_FTP_CREATE_MISSING_DIRS = CURLOPTTYPE_LONG + 110 CURLOPT_PROXYAUTH = CURLOPTTYPE_LONG + 111 - CURLOPT_FTP_RESPONSE_TIMEOUT = CURLOPTTYPE_LONG + 112 + CURLOPT_SERVER_RESPONSE_TIMEOUT = CURLOPTTYPE_LONG + 112 CURLOPT_IPRESOLVE = CURLOPTTYPE_LONG + 113 CURLOPT_MAXFILESIZE = CURLOPTTYPE_LONG + 114 CURLOPT_INFILESIZE_LARGE = CURLOPTTYPE_OFF_T + 115 @@ -919,14 +956,35 @@ enum CURLOPT_MAXAGE_CONN = CURLOPTTYPE_LONG + 288 CURLOPT_SASL_AUTHZID = CURLOPTTYPE_OBJECTPOINT + 289 CURLOPT_MAIL_RCPT_ALLLOWFAILS = CURLOPTTYPE_LONG + 290 - CURLOPT_SSLCERT_BLOB = 40000 + 291 - CURLOPT_SSLKEY_BLOB = 40000 + 292 - CURLOPT_PROXY_SSLCERT_BLOB = 40000 + 293 - CURLOPT_PROXY_SSLKEY_BLOB = 40000 + 294 - CURLOPT_ISSUERCERT_BLOB = 40000 + 295 + CURLOPT_SSLCERT_BLOB = CURLOPTTYPE_BLOB + 291 + CURLOPT_SSLKEY_BLOB = CURLOPTTYPE_BLOB + 292 + CURLOPT_PROXY_SSLCERT_BLOB = CURLOPTTYPE_BLOB + 293 + CURLOPT_PROXY_SSLKEY_BLOB = CURLOPTTYPE_BLOB + 294 + CURLOPT_ISSUERCERT_BLOB = CURLOPTTYPE_BLOB + 295 CURLOPT_PROXY_ISSUERCERT = CURLOPTTYPE_OBJECTPOINT + 296 - CURLOPT_PROXY_ISSUERCERT_BLOB = 40000 + 297 + CURLOPT_PROXY_ISSUERCERT_BLOB = CURLOPTTYPE_BLOB + 297 CURLOPT_SSL_EC_CURVES = CURLOPTTYPE_OBJECTPOINT + 298 + CURLOPT_HSTS_CTRL = CURLOPTTYPE_LONG + 299 + CURLOPT_HSTS = CURLOPTTYPE_OBJECTPOINT + 300 + CURLOPT_HSTSREADFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 301 + CURLOPT_HSTSREADDATA = CURLOPTTYPE_OBJECTPOINT + 302 + CURLOPT_HSTSWRITEFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 303 + CURLOPT_HSTSWRITEDATA = CURLOPTTYPE_OBJECTPOINT + 304 + CURLOPT_AWS_SIGV4 = CURLOPTTYPE_OBJECTPOINT + 305 + CURLOPT_DOH_SSL_VERIFYPEER = CURLOPTTYPE_LONG + 306 + CURLOPT_DOH_SSL_VERIFYHOST = CURLOPTTYPE_LONG + 307 + CURLOPT_DOH_SSL_VERIFYSTATUS = CURLOPTTYPE_LONG + 308 + CURLOPT_CAINFO_BLOB = CURLOPTTYPE_BLOB + 309 + CURLOPT_PROXY_CAINFO_BLOB = CURLOPTTYPE_BLOB + 310 + CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 = CURLOPTTYPE_OBJECTPOINT + 311 + CURLOPT_PREREQFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 312 + CURLOPT_PREREQDATA = CURLOPTTYPE_OBJECTPOINT + 313 + CURLOPT_MAXLIFETIME_CONN = CURLOPTTYPE_LONG + 314 + CURLOPT_MIME_OPTIONS = CURLOPTTYPE_LONG + 315 + CURLOPT_SSH_HOSTKEYFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 316 + CURLOPT_SSH_HOSTKEYDATA = CURLOPTTYPE_OBJECTPOINT + 317 + CURLOPT_PROTOCOLS_STR = CURLOPTTYPE_OBJECTPOINT + 318 + CURLOPT_REDIR_PROTOCOLS_STR = CURLOPTTYPE_OBJECTPOINT + 319 CURLOPT_LASTENTRY end enum @@ -937,7 +995,6 @@ const CURLOPT_WRITEHEADER = CURLOPT_HEADERDATA const CURLOPT_INFILE = CURLOPT_READDATA const CURLOPT_FILE = CURLOPT_WRITEDATA const CURLOPT_PROGRESSDATA = CURLOPT_XFERINFODATA -const CURLOPT_SERVER_RESPONSE_TIMEOUT = CURLOPT_FTP_RESPONSE_TIMEOUT const CURLOPT_POST301 = CURLOPT_POSTREDIR const CURLOPT_SSLKEYPASSWD = CURLOPT_KEYPASSWD const CURLOPT_FTPAPPEND = CURLOPT_APPEND @@ -945,6 +1002,7 @@ const CURLOPT_FTPLISTONLY = CURLOPT_DIRLISTONLY const CURLOPT_FTP_SSL = CURLOPT_USE_SSL const CURLOPT_SSLCERTPASSWD = CURLOPT_KEYPASSWD const CURLOPT_KRB4LEVEL = CURLOPT_KRBLEVEL +const CURLOPT_FTP_RESPONSE_TIMEOUT = CURLOPT_SERVER_RESPONSE_TIMEOUT const CURL_IPRESOLVE_WHATEVER = 0 const CURL_IPRESOLVE_V4 = 1 const CURL_IPRESOLVE_V6 = 2 @@ -1034,6 +1092,7 @@ end enum const CURL_ZERO_TERMINATED = cuint(-1) declare function curl_strequal(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as long declare function curl_strnequal(byval s1 as const zstring ptr, byval s2 as const zstring ptr, byval n as uinteger) as long +const CURLMIMEOPT_FORMESCAPE = 1 shl 0 type curl_mime as curl_mime_ declare function curl_mime_init(byval easy as CURL ptr) as curl_mime ptr declare sub curl_mime_free(byval mime as curl_mime ptr) @@ -1220,7 +1279,10 @@ enum CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57 CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58 CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59 - CURLINFO_LASTONE = 59 + CURLINFO_REFERER = CURLINFO_STRING + 60 + CURLINFO_CAINFO = CURLINFO_STRING + 61 + CURLINFO_CAPATH = CURLINFO_STRING + 62 + CURLINFO_LASTONE = 62 end enum const CURLINFO_HTTP_CODE = CURLINFO_RESPONSE_CODE @@ -1302,10 +1364,12 @@ enum CURLVERSION_SIXTH CURLVERSION_SEVENTH CURLVERSION_EIGHTH + CURLVERSION_NINTH + CURLVERSION_TENTH CURLVERSION_LAST end enum -const CURLVERSION_NOW = CURLVERSION_EIGHTH +const CURLVERSION_NOW = CURLVERSION_TENTH type curl_version_info_data age as CURLversion @@ -1331,6 +1395,8 @@ type curl_version_info_data capath as const zstring ptr zstd_ver_num as ulong zstd_version as const zstring ptr + hyper_version as const zstring ptr + gsasl_version as const zstring ptr end type const CURL_VERSION_IPV6 = 1 shl 0 @@ -1361,6 +1427,9 @@ const CURL_VERSION_ALTSVC = 1 shl 24 const CURL_VERSION_HTTP3 = 1 shl 25 const CURL_VERSION_ZSTD = 1 shl 26 const CURL_VERSION_UNICODE = 1 shl 27 +const CURL_VERSION_HSTS = 1 shl 28 +const CURL_VERSION_GSASL = 1 shl 29 +const CURL_VERSION_THREADSAFE = 1 shl 30 declare function curl_version_info(byval as CURLversion) as curl_version_info_data ptr declare function curl_easy_strerror(byval as CURLcode) as const zstring ptr @@ -1410,6 +1479,8 @@ enum CURLM_RECURSIVE_API_CALL CURLM_WAKEUP_FAILURE CURLM_BAD_FUNCTION_ARGUMENT + CURLM_ABORTED_BY_CALLBACK + CURLM_UNRECOVERABLE_POLL CURLM_LAST end enum @@ -1534,6 +1605,19 @@ enum CURLUE_NO_PORT CURLUE_NO_QUERY CURLUE_NO_FRAGMENT + CURLUE_NO_ZONEID + CURLUE_BAD_FILE_URL + CURLUE_BAD_FRAGMENT + CURLUE_BAD_HOSTNAME + CURLUE_BAD_IPV6 + CURLUE_BAD_LOGIN + CURLUE_BAD_PASSWORD + CURLUE_BAD_PATH + CURLUE_BAD_QUERY + CURLUE_BAD_SCHEME + CURLUE_BAD_SLASHES + CURLUE_BAD_USER + CURLUE_LAST end enum type CURLUPart as long @@ -1562,6 +1646,7 @@ const CURLU_URLENCODE = 1 shl 7 const CURLU_APPENDQUERY = 1 shl 8 const CURLU_GUESS_SCHEME = 1 shl 9 const CURLU_NO_AUTHORITY = 1 shl 10 +const CURLU_ALLOW_SPACE = 1 shl 11 type CURLU as Curl_URL declare function curl_url() as CURLU ptr @@ -1569,6 +1654,7 @@ declare sub curl_url_cleanup(byval handle as CURLU ptr) declare function curl_url_dup(byval in as CURLU ptr) as CURLU ptr declare function curl_url_get(byval handle as CURLU ptr, byval what as CURLUPart, byval part as zstring ptr ptr, byval flags as ulong) as CURLUcode declare function curl_url_set(byval handle as CURLU ptr, byval what as CURLUPart, byval part as const zstring ptr, byval flags as ulong) as CURLUcode +declare function curl_url_strerror(byval as CURLUcode) as const zstring ptr #define CURLINC_OPTIONS_H type curl_easytype as long @@ -1596,5 +1682,36 @@ end type declare function curl_easy_option_by_name(byval name as const zstring ptr) as const curl_easyoption ptr declare function curl_easy_option_by_id(byval id as CURLoption) as const curl_easyoption ptr declare function curl_easy_option_next(byval prev as const curl_easyoption ptr) as const curl_easyoption ptr +#define CURLINC_HEADER_H + +type curl_header + name as zstring ptr + value as zstring ptr + amount as uinteger + index as uinteger + origin as ulong + anchor as any ptr +end type + +const CURLH_HEADER = 1 shl 0 +const CURLH_TRAILER = 1 shl 1 +const CURLH_CONNECT = 1 shl 2 +const CURLH_1XX = 1 shl 3 +const CURLH_PSEUDO = 1 shl 4 + +type CURLHcode as long +enum + CURLHE_OK + CURLHE_BADINDEX + CURLHE_MISSING + CURLHE_NOHEADERS + CURLHE_NOREQUEST + CURLHE_OUT_OF_MEMORY + CURLHE_BAD_ARGUMENT + CURLHE_NOT_BUILT_IN +end enum + +declare function curl_easy_header(byval easy as CURL ptr, byval name as const zstring ptr, byval index as uinteger, byval origin as ulong, byval request as long, byval hout as curl_header ptr ptr) as CURLHcode +declare function curl_easy_nextheader(byval easy as CURL ptr, byval origin as ulong, byval request as long, byval prev as curl_header ptr) as curl_header ptr end extern diff --git a/inc/mariadb.bi b/inc/mariadb.bi new file mode 100644 index 0000000000..3e952c5425 --- /dev/null +++ b/inc/mariadb.bi @@ -0,0 +1,1498 @@ +'' FreeBASIC binding for mariadb-connector-c-3.3.1 +'' +'' based on the C header files: +'' Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +'' 2012 by MontyProgram AB +'' +'' This library is free software; you can redistribute it and/or +'' modify it under the terms of the GNU Library General Public +'' License as published by the Free Software Foundation; either +'' version 2 of the License, or (at your option) any later version. +'' +'' This library 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 +'' Library General Public License for more details. +'' +'' You should have received a copy of the GNU Library General Public +'' License along with this library; if not, write to the Free +'' Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +'' MA 02111-1301, USA +'' +'' translated to FreeBASIC by: +'' Copyright © 2021 FreeBASIC development team + +#pragma once + +#inclib "mariadb" + +#ifdef __FB_WIN32__ + #inclib "kernel32" +#endif + +#include once "crt/long.bi" +#include once "crt/stdarg.bi" +#include once "crt/sys/types.bi" +#include once "crt/ctype.bi" + +'' The following symbols have been renamed: +'' #define CHARSET_DIR => CHARSET_DIR_ +'' variable mysql_port => mysql_port_ + +#ifdef __FB_UNIX__ + extern "C" +#else + extern "Windows" +#endif + +#define _mysql_h +#define LIBMARIADB +#define MYSQL_CLIENT +type my_bool as zstring +type my_ulonglong as ulongint +#define my_socket_defined + +#ifdef __FB_UNIX__ + type my_socket as long +#elseif defined(__FB_WIN32__) and (not defined(__FB_64BIT__)) + type my_socket as ulong +#else + type my_socket as ulongint +#endif + +#define _mysql_com_h +const NAME_CHAR_LEN = 64 +const NAME_LEN = 256 +const HOSTNAME_LENGTH = 255 +const SYSTEM_MB_MAX_CHAR_LENGTH = 4 +const USERNAME_CHAR_LENGTH = 128 +const USERNAME_LENGTH = USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH +const SERVER_VERSION_LENGTH = 60 +const SQLSTATE_LENGTH = 5 +const SCRAMBLE_LENGTH = 20 +const SCRAMBLE_LENGTH_323 = 8 +#define LOCAL_HOST "localhost" +#define LOCAL_HOST_NAMEDPIPE "." + +#ifdef __FB_WIN32__ + #define MARIADB_NAMEDPIPE "MySQL" + #define MYSQL_SERVICENAME "MySql" +#endif + +#define MYSQL_AUTODETECT_CHARSET_NAME "auto" +const BINCMP_FLAG = 131072 + +type mysql_enum_shutdown_level as long +enum + SHUTDOWN_DEFAULT = 0 + KILL_QUERY = 254 + KILL_CONNECTION = 255 +end enum + +type enum_server_command as long +enum + COM_SLEEP = 0 + 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 = 15 + COM_DELAYED_INSERT + COM_CHANGE_USER + COM_BINLOG_DUMP + COM_TABLE_DUMP + COM_CONNECT_OUT = 20 + COM_REGISTER_SLAVE + COM_STMT_PREPARE = 22 + COM_STMT_EXECUTE = 23 + COM_STMT_SEND_LONG_DATA = 24 + COM_STMT_CLOSE = 25 + COM_STMT_RESET = 26 + COM_SET_OPTION = 27 + COM_STMT_FETCH = 28 + COM_DAEMON = 29 + COM_UNSUPPORTED = 30 + COM_RESET_CONNECTION = 31 + COM_STMT_BULK_EXECUTE = 250 + COM_RESERVED_1 = 254 + COM_END +end enum + +const NOT_NULL_FLAG = 1 +const PRI_KEY_FLAG = 2 +const UNIQUE_KEY_FLAG = 4 +const MULTIPLE_KEY_FLAG = 8 +const BLOB_FLAG = 16 +const UNSIGNED_FLAG = 32 +const ZEROFILL_FLAG = 64 +const BINARY_FLAG = 128 +const ENUM_FLAG = 256 +const AUTO_INCREMENT_FLAG = 512 +const TIMESTAMP_FLAG = 1024 +const SET_FLAG = 2048 +const NO_DEFAULT_VALUE_FLAG = 4096 +const ON_UPDATE_NOW_FLAG = 8192 +const NUM_FLAG = 32768 +const PART_KEY_FLAG = 16384 +const GROUP_FLAG = 32768 +const UNIQUE_FLAG = 65536 +const REFRESH_GRANT = 1 +const REFRESH_LOG = 2 +const REFRESH_TABLES = 4 +const REFRESH_HOSTS = 8 +const REFRESH_STATUS = 16 +const REFRESH_THREADS = 32 +const REFRESH_SLAVE = 64 +const REFRESH_MASTER = 128 +const REFRESH_READ_LOCK = 16384 +const REFRESH_FAST = 32768 +const CLIENT_MYSQL = 1 +const CLIENT_FOUND_ROWS = 2 +const CLIENT_LONG_FLAG = 4 +const CLIENT_CONNECT_WITH_DB = 8 +const CLIENT_NO_SCHEMA = 16 +const CLIENT_COMPRESS = 32 +const CLIENT_ODBC = 64 +const CLIENT_LOCAL_FILES = 128 +const CLIENT_IGNORE_SPACE = 256 +const CLIENT_INTERACTIVE = 1024 +const CLIENT_SSL = 2048 +const CLIENT_IGNORE_SIGPIPE = 4096 +const CLIENT_TRANSACTIONS = 8192 +const CLIENT_PROTOCOL_41 = 512 +const CLIENT_RESERVED = 16384 +const CLIENT_SECURE_CONNECTION = 32768 +const CLIENT_MULTI_STATEMENTS = cast(culong, 1) shl 16 +const CLIENT_MULTI_RESULTS = cast(culong, 1) shl 17 +const CLIENT_PS_MULTI_RESULTS = cast(culong, 1) shl 18 +const CLIENT_PLUGIN_AUTH = cast(culong, 1) shl 19 +const CLIENT_CONNECT_ATTRS = cast(culong, 1) shl 20 +const CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA = cast(culong, 1) shl 21 +const CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS = cast(culong, 1) shl 22 +const CLIENT_SESSION_TRACKING = cast(culong, 1) shl 23 +const CLIENT_ZSTD_COMPRESSION = cast(culong, 1) shl 26 +const CLIENT_PROGRESS = cast(culong, 1) shl 29 +const CLIENT_PROGRESS_OBSOLETE = CLIENT_PROGRESS +const CLIENT_SSL_VERIFY_SERVER_CERT = cast(culong, 1) shl 30 +const CLIENT_REMEMBER_OPTIONS = cast(culong, 1) shl 31 +const MARIADB_CLIENT_FLAGS = &hFFFFFFFF00000000ull +const MARIADB_CLIENT_PROGRESS = 1ull shl 32 +const MARIADB_CLIENT_RESERVED_1 = 1ull shl 33 +const MARIADB_CLIENT_STMT_BULK_OPERATIONS = 1ull shl 34 +const MARIADB_CLIENT_EXTENDED_METADATA = 1ull shl 35 +const MARIADB_CLIENT_CACHE_METADATA = 1ull shl 36 +#define IS_MARIADB_EXTENDED_SERVER(mysql) ((mysql->server_capabilities and CLIENT_MYSQL) = 0) +const MARIADB_CLIENT_SUPPORTED_FLAGS = ((MARIADB_CLIENT_PROGRESS or MARIADB_CLIENT_STMT_BULK_OPERATIONS) or MARIADB_CLIENT_EXTENDED_METADATA) or MARIADB_CLIENT_CACHE_METADATA +const CLIENT_SUPPORTED_FLAGS = ((((((((((((((((((((((CLIENT_MYSQL or CLIENT_FOUND_ROWS) or CLIENT_LONG_FLAG) or CLIENT_CONNECT_WITH_DB) or CLIENT_NO_SCHEMA) or CLIENT_COMPRESS) or CLIENT_ODBC) or CLIENT_LOCAL_FILES) or CLIENT_IGNORE_SPACE) or CLIENT_INTERACTIVE) or CLIENT_SSL) or CLIENT_IGNORE_SIGPIPE) or CLIENT_TRANSACTIONS) or CLIENT_PROTOCOL_41) or CLIENT_RESERVED) or CLIENT_SECURE_CONNECTION) or CLIENT_MULTI_STATEMENTS) or CLIENT_MULTI_RESULTS) or CLIENT_PROGRESS) or CLIENT_SSL_VERIFY_SERVER_CERT) or CLIENT_REMEMBER_OPTIONS) or CLIENT_PLUGIN_AUTH) or CLIENT_SESSION_TRACKING) or CLIENT_CONNECT_ATTRS +const CLIENT_CAPABILITIES = (((((((((CLIENT_MYSQL or CLIENT_LONG_FLAG) or CLIENT_TRANSACTIONS) or CLIENT_SECURE_CONNECTION) or CLIENT_MULTI_RESULTS) or CLIENT_PS_MULTI_RESULTS) or CLIENT_PROTOCOL_41) or CLIENT_PLUGIN_AUTH) or CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA) or CLIENT_SESSION_TRACKING) or CLIENT_CONNECT_ATTRS +const CLIENT_DEFAULT_FLAGS = (CLIENT_SUPPORTED_FLAGS and (not CLIENT_COMPRESS)) and (not CLIENT_SSL) +const SERVER_STATUS_IN_TRANS = 1 +const SERVER_STATUS_AUTOCOMMIT = 2 +const SERVER_MORE_RESULTS_EXIST = 8 +const SERVER_QUERY_NO_GOOD_INDEX_USED = 16 +const SERVER_QUERY_NO_INDEX_USED = 32 +const SERVER_STATUS_CURSOR_EXISTS = 64 +const SERVER_STATUS_LAST_ROW_SENT = 128 +const SERVER_STATUS_DB_DROPPED = 256 +const SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512 +const SERVER_STATUS_METADATA_CHANGED = 1024 +const SERVER_QUERY_WAS_SLOW = 2048 +const SERVER_PS_OUT_PARAMS = 4096 +const SERVER_STATUS_IN_TRANS_READONLY = 8192 +const SERVER_SESSION_STATE_CHANGED = 16384 +const SERVER_STATUS_ANSI_QUOTES = 32768 +const MYSQL_ERRMSG_SIZE = 512 +const NET_READ_TIMEOUT = 30 +const NET_WRITE_TIMEOUT = 60 +const NET_WAIT_TIMEOUT = (8 * 60) * 60 +const LIST_PROCESS_HOST_LEN = 64 +#define MYSQL50_TABLE_NAME_PREFIX "#mysql50#" +#define MYSQL50_TABLE_NAME_PREFIX_LENGTH (sizeof(MYSQL50_TABLE_NAME_PREFIX) - 1) +#define SAFE_NAME_LEN (NAME_LEN + MYSQL50_TABLE_NAME_PREFIX_LENGTH) +type MARIADB_PVIO as st_ma_pvio +const MAX_CHAR_WIDTH = 255 +const MAX_BLOB_WIDTH = 8192 +const MAX_TINYINT_WIDTH = 3 +const MAX_SMALLINT_WIDTH = 5 +const MAX_MEDIUMINT_WIDTH = 8 +const MAX_INT_WIDTH = 10 +const MAX_BIGINT_WIDTH = 20 +type st_mariadb_net_extension as st_mariadb_net_extension_ + +type st_net + pvio as MARIADB_PVIO ptr + buff as ubyte ptr + buff_end as ubyte ptr + write_pos as ubyte ptr + read_pos as ubyte ptr + + #ifdef __FB_UNIX__ + fd as my_socket + #elseif defined(__FB_WIN32__) and (not defined(__FB_64BIT__)) + fd as ulong + #else + fd as ulongint + #endif + + remain_in_buf as culong + length as culong + buf_length as culong + where_b as culong + max_packet as culong + max_packet_size as culong + pkt_nr as ulong + compress_pkt_nr as ulong + write_timeout as ulong + read_timeout as ulong + retry_count as ulong + fcntl as long + return_status as ulong ptr + reading_or_writing as ubyte + save_char as byte + unused_1 as byte + unused_2 as byte + compress as byte + unused_3 as byte + unused_4 as any ptr + last_errno as ulong + error as ubyte + unused_5 as byte + unused_6 as byte + last_error as zstring * 512 + sqlstate as zstring * 5 + 1 + extension as st_mariadb_net_extension ptr +end type + +type NET as st_net +const packet_error = culng(-1) + +type enum_mysql_set_option as long +enum + MYSQL_OPTION_MULTI_STATEMENTS_ON + MYSQL_OPTION_MULTI_STATEMENTS_OFF +end enum + +type enum_session_state_type as long +enum + SESSION_TRACK_SYSTEM_VARIABLES = 0 + SESSION_TRACK_SCHEMA + SESSION_TRACK_STATE_CHANGE + SESSION_TRACK_GTIDS + SESSION_TRACK_TRANSACTION_CHARACTERISTICS + SESSION_TRACK_TRANSACTION_STATE +end enum + +const SESSION_TRACK_BEGIN = 0 +const SESSION_TRACK_END = SESSION_TRACK_TRANSACTION_STATE +const SESSION_TRACK_TYPES = SESSION_TRACK_END + 1 +const SESSION_TRACK_TRANSACTION_TYPE = SESSION_TRACK_TRANSACTION_STATE + +type enum_field_types as long +enum + 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 + MAX_NO_FIELD_TYPES +end enum + +const FIELD_TYPE_DECIMAL = MYSQL_TYPE_DECIMAL +const FIELD_TYPE_NEWDECIMAL = MYSQL_TYPE_NEWDECIMAL +const FIELD_TYPE_TINY = MYSQL_TYPE_TINY +const FIELD_TYPE_CHAR = FIELD_TYPE_TINY +const FIELD_TYPE_SHORT = MYSQL_TYPE_SHORT +const FIELD_TYPE_LONG = MYSQL_TYPE_LONG +const FIELD_TYPE_FLOAT = MYSQL_TYPE_FLOAT +const FIELD_TYPE_DOUBLE = MYSQL_TYPE_DOUBLE +const FIELD_TYPE_NULL = MYSQL_TYPE_NULL +const FIELD_TYPE_TIMESTAMP = MYSQL_TYPE_TIMESTAMP +const FIELD_TYPE_LONGLONG = MYSQL_TYPE_LONGLONG +const FIELD_TYPE_INT24 = MYSQL_TYPE_INT24 +const FIELD_TYPE_DATE = MYSQL_TYPE_DATE +const FIELD_TYPE_TIME = MYSQL_TYPE_TIME +const FIELD_TYPE_DATETIME = MYSQL_TYPE_DATETIME +const FIELD_TYPE_YEAR = MYSQL_TYPE_YEAR +const FIELD_TYPE_NEWDATE = MYSQL_TYPE_NEWDATE +const FIELD_TYPE_ENUM = MYSQL_TYPE_ENUM +const FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM +const FIELD_TYPE_SET = MYSQL_TYPE_SET +const FIELD_TYPE_TINY_BLOB = MYSQL_TYPE_TINY_BLOB +const FIELD_TYPE_MEDIUM_BLOB = MYSQL_TYPE_MEDIUM_BLOB +const FIELD_TYPE_LONG_BLOB = MYSQL_TYPE_LONG_BLOB +const FIELD_TYPE_BLOB = MYSQL_TYPE_BLOB +const FIELD_TYPE_VAR_STRING = MYSQL_TYPE_VAR_STRING +const FIELD_TYPE_STRING = MYSQL_TYPE_STRING +const FIELD_TYPE_GEOMETRY = MYSQL_TYPE_GEOMETRY +const FIELD_TYPE_BIT = MYSQL_TYPE_BIT +extern max_allowed_packet as culong +extern net_buffer_length as culong +#define net_new_transaction(net) scope : (net)->pkt_nr = 0 : end scope + +declare function ma_net_init cdecl(byval net as NET ptr, byval pvio as MARIADB_PVIO ptr) as long +declare sub ma_net_end cdecl(byval net as NET ptr) +declare sub ma_net_clear cdecl(byval net as NET ptr) +declare function ma_net_flush cdecl(byval net as NET ptr) as long +declare function ma_net_write cdecl(byval net as NET ptr, byval packet as const ubyte ptr, byval len as uinteger) as long +declare function ma_net_write_command cdecl(byval net as NET ptr, byval command as ubyte, byval packet as const zstring ptr, byval len as uinteger, byval disable_flush as byte) as long +declare function ma_net_real_write cdecl(byval net as NET ptr, byval packet as const zstring ptr, byval len as uinteger) as long +declare function ma_net_read cdecl(byval net as NET ptr) as culong + +type rand_struct + seed1 as culong + seed2 as culong + max_value as culong + max_value_dbl as double +end type + +type Item_result as long +enum + STRING_RESULT + REAL_RESULT + INT_RESULT + ROW_RESULT + DECIMAL_RESULT +end enum + +type st_udf_args + arg_count as ulong + arg_type as Item_result ptr + args as zstring ptr ptr + lengths as culong ptr + maybe_null as zstring ptr +end type + +type UDF_ARGS as st_udf_args + +type st_udf_init + maybe_null as byte + decimals as ulong + max_length as ulong + ptr as zstring ptr + const_item as byte +end type + +type UDF_INIT as st_udf_init +const MARIADB_CONNECTION_UNIXSOCKET = 0 +const MARIADB_CONNECTION_TCP = 1 +const MARIADB_CONNECTION_NAMEDPIPE = 2 +const MARIADB_CONNECTION_SHAREDMEM = 3 +const NET_HEADER_SIZE = 4 +const COMP_HEADER_SIZE = 3 +#define native_password_plugin_name "mysql_native_password" +#define old_password_plugin_name "mysql_old_password" + +declare function ma_scramble_323 cdecl(byval to as zstring ptr, byval message as const zstring ptr, byval password as const zstring ptr) as zstring ptr +declare sub ma_scramble_41 cdecl(byval buffer as const ubyte ptr, byval scramble as const zstring ptr, byval password as const zstring ptr) +declare sub ma_hash_password cdecl(byval result as culong ptr, byval password as const zstring ptr, byval len as uinteger) +declare sub ma_make_scrambled_password cdecl(byval to as zstring ptr, byval password as const zstring ptr) +declare sub mariadb_load_defaults cdecl(byval conf_file as const zstring ptr, byval groups as const zstring ptr ptr, byval argc as long ptr, byval argv as zstring ptr ptr ptr) +declare function ma_thread_init cdecl() as byte +declare sub ma_thread_end cdecl() + +const NULL_LENGTH = cast(culong, not 0) +#define _mariadb_version_h_ +const PROTOCOL_VERSION = 10 +#define MARIADB_CLIENT_VERSION_STR "10.6.8" +#define MARIADB_BASE_VERSION "mariadb-10.6" +const MARIADB_VERSION_ID = 100608 +const MARIADB_PORT = 3306 +#define MARIADB_UNIX_ADDR "/tmp/mysql.sock" +#define MYSQL_UNIX_ADDR MARIADB_UNIX_ADDR +const MYSQL_PORT = MARIADB_PORT +#define MYSQL_CONFIG_NAME "my" +const MYSQL_VERSION_ID = 100608 +#define MYSQL_SERVER_VERSION "10.6.8-MariaDB" +#define MARIADB_PACKAGE_VERSION "3.3.1" +const MARIADB_PACKAGE_VERSION_ID = 30301 +#define MARIADB_SYSTEM_TYPE "Linux" +#define MARIADB_MACHINE_TYPE "x86_64" +#define MARIADB_PLUGINDIR "/usr/local/lib/mariadb/plugin" +#define MYSQL_CHARSET "" +#define CC_SOURCE_REVISION "5e94e7c27ffad7e76665b1333a67975316b9c3c2" +#define _list_h_ + +type st_list + prev as st_list ptr + next as st_list ptr + data as any ptr +end type + +type LIST as st_list +type list_walk_action as function cdecl(byval as any ptr, byval as any ptr) as long +declare function list_add cdecl(byval root as LIST ptr, byval element as LIST ptr) as LIST ptr +declare function list_delete cdecl(byval root as LIST ptr, byval element as LIST ptr) as LIST ptr +declare function list_cons cdecl(byval data as any ptr, byval root as LIST ptr) as LIST ptr +declare function list_reverse cdecl(byval root as LIST ptr) as LIST ptr +declare sub list_free cdecl(byval root as LIST ptr, byval free_data as ulong) +declare function list_length cdecl(byval list as LIST ptr) as ulong +declare function list_walk cdecl(byval list as LIST ptr, byval action as list_walk_action, byval argument as zstring ptr) as long + +#define list_rest(a) (a)->next +#define list_push(a, b) scope : (a) = list_cons((b), (a)) : end scope +#macro list_pop(A) + scope + dim old as LIST ptr = (A) + (A) = list_delete(old, old) + ma_free(cptr(zstring ptr, old), MYF(MY_FAE)) + end scope +#endmacro +#define _mariadb_ctype_h +#define CHARSET_DIR_ "charsets/" +const MY_CS_NAME_SIZE = 32 +#define MADB_DEFAULT_CHARSET_NAME "latin1" +#define MADB_DEFAULT_COLLATION_NAME "latin1_swedish_ci" +#define MADB_AUTODETECT_CHARSET_NAME "auto" + +type ma_charset_info_st + nr as ulong + state as ulong + csname as const zstring ptr + name as const zstring ptr + dir as const zstring ptr + codepage as ulong + encoding as const zstring ptr + char_minlen as ulong + char_maxlen as ulong + mb_charlen as function cdecl(byval c as ulong) as ulong + mb_valid as function cdecl(byval start as const zstring ptr, byval end as const zstring ptr) as ulong +end type + +type MARIADB_CHARSET_INFO as ma_charset_info_st +extern mariadb_compiled_charsets as const MARIADB_CHARSET_INFO ptr +extern ma_default_charset_info as MARIADB_CHARSET_INFO ptr +extern ma_charset_bin as MARIADB_CHARSET_INFO ptr +extern ma_charset_latin1 as MARIADB_CHARSET_INFO ptr +extern ma_charset_utf8_general_ci as MARIADB_CHARSET_INFO ptr +extern ma_charset_utf16le_general_ci as MARIADB_CHARSET_INFO ptr + +declare function find_compiled_charset cdecl(byval cs_number as ulong) as MARIADB_CHARSET_INFO ptr +declare function find_compiled_charset_by_name cdecl(byval name as const zstring ptr) as MARIADB_CHARSET_INFO ptr +declare function mysql_cset_escape_quotes cdecl(byval cset as const MARIADB_CHARSET_INFO ptr, byval newstr as zstring ptr, byval escapestr as const zstring ptr, byval escapestr_len as uinteger) as uinteger +declare function mysql_cset_escape_slashes cdecl(byval cset as const MARIADB_CHARSET_INFO ptr, byval newstr as zstring ptr, byval escapestr as const zstring ptr, byval escapestr_len as uinteger) as uinteger +declare function madb_get_os_character_set cdecl() as const zstring ptr + +#ifdef __FB_WIN32__ + declare function madb_get_windows_cp cdecl(byval charset as const zstring ptr) as long +#endif + +type st_ma_const_string + str as const zstring ptr + length as uinteger +end type + +type MARIADB_CONST_STRING as st_ma_const_string +#define ST_MA_USED_MEM_DEFINED + +type st_ma_used_mem + next as st_ma_used_mem ptr + left as uinteger + size as uinteger +end type + +type MA_USED_MEM as st_ma_used_mem + +type st_ma_mem_root + free as MA_USED_MEM ptr + used as MA_USED_MEM ptr + pre_alloc as MA_USED_MEM ptr + min_malloc as uinteger + block_size as uinteger + block_num as ulong + first_block_usage as ulong + error_handler as sub cdecl() +end type + +type MA_MEM_ROOT as st_ma_mem_root +extern mysql_port_ alias "mysql_port" as ulong +extern mysql_unix_port as zstring ptr +extern mariadb_deinitialize_ssl as ulong + +#define IS_PRI_KEY(n) ((n) and PRI_KEY_FLAG) +#define IS_NOT_NULL(n) ((n) and NOT_NULL_FLAG) +#define IS_BLOB(n) ((n) and BLOB_FLAG) +#define IS_NUM(t) (((((t) <= MYSQL_TYPE_INT24) andalso ((t) <> MYSQL_TYPE_TIMESTAMP)) orelse ((t) = MYSQL_TYPE_YEAR)) orelse ((t) = MYSQL_TYPE_NEWDECIMAL)) +#define IS_NUM_FIELD(f) ((f)->flags and NUM_FLAG) +#define INTERNAL_NUM_FIELD(f) ((((((f)->type <= MYSQL_TYPE_INT24) andalso ((((f)->type <> MYSQL_TYPE_TIMESTAMP) orelse ((f)->length = 14)) orelse ((f)->length = 8))) orelse ((f)->type = MYSQL_TYPE_YEAR)) orelse ((f)->type = MYSQL_TYPE_NEWDECIMAL)) orelse ((f)->type = MYSQL_TYPE_DECIMAL)) + +type st_mysql_field + name as zstring ptr + org_name as zstring ptr + table as zstring ptr + org_table as zstring ptr + db as zstring ptr + catalog as zstring ptr + def as zstring ptr + length as culong + max_length as culong + name_length as ulong + org_name_length as ulong + table_length as ulong + org_table_length as ulong + db_length as ulong + catalog_length as ulong + def_length as ulong + flags as ulong + decimals as ulong + charsetnr as ulong + as enum_field_types type + extension as any ptr +end type + +type MYSQL_FIELD as st_mysql_field +type MYSQL_ROW as zstring ptr ptr +type MYSQL_FIELD_OFFSET as ulong +#macro SET_CLIENT_ERROR(a, b, c, d) + scope + (a)->net.last_errno = (b) + strncpy((a)->net.sqlstate, (c), SQLSTATE_LENGTH) + (a)->net.sqlstate[SQLSTATE_LENGTH] = 0 + strncpy((a)->net.last_error, iif((d), (d), ER((b))), MYSQL_ERRMSG_SIZE - 1) + (a)->net.last_error[(MYSQL_ERRMSG_SIZE - 1)] = 0 + end scope +#endmacro +#define set_mariadb_error(A, B, C) SET_CLIENT_ERROR((A), (B), (C), 0) +extern SQLSTATE_UNKNOWN as const zstring ptr +extern unknown_sqlstate alias "SQLSTATE_UNKNOWN" as const zstring ptr +#macro CLEAR_CLIENT_ERROR(a) + scope + (a)->net.last_errno = 0 + strcpy((a)->net.sqlstate, "00000") + (a)->net.last_error[0] = asc(!"\0") + if (a)->net.extension then + (a)->net.extension->extended_errno = 0 + end if + end scope +#endmacro +const MYSQL_COUNT_ERROR = not culngint(0) + +type st_mysql_rows + next as st_mysql_rows ptr + data as MYSQL_ROW + length as culong +end type + +type MYSQL_ROWS as st_mysql_rows +type MYSQL_ROW_OFFSET as MYSQL_ROWS ptr + +type st_mysql_data + data as MYSQL_ROWS ptr + embedded_info as any ptr + alloc as MA_MEM_ROOT + rows as ulongint + fields as ulong + extension as any ptr +end type + +type MYSQL_DATA as st_mysql_data + +type mysql_option as long +enum + 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_PROGRESS_CALLBACK = 5999 + MYSQL_OPT_NONBLOCK + MYSQL_DATABASE_DRIVER = 7000 + MARIADB_OPT_SSL_FP + MARIADB_OPT_SSL_FP_LIST + MARIADB_OPT_TLS_PASSPHRASE + MARIADB_OPT_TLS_CIPHER_STRENGTH + MARIADB_OPT_TLS_VERSION + MARIADB_OPT_TLS_PEER_FP + MARIADB_OPT_TLS_PEER_FP_LIST + MARIADB_OPT_CONNECTION_READ_ONLY + MYSQL_OPT_CONNECT_ATTRS + MARIADB_OPT_USERDATA + MARIADB_OPT_CONNECTION_HANDLER + MARIADB_OPT_PORT + MARIADB_OPT_UNIXSOCKET + MARIADB_OPT_PASSWORD + MARIADB_OPT_HOST + MARIADB_OPT_USER + MARIADB_OPT_SCHEMA + MARIADB_OPT_DEBUG + MARIADB_OPT_FOUND_ROWS + MARIADB_OPT_MULTI_RESULTS + MARIADB_OPT_MULTI_STATEMENTS + MARIADB_OPT_INTERACTIVE + MARIADB_OPT_PROXY_HEADER + MARIADB_OPT_IO_WAIT + MARIADB_OPT_SKIP_READ_RESPONSE + MARIADB_OPT_RESTRICTED_AUTH +end enum + +type mariadb_value as long +enum + MARIADB_CHARSET_ID + MARIADB_CHARSET_NAME + MARIADB_CLIENT_ERRORS + MARIADB_CLIENT_VERSION + MARIADB_CLIENT_VERSION_ID + MARIADB_CONNECTION_ASYNC_TIMEOUT + MARIADB_CONNECTION_ASYNC_TIMEOUT_MS + MARIADB_CONNECTION_MARIADB_CHARSET_INFO + MARIADB_CONNECTION_ERROR + MARIADB_CONNECTION_ERROR_ID + MARIADB_CONNECTION_HOST + MARIADB_CONNECTION_INFO + MARIADB_CONNECTION_PORT + MARIADB_CONNECTION_PROTOCOL_VERSION_ID + MARIADB_CONNECTION_PVIO_TYPE + MARIADB_CONNECTION_SCHEMA + MARIADB_CONNECTION_SERVER_TYPE + MARIADB_CONNECTION_SERVER_VERSION + MARIADB_CONNECTION_SERVER_VERSION_ID + MARIADB_CONNECTION_SOCKET + MARIADB_CONNECTION_SQLSTATE + MARIADB_CONNECTION_SSL_CIPHER + MARIADB_TLS_LIBRARY + MARIADB_CONNECTION_TLS_VERSION + MARIADB_CONNECTION_TLS_VERSION_ID + MARIADB_CONNECTION_TYPE + MARIADB_CONNECTION_UNIX_SOCKET + MARIADB_CONNECTION_USER + MARIADB_MAX_ALLOWED_PACKET + MARIADB_NET_BUFFER_LENGTH + MARIADB_CONNECTION_SERVER_STATUS + MARIADB_CONNECTION_SERVER_CAPABILITIES + MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES + MARIADB_CONNECTION_CLIENT_CAPABILITIES + MARIADB_CONNECTION_BYTES_READ + MARIADB_CONNECTION_BYTES_SENT +end enum + +type mysql_status as long +enum + MYSQL_STATUS_READY + MYSQL_STATUS_GET_RESULT + MYSQL_STATUS_USE_RESULT + MYSQL_STATUS_QUERY_SENT + MYSQL_STATUS_SENDING_LOAD_DATA + MYSQL_STATUS_FETCHING_DATA + MYSQL_STATUS_NEXT_RESULT_PENDING + MYSQL_STATUS_QUIT_SENT + MYSQL_STATUS_STMT_RESULT +end enum + +type mysql_protocol_type as long +enum + MYSQL_PROTOCOL_DEFAULT + MYSQL_PROTOCOL_TCP + MYSQL_PROTOCOL_SOCKET + MYSQL_PROTOCOL_PIPE + MYSQL_PROTOCOL_MEMORY +end enum + +type st_dynamic_array as st_dynamic_array_ +type st_mysql_options_extension as st_mysql_options_extension_ + +type st_mysql_options + connect_timeout as ulong + read_timeout as ulong + write_timeout as ulong + port as ulong + protocol as ulong + client_flag as culong + host as zstring ptr + user as zstring ptr + password as zstring ptr + unix_socket as zstring ptr + db as zstring ptr + init_command as st_dynamic_array ptr + my_cnf_file as zstring ptr + my_cnf_group as zstring ptr + charset_dir as zstring ptr + charset_name as zstring ptr + ssl_key as zstring ptr + ssl_cert as zstring ptr + ssl_ca as zstring ptr + ssl_capath as zstring ptr + ssl_cipher as zstring ptr + shared_memory_base_name as zstring ptr + max_allowed_packet as culong + use_ssl as byte + compress as byte + named_pipe as byte + reconnect as byte + unused_1 as byte + unused_2 as byte + unused_3 as byte + methods_to_use as mysql_option + bind_address as zstring ptr + secure_auth as byte + report_data_truncation as byte + local_infile_init as function cdecl(byval as any ptr ptr, byval as const zstring ptr, byval as any ptr) as long + local_infile_read as function cdecl(byval as any ptr, byval as zstring ptr, byval as ulong) as long + local_infile_end as sub cdecl(byval as any ptr) + local_infile_error as function cdecl(byval as any ptr, byval as zstring ptr, byval as ulong) as long + local_infile_userdata as any ptr + extension as st_mysql_options_extension ptr +end type + +type st_mariadb_methods as st_mariadb_methods_ +type st_mariadb_extension as st_mariadb_extension_ + +type st_mysql + net as NET + unused_0 as any ptr + host as zstring ptr + user as zstring ptr + passwd as zstring ptr + unix_socket as zstring ptr + server_version as zstring ptr + host_info as zstring ptr + info as zstring ptr + db as zstring ptr + charset as const ma_charset_info_st ptr + fields as MYSQL_FIELD ptr + field_alloc as MA_MEM_ROOT + affected_rows as ulongint + insert_id as ulongint + extra_info as ulongint + thread_id as culong + packet_length as culong + port as ulong + client_flag as culong + server_capabilities as culong + protocol_version as ulong + field_count as ulong + server_status as ulong + server_language as ulong + warning_count as ulong + options as st_mysql_options + status as mysql_status + free_me as byte + unused_1 as byte + scramble_buff as zstring * 20 + 1 + unused_2 as byte + unused_3 as any ptr + unused_4 as any ptr + unused_5 as any ptr + unused_6 as any ptr + stmts as LIST ptr + methods as const st_mariadb_methods ptr + thd as any ptr + unbuffered_fetch_owner as my_bool ptr + info_buffer as zstring ptr + extension as st_mariadb_extension ptr +end type + +type MYSQL as st_mysql + +type st_mysql_res + row_count as ulongint + field_count as ulong + current_field as ulong + fields as MYSQL_FIELD ptr + data as MYSQL_DATA ptr + data_cursor as MYSQL_ROWS ptr + field_alloc as MA_MEM_ROOT + row as MYSQL_ROW + current_row as MYSQL_ROW + lengths as culong ptr + handle as MYSQL ptr + eof as byte + is_ps as byte +end type + +type MYSQL_RES as st_mysql_res + +type MYSQL_PARAMETERS + p_max_allowed_packet as culong ptr + p_net_buffer_length as culong ptr + extension as any ptr +end type + +type mariadb_field_attr_t as long +enum + MARIADB_FIELD_ATTR_DATA_TYPE_NAME = 0 + MARIADB_FIELD_ATTR_FORMAT_NAME = 1 +end enum + +const MARIADB_FIELD_ATTR_LAST = MARIADB_FIELD_ATTR_FORMAT_NAME +declare function mariadb_field_attr(byval attr as MARIADB_CONST_STRING ptr, byval field as const MYSQL_FIELD ptr, byval type as mariadb_field_attr_t) as long + +type enum_mysql_timestamp_type as long +enum + MYSQL_TIMESTAMP_NONE = -2 + MYSQL_TIMESTAMP_ERROR = -1 + MYSQL_TIMESTAMP_DATE = 0 + MYSQL_TIMESTAMP_DATETIME = 1 + MYSQL_TIMESTAMP_TIME = 2 +end enum + +type st_mysql_time + year as ulong + month as ulong + day as ulong + hour as ulong + minute as ulong + second as ulong + second_part as culong + neg as byte + time_type as enum_mysql_timestamp_type +end type + +type MYSQL_TIME as st_mysql_time +const AUTO_SEC_PART_DIGITS = 39 +const SEC_PART_DIGITS = 6 +const MARIADB_INVALID_SOCKET = -1 +const MYSQL_WAIT_READ = 1 +const MYSQL_WAIT_WRITE = 2 +const MYSQL_WAIT_EXCEPT = 4 +const MYSQL_WAIT_TIMEOUT = 8 + +type character_set + number as ulong + state as ulong + csname as const zstring ptr + name as const zstring ptr + comment as const zstring ptr + dir as const zstring ptr + mbminlen as ulong + mbmaxlen as ulong +end type + +type MY_CHARSET_INFO as character_set +const LOCAL_INFILE_ERROR_LEN = 512 +const MYSQL_NO_DATA = 100 +const MYSQL_DATA_TRUNCATED = 101 +const MYSQL_DEFAULT_PREFETCH_ROWS = cast(culong, 1) +const MADB_BIND_DUMMY = 1 +#define MARIADB_STMT_BULK_SUPPORTED(stmt) ((stmt)->mysql andalso ((((stmt)->mysql->server_capabilities and CLIENT_MYSQL) = 0) andalso ((stmt)->mysql->extension->mariadb_server_capabilities and (MARIADB_CLIENT_STMT_BULK_OPERATIONS shr 32)))) +#macro SET_CLIENT_STMT_ERROR(a, b, c, d) + scope + (a)->last_errno = (b) + strncpy((a)->sqlstate, (c), SQLSTATE_LENGTH) + (a)->sqlstate[SQLSTATE_LENGTH] = 0 + strncpy((a)->last_error, iif((d), (d), ER((b))), MYSQL_ERRMSG_SIZE) + (a)->last_error[(MYSQL_ERRMSG_SIZE - 1)] = 0 + end scope +#endmacro +#macro CLEAR_CLIENT_STMT_ERROR(a) + scope + (a)->last_errno = 0 + strcpy((a)->sqlstate, "00000") + (a)->last_error[0] = 0 + end scope +#endmacro +const MYSQL_PS_SKIP_RESULT_W_LEN = -1 +const MYSQL_PS_SKIP_RESULT_STR = -2 +const STMT_ID_LENGTH = 4 +type MYSQL_STMT as st_mysql_stmt +type mysql_stmt_use_or_store_func as function cdecl(byval as MYSQL_STMT ptr) as MYSQL_RES ptr + +type enum_stmt_attr_type as long +enum + STMT_ATTR_UPDATE_MAX_LENGTH + STMT_ATTR_CURSOR_TYPE + STMT_ATTR_PREFETCH_ROWS + STMT_ATTR_PREBIND_PARAMS = 200 + STMT_ATTR_ARRAY_SIZE + STMT_ATTR_ROW_SIZE + STMT_ATTR_STATE + STMT_ATTR_CB_USER_DATA + STMT_ATTR_CB_PARAM + STMT_ATTR_CB_RESULT +end enum + +type enum_cursor_type as long +enum + CURSOR_TYPE_NO_CURSOR = 0 + CURSOR_TYPE_READ_ONLY = 1 + CURSOR_TYPE_FOR_UPDATE = 2 + CURSOR_TYPE_SCROLLABLE = 4 +end enum + +type enum_indicator_type as long +enum + STMT_INDICATOR_NTS = -1 + STMT_INDICATOR_NONE = 0 + STMT_INDICATOR_NULL = 1 + STMT_INDICATOR_DEFAULT = 2 + STMT_INDICATOR_IGNORE = 3 + STMT_INDICATOR_IGNORE_ROW = 4 +end enum + +const STMT_BULK_FLAG_CLIENT_SEND_TYPES = 128 +const STMT_BULK_FLAG_INSERT_ID_REQUEST = 64 + +type mysql_stmt_state as long +enum + MYSQL_STMT_INITTED = 0 + MYSQL_STMT_PREPARED + MYSQL_STMT_EXECUTED + MYSQL_STMT_WAITING_USE_OR_STORE + MYSQL_STMT_USE_OR_STORE_CALLED + MYSQL_STMT_USER_FETCHING + MYSQL_STMT_FETCH_DONE +end enum + +type enum_mysqlnd_stmt_state as mysql_stmt_state + +union st_mysql_bind_u + row_ptr as ubyte ptr + indicator as zstring ptr +end union + +type st_mysql_bind + length as culong ptr + is_null as my_bool ptr + buffer as any ptr + error as my_bool ptr + u as st_mysql_bind_u + store_param_func as sub cdecl(byval net as NET ptr, byval param as st_mysql_bind ptr) + fetch_result as sub cdecl(byval as st_mysql_bind ptr, byval as MYSQL_FIELD ptr, byval row as ubyte ptr ptr) + skip_result as sub cdecl(byval as st_mysql_bind ptr, byval as MYSQL_FIELD ptr, byval row as ubyte ptr ptr) + buffer_length as culong + offset as culong + length_value as culong + flags as ulong + pack_length as ulong + buffer_type as enum_field_types + error_value as byte + is_unsigned as byte + long_data_used as byte + is_null_value as byte + extension as any ptr +end type + +type MYSQL_BIND as st_mysql_bind + +type st_mysqlnd_upsert_result + warning_count as ulong + server_status as ulong + affected_rows as ulongint + last_insert_id as ulongint +end type + +type mysql_upsert_status as st_mysqlnd_upsert_result + +type st_mysql_cmd_buffer + buffer as ubyte ptr + length as uinteger +end type + +type MYSQL_CMD_BUFFER as st_mysql_cmd_buffer + +type st_mysql_error_info + error_no as ulong + error as zstring * 512 + 1 + sqlstate as zstring * 5 + 1 +end type + +type mysql_error_info as st_mysql_error_info +type mysql_stmt_fetch_row_func as function cdecl(byval stmt as MYSQL_STMT ptr, byval row as ubyte ptr ptr) as long +type ps_result_callback as sub cdecl(byval data as any ptr, byval column as ulong, byval row as ubyte ptr ptr) +type ps_param_callback as function cdecl(byval data as any ptr, byval bind as MYSQL_BIND ptr, byval row_nr as ulong) as my_bool ptr + +type st_mysql_stmt + mem_root as MA_MEM_ROOT + mysql as MYSQL ptr + stmt_id as culong + flags as culong + state as enum_mysqlnd_stmt_state + fields as MYSQL_FIELD ptr + field_count as ulong + param_count as ulong + send_types_to_server as ubyte + params as MYSQL_BIND ptr + bind as MYSQL_BIND ptr + result as MYSQL_DATA + result_cursor as MYSQL_ROWS ptr + bind_result_done as byte + bind_param_done as byte + upsert_status as mysql_upsert_status + last_errno as ulong + last_error as zstring * 512 + 1 + sqlstate as zstring * 5 + 1 + update_max_length as byte + prefetch_rows as culong + list as LIST + cursor_exists as byte + extension as any ptr + fetch_row_func as mysql_stmt_fetch_row_func + execute_count as ulong + default_rset_handler as mysql_stmt_use_or_store_func + request_buffer as ubyte ptr + array_size as ulong + row_size as uinteger + prebind_params as ulong + user_data as any ptr + result_callback as ps_result_callback + param_callback as ps_param_callback + request_length as uinteger +end type + +type ps_field_fetch_func as sub cdecl(byval r_param as MYSQL_BIND ptr, byval field as const MYSQL_FIELD ptr, byval row as ubyte ptr ptr) + +type st_mysql_perm_bind + func as ps_field_fetch_func + pack_len as long + max_len as culong +end type + +type MYSQL_PS_CONVERSION as st_mysql_perm_bind +extern mysql_ps_fetch_functions(0 to (MYSQL_TYPE_GEOMETRY + 1) - 1) as MYSQL_PS_CONVERSION +declare function ma_net_safe_read cdecl(byval mysql as MYSQL ptr) as culong +declare sub mysql_init_ps_subsystem cdecl() +declare function net_field_length cdecl(byval packet as ubyte ptr ptr) as culong +declare function ma_simple_command cdecl(byval mysql as MYSQL ptr, byval command as enum_server_command, byval arg as const zstring ptr, byval length as uinteger, byval skipp_check as byte, byval opt_arg as any ptr) as long +declare function mysql_stmt_init(byval mysql as MYSQL ptr) as MYSQL_STMT ptr +declare function mysql_stmt_prepare(byval stmt as MYSQL_STMT ptr, byval query as const zstring ptr, byval length as culong) as long +declare function mysql_stmt_execute(byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_fetch(byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_fetch_column(byval stmt as MYSQL_STMT ptr, byval bind_arg as MYSQL_BIND ptr, byval column as ulong, byval offset as culong) as long +declare function mysql_stmt_store_result(byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_param_count(byval stmt as MYSQL_STMT ptr) as culong +declare function mysql_stmt_attr_set(byval stmt as MYSQL_STMT ptr, byval attr_type as enum_stmt_attr_type, byval attr as const any ptr) as byte +declare function mysql_stmt_attr_get(byval stmt as MYSQL_STMT ptr, byval attr_type as enum_stmt_attr_type, byval attr as any ptr) as byte +declare function mysql_stmt_bind_param(byval stmt as MYSQL_STMT ptr, byval bnd as MYSQL_BIND ptr) as byte +declare function mysql_stmt_bind_result(byval stmt as MYSQL_STMT ptr, byval bnd as MYSQL_BIND ptr) as byte +declare function mysql_stmt_close(byval stmt as MYSQL_STMT ptr) as byte +declare function mysql_stmt_reset(byval stmt as MYSQL_STMT ptr) as byte +declare function mysql_stmt_free_result(byval stmt as MYSQL_STMT ptr) as byte +declare function mysql_stmt_send_long_data(byval stmt as MYSQL_STMT ptr, byval param_number as ulong, byval data as const zstring ptr, byval length as culong) as byte +declare function mysql_stmt_result_metadata(byval stmt as MYSQL_STMT ptr) as MYSQL_RES ptr +declare function mysql_stmt_param_metadata(byval stmt as MYSQL_STMT ptr) as MYSQL_RES ptr +declare function mysql_stmt_errno(byval stmt as MYSQL_STMT ptr) as ulong +declare function mysql_stmt_error(byval stmt as MYSQL_STMT ptr) as const zstring ptr +declare function mysql_stmt_sqlstate(byval stmt as MYSQL_STMT ptr) as const zstring ptr +declare function mysql_stmt_row_seek(byval stmt as MYSQL_STMT ptr, byval offset as MYSQL_ROW_OFFSET) as MYSQL_ROW_OFFSET +declare function mysql_stmt_row_tell(byval stmt as MYSQL_STMT ptr) as MYSQL_ROW_OFFSET +declare sub mysql_stmt_data_seek(byval stmt as MYSQL_STMT ptr, byval offset as ulongint) +declare function mysql_stmt_num_rows(byval stmt as MYSQL_STMT ptr) as ulongint +declare function mysql_stmt_affected_rows(byval stmt as MYSQL_STMT ptr) as ulongint +declare function mysql_stmt_insert_id(byval stmt as MYSQL_STMT ptr) as ulongint +declare function mysql_stmt_field_count(byval stmt as MYSQL_STMT ptr) as ulong +declare function mysql_stmt_next_result(byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_more_results(byval stmt as MYSQL_STMT ptr) as byte +declare function mariadb_stmt_execute_direct(byval stmt as MYSQL_STMT ptr, byval stmt_str as const zstring ptr, byval length as uinteger) as long +declare function mariadb_stmt_fetch_fields(byval stmt as MYSQL_STMT ptr) as MYSQL_FIELD ptr + +type st_mysql_client_plugin + as long type + interface_version as ulong + name as const zstring ptr + author as const zstring ptr + desc as const zstring ptr + version(0 to 2) as ulong + license as const zstring ptr + mysql_api as any ptr + init as function cdecl(byval as zstring ptr, byval as uinteger, byval as long, byval as va_list) as long + deinit as function cdecl() as long + options as function cdecl(byval option as const zstring ptr, byval as const any ptr) as long +end type + +declare function mysql_load_plugin cdecl(byval mysql as st_mysql ptr, byval name as const zstring ptr, byval type as long, byval argc as long, ...) as st_mysql_client_plugin ptr +declare function mysql_load_plugin_v(byval mysql as st_mysql ptr, byval name as const zstring ptr, byval type as long, byval argc as long, byval args as va_list) as st_mysql_client_plugin ptr +declare function mysql_client_find_plugin(byval mysql as st_mysql ptr, byval name as const zstring ptr, byval type as long) as st_mysql_client_plugin ptr +declare function mysql_client_register_plugin(byval mysql as st_mysql ptr, byval plugin as st_mysql_client_plugin ptr) as st_mysql_client_plugin ptr +declare sub mysql_set_local_infile_handler(byval mysql as MYSQL ptr, byval local_infile_init as function cdecl(byval as any ptr ptr, byval as const zstring ptr, byval as any ptr) as long, byval local_infile_read as function cdecl(byval as any ptr, byval as zstring ptr, byval as ulong) as long, byval local_infile_end as sub cdecl(byval as any ptr), byval local_infile_error as function cdecl(byval as any ptr, byval as zstring ptr, byval as ulong) as long, byval as any ptr) +declare sub mysql_set_local_infile_default cdecl(byval mysql as MYSQL ptr) +declare sub my_set_error cdecl(byval mysql as MYSQL ptr, byval error_nr as ulong, byval sqlstate as const zstring ptr, byval format as const zstring ptr, ...) +declare function mysql_num_rows(byval res as MYSQL_RES ptr) as my_ulonglong +declare function mysql_num_fields(byval res as MYSQL_RES ptr) as ulong +declare function mysql_eof(byval res as MYSQL_RES ptr) as byte +declare function mysql_fetch_field_direct(byval res as MYSQL_RES ptr, byval fieldnr as ulong) as MYSQL_FIELD ptr +declare function mysql_fetch_fields(byval res as MYSQL_RES ptr) as MYSQL_FIELD ptr +declare function mysql_row_tell(byval res as MYSQL_RES ptr) as MYSQL_ROWS ptr +declare function mysql_field_tell(byval res as MYSQL_RES ptr) as ulong +declare function mysql_field_count(byval mysql as MYSQL ptr) as ulong +declare function mysql_more_results(byval mysql as MYSQL ptr) as byte +declare function mysql_next_result(byval mysql as MYSQL ptr) as long +declare function mysql_affected_rows(byval mysql as MYSQL ptr) as my_ulonglong +declare function mysql_autocommit(byval mysql as MYSQL ptr, byval mode as byte) as byte +declare function mysql_commit(byval mysql as MYSQL ptr) as byte +declare function mysql_rollback(byval mysql as MYSQL ptr) as byte +declare function mysql_insert_id(byval mysql as MYSQL ptr) as my_ulonglong +declare function mysql_errno(byval mysql as MYSQL ptr) as ulong +declare function mysql_error(byval mysql as MYSQL ptr) as const zstring ptr +declare function mysql_info(byval mysql as MYSQL ptr) as const zstring ptr +declare function mysql_thread_id(byval mysql as MYSQL ptr) as culong +declare function mysql_character_set_name(byval mysql as MYSQL ptr) as const zstring ptr +declare sub mysql_get_character_set_info(byval mysql as MYSQL ptr, byval cs as MY_CHARSET_INFO ptr) +declare function mysql_set_character_set(byval mysql as MYSQL ptr, byval csname as const zstring ptr) as long +declare function mariadb_get_infov cdecl(byval mysql as MYSQL ptr, byval value as mariadb_value, byval arg as any ptr, ...) as byte +declare function mariadb_get_info(byval mysql as MYSQL ptr, byval value as mariadb_value, byval arg as any ptr) as byte +declare function mysql_init(byval mysql as MYSQL ptr) as MYSQL ptr +declare function mysql_ssl_set(byval mysql as MYSQL ptr, byval key as const zstring ptr, byval cert as const zstring ptr, byval ca as const zstring ptr, byval capath as const zstring ptr, byval cipher as const zstring ptr) as long +declare function mysql_get_ssl_cipher(byval mysql as MYSQL ptr) as const zstring ptr +declare function mysql_change_user(byval mysql as MYSQL ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr) as byte +declare function mysql_real_connect(byval mysql as MYSQL ptr, byval host as const zstring ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr, byval port as ulong, byval unix_socket as const zstring ptr, byval clientflag as culong) as MYSQL ptr +declare sub mysql_close(byval sock as MYSQL ptr) +declare function mysql_select_db(byval mysql as MYSQL ptr, byval db as const zstring ptr) as long +declare function mysql_query(byval mysql as MYSQL ptr, byval q as const zstring ptr) as long +declare function mysql_send_query(byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long +declare function mysql_read_query_result(byval mysql as MYSQL ptr) as byte +declare function mysql_real_query(byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long +declare function mysql_shutdown(byval mysql as MYSQL ptr, byval shutdown_level as mysql_enum_shutdown_level) as long +declare function mysql_dump_debug_info(byval mysql as MYSQL ptr) as long +declare function mysql_refresh(byval mysql as MYSQL ptr, byval refresh_options as ulong) as long +declare function mysql_kill(byval mysql as MYSQL ptr, byval pid as culong) as long +declare function mysql_ping(byval mysql as MYSQL ptr) as long +declare function mysql_stat(byval mysql as MYSQL ptr) as zstring ptr +declare function mysql_get_server_info(byval mysql as MYSQL ptr) as zstring ptr +declare function mysql_get_server_version(byval mysql as MYSQL ptr) as culong +declare function mysql_get_host_info(byval mysql as MYSQL ptr) as zstring ptr +declare function mysql_get_proto_info(byval mysql as MYSQL ptr) as ulong +declare function mysql_list_dbs(byval mysql as MYSQL ptr, byval wild as const zstring ptr) as MYSQL_RES ptr +declare function mysql_list_tables(byval mysql as MYSQL ptr, byval wild as const zstring ptr) as MYSQL_RES ptr +declare function mysql_list_fields(byval mysql as MYSQL ptr, byval table as const zstring ptr, byval wild as const zstring ptr) as MYSQL_RES ptr +declare function mysql_list_processes(byval mysql as MYSQL ptr) as MYSQL_RES ptr +declare function mysql_store_result(byval mysql as MYSQL ptr) as MYSQL_RES ptr +declare function mysql_use_result(byval mysql as MYSQL ptr) as MYSQL_RES ptr +declare function mysql_options(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as const any ptr) as long +declare function mysql_options4(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg1 as const any ptr, byval arg2 as const any ptr) as long +declare sub mysql_free_result(byval result as MYSQL_RES ptr) +declare sub mysql_data_seek(byval result as MYSQL_RES ptr, byval offset as ulongint) +declare function mysql_row_seek(byval result as MYSQL_RES ptr, byval as MYSQL_ROW_OFFSET) as MYSQL_ROW_OFFSET +declare function mysql_field_seek(byval result as MYSQL_RES ptr, byval offset as MYSQL_FIELD_OFFSET) as MYSQL_FIELD_OFFSET +declare function mysql_fetch_row(byval result as MYSQL_RES ptr) as MYSQL_ROW +declare function mysql_fetch_lengths(byval result as MYSQL_RES ptr) as culong ptr +declare function mysql_fetch_field(byval result as MYSQL_RES ptr) as MYSQL_FIELD ptr +declare function mysql_escape_string(byval to as zstring ptr, byval from as const zstring ptr, byval from_length as culong) as culong +declare function mysql_real_escape_string(byval mysql as MYSQL ptr, byval to as zstring ptr, byval from as const zstring ptr, byval length as culong) as culong +declare function mysql_thread_safe() as ulong +declare function mysql_warning_count(byval mysql as MYSQL ptr) as ulong +declare function mysql_sqlstate(byval mysql as MYSQL ptr) as const zstring ptr +declare function mysql_server_init(byval argc as long, byval argv as zstring ptr ptr, byval groups as zstring ptr ptr) as long +declare sub mysql_server_end() +declare sub mysql_thread_end() +declare function mysql_thread_init() as byte +declare function mysql_set_server_option(byval mysql as MYSQL ptr, byval option as enum_mysql_set_option) as long +declare function mysql_get_client_info() as const zstring ptr +declare function mysql_get_client_version() as culong +declare function mariadb_connection(byval mysql as MYSQL ptr) as byte +declare function mysql_get_server_name(byval mysql as MYSQL ptr) as const zstring ptr +declare function mariadb_get_charset_by_name(byval csname as const zstring ptr) as MARIADB_CHARSET_INFO ptr +declare function mariadb_get_charset_by_nr(byval csnr as ulong) as MARIADB_CHARSET_INFO ptr +declare function mariadb_convert_string(byval from as const zstring ptr, byval from_len as uinteger ptr, byval from_cs as MARIADB_CHARSET_INFO ptr, byval to as zstring ptr, byval to_len as uinteger ptr, byval to_cs as MARIADB_CHARSET_INFO ptr, byval errorcode as long ptr) as uinteger +declare function mysql_optionsv cdecl(byval mysql as MYSQL ptr, byval option as mysql_option, ...) as long +declare function mysql_get_optionv cdecl(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as any ptr, ...) as long +declare function mysql_get_option(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as any ptr) as long +declare function mysql_hex_string(byval to as zstring ptr, byval from as const zstring ptr, byval len as culong) as culong + +#ifdef __FB_UNIX__ + declare function mysql_get_socket(byval mysql as MYSQL ptr) as my_socket +#elseif defined(__FB_WIN32__) and (not defined(__FB_64BIT__)) + declare function mysql_get_socket(byval mysql as MYSQL ptr) as ulong +#else + declare function mysql_get_socket(byval mysql as MYSQL ptr) as ulongint +#endif + +declare function mysql_get_timeout_value(byval mysql as const MYSQL ptr) as ulong +declare function mysql_get_timeout_value_ms(byval mysql as const MYSQL ptr) as ulong +declare function mariadb_reconnect(byval mysql as MYSQL ptr) as byte +declare function mariadb_cancel(byval mysql as MYSQL ptr) as long +declare sub mysql_debug(byval debug as const zstring ptr) +declare function mysql_net_read_packet(byval mysql as MYSQL ptr) as culong +declare function mysql_net_field_length(byval packet as ubyte ptr ptr) as culong +declare function mysql_embedded() as byte +declare function mysql_get_parameters() as MYSQL_PARAMETERS ptr +declare function mysql_close_start(byval sock as MYSQL ptr) as long +declare function mysql_close_cont(byval sock as MYSQL ptr, byval status as long) as long +declare function mysql_commit_start(byval ret as my_bool ptr, byval mysql as MYSQL ptr) as long +declare function mysql_commit_cont(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_dump_debug_info_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval ready_status as long) as long +declare function mysql_dump_debug_info_start(byval ret as long ptr, byval mysql as MYSQL ptr) as long +declare function mysql_rollback_start(byval ret as my_bool ptr, byval mysql as MYSQL ptr) as long +declare function mysql_rollback_cont(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_autocommit_start(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval auto_mode as byte) as long +declare function mysql_list_fields_cont(byval ret as MYSQL_RES ptr ptr, byval mysql as MYSQL ptr, byval ready_status as long) as long +declare function mysql_list_fields_start(byval ret as MYSQL_RES ptr ptr, byval mysql as MYSQL ptr, byval table as const zstring ptr, byval wild as const zstring ptr) as long +declare function mysql_autocommit_cont(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_next_result_start(byval ret as long ptr, byval mysql as MYSQL ptr) as long +declare function mysql_next_result_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_select_db_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval db as const zstring ptr) as long +declare function mysql_select_db_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval ready_status as long) as long +declare function mysql_stmt_warning_count(byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_next_result_start(byval ret as long ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_next_result_cont(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_set_character_set_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval csname as const zstring ptr) as long +declare function mysql_set_character_set_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_change_user_start(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr) as long +declare function mysql_change_user_cont(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_real_connect_start(byval ret as MYSQL ptr ptr, byval mysql as MYSQL ptr, byval host as const zstring ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr, byval port as ulong, byval unix_socket as const zstring ptr, byval clientflag as culong) as long +declare function mysql_real_connect_cont(byval ret as MYSQL ptr ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_query_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval q as const zstring ptr) as long +declare function mysql_query_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_send_query_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long +declare function mysql_send_query_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_real_query_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long +declare function mysql_real_query_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_store_result_start(byval ret as MYSQL_RES ptr ptr, byval mysql as MYSQL ptr) as long +declare function mysql_store_result_cont(byval ret as MYSQL_RES ptr ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_shutdown_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval shutdown_level as mysql_enum_shutdown_level) as long +declare function mysql_shutdown_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_refresh_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval refresh_options as ulong) as long +declare function mysql_refresh_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_kill_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval pid as culong) as long +declare function mysql_kill_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_set_server_option_start(byval ret as long ptr, byval mysql as MYSQL ptr, byval option as enum_mysql_set_option) as long +declare function mysql_set_server_option_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_ping_start(byval ret as long ptr, byval mysql as MYSQL ptr) as long +declare function mysql_ping_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_stat_start(byval ret as const zstring ptr ptr, byval mysql as MYSQL ptr) as long +declare function mysql_stat_cont(byval ret as const zstring ptr ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_free_result_start(byval result as MYSQL_RES ptr) as long +declare function mysql_free_result_cont(byval result as MYSQL_RES ptr, byval status as long) as long +declare function mysql_fetch_row_start(byval ret as MYSQL_ROW ptr, byval result as MYSQL_RES ptr) as long +declare function mysql_fetch_row_cont(byval ret as MYSQL_ROW ptr, byval result as MYSQL_RES ptr, byval status as long) as long +declare function mysql_read_query_result_start(byval ret as my_bool ptr, byval mysql as MYSQL ptr) as long +declare function mysql_read_query_result_cont(byval ret as my_bool ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_reset_connection_start(byval ret as long ptr, byval mysql as MYSQL ptr) as long +declare function mysql_reset_connection_cont(byval ret as long ptr, byval mysql as MYSQL ptr, byval status as long) as long +declare function mysql_session_track_get_next(byval mysql as MYSQL ptr, byval type as enum_session_state_type, byval data as const zstring ptr ptr, byval length as uinteger ptr) as long +declare function mysql_session_track_get_first(byval mysql as MYSQL ptr, byval type as enum_session_state_type, byval data as const zstring ptr ptr, byval length as uinteger ptr) as long +declare function mysql_stmt_prepare_start(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval query as const zstring ptr, byval length as culong) as long +declare function mysql_stmt_prepare_cont(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_execute_start(byval ret as long ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_execute_cont(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_fetch_start(byval ret as long ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_fetch_cont(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_store_result_start(byval ret as long ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_store_result_cont(byval ret as long ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_close_start(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_close_cont(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_reset_start(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_reset_cont(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_free_result_start(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr) as long +declare function mysql_stmt_free_result_cont(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_stmt_send_long_data_start(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr, byval param_number as ulong, byval data as const zstring ptr, byval len as culong) as long +declare function mysql_stmt_send_long_data_cont(byval ret as my_bool ptr, byval stmt as MYSQL_STMT ptr, byval status as long) as long +declare function mysql_reset_connection(byval mysql as MYSQL ptr) as long + +type st_mariadb_api + mysql_num_rows as function(byval res as MYSQL_RES ptr) as ulongint + mysql_num_fields as function(byval res as MYSQL_RES ptr) as ulong + mysql_eof as function(byval res as MYSQL_RES ptr) as byte + mysql_fetch_field_direct as function(byval res as MYSQL_RES ptr, byval fieldnr as ulong) as MYSQL_FIELD ptr + mysql_fetch_fields as function(byval res as MYSQL_RES ptr) as MYSQL_FIELD ptr + mysql_row_tell as function(byval res as MYSQL_RES ptr) as MYSQL_ROWS ptr + mysql_field_tell as function(byval res as MYSQL_RES ptr) as ulong + mysql_field_count as function(byval mysql as MYSQL ptr) as ulong + mysql_more_results as function(byval mysql as MYSQL ptr) as byte + mysql_next_result as function(byval mysql as MYSQL ptr) as long + mysql_affected_rows as function(byval mysql as MYSQL ptr) as ulongint + mysql_autocommit as function(byval mysql as MYSQL ptr, byval mode as byte) as byte + mysql_commit as function(byval mysql as MYSQL ptr) as byte + mysql_rollback as function(byval mysql as MYSQL ptr) as byte + mysql_insert_id as function(byval mysql as MYSQL ptr) as ulongint + mysql_errno as function(byval mysql as MYSQL ptr) as ulong + mysql_error as function(byval mysql as MYSQL ptr) as const zstring ptr + mysql_info as function(byval mysql as MYSQL ptr) as const zstring ptr + mysql_thread_id as function(byval mysql as MYSQL ptr) as culong + mysql_character_set_name as function(byval mysql as MYSQL ptr) as const zstring ptr + mysql_get_character_set_info as sub(byval mysql as MYSQL ptr, byval cs as MY_CHARSET_INFO ptr) + mysql_set_character_set as function(byval mysql as MYSQL ptr, byval csname as const zstring ptr) as long + mariadb_get_infov as function cdecl(byval mysql as MYSQL ptr, byval value as mariadb_value, byval arg as any ptr, ...) as byte + mariadb_get_info as function(byval mysql as MYSQL ptr, byval value as mariadb_value, byval arg as any ptr) as byte + mysql_init as function(byval mysql as MYSQL ptr) as MYSQL ptr + mysql_ssl_set as function(byval mysql as MYSQL ptr, byval key as const zstring ptr, byval cert as const zstring ptr, byval ca as const zstring ptr, byval capath as const zstring ptr, byval cipher as const zstring ptr) as long + mysql_get_ssl_cipher as function(byval mysql as MYSQL ptr) as const zstring ptr + mysql_change_user as function(byval mysql as MYSQL ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr) as byte + mysql_real_connect as function(byval mysql as MYSQL ptr, byval host as const zstring ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr, byval port as ulong, byval unix_socket as const zstring ptr, byval clientflag as culong) as MYSQL ptr + mysql_close as sub(byval sock as MYSQL ptr) + mysql_select_db as function(byval mysql as MYSQL ptr, byval db as const zstring ptr) as long + mysql_query as function(byval mysql as MYSQL ptr, byval q as const zstring ptr) as long + mysql_send_query as function(byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long + mysql_read_query_result as function(byval mysql as MYSQL ptr) as byte + mysql_real_query as function(byval mysql as MYSQL ptr, byval q as const zstring ptr, byval length as culong) as long + mysql_shutdown as function(byval mysql as MYSQL ptr, byval shutdown_level as mysql_enum_shutdown_level) as long + mysql_dump_debug_info as function(byval mysql as MYSQL ptr) as long + mysql_refresh as function(byval mysql as MYSQL ptr, byval refresh_options as ulong) as long + mysql_kill as function(byval mysql as MYSQL ptr, byval pid as culong) as long + mysql_ping as function(byval mysql as MYSQL ptr) as long + mysql_stat as function(byval mysql as MYSQL ptr) as zstring ptr + mysql_get_server_info as function(byval mysql as MYSQL ptr) as zstring ptr + mysql_get_server_version as function(byval mysql as MYSQL ptr) as culong + mysql_get_host_info as function(byval mysql as MYSQL ptr) as zstring ptr + mysql_get_proto_info as function(byval mysql as MYSQL ptr) as ulong + mysql_list_dbs as function(byval mysql as MYSQL ptr, byval wild as const zstring ptr) as MYSQL_RES ptr + mysql_list_tables as function(byval mysql as MYSQL ptr, byval wild as const zstring ptr) as MYSQL_RES ptr + mysql_list_fields as function(byval mysql as MYSQL ptr, byval table as const zstring ptr, byval wild as const zstring ptr) as MYSQL_RES ptr + mysql_list_processes as function(byval mysql as MYSQL ptr) as MYSQL_RES ptr + mysql_store_result as function(byval mysql as MYSQL ptr) as MYSQL_RES ptr + mysql_use_result as function(byval mysql as MYSQL ptr) as MYSQL_RES ptr + mysql_options as function(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as const any ptr) as long + mysql_free_result as sub(byval result as MYSQL_RES ptr) + mysql_data_seek as sub(byval result as MYSQL_RES ptr, byval offset as ulongint) + mysql_row_seek as function(byval result as MYSQL_RES ptr, byval as MYSQL_ROW_OFFSET) as MYSQL_ROW_OFFSET + mysql_field_seek as function(byval result as MYSQL_RES ptr, byval offset as MYSQL_FIELD_OFFSET) as MYSQL_FIELD_OFFSET + mysql_fetch_row as function(byval result as MYSQL_RES ptr) as MYSQL_ROW + mysql_fetch_lengths as function(byval result as MYSQL_RES ptr) as culong ptr + mysql_fetch_field as function(byval result as MYSQL_RES ptr) as MYSQL_FIELD ptr + mysql_escape_string as function(byval to as zstring ptr, byval from as const zstring ptr, byval from_length as culong) as culong + mysql_real_escape_string as function(byval mysql as MYSQL ptr, byval to as zstring ptr, byval from as const zstring ptr, byval length as culong) as culong + mysql_thread_safe as function() as ulong + mysql_warning_count as function(byval mysql as MYSQL ptr) as ulong + mysql_sqlstate as function(byval mysql as MYSQL ptr) as const zstring ptr + mysql_server_init as function(byval argc as long, byval argv as zstring ptr ptr, byval groups as zstring ptr ptr) as long + mysql_server_end as sub() + mysql_thread_end as sub() + mysql_thread_init as function() as byte + mysql_set_server_option as function(byval mysql as MYSQL ptr, byval option as enum_mysql_set_option) as long + mysql_get_client_info as function() as const zstring ptr + mysql_get_client_version as function() as culong + mariadb_connection as function(byval mysql as MYSQL ptr) as byte + mysql_get_server_name as function(byval mysql as MYSQL ptr) as const zstring ptr + mariadb_get_charset_by_name as function(byval csname as const zstring ptr) as MARIADB_CHARSET_INFO ptr + mariadb_get_charset_by_nr as function(byval csnr as ulong) as MARIADB_CHARSET_INFO ptr + mariadb_convert_string as function(byval from as const zstring ptr, byval from_len as uinteger ptr, byval from_cs as MARIADB_CHARSET_INFO ptr, byval to as zstring ptr, byval to_len as uinteger ptr, byval to_cs as MARIADB_CHARSET_INFO ptr, byval errorcode as long ptr) as uinteger + mysql_optionsv as function cdecl(byval mysql as MYSQL ptr, byval option as mysql_option, ...) as long + mysql_get_optionv as function cdecl(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as any ptr, ...) as long + mysql_get_option as function(byval mysql as MYSQL ptr, byval option as mysql_option, byval arg as any ptr) as long + mysql_hex_string as function(byval to as zstring ptr, byval from as const zstring ptr, byval len as culong) as culong + + #ifdef __FB_UNIX__ + mysql_get_socket as function(byval mysql as MYSQL ptr) as my_socket + #elseif defined(__FB_WIN32__) and (not defined(__FB_64BIT__)) + mysql_get_socket as function(byval mysql as MYSQL ptr) as ulong + #else + mysql_get_socket as function(byval mysql as MYSQL ptr) as ulongint + #endif + + mysql_get_timeout_value as function(byval mysql as const MYSQL ptr) as ulong + mysql_get_timeout_value_ms as function(byval mysql as const MYSQL ptr) as ulong + mariadb_reconnect as function(byval mysql as MYSQL ptr) as byte + mysql_stmt_init as function(byval mysql as MYSQL ptr) as MYSQL_STMT ptr + mysql_stmt_prepare as function(byval stmt as MYSQL_STMT ptr, byval query as const zstring ptr, byval length as culong) as long + mysql_stmt_execute as function(byval stmt as MYSQL_STMT ptr) as long + mysql_stmt_fetch as function(byval stmt as MYSQL_STMT ptr) as long + mysql_stmt_fetch_column as function(byval stmt as MYSQL_STMT ptr, byval bind_arg as MYSQL_BIND ptr, byval column as ulong, byval offset as culong) as long + mysql_stmt_store_result as function(byval stmt as MYSQL_STMT ptr) as long + mysql_stmt_param_count as function(byval stmt as MYSQL_STMT ptr) as culong + mysql_stmt_attr_set as function(byval stmt as MYSQL_STMT ptr, byval attr_type as enum_stmt_attr_type, byval attr as const any ptr) as byte + mysql_stmt_attr_get as function(byval stmt as MYSQL_STMT ptr, byval attr_type as enum_stmt_attr_type, byval attr as any ptr) as byte + mysql_stmt_bind_param as function(byval stmt as MYSQL_STMT ptr, byval bnd as MYSQL_BIND ptr) as byte + mysql_stmt_bind_result as function(byval stmt as MYSQL_STMT ptr, byval bnd as MYSQL_BIND ptr) as byte + mysql_stmt_close as function(byval stmt as MYSQL_STMT ptr) as byte + mysql_stmt_reset as function(byval stmt as MYSQL_STMT ptr) as byte + mysql_stmt_free_result as function(byval stmt as MYSQL_STMT ptr) as byte + mysql_stmt_send_long_data as function(byval stmt as MYSQL_STMT ptr, byval param_number as ulong, byval data as const zstring ptr, byval length as culong) as byte + mysql_stmt_result_metadata as function(byval stmt as MYSQL_STMT ptr) as MYSQL_RES ptr + mysql_stmt_param_metadata as function(byval stmt as MYSQL_STMT ptr) as MYSQL_RES ptr + mysql_stmt_errno as function(byval stmt as MYSQL_STMT ptr) as ulong + mysql_stmt_error as function(byval stmt as MYSQL_STMT ptr) as const zstring ptr + mysql_stmt_sqlstate as function(byval stmt as MYSQL_STMT ptr) as const zstring ptr + mysql_stmt_row_seek as function(byval stmt as MYSQL_STMT ptr, byval offset as MYSQL_ROW_OFFSET) as MYSQL_ROW_OFFSET + mysql_stmt_row_tell as function(byval stmt as MYSQL_STMT ptr) as MYSQL_ROW_OFFSET + mysql_stmt_data_seek as sub(byval stmt as MYSQL_STMT ptr, byval offset as ulongint) + mysql_stmt_num_rows as function(byval stmt as MYSQL_STMT ptr) as ulongint + mysql_stmt_affected_rows as function(byval stmt as MYSQL_STMT ptr) as ulongint + mysql_stmt_insert_id as function(byval stmt as MYSQL_STMT ptr) as ulongint + mysql_stmt_field_count as function(byval stmt as MYSQL_STMT ptr) as ulong + mysql_stmt_next_result as function(byval stmt as MYSQL_STMT ptr) as long + mysql_stmt_more_results as function(byval stmt as MYSQL_STMT ptr) as byte + mariadb_stmt_execute_direct as function(byval stmt as MYSQL_STMT ptr, byval stmtstr as const zstring ptr, byval length as uinteger) as long + mysql_reset_connection as function(byval mysql as MYSQL ptr) as long +end type + +type st_mariadb_methods_ + db_connect as function cdecl(byval mysql as MYSQL ptr, byval host as const zstring ptr, byval user as const zstring ptr, byval passwd as const zstring ptr, byval db as const zstring ptr, byval port as ulong, byval unix_socket as const zstring ptr, byval clientflag as culong) as MYSQL ptr + db_close as sub cdecl(byval mysql as MYSQL ptr) + db_command as function cdecl(byval mysql as MYSQL ptr, byval command as enum_server_command, byval arg as const zstring ptr, byval length as uinteger, byval skipp_check as byte, byval opt_arg as any ptr) as long + db_skip_result as sub cdecl(byval mysql as MYSQL ptr) + db_read_query_result as function cdecl(byval mysql as MYSQL ptr) as long + db_read_rows as function cdecl(byval mysql as MYSQL ptr, byval fields as MYSQL_FIELD ptr, byval field_count as ulong) as MYSQL_DATA ptr + db_read_one_row as function cdecl(byval mysql as MYSQL ptr, byval fields as ulong, byval row as MYSQL_ROW, byval lengths as culong ptr) as long + db_supported_buffer_type as function cdecl(byval type as enum_field_types) as byte + db_read_prepare_response as function cdecl(byval stmt as MYSQL_STMT ptr) as byte + db_read_stmt_result as function cdecl(byval mysql as MYSQL ptr) as long + db_stmt_get_result_metadata as function cdecl(byval stmt as MYSQL_STMT ptr) as byte + db_stmt_get_param_metadata as function cdecl(byval stmt as MYSQL_STMT ptr) as byte + db_stmt_read_all_rows as function cdecl(byval stmt as MYSQL_STMT ptr) as long + db_stmt_fetch as function cdecl(byval stmt as MYSQL_STMT ptr, byval row as ubyte ptr ptr) as long + db_stmt_fetch_to_bind as function cdecl(byval stmt as MYSQL_STMT ptr, byval row as ubyte ptr) as long + db_stmt_flush_unbuffered as sub cdecl(byval stmt as MYSQL_STMT ptr) + set_error as sub cdecl(byval mysql as MYSQL ptr, byval error_nr as ulong, byval sqlstate as const zstring ptr, byval format as const zstring ptr, ...) + invalidate_stmts as sub cdecl(byval mysql as MYSQL ptr, byval function_name as const zstring ptr) + api as st_mariadb_api ptr + db_read_execute_response as function cdecl(byval stmt as MYSQL_STMT ptr) as long + db_execute_generate_request as function cdecl(byval stmt as MYSQL_STMT ptr, byval request_len as uinteger ptr, byval internal as byte) as ubyte ptr +end type + +#define mysql_reload(mysql) mysql_refresh((mysql), REFRESH_GRANT) +declare function mysql_library_init alias "mysql_server_init"(byval argc as long, byval argv as zstring ptr ptr, byval groups as zstring ptr ptr) as long +declare sub mysql_library_end alias "mysql_server_end"() +#define mariadb_connect(hdl, conn_str) mysql_real_connect((hdl), (conn_str), NULL, NULL, NULL, 0, NULL, 0) +#define HAVE_MYSQL_REAL_CONNECT + +end extern diff --git a/inc/postgresql/libpq-fe.bi b/inc/postgresql/libpq-fe.bi index a5affa3106..6aa810336c 100644 --- a/inc/postgresql/libpq-fe.bi +++ b/inc/postgresql/libpq-fe.bi @@ -1,10 +1,10 @@ -'' FreeBASIC binding for postgresql-12.0 +'' FreeBASIC binding for postgresql-14.0 '' '' based on the C header files: '' PostgreSQL Database Management System '' (formerly known as Postgres, then as Postgres95) '' -'' Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group +'' Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group '' '' Portions Copyright (c) 1994, The Regents of the University of California '' @@ -26,7 +26,7 @@ '' PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. '' '' translated to FreeBASIC by: -'' Copyright © 2019 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once @@ -38,6 +38,8 @@ extern "C" #define LIBPQ_FE_H +const LIBPQ_HAS_PIPELINING = 1 +const LIBPQ_HAS_TRACE_FLAGS = 1 const PG_COPYRES_ATTRS = &h01 const PG_COPYRES_TUPLES = &h02 const PG_COPYRES_EVENTS = &h04 @@ -57,6 +59,8 @@ enum CONNECTION_CHECK_WRITABLE CONNECTION_CONSUME CONNECTION_GSS_STARTUP + CONNECTION_CHECK_TARGET + CONNECTION_CHECK_STANDBY end enum type PostgresPollingStatusType as long @@ -80,6 +84,8 @@ enum PGRES_FATAL_ERROR PGRES_COPY_BOTH PGRES_SINGLE_TUPLE + PGRES_PIPELINE_SYNC + PGRES_PIPELINE_ABORTED end enum type PGTransactionStatusType as long @@ -114,6 +120,13 @@ enum PQPING_NO_ATTEMPT end enum +type PGpipelineStatus as long +enum + PQ_PIPELINE_OFF + PQ_PIPELINE_ON + PQ_PIPELINE_ABORTED +end enum + type PGconn as pg_conn type PGresult as pg_result type PGcancel as pg_cancel @@ -212,6 +225,7 @@ declare function PQserverVersion(byval conn as const PGconn ptr) as long declare function PQerrorMessage(byval conn as const PGconn ptr) as zstring ptr declare function PQsocket(byval conn as const PGconn ptr) as long declare function PQbackendPID(byval conn as const PGconn ptr) as long +declare function PQpipelineStatus(byval conn as const PGconn ptr) as PGpipelineStatus declare function PQconnectionNeedsPassword(byval conn as const PGconn ptr) as long declare function PQconnectionUsedPassword(byval conn as const PGconn ptr) as long declare function PQclientEncoding(byval conn as const PGconn ptr) as long @@ -227,16 +241,20 @@ declare function PQgssEncInUse(byval conn as PGconn ptr) as long declare function PQgetgssctx(byval conn as PGconn ptr) as any ptr declare function PQsetErrorVerbosity(byval conn as PGconn ptr, byval verbosity as PGVerbosity) as PGVerbosity declare function PQsetErrorContextVisibility(byval conn as PGconn ptr, byval show_context as PGContextVisibility) as PGContextVisibility -declare sub PQtrace(byval conn as PGconn ptr, byval debug_port as FILE ptr) -declare sub PQuntrace(byval conn as PGconn ptr) declare function PQsetNoticeReceiver(byval conn as PGconn ptr, byval proc as PQnoticeReceiver, byval arg as any ptr) as PQnoticeReceiver declare function PQsetNoticeProcessor(byval conn as PGconn ptr, byval proc as PQnoticeProcessor, byval arg as any ptr) as PQnoticeProcessor type pgthreadlock_t as sub(byval acquire as long) declare function PQregisterThreadLock(byval newhandler as pgthreadlock_t) as pgthreadlock_t +declare sub PQtrace(byval conn as PGconn ptr, byval debug_port as FILE ptr) +declare sub PQuntrace(byval conn as PGconn ptr) +const PQTRACE_SUPPRESS_TIMESTAMPS = 1 shl 0 +const PQTRACE_REGRESS_MODE = 1 shl 1 +declare sub PQsetTraceFlags(byval conn as PGconn ptr, byval flags as long) declare function PQexec(byval conn as PGconn ptr, byval query as const zstring ptr) as PGresult ptr declare function PQexecParams(byval conn as PGconn ptr, byval command as const zstring ptr, byval nParams as long, byval paramTypes as const Oid ptr, byval paramValues as const zstring const ptr ptr, byval paramLengths as const long ptr, byval paramFormats as const long ptr, byval resultFormat as long) as PGresult ptr declare function PQprepare(byval conn as PGconn ptr, byval stmtName as const zstring ptr, byval query as const zstring ptr, byval nParams as long, byval paramTypes as const Oid ptr) as PGresult ptr declare function PQexecPrepared(byval conn as PGconn ptr, byval stmtName as const zstring ptr, byval nParams as long, byval paramValues as const zstring const ptr ptr, byval paramLengths as const long ptr, byval paramFormats as const long ptr, byval resultFormat as long) as PGresult ptr +const PQ_QUERY_PARAM_MAX_LIMIT = 65535 declare function PQsendQuery(byval conn as PGconn ptr, byval query as const zstring ptr) as long declare function PQsendQueryParams(byval conn as PGconn ptr, byval command as const zstring ptr, byval nParams as long, byval paramTypes as const Oid ptr, byval paramValues as const zstring const ptr ptr, byval paramLengths as const long ptr, byval paramFormats as const long ptr, byval resultFormat as long) as long declare function PQsendPrepare(byval conn as PGconn ptr, byval stmtName as const zstring ptr, byval query as const zstring ptr, byval nParams as long, byval paramTypes as const Oid ptr) as long @@ -245,6 +263,10 @@ declare function PQsetSingleRowMode(byval conn as PGconn ptr) as long declare function PQgetResult(byval conn as PGconn ptr) as PGresult ptr declare function PQisBusy(byval conn as PGconn ptr) as long declare function PQconsumeInput(byval conn as PGconn ptr) as long +declare function PQenterPipelineMode(byval conn as PGconn ptr) as long +declare function PQexitPipelineMode(byval conn as PGconn ptr) as long +declare function PQpipelineSync(byval conn as PGconn ptr) as long +declare function PQsendFlushRequest(byval conn as PGconn ptr) as long declare function PQnotifies(byval conn as PGconn ptr) as PGnotify ptr declare function PQputCopyData(byval conn as PGconn ptr, byval buffer as const zstring ptr, byval nbytes as long) as long declare function PQputCopyEnd(byval conn as PGconn ptr, byval errormsg as const zstring ptr) as long @@ -309,7 +331,7 @@ declare function PQescapeString(byval to as zstring ptr, byval from as const zst declare function PQescapeBytea(byval from as const ubyte ptr, byval from_length as uinteger, byval to_length as uinteger ptr) as ubyte ptr declare sub PQprint(byval fout as FILE ptr, byval res as const PGresult ptr, byval ps as const PQprintOpt ptr) declare sub PQdisplayTuples(byval res as const PGresult ptr, byval fp as FILE ptr, byval fillAlign as long, byval fieldSep as const zstring ptr, byval printHeader as long, byval quiet as long) -declare sub PQprintTuples(byval res as const PGresult ptr, byval fout as FILE ptr, byval printAttName as long, byval terseOutput as long, byval width as long) +declare sub PQprintTuples(byval res as const PGresult ptr, byval fout as FILE ptr, byval PrintAttNames as long, byval TerseOutput as long, byval colWidth as long) declare function lo_open(byval conn as PGconn ptr, byval lobjId as Oid, byval mode as long) as long declare function lo_close(byval conn as PGconn ptr, byval fd as long) as long declare function lo_read(byval conn as PGconn ptr, byval fd as long, byval buf as zstring ptr, byval len as uinteger) as long @@ -328,6 +350,7 @@ declare function lo_import_with_oid(byval conn as PGconn ptr, byval filename as declare function lo_export(byval conn as PGconn ptr, byval lobjId as Oid, byval filename as const zstring ptr) as long declare function PQlibVersion() as long declare function PQmblen(byval s as const zstring ptr, byval encoding as long) as long +declare function PQmblenBounded(byval s as const zstring ptr, byval encoding as long) as long declare function PQdsplen(byval s as const zstring ptr, byval encoding as long) as long declare function PQenv2encoding() as long declare function PQencryptPassword(byval passwd as const zstring ptr, byval user as const zstring ptr) as zstring ptr @@ -335,5 +358,9 @@ declare function PQencryptPasswordConn(byval conn as PGconn ptr, byval passwd as declare function pg_char_to_encoding(byval name as const zstring ptr) as long declare function pg_encoding_to_char(byval encoding as long) as const zstring ptr declare function pg_valid_server_encoding_id(byval encoding as long) as long +type PQsslKeyPassHook_OpenSSL_type as function(byval buf as zstring ptr, byval size as long, byval conn as PGconn ptr) as long +declare function PQgetSSLKeyPassHook_OpenSSL() as PQsslKeyPassHook_OpenSSL_type +declare sub PQsetSSLKeyPassHook_OpenSSL(byval hook as PQsslKeyPassHook_OpenSSL_type) +declare function PQdefaultSSLKeyPassHook_OpenSSL(byval buf as zstring ptr, byval size as long, byval conn as PGconn ptr) as long end extern diff --git a/inc/postgresql/postgres_ext.bi b/inc/postgresql/postgres_ext.bi index abc1a043e0..488bda5981 100644 --- a/inc/postgresql/postgres_ext.bi +++ b/inc/postgresql/postgres_ext.bi @@ -1,10 +1,10 @@ -'' FreeBASIC binding for postgresql-12.0 +'' FreeBASIC binding for postgresql-14.0 '' '' based on the C header files: '' PostgreSQL Database Management System '' (formerly known as Postgres, then as Postgres95) '' -'' Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group +'' Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group '' '' Portions Copyright (c) 1994, The Regents of the University of California '' @@ -26,7 +26,7 @@ '' PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. '' '' translated to FreeBASIC by: -'' Copyright © 2019 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once diff --git a/inc/sqlite2.bi b/inc/sqlite2.bi index 821775abba..578d7d68cf 100644 --- a/inc/sqlite2.bi +++ b/inc/sqlite2.bi @@ -17,7 +17,7 @@ '' * @(#) $Id: sqlite.h.in,v 1.60.2.1 2004/10/06 15:52:36 drh Exp $ '' '' translated to FreeBASIC by: -'' Copyright © 2020 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once diff --git a/inc/sqlite3.bi b/inc/sqlite3.bi index af2e90c0f7..8162d1172f 100644 --- a/inc/sqlite3.bi +++ b/inc/sqlite3.bi @@ -1,4 +1,4 @@ -'' FreeBASIC binding for SQLite 3.34.0 +'' FreeBASIC binding for SQLite 3.39.4 '' '' based on the C header files: '' * 2001-09-15 @@ -33,7 +33,7 @@ '' * part of the build process. '' '' translated to FreeBASIC by: -'' Copyright © 2020 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once @@ -45,9 +45,9 @@ extern "C" #define SQLITE3_H -#define SQLITE_VERSION "3.34.0" -const SQLITE_VERSION_NUMBER = 3034000 -#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b" +#define SQLITE_VERSION "3.39.4" +const SQLITE_VERSION_NUMBER = 3039004 +#define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309" extern __sqlite3_version alias "sqlite3_version" as const byte #define sqlite3_version (*cptr(const zstring ptr, @__sqlite3_version)) @@ -167,6 +167,7 @@ const SQLITE_CONSTRAINT_UNIQUE = SQLITE_CONSTRAINT or (8 shl 8) const SQLITE_CONSTRAINT_VTAB = SQLITE_CONSTRAINT or (9 shl 8) const SQLITE_CONSTRAINT_ROWID = SQLITE_CONSTRAINT or (10 shl 8) const SQLITE_CONSTRAINT_PINNED = SQLITE_CONSTRAINT or (11 shl 8) +const SQLITE_CONSTRAINT_DATATYPE = SQLITE_CONSTRAINT or (12 shl 8) const SQLITE_NOTICE_RECOVER_WAL = SQLITE_NOTICE or (1 shl 8) const SQLITE_NOTICE_RECOVER_ROLLBACK = SQLITE_NOTICE or (2 shl 8) const SQLITE_WARNING_AUTOINDEX = SQLITE_WARNING or (1 shl 8) @@ -194,6 +195,7 @@ const SQLITE_OPEN_SHAREDCACHE = &h00020000 const SQLITE_OPEN_PRIVATECACHE = &h00040000 const SQLITE_OPEN_WAL = &h00080000 const SQLITE_OPEN_NOFOLLOW = &h01000000 +const SQLITE_OPEN_EXRESCODE = &h02000000 const SQLITE_OPEN_MASTER_JOURNAL = &h00004000 const SQLITE_IOCAP_ATOMIC = &h00000001 const SQLITE_IOCAP_ATOMIC512 = &h00000002 @@ -284,6 +286,8 @@ const SQLITE_FCNTL_SIZE_LIMIT = 36 const SQLITE_FCNTL_CKPT_DONE = 37 const SQLITE_FCNTL_RESERVE_BYTES = 38 const SQLITE_FCNTL_CKPT_START = 39 +const SQLITE_FCNTL_EXTERNAL_READER = 40 +const SQLITE_FCNTL_CKSM_FILE = 41 const SQLITE_GET_LOCKPROXYFILE = SQLITE_FCNTL_GET_LOCKPROXYFILE const SQLITE_SET_LOCKPROXYFILE = SQLITE_FCNTL_SET_LOCKPROXYFILE const SQLITE_LAST_ERRNO = SQLITE_FCNTL_LAST_ERRNO @@ -393,7 +397,9 @@ declare function sqlite3_extended_result_codes(byval as sqlite3 ptr, byval onoff declare function sqlite3_last_insert_rowid(byval as sqlite3 ptr) as sqlite3_int64 declare sub sqlite3_set_last_insert_rowid(byval as sqlite3 ptr, byval as sqlite3_int64) declare function sqlite3_changes(byval as sqlite3 ptr) as long +declare function sqlite3_changes64(byval as sqlite3 ptr) as sqlite3_int64 declare function sqlite3_total_changes(byval as sqlite3 ptr) as long +declare function sqlite3_total_changes64(byval as sqlite3 ptr) as sqlite3_int64 declare sub sqlite3_interrupt(byval as sqlite3 ptr) declare function sqlite3_complete(byval sql as const zstring ptr) as long declare function sqlite3_complete16(byval sql as const any ptr) as long @@ -479,6 +485,7 @@ declare function sqlite3_extended_errcode(byval db as sqlite3 ptr) as long declare function sqlite3_errmsg(byval as sqlite3 ptr) as const zstring ptr declare function sqlite3_errmsg16(byval as sqlite3 ptr) as const any ptr declare function sqlite3_errstr(byval as long) as const zstring ptr +declare function sqlite3_error_offset(byval db as sqlite3 ptr) as long declare function sqlite3_limit(byval as sqlite3 ptr, byval id as long, byval newVal as long) as long const SQLITE_LIMIT_LENGTH = 0 @@ -506,7 +513,6 @@ declare function sqlite3_prepare16_v2(byval db as sqlite3 ptr, byval zSql as con declare function sqlite3_prepare16_v3(byval db as sqlite3 ptr, byval zSql as const any ptr, byval nByte as long, byval prepFlags as ulong, byval ppStmt as sqlite3_stmt ptr ptr, byval pzTail as const any ptr ptr) as long declare function sqlite3_sql(byval pStmt as sqlite3_stmt ptr) as const zstring ptr declare function sqlite3_expanded_sql(byval pStmt as sqlite3_stmt ptr) as zstring ptr -declare function sqlite3_normalized_sql(byval pStmt as sqlite3_stmt ptr) as const zstring ptr declare function sqlite3_stmt_readonly(byval pStmt as sqlite3_stmt ptr) as long declare function sqlite3_stmt_isexplain(byval pStmt as sqlite3_stmt ptr) as long declare function sqlite3_stmt_busy(byval as sqlite3_stmt ptr) as long @@ -646,6 +652,7 @@ const SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1 const SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2 declare function sqlite3_get_autocommit(byval as sqlite3 ptr) as long declare function sqlite3_db_handle(byval as sqlite3_stmt ptr) as sqlite3 ptr +declare function sqlite3_db_name(byval db as sqlite3 ptr, byval N as long) as const zstring ptr declare function sqlite3_db_filename(byval db as sqlite3 ptr, byval zDbName as const zstring ptr) as const zstring ptr declare function sqlite3_db_readonly(byval db as sqlite3 ptr, byval zDbName as const zstring ptr) as long declare function sqlite3_txn_state(byval as sqlite3 ptr, byval zSchema as const zstring ptr) as long @@ -657,6 +664,7 @@ const SQLITE_TXN_WRITE = 2 declare function sqlite3_next_stmt(byval pDb as sqlite3 ptr, byval pStmt as sqlite3_stmt ptr) as sqlite3_stmt ptr declare function sqlite3_commit_hook(byval as sqlite3 ptr, byval as function(byval as any ptr) as long, byval as any ptr) as any ptr declare function sqlite3_rollback_hook(byval as sqlite3 ptr, byval as sub(byval as any ptr), byval as any ptr) as any ptr +declare function sqlite3_autovacuum_pages(byval db as sqlite3 ptr, byval as function(byval as any ptr, byval as const zstring ptr, byval as ulong, byval as ulong, byval as ulong) as ulong, byval as any ptr, byval as sub(byval as any ptr)) as long declare function sqlite3_update_hook(byval as sqlite3 ptr, byval as sub(byval as any ptr, byval as long, byval as const zstring ptr, byval as const zstring ptr, byval as sqlite3_int64), byval as any ptr) as any ptr declare function sqlite3_enable_shared_cache(byval as long) as long declare function sqlite3_release_memory(byval as long) as long @@ -750,6 +758,8 @@ const SQLITE_INDEX_CONSTRAINT_ISNOT = 69 const SQLITE_INDEX_CONSTRAINT_ISNOTNULL = 70 const SQLITE_INDEX_CONSTRAINT_ISNULL = 71 const SQLITE_INDEX_CONSTRAINT_IS = 72 +const SQLITE_INDEX_CONSTRAINT_LIMIT = 73 +const SQLITE_INDEX_CONSTRAINT_OFFSET = 74 const SQLITE_INDEX_CONSTRAINT_FUNCTION = 150 declare function sqlite3_create_module(byval db as sqlite3 ptr, byval zName as const zstring ptr, byval p as const sqlite3_module ptr, byval pClientData as any ptr) as long @@ -850,7 +860,10 @@ const SQLITE_TESTCTRL_RESULT_INTREAL = 27 const SQLITE_TESTCTRL_PRNG_SEED = 28 const SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS = 29 const SQLITE_TESTCTRL_SEEK_COUNT = 30 -const SQLITE_TESTCTRL_LAST = 30 +const SQLITE_TESTCTRL_TRACEFLAGS = 31 +const SQLITE_TESTCTRL_TUNE = 32 +const SQLITE_TESTCTRL_LOGEST = 33 +const SQLITE_TESTCTRL_LAST = 33 declare function sqlite3_keyword_count() as long declare function sqlite3_keyword_name(byval as long, byval as const zstring ptr ptr, byval as long ptr) as long @@ -902,6 +915,8 @@ const SQLITE_STMTSTATUS_AUTOINDEX = 3 const SQLITE_STMTSTATUS_VM_STEP = 4 const SQLITE_STMTSTATUS_REPREPARE = 5 const SQLITE_STMTSTATUS_RUN = 6 +const SQLITE_STMTSTATUS_FILTER_MISS = 7 +const SQLITE_STMTSTATUS_FILTER_HIT = 8 const SQLITE_STMTSTATUS_MEMUSED = 99 type sqlite3_pcache_page @@ -970,6 +985,11 @@ const SQLITE_VTAB_DIRECTONLY = 3 declare function sqlite3_vtab_on_conflict(byval as sqlite3 ptr) as long declare function sqlite3_vtab_nochange(byval as sqlite3_context ptr) as long declare function sqlite3_vtab_collation(byval as sqlite3_index_info ptr, byval as long) as const zstring ptr +declare function sqlite3_vtab_distinct(byval as sqlite3_index_info ptr) as long +declare function sqlite3_vtab_in(byval as sqlite3_index_info ptr, byval iCons as long, byval bHandle as long) as long +declare function sqlite3_vtab_in_first(byval pVal as sqlite3_value ptr, byval ppOut as sqlite3_value ptr ptr) as long +declare function sqlite3_vtab_in_next(byval pVal as sqlite3_value ptr, byval ppOut as sqlite3_value ptr ptr) as long +declare function sqlite3_vtab_rhs_value(byval as sqlite3_index_info ptr, byval as long, byval ppVal as sqlite3_value ptr ptr) as long const SQLITE_ROLLBACK = 1 const SQLITE_FAIL = 3 diff --git a/inc/sqlite3ext.bi b/inc/sqlite3ext.bi index 53a893b187..b59f28780a 100644 --- a/inc/sqlite3ext.bi +++ b/inc/sqlite3ext.bi @@ -1,4 +1,4 @@ -'' FreeBASIC binding for SQLite 3.34.0 +'' FreeBASIC binding for SQLite 3.39.4 '' '' based on the C header files: '' * 2006 June 7 @@ -18,7 +18,7 @@ '' * sqlite3.h. '' '' translated to FreeBASIC by: -'' Copyright © 2020 FreeBASIC development team +'' Copyright © 2021 FreeBASIC development team #pragma once @@ -282,6 +282,18 @@ type sqlite3_api_routines free_filename as sub(byval as zstring ptr) database_file_object as function(byval as const zstring ptr) as sqlite3_file ptr txn_state as function(byval as sqlite3 ptr, byval as const zstring ptr) as long + changes64 as function(byval as sqlite3 ptr) as sqlite3_int64 + total_changes64 as function(byval as sqlite3 ptr) as sqlite3_int64 + autovacuum_pages as function(byval as sqlite3 ptr, byval as function(byval as any ptr, byval as const zstring ptr, byval as ulong, byval as ulong, byval as ulong) as ulong, byval as any ptr, byval as sub(byval as any ptr)) as long + error_offset as function(byval as sqlite3 ptr) as long + vtab_rhs_value as function(byval as sqlite3_index_info ptr, byval as long, byval as sqlite3_value ptr ptr) as long + vtab_distinct as function(byval as sqlite3_index_info ptr) as long + vtab_in as function(byval as sqlite3_index_info ptr, byval as long, byval as long) as long + vtab_in_first as function(byval as sqlite3_value ptr, byval as sqlite3_value ptr ptr) as long + vtab_in_next as function(byval as sqlite3_value ptr, byval as sqlite3_value ptr ptr) as long + deserialize as function(byval as sqlite3 ptr, byval as const zstring ptr, byval as ubyte ptr, byval as sqlite3_int64, byval as sqlite3_int64, byval as ulong) as long + serialize as function(byval as sqlite3 ptr, byval as const zstring ptr, byval as sqlite3_int64 ptr, byval as ulong) as ubyte ptr + db_name as function(byval as sqlite3 ptr, byval as long) as const zstring ptr end type type sqlite3_loadext_entry as function(byval db as sqlite3 ptr, byval pzErrMsg as zstring ptr ptr, byval pThunk as const sqlite3_api_routines ptr) as long @@ -797,6 +809,18 @@ type sqlite3_loadext_entry as function(byval db as sqlite3 ptr, byval pzErrMsg a #define sqlite3_database_file_object sqlite3_api->database_file_object #undef sqlite3_txn_state #define sqlite3_txn_state sqlite3_api->txn_state +#define sqlite3_changes64 sqlite3_api->changes64 +#define sqlite3_total_changes64 sqlite3_api->total_changes64 +#define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages +#define sqlite3_error_offset sqlite3_api->error_offset +#define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value +#define sqlite3_vtab_distinct sqlite3_api->vtab_distinct +#define sqlite3_vtab_in sqlite3_api->vtab_in +#define sqlite3_vtab_in_first sqlite3_api->vtab_in_first +#define sqlite3_vtab_in_next sqlite3_api->vtab_in_next +#define sqlite3_deserialize sqlite3_api->deserialize +#define sqlite3_serialize sqlite3_api->serialize +#define sqlite3_db_name sqlite3_api->db_name #define SQLITE_EXTENSION_INIT1 dim shared as const sqlite3_api_routines ptr sqlite3_api = 0 #define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v #define SQLITE_EXTENSION_INIT3 extern as const sqlite3_api_routines ptr sqlite3_api