summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-06-20 23:24:21 +0200
committerAraq <rumpf_a@web.de>2015-06-20 23:24:21 +0200
commit87f65f5e72148d6b44e09cfd4834c9366bfacd4c (patch)
tree34778aef8b91ae168a9a74f9e24c96497c58f7d9 /lib
parente74012b3967476a9bb19073daa4f6d8e061fe60a (diff)
downloadNim-87f65f5e72148d6b44e09cfd4834c9366bfacd4c.tar.gz
preparations for more Nimble packages; clear licensing; fixes #2949
Diffstat (limited to 'lib')
-rw-r--r--lib/impure/zipfiles.nim183
-rw-r--r--lib/pure/algorithm.nim2
-rw-r--r--lib/windows/mmsystem.nim2650
-rw-r--r--lib/windows/nb30.nim236
-rw-r--r--lib/windows/psapi.nim202
-rw-r--r--lib/windows/shellapi.nim863
-rw-r--r--lib/windows/shfolder.nim93
-rw-r--r--lib/windows/windows.nim23662
-rw-r--r--lib/wrappers/claro.nim2748
-rw-r--r--lib/wrappers/expat.nim899
-rw-r--r--lib/wrappers/iup.nim10
-rw-r--r--lib/wrappers/joyent_http_parser.nim11
-rw-r--r--lib/wrappers/libcurl.nim512
-rw-r--r--lib/wrappers/libffi/common/ffi.h331
-rw-r--r--lib/wrappers/libffi/common/ffi_common.h77
-rw-r--r--lib/wrappers/libffi/common/fficonfig.h96
-rw-r--r--lib/wrappers/libffi/common/ffitarget.h150
-rw-r--r--lib/wrappers/libffi/common/malloc_closure.c110
-rw-r--r--lib/wrappers/libffi/common/raw_api.c254
-rw-r--r--lib/wrappers/libffi/gcc/closures.c627
-rw-r--r--lib/wrappers/libffi/gcc/ffi.c841
-rw-r--r--lib/wrappers/libffi/gcc/ffi64.c673
-rw-r--r--lib/wrappers/libffi/gcc/prep_cif.c237
-rw-r--r--lib/wrappers/libffi/gcc/types.c77
-rw-r--r--lib/wrappers/libffi/gcc/win32_asm.asm759
-rw-r--r--lib/wrappers/libffi/gcc/win32_asm.s736
-rw-r--r--lib/wrappers/libffi/gcc/win64_asm.asm467
-rw-r--r--lib/wrappers/libffi/gcc/win64_asm.s227
-rw-r--r--lib/wrappers/libffi/libffi.nim176
-rw-r--r--lib/wrappers/libffi/msvc/ffi.c457
-rw-r--r--lib/wrappers/libffi/msvc/prep_cif.c175
-rw-r--r--lib/wrappers/libffi/msvc/types.c104
-rw-r--r--lib/wrappers/libffi/msvc/win32.c162
-rw-r--r--lib/wrappers/libffi/msvc/win32_asm.asm470
-rw-r--r--lib/wrappers/libffi/msvc/win64_asm.asm156
-rw-r--r--lib/wrappers/libuv.nim11
-rw-r--r--lib/wrappers/odbcsql.nim358
-rw-r--r--lib/wrappers/openssl.nim148
-rw-r--r--lib/wrappers/pcre.nim41
-rw-r--r--lib/wrappers/pdcurses.nim1293
-rw-r--r--lib/wrappers/postgres.nim231
-rw-r--r--lib/wrappers/readline/history.nim279
-rw-r--r--lib/wrappers/readline/readline.nim1209
-rw-r--r--lib/wrappers/readline/rltypedefs.nim79
-rw-r--r--lib/wrappers/readline/tweaked/history.h257
-rw-r--r--lib/wrappers/readline/tweaked/readline.h956
-rw-r--r--lib/wrappers/readline/tweaked/rltypedefs.h78
-rw-r--r--lib/wrappers/readline/tweaked/tilde.h77
-rw-r--r--lib/wrappers/sdl/sdl.nim2579
-rw-r--r--lib/wrappers/sdl/sdl_gfx.nim452
-rw-r--r--lib/wrappers/sdl/sdl_image.nim243
-rw-r--r--lib/wrappers/sdl/sdl_mixer.nim489
-rw-r--r--lib/wrappers/sdl/sdl_mixer_nosmpeg.nim357
-rw-r--r--lib/wrappers/sdl/sdl_net.nim428
-rw-r--r--lib/wrappers/sdl/sdl_ttf.nim338
-rw-r--r--lib/wrappers/sdl/smpeg.nim335
-rw-r--r--lib/wrappers/sphinx.nim263
-rw-r--r--lib/wrappers/tre.nim188
-rw-r--r--lib/wrappers/zip/libzip.nim251
-rw-r--r--lib/wrappers/zip/libzip_all.c4189
-rw-r--r--lib/wrappers/zip/zlib.nim312
-rw-r--r--lib/wrappers/zip/zzip.nim176
62 files changed, 1049 insertions, 54001 deletions
diff --git a/lib/impure/zipfiles.nim b/lib/impure/zipfiles.nim
deleted file mode 100644
index d8903f5c1..000000000
--- a/lib/impure/zipfiles.nim
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2012 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-## This module implements a zip archive creator/reader/modifier.
-
-import
-  streams, libzip, times, os, strutils
-
-type
-  ZipArchive* = object of RootObj ## represents a zip archive
-    mode: FileMode
-    w: PZip
-{.deprecated: [TZipArchive: ZipArchive].}
-
-proc zipError(z: var ZipArchive) =
-  var e: ref IOError
-  new(e)
-  e.msg = $zip_strerror(z.w)
-  raise e
-
-proc open*(z: var ZipArchive, filename: string, mode: FileMode = fmRead): bool =
-  ## Opens a zip file for reading, writing or appending. All file modes are
-  ## supported. Returns true iff successful, false otherwise.
-  var err, flags: int32
-  case mode
-  of fmRead, fmReadWriteExisting, fmAppend: flags = 0
-  of fmWrite:
-    if existsFile(filename): removeFile(filename)
-    flags = ZIP_CREATE or ZIP_EXCL
-  of fmReadWrite: flags = ZIP_CREATE
-  z.w = zip_open(filename, flags, addr(err))
-  z.mode = mode
-  result = z.w != nil
-
-proc close*(z: var ZipArchive) =
-  ## Closes a zip file.
-  zip_close(z.w)
-
-proc createDir*(z: var ZipArchive, dir: string) =
-  ## Creates a directory within the `z` archive. This does not fail if the
-  ## directory already exists. Note that for adding a file like
-  ## ``"path1/path2/filename"`` it is not necessary
-  ## to create the ``"path/path2"`` subdirectories - it will be done
-  ## automatically by ``addFile``.
-  assert(z.mode != fmRead)
-  discard zip_add_dir(z.w, dir)
-  zip_error_clear(z.w)
-
-proc addFile*(z: var ZipArchive, dest, src: string) =
-  ## Adds the file `src` to the archive `z` with the name `dest`. `dest`
-  ## may contain a path that will be created.
-  assert(z.mode != fmRead)
-  if not fileExists(src):
-    raise newException(IOError, "File '" & src & "' does not exist")
-  var zipsrc = zip_source_file(z.w, src, 0, -1)
-  if zipsrc == nil:
-    #echo("Dest: " & dest)
-    #echo("Src: " & src)
-    zipError(z)
-  if zip_add(z.w, dest, zipsrc) < 0'i32:
-    zip_source_free(zipsrc)
-    zipError(z)
-
-proc addFile*(z: var ZipArchive, file: string) =
-  ## A shortcut for ``addFile(z, file, file)``, i.e. the name of the source is
-  ## the name of the destination.
-  addFile(z, file, file)
-
-proc mySourceCallback(state, data: pointer, len: int,
-                      cmd: ZipSourceCmd): int {.cdecl.} =
-  var src = cast[Stream](state)
-  case cmd
-  of ZIP_SOURCE_OPEN:
-    if src.setPositionImpl != nil: setPosition(src, 0) # reset
-  of ZIP_SOURCE_READ:
-    result = readData(src, data, len)
-  of ZIP_SOURCE_CLOSE: close(src)
-  of ZIP_SOURCE_STAT:
-    var stat = cast[PZipStat](data)
-    zip_stat_init(stat)
-    stat.size = high(int32)-1 # we don't know the size
-    stat.mtime = getTime()
-    result = sizeof(ZipStat)
-  of ZIP_SOURCE_ERROR:
-    var err = cast[ptr array[0..1, cint]](data)
-    err[0] = ZIP_ER_INTERNAL
-    err[1] = 0
-    result = 2*sizeof(cint)
-  of constZIP_SOURCE_FREE: GC_unref(src)
-  else: assert(false)
-
-proc addFile*(z: var ZipArchive, dest: string, src: Stream) =
-  ## Adds a file named with `dest` to the archive `z`. `dest`
-  ## may contain a path. The file's content is read from the `src` stream.
-  assert(z.mode != fmRead)
-  GC_ref(src)
-  var zipsrc = zip_source_function(z.w, mySourceCallback, cast[pointer](src))
-  if zipsrc == nil: zipError(z)
-  if zip_add(z.w, dest, zipsrc) < 0'i32:
-    zip_source_free(zipsrc)
-    zipError(z)
-
-# -------------- zip file stream ---------------------------------------------
-
-type
-  TZipFileStream = object of StreamObj
-    f: PZipFile
-    atEnd: bool
-
-  PZipFileStream* =
-    ref TZipFileStream ## a reader stream of a file within a zip archive
-
-proc fsClose(s: Stream) = zip_fclose(PZipFileStream(s).f)
-proc fsAtEnd(s: Stream): bool = PZipFileStream(s).atEnd
-proc fsReadData(s: Stream, buffer: pointer, bufLen: int): int =
-  result = zip_fread(PZipFileStream(s).f, buffer, bufLen)
-  if result == 0:
-    PZipFileStream(s).atEnd = true
-
-proc newZipFileStream(f: PZipFile): PZipFileStream =
-  new(result)
-  result.f = f
-  result.atEnd = false
-  result.closeImpl = fsClose
-  result.readDataImpl = fsReadData
-  result.atEndImpl = fsAtEnd
-  # other methods are nil!
-
-# ----------------------------------------------------------------------------
-
-proc getStream*(z: var ZipArchive, filename: string): PZipFileStream =
-  ## returns a stream that can be used to read the file named `filename`
-  ## from the archive `z`. Returns nil in case of an error.
-  ## The returned stream does not support the `setPosition`, `getPosition`,
-  ## `writeData` or `atEnd` methods.
-  var x = zip_fopen(z.w, filename, 0'i32)
-  if x != nil: result = newZipFileStream(x)
-
-iterator walkFiles*(z: var ZipArchive): string =
-  ## walks over all files in the archive `z` and returns the filename
-  ## (including the path).
-  var i = 0'i32
-  var num = zip_get_num_files(z.w)
-  while i < num:
-    yield $zip_get_name(z.w, i, 0'i32)
-    inc(i)
-
-
-proc extractFile*(z: var ZipArchive, srcFile: string, dest: Stream) =
-  ## extracts a file from the zip archive `z` to the destination stream.
-  var strm = getStream(z, srcFile)
-  while true:
-    if not strm.atEnd:
-        dest.write(strm.readStr(1))
-    else: break
-  dest.flush()
-  strm.close()
-
-proc extractFile*(z: var ZipArchive, srcFile: string, dest: string) =
-  ## extracts a file from the zip archive `z` to the destination filename.
-  var file = newFileStream(dest, fmWrite)
-  extractFile(z, srcFile, file)
-  file.close()
-
-proc extractAll*(z: var ZipArchive, dest: string) =
-  ## extracts all files from archive `z` to the destination directory.
-  for file in walkFiles(z):
-    if file.endsWith("/"):
-      createDir(dest / file)
-    else:
-      extractFile(z, file, dest / file)
-
-when not defined(testing) and isMainModule:
-  var zip: ZipArchive
-  if not zip.open("nim-0.11.0.zip"):
-    raise newException(IOError, "opening zip failed")
-  zip.extractAll("test")
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index ac18ae420..e087b5ac9 100644
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -355,7 +355,7 @@ when isMainModule:
   var srt1 = [1,2,3,4,4,4,4,5]
   var srt2 = ["iello","hello"]
   var srt3 = [1.0,1.0,1.0]
-  var srt4 = []
+  var srt4: seq[int] = @[]
   assert srt1.isSorted(cmp) == true
   assert srt2.isSorted(cmp) == false
   assert srt3.isSorted(cmp) == true
diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim
deleted file mode 100644
index 9bc6a873f..000000000
--- a/lib/windows/mmsystem.nim
+++ /dev/null
@@ -1,2650 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2006 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-#*********************************
-#*******************************
-# Generated by c2pas32  v0.9b
-#     Fixed by P.V.Ozerski
-# (c) 2001 Oleg Bulychov
-#     Original C header file
-# Gladiators Software
-#     (created at Dec-03-1998)
-# http://www.astonshell.com/
-#   from LCC-win32 is used
-#*********************************
-#   LCC-win32 (c) Jacob Navia
-#*******************************
-
-{.deadCodeElim: on.}
-
-import
-  windows
-
-type
-  MMRESULT* = uint32
-  MMVERSION* = uint32
-  HWAVEOUT* = Handle
-  LPHWAVEOUT* = ptr HWAVEOUT
-  HWAVEIN* = Handle
-  LPHWAVEIN* = ptr HWAVEOUT
-  HWAVE* = Handle
-  LPHWAVE* = ptr Handle
-  LPUINT* = ptr uint32
-
-const
-  MAXPNAMELEN* = 32
-  MAXERRORLENGTH* = 256
-  MAX_JOYSTICKOEMVXDNAME* = 260
-  MM_MIDI_MAPPER* = 1
-  MM_WAVE_MAPPER* = 2
-  MM_SNDBLST_MIDIOUT* = 3
-  MM_SNDBLST_MIDIIN* = 4
-  MM_SNDBLST_SYNTH* = 5
-  MM_SNDBLST_WAVEOUT* = 6
-  MM_SNDBLST_WAVEIN* = 7
-  MM_ADLIB* = 9
-  MM_MPU401_MIDIOUT* = 10
-  MM_MPU401_MIDIIN* = 11
-  MM_PC_JOYSTICK* = 12
-  TIME_MS* = 1
-  TIME_SAMPLES* = 2
-  TIME_BYTES* = 4
-  TIME_SMPTE* = 8
-  TIME_MIDI* = 16
-  TIME_TICKS* = 32
-  MM_MCINOTIFY* = 0x000003B9
-  MM_WOM_OPEN* = 0x000003BB
-  MM_WOM_CLOSE* = 0x000003BC
-  MM_WOM_DONE* = 0x000003BD
-  MM_WIM_OPEN* = 0x000003BE
-  MM_WIM_CLOSE* = 0x000003BF
-  MM_WIM_DATA* = 0x000003C0
-  MM_MIM_OPEN* = 0x000003C1
-  MM_MIM_CLOSE* = 0x000003C2
-  MM_MIM_DATA* = 0x000003C3
-  MM_MIM_LONGDATA* = 0x000003C4
-  MM_MIM_ERROR* = 0x000003C5
-  MM_MIM_LONGERROR* = 0x000003C6
-  MM_MOM_OPEN* = 0x000003C7
-  MM_MOM_CLOSE* = 0x000003C8
-  MM_MOM_DONE* = 0x000003C9
-  MM_DRVM_OPEN* = 0x000003D0
-  MM_DRVM_CLOSE* = 0x000003D1
-  MM_DRVM_DATA* = 0x000003D2
-  MM_DRVM_ERROR* = 0x000003D3
-  MM_STREAM_OPEN* = 0x000003D4
-  MM_STREAM_CLOSE* = 0x000003D5
-  MM_STREAM_DONE* = 0x000003D6
-  MM_STREAM_ERROR* = 0x000003D7
-  MM_MOM_POSITIONCB* = 0x000003CA
-  MM_MCISIGNAL* = 0x000003CB
-  WAVE_INVALIDFORMAT* = 0
-  WAVE_FORMAT_1M08* = 1
-  WAVE_FORMAT_1S08* = 2
-  WAVE_FORMAT_1M16* = 4
-  WAVE_FORMAT_1S16* = 8
-  WAVE_FORMAT_2M08* = 16
-  WAVE_FORMAT_2S08* = 32
-  WAVE_FORMAT_2M16* = 64
-  WAVE_FORMAT_2S16* = 128
-  WAVE_FORMAT_4M08* = 256
-  WAVE_FORMAT_4S08* = 512
-  WAVE_FORMAT_4M16* = 0x00000400
-  WAVE_FORMAT_4S16* = 0x00000800
-  MM_MIM_MOREDATA* = 0x000003CC
-  MM_MIXM_LINE_CHANGE* = 0x000003D0
-  MM_MIXM_CONTROL_CHANGE* = 0x000003D1
-  MMSYSERR_BASE* = 0
-  WAVERR_BASE* = 32
-  MIDIERR_BASE* = 64
-  TIMERR_BASE* = 96
-  JOYERR_BASE* = 160
-  MCIERR_BASE* = 256
-  MIXERR_BASE* = 1024
-  MCI_STRING_OFFSET* = 512
-  MCI_VD_OFFSET* = 1024
-  MCI_CD_OFFSET* = 1088
-  MCI_WAVE_OFFSET* = 1152
-  MCI_SEQ_OFFSET* = 1216
-  MMSYSERR_NOERROR* = 0
-  MMSYSERR_ERROR* = (MMSYSERR_BASE + 1)
-  MMSYSERR_BADDEVICEID* = (MMSYSERR_BASE + 2)
-  MMSYSERR_NOTENABLED* = (MMSYSERR_BASE + 3)
-  MMSYSERR_ALLOCATED* = (MMSYSERR_BASE + 4)
-  MMSYSERR_INVALHANDLE* = (MMSYSERR_BASE + 5)
-  MMSYSERR_NODRIVER* = (MMSYSERR_BASE + 6)
-  MMSYSERR_NOMEM* = (MMSYSERR_BASE + 7)
-  MMSYSERR_NOTSUPPORTED* = (MMSYSERR_BASE + 8)
-  MMSYSERR_BADERRNUM* = (MMSYSERR_BASE + 9)
-  MMSYSERR_INVALFLAG* = (MMSYSERR_BASE + 10)
-  MMSYSERR_INVALPARAM* = (MMSYSERR_BASE + 11)
-  MMSYSERR_HANDLEBUSY* = (MMSYSERR_BASE + 12)
-  MMSYSERR_INVALIDALIAS* = (MMSYSERR_BASE + 13)
-  MMSYSERR_BADDB* = (MMSYSERR_BASE + 14)
-  MMSYSERR_KEYNOTFOUND* = (MMSYSERR_BASE + 15)
-  MMSYSERR_READERROR* = (MMSYSERR_BASE + 16)
-  MMSYSERR_WRITEERROR* = (MMSYSERR_BASE + 17)
-  MMSYSERR_DELETEERROR* = (MMSYSERR_BASE + 18)
-  MMSYSERR_VALNOTFOUND* = (MMSYSERR_BASE + 19)
-  MMSYSERR_NODRIVERCB* = (MMSYSERR_BASE + 20)
-  MMSYSERR_LASTERROR* = (MMSYSERR_BASE + 20)
-  MM_JOY1MOVE* = 0x000003A0
-  MM_JOY2MOVE* = 0x000003A1
-  MM_JOY1ZMOVE* = 0x000003A2
-  MM_JOY2ZMOVE* = 0x000003A3
-  MM_JOY1BUTTONDOWN* = 0x000003B5
-  MM_JOY2BUTTONDOWN* = 0x000003B6
-  MM_JOY1BUTTONUP* = 0x000003B7
-  MM_JOY2BUTTONUP* = 0x000003B8
-  CALLBACK_TYPEMASK* = 0x00070000
-  CALLBACK_NULL* = 0
-  CALLBACK_EVENT* = 0x00050000
-  CALLBACK_WINDOW* = 0x00010000
-  CALLBACK_TASK* = 0x00020000
-  CALLBACK_THREAD* = CALLBACK_TASK
-  CALLBACK_FUNCTION* = 0x00030000
-
-type
-  HDRVR* = Handle
-
-const
-  DRV_LOAD* = 1
-  DRV_ENABLE* = 2
-  DRV_OPEN* = 0x00000003
-  DRV_CLOSE* = 4
-  DRV_DISABLE* = 0x00000005
-  DRV_FREE* = 0x00000006
-  DRV_CONFIGURE* = 0x00000007
-  DRV_QUERYCONFIGURE* = 8
-  DRV_INSTALL* = 0x00000009
-  DRV_REMOVE* = 0x0000000A
-  DRV_EXITSESSION* = 0x0000000B
-  DRV_POWER* = 0x0000000F
-  DRV_RESERVED* = 0x00000800
-  DRV_USER* = 0x00004000
-  DRVCNF_CANCEL* = 0
-  DRVCNF_OK* = 1
-  DRVCNF_RESTART* = 2
-  DRV_CANCEL* = DRVCNF_CANCEL
-  DRV_OK* = DRVCNF_OK
-  DRV_RESTART* = DRVCNF_RESTART
-  DRV_MCI_FIRST* = DRV_RESERVED
-  DRV_MCI_LAST* = (DRV_RESERVED + 0x00000FFF)
-
-type
-  PDRVCALLBACK* = proc (hdrvr: Handle, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
-      stdcall.}
-
-proc sndPlaySoundA*(Name: LPCSTR, flags: uint32): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "sndPlaySoundA".}
-proc sndPlaySoundW*(Name: LPCWSTR, flags: uint32): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "sndPlaySoundW".}
-when defined(winUNICODE):
-  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
-      dynlib: "winmm.dll", importc: "sndPlaySoundW".}
-else:
-  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
-      dynlib: "winmm.dll", importc: "sndPlaySoundA".}
-const
-  SND_NODEFAULT* = 2
-  SND_MEMORY* = 4
-  SND_LOOP* = 8
-  SND_NOSTOP* = 16
-  SND_SYNC* = 0
-  SND_ASYNC* = 1
-  SND_PURGE* = 64
-  SND_APPLICATION* = 128
-  SND_ALIAS_START* = 0
-  SND_ALIAS_SYSTEMHAND* = 18515
-  SND_ALIAS_SYSTEMEXCLAMATION* = 8531
-  SND_ALIAS_SYSTEMASTERISK* = 10835
-  SND_ALIAS_SYSTEMQUESTION* = 16211
-  SND_ALIAS_SYSTEMDEFAULT* = 17491
-  SND_ALIAS_SYSTEMEXIT* = 17747
-  SND_ALIAS_SYSTEMSTART* = 21331
-  SND_ALIAS_SYSTEMWELCOME* = 22355
-  SND_NOWAIT* = 0x00002000
-  SND_ALIAS* = 0x00010000
-  SND_ALIAS_ID* = 0x00110000
-  SND_FILENAME* = 0x00020000
-  SND_RESOURCE* = 0x00040004
-  WAVERR_BADFORMAT* = (WAVERR_BASE + 0)
-  WAVERR_STILLPLAYING* = (WAVERR_BASE + 1)
-  WAVERR_UNPREPARED* = (WAVERR_BASE + 2)
-  WAVERR_SYNC* = (WAVERR_BASE + 3)
-  WAVERR_LASTERROR* = (WAVERR_BASE + 3)
-  WOM_OPEN* = MM_WOM_OPEN
-  WOM_CLOSE* = MM_WOM_CLOSE
-  WOM_DONE* = MM_WOM_DONE
-  WIM_OPEN* = MM_WIM_OPEN
-  WIM_CLOSE* = MM_WIM_CLOSE
-  WIM_DATA* = MM_WIM_DATA
-  WAVE_MAPPER* = uint32(- 1)
-  WAVE_FORMAT_QUERY* = 1
-  WAVE_ALLOWSYNC* = 2
-  WAVE_MAPPED* = 4
-  WAVE_FORMAT_DIRECT* = 8
-  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY or WAVE_FORMAT_DIRECT)
-  MIM_OPEN* = MM_MIM_OPEN
-  MIM_CLOSE* = MM_MIM_CLOSE
-  MIM_DATA* = MM_MIM_DATA
-  MIM_LONGDATA* = MM_MIM_LONGDATA
-  MIM_ERROR* = MM_MIM_ERROR
-  MIM_LONGERROR* = MM_MIM_LONGERROR
-  MOM_OPEN* = MM_MOM_OPEN
-  MOM_CLOSE* = MM_MOM_CLOSE
-  MOM_DONE* = MM_MOM_DONE
-  MIM_MOREDATA* = MM_MIM_MOREDATA
-  MOM_POSITIONCB* = MM_MOM_POSITIONCB
-  MIDIMAPPER* = uint32(- 1)
-  MIDI_IO_STATUS* = 32
-  MIDI_CACHE_ALL* = 1
-  MIDI_CACHE_BESTFIT* = 2
-  MIDI_CACHE_QUERY* = 3
-  MIDI_UNCACHE* = 4
-  WHDR_DONE* = 1
-  WHDR_PREPARED* = 2
-  WHDR_BEGINLOOP* = 0x00000004
-  WHDR_ENDLOOP* = 0x00000008
-  WHDR_INQUEUE* = 0x00000010
-  MOD_MIDIPORT* = 1
-  MOD_SYNTH* = 2
-  MOD_SQSYNTH* = 3
-  MOD_FMSYNTH* = 4
-  MOD_MAPPER* = 5
-  MIDICAPS_VOLUME* = 1
-  MIDICAPS_LRVOLUME* = 2
-  MIDICAPS_CACHE* = 4
-  MIDICAPS_STREAM* = 8
-  MHDR_DONE* = 1
-  MHDR_PREPARED* = 2
-  MHDR_INQUEUE* = 0x00000004
-  MHDR_ISSTRM* = 0x00000008
-  MEVT_F_SHORT* = 0
-  MEVT_F_LONG* = 0x80000000
-  MEVT_F_CALLBACK* = 0x40000000
-
-proc MEVT_EVENTTYPE*(x: int8): int8
-proc MEVT_EVENTPARM*(x: DWORD): DWORD
-const
-  MEVT_SHORTMSG* = 0
-  MEVT_TEMPO* = 0x00000001
-  MEVT_NOP* = 0x00000002
-  MEVT_LONGMSG* = 0x00000080
-  MEVT_COMMENT* = 0x00000082
-  MEVT_VERSION* = 0x00000084
-  MIDISTRM_ERROR* = - 2
-  MIDIPROP_SET* = 0x80000000
-  MIDIPROP_GET* = 0x40000000
-  MIDIPROP_TIMEDIV* = 1
-  MIDIPROP_TEMPO* = 2
-  MIXERLINE_LINEF_ACTIVE* = 1
-  MIXERLINE_LINEF_DISCONNECTED* = 0x00008000
-  MIXERLINE_LINEF_SOURCE* = 0x80000000
-  MIXERLINE_COMPONENTTYPE_DST_FIRST* = 0
-  MIXERLINE_COMPONENTTYPE_DST_UNDEFINED* = (MIXERLINE_COMPONENTTYPE_DST_FIRST)
-  MIXERLINE_COMPONENTTYPE_DST_DIGITAL* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
-  MIXERLINE_COMPONENTTYPE_DST_LINE* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
-  MIXERLINE_COMPONENTTYPE_DST_MONITOR* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
-  MIXERLINE_COMPONENTTYPE_DST_SPEAKERS* = (MIXERLINE_COMPONENTTYPE_DST_FIRST +
-      4)
-  MIXERLINE_COMPONENTTYPE_DST_HEADPHONES* = (
-    MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
-  MIXERLINE_COMPONENTTYPE_DST_TELEPHONE* = (
-    MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
-  MIXERLINE_COMPONENTTYPE_DST_WAVEIN* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
-  MIXERLINE_COMPONENTTYPE_DST_VOICEIN* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
-  MIXERLINE_COMPONENTTYPE_DST_LAST* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
-  MIXERLINE_COMPONENTTYPE_SRC_FIRST* = 0x00001000
-  MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
-  MIXERLINE_COMPONENTTYPE_SRC_DIGITAL* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
-  MIXERLINE_COMPONENTTYPE_SRC_LINE* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
-  MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
-  MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
-  MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
-  MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
-  MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
-  MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
-  MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY* = (
-    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
-  MIXERLINE_COMPONENTTYPE_SRC_ANALOG* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
-  MIXERLINE_COMPONENTTYPE_SRC_LAST* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
-  MIXERLINE_TARGETTYPE_UNDEFINED* = 0
-  MIXERLINE_TARGETTYPE_WAVEOUT* = 1
-  MIXERLINE_TARGETTYPE_WAVEIN* = 2
-  MIXERLINE_TARGETTYPE_MIDIOUT* = 3
-  MIXERLINE_TARGETTYPE_MIDIIN* = 4
-  MIXERLINE_TARGETTYPE_AUX* = 5
-  MIDIERR_UNPREPARED* = (MIDIERR_BASE + 0)
-  MIDIERR_STILLPLAYING* = (MIDIERR_BASE + 1)
-  MIDIERR_NOMAP* = (MIDIERR_BASE + 2)
-  MIDIERR_NOTREADY* = (MIDIERR_BASE + 3)
-  MIDIERR_NODEVICE* = (MIDIERR_BASE + 4)
-  MIDIERR_INVALIDSETUP* = (MIDIERR_BASE + 5)
-  MIDIERR_BADOPENMODE* = (MIDIERR_BASE + 6)
-  MIDIERR_DONT_CONTINUE* = (MIDIERR_BASE + 7)
-  MIDIERR_LASTERROR* = (MIDIERR_BASE + 7)
-  MIXERCONTROL_CONTROLF_UNIFORM* = 1
-  MIXERCONTROL_CONTROLF_MULTIPLE* = 2
-  MIXERCONTROL_CONTROLF_DISABLED* = 0x80000000
-  MIXERCONTROL_CT_CLASS_MASK* = 0xF0000000
-  MIXERCONTROL_CT_CLASS_CUSTOM* = 0
-  MIXERCONTROL_CT_CLASS_METER* = 0x10000000
-  MIXERCONTROL_CT_CLASS_SWITCH* = 0x20000000
-  MIXERCONTROL_CT_CLASS_NUMBER* = 0x30000000
-  MIXERCONTROL_CT_CLASS_SLIDER* = 0x40000000
-  MIXERCONTROL_CT_CLASS_FADER* = 0x50000000
-  MIXERCONTROL_CT_CLASS_TIME* = 0x60000000
-  MIXERCONTROL_CT_CLASS_LIST* = 0x70000000
-  MIXERCONTROL_CT_SUBCLASS_MASK* = 0x0F000000
-  MIXERCONTROL_CT_SC_SWITCH_BOOLEAN* = 0
-  MIXERCONTROL_CT_SC_SWITCH_BUTTON* = 0x01000000
-  MIXERCONTROL_CT_SC_METER_POLLED* = 0
-  MIXERCONTROL_CT_SC_TIME_MICROSECS* = 0
-  MIXERCONTROL_CT_SC_TIME_MILLISECS* = 0x01000000
-  MIXERCONTROL_CT_SC_LIST_SINGLE* = 0
-  MIXERCONTROL_CT_SC_LIST_MULTIPLE* = 0x01000000
-  MIXERCONTROL_CT_UNITS_MASK* = 0x00FF0000
-  MIXERCONTROL_CT_UNITS_CUSTOM* = 0
-  MIXERCONTROL_CT_UNITS_BOOLEAN* = 0x00010000
-  MIXERCONTROL_CT_UNITS_SIGNED* = 0x00020000
-  MIXERCONTROL_CT_UNITS_UNSIGNED* = 0x00030000
-  MIXERCONTROL_CT_UNITS_DECIBELS* = 0x00040000
-  MIXERCONTROL_CT_UNITS_PERCENT* = 0x00050000
-  MIXERCONTROL_CONTROLTYPE_CUSTOM* = (
-    MIXERCONTROL_CT_CLASS_CUSTOM or MIXERCONTROL_CT_UNITS_CUSTOM)
-  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER or
-      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
-      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_SIGNED)
-  MIXERCONTROL_CONTROLTYPE_PEAKMETER* = (
-    MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
-  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
-      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH or
-      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_ONOFF* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
-  MIXERCONTROL_CONTROLTYPE_MUTE* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
-  MIXERCONTROL_CONTROLTYPE_MONO* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
-  MIXERCONTROL_CONTROLTYPE_LOUDNESS* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
-  MIXERCONTROL_CONTROLTYPE_STEREOENH* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
-  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH or
-      MIXERCONTROL_CT_SC_SWITCH_BUTTON or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_DECIBELS* = (
-    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_DECIBELS)
-  MIXERCONTROL_CONTROLTYPE_SIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_SIGNED)
-  MIXERCONTROL_CONTROLTYPE_UNSIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_PERCENT* = (
-    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_PERCENT)
-  MIXERCONTROL_CONTROLTYPE_SLIDER* = (
-    MIXERCONTROL_CT_CLASS_SLIDER or MIXERCONTROL_CT_UNITS_SIGNED)
-  MIXERCONTROL_CONTROLTYPE_PAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
-  MIXERCONTROL_CONTROLTYPE_QSOUNDPAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
-  MIXERCONTROL_CONTROLTYPE_FADER* = (
-    MIXERCONTROL_CT_CLASS_FADER or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_VOLUME* = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
-  MIXERCONTROL_CONTROLTYPE_BASS* = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
-  MIXERCONTROL_CONTROLTYPE_TREBLE* = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
-  MIXERCONTROL_CONTROLTYPE_EQUALIZER* = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
-  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
-      MIXERCONTROL_CT_SC_LIST_SINGLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_MUX* = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
-  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
-      MIXERCONTROL_CT_SC_LIST_MULTIPLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_MIXER* = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT +
-      1)
-  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME or
-      MIXERCONTROL_CT_SC_TIME_MICROSECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME or
-      MIXERCONTROL_CT_SC_TIME_MILLISECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXER_SHORT_NAME_CHARS* = 16
-  MIXER_LONG_NAME_CHARS* = 64
-  MIXERR_INVALLINE* = (MIXERR_BASE + 0)
-  MIXERR_INVALCONTROL* = (MIXERR_BASE + 1)
-  MIXERR_INVALVALUE* = (MIXERR_BASE + 2)
-  MIXERR_LASTERROR* = (MIXERR_BASE + 2)
-  MIXER_OBJECTF_HANDLE* = 0x80000000
-  MIXER_OBJECTF_MIXER* = 0
-  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIXER)
-  MIXER_OBJECTF_WAVEOUT* = 0x10000000
-  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEOUT)
-  MIXER_OBJECTF_WAVEIN* = 0x20000000
-  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEIN)
-  MIXER_OBJECTF_MIDIOUT* = 0x30000000
-  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIOUT)
-  MIXER_OBJECTF_MIDIIN* = 0x40000000
-  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)
-  MIXER_OBJECTF_AUX* = 0x50000000
-  MIXER_GETCONTROLDETAILSF_VALUE* = 0
-  MIXER_GETCONTROLDETAILSF_LISTTEXT* = 1
-  MIXER_GETCONTROLDETAILSF_QUERYMASK* = 0x0000000F
-  MIXER_SETCONTROLDETAILSF_VALUE* = 0
-  MIXER_SETCONTROLDETAILSF_CUSTOM* = 1
-  MIXER_SETCONTROLDETAILSF_QUERYMASK* = 0x0000000F
-  JOYERR_NOERROR* = (0)
-  JOYERR_PARMS* = (JOYERR_BASE + 5)
-  JOYERR_NOCANDO* = (JOYERR_BASE + 6)
-  JOYERR_UNPLUGGED* = (JOYERR_BASE + 7)
-  JOY_BUTTON1* = 1
-  JOY_BUTTON2* = 2
-  JOY_BUTTON3* = 4
-  JOY_BUTTON4* = 8
-  JOY_BUTTON1CHG* = 256
-  JOY_BUTTON2CHG* = 512
-  JOY_BUTTON3CHG* = 0x00000400
-  JOY_BUTTON4CHG* = 0x00000800
-  JOY_BUTTON5* = 16
-  JOY_BUTTON6* = 32
-  JOY_BUTTON7* = 64
-  JOY_BUTTON8* = 128
-  JOY_BUTTON9* = 256
-  JOY_BUTTON10* = 512
-  JOY_BUTTON11* = 0x00000400
-  JOY_BUTTON12* = 0x00000800
-  JOY_BUTTON13* = 0x00001000
-  JOY_BUTTON14* = 0x00002000
-  JOY_BUTTON15* = 0x00004000
-  JOY_BUTTON16* = 0x00008000
-  JOY_BUTTON17* = 0x00010000
-  JOY_BUTTON18* = 0x00020000
-  JOY_BUTTON19* = 0x00040000
-  JOY_BUTTON20* = 0x00080000
-  JOY_BUTTON21* = 0x00100000
-  JOY_BUTTON22* = 0x00200000
-  JOY_BUTTON23* = 0x00400000
-  JOY_BUTTON24* = 0x00800000
-  JOY_BUTTON25* = 0x01000000
-  JOY_BUTTON26* = 0x02000000
-  JOY_BUTTON27* = 0x04000000
-  JOY_BUTTON28* = 0x08000000
-  JOY_BUTTON29* = 0x10000000
-  JOY_BUTTON30* = 0x20000000
-  JOY_BUTTON31* = 0x40000000
-  JOY_BUTTON32* = 0x80000000
-  JOY_POVCENTERED* = - 1
-  JOY_POVFORWARD* = 0
-  JOY_POVRIGHT* = 9000
-  JOY_POVBACKWARD* = 18000
-  JOY_POVLEFT* = 27000
-  JOY_RETURNX* = 1
-  JOY_RETURNY* = 2
-  JOY_RETURNZ* = 4
-  JOY_RETURNR* = 8
-  JOY_RETURNU* = 16
-  JOY_RETURNV* = 32
-  JOY_RETURNPOV* = 64
-  JOY_RETURNBUTTONS* = 128
-  JOY_RETURNRAWDATA* = 256
-  JOY_RETURNPOVCTS* = 512
-  JOY_RETURNCENTERED* = 0x00000400
-  JOY_USEDEADZONE* = 0x00000800
-  JOY_RETURNALL* = (JOY_RETURNX or JOY_RETURNY or JOY_RETURNZ or JOY_RETURNR or
-      JOY_RETURNU or JOY_RETURNV or JOY_RETURNPOV or JOY_RETURNBUTTONS)
-  JOY_CAL_READALWAYS* = 0x00010000
-  JOY_CAL_READXYONLY* = 0x00020000
-  JOY_CAL_READ3* = 0x00040000
-  JOY_CAL_READ4* = 0x00080000
-  JOY_CAL_READXONLY* = 0x00100000
-  JOY_CAL_READYONLY* = 0x00200000
-  JOY_CAL_READ5* = 0x00400000
-  JOY_CAL_READ6* = 0x00800000
-  JOY_CAL_READZONLY* = 0x01000000
-  JOY_CAL_READRONLY* = 0x02000000
-  JOY_CAL_READUONLY* = 0x04000000
-  JOY_CAL_READVONLY* = 0x08000000
-  JOYSTICKID1* = 0
-  JOYSTICKID2* = 1
-  JOYCAPS_HASZ* = 1
-  JOYCAPS_HASR* = 2
-  JOYCAPS_HASU* = 4
-  JOYCAPS_HASV* = 8
-  JOYCAPS_HASPOV* = 16
-  JOYCAPS_POV4DIR* = 32
-  JOYCAPS_POVCTS* = 64
-  MMIOERR_BASE* = 256
-  MMIOERR_FILENOTFOUND* = (MMIOERR_BASE + 1)
-  MMIOERR_OUTOFMEMORY* = (MMIOERR_BASE + 2)
-  MMIOERR_CANNOTOPEN* = (MMIOERR_BASE + 3)
-  MMIOERR_CANNOTCLOSE* = (MMIOERR_BASE + 4)
-  MMIOERR_CANNOTREAD* = (MMIOERR_BASE + 5)
-  MMIOERR_CANNOTWRITE* = (MMIOERR_BASE + 6)
-  MMIOERR_CANNOTSEEK* = (MMIOERR_BASE + 7)
-  MMIOERR_CANNOTEXPAND* = (MMIOERR_BASE + 8)
-  MMIOERR_CHUNKNOTFOUND* = (MMIOERR_BASE + 9)
-  MMIOERR_UNBUFFERED* = (MMIOERR_BASE + 10)
-  MMIOERR_PATHNOTFOUND* = (MMIOERR_BASE + 11)
-  MMIOERR_ACCESSDENIED* = (MMIOERR_BASE + 12)
-  MMIOERR_SHARINGVIOLATION* = (MMIOERR_BASE + 13)
-  MMIOERR_NETWORKERROR* = (MMIOERR_BASE + 14)
-  MMIOERR_TOOMANYOPENFILES* = (MMIOERR_BASE + 15)
-  MMIOERR_INVALIDFILE* = (MMIOERR_BASE + 16)
-  CFSEPCHAR* = '+'
-  WAVECAPS_PITCH* = 1
-  WAVECAPS_PLAYBACKRATE* = 2
-  WAVECAPS_VOLUME* = 4
-  WAVECAPS_LRVOLUME* = 8
-  WAVECAPS_SYNC* = 16
-  WAVECAPS_SAMPLEACCURATE* = 32
-  WAVECAPS_DIRECTSOUND* = 64
-  MIXER_GETLINEINFOF_DESTINATION* = 0
-  MIXER_GETLINEINFOF_SOURCE* = 1
-  MIXER_GETLINEINFOF_LINEID* = 2
-  MIXER_GETLINEINFOF_COMPONENTTYPE* = 3
-  MIXER_GETLINEINFOF_TARGETTYPE* = 4
-  MIXER_GETLINEINFOF_QUERYMASK* = 0x0000000F
-  MMIO_RWMODE* = 3
-  MMIO_SHAREMODE* = 0x00000070
-  MMIO_CREATE* = 0x00001000
-  MMIO_PARSE* = 256
-  MMIO_DELETE* = 512
-  MMIO_EXIST* = 0x00004000
-  MMIO_ALLOCBUF* = 0x00010000
-  MMIO_GETTEMP* = 0x00020000
-  MMIO_DIRTY* = 0x10000000
-  cMMIO_READ* = 0
-  cMMIO_WRITE* = 1
-  MMIO_READWRITE* = 2
-  MMIO_COMPAT* = 0
-  MMIO_EXCLUSIVE* = 16
-  MMIO_DENYWRITE* = 32
-  MMIO_DENYREAD* = 0x00000030
-  MMIO_DENYNONE* = 64
-  MMIO_FHOPEN* = 16
-  MMIO_EMPTYBUF* = 16
-  MMIO_TOUPPER* = 16
-  MMIO_INSTALLPROC* = 0x00010000
-  MMIO_GLOBALPROC* = 0x10000000
-  MMIO_REMOVEPROC* = 0x00020000
-  MMIO_UNICODEPROC* = 0x01000000
-  MMIO_FINDPROC* = 0x00040000
-  MMIO_FINDCHUNK* = 16
-  MMIO_FINDRIFF* = 32
-  MMIO_FINDLIST* = 64
-  MMIO_CREATERIFF* = 32
-  MMIO_CREATELIST* = 64
-  MMIOM_READ* = cMMIO_READ
-  MMIOM_WRITE* = cMMIO_WRITE
-  MMIOM_SEEK* = 2
-  MMIOM_OPEN* = 3
-  MMIOM_CLOSE* = 4
-  MMIOM_WRITEFLUSH* = 5
-  MMIOM_RENAME* = 6
-  MMIOM_USER* = 0x00008000
-  FOURCC_RIFF* = 0x46464952   #'R','I','F','F'
-  FOURCC_LIST* = 0x5453494C   #'L','I','S','T'
-  FOURCC_DOS* = 0x20532F44    #'D','O','S',' '
-  FOURCC_MEM* = 0x204D454D    #'M','E','M',' '
-  SEEK_SET* = 0
-  SEEK_CUR* = 1
-  SEEK_END* = 2
-  MMIO_DEFAULTBUFFER* = 8192
-  MCIERR_INVALID_DEVICE_ID* = (MCIERR_BASE + 1)
-  MCIERR_UNRECOGNIZED_KEYWORD* = (MCIERR_BASE + 3)
-  MCIERR_UNRECOGNIZED_COMMAND* = (MCIERR_BASE + 5)
-  MCIERR_HARDWARE* = (MCIERR_BASE + 6)
-  MCIERR_INVALID_DEVICE_NAME* = (MCIERR_BASE + 7)
-  MCIERR_OUT_OF_MEMORY* = (MCIERR_BASE + 8)
-  MCIERR_DEVICE_OPEN* = (MCIERR_BASE + 9)
-  MCIERR_CANNOT_LOAD_DRIVER* = (MCIERR_BASE + 10)
-  MCIERR_MISSING_COMMAND_STRING* = (MCIERR_BASE + 11)
-  MCIERR_PARAM_OVERFLOW* = (MCIERR_BASE + 12)
-  MCIERR_MISSING_STRING_ARGUMENT* = (MCIERR_BASE + 13)
-  MCIERR_BAD_INTEGER* = (MCIERR_BASE + 14)
-  MCIERR_PARSER_INTERNAL* = (MCIERR_BASE + 15)
-  MCIERR_DRIVER_INTERNAL* = (MCIERR_BASE + 16)
-  MCIERR_MISSING_PARAMETER* = (MCIERR_BASE + 17)
-  MCIERR_UNSUPPORTED_FUNCTION* = (MCIERR_BASE + 18)
-  MCIERR_FILE_NOT_FOUND* = (MCIERR_BASE + 19)
-  MCIERR_DEVICE_NOT_READY* = (MCIERR_BASE + 20)
-  MCIERR_INTERNAL* = (MCIERR_BASE + 21)
-  MCIERR_DRIVER* = (MCIERR_BASE + 22)
-  MCIERR_CANNOT_USE_ALL* = (MCIERR_BASE + 23)
-  MCIERR_MULTIPLE* = (MCIERR_BASE + 24)
-  MCIERR_EXTENSION_NOT_FOUND* = (MCIERR_BASE + 25)
-  MCIERR_OUTOFRANGE* = (MCIERR_BASE + 26)
-  MCIERR_FLAGS_NOT_COMPATIBLE* = (MCIERR_BASE + 28)
-  MCIERR_FILE_NOT_SAVED* = (MCIERR_BASE + 30)
-  MCIERR_DEVICE_TYPE_REQUIRED* = (MCIERR_BASE + 31)
-  MCIERR_DEVICE_LOCKED* = (MCIERR_BASE + 32)
-  MCIERR_DUPLICATE_ALIAS* = (MCIERR_BASE + 33)
-  MCIERR_BAD_CONSTANT* = (MCIERR_BASE + 34)
-  MCIERR_MUST_USE_SHAREABLE* = (MCIERR_BASE + 35)
-  MCIERR_MISSING_DEVICE_NAME* = (MCIERR_BASE + 36)
-  MCIERR_BAD_TIME_FORMAT* = (MCIERR_BASE + 37)
-  MCIERR_NO_CLOSING_QUOTE* = (MCIERR_BASE + 38)
-  MCIERR_DUPLICATE_FLAGS* = (MCIERR_BASE + 39)
-  MCIERR_INVALID_FILE* = (MCIERR_BASE + 40)
-  MCIERR_NULL_PARAMETER_BLOCK* = (MCIERR_BASE + 41)
-  MCIERR_UNNAMED_RESOURCE* = (MCIERR_BASE + 42)
-  MCIERR_NEW_REQUIRES_ALIAS* = (MCIERR_BASE + 43)
-  MCIERR_NOTIFY_ON_AUTO_OPEN* = (MCIERR_BASE + 44)
-  MCIERR_NO_ELEMENT_ALLOWED* = (MCIERR_BASE + 45)
-  MCIERR_NONAPPLICABLE_FUNCTION* = (MCIERR_BASE + 46)
-  MCIERR_ILLEGAL_FOR_AUTO_OPEN* = (MCIERR_BASE + 47)
-  MCIERR_FILENAME_REQUIRED* = (MCIERR_BASE + 48)
-  MCIERR_EXTRA_CHARACTERS* = (MCIERR_BASE + 49)
-  MCIERR_DEVICE_NOT_INSTALLED* = (MCIERR_BASE + 50)
-  MCIERR_GET_CD* = (MCIERR_BASE + 51)
-  MCIERR_SET_CD* = (MCIERR_BASE + 52)
-  MCIERR_SET_DRIVE* = (MCIERR_BASE + 53)
-  MCIERR_DEVICE_LENGTH* = (MCIERR_BASE + 54)
-  MCIERR_DEVICE_ORD_LENGTH* = (MCIERR_BASE + 55)
-  MCIERR_NO_INTEGER* = (MCIERR_BASE + 56)
-  MCIERR_WAVE_OUTPUTSINUSE* = (MCIERR_BASE + 64)
-  MCIERR_WAVE_SETOUTPUTINUSE* = (MCIERR_BASE + 65)
-  MCIERR_WAVE_INPUTSINUSE* = (MCIERR_BASE + 66)
-  MCIERR_WAVE_SETINPUTINUSE* = (MCIERR_BASE + 67)
-  MCIERR_WAVE_OUTPUTUNSPECIFIED* = (MCIERR_BASE + 68)
-  MCIERR_WAVE_INPUTUNSPECIFIED* = (MCIERR_BASE + 69)
-  MCIERR_WAVE_OUTPUTSUNSUITABLE* = (MCIERR_BASE + 70)
-  MCIERR_WAVE_SETOUTPUTUNSUITABLE* = (MCIERR_BASE + 71)
-  MCIERR_WAVE_INPUTSUNSUITABLE* = (MCIERR_BASE + 72)
-  MCIERR_WAVE_SETINPUTUNSUITABLE* = (MCIERR_BASE + 73)
-  MCIERR_SEQ_DIV_INCOMPATIBLE* = (MCIERR_BASE + 80)
-  MCIERR_SEQ_PORT_INUSE* = (MCIERR_BASE + 81)
-  MCIERR_SEQ_PORT_NONEXISTENT* = (MCIERR_BASE + 82)
-  MCIERR_SEQ_PORT_MAPNODEVICE* = (MCIERR_BASE + 83)
-  MCIERR_SEQ_PORT_MISCERROR* = (MCIERR_BASE + 84)
-  MCIERR_SEQ_TIMER* = (MCIERR_BASE + 85)
-  MCIERR_SEQ_PORTUNSPECIFIED* = (MCIERR_BASE + 86)
-  MCIERR_SEQ_NOMIDIPRESENT* = (MCIERR_BASE + 87)
-  MCIERR_NO_WINDOW* = (MCIERR_BASE + 90)
-  MCIERR_CREATEWINDOW* = (MCIERR_BASE + 91)
-  MCIERR_FILE_READ* = (MCIERR_BASE + 92)
-  MCIERR_FILE_WRITE* = (MCIERR_BASE + 93)
-  MCIERR_NO_IDENTITY* = (MCIERR_BASE + 94)
-  MCIERR_CUSTOM_DRIVER_BASE* = (MCIERR_BASE + 256)
-  MCI_FIRST* = DRV_MCI_FIRST
-  MCI_ESCAPE* = 0x00000805
-  MCI_PLAY* = 0x00000806
-  MCI_SEEK* = 0x00000807
-  MCI_STOP* = 0x00000808
-  MCI_PAUSE* = 0x00000809
-  MCI_INFO* = 0x0000080A
-  MCI_GETDEVCAPS* = 0x0000080B
-  MCI_BREAK* = 0x00000811
-  MCI_WHERE* = 0x00000843
-  MCI_FREEZE* = 0x00000844
-  MCI_UNFREEZE* = 0x00000845
-  MCI_LOAD* = 0x00000850
-  MCI_CUT* = 0x00000851
-  MCI_COPY* = 0x00000852
-  MCI_PASTE* = 0x00000853
-  MCI_UPDATE* = 0x00000854
-  MCI_RESUME* = 0x00000855
-  MCI_DELETE* = 0x00000856
-  MCI_SET* = 0x0000080D
-  MCI_STEP* = 0x0000080E
-  MCI_SAVE* = 0x00000813
-  MCI_SPIN* = 0x0000080C
-  MCI_STATUS* = 0x00000814
-  MCI_CUE* = 0x00000830
-  MCI_REALIZE* = 0x00000840
-  MCI_WINDOW* = 0x00000841
-  MCI_PUT* = 0x00000842
-  MCI_RECORD* = 0x0000080F
-  MCI_SYSINFO* = 0x00000810
-  MCI_OPEN* = 0x00000803
-  MCI_CLOSE* = 0x00000804
-  MCI_USER_MESSAGES* = (DRV_MCI_FIRST + 0x00000400)
-  MCI_LAST* = 0x00000FFF
-  MCI_ALL_DEVICE_ID* = - 1
-  MCI_DEVTYPE_VCR* = 513
-  MCI_DEVTYPE_VIDEODISC* = 514
-  MCI_DEVTYPE_OVERLAY* = 515
-  MCI_DEVTYPE_CD_AUDIO* = 516
-  MCI_DEVTYPE_DAT* = 517
-  MCI_DEVTYPE_SCANNER* = 518
-  MCI_DEVTYPE_ANIMATION* = 519
-  MCI_DEVTYPE_DIGITAL_VIDEO* = 520
-  MCI_DEVTYPE_OTHER* = 521
-  MCI_DEVTYPE_WAVEFORM_AUDIO* = 522
-  MCI_DEVTYPE_SEQUENCER* = 523
-  MCI_DEVTYPE_FIRST* = MCI_DEVTYPE_VCR
-  MCI_DEVTYPE_LAST* = MCI_DEVTYPE_SEQUENCER
-  MCI_DEVTYPE_FIRST_USER* = 0x00001000
-  MCI_MODE_NOT_READY* = (MCI_STRING_OFFSET + 12)
-  MCI_MODE_STOP* = (MCI_STRING_OFFSET + 13)
-  MCI_MODE_PLAY* = (MCI_STRING_OFFSET + 14)
-  MCI_MODE_RECORD* = (MCI_STRING_OFFSET + 15)
-  MCI_MODE_SEEK* = (MCI_STRING_OFFSET + 16)
-  MCI_MODE_PAUSE* = (MCI_STRING_OFFSET + 17)
-  MCI_MODE_OPEN* = (MCI_STRING_OFFSET + 18)
-  MCI_FORMAT_MILLISECONDS* = 0
-  MCI_FORMAT_HMS* = 1
-  MCI_FORMAT_MSF* = 2
-  MCI_FORMAT_FRAMES* = 3
-  MCI_FORMAT_SMPTE_24* = 4
-  MCI_FORMAT_SMPTE_25* = 5
-  MCI_FORMAT_SMPTE_30* = 6
-  MCI_FORMAT_SMPTE_30DROP* = 7
-  MCI_FORMAT_BYTES* = 8
-  MCI_FORMAT_SAMPLES* = 9
-  MCI_FORMAT_TMSF* = 10
-
-proc MCI_MSF_MINUTE*(msf: int32): int8
-proc MCI_MSF_SECOND*(msf: int32): int8
-proc MCI_MSF_FRAME*(msf: int32): int8
-proc MCI_MAKE_MSF*(m, s, f: int8): int32
-const
-  MCI_SET_DOOR_OPEN* = 256
-  MCI_SET_DOOR_CLOSED* = 512
-  MCI_SET_TIME_FORMAT* = 0x00000400
-  MCI_SET_AUDIO* = 0x00000800
-  MCI_SET_VIDEO* = 0x00001000
-  MCI_SET_ON* = 0x00002000
-  MCI_SET_OFF* = 0x00004000
-  MCI_SET_AUDIO_ALL* = 0
-  MCI_SET_AUDIO_LEFT* = 1
-  MCI_SET_AUDIO_RIGHT* = 2
-
-proc MCI_TMSF_TRACK*(tmsf: int32): int8
-proc MCI_TMSF_MINUTE*(tmsf: int32): int8
-proc MCI_TMSF_SECOND*(tmsf: int32): int8
-proc MCI_TMSF_FRAME*(tmsf: int32): int8
-proc MCI_HMS_HOUR*(h: int32): int8
-proc MCI_HMS_MINUTE*(h: int32): int8
-proc MCI_HMS_SECOND*(h: int32): int8
-proc MCI_MAKE_HMS*(h, m, s: int8): int32
-const
-  MCI_INFO_PRODUCT* = 256
-  MCI_INFO_FILE* = 512
-  MCI_INFO_MEDIA_UPC* = 0x00000400
-  MCI_INFO_MEDIA_IDENTITY* = 0x00000800
-  MCI_INFO_NAME* = 0x00001000
-  MCI_INFO_COPYRIGHT* = 0x00002000
-
-proc MCI_MAKE_TMSF*(t, m, s, f: int8): int32
-const
-  MCI_WAIT* = 2
-  MCI_FROM* = 4
-  MCI_TO* = 8
-  MCI_TRACK* = 16
-  MCI_SEEK_TO_START* = 256
-  MCI_SEEK_TO_END* = 512
-  MCI_STATUS_ITEM* = 256
-  MCI_STATUS_START* = 512
-  MCI_STATUS_LENGTH* = 1
-  MCI_STATUS_POSITION* = 2
-  MCI_STATUS_NUMBER_OF_TRACKS* = 3
-  MCI_STATUS_MODE* = 4
-  MCI_STATUS_MEDIA_PRESENT* = 5
-  MCI_STATUS_TIME_FORMAT* = 6
-  MCI_STATUS_READY* = 7
-  MCI_STATUS_CURRENT_TRACK* = 8
-  MCI_OPEN_SHAREABLE* = 256
-  MCI_OPEN_ELEMENT* = 512
-  MCI_OPEN_ALIAS* = 0x00000400
-  MCI_OPEN_ELEMENT_ID* = 0x00000800
-  MCI_OPEN_TYPE_ID* = 0x00001000
-  MCI_OPEN_TYPE* = 0x00002000
-  MCI_GETDEVCAPS_ITEM* = 256
-  MCI_GETDEVCAPS_CAN_RECORD* = 1
-  MCI_GETDEVCAPS_HAS_AUDIO* = 2
-  MCI_GETDEVCAPS_HAS_VIDEO* = 3
-  MCI_GETDEVCAPS_DEVICE_TYPE* = 4
-  MCI_GETDEVCAPS_USES_FILES* = 5
-  MCI_GETDEVCAPS_COMPOUND_DEVICE* = 6
-  MCI_GETDEVCAPS_CAN_EJECT* = 7
-  MCI_GETDEVCAPS_CAN_PLAY* = 8
-  MCI_GETDEVCAPS_CAN_SAVE* = 9
-  MCI_SYSINFO_QUANTITY* = 256
-  MCI_SYSINFO_OPEN* = 512
-  MCI_SYSINFO_NAME* = 0x00000400
-  MCI_SYSINFO_INSTALLNAME* = 0x00000800
-  MCI_NOTIFY_SUCCESSFUL* = 1
-  MCI_NOTIFY_SUPERSEDED* = 2
-  MCI_NOTIFY_ABORTED* = 4
-  MCI_NOTIFY_FAILURE* = 8
-  MCI_NOTIFY* = 1
-  MCI_BREAK_KEY* = 256
-  MCI_BREAK_HWND* = 512
-  MCI_BREAK_OFF* = 0x00000400
-  MCI_RECORD_INSERT* = 256
-  MCI_RECORD_OVERWRITE* = 512
-  MCI_SAVE_FILE* = 256
-  MCI_LOAD_FILE* = 256
-  MCI_VD_GETDEVCAPS_FAST_RATE* = 0x00004003
-  MCI_VD_GETDEVCAPS_SLOW_RATE* = 0x00004004
-  MCI_VD_GETDEVCAPS_NORMAL_RATE* = 0x00004005
-  MCI_VD_STEP_FRAMES* = 0x00010000
-  MCI_VD_STEP_REVERSE* = 0x00020000
-  MCI_VD_ESCAPE_STRING* = 256
-  MCI_VD_FORMAT_TRACK* = 0x00004001
-  MCI_VD_PLAY_REVERSE* = 0x00010000
-  MCI_VD_PLAY_FAST* = 0x00020000
-  MCI_VD_MODE_PARK* = (MCI_VD_OFFSET + 1)
-  MCI_VD_GETDEVCAPS_CAV* = 0x00020000
-  MCI_VD_SPIN_UP* = 0x00010000
-  MCI_VD_SPIN_DOWN* = 0x00020000
-  MCI_VD_SEEK_REVERSE* = 0x00010000
-  MCI_VD_STATUS_SPEED* = 0x00004002
-  MCI_VD_STATUS_FORWARD* = 0x00004003
-  MCI_VD_STATUS_MEDIA_TYPE* = 0x00004004
-  MCI_VD_STATUS_SIDE* = 0x00004005
-  MCI_VD_GETDEVCAPS_CAN_REVERSE* = 0x00004002
-  MCI_VD_MEDIA_CLV* = (MCI_VD_OFFSET + 2)
-  MCI_VD_MEDIA_CAV* = (MCI_VD_OFFSET + 3)
-  MCI_VD_MEDIA_OTHER* = (MCI_VD_OFFSET + 4)
-  MCI_VD_STATUS_DISC_SIZE* = 0x00004006
-  MCI_VD_GETDEVCAPS_CLV* = 0x00010000
-  MCI_VD_PLAY_SPEED* = 0x00040000
-  MCI_VD_PLAY_SCAN* = 0x00080000
-  MCI_VD_PLAY_SLOW* = 0x00100000
-  MCI_WAVE_STATUS_CHANNELS* = 0x00004002
-  MCI_WAVE_STATUS_SAMPLESPERSEC* = 0x00004003
-  MCI_WAVE_PCM* = MCI_WAVE_OFFSET
-  MCI_WAVE_MAPPER* = (MCI_WAVE_OFFSET + 1)
-  MCI_WAVE_OPEN_BUFFER* = 0x00010000
-  MCI_WAVE_STATUS_BITSPERSAMPLE* = 0x00004006
-  MCI_WAVE_STATUS_LEVEL* = 0x00004007
-  MCI_WAVE_SET_FORMATTAG* = 0x00010000
-  MCI_WAVE_SET_CHANNELS* = 0x00020000
-  MCI_WAVE_SET_SAMPLESPERSEC* = 0x00040000
-  MCI_WAVE_SET_AVGBYTESPERSEC* = 0x00080000
-  MCI_WAVE_SET_BLOCKALIGN* = 0x00100000
-  MCI_WAVE_SET_BITSPERSAMPLE* = 0x00200000
-  MCI_WAVE_INPUT* = 0x00400000
-  MCI_WAVE_OUTPUT* = 0x00800000
-  MCI_WAVE_STATUS_FORMATTAG* = 0x00004001
-  MCI_WAVE_SET_ANYINPUT* = 0x04000000
-  MCI_WAVE_SET_ANYOUTPUT* = 0x08000000
-  MCI_WAVE_GETDEVCAPS_INPUTS* = 0x00004001
-  MCI_WAVE_GETDEVCAPS_OUTPUTS* = 0x00004002
-  MCI_WAVE_STATUS_AVGBYTESPERSEC* = 0x00004004
-  MCI_WAVE_STATUS_BLOCKALIGN* = 0x00004005
-  MCI_CDA_STATUS_TYPE_TRACK* = 0x00004001
-  MCI_CDA_TRACK_AUDIO* = (MCI_CD_OFFSET)
-  MCI_CDA_TRACK_OTHER* = (MCI_CD_OFFSET + 1)
-  MCI_SEQ_DIV_PPQN* = (MCI_SEQ_OFFSET)
-  MCI_SEQ_DIV_SMPTE_24* = (MCI_SEQ_OFFSET + 1)
-  MCI_SEQ_DIV_SMPTE_25* = (MCI_SEQ_OFFSET + 2)
-  MCI_SEQ_DIV_SMPTE_30DROP* = (MCI_SEQ_OFFSET + 3)
-  MCI_SEQ_DIV_SMPTE_30* = (MCI_SEQ_OFFSET + 4)
-  MCI_SEQ_FORMAT_SONGPTR* = 0x00004001
-  MCI_SEQ_FILE* = 0x00004002
-  MCI_SEQ_MIDI* = 0x00004003
-  MCI_SEQ_SMPTE* = 0x00004004
-  MCI_SEQ_NONE* = 65533
-  MCI_SEQ_MAPPER* = 65535
-  MCI_SEQ_STATUS_TEMPO* = 0x00004002
-  MCI_SEQ_STATUS_PORT* = 0x00004003
-  MCI_SEQ_STATUS_SLAVE* = 0x00004007
-  MCI_SEQ_STATUS_MASTER* = 0x00004008
-  MCI_SEQ_STATUS_OFFSET* = 0x00004009
-  MCI_SEQ_STATUS_DIVTYPE* = 0x0000400A
-  MCI_SEQ_STATUS_NAME* = 0x0000400B
-  MCI_SEQ_STATUS_COPYRIGHT* = 0x0000400C
-  MCI_SEQ_SET_TEMPO* = 0x00010000
-  MCI_SEQ_SET_PORT* = 0x00020000
-  MCI_SEQ_SET_SLAVE* = 0x00040000
-  MCI_SEQ_SET_MASTER* = 0x00080000
-  MCI_SEQ_SET_OFFSET* = 0x01000000
-  MCI_ANIM_PLAY_SLOW* = 0x00080000
-  MCI_ANIM_PLAY_SCAN* = 0x00100000
-  MCI_ANIM_GETDEVCAPS_SLOW_RATE* = 0x00004003
-  MCI_ANIM_GETDEVCAPS_NORMAL_RATE* = 0x00004004
-  MCI_ANIM_STEP_REVERSE* = 0x00010000
-  MCI_ANIM_STEP_FRAMES* = 0x00020000
-  MCI_ANIM_STATUS_SPEED* = 0x00004001
-  MCI_ANIM_GETDEVCAPS_PALETTES* = 0x00004006
-  MCI_ANIM_OPEN_WS* = 0x00010000
-  MCI_ANIM_OPEN_PARENT* = 0x00020000
-  MCI_ANIM_OPEN_NOSTATIC* = 0x00040000
-  MCI_ANIM_GETDEVCAPS_FAST_RATE* = 0x00004002
-  MCI_ANIM_PLAY_SPEED* = 0x00010000
-  MCI_ANIM_PLAY_REVERSE* = 0x00020000
-  MCI_ANIM_PLAY_FAST* = 0x00040000
-  MCI_ANIM_STATUS_FORWARD* = 0x00004002
-  MCI_ANIM_STATUS_HWND* = 0x00004003
-  MCI_ANIM_STATUS_HPAL* = 0x00004004
-  MCI_ANIM_STATUS_STRETCH* = 0x00004005
-  MCI_ANIM_INFO_TEXT* = 0x00010000
-  MCI_ANIM_GETDEVCAPS_CAN_REVERSE* = 0x00004001
-  MCI_ANIM_WINDOW_TEXT* = 0x00080000
-  MCI_ANIM_WINDOW_ENABLE_STRETCH* = 0x00100000
-  MCI_ANIM_WINDOW_DISABLE_STRETCH* = 0x00200000
-  MCI_ANIM_WINDOW_DEFAULT* = 0
-  MCI_ANIM_RECT* = 0x00010000
-  MCI_ANIM_PUT_SOURCE* = 0x00020000
-  MCI_ANIM_PUT_DESTINATION* = 0x00040000
-  MCI_ANIM_WHERE_SOURCE* = 0x00020000
-  MCI_ANIM_WHERE_DESTINATION* = 0x00040000
-  MCI_ANIM_UPDATE_HDC* = 0x00020000
-  MCI_ANIM_GETDEVCAPS_CAN_STRETCH* = 0x00004007
-  MCI_ANIM_GETDEVCAPS_MAX_WINDOWS* = 0x00004008
-  MCI_ANIM_REALIZE_NORM* = 0x00010000
-  MCI_ANIM_REALIZE_BKGD* = 0x00020000
-  MCI_ANIM_WINDOW_HWND* = 0x00010000
-  MCI_ANIM_WINDOW_STATE* = 0x00040000
-  TIMERR_NOERROR* = 0
-  TIMERR_NOCANDO* = (TIMERR_BASE + 1)
-  TIMERR_STRUCT* = (TIMERR_BASE + 33)
-  TIME_ONESHOT* = 0
-  TIME_PERIODIC* = 1
-  TIME_CALLBACK_FUNCTION* = 0
-  TIME_CALLBACK_EVENT_SET* = 16
-  TIME_CALLBACK_EVENT_PULSE* = 32
-  MCI_OVLY_OPEN_WS* = 0x00010000
-  MCI_OVLY_OPEN_PARENT* = 0x00020000
-  MCI_OVLY_STATUS_HWND* = 0x00004001
-  MCI_OVLY_STATUS_STRETCH* = 0x00004002
-  MCI_OVLY_INFO_TEXT* = 0x00010000
-  MCI_OVLY_GETDEVCAPS_CAN_STRETCH* = 0x00004001
-  MCI_OVLY_GETDEVCAPS_CAN_FREEZE* = 0x00004002
-  MCI_OVLY_GETDEVCAPS_MAX_WINDOWS* = 0x00004003
-  MCI_OVLY_WINDOW_HWND* = 0x00010000
-  MCI_OVLY_WINDOW_STATE* = 0x00040000
-  MCI_OVLY_WINDOW_TEXT* = 0x00080000
-  MCI_OVLY_WINDOW_ENABLE_STRETCH* = 0x00100000
-  MCI_OVLY_WINDOW_DISABLE_STRETCH* = 0x00200000
-  MCI_OVLY_WINDOW_DEFAULT* = 0
-  MCI_OVLY_RECT* = 0x00010000
-  MCI_OVLY_PUT_SOURCE* = 0x00020000
-  MCI_OVLY_PUT_DESTINATION* = 0x00040000
-  MCI_OVLY_PUT_FRAME* = 0x00080000
-  MCI_OVLY_PUT_VIDEO* = 0x00100000
-  MCI_OVLY_WHERE_SOURCE* = 0x00020000
-  MCI_OVLY_WHERE_DESTINATION* = 0x00040000
-  MCI_OVLY_WHERE_FRAME* = 0x00080000
-  MCI_OVLY_WHERE_VIDEO* = 0x00100000
-  AUX_MAPPER* = - 1
-  MIXER_GETLINECONTROLSF_ONEBYID* = 1
-  MIXER_GETLINECONTROLSF_ONEBYTYPE* = 2
-  MIXER_GETLINECONTROLSF_ALL* = 0
-  MIXER_GETLINECONTROLSF_QUERYMASK* = 0x0000000F
-  NEWTRANSPARENT* = 3
-  QUERYROPSUPPORT* = 40
-  SELECTDIB* = 41
-
-proc DIBINDEX*(n: int32): int32
-const
-  SC_SCREENSAVE* = 0x0000F140
-  AUXCAPS_CDAUDIO* = 1
-  AUXCAPS_AUXIN* = 2
-  AUXCAPS_VOLUME* = 1
-  AUXCAPS_LRVOLUME* = 2 #/////////////////////////////////////////////////////////
-                        # Structures and typedefs
-                        #/////////////////////////////////////////////////////////
-
-type
-  MMTIME* {.final.} = object
-    wType*: uint32
-    hour*, min*, sec*, frame*, fps*, dummy*: int8
-    pad*: array[0..1, int8]
-
-  PMMTIME* = ptr MMTIME
-  NPMMTIME* = ptr MMTIME
-  LPMMTIME* = ptr MMTIME
-  PWAVEHDR* = ptr WAVEHDR
-  WAVEHDR* {.final.} = object
-    lpData*: cstring
-    dwBufferLength*: DWORD
-    dwBytesRecorded*: DWORD
-    dwUser*: DWORD
-    dwFlags*: DWORD
-    dwLoops*: DWORD
-    lpNext*: PWAVEHDR
-    reserved*: DWORD
-
-  NPWAVEHDR* = ptr WAVEHDR
-  LPWAVEHDR* = ptr WAVEHDR
-  WAVEOUTCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    dwFormats*: DWORD
-    wChannels*: int16
-    wReserved1*: int16
-    dwSupport*: DWORD
-
-  PWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
-  NPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
-  LPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
-  WAVEOUTCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
-    dwFormats*: DWORD
-    wChannels*: int16
-    wReserved1*: int16
-    dwSupport*: DWORD
-
-  PWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
-  NPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
-  LPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
-{.deprecated: [Twavehdr: Wavehdr, Tmmtime: Mmtime, Twaveoutcapsa: Waveoutcapsa,
-              Twaveoutcapsw: Waveoutcapsw].}
-
-when defined(UNICODE):
-  type
-    WAVEOUTCAPS* = WAVEOUTCAPSW
-    PWAVEOUTCAPS* = PWAVEOUTCAPSW
-    NPWAVEOUTCAPS* = NPWAVEOUTCAPSW
-    LPWAVEOUTCAPS* = LPWAVEOUTCAPSW
-else:
-  type
-    WAVEOUTCAPS* = WAVEOUTCAPSA
-    PWAVEOUTCAPS* = PWAVEOUTCAPSA
-    NPWAVEOUTCAPS* = NPWAVEOUTCAPSA
-    LPWAVEOUTCAPS* = LPWAVEOUTCAPSA
-type
-  TWAVEOUTCAPS* = WAVEOUTCAPS
-  WAVEINCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    dwFormats*: DWORD
-    wChannels*: int16
-    wReserved1*: int16
-
-  PWAVEINCAPSA* = ptr WAVEINCAPSA
-  NPWAVEINCAPSA* = ptr WAVEINCAPSA
-  LPWAVEINCAPSA* = ptr WAVEINCAPSA
-  TWAVEINCAPSA* = WAVEINCAPSA
-  WAVEINCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
-    dwFormats*: DWORD
-    wChannels*: int16
-    wReserved1*: int16
-
-  PWAVEINCAPSW* = ptr WAVEINCAPSW
-  NPWAVEINCAPSW* = ptr WAVEINCAPSW
-  LPWAVEINCAPSW* = ptr WAVEINCAPSW
-  TWAVEINCAPSW* = WAVEINCAPSW
-
-when defined(UNICODE):
-  type
-    WAVEINCAPS* = WAVEINCAPSW
-    PWAVEINCAPS* = PWAVEINCAPSW
-    NPWAVEINCAPS* = NPWAVEINCAPSW
-    LPWAVEINCAPS* = LPWAVEINCAPSW
-else:
-  type
-    WAVEINCAPS* = WAVEINCAPSA
-    PWAVEINCAPS* = PWAVEINCAPSA
-    NPWAVEINCAPS* = NPWAVEINCAPSA
-    LPWAVEINCAPS* = LPWAVEINCAPSA
-type
-  TWAVEINCAPS* = WAVEINCAPS
-  WAVEFORMAT* {.final.} = object
-    wFormatTag*: int16
-    nChannels*: int16
-    nSamplesPerSec*: DWORD
-    nAvgBytesPerSec*: DWORD
-    nBlockAlign*: int16
-
-  PWAVEFORMAT* = ptr WAVEFORMAT
-  NPWAVEFORMAT* = ptr WAVEFORMAT
-  LPWAVEFORMAT* = ptr WAVEFORMAT
-  TWAVEFORMAT* = WAVEFORMAT
-
-const
-  WAVE_FORMAT_PCM* = 1
-
-type
-  PCMWAVEFORMAT* {.final.} = object
-    wf*: WAVEFORMAT
-    wBitsPerSample*: int16
-
-  PPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
-  NPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
-  LPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
-  TPCMWAVEFORMAT* = PCMWAVEFORMAT
-  WAVEFORMATEX* {.final.} = object
-    wFormatTag*: int16
-    nChannels*: int16
-    nSamplesPerSec*: DWORD
-    nAvgBytesPerSec*: DWORD
-    nBlockAlign*: int16
-    wBitsPerSample*: int16
-    cbSize*: int16
-
-  PWAVEFORMATEX* = ptr WAVEFORMATEX
-  NPWAVEFORMATEX* = ptr WAVEFORMATEX
-  LPWAVEFORMATEX* = ptr WAVEFORMATEX
-  LPCWAVEFORMATEX* = ptr WAVEFORMATEX
-  TWAVEFORMATEX* = WAVEFORMATEX
-  HMIDI* = Handle
-  HMIDIIN* = Handle
-  HMIDIOUT* = Handle
-  HMIDISTRM* = Handle
-  LPHMIDI* = ptr HMIDI
-  LPHMIDIIN* = ptr HMIDIIN
-  LPHMIDIOUT* = ptr HMIDIOUT
-  LPHMIDISTRM* = ptr HMIDISTRM
-  LPMIDICALLBACK* = PDRVCALLBACK
-
-const
-  MIDIPATCHSIZE* = 128
-
-type
-  PATCHARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
-  LPPATCHARRAY* = ptr int16
-  KEYARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
-  LPKEYARRAY* = ptr int16
-  MIDIOUTCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    wTechnology*: int16
-    wVoices*: int16
-    wNotes*: int16
-    wChannelMask*: int16
-    dwSupport*: DWORD
-
-  PMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
-  NPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
-  LPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
-  TMIDIOUTCAPSA* = MIDIOUTCAPSA
-  MIDIOUTCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
-    wTechnology*: int16
-    wVoices*: int16
-    wNotes*: int16
-    wChannelMask*: int16
-    dwSupport*: DWORD
-
-  PMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
-  NPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
-  LPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
-  TMIDIOUTCAPSW* = MIDIOUTCAPSW
-  MIDIINCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    dwSupport*: DWORD
-
-  PMIDIINCAPSA* = ptr MIDIINCAPSA
-  NPMIDIINCAPSA* = ptr MIDIINCAPSA
-  LPMIDIINCAPSA* = ptr MIDIINCAPSA
-  TMIDIINCAPSA* = MIDIINCAPSA
-  MIDIINCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
-    dwSupport*: DWORD
-
-  PMIDIINCAPSW* = ptr MIDIINCAPSW
-  NPMIDIINCAPSW* = ptr MIDIINCAPSW
-  LPMIDIINCAPSW* = ptr MIDIINCAPSW
-  TMIDIINCAPSW* = MIDIINCAPSW
-
-when defined(UNICODE):
-  type
-    MIDIINCAPS* = MIDIINCAPSW
-    PMIDIINCAPS* = PMIDIINCAPSW
-    NPMIDIINCAPS* = NPMIDIINCAPSW
-    LPMIDIINCAPS* = LPMIDIINCAPSW
-    MIDIOUTCAPS* = MIDIOUTCAPSW
-    PMIDIOUTCAPS* = PMIDIOUTCAPSW
-    NPMIDIOUTCAPS* = NPMIDIOUTCAPSW
-    LPMIDIOUTCAPS* = LPMIDIOUTCAPSW
-else:
-  type
-    MIDIOUTCAPS* = MIDIOUTCAPSA
-    PMIDIOUTCAPS* = PMIDIOUTCAPSA
-    NPMIDIOUTCAPS* = NPMIDIOUTCAPSA
-    LPMIDIOUTCAPS* = LPMIDIOUTCAPSA
-    MIDIINCAPS* = MIDIINCAPSA
-    PMIDIINCAPS* = PMIDIINCAPSA
-    NPMIDIINCAPS* = NPMIDIINCAPSA
-    LPMIDIINCAPS* = LPMIDIINCAPSA
-type
-  TMIDIINCAPS* = MIDIINCAPS
-  PMIDIHDR* = ptr MIDIHDR
-  MIDIHDR* {.final.} = object
-    lpData*: cstring
-    dwBufferLength*: DWORD
-    dwBytesRecorded*: DWORD
-    dwUser*: DWORD
-    dwFlags*: DWORD
-    lpNext*: PMIDIHDR
-    reserved*: DWORD
-    dwOffset*: DWORD
-    dwReserved*: array[0..pred(8), DWORD]
-
-  NPMIDIHDR* = ptr MIDIHDR
-  LPMIDIHDR* = ptr MIDIHDR
-  TMIDIHDR* = MIDIHDR
-  MIDIEVENT* {.final.} = object
-    dwDeltaTime*: DWORD
-    dwStreamID*: DWORD
-    dwEvent*: DWORD
-    dwParms*: array[0..pred(1), DWORD]
-
-  TMIDIEVENT* = MIDIEVENT
-  MIDISTRMBUFFVER* {.final.} = object
-    dwVersion*: DWORD
-    dwMid*: DWORD
-    dwOEMVersion*: DWORD
-
-  TMIDISTRMBUFFVER* = MIDISTRMBUFFVER
-  Tmidiproptimediv* {.final.} = object
-    cbStruct*: DWORD
-    dwTimeDiv*: DWORD
-
-  LPMIDIPROPTIMEDIV* = ptr Tmidiproptimediv
-  Tmidiproptempo* {.final.} = object
-    cbStruct*: DWORD
-    dwTempo*: DWORD
-
-  LPMIDIPROPTEMPO* = ptr Tmidiproptempo
-  AUXCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    wTechnology*: int16
-    wReserved1*: int16
-    dwSupport*: DWORD
-
-  PAUXCAPSA* = ptr AUXCAPSA
-  NPAUXCAPSA* = ptr AUXCAPSA
-  LPAUXCAPSA* = ptr AUXCAPSA
-  TAUXCAPSA* = AUXCAPSA
-  AUXCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
-    wTechnology*: int16
-    wReserved1*: int16
-    dwSupport*: DWORD
-
-  PAUXCAPSW* = ptr AUXCAPSW
-  NPAUXCAPSW* = ptr AUXCAPSW
-  LPAUXCAPSW* = ptr AUXCAPSW
-  TAUXCAPSW* = AUXCAPSW
-
-when defined(UNICODE):
-  type
-    AUXCAPS* = AUXCAPSW
-    PAUXCAPS* = PAUXCAPSW
-    NPAUXCAPS* = NPAUXCAPSW
-    LPAUXCAPS* = LPAUXCAPSW
-else:
-  type
-    AUXCAPS* = AUXCAPSA
-    PAUXCAPS* = PAUXCAPSA
-    NPAUXCAPS* = NPAUXCAPSA
-    LPAUXCAPS* = LPAUXCAPSA
-type
-  TAUXCAPS* = AUXCAPS
-  HMIXEROBJ* = Handle
-  LPHMIXEROBJ* = ptr HMIXEROBJ
-  HMIXER* = Handle
-  LPHMIXER* = ptr HMIXER
-
-proc mixerGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                               importc: "mixerGetNumDevs".}
-type
-  MIXERCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    fdwSupport*: DWORD
-    cDestinations*: DWORD
-
-  PMIXERCAPSA* = ptr MIXERCAPSA
-  LPMIXERCAPSA* = ptr MIXERCAPSA
-  TMIXERCAPSA* = MIXERCAPSA
-  MIXERCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
-    fdwSupport*: DWORD
-    cDestinations*: DWORD
-
-  PMIXERCAPSW* = ptr MIXERCAPSW
-  LPMIXERCAPSW* = ptr MIXERCAPSW
-  TMIXERCAPSW* = MIXERCAPSW
-
-when defined(UNICODE):
-  type
-    MIXERCAPS* = MIXERCAPSW
-    PMIXERCAPS* = PMIXERCAPSW
-    LPMIXERCAPS* = LPMIXERCAPSW
-else:
-  type
-    MIXERCAPS* = MIXERCAPSA
-    PMIXERCAPS* = PMIXERCAPSA
-    LPMIXERCAPS* = LPMIXERCAPSA
-type
-  TMIXERCAPS* = MIXERCAPS
-  MIXERLINEA* {.final.} = object
-    cbStruct*: DWORD
-    dwDestination*: DWORD
-    dwSource*: DWORD
-    dwLineID*: DWORD
-    fdwLine*: DWORD
-    dwUser*: DWORD
-    dwComponentType*: DWORD
-    cChannels*: DWORD
-    cConnections*: DWORD
-    cControls*: DWORD
-    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
-    dwType*, dwDeviceID*: DWORD
-    wMid*, wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-
-  PMIXERLINEA* = ptr MIXERLINEA
-  LPMIXERLINEA* = ptr MIXERLINEA
-  TMIXERLINEA* = MIXERLINEA
-  MIXERLINEW* {.final.} = object
-    cbStruct*: DWORD
-    dwDestination*: DWORD
-    dwSource*: DWORD
-    dwLineID*: DWORD
-    fdwLine*: DWORD
-    dwUser*: DWORD
-    dwComponentType*: DWORD
-    cChannels*: DWORD
-    cConnections*: DWORD
-    cControls*: DWORD
-    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
-    dwType*, dwDeviceID*: DWORD
-    wMid*, wPid*: int16
-    vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), WChar]
-
-  TMIXERLINEW* = MIXERLINEW
-  PMIXERLINEW* = ptr MIXERLINEW
-  LPMIXERLINEW* = ptr MIXERLINEW
-
-when defined(UNICODE):
-  type
-    MIXERLINE* = MIXERLINEW
-    PMIXERLINE* = PMIXERLINEW
-    LPMIXERLINE* = LPMIXERLINEW
-else:
-  type
-    MIXERLINE* = MIXERLINEA
-    PMIXERLINE* = PMIXERLINEA
-    LPMIXERLINE* = LPMIXERLINEA
-type
-  TMIXERLINE* = MIXERLINE
-  MIXERCONTROLA* {.final.} = object
-    cbStruct*: DWORD
-    dwControlID*: DWORD
-    dwControlType*: DWORD
-    fdwControl*: DWORD
-    cMultipleItems*: DWORD
-    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
-    dwMinimum*, dwMaximum*: DWORD
-    dwReserved*: array[0..3, DWORD]
-    cSteps*: DWORD
-    dwReserved2*: array[0..4, DWORD]
-
-  PMIXERCONTROLA* = ptr MIXERCONTROLA
-  LPMIXERCONTROLA* = ptr MIXERCONTROLA
-  TMIXERCONTROLA* = MIXERCONTROLA
-  MIXERCONTROLW* {.final.} = object
-    cbStruct*: DWORD
-    dwControlID*: DWORD
-    dwControlType*: DWORD
-    fdwControl*: DWORD
-    cMultipleItems*: DWORD
-    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
-    dwMinimum*, dwMaximum*: DWORD
-    dwReserved*: array[0..3, DWORD]
-    cSteps*: DWORD
-    dwReserved2*: array[0..4, DWORD]
-
-  PMIXERCONTROLW* = ptr MIXERCONTROLW
-  LPMIXERCONTROLW* = ptr MIXERCONTROLW
-  TMIXERCONTROLW* = MIXERCONTROLW
-
-when defined(UNICODE):
-  type
-    MIXERCONTROL* = MIXERCONTROLW
-    PMIXERCONTROL* = PMIXERCONTROLW
-    LPMIXERCONTROL* = LPMIXERCONTROLW
-else:
-  type
-    MIXERCONTROL* = MIXERCONTROLA
-    PMIXERCONTROL* = PMIXERCONTROLA
-    LPMIXERCONTROL* = LPMIXERCONTROLA
-type
-  TMIXERCONTROL* = MIXERCONTROL
-  MIXERLINECONTROLSA* {.final.} = object
-    cbStruct*: DWORD
-    dwLineID*: DWORD
-    dwControlType*, cControls*, cbmxctrl*: DWORD
-    pamxctrl*: PMIXERCONTROLA
-
-  PMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
-  LPMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
-  TMIXERLINECONTROLSA* = MIXERLINECONTROLSA
-  MIXERLINECONTROLSW* {.final.} = object
-    cbStruct*: DWORD
-    dwLineID*: DWORD
-    dwControlType*, cControls*, cbmxctrl*: DWORD
-    pamxctrl*: PMIXERCONTROLW
-
-  PMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW
-  LPMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW
-  TMIXERLINECONTROLSW* = MIXERLINECONTROLSW
-
-when defined(UNICODE):
-  type
-    MIXERLINECONTROLS* = MIXERLINECONTROLSW
-    PMIXERLINECONTROLS* = PMIXERLINECONTROLSW
-    LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSW
-else:
-  type
-    MIXERLINECONTROLS* = MIXERLINECONTROLSA
-    PMIXERLINECONTROLS* = PMIXERLINECONTROLSA
-    LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSA
-type
-  TMIXERLINECONTROLS* = MIXERLINECONTROLS
-  TMIXERCONTROLDETAILS* {.final.} = object
-    cbStruct*: DWORD
-    dwControlID*: DWORD
-    cChannels*: DWORD
-    cMultipleItems*, cbDetails*: DWORD
-    paDetails*: pointer
-
-  MIXERCONTROLDETAILS* = TMIXERCONTROLDETAILS
-  PMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
-  LPMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
-  MIXERCONTROLDETAILS_LISTTEXTA* {.final.} = object
-    dwParam1*: DWORD
-    dwParam2*: DWORD
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
-
-  PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
-  LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
-  TMIXERCONTROLDETAILS_LISTTEXTA* = MIXERCONTROLDETAILS_LISTTEXTA
-  MIXERCONTROLDETAILS_LISTTEXTW* {.final.} = object
-    dwParam1*: DWORD
-    dwParam2*: DWORD
-    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
-
-  PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
-  LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
-  TMIXERCONTROLDETAILS_LISTTEXTW* = MIXERCONTROLDETAILS_LISTTEXTW
-
-when defined(UNICODE):
-  type
-    MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTW
-    PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTW
-    LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTW
-else:
-  type
-    MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTA
-    PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTA
-    LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTA
-type
-  TMIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXT
-  MIXERCONTROLDETAILS_BOOLEAN* {.final.} = object
-    fValue*: int32
-
-  PMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
-  LPMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
-  TMIXERCONTROLDETAILS_BOOLEAN* = MIXERCONTROLDETAILS_BOOLEAN
-  MIXERCONTROLDETAILS_SIGNED* {.final.} = object
-    lValue*: int32
-
-  PMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
-  LPMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
-  TMIXERCONTROLDETAILS_SIGNED* = MIXERCONTROLDETAILS_SIGNED
-  MIXERCONTROLDETAILS_UNSIGNED* {.final.} = object
-    dwValue*: DWORD
-
-  PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
-  LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
-  TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED
-  LPTIMECALLBACK* = proc (uTimerID, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
-      stdcall.}
-  TTIMECALLBACK* = LPTIMECALLBACK
-  TIMECAPS* {.final.} = object
-    wPeriodMin*: uint32
-    wPeriodMax*: uint32
-
-  PTIMECAPS* = ptr TIMECAPS
-  NPTIMECAPS* = ptr TIMECAPS
-  LPTIMECAPS* = ptr TIMECAPS
-  TTIMECAS* = TIMECAPS
-  JOYCAPSA* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    szPname*: array[0..pred(MAXPNAMELEN), char]
-    wXmin*: uint32
-    wXmax*: uint32
-    wYmin*: uint32
-    wYmax*: uint32
-    wZmin*: uint32
-    wZmax*: uint32
-    wNumButtons*: uint32
-    wPeriodMin*: uint32
-    wPeriodMax*: uint32
-    wRmin*: uint32
-    wRmax*: uint32
-    wUmin*: uint32
-    wUmax*: uint32
-    wVmin*: uint32
-    wVmax*: uint32
-    wCaps*: uint32
-    wMaxAxes*: uint32
-    wNumAxes*: uint32
-    wMaxButtons*: uint32
-    szRegKey*: array[0..pred(MAXPNAMELEN), char]
-    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), char]
-
-  PJOYCAPSA* = ptr JOYCAPSA
-  NPJOYCAPSA* = ptr JOYCAPSA
-  LPJOYCAPSA* = ptr JOYCAPSA
-  TJOYCAPSA* = JOYCAPSA
-  JOYCAPSW* {.final.} = object
-    wMid*: int16
-    wPid*: int16
-    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
-    wXmin*: uint32
-    wXmax*: uint32
-    wYmin*: uint32
-    wYmax*: uint32
-    wZmin*: uint32
-    wZmax*: uint32
-    wNumButtons*: uint32
-    wPeriodMin*: uint32
-    wPeriodMax*: uint32
-    wRmin*: uint32
-    wRmax*: uint32
-    wUmin*: uint32
-    wUmax*: uint32
-    wVmin*: uint32
-    wVmax*: uint32
-    wCaps*: uint32
-    wMaxAxes*: uint32
-    wNumAxes*: uint32
-    wMaxButtons*: uint32
-    szRegKey*: array[0..pred(MAXPNAMELEN), WCHAR]
-    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]
-
-  PJOYCAPSW* = ptr JOYCAPSW
-  NPJOYCAPSW* = ptr JOYCAPSW
-  LPJOYCAPSW* = ptr JOYCAPSW
-  TJOYCAPSW* = JOYCAPSW
-
-when defined(UNICODE):
-  type
-    JOYCAPS* = JOYCAPSW
-    PJOYCAPS* = PJOYCAPSW
-    NPJOYCAPS* = NPJOYCAPSW
-    LPJOYCAPS* = LPJOYCAPSW
-else:
-  type
-    JOYCAPS* = JOYCAPSA
-    PJOYCAPS* = PJOYCAPSA
-    NPJOYCAPS* = NPJOYCAPSA
-    LPJOYCAPS* = LPJOYCAPSA
-type
-  TJOYCAPS* = JOYCAPS
-  JOYINFO* {.final.} = object
-    wXpos*: uint32
-    wYpos*: uint32
-    wZpos*: uint32
-    wButtons*: uint32
-
-  PJOYINFO* = ptr JOYINFO
-  NPJOYINFO* = ptr JOYINFO
-  LPJOYINFO* = ptr JOYINFO
-  TJOYINFO* = JOYINFO
-  JOYINFOEX* {.final.} = object
-    dwSize*: DWORD
-    dwFlags*: DWORD
-    wXpos*: uint32
-    wYpos*: uint32
-    wZpos*: uint32
-    dwRpos*: DWORD
-    dwUpos*: DWORD
-    dwVpos*: DWORD
-    wButtons*: uint32
-    dwButtonNumber*: DWORD
-    dwPOV*: DWORD
-    dwReserved1*: DWORD
-    dwReserved2*: DWORD
-
-  PJOYINFOEX* = ptr JOYINFOEX
-  NPJOYINFOEX* = ptr JOYINFOEX
-  LPJOYINFOEX* = ptr JOYINFOEX
-  TJOYINFOEX* = JOYINFOEX
-  FOURCC* = DWORD
-  HPSTR* = cstring
-  HMMIO* = Handle
-  LPMMIOPROC* = proc (x1: LPSTR, x2: uint32, x3, x4: LPARAM): LRESULT{.stdcall.}
-  TMMIOPROC* = LPMMIOPROC
-  MMIOINFO* {.final.} = object
-    dwFlags*: DWORD
-    fccIOProc*: FOURCC
-    pIOProc*: LPMMIOPROC
-    wErrorRet*: uint32
-    htask*: HTASK
-    cchBuffer*: int32
-    pchBuffer*: HPSTR
-    pchNext*: HPSTR
-    pchEndRead*: HPSTR
-    pchEndWrite*: HPSTR
-    lBufOffset*: int32
-    lDiskOffset*: int32
-    adwInfo*: array[0..pred(3), DWORD]
-    dwReserved1*: DWORD
-    dwReserved2*: DWORD
-    hmmio*: HMMIO
-
-  PMMIOINFO* = ptr MMIOINFO
-  NPMMIOINFO* = ptr MMIOINFO
-  LPMMIOINFO* = ptr MMIOINFO
-  LPCMMIOINFO* = ptr MMIOINFO
-  TMMIOINFO* = MMIOINFO
-  MMCKINFO* {.final.} = object
-    ckid*: FOURCC
-    cksize*: DWORD
-    fccType*: FOURCC
-    dwDataOffset*: DWORD
-    dwFlags*: DWORD
-
-  PMMCKINFO* = ptr MMCKINFO
-  NPMMCKINFO* = ptr MMCKINFO
-  LPMMCKINFO* = ptr MMCKINFO
-  LPCMMCKINFO* = ptr MMCKINFO
-  TMMCKINFO* = MMCKINFO
-  MCIERROR* = DWORD
-  MCIDEVICEID* = uint32
-  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): uint32{.stdcall.}
-  TYIELDPROC* = YIELDPROC
-  MCI_GENERIC_PARMS* {.final.} = object
-    dwCallback*: DWORD
-
-  PMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS
-  LPMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS
-  TMCI_GENERIC_PARMS* = MCI_GENERIC_PARMS
-  MCI_OPEN_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCSTR
-    lpstrElementName*: LPCSTR
-    lpstrAlias*: LPCSTR
-
-  PMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA
-  LPMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA
-  TMCI_OPEN_PARMSA* = MCI_OPEN_PARMSA
-  MCI_OPEN_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCWSTR
-    lpstrElementName*: LPCWSTR
-    lpstrAlias*: LPCWSTR
-
-  PMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW
-  LPMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW
-  TMCI_OPEN_PARMSW* = MCI_OPEN_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_OPEN_PARMS* = MCI_OPEN_PARMSW
-    PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSW
-    LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSW
-else:
-  type
-    MCI_OPEN_PARMS* = MCI_OPEN_PARMSA
-    PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSA
-    LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSA
-type
-  TMCI_OPEN_PARMS* = MCI_OPEN_PARMS
-  MCI_PLAY_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrom*: DWORD
-    dwTo*: DWORD
-
-  PMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS
-  LPMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS
-  TMCI_PLAY_PARMS* = MCI_PLAY_PARMS
-  MCI_SEEK_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwTo*: DWORD
-
-  PMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS
-  LPMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS
-  TMCI_SEEK_PARMS* = MCI_SEEK_PARMS
-  MCI_STATUS_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwReturn*: DWORD
-    dwItem*: DWORD
-    dwTrack*: DWORD
-
-  PMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS
-  LPMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS
-  TMCI_STATUS_PARMS* = MCI_STATUS_PARMS
-  MCI_INFO_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpstrReturn*: cstring
-    dwRetSize*: DWORD
-
-  LPMCI_INFO_PARMSA* = ptr MCI_INFO_PARMSA
-  TMCI_INFO_PARMSA* = MCI_INFO_PARMSA
-  MCI_INFO_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpstrReturn*: LPWSTR
-    dwRetSize*: DWORD
-
-  LPMCI_INFO_PARMSW* = ptr MCI_INFO_PARMSW
-  TMCI_INFO_PARMSW* = MCI_INFO_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_INFO_PARMS* = MCI_INFO_PARMSW
-    LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSW
-else:
-  type
-    MCI_INFO_PARMS* = MCI_INFO_PARMSA
-    LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSA
-type
-  TMCI_INFO_PARMS* = MCI_INFO_PARMS
-  MCI_GETDEVCAPS_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwReturn*: DWORD
-    dwItem*: DWORD
-
-  PMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS
-  LPMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS
-  TMCI_GETDEVCAPS_PARMS* = MCI_GETDEVCAPS_PARMS
-  MCI_SYSINFO_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpstrReturn*: cstring
-    dwRetSize*: DWORD
-    dwNumber*: DWORD
-    wDeviceType*: uint32
-
-  PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
-  LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
-  TMCI_SYSINFO_PARMSA* = MCI_SYSINFO_PARMSA
-  MCI_SYSINFO_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpstrReturn*: LPWSTR
-    dwRetSize*: DWORD
-    dwNumber*: DWORD
-    wDeviceType*: uint32
-
-  PMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
-  LPMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
-  TMCI_SYSINFO_PARMSW* = MCI_SYSINFO_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMSW
-    PMCI_SYSINFO_PARMS* = PMCI_SYSINFO_PARMSW
-    LPMCI_SYSINFO_PARMS* = LPMCI_SYSINFO_PARMSW
-else:
-  type
-    MCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMSA
-    PMCI_SYSINFO_PARMS* = PMCI_SYSINFO_PARMSA
-    LPMCI_SYSINFO_PARMS* = LPMCI_SYSINFO_PARMSA
-type
-  TMCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMS
-  MCI_SET_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwTimeFormat*: DWORD
-    dwAudio*: DWORD
-
-  PMCI_SET_PARMS* = ptr MCI_SET_PARMS
-  LPMCI_SET_PARMS* = ptr MCI_SET_PARMS
-  TMCI_SET_PARMS* = MCI_SET_PARMS
-  MCI_BREAK_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    nVirtKey*: int32
-    hwndBreak*: HWND
-
-  PMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS
-  LPMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS
-  TMCI_BREAK_PARMS* = MCI_BREAK_PARMS
-  MCI_SAVE_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCSTR
-
-  PMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA
-  LPMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA
-  TMCI_SAVE_PARMSA* = MCI_SAVE_PARMSA
-  MCI_SAVE_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCWSTR
-
-  PMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW
-  LPMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW
-  TMCI_SAVE_PARMSW* = MCI_SAVE_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_SAVE_PARMS* = MCI_SAVE_PARMSW
-    PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSW
-    LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSW
-else:
-  type
-    MCI_SAVE_PARMS* = MCI_SAVE_PARMSA
-    PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSA
-    LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSA
-type
-  TMCI_SAVE_PARMS* = MCI_SAVE_PARMS
-  MCI_LOAD_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCSTR
-
-  PMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA
-  LPMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA
-  TMCI_LOAD_PARMSA* = MCI_LOAD_PARMSA
-  MCI_LOAD_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCWSTR
-
-  PMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW
-  LPMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW
-  TMCI_LOAD_PARMSW* = MCI_LOAD_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_LOAD_PARMS* = MCI_LOAD_PARMSW
-    PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSW
-    LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSW
-else:
-  type
-    MCI_LOAD_PARMS* = MCI_LOAD_PARMSA
-    PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSA
-    LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSA
-type
-  TMCI_LOAD_PARMS* = MCI_LOAD_PARMS
-  MCI_RECORD_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrom*: DWORD
-    dwTo*: DWORD
-
-  LPMCI_RECORD_PARMS* = ptr MCI_RECORD_PARMS
-  TMCI_RECORD_PARMS* = MCI_RECORD_PARMS
-  MCI_VD_PLAY_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrom*: DWORD
-    dwTo*: DWORD
-    dwSpeed*: DWORD
-
-  PMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS
-  LPMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS
-  TMCI_VD_PLAY_PARMS* = MCI_VD_PLAY_PARMS
-  MCI_VD_STEP_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrames*: DWORD
-
-  PMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS
-  LPMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS
-  MCI_VD_ESCAPE_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpstrCommand*: LPCSTR
-
-  PMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA
-  LPMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA
-  TMCI_VD_ESCAPE_PARMSA* = MCI_VD_ESCAPE_PARMSA
-  MCI_VD_ESCAPE_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpstrCommand*: LPCWSTR
-
-  PMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW
-  LPMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW
-  TMCI_VD_ESCAPE_PARMSW* = MCI_VD_ESCAPE_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSW
-    PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSW
-    LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSW
-else:
-  type
-    MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSA
-    PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSA
-    LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSA
-type
-  TMCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMS
-  MCI_WAVE_OPEN_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCSTR
-    lpstrElementName*: LPCSTR
-    lpstrAlias*: LPCSTR
-    dwBufferSeconds*: DWORD
-
-  PMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA
-  LPMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA
-  TMCI_WAVE_OPEN_PARMSA* = MCI_WAVE_OPEN_PARMSA
-  MCI_WAVE_OPEN_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCWSTR
-    lpstrElementName*: LPCWSTR
-    lpstrAlias*: LPCWSTR
-    dwBufferSeconds*: DWORD
-
-  PMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW
-  LPMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW
-  TMCI_WAVE_OPEN_PARMSW* = MCI_WAVE_OPEN_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSW
-    PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSW
-    LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSW
-else:
-  type
-    MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSA
-    PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSA
-    LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSA
-type
-  TMCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMS
-  MCI_WAVE_DELETE_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrom*: DWORD
-    dwTo*: DWORD
-
-  PMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS
-  LPMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS
-  TMCI_WAVE_DELETE_PARMS* = MCI_WAVE_DELETE_PARMS
-  MCI_WAVE_SET_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwTimeFormat*: DWORD
-    dwAudio*: DWORD
-    wInput*: uint32
-    wOutput*: uint32
-    wFormatTag*: int16
-    wReserved2*: int16
-    nChannels*: int16
-    wReserved3*: int16
-    nSamplesPerSec*: DWORD
-    nAvgBytesPerSec*: DWORD
-    nBlockAlign*: int16
-    wReserved4*: int16
-    wBitsPerSample*: int16
-    wReserved5*: int16
-
-  PMCI_WAVE_SET_PARMS* = ptr MCI_WAVE_SET_PARMS
-  LPMCI_WAVE_SET_PARMS* = ptr MCI_WAVE_SET_PARMS
-  TMCI_WAVE_SET_PARMS* = MCI_WAVE_SET_PARMS
-  MCI_SEQ_SET_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwTimeFormat*: DWORD
-    dwAudio*: DWORD
-    dwTempo*: DWORD
-    dwPort*: DWORD
-    dwSlave*: DWORD
-    dwMaster*: DWORD
-    dwOffset*: DWORD
-
-  PMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS
-  LPMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS
-  TMCI_SEQ_SET_PARMS* = MCI_SEQ_SET_PARMS
-  MCI_ANIM_OPEN_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCSTR
-    lpstrElementName*: LPCSTR
-    lpstrAlias*: LPCSTR
-    dwStyle*: DWORD
-    hWndParent*: HWND
-
-  PMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA
-  LPMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA
-  TMCI_ANIM_OPEN_PARMSA* = MCI_ANIM_OPEN_PARMSA
-  MCI_ANIM_OPEN_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCWSTR
-    lpstrElementName*: LPCWSTR
-    lpstrAlias*: LPCWSTR
-    dwStyle*: DWORD
-    hWndParent*: HWND
-
-  PMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW
-  LPMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSW
-    PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSW
-    LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSW
-else:
-  type
-    MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSA
-    PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSA
-    LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSA
-type
-  TMCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMS
-  MCI_ANIM_WINDOW_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    hWnd*: HWND
-    nCmdShow*: uint32
-    lpstrText*: LPCWSTR
-
-  PMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
-  LPMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
-  TMCI_ANIM_WINDOW_PARMSW* = MCI_ANIM_WINDOW_PARMSW
-  MCI_ANIM_STEP_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrames*: DWORD
-
-  PMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS
-  LPMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS
-  TMCI_ANIM_STEP_PARMS* = MCI_ANIM_STEP_PARMS
-  MCI_ANIM_WINDOW_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    hWnd*: HWND
-    nCmdShow*: uint32
-    lpstrText*: LPCSTR
-
-  PMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
-  LPMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
-  TMCI_ANIM_WINDOW_PARMSA* = MCI_ANIM_WINDOW_PARMSA
-  MCI_ANIM_PLAY_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    dwFrom*: DWORD
-    dwTo*: DWORD
-    dwSpeed*: DWORD
-
-  PMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS
-  LPMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS
-
-when defined(UNICODE):
-  type
-    MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSW
-    PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSW
-    LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSW
-else:
-  type
-    MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSA
-    PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSA
-    LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSA
-type
-  MCI_ANIM_RECT_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    rc*: RECT
-
-  PMCI_ANIM_RECT_PARMS* = ptr MCI_ANIM_RECT_PARMS
-  LPMCI_ANIM_RECT_PARMS* = ptr MCI_ANIM_RECT_PARMS
-  TMCI_ANIM_RECT_PARMS* = MCI_ANIM_RECT_PARMS
-  MCI_ANIM_UPDATE_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    rc*: RECT
-    hDC*: HDC
-
-  PMCI_ANIM_UPDATE_PARMS* = ptr MCI_ANIM_UPDATE_PARMS
-  LPMCI_ANIM_UPDATE_PARMS* = ptr MCI_ANIM_UPDATE_PARMS
-  TMCI_ANIM_UPDATE_PARMS* = MCI_ANIM_UPDATE_PARMS
-  MCI_OVLY_OPEN_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCSTR
-    lpstrElementName*: LPCSTR
-    lpstrAlias*: LPCSTR
-    dwStyle*: DWORD
-    hWndParent*: HWND
-
-  PMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA
-  LPMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA
-  TMCI_OVLY_OPEN_PARMSA* = MCI_OVLY_OPEN_PARMSA
-  MCI_OVLY_OPEN_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    wDeviceID*: MCIDEVICEID
-    lpstrDeviceType*: LPCWSTR
-    lpstrElementName*: LPCWSTR
-    lpstrAlias*: LPCWSTR
-    dwStyle*: DWORD
-    hWndParent*: HWND
-
-  PMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW
-  LPMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW
-  TMCI_OVLY_OPEN_PARMSW* = MCI_OVLY_OPEN_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSW
-    PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSW
-    LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSW
-else:
-  type
-    MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSA
-    PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSA
-    LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSA
-type
-  TMCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMS
-  MCI_OVLY_WINDOW_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    hWnd*: HWND
-    nCmdShow*: uint32
-    lpstrText*: LPCSTR
-
-  PMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
-  LPMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
-  TMCI_OVLY_WINDOW_PARMSA* = MCI_OVLY_WINDOW_PARMSA
-  MCI_OVLY_WINDOW_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    hWnd*: HWND
-    nCmdShow*: uint32
-    lpstrText*: LPCWSTR
-
-  PMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
-  LPMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
-  TMCI_OVLY_WINDOW_PARMSW* = MCI_OVLY_WINDOW_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSW
-    PMCI_OVLY_WINDOW_PARMS* = PMCI_OVLY_WINDOW_PARMSW
-    LPMCI_OVLY_WINDOW_PARMS* = LPMCI_OVLY_WINDOW_PARMSW
-else:
-  type
-    MCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSA
-    PMCI_OVLY_WINDOW_PARMS* = PMCI_OVLY_WINDOW_PARMSA
-    LPMCI_OVLY_WINDOW_PARMS* = LPMCI_OVLY_WINDOW_PARMSA
-type
-  TMCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSW
-  MCI_OVLY_RECT_PARMS* {.final.} = object
-    dwCallback*: DWORD
-    rc*: RECT
-
-  PMCI_OVLY_RECT_PARMS* = ptr MCI_OVLY_RECT_PARMS
-  LPMCI_OVLY_RECT_PARMS* = ptr MCI_OVLY_RECT_PARMS
-  TMCI_OVLY_RECT_PARMS* = MCI_OVLY_RECT_PARMS
-  MCI_OVLY_SAVE_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCSTR
-    rc*: RECT
-
-  PMCI_OVLY_SAVE_PARMSA* = ptr MCI_OVLY_SAVE_PARMSA
-  LPMCI_OVLY_SAVE_PARMSA* = ptr MCI_OVLY_SAVE_PARMSA
-  TMCI_OVLY_SAVE_PARMSA* = MCI_OVLY_SAVE_PARMSA
-  MCI_OVLY_SAVE_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCWSTR
-    rc*: RECT
-
-  PMCI_OVLY_SAVE_PARMSW* = ptr MCI_OVLY_SAVE_PARMSW
-  LPMCI_OVLY_SAVE_PARMSW* = ptr MCI_OVLY_SAVE_PARMSW
-  TMCI_OVLY_SAVE_PARMSW* = MCI_OVLY_SAVE_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMSW
-    PMCI_OVLY_SAVE_PARMS* = PMCI_OVLY_SAVE_PARMSW
-    LPMCI_OVLY_SAVE_PARMS* = LPMCI_OVLY_SAVE_PARMSW
-else:
-  type
-    MCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMSA
-    PMCI_OVLY_SAVE_PARMS* = PMCI_OVLY_SAVE_PARMSA
-    LPMCI_OVLY_SAVE_PARMS* = LPMCI_OVLY_SAVE_PARMSA
-type
-  TMCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMS
-  MCI_OVLY_LOAD_PARMSA* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCSTR
-    rc*: RECT
-
-  PMCI_OVLY_LOAD_PARMSA* = ptr MCI_OVLY_LOAD_PARMSA
-  LPMCI_OVLY_LOAD_PARMSA* = ptr MCI_OVLY_LOAD_PARMSA
-  TMCI_OVLY_LOAD_PARMSA* = MCI_OVLY_LOAD_PARMSA
-  MCI_OVLY_LOAD_PARMSW* {.final.} = object
-    dwCallback*: DWORD
-    lpfilename*: LPCWSTR
-    rc*: RECT
-
-  PMCI_OVLY_LOAD_PARMSW* = ptr MCI_OVLY_LOAD_PARMSW
-  LPMCI_OVLY_LOAD_PARMSW* = ptr MCI_OVLY_LOAD_PARMSW
-  TMCI_OVLY_LOAD_PARMSW* = MCI_OVLY_LOAD_PARMSW
-
-when defined(UNICODE):
-  type
-    MCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMSW
-    PMCI_OVLY_LOAD_PARMS* = PMCI_OVLY_LOAD_PARMSW
-    LPMCI_OVLY_LOAD_PARMS* = LPMCI_OVLY_LOAD_PARMSW
-else:
-  type
-    MCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMSA
-    PMCI_OVLY_LOAD_PARMS* = PMCI_OVLY_LOAD_PARMSA
-    LPMCI_OVLY_LOAD_PARMS* = LPMCI_OVLY_LOAD_PARMSA
-type
-  TMCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMS
-
-proc mmioStringToFOURCCA*(x1: LPCSTR, x2: uint32): FOURCC{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
-proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: uint32): FOURCC{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioStringToFOURCCW".}
-proc mmioStringToFOURCC*(x1: cstring, x2: uint32): FOURCC{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
-proc mmioInstallIOProcA*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
-proc mmioInstallIOProcW*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcW".}
-proc mmioInstallIOProc*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
-proc mmioOpenA*(x1: LPSTR, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioOpenA".}
-proc mmioOpenW*(x1: LPWSTR, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioOpenW".}
-proc mmioOpen*(x1: cstring, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioOpenA".}
-proc mmioRenameA*(x1: LPCSTR, x2: LPCSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
-proc mmioRenameW*(x1: LPCWSTR, x2: LPCWSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioRenameW".}
-proc mmioRename*(x1: cstring, x2: cstring, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
-proc mmioClose*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "mmioClose".}
-proc mmioRead*(x1: HMMIO, x2: HPSTR, x3: LONG): LONG{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioRead".}
-proc mmioWrite*(x1: HMMIO, x2: cstring, x3: LONG): LONG{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioWrite".}
-proc mmioSeek*(x1: HMMIO, x2: LONG, x3: WINT): LONG{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioSeek".}
-proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioGetInfo".}
-proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioSetInfo".}
-proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioSetBuffer".}
-proc mmioFlush*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "mmioFlush".}
-proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioAdvance".}
-proc mmioSendMessage*(x1: HMMIO, x2: uint32, x3: LPARAM, x4: LPARAM): LRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioSendMessage".}
-proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mmioDescend".}
-proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioAscend".}
-proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mmioCreateChunk".}
-proc mciSendCommandA*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendCommandW*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandW".}
-proc mciSendCommand*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: uint32, x4: HWND): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
-proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: uint32, x4: HWND): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendStringW".}
-proc mciSendString*(x1: cstring, x2: cstring, x3: uint32, x4: HWND): MCIERROR{.
-    stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
-proc mciGetDeviceIDA*(x1: LPCSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
-    importc: "mciGetDeviceIDA".}
-proc mciGetDeviceIDW*(x1: LPCWSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
-    importc: "mciGetDeviceIDW".}
-proc mciGetDeviceID*(x1: cstring): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
-    importc: "mciGetDeviceIDA".}
-proc mciGetDeviceIDFromElementIDA*(x1: DWORD, x2: LPCSTR): MCIDEVICEID{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
-proc mciGetDeviceIDFromElementIDW*(x1: DWORD, x2: LPCWSTR): MCIDEVICEID{.
-    stdcall, dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDW".}
-proc mciGetDeviceIDFromElementID*(x1: DWORD, x2: cstring): MCIDEVICEID{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
-proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: uint32): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: uint32): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetErrorStringW".}
-proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: uint32): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "mciSetYieldProc".}
-proc mciGetCreatorTask*(x1: MCIDEVICEID): HTASK{.stdcall, dynlib: "winmm.dll",
-    importc: "mciGetCreatorTask".}
-proc mciGetYieldProc*(x1: MCIDEVICEID, x2: LPDWORD): YIELDPROC{.stdcall,
-    dynlib: "winmm.dll", importc: "mciGetYieldProc".}
-proc mciExecute*(x1: LPCSTR): bool{.stdcall, dynlib: "winmm.dll",
-                                    importc: "mciExecute".}
-proc joyGetPos*(x1: uint32, x2: LPJOYINFO): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetPos".}
-proc joyGetPosEx*(x1: uint32, x2: LPJOYINFOEX): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetPosEx".}
-proc joyGetThreshold*(x1: uint32, x2: LPUINT): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetThreshold".}
-proc joyReleaseCapture*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "joyReleaseCapture".}
-proc joySetCapture*(x1: HWND, x2: uint32, x3: uint32, x4: bool): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joySetCapture".}
-proc joySetThreshold*(x1: uint32, x2: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joySetThreshold".}
-proc waveOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                                 importc: "waveOutGetNumDevs".}
-proc waveOutGetDevCapsA*(x1: uint32, x2: LPWAVEOUTCAPSA, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
-proc waveOutGetDevCapsW*(x1: uint32, x2: LPWAVEOUTCAPSW, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsW".}
-proc waveOutGetDevCaps*(x1: uint32, x2: LPWAVEOUTCAPS, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
-proc waveOutGetVolume*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutGetVolume".}
-proc waveOutSetVolume*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutSetVolume".}
-proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextW".}
-proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutOpen*(x1: LPHWAVEOUT, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
-                  x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutOpen".}
-proc waveOutClose*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutClose".}
-proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutPrepareHeader".}
-proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutUnprepareHeader".}
-proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutWrite".}
-proc waveOutPause*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutPause".}
-proc waveOutRestart*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutRestart".}
-proc waveOutReset*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutReset".}
-proc waveOutBreakLoop*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveOutBreakLoop".}
-proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutGetPosition".}
-proc waveOutGetPitch*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutGetPitch".}
-proc waveOutSetPitch*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutSetPitch".}
-proc waveOutGetPlaybackRate*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutGetPlaybackRate".}
-proc waveOutSetPlaybackRate*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutSetPlaybackRate".}
-proc waveOutGetID*(x1: HWAVEOUT, x2: LPUINT): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveOutGetID".}
-proc waveOutMessage*(x1: HWAVEOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveOutMessage".}
-proc waveInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                                importc: "waveInGetNumDevs".}
-proc waveInGetDevCapsA*(x1: uint32, x2: LPWAVEINCAPSA, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetDevCapsW*(x1: uint32, x2: LPWAVEINCAPSW, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsW".}
-proc waveInGetDevCaps*(x1: uint32, x2: LPWAVEINCAPS, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextW".}
-proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInOpen*(x1: LPHWAVEIN, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
-                 x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveInOpen".}
-proc waveInClose*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveInClose".}
-proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInPrepareHeader".}
-proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInUnprepareHeader".}
-proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveInAddBuffer".}
-proc waveInStart*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveInStart".}
-proc waveInStop*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveInStop".}
-proc waveInReset*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "waveInReset".}
-proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveInGetPosition".}
-proc waveInGetID*(x1: HWAVEIN, x2: LPUINT): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "waveInGetID".}
-proc waveInMessage*(x1: HWAVEIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "waveInMessage".}
-proc mixerGetLineControlsA*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSA, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
-proc mixerGetLineControlsW*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSW, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsW".}
-proc mixerGetLineControls*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLS, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
-proc joyGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                             importc: "joyGetNumDevs".}
-proc joyGetDevCapsA*(x1: uint32, x2: LPJOYCAPSA, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
-proc joyGetDevCapsW*(x1: uint32, x2: LPJOYCAPSW, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetDevCapsW".}
-proc joyGetDevCaps*(x1: uint32, x2: LPJOYCAPS, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
-proc mixerGetControlDetailsA*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
-                              x3: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
-proc mixerGetControlDetailsW*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
-                              x3: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetControlDetailsW".}
-proc mixerGetControlDetails*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
-proc timeGetSystemTime*(x1: LPMMTIME, x2: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "timeGetSystemTime".}
-proc timeGetTime*(): DWORD{.stdcall, dynlib: "winmm.dll", importc: "timeGetTime".}
-proc timeSetEvent*(x1: uint32, x2: uint32, x3: LPTIMECALLBACK, x4: DWORD, x5: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "timeSetEvent".}
-proc timeKillEvent*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "timeKillEvent".}
-proc timeGetDevCaps*(x1: LPTIMECAPS, x2: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "timeGetDevCaps".}
-proc timeBeginPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "timeBeginPeriod".}
-proc timeEndPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "timeEndPeriod".}
-proc mixerGetDevCapsA*(x1: uint32, x2: LPMIXERCAPSA, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerGetDevCapsW*(x1: uint32, x2: LPMIXERCAPSW, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetDevCapsW".}
-proc mixerGetDevCaps*(x1: uint32, x2: LPMIXERCAPS, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerOpen*(x1: LPHMIXER, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerOpen".}
-proc mixerClose*(x1: HMIXER): MMRESULT{.stdcall, dynlib: "winmm.dll",
-                                        importc: "mixerClose".}
-proc mixerMessage*(x1: HMIXER, x2: uint32, x3: DWORD, x4: DWORD): DWORD{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerMessage".}
-proc auxGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                             importc: "auxGetNumDevs".}
-proc auxGetDevCapsA*(x1: uint32, x2: LPAUXCAPSA, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxGetDevCapsW*(x1: uint32, x2: LPAUXCAPSW, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "auxGetDevCapsW".}
-proc auxGetDevCaps*(x1: uint32, x2: LPAUXCAPS, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxSetVolume*(x1: uint32, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "auxSetVolume".}
-proc auxGetVolume*(x1: uint32, x2: LPDWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "auxGetVolume".}
-proc auxOutMessage*(x1: uint32, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "auxOutMessage".}
-proc midiOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                                 importc: "midiOutGetNumDevs".}
-proc midiStreamOpen*(x1: LPHMIDISTRM, x2: LPUINT, x3: DWORD, x4: DWORD,
-                     x5: DWORD, x6: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiStreamOpen".}
-proc midiStreamClose*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiStreamClose".}
-proc midiStreamProperty*(x1: HMIDISTRM, x2: LPBYTE, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiStreamProperty".}
-proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiStreamPosition".}
-proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiStreamOut".}
-proc midiStreamPause*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiStreamPause".}
-proc midiStreamRestart*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiStreamRestart".}
-proc midiStreamStop*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiStreamStop".}
-proc midiConnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiConnect".}
-proc midiDisconnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiDisconnect".}
-proc midiOutGetDevCapsA*(x1: uint32, x2: LPMIDIOUTCAPSA, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
-proc midiOutGetDevCapsW*(x1: uint32, x2: LPMIDIOUTCAPSW, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsW".}
-proc midiOutGetDevCaps*(x1: uint32, x2: LPMIDIOUTCAPS, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
-proc midiOutGetVolume*(x1: HMIDIOUT, x2: LPDWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiOutGetVolume".}
-proc midiOutSetVolume*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiOutSetVolume".}
-proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextW".}
-proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutOpen*(x1: LPHMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutOpen".}
-proc midiOutClose*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiOutClose".}
-proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutPrepareHeader".}
-proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutUnprepareHeader".}
-proc midiOutShortMsg*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiOutShortMsg".}
-proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiOutLongMsg".}
-proc midiOutReset*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiOutReset".}
-proc midiOutCachePatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutCachePatches".}
-proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutCacheDrumPatches".}
-proc midiOutGetID*(x1: HMIDIOUT, x2: LPUINT): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiOutGetID".}
-proc midiOutMessage*(x1: HMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiOutMessage".}
-proc midiInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
-                                importc: "midiInGetNumDevs".}
-proc midiInGetDevCapsA*(x1: uint32, x2: LPMIDIINCAPSA, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetDevCapsW*(x1: uint32, x2: LPMIDIINCAPSW, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsW".}
-proc midiInGetDevCaps*(x1: uint32, x2: LPMIDIINCAPS, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextW".}
-proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInOpen*(x1: LPHMIDIIN, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInOpen".}
-proc midiInClose*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiInClose".}
-proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInPrepareHeader".}
-proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInUnprepareHeader".}
-proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiInAddBuffer".}
-proc midiInStart*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiInStart".}
-proc midiInStop*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiInStop".}
-proc midiInReset*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
-    importc: "midiInReset".}
-proc midiInGetID*(x1: HMIDIIN, x2: LPUINT): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "midiInGetID".}
-proc midiInMessage*(x1: HMIDIIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "midiInMessage".}
-proc mixerGetLineInfoA*(x1: HMIXEROBJ, x2: LPMIXERLINEA, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
-proc mixerGetLineInfoW*(x1: HMIXEROBJ, x2: LPMIXERLINEW, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoW".}
-proc mixerGetLineInfo*(x1: HMIXEROBJ, x2: LPMIXERLINE, x3: DWORD): MMRESULT{.
-    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
-proc mixerGetID*(x1: HMIXEROBJ, x2: var uint32, x3: DWORD): MMRESULT{.stdcall,
-    dynlib: "winmm.dll", importc: "mixerGetID".}
-proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "PlaySoundA".}
-proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "PlaySoundW".}
-proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): bool{.stdcall,
-    dynlib: "winmm.dll", importc: "PlaySoundA".}
-# implementation
-
-proc MEVT_EVENTTYPE(x: int8): int8 =
-  result = toU8(x shr 24)
-
-proc MEVT_EVENTPARM(x: DWORD): DWORD =
-  result = x and 0x00FFFFFF
-
-proc MCI_MSF_MINUTE(msf: int32): int8 =
-  result = toU8(msf and 0xff)
-
-proc MCI_TMSF_TRACK(tmsf: int32): int8 =
-  result = toU8(tmsf and 0xff)
-
-proc MCI_HMS_HOUR(h: int32): int8 =
-  result = toU8(h and 0xff)
-
-proc MCI_MSF_SECOND(msf: int32): int8 =
-  result = toU8(msf shr 8)
-
-proc MCI_TMSF_MINUTE(tmsf: int32): int8 =
-  result = toU8(tmsf shr 8)
-
-proc MCI_HMS_MINUTE(h: int32): int8 =
-  result = toU8(h shr 8)
-
-proc MCI_MSF_FRAME(msf: int32): int8 =
-  result = toU8(msf shr 16)
-
-proc MCI_TMSF_SECOND(tmsf: int32): int8 =
-  result = toU8(tmsf shr 16)
-
-proc MCI_HMS_SECOND(h: int32): int8 =
-  result = toU8(h shr 16)
-
-proc MCI_MAKE_MSF(m, s, f: int8): int32 =
-  result = toU32(ze(m) or ze(s) shl 8 or ze(f) shl 16)
-
-proc MCI_MAKE_HMS(h, m, s: int8): int32 =
-  result = toU32(ze(h) or ze(m) shl 8 or ze(s) shl 16)
-
-proc MCI_TMSF_FRAME(tmsf: int32): int8 =
-  result = toU8(tmsf shr 24)
-
-proc MCI_MAKE_TMSF(t, m, s, f: int8): int32 =
-  result = (ze(t) or ze(m) shl 8 or ze(s) shl 16 or ze(f) shl 24).int32
-
-proc DIBINDEX(n: int32): int32 =
-  result = n or 0x000010FF'i32 shl 16'i32
diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim
deleted file mode 100644
index 820e0b7a3..000000000
--- a/lib/windows/nb30.nim
+++ /dev/null
@@ -1,236 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2006 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-#       NetBIOS 3.0 interface unit 
-
-# This module contains the definitions for portable NetBIOS 3.0 support. 
-
-{.deadCodeElim: on.}
-
-import                        # Data structure templates 
-  windows
-
-const 
-  NCBNAMSZ* = 16              # absolute length of a net name
-  MAX_LANA* = 254             # lana's in range 0 to MAX_LANA inclusive
-
-type                          # Network Control Block
-  PNCB* = ptr NCB
-  NCBPostProc* = proc (P: PNCB) {.stdcall.}
-  NCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
-                           # by an array of NAME_BUFFER structures.
-    ncb_command*: char        # command code
-    ncb_retcode*: char        # return code
-    ncb_lsn*: char            # local session number
-    ncb_num*: char            # number of our network name
-    ncb_buffer*: cstring      # address of message buffer
-    ncb_length*: int16        # size of message buffer
-    ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote
-    ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname
-    ncb_rto*: char            # rcv timeout/retry count
-    ncb_sto*: char            # send timeout/sys timeout
-    ncb_post*: NCBPostProc    # POST routine address
-    ncb_lana_num*: char       # lana (adapter) number
-    ncb_cmd_cplt*: char       # 0xff => commmand pending
-    ncb_reserve*: array[0..9, char] # reserved, used by BIOS
-    ncb_event*: Handle        # HANDLE to Win32 event which
-                              # will be set to the signalled
-                              # state when an ASYNCH command
-                              # completes
-  
-  PAdapterStatus* = ptr AdapterStatus
-  AdapterStatus* {.final.} = object 
-    adapter_address*: array[0..5, char]
-    rev_major*: char
-    reserved0*: char
-    adapter_type*: char
-    rev_minor*: char
-    duration*: int16
-    frmr_recv*: int16
-    frmr_xmit*: int16
-    iframe_recv_err*: int16
-    xmit_aborts*: int16
-    xmit_success*: DWORD
-    recv_success*: DWORD
-    iframe_xmit_err*: int16
-    recv_buff_unavail*: int16
-    t1_timeouts*: int16
-    ti_timeouts*: int16
-    reserved1*: DWORD
-    free_ncbs*: int16
-    max_cfg_ncbs*: int16
-    max_ncbs*: int16
-    xmit_buf_unavail*: int16
-    max_dgram_size*: int16
-    pending_sess*: int16
-    max_cfg_sess*: int16
-    max_sess*: int16
-    max_sess_pkt_size*: int16
-    name_count*: int16
-
-  PNameBuffer* = ptr NameBuffer
-  NameBuffer* {.final.} = object 
-    name*: array[0..NCBNAMSZ - 1, char]
-    name_num*: char
-    name_flags*: char
-{.deprecated: [TNCB: NCB, TNCBPostProc: NCBPostProc,
-              TAdapterStatus: AdapterStatus, TNameBuffer: NameBuffer].}
-
-
-const                         # values for name_flags bits.
-  NAME_FLAGS_MASK* = 0x00000087
-  GROUP_NAME* = 0x00000080
-  UNIQUE_NAME* = 0x00000000
-  REGISTERING* = 0x00000000
-  REGISTERED* = 0x00000004
-  DEREGISTERED* = 0x00000005
-  DUPLICATE* = 0x00000006
-  DUPLICATE_DEREG* = 0x00000007
-
-type # Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
-     # by an array of SESSION_BUFFER structures. If the NCB_NAME starts with an
-     # asterisk then an array of these structures is returned containing the
-     # status for all names.
-  PSessionHeader* = ptr SessionHeader
-  SessionHeader* {.final.} = object 
-    sess_name*: char
-    num_sess*: char
-    rcv_dg_outstanding*: char
-    rcv_any_outstanding*: char
-
-  PSessionBuffer* = ptr SessionBuffer
-  SessionBuffer* {.final.} = object 
-    lsn*: char
-    state*: char
-    local_name*: array[0..NCBNAMSZ - 1, char]
-    remote_name*: array[0..NCBNAMSZ - 1, char]
-    rcvs_outstanding*: char
-    sends_outstanding*: char
-{.deprecated: [TSessionHeader: SessionHeader, TSessionBuffer: SessionBuffer].}
-
-
-const                         # Values for state
-  LISTEN_OUTSTANDING* = 0x00000001
-  CALL_PENDING* = 0x00000002
-  SESSION_ESTABLISHED* = 0x00000003
-  HANGUP_PENDING* = 0x00000004
-  HANGUP_COMPLETE* = 0x00000005
-  SESSION_ABORTED* = 0x00000006
-
-type # Structure returned to the NCB command NCBENUM.
-     # On a system containing lana's 0, 2 and 3, a structure with
-     # length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned.
-  PLanaEnum* = ptr TLanaEnum
-  TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
-                                # by an array of FIND_NAME_BUFFER structures.
-    len*: char                #  Number of valid entries in lana[]
-    lana*: array[0..MAX_LANA, char]
-
-  PFindNameHeader* = ptr FindNameHeader
-  FindNameHeader* {.final.} = object 
-    node_count*: int16
-    reserved*: char
-    unique_group*: char
-
-  PFindNameBuffer* = ptr FindNameBuffer
-  FindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide
-                                      # transport specific extensions to netbios.
-    len*: char
-    access_control*: char
-    frame_control*: char
-    destination_addr*: array[0..5, char]
-    source_addr*: array[0..5, char]
-    routing_info*: array[0..17, char]
-
-  PActionHeader* = ptr ActionHeader
-  ActionHeader* {.final.} = object 
-    transport_id*: int32
-    action_code*: int16
-    reserved*: int16
-{.deprecated: [TFindNameHeader: FindNameHeader, TFindNameBuffer: FindNameBuffer,
-              TActionHeader: ActionHeader].}
-
-const                         # Values for transport_id
-  ALL_TRANSPORTS* = "M\0\0\0"
-  MS_NBF* = "MNBF"            # Special values and constants 
-
-const                         # NCB Command codes
-  NCBCALL* = 0x00000010       # NCB CALL
-  NCBLISTEN* = 0x00000011     # NCB LISTEN
-  NCBHANGUP* = 0x00000012     # NCB HANG UP
-  NCBSEND* = 0x00000014       # NCB SEND
-  NCBRECV* = 0x00000015       # NCB RECEIVE
-  NCBRECVANY* = 0x00000016    # NCB RECEIVE ANY
-  NCBCHAINSEND* = 0x00000017  # NCB CHAIN SEND
-  NCBDGSEND* = 0x00000020     # NCB SEND DATAGRAM
-  NCBDGRECV* = 0x00000021     # NCB RECEIVE DATAGRAM
-  NCBDGSENDBC* = 0x00000022   # NCB SEND BROADCAST DATAGRAM
-  NCBDGRECVBC* = 0x00000023   # NCB RECEIVE BROADCAST DATAGRAM
-  NCBADDNAME* = 0x00000030    # NCB ADD NAME
-  NCBDELNAME* = 0x00000031    # NCB DELETE NAME
-  NCBRESET* = 0x00000032      # NCB RESET
-  NCBASTAT* = 0x00000033      # NCB ADAPTER STATUS
-  NCBSSTAT* = 0x00000034      # NCB SESSION STATUS
-  NCBCANCEL* = 0x00000035     # NCB CANCEL
-  NCBADDGRNAME* = 0x00000036  # NCB ADD GROUP NAME
-  NCBENUM* = 0x00000037       # NCB ENUMERATE LANA NUMBERS
-  NCBUNLINK* = 0x00000070     # NCB UNLINK
-  NCBSENDNA* = 0x00000071     # NCB SEND NO ACK
-  NCBCHAINSENDNA* = 0x00000072 # NCB CHAIN SEND NO ACK
-  NCBLANSTALERT* = 0x00000073 # NCB LAN STATUS ALERT
-  NCBACTION* = 0x00000077     # NCB ACTION
-  NCBFINDNAME* = 0x00000078   # NCB FIND NAME
-  NCBTRACE* = 0x00000079      # NCB TRACE
-  ASYNCH* = 0x00000080        # high bit set = asynchronous
-                              # NCB Return codes
-  NRC_GOODRET* = 0x00000000   # good return
-                              # also returned when ASYNCH request accepted
-  NRC_BUFLEN* = 0x00000001    # illegal buffer length
-  NRC_ILLCMD* = 0x00000003    # illegal command
-  NRC_CMDTMO* = 0x00000005    # command timed out
-  NRC_INCOMP* = 0x00000006    # message incomplete, issue another command
-  NRC_BADDR* = 0x00000007     # illegal buffer address
-  NRC_SNUMOUT* = 0x00000008   # session number out of range
-  NRC_NORES* = 0x00000009     # no resource available
-  NRC_SCLOSED* = 0x0000000A   # session closed
-  NRC_CMDCAN* = 0x0000000B    # command cancelled
-  NRC_DUPNAME* = 0x0000000D   # duplicate name
-  NRC_NAMTFUL* = 0x0000000E   # name table full
-  NRC_ACTSES* = 0x0000000F    # no deletions, name has active sessions
-  NRC_LOCTFUL* = 0x00000011   # local session table full
-  NRC_REMTFUL* = 0x00000012   # remote session table full
-  NRC_ILLNN* = 0x00000013     # illegal name number
-  NRC_NOCALL* = 0x00000014    # no callname
-  NRC_NOWILD* = 0x00000015    # cannot put * in NCB_NAME
-  NRC_INUSE* = 0x00000016     # name in use on remote adapter
-  NRC_NAMERR* = 0x00000017    # name deleted
-  NRC_SABORT* = 0x00000018    # session ended abnormally
-  NRC_NAMCONF* = 0x00000019   # name conflict detected
-  NRC_IFBUSY* = 0x00000021    # interface busy, IRET before retrying
-  NRC_TOOMANY* = 0x00000022   # too many commands outstanding, retry later
-  NRC_BRIDGE* = 0x00000023    # NCB_lana_num field invalid
-  NRC_CANOCCR* = 0x00000024   # command completed while cancel occurring
-  NRC_CANCEL* = 0x00000026    # command not valid to cancel
-  NRC_DUPENV* = 0x00000030    # name defined by anther local process
-  NRC_ENVNOTDEF* = 0x00000034 # environment undefined. RESET required
-  NRC_OSRESNOTAV* = 0x00000035 # required OS resources exhausted
-  NRC_MAXAPPS* = 0x00000036   # max number of applications exceeded
-  NRC_NOSAPS* = 0x00000037    # no saps available for netbios
-  NRC_NORESOURCES* = 0x00000038 # requested resources are not available
-  NRC_INVADDRESS* = 0x00000039 # invalid ncb address or length > segment
-  NRC_INVDDID* = 0x0000003B   # invalid NCB DDID
-  NRC_LOCKFAIL* = 0x0000003C  # lock of user area failed
-  NRC_OPENERR* = 0x0000003F   # NETBIOS not loaded
-  NRC_SYSTEM* = 0x00000040    # system error
-  NRC_PENDING* = 0x000000FF   # asynchronous command is not yet finished
-                              # main user entry point for NetBIOS 3.0
-                              #   Usage: Result = Netbios( pncb ); 
-
-proc Netbios*(P: PNCB): char{.stdcall, dynlib: "netapi32.dll", 
-                              importc: "Netbios".}
-# implementation
diff --git a/lib/windows/psapi.nim b/lib/windows/psapi.nim
deleted file mode 100644
index fd1dcada8..000000000
--- a/lib/windows/psapi.nim
+++ /dev/null
@@ -1,202 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2009 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-#       PSAPI interface unit
-
-# Contains the definitions for the APIs provided by PSAPI.DLL
-
-import                        # Data structure templates
-  Windows
-
-const
-  psapiDll = "psapi.dll"
-
-proc EnumProcesses*(lpidProcess: ptr DWORD, cb: DWORD, 
-                    cbNeeded: ptr DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EnumProcesses".}
-proc EnumProcessModules*(hProcess: HANDLE, lphModule: ptr HMODULE, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EnumProcessModules".}
-
-proc GetModuleBaseNameA*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetModuleBaseNameA".}
-proc GetModuleBaseNameW*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetModuleBaseNameW".}
-when defined(winUnicode):
-  proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetModuleBaseNameW".}
-else:
-  proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetModuleBaseNameA".}
-
-proc GetModuleFileNameExA*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetModuleFileNameExA".}
-proc GetModuleFileNameExW*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetModuleFileNameExW".}
-when defined(winUnicode):
-  proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetModuleFileNameExW".}
-else:
-  proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetModuleFileNameExA".}
-
-type
-  MODULEINFO* {.final.} = object
-    lpBaseOfDll*: LPVOID
-    SizeOfImage*: DWORD
-    EntryPoint*: LPVOID
-  LPMODULEINFO* = ptr MODULEINFO
-
-proc GetModuleInformation*(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "GetModuleInformation".}
-proc EmptyWorkingSet*(hProcess: HANDLE): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EmptyWorkingSet".}
-proc QueryWorkingSet*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "QueryWorkingSet".}
-proc QueryWorkingSetEx*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "QueryWorkingSetEx".}
-proc InitializeProcessForWsWatch*(hProcess: HANDLE): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "InitializeProcessForWsWatch".}
-
-type
-  PSAPI_WS_WATCH_INFORMATION* {.final.} = object
-    FaultingPc*: LPVOID
-    FaultingVa*: LPVOID
-  PPSAPI_WS_WATCH_INFORMATION* = ptr PSAPI_WS_WATCH_INFORMATION
-
-proc GetWsChanges*(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "GetWsChanges".}
-
-proc GetMappedFileNameA*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetMappedFileNameA".}
-proc GetMappedFileNameW*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetMappedFileNameW".}
-when defined(winUnicode):
-  proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetMappedFileNameW".}
-else:
-  proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetMappedFileNameA".}
-
-proc EnumDeviceDrivers*(lpImageBase: LPVOID, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EnumDeviceDrivers".}
-
-proc GetDeviceDriverBaseNameA*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".}
-proc GetDeviceDriverBaseNameW*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".}
-when defined(winUnicode):
-  proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".}
-else:
-  proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".}
-
-proc GetDeviceDriverFileNameA*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".}
-proc GetDeviceDriverFileNameW*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".}
-when defined(winUnicode):
-  proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".}
-else:
-  proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".}
-
-type
-  PROCESS_MEMORY_COUNTERS* {.final.} = object
-    cb*: DWORD
-    PageFaultCount*: DWORD
-    PeakWorkingSetSize: SIZE_T
-    WorkingSetSize: SIZE_T
-    QuotaPeakPagedPoolUsage: SIZE_T
-    QuotaPagedPoolUsage: SIZE_T
-    QuotaPeakNonPagedPoolUsage: SIZE_T
-    QuotaNonPagedPoolUsage: SIZE_T
-    PagefileUsage: SIZE_T
-    PeakPagefileUsage: SIZE_T
-  PPROCESS_MEMORY_COUNTERS* = ptr PROCESS_MEMORY_COUNTERS
-
-type
-  PROCESS_MEMORY_COUNTERS_EX* {.final.} = object
-    cb*: DWORD
-    PageFaultCount*: DWORD
-    PeakWorkingSetSize: SIZE_T
-    WorkingSetSize: SIZE_T
-    QuotaPeakPagedPoolUsage: SIZE_T
-    QuotaPagedPoolUsage: SIZE_T
-    QuotaPeakNonPagedPoolUsage: SIZE_T
-    QuotaNonPagedPoolUsage: SIZE_T
-    PagefileUsage: SIZE_T
-    PeakPagefileUsage: SIZE_T
-    PrivateUsage: SIZE_T
-  PPROCESS_MEMORY_COUNTERS_EX* = ptr PROCESS_MEMORY_COUNTERS_EX
-
-proc GetProcessMemoryInfo*(hProcess: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "GetProcessMemoryInfo".}
-
-type
-  PERFORMANCE_INFORMATION* {.final.} = object
-    cb*: DWORD
-    CommitTotal: SIZE_T
-    CommitLimit: SIZE_T
-    CommitPeak: SIZE_T
-    PhysicalTotal: SIZE_T
-    PhysicalAvailable: SIZE_T
-    SystemCache: SIZE_T
-    KernelTotal: SIZE_T
-    KernelPaged: SIZE_T
-    KernelNonpaged: SIZE_T
-    PageSize: SIZE_T
-    HandleCount*: DWORD
-    ProcessCount*: DWORD
-    ThreadCount*: DWORD
-  PPERFORMANCE_INFORMATION* = ptr PERFORMANCE_INFORMATION
-  # Skip definition of PERFORMACE_INFORMATION...
-
-proc GetPerformanceInfo*(pPerformanceInformation: PPERFORMANCE_INFORMATION, cb: DWORD): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "GetPerformanceInfo".}
-
-type
-  ENUM_PAGE_FILE_INFORMATION* {.final.} = object
-    cb*: DWORD
-    Reserved*: DWORD
-    TotalSize: SIZE_T
-    TotalInUse: SIZE_T
-    PeakUsage: SIZE_T
-  PENUM_PAGE_FILE_INFORMATION* = ptr ENUM_PAGE_FILE_INFORMATION
-
-# Callback procedure
-type
-  PENUM_PAGE_FILE_CALLBACKW* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.}
-  PENUM_PAGE_FILE_CALLBACKA* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.}
-
-#TODO
-proc EnumPageFilesA*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EnumPageFilesA".}
-proc EnumPageFilesW*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall,
-    dynlib: psapiDll, importc: "EnumPageFilesW".}
-when defined(winUnicode):
-  proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall,
-      dynlib: psapiDll, importc: "EnumPageFilesW".}
-  type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.}
-else:
-  proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall,
-      dynlib: psapiDll, importc: "EnumPageFilesA".}
-  type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.}
-
-proc GetProcessImageFileNameA*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetProcessImageFileNameA".}
-proc GetProcessImageFileNameW*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-    dynlib: psapiDll, importc: "GetProcessImageFileNameW".}
-when defined(winUnicode):
-  proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetProcessImageFileNameW".}
-else:
-  proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
-      dynlib: psapiDll, importc: "GetProcessImageFileNameA".}
diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim
deleted file mode 100644
index 0f8bc5ea3..000000000
--- a/lib/windows/shellapi.nim
+++ /dev/null
@@ -1,863 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2006 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-{.deadCodeElim: on.}
-
-# leave out unused functions so the unit can be used on win2000 as well
-
-#+-------------------------------------------------------------------------
-#
-#  Microsoft Windows
-#  Copyright (c) Microsoft Corporation. All rights reserved.
-#
-#  File: shellapi.h
-#
-#  Header translation by Marco van de Voort for Free Pascal Platform
-#  SDK dl'ed January 2002
-#
-#--------------------------------------------------------------------------
-
-#
-#    shellapi.h -  SHELL.DLL functions, types, and definitions
-#    Copyright (c) Microsoft Corporation. All rights reserved.
-
-import
-  windows
-
-type
-  HDROP* = Handle
-  UINT_PTR* = ptr uint32
-  DWORD_PTR* = ptr DWORD
-  PHICON* = ptr HICON
-  PBool* = ptr bool
-  STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
-    cb*: DWORD
-    lpReserved*: LPTSTR
-    lpDesktop*: LPTSTR
-    lpTitle*: LPTSTR
-    dwX*: DWORD
-    dwY*: DWORD
-    dwXSize*: DWORD
-    dwYSize*: DWORD
-    dwXCountChars*: DWORD
-    dwYCountChars*: DWORD
-    dwFillAttribute*: DWORD
-    dwFlags*: DWORD
-    wShowWindow*: int16
-    cbReserved2*: int16
-    lpReserved2*: LPBYTE
-    hStdInput*: HANDLE
-    hStdOutput*: HANDLE
-    hStdError*: HANDLE
-
-  LPSTARTUPINFOW* = ptr STARTUPINFOW
-  PSTARTUPINFOW* = ptr STARTUPINFOW #unicode
-{.deprecated: [TSTARTUPINFOW: STARTUPINFOW].}
-
-proc DragQueryFileA*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
-    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFileW*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
-    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
-    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
-    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "DragQueryPoint".}
-proc DragFinish*(arg1: HDROP){.stdcall, dynlib: "shell32.dll",
-                               importc: "DragFinish".}
-proc DragAcceptFiles*(hwnd: HWND, arg2: bool){.stdcall, dynlib: "shell32.dll",
-    importc: "DragAcceptFiles".}
-proc ShellExecuteA*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
-                    lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
-proc ShellExecuteW*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
-                    lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
-proc ShellExecute*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
-                   lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
-proc ShellExecute*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
-                   lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
-proc FindExecutableA*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
-proc FindExecutableW*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
-proc FindExecutable*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
-proc FindExecutable*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
-    stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
-proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): PLPWSTR{.
-    stdcall, dynlib: "shell32.dll", importc: "CommandLineToArgvW".}
-proc ShellAboutA*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAboutW*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
-                  hIcon: HICON): int32{.stdcall, dynlib: "shell32.dll",
-                                        importc: "ShellAboutW".}
-proc ShellAbout*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAbout*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR, hIcon: HICON): int32{.
-    stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
-proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall,
-    dynlib: "shell32.dll", importc: "DuplicateIcon".}
-proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
-proc ExtractAssociatedIconW*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
-proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
-proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
-proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
-  # if(WINVER >= 0x0400)
-type                          # init with sizeof(DRAGINFO)
-  DRAGINFOA* {.final.} = object
-    uSize*: uint32
-    pt*: POINT
-    fNC*: bool
-    lpFileList*: LPSTR
-    grfKeyState*: DWORD
-
-  LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO)
-  DRAGINFOW* {.final.} = object
-    uSize*: uint32
-    pt*: POINT
-    fNC*: bool
-    lpFileList*: LPWSTR
-    grfKeyState*: DWORD
-
-  LPDRAGINFOW* = ptr DRAGINFOW
-{.deprecated: [TDRAGINFOA: DRAGINFOA, TDRAGINFOW: DRAGINFOW].}
-
-when defined(UNICODE):
-  type
-    DRAGINFO* = DRAGINFOW
-    LPDRAGINFO* = LPDRAGINFOW
-  {.deprecated: [TDRAGINFO: DRAGINFOW].}
-else:
-  type
-    DRAGINFO* = DRAGINFOA
-    LPDRAGINFO* = LPDRAGINFOA
-  {.deprecated: [TDRAGINFO: DRAGINFOW].}
-const
-  ABM_NEW* = 0x00000000
-  ABM_REMOVE* = 0x00000001
-  ABM_QUERYPOS* = 0x00000002
-  ABM_SETPOS* = 0x00000003
-  ABM_GETSTATE* = 0x00000004
-  ABM_GETTASKBARPOS* = 0x00000005
-  ABM_ACTIVATE* = 0x00000006  # lParam == TRUE/FALSE means activate/deactivate
-  ABM_GETAUTOHIDEBAR* = 0x00000007
-  ABM_SETAUTOHIDEBAR* = 0x00000008 # this can fail at any time.  MUST check the result
-                                   # lParam = TRUE/FALSE  Set/Unset
-                                   # uEdge = what edge
-  ABM_WINDOWPOSCHANGED* = 0x00000009
-  ABM_SETSTATE* = 0x0000000A
-  ABN_STATECHANGE* = 0x00000000 # these are put in the wparam of callback messages
-  ABN_POSCHANGED* = 0x00000001
-  ABN_FULLSCREENAPP* = 0x00000002
-  ABN_WINDOWARRANGE* = 0x00000003 # lParam == TRUE means hide
-                                  # flags for get state
-  ABS_AUTOHIDE* = 0x00000001
-  ABS_ALWAYSONTOP* = 0x00000002
-  ABE_LEFT* = 0
-  ABE_TOP* = 1
-  ABE_RIGHT* = 2
-  ABE_BOTTOM* = 3
-
-type
-  AppBarData* {.final.} = object
-    cbSize*: DWORD
-    hWnd*: HWND
-    uCallbackMessage*: uint32
-    uEdge*: uint32
-    rc*: RECT
-    lParam*: LPARAM           # message specific
-
-  PAPPBARDATA* = ptr AppBarData
-{.deprecated: [TAPPBARDATA: AppBarData].}
-
-proc SHAppBarMessage*(dwMessage: DWORD, pData: APPBARDATA): UINT_PTR{.stdcall,
-    dynlib: "shell32.dll", importc: "SHAppBarMessage".}
-  #
-  #  EndAppBar
-  #
-proc DoEnvironmentSubstA*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
-    dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
-    dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
-proc DoEnvironmentSubst*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
-    dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubst*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
-    dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
-  #Macro
-proc EIRESID*(x: int32): int32
-proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
-                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
-    dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
-                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
-    dynlib: "shell32.dll", importc: "ExtractIconExW".}
-proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32,
-                     phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
-    importc: "ExtractIconExA".}
-proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32,
-                     phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
-    importc: "ExtractIconExW".}
-proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
-                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
-    dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
-                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
-    dynlib: "shell32.dll", importc: "ExtractIconExW".}
-proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: var HICON,
-                    phiconSmall: var HIcon, nIcons: uint32): uint32{.stdcall,
-    dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32,
-                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: uint32): uint32{.
-    stdcall, dynlib: "shell32.dll", importc: "ExtractIconExW".}
-  #
-  # Shell File Operations
-  #
-  #ifndef FO_MOVE  //these need to be kept in sync with the ones in shlobj.h}
-const
-  FO_MOVE* = 0x00000001
-  FO_COPY* = 0x00000002
-  FO_DELETE* = 0x00000003
-  FO_RENAME* = 0x00000004
-  FOF_MULTIDESTFILES* = 0x00000001
-  FOF_CONFIRMMOUSE* = 0x00000002
-  FOF_SILENT* = 0x00000004    # don't create progress/report
-  FOF_RENAMEONCOLLISION* = 0x00000008
-  FOF_NOCONFIRMATION* = 0x00000010 # Don't prompt the user.
-  FOF_WANTMAPPINGHANDLE* = 0x00000020 # Fill in SHFILEOPSTRUCT.hNameMappings
-  FOF_ALLOWUNDO* = 0x00000040 # Must be freed using SHFreeNameMappings
-  FOF_FILESONLY* = 0x00000080 # on *.*, do only files
-  FOF_SIMPLEPROGRESS* = 0x00000100 # means don't show names of files
-  FOF_NOCONFIRMMKDIR* = 0x00000200 # don't confirm making any needed dirs
-  FOF_NOERRORUI* = 0x00000400 # don't put up error UI
-  FOF_NOCOPYSECURITYATTRIBS* = 0x00000800 # dont copy NT file Security Attributes
-  FOF_NORECURSION* = 0x00001000 # don't recurse into directories.
-                                #if (_WIN32_IE >= 0x0500)
-  FOF_NO_CONNECTED_ELEMENTS* = 0x00002000 # don't operate on connected elements.
-  FOF_WANTNUKEWARNING* = 0x00004000 # during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
-                                    #endif
-                                    #if (_WIN32_WINNT >= 0x0501)
-  FOF_NORECURSEREPARSE* = 0x00008000 # treat reparse points as objects, not containers
-                                     #endif
-
-type
-  FILEOP_FLAGS* = int16
-
-const
-  PO_DELETE* = 0x00000013     # printer is being deleted
-  PO_RENAME* = 0x00000014     # printer is being renamed
-  PO_PORTCHANGE* = 0x00000020 # port this printer connected to is being changed
-                              # if this id is set, the strings received by
-                              # the copyhook are a doubly-null terminated
-                              # list of strings.  The first is the printer
-                              # name and the second is the printer port.
-  PO_REN_PORT* = 0x00000034   # PO_RENAME and PO_PORTCHANGE at same time.
-                              # no POF_ flags currently defined
-
-type
-  PRINTEROP_FLAGS* = int16 #endif}
-                           # FO_MOVE
-                           # implicit parameters are:
-                           #      if pFrom or pTo are unqualified names the current directories are
-                           #      taken from the global current drive/directory settings managed
-                           #      by Get/SetCurrentDrive/Directory
-                           #
-                           #      the global confirmation settings
-                           # only used if FOF_SIMPLEPROGRESS
-
-type
-  SHFILEOPSTRUCTA* {.final.} = object
-    hwnd*: HWND
-    wFunc*: uint32
-    pFrom*: LPCSTR
-    pTo*: LPCSTR
-    fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: bool
-    hNameMappings*: LPVOID
-    lpszProgressTitle*: LPCSTR # only used if FOF_SIMPLEPROGRESS
-
-  LPSHFILEOPSTRUCTA* = ptr SHFILEOPSTRUCTA
-  SHFILEOPSTRUCTW* {.final.} = object
-    hwnd*: HWND
-    wFunc*: uint32
-    pFrom*: LPCWSTR
-    pTo*: LPCWSTR
-    fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: bool
-    hNameMappings*: LPVOID
-    lpszProgressTitle*: LPCWSTR
-
-  LPSHFILEOPSTRUCTW* = ptr SHFILEOPSTRUCTW
-{.deprecated: [TSHFILEOPSTRUCTA: SHFILEOPSTRUCTA,
-              TSHFILEOPSTRUCTW: SHFILEOPSTRUCTW].}
-
-when defined(UNICODE):
-  type
-    SHFILEOPSTRUCT* = SHFILEOPSTRUCTW
-    LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTW
-  {.deprecated: [TSHFILEOPSTRUCT: SHFILEOPSTRUCTW].}
-else:
-  type
-    SHFILEOPSTRUCT* = SHFILEOPSTRUCTA
-    LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTA
-  {.deprecated: [TSHFILEOPSTRUCT: SHFILEOPSTRUCTA].}
-
-proc SHFileOperationA*(lpFileOp: LPSHFILEOPSTRUCTA): int32{.stdcall,
-    dynlib: "shell32.dll", importc: "SHFileOperationA".}
-proc SHFileOperationW*(lpFileOp: LPSHFILEOPSTRUCTW): int32{.stdcall,
-    dynlib: "shell32.dll", importc: "SHFileOperationW".}
-proc SHFileOperation*(lpFileOp: LPSHFILEOPSTRUCTA): int32{.stdcall,
-    dynlib: "shell32.dll", importc: "SHFileOperationA".}
-proc SHFileOperation*(lpFileOp: LPSHFILEOPSTRUCTW): int32{.stdcall,
-    dynlib: "shell32.dll", importc: "SHFileOperationW".}
-proc SHFreeNameMappings*(hNameMappings: Handle){.stdcall,
-    dynlib: "shell32.dll", importc: "SHFreeNameMappings".}
-type
-  SHNAMEMAPPINGA* {.final.} = object
-    pszOldPath*: LPSTR
-    pszNewPath*: LPSTR
-    cchOldPath*: int32
-    cchNewPath*: int32
-
-  LPSHNAMEMAPPINGA* = ptr SHNAMEMAPPINGA
-  SHNAMEMAPPINGW* {.final.} = object
-    pszOldPath*: LPWSTR
-    pszNewPath*: LPWSTR
-    cchOldPath*: int32
-    cchNewPath*: int32
-
-  LPSHNAMEMAPPINGW* = ptr SHNAMEMAPPINGW
-{.deprecated: [TSHNAMEMAPPINGA: SHNAMEMAPPINGA,
-              TSHNAMEMAPPINGW: SHNAMEMAPPINGW].}
-
-when not(defined(UNICODE)):
-  type
-    SHNAMEMAPPING* = SHNAMEMAPPINGW
-    LPSHNAMEMAPPING* = LPSHNAMEMAPPINGW
-  {.deprecated: [TSHNAMEMAPPING: SHNAMEMAPPINGW].}
-else:
-  type
-    SHNAMEMAPPING* = SHNAMEMAPPINGA
-    LPSHNAMEMAPPING* = LPSHNAMEMAPPINGA
-  {.deprecated: [TSHNAMEMAPPING: SHNAMEMAPPINGA].}
-#
-# End Shell File Operations
-#
-#
-#  Begin ShellExecuteEx and family
-#
-# ShellExecute() and ShellExecuteEx() error codes
-# regular WinExec() codes
-
-const
-  SE_ERR_FNF* = 2             # file not found
-  SE_ERR_PNF* = 3             # path not found
-  SE_ERR_ACCESSDENIED* = 5    # access denied
-  SE_ERR_OOM* = 8             # out of memory
-  SE_ERR_DLLNOTFOUND* = 32    # endif   WINVER >= 0x0400
-                              # error values for ShellExecute() beyond the regular WinExec() codes
-  SE_ERR_SHARE* = 26
-  SE_ERR_ASSOCINCOMPLETE* = 27
-  SE_ERR_DDETIMEOUT* = 28
-  SE_ERR_DDEFAIL* = 29
-  SE_ERR_DDEBUSY* = 30
-  SE_ERR_NOASSOC* = 31        #if(WINVER >= 0x0400)}
-                              # Note CLASSKEY overrides CLASSNAME
-  SEE_MASK_CLASSNAME* = 0x00000001
-  SEE_MASK_CLASSKEY* = 0x00000003 # Note INVOKEIDLIST overrides IDLIST
-  SEE_MASK_IDLIST* = 0x00000004
-  SEE_MASK_INVOKEIDLIST* = 0x0000000C
-  SEE_MASK_ICON* = 0x00000010
-  SEE_MASK_HOTKEY* = 0x00000020
-  SEE_MASK_NOCLOSEPROCESS* = 0x00000040
-  SEE_MASK_CONNECTNETDRV* = 0x00000080
-  SEE_MASK_FLAG_DDEWAIT* = 0x00000100
-  SEE_MASK_DOENVSUBST* = 0x00000200
-  SEE_MASK_FLAG_NO_UI* = 0x00000400
-  SEE_MASK_UNICODE* = 0x00004000
-  SEE_MASK_NO_CONSOLE* = 0x00008000
-  SEE_MASK_ASYNCOK* = 0x00100000
-  SEE_MASK_HMONITOR* = 0x00200000 #if (_WIN32_IE >= 0x0500)
-  SEE_MASK_NOQUERYCLASSSTORE* = 0x01000000
-  SEE_MASK_WAITFORINPUTIDLE* = 0x02000000 #endif  (_WIN32_IE >= 0x500)
-                                          #if (_WIN32_IE >= 0x0560)
-  SEE_MASK_FLAG_LOG_USAGE* = 0x04000000 #endif
-                                        # (_WIN32_IE >= 0x560)
-
-type
-  SHELLEXECUTEINFOA* {.final.} = object
-    cbSize*: DWORD
-    fMask*: ULONG
-    hwnd*: HWND
-    lpVerb*: LPCSTR
-    lpFile*: LPCSTR
-    lpParameters*: LPCSTR
-    lpDirectory*: LPCSTR
-    nShow*: int32
-    hInstApp*: HINST
-    lpIDList*: LPVOID
-    lpClass*: LPCSTR
-    hkeyClass*: HKEY
-    dwHotKey*: DWORD
-    hMonitor*: HANDLE         # also: hIcon
-    hProcess*: HANDLE
-
-  LPSHELLEXECUTEINFOA* = ptr SHELLEXECUTEINFOA
-  SHELLEXECUTEINFOW* {.final.} = object
-    cbSize*: DWORD
-    fMask*: ULONG
-    hwnd*: HWND
-    lpVerb*: LPCWSTR
-    lpFile*: LPCWSTR
-    lpParameters*: LPCWSTR
-    lpDirectory*: LPCWSTR
-    nShow*: int32
-    hInstApp*: HINST
-    lpIDList*: LPVOID
-    lpClass*: LPCWSTR
-    hkeyClass*: HKEY
-    dwHotKey*: DWORD
-    hMonitor*: HANDLE         # also: hIcon
-    hProcess*: HANDLE
-
-  LPSHELLEXECUTEINFOW* = ptr SHELLEXECUTEINFOW
-{.deprecated: [TSHELLEXECUTEINFOA: SHELLEXECUTEINFOA,
-              TSHELLEXECUTEINFOW: SHELLEXECUTEINFOW].}
-
-when defined(UNICODE):
-  type
-    SHELLEXECUTEINFO* = SHELLEXECUTEINFOW
-    LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOW
-  {.deprecated: [TSHELLEXECUTEINFO: SHELLEXECUTEINFOW].}
-else:
-  type
-    SHELLEXECUTEINFO* = SHELLEXECUTEINFOA
-    LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOA
-  {.deprecated: [TSHELLEXECUTEINFO: SHELLEXECUTEINFOA].}
-
-proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc WinExecErrorA*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
-                    lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
-    importc: "WinExecErrorA".}
-proc WinExecErrorW*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
-                    lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
-    importc: "WinExecErrorW".}
-proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
-                   lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
-                                        importc: "WinExecErrorA".}
-proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
-                   lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
-    importc: "WinExecErrorW".}
-type
-  SHCREATEPROCESSINFOW* {.final.} = object
-    cbSize*: DWORD
-    fMask*: ULONG
-    hwnd*: HWND
-    pszFile*: LPCWSTR
-    pszParameters*: LPCWSTR
-    pszCurrentDirectory*: LPCWSTR
-    hUserToken*: HANDLE
-    lpProcessAttributes*: LPSECURITY_ATTRIBUTES
-    lpThreadAttributes*: LPSECURITY_ATTRIBUTES
-    bInheritHandles*: bool
-    dwCreationFlags*: DWORD
-    lpStartupInfo*: LPSTARTUPINFOW
-    lpProcessInformation*: LPPROCESS_INFORMATION
-
-  PSHCREATEPROCESSINFOW* = ptr SHCREATEPROCESSINFOW
-{.deprecated: [TSHCREATEPROCESSINFOW: SHCREATEPROCESSINFOW].}
-
-proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHCreateProcessAsUserW".}
-  #
-  #  End ShellExecuteEx and family }
-  #
-  #
-  # RecycleBin
-  #
-  # struct for query recycle bin info
-type
-  SHQUERYRBINFO* {.final.} = object
-    cbSize*: DWORD
-    i64Size*: int64
-    i64NumItems*: int64
-
-  LPSHQUERYRBINFO* = ptr SHQUERYRBINFO # flags for SHEmptyRecycleBin
-{.deprecated: [TSHQUERYRBINFO: SHQUERYRBINFO].}
-
-const
-  SHERB_NOCONFIRMATION* = 0x00000001
-  SHERB_NOPROGRESSUI* = 0x00000002
-  SHERB_NOSOUND* = 0x00000004
-
-proc SHQueryRecycleBinA*(pszRootPath: LPCSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinA".}
-proc SHQueryRecycleBinW*(pszRootPath: LPCWSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinW".}
-proc SHQueryRecycleBin*(pszRootPath: LPCSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinA".}
-proc SHQueryRecycleBin*(pszRootPath: LPCWSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinW".}
-proc SHEmptyRecycleBinA*(hwnd: HWND, pszRootPath: LPCSTR, dwFlags: DWORD): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinA".}
-proc SHEmptyRecycleBinW*(hwnd: HWND, pszRootPath: LPCWSTR, dwFlags: DWORD): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinW".}
-proc SHEmptyRecycleBin*(hwnd: HWND, pszRootPath: LPCSTR, dwFlags: DWORD): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinA".}
-proc SHEmptyRecycleBin*(hwnd: HWND, pszRootPath: LPCWSTR, dwFlags: DWORD): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinW".}
-  #
-  # end of RecycleBin
-  #
-  #
-  # Tray notification definitions
-  #
-type
-  NOTIFYICONDATAA* {.final.} = object
-    cbSize*: DWORD
-    hWnd*: HWND
-    uID*: uint32
-    uFlags*: uint32
-    uCallbackMessage*: uint32
-    hIcon*: HICON
-    szTip*: array[0..127, char]
-    dwState*: DWORD
-    dwStateMask*: DWORD
-    szInfo*: array[0..255, char]
-    uTimeout*: uint32           # also: uVersion
-    szInfoTitle*: array[0..63, char]
-    dwInfoFlags*: DWORD
-    guidItem*: GUID
-
-  PNOTIFYICONDATAA* = ptr NOTIFYICONDATAA
-  NOTIFYICONDATAW* {.final.} = object
-    cbSize*: DWORD
-    hWnd*: HWND
-    uID*: uint32
-    uFlags*: uint32
-    uCallbackMessage*: uint32
-    hIcon*: HICON
-    szTip*: array[0..127, Wchar]
-    dwState*: DWORD
-    dwStateMask*: DWORD
-    szInfo*: array[0..255, Wchar]
-    uTimeout*: uint32           # also uVersion : UINT
-    szInfoTitle*: array[0..63, char]
-    dwInfoFlags*: DWORD
-    guidItem*: GUID
-
-  PNOTIFYICONDATAW* = ptr NOTIFYICONDATAW
-{.deprecated: [TNOTIFYICONDATAA: NOTIFYICONDATAA,
-              TNOTIFYICONDATAW: NOTIFYICONDATAW].}
-
-when defined(UNICODE):
-  type
-    NOTIFYICONDATA* = NOTIFYICONDATAW
-    PNOTIFYICONDATA* = PNOTIFYICONDATAW
-  {.deprecated: [TNOTIFYICONDATA: NOTIFYICONDATAW].}
-else:
-  type
-    NOTIFYICONDATA* = NOTIFYICONDATAA
-    PNOTIFYICONDATA* = PNOTIFYICONDATAA
-  {.deprecated: [TNOTIFYICONDATA: NOTIFYICONDATAA].}
-const
-  NIN_SELECT* = WM_USER + 0
-  NINF_KEY* = 0x00000001
-  NIN_KEYSELECT* = NIN_SELECT or NINF_KEY
-  NIN_BALLOONSHOW* = WM_USER + 2
-  NIN_BALLOONHIDE* = WM_USER + 3
-  NIN_BALLOONTIMEOUT* = WM_USER + 4
-  NIN_BALLOONUSERCLICK* = WM_USER + 5
-  NIM_ADD* = 0x00000000
-  NIM_MODIFY* = 0x00000001
-  NIM_DELETE* = 0x00000002
-  NIM_SETFOCUS* = 0x00000003
-  NIM_SETVERSION* = 0x00000004
-  NOTIFYICON_VERSION* = 3
-  NIF_MESSAGE* = 0x00000001
-  NIF_ICON* = 0x00000002
-  NIF_TIP* = 0x00000004
-  NIF_STATE* = 0x00000008
-  NIF_INFO* = 0x00000010
-  NIF_GUID* = 0x00000020
-  NIS_HIDDEN* = 0x00000001
-  NIS_SHAREDICON* = 0x00000002 # says this is the source of a shared icon
-                               # Notify Icon Infotip flags
-  NIIF_NONE* = 0x00000000     # icon flags are mutually exclusive
-                              # and take only the lowest 2 bits
-  NIIF_INFO* = 0x00000001
-  NIIF_WARNING* = 0x00000002
-  NIIF_ERROR* = 0x00000003
-  NIIF_ICON_MASK* = 0x0000000F
-  NIIF_NOSOUND* = 0x00000010
-
-proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
-  #
-  #       The SHGetFileInfo API provides an easy way to get attributes
-  #       for a file given a pathname.
-  #
-  #         PARAMETERS
-  #
-  #           pszPath              file name to get info about
-  #           dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
-  #           psfi                 place to return file info
-  #           cbFileInfo           size of structure
-  #           uFlags               flags
-  #
-  #         RETURN
-  #           TRUE if things worked
-  #
-  # out: icon
-  # out: icon index
-  # out: SFGAO_ flags
-  # out: display name (or path)
-  # out: type name
-type
-  SHFILEINFOA* {.final.} = object
-    hIcon*: HICON             # out: icon
-    iIcon*: int32             # out: icon index
-    dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, char] # out: display name (or path)
-    szTypeName*: array[0..79, char] # out: type name
-
-  PSHFILEINFOA* = ptr SHFILEINFOA
-  SHFILEINFOW* {.final.} = object
-    hIcon*: HICON             # out: icon
-    iIcon*: int32             # out: icon index
-    dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, Wchar] # out: display name (or path)
-    szTypeName*: array[0..79, Wchar] # out: type name
-
-  PSHFILEINFOW* = ptr SHFILEINFOW
-{.deprecated: [TSHFILEINFOA: SHFILEINFOA, TSHFILEINFOW: SHFILEINFOW].}
-
-when defined(UNICODE):
-  type
-    SHFILEINFO* = SHFILEINFOW
-    pFILEINFO* = SHFILEINFOW
-  {.deprecated: [TSHFILEINFO: SHFILEINFOW].}
-else:
-  type
-    SHFILEINFO* = SHFILEINFOA
-    pFILEINFO* = SHFILEINFOA
-  {.deprecated: [TSHFILEINFO: SHFILEINFOA].}
-# NOTE: This is also in shlwapi.h.  Please keep in synch.
-
-const
-  SHGFI_ICON* = 0x00000100    # get Icon
-  SHGFI_DISPLAYNAME* = 0x00000200 # get display name
-  SHGFI_TYPENAME* = 0x00000400 # get type name
-  SHGFI_ATTRIBUTES* = 0x00000800 # get attributes
-  SHGFI_ICONLOCATION* = 0x00001000 # get icon location
-  SHGFI_EXETYPE* = 0x00002000 # return exe type
-  SHGFI_SYSICONINDEX* = 0x00004000 # get system icon index
-  SHGFI_LINKOVERLAY* = 0x00008000 # put a link overlay on icon
-  SHGFI_SELECTED* = 0x00010000 # show icon in selected state
-  SHGFI_ATTR_SPECIFIED* = 0x00020000 # get only specified attributes
-  SHGFI_LARGEICON* = 0x00000000 # get large icon
-  SHGFI_SMALLICON* = 0x00000001 # get small icon
-  SHGFI_OPENICON* = 0x00000002 # get open icon
-  SHGFI_SHELLICONSIZE* = 0x00000004 # get shell size icon
-  SHGFI_PIDL* = 0x00000008    # pszPath is a pidl
-  SHGFI_USEFILEATTRIBUTES* = 0x00000010 # use passed dwFileAttribute
-  SHGFI_ADDOVERLAYS* = 0x00000020 # apply the appropriate overlays
-  SHGFI_OVERLAYINDEX* = 0x00000040 # Get the index of the overlay
-                                   # in the upper 8 bits of the iIcon
-
-proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
-proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: PSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
-proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
-proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: var SHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
-proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: var SHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
-proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: var SHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
-proc SHGetFileInfo*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                    psfi: var SHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
-proc SHGetDiskFreeSpaceExA*(pszDirectoryName: LPCSTR,
-                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                            pulTotalNumberOfBytes: PULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
-proc SHGetDiskFreeSpaceExW*(pszDirectoryName: LPCWSTR,
-                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                            pulTotalNumberOfBytes: PULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
-proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCSTR,
-                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                           pulTotalNumberOfBytes: PULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
-proc SHGetDiskFreeSpace*(pszDirectoryName: LPCSTR,
-                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                         pulTotalNumberOfBytes: PULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
-proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCWSTR,
-                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                           pulTotalNumberOfBytes: PULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
-proc SHGetDiskFreeSpace*(pszDirectoryName: LPCWSTR,
-                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
-                         pulTotalNumberOfBytes: PULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
-proc SHGetNewLinkInfoA*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
-proc SHGetNewLinkInfoW*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
-proc SHGetNewLinkInfo*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
-proc SHGetNewLinkInfo*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
-const
-  SHGNLI_PIDL* = 0x00000001   # pszLinkTo is a pidl
-  SHGNLI_PREFIXNAME* = 0x00000002 # Make name "Shortcut to xxx"
-  SHGNLI_NOUNIQUE* = 0x00000004 # don't do the unique name generation
-  SHGNLI_NOLNK* = 0x00000008  # don't add ".lnk" extension
-  PRINTACTION_OPEN* = 0
-  PRINTACTION_PROPERTIES* = 1
-  PRINTACTION_NETINSTALL* = 2
-  PRINTACTION_NETINSTALLLINK* = 3
-  PRINTACTION_TESTPAGE* = 4
-  PRINTACTION_OPENNETPRN* = 5
-  PRINTACTION_DOCUMENTDEFAULTS* = 6
-  PRINTACTION_SERVERPROPERTIES* = 7
-
-proc SHInvokePrinterCommandA*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
-                              lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommandW*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
-                              lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
-proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
-                             lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
-                             lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
-    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
-proc SHLoadNonloadedIconOverlayIdentifiers*(): HResult{.stdcall,
-    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
-proc SHIsFileAvailableOffline*(pwszPath: LPCWSTR, pdwStatus: LPDWORD): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHIsFileAvailableOffline".}
-const
-  OFFLINE_STATUS_LOCAL* = 0x00000001 # If open, it's open locally
-  OFFLINE_STATUS_REMOTE* = 0x00000002 # If open, it's open remotely
-  OFFLINE_STATUS_INCOMPLETE* = 0x00000004 # The local copy is currently incomplete.
-                                          # The file will not be available offline
-                                          # until it has been synchronized.
-                                          #  sets the specified path to use the string resource
-                                          #  as the UI instead of the file system name
-
-proc SHSetLocalizedName*(pszPath: LPWSTR, pszResModule: LPCWSTR, idsRes: int32): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHSetLocalizedName".}
-proc SHEnumerateUnreadMailAccountsA*(hKeyUser: HKEY, dwIndex: DWORD,
-                                     pszMailAddress: LPSTR,
-                                     cchMailAddress: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsA".}
-proc SHEnumerateUnreadMailAccountsW*(hKeyUser: HKEY, dwIndex: DWORD,
-                                     pszMailAddress: LPWSTR,
-                                     cchMailAddress: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsW".}
-proc SHEnumerateUnreadMailAccounts*(hKeyUser: HKEY, dwIndex: DWORD,
-                                    pszMailAddress: LPWSTR,
-                                    cchMailAddress: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsW".}
-proc SHGetUnreadMailCountA*(hKeyUser: HKEY, pszMailAddress: LPCSTR,
-                            pdwCount: PDWORD, pFileTime: PFILETIME,
-                            pszShellExecuteCommand: LPSTR,
-                            cchShellExecuteCommand: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetUnreadMailCountA".}
-proc SHGetUnreadMailCountW*(hKeyUser: HKEY, pszMailAddress: LPCWSTR,
-                            pdwCount: PDWORD, pFileTime: PFILETIME,
-                            pszShellExecuteCommand: LPWSTR,
-                            cchShellExecuteCommand: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetUnreadMailCountW".}
-proc SHGetUnreadMailCount*(hKeyUser: HKEY, pszMailAddress: LPCSTR,
-                           pdwCount: PDWORD, pFileTime: PFILETIME,
-                           pszShellExecuteCommand: LPSTR,
-                           cchShellExecuteCommand: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetUnreadMailCountA".}
-proc SHGetUnreadMailCount*(hKeyUser: HKEY, pszMailAddress: LPCWSTR,
-                           pdwCount: PDWORD, pFileTime: PFILETIME,
-                           pszShellExecuteCommand: LPWSTR,
-                           cchShellExecuteCommand: int32): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHGetUnreadMailCountW".}
-proc SHSetUnreadMailCountA*(pszMailAddress: LPCSTR, dwCount: DWORD,
-                            pszShellExecuteCommand: LPCSTR): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHSetUnreadMailCountA".}
-proc SHSetUnreadMailCountW*(pszMailAddress: LPCWSTR, dwCount: DWORD,
-                            pszShellExecuteCommand: LPCWSTR): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHSetUnreadMailCountW".}
-proc SHSetUnreadMailCount*(pszMailAddress: LPCSTR, dwCount: DWORD,
-                           pszShellExecuteCommand: LPCSTR): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHSetUnreadMailCountA".}
-proc SHSetUnreadMailCount*(pszMailAddress: LPCWSTR, dwCount: DWORD,
-                           pszShellExecuteCommand: LPCWSTR): HRESULT{.stdcall,
-    dynlib: "shell32.dll", importc: "SHSetUnreadMailCountW".}
-proc SHGetImageList*(iImageList: int32, riid: TIID, ppvObj: ptr pointer): HRESULT{.
-    stdcall, dynlib: "shell32.dll", importc: "SHGetImageList".}
-const
-  SHIL_LARGE* = 0             # normally 32x32
-  SHIL_SMALL* = 1             # normally 16x16
-  SHIL_EXTRALARGE* = 2
-  SHIL_SYSSMALL* = 3          # like SHIL_SMALL, but tracks system small icon metric correctly
-  SHIL_LAST* = SHIL_SYSSMALL
-
-# implementation
-
-proc EIRESID(x: int32): int32 =
-  result = -x
diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim
deleted file mode 100644
index 99cdf6cf5..000000000
--- a/lib/windows/shfolder.nim
+++ /dev/null
@@ -1,93 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2006 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-# ---------------------------------------------------------------------
-#  shfolder.dll is distributed standard with IE5.5, so it should ship
-#  with 2000/XP or higher but is likely to be installed on NT/95/98 or
-#  ME as well.  It works on all these systems.
-#
-#  The info found here is also in the registry:
-#  HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\
-#  HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\
-#
-#  Note that not all CSIDL_* constants are supported by shlfolder.dll,
-#  they should be supported by the shell32.dll, though again not on all
-#  systems.
-#  ---------------------------------------------------------------------
-
-{.deadCodeElim: on.}
-
-import 
-  windows
-
-const 
-  LibName* = "SHFolder.dll"
-
-const 
-  CSIDL_PROGRAMS* = 0x00000002 # %SYSTEMDRIVE%\Program Files                                      
-  CSIDL_PERSONAL* = 0x00000005 # %USERPROFILE%\My Documents                                       
-  CSIDL_FAVORITES* = 0x00000006 # %USERPROFILE%\Favorites                                          
-  CSIDL_STARTUP* = 0x00000007 # %USERPROFILE%\Start menu\Programs\Startup                        
-  CSIDL_RECENT* = 0x00000008  # %USERPROFILE%\Recent                                             
-  CSIDL_SENDTO* = 0x00000009  # %USERPROFILE%\Sendto                                             
-  CSIDL_STARTMENU* = 0x0000000B # %USERPROFILE%\Start menu                                         
-  CSIDL_MYMUSIC* = 0x0000000D # %USERPROFILE%\Documents\My Music                                 
-  CSIDL_MYVIDEO* = 0x0000000E # %USERPROFILE%\Documents\My Videos                                
-  CSIDL_DESKTOPDIRECTORY* = 0x00000010 # %USERPROFILE%\Desktop                                            
-  CSIDL_NETHOOD* = 0x00000013 # %USERPROFILE%\NetHood                                            
-  CSIDL_TEMPLATES* = 0x00000015 # %USERPROFILE%\Templates                                          
-  CSIDL_COMMON_STARTMENU* = 0x00000016 # %PROFILEPATH%\All users\Start menu                               
-  CSIDL_COMMON_PROGRAMS* = 0x00000017 # %PROFILEPATH%\All users\Start menu\Programs                      
-  CSIDL_COMMON_STARTUP* = 0x00000018 # %PROFILEPATH%\All users\Start menu\Programs\Startup              
-  CSIDL_COMMON_DESKTOPDIRECTORY* = 0x00000019 # %PROFILEPATH%\All users\Desktop                                  
-  CSIDL_APPDATA* = 0x0000001A # %USERPROFILE%\Application Data (roaming)                         
-  CSIDL_PRINTHOOD* = 0x0000001B # %USERPROFILE%\Printhood                                          
-  CSIDL_LOCAL_APPDATA* = 0x0000001C # %USERPROFILE%\Local Settings\Application Data (non roaming)      
-  CSIDL_COMMON_FAVORITES* = 0x0000001F # %PROFILEPATH%\All users\Favorites                                
-  CSIDL_INTERNET_CACHE* = 0x00000020 # %USERPROFILE%\Local Settings\Temporary Internet Files            
-  CSIDL_COOKIES* = 0x00000021 # %USERPROFILE%\Cookies                                            
-  CSIDL_HISTORY* = 0x00000022 # %USERPROFILE%\Local settings\History                             
-  CSIDL_COMMON_APPDATA* = 0x00000023 # %PROFILESPATH%\All Users\Application Data                        
-  CSIDL_WINDOWS* = 0x00000024 # %SYSTEMROOT%                                                     
-  CSIDL_SYSTEM* = 0x00000025  # %SYSTEMROOT%\SYSTEM32 (may be system on 95/98/ME)                
-  CSIDL_PROGRAM_FILES* = 0x00000026 # %SYSTEMDRIVE%\Program Files                                      
-  CSIDL_MYPICTURES* = 0x00000027 # %USERPROFILE%\My Documents\My Pictures                           
-  CSIDL_PROFILE* = 0x00000028 # %USERPROFILE%                                                    
-  CSIDL_PROGRAM_FILES_COMMON* = 0x0000002B # %SYSTEMDRIVE%\Program Files\Common                               
-  CSIDL_COMMON_TEMPLATES* = 0x0000002D # %PROFILEPATH%\All Users\Templates                                
-  CSIDL_COMMON_DOCUMENTS* = 0x0000002E # %PROFILEPATH%\All Users\Documents                                
-  CSIDL_COMMON_ADMINTOOLS* = 0x0000002F # %PROFILEPATH%\All Users\Start Menu\Programs\Administrative Tools 
-  CSIDL_ADMINTOOLS* = 0x00000030 # %USERPROFILE%\Start Menu\Programs\Administrative Tools           
-  CSIDL_COMMON_MUSIC* = 0x00000035 # %PROFILEPATH%\All Users\Documents\my music                       
-  CSIDL_COMMON_PICTURES* = 0x00000036 # %PROFILEPATH%\All Users\Documents\my pictures                    
-  CSIDL_COMMON_VIDEO* = 0x00000037 # %PROFILEPATH%\All Users\Documents\my videos                      
-  CSIDL_CDBURN_AREA* = 0x0000003B # %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning 
-  CSIDL_PROFILES* = 0x0000003E # %PROFILEPATH%                                                    
-  CSIDL_FLAG_CREATE* = 0x00008000 # (force creation of requested folder if it doesn't exist yet)     
-                                  # Original entry points 
-
-proc SHGetFolderPathA*(Ahwnd: HWND, Csidl: int, Token: Handle, Flags: DWord, 
-                       Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
-    importc: "SHGetFolderPathA".}
-proc SHGetFolderPathW*(Ahwnd: HWND, Csidl: int, Token: Handle, Flags: DWord, 
-                       Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
-    importc: "SHGetFolderPathW".}
-proc SHGetFolderPath*(Ahwnd: HWND, Csidl: int, Token: Handle, Flags: DWord, 
-                      Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
-    importc: "SHGetFolderPathA".}
-type 
-  PFNSHGetFolderPathA* = proc (Ahwnd: HWND, Csidl: int, Token: Handle, 
-                               Flags: DWord, Path: cstring): HRESULT{.stdcall.}
-  PFNSHGetFolderPathW* = proc (Ahwnd: HWND, Csidl: int, Token: Handle, 
-                               Flags: DWord, Path: cstring): HRESULT{.stdcall.}
-  PFNSHGetFolderPath* = PFNSHGetFolderPathA
-  
-{.deprecated: [TSHGetFolderPathA: PFNSHGetFolderPathA,
-              TSHGetFolderPathW: PFNSHGetFolderPathW,
-              TSHGetFolderPath: SHGetFolderPathA].}
diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim
deleted file mode 100644
index bddb4cef7..000000000
--- a/lib/windows/windows.nim
+++ /dev/null
@@ -1,23662 +0,0 @@
-#

-#

-#            Nim's Runtime Library

-#        (c) Copyright 2010 Andreas Rumpf

-#

-#    See the file "copying.txt", included in this

-#    distribution, for details about the copyright.

-#

-

-## Define ``winUnicode`` before importing this module for the

-## Unicode version.

-

-{.deadCodeElim: on.}

-{.push gcsafe.}

-type

-  WideChar* = uint16

-  PWideChar* = ptr uint16

-

-type  # WinNT.h -- Defines the 32-Bit Windows types and constants

-  SHORT* = int16

-  LONG* = int32

-  # UNICODE (Wide Character) types

-  PWCHAR* = PWideChar

-  LPWCH* = PWideChar

-  PWCH* = PWideChar

-  LPCWCH* = PWideChar

-  PCWCH* = PWideChar

-  NWPSTR* = PWideChar

-  LPWSTR* = PWideChar

-  LPCWSTR* = PWideChar

-  PCWSTR* = PWideChar

-  # ANSI (Multi-byte Character) types

-  LPCH* = cstring

-  PCH* = cstring

-  LPCCH* = cstring

-  PCCH* = cstring

-  LPSTR* = cstring

-  PSTR* = cstring

-  LPCSTR* = cstring

-  PCSTR* = cstring

-

-type  # BaseTsd.h -- Type definitions for the basic sized types

-      # Give here only the bare minimum, to be expanded as needs arise

-  LONG32* = int32

-  ULONG32* = int32

-  DWORD32* = int32

-  LONG64* = int64

-  ULONG64* = int64

-  DWORD64* = int64

-  PDWORD64* = ptr DWORD64

-  # int32 on Win32, int64 on Win64

-  INT_PTR* = ByteAddress

-  UINT_PTR* = ByteAddress

-  LONG_PTR* = ByteAddress

-  ULONG_PTR* = ByteAddress

-  SIZE_T* = ByteAddress

-  SSIZE_T* = ByteAddress

-  DWORD_PTR* = ByteAddress

-  # Thread affinity

-  KAFFINITY* = ByteAddress

-  PKAFFINITY* = ptr KAFFINITY

-

-type  # WinDef.h -- Basic Windows Type Definitions

-  # BaseTypes

-  WINUINT* = int32

-  ULONG* = int

-  PULONG* = ptr int

-  USHORT* = int16

-  PUSHORT* = ptr int16

-  UCHAR* = int8

-  PUCHAR* = ptr int8

-  PSZ* = cstring

-

-  DWORD* = int32

-  WINBOOL* = int32

-  WORD* = int16

-  #FLOAT* = float

-  PFLOAT* = ptr float32

-  PWINBOOL* = ptr WINBOOL

-  LPWINBOOL* = ptr WINBOOL

-  PBYTE* = ptr int8

-  LPBYTE* = ptr int8

-  PINT* = ptr int32

-  LPINT* = ptr int32

-  PWORD* = ptr int16

-  LPWORD* = ptr int16

-  LPLONG* = ptr int32

-  PDWORD* = ptr DWORD

-  LPDWORD* = ptr DWORD

-  LPVOID* = pointer

-  LPCVOID* = pointer

-

-  # INT* = int  # Cannot work and not necessary anyway

-  PUINT* = ptr int

-

-  WPARAM* = LONG_PTR

-  LPARAM* = LONG_PTR

-  LRESULT* = LONG_PTR

-

-  ATOM* = int16

-  HANDLE* = int

-#  Handle* = HANDLE

-  PHANDLE* = ptr HANDLE

-  LPHANDLE* = ptr HANDLE

-  HWND* = HANDLE

-  HHOOK* = HANDLE

-  HEVENT* = HANDLE

-  HGLOBAL* = HANDLE

-  HLOCAL* = HANDLE

-  HGDIOBJ* = HANDLE

-  HKEY* = HANDLE

-  PHKEY* = ptr HKEY

-  HACCEL* = HANDLE

-  HBITMAP* = HANDLE

-  HBRUSH* = HANDLE

-  HCOLORSPACE* = HANDLE

-  HDC* = HANDLE

-  HGLRC* = HANDLE

-  HDESK* = HANDLE

-  HENHMETAFILE* = HANDLE

-  HFONT* = HANDLE

-  HICON* = HANDLE

-  HMETAFILE* = HANDLE

-  HINST* = HANDLE  # Not HINSTANCE, else it has problems with the var HInstance

-  HMODULE* = HANDLE

-  HPALETTE* = HANDLE

-  HPEN* = HANDLE

-  HRGN* = HANDLE

-  HRSRC* = HANDLE

-  HTASK* = HANDLE

-  HWINSTA* = HANDLE

-  HKL* = HANDLE

-  HMONITOR* = HANDLE

-  HWINEVENTHOOK* = HANDLE

-  HUMPD* = HANDLE

-

-  HFILE* = HANDLE

-  HCURSOR* = HANDLE # = HICON

-  COLORREF* = DWORD

-  LPCOLORREF* = ptr COLORREF

-

-  POINT* {.final, pure.} = object

-    x*: LONG

-    y*: LONG

-  PPOINT* = ptr POINT

-  LPPOINT* = ptr POINT

-  POINTL* {.final, pure.} = object

-    x*: LONG

-    y*: LONG

-  PPOINTL* = ptr POINTL

-

-  RECT* {.final, pure.} = object

-    TopLeft*, BottomRight*: Point

-  PRECT* = ptr RECT

-  LPRECT* = ptr RECT

-

-  RECTL* {.final, pure.} = object

-    left*: LONG

-    top*: LONG

-    right*: LONG

-    bottom*: LONG

-  PRECTL* = ptr RECTL

-

-  SIZE* {.final, pure.} = object

-    cx*: LONG

-    cy*: LONG

-  PSIZE* = ptr SIZE

-  LPSIZE* = ptr SIZE

-  SIZEL* = SIZE

-  PSIZEL* = ptr SIZE

-  LPSIZEL* = ptr SIZE

-

-  POINTS* {.final, pure.} = object

-    x*: SHORT

-    y*: SHORT

-  PPOINTS* = ptr POINTS

-

-  FILETIME* {.final, pure.} = object

-    dwLowDateTime*: DWORD

-    dwHighDateTime*: DWORD

-  PFILETIME* = ptr FILETIME

-  LPFILETIME* = ptr FILETIME

-{.deprecated: [THandle: Handle, TAtom: ATOM, TFILETIME: FILETIME, TRECT: RECT,

-              TRECTL: RECTL, TSIZE: SIZE, TSIZEL: SIZE, TPOINTS: POINTS,

-              TPOINT: POINT, TPOINTL: POINTL].}

-

-const

-  MAX_PATH* = 260

-  HFILE_ERROR* = HFILE(-1)

-

-  # mode selections for the device mode function

-  # DocumentProperties

-  DM_UPDATE* = 1

-  DM_COPY* = 2

-  DM_PROMPT* = 4

-  DM_MODIFY* = 8

-

-  DM_IN_BUFFER* = DM_MODIFY

-  DM_IN_PROMPT* = DM_PROMPT

-  DM_OUT_BUFFER* = DM_COPY

-  DM_OUT_DEFAULT* = DM_UPDATE

-

-  # device capabilities indices

-  DC_FIELDS* = 1

-  DC_PAPERS* = 2

-  DC_PAPERSIZE* = 3

-  DC_MINEXTENT* = 4

-  DC_MAXEXTENT* = 5

-  DC_BINS* = 6

-  DC_DUPLEX* = 7

-  DC_SIZE* = 8

-  DC_EXTRA* = 9

-  DC_VERSION* = 10

-  DC_DRIVER* = 11

-  DC_BINNAMES* = 12

-  DC_ENUMRESOLUTIONS* = 13

-  DC_FILEDEPENDENCIES* = 14

-  DC_TRUETYPE* = 15

-  DC_PAPERNAMES* = 16

-  DC_ORIENTATION* = 17

-  DC_COPIES* = 18

-

-  DC_BINADJUST* = 19

-  DC_EMF_COMPLIANT* = 20

-  DC_DATATYPE_PRODUCED* = 21

-

-type

-  WORDBOOL* = int16  # XXX: not a bool

-  CALTYPE* = int

-  CALID* = int

-  CCHAR* = char

-  WINT* = int32

-  PINTEGER* = ptr int32

-  PBOOL* = ptr WINBOOL

-  LONGLONG* = int64

-  PLONGLONG* = ptr LONGLONG

-  LPLONGLONG* = ptr LONGLONG

-  ULONGLONG* = int64          # used in AMD64 CONTEXT

-  PULONGLONG* = ptr ULONGLONG #

-  DWORDLONG* = int64          # was unsigned long

-  PDWORDLONG* = ptr DWORDLONG

-  HRESULT* = int

-  PHRESULT* = ptr HRESULT

-  HCONV* = HANDLE

-  HCONVLIST* = HANDLE

-  HDBC* = HANDLE

-  HDDEDATA* = HANDLE

-  HDROP* = HANDLE

-  HDWP* = HANDLE

-  HENV* = HANDLE

-  HIMAGELIST* = HANDLE

-  HMENU* = HANDLE

-  HRASCONN* = HANDLE

-  HSTMT* = HANDLE

-  HSTR* = HANDLE

-  HSZ* = HANDLE

-  LANGID* = int16

-  LCID* = DWORD

-  LCTYPE* = DWORD

-  LP* = ptr int16

-  LPBOOL* = ptr WINBOOL

-{.deprecated: [TCOLORREF: COLORREF].}

-

-when defined(winUnicode):

-  type

-    LPCTSTR* = PWideChar

-else:

-  type

-    LPCTSTR* = cstring

-type

-  LPPCSTR* = ptr LPCSTR

-  LPPCTSTR* = ptr LPCTSTR

-  LPPCWSTR* = ptr LPCWSTR

-

-when defined(winUnicode):

-  type

-    LPTCH* = PWideChar

-    LPTSTR* = PWideChar

-else:

-  type

-    LPTCH* = cstring

-    LPTSTR* = cstring

-type

-  PBOOLEAN* = ptr int8

-  PLONG* = ptr int32

-  PSHORT* = ptr SHORT

-

-when defined(winUnicode):

-  type

-    PTBYTE* = ptr uint16

-    PTCH* = PWideChar

-    PTCHAR* = PWideChar

-    PTSTR* = PWideChar

-else:

-  type

-    PTBYTE* = ptr byte

-    PTCH* = cstring

-    PTCHAR* = cstring

-    PTSTR* = cstring

-type

-  PVOID* = pointer

-  RETCODE* = SHORT

-  SC_HANDLE* = HANDLE

-  SC_LOCK* = LPVOID

-  LPSC_HANDLE* = ptr SC_HANDLE

-  SERVICE_STATUS_HANDLE* = DWORD

-

-when defined(winUnicode):

-  type

-    BYTE* = uint16

-    CHAR* = widechar

-    BCHAR* = int16

-  {.deprecated: [TBYTE: BYTE, TCHAR: CHAR].}

-else:

-  type

-    BYTE* = uint8

-    CHAR* = char

-    BCHAR* = int8

-  {.deprecated: [TBYTE: BYTE, TCHAR: CHAR].}

-type

-  WCHAR* = WideChar

-  PLPSTR* = ptr LPSTR

-  PLPWStr* = ptr LPWStr

-  ACL_INFORMATION_CLASS* = enum

-    AclRevisionInformation = 1, AclSizeInformation

-  MEDIA_TYPE* = enum

-    Unknown, F5_1Pt2_512, F3_1Pt44_512, F3_2Pt88_512, F3_20Pt8_512, F3_720_512,

-    F5_360_512, F5_320_512, F5_320_1024, F5_180_512, F5_160_512, RemovableMedia,

-    FixedMedia

-

-const

-  RASCS_DONE* = 0x00002000

-  RASCS_PAUSED* = 0x00001000

-

-type

-  RASCONNSTATE* = enum

-    RASCS_OpenPort = 0, RASCS_PortOpened, RASCS_ConnectDevice,

-    RASCS_DeviceConnected, RASCS_AllDevicesConnected, RASCS_Authenticate,

-    RASCS_AuthNotify, RASCS_AuthRetry, RASCS_AuthCallback,

-    RASCS_AuthChangePassword, RASCS_AuthProject, RASCS_AuthLinkSpeed,

-    RASCS_AuthAck, RASCS_ReAuthenticate, RASCS_Authenticated,

-    RASCS_PrepareForCallback, RASCS_WaitForModemReset, RASCS_WaitForCallback,

-    RASCS_Projected, RASCS_StartAuthentication, RASCS_CallbackComplete,

-    RASCS_LogonNetwork, RASCS_Interactive = RASCS_PAUSED,

-    RASCS_RetryAuthentication, RASCS_CallbackSetByCaller, RASCS_PasswordExpired,

-    RASCS_Connected = RASCS_DONE, RASCS_Disconnected

-  RASPROJECTION* = enum

-    RASP_PppIp = 0x00008021, RASP_PppIpx = 0x0000802B, RASP_PppNbf = 0x0000803F,

-    RASP_Amb = 0x00010000

-  SECURITY_IMPERSONATION_LEVEL* = enum

-

-

-    SecurityAnonymous, SecurityIdentification, SecurityImpersonation,

-    SecurityDelegation

-  SID_NAME_USE* = enum

-    SidTypeUser = 1, SidTypeGroup, SidTypeDomain, SidTypeAlias,

-    SidTypeWellKnownGroup, SidTypeDeletedAccount, SidTypeInvalid, SidTypeUnknown

-  PSID_NAME_USE* = ptr SID_NAME_USE

-  TOKEN_INFORMATION_CLASS* = enum

-    TokenUser = 1, TokenGroups, TokenPrivileges, TokenOwner, TokenPrimaryGroup,

-    TokenDefaultDacl, TokenSource, TokenType, TokenImpersonationLevel,

-    TokenStatistics

-  TTOKEN_TYPE* = enum # Name conflict if we drop the `T`

-    TokenPrimary = 1, TokenImpersonation

-  MakeIntResourceA* = cstring

-  MakeIntResourceW* = PWideChar

-  MakeIntResource* = MakeIntResourceA

-

-#

-#    Definitions for callback procedures

-#

-type

-  BFFCALLBACK* = proc (para1: HWND, para2: WINUINT, para3: LPARAM, para4: LPARAM): int32{.

-      stdcall.}

-  LPCCHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): WINUINT{.

-      stdcall.}

-  LPCFHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): WINUINT{.

-      stdcall.}

-  PTHREAD_START_ROUTINE* = pointer

-  LPTHREAD_START_ROUTINE* = PTHREAD_START_ROUTINE

-  EDITSTREAMCALLBACK* = proc (para1: DWORD, para2: LPBYTE, para3: LONG,

-                              para4: LONG): DWORD{.stdcall.}

-  LPFRHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): WINUINT{.

-      stdcall.}

-  LPOFNHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): WINUINT{.

-      stdcall.}

-  LPPRINTHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM,

-                           para4: LPARAM): WINUINT{.stdcall.}

-  LPSETUPHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM,

-                           para4: LPARAM): WINUINT{.stdcall.}

-  DLGPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): LRESULT{.

-      stdcall.}

-  PFNPROPSHEETCALLBACK* = proc (para1: HWND, para2: WINUINT, para3: LPARAM): int32{.

-      stdcall.}

-  LPSERVICE_MAIN_FUNCTION* = proc (para1: DWORD, para2: LPTSTR){.stdcall.}

-  PFNTVCOMPARE* = proc (para1: LPARAM, para2: LPARAM, para3: LPARAM): int32{.

-      stdcall.}

-  WNDPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): LRESULT{.

-      stdcall.}

-  FARPROC* = pointer

-  Proc* = pointer

-  ENUMRESTYPEPROC* = proc (para1: HANDLE, para2: LPTSTR, para3: LONG): WINBOOL{.

-      stdcall.}

-  ENUMRESNAMEPROC* = proc (para1: HANDLE, para2: LPCTSTR, para3: LPTSTR,

-                           para4: LONG): WINBOOL{.stdcall.}

-  ENUMRESLANGPROC* = proc (para1: HANDLE, para2: LPCTSTR, para3: LPCTSTR,

-                           para4: int16, para5: LONG): WINBOOL{.stdcall.}

-  DESKTOPENUMPROC* = FARPROC

-  ENUMWINDOWSPROC* = proc (para1: HWND, para2: LPARAM): WINBOOL{.stdcall.}

-  ENUMWINDOWSTATIONPROC* = proc (para1: LPTSTR, para2: LPARAM): WINBOOL{.stdcall.}

-  SENDASYNCPROC* = proc (para1: HWND, para2: WINUINT, para3: DWORD, para4: LRESULT){.

-      stdcall.}

-  TIMERPROC* = proc (para1: HWND, para2: WINUINT, para3: WINUINT, para4: DWORD){.

-      stdcall.}

-  GRAYSTRINGPROC* = FARPROC

-  DRAWSTATEPROC* = proc (para1: HDC, para2: LPARAM, para3: WPARAM, para4: int32,

-                         para5: int32): WINBOOL{.stdcall.}

-  PROPENUMPROCEX* = proc (para1: HWND, para2: LPCTSTR, para3: HANDLE,

-                          para4: DWORD): WINBOOL{.stdcall.}

-  PROPENUMPROC* = proc (para1: HWND, para2: LPCTSTR, para3: HANDLE): WINBOOL{.

-      stdcall.}

-  HOOKPROC* = proc (para1: int32, para2: WPARAM, para3: LPARAM): LRESULT{.

-      stdcall.}

-  ENUMOBJECTSPROC* = proc (para1: LPVOID, para2: LPARAM){.stdcall.}

-  LINEDDAPROC* = proc (para1: int32, para2: int32, para3: LPARAM){.stdcall.}

-  ABORTPROC* = proc (para1: HDC, para2: int32): WINBOOL{.stdcall.}

-  LPPAGEPAINTHOOK* = proc (para1: HWND, para2: WINUINT, para3: WPARAM,

-                           para4: LPARAM): WINUINT{.stdcall.}

-  LPPAGESETUPHOOK* = proc (para1: HWND, para2: WINUINT, para3: WPARAM,

-                           para4: LPARAM): WINUINT{.stdcall.}

-  ICMENUMPROC* = proc (para1: LPTSTR, para2: LPARAM): int32{.stdcall.}

-  EDITWORDBREAKPROCEX* = proc (para1: cstring, para2: LONG, para3: int8,

-                               para4: WINT): LONG{.stdcall.}

-  PFNLVCOMPARE* = proc (para1: LPARAM, para2: LPARAM, para3: LPARAM): int32{.

-      stdcall.}

-  LOCALE_ENUMPROC* = proc (para1: LPTSTR): WINBOOL{.stdcall.}

-  CODEPAGE_ENUMPROC* = proc (para1: LPTSTR): WINBOOL{.stdcall.}

-  DATEFMT_ENUMPROC* = proc (para1: LPTSTR): WINBOOL{.stdcall.}

-  TIMEFMT_ENUMPROC* = proc (para1: LPTSTR): WINBOOL{.stdcall.}

-  CALINFO_ENUMPROC* = proc (para1: LPTSTR): WINBOOL{.stdcall.}

-  PHANDLER_ROUTINE* = proc (para1: DWORD): WINBOOL{.stdcall.}

-  LPHANDLER_FUNCTION* = proc (para1: DWORD): WINBOOL{.stdcall.}

-  PFNGETPROFILEPATH* = proc (para1: LPCTSTR, para2: LPSTR, para3: WINUINT): WINUINT{.

-      stdcall.}

-  PFNRECONCILEPROFILE* = proc (para1: LPCTSTR, para2: LPCTSTR, para3: DWORD): WINUINT{.

-      stdcall.}

-  PFNPROCESSPOLICIES* = proc (para1: HWND, para2: LPCTSTR, para3: LPCTSTR,

-                              para4: LPCTSTR, para5: DWORD): WINBOOL{.stdcall.}

-{.deprecated: [TFarProc: FARPROC, TProc: Proc, TABORTPROC: ABORTPROC].}

-

-const

-  SE_CREATE_TOKEN_NAME* = "SeCreateTokenPrivilege"

-  SE_ASSIGNPRIMARYTOKEN_NAME* = "SeAssignPrimaryTokenPrivilege"

-  SE_LOCK_MEMORY_NAME* = "SeLockMemoryPrivilege"

-  SE_INCREASE_QUOTA_NAME* = "SeIncreaseQuotaPrivilege"

-  SE_UNSOLICITED_INPUT_NAME* = "SeUnsolicitedInputPrivilege"

-  SE_MACHINE_ACCOUNT_NAME* = "SeMachineAccountPrivilege"

-  SE_TCB_NAME* = "SeTcbPrivilege"

-  SE_SECURITY_NAME* = "SeSecurityPrivilege"

-  SE_TAKE_OWNERSHIP_NAME* = "SeTakeOwnershipPrivilege"

-  SE_LOAD_DRIVER_NAME* = "SeLoadDriverPrivilege"

-  SE_SYSTEM_PROFILE_NAME* = "SeSystemProfilePrivilege"

-  SE_SYSTEMTIME_NAME* = "SeSystemtimePrivilege"

-  SE_PROF_SINGLE_PROCESS_NAME* = "SeProfileSingleProcessPrivilege"

-  SE_INC_BASE_PRIORITY_NAME* = "SeIncreaseBasePriorityPrivilege"

-  SE_CREATE_PAGEFILE_NAME* = "SeCreatePagefilePrivilege"

-  SE_CREATE_PERMANENT_NAME* = "SeCreatePermanentPrivilege"

-  SE_BACKUP_NAME* = "SeBackupPrivilege"

-  SE_RESTORE_NAME* = "SeRestorePrivilege"

-  SE_SHUTDOWN_NAME* = "SeShutdownPrivilege"

-  SE_DEBUG_NAME* = "SeDebugPrivilege"

-  SE_AUDIT_NAME* = "SeAuditPrivilege"

-  SE_SYSTEM_ENVIRONMENT_NAME* = "SeSystemEnvironmentPrivilege"

-  SE_CHANGE_NOTIFY_NAME* = "SeChangeNotifyPrivilege"

-  SE_REMOTE_SHUTDOWN_NAME* = "SeRemoteShutdownPrivilege"

-  SERVICES_ACTIVE_DATABASEW* = "ServicesActive"

-  SERVICES_FAILED_DATABASEW* = "ServicesFailed"

-  SERVICES_ACTIVE_DATABASEA* = "ServicesActive"

-  SERVICES_FAILED_DATABASEA* = "ServicesFailed"

-  SC_GROUP_IDENTIFIERW* = "+"

-  SC_GROUP_IDENTIFIERA* = "+"

-

-when defined(winUnicode):

-  const

-    SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEW

-    SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEW

-    SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERW

-else:

-  const

-    SERVICES_ACTIVE_DATABASE* = SERVICES_ACTIVE_DATABASEA

-    SERVICES_FAILED_DATABASE* = SERVICES_FAILED_DATABASEA

-    SC_GROUP_IDENTIFIER* = SC_GROUP_IDENTIFIERA

-type

-  PFNCALLBACK* = proc (para1, para2: WINUINT, para3: HCONV, para4, para5: HSZ,

-                       para6: HDDEDATA, para7, para8: DWORD): HDDEData{.stdcall.}

-  CALLB* = PFNCALLBACK

-  SECURITY_CONTEXT_TRACKING_MODE* = WINBOOL

-  # End of stuff from ddeml.h in old Cygnus headers

-

-  WNDENUMPROC* = FARPROC

-  ENHMFENUMPROC* = FARPROC

-  CCSTYLE* = DWORD

-  PCCSTYLE* = ptr CCSTYLE

-  LPCCSTYLE* = ptr CCSTYLE

-  CCSTYLEFLAGA* = DWORD

-  PCCSTYLEFLAGA* = ptr CCSTYLEFLAGA

-  LPCCSTYLEFLAGA* = ptr CCSTYLEFLAGA

-

-const

-  LZERROR_UNKNOWNALG* = -8

-  LZERROR_BADVALUE* = -7

-  LZERROR_GLOBLOCK* = -6

-  LZERROR_GLOBALLOC* = -5

-  LZERROR_WRITE* = -4

-  LZERROR_READ* = -3

-  LZERROR_BADOUTHANDLE* = -2

-  LZERROR_BADINHANDLE* = -1

-  NO_ERROR* = 0

-  ERROR_SUCCESS* = 0

-  ERROR_INVALID_FUNCTION* = 1

-  ERROR_FILE_NOT_FOUND* = 2

-  ERROR_PATH_NOT_FOUND* = 3

-  ERROR_TOO_MANY_OPEN_FILES* = 4

-  ERROR_ACCESS_DENIED* = 5

-  ERROR_INVALID_HANDLE* = 6

-  ERROR_ARENA_TRASHED* = 7

-  ERROR_NOT_ENOUGH_MEMORY* = 8

-  ERROR_INVALID_BLOCK* = 9

-  ERROR_BAD_ENVIRONMENT* = 10

-  ERROR_BAD_FORMAT* = 11

-  ERROR_INVALID_ACCESS* = 12

-  ERROR_INVALID_DATA* = 13

-  ERROR_OUTOFMEMORY* = 14

-  ERROR_INVALID_DRIVE* = 15

-  ERROR_CURRENT_DIRECTORY* = 16

-  ERROR_NOT_SAME_DEVICE* = 17

-  ERROR_NO_MORE_FILES* = 18

-  ERROR_WRITE_PROTECT* = 19

-  ERROR_BAD_UNIT* = 20

-  ERROR_NOT_READY* = 21

-  ERROR_BAD_COMMAND* = 22

-  ERROR_CRC* = 23

-  ERROR_BAD_LENGTH* = 24

-  ERROR_SEEK* = 25

-  ERROR_NOT_DOS_DISK* = 26

-  ERROR_SECTOR_NOT_FOUND* = 27

-  ERROR_OUT_OF_PAPER* = 28

-  ERROR_WRITE_FAULT* = 29

-  ERROR_READ_FAULT* = 30

-  ERROR_GEN_FAILURE* = 31

-  ERROR_SHARING_VIOLATION* = 32

-  ERROR_LOCK_VIOLATION* = 33

-  ERROR_WRONG_DISK* = 34

-  ERROR_SHARING_BUFFER_EXCEEDED* = 36

-  ERROR_HANDLE_EOF* = 38

-  ERROR_HANDLE_DISK_FULL* = 39

-  ERROR_NOT_SUPPORTED* = 50

-  ERROR_REM_NOT_LIST* = 51

-  ERROR_DUP_NAME* = 52

-  ERROR_BAD_NETPATH* = 53

-  ERROR_NETWORK_BUSY* = 54

-  ERROR_DEV_NOT_EXIST* = 55

-  ERROR_TOO_MANY_CMDS* = 56

-  ERROR_ADAP_HDW_ERR* = 57

-  ERROR_BAD_NET_RESP* = 58

-  ERROR_UNEXP_NET_ERR* = 59

-  ERROR_BAD_REM_ADAP* = 60

-  ERROR_PRINTQ_FULL* = 61

-  ERROR_NO_SPOOL_SPACE* = 62

-  ERROR_PRINT_CANCELLED* = 63

-  ERROR_NETNAME_DELETED* = 64

-  ERROR_NETWORK_ACCESS_DENIED* = 65

-  ERROR_BAD_DEV_TYPE* = 66

-  ERROR_BAD_NET_NAME* = 67

-  ERROR_TOO_MANY_NAMES* = 68

-  ERROR_TOO_MANY_SESS* = 69

-  ERROR_SHARING_PAUSED* = 70

-  ERROR_REQ_NOT_ACCEP* = 71

-  ERROR_REDIR_PAUSED* = 72

-  ERROR_FILE_EXISTS* = 80

-  ERROR_CANNOT_MAKE* = 82

-  ERROR_FAIL_I24* = 83

-  ERROR_OUT_OF_STRUCTURES* = 84

-  ERROR_ALREADY_ASSIGNED* = 85

-  ERROR_INVALID_PASSWORD* = 86

-  ERROR_INVALID_PARAMETER* = 87

-  ERROR_NET_WRITE_FAULT* = 88

-  ERROR_NO_PROC_SLOTS* = 89

-  ERROR_TOO_MANY_SEMAPHORES* = 100

-  ERROR_EXCL_SEM_ALREADY_OWNED* = 101

-  ERROR_SEM_IS_SET* = 102

-  ERROR_TOO_MANY_SEM_REQUESTS* = 103

-  ERROR_INVALID_AT_INTERRUPT_TIME* = 104

-  ERROR_SEM_OWNER_DIED* = 105

-  ERROR_SEM_USER_LIMIT* = 106

-  ERROR_DISK_CHANGE* = 107

-  ERROR_DRIVE_LOCKED* = 108

-  ERROR_BROKEN_PIPE* = 109

-  ERROR_OPEN_FAILED* = 110

-  ERROR_BUFFER_OVERFLOW* = 111

-  ERROR_DISK_FULL* = 112

-  ERROR_NO_MORE_SEARCH_HANDLES* = 113

-  ERROR_INVALID_TARGET_HANDLE* = 114

-  ERROR_INVALID_CATEGORY* = 117

-  ERROR_INVALID_VERIFY_SWITCH* = 118

-  ERROR_BAD_DRIVER_LEVEL* = 119

-  ERROR_CALL_NOT_IMPLEMENTED* = 120

-  ERROR_SEM_TIMEOUT* = 121

-  ERROR_INSUFFICIENT_BUFFER* = 122

-  ERROR_INVALID_NAME* = 123

-  ERROR_INVALID_LEVEL* = 124

-  ERROR_NO_VOLUME_LABEL* = 125

-  ERROR_MOD_NOT_FOUND* = 126

-  ERROR_PROC_NOT_FOUND* = 127

-  ERROR_WAIT_NO_CHILDREN* = 128

-  ERROR_CHILD_NOT_COMPLETE* = 129

-  ERROR_DIRECT_ACCESS_HANDLE* = 130

-  ERROR_NEGATIVE_SEEK* = 131

-  ERROR_SEEK_ON_DEVICE* = 132

-  ERROR_IS_JOIN_TARGET* = 133

-  ERROR_IS_JOINED* = 134

-  ERROR_IS_SUBSTED* = 135

-  ERROR_NOT_JOINED* = 136

-  ERROR_NOT_SUBSTED* = 137

-  ERROR_JOIN_TO_JOIN* = 138

-  ERROR_SUBST_TO_SUBST* = 139

-  ERROR_JOIN_TO_SUBST* = 140

-  ERROR_SUBST_TO_JOIN* = 141

-  ERROR_BUSY_DRIVE* = 142

-  ERROR_SAME_DRIVE* = 143

-  ERROR_DIR_NOT_ROOT* = 144

-  ERROR_DIR_NOT_EMPTY* = 145

-  ERROR_IS_SUBST_PATH* = 146

-  ERROR_IS_JOIN_PATH* = 147

-  ERROR_PATH_BUSY* = 148

-  ERROR_IS_SUBST_TARGET* = 149

-  ERROR_SYSTEM_TRACE* = 150

-  ERROR_INVALID_EVENT_COUNT* = 151

-  ERROR_TOO_MANY_MUXWAITERS* = 152

-  ERROR_INVALID_LIST_FORMAT* = 153

-  ERROR_LABEL_TOO_LONG* = 154

-  ERROR_TOO_MANY_TCBS* = 155

-  ERROR_SIGNAL_REFUSED* = 156

-  ERROR_DISCARDED* = 157

-  ERROR_NOT_LOCKED* = 158

-  ERROR_BAD_THREADID_ADDR* = 159

-  ERROR_BAD_ARGUMENTS* = 160

-  ERROR_BAD_PATHNAME* = 161

-  ERROR_SIGNAL_PENDING* = 162

-  ERROR_MAX_THRDS_REACHED* = 164

-  ERROR_LOCK_FAILED* = 167

-  ERROR_BUSY* = 170

-  ERROR_CANCEL_VIOLATION* = 173

-  ERROR_ATOMIC_LOCKS_NOT_SUPPORTED* = 174

-  ERROR_INVALID_SEGMENT_NUMBER* = 180

-  ERROR_INVALID_ORDINAL* = 182

-  ERROR_ALREADY_EXISTS* = 183

-  ERROR_INVALID_FLAG_NUMBER* = 186

-  ERROR_SEM_NOT_FOUND* = 187

-  ERROR_INVALID_STARTING_CODESEG* = 188

-  ERROR_INVALID_STACKSEG* = 189

-  ERROR_INVALID_MODULETYPE* = 190

-  ERROR_INVALID_EXE_SIGNATURE* = 191

-  ERROR_EXE_MARKED_INVALID* = 192

-  ERROR_BAD_EXE_FORMAT* = 193

-  ERROR_ITERATED_DATA_EXCEEDS_64k* = 194

-  ERROR_INVALID_MINALLOCSIZE* = 195

-  ERROR_DYNLINK_FROM_INVALID_RING* = 196

-  ERROR_IOPL_NOT_ENABLED* = 197

-  ERROR_INVALID_SEGDPL* = 198

-  ERROR_AUTODATASEG_EXCEEDS_64k* = 199

-  ERROR_RING2SEG_MUST_BE_MOVABLE* = 200

-  ERROR_RELOC_CHAIN_XEEDS_SEGLIM* = 201

-  ERROR_INFLOOP_IN_RELOC_CHAIN* = 202

-  ERROR_ENVVAR_NOT_FOUND* = 203

-  ERROR_NO_SIGNAL_SENT* = 205

-  ERROR_FILENAME_EXCED_RANGE* = 206

-  ERROR_RING2_STACK_IN_USE* = 207

-  ERROR_META_EXPANSION_TOO_LONG* = 208

-  ERROR_INVALID_SIGNAL_NUMBER* = 209

-  ERROR_THREAD_1_INACTIVE* = 210

-  ERROR_LOCKED* = 212

-  ERROR_TOO_MANY_MODULES* = 214

-  ERROR_NESTING_NOT_ALLOWED* = 215

-  ERROR_BAD_PIPE* = 230

-  ERROR_PIPE_BUSY* = 231

-  ERROR_NO_DATA* = 232

-  ERROR_PIPE_NOT_CONNECTED* = 233

-  ERROR_MORE_DATA* = 234

-  ERROR_VC_DISCONNECTED* = 240

-  ERROR_INVALID_EA_NAME* = 254

-  ERROR_EA_LIST_INCONSISTENT* = 255

-  ERROR_NO_MORE_ITEMS* = 259

-  ERROR_CANNOT_COPY* = 266

-  ERROR_DIRECTORY* = 267

-  ERROR_EAS_DIDNT_FIT* = 275

-  ERROR_EA_FILE_CORRUPT* = 276

-  ERROR_EA_TABLE_FULL* = 277

-  ERROR_INVALID_EA_HANDLE* = 278

-  ERROR_EAS_NOT_SUPPORTED* = 282

-  ERROR_NOT_OWNER* = 288

-  ERROR_TOO_MANY_POSTS* = 298

-  ERROR_PARTIAL_COPY* = 299

-  ERROR_MR_MID_NOT_FOUND* = 317

-  ERROR_INVALID_ADDRESS* = 487

-  ERROR_ARITHMETIC_OVERFLOW* = 534

-  ERROR_PIPE_CONNECTED* = 535

-  ERROR_PIPE_LISTENING* = 536

-  ERROR_EA_ACCESS_DENIED* = 994

-  ERROR_OPERATION_ABORTED* = 995

-  ERROR_IO_INCOMPLETE* = 996

-  ERROR_IO_PENDING* = 997

-  ERROR_NOACCESS* = 998

-  ERROR_SWAPERROR* = 999

-  ERROR_STACK_OVERFLOW* = 1001

-  ERROR_INVALID_MESSAGE* = 1002

-  ERROR_CAN_NOT_COMPLETE* = 1003

-  ERROR_INVALID_FLAGS* = 1004

-  ERROR_UNRECOGNIZED_VOLUME* = 1005

-  ERROR_FILE_INVALID* = 1006

-  ERROR_FULLSCREEN_MODE* = 1007

-  ERROR_NO_TOKEN* = 1008

-  ERROR_BADDB* = 1009

-  ERROR_BADKEY* = 1010

-  ERROR_CANTOPEN* = 1011

-  ERROR_CANTREAD* = 1012

-  ERROR_CANTWRITE* = 1013

-  ERROR_REGISTRY_RECOVERED* = 1014

-  ERROR_REGISTRY_CORRUPT* = 1015

-  ERROR_REGISTRY_IO_FAILED* = 1016

-  ERROR_NOT_REGISTRY_FILE* = 1017

-  ERROR_KEY_DELETED* = 1018

-  ERROR_NO_LOG_SPACE* = 1019

-  ERROR_KEY_HAS_CHILDREN* = 1020

-  ERROR_CHILD_MUST_BE_VOLATILE* = 1021

-  ERROR_NOTIFY_ENUM_DIR* = 1022

-  ERROR_DEPENDENT_SERVICES_RUNNING* = 1051

-  ERROR_INVALID_SERVICE_CONTROL* = 1052

-  ERROR_SERVICE_REQUEST_TIMEOUT* = 1053

-  ERROR_SERVICE_NO_THREAD* = 1054

-  ERROR_SERVICE_DATABASE_LOCKED* = 1055

-  ERROR_SERVICE_ALREADY_RUNNING* = 1056

-  ERROR_INVALID_SERVICE_ACCOUNT* = 1057

-  ERROR_SERVICE_DISABLED* = 1058

-  ERROR_CIRCULAR_DEPENDENCY* = 1059

-  ERROR_SERVICE_DOES_NOT_EXIST* = 1060

-  ERROR_SERVICE_CANNOT_ACCEPT_CTRL* = 1061

-  ERROR_SERVICE_NOT_ACTIVE* = 1062

-  ERROR_FAILED_SERVICE_CONTROLLER_CONNECT* = 1063

-  ERROR_EXCEPTION_IN_SERVICE* = 1064

-  ERROR_DATABASE_DOES_NOT_EXIST* = 1065

-  ERROR_SERVICE_SPECIFIC_ERROR* = 1066

-  ERROR_PROCESS_ABORTED* = 1067

-  ERROR_SERVICE_DEPENDENCY_FAIL* = 1068

-  ERROR_SERVICE_LOGON_FAILED* = 1069

-  ERROR_SERVICE_START_HANG* = 1070

-  ERROR_INVALID_SERVICE_LOCK* = 1071

-  ERROR_SERVICE_MARKED_FOR_DELETE* = 1072

-  ERROR_SERVICE_EXISTS* = 1073

-  ERROR_ALREADY_RUNNING_LKG* = 1074

-  ERROR_SERVICE_DEPENDENCY_DELETED* = 1075

-  ERROR_BOOT_ALREADY_ACCEPTED* = 1076

-  ERROR_SERVICE_NEVER_STARTED* = 1077

-  ERROR_DUPLICATE_SERVICE_NAME* = 1078

-  ERROR_END_OF_MEDIA* = 1100

-  ERROR_FILEMARK_DETECTED* = 1101

-  ERROR_BEGINNING_OF_MEDIA* = 1102

-  ERROR_SETMARK_DETECTED* = 1103

-  ERROR_NO_DATA_DETECTED* = 1104

-  ERROR_PARTITION_FAILURE* = 1105

-  ERROR_INVALID_BLOCK_LENGTH* = 1106

-  ERROR_DEVICE_NOT_PARTITIONED* = 1107

-  ERROR_UNABLE_TO_LOCK_MEDIA* = 1108

-  ERROR_UNABLE_TO_UNLOAD_MEDIA* = 1109

-  ERROR_MEDIA_CHANGED* = 1110

-  ERROR_BUS_RESET* = 1111

-  ERROR_NO_MEDIA_IN_DRIVE* = 1112

-  ERROR_NO_UNICODE_TRANSLATION* = 1113

-  ERROR_DLL_INIT_FAILED* = 1114

-  ERROR_SHUTDOWN_IN_PROGRESS* = 1115

-  ERROR_NO_SHUTDOWN_IN_PROGRESS* = 1116

-  ERROR_IO_DEVICE* = 1117

-  ERROR_SERIAL_NO_DEVICE* = 1118

-  ERROR_IRQ_BUSY* = 1119

-  ERROR_MORE_WRITES* = 1120

-  ERROR_COUNTER_TIMEOUT* = 1121

-  ERROR_FLOPPY_ID_MARK_NOT_FOUND* = 1122

-  ERROR_FLOPPY_WRONG_CYLINDER* = 1123

-  ERROR_FLOPPY_UNKNOWN_ERROR* = 1124

-  ERROR_FLOPPY_BAD_REGISTERS* = 1125

-  ERROR_DISK_RECALIBRATE_FAILED* = 1126

-  ERROR_DISK_OPERATION_FAILED* = 1127

-  ERROR_DISK_RESET_FAILED* = 1128

-  ERROR_EOM_OVERFLOW* = 1129

-  ERROR_NOT_ENOUGH_SERVER_MEMORY* = 1130

-  ERROR_POSSIBLE_DEADLOCK* = 1131

-  ERROR_MAPPED_ALIGNMENT* = 1132

-  ERROR_SET_POWER_STATE_VETOED* = 1140

-  ERROR_SET_POWER_STATE_FAILED* = 1141

-  ERROR_OLD_WIN_VERSION* = 1150

-  ERROR_APP_WRONG_OS* = 1151

-  ERROR_SINGLE_INSTANCE_APP* = 1152

-  ERROR_RMODE_APP* = 1153

-  ERROR_INVALID_DLL* = 1154

-  ERROR_NO_ASSOCIATION* = 1155

-  ERROR_DDE_FAIL* = 1156

-  ERROR_DLL_NOT_FOUND* = 1157

-  ERROR_BAD_USERNAME* = 2202

-  ERROR_NOT_CONNECTED* = 2250

-  ERROR_OPEN_FILES* = 2401

-  ERROR_ACTIVE_CONNECTIONS* = 2402

-  ERROR_DEVICE_IN_USE* = 2404

-  ERROR_BAD_DEVICE* = 1200

-  ERROR_CONNECTION_UNAVAIL* = 1201

-  ERROR_DEVICE_ALREADY_REMEMBERED* = 1202

-  ERROR_NO_NET_OR_BAD_PATH* = 1203

-  ERROR_BAD_PROVIDER* = 1204

-  ERROR_CANNOT_OPEN_PROFILE* = 1205

-  ERROR_BAD_PROFILE* = 1206

-  ERROR_NOT_CONTAINER* = 1207

-  ERROR_EXTENDED_ERROR* = 1208

-  ERROR_INVALID_GROUPNAME* = 1209

-  ERROR_INVALID_COMPUTERNAME* = 1210

-  ERROR_INVALID_EVENTNAME* = 1211

-  ERROR_INVALID_DOMAINNAME* = 1212

-  ERROR_INVALID_SERVICENAME* = 1213

-  ERROR_INVALID_NETNAME* = 1214

-  ERROR_INVALID_SHARENAME* = 1215

-  ERROR_INVALID_PASSWORDNAME* = 1216

-  ERROR_INVALID_MESSAGENAME* = 1217

-  ERROR_INVALID_MESSAGEDEST* = 1218

-  ERROR_SESSION_CREDENTIAL_CONFLICT* = 1219

-  ERROR_REMOTE_SESSION_LIMIT_EXCEEDED* = 1220

-  ERROR_DUP_DOMAINNAME* = 1221

-  ERROR_NO_NETWORK* = 1222

-  ERROR_CANCELLED* = 1223

-  ERROR_USER_MAPPED_FILE* = 1224

-  ERROR_CONNECTION_REFUSED* = 1225

-  ERROR_GRACEFUL_DISCONNECT* = 1226

-  ERROR_ADDRESS_ALREADY_ASSOCIATED* = 1227

-  ERROR_ADDRESS_NOT_ASSOCIATED* = 1228

-  ERROR_CONNECTION_INVALID* = 1229

-  ERROR_CONNECTION_ACTIVE* = 1230

-  ERROR_NETWORK_UNREACHABLE* = 1231

-  ERROR_HOST_UNREACHABLE* = 1232

-  ERROR_PROTOCOL_UNREACHABLE* = 1233

-  ERROR_PORT_UNREACHABLE* = 1234

-  ERROR_REQUEST_ABORTED* = 1235

-  ERROR_CONNECTION_ABORTED* = 1236

-  ERROR_RETRY* = 1237

-  ERROR_CONNECTION_COUNT_LIMIT* = 1238

-  ERROR_LOGIN_TIME_RESTRICTION* = 1239

-  ERROR_LOGIN_WKSTA_RESTRICTION* = 1240

-  ERROR_INCORRECT_ADDRESS* = 1241

-  ERROR_ALREADY_REGISTERED* = 1242

-  ERROR_SERVICE_NOT_FOUND* = 1243

-  ERROR_NOT_AUTHENTICATED* = 1244

-  ERROR_NOT_LOGGED_ON* = 1245

-  ERROR_CONTINUE* = 1246

-  ERROR_ALREADY_INITIALIZED* = 1247

-  ERROR_NO_MORE_DEVICES* = 1248

-  ERROR_NOT_ALL_ASSIGNED* = 1300

-  ERROR_SOME_NOT_MAPPED* = 1301

-  ERROR_NO_QUOTAS_FOR_ACCOUNT* = 1302

-  ERROR_LOCAL_USER_SESSION_KEY* = 1303

-  ERROR_NULL_LM_PASSWORD* = 1304

-  ERROR_UNKNOWN_REVISION* = 1305

-  ERROR_REVISION_MISMATCH* = 1306

-  ERROR_INVALID_OWNER* = 1307

-  ERROR_INVALID_PRIMARY_GROUP* = 1308

-  ERROR_NO_IMPERSONATION_TOKEN* = 1309

-  ERROR_CANT_DISABLE_MANDATORY* = 1310

-  ERROR_NO_LOGON_SERVERS* = 1311

-  ERROR_NO_SUCH_LOGON_SESSION* = 1312

-  ERROR_NO_SUCH_PRIVILEGE* = 1313

-  ERROR_PRIVILEGE_NOT_HELD* = 1314

-  ERROR_INVALID_ACCOUNT_NAME* = 1315

-  ERROR_USER_EXISTS* = 1316

-  ERROR_NO_SUCH_USER* = 1317

-  ERROR_GROUP_EXISTS* = 1318

-  ERROR_NO_SUCH_GROUP* = 1319

-  ERROR_MEMBER_IN_GROUP* = 1320

-  ERROR_MEMBER_NOT_IN_GROUP* = 1321

-  ERROR_LAST_ADMIN* = 1322

-  ERROR_WRONG_PASSWORD* = 1323

-  ERROR_ILL_FORMED_PASSWORD* = 1324

-  ERROR_PASSWORD_RESTRICTION* = 1325

-  ERROR_LOGON_FAILURE* = 1326

-  ERROR_ACCOUNT_RESTRICTION* = 1327

-  ERROR_INVALID_LOGON_HOURS* = 1328

-  ERROR_INVALID_WORKSTATION* = 1329

-  ERROR_PASSWORD_EXPIRED* = 1330

-  ERROR_ACCOUNT_DISABLED* = 1331

-  ERROR_NONE_MAPPED* = 1332

-  ERROR_TOO_MANY_LUIDS_REQUESTED* = 1333

-  ERROR_LUIDS_EXHAUSTED* = 1334

-  ERROR_INVALID_SUB_AUTHORITY* = 1335

-  ERROR_INVALID_ACL* = 1336

-  ERROR_INVALID_SID* = 1337

-  ERROR_INVALID_SECURITY_DESCR* = 1338

-  ERROR_BAD_INHERITANCE_ACL* = 1340

-  ERROR_SERVER_DISABLED* = 1341

-  ERROR_SERVER_NOT_DISABLED* = 1342

-  ERROR_INVALID_ID_AUTHORITY* = 1343

-  ERROR_ALLOTTED_SPACE_EXCEEDED* = 1344

-  ERROR_INVALID_GROUP_ATTRIBUTES* = 1345

-  ERROR_BAD_IMPERSONATION_LEVEL* = 1346

-  ERROR_CANT_OPEN_ANONYMOUS* = 1347

-  ERROR_BAD_VALIDATION_CLASS* = 1348

-  ERROR_BAD_TOKEN_TYPE* = 1349

-  ERROR_NO_SECURITY_ON_OBJECT* = 1350

-  ERROR_CANT_ACCESS_DOMAIN_INFO* = 1351

-  ERROR_INVALID_SERVER_STATE* = 1352

-  ERROR_INVALID_DOMAIN_STATE* = 1353

-  ERROR_INVALID_DOMAIN_ROLE* = 1354

-  ERROR_NO_SUCH_DOMAIN* = 1355

-  ERROR_DOMAIN_EXISTS* = 1356

-  ERROR_DOMAIN_LIMIT_EXCEEDED* = 1357

-  ERROR_INTERNAL_DB_CORRUPTION* = 1358

-  ERROR_INTERNAL_ERROR* = 1359

-  ERROR_GENERIC_NOT_MAPPED* = 1360

-  ERROR_BAD_DESCRIPTOR_FORMAT* = 1361

-  ERROR_NOT_LOGON_PROCESS* = 1362

-  ERROR_LOGON_SESSION_EXISTS* = 1363

-  ERROR_NO_SUCH_PACKAGE* = 1364

-  ERROR_BAD_LOGON_SESSION_STATE* = 1365

-  ERROR_LOGON_SESSION_COLLISION* = 1366

-  ERROR_INVALID_LOGON_TYPE* = 1367

-  ERROR_CANNOT_IMPERSONATE* = 1368

-  ERROR_RXACT_INVALID_STATE* = 1369

-  ERROR_RXACT_COMMIT_FAILURE* = 1370

-  ERROR_SPECIAL_ACCOUNT* = 1371

-  ERROR_SPECIAL_GROUP* = 1372

-  ERROR_SPECIAL_USER* = 1373

-  ERROR_MEMBERS_PRIMARY_GROUP* = 1374

-  ERROR_TOKEN_ALREADY_IN_USE* = 1375

-  ERROR_NO_SUCH_ALIAS* = 1376

-  ERROR_MEMBER_NOT_IN_ALIAS* = 1377

-  ERROR_MEMBER_IN_ALIAS* = 1378

-  ERROR_ALIAS_EXISTS* = 1379

-  ERROR_LOGON_NOT_GRANTED* = 1380

-  ERROR_TOO_MANY_SECRETS* = 1381

-  ERROR_SECRET_TOO_LONG* = 1382

-  ERROR_INTERNAL_DB_ERROR* = 1383

-  ERROR_TOO_MANY_CONTEXT_IDS* = 1384

-  ERROR_LOGON_TYPE_NOT_GRANTED* = 1385

-  ERROR_NT_CROSS_ENCRYPTION_REQUIRED* = 1386

-  ERROR_NO_SUCH_MEMBER* = 1387

-  ERROR_INVALID_MEMBER* = 1388

-  ERROR_TOO_MANY_SIDS* = 1389

-  ERROR_LM_CROSS_ENCRYPTION_REQUIRED* = 1390

-  ERROR_NO_INHERITANCE* = 1391

-  ERROR_FILE_CORRUPT* = 1392

-  ERROR_DISK_CORRUPT* = 1393

-  ERROR_NO_USER_SESSION_KEY* = 1394

-  ERROR_LICENSE_QUOTA_EXCEEDED* = 1395

-  ERROR_INVALID_WINDOW_HANDLE* = 1400

-  ERROR_INVALID_MENU_HANDLE* = 1401

-  ERROR_INVALID_CURSOR_HANDLE* = 1402

-  ERROR_INVALID_ACCEL_HANDLE* = 1403

-  ERROR_INVALID_HOOK_HANDLE* = 1404

-  ERROR_INVALID_DWP_HANDLE* = 1405

-  ERROR_TLW_WITH_WSCHILD* = 1406

-  ERROR_CANNOT_FIND_WND_CLASS* = 1407

-  ERROR_WINDOW_OF_OTHER_THREAD* = 1408

-  ERROR_HOTKEY_ALREADY_REGISTERED* = 1409

-  ERROR_CLASS_ALREADY_EXISTS* = 1410

-  ERROR_CLASS_DOES_NOT_EXIST* = 1411

-  ERROR_CLASS_HAS_WINDOWS* = 1412

-  ERROR_INVALID_INDEX* = 1413

-  ERROR_INVALID_ICON_HANDLE* = 1414

-  ERROR_PRIVATE_DIALOG_INDEX* = 1415

-  ERROR_LISTBOX_ID_NOT_FOUND* = 1416

-  ERROR_NO_WILDCARD_CHARACTERS* = 1417

-  ERROR_CLIPBOARD_NOT_OPEN* = 1418

-  ERROR_HOTKEY_NOT_REGISTERED* = 1419

-  ERROR_WINDOW_NOT_DIALOG* = 1420

-  ERROR_CONTROL_ID_NOT_FOUND* = 1421

-  ERROR_INVALID_COMBOBOX_MESSAGE* = 1422

-  ERROR_WINDOW_NOT_COMBOBOX* = 1423

-  ERROR_INVALID_EDIT_HEIGHT* = 1424

-  ERROR_DC_NOT_FOUND* = 1425

-  ERROR_INVALID_HOOK_FILTER* = 1426

-  ERROR_INVALID_FILTER_PROC* = 1427

-  ERROR_HOOK_NEEDS_HMOD* = 1428

-  ERROR_GLOBAL_ONLY_HOOK* = 1429

-  ERROR_JOURNAL_HOOK_SET* = 1430

-  ERROR_HOOK_NOT_INSTALLED* = 1431

-  ERROR_INVALID_LB_MESSAGE* = 1432

-  ERROR_SETCOUNT_ON_BAD_LB* = 1433

-  ERROR_LB_WITHOUT_TABSTOPS* = 1434

-  ERROR_DESTROY_OBJECT_OF_OTHER_THREAD* = 1435

-  ERROR_CHILD_WINDOW_MENU* = 1436

-  ERROR_NO_SYSTEM_MENU* = 1437

-  ERROR_INVALID_MSGBOX_STYLE* = 1438

-  ERROR_INVALID_SPI_VALUE* = 1439

-  ERROR_SCREEN_ALREADY_LOCKED* = 1440

-  ERROR_HWNDS_HAVE_DIFF_PARENT* = 1441

-  ERROR_NOT_CHILD_WINDOW* = 1442

-  ERROR_INVALID_GW_COMMAND* = 1443

-  ERROR_INVALID_THREAD_ID* = 1444

-  ERROR_NON_MDICHILD_WINDOW* = 1445

-  ERROR_POPUP_ALREADY_ACTIVE* = 1446

-  ERROR_NO_SCROLLBARS* = 1447

-  ERROR_INVALID_SCROLLBAR_RANGE* = 1448

-  ERROR_INVALID_SHOWWIN_COMMAND* = 1449

-  ERROR_NO_SYSTEM_RESOURCES* = 1450

-  ERROR_NONPAGED_SYSTEM_RESOURCES* = 1451

-  ERROR_PAGED_SYSTEM_RESOURCES* = 1452

-  ERROR_WORKING_SET_QUOTA* = 1453

-  ERROR_PAGEFILE_QUOTA* = 1454

-  ERROR_COMMITMENT_LIMIT* = 1455

-  ERROR_MENU_ITEM_NOT_FOUND* = 1456

-  ERROR_INVALID_KEYBOARD_HANDLE* = 1457

-  ERROR_HOOK_TYPE_NOT_ALLOWED* = 1458

-  ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION* = 1459

-  ERROR_TIMEOUT* = 1460

-  ERROR_EVENTLOG_FILE_CORRUPT* = 1500

-  ERROR_EVENTLOG_CANT_START* = 1501

-  ERROR_LOG_FILE_FULL* = 1502

-  ERROR_EVENTLOG_FILE_CHANGED* = 1503

-  RPC_S_INVALID_STRING_BINDING* = 1700

-  RPC_S_WRONG_KIND_OF_BINDING* = 1701

-  RPC_S_INVALID_BINDING* = 1702

-  RPC_S_PROTSEQ_NOT_SUPPORTED* = 1703

-  RPC_S_INVALID_RPC_PROTSEQ* = 1704

-  RPC_S_INVALID_STRING_UUID* = 1705

-  RPC_S_INVALID_ENDPOINT_FORMAT* = 1706

-  RPC_S_INVALID_NET_ADDR* = 1707

-  RPC_S_NO_ENDPOINT_FOUND* = 1708

-  RPC_S_INVALID_TIMEOUT* = 1709

-  RPC_S_OBJECT_NOT_FOUND* = 1710

-  RPC_S_ALREADY_REGISTERED* = 1711

-  RPC_S_TYPE_ALREADY_REGISTERED* = 1712

-  RPC_S_ALREADY_LISTENING* = 1713

-  RPC_S_NO_PROTSEQS_REGISTERED* = 1714

-  RPC_S_NOT_LISTENING* = 1715

-  RPC_S_UNKNOWN_MGR_TYPE* = 1716

-  RPC_S_UNKNOWN_IF* = 1717

-  RPC_S_NO_BINDINGS* = 1718

-  RPC_S_NO_PROTSEQS* = 1719

-  RPC_S_CANT_CREATE_ENDPOINT* = 1720

-  RPC_S_OUT_OF_RESOURCES* = 1721

-  RPC_S_SERVER_UNAVAILABLE* = 1722

-  RPC_S_SERVER_TOO_BUSY* = 1723

-  RPC_S_INVALID_NETWORK_OPTIONS* = 1724

-  RPC_S_NO_CALL_ACTIVE* = 1725

-  RPC_S_CALL_FAILED* = 1726

-  RPC_S_CALL_FAILED_DNE* = 1727

-  RPC_S_PROTOCOL_ERROR* = 1728

-  RPC_S_UNSUPPORTED_TRANS_SYN* = 1730

-  RPC_S_UNSUPPORTED_TYPE* = 1732

-  RPC_S_INVALID_TAG* = 1733

-  RPC_S_INVALID_BOUND* = 1734

-  RPC_S_NO_ENTRY_NAME* = 1735

-  RPC_S_INVALID_NAME_SYNTAX* = 1736

-  RPC_S_UNSUPPORTED_NAME_SYNTAX* = 1737

-  RPC_S_UUID_NO_ADDRESS* = 1739

-  RPC_S_DUPLICATE_ENDPOINT* = 1740

-  RPC_S_UNKNOWN_AUTHN_TYPE* = 1741

-  RPC_S_MAX_CALLS_TOO_SMALL* = 1742

-  RPC_S_STRING_TOO_LONG* = 1743

-  RPC_S_PROTSEQ_NOT_FOUND* = 1744

-  RPC_S_PROCNUM_OUT_OF_RANGE* = 1745

-  RPC_S_BINDING_HAS_NO_AUTH* = 1746

-  RPC_S_UNKNOWN_AUTHN_SERVICE* = 1747

-  RPC_S_UNKNOWN_AUTHN_LEVEL* = 1748

-  RPC_S_INVALID_AUTH_IDENTITY* = 1749

-  RPC_S_UNKNOWN_AUTHZ_SERVICE* = 1750

-  EPT_S_INVALID_ENTRY* = 1751

-  EPT_S_CANT_PERFORM_OP* = 1752

-  EPT_S_NOT_REGISTERED* = 1753

-  RPC_S_NOTHING_TO_EXPORT* = 1754

-  RPC_S_INCOMPLETE_NAME* = 1755

-  RPC_S_INVALID_VERS_OPTION* = 1756

-  RPC_S_NO_MORE_MEMBERS* = 1757

-  RPC_S_NOT_ALL_OBJS_UNEXPORTED* = 1758

-  RPC_S_INTERFACE_NOT_FOUND* = 1759

-  RPC_S_ENTRY_ALREADY_EXISTS* = 1760

-  RPC_S_ENTRY_NOT_FOUND* = 1761

-  RPC_S_NAME_SERVICE_UNAVAILABLE* = 1762

-  RPC_S_INVALID_NAF_ID* = 1763

-  RPC_S_CANNOT_SUPPORT* = 1764

-  RPC_S_NO_CONTEXT_AVAILABLE* = 1765

-  RPC_S_INTERNAL_ERROR* = 1766

-  RPC_S_ZERO_DIVIDE* = 1767

-  RPC_S_ADDRESS_ERROR* = 1768

-  RPC_S_FP_DIV_ZERO* = 1769

-  RPC_S_FP_UNDERFLOW* = 1770

-  RPC_S_FP_OVERFLOW* = 1771

-  RPC_X_NO_MORE_ENTRIES* = 1772

-  RPC_X_SS_CHAR_TRANS_OPEN_FAIL* = 1773

-  RPC_X_SS_CHAR_TRANS_SHORT_FILE* = 1774

-  RPC_X_SS_IN_NULL_CONTEXT* = 1775

-  RPC_X_SS_CONTEXT_DAMAGED* = 1777

-  RPC_X_SS_HANDLES_MISMATCH* = 1778

-  RPC_X_SS_CANNOT_GET_CALL_HANDLE* = 1779

-  RPC_X_NULL_REF_POINTER* = 1780

-  RPC_X_ENUM_VALUE_OUT_OF_RANGE* = 1781

-  RPC_X_BYTE_COUNT_TOO_SMALL* = 1782

-  RPC_X_BAD_STUB_DATA* = 1783

-  ERROR_INVALID_USER_BUFFER* = 1784

-  ERROR_UNRECOGNIZED_MEDIA* = 1785

-  ERROR_NO_TRUST_LSA_SECRET* = 1786

-  ERROR_NO_TRUST_SAM_ACCOUNT* = 1787

-  ERROR_TRUSTED_DOMAIN_FAILURE* = 1788

-  ERROR_TRUSTED_RELATIONSHIP_FAILURE* = 1789

-  ERROR_TRUST_FAILURE* = 1790

-  RPC_S_CALL_IN_PROGRESS* = 1791

-  ERROR_NETLOGON_NOT_STARTED* = 1792

-  ERROR_ACCOUNT_EXPIRED* = 1793

-  ERROR_REDIRECTOR_HAS_OPEN_HANDLES* = 1794

-  ERROR_PRINTER_DRIVER_ALREADY_INSTALLED* = 1795

-  ERROR_UNKNOWN_PORT* = 1796

-  ERROR_UNKNOWN_PRINTER_DRIVER* = 1797

-  ERROR_UNKNOWN_PRINTPROCESSOR* = 1798

-  ERROR_INVALID_SEPARATOR_FILE* = 1799

-  ERROR_INVALID_PRIORITY* = 1800

-  ERROR_INVALID_PRINTER_NAME* = 1801

-  ERROR_PRINTER_ALREADY_EXISTS* = 1802

-  ERROR_INVALID_PRINTER_COMMAND* = 1803

-  ERROR_INVALID_DATATYPE* = 1804

-  ERROR_INVALID_ENVIRONMENT* = 1805

-  RPC_S_NO_MORE_BINDINGS* = 1806

-  ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT* = 1807

-  ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT* = 1808

-  ERROR_NOLOGON_SERVER_TRUST_ACCOUNT* = 1809

-  ERROR_DOMAIN_TRUST_INCONSISTENT* = 1810

-  ERROR_SERVER_HAS_OPEN_HANDLES* = 1811

-  ERROR_RESOURCE_DATA_NOT_FOUND* = 1812

-  ERROR_RESOURCE_TYPE_NOT_FOUND* = 1813

-  ERROR_RESOURCE_NAME_NOT_FOUND* = 1814

-  ERROR_RESOURCE_LANG_NOT_FOUND* = 1815

-  ERROR_NOT_ENOUGH_QUOTA* = 1816

-  RPC_S_NO_INTERFACES* = 1817

-  RPC_S_CALL_CANCELLED* = 1818

-  RPC_S_BINDING_INCOMPLETE* = 1819

-  RPC_S_COMM_FAILURE* = 1820

-  RPC_S_UNSUPPORTED_AUTHN_LEVEL* = 1821

-  RPC_S_NO_PRINC_NAME* = 1822

-  RPC_S_NOT_RPC_ERROR* = 1823

-  RPC_S_UUID_LOCAL_ONLY* = 1824

-  RPC_S_SEC_PKG_ERROR* = 1825

-  RPC_S_NOT_CANCELLED* = 1826

-  RPC_X_INVALID_ES_ACTION* = 1827

-  RPC_X_WRONG_ES_VERSION* = 1828

-  RPC_X_WRONG_STUB_VERSION* = 1829

-  RPC_X_INVALID_PIPE_OBJECT* = 1830

-  RPC_X_INVALID_PIPE_OPERATION* = 1831

-  RPC_S_GROUP_MEMBER_NOT_FOUND* = 1898

-  EPT_S_CANT_CREATE* = 1899

-  RPC_S_INVALID_OBJECT* = 1900

-  ERROR_INVALID_TIME* = 1901

-  ERROR_INVALID_FORM_NAME* = 1902

-  ERROR_INVALID_FORM_SIZE* = 1903

-  ERROR_ALREADY_WAITING* = 1904

-  ERROR_PRINTER_DELETED* = 1905

-  ERROR_INVALID_PRINTER_STATE* = 1906

-  ERROR_PASSWORD_MUST_CHANGE* = 1907

-  ERROR_DOMAIN_CONTROLLER_NOT_FOUND* = 1908

-  ERROR_ACCOUNT_LOCKED_OUT* = 1909

-  OR_INVALID_OXID* = 1910

-  OR_INVALID_OID* = 1911

-  OR_INVALID_SET* = 1912

-  RPC_S_SEND_INCOMPLETE* = 1913

-  ERROR_NO_BROWSER_SERVERS_FOUND* = 6118

-  ERROR_INVALID_PIXEL_FORMAT* = 2000

-  ERROR_BAD_DRIVER* = 2001

-  ERROR_INVALID_WINDOW_STYLE* = 2002

-  ERROR_METAFILE_NOT_SUPPORTED* = 2003

-  ERROR_TRANSFORM_NOT_SUPPORTED* = 2004

-  ERROR_CLIPPING_NOT_SUPPORTED* = 2005

-  ERROR_UNKNOWN_PRINT_MONITOR* = 3000

-  ERROR_PRINTER_DRIVER_IN_USE* = 3001

-  ERROR_SPOOL_FILE_NOT_FOUND* = 3002

-  ERROR_SPL_NO_STARTDOC* = 3003

-  ERROR_SPL_NO_ADDJOB* = 3004

-  ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED* = 3005

-  ERROR_PRINT_MONITOR_ALREADY_INSTALLED* = 3006

-  ERROR_INVALID_PRINT_MONITOR* = 3007

-  ERROR_PRINT_MONITOR_IN_USE* = 3008

-  ERROR_PRINTER_HAS_JOBS_QUEUED* = 3009

-  ERROR_SUCCESS_REBOOT_REQUIRED* = 3010

-  ERROR_SUCCESS_RESTART_REQUIRED* = 3011

-  ERROR_WINS_INTERNAL* = 4000

-  ERROR_CAN_NOT_DEL_LOCAL_WINS* = 4001

-  ERROR_STATIC_INIT* = 4002

-  ERROR_INC_BACKUP* = 4003

-  ERROR_FULL_BACKUP* = 4004

-  ERROR_REC_NON_EXISTENT* = 4005

-  ERROR_RPL_NOT_ALLOWED* = 4006

-  E_UNEXPECTED* = HRESULT(0x8000FFFF)

-  E_NOTIMPL* = HRESULT(0x80004001)

-  E_OUTOFMEMORY* = HRESULT(0x8007000E)

-  E_INVALIDARG* = HRESULT(0x80070057)

-  E_NOINTERFACE* = HRESULT(0x80004002)

-  E_POINTER* = HRESULT(0x80004003)

-  E_HANDLE* = HRESULT(0x80070006)

-  E_ABORT* = HRESULT(0x80004004)

-  E_FAIL* = HRESULT(0x80004005)

-  E_ACCESSDENIED* = HRESULT(0x80070005)

-  E_PENDING* = HRESULT(0x8000000A)

-  CO_E_INIT_TLS* = HRESULT(0x80004006)

-  CO_E_INIT_SHARED_ALLOCATOR* = HRESULT(0x80004007)

-  CO_E_INIT_MEMORY_ALLOCATOR* = HRESULT(0x80004008)

-  CO_E_INIT_CLASS_CACHE* = HRESULT(0x80004009)

-  CO_E_INIT_RPC_CHANNEL* = HRESULT(0x8000400A)

-  CO_E_INIT_TLS_SET_CHANNEL_CONTROL* = HRESULT(0x8000400B)

-  CO_E_INIT_TLS_CHANNEL_CONTROL* = HRESULT(0x8000400C)

-  CO_E_INIT_UNACCEPTED_USER_ALLOCATOR* = HRESULT(0x8000400D)

-  CO_E_INIT_SCM_MUTEX_EXISTS* = HRESULT(0x8000400E)

-  CO_E_INIT_SCM_FILE_MAPPING_EXISTS* = HRESULT(0x8000400F)

-  CO_E_INIT_SCM_MAP_VIEW_OF_FILE* = HRESULT(0x80004010)

-  CO_E_INIT_SCM_EXEC_FAILURE* = HRESULT(0x80004011)

-  CO_E_INIT_ONLY_SINGLE_THREADED* = HRESULT(0x80004012)

-  CO_E_CANT_REMOTE* = HRESULT(0x80004013)

-  CO_E_BAD_SERVER_NAME* = HRESULT(0x80004014)

-  CO_E_WRONG_SERVER_IDENTITY* = HRESULT(0x80004015)

-  CO_E_OLE1DDE_DISABLED* = HRESULT(0x80004016)

-  CO_E_RUNAS_SYNTAX* = HRESULT(0x80004017)

-  CO_E_CREATEPROCESS_FAILURE* = HRESULT(0x80004018)

-  CO_E_RUNAS_CREATEPROCESS_FAILURE* = HRESULT(0x80004019)

-  CO_E_RUNAS_LOGON_FAILURE* = HRESULT(0x8000401A)

-  CO_E_LAUNCH_PERMSSION_DENIED* = HRESULT(0x8000401B)

-  CO_E_START_SERVICE_FAILURE* = HRESULT(0x8000401C)

-  CO_E_REMOTE_COMMUNICATION_FAILURE* = HRESULT(0x8000401D)

-  CO_E_SERVER_START_TIMEOUT* = HRESULT(0x8000401E)

-  CO_E_CLSREG_INCONSISTENT* = HRESULT(0x8000401F)

-  CO_E_IIDREG_INCONSISTENT* = HRESULT(0x80004020)

-  CO_E_NOT_SUPPORTED* = HRESULT(0x80004021)

-  CO_E_FIRST* = DWORD(0x800401F0)

-  CO_E_LAST* = DWORD(0x800401FF)

-  CO_S_FIRST* = DWORD(0x000401F0)

-  CO_S_LAST* = DWORD(0x000401FF)

-  S_OK* = HRESULT(0x00000000)

-  S_FALSE* = HRESULT(0x00000001)

-  CO_E_NOTINITIALIZED* = HRESULT(0x800401F0)

-  CO_E_ALREADYINITIALIZED* = HRESULT(0x800401F1)

-  CO_E_CANTDETERMINECLASS* = HRESULT(0x800401F2)

-  CO_E_CLASSSTRING* = HRESULT(0x800401F3)

-  CO_E_IIDSTRING* = HRESULT(0x800401F4)

-  CO_E_APPNOTFOUND* = HRESULT(0x800401F5)

-  CO_E_APPSINGLEUSE* = HRESULT(0x800401F6)

-  CO_E_ERRORINAPP* = HRESULT(0x800401F7)

-  CO_E_DLLNOTFOUND* = HRESULT(0x800401F8)

-  CO_E_ERRORINDLL* = HRESULT(0x800401F9)

-  CO_E_WRONGOSFORAPP* = HRESULT(0x800401FA)

-  CO_E_OBJNOTREG* = HRESULT(0x800401FB)

-  CO_E_OBJISREG* = HRESULT(0x800401FC)

-  CO_E_OBJNOTCONNECTED* = HRESULT(0x800401FD)

-  CO_E_APPDIDNTREG* = HRESULT(0x800401FE)

-  CO_E_RELEASED* = HRESULT(0x800401FF)

-  OLE_E_FIRST* = HRESULT(0x80040000)

-  OLE_E_LAST* = HRESULT(0x800400FF)

-  OLE_S_FIRST* = HRESULT(0x00040000)

-  OLE_S_LAST* = HRESULT(0x000400FF)

-  OLE_E_OLEVERB* = HRESULT(0x80040000)

-  OLE_E_ADVF* = HRESULT(0x80040001)

-  OLE_E_ENUM_NOMORE* = HRESULT(0x80040002)

-  OLE_E_ADVISENOTSUPPORTED* = HRESULT(0x80040003)

-  OLE_E_NOCONNECTION* = HRESULT(0x80040004)

-  OLE_E_NOTRUNNING* = HRESULT(0x80040005)

-  OLE_E_NOCACHE* = HRESULT(0x80040006)

-  OLE_E_BLANK* = HRESULT(0x80040007)

-  OLE_E_CLASSDIFF* = HRESULT(0x80040008)

-  OLE_E_CANT_GETMONIKER* = HRESULT(0x80040009)

-  OLE_E_CANT_BINDTOSOURCE* = HRESULT(0x8004000A)

-  OLE_E_STATIC* = HRESULT(0x8004000B)

-  OLE_E_PROMPTSAVECANCELLED* = HRESULT(0x8004000C)

-  OLE_E_INVALIDRECT* = HRESULT(0x8004000D)

-  OLE_E_WRONGCOMPOBJ* = HRESULT(0x8004000E)

-  OLE_E_INVALIDHWND* = HRESULT(0x8004000F)

-  OLE_E_NOT_INPLACEACTIVE* = HRESULT(0x80040010)

-  OLE_E_CANTCONVERT* = HRESULT(0x80040011)

-  OLE_E_NOSTORAGE* = HRESULT(0x80040012)

-  DV_E_FORMATETC* = HRESULT(0x80040064)

-  DV_E_DVTARGETDEVICE* = HRESULT(0x80040065)

-  DV_E_STGMEDIUM* = HRESULT(0x80040066)

-  DV_E_STATDATA* = HRESULT(0x80040067)

-  DV_E_LINDEX* = HRESULT(0x80040068)

-  DV_E_TYMED* = HRESULT(0x80040069)

-  DV_E_CLIPFORMAT* = HRESULT(0x8004006A)

-  DV_E_DVASPECT* = HRESULT(0x8004006B)

-  DV_E_DVTARGETDEVICE_SIZE* = HRESULT(0x8004006C)

-  DV_E_NOIVIEWOBJECT* = HRESULT(0x8004006D)

-  DRAGDROP_E_FIRST* = DWORD(0x80040100)

-  DRAGDROP_E_LAST* = DWORD(0x8004010F)

-  DRAGDROP_S_FIRST* = DWORD(0x00040100)

-  DRAGDROP_S_LAST* = DWORD(0x0004010F)

-  DRAGDROP_E_NOTREGISTERED* = HRESULT(0x80040100)

-  DRAGDROP_E_ALREADYREGISTERED* = HRESULT(0x80040101)

-  DRAGDROP_E_INVALIDHWND* = HRESULT(0x80040102)

-  CLASSFACTORY_E_FIRST* = DWORD(0x80040110)

-  CLASSFACTORY_E_LAST* = DWORD(0x8004011F)

-  CLASSFACTORY_S_FIRST* = DWORD(0x00040110)

-  CLASSFACTORY_S_LAST* = DWORD(0x0004011F)

-  CLASS_E_NOAGGREGATION* = HRESULT(0x80040110)

-  CLASS_E_CLASSNOTAVAILABLE* = HRESULT(0x80040111)

-  MARSHAL_E_FIRST* = DWORD(0x80040120)

-  MARSHAL_E_LAST* = DWORD(0x8004012F)

-  MARSHAL_S_FIRST* = DWORD(0x00040120)

-  MARSHAL_S_LAST* = DWORD(0x0004012F)

-  DATA_E_FIRST* = DWORD(0x80040130)

-  DATA_E_LAST* = DWORD(0x8004013F)

-  DATA_S_FIRST* = DWORD(0x00040130)

-  DATA_S_LAST* = DWORD(0x0004013F)

-  VIEW_E_FIRST* = DWORD(0x80040140)

-  VIEW_E_LAST* = DWORD(0x8004014F)

-  VIEW_S_FIRST* = DWORD(0x00040140)

-  VIEW_S_LAST* = DWORD(0x0004014F)

-  VIEW_E_DRAW* = HRESULT(0x80040140)

-  REGDB_E_FIRST* = DWORD(0x80040150)

-  REGDB_E_LAST* = DWORD(0x8004015F)

-  REGDB_S_FIRST* = DWORD(0x00040150)

-  REGDB_S_LAST* = DWORD(0x0004015F)

-  REGDB_E_READREGDB* = HRESULT(0x80040150)

-  REGDB_E_WRITEREGDB* = HRESULT(0x80040151)

-  REGDB_E_KEYMISSING* = HRESULT(0x80040152)

-  REGDB_E_INVALIDVALUE* = HRESULT(0x80040153)

-  REGDB_E_CLASSNOTREG* = HRESULT(0x80040154)

-  REGDB_E_IIDNOTREG* = HRESULT(0x80040155)

-  CACHE_E_FIRST* = DWORD(0x80040170)

-  CACHE_E_LAST* = DWORD(0x8004017F)

-  CACHE_S_FIRST* = DWORD(0x00040170)

-  CACHE_S_LAST* = DWORD(0x0004017F)

-  CACHE_E_NOCACHE_UPDATED* = HRESULT(0x80040170)

-  OLEOBJ_E_FIRST* = DWORD(0x80040180)

-  OLEOBJ_E_LAST* = DWORD(0x8004018F)

-  OLEOBJ_S_FIRST* = DWORD(0x00040180)

-  OLEOBJ_S_LAST* = DWORD(0x0004018F)

-  OLEOBJ_E_NOVERBS* = HRESULT(0x80040180)

-  OLEOBJ_E_INVALIDVERB* = HRESULT(0x80040181)

-  CLIENTSITE_E_FIRST* = DWORD(0x80040190)

-  CLIENTSITE_E_LAST* = DWORD(0x8004019F)

-  CLIENTSITE_S_FIRST* = DWORD(0x00040190)

-  CLIENTSITE_S_LAST* = DWORD(0x0004019F)

-  INPLACE_E_NOTUNDOABLE* = HRESULT(0x800401A0)

-  INPLACE_E_NOTOOLSPACE* = HRESULT(0x800401A1)

-  INPLACE_E_FIRST* = DWORD(0x800401A0)

-  INPLACE_E_LAST* = DWORD(0x800401AF)

-  INPLACE_S_FIRST* = DWORD(0x000401A0)

-  INPLACE_S_LAST* = DWORD(0x000401AF)

-  ENUM_E_FIRST* = DWORD(0x800401B0)

-  ENUM_E_LAST* = DWORD(0x800401BF)

-  ENUM_S_FIRST* = DWORD(0x000401B0)

-  ENUM_S_LAST* = DWORD(0x000401BF)

-  CONVERT10_E_FIRST* = DWORD(0x800401C0)

-  CONVERT10_E_LAST* = DWORD(0x800401CF)

-  CONVERT10_S_FIRST* = DWORD(0x000401C0)

-  CONVERT10_S_LAST* = DWORD(0x000401CF)

-  CONVERT10_E_OLESTREAM_GET* = HRESULT(0x800401C0)

-  CONVERT10_E_OLESTREAM_PUT* = HRESULT(0x800401C1)

-  CONVERT10_E_OLESTREAM_FMT* = HRESULT(0x800401C2)

-  CONVERT10_E_OLESTREAM_BITMAP_TO_DIB* = HRESULT(0x800401C3)

-  CONVERT10_E_STG_FMT* = HRESULT(0x800401C4)

-  CONVERT10_E_STG_NO_STD_STREAM* = HRESULT(0x800401C5)

-  CONVERT10_E_STG_DIB_TO_BITMAP* = HRESULT(0x800401C6)

-  CLIPBRD_E_FIRST* = DWORD(0x800401D0)

-  CLIPBRD_E_LAST* = DWORD(0x800401DF)

-  CLIPBRD_S_FIRST* = DWORD(0x000401D0)

-  CLIPBRD_S_LAST* = DWORD(0x000401DF)

-  CLIPBRD_E_CANT_OPEN* = HRESULT(0x800401D0)

-  CLIPBRD_E_CANT_EMPTY* = HRESULT(0x800401D1)

-  CLIPBRD_E_CANT_SET* = HRESULT(0x800401D2)

-  CLIPBRD_E_BAD_DATA* = HRESULT(0x800401D3)

-  CLIPBRD_E_CANT_CLOSE* = HRESULT(0x800401D4)

-  MK_E_FIRST* = DWORD(0x800401E0)

-  MK_E_LAST* = DWORD(0x800401EF)

-  MK_S_FIRST* = DWORD(0x000401E0)

-  MK_S_LAST* = DWORD(0x000401EF)

-  MK_E_CONNECTMANUALLY* = HRESULT(0x800401E0)

-  MK_E_EXCEEDEDDEADLINE* = HRESULT(0x800401E1)

-  MK_E_NEEDGENERIC* = HRESULT(0x800401E2)

-  MK_E_UNAVAILABLE* = HRESULT(0x800401E3)

-  MK_E_SYNTAX* = HRESULT(0x800401E4)

-  MK_E_NOOBJECT* = HRESULT(0x800401E5)

-  MK_E_INVALIDEXTENSION* = HRESULT(0x800401E6)

-  MK_E_INTERMEDIATEINTERFACENOTSUPPORTED* = HRESULT(0x800401E7)

-  MK_E_NOTBINDABLE* = HRESULT(0x800401E8)

-  MK_E_NOTBOUND* = HRESULT(0x800401E9)

-  MK_E_CANTOPENFILE* = HRESULT(0x800401EA)

-  MK_E_MUSTBOTHERUSER* = HRESULT(0x800401EB)

-  MK_E_NOINVERSE* = HRESULT(0x800401EC)

-  MK_E_NOSTORAGE* = HRESULT(0x800401ED)

-  MK_E_NOPREFIX* = HRESULT(0x800401EE)

-  MK_E_ENUMERATION_FAILED* = HRESULT(0x800401EF)

-  OLE_S_USEREG* = HRESULT(0x00040000)

-  OLE_S_STATIC* = HRESULT(0x00040001)

-  OLE_S_MAC_CLIPFORMAT* = HRESULT(0x00040002)

-  DRAGDROP_S_DROP* = HRESULT(0x00040100)

-  DRAGDROP_S_CANCEL* = HRESULT(0x00040101)

-  DRAGDROP_S_USEDEFAULTCURSORS* = HRESULT(0x00040102)

-  DATA_S_SAMEFORMATETC* = HRESULT(0x00040130)

-  VIEW_S_ALREADY_FROZEN* = HRESULT(0x00040140)

-  CACHE_S_FORMATETC_NOTSUPPORTED* = HRESULT(0x00040170)

-  CACHE_S_SAMECACHE* = HRESULT(0x00040171)

-  CACHE_S_SOMECACHES_NOTUPDATED* = HRESULT(0x00040172)

-  OLEOBJ_S_INVALIDVERB* = HRESULT(0x00040180)

-  OLEOBJ_S_CANNOT_DOVERB_NOW* = HRESULT(0x00040181)

-  OLEOBJ_S_INVALIDHWND* = HRESULT(0x00040182)

-  INPLACE_S_TRUNCATED* = HRESULT(0x000401A0)

-  CONVERT10_S_NO_PRESENTATION* = HRESULT(0x000401C0)

-  MK_S_REDUCED_TO_SELF* = HRESULT(0x000401E2)

-  MK_S_ME* = HRESULT(0x000401E4)

-  MK_S_HIM* = HRESULT(0x000401E5)

-  MK_S_US* = HRESULT(0x000401E6)

-  MK_S_MONIKERALREADYREGISTERED* = HRESULT(0x000401E7)

-  CO_E_CLASS_CREATE_FAILED* = HRESULT(0x80080001)

-  CO_E_SCM_ERROR* = HRESULT(0x80080002)

-  CO_E_SCM_RPC_FAILURE* = HRESULT(0x80080003)

-  CO_E_BAD_PATH* = HRESULT(0x80080004)

-  CO_E_SERVER_EXEC_FAILURE* = HRESULT(0x80080005)

-  CO_E_OBJSRV_RPC_FAILURE* = HRESULT(0x80080006)

-  MK_E_NO_NORMALIZED* = HRESULT(0x80080007)

-  CO_E_SERVER_STOPPING* = HRESULT(0x80080008)

-  MEM_E_INVALID_ROOT* = HRESULT(0x80080009)

-  MEM_E_INVALID_LINK* = HRESULT(0x80080010)

-  MEM_E_INVALID_SIZE* = HRESULT(0x80080011)

-  CO_S_NOTALLINTERFACES* = HRESULT(0x00080012)

-  DISP_E_UNKNOWNINTERFACE* = HRESULT(0x80020001)

-  DISP_E_MEMBERNOTFOUND* = HRESULT(0x80020003)

-  DISP_E_PARAMNOTFOUND* = HRESULT(0x80020004)

-  DISP_E_TYPEMISMATCH* = HRESULT(0x80020005)

-  DISP_E_UNKNOWNNAME* = HRESULT(0x80020006)

-  DISP_E_NONAMEDARGS* = HRESULT(0x80020007)

-  DISP_E_BADVARTYPE* = HRESULT(0x80020008)

-  DISP_E_EXCEPTION* = HRESULT(0x80020009)

-  DISP_E_OVERFLOW* = HRESULT(0x8002000A)

-  DISP_E_BADINDEX* = HRESULT(0x8002000B)

-  DISP_E_UNKNOWNLCID* = HRESULT(0x8002000C)

-  DISP_E_ARRAYISLOCKED* = HRESULT(0x8002000D)

-  DISP_E_BADPARAMCOUNT* = HRESULT(0x8002000E)

-  DISP_E_PARAMNOTOPTIONAL* = HRESULT(0x8002000F)

-  DISP_E_BADCALLEE* = HRESULT(0x80020010)

-  DISP_E_NOTACOLLECTION* = HRESULT(0x80020011)

-  TYPE_E_BUFFERTOOSMALL* = HRESULT(0x80028016)

-  TYPE_E_INVDATAREAD* = HRESULT(0x80028018)

-  TYPE_E_UNSUPFORMAT* = HRESULT(0x80028019)

-  TYPE_E_REGISTRYACCESS* = HRESULT(0x8002801C)

-  TYPE_E_LIBNOTREGISTERED* = HRESULT(0x8002801D)

-  TYPE_E_UNDEFINEDTYPE* = HRESULT(0x80028027)

-  TYPE_E_QUALIFIEDNAMEDISALLOWED* = HRESULT(0x80028028)

-  TYPE_E_INVALIDSTATE* = HRESULT(0x80028029)

-  TYPE_E_WRONGTYPEKIND* = HRESULT(0x8002802A)

-  TYPE_E_ELEMENTNOTFOUND* = HRESULT(0x8002802B)

-  TYPE_E_AMBIGUOUSNAME* = HRESULT(0x8002802C)

-  TYPE_E_NAMECONFLICT* = HRESULT(0x8002802D)

-  TYPE_E_UNKNOWNLCID* = HRESULT(0x8002802E)

-  TYPE_E_DLLFUNCTIONNOTFOUND* = HRESULT(0x8002802F)

-  TYPE_E_BADMODULEKIND* = HRESULT(0x800288BD)

-  TYPE_E_SIZETOOBIG* = HRESULT(0x800288C5)

-  TYPE_E_DUPLICATEID* = HRESULT(0x800288C6)

-  TYPE_E_INVALIDID* = HRESULT(0x800288CF)

-  TYPE_E_TYPEMISMATCH* = HRESULT(0x80028CA0)

-  TYPE_E_OUTOFBOUNDS* = HRESULT(0x80028CA1)

-  TYPE_E_IOERROR* = HRESULT(0x80028CA2)

-  TYPE_E_CANTCREATETMPFILE* = HRESULT(0x80028CA3)

-  TYPE_E_CANTLOADLIBRARY* = HRESULT(0x80029C4A)

-  TYPE_E_INCONSISTENTPROPFUNCS* = HRESULT(0x80029C83)

-  TYPE_E_CIRCULARTYPE* = HRESULT(0x80029C84)

-  STG_E_INVALIDFUNCTION* = HRESULT(0x80030001)

-  STG_E_FILENOTFOUND* = HRESULT(0x80030002)

-  STG_E_PATHNOTFOUND* = HRESULT(0x80030003)

-  STG_E_TOOMANYOPENFILES* = HRESULT(0x80030004)

-  STG_E_ACCESSDENIED* = HRESULT(0x80030005)

-  STG_E_INVALIDHANDLE* = HRESULT(0x80030006)

-  STG_E_INSUFFICIENTMEMORY* = HRESULT(0x80030008)

-  STG_E_INVALIDPOINTER* = HRESULT(0x80030009)

-  STG_E_NOMOREFILES* = HRESULT(0x80030012)

-  STG_E_DISKISWRITEPROTECTED* = HRESULT(0x80030013)

-  STG_E_SEEKERROR* = HRESULT(0x80030019)

-  STG_E_WRITEFAULT* = HRESULT(0x8003001D)

-  STG_E_READFAULT* = HRESULT(0x8003001E)

-  STG_E_SHAREVIOLATION* = HRESULT(0x80030020)

-  STG_E_LOCKVIOLATION* = HRESULT(0x80030021)

-  STG_E_FILEALREADYEXISTS* = HRESULT(0x80030050)

-  STG_E_INVALIDPARAMETER* = HRESULT(0x80030057)

-  STG_E_MEDIUMFULL* = HRESULT(0x80030070)

-  STG_E_PROPSETMISMATCHED* = HRESULT(0x800300F0)

-  STG_E_ABNORMALAPIEXIT* = HRESULT(0x800300FA)

-  STG_E_INVALIDHEADER* = HRESULT(0x800300FB)

-  STG_E_INVALIDNAME* = HRESULT(0x800300FC)

-  STG_E_UNKNOWN* = HRESULT(0x800300FD)

-  STG_E_UNIMPLEMENTEDFUNCTION* = HRESULT(0x800300FE)

-  STG_E_INVALIDFLAG* = HRESULT(0x800300FF)

-  STG_E_INUSE* = HRESULT(0x80030100)

-  STG_E_NOTCURRENT* = HRESULT(0x80030101)

-  STG_E_REVERTED* = HRESULT(0x80030102)

-  STG_E_CANTSAVE* = HRESULT(0x80030103)

-  STG_E_OLDFORMAT* = HRESULT(0x80030104)

-  STG_E_OLDDLL* = HRESULT(0x80030105)

-  STG_E_SHAREREQUIRED* = HRESULT(0x80030106)

-  STG_E_NOTFILEBASEDSTORAGE* = HRESULT(0x80030107)

-  STG_E_EXTANTMARSHALLINGS* = HRESULT(0x80030108)

-  STG_E_DOCFILECORRUPT* = HRESULT(0x80030109)

-  STG_E_BADBASEADDRESS* = HRESULT(0x80030110)

-  STG_E_INCOMPLETE* = HRESULT(0x80030201)

-  STG_E_TERMINATED* = HRESULT(0x80030202)

-  STG_S_CONVERTED* = HRESULT(0x00030200)

-  STG_S_BLOCK* = HRESULT(0x00030201)

-  STG_S_RETRYNOW* = HRESULT(0x00030202)

-  STG_S_MONITORING* = HRESULT(0x00030203)

-  RPC_E_CALL_REJECTED* = HRESULT(0x80010001)

-  RPC_E_CALL_CANCELED* = HRESULT(0x80010002)

-  RPC_E_CANTPOST_INSENDCALL* = HRESULT(0x80010003)

-  RPC_E_CANTCALLOUT_INASYNCCALL* = HRESULT(0x80010004)

-  RPC_E_CANTCALLOUT_INEXTERNALCALL* = HRESULT(0x80010005)

-  RPC_E_CONNECTION_TERMINATED* = HRESULT(0x80010006)

-  RPC_E_SERVER_DIED* = HRESULT(0x80010007)

-  RPC_E_CLIENT_DIED* = HRESULT(0x80010008)

-  RPC_E_INVALID_DATAPACKET* = HRESULT(0x80010009)

-  RPC_E_CANTTRANSMIT_CALL* = HRESULT(0x8001000A)

-  RPC_E_CLIENT_CANTMARSHAL_DATA* = HRESULT(0x8001000B)

-  RPC_E_CLIENT_CANTUNMARSHAL_DATA* = HRESULT(0x8001000C)

-  RPC_E_SERVER_CANTMARSHAL_DATA* = HRESULT(0x8001000D)

-  RPC_E_SERVER_CANTUNMARSHAL_DATA* = HRESULT(0x8001000E)

-  RPC_E_INVALID_DATA* = HRESULT(0x8001000F)

-  RPC_E_INVALID_PARAMETER* = HRESULT(0x80010010)

-  RPC_E_CANTCALLOUT_AGAIN* = HRESULT(0x80010011)

-  RPC_E_SERVER_DIED_DNE* = HRESULT(0x80010012)

-  RPC_E_SYS_CALL_FAILED* = HRESULT(0x80010100)

-  RPC_E_OUT_OF_RESOURCES* = HRESULT(0x80010101)

-  RPC_E_ATTEMPTED_MULTITHREAD* = HRESULT(0x80010102)

-  RPC_E_NOT_REGISTERED* = HRESULT(0x80010103)

-  RPC_E_FAULT* = HRESULT(0x80010104)

-  RPC_E_SERVERFAULT* = HRESULT(0x80010105)

-  RPC_E_CHANGED_MODE* = HRESULT(0x80010106)

-  RPC_E_INVALIDMETHOD* = HRESULT(0x80010107)

-  RPC_E_DISCONNECTED* = HRESULT(0x80010108)

-  RPC_E_RETRY* = HRESULT(0x80010109)

-  RPC_E_SERVERCALL_RETRYLATER* = HRESULT(0x8001010A)

-  RPC_E_SERVERCALL_REJECTED* = HRESULT(0x8001010B)

-  RPC_E_INVALID_CALLDATA* = HRESULT(0x8001010C)

-  RPC_E_CANTCALLOUT_ININPUTSYNCCALL* = HRESULT(0x8001010D)

-  RPC_E_WRONG_THREAD* = HRESULT(0x8001010E)

-  RPC_E_THREAD_NOT_INIT* = HRESULT(0x8001010F)

-  RPC_E_VERSION_MISMATCH* = HRESULT(0x80010110)

-  RPC_E_INVALID_HEADER* = HRESULT(0x80010111)

-  RPC_E_INVALID_EXTENSION* = HRESULT(0x80010112)

-  RPC_E_INVALID_IPID* = HRESULT(0x80010113)

-  RPC_E_INVALID_OBJECT* = HRESULT(0x80010114)

-  RPC_S_CALLPENDING* = HRESULT(0x80010115)

-  RPC_S_WAITONTIMER* = HRESULT(0x80010116)

-  RPC_E_CALL_COMPLETE* = HRESULT(0x80010117)

-  RPC_E_UNSECURE_CALL* = HRESULT(0x80010118)

-  RPC_E_TOO_LATE* = HRESULT(0x80010119)

-  RPC_E_NO_GOOD_SECURITY_PACKAGES* = HRESULT(0x8001011A)

-  RPC_E_ACCESS_DENIED* = HRESULT(0x8001011B)

-  RPC_E_REMOTE_DISABLED* = HRESULT(0x8001011C)

-  RPC_E_INVALID_OBJREF* = HRESULT(0x8001011D)

-  RPC_E_UNEXPECTED* = HRESULT(0x8001FFFF)

-  NTE_BAD_UID* = HRESULT(0x80090001)

-  NTE_BAD_HASH* = HRESULT(0x80090002)

-  NTE_BAD_KEY* = HRESULT(0x80090003)

-  NTE_BAD_LEN* = HRESULT(0x80090004)

-  NTE_BAD_DATA* = HRESULT(0x80090005)

-  NTE_BAD_SIGNATURE* = HRESULT(0x80090006)

-  NTE_BAD_VER* = HRESULT(0x80090007)

-  NTE_BAD_ALGID* = HRESULT(0x80090008)

-  NTE_BAD_FLAGS* = HRESULT(0x80090009)

-  NTE_BAD_TYPE* = HRESULT(0x8009000A)

-  NTE_BAD_KEY_STATE* = HRESULT(0x8009000B)

-  NTE_BAD_HASH_STATE* = HRESULT(0x8009000C)

-  NTE_NO_KEY* = HRESULT(0x8009000D)

-  NTE_NO_MEMORY* = HRESULT(0x8009000E)

-  NTE_EXISTS* = HRESULT(0x8009000F)

-  NTE_PERM* = HRESULT(0x80090010)

-  NTE_NOT_FOUND* = HRESULT(0x80090011)

-  NTE_DOUBLE_ENCRYPT* = HRESULT(0x80090012)

-  NTE_BAD_PROVIDER* = HRESULT(0x80090013)

-  NTE_BAD_PROV_TYPE* = HRESULT(0x80090014)

-  NTE_BAD_PUBLIC_KEY* = HRESULT(0x80090015)

-  NTE_BAD_KEYSET* = HRESULT(0x80090016)

-  NTE_PROV_TYPE_NOT_DEF* = HRESULT(0x80090017)

-  NTE_PROV_TYPE_ENTRY_BAD* = HRESULT(0x80090018)

-  NTE_KEYSET_NOT_DEF* = HRESULT(0x80090019)

-  NTE_KEYSET_ENTRY_BAD* = HRESULT(0x8009001A)

-  NTE_PROV_TYPE_NO_MATCH* = HRESULT(0x8009001B)

-  NTE_SIGNATURE_FILE_BAD* = HRESULT(0x8009001C)

-  NTE_PROVIDER_DLL_FAIL* = HRESULT(0x8009001D)

-  NTE_PROV_DLL_NOT_FOUND* = HRESULT(0x8009001E)

-  NTE_BAD_KEYSET_PARAM* = HRESULT(0x8009001F)

-  NTE_FAIL* = HRESULT(0x80090020)

-  NTE_SYS_ERR* = HRESULT(0x80090021)

-  NTE_OP_OK* = HRESULT(0)

-  TRUST_E_PROVIDER_UNKNOWN* = HRESULT(0x800B0001)

-  TRUST_E_ACTION_UNKNOWN* = HRESULT(0x800B0002)

-  TRUST_E_SUBJECT_FORM_UNKNOWN* = HRESULT(0x800B0003)

-  TRUST_E_SUBJECT_NOT_TRUSTED* = HRESULT(0x800B0004)

-  DIGSIG_E_ENCODE* = HRESULT(0x800B0005)

-  DIGSIG_E_DECODE* = HRESULT(0x800B0006)

-  DIGSIG_E_EXTENSIBILITY* = HRESULT(0x800B0007)

-  DIGSIG_E_CRYPTO* = HRESULT(0x800B0008)

-  PERSIST_E_SIZEDEFINITE* = HRESULT(0x800B0009)

-  PERSIST_E_SIZEINDEFINITE* = HRESULT(0x800B000A)

-  PERSIST_E_NOTSELFSIZING* = HRESULT(0x800B000B)

-  TRUST_E_NOSIGNATURE* = HRESULT(0x800B0100)

-  CERT_E_EXPIRED* = HRESULT(0x800B0101)

-  CERT_E_VALIDIYPERIODNESTING* = HRESULT(0x800B0102)

-  CERT_E_ROLE* = HRESULT(0x800B0103)

-  CERT_E_PATHLENCONST* = HRESULT(0x800B0104)

-  CERT_E_CRITICAL* = HRESULT(0x800B0105)

-  CERT_E_PURPOSE* = HRESULT(0x800B0106)

-  CERT_E_ISSUERCHAINING* = HRESULT(0x800B0107)

-  CERT_E_MALFORMED* = HRESULT(0x800B0108)

-  CERT_E_UNTRUSTEDROOT* = HRESULT(0x800B0109)

-  CERT_E_CHAINING* = HRESULT(0x800B010A)

-

-proc UNICODE_NULL*(): WCHAR

-const

-  LF_FACESIZE* = 32

-  LF_FULLFACESIZE* = 64

-  ELF_VENDOR_SIZE* = 4

-  SECURITY_STATIC_TRACKING* = 0

-  SECURITY_DYNAMIC_TRACKING* = 1

-  MAX_DEFAULTCHAR* = 2

-  MAX_LEADBYTES* = 12

-  EXCEPTION_MAXIMUM_PARAMETERS* = 15

-  CCHDEVICENAME* = 32

-  CCHFORMNAME* = 32

-  MENU_TEXT_LEN* = 40

-  MAX_LANA* = 254

-  NCBNAMSZ* = 16

-  NETBIOS_NAME_LEN* = 16

-  OFS_MAXPATHNAME* = 128

-  MAX_TAB_STOPS* = 32

-  ANYSIZE_ARRAY* = 1

-  RAS_MaxCallbackNumber* = 128

-  RAS_MaxDeviceName* = 128

-  RAS_MaxDeviceType* = 16

-  RAS_MaxEntryName* = 256

-  RAS_MaxIpAddress* = 15

-  RAS_MaxIpxAddress* = 21

-  RAS_MaxPhoneNumber* = 128

-  UNLEN* = 256

-  PWLEN* = 256

-  CNLEN* = 15

-  DNLEN* = 15

-  # Unsigned types max

-  MAXDWORD* = 0xFFFFFFFF

-  MAXWORD* = 0x0000FFFF

-  MAXBYTE* = 0x000000FF

-  # Signed types max/min

-  MINCHAR* = 0x00000080

-  MAXCHAR* = 0x0000007F

-  MINSHORT* = 0x00008000

-  MAXSHORT* = 0x00007FFF

-  MINLONG* = 0x80000000

-  MAXLONG* = 0x7FFFFFFF

-  # _llseek

-  FILE_BEGIN* = 0

-  FILE_CURRENT* = 1

-  FILE_END* = 2

-  # _lopen, LZOpenFile, OpenFile

-  OF_READ* = 0

-  OF_READWRITE* = 2

-  OF_WRITE* = 1

-  OF_SHARE_COMPAT* = 0

-  OF_SHARE_DENY_NONE* = 64

-  OF_SHARE_DENY_READ* = 48

-  OF_SHARE_DENY_WRITE* = 32

-  OF_SHARE_EXCLUSIVE* = 16

-  OF_CANCEL* = 2048

-  OF_CREATE* = 4096

-  OF_DELETE* = 512

-  OF_EXIST* = 16384

-  OF_PARSE* = 256

-  OF_PROMPT* = 8192

-  OF_REOPEN* = 32768

-  OF_VERIFY* = 1024

-  # ActivateKeyboardLayout, LoadKeyboardLayout

-  HKL_NEXT* = 1

-  HKL_PREV* = 0

-  KLF_REORDER* = 8

-  KLF_UNLOADPREVIOUS* = 4

-  KLF_ACTIVATE* = 1

-  KLF_NOTELLSHELL* = 128

-  KLF_REPLACELANG* = 16

-  KLF_SUBSTITUTE_OK* = 2

-  # AppendMenu

-  MF_BITMAP* = 0x00000004

-  MF_DISABLED* = 0x00000002

-  MF_ENABLED* = 0

-  MF_GRAYED* = 0x00000001

-  MF_HELP* = 0x00004000

-  MF_MENUBARBREAK* = 0x00000020

-  MF_MENUBREAK* = 0x00000040

-  MF_MOUSESELECT* = 0x00008000

-  MF_OWNERDRAW* = 0x00000100

-  MF_POPUP* = 0x00000010

-  MF_SEPARATOR* = 0x00000800

-  MF_STRING* = 0

-  MF_SYSMENU* = 0x00002000

-  MF_USECHECKBITMAPS* = 0x00000200

-  # Ternary Raster Operations - BitBlt

-  BLACKNESS* = 0x00000042

-  NOTSRCERASE* = 0x001100A6

-  NOTSRCCOPY* = 0x00330008

-  SRCERASE* = 0x00440328

-  DSTINVERT* = 0x00550009

-  PATINVERT* = 0x005A0049

-  SRCINVERT* = 0x00660046

-  SRCAND* = 0x008800C6

-  MERGEPAINT* = 0x00BB0226

-  MERGECOPY* = 0x00C000CA

-  SRCCOPY* = 0x00CC0020

-  SRCPAINT* = 0x00EE0086

-  PATCOPY* = 0x00F00021

-  PATPAINT* = 0x00FB0A09

-  WHITENESS* = 0x00FF0062

-  # Binary Raster Operations

-  R2_BLACK* = 1

-  R2_COPYPEN* = 13

-  R2_MASKNOTPEN* = 3

-  R2_MASKPEN* = 9

-  R2_MASKPENNOT* = 5

-  R2_MERGENOTPEN* = 12

-  R2_MERGEPEN* = 15

-  R2_MERGEPENNOT* = 14

-  R2_NOP* = 11

-  R2_NOT* = 6

-  R2_NOTCOPYPEN* = 4

-  R2_NOTMASKPEN* = 8

-  R2_NOTMERGEPEN* = 2

-  R2_NOTXORPEN* = 10

-  R2_WHITE* = 16

-  R2_XORPEN* = 7

-  # BroadcastSystemMessage

-  BSF_FLUSHDISK* = 4

-  BSF_FORCEIFHUNG* = 32

-  BSF_IGNORECURRENTTASK* = 2

-  BSF_NOHANG* = 8

-  BSF_POSTMESSAGE* = 16

-  BSF_QUERY* = 1

-  BSM_ALLCOMPONENTS* = 0

-  BSM_APPLICATIONS* = 8

-  BSM_INSTALLABLEDRIVERS* = 4

-  BSM_NETDRIVER* = 2

-  BSM_VXDS* = 1

-  BROADCAST_QUERY_DENY* = 1112363332

-                                     # CallNamedPipe

-  NMPWAIT_NOWAIT* = 1

-  NMPWAIT_WAIT_FOREVER* = -1

-  NMPWAIT_USE_DEFAULT_WAIT* = 0

-  # CascadeWindows, TileWindows

-  MDITILE_SKIPDISABLED* = 2

-  MDITILE_HORIZONTAL* = 1

-  MDITILE_VERTICAL* = 0

-  # CBTProc

-  HCBT_ACTIVATE* = 5

-  HCBT_CLICKSKIPPED* = 6

-  HCBT_CREATEWND* = 3

-  HCBT_DESTROYWND* = 4

-  HCBT_KEYSKIPPED* = 7

-  HCBT_MINMAX* = 1

-  HCBT_MOVESIZE* = 0

-  HCBT_QS* = 2

-  HCBT_SETFOCUS* = 9

-  HCBT_SYSCOMMAND* = 8

-

-  CDS_UPDATEREGISTRY* = 1

-  CDS_TEST* = 2

-  CDS_FULLSCREEN* = 4

-  CDS_GLOBAL* = 8

-  CDS_SET_PRIMARY* = 0x00000010

-  CDS_RESET* = 0x40000000

-  CDS_SETRECT* = 0x20000000

-  CDS_NORESET* = 0x10000000

-  DISP_CHANGE_SUCCESSFUL* = 0

-  DISP_CHANGE_RESTART* = 1

-  DISP_CHANGE_BADFLAGS* = -4

-  DISP_CHANGE_FAILED* = -1

-  DISP_CHANGE_BADMODE* = -2

-  DISP_CHANGE_NOTUPDATED* = -3

-  # ChangeServiceConfig

-  SERVICE_NO_CHANGE* = -1

-  SERVICE_WIN32_OWN_PROCESS* = 16

-  SERVICE_WIN32_SHARE_PROCESS* = 32

-  SERVICE_KERNEL_DRIVER* = 1

-  SERVICE_FILE_SYSTEM_DRIVER* = 2

-  SERVICE_INTERACTIVE_PROCESS* = 256

-  SERVICE_BOOT_START* = 0

-  SERVICE_SYSTEM_START* = 1

-  SERVICE_AUTO_START* = 2

-  SERVICE_DEMAND_START* = 3

-  SERVICE_DISABLED* = 4

-  SERVICE_STOPPED* = 1

-  SERVICE_START_PENDING* = 2

-  SERVICE_STOP_PENDING* = 3

-  SERVICE_RUNNING* = 4

-  SERVICE_CONTINUE_PENDING* = 5

-  SERVICE_PAUSE_PENDING* = 6

-  SERVICE_PAUSED* = 7

-  SERVICE_ACCEPT_STOP* = 1

-  SERVICE_ACCEPT_PAUSE_CONTINUE* = 2

-  SERVICE_ACCEPT_SHUTDOWN* = 4

-  # CheckDlgButton

-  BST_CHECKED* = 1

-  BST_INDETERMINATE* = 2

-  BST_UNCHECKED* = 0

-  BST_FOCUS* = 8

-  BST_PUSHED* = 4

-  # CheckMenuItem, HiliteMenuItem

-  MF_BYCOMMAND* = 0

-  MF_BYPOSITION* = 0x00000400

-  MF_CHECKED* = 0x00000008

-  MF_UNCHECKED* = 0

-  MF_HILITE* = 0x00000080

-  MF_UNHILITE* = 0

-  # ChildWindowFromPointEx

-  CWP_ALL* = 0

-  CWP_SKIPINVISIBLE* = 1

-  CWP_SKIPDISABLED* = 2

-  CWP_SKIPTRANSPARENT* = 4

-  # ClearCommError

-  CE_BREAK* = 16

-  CE_DNS* = 2048

-  CE_FRAME* = 8

-  CE_IOE* = 1024

-  CE_MODE* = 32768

-  CE_OOP* = 4096

-  CE_OVERRUN* = 2

-  CE_PTO* = 512

-  CE_RXOVER* = 1

-  CE_RXPARITY* = 4

-  CE_TXFULL* = 256

-                              # CombineRgn

-  RGN_AND* = 1

-  RGN_COPY* = 5

-  RGN_DIFF* = 4

-  RGN_OR* = 2

-  RGN_XOR* = 3

-  NULLREGION* = 1

-  SIMPLEREGION* = 2

-  COMPLEXREGION* = 3

-  ERROR* = 0

-  # CommonDlgExtendedError

-  CDERR_DIALOGFAILURE* = 0x0000FFFF

-  CDERR_FINDRESFAILURE* = 6

-  CDERR_INITIALIZATION* = 2

-  CDERR_LOADRESFAILURE* = 7

-  CDERR_LOADSTRFAILURE* = 5

-  CDERR_LOCKRESFAILURE* = 8

-  CDERR_MEMALLOCFAILURE* = 9

-  CDERR_MEMLOCKFAILURE* = 10

-  CDERR_NOHINSTANCE* = 4

-  CDERR_NOHOOK* = 11

-  CDERR_NOTEMPLATE* = 3

-  CDERR_REGISTERMSGFAIL* = 12

-  CDERR_STRUCTSIZE* = 1

-  PDERR_CREATEICFAILURE* = 0x00001000 + 10

-  PDERR_DEFAULTDIFFERENT* = 0x00001000 + 12

-  PDERR_DNDMMISMATCH* = 0x00001000 + 9

-  PDERR_GETDEVMODEFAIL* = 0x00001000 + 5

-  PDERR_INITFAILURE* = 0x00001000 + 6

-  PDERR_LOADDRVFAILURE* = 0x00001000 + 4

-  PDERR_NODEFAULTPRN* = 0x00001000 + 8

-  PDERR_NODEVICES* = 0x00001000 + 7

-  PDERR_PARSEFAILURE* = 0x00001000 + 2

-  PDERR_PRINTERNOTFOUND* = 0x00001000 + 11

-  PDERR_RETDEFFAILURE* = 0x00001000 + 3

-  PDERR_SETUPFAILURE* = 0x00001000 + 1

-  CFERR_MAXLESSTHANMIN* = 0x00002000 + 2

-  CFERR_NOFONTS* = 0x00002000 + 1

-  FNERR_BUFFERTOOSMALL* = 0x00003000 + 3

-  FNERR_INVALIDFILENAME* = 0x00003000 + 2

-  FNERR_SUBCLASSFAILURE* = 0x00003000 + 1

-  FRERR_BUFFERLENGTHZERO* = 0x00004000 + 1

-  # CompareString, LCMapString

-  LOCALE_SYSTEM_DEFAULT* = 0x00000800

-  LOCALE_USER_DEFAULT* = 0x00000400

-  NORM_IGNORECASE* = 1

-  NORM_IGNOREKANATYPE* = 65536

-  NORM_IGNORENONSPACE* = 2

-  NORM_IGNORESYMBOLS* = 4

-  NORM_IGNOREWIDTH* = 131072

-  SORT_STRINGSORT* = 4096

-  LCMAP_BYTEREV* = 2048

-  LCMAP_FULLWIDTH* = 8388608

-  LCMAP_HALFWIDTH* = 4194304

-  LCMAP_HIRAGANA* = 1048576

-  LCMAP_KATAKANA* = 2097152

-  LCMAP_LOWERCASE* = 256

-  LCMAP_SORTKEY* = 1024

-  LCMAP_UPPERCASE* = 512

-  # ContinueDebugEvent

-  DBG_CONTINUE* = 0x00010002

-  DBG_CONTROL_BREAK* = 0x40010008

-  DBG_CONTROL_C* = 0x40010005

-  DBG_EXCEPTION_NOT_HANDLED* = 0x80010001

-  DBG_TERMINATE_THREAD* = 0x40010003

-  DBG_TERMINATE_PROCESS* = 0x40010004

-  # ControlService

-  SERVICE_CONTROL_STOP* = 1

-  SERVICE_CONTROL_PAUSE* = 2

-  SERVICE_CONTROL_CONTINUE* = 3

-  SERVICE_CONTROL_INTERROGATE* = 4

-  SERVICE_CONTROL_SHUTDOWN* = 5

-  # CopyImage, LoadImage

-  IMAGE_BITMAP* = 0

-  IMAGE_CURSOR* = 2

-  IMAGE_ENHMETAFILE* = 1

-  IMAGE_ICON* = 1

-  LR_MONOCHROME* = 1

-  LR_COLOR* = 2

-  LR_COPYRETURNORG* = 4

-  LR_COPYDELETEORG* = 8

-  LR_DEFAULTSIZE* = 64

-  LR_CREATEDIBSECTION* = 8192

-  LR_COPYFROMRESOURCE* = 0x00004000

-  LR_SHARED* = 0x00008000

-  # CreateDesktop

-  DF_ALLOWOTHERACCOUNTHOOK* = 0x00000001

-  DESKTOP_CREATEMENU* = 0x00000004

-  DESKTOP_CREATEWINDOW* = 0x00000002

-  DESKTOP_ENUMERATE* = 0x00000040

-  DESKTOP_HOOKCONTROL* = 0x00000008

-  DESKTOP_JOURNALPLAYBACK* = 0x00000020

-  DESKTOP_JOURNALRECORD* = 0x00000010

-  DESKTOP_READOBJECTS* = 0x00000001

-  DESKTOP_SWITCHDESKTOP* = 0x00000100

-  DESKTOP_WRITEOBJECTS* = 0x00000080

-  WSF_VISIBLE* = 0x00000001

-  # CreateDIBitmap

-  CBM_INIT* = 0x00000004

-  DIB_PAL_COLORS* = 1

-  DIB_RGB_COLORS* = 0

-  # CreateFile, GetFileAttributes, SetFileAttributes

-  GENERIC_READ* = 0x80000000

-  GENERIC_WRITE* = 0x40000000

-  FILE_READ_DATA* = 0x00000001 # file & pipe

-  FILE_LIST_DIRECTORY* = 0x00000001 # directory

-  FILE_WRITE_DATA* = 0x00000002 # file & pipe

-  FILE_ADD_FILE* = 0x00000002 # directory

-  FILE_APPEND_DATA* = 0x00000004 # file

-  FILE_ADD_SUBDIRECTORY* = 0x00000004 # directory

-  FILE_CREATE_PIPE_INSTANCE* = 0x00000004 # named pipe

-  FILE_READ_EA* = 0x00000008 # file & directory

-  FILE_READ_PROPERTIES* = FILE_READ_EA

-  FILE_WRITE_EA* = 0x00000010 # file & directory

-  FILE_WRITE_PROPERTIES* = FILE_WRITE_EA

-  FILE_EXECUTE* = 0x00000020 # file

-  FILE_TRAVERSE* = 0x00000020 # directory

-  FILE_DELETE_CHILD* = 0x00000040 # directory

-  FILE_READ_ATTRIBUTES* = 0x00000080 # all

-  FILE_WRITE_ATTRIBUTES* = 0x00000100 # all

-  FILE_SHARE_DELETE* = 4

-  FILE_SHARE_READ* = 1

-  FILE_SHARE_WRITE* = 2

-  CONSOLE_TEXTMODE_BUFFER* = 1

-  CREATE_NEW* = 1

-  CREATE_ALWAYS* = 2

-  OPEN_EXISTING* = 3

-  OPEN_ALWAYS* = 4

-  TRUNCATE_EXISTING* = 5

-  FILE_ATTRIBUTE_ARCHIVE* = 32

-  FILE_ATTRIBUTE_COMPRESSED* = 2048

-  FILE_ATTRIBUTE_NORMAL* = 128

-  FILE_ATTRIBUTE_DIRECTORY* = 16

-  FILE_ATTRIBUTE_HIDDEN* = 2

-  FILE_ATTRIBUTE_READONLY* = 1

-  FILE_ATTRIBUTE_SYSTEM* = 4

-  FILE_ATTRIBUTE_TEMPORARY* = 256

-  FILE_FLAG_WRITE_THROUGH* = 0x80000000

-  FILE_FLAG_OVERLAPPED* = 1073741824

-  FILE_FLAG_NO_BUFFERING* = 536870912

-  FILE_FLAG_RANDOM_ACCESS* = 268435456

-  FILE_FLAG_SEQUENTIAL_SCAN* = 134217728

-  FILE_FLAG_DELETE_ON_CLOSE* = 67108864

-  FILE_FLAG_BACKUP_SEMANTICS* = 33554432

-  FILE_FLAG_POSIX_SEMANTICS* = 16777216

-  cSECURITY_ANONYMOUS* = 0

-  cSECURITY_IDENTIFICATION* = 65536

-  cSECURITY_IMPERSONATION* = 131072

-  cSECURITY_DELEGATION* = 196608

-  cSECURITY_CONTEXT_TRACKING* = 262144

-  cSECURITY_EFFECTIVE_ONLY* = 524288

-  cSECURITY_SQOS_PRESENT* = 1048576

-  # CreateFileMapping, VirtualAlloc, VirtualFree, VirtualProtect

-  SEC_COMMIT* = 134217728

-  SEC_IMAGE* = 16777216

-  SEC_NOCACHE* = 268435456

-  SEC_RESERVE* = 67108864

-  PAGE_READONLY* = 2

-  PAGE_READWRITE* = 4

-  PAGE_WRITECOPY* = 8

-  PAGE_EXECUTE* = 16

-  PAGE_EXECUTE_READ* = 32

-  PAGE_EXECUTE_READWRITE* = 64

-  PAGE_EXECUTE_WRITECOPY* = 128

-  PAGE_GUARD* = 256

-  PAGE_NOACCESS* = 1

-  PAGE_NOCACHE* = 512

-  MEM_COMMIT* = 4096

-  MEM_FREE* = 65536

-  MEM_RESERVE* = 8192

-  MEM_IMAGE* = 16777216

-  MEM_MAPPED* = 262144

-  MEM_PRIVATE* = 131072

-  MEM_DECOMMIT* = 16384

-  MEM_RELEASE* = 32768

-  MEM_TOP_DOWN* = 1048576

-  EXCEPTION_GUARD_PAGE* = 0x80000001

-  SECTION_EXTEND_SIZE* = 0x00000010

-  SECTION_MAP_READ* = 0x00000004

-  SECTION_MAP_WRITE* = 0x00000002

-  SECTION_QUERY* = 0x00000001

-  SECTION_ALL_ACCESS* = 0x000F001F

-  # CreateFont

-  FW_DONTCARE* = 0

-  FW_THIN* = 100

-  FW_EXTRALIGHT* = 200

-  FW_LIGHT* = 300

-  FW_NORMAL* = 400

-  FW_REGULAR* = FW_NORMAL

-  FW_MEDIUM* = 500

-  FW_SEMIBOLD* = 600

-  FW_BOLD* = 700

-  FW_EXTRABOLD* = 800

-  FW_HEAVY* = 900

-  ANSI_CHARSET* = 0

-  DEFAULT_CHARSET* = 1

-  SYMBOL_CHARSET* = 2

-  SHIFTJIS_CHARSET* = 128

-  HANGEUL_CHARSET* = 129

-  GB2312_CHARSET* = 134

-  CHINESEBIG5_CHARSET* = 136

-  GREEK_CHARSET* = 161

-  TURKISH_CHARSET* = 162

-  HEBREW_CHARSET* = 177

-  ARABIC_CHARSET* = 178

-  BALTIC_CHARSET* = 186

-  RUSSIAN_CHARSET* = 204

-  THAI_CHARSET* = 222

-  EASTEUROPE_CHARSET* = 238

-  OEM_CHARSET* = 255

-  OUT_DEFAULT_PRECIS* = 0

-  OUT_STRING_PRECIS* = 1

-  OUT_CHARACTER_PRECIS* = 2

-  OUT_STROKE_PRECIS* = 3

-  OUT_TT_PRECIS* = 4

-  OUT_DEVICE_PRECIS* = 5

-  OUT_RASTER_PRECIS* = 6

-  OUT_TT_ONLY_PRECIS* = 7

-  OUT_OUTLINE_PRECIS* = 8

-  CLIP_DEFAULT_PRECIS* = 0

-  CLIP_CHARACTER_PRECIS* = 1

-  CLIP_STROKE_PRECIS* = 2

-  CLIP_MASK* = 15

-  CLIP_LH_ANGLES* = 16

-  CLIP_TT_ALWAYS* = 32

-  CLIP_EMBEDDED* = 128

-  DEFAULT_QUALITY* = 0

-  DRAFT_QUALITY* = 1

-  PROOF_QUALITY* = 2

-  NONANTIALIASED_QUALITY* = 3

-  ANTIALIASED_QUALITY* = 4

-  DEFAULT_PITCH* = 0

-  FIXED_PITCH* = 1

-  VARIABLE_PITCH* = 2

-  MONO_FONT* = 8

-  FF_DECORATIVE* = 80

-  FF_DONTCARE* = 0

-  FF_MODERN* = 48

-  FF_ROMAN* = 16

-  FF_SCRIPT* = 64

-  FF_SWISS* = 32

-  # CreateHatchBrush

-  HS_BDIAGONAL* = 3

-  HS_CROSS* = 4

-  HS_DIAGCROSS* = 5

-  HS_FDIAGONAL* = 2

-  HS_HORIZONTAL* = 0

-  HS_VERTICAL* = 1

-  # CreateIconFromResourceEx

-  LR_DEFAULTCOLOR* = 0

-  LR_LOADREALSIZE* = 128

-                              # CreateMailslot, GetMailslotInfo

-  MAILSLOT_WAIT_FOREVER* = 0xFFFFFFFF

-  MAILSLOT_NO_MESSAGE* = 0xFFFFFFFF

-  # CreateMappedBitmap

-  CMB_MASKED* = 2

-  # CreateNamedPipe

-  PIPE_ACCESS_DUPLEX* = 3

-  PIPE_ACCESS_INBOUND* = 1

-  PIPE_ACCESS_OUTBOUND* = 2

-  WRITE_DAC* = 0x00040000

-  WRITE_OWNER* = 0x00080000

-  ACCESS_SYSTEM_SECURITY* = 0x01000000

-  PIPE_TYPE_BYTE* = 0

-  PIPE_TYPE_MESSAGE* = 4

-  PIPE_READMODE_BYTE* = 0

-  PIPE_READMODE_MESSAGE* = 2

-  PIPE_WAIT* = 0

-  PIPE_NOWAIT* = 1

-  # CreatePen, ExtCreatePen

-  PS_GEOMETRIC* = 65536

-  PS_COSMETIC* = 0

-  PS_ALTERNATE* = 8

-  PS_SOLID* = 0

-  PS_DASH* = 1

-  PS_DOT* = 2

-  PS_DASHDOT* = 3

-  PS_DASHDOTDOT* = 4

-  PS_NULL* = 5

-  PS_USERSTYLE* = 7

-  PS_INSIDEFRAME* = 6

-  PS_ENDCAP_ROUND* = 0

-  PS_ENDCAP_SQUARE* = 256

-  PS_ENDCAP_FLAT* = 512

-  PS_JOIN_BEVEL* = 4096

-  PS_JOIN_MITER* = 8192

-  PS_JOIN_ROUND* = 0

-  PS_STYLE_MASK* = 15

-  PS_ENDCAP_MASK* = 3840

-  PS_TYPE_MASK* = 983040

-  # CreatePolygonRgn

-  ALTERNATE* = 1

-  WINDING* = 2

-  # CreateProcess

-  CREATE_DEFAULT_ERROR_MODE* = 67108864

-  CREATE_NEW_CONSOLE* = 16

-  CREATE_NEW_PROCESS_GROUP* = 512

-  CREATE_SEPARATE_WOW_VDM* = 2048

-  CREATE_SUSPENDED* = 4

-  CREATE_UNICODE_ENVIRONMENT* = 1024

-  DEBUG_PROCESS* = 1

-  DEBUG_ONLY_THIS_PROCESS* = 2

-  DETACHED_PROCESS* = 8

-  HIGH_PRIORITY_CLASS* = 128

-  IDLE_PRIORITY_CLASS* = 64

-  NORMAL_PRIORITY_CLASS* = 32

-  REALTIME_PRIORITY_CLASS* = 256

-  # CreateService

-  SERVICE_ALL_ACCESS* = 0x000F01FF

-  SERVICE_CHANGE_CONFIG* = 2

-  SERVICE_ENUMERATE_DEPENDENTS* = 8

-  SERVICE_INTERROGATE* = 128

-  SERVICE_PAUSE_CONTINUE* = 64

-  SERVICE_QUERY_CONFIG* = 1

-  SERVICE_QUERY_STATUS* = 4

-  SERVICE_START* = 16

-  SERVICE_STOP* = 32

-  SERVICE_USER_DEFINED_CONTROL* = 256

-  SERVICE_DELETE* = 0x00010000

-  SERVICE_READ_CONTROL* = 0x00020000

-  SERVICE_GENERIC_EXECUTE* = 0x20000000

-  SERVICE_ERROR_IGNORE* = 0

-  SERVICE_ERROR_NORMAL* = 1

-  SERVICE_ERROR_SEVERE* = 2

-  SERVICE_ERROR_CRITICAL* = 3

-  # CreateTapePartition, WriteTapemark

-  TAPE_FIXED_PARTITIONS* = 0

-  TAPE_INITIATOR_PARTITIONS* = 0x00000002

-  TAPE_SELECT_PARTITIONS* = 0x00000001

-  TAPE_FILEMARKS* = 0x00000001

-  TAPE_LONG_FILEMARKS* = 0x00000003

-  TAPE_SETMARKS* = 0

-  TAPE_SHORT_FILEMARKS* = 0x00000002

-  # CreateWindow

-  CW_USEDEFAULT* = int32(0x80000000)

-  WS_BORDER* = 0x00800000

-  WS_CAPTION* = 0x00C00000

-  WS_CHILD* = 0x40000000

-  WS_CHILDWINDOW* = 0x40000000

-  WS_CLIPCHILDREN* = 0x02000000

-  WS_CLIPSIBLINGS* = 0x04000000

-  WS_DISABLED* = 0x08000000

-  WS_DLGFRAME* = 0x00400000

-  WS_GROUP* = 0x00020000

-  WS_HSCROLL* = 0x00100000

-  WS_ICONIC* = 0x20000000

-  WS_MAXIMIZE* = 0x01000000

-  WS_MAXIMIZEBOX* = 0x00010000

-  WS_MINIMIZE* = 0x20000000

-  WS_MINIMIZEBOX* = 0x00020000

-  WS_OVERLAPPED* = 0

-  WS_OVERLAPPEDWINDOW* = 0x00CF0000

-  WS_POPUP* = LONG(0x80000000)

-  WS_POPUPWINDOW* = LONG(0x80880000)

-  WS_SIZEBOX* = 0x00040000

-  WS_SYSMENU* = 0x00080000

-  WS_TABSTOP* = 0x00010000

-  WS_THICKFRAME* = 0x00040000

-

-  WS_TILED* = 0

-  WS_TILEDWINDOW* = 0x00CF0000

-  WS_VISIBLE* = 0x10000000

-  WS_VSCROLL* = 0x00200000

-  MDIS_ALLCHILDSTYLES* = 0x00000001

-  BS_3STATE* = 0x00000005

-  BS_AUTO3STATE* = 0x00000006

-  BS_AUTOCHECKBOX* = 0x00000003

-  BS_AUTORADIOBUTTON* = 0x00000009

-  BS_BITMAP* = 0x00000080

-  BS_BOTTOM* = 0x00000800

-  BS_CENTER* = 0x00000300

-  BS_CHECKBOX* = 0x00000002

-  BS_DEFPUSHBUTTON* = 0x00000001

-  BS_GROUPBOX* = 0x00000007

-  BS_ICON* = 0x00000040

-  BS_LEFT* = 0x00000100

-  BS_LEFTTEXT* = 0x00000020

-  BS_MULTILINE* = 0x00002000

-  BS_NOTIFY* = 0x00004000

-  BS_OWNERDRAW* = 0x0000000B

-  BS_PUSHBUTTON* = 0

-  BS_PUSHLIKE* = 0x00001000

-  BS_RADIOBUTTON* = 0x00000004

-  BS_RIGHT* = 0x00000200

-  BS_RIGHTBUTTON* = 0x00000020

-  BS_TEXT* = 0

-  BS_TOP* = 0x00000400

-  BS_USERBUTTON* = 0x00000008

-  BS_VCENTER* = 0x00000C00

-  BS_FLAT* = 0x00008000

-  CBS_AUTOHSCROLL* = 0x00000040

-  CBS_DISABLENOSCROLL* = 0x00000800

-  CBS_DROPDOWN* = 0x00000002

-  CBS_DROPDOWNLIST* = 0x00000003

-  CBS_HASSTRINGS* = 0x00000200

-  CBS_LOWERCASE* = 0x00004000

-  CBS_NOINTEGRALHEIGHT* = 0x00000400

-  CBS_OEMCONVERT* = 0x00000080

-  CBS_OWNERDRAWFIXED* = 0x00000010

-  CBS_OWNERDRAWVARIABLE* = 0x00000020

-  CBS_SIMPLE* = 0x00000001

-  CBS_SORT* = 0x00000100

-  CBS_UPPERCASE* = 0x00002000

-  ES_AUTOHSCROLL* = 0x00000080

-  ES_AUTOVSCROLL* = 0x00000040

-  ES_CENTER* = 0x00000001

-  ES_LEFT* = 0

-  ES_LOWERCASE* = 0x00000010

-  ES_MULTILINE* = 0x00000004

-  ES_NOHIDESEL* = 0x00000100

-  ES_NUMBER* = 0x00002000

-  ES_OEMCONVERT* = 0x00000400

-  ES_PASSWORD* = 0x00000020

-  ES_READONLY* = 0x00000800

-  ES_RIGHT* = 0x00000002

-  ES_UPPERCASE* = 0x00000008

-  ES_WANTRETURN* = 0x00001000

-  LBS_DISABLENOSCROLL* = 0x00001000

-  LBS_EXTENDEDSEL* = 0x00000800

-  LBS_HASSTRINGS* = 0x00000040

-  LBS_MULTICOLUMN* = 0x00000200

-  LBS_MULTIPLESEL* = 0x00000008

-  LBS_NODATA* = 0x00002000

-  LBS_NOINTEGRALHEIGHT* = 0x00000100

-  LBS_NOREDRAW* = 0x00000004

-  LBS_NOSEL* = 0x00004000

-  LBS_NOTIFY* = 0x00000001

-  LBS_OWNERDRAWFIXED* = 0x00000010

-  LBS_OWNERDRAWVARIABLE* = 0x00000020

-  LBS_SORT* = 0x00000002

-  LBS_STANDARD* = 0x00A00003

-  LBS_USETABSTOPS* = 0x00000080

-  LBS_WANTKEYBOARDINPUT* = 0x00000400

-  SBS_BOTTOMALIGN* = 0x00000004

-  SBS_HORZ* = 0

-  SBS_LEFTALIGN* = 0x00000002

-  SBS_RIGHTALIGN* = 0x00000004

-  SBS_SIZEBOX* = 0x00000008

-  SBS_SIZEBOXBOTTOMRIGHTALIGN* = 0x00000004

-  SBS_SIZEBOXTOPLEFTALIGN* = 0x00000002

-  SBS_SIZEGRIP* = 0x00000010

-  SBS_TOPALIGN* = 0x00000002

-  SBS_VERT* = 0x00000001

-  SS_BITMAP* = 0x0000000E

-  SS_BLACKFRAME* = 0x00000007

-  SS_BLACKRECT* = 0x00000004

-  SS_CENTER* = 0x00000001

-  SS_CENTERIMAGE* = 0x00000200

-  SS_ENHMETAFILE* = 0x0000000F

-  SS_ETCHEDFRAME* = 0x00000012

-  SS_ETCHEDHORZ* = 0x00000010

-  SS_ETCHEDVERT* = 0x00000011

-  SS_GRAYFRAME* = 0x00000008

-  SS_GRAYRECT* = 0x00000005

-  SS_ICON* = 0x00000003

-  SS_LEFT* = 0

-  SS_LEFTNOWORDWRAP* = 0x0000000C

-  SS_NOPREFIX* = 0x00000080

-  SS_NOTIFY* = 0x00000100

-  SS_OWNERDRAW* = 0x0000000D

-  SS_REALSIZEIMAGE* = 0x00000800

-  SS_RIGHT* = 0x00000002

-  SS_RIGHTJUST* = 0x00000400

-  SS_SIMPLE* = 0x0000000B

-  SS_SUNKEN* = 0x00001000

-  SS_USERITEM* = 0x0000000A

-  SS_WHITEFRAME* = 0x00000009

-  SS_WHITERECT* = 0x00000006

-  DS_3DLOOK* = 0x00000004

-  DS_ABSALIGN* = 0x00000001

-  DS_CENTER* = 0x00000800

-  DS_CENTERMOUSE* = 0x00001000

-  DS_CONTEXTHELP* = 0x00002000

-  DS_CONTROL* = 0x00000400

-  DS_FIXEDSYS* = 0x00000008

-  DS_LOCALEDIT* = 0x00000020

-  DS_MODALFRAME* = 0x00000080

-  DS_NOFAILCREATE* = 0x00000010

-  DS_NOIDLEMSG* = 0x00000100

-  DS_SETFONT* = 0x00000040

-  DS_SETFOREGROUND* = 0x00000200

-  DS_SYSMODAL* = 0x00000002

-  # CreateWindowEx

-  WS_EX_ACCEPTFILES* = 0x00000010

-  WS_EX_APPWINDOW* = 0x00040000

-  WS_EX_CLIENTEDGE* = 0x00000200

-  WS_EX_CONTEXTHELP* = 0x00000400

-  WS_EX_CONTROLPARENT* = 0x00010000

-  WS_EX_DLGMODALFRAME* = 0x00000001

-  WS_EX_LEFT* = 0

-  WS_EX_LEFTSCROLLBAR* = 0x00004000

-  WS_EX_LTRREADING* = 0

-  WS_EX_MDICHILD* = 0x00000040

-  WS_EX_NOPARENTNOTIFY* = 0x00000004

-  WS_EX_OVERLAPPEDWINDOW* = 0x00000300

-  WS_EX_PALETTEWINDOW* = 0x00000188

-  WS_EX_RIGHT* = 0x00001000

-  WS_EX_RIGHTSCROLLBAR* = 0

-  WS_EX_RTLREADING* = 0x00002000

-  WS_EX_STATICEDGE* = 0x00020000

-  WS_EX_TOOLWINDOW* = 0x00000080

-  WS_EX_TOPMOST* = 0x00000008

-  WS_EX_TRANSPARENT* = 0x00000020

-  WS_EX_WINDOWEDGE* = 0x00000100

-  # CreateWindowStation

-  WINSTA_ACCESSCLIPBOARD* = 0x00000004

-  WINSTA_ACCESSGLOBALATOMS* = 0x00000020

-  WINSTA_CREATEDESKTOP* = 0x00000008

-  WINSTA_ENUMDESKTOPS* = 0x00000001

-  WINSTA_ENUMERATE* = 0x00000100

-  WINSTA_EXITWINDOWS* = 0x00000040

-  WINSTA_READATTRIBUTES* = 0x00000002

-  WINSTA_READSCREEN* = 0x00000200

-  WINSTA_WRITEATTRIBUTES* = 0x00000010

-  # DdeCallback

-  # DdeClientTransaction

-  # DdeEnableCallback

-  # DdeGetLastError

-  # DdeInitialize

-  # DdeNameService

-  # DebugProc

-  WH_CALLWNDPROC* = 4

-  WH_CALLWNDPROCRET* = 12

-  WH_CBT* = 5

-  WH_DEBUG* = 9

-  WH_GETMESSAGE* = 3

-  WH_JOURNALPLAYBACK* = 1

-  WH_JOURNALRECORD* = 0

-  WH_KEYBOARD* = 2

-  WH_MOUSE* = 7

-  WH_MSGFILTER* = -1

-  WH_SHELL* = 10

-  WH_SYSMSGFILTER* = 6

-  WH_FOREGROUNDIDLE* = 11

-  # DefineDosDevice

-  DDD_RAW_TARGET_PATH* = 1

-  DDD_REMOVE_DEFINITION* = 2

-  DDD_EXACT_MATCH_ON_REMOVE* = 4

-  # DeviceCapbilities

-  DCTT_BITMAP* = 0x00000001

-  DCTT_DOWNLOAD* = 0x00000002

-  DCTT_SUBDEV* = 0x00000004

-                              # DlgDirList

-  DDL_ARCHIVE* = 32

-  DDL_DIRECTORY* = 16

-  DDL_DRIVES* = 16384

-  DDL_EXCLUSIVE* = 32768

-  DDL_HIDDEN* = 2

-  DDL_READONLY* = 1

-  DDL_READWRITE* = 0

-  DDL_SYSTEM* = 4

-  DDL_POSTMSGS* = 8192

-  # DllEntryPoint

-  DLL_PROCESS_ATTACH* = 1

-  DLL_THREAD_ATTACH* = 2

-  DLL_PROCESS_DETACH* = 0

-  DLL_THREAD_DETACH* = 3

-  # DrawAnimatedRects

-  IDANI_OPEN* = 1

-  IDANI_CLOSE* = 2

-  # DrawCaption

-  DC_ACTIVE* = 1

-  DC_SMALLCAP* = 2

-  # DrawEdge

-  BDR_RAISEDINNER* = 4

-  BDR_SUNKENINNER* = 8

-  BDR_RAISEDOUTER* = 1

-  BDR_SUNKENOUTER* = 2

-  BDR_OUTER* = BDR_RAISEDOUTER or BDR_SUNKENOUTER

-  BDR_INNER* = BDR_RAISEDINNER or BDR_SUNKENINNER

-  BDR_RAISED* = BDR_RAISEDOUTER or BDR_RAISEDINNER

-  BDR_SUNKEN* = BDR_SUNKENOUTER or BDR_SUNKENINNER

-  EDGE_BUMP* = 9

-  EDGE_ETCHED* = 6

-  EDGE_RAISED* = 5

-  EDGE_SUNKEN* = 10

-  BF_ADJUST* = 8192

-  BF_BOTTOM* = 8

-  BF_BOTTOMLEFT* = 9

-  BF_BOTTOMRIGHT* = 12

-  BF_DIAGONAL* = 16

-  BF_DIAGONAL_ENDBOTTOMLEFT* = 25

-  BF_DIAGONAL_ENDBOTTOMRIGHT* = 28

-  BF_DIAGONAL_ENDTOPLEFT* = 19

-  BF_DIAGONAL_ENDTOPRIGHT* = 22

-  BF_FLAT* = 16384

-  BF_LEFT* = 1

-  BF_MIDDLE* = 2048

-  BF_MONO* = 32768

-  BF_RECT* = 15

-  BF_RIGHT* = 4

-  BF_SOFT* = 4096

-  BF_TOP* = 2

-  BF_TOPLEFT* = 3

-  BF_TOPRIGHT* = 6

-  # DrawFrameControl

-  DFC_BUTTON* = 4

-  DFC_CAPTION* = 1

-  DFC_MENU* = 2

-  DFC_SCROLL* = 3

-  DFCS_BUTTON3STATE* = 8

-  DFCS_BUTTONCHECK* = 0

-  DFCS_BUTTONPUSH* = 16

-  DFCS_BUTTONRADIO* = 4

-  DFCS_BUTTONRADIOIMAGE* = 1

-  DFCS_BUTTONRADIOMASK* = 2

-  DFCS_CAPTIONCLOSE* = 0

-  DFCS_CAPTIONHELP* = 4

-  DFCS_CAPTIONMAX* = 2

-  DFCS_CAPTIONMIN* = 1

-  DFCS_CAPTIONRESTORE* = 3

-  DFCS_MENUARROW* = 0

-  DFCS_MENUBULLET* = 2

-  DFCS_MENUCHECK* = 1

-  DFCS_SCROLLCOMBOBOX* = 5

-  DFCS_SCROLLDOWN* = 1

-  DFCS_SCROLLLEFT* = 2

-  DFCS_SCROLLRIGHT* = 3

-  DFCS_SCROLLSIZEGRIP* = 8

-  DFCS_SCROLLUP* = 0

-  DFCS_ADJUSTRECT* = 8192

-  DFCS_CHECKED* = 1024

-  DFCS_FLAT* = 16384

-  DFCS_INACTIVE* = 256

-  DFCS_MONO* = 32768

-  DFCS_PUSHED* = 512

-  # DrawIconEx

-  DI_COMPAT* = 4

-  DI_DEFAULTSIZE* = 8

-  DI_IMAGE* = 2

-  DI_MASK* = 1

-  DI_NORMAL* = 3

-  # DrawState

-  DST_BITMAP* = 4

-  DST_COMPLEX* = 0

-  DST_ICON* = 3

-  DST_PREFIXTEXT* = 2

-  DST_TEXT* = 1

-  DSS_NORMAL* = 0

-  DSS_UNION* = 16

-  DSS_DISABLED* = 32

-  DSS_MONO* = 128

-  # DrawStatusText

-  SBT_NOBORDERS* = 256

-  SBT_OWNERDRAW* = 4096

-  SBT_POPOUT* = 512

-  SBT_RTLREADING* = 1024

-  # DrawText, DrawTextEx

-  DT_BOTTOM* = 8

-  DT_CALCRECT* = 1024

-  DT_CENTER* = 1

-  DT_EDITCONTROL* = 8192

-  DT_END_ELLIPSIS* = 32768

-  DT_PATH_ELLIPSIS* = 16384

-  DT_EXPANDTABS* = 64

-  DT_EXTERNALLEADING* = 512

-  DT_LEFT* = 0

-  DT_MODIFYSTRING* = 65536

-  DT_NOCLIP* = 256

-  DT_NOPREFIX* = 2048

-  DT_RIGHT* = 2

-  DT_RTLREADING* = 131072

-  DT_SINGLELINE* = 32

-  DT_TABSTOP* = 128

-  DT_TOP* = 0

-  DT_VCENTER* = 4

-  DT_WORDBREAK* = 16

-  DT_INTERNAL* = 4096

-  DT_WORD_ELLIPSIS* = 0x00040000

-  DT_HIDEPREFIX* = 0x00100000

-  DT_PREFIXONLY* = 0x00200000

-  # DuplicateHandle, MapViewOfFile

-  DUPLICATE_CLOSE_SOURCE* = 1

-  DUPLICATE_SAME_ACCESS* = 2

-  FILE_MAP_ALL_ACCESS* = 0x000F001F

-  FILE_MAP_READ* = 4

-  FILE_MAP_WRITE* = 2

-  FILE_MAP_COPY* = 1

-  MUTEX_ALL_ACCESS* = 0x001F0001

-  MUTEX_MODIFY_STATE* = 1

-  SYNCHRONIZE* = 0x00100000

-  SEMAPHORE_ALL_ACCESS* = 0x001F0003

-  SEMAPHORE_MODIFY_STATE* = 2

-  EVENT_ALL_ACCESS* = 0x001F0003

-  EVENT_MODIFY_STATE* = 2

-  KEY_ALL_ACCESS* = 0x000F003F

-  KEY_CREATE_LINK* = 32

-  KEY_CREATE_SUB_KEY* = 4

-  KEY_ENUMERATE_SUB_KEYS* = 8

-  KEY_EXECUTE* = 0x00020019

-  KEY_NOTIFY* = 16

-  KEY_QUERY_VALUE* = 1

-  KEY_READ* = 0x00020019

-  KEY_SET_VALUE* = 2

-  KEY_WRITE* = 0x00020006

-  PROCESS_ALL_ACCESS* = 0x001F0FFF

-  PROCESS_CREATE_PROCESS* = 128

-  PROCESS_CREATE_THREAD* = 2

-  PROCESS_DUP_HANDLE* = 64

-  PROCESS_QUERY_INFORMATION* = 1024

-  PROCESS_SET_INFORMATION* = 512

-  PROCESS_TERMINATE* = 1

-  PROCESS_VM_OPERATION* = 8

-  PROCESS_VM_READ* = 16

-  PROCESS_VM_WRITE* = 32

-  THREAD_ALL_ACCESS* = 0x001F03FF

-  THREAD_DIRECT_IMPERSONATION* = 512

-  THREAD_GET_CONTEXT* = 8

-  THREAD_IMPERSONATE* = 256

-  THREAD_QUERY_INFORMATION* = 64

-  THREAD_SET_CONTEXT* = 16

-  THREAD_SET_INFORMATION* = 32

-  THREAD_SET_THREAD_TOKEN* = 128

-  THREAD_SUSPEND_RESUME* = 2

-  THREAD_TERMINATE* = 1

-  # EditWordBreakProc

-  WB_ISDELIMITER* = 2

-  WB_LEFT* = 0

-  WB_RIGHT* = 1

-  # EnableScrollBar

-  SB_BOTH* = 3

-  SB_CTL* = 2

-  SB_HORZ* = 0

-  SB_VERT* = 1

-  ESB_DISABLE_BOTH* = 3

-  ESB_DISABLE_DOWN* = 2

-  ESB_DISABLE_LEFT* = 1

-  ESB_DISABLE_LTUP* = 1

-  ESB_DISABLE_RIGHT* = 2

-  ESB_DISABLE_RTDN* = 2

-  ESB_DISABLE_UP* = 1

-  ESB_ENABLE_BOTH* = 0

-  # Scroll Bar notifications

-  SB_LINEUP* = 0

-  SB_LINEDOWN* = 1

-  SB_LINELEFT* = 0

-  SB_LINERIGHT* = 1

-  SB_PAGEUP* = 2

-  SB_PAGEDOWN* = 3

-  SB_PAGELEFT* = 2

-  SB_PAGERIGHT* = 3

-  SB_THUMBPOSITION* = 4

-  SB_THUMBTRACK* = 5

-  SB_ENDSCROLL* = 8

-  SB_LEFT* = 6

-  SB_RIGHT* = 7

-  SB_BOTTOM* = 7

-  SB_TOP* = 6

-  # EnumCalendarInfo

-  ENUM_ALL_CALENDARS* = -1

-  # EnumDateFormats

-  # GetDateFormat

-  DATE_SHORTDATE* = 1

-  DATE_LONGDATE* = 2

-  DATE_USE_ALT_CALENDAR* = 4

-  # EnumDependentServices

-  SERVICE_ACTIVE* = 1

-  SERVICE_INACTIVE* = 2

-  # EnumFontFamExProc

-  DEVICE_FONTTYPE* = 2

-  RASTER_FONTTYPE* = 1

-  TRUETYPE_FONTTYPE* = 4

-  # EnumObjects, GetCurrentObject, GetObjectType

-  OBJ_BRUSH* = 2

-  OBJ_PEN* = 1

-  OBJ_PAL* = 5

-  OBJ_FONT* = 6

-  OBJ_BITMAP* = 7

-  OBJ_EXTPEN* = 11

-  OBJ_REGION* = 8

-  OBJ_DC* = 3

-  OBJ_MEMDC* = 10

-  OBJ_METAFILE* = 9

-  OBJ_METADC* = 4

-  OBJ_ENHMETAFILE* = 13

-  OBJ_ENHMETADC* = 12

-

-                              #

-                              # Predefined Resource Types

-                              #

-const

-  RT_CURSOR* = cast[MAKEINTRESOURCE](1)

-  RT_BITMAP* = cast[MAKEINTRESOURCE](2)

-  RT_ICON* = cast[MAKEINTRESOURCE](3)

-  RT_MENU* = cast[MAKEINTRESOURCE](4)

-  RT_DIALOG* = cast[MAKEINTRESOURCE](5)

-  RT_STRING* = cast[MAKEINTRESOURCE](6)

-  RT_FONTDIR* = cast[MAKEINTRESOURCE](7)

-  RT_FONT* = cast[MAKEINTRESOURCE](8)

-  RT_ACCELERATOR* = cast[MAKEINTRESOURCE](9)

-  RT_RCDATA* = cast[MAKEINTRESOURCE](10)

-  RT_MESSAGETABLE* = cast[MAKEINTRESOURCE](11)

-  DIFFERENCE* = 11

-  RT_GROUP_CURSOR* = cast[MAKEINTRESOURCE](12)

-  RT_GROUP_ICON* = cast[MAKEINTRESOURCE](14)

-  RT_VERSION* = cast[MAKEINTRESOURCE](16)

-  RT_DLGINCLUDE* = cast[MAKEINTRESOURCE](17)

-  RT_PLUGPLAY* = cast[MAKEINTRESOURCE](19)

-  RT_VXD* = cast[MAKEINTRESOURCE](20)

-  RT_ANICURSOR* = cast[MAKEINTRESOURCE](21)

-  RT_ANIICON* = cast[MAKEINTRESOURCE](22)

-  RT_HTML* = cast[MAKEINTRESOURCE](23)

-  RT_MANIFEST* = cast[MAKEINTRESOURCE](24)

-

-const

-  # EnumServicesStatus

-  SERVICE_WIN32* = 48

-  SERVICE_DRIVER* = 11

-  # EnumSystemCodePages

-  CP_INSTALLED* = 1

-  CP_SUPPORTED* = 2

-  # EnumSystemLocales

-  LCID_INSTALLED* = 1

-  LCID_SUPPORTED* = 2

-  # EraseTape

-  TAPE_ERASE_LONG* = 0x00000001

-  TAPE_ERASE_SHORT* = 0

-  # Escape

-  SP_ERROR* = -1

-  SP_OUTOFDISK* = -4

-  SP_OUTOFMEMORY* = -5

-  SP_USERABORT* = -3

-  PHYSICALWIDTH* = 110

-  PHYSICALHEIGHT* = 111

-  PHYSICALOFFSETX* = 112

-  PHYSICALOFFSETY* = 113

-  SCALINGFACTORX* = 114

-  SCALINGFACTORY* = 115

-  QUERYESCSUPPORT* = 8

-  #ABORTDOC = 2; conflicts with AbortDoc function

-  cABORTDOC* = 2

-  #ENDDOC = 11; conflicts with AbortDoc function

-  cENDDOC* = 11

-  GETPHYSPAGESIZE* = 12

-  GETPRINTINGOFFSET* = 13

-  GETSCALINGFACTOR* = 14

-  NEWFRAME* = 1

-  NEXTBAND* = 3

-  PASSTHROUGH* = 19

-  #SETABORTPROC = 9; conflicts with AbortDoc function

-  cSETABORTPROC* = 9

-  #STARTDOC = 10; conflicts with AbortDoc function

-  cSTARTDOC* = 10

-  # EscapeCommFunction

-  CLRDTR* = 6

-  CLRRTS* = 4

-  SETDTR* = 5

-  SETRTS* = 3

-  SETXOFF* = 1

-  SETXON* = 2

-  SETBREAK* = 8

-  CLRBREAK* = 9

-  # ExitWindowsEx

-  EWX_FORCE* = 4

-  EWX_LOGOFF* = 0

-  EWX_POWEROFF* = 8

-  EWX_REBOOT* = 2

-  EWX_SHUTDOWN* = 1

-  # ExtFloodFill

-  FLOODFILLBORDER* = 0

-  FLOODFILLSURFACE* = 1

-  # ExtTextOut

-  ETO_CLIPPED* = 4

-  ETO_GLYPH_INDEX* = 16

-  ETO_OPAQUE* = 2

-  ETO_RTLREADING* = 128

-  # FillConsoleOutputAttribute

-  FOREGROUND_BLUE* = 1

-  FOREGROUND_GREEN* = 2

-  FOREGROUND_RED* = 4

-  FOREGROUND_INTENSITY* = 8

-  BACKGROUND_BLUE* = 16

-  BACKGROUND_GREEN* = 32

-  BACKGROUND_RED* = 64

-  BACKGROUND_INTENSITY* = 128

-  # FindFirstChangeNotification

-  FILE_NOTIFY_CHANGE_FILE_NAME* = 1

-  FILE_NOTIFY_CHANGE_DIR_NAME* = 2

-  FILE_NOTIFY_CHANGE_ATTRIBUTES* = 4

-  FILE_NOTIFY_CHANGE_SIZE* = 8

-  FILE_NOTIFY_CHANGE_LAST_WRITE* = 16

-  FILE_NOTIFY_CHANGE_SECURITY* = 256

-  # FindFirstPrinterChangeNotification

-  # FindNextPrinterNotification

-  # FMExtensionProc

-  # FoldString

-  MAP_FOLDCZONE* = 16

-  MAP_FOLDDIGITS* = 128

-  MAP_PRECOMPOSED* = 32

-  MAP_COMPOSITE* = 64

-  # ForegroundIdleProc

-  HC_ACTION* = 0

-  # FormatMessage

-  FORMAT_MESSAGE_ALLOCATE_BUFFER* = 256

-  FORMAT_MESSAGE_IGNORE_INSERTS* = 512

-  FORMAT_MESSAGE_FROM_STRING* = 1024

-  FORMAT_MESSAGE_FROM_HMODULE* = 2048

-  FORMAT_MESSAGE_FROM_SYSTEM* = 4096

-  FORMAT_MESSAGE_ARGUMENT_ARRAY* = 8192

-  FORMAT_MESSAGE_MAX_WIDTH_MASK* = 255

-  # GdiComment

-  GDICOMMENT_WINDOWS_METAFILE* = -2147483647

-  GDICOMMENT_BEGINGROUP* = 2

-  GDICOMMENT_ENDGROUP* = 3

-  GDICOMMENT_MULTIFORMATS* = 1073741828

-  GDICOMMENT_IDENTIFIER* = 1128875079

-  # GenerateConsoleCtrlEvent, HandlerRoutine

-  CTRL_C_EVENT* = 0

-  CTRL_BREAK_EVENT* = 1

-  CTRL_CLOSE_EVENT* = 2

-  CTRL_LOGOFF_EVENT* = 5

-  CTRL_SHUTDOWN_EVENT* = 6

-  # GetAddressByName

-  # GetArcDirection

-  AD_COUNTERCLOCKWISE* = 1

-  AD_CLOCKWISE* = 2

-  # GetBinaryTypes

-  SCS_32BIT_BINARY* = 0

-  SCS_DOS_BINARY* = 1

-  SCS_OS216_BINARY* = 5

-  SCS_PIF_BINARY* = 3

-  SCS_POSIX_BINARY* = 4

-  SCS_WOW_BINARY* = 2

-  # GetBoundsRect, SetBoundsRect

-  DCB_DISABLE* = 8

-  DCB_ENABLE* = 4

-  DCB_RESET* = 1

-  DCB_SET* = 3

-  DCB_ACCUMULATE* = 2

-  # GetCharacterPlacement, GetFontLanguageInfo

-  GCP_DBCS* = 1

-  GCP_ERROR* = 0x00008000

-  GCP_CLASSIN* = 0x00080000

-  GCP_DIACRITIC* = 256

-  GCP_DISPLAYZWG* = 0x00400000

-  GCP_GLYPHSHAPE* = 16

-  GCP_JUSTIFY* = 0x00010000

-  GCP_JUSTIFYIN* = 0x00200000

-  GCP_KASHIDA* = 1024

-  GCP_LIGATE* = 32

-  GCP_MAXEXTENT* = 0x00100000

-  GCP_NEUTRALOVERRIDE* = 0x02000000

-  GCP_NUMERICOVERRIDE* = 0x01000000

-  GCP_NUMERICSLATIN* = 0x04000000

-  GCP_NUMERICSLOCAL* = 0x08000000

-  GCP_REORDER* = 2

-  GCP_SYMSWAPOFF* = 0x00800000

-  GCP_USEKERNING* = 8

-  FLI_GLYPHS* = 0x00040000

-  FLI_MASK* = 0x0000103B

-  # GetClassLong, GetClassWord

-  GCW_ATOM* = -32

-  GCL_CBCLSEXTRA* = -20

-  GCL_CBWNDEXTRA* = -18

-  GCL_HBRBACKGROUND* = -10

-  GCL_HCURSOR* = -12

-  GCL_HICON* = -14

-  GCL_HICONSM* = -34

-  GCL_HMODULE* = -16

-  GCL_MENUNAME* = -8

-  GCL_STYLE* = -26

-  GCL_WNDPROC* = -24

-  # GetClipboardFormat, SetClipboardData

-  CF_BITMAP* = 2

-  CF_DIB* = 8

-  CF_PALETTE* = 9

-  CF_ENHMETAFILE* = 14

-  CF_METAFILEPICT* = 3

-  CF_OEMTEXT* = 7

-  CF_TEXT* = 1

-  CF_UNICODETEXT* = 13

-  CF_DIF* = 5

-  CF_DSPBITMAP* = 130

-  CF_DSPENHMETAFILE* = 142

-  CF_DSPMETAFILEPICT* = 131

-  CF_DSPTEXT* = 129

-  CF_GDIOBJFIRST* = 768

-  CF_GDIOBJLAST* = 1023

-  CF_HDROP* = 15

-  CF_LOCALE* = 16

-  CF_OWNERDISPLAY* = 128

-  CF_PENDATA* = 10

-  CF_PRIVATEFIRST* = 512

-  CF_PRIVATELAST* = 767

-  CF_RIFF* = 11

-  CF_SYLK* = 4

-  CF_WAVE* = 12

-  CF_TIFF* = 6

-  # GetCommMask

-  EV_BREAK* = 64

-  EV_CTS* = 8

-  EV_DSR* = 16

-  EV_ERR* = 128

-  EV_EVENT1* = 2048

-  EV_EVENT2* = 4096

-  EV_PERR* = 512

-  EV_RING* = 256

-  EV_RLSD* = 32

-  EV_RX80FULL* = 1024

-  EV_RXCHAR* = 1

-  EV_RXFLAG* = 2

-  EV_TXEMPTY* = 4

-  # GetCommModemStatus

-  MS_CTS_ON* = 0x00000010

-  MS_DSR_ON* = 0x00000020

-  MS_RING_ON* = 0x00000040

-  MS_RLSD_ON* = 0x00000080

-  # GetComputerName

-  MAX_COMPUTERNAME_LENGTH* = 15

-  # GetConsoleMode

-  ENABLE_LINE_INPUT* = 2

-  ENABLE_ECHO_INPUT* = 4

-  ENABLE_PROCESSED_INPUT* = 1

-  ENABLE_WINDOW_INPUT* = 8

-  ENABLE_MOUSE_INPUT* = 16

-  ENABLE_PROCESSED_OUTPUT* = 1

-  ENABLE_WRAP_AT_EOL_OUTPUT* = 2

-  # GetCPInfo

-  CP_ACP* = 0

-  CP_MACCP* = 2

-  CP_OEMCP* = 1

-  # GetDCEx

-  DCX_WINDOW* = 0x00000001

-  DCX_CACHE* = 0x00000002

-  DCX_PARENTCLIP* = 0x00000020

-  DCX_CLIPSIBLINGS* = 0x00000010

-  DCX_CLIPCHILDREN* = 0x00000008

-  DCX_NORESETATTRS* = 0x00000004

-  DCX_LOCKWINDOWUPDATE* = 0x00000400

-  DCX_EXCLUDERGN* = 0x00000040

-  DCX_INTERSECTRGN* = 0x00000080

-  DCX_VALIDATE* = 0x00200000

-  # GetDeviceCaps

-  DRIVERVERSION* = 0

-  TECHNOLOGY* = 2

-  DT_PLOTTER* = 0

-  DT_RASDISPLAY* = 1

-  DT_RASPRINTER* = 2

-  DT_RASCAMERA* = 3

-  DT_CHARSTREAM* = 4

-  DT_METAFILE* = 5

-  DT_DISPFILE* = 6

-  HORZSIZE* = 4

-  VERTSIZE* = 6

-  HORZRES* = 8

-  VERTRES* = 10

-  LOGPIXELSX* = 88

-  LOGPIXELSY* = 90

-  BITSPIXEL* = 12

-  PLANES* = 14

-  NUMBRUSHES* = 16

-  NUMPENS* = 18

-  NUMFONTS* = 22

-  NUMCOLORS* = 24

-  ASPECTX* = 40

-  ASPECTY* = 42

-  ASPECTXY* = 44

-  PDEVICESIZE* = 26

-  CLIPCAPS* = 36

-  SIZEPALETTE* = 104

-  NUMRESERVED* = 106

-  COLORRES* = 108

-  VREFRESH* = 116

-  DESKTOPHORZRES* = 118

-  DESKTOPVERTRES* = 117

-  BLTALIGNMENT* = 119

-  RASTERCAPS* = 38

-  RC_BANDING* = 2

-  RC_BITBLT* = 1

-  RC_BITMAP64* = 8

-  RC_DI_BITMAP* = 128

-  RC_DIBTODEV* = 512

-  RC_FLOODFILL* = 4096

-  RC_GDI20_OUTPUT* = 16

-  RC_PALETTE* = 256

-  RC_SCALING* = 4

-  RC_STRETCHBLT* = 2048

-  RC_STRETCHDIB* = 8192

-  CURVECAPS* = 28

-  CC_NONE* = 0

-  CC_CIRCLES* = 1

-  CC_PIE* = 2

-  CC_CHORD* = 4

-  CC_ELLIPSES* = 8

-  CC_WIDE* = 16

-  CC_STYLED* = 32

-  CC_WIDESTYLED* = 64

-  CC_INTERIORS* = 128

-  CC_ROUNDRECT* = 256

-  LINECAPS* = 30

-  LC_NONE* = 0

-  LC_POLYLINE* = 2

-  LC_MARKER* = 4

-  LC_POLYMARKER* = 8

-  LC_WIDE* = 16

-  LC_STYLED* = 32

-  LC_WIDESTYLED* = 64

-  LC_INTERIORS* = 128

-  POLYGONALCAPS* = 32

-  PC_NONE* = 0

-  PC_POLYGON* = 1

-  PC_RECTANGLE* = 2

-  PC_WINDPOLYGON* = 4

-  PC_SCANLINE* = 8

-  PC_WIDE* = 16

-  PC_STYLED* = 32

-  PC_WIDESTYLED* = 64

-  PC_INTERIORS* = 128

-  TEXTCAPS* = 34

-  TC_OP_CHARACTER* = 1

-  TC_OP_STROKE* = 2

-  TC_CP_STROKE* = 4

-  TC_CR_90* = 8

-  TC_CR_ANY* = 16

-  TC_SF_X_YINDEP* = 32

-  TC_SA_DOUBLE* = 64

-  TC_SA_INTEGER* = 128

-  TC_SA_CONTIN* = 256

-  TC_EA_DOUBLE* = 512

-  TC_IA_ABLE* = 1024

-  TC_UA_ABLE* = 2048

-  TC_SO_ABLE* = 4096

-  TC_RA_ABLE* = 8192

-  TC_VA_ABLE* = 16384

-  TC_RESERVED* = 32768

-  TC_SCROLLBLT* = 65536

-  PC_PATHS* = 512

-  # GetDriveType

-  DRIVE_REMOVABLE* = 2

-  DRIVE_FIXED* = 3

-  DRIVE_REMOTE* = 4

-  DRIVE_CDROM* = 5

-  DRIVE_RAMDISK* = 6

-  DRIVE_UNKNOWN* = 0

-  DRIVE_NO_ROOT_DIR* = 1

-  # GetExceptionCode

-  EXCEPTION_ACCESS_VIOLATION* = 0xC0000005

-  EXCEPTION_BREAKPOINT* = 0x80000003

-  EXCEPTION_DATATYPE_MISALIGNMENT* = 0x80000002

-  EXCEPTION_SINGLE_STEP* = 0x80000004

-  EXCEPTION_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C

-  EXCEPTION_FLT_DENORMAL_OPERAND* = 0xC000008D

-  EXCEPTION_FLT_DIVIDE_BY_ZERO* = 0xC000008E

-  EXCEPTION_FLT_INEXACT_RESULT* = 0xC000008F

-  EXCEPTION_FLT_INVALID_OPERATION* = 0xC0000090

-  EXCEPTION_FLT_OVERFLOW* = 0xC0000091

-  EXCEPTION_FLT_STACK_CHECK* = 0xC0000092

-  EXCEPTION_FLT_UNDERFLOW* = 0xC0000093

-  EXCEPTION_INT_DIVIDE_BY_ZERO* = 0xC0000094

-  EXCEPTION_INT_OVERFLOW* = 0xC0000095

-  EXCEPTION_INVALID_HANDLE* = 0xC0000008

-  EXCEPTION_PRIV_INSTRUCTION* = 0xC0000096

-  EXCEPTION_NONCONTINUABLE_EXCEPTION* = 0xC0000025

-  EXCEPTION_NONCONTINUABLE* = 0x00000001

-  EXCEPTION_STACK_OVERFLOW* = 0xC00000FD

-  EXCEPTION_INVALID_DISPOSITION* = 0xC0000026

-  EXCEPTION_IN_PAGE_ERROR* = 0xC0000006

-  EXCEPTION_ILLEGAL_INSTRUCTION* = 0xC000001D

-  EXCEPTION_POSSIBLE_DEADLOCK* = 0xC0000194

-  # GetFileType

-  FILE_TYPE_UNKNOWN* = 0

-  FILE_TYPE_DISK* = 1

-  FILE_TYPE_CHAR* = 2

-  FILE_TYPE_PIPE* = 3

-  # GetGlyphOutline

-  GGO_BITMAP* = 1

-  GGO_NATIVE* = 2

-  GGO_METRICS* = 0

-  GGO_GRAY2_BITMAP* = 4

-  GGO_GRAY4_BITMAP* = 5

-  GGO_GRAY8_BITMAP* = 6

-  GDI_ERROR* = 0xFFFFFFFF

-  # GetGraphicsMode

-  GM_COMPATIBLE* = 1

-  GM_ADVANCED* = 2

-  # GetHandleInformation

-  HANDLE_FLAG_INHERIT* = 1

-  HANDLE_FLAG_PROTECT_FROM_CLOSE* = 2

-  # GetIconInfo

-  IDC_ARROW* =       cast[MAKEINTRESOURCE](32512)

-  IDC_IBEAM* =       cast[MAKEINTRESOURCE](32513)

-  IDC_WAIT* =        cast[MAKEINTRESOURCE](32514)

-  IDC_CROSS* =       cast[MAKEINTRESOURCE](32515)

-  IDC_UPARROW* =     cast[MAKEINTRESOURCE](32516)

-  IDC_SIZE* =        cast[MAKEINTRESOURCE](32640)  # OBSOLETE: use IDC_SIZEALL

-  IDC_ICON* =        cast[MAKEINTRESOURCE](32641)  # OBSOLETE: use IDC_ARROW

-  IDC_SIZENWSE* =    cast[MAKEINTRESOURCE](32642)

-  IDC_SIZENESW* =    cast[MAKEINTRESOURCE](32643)

-  IDC_SIZEWE* =      cast[MAKEINTRESOURCE](32644)

-  IDC_SIZENS* =      cast[MAKEINTRESOURCE](32645)

-  IDC_SIZEALL* =     cast[MAKEINTRESOURCE](32646)

-  IDC_NO* =          cast[MAKEINTRESOURCE](32648)

-  IDC_HAND* =        cast[MAKEINTRESOURCE](32649)

-  IDC_APPSTARTING* = cast[MAKEINTRESOURCE](32650)

-  IDC_HELP* =        cast[MAKEINTRESOURCE](32651)

-

-  IDI_APPLICATION* = cast[MAKEINTRESOURCE](32512)

-  IDI_HAND* =        cast[MAKEINTRESOURCE](32513)

-  IDI_QUESTION* =    cast[MAKEINTRESOURCE](32514)

-  IDI_EXCLAMATION* = cast[MAKEINTRESOURCE](32515)

-  IDI_ASTERISK* =    cast[MAKEINTRESOURCE](32516)

-  IDI_WINLOGO* =     cast[MAKEINTRESOURCE](32517)

-  IDI_WARNING* =     IDI_EXCLAMATION

-  IDI_ERROR* =       IDI_HAND

-  IDI_INFORMATION* = IDI_ASTERISK

-

-const

-  # GetMapMode

-  MM_ANISOTROPIC* = 8

-  MM_HIENGLISH* = 5

-  MM_HIMETRIC* = 3

-  MM_ISOTROPIC* = 7

-  MM_LOENGLISH* = 4

-  MM_LOMETRIC* = 2

-  MM_TEXT* = 1

-  MM_TWIPS* = 6

-  # GetMenuDefaultItem

-  GMDI_GOINTOPOPUPS* = 0x00000002

-  GMDI_USEDISABLED* = 0x00000001

-  # PeekMessage

-  PM_NOREMOVE* = 0

-  PM_REMOVE* = 1

-  PM_NOYIELD* = 2

-  # GetNamedPipeHandleState

-  #   PIPE_NOWAIT = 1; already above

-  #   PIPE_READMODE_MESSAGE = 2;already above

-  # GetNamedPipeInfo

-  PIPE_CLIENT_END* = 0

-  PIPE_SERVER_END* = 1

-  #   PIPE_TYPE_MESSAGE = 4;already above

-  # GetNextWindow, GetWindow

-  GW_HWNDNEXT* = 2

-  GW_HWNDPREV* = 3

-  GW_CHILD* = 5

-  GW_HWNDFIRST* = 0

-  GW_HWNDLAST* = 1

-  GW_OWNER* = 4

-  # GetPath

-  PT_MOVETO* = 6

-  PT_LINETO* = 2

-  PT_BEZIERTO* = 4

-  PT_CLOSEFIGURE* = 1

-  # GetProcessShutdownParameters

-  SHUTDOWN_NORETRY* = 1

-  # GetQueueStatus

-  QS_ALLEVENTS* = 191

-  QS_ALLINPUT* = 255

-  QS_HOTKEY* = 128

-  QS_INPUT* = 7

-  QS_KEY* = 1

-  QS_MOUSE* = 6

-  QS_MOUSEBUTTON* = 4

-  QS_MOUSEMOVE* = 2

-  QS_PAINT* = 32

-  QS_POSTMESSAGE* = 8

-  QS_SENDMESSAGE* = 64

-  QS_TIMER* = 16

-  # GetScrollInfo, SetScrollInfo

-  SIF_ALL* = 23

-  SIF_PAGE* = 2

-  SIF_POS* = 4

-  SIF_RANGE* = 1

-  SIF_DISABLENOSCROLL* = 8

-

-  # GetStdHandle

-  STD_INPUT_HANDLE* =  DWORD(-10)

-  STD_OUTPUT_HANDLE* = DWORD(-11)

-  STD_ERROR_HANDLE* =  DWORD(-12)

-

-  INVALID_HANDLE_VALUE* = HANDLE(-1)

-  INVALID_SET_FILE_POINTER* = ULONG(-1)

-  INVALID_FILE_SIZE* = ULONG(-1)

-  INVALID_FILE_ATTRIBUTES* = ULONG(-1)

-

-const

-  # GetStockObject

-  BLACK_BRUSH* = 4

-  DKGRAY_BRUSH* = 3

-  GRAY_BRUSH* = 2

-  HOLLOW_BRUSH* = 5

-  LTGRAY_BRUSH* = 1

-  NULL_BRUSH* = 5

-  WHITE_BRUSH* = 0

-  BLACK_PEN* = 7

-  NULL_PEN* = 8

-  WHITE_PEN* = 6

-  ANSI_FIXED_FONT* = 11

-  ANSI_VAR_FONT* = 12

-  DEVICE_DEFAULT_FONT* = 14

-  DEFAULT_GUI_FONT* = 17

-  OEM_FIXED_FONT* = 10

-  SYSTEM_FONT* = 13

-  SYSTEM_FIXED_FONT* = 16

-  DEFAULT_PALETTE* = 15

-  # GetStringTypeA

-  CT_CTYPE1* = 1

-  CT_CTYPE2* = 2

-  CT_CTYPE3* = 4

-  C1_UPPER* = 1

-  C1_LOWER* = 2

-  C1_DIGIT* = 4

-  C1_SPACE* = 8

-  C1_PUNCT* = 16

-  C1_CNTRL* = 32

-  C1_BLANK* = 64

-  C1_XDIGIT* = 128

-  C1_ALPHA* = 256

-  C2_LEFTTORIGHT* = 1

-  C2_RIGHTTOLEFT* = 2

-  C2_EUROPENUMBER* = 3

-  C2_EUROPESEPARATOR* = 4

-  C2_EUROPETERMINATOR* = 5

-  C2_ARABICNUMBER* = 6

-  C2_COMMONSEPARATOR* = 7

-  C2_BLOCKSEPARATOR* = 8

-  C2_SEGMENTSEPARATOR* = 9

-  C2_WHITESPACE* = 10

-  C2_OTHERNEUTRAL* = 11

-  C2_NOTAPPLICABLE* = 0

-  C3_NONSPACING* = 1

-  C3_DIACRITIC* = 2

-  C3_VOWELMARK* = 4

-  C3_SYMBOL* = 8

-  C3_KATAKANA* = 16

-  C3_HIRAGANA* = 32

-  C3_HALFWIDTH* = 64

-  C3_FULLWIDTH* = 128

-  C3_IDEOGRAPH* = 256

-  C3_KASHIDA* = 512

-  C3_ALPHA* = 32768

-  C3_NOTAPPLICABLE* = 0

-  # GetSysColor

-  COLOR_3DDKSHADOW* = 21

-  COLOR_3DFACE* = 15

-  COLOR_3DHILIGHT* = 20

-  COLOR_3DLIGHT* = 22

-  COLOR_BTNHILIGHT* = 20

-  COLOR_3DSHADOW* = 16

-  COLOR_ACTIVEBORDER* = 10

-  COLOR_ACTIVECAPTION* = 2

-  COLOR_APPWORKSPACE* = 12

-  COLOR_BACKGROUND* = 1

-  COLOR_DESKTOP* = 1

-  COLOR_BTNFACE* = 15

-  COLOR_BTNHIGHLIGHT* = 20

-  COLOR_BTNSHADOW* = 16

-  COLOR_BTNTEXT* = 18

-  COLOR_CAPTIONTEXT* = 9

-  COLOR_GRAYTEXT* = 17

-  COLOR_HIGHLIGHT* = 13

-  COLOR_HIGHLIGHTTEXT* = 14

-  COLOR_INACTIVEBORDER* = 11

-  COLOR_INACTIVECAPTION* = 3

-  COLOR_INACTIVECAPTIONTEXT* = 19

-  COLOR_INFOBK* = 24

-  COLOR_INFOTEXT* = 23

-  COLOR_MENU* = 4

-  COLOR_MENUTEXT* = 7

-  COLOR_SCROLLBAR* = 0

-  COLOR_WINDOW* = 5

-  COLOR_WINDOWFRAME* = 6

-  COLOR_WINDOWTEXT* = 8

-  # GetSystemMetrics

-  SM_CYMIN* = 29

-  SM_CXMIN* = 28

-  SM_ARRANGE* = 56

-  SM_CLEANBOOT* = 67

-  # The right value for SM_CEMETRICS for NT 3.5 is 75.  For Windows 95

-  #     and NT 4.0, it is 76.  The meaning is undocumented, anyhow.

-  SM_CMETRICS* = 76

-  SM_CMOUSEBUTTONS* = 43

-  SM_CXBORDER* = 5

-  SM_CYBORDER* = 6

-  SM_CXCURSOR* = 13

-  SM_CYCURSOR* = 14

-  SM_CXDLGFRAME* = 7

-  SM_CYDLGFRAME* = 8

-  SM_CXDOUBLECLK* = 36

-  SM_CYDOUBLECLK* = 37

-  SM_CXDRAG* = 68

-  SM_CYDRAG* = 69

-  SM_CXEDGE* = 45

-  SM_CYEDGE* = 46

-  SM_CXFIXEDFRAME* = 7

-  SM_CYFIXEDFRAME* = 8

-  SM_CXFRAME* = 32

-  SM_CYFRAME* = 33

-  SM_CXFULLSCREEN* = 16

-  SM_CYFULLSCREEN* = 17

-  SM_CXHSCROLL* = 21

-  SM_CYHSCROLL* = 3

-  SM_CXHTHUMB* = 10

-  SM_CXICON* = 11

-  SM_CYICON* = 12

-  SM_CXICONSPACING* = 38

-  SM_CYICONSPACING* = 39

-  SM_CXMAXIMIZED* = 61

-  SM_CYMAXIMIZED* = 62

-  SM_CXMAXTRACK* = 59

-  SM_CYMAXTRACK* = 60

-  SM_CXMENUCHECK* = 71

-  SM_CYMENUCHECK* = 72

-  SM_CXMENUSIZE* = 54

-  SM_CYMENUSIZE* = 55

-  SM_CXMINIMIZED* = 57

-  SM_CYMINIMIZED* = 58

-  SM_CXMINSPACING* = 47

-  SM_CYMINSPACING* = 48

-  SM_CXMINTRACK* = 34

-  SM_CYMINTRACK* = 35

-  SM_CXSCREEN* = 0

-  SM_CYSCREEN* = 1

-  SM_CXSIZE* = 30

-  SM_CYSIZE* = 31

-  SM_CXSIZEFRAME* = 32

-  SM_CYSIZEFRAME* = 33

-  SM_CXSMICON* = 49

-  SM_CYSMICON* = 50

-  SM_CXSMSIZE* = 52

-  SM_CYSMSIZE* = 53

-  SM_CXVSCROLL* = 2

-  #SM_CYHSCROLL = 3;already above

-  #SM_CXHSCROLL = 21;already above

-  SM_CYVSCROLL* = 20

-  SM_CYVTHUMB* = 9

-  SM_CYCAPTION* = 4

-  SM_CYKANJIWINDOW* = 18

-  SM_CYMENU* = 15

-  SM_CYSMCAPTION* = 51

-  SM_DBCSENABLED* = 42

-  SM_DEBUG* = 22

-  SM_MENUDROPALIGNMENT* = 40

-  SM_MIDEASTENABLED* = 74

-  SM_MOUSEPRESENT* = 19

-  SM_MOUSEWHEELPRESENT* = 75

-  SM_NETWORK* = 63

-  SM_PENWINDOWS* = 41

-  SM_SECURE* = 44

-  SM_SHOWSOUNDS* = 70

-  SM_SLOWMACHINE* = 73

-  SM_SWAPBUTTON* = 23

-  ARW_BOTTOMLEFT* = 0

-  ARW_BOTTOMRIGHT* = 0x00000001

-  ARW_HIDE* = 0x00000008

-  ARW_TOPLEFT* = 0x00000002

-  ARW_TOPRIGHT* = 0x00000003

-  ARW_DOWN* = 0x00000004

-  ARW_LEFT* = 0

-  ARW_RIGHT* = 0

-  ARW_UP* = 0x00000004

-  # GetSystemPaletteUse

-  SYSPAL_NOSTATIC* = 2

-  SYSPAL_STATIC* = 1

-  SYSPAL_ERROR* = 0

-  # GetTapeParameters, SetTapeParameters

-  GET_TAPE_MEDIA_INFORMATION* = 0

-  GET_TAPE_DRIVE_INFORMATION* = 1

-  SET_TAPE_MEDIA_INFORMATION* = 0

-  SET_TAPE_DRIVE_INFORMATION* = 1

-  # GetTapePosition

-  TAPE_ABSOLUTE_POSITION* = 0

-  TAPE_LOGICAL_POSITION* = 0x00000001

-  # GetTextAlign

-  TA_BASELINE* = 24

-  TA_BOTTOM* = 8

-  TA_TOP* = 0

-  TA_CENTER* = 6

-  TA_LEFT* = 0

-  TA_RIGHT* = 2

-  TA_RTLREADING* = 256

-  TA_NOUPDATECP* = 0

-  TA_UPDATECP* = 1

-  VTA_BASELINE* = 24

-  VTA_CENTER* = 6

-  # GetThreadPriority

-  THREAD_PRIORITY_ABOVE_NORMAL* = 1

-  THREAD_PRIORITY_BELOW_NORMAL* = -1

-  THREAD_PRIORITY_HIGHEST* = 2

-  THREAD_PRIORITY_IDLE* = -15

-  THREAD_PRIORITY_LOWEST* = -2

-  THREAD_PRIORITY_NORMAL* = 0

-  THREAD_PRIORITY_TIME_CRITICAL* = 15

-  THREAD_PRIORITY_ERROR_RETURN* = 2147483647

-  TLS_MINIMUM_AVAILABLE* = 64

-  # GetTimeFormat

-  TIME_NOMINUTESORSECONDS* = 1

-  TIME_NOSECONDS* = 2

-  TIME_NOTIMEMARKER* = 4

-  TIME_FORCE24HOURFORMAT* = 8

-

-const

-  # GetTimeZoneInformation

-  TIME_ZONE_ID_INVALID* = DWORD(- 1)

-  TIME_ZONE_ID_UNKNOWN* = 0

-  TIME_ZONE_ID_STANDARD* = 1

-  TIME_ZONE_ID_DAYLIGHT* = 2

-  # GetUserObjectInformation

-  UOI_FLAGS* = 1

-  UOI_NAME* = 2

-  UOI_TYPE* = 3

-  # GetVolumeInformation

-  FS_CASE_IS_PRESERVED* = 2

-  FS_CASE_SENSITIVE* = 1

-  FS_UNICODE_STORED_ON_DISK* = 4

-  FS_PERSISTENT_ACLS* = 8

-  FS_FILE_COMPRESSION* = 16

-  FS_VOL_IS_COMPRESSED* = 32768

-  # GetWindowLong

-  GWL_EXSTYLE* = -20

-  GWL_STYLE* = -16

-  GWL_WNDPROC* = -4

-  GWL_HINSTANCE* = -6

-  GWL_HWNDPARENT* = -8

-  GWL_ID* = -12

-  GWL_USERDATA* = -21

-  DWL_DLGPROC* = 4

-  DWL_MSGRESULT* = 0

-  DWL_USER* = 8

-  # GlobalAlloc, GlobalFlags

-  GMEM_FIXED* = 0

-  GMEM_MOVEABLE* = 2

-  GPTR* = 64

-  GHND* = 66

-  GMEM_DDESHARE* = 8192

-  GMEM_DISCARDABLE* = 256

-  GMEM_LOWER* = 4096

-  GMEM_NOCOMPACT* = 16

-  GMEM_NODISCARD* = 32

-  GMEM_NOT_BANKED* = 4096

-  GMEM_NOTIFY* = 16384

-  GMEM_SHARE* = 8192

-  GMEM_ZEROINIT* = 64

-  GMEM_DISCARDED* = 16384

-  GMEM_INVALID_HANDLE* = 32768

-  GMEM_LOCKCOUNT* = 255

-  # HeapAlloc, HeapReAlloc

-  HEAP_GENERATE_EXCEPTIONS* = 4

-  HEAP_NO_SERIALIZE* = 1

-  HEAP_ZERO_MEMORY* = 8

-  STATUS_NO_MEMORY* = 0xC0000017

-  STATUS_ACCESS_VIOLATION* = 0xC0000005

-  HEAP_REALLOC_IN_PLACE_ONLY* = 16

-  # ImageList_Create

-  ILC_COLOR* = 0

-  ILC_COLOR4* = 4

-  ILC_COLOR8* = 8

-  ILC_COLOR16* = 16

-  ILC_COLOR24* = 24

-  ILC_COLOR32* = 32

-  ILC_COLORDDB* = 254

-  ILC_MASK* = 1

-  ILC_PALETTE* = 2048

-  # ImageList_Draw, ImageList_DrawEx

-  ILD_BLEND25* = 2

-  ILD_BLEND50* = 4

-  ILD_SELECTED* = 4

-  ILD_BLEND* = 4

-  ILD_FOCUS* = 2

-  ILD_MASK* = 16

-  ILD_NORMAL* = 0

-  ILD_TRANSPARENT* = 1

-  CLR_NONE* = 0xFFFFFFFF

-  CLR_DEFAULT* = 0xFF000000

-  CLR_INVALID* = 0xFFFFFFFF

-  # ImageList_LoadImage

-  #LR_DEFAULTCOLOR = 0;already above

-  LR_LOADFROMFILE* = 16

-  LR_LOADMAP3DCOLORS* = 4096

-  LR_LOADTRANSPARENT* = 32

-  # ImmConfigureIME

-  IME_CONFIG_GENERAL* = 1

-  IME_CONFIG_REGISTERWORD* = 2

-  IME_CONFIG_SELECTDICTIONARY* = 3

-  # ImmGetConversionList

-  GCL_CONVERSION* = 1

-  GCL_REVERSECONVERSION* = 2

-  GCL_REVERSE_LENGTH* = 3

-  # ImmGetGuideLine

-  GGL_LEVEL* = 1

-  GGL_INDEX* = 2

-  GGL_STRING* = 3

-  GGL_PRIVATE* = 4

-  GL_LEVEL_ERROR* = 2

-  GL_LEVEL_FATAL* = 1

-  GL_LEVEL_INFORMATION* = 4

-  GL_LEVEL_NOGUIDELINE* = 0

-  GL_LEVEL_WARNING* = 3

-  GL_ID_CANNOTSAVE* = 17

-  GL_ID_NOCONVERT* = 32

-  GL_ID_NODICTIONARY* = 16

-  GL_ID_NOMODULE* = 1

-  GL_ID_READINGCONFLICT* = 35

-  GL_ID_TOOMANYSTROKE* = 34

-  GL_ID_TYPINGERROR* = 33

-  GL_ID_UNKNOWN* = 0

-  GL_ID_INPUTREADING* = 36

-  GL_ID_INPUTRADICAL* = 37

-  GL_ID_INPUTCODE* = 38

-  GL_ID_CHOOSECANDIDATE* = 40

-  GL_ID_REVERSECONVERSION* = 41

-  # ImmGetProperty

-  IGP_PROPERTY* = 4

-  IGP_CONVERSION* = 8

-  IGP_SENTENCE* = 12

-  IGP_UI* = 16

-  IGP_SETCOMPSTR* = 20

-  IGP_SELECT* = 24

-  IME_PROP_AT_CARET* = 65536

-  IME_PROP_SPECIAL_UI* = 131072

-  IME_PROP_CANDLIST_START_FROM_1* = 262144

-  IME_PROP_UNICODE* = 524288

-  UI_CAP_2700* = 1

-  UI_CAP_ROT90* = 2

-  UI_CAP_ROTANY* = 4

-  SCS_CAP_COMPSTR* = 1

-  SCS_CAP_MAKEREAD* = 2

-  SELECT_CAP_CONVERSION* = 1

-  SELECT_CAP_SENTENCE* = 2

-  # ImmNotifyIME

-  NI_CHANGECANDIDATELIST* = 19

-  NI_CLOSECANDIDATE* = 17

-  NI_COMPOSITIONSTR* = 21

-  NI_OPENCANDIDATE* = 16

-  NI_SELECTCANDIDATESTR* = 18

-  NI_SETCANDIDATE_PAGESIZE* = 23

-  NI_SETCANDIDATE_PAGESTART* = 22

-  CPS_CANCEL* = 4

-  CPS_COMPLETE* = 1

-  CPS_CONVERT* = 2

-  CPS_REVERT* = 3

-  # ImmSetCompositionString

-  SCS_SETSTR* = 9

-  SCS_CHANGEATTR* = 18

-  SCS_CHANGECLAUSE* = 36

-  # ImmUnregisterWord

-  IME_REGWORD_STYLE_EUDC* = 1

-  IME_REGWORD_STYLE_USER_FIRST* = 0x80000000

-  IME_REGWORD_STYLE_USER_LAST* = -1

-  # InitializeSecurityDescriptor

-  SECURITY_DESCRIPTOR_REVISION* = 1

-  # IsTextUnicode

-  IS_TEXT_UNICODE_ASCII16* = 1

-  IS_TEXT_UNICODE_REVERSE_ASCII16* = 16

-  IS_TEXT_UNICODE_STATISTICS* = 2

-  IS_TEXT_UNICODE_REVERSE_STATISTICS* = 32

-  IS_TEXT_UNICODE_CONTROLS* = 4

-  IS_TEXT_UNICODE_REVERSE_CONTROLS* = 64

-  IS_TEXT_UNICODE_SIGNATURE* = 8

-  IS_TEXT_UNICODE_REVERSE_SIGNATURE* = 128

-  IS_TEXT_UNICODE_ILLEGAL_CHARS* = 256

-  IS_TEXT_UNICODE_ODD_LENGTH* = 512

-  IS_TEXT_UNICODE_NULL_BYTES* = 4096

-  IS_TEXT_UNICODE_UNICODE_MASK* = 15

-  IS_TEXT_UNICODE_REVERSE_MASK* = 240

-  IS_TEXT_UNICODE_NOT_UNICODE_MASK* = 3840

-  IS_TEXT_UNICODE_NOT_ASCII_MASK* = 61440

-  # JournalPlaybackProc, KeyboardProc

-  HC_GETNEXT* = 1

-  HC_SKIP* = 2

-  HC_SYSMODALOFF* = 5

-  HC_SYSMODALON* = 4

-  HC_NOREMOVE* = 3

-  # keybd_event

-  KEYEVENTF_EXTENDEDKEY* = 1

-  KEYEVENTF_KEYUP* = 2

-  # LoadBitmap

-  OBM_BTNCORNERS* = 32758

-  OBM_BTSIZE* = 32761

-  OBM_CHECK* = 32760

-  OBM_CHECKBOXES* = 32759

-  OBM_CLOSE* = 32754

-  OBM_COMBO* = 32738

-  OBM_DNARROW* = 32752

-  OBM_DNARROWD* = 32742

-  OBM_DNARROWI* = 32736

-  OBM_LFARROW* = 32750

-  OBM_LFARROWI* = 32734

-  OBM_LFARROWD* = 32740

-  OBM_MNARROW* = 32739

-  OBM_OLD_CLOSE* = 32767

-  OBM_OLD_DNARROW* = 32764

-  OBM_OLD_LFARROW* = 32762

-  OBM_OLD_REDUCE* = 32757

-  OBM_OLD_RESTORE* = 32755

-  OBM_OLD_RGARROW* = 32763

-  OBM_OLD_UPARROW* = 32765

-  OBM_OLD_ZOOM* = 32756

-  OBM_REDUCE* = 32749

-  OBM_REDUCED* = 32746

-  OBM_RESTORE* = 32747

-  OBM_RESTORED* = 32744

-  OBM_RGARROW* = 32751

-  OBM_RGARROWD* = 32741

-  OBM_RGARROWI* = 32735

-  OBM_SIZE* = 32766

-  OBM_UPARROW* = 32753

-  OBM_UPARROWD* = 32743

-  OBM_UPARROWI* = 32737

-  OBM_ZOOM* = 32748

-  OBM_ZOOMD* = 32745

-  # LoadLibraryEx

-  DONT_RESOLVE_DLL_REFERENCES* = 1

-  LOAD_LIBRARY_AS_DATAFILE* = 2

-  LOAD_WITH_ALTERED_SEARCH_PATH* = 8

-  # LocalAlloc, LocalFlags

-  LPTR* = 64

-  LHND* = 66

-  NONZEROLHND* = 2

-  NONZEROLPTR* = 0

-  LMEM_NONZEROLHND* = 2

-  LMEM_NONZEROLPTR* = 0

-  LMEM_FIXED* = 0

-  LMEM_MOVEABLE* = 2

-  LMEM_NOCOMPACT* = 16

-  LMEM_NODISCARD* = 32

-  LMEM_ZEROINIT* = 64

-  LMEM_MODIFY* = 128

-  LMEM_LOCKCOUNT* = 255

-  LMEM_DISCARDABLE* = 3840

-  LMEM_DISCARDED* = 16384

-  LMEM_INVALID_HANDLE* = 32768

-  # LockFileEx

-  LOCKFILE_FAIL_IMMEDIATELY* = 1

-  LOCKFILE_EXCLUSIVE_LOCK* = 2

-  # LogonUser

-  # LZCopy, LZInit, LZRead

-  # MessageBeep, MessageBox

-  MB_USERICON* = 0x00000080

-  MB_ICONASTERISK* = 0x00000040

-  MB_ICONEXCLAMATION* = 0x00000030

-  MB_ICONWARNING* = 0x00000030

-  MB_ICONERROR* = 0x00000010

-  MB_ICONHAND* = 0x00000010

-  MB_ICONQUESTION* = 0x00000020

-  MB_OK* = 0

-  MB_ABORTRETRYIGNORE* = 0x00000002

-  MB_APPLMODAL* = 0

-  MB_DEFAULT_DESKTOP_ONLY* = 0x00020000

-  MB_HELP* = 0x00004000

-  MB_RIGHT* = 0x00080000

-  MB_RTLREADING* = 0x00100000

-  MB_TOPMOST* = 0x00040000

-  MB_DEFBUTTON1* = 0

-  MB_DEFBUTTON2* = 0x00000100

-  MB_DEFBUTTON3* = 0x00000200

-  MB_DEFBUTTON4* = 0x00000300

-  MB_ICONINFORMATION* = 0x00000040

-  MB_ICONSTOP* = 0x00000010

-  MB_OKCANCEL* = 0x00000001

-  MB_RETRYCANCEL* = 0x00000005

-  MB_SERVICE_NOTIFICATION* = 0x00040000

-  MB_SETFOREGROUND* = 0x00010000

-  MB_SYSTEMMODAL* = 0x00001000

-  MB_TASKMODAL* = 0x00002000

-  MB_YESNO* = 0x00000004

-  MB_YESNOCANCEL* = 0x00000003

-  IDABORT* = 3

-  IDCANCEL* = 2

-  IDCLOSE* = 8

-  IDHELP* = 9

-  IDIGNORE* = 5

-  IDNO* = 7

-  IDOK* = 1

-  IDRETRY* = 4

-  IDYES* = 6

-  # MessageProc

-  MSGF_DIALOGBOX* = 0

-  MSGF_MENU* = 2

-  MSGF_NEXTWINDOW* = 6

-  MSGF_SCROLLBAR* = 5

-  MSGF_MAINLOOP* = 8

-  MSGF_USER* = 4096

-  # ModifyWorldTransform

-  MWT_IDENTITY* = 1

-  MWT_LEFTMULTIPLY* = 2

-  MWT_RIGHTMULTIPLY* = 3

-  # mouse_event

-  MOUSEEVENTF_ABSOLUTE* = 32768

-  MOUSEEVENTF_MOVE* = 1

-  MOUSEEVENTF_LEFTDOWN* = 2

-  MOUSEEVENTF_LEFTUP* = 4

-  MOUSEEVENTF_RIGHTDOWN* = 8

-  MOUSEEVENTF_RIGHTUP* = 16

-  MOUSEEVENTF_MIDDLEDOWN* = 32

-  MOUSEEVENTF_MIDDLEUP* = 64

-  # MoveFileEx

-  MOVEFILE_REPLACE_EXISTING* = 1

-  MOVEFILE_COPY_ALLOWED* = 2

-  MOVEFILE_DELAY_UNTIL_REBOOT* = 4

-  # MsgWaitForMultipleObjects, WaitForMultipleObjectsEx

-  WAIT_OBJECT_0* = 0

-  WAIT_ABANDONED_0* = 0x00000080

-  WAIT_TIMEOUT* = 0x00000102

-  WAIT_IO_COMPLETION* = 0x000000C0

-  WAIT_ABANDONED* = 0x00000080

-  WAIT_FAILED* = 0xFFFFFFFF

-  MAXIMUM_WAIT_OBJECTS* = 0x00000040

-  MAXIMUM_SUSPEND_COUNT* = 0x0000007F

-  # MultiByteToWideChar

-  MB_PRECOMPOSED* = 1

-  MB_COMPOSITE* = 2

-  MB_ERR_INVALID_CHARS* = 8

-  MB_USEGLYPHCHARS* = 4

-  # NDdeSetTrustedShare

-  # NetAccessCheck

-  # NetServerEnum

-  # NetServiceControl

-  # NetUserEnum

-  # OpenProcessToken

-  TOKEN_ADJUST_DEFAULT* = 128

-  TOKEN_ADJUST_GROUPS* = 64

-  TOKEN_ADJUST_PRIVILEGES* = 32

-  TOKEN_ALL_ACCESS* = 0x000F00FF

-  TOKEN_ASSIGN_PRIMARY* = 1

-  TOKEN_DUPLICATE* = 2

-  TOKEN_EXECUTE* = 0x00020000

-  TOKEN_IMPERSONATE* = 4

-  TOKEN_QUERY* = 8

-  TOKEN_QUERY_SOURCE* = 16

-  TOKEN_READ* = 0x00020008

-  TOKEN_WRITE* = 0x000200E0

-  # OpenSCManager

-  SC_MANAGER_ALL_ACCESS* = 0x000F003F

-  SC_MANAGER_CONNECT* = 1

-  SC_MANAGER_CREATE_SERVICE* = 2

-  SC_MANAGER_ENUMERATE_SERVICE* = 4

-  SC_MANAGER_LOCK* = 8

-  SC_MANAGER_QUERY_LOCK_STATUS* = 16

-  SC_MANAGER_MODIFY_BOOT_CONFIG* = 32

-  # PostMessage

-  HWND_BROADCAST* = HWND(0xffff)

-

-const

-  # PrepareTape

-  TAPE_FORMAT* = 0x00000005

-  TAPE_LOAD* = 0

-  TAPE_LOCK* = 0x00000003

-  TAPE_TENSION* = 0x00000002

-  TAPE_UNLOAD* = 0x00000001

-  TAPE_UNLOCK* = 0x00000004

-  # PropertySheet

-  IS_PSREBOOTSYSTEM* = 3

-  IS_PSRESTARTWINDOWS* = 2

-  # PropSheetPageProc

-  PSPCB_CREATE* = 2

-  PSPCB_RELEASE* = 1

-  # PurgeComm

-  PURGE_TXABORT* = 1

-  PURGE_RXABORT* = 2

-  PURGE_TXCLEAR* = 4

-  PURGE_RXCLEAR* = 8

-  # QueryServiceObjectSecurity

-  OWNER_SECURITY_INFORMATION* = 0x00000001

-  GROUP_SECURITY_INFORMATION* = 0x00000002

-  DACL_SECURITY_INFORMATION* = 0x00000004

-  SACL_SECURITY_INFORMATION* = 0x00000008

-  # ReadEventLog, ReportEvent

-  EVENTLOG_FORWARDS_READ* = 4

-  EVENTLOG_BACKWARDS_READ* = 8

-  EVENTLOG_SEEK_READ* = 2

-  EVENTLOG_SEQUENTIAL_READ* = 1

-  EVENTLOG_ERROR_TYPE* = 1

-  EVENTLOG_WARNING_TYPE* = 2

-  EVENTLOG_INFORMATION_TYPE* = 4

-  EVENTLOG_AUDIT_SUCCESS* = 8

-

-  EVENTLOG_AUDIT_FAILURE* = 16

-  # RedrawWindow

-  RDW_ERASE* = 4

-  RDW_FRAME* = 1024

-  RDW_INTERNALPAINT* = 2

-  RDW_INVALIDATE* = 1

-  RDW_NOERASE* = 32

-  RDW_NOFRAME* = 2048

-  RDW_NOINTERNALPAINT* = 16

-  RDW_VALIDATE* = 8

-  RDW_ERASENOW* = 512

-  RDW_UPDATENOW* = 256

-  RDW_ALLCHILDREN* = 128

-  RDW_NOCHILDREN* = 64

-

-  # RegCreateKey

-  HKEY_CLASSES_ROOT* =     HKEY(0x80000000)

-  HKEY_CURRENT_USER* =     HKEY(0x80000001)

-  HKEY_LOCAL_MACHINE* =    HKEY(0x80000002)

-  HKEY_USERS* =            HKEY(0x80000003)

-  HKEY_PERFORMANCE_DATA* = HKEY(0x80000004)

-  HKEY_CURRENT_CONFIG* =   HKEY(0x80000005)

-  HKEY_DYN_DATA* =         HKEY(0x80000006)

-

-const

-  # RegCreateKeyEx

-  REG_OPTION_VOLATILE* = 0x00000001

-  REG_OPTION_NON_VOLATILE* = 0

-  REG_CREATED_NEW_KEY* = 0x00000001

-  REG_OPENED_EXISTING_KEY* = 0x00000002

-  # RegEnumValue

-  REG_BINARY* = 3

-  REG_DWORD* = 4

-  REG_DWORD_LITTLE_ENDIAN* = 4

-  REG_DWORD_BIG_ENDIAN* = 5

-  REG_EXPAND_SZ* = 2

-  REG_FULL_RESOURCE_DESCRIPTOR* = 9

-  REG_LINK* = 6

-  REG_MULTI_SZ* = 7

-  REG_NONE* = 0

-  REG_RESOURCE_LIST* = 8

-  REG_RESOURCE_REQUIREMENTS_LIST* = 10

-  REG_SZ* = 1

-  # RegisterHotKey

-  MOD_ALT* = 1

-  MOD_CONTROL* = 2

-  MOD_SHIFT* = 4

-  MOD_WIN* = 8

-  IDHOT_SNAPDESKTOP* = -2

-  IDHOT_SNAPWINDOW* = -1

-  # RegNotifyChangeKeyValue

-  REG_NOTIFY_CHANGE_NAME* = 0x00000001

-  REG_NOTIFY_CHANGE_ATTRIBUTES* = 0x00000002

-  REG_NOTIFY_CHANGE_LAST_SET* = 0x00000004

-  REG_NOTIFY_CHANGE_SECURITY* = 0x00000008

-  # ScrollWindowEx

-  SW_ERASE* = 4

-  SW_INVALIDATE* = 2

-  SW_SCROLLCHILDREN* = 1

-  # SendMessageTimeout

-  SMTO_ABORTIFHUNG* = 2

-  SMTO_BLOCK* = 1

-  SMTO_NORMAL* = 0

-  # SetBkMode

-  OPAQUE* = 2

-

-  TRANSPARENT* = 1

-  # SetDebugErrorLevel

-  SLE_ERROR* = 1

-  SLE_MINORERROR* = 2

-  SLE_WARNING* = 3

-  # SetErrorMode

-  SEM_FAILCRITICALERRORS* = 1

-  SEM_NOALIGNMENTFAULTEXCEPT* = 4

-  SEM_NOGPFAULTERRORBOX* = 2

-  SEM_NOOPENFILEERRORBOX* = 32768

-  # SetICMMode

-  ICM_ON* = 2

-  ICM_OFF* = 1

-  ICM_QUERY* = 3

-  # SetJob

-  # Locale Information

-  LOCALE_ILANGUAGE* = 1

-  LOCALE_SLANGUAGE* = 2

-  LOCALE_SENGLANGUAGE* = 4097

-  LOCALE_SABBREVLANGNAME* = 3

-  LOCALE_SNATIVELANGNAME* = 4

-  LOCALE_ICOUNTRY* = 5

-  LOCALE_SCOUNTRY* = 6

-  LOCALE_SENGCOUNTRY* = 4098

-  LOCALE_SABBREVCTRYNAME* = 7

-  LOCALE_SNATIVECTRYNAME* = 8

-  LOCALE_IDEFAULTLANGUAGE* = 9

-  LOCALE_IDEFAULTCOUNTRY* = 10

-  LOCALE_IDEFAULTANSICODEPAGE* = 4100

-  LOCALE_IDEFAULTCODEPAGE* = 11

-  LOCALE_SLIST* = 12

-  LOCALE_IMEASURE* = 13

-  LOCALE_SDECIMAL* = 14

-  LOCALE_STHOUSAND* = 15

-  LOCALE_SGROUPING* = 16

-  LOCALE_IDIGITS* = 17

-  LOCALE_ILZERO* = 18

-  LOCALE_INEGNUMBER* = 4112

-  LOCALE_SCURRENCY* = 20

-  LOCALE_SMONDECIMALSEP* = 22

-  LOCALE_SMONTHOUSANDSEP* = 23

-  LOCALE_SMONGROUPING* = 24

-  LOCALE_ICURRDIGITS* = 25

-  LOCALE_ICURRENCY* = 27

-  LOCALE_INEGCURR* = 28

-  LOCALE_SDATE* = 29

-  LOCALE_STIME* = 30

-  LOCALE_STIMEFORMAT* = 4099

-  LOCALE_SSHORTDATE* = 31

-  LOCALE_SLONGDATE* = 32

-  LOCALE_IDATE* = 33

-  LOCALE_ILDATE* = 34

-  LOCALE_ITIME* = 35

-  LOCALE_ITLZERO* = 37

-  LOCALE_IDAYLZERO* = 38

-  LOCALE_IMONLZERO* = 39

-  LOCALE_S1159* = 40

-  LOCALE_S2359* = 41

-  LOCALE_ICALENDARTYPE* = 4105

-  LOCALE_IOPTIONALCALENDAR* = 4107

-  LOCALE_IFIRSTDAYOFWEEK* = 4108

-  LOCALE_IFIRSTWEEKOFYEAR* = 4109

-  LOCALE_SDAYNAME1* = 42

-  LOCALE_SDAYNAME2* = 43

-  LOCALE_SDAYNAME3* = 44

-  LOCALE_SDAYNAME4* = 45

-  LOCALE_SDAYNAME5* = 46

-  LOCALE_SDAYNAME6* = 47

-  LOCALE_SDAYNAME7* = 48

-  LOCALE_SABBREVDAYNAME1* = 49

-  LOCALE_SABBREVDAYNAME2* = 50

-  LOCALE_SABBREVDAYNAME3* = 51

-  LOCALE_SABBREVDAYNAME4* = 52

-  LOCALE_SABBREVDAYNAME5* = 53

-  LOCALE_SABBREVDAYNAME6* = 54

-  LOCALE_SABBREVDAYNAME7* = 55

-  LOCALE_SMONTHNAME1* = 56

-  LOCALE_SMONTHNAME2* = 57

-  LOCALE_SMONTHNAME3* = 58

-  LOCALE_SMONTHNAME4* = 59

-  LOCALE_SMONTHNAME5* = 60

-  LOCALE_SMONTHNAME6* = 61

-  LOCALE_SMONTHNAME7* = 62

-  LOCALE_SMONTHNAME8* = 63

-  LOCALE_SMONTHNAME9* = 64

-  LOCALE_SMONTHNAME10* = 65

-  LOCALE_SMONTHNAME11* = 66

-  LOCALE_SMONTHNAME12* = 67

-  LOCALE_SMONTHNAME13* = 4110

-  LOCALE_SABBREVMONTHNAME1* = 68

-  LOCALE_SABBREVMONTHNAME2* = 69

-  LOCALE_SABBREVMONTHNAME3* = 70

-  LOCALE_SABBREVMONTHNAME4* = 71

-  LOCALE_SABBREVMONTHNAME5* = 72

-  LOCALE_SABBREVMONTHNAME6* = 73

-  LOCALE_SABBREVMONTHNAME7* = 74

-  LOCALE_SABBREVMONTHNAME8* = 75

-  LOCALE_SABBREVMONTHNAME9* = 76

-  LOCALE_SABBREVMONTHNAME10* = 77

-  LOCALE_SABBREVMONTHNAME11* = 78

-  LOCALE_SABBREVMONTHNAME12* = 79

-  LOCALE_SABBREVMONTHNAME13* = 4111

-  LOCALE_SPOSITIVESIGN* = 80

-  LOCALE_SNEGATIVESIGN* = 81

-  LOCALE_IPOSSIGNPOSN* = 82

-  LOCALE_INEGSIGNPOSN* = 83

-  LOCALE_IPOSSYMPRECEDES* = 84

-  LOCALE_IPOSSEPBYSPACE* = 85

-  LOCALE_INEGSYMPRECEDES* = 86

-  LOCALE_INEGSEPBYSPACE* = 87

-  LOCALE_NOUSEROVERRIDE* = 0x80000000

-  LOCALE_USE_CP_ACP* = 0x40000000 # use the system ACP

-  LOCALE_RETURN_NUMBER* = 0x20000000 # return number instead

-  LOCALE_SISO639LANGNAME* = 0x00000059

-  LOCALE_SISO3166CTRYNAME* = 0x0000005A

-  # Calendar Type Information

-  CAL_ICALINTVALUE* = 1

-  CAL_IYEAROFFSETRANGE* = 3

-  CAL_SABBREVDAYNAME1* = 14

-  CAL_SABBREVDAYNAME2* = 15

-  CAL_SABBREVDAYNAME3* = 16

-  CAL_SABBREVDAYNAME4* = 17

-  CAL_SABBREVDAYNAME5* = 18

-  CAL_SABBREVDAYNAME6* = 19

-  CAL_SABBREVDAYNAME7* = 20

-  CAL_SABBREVMONTHNAME1* = 34

-  CAL_SABBREVMONTHNAME2* = 35

-  CAL_SABBREVMONTHNAME3* = 36

-  CAL_SABBREVMONTHNAME4* = 37

-  CAL_SABBREVMONTHNAME5* = 38

-  CAL_SABBREVMONTHNAME6* = 39

-  CAL_SABBREVMONTHNAME7* = 40

-  CAL_SABBREVMONTHNAME8* = 41

-  CAL_SABBREVMONTHNAME9* = 42

-  CAL_SABBREVMONTHNAME10* = 43

-  CAL_SABBREVMONTHNAME11* = 44

-  CAL_SABBREVMONTHNAME12* = 45

-  CAL_SABBREVMONTHNAME13* = 46

-  CAL_SCALNAME* = 2

-  CAL_SDAYNAME1* = 7

-  CAL_SDAYNAME2* = 8

-  CAL_SDAYNAME3* = 9

-  CAL_SDAYNAME4* = 10

-  CAL_SDAYNAME5* = 11

-  CAL_SDAYNAME6* = 12

-  CAL_SDAYNAME7* = 13

-  CAL_SERASTRING* = 4

-  CAL_SLONGDATE* = 6

-  CAL_SMONTHNAME1* = 21

-  CAL_SMONTHNAME2* = 22

-  CAL_SMONTHNAME3* = 23

-  CAL_SMONTHNAME4* = 24

-  CAL_SMONTHNAME5* = 25

-  CAL_SMONTHNAME6* = 26

-  CAL_SMONTHNAME7* = 27

-  CAL_SMONTHNAME8* = 28

-  CAL_SMONTHNAME9* = 29

-  CAL_SMONTHNAME10* = 30

-  CAL_SMONTHNAME11* = 31

-  CAL_SMONTHNAME12* = 32

-  CAL_SMONTHNAME13* = 33

-  CAL_SSHORTDATE* = 5

-  # SetProcessWorkingSetSize

-  PROCESS_SET_QUOTA* = 256

-  # SetPrinter

-  # SetService

-  # SetStretchBltMode

-  BLACKONWHITE* = 1

-  COLORONCOLOR* = 3

-  HALFTONE* = 4

-  STRETCH_ANDSCANS* = 1

-  STRETCH_DELETESCANS* = 3

-  STRETCH_HALFTONE* = 4

-  STRETCH_ORSCANS* = 2

-  WHITEONBLACK* = 2

-  # SetSystemCursor

-  OCR_NORMAL* = 32512

-  OCR_IBEAM* = 32513

-  OCR_WAIT* = 32514

-  OCR_CROSS* = 32515

-  OCR_UP* = 32516

-  OCR_SIZE* = 32640

-  OCR_ICON* = 32641

-  OCR_SIZENWSE* = 32642

-  OCR_SIZENESW* = 32643

-  OCR_SIZEWE* = 32644

-  OCR_SIZENS* = 32645

-  OCR_SIZEALL* = 32646

-  OCR_NO* = 32648

-  OCR_APPSTARTING* = 32650

-  # SetTapePosition

-  TAPE_ABSOLUTE_BLOCK* = 0x00000001

-  TAPE_LOGICAL_BLOCK* = 0x00000002

-  TAPE_REWIND* = 0

-  TAPE_SPACE_END_OF_DATA* = 0x00000004

-  TAPE_SPACE_FILEMARKS* = 0x00000006

-  TAPE_SPACE_RELATIVE_BLOCKS* = 0x00000005

-  TAPE_SPACE_SEQUENTIAL_FMKS* = 0x00000007

-  TAPE_SPACE_SEQUENTIAL_SMKS* = 0x00000009

-  TAPE_SPACE_SETMARKS* = 0x00000008

-  # SetUnhandledExceptionFilter

-  EXCEPTION_EXECUTE_HANDLER* = 1

-  EXCEPTION_CONTINUE_EXECUTION* = -1

-  EXCEPTION_CONTINUE_SEARCH* = 0

-

-  # SetWindowPos, DeferWindowPos

-  HWND_BOTTOM* =    HWND(1)

-  HWND_NOTOPMOST* = HWND(-2)

-  HWND_TOP* =       HWND(0)

-  HWND_TOPMOST* =   HWND(-1)

-

-const

-  SWP_DRAWFRAME* = 32

-  SWP_FRAMECHANGED* = 32

-  SWP_HIDEWINDOW* = 128

-  SWP_NOACTIVATE* = 16

-  SWP_NOCOPYBITS* = 256

-  SWP_NOMOVE* = 2

-  SWP_NOSIZE* = 1

-  SWP_NOREDRAW* = 8

-  SWP_NOZORDER* = 4

-  SWP_SHOWWINDOW* = 64

-  SWP_NOOWNERZORDER* = 512

-  SWP_NOREPOSITION* = 512

-  SWP_NOSENDCHANGING* = 1024

-  # SHAddToRecentDocs

-  # SHAppBarMessage

-  # SHChangeNotify

-  # ShellProc

-  HSHELL_ACTIVATESHELLWINDOW* = 3

-  HSHELL_GETMINRECT* = 5

-  HSHELL_LANGUAGE* = 8

-  HSHELL_REDRAW* = 6

-  HSHELL_TASKMAN* = 7

-  HSHELL_WINDOWACTIVATED* = 4

-  HSHELL_WINDOWCREATED* = 1

-  HSHELL_WINDOWDESTROYED* = 2

-  # SHGetFileInfo

-  # SHGetSpecialFolderLocation

-  # ShowWindow

-  SW_HIDE* = 0

-  SW_MAXIMIZE* = 3

-  SW_MINIMIZE* = 6

-  SW_NORMAL* = 1

-  SW_RESTORE* = 9

-  SW_SHOW* = 5

-  SW_SHOWDEFAULT* = 10

-  SW_SHOWMAXIMIZED* = 3

-  SW_SHOWMINIMIZED* = 2

-  SW_SHOWMINNOACTIVE* = 7

-  SW_SHOWNA* = 8

-  SW_SHOWNOACTIVATE* = 4

-  SW_SHOWNORMAL* = 1

-  WPF_RESTORETOMAXIMIZED* = 2

-  WPF_SETMINPOSITION* = 1

-  # Sleep

-  INFINITE* = -1'i32

-  # SystemParametersInfo

-  SPI_GETBEEP* = 1

-  SPI_SETBEEP* = 2

-  SPI_GETMOUSE* = 3

-  SPI_SETMOUSE* = 4

-  SPI_GETBORDER* = 5

-  SPI_SETBORDER* = 6

-  SPI_GETKEYBOARDSPEED* = 10

-  SPI_SETKEYBOARDSPEED* = 11

-  SPI_LANGDRIVER* = 12

-  SPI_ICONHORIZONTALSPACING* = 13

-  SPI_GETSCREENSAVETIMEOUT* = 14

-  SPI_SETSCREENSAVETIMEOUT* = 15

-  SPI_GETSCREENSAVEACTIVE* = 16

-  SPI_SETSCREENSAVEACTIVE* = 17

-  SPI_GETGRIDGRANULARITY* = 18

-  SPI_SETGRIDGRANULARITY* = 19

-  SPI_SETDESKWALLPAPER* = 20

-  SPI_SETDESKPATTERN* = 21

-  SPI_GETKEYBOARDDELAY* = 22

-  SPI_SETKEYBOARDDELAY* = 23

-  SPI_ICONVERTICALSPACING* = 24

-  SPI_GETICONTITLEWRAP* = 25

-  SPI_SETICONTITLEWRAP* = 26

-  SPI_GETMENUDROPALIGNMENT* = 27

-  SPI_SETMENUDROPALIGNMENT* = 28

-  SPI_SETDOUBLECLKWIDTH* = 29

-  SPI_SETDOUBLECLKHEIGHT* = 30

-  SPI_GETICONTITLELOGFONT* = 31

-  SPI_SETDOUBLECLICKTIME* = 32

-  SPI_SETMOUSEBUTTONSWAP* = 33

-  SPI_SETICONTITLELOGFONT* = 34

-  SPI_GETFASTTASKSWITCH* = 35

-  SPI_SETFASTTASKSWITCH* = 36

-  SPI_SETDRAGFULLWINDOWS* = 37

-  SPI_GETDRAGFULLWINDOWS* = 38

-  SPI_GETNONCLIENTMETRICS* = 41

-  SPI_SETNONCLIENTMETRICS* = 42

-

-  SPI_GETMINIMIZEDMETRICS* = 43

-  SPI_SETMINIMIZEDMETRICS* = 44

-  SPI_GETICONMETRICS* = 45

-  SPI_SETICONMETRICS* = 46

-  SPI_SETWORKAREA* = 47

-  SPI_GETWORKAREA* = 48

-  SPI_SETPENWINDOWS* = 49

-  SPI_GETFILTERKEYS* = 50

-  SPI_SETFILTERKEYS* = 51

-  SPI_GETTOGGLEKEYS* = 52

-  SPI_SETTOGGLEKEYS* = 53

-  SPI_GETMOUSEKEYS* = 54

-  SPI_SETMOUSEKEYS* = 55

-  SPI_GETSHOWSOUNDS* = 56

-  SPI_SETSHOWSOUNDS* = 57

-  SPI_GETSTICKYKEYS* = 58

-  SPI_SETSTICKYKEYS* = 59

-  SPI_GETACCESSTIMEOUT* = 60

-  SPI_SETACCESSTIMEOUT* = 61

-  SPI_GETSERIALKEYS* = 62

-  SPI_SETSERIALKEYS* = 63

-  SPI_GETSOUNDSENTRY* = 64

-  SPI_SETSOUNDSENTRY* = 65

-  SPI_GETHIGHCONTRAST* = 66

-  SPI_SETHIGHCONTRAST* = 67

-  SPI_GETKEYBOARDPREF* = 68

-  SPI_SETKEYBOARDPREF* = 69

-  SPI_GETSCREENREADER* = 70

-  SPI_SETSCREENREADER* = 71

-  SPI_GETANIMATION* = 72

-  SPI_SETANIMATION* = 73

-  SPI_GETFONTSMOOTHING* = 74

-  SPI_SETFONTSMOOTHING* = 75

-  SPI_SETDRAGWIDTH* = 76

-  SPI_SETDRAGHEIGHT* = 77

-  SPI_SETHANDHELD* = 78

-  SPI_GETLOWPOWERTIMEOUT* = 79

-  SPI_GETPOWEROFFTIMEOUT* = 80

-  SPI_SETLOWPOWERTIMEOUT* = 81

-  SPI_SETPOWEROFFTIMEOUT* = 82

-  SPI_GETLOWPOWERACTIVE* = 83

-  SPI_GETPOWEROFFACTIVE* = 84

-  SPI_SETLOWPOWERACTIVE* = 85

-  SPI_SETPOWEROFFACTIVE* = 86

-  SPI_SETCURSORS* = 87

-  SPI_SETICONS* = 88

-  SPI_GETDEFAULTINPUTLANG* = 89

-  SPI_SETDEFAULTINPUTLANG* = 90

-  SPI_SETLANGTOGGLE* = 91

-  SPI_GETWINDOWSEXTENSION* = 92

-  SPI_SETMOUSETRAILS* = 93

-  SPI_GETMOUSETRAILS* = 94

-  SPI_GETSNAPTODEFBUTTON* = 95

-  SPI_SETSNAPTODEFBUTTON* = 96

-  SPI_SCREENSAVERRUNNING* = 97

-  SPI_SETSCREENSAVERRUNNING* = 97

-  SPI_GETMOUSEHOVERWIDTH* = 98

-  SPI_SETMOUSEHOVERWIDTH* = 99

-  SPI_GETMOUSEHOVERHEIGHT* = 100

-  SPI_SETMOUSEHOVERHEIGHT* = 101

-  SPI_GETMOUSEHOVERTIME* = 102

-  SPI_SETMOUSEHOVERTIME* = 103

-  SPI_GETWHEELSCROLLLINES* = 104

-  SPI_SETWHEELSCROLLLINES* = 105

-  SPI_GETMENUSHOWDELAY* = 106

-  SPI_SETMENUSHOWDELAY* = 107

-  SPI_GETSHOWIMEUI* = 110

-  SPI_SETSHOWIMEUI* = 111

-  # Windows Me/2000 and higher

-  SPI_GETMOUSESPEED* = 112

-  SPI_SETMOUSESPEED* = 113

-  SPI_GETSCREENSAVERRUNNING* = 114

-  SPI_GETDESKWALLPAPER* = 115

-  SPI_GETACTIVEWINDOWTRACKING* = 4096

-  SPI_SETACTIVEWINDOWTRACKING* = 4097

-  SPI_GETMENUANIMATION* = 4098

-  SPI_SETMENUANIMATION* = 4099

-  SPI_GETCOMBOBOXANIMATION* = 4100

-  SPI_SETCOMBOBOXANIMATION* = 4101

-  SPI_GETLISTBOXSMOOTHSCROLLING* = 4102

-  SPI_SETLISTBOXSMOOTHSCROLLING* = 4103

-  SPI_GETGRADIENTCAPTIONS* = 4104

-  SPI_SETGRADIENTCAPTIONS* = 4105

-  SPI_GETKEYBOARDCUES* = 4106

-  SPI_SETKEYBOARDCUES* = 4107

-  SPI_GETMENUUNDERLINES* = 4106

-  SPI_SETMENUUNDERLINES* = 4107

-  SPI_GETACTIVEWNDTRKZORDER* = 4108

-  SPI_SETACTIVEWNDTRKZORDER* = 4109

-  SPI_GETHOTTRACKING* = 4110

-  SPI_SETHOTTRACKING* = 4111

-  SPI_GETMENUFADE* = 4114

-  SPI_SETMENUFADE* = 4115

-  SPI_GETSELECTIONFADE* = 4116

-  SPI_SETSELECTIONFADE* = 4117

-  SPI_GETTOOLTIPANIMATION* = 4118

-  SPI_SETTOOLTIPANIMATION* = 4119

-  SPI_GETTOOLTIPFADE* = 4120

-  SPI_SETTOOLTIPFADE* = 4121

-  SPI_GETCURSORSHADOW* = 4122

-  SPI_SETCURSORSHADOW* = 4123

-  SPI_GETUIEFFECTS* = 4158

-  SPI_SETUIEFFECTS* = 4159

-  SPI_GETFOREGROUNDLOCKTIMEOUT* = 8192

-  SPI_SETFOREGROUNDLOCKTIMEOUT* = 8193

-  SPI_GETACTIVEWNDTRKTIMEOUT* = 8194

-  SPI_SETACTIVEWNDTRKTIMEOUT* = 8195

-  SPI_GETFOREGROUNDFLASHCOUNT* = 8196

-  SPI_SETFOREGROUNDFLASHCOUNT* = 8197

-  SPI_GETCARETWIDTH* = 8198

-  SPI_SETCARETWIDTH* = 8199

-  # Windows XP and higher

-  SPI_GETMOUSESONAR* = 4124

-  SPI_SETMOUSESONAR* = 4125

-  SPI_GETMOUSECLICKLOCK* = 4126

-  SPI_SETMOUSECLICKLOCK* = 4127

-  SPI_GETMOUSEVANISH* = 4128

-  SPI_SETMOUSEVANISH* = 4129

-  SPI_GETFLATMENU* = 4130

-  SPI_SETFLATMENU* = 4131

-  SPI_GETDROPSHADOW* = 4132

-  SPI_SETDROPSHADOW* = 4133

-  SPI_GETBLOCKSENDINPUTRESETS* = 4134

-  SPI_SETBLOCKSENDINPUTRESETS* = 4135

-  SPI_GETMOUSECLICKLOCKTIME* = 8200

-  SPI_SETMOUSECLICKLOCKTIME* = 8201

-  SPI_GETFONTSMOOTHINGTYPE* = 8202

-  SPI_SETFONTSMOOTHINGTYPE* = 8203

-  SPI_GETFONTSMOOTHINGCONTRAST* = 8204

-  SPI_SETFONTSMOOTHINGCONTRAST* = 8205

-  SPI_GETFOCUSBORDERWIDTH* = 8206

-  SPI_SETFOCUSBORDERWIDTH* = 8207

-  SPI_GETFOCUSBORDERHEIGHT* = 8208

-  SPI_SETFOCUSBORDERHEIGHT* = 8209

-  SPI_GETFONTSMOOTHINGORIENTATION* = 8210

-  SPI_SETFONTSMOOTHINGORIENTATION* = 8211

-  # constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE:

-  FE_FONTSMOOTHINGSTANDARD* = 1

-  FE_FONTSMOOTHINGCLEARTYPE* = 2

-  FE_FONTSMOOTHINGDOCKING* = 32768

-  # constants for SPI_GETFONTSMOOTHINGORIENTATION and SPI_SETFONTSMOOTHINGORIENTATION:

-  FE_FONTSMOOTHINGORIENTATIONBGR* = 0

-  FE_FONTSMOOTHINGORIENTATIONRGB* = 1

-  # Flags

-  SPIF_UPDATEINIFILE* = 1

-  SPIF_SENDWININICHANGE* = 2

-  SPIF_SENDCHANGE* = 2

-  # TrackPopupMenu, TrackPopMenuEx

-  TPM_CENTERALIGN* = 0x00000004

-  TPM_LEFTALIGN* = 0

-  TPM_RIGHTALIGN* = 0x00000008

-  TPM_LEFTBUTTON* = 0

-  TPM_RIGHTBUTTON* = 0x00000002

-  TPM_HORIZONTAL* = 0

-  TPM_VERTICAL* = 0x00000040

-  # TranslateCharsetInfo

-  TCI_SRCCHARSET* = 1

-  TCI_SRCCODEPAGE* = 2

-  TCI_SRCFONTSIG* = 3

-  # VerFindFile

-  VFFF_ISSHAREDFILE* = 1

-  VFF_CURNEDEST* = 1

-  VFF_FILEINUSE* = 2

-  VFF_BUFFTOOSMALL* = 4

-  # VerInstallFile

-  VIFF_FORCEINSTALL* = 1

-  VIFF_DONTDELETEOLD* = 2

-  VIF_TEMPFILE* = 0x00000001

-  VIF_MISMATCH* = 0x00000002

-  VIF_SRCOLD* = 0x00000004

-  VIF_DIFFLANG* = 0x00000008

-  VIF_DIFFCODEPG* = 0x00000010

-  VIF_DIFFTYPE* = 0x00000020

-  VIF_WRITEPROT* = 0x00000040

-  VIF_FILEINUSE* = 0x00000080

-  VIF_OUTOFSPACE* = 0x00000100

-  VIF_ACCESSVIOLATION* = 0x00000200

-  VIF_SHARINGVIOLATION* = 0x00000400

-  VIF_CANNOTCREATE* = 0x00000800

-  VIF_CANNOTDELETE* = 0x00001000

-  VIF_CANNOTDELETECUR* = 0x00004000

-  VIF_CANNOTRENAME* = 0x00002000

-  VIF_OUTOFMEMORY* = 0x00008000

-  VIF_CANNOTREADSRC* = 0x00010000

-  VIF_CANNOTREADDST* = 0x00020000

-  VIF_BUFFTOOSMALL* = 0x00040000

-  # WideCharToMultiByte

-  WC_COMPOSITECHECK* = 512

-  WC_DISCARDNS* = 16

-  WC_SEPCHARS* = 32

-  WC_DEFAULTCHAR* = 64

-  # WinHelp

-  HELP_COMMAND* = 0x00000102

-  HELP_CONTENTS* = 0x00000003

-  HELP_CONTEXT* = 0x00000001

-  HELP_CONTEXTPOPUP* = 0x00000008

-  HELP_FORCEFILE* = 0x00000009

-  HELP_HELPONHELP* = 0x00000004

-  HELP_INDEX* = 0x00000003

-  HELP_KEY* = 0x00000101

-  HELP_MULTIKEY* = 0x00000201

-  HELP_PARTIALKEY* = 0x00000105

-  HELP_QUIT* = 0x00000002

-  HELP_SETCONTENTS* = 0x00000005

-  HELP_SETINDEX* = 0x00000005

-  HELP_CONTEXTMENU* = 0x0000000A

-  HELP_FINDER* = 0x0000000B

-  HELP_WM_HELP* = 0x0000000C

-  HELP_TCARD* = 0x00008000

-  HELP_TCARD_DATA* = 0x00000010

-  HELP_TCARD_OTHER_CALLER* = 0x00000011

-  # WNetAddConnectino2

-  CONNECT_UPDATE_PROFILE* = 1

-  # WNetConnectionDialog, WNetDisconnectDialog, WNetOpenEnum

-  RESOURCETYPE_DISK* = 1

-  RESOURCETYPE_PRINT* = 2

-  RESOURCETYPE_ANY* = 0

-  RESOURCE_CONNECTED* = 1

-  RESOURCE_GLOBALNET* = 2

-  RESOURCE_REMEMBERED* = 3

-  RESOURCEUSAGE_CONNECTABLE* = 1

-  RESOURCEUSAGE_CONTAINER* = 2

-  # WNetGetResourceInformation, WNetGetResourceParent

-  WN_BAD_NETNAME* = 0x00000043

-  WN_EXTENDED_ERROR* = 0x000004B8

-  WN_MORE_DATA* = 0x000000EA

-  WN_NO_NETWORK* = 0x000004C6

-  WN_SUCCESS* = 0

-  WN_ACCESS_DENIED* = 0x00000005

-  WN_BAD_PROVIDER* = 0x000004B4

-  WN_NOT_AUTHENTICATED* = 0x000004DC

-  # WNetGetUniversalName

-  UNIVERSAL_NAME_INFO_LEVEL* = 1

-  REMOTE_NAME_INFO_LEVEL* = 2

-  # GetExitCodeThread

-  STILL_ACTIVE* = 0x00000103

-  # COMMPROP structure

-  SP_SERIALCOMM* = 0x00000001

-  BAUD_075* = 0x00000001

-  BAUD_110* = 0x00000002

-  BAUD_134_5* = 0x00000004

-  BAUD_150* = 0x00000008

-  BAUD_300* = 0x00000010

-  BAUD_600* = 0x00000020

-  BAUD_1200* = 0x00000040

-  BAUD_1800* = 0x00000080

-  BAUD_2400* = 0x00000100

-  BAUD_4800* = 0x00000200

-  BAUD_7200* = 0x00000400

-  BAUD_9600* = 0x00000800

-  BAUD_14400* = 0x00001000

-  BAUD_19200* = 0x00002000

-  BAUD_38400* = 0x00004000

-  BAUD_56K* = 0x00008000

-  BAUD_57600* = 0x00040000

-  BAUD_115200* = 0x00020000

-  BAUD_128K* = 0x00010000

-  BAUD_USER* = 0x10000000

-  PST_FAX* = 0x00000021

-  PST_LAT* = 0x00000101

-  PST_MODEM* = 0x00000006

-  PST_NETWORK_BRIDGE* = 0x00000100

-  PST_PARALLELPORT* = 0x00000002

-  PST_RS232* = 0x00000001

-  PST_RS422* = 0x00000003

-  PST_RS423* = 0x00000004

-  PST_RS449* = 0x00000005

-  PST_SCANNER* = 0x00000022

-  PST_TCPIP_TELNET* = 0x00000102

-  PST_UNSPECIFIED* = 0

-  PST_X25* = 0x00000103

-  PCF_16BITMODE* = 0x00000200

-  PCF_DTRDSR* = 0x00000001

-  PCF_INTTIMEOUTS* = 0x00000080

-  PCF_PARITY_CHECK* = 0x00000008

-  PCF_RLSD* = 0x00000004

-  PCF_RTSCTS* = 0x00000002

-  PCF_SETXCHAR* = 0x00000020

-  PCF_SPECIALCHARS* = 0x00000100

-  PCF_TOTALTIMEOUTS* = 0x00000040

-  PCF_XONXOFF* = 0x00000010

-  SP_BAUD* = 0x00000002

-  SP_DATABITS* = 0x00000004

-  SP_HANDSHAKING* = 0x00000010

-  SP_PARITY* = 0x00000001

-  SP_PARITY_CHECK* = 0x00000020

-  SP_RLSD* = 0x00000040

-  SP_STOPBITS* = 0x00000008

-  DATABITS_5* = 1

-  DATABITS_6* = 2

-  DATABITS_7* = 4

-  DATABITS_8* = 8

-  DATABITS_16* = 16

-  DATABITS_16X* = 32

-  STOPBITS_10* = 1

-  STOPBITS_15* = 2

-  STOPBITS_20* = 4

-  PARITY_NONE* = 256

-  PARITY_ODD* = 512

-  PARITY_EVEN* = 1024

-  PARITY_MARK* = 2048

-  PARITY_SPACE* = 4096

-  COMMPROP_INITIALIZED* = 0xE73CF52E

-  # DCB structure

-  CBR_110* = 110

-  CBR_300* = 300

-  CBR_600* = 600

-  CBR_1200* = 1200

-  CBR_2400* = 2400

-  CBR_4800* = 4800

-  CBR_9600* = 9600

-  CBR_14400* = 14400

-  CBR_19200* = 19200

-  CBR_38400* = 38400

-  CBR_56000* = 56000

-  CBR_57600* = 57600

-  CBR_115200* = 115200

-  CBR_128000* = 128000

-  CBR_256000* = 256000

-  DTR_CONTROL_DISABLE* = 0

-  DTR_CONTROL_ENABLE* = 1

-  DTR_CONTROL_HANDSHAKE* = 2

-  RTS_CONTROL_DISABLE* = 0

-  RTS_CONTROL_ENABLE* = 1

-  RTS_CONTROL_HANDSHAKE* = 2

-  RTS_CONTROL_TOGGLE* = 3

-  EVENPARITY* = 2

-  MARKPARITY* = 3

-  NOPARITY* = 0

-  ODDPARITY* = 1

-  SPACEPARITY* = 4

-  ONESTOPBIT* = 0

-  ONE5STOPBITS* = 1

-  TWOSTOPBITS* = 2

-  # Debugging events

-  CREATE_PROCESS_DEBUG_EVENT* = 3

-  CREATE_THREAD_DEBUG_EVENT* = 2

-  EXCEPTION_DEBUG_EVENT* = 1

-  EXIT_PROCESS_DEBUG_EVENT* = 5

-  EXIT_THREAD_DEBUG_EVENT* = 4

-  LOAD_DLL_DEBUG_EVENT* = 6

-  OUTPUT_DEBUG_STRING_EVENT* = 8

-  UNLOAD_DLL_DEBUG_EVENT* = 7

-  RIP_EVENT* = 9

-  # PROCESS_HEAP_ENTRY structure

-  PROCESS_HEAP_REGION* = 1

-  PROCESS_HEAP_UNCOMMITTED_RANGE* = 2

-  PROCESS_HEAP_ENTRY_BUSY* = 4

-  PROCESS_HEAP_ENTRY_MOVEABLE* = 16

-  PROCESS_HEAP_ENTRY_DDESHARE* = 32

-  # Win32s

-  HINSTANCE_ERROR* = 32

-  # WIN32_STREAM_ID structure

-  BACKUP_DATA* = 1

-  BACKUP_EA_DATA* = 2

-  BACKUP_SECURITY_DATA* = 3

-  BACKUP_ALTERNATE_DATA* = 4

-  BACKUP_LINK* = 5

-  STREAM_MODIFIED_WHEN_READ* = 1

-  STREAM_CONTAINS_SECURITY* = 2

-  # STARTUPINFO structure

-  STARTF_USESHOWWINDOW* = 1

-  STARTF_USEPOSITION* = 4

-  STARTF_USESIZE* = 2

-  STARTF_USECOUNTCHARS* = 8

-  STARTF_USEFILLATTRIBUTE* = 16

-  STARTF_RUNFULLSCREEN* = 32

-  STARTF_FORCEONFEEDBACK* = 64

-  STARTF_FORCEOFFFEEDBACK* = 128

-  STARTF_USESTDHANDLES* = 256

-  STARTF_USEHOTKEY* = 512

-  # OSVERSIONINFO structure

-  VER_PLATFORM_WIN32s* = 0

-  VER_PLATFORM_WIN32_WINDOWS* = 1

-  VER_PLATFORM_WIN32_NT* = 2

-  # More versions

-  VER_SERVER_NT* = 0x80000000

-  VER_WORKSTATION_NT* = 0x40000000

-  VER_SUITE_SMALLBUSINESS* = 0x00000001

-  VER_SUITE_ENTERPRISE* = 0x00000002

-  VER_SUITE_BACKOFFICE* = 0x00000004

-  VER_SUITE_COMMUNICATIONS* = 0x00000008

-  VER_SUITE_TERMINAL* = 0x00000010

-  VER_SUITE_SMALLBUSINESS_RESTRICTED* = 0x00000020

-  VER_SUITE_EMBEDDEDNT* = 0x00000040

-  VER_SUITE_DATACENTER* = 0x00000080

-  VER_SUITE_SINGLEUSERTS* = 0x00000100

-  VER_SUITE_PERSONAL* = 0x00000200

-  VER_SUITE_BLADE* = 0x00000400

-  VER_SUITE_EMBEDDED_RESTRICTED* = 0x00000800

-  # PROPSHEETPAGE structure

-  MAXPROPPAGES* = 100

-  PSP_DEFAULT* = 0

-  PSP_DLGINDIRECT* = 1

-  PSP_HASHELP* = 32

-  PSP_USECALLBACK* = 128

-  PSP_USEHICON* = 2

-  PSP_USEICONID* = 4

-  PSP_USEREFPARENT* = 64

-  PSP_USETITLE* = 8

-  PSP_RTLREADING* = 16

-  # PROPSHEETHEADER structure

-  PSH_DEFAULT* = 0

-  PSH_HASHELP* = 512

-  PSH_MODELESS* = 1024

-  PSH_NOAPPLYNOW* = 128

-  PSH_PROPSHEETPAGE* = 8

-  PSH_PROPTITLE* = 1

-  PSH_USECALLBACK* = 256

-  PSH_USEHICON* = 2

-  PSH_USEICONID* = 4

-  PSH_USEPSTARTPAGE* = 64

-  PSH_WIZARD* = 32

-  PSH_RTLREADING* = 2048

-  PSCB_INITIALIZED* = 1

-  PSCB_PRECREATE* = 2

-  # PSN_APPLY message

-  PSNRET_NOERROR* = 0

-  PSNRET_INVALID_NOCHANGEPAGE* = 2

-  # Property Sheet

-  PSBTN_APPLYNOW* = 4

-  PSBTN_BACK* = 0

-  PSBTN_CANCEL* = 5

-  PSBTN_FINISH* = 2

-  PSBTN_HELP* = 6

-  PSBTN_NEXT* = 1

-  PSBTN_OK* = 3

-  PSWIZB_BACK* = 1

-  PSWIZB_NEXT* = 2

-  PSWIZB_FINISH* = 4

-  PSWIZB_DISABLEDFINISH* = 8

-  ID_PSREBOOTSYSTEM* = 3

-  ID_PSRESTARTWINDOWS* = 2

-  WIZ_BODYCX* = 184

-  WIZ_BODYX* = 92

-  WIZ_CXBMP* = 80

-  WIZ_CXDLG* = 276

-  WIZ_CYDLG* = 140

-

-  # VX_FIXEDFILEINFO structure

-  VS_FILE_INFO* = cast[MAKEINTRESOURCE](16)

-

-const

-  VS_VERSION_INFO* = 1

-  VS_FF_DEBUG* = 0x00000001

-  VS_FF_INFOINFERRED* = 0x00000010

-  VS_FF_PATCHED* = 0x00000004

-  VS_FF_PRERELEASE* = 0x00000002

-  VS_FF_PRIVATEBUILD* = 0x00000008

-  VS_FF_SPECIALBUILD* = 0x00000020

-  VOS_UNKNOWN* = 0

-  VOS_DOS* = 0x00010000

-  VOS_OS216* = 0x00020000

-  VOS_OS232* = 0x00030000

-  VOS_NT* = 0x00040000

-  VOS_DOS_WINDOWS16* = 0x00010001

-  VOS_DOS_WINDOWS32* = 0x00010004

-  VOS_OS216_PM16* = 0x00020002

-  VOS_OS232_PM32* = 0x00030003

-  VOS_NT_WINDOWS32* = 0x00040004

-  VFT_UNKNOWN* = 0

-  VFT_APP* = 0x00000001

-  VFT_DLL* = 0x00000002

-  VFT_DRV* = 0x00000003

-  VFT_FONT* = 0x00000004

-  VFT_VXD* = 0x00000005

-  VFT_STATIC_LIB* = 0x00000007

-  VFT2_UNKNOWN* = 0

-  VFT2_DRV_PRINTER* = 0x00000001

-  VFT2_DRV_KEYBOARD* = 0x00000002

-  VFT2_DRV_LANGUAGE* = 0x00000003

-  VFT2_DRV_DISPLAY* = 0x00000004

-  VFT2_DRV_MOUSE* = 0x00000005

-  VFT2_DRV_NETWORK* = 0x00000006

-  VFT2_DRV_SYSTEM* = 0x00000007

-  VFT2_DRV_INSTALLABLE* = 0x00000008

-  VFT2_DRV_SOUND* = 0x00000009

-  VFT2_FONT_RASTER* = 0x00000001

-  VFT2_FONT_VECTOR* = 0x00000002

-  VFT2_FONT_TRUETYPE* = 0x00000003

-  # PANOSE structure

-  PAN_ANY* = 0

-  PAN_NO_FIT* = 1

-  PAN_FAMILY_TEXT_DISPLAY* = 2

-  PAN_FAMILY_SCRIPT* = 3

-  PAN_FAMILY_DECORATIVE* = 4

-  PAN_FAMILY_PICTORIAL* = 5

-  PAN_SERIF_COVE* = 2

-  PAN_SERIF_OBTUSE_COVE* = 3

-  PAN_SERIF_SQUARE_COVE* = 4

-  PAN_SERIF_OBTUSE_SQUARE_COVE* = 5

-  PAN_SERIF_SQUARE* = 6

-  PAN_SERIF_THIN* = 7

-  PAN_SERIF_BONE* = 8

-  PAN_SERIF_EXAGGERATED* = 9

-  PAN_SERIF_TRIANGLE* = 10

-  PAN_SERIF_NORMAL_SANS* = 11

-  PAN_SERIF_OBTUSE_SANS* = 12

-  PAN_SERIF_PERP_SANS* = 13

-  PAN_SERIF_FLARED* = 14

-  PAN_SERIF_ROUNDED* = 15

-  PAN_WEIGHT_VERY_LIGHT* = 2

-  PAN_WEIGHT_LIGHT* = 3

-  PAN_WEIGHT_THIN* = 4

-  PAN_WEIGHT_BOOK* = 5

-  PAN_WEIGHT_MEDIUM* = 6

-  PAN_WEIGHT_DEMI* = 7

-  PAN_WEIGHT_BOLD* = 8

-  PAN_WEIGHT_HEAVY* = 9

-  PAN_WEIGHT_BLACK* = 10

-  PAN_WEIGHT_NORD* = 11

-  PAN_PROP_OLD_STYLE* = 2

-  PAN_PROP_MODERN* = 3

-  PAN_PROP_EVEN_WIDTH* = 4

-  PAN_PROP_EXPANDED* = 5

-  PAN_PROP_CONDENSED* = 6

-  PAN_PROP_VERY_EXPANDED* = 7

-  PAN_PROP_VERY_CONDENSED* = 8

-  PAN_PROP_MONOSPACED* = 9

-  PAN_CONTRAST_NONE* = 2

-  PAN_CONTRAST_VERY_LOW* = 3

-  PAN_CONTRAST_LOW* = 4

-  PAN_CONTRAST_MEDIUM_LOW* = 5

-  PAN_CONTRAST_MEDIUM* = 6

-  PAN_CONTRAST_MEDIUM_HIGH* = 7

-  PAN_CONTRAST_HIGH* = 8

-  PAN_CONTRAST_VERY_HIGH* = 9

-  PAN_STROKE_GRADUAL_DIAG* = 2

-  PAN_STROKE_GRADUAL_TRAN* = 3

-  PAN_STROKE_GRADUAL_VERT* = 4

-  PAN_STROKE_GRADUAL_HORZ* = 5

-  PAN_STROKE_RAPID_VERT* = 6

-  PAN_STROKE_RAPID_HORZ* = 7

-  PAN_STROKE_INSTANT_VERT* = 8

-  PAN_STRAIGHT_ARMS_HORZ* = 2

-  PAN_STRAIGHT_ARMS_WEDGE* = 3

-  PAN_STRAIGHT_ARMS_VERT* = 4

-  PAN_STRAIGHT_ARMS_SINGLE_SERIF* = 5

-  PAN_STRAIGHT_ARMS_DOUBLE_SERIF* = 6

-  PAN_BENT_ARMS_HORZ* = 7

-  PAN_BENT_ARMS_VERT* = 9

-  PAN_BENT_ARMS_WEDGE* = 8

-  PAN_BENT_ARMS_SINGLE_SERIF* = 10

-  PAN_BENT_ARMS_DOUBLE_SERIF* = 11

-  PAN_LETT_NORMAL_CONTACT* = 2

-  PAN_LETT_NORMAL_WEIGHTED* = 3

-  PAN_LETT_NORMAL_BOXED* = 4

-  PAN_LETT_NORMAL_FLATTENED* = 5

-  PAN_LETT_NORMAL_ROUNDED* = 6

-  PAN_LETT_NORMAL_OFF_CENTER* = 7

-  PAN_LETT_NORMAL_SQUARE* = 8

-  PAN_LETT_OBLIQUE_CONTACT* = 9

-  PAN_LETT_OBLIQUE_WEIGHTED* = 10

-  PAN_LETT_OBLIQUE_BOXED* = 11

-  PAN_LETT_OBLIQUE_FLATTENED* = 12

-  PAN_LETT_OBLIQUE_ROUNDED* = 13

-  PAN_LETT_OBLIQUE_OFF_CENTER* = 14

-  PAN_LETT_OBLIQUE_SQUARE* = 15

-  PAN_MIDLINE_STANDARD_TRIMMED* = 2

-  PAN_MIDLINE_STANDARD_POINTED* = 3

-  PAN_MIDLINE_STANDARD_SERIFED* = 4

-  PAN_MIDLINE_HIGH_TRIMMED* = 5

-  PAN_MIDLINE_HIGH_POINTED* = 6

-  PAN_MIDLINE_HIGH_SERIFED* = 7

-  PAN_MIDLINE_CONSTANT_TRIMMED* = 8

-  PAN_MIDLINE_CONSTANT_POINTED* = 9

-  PAN_MIDLINE_CONSTANT_SERIFED* = 10

-  PAN_MIDLINE_LOW_TRIMMED* = 11

-  PAN_MIDLINE_LOW_POINTED* = 12

-  PAN_MIDLINE_LOW_SERIFED* = 13

-  PAN_XHEIGHT_CONSTANT_SMALL* = 2

-  PAN_XHEIGHT_CONSTANT_STD* = 3

-  PAN_XHEIGHT_CONSTANT_LARGE* = 4

-  PAN_XHEIGHT_DUCKING_SMALL* = 5

-  PAN_XHEIGHT_DUCKING_STD* = 6

-  PAN_XHEIGHT_DUCKING_LARGE* = 7

-  # PALETTENTRY structure

-  PC_EXPLICIT* = 2

-  PC_NOCOLLAPSE* = 4

-  PC_RESERVED* = 1

-  # LOGBRUSH structure

-  BS_DIBPATTERN* = 5

-  BS_DIBPATTERN8X8* = 8

-  BS_DIBPATTERNPT* = 6

-  BS_HATCHED* = 2

-  BS_HOLLOW* = 1

-  BS_NULL* = 1

-  BS_PATTERN* = 3

-  BS_PATTERN8X8* = 7

-  BS_SOLID* = 0

-  # DEVMODE structure, field selection bits

-  DM_ORIENTATION* = 0x00000001

-  DM_PAPERSIZE* = 0x00000002

-  DM_PAPERLENGTH* = 0x00000004

-  DM_PAPERWIDTH* = 0x00000008

-  DM_SCALE* = 0x00000010

-  DM_POSITION* = 0x00000020

-  DM_NUP* = 0x00000040

-  DM_DISPLAYORIENTATION* = 0x00000080

-  DM_COPIES* = 0x00000100

-  DM_DEFAULTSOURCE* = 0x00000200

-  DM_PRINTQUALITY* = 0x00000400

-  DM_COLOR* = 0x00000800

-  DM_DUPLEX* = 0x00001000

-  DM_YRESOLUTION* = 0x00002000

-  DM_TTOPTION* = 0x00004000

-  DM_COLLATE* = 0x00008000

-  DM_FORMNAME* = 0x00010000

-  DM_LOGPIXELS* = 0x00020000

-  DM_BITSPERPEL* = 0x00040000

-  DM_PELSWIDTH* = 0x00080000

-  DM_PELSHEIGHT* = 0x00100000

-  DM_DISPLAYFLAGS* = 0x00200000

-  DM_DISPLAYFREQUENCY* = 0x00400000

-  DM_ICMMETHOD* = 0x00800000

-  DM_ICMINTENT* = 0x01000000

-  DM_MEDIATYPE* = 0x02000000

-  DM_DITHERTYPE* = 0x04000000

-  DM_PANNINGWIDTH* = 0x08000000

-  DM_PANNINGHEIGHT* = 0x10000000

-  DM_DISPLAYFIXEDOUTPUT* = 0x20000000

-  # orientation selections

-  DMORIENT_LANDSCAPE* = 2

-  DMORIENT_PORTRAIT* = 1

-  # paper selections

-  DMPAPER_LETTER* = 1

-  DMPAPER_LEGAL* = 5

-  DMPAPER_A4* = 9

-  DMPAPER_CSHEET* = 24

-  DMPAPER_DSHEET* = 25

-  DMPAPER_ESHEET* = 26

-  DMPAPER_LETTERSMALL* = 2

-  DMPAPER_TABLOID* = 3

-  DMPAPER_LEDGER* = 4

-  DMPAPER_STATEMENT* = 6

-  DMPAPER_EXECUTIVE* = 7

-  DMPAPER_A3* = 8

-  DMPAPER_A4SMALL* = 10

-  DMPAPER_A5* = 11

-  DMPAPER_B4* = 12

-  DMPAPER_B5* = 13

-  DMPAPER_FOLIO* = 14

-  DMPAPER_QUARTO* = 15

-  DMPAPER_10X14* = 16

-  DMPAPER_11X17* = 17

-  DMPAPER_NOTE* = 18

-  DMPAPER_ENV_9* = 19

-  DMPAPER_ENV_10* = 20

-  DMPAPER_ENV_11* = 21

-  DMPAPER_ENV_12* = 22

-  DMPAPER_ENV_14* = 23

-  DMPAPER_ENV_DL* = 27

-  DMPAPER_ENV_C5* = 28

-  DMPAPER_ENV_C3* = 29

-  DMPAPER_ENV_C4* = 30

-  DMPAPER_ENV_C6* = 31

-  DMPAPER_ENV_C65* = 32

-  DMPAPER_ENV_B4* = 33

-  DMPAPER_ENV_B5* = 34

-  DMPAPER_ENV_B6* = 35

-  DMPAPER_ENV_ITALY* = 36

-  DMPAPER_ENV_MONARCH* = 37

-  DMPAPER_ENV_PERSONAL* = 38

-  DMPAPER_FANFOLD_US* = 39

-  DMPAPER_FANFOLD_STD_GERMAN* = 40

-  DMPAPER_FANFOLD_LGL_GERMAN* = 41

-  DMPAPER_ISO_B4* = 42

-  DMPAPER_JAPANESE_POSTCARD* = 43

-  DMPAPER_9X11* = 44

-  DMPAPER_10X11* = 45

-  DMPAPER_15X11* = 46

-  DMPAPER_ENV_INVITE* = 47

-  DMPAPER_RESERVED_48* = 48

-  DMPAPER_RESERVED_49* = 49

-  DMPAPER_LETTER_EXTRA* = 50

-  DMPAPER_LEGAL_EXTRA* = 51

-  DMPAPER_TABLOID_EXTRA* = 52

-  DMPAPER_A4_EXTRA* = 53

-  DMPAPER_LETTER_TRANSVERSE* = 54

-  DMPAPER_A4_TRANSVERSE* = 55

-  DMPAPER_LETTER_EXTRA_TRANSVERSE* = 56

-  DMPAPER_A_PLUS* = 57

-  DMPAPER_B_PLUS* = 58

-  DMPAPER_LETTER_PLUS* = 59

-  DMPAPER_A4_PLUS* = 60

-  DMPAPER_A5_TRANSVERSE* = 61

-  DMPAPER_B5_TRANSVERSE* = 62

-  DMPAPER_A3_EXTRA* = 63

-  DMPAPER_A5_EXTRA* = 64

-  DMPAPER_B5_EXTRA* = 65

-  DMPAPER_A2* = 66

-  DMPAPER_A3_TRANSVERSE* = 67

-  DMPAPER_A3_EXTRA_TRANSVERSE* = 68

-  DMPAPER_DBL_JAPANESE_POSTCARD* = 69

-  DMPAPER_A6* = 70

-  DMPAPER_JENV_KAKU2* = 71

-  DMPAPER_JENV_KAKU3* = 72

-  DMPAPER_JENV_CHOU3* = 73

-  DMPAPER_JENV_CHOU4* = 74

-  DMPAPER_LETTER_ROTATED* = 75

-  DMPAPER_A3_ROTATED* = 76

-  DMPAPER_A4_ROTATED* = 77

-  DMPAPER_A5_ROTATED* = 78

-  DMPAPER_B4_JIS_ROTATED* = 79

-  DMPAPER_B5_JIS_ROTATED* = 80

-  DMPAPER_JAPANESE_POSTCARD_ROTATED* = 81

-  DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED* = 82

-  DMPAPER_A6_ROTATED* = 83

-  DMPAPER_JENV_KAKU2_ROTATED* = 84

-  DMPAPER_JENV_KAKU3_ROTATED* = 85

-  DMPAPER_JENV_CHOU3_ROTATED* = 86

-  DMPAPER_JENV_CHOU4_ROTATED* = 87

-  DMPAPER_B6_JIS* = 88

-  DMPAPER_B6_JIS_ROTATED* = 89

-  DMPAPER_12X11* = 90

-  DMPAPER_JENV_YOU4* = 91

-  DMPAPER_JENV_YOU4_ROTATED* = 92

-  DMPAPER_P16K* = 93

-  DMPAPER_P32K* = 94

-  DMPAPER_P32KBIG* = 95

-  DMPAPER_PENV_1* = 96

-  DMPAPER_PENV_2* = 97

-  DMPAPER_PENV_3* = 98

-  DMPAPER_PENV_4* = 99

-  DMPAPER_PENV_5* = 100

-  DMPAPER_PENV_6* = 101

-  DMPAPER_PENV_7* = 102

-  DMPAPER_PENV_8* = 103

-  DMPAPER_PENV_9* = 104

-  DMPAPER_PENV_10* = 105

-  DMPAPER_P16K_ROTATED* = 106

-  DMPAPER_P32K_ROTATED* = 107

-  DMPAPER_P32KBIG_ROTATED* = 108

-  DMPAPER_PENV_1_ROTATED* = 109

-  DMPAPER_PENV_2_ROTATED* = 110

-  DMPAPER_PENV_3_ROTATED* = 111

-  DMPAPER_PENV_4_ROTATED* = 112

-  DMPAPER_PENV_5_ROTATED* = 113

-  DMPAPER_PENV_6_ROTATED* = 114

-  DMPAPER_PENV_7_ROTATED* = 115

-  DMPAPER_PENV_8_ROTATED* = 116

-  DMPAPER_PENV_9_ROTATED* = 117

-  DMPAPER_PENV_10_ROTATED* = 118

-  DMPAPER_USER* = 256

-  # bin selections

-  DMBIN_UPPER* = 1

-  DMBIN_ONLYONE* = 1

-  DMBIN_LOWER* = 2

-  DMBIN_MIDDLE* = 3

-  DMBIN_MANUAL* = 4

-  DMBIN_ENVELOPE* = 5

-  DMBIN_ENVMANUAL* = 6

-  DMBIN_AUTO* = 7

-  DMBIN_TRACTOR* = 8

-  DMBIN_SMALLFMT* = 9

-  DMBIN_LARGEFMT* = 10

-  DMBIN_LARGECAPACITY* = 11

-  DMBIN_CASSETTE* = 14

-  DMBIN_FORMSOURCE* = 15

-  DMBIN_USER* = 256

-  # print qualities

-  DMRES_DRAFT* = -1

-  DMRES_LOW* = -2

-  DMRES_MEDIUM* = -3

-  DMRES_HIGH* = -4

-  # color enable/disable for color printers

-  DMCOLOR_MONOCHROME* = 1

-  DMCOLOR_COLOR* = 2

-  # duplex enable

-  DMDUP_SIMPLEX* = 1

-  DMDUP_VERTICAL* = 2

-  DMDUP_HORIZONTAL* = 3

-  # TrueType options

-  DMTT_BITMAP* = 1

-  DMTT_DOWNLOAD* = 2

-  DMTT_SUBDEV* = 3

-  # Collation selections

-  DMCOLLATE_TRUE* = 1

-  DMCOLLATE_FALSE* = 0

-  # DEVMODE dmDisplayOrientation specifiations

-  DMDO_DEFAULT* = 0

-  DMDO_90* = 1

-  DMDO_180* = 2

-  DMDO_270* = 3

-  # DEVMODE dmDisplayFixedOutput specifiations

-  DMDFO_DEFAULT* = 0

-  DMDFO_STRETCH* = 1

-  DMDFO_CENTER* = 2

-  # Deprecated

-  #DM_GRAYSCALE* = 1

-  #DM_INTERLACED* = 2

-  DMDISPLAYFLAGS_TEXTMODE* = 0x00000004

-  # dmNup , multiple logical page per physical page options

-  DMNUP_SYSTEM* = 1

-  DMNUP_ONEUP* = 2

-  # ICM methods

-  DMICMMETHOD_NONE* = 1

-  DMICMMETHOD_SYSTEM* = 2

-  DMICMMETHOD_DRIVER* = 3

-  DMICMMETHOD_DEVICE* = 4

-  DMICMMETHOD_USER* = 256

-  # ICM Intents

-  DMICM_SATURATE* = 1

-  DMICM_CONTRAST* = 2

-  DMICM_COLORMETRIC* = 3

-  DMICM_USER* = 256

-  # Media types

-  DMMEDIA_STANDARD* = 1

-  DMMEDIA_TRANSPARENCY* = 2

-  DMMEDIA_GLOSSY* = 3

-  DMMEDIA_USER* = 256

-  # Dither types

-  DMDITHER_NONE* = 1

-  DMDITHER_COARSE* = 2

-  DMDITHER_FINE* = 3

-  DMDITHER_LINEART* = 4

-  DMDITHER_GRAYSCALE* = 10

-  DMDITHER_USER* = 256

-  # RGNDATAHEADER structure

-  RDH_RECTANGLES* = 1

-  # TTPOLYGONHEADER structure

-  TT_POLYGON_TYPE* = 24

-  # TTPOLYCURVE structure

-  TT_PRIM_LINE* = 1

-  TT_PRIM_QSPLINE* = 2

-  # GCP_RESULTS structure

-  GCPCLASS_ARABIC* = 2

-  GCPCLASS_HEBREW* = 2

-  GCPCLASS_LATIN* = 1

-  GCPCLASS_LATINNUMBER* = 5

-  GCPCLASS_LOCALNUMBER* = 4

-  GCPCLASS_LATINNUMERICSEPARATOR* = 7

-  GCPCLASS_LATINNUMERICTERMINATOR* = 6

-  GCPCLASS_NEUTRAL* = 3

-  GCPCLASS_NUMERICSEPARATOR* = 8

-  GCPCLASS_PREBOUNDLTR* = 128

-  GCPCLASS_PREBOUNDRTL* = 64

-  GCPCLASS_POSTBOUNDLTR* = 32

-  GCPCLASS_POSTBOUNDRTL* = 16

-  GCPGLYPH_LINKBEFORE* = 32768

-  GCPGLYPH_LINKAFTER* = 16384

-  # RASTERIZER_STATUS structure

-  TT_AVAILABLE* = 1

-  TT_ENABLED* = 2

-  # COLORADJUSTMENT structure

-  CA_NEGATIVE* = 1

-  CA_LOG_FILTER* = 2

-  ILLUMINANT_DEVICE_DEFAULT* = 0

-  ILLUMINANT_A* = 1

-  ILLUMINANT_B* = 2

-  ILLUMINANT_C* = 3

-  ILLUMINANT_D50* = 4

-  ILLUMINANT_D55* = 5

-  ILLUMINANT_D65* = 6

-  ILLUMINANT_D75* = 7

-  ILLUMINANT_F2* = 8

-  ILLUMINANT_TUNGSTEN* = 1

-  ILLUMINANT_DAYLIGHT* = 3

-  ILLUMINANT_FLUORESCENT* = 8

-  ILLUMINANT_NTSC* = 3

-  # DOCINFO structure

-  DI_APPBANDING* = 1

-  # EMRMETAHEADER structure

-  EMR_HEADER* = 1

-  ENHMETA_SIGNATURE* = 1179469088

-  # RTF event masks

-  ENM_CHANGE* = 1

-  ENM_CORRECTTEXT* = 4194304

-  ENM_DROPFILES* = 1048576

-  ENM_KEYEVENTS* = 65536

-  ENM_MOUSEEVENTS* = 131072

-  ENM_PROTECTED* = 2097152

-  ENM_REQUESTRESIZE* = 262144

-  ENM_SCROLL* = 4

-  ENM_SELCHANGE* = 524288

-  ENM_UPDATE* = 2

-  ENM_NONE* = 0

-  # RTF styles

-  ES_DISABLENOSCROLL* = 8192

-  ES_EX_NOCALLOLEINIT* = 16777216

-  ES_NOIME* = 524288

-  ES_SAVESEL* = 32768

-  ES_SELFIME* = 262144

-  ES_SUNKEN* = 16384

-  ES_VERTICAL* = 4194304

-  ES_SELECTIONBAR* = 16777216

-  # EM_SETOPTIONS message

-  ECOOP_SET* = 1

-  ECOOP_OR* = 2

-  ECOOP_AND* = 3

-  ECOOP_XOR* = 4

-  ECO_AUTOWORDSELECTION* = 1

-  ECO_AUTOVSCROLL* = 64

-  ECO_AUTOHSCROLL* = 128

-  ECO_NOHIDESEL* = 256

-  ECO_READONLY* = 2048

-  ECO_WANTRETURN* = 4096

-  ECO_SAVESEL* = 32768

-  ECO_SELECTIONBAR* = 16777216

-  ECO_VERTICAL* = 4194304

-  # EM_SETCHARFORMAT message

-  SCF_WORD* = 2

-  SCF_SELECTION* = 1

-  # EM_STREAMOUT message

-  SF_TEXT* = 1

-  SF_RTF* = 2

-  SF_RTFNOOBJS* = 3

-  SF_TEXTIZED* = 4

-  SFF_SELECTION* = 32768

-  SFF_PLAINRTF* = 16384

-  # EM_FINDWORDBREAK message

-  WB_CLASSIFY* = 3

-  #WB_ISDELIMITER = 2;

-  #     WB_LEFT = 0; already above

-  WB_LEFTBREAK* = 6

-  WB_PREVBREAK* = 6

-  WB_MOVEWORDLEFT* = 4

-  WB_MOVEWORDPREV* = 4

-  WB_MOVEWORDRIGHT* = 5

-  WB_MOVEWORDNEXT* = 5

-  #WB_RIGHT = 1;already above

-  WB_RIGHTBREAK* = 7

-  WB_NEXTBREAK* = 7

-  # EM_GETPUNCTUATION message

-  PC_LEADING* = 2

-  PC_FOLLOWING* = 1

-  PC_DELIMITER* = 4

-  PC_OVERFLOW* = 3

-  # EM_SETWORDWRAPMODE message

-  WBF_WORDWRAP* = 16

-  WBF_WORDBREAK* = 32

-  WBF_OVERFLOW* = 64

-  WBF_LEVEL1* = 128

-  WBF_LEVEL2* = 256

-  WBF_CUSTOM* = 512

-  WBF_BREAKAFTER* = 64

-  WBF_BREAKLINE* = 32

-  WBF_ISWHITE* = 16

-  # CHARFORMAT structure

-  CFM_BOLD* = 1

-  CFM_COLOR* = 1073741824

-  CFM_FACE* = 536870912

-  CFM_ITALIC* = 2

-  CFM_OFFSET* = 268435456

-  CFM_PROTECTED* = 16

-  CFM_SIZE* = 0x80000000

-  CFM_STRIKEOUT* = 8

-  CFM_UNDERLINE* = 4

-  CFE_AUTOCOLOR* = 1073741824

-  CFE_BOLD* = 1

-  CFE_ITALIC* = 2

-  CFE_STRIKEOUT* = 8

-  CFE_UNDERLINE* = 4

-  CFE_PROTECTED* = 16

-  # PARAFORMAT structure

-  PFM_ALIGNMENT* = 8

-  PFM_NUMBERING* = 32

-  PFM_OFFSET* = 4

-  PFM_OFFSETINDENT* = 0x80000000

-  PFM_RIGHTINDENT* = 2

-  PFM_STARTINDENT* = 1

-  PFM_TABSTOPS* = 16

-  PFN_BULLET* = 1

-  PFA_LEFT* = 1

-  PFA_RIGHT* = 2

-  PFA_CENTER* = 3

-  # SELCHANGE structure

-  SEL_EMPTY* = 0

-  SEL_TEXT* = 1

-  SEL_OBJECT* = 2

-  SEL_MULTICHAR* = 4

-  SEL_MULTIOBJECT* = 8

-  # RTF clipboard formats

-  CF_RTF* = "Rich Text Format"

-  CF_RETEXTOBJ* = "RichEdit Text and Objects"

-  # DRAWITEMSTRUCT structure

-  ODT_BUTTON* = 4

-  ODT_COMBOBOX* = 3

-  ODT_LISTBOX* = 2

-  ODT_LISTVIEW* = 102

-  ODT_MENU* = 1

-  ODT_STATIC* = 5

-  ODT_TAB* = 101

-  ODT_HEADER* = 100

-  ODA_DRAWENTIRE* = 1

-  ODA_FOCUS* = 4

-  ODA_SELECT* = 2

-  ODS_SELECTED* = 1

-  ODS_GRAYED* = 2

-  ODS_DISABLED* = 4

-  ODS_CHECKED* = 8

-  ODS_FOCUS* = 16

-  ODS_DEFAULT* = 32

-  ODS_HOTLIGHT* = 0x00000040

-  ODS_INACTIVE* = 0x00000080

-  ODS_NOACCEL* = 0x00000100

-  ODS_NOFOCUSRECT* = 0x00000200

-  ODS_COMBOBOXEDIT* = 0x00001000

-  # Common control styles

-  CCS_ADJUSTABLE* = 0x00000020

-  CCS_BOTTOM* = 0x00000003

-  CCS_NODIVIDER* = 0x00000040

-  CCS_NOMOVEY* = 0x00000002

-  CCS_NOPARENTALIGN* = 0x00000008

-  CCS_NORESIZE* = 0x00000004

-  CCS_TOP* = 0x00000001

-

-  # Common control window classes

-  ANIMATE_CLASSW* = "SysAnimate32"

-  HOTKEY_CLASSW* = "msctls_hotkey32"

-  PROGRESS_CLASSW* = "msctls_progress32"

-  STATUSCLASSNAMEW* = "msctls_statusbar32"

-  TOOLBARCLASSNAMEW* = "ToolbarWindow32"

-  TOOLTIPS_CLASSW* = "tooltips_class32"

-  TRACKBAR_CLASSW* = "msctls_trackbar32"

-  UPDOWN_CLASSW* = "msctls_updown32"

-  WC_HEADERW* = "SysHeader32"

-  WC_LISTVIEWW* = "SysListView32"

-  WC_TABCONTROLW* = "SysTabControl32"

-  WC_TREEVIEWW* = "SysTreeView32"

-

-  ANIMATE_CLASSA* = "SysAnimate32"

-  HOTKEY_CLASSA* = "msctls_hotkey32"

-  PROGRESS_CLASSA* = "msctls_progress32"

-  STATUSCLASSNAMEA* = "msctls_statusbar32"

-  TOOLBARCLASSNAMEA* = "ToolbarWindow32"

-  TOOLTIPS_CLASSA* = "tooltips_class32"

-  TRACKBAR_CLASSA* = "msctls_trackbar32"

-  UPDOWN_CLASSA* = "msctls_updown32"

-  WC_HEADERA* = "SysHeader32"

-  WC_LISTVIEWA* = "SysListView32"

-  WC_TABCONTROLA* = "SysTabControl32"

-  WC_TREEVIEWA* = "SysTreeView32"

-

-when defined(winUnicode):

-  const

-    ANIMATE_CLASS* = ANIMATE_CLASSW

-    HOTKEY_CLASS* = HOTKEY_CLASSW

-    PROGRESS_CLASS* = PROGRESS_CLASSW

-    STATUSCLASSNAME* = STATUSCLASSNAMEW

-    TOOLBARCLASSNAME* = TOOLBARCLASSNAMEW

-    TOOLTIPS_CLASS* = TOOLTIPS_CLASSW

-    TRACKBAR_CLASS* = TRACKBAR_CLASSW

-    UPDOWN_CLASS* = UPDOWN_CLASSW

-    WC_HEADER* = WC_HEADERW

-    WC_LISTVIEW* = WC_LISTVIEWW

-    WC_TABCONTROL* = WC_TABCONTROLW

-    WC_TREEVIEW* = WC_TREEVIEWW

-else:

-  const

-    ANIMATE_CLASS* = ANIMATE_CLASSA

-    HOTKEY_CLASS* = HOTKEY_CLASSA

-    PROGRESS_CLASS* = PROGRESS_CLASSA

-    STATUSCLASSNAME* = STATUSCLASSNAMEA

-    TOOLBARCLASSNAME* = TOOLBARCLASSNAMEA

-    TOOLTIPS_CLASS* = TOOLTIPS_CLASSA

-    TRACKBAR_CLASS* = TRACKBAR_CLASSA

-    UPDOWN_CLASS* = UPDOWN_CLASSA

-    WC_HEADER* = WC_HEADERA

-    WC_LISTVIEW* = WC_LISTVIEWA

-    WC_TABCONTROL* = WC_TABCONTROLA

-    WC_TREEVIEW* = WC_TREEVIEWA

-# UNICODE

-

-const

-  # Header control styles

-  HDS_BUTTONS* = 2

-  HDS_HIDDEN* = 8

-  HDS_HORZ* = 0

-  # HD_ITEM structure

-  HDI_BITMAP* = 16

-  HDI_FORMAT* = 4

-  HDI_HEIGHT* = 1

-  HDI_LPARAM* = 8

-  HDI_TEXT* = 2

-  HDI_WIDTH* = 1

-  HDF_CENTER* = 2

-  HDF_LEFT* = 0

-  HDF_RIGHT* = 1

-  HDF_RTLREADING* = 4

-  HDF_BITMAP* = 8192

-  HDF_OWNERDRAW* = 32768

-  HDF_STRING* = 16384

-  HDF_JUSTIFYMASK* = 3

-  # HD_HITTESTINFO structure

-  HHT_NOWHERE* = 1

-  HHT_ONDIVIDER* = 4

-  HHT_ONDIVOPEN* = 8

-  HHT_ONHEADER* = 2

-  HHT_TOLEFT* = 2048

-  HHT_TORIGHT* = 1024

-  # TBADDBITMAP structure

-  HINST_COMMCTRL* = HINST(-1)

-

-const

-  IDB_STD_LARGE_COLOR* = 1

-  IDB_STD_SMALL_COLOR* = 0

-  IDB_VIEW_LARGE_COLOR* = 5

-  IDB_VIEW_SMALL_COLOR* = 4

-  STD_COPY* = 1

-  STD_CUT* = 0

-  STD_DELETE* = 5

-  STD_FILENEW* = 6

-  STD_FILEOPEN* = 7

-  STD_FILESAVE* = 8

-  STD_FIND* = 12

-  STD_HELP* = 11

-  STD_PASTE* = 2

-  STD_PRINT* = 14

-  STD_PRINTPRE* = 9

-  STD_PROPERTIES* = 10

-  STD_REDOW* = 4

-  STD_REPLACE* = 13

-  STD_UNDO* = 3

-  VIEW_LARGEICONS* = 0

-  VIEW_SMALLICONS* = 1

-  VIEW_LIST* = 2

-  VIEW_DETAILS* = 3

-  VIEW_SORTNAME* = 4

-  VIEW_SORTSIZE* = 5

-  VIEW_SORTDATE* = 6

-  VIEW_SORTTYPE* = 7

-  # Toolbar styles

-  TBSTYLE_ALTDRAG* = 1024

-  TBSTYLE_TOOLTIPS* = 256

-  TBSTYLE_WRAPABLE* = 512

-  TBSTYLE_BUTTON* = 0

-  TBSTYLE_CHECK* = 2

-  TBSTYLE_CHECKGROUP* = 6

-  TBSTYLE_GROUP* = 4

-  TBSTYLE_SEP* = 1

-  # Toolbar states

-  TBSTATE_CHECKED* = 1

-  TBSTATE_ENABLED* = 4

-  TBSTATE_HIDDEN* = 8

-  TBSTATE_INDETERMINATE* = 16

-  TBSTATE_PRESSED* = 2

-  TBSTATE_WRAP* = 32

-  # Tooltip styles

-  TTS_ALWAYSTIP* = 1

-  TTS_NOPREFIX* = 2

-  # TOOLINFO structure

-  TTF_IDISHWND* = 1

-  TTF_CENTERTIP* = 2

-  TTF_RTLREADING* = 4

-  TTF_SUBCLASS* = 16

-  # TTM_SETDELAYTIME message

-  TTDT_AUTOMATIC* = 0

-  TTDT_AUTOPOP* = 2

-  TTDT_INITIAL* = 3

-  TTDT_RESHOW* = 1

-  # Status window

-  SBARS_SIZEGRIP* = 256

-  #SBARS_SIZEGRIP = 256;already above

-  # DL_DRAGGING message

-  DL_MOVECURSOR* = 3

-  DL_COPYCURSOR* = 2

-  DL_STOPCURSOR* = 1

-  # Up-down control styles

-  UDS_ALIGNLEFT* = 8

-  UDS_ALIGNRIGHT* = 4

-  UDS_ARROWKEYS* = 32

-  UDS_AUTOBUDDY* = 16

-  UDS_HORZ* = 64

-  UDS_NOTHOUSANDS* = 128

-  UDS_SETBUDDYINT* = 2

-  UDS_WRAP* = 1

-  # UDM_SETRANGE message

-  UD_MAXVAL* = 32767

-  UD_MINVAL* = -32767

-  # HKM_GETHOTKEY message

-  HOTKEYF_ALT* = 4

-  HOTKEYF_CONTROL* = 2

-  HOTKEYF_EXT* = 8

-  HOTKEYF_SHIFT* = 1

-  # HKM_SETRULES message

-  HKCOMB_A* = 8

-  HKCOMB_C* = 4

-  HKCOMB_CA* = 64

-  HKCOMB_NONE* = 1

-  HKCOMB_S* = 2

-  HKCOMB_SA* = 32

-  HKCOMB_SC* = 16

-  HKCOMB_SCA* = 128

-  # Trackbar styles

-  TBS_HORZ* = 0

-  TBS_VERT* = 2

-  TBS_AUTOTICKS* = 1

-  TBS_NOTICKS* = 16

-  TBS_TOP* = 4

-  TBS_BOTTOM* = 0

-  TBS_LEFT* = 4

-  TBS_RIGHT* = 0

-  TBS_BOTH* = 8

-  TBS_ENABLESELRANGE* = 32

-  TBS_FIXEDLENGTH* = 64

-  TBS_NOTHUMB* = 128

-  TB_BOTTOM* = 7

-  TB_ENDTRACK* = 8

-  TB_LINEDOWN* = 1

-  TB_LINEUP* = 0

-  TB_PAGEDOWN* = 3

-  TB_PAGEUP* = 2

-  TB_THUMBPOSITION* = 4

-  TB_THUMBTRACK* = 5

-  TB_TOP* = 6

-  # List view styles

-  LVS_ALIGNLEFT* = 2048

-  LVS_ALIGNTOP* = 0

-  LVS_AUTOARRANGE* = 256

-  LVS_EDITLABELS* = 512

-  LVS_ICON* = 0

-  LVS_LIST* = 3

-  LVS_NOCOLUMNHEADER* = 16384

-  LVS_NOLABELWRAP* = 128

-  LVS_NOSCROLL* = 8192

-  LVS_NOSORTHEADER* = 32768

-  LVS_OWNERDRAWFIXED* = 1024

-  LVS_REPORT* = 1

-  LVS_SHAREIMAGELISTS* = 64

-  LVS_SHOWSELALWAYS* = 8

-  LVS_SINGLESEL* = 4

-  LVS_SMALLICON* = 2

-  LVS_SORTASCENDING* = 16

-  LVS_SORTDESCENDING* = 32

-  LVS_TYPESTYLEMASK* = 64512

-  LVSIL_NORMAL* = 0

-  LVSIL_SMALL* = 1

-  LVSIL_STATE* = 2

-  LVIS_CUT* = 4

-  LVIS_DROPHILITED* = 8

-  LVIS_FOCUSED* = 1

-  LVIS_SELECTED* = 2

-  LVIS_OVERLAYMASK* = 3840

-  LVIS_STATEIMAGEMASK* = 61440

-

-  LPSTR_TEXTCALLBACKW* = cast[LPWSTR](-1)

-  LPSTR_TEXTCALLBACKA* = cast[LPSTR](-1)

-when defined(winUnicode):

-  const LPSTR_TEXTCALLBACK*  = cast[LPWSTR](-1)

-else:

-  const LPSTR_TEXTCALLBACK*  = cast[LPSTR](-1)

-

-const

-  LVIF_TEXT* = 1

-  LVIF_IMAGE* = 2

-  LVIF_PARAM* = 4

-  LVIF_STATE* = 8

-  LVIF_DI_SETITEM* = 4096

-  # LVM_GETNEXTITEM structure

-  LVNI_ABOVE* = 256

-  LVNI_ALL* = 0

-  LVNI_BELOW* = 512

-  LVNI_TOLEFT* = 1024

-  LVNI_TORIGHT* = 2048

-  LVNI_CUT* = 4

-  LVNI_DROPHILITED* = 8

-  LVNI_FOCUSED* = 1

-  LVNI_SELECTED* = 2

-  # LV_FINDINFO structure

-  LVFI_PARAM* = 1

-  LVFI_PARTIAL* = 8

-  LVFI_STRING* = 2

-  LVFI_WRAP* = 32

-  LVFI_NEARESTXY* = 64

-  # LV_HITTESTINFO structure

-  LVHT_ABOVE* = 8

-  LVHT_BELOW* = 16

-  LVHT_NOWHERE* = 1

-  LVHT_ONITEMICON* = 2

-  LVHT_ONITEMLABEL* = 4

-  LVHT_ONITEMSTATEICON* = 8

-  LVHT_TOLEFT* = 64

-  LVHT_TORIGHT* = 32

-  # LV_COLUMN structure

-  LVCF_FMT* = 1

-  LVCF_SUBITEM* = 8

-  LVCF_TEXT* = 4

-  LVCF_WIDTH* = 2

-  LVCFMT_CENTER* = 2

-  LVCFMT_LEFT* = 0

-  LVCFMT_RIGHT* = 1

-  # ListView_GetItemRect

-  LVIR_BOUNDS* = 0

-  LVIR_ICON* = 1

-  LVIR_LABEL* = 2

-  LVIR_SELECTBOUNDS* = 3

-  # LVM_ARRANGE message

-  LVA_ALIGNLEFT* = 1

-  LVA_ALIGNTOP* = 2

-  LVA_DEFAULT* = 0

-  LVA_SNAPTOGRID* = 5

-  # LVM_SETCOLUMNWIDTH message

-  LVSCW_AUTOSIZE* = -1

-  LVSCW_AUTOSIZE_USEHEADER* = -2

-  # Tree View styles

-  TVS_DISABLEDRAGDROP* = 16

-  TVS_EDITLABELS* = 8

-  TVS_HASBUTTONS* = 1

-  TVS_HASLINES* = 2

-  TVS_LINESATROOT* = 4

-  TVS_SHOWSELALWAYS* = 32

-  # Tree View states

-  TVIS_BOLD* = 16

-  TVIS_CUT* = 4

-  TVIS_DROPHILITED* = 8

-  TVIS_EXPANDED* = 32

-  TVIS_EXPANDEDONCE* = 64

-  TVIS_FOCUSED* = 1

-  TVIS_OVERLAYMASK* = 3840

-  TVIS_SELECTED* = 2

-  TVIS_STATEIMAGEMASK* = 61440

-  TVIS_USERMASK* = 61440

-  # TV_ITEM structure

-  TVIF_CHILDREN* = 64

-  TVIF_HANDLE* = 16

-  TVIF_IMAGE* = 2

-  TVIF_PARAM* = 4

-  TVIF_SELECTEDIMAGE* = 32

-  TVIF_STATE* = 8

-  TVIF_TEXT* = 1

-  I_CHILDRENCALLBACK* = -1

-  I_IMAGECALLBACK* = -1

-  # TV_INSERTSTRUCT structure

-

-type

-  TREEITEM* {.final, pure.} = object

-  HTREEITEM* = ptr TREEITEM

-  PTREEITEM* = ptr TREEITEM

-{.deprecated: [TTREEITEM: TREEITEM].}

-

-const

-  TVI_ROOT* =  cast[HTREEITEM](0xFFFF0000)

-  TVI_FIRST* = cast[HTREEITEM](0xFFFF0001)

-  TVI_LAST* =  cast[HTREEITEM](0xFFFF0002)

-  TVI_SORT* =  cast[HTREEITEM](0xFFFF0003)

-

-const

-  # TV_HITTESTINFO structure

-  TVHT_ABOVE* = 256

-  TVHT_BELOW* = 512

-  TVHT_NOWHERE* = 1

-  TVHT_ONITEM* = 70

-  TVHT_ONITEMBUTTON* = 16

-  TVHT_ONITEMICON* = 2

-  TVHT_ONITEMINDENT* = 8

-  TVHT_ONITEMLABEL* = 4

-  TVHT_ONITEMRIGHT* = 32

-  TVHT_ONITEMSTATEICON* = 64

-  TVHT_TOLEFT* = 2048

-  TVHT_TORIGHT* = 1024

-  # TVM_EXPAND message

-  TVE_COLLAPSE* = 1

-  TVE_COLLAPSERESET* = 32768

-  TVE_EXPAND* = 2

-  TVE_TOGGLE* = 3

-  # TVM_GETIMAGELIST message

-  TVSIL_NORMAL* = 0

-  TVSIL_STATE* = 2

-  # TVM_GETNEXTITEM message

-  TVGN_CARET* = 9

-  TVGN_CHILD* = 4

-  TVGN_DROPHILITE* = 8

-  TVGN_FIRSTVISIBLE* = 5

-  TVGN_NEXT* = 1

-  TVGN_NEXTVISIBLE* = 6

-  TVGN_PARENT* = 3

-  TVGN_PREVIOUS* = 2

-  TVGN_PREVIOUSVISIBLE* = 7

-  TVGN_ROOT* = 0

-  # TVN_SELCHANGED message

-  TVC_BYKEYBOARD* = 2

-  TVC_BYMOUSE* = 1

-  TVC_UNKNOWN* = 0

-  # Tab control styles

-  TCS_BUTTONS* = 256

-  TCS_FIXEDWIDTH* = 1024

-  TCS_FOCUSNEVER* = 32768

-  TCS_FOCUSONBUTTONDOWN* = 4096

-  TCS_FORCEICONLEFT* = 16

-  TCS_FORCELABELLEFT* = 32

-  TCS_MULTILINE* = 512

-  TCS_OWNERDRAWFIXED* = 8192

-  TCS_RAGGEDRIGHT* = 2048

-  TCS_RIGHTJUSTIFY* = 0

-  TCS_SINGLELINE* = 0

-  TCS_TABS* = 0

-  TCS_TOOLTIPS* = 16384

-  # TC_ITEM structure

-  TCIF_TEXT* = 1

-  TCIF_IMAGE* = 2

-  TCIF_PARAM* = 8

-  TCIF_RTLREADING* = 4

-  # TC_HITTESTINFO structure

-  TCHT_NOWHERE* = 1

-  TCHT_ONITEM* = 6

-  TCHT_ONITEMICON* = 2

-  TCHT_ONITEMLABEL* = 4

-  # Animation control styles

-  ACS_AUTOPLAY* = 4

-  ACS_CENTER* = 1

-  ACS_TRANSPARENT* = 2

-  # MODEMDEVCAPS structure

-  DIALOPTION_BILLING* = 64

-  DIALOPTION_QUIET* = 128

-  DIALOPTION_DIALTONE* = 256

-  MDMVOLFLAG_LOW* = 1

-  MDMVOLFLAG_MEDIUM* = 2

-  MDMVOLFLAG_HIGH* = 4

-  MDMVOL_LOW* = 0

-  MDMVOL_MEDIUM* = 1

-  MDMVOL_HIGH* = 2

-  MDMSPKRFLAG_OFF* = 1

-  MDMSPKRFLAG_DIAL* = 2

-  MDMSPKRFLAG_ON* = 4

-  MDMSPKRFLAG_CALLSETUP* = 8

-  MDMSPKR_OFF* = 0

-  MDMSPKR_DIAL* = 1

-  MDMSPKR_ON* = 2

-  MDMSPKR_CALLSETUP* = 3

-  MDM_BLIND_DIAL* = 512

-  MDM_CCITT_OVERRIDE* = 64

-  MDM_CELLULAR* = 8

-  MDM_COMPRESSION* = 1

-  MDM_ERROR_CONTROL* = 2

-  MDM_FLOWCONTROL_HARD* = 16

-  MDM_FLOWCONTROL_SOFT* = 32

-  MDM_FORCED_EC* = 4

-  MDM_SPEED_ADJUST* = 128

-  MDM_TONE_DIAL* = 256

-  MDM_V23_OVERRIDE* = 1024

-

-  # Languages

-  #

-  #  Language IDs.

-  #

-  #  The following two combinations of primary language ID and

-  #  sublanguage ID have special semantics:

-  #

-  #    Primary Language ID   Sublanguage ID      Result

-  #    -------------------   ---------------     ------------------------

-  #    LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral

-  #    LANG_NEUTRAL          SUBLANG_DEFAULT     User default language

-  #    LANG_NEUTRAL          SUBLANG_SYS_DEFAULT System default language

-  #    LANG_INVARIANT        SUBLANG_NEUTRAL     Invariant locale

-  #

-  #

-  #  Primary language IDs.

-  #

-  LANG_NEUTRAL* = 0x00000000

-  LANG_INVARIANT* = 0x0000007F

-  LANG_AFRIKAANS* = 0x00000036

-  LANG_ALBANIAN* = 0x0000001C

-  LANG_ARABIC* = 0x00000001

-  LANG_ARMENIAN* = 0x0000002B

-  LANG_ASSAMESE* = 0x0000004D

-  LANG_AZERI* = 0x0000002C

-  LANG_BASQUE* = 0x0000002D

-  LANG_BELARUSIAN* = 0x00000023

-  LANG_BENGALI* = 0x00000045

-  LANG_BULGARIAN* = 0x00000002

-  LANG_CATALAN* = 0x00000003

-  LANG_CHINESE* = 0x00000004

-  LANG_CROATIAN* = 0x0000001A

-  LANG_CZECH* = 0x00000005

-  LANG_DANISH* = 0x00000006

-  LANG_DIVEHI* = 0x00000065

-  LANG_DUTCH* = 0x00000013

-  LANG_ENGLISH* = 0x00000009

-  LANG_ESTONIAN* = 0x00000025

-  LANG_FAEROESE* = 0x00000038

-  LANG_FARSI* = 0x00000029

-  LANG_FINNISH* = 0x0000000B

-  LANG_FRENCH* = 0x0000000C

-  LANG_GALICIAN* = 0x00000056

-  LANG_GEORGIAN* = 0x00000037

-  LANG_GERMAN* = 0x00000007

-  LANG_GREEK* = 0x00000008

-  LANG_GUJARATI* = 0x00000047

-  LANG_HEBREW* = 0x0000000D

-  LANG_HINDI* = 0x00000039

-  LANG_HUNGARIAN* = 0x0000000E

-  LANG_ICELANDIC* = 0x0000000F

-  LANG_INDONESIAN* = 0x00000021

-  LANG_ITALIAN* = 0x00000010

-  LANG_JAPANESE* = 0x00000011

-  LANG_KANNADA* = 0x0000004B

-  LANG_KASHMIRI* = 0x00000060

-  LANG_KAZAK* = 0x0000003F

-  LANG_KONKANI* = 0x00000057

-  LANG_KOREAN* = 0x00000012

-  LANG_KYRGYZ* = 0x00000040

-  LANG_LATVIAN* = 0x00000026

-  LANG_LITHUANIAN* = 0x00000027

-  LANG_MACEDONIAN* = 0x0000002F # the Former Yugoslav Republic of Macedonia

-  LANG_MALAY* = 0x0000003E

-  LANG_MALAYALAM* = 0x0000004C

-  LANG_MANIPURI* = 0x00000058

-  LANG_MARATHI* = 0x0000004E

-  LANG_MONGOLIAN* = 0x00000050

-  LANG_NEPALI* = 0x00000061

-  LANG_NORWEGIAN* = 0x00000014

-  LANG_ORIYA* = 0x00000048

-  LANG_POLISH* = 0x00000015

-  LANG_PORTUGUESE* = 0x00000016

-  LANG_PUNJABI* = 0x00000046

-  LANG_ROMANIAN* = 0x00000018

-  LANG_RUSSIAN* = 0x00000019

-  LANG_SANSKRIT* = 0x0000004F

-  LANG_SERBIAN* = 0x0000001A

-  LANG_SINDHI* = 0x00000059

-  LANG_SLOVAK* = 0x0000001B

-  LANG_SLOVENIAN* = 0x00000024

-  LANG_SPANISH* = 0x0000000A

-  LANG_SWAHILI* = 0x00000041

-  LANG_SWEDISH* = 0x0000001D

-  LANG_SYRIAC* = 0x0000005A

-  LANG_TAMIL* = 0x00000049

-  LANG_TATAR* = 0x00000044

-  LANG_TELUGU* = 0x0000004A

-  LANG_THAI* = 0x0000001E

-  LANG_TURKISH* = 0x0000001F

-  LANG_UKRAINIAN* = 0x00000022

-  LANG_URDU* = 0x00000020

-  LANG_UZBEK* = 0x00000043

-  LANG_VIETNAMESE* = 0x0000002A

-  #

-  #  Sublanguage IDs.

-  #

-  #  The name immediately following SUBLANG_ dictates which primary

-  #  language ID that sublanguage ID can be combined with to form a

-  #  valid language ID.

-  #

-  SUBLANG_NEUTRAL* = 0x00000000 # language neutral

-  SUBLANG_DEFAULT* = 0x00000001 # user default

-  SUBLANG_SYS_DEFAULT* = 0x00000002 # system default

-  SUBLANG_ARABIC_SAUDI_ARABIA* = 0x00000001 # Arabic (Saudi Arabia)

-  SUBLANG_ARABIC_IRAQ* = 0x00000002 # Arabic (Iraq)

-  SUBLANG_ARABIC_EGYPT* = 0x00000003 # Arabic (Egypt)

-  SUBLANG_ARABIC_LIBYA* = 0x00000004 # Arabic (Libya)

-  SUBLANG_ARABIC_ALGERIA* = 0x00000005 # Arabic (Algeria)

-  SUBLANG_ARABIC_MOROCCO* = 0x00000006 # Arabic (Morocco)

-  SUBLANG_ARABIC_TUNISIA* = 0x00000007 # Arabic (Tunisia)

-  SUBLANG_ARABIC_OMAN* = 0x00000008 # Arabic (Oman)

-  SUBLANG_ARABIC_YEMEN* = 0x00000009 # Arabic (Yemen)

-  SUBLANG_ARABIC_SYRIA* = 0x0000000A # Arabic (Syria)

-  SUBLANG_ARABIC_JORDAN* = 0x0000000B # Arabic (Jordan)

-  SUBLANG_ARABIC_LEBANON* = 0x0000000C # Arabic (Lebanon)

-  SUBLANG_ARABIC_KUWAIT* = 0x0000000D # Arabic (Kuwait)

-  SUBLANG_ARABIC_UAE* = 0x0000000E # Arabic (U.A.E)

-  SUBLANG_ARABIC_BAHRAIN* = 0x0000000F # Arabic (Bahrain)

-  SUBLANG_ARABIC_QATAR* = 0x00000010 # Arabic (Qatar)

-  SUBLANG_AZERI_LATIN* = 0x00000001 # Azeri (Latin)

-  SUBLANG_AZERI_CYRILLIC* = 0x00000002 # Azeri (Cyrillic)

-  SUBLANG_CHINESE_TRADITIONAL* = 0x00000001 # Chinese (Taiwan)

-  SUBLANG_CHINESE_SIMPLIFIED* = 0x00000002 # Chinese (PR China)

-  SUBLANG_CHINESE_HONGKONG* = 0x00000003 # Chinese (Hong Kong S.A.R., P.R.C.)

-  SUBLANG_CHINESE_SINGAPORE* = 0x00000004 # Chinese (Singapore)

-  SUBLANG_CHINESE_MACAU* = 0x00000005 # Chinese (Macau S.A.R.)

-  SUBLANG_DUTCH* = 0x00000001 # Dutch

-  SUBLANG_DUTCH_BELGIAN* = 0x00000002 # Dutch (Belgian)

-  SUBLANG_ENGLISH_US* = 0x00000001 # English (USA)

-  SUBLANG_ENGLISH_UK* = 0x00000002 # English (UK)

-  SUBLANG_ENGLISH_AUS* = 0x00000003 # English (Australian)

-  SUBLANG_ENGLISH_CAN* = 0x00000004 # English (Canadian)

-  SUBLANG_ENGLISH_NZ* = 0x00000005 # English (New Zealand)

-  SUBLANG_ENGLISH_EIRE* = 0x00000006 # English (Irish)

-  SUBLANG_ENGLISH_SOUTH_AFRICA* = 0x00000007 # English (South Africa)

-  SUBLANG_ENGLISH_JAMAICA* = 0x00000008 # English (Jamaica)

-  SUBLANG_ENGLISH_CARIBBEAN* = 0x00000009 # English (Caribbean)

-  SUBLANG_ENGLISH_BELIZE* = 0x0000000A # English (Belize)

-  SUBLANG_ENGLISH_TRINIDAD* = 0x0000000B # English (Trinidad)

-  SUBLANG_ENGLISH_ZIMBABWE* = 0x0000000C # English (Zimbabwe)

-  SUBLANG_ENGLISH_PHILIPPINES* = 0x0000000D # English (Philippines)

-  SUBLANG_FRENCH* = 0x00000001 # French

-  SUBLANG_FRENCH_BELGIAN* = 0x00000002 # French (Belgian)

-  SUBLANG_FRENCH_CANADIAN* = 0x00000003 # French (Canadian)

-  SUBLANG_FRENCH_SWISS* = 0x00000004 # French (Swiss)

-  SUBLANG_FRENCH_LUXEMBOURG* = 0x00000005 # French (Luxembourg)

-  SUBLANG_FRENCH_MONACO* = 0x00000006 # French (Monaco)

-  SUBLANG_GERMAN* = 0x00000001 # German

-  SUBLANG_GERMAN_SWISS* = 0x00000002 # German (Swiss)

-  SUBLANG_GERMAN_AUSTRIAN* = 0x00000003 # German (Austrian)

-  SUBLANG_GERMAN_LUXEMBOURG* = 0x00000004 # German (Luxembourg)

-  SUBLANG_GERMAN_LIECHTENSTEIN* = 0x00000005 # German (Liechtenstein)

-  SUBLANG_ITALIAN* = 0x00000001 # Italian

-  SUBLANG_ITALIAN_SWISS* = 0x00000002 # Italian (Swiss)

-  SUBLANG_KASHMIRI_SASIA* = 0x00000002 # Kashmiri (South Asia)

-  SUBLANG_KASHMIRI_INDIA* = 0x00000002 # For app compatibility only

-  SUBLANG_KOREAN* = 0x00000001 # Korean (Extended Wansung)

-  SUBLANG_LITHUANIAN* = 0x00000001 # Lithuanian

-  SUBLANG_MALAY_MALAYSIA* = 0x00000001 # Malay (Malaysia)

-  SUBLANG_MALAY_BRUNEI_DARUSSALAM* = 0x00000002 # Malay (Brunei Darussalam)

-  SUBLANG_NEPALI_INDIA* = 0x00000002 # Nepali (India)

-  SUBLANG_NORWEGIAN_BOKMAL* = 0x00000001 # Norwegian (Bokmal)

-  SUBLANG_NORWEGIAN_NYNORSK* = 0x00000002 # Norwegian (Nynorsk)

-  SUBLANG_PORTUGUESE* = 0x00000002 # Portuguese

-  SUBLANG_PORTUGUESE_BRAZILIAN* = 0x00000001 # Portuguese (Brazilian)

-  SUBLANG_SERBIAN_LATIN* = 0x00000002 # Serbian (Latin)

-  SUBLANG_SERBIAN_CYRILLIC* = 0x00000003 # Serbian (Cyrillic)

-  SUBLANG_SPANISH* = 0x00000001 # Spanish (Castilian)

-  SUBLANG_SPANISH_MEXICAN* = 0x00000002 # Spanish (Mexican)

-  SUBLANG_SPANISH_MODERN* = 0x00000003 # Spanish (Spain)

-  SUBLANG_SPANISH_GUATEMALA* = 0x00000004 # Spanish (Guatemala)

-  SUBLANG_SPANISH_COSTA_RICA* = 0x00000005 # Spanish (Costa Rica)

-  SUBLANG_SPANISH_PANAMA* = 0x00000006 # Spanish (Panama)

-  SUBLANG_SPANISH_DOMINICAN_REPUBLIC* = 0x00000007 # Spanish (Dominican Republic)

-  SUBLANG_SPANISH_VENEZUELA* = 0x00000008 # Spanish (Venezuela)

-  SUBLANG_SPANISH_COLOMBIA* = 0x00000009 # Spanish (Colombia)

-  SUBLANG_SPANISH_PERU* = 0x0000000A # Spanish (Peru)

-  SUBLANG_SPANISH_ARGENTINA* = 0x0000000B # Spanish (Argentina)

-  SUBLANG_SPANISH_ECUADOR* = 0x0000000C # Spanish (Ecuador)

-  SUBLANG_SPANISH_CHILE* = 0x0000000D # Spanish (Chile)

-  SUBLANG_SPANISH_URUGUAY* = 0x0000000E # Spanish (Uruguay)

-  SUBLANG_SPANISH_PARAGUAY* = 0x0000000F # Spanish (Paraguay)

-  SUBLANG_SPANISH_BOLIVIA* = 0x00000010 # Spanish (Bolivia)

-  SUBLANG_SPANISH_EL_SALVADOR* = 0x00000011 # Spanish (El Salvador)

-  SUBLANG_SPANISH_HONDURAS* = 0x00000012 # Spanish (Honduras)

-  SUBLANG_SPANISH_NICARAGUA* = 0x00000013 # Spanish (Nicaragua)

-  SUBLANG_SPANISH_PUERTO_RICO* = 0x00000014 # Spanish (Puerto Rico)

-  SUBLANG_SWEDISH* = 0x00000001 # Swedish

-  SUBLANG_SWEDISH_FINLAND* = 0x00000002 # Swedish (Finland)

-  SUBLANG_URDU_PAKISTAN* = 0x00000001 # Urdu (Pakistan)

-  SUBLANG_URDU_INDIA* = 0x00000002 # Urdu (India)

-  SUBLANG_UZBEK_LATIN* = 0x00000001 # Uzbek (Latin)

-  SUBLANG_UZBEK_CYRILLIC* = 0x00000002 # Uzbek (Cyrillic)

-                                       #

-                                       #  Sorting IDs.

-                                       #

-  SORT_DEFAULT* = 0x00000000  # sorting default

-  SORT_JAPANESE_XJIS* = 0x00000000 # Japanese XJIS order

-  SORT_JAPANESE_UNICODE* = 0x00000001 # Japanese Unicode order

-  SORT_CHINESE_BIG5* = 0x00000000 # Chinese BIG5 order

-  SORT_CHINESE_PRCP* = 0x00000000 # PRC Chinese Phonetic order

-  SORT_CHINESE_UNICODE* = 0x00000001 # Chinese Unicode order

-  SORT_CHINESE_PRC* = 0x00000002 # PRC Chinese Stroke Count order

-  SORT_CHINESE_BOPOMOFO* = 0x00000003 # Traditional Chinese Bopomofo order

-  SORT_KOREAN_KSC* = 0x00000000 # Korean KSC order

-  SORT_KOREAN_UNICODE* = 0x00000001 # Korean Unicode order

-  SORT_GERMAN_PHONE_BOOK* = 0x00000001 # German Phone Book order

-  SORT_HUNGARIAN_DEFAULT* = 0x00000000 # Hungarian Default order

-  SORT_HUNGARIAN_TECHNICAL* = 0x00000001 # Hungarian Technical order

-  SORT_GEORGIAN_TRADITIONAL* = 0x00000000 # Georgian Traditional order

-  SORT_GEORGIAN_MODERN* = 0x00000001 # Georgian Modern order

-                                     # SYSTEM_INFO structure

-  PROCESSOR_INTEL_386* = 386

-  PROCESSOR_INTEL_486* = 486

-  PROCESSOR_INTEL_PENTIUM* = 586

-  PROCESSOR_MIPS_R4000* = 4000

-  PROCESSOR_ALPHA_21064* = 21064

-  # FSCTL_SET_COMPRESSION

-  COMPRESSION_FORMAT_NONE* = 0

-  COMPRESSION_FORMAT_DEFAULT* = 1

-  COMPRESSION_FORMAT_LZNT1* = 2

-  # TAPE_GET_DRIVE_PARAMETERS structure

-  TAPE_DRIVE_COMPRESSION* = 131072

-  TAPE_DRIVE_ECC* = 65536

-  TAPE_DRIVE_ERASE_BOP_ONLY* = 64

-  TAPE_DRIVE_ERASE_LONG* = 32

-  TAPE_DRIVE_ERASE_IMMEDIATE* = 128

-  TAPE_DRIVE_ERASE_SHORT* = 16

-  TAPE_DRIVE_FIXED* = 1

-  TAPE_DRIVE_FIXED_BLOCK* = 1024

-  TAPE_DRIVE_INITIATOR* = 4

-  TAPE_DRIVE_PADDING* = 262144

-  TAPE_DRIVE_GET_ABSOLUTE_BLK* = 1048576

-  TAPE_DRIVE_GET_LOGICAL_BLK* = 2097152

-  TAPE_DRIVE_REPORT_SMKS* = 524288

-  TAPE_DRIVE_SELECT* = 2

-  TAPE_DRIVE_SET_EOT_WZ_SIZE* = 4194304

-  TAPE_DRIVE_TAPE_CAPACITY* = 256

-  TAPE_DRIVE_TAPE_REMAINING* = 512

-  TAPE_DRIVE_VARIABLE_BLOCK* = 2048

-  TAPE_DRIVE_WRITE_PROTECT* = 4096

-  TAPE_DRIVE_ABS_BLK_IMMED* = -2147475456

-  TAPE_DRIVE_ABSOLUTE_BLK* = -2147479552

-  TAPE_DRIVE_END_OF_DATA* = -2147418112

-  TAPE_DRIVE_FILEMARKS* = -2147221504

-  TAPE_DRIVE_LOAD_UNLOAD* = -2147483647

-  TAPE_DRIVE_LOAD_UNLD_IMMED* = -2147483616

-  TAPE_DRIVE_LOCK_UNLOCK* = -2147483644

-  TAPE_DRIVE_LOCK_UNLK_IMMED* = -2147483520

-  TAPE_DRIVE_LOG_BLK_IMMED* = -2147450880

-  TAPE_DRIVE_LOGICAL_BLK* = -2147467264

-  TAPE_DRIVE_RELATIVE_BLKS* = -2147352576

-  TAPE_DRIVE_REVERSE_POSITION* = -2143289344

-  TAPE_DRIVE_REWIND_IMMEDIATE* = -2147483640

-  TAPE_DRIVE_SEQUENTIAL_FMKS* = -2146959360

-  TAPE_DRIVE_SEQUENTIAL_SMKS* = -2145386496

-  TAPE_DRIVE_SET_BLOCK_SIZE* = -2147483632

-  TAPE_DRIVE_SET_COMPRESSION* = -2147483136

-  TAPE_DRIVE_SET_ECC* = -2147483392

-  TAPE_DRIVE_SET_PADDING* = -2147482624

-  TAPE_DRIVE_SET_REPORT_SMKS* = -2147481600

-  TAPE_DRIVE_SETMARKS* = -2146435072

-  TAPE_DRIVE_SPACE_IMMEDIATE* = -2139095040

-  TAPE_DRIVE_TENSION* = -2147483646

-  TAPE_DRIVE_TENSION_IMMED* = -2147483584

-  TAPE_DRIVE_WRITE_FILEMARKS* = -2113929216

-  TAPE_DRIVE_WRITE_LONG_FMKS* = -2013265920

-  TAPE_DRIVE_WRITE_MARK_IMMED* = -1879048192

-  TAPE_DRIVE_WRITE_SETMARKS* = -2130706432

-  TAPE_DRIVE_WRITE_SHORT_FMKS* = -2080374784

-  # Standard rights

-  STANDARD_RIGHTS_REQUIRED* = 0x000F0000

-  STANDARD_RIGHTS_WRITE* = 0x00020000

-  STANDARD_RIGHTS_READ* = 0x00020000

-  STANDARD_RIGHTS_EXECUTE* = 0x00020000

-  STANDARD_RIGHTS_ALL* = 0x001F0000

-  SPECIFIC_RIGHTS_ALL* = 0x0000FFFF

-

-  FILE_GENERIC_READ* = STANDARD_RIGHTS_READ or

-      FILE_READ_DATA or

-      FILE_READ_ATTRIBUTES or

-      FILE_READ_EA or

-      SYNCHRONIZE

-  FILE_GENERIC_WRITE* = STANDARD_RIGHTS_WRITE or

-      FILE_WRITE_DATA or

-      FILE_WRITE_ATTRIBUTES or

-      FILE_WRITE_EA or

-      FILE_APPEND_DATA or

-      SYNCHRONIZE

-  FILE_GENERIC_EXECUTE* = STANDARD_RIGHTS_EXECUTE or

-      FILE_READ_ATTRIBUTES or

-      FILE_EXECUTE or

-      SYNCHRONIZE

-  FILE_ALL_ACCESS* = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or 0x1FF

-

-  # ACCESS_MASK

-  MAXIMUM_ALLOWED* = 0x02000000

-  GENERIC_ALL* = 0x10000000

-  # SID

-  SECURITY_NULL_RID* = 0

-  SECURITY_WORLD_RID* = 0

-  SECURITY_LOCAL_RID* = 0

-  SECURITY_CREATOR_OWNER_RID* = 0

-  SECURITY_CREATOR_GROUP_RID* = 0x00000001

-  SECURITY_DIALUP_RID* = 0x00000001

-  SECURITY_NETWORK_RID* = 0x00000002

-  SECURITY_BATCH_RID* = 0x00000003

-  SECURITY_INTERACTIVE_RID* = 0x00000004

-  SECURITY_LOGON_IDS_RID* = 0x00000005

-  SECURITY_LOGON_IDS_RID_COUNT* = 0x00000003

-  SECURITY_SERVICE_RID* = 0x00000006

-  SECURITY_LOCAL_SYSTEM_RID* = 0x00000012

-  SECURITY_BUILTIN_DOMAIN_RID* = 0x00000020

-  DOMAIN_USER_RID_ADMIN* = 0x000001F4

-  DOMAIN_USER_RID_GUEST* = 0x000001F5

-  DOMAIN_GROUP_RID_ADMINS* = 0x00000200

-  DOMAIN_GROUP_RID_USERS* = 0x00000201

-  DOMAIN_ALIAS_RID_ADMINS* = 0x00000220

-  DOMAIN_ALIAS_RID_USERS* = 0x00000221

-  DOMAIN_ALIAS_RID_GUESTS* = 0x00000222

-  DOMAIN_ALIAS_RID_POWER_USERS* = 0x00000223

-  DOMAIN_ALIAS_RID_ACCOUNT_OPS* = 0x00000224

-  DOMAIN_ALIAS_RID_SYSTEM_OPS* = 0x00000225

-  DOMAIN_ALIAS_RID_PRINT_OPS* = 0x00000226

-  DOMAIN_ALIAS_RID_BACKUP_OPS* = 0x00000227

-  DOMAIN_ALIAS_RID_REPLICATOR* = 0x00000228

-  # TOKEN_GROUPS structure

-  SE_GROUP_MANDATORY* = 0x00000001

-  SE_GROUP_ENABLED_BY_DEFAULT* = 0x00000002

-  SE_GROUP_ENABLED* = 0x00000004

-  SE_GROUP_OWNER* = 0x00000008

-  SE_GROUP_LOGON_ID* = 0xC0000000

-  # ACL Defines

-  ACL_REVISION* = 2

-  # ACE_HEADER structure

-  ACCESS_ALLOWED_ACE_TYPE* = 0x00000000

-  ACCESS_DENIED_ACE_TYPE* = 0x00000001

-  SYSTEM_AUDIT_ACE_TYPE* = 0x00000002

-  SYSTEM_ALARM_ACE_TYPE* = 0x00000003

-  # ACE flags in the ACE_HEADER structure

-  OBJECT_INHERIT_ACE* = 0x00000001

-  CONTAINER_INHERIT_ACE* = 0x00000002

-  NO_PROPAGATE_INHERIT_ACE* = 0x00000004

-  INHERIT_ONLY_ACE* = 0x00000008

-  SUCCESSFUL_ACCESS_ACE_FLAG* = 0x00000040

-  FAILED_ACCESS_ACE_FLAG* = 0x00000080

-  # SECURITY_DESCRIPTOR_CONTROL

-  #SECURITY_DESCRIPTOR_REVISION = 1;already defined above

-  SECURITY_DESCRIPTOR_MIN_LENGTH* = 20

-  SE_OWNER_DEFAULTED* = 1

-  SE_GROUP_DEFAULTED* = 2

-  SE_DACL_PRESENT* = 4

-  SE_DACL_DEFAULTED* = 8

-  SE_SACL_PRESENT* = 16

-  SE_SACL_DEFAULTED* = 32

-  SE_SELF_RELATIVE* = 32768

-  # PRIVILEGE_SET

-  SE_PRIVILEGE_ENABLED_BY_DEFAULT* = 0x00000001

-  SE_PRIVILEGE_ENABLED* = 0x00000002

-  SE_PRIVILEGE_USED_FOR_ACCESS* = 0x80000000

-  PRIVILEGE_SET_ALL_NECESSARY* = 0x00000001

-  # OPENFILENAME structure

-  OFN_ALLOWMULTISELECT* = 0x00000200

-  OFN_CREATEPROMPT* = 0x00002000

-  OFN_ENABLEHOOK* = 0x00000020

-  OFN_ENABLETEMPLATE* = 0x00000040

-  OFN_ENABLETEMPLATEHANDLE* = 0x00000080

-  OFN_EXPLORER* = 0x00080000

-  OFN_EXTENSIONDIFFERENT* = 0x00000400

-  OFN_FILEMUSTEXIST* = 0x00001000

-  OFN_HIDEREADONLY* = 0x00000004

-  OFN_LONGNAMES* = 0x00200000

-  OFN_NOCHANGEDIR* = 0x00000008

-  OFN_NODEREFERENCELINKS* = 0x00100000

-  OFN_NOLONGNAMES* = 0x00040000

-  OFN_NONETWORKBUTTON* = 0x00020000

-  OFN_NOREADONLYRETURN* = 0x00008000

-  OFN_NOTESTFILECREATE* = 0x00010000

-  OFN_NOVALIDATE* = 0x00000100

-  OFN_OVERWRITEPROMPT* = 0x00000002

-  OFN_PATHMUSTEXIST* = 0x00000800

-  OFN_READONLY* = 0x00000001

-  OFN_SHAREAWARE* = 0x00004000

-  OFN_SHOWHELP* = 0x00000010

-  # SHAREVISTRING message

-  OFN_SHAREFALLTHROUGH* = 0x00000002

-  OFN_SHARENOWARN* = 0x00000001

-  OFN_SHAREWARN* = 0

-  # Open/Save notifications

-  CDN_INITDONE* = 0xFFFFFDA7

-  CDN_SELCHANGE* = 0xFFFFFDA6

-  CDN_FOLDERCHANGE* = 0xFFFFFDA5

-  CDN_SHAREVIOLATION* = 0xFFFFFDA4

-  CDN_HELP* = 0xFFFFFDA3

-  CDN_FILEOK* = 0xFFFFFDA2

-  CDN_TYPECHANGE* = 0xFFFFFDA1

-  # Open/Save messages

-  CDM_GETFILEPATH* = 0x00000465

-  CDM_GETFOLDERIDLIST* = 0x00000467

-  CDM_GETFOLDERPATH* = 0x00000466

-  CDM_GETSPEC* = 0x00000464

-  CDM_HIDECONTROL* = 0x00000469

-  CDM_SETCONTROLTEXT* = 0x00000468

-  CDM_SETDEFEXT* = 0x0000046A

-  # CHOOSECOLOR structure

-  CC_ENABLEHOOK* = 0x00000010

-  CC_ENABLETEMPLATE* = 0x00000020

-  CC_ENABLETEMPLATEHANDLE* = 0x00000040

-  CC_FULLOPEN* = 0x00000002

-  CC_PREVENTFULLOPEN* = 0x00000004

-  CC_RGBINIT* = 0x00000001

-  CC_SHOWHELP* = 0x00000008

-  CC_SOLIDCOLOR* = 0x00000080

-  # FINDREPLACE structure

-  FR_DIALOGTERM* = 0x00000040

-  FR_DOWN* = 0x00000001

-  FR_ENABLEHOOK* = 0x00000100

-  FR_ENABLETEMPLATE* = 0x00000200

-  FR_ENABLETEMPLATEHANDLE* = 0x00002000

-  FR_FINDNEXT* = 0x00000008

-  FR_HIDEUPDOWN* = 0x00004000

-  FR_HIDEMATCHCASE* = 0x00008000

-  FR_HIDEWHOLEWORD* = 0x00010000

-  FR_MATCHCASE* = 0x00000004

-  FR_NOMATCHCASE* = 0x00000800

-  FR_NOUPDOWN* = 0x00000400

-  FR_NOWHOLEWORD* = 0x00001000

-  FR_REPLACE* = 0x00000010

-  FR_REPLACEALL* = 0x00000020

-  FR_SHOWHELP* = 0x00000080

-  FR_WHOLEWORD* = 0x00000002

-  # CHOOSEFONT structure

-  CF_APPLY* = 0x00000200

-  CF_ANSIONLY* = 0x00000400

-  CF_BOTH* = 0x00000003

-  CF_TTONLY* = 0x00040000

-  CF_EFFECTS* = 0x00000100

-  CF_ENABLEHOOK* = 0x00000008

-  CF_ENABLETEMPLATE* = 0x00000010

-  CF_ENABLETEMPLATEHANDLE* = 0x00000020

-  CF_FIXEDPITCHONLY* = 0x00004000

-  CF_FORCEFONTEXIST* = 0x00010000

-  CF_INITTOLOGFONTSTRUCT* = 0x00000040

-  CF_LIMITSIZE* = 0x00002000

-  CF_NOOEMFONTS* = 0x00000800

-  CF_NOFACESEL* = 0x00080000

-  CF_NOSCRIPTSEL* = 0x00800000

-  CF_NOSTYLESEL* = 0x00100000

-  CF_NOSIZESEL* = 0x00200000

-  CF_NOSIMULATIONS* = 0x00001000

-  CF_NOVECTORFONTS* = 0x00000800

-  CF_NOVERTFONTS* = 0x01000000

-  CF_PRINTERFONTS* = 0x00000002

-  CF_SCALABLEONLY* = 0x00020000

-  CF_SCREENFONTS* = 0x00000001

-  CF_SCRIPTSONLY* = 0x00000400

-  CF_SELECTSCRIPT* = 0x00400000

-  CF_SHOWHELP* = 0x00000004

-  CF_USESTYLE* = 0x00000080

-  CF_WYSIWYG* = 0x00008000

-  BOLD_FONTTYPE* = 0x00000100

-  ITALIC_FONTTYPE* = 0x00000200

-  PRINTER_FONTTYPE* = 0x00004000

-  REGULAR_FONTTYPE* = 0x00000400

-  SCREEN_FONTTYPE* = 0x00002000

-  SIMULATED_FONTTYPE* = 0x00008000

-  # Common dialog messages

-  COLOROKSTRINGW* = "commdlg_ColorOK"

-  FILEOKSTRINGW* = "commdlg_FileNameOK"

-  FINDMSGSTRINGW* = "commdlg_FindReplace"

-  HELPMSGSTRINGW* = "commdlg_help"

-  LBSELCHSTRINGW* = "commdlg_LBSelChangedNotify"

-  SETRGBSTRINGW* = "commdlg_SetRGBColor"

-  SHAREVISTRINGW* = "commdlg_ShareViolation"

-  COLOROKSTRINGA* = "commdlg_ColorOK"

-  FILEOKSTRINGA* = "commdlg_FileNameOK"

-  FINDMSGSTRINGA* = "commdlg_FindReplace"

-  HELPMSGSTRINGA* = "commdlg_help"

-  LBSELCHSTRINGA* = "commdlg_LBSelChangedNotify"

-  SETRGBSTRINGA* = "commdlg_SetRGBColor"

-  SHAREVISTRINGA* = "commdlg_ShareViolation"

-

-when defined(winUnicode):

-  const

-    COLOROKSTRING* = COLOROKSTRINGW

-    FILEOKSTRING* = FILEOKSTRINGW

-    FINDMSGSTRING* = FINDMSGSTRINGW

-    HELPMSGSTRING* = HELPMSGSTRINGW

-    LBSELCHSTRING* = LBSELCHSTRINGW

-    SETRGBSTRING* = SETRGBSTRINGW

-    SHAREVISTRING* = SHAREVISTRINGW

-else:

-  const

-    COLOROKSTRING* = COLOROKSTRINGA

-    FILEOKSTRING* = FILEOKSTRINGA

-    FINDMSGSTRING* = FINDMSGSTRINGA

-    HELPMSGSTRING* = HELPMSGSTRINGA

-    LBSELCHSTRING* = LBSELCHSTRINGA

-    SETRGBSTRING* = SETRGBSTRINGA

-    SHAREVISTRING* = SHAREVISTRINGA

-

-const

-  # LBSELCHSTRING message

-  CD_LBSELCHANGE* = 0

-  CD_LBSELADD* = 2

-  CD_LBSELSUB* = 1

-  CD_LBSELNOITEMS* = -1

-  # DEVNAMES structure

-  DN_DEFAULTPRN* = 1

-  # PRINTDLG structure

-  PD_ALLPAGES* = 0

-  PD_COLLATE* = 16

-  PD_DISABLEPRINTTOFILE* = 524288

-  PD_ENABLEPRINTHOOK* = 4096

-  PD_ENABLEPRINTTEMPLATE* = 16384

-  PD_ENABLEPRINTTEMPLATEHANDLE* = 65536

-  PD_ENABLESETUPHOOK* = 8192

-  PD_ENABLESETUPTEMPLATE* = 32768

-  PD_ENABLESETUPTEMPLATEHANDLE* = 131072

-  PD_HIDEPRINTTOFILE* = 1048576

-  PD_NOPAGENUMS* = 8

-  PD_NOSELECTION* = 4

-  PD_NOWARNING* = 128

-  PD_PAGENUMS* = 2

-  PD_PRINTSETUP* = 64

-  PD_PRINTTOFILE* = 32

-  PD_RETURNDC* = 256

-  PD_RETURNDEFAULT* = 1024

-  PD_RETURNIC* = 512

-  PD_SELECTION* = 1

-  PD_SHOWHELP* = 2048

-  PD_USEDEVMODECOPIES* = 262144

-  PD_USEDEVMODECOPIESANDCOLLATE* = 262144

-  # PAGESETUPDLG structure

-  PSD_DEFAULTMINMARGINS* = 0

-  PSD_DISABLEMARGINS* = 16

-  PSD_DISABLEORIENTATION* = 256

-  PSD_DISABLEPAGEPAINTING* = 524288

-  PSD_DISABLEPAPER* = 512

-  PSD_DISABLEPRINTER* = 32

-  PSD_ENABLEPAGEPAINTHOOK* = 262144

-  PSD_ENABLEPAGESETUPHOOK* = 8192

-  PSD_ENABLEPAGESETUPTEMPLATE* = 32768

-  PSD_ENABLEPAGESETUPTEMPLATEHANDLE* = 131072

-  PSD_INHUNDREDTHSOFMILLIMETERS* = 8

-  PSD_INTHOUSANDTHSOFINCHES* = 4

-  PSD_INWININIINTLMEASURE* = 0

-  PSD_MARGINS* = 2

-  PSD_MINMARGINS* = 1

-  PSD_NOWARNING* = 128

-  PSD_RETURNDEFAULT* = 1024

-  PSD_SHOWHELP* = 2048

-  # WM_SHOWWINDOW message

-  SW_OTHERUNZOOM* = 4

-  SW_OTHERZOOM* = 2

-  SW_PARENTCLOSING* = 1

-  SW_PARENTOPENING* = 3

-  # Virtual Key codes

-  VK_LBUTTON* = 1

-  VK_RBUTTON* = 2

-  VK_CANCEL* = 3

-  VK_MBUTTON* = 4

-  VK_BACK* = 8

-  VK_TAB* = 9

-  VK_CLEAR* = 12

-  VK_RETURN* = 13

-  VK_SHIFT* = 16

-  VK_CONTROL* = 17

-  VK_MENU* = 18

-  VK_PAUSE* = 19

-  VK_CAPITAL* = 20

-  VK_ESCAPE* = 27

-  VK_SPACE* = 32

-  VK_PRIOR* = 33

-  VK_NEXT* = 34

-  VK_END* = 35

-  VK_HOME* = 36

-  VK_LEFT* = 37

-  VK_UP* = 38

-  VK_RIGHT* = 39

-  VK_DOWN* = 40

-  VK_SELECT* = 41

-  VK_PRINT* = 42

-  VK_EXECUTE* = 43

-  VK_SNAPSHOT* = 44

-  VK_INSERT* = 45

-  VK_DELETE* = 46

-  VK_HELP* = 47

-  VK_0* = 48

-  VK_1* = 49

-  VK_2* = 50

-  VK_3* = 51

-  VK_4* = 52

-  VK_5* = 53

-  VK_6* = 54

-  VK_7* = 55

-  VK_8* = 56

-  VK_9* = 57

-  VK_A* = 65

-  VK_B* = 66

-  VK_C* = 67

-  VK_D* = 68

-  VK_E* = 69

-  VK_F* = 70

-  VK_G* = 71

-  VK_H* = 72

-  VK_I* = 73

-  VK_J* = 74

-  VK_K* = 75

-  VK_L* = 76

-  VK_M* = 77

-  VK_N* = 78

-  VK_O* = 79

-  VK_P* = 80

-  VK_Q* = 81

-  VK_R* = 82

-  VK_S* = 83

-  VK_T* = 84

-  VK_U* = 85

-  VK_V* = 86

-  VK_W* = 87

-  VK_X* = 88

-  VK_Y* = 89

-  VK_Z* = 90

-  VK_LWIN* = 91

-  VK_RWIN* = 92

-  VK_APPS* = 93

-  VK_NUMPAD0* = 96

-  VK_NUMPAD1* = 97

-  VK_NUMPAD2* = 98

-  VK_NUMPAD3* = 99

-  VK_NUMPAD4* = 100

-  VK_NUMPAD5* = 101

-  VK_NUMPAD6* = 102

-  VK_NUMPAD7* = 103

-  VK_NUMPAD8* = 104

-  VK_NUMPAD9* = 105

-  VK_MULTIPLY* = 106

-  VK_ADD* = 107

-  VK_SEPARATOR* = 108

-  VK_SUBTRACT* = 109

-  VK_DECIMAL* = 110

-  VK_DIVIDE* = 111

-  VK_F1* = 112

-  VK_F2* = 113

-  VK_F3* = 114

-  VK_F4* = 115

-  VK_F5* = 116

-  VK_F6* = 117

-  VK_F7* = 118

-  VK_F8* = 119

-  VK_F9* = 120

-  VK_F10* = 121

-  VK_F11* = 122

-  VK_F12* = 123

-  VK_F13* = 124

-  VK_F14* = 125

-  VK_F15* = 126

-  VK_F16* = 127

-  VK_F17* = 128

-  VK_F18* = 129

-  VK_F19* = 130

-  VK_F20* = 131

-  VK_F21* = 132

-  VK_F22* = 133

-  VK_F23* = 134

-  VK_F24* = 135

-  # GetAsyncKeyState

-  VK_NUMLOCK* = 144

-  VK_SCROLL* = 145

-  VK_LSHIFT* = 160

-  VK_LCONTROL* = 162

-  VK_LMENU* = 164

-  VK_RSHIFT* = 161

-  VK_RCONTROL* = 163

-  VK_RMENU* = 165

-  # ImmGetVirtualKey

-  VK_PROCESSKEY* = 229

-  # Keystroke Message Flags

-  KF_ALTDOWN* = 8192

-  KF_DLGMODE* = 2048

-  KF_EXTENDED* = 256

-  KF_MENUMODE* = 4096

-  KF_REPEAT* = 16384

-  KF_UP* = 32768

-  # GetKeyboardLayoutName

-  KL_NAMELENGTH* = 9

-  # WM_ACTIVATE message

-  WA_ACTIVE* = 1

-  WA_CLICKACTIVE* = 2

-  WA_INACTIVE* = 0

-  # WM_ACTIVATE message

-  PWR_CRITICALRESUME* = 3

-  PWR_SUSPENDREQUEST* = 1

-  PWR_SUSPENDRESUME* = 2

-  PWR_FAIL* = -1

-  PWR_OK* = 1

-  # WM_NOTIFYFORMAT message

-  NF_QUERY* = 3

-  NF_REQUERY* = 4

-  NFR_ANSI* = 1

-  NFR_UNICODE* = 2

-  # WM_SIZING message

-  WMSZ_BOTTOM* = 6

-  WMSZ_BOTTOMLEFT* = 7

-  WMSZ_BOTTOMRIGHT* = 8

-  WMSZ_LEFT* = 1

-  WMSZ_RIGHT* = 2

-  WMSZ_TOP* = 3

-  WMSZ_TOPLEFT* = 4

-  WMSZ_TOPRIGHT* = 5

-  # WM_MOUSEACTIVATE message

-  MA_ACTIVATE* = 1

-  MA_ACTIVATEANDEAT* = 2

-  MA_NOACTIVATE* = 3

-  MA_NOACTIVATEANDEAT* = 4

-  # WM_SIZE message

-  SIZE_MAXHIDE* = 4

-  SIZE_MAXIMIZED* = 2

-  SIZE_MAXSHOW* = 3

-  SIZE_MINIMIZED* = 1

-  SIZE_RESTORED* = 0

-  # WM_NCCALCSIZE message

-  WVR_ALIGNTOP* = 16

-  WVR_ALIGNLEFT* = 32

-  WVR_ALIGNBOTTOM* = 64

-  WVR_ALIGNRIGHT* = 128

-  WVR_HREDRAW* = 256

-  WVR_VREDRAW* = 512

-  WVR_REDRAW* = 768

-  WVR_VALIDRECTS* = 1024

-  # WM_NCHITTEST message

-  HTBOTTOM* = 15

-  HTBOTTOMLEFT* = 16

-  HTBOTTOMRIGHT* = 17

-  HTCAPTION* = 2

-  HTCLIENT* = 1

-  HTERROR* = -2

-  HTGROWBOX* = 4

-  HTHSCROLL* = 6

-  HTLEFT* = 10

-  HTMENU* = 5

-  HTNOWHERE* = 0

-  HTREDUCE* = 8

-

-  HTRIGHT* = 11

-  HTSIZE* = 4

-  HTSYSMENU* = 3

-  HTTOP* = 12

-  HTTOPLEFT* = 13

-  HTTOPRIGHT* = 14

-  HTTRANSPARENT* = -1

-  HTVSCROLL* = 7

-  HTZOOM* = 9

-  # Mouse messages

-  MK_CONTROL* = 8

-  MK_LBUTTON* = 1

-  MK_MBUTTON* = 16

-  MK_RBUTTON* = 2

-  MK_SHIFT* = 4

-  # WNDCLASS structure

-  CS_BYTEALIGNCLIENT* = 4096

-  CS_BYTEALIGNWINDOW* = 8192

-  CS_CLASSDC* = 64

-  CS_DBLCLKS* = 8

-  CS_GLOBALCLASS* = 16384

-  CS_HREDRAW* = 2

-  CS_KEYCVTWINDOW* = 4

-  CS_NOCLOSE* = 512

-  CS_NOKEYCVT* = 256

-  CS_OWNDC* = 32

-  CS_PARENTDC* = 128

-  CS_SAVEBITS* = 2048

-  CS_VREDRAW* = 1

-  DLGWINDOWEXTRA* = 30

-  # ACCEL structure

-  FALT* = 16

-  FCONTROL* = 8

-  FNOINVERT* = 2

-  FSHIFT* = 4

-  FVIRTKEY* = 1

-  # WM_MENUCHAR return constants

-  MNC_IGNORE* = 0

-  MNC_CLOSE* = 1

-  MNC_EXECUTE* = 2

-  MNC_SELECT* = 3

-  # MENUINFO structure

-  MIM_MAXHEIGHT* = 1

-  MIM_BACKGROUND* = 2

-  MIM_HELPID* = 4

-  MIM_MENUDATA* = 8

-  MIM_STYLE* = 16

-  MIM_APPLYTOSUBMENUS* = 0x80000000

-  MNS_CHECKORBMP* = 0x04000000

-  MNS_NOTIFYBYPOS* = 0x08000000

-  MNS_AUTODISMISS* = 0x10000000

-  MNS_DRAGDROP* = 0x20000000

-  MNS_MODELESS* = 0x40000000

-  MNS_NOCHECK* = 0x80000000

-  # MENUITEMINFO structure

-  MIIM_CHECKMARKS* = 8

-  MIIM_DATA* = 32

-  MIIM_ID* = 2

-  MIIM_STATE* = 1

-  MIIM_SUBMENU* = 4

-  MIIM_TYPE* = 16

-  MIIM_STRING* = 64

-  MIIM_BITMAP* = 128

-  MIIM_FTYPE* = 256

-  MFT_BITMAP* = 0x00000004

-  MFT_MENUBARBREAK* = 0x00000020

-  MFT_MENUBREAK* = 0x00000040

-  MFT_OWNERDRAW* = 0x00000100

-  MFT_RADIOCHECK* = 0x00000200

-  MFT_RIGHTJUSTIFY* = 0x00004000

-  MFT_SEPARATOR* = 0x00000800

-  MFT_RIGHTORDER* = 0x00002000

-  MFT_STRING* = 0

-  MFS_CHECKED* = 0x00000008

-  MFS_DEFAULT* = 0x00001000

-  MFS_DISABLED* = 0x00000003

-  MFS_ENABLED* = 0

-  MFS_GRAYED* = 0x00000003

-  MFS_HILITE* = 0x00000080

-  MFS_UNCHECKED* = 0

-  MFS_UNHILITE* = 0

-  HBMMENU_CALLBACK* = - 1

-  HBMMENU_SYSTEM* = 1

-  HBMMENU_MBAR_RESTORE* = 2

-  HBMMENU_MBAR_MINIMIZE* = 3

-  HBMMENU_MBAR_CLOSE* = 5

-  HBMMENU_MBAR_CLOSE_D* = 6

-  HBMMENU_MBAR_MINIMIZE_D* = 7

-  HBMMENU_POPUP_CLOSE* = 8

-  HBMMENU_POPUP_RESTORE* = 9

-  HBMMENU_POPUP_MAXIMIZE* = 10

-  HBMMENU_POPUP_MINIMIZE* = 11

-  # SERIALKEYS structure

-  SERKF_AVAILABLE* = 2

-  SERKF_INDICATOR* = 4

-  SERKF_SERIALKEYSON* = 1

-  # FILTERKEYS structure

-  FKF_AVAILABLE* = 2

-  FKF_CLICKON* = 64

-  FKF_FILTERKEYSON* = 1

-  FKF_HOTKEYACTIVE* = 4

-  FKF_HOTKEYSOUND* = 16

-  FKF_CONFIRMHOTKEY* = 8

-  FKF_INDICATOR* = 32

-  # HELPINFO structure

-  HELPINFO_MENUITEM* = 2

-  HELPINFO_WINDOW* = 1

-  # WM_PRINT message

-  PRF_CHECKVISIBLE* = 0x00000001

-  PRF_CHILDREN* = 0x00000010

-  PRF_CLIENT* = 0x00000004

-  PRF_ERASEBKGND* = 0x00000008

-  PRF_NONCLIENT* = 0x00000002

-  PRF_OWNED* = 0x00000020

-

-  # MapWindowPoints

-  HWND_DESKTOP* = HWND(0)

-

-const

-  # WM_SYSCOMMAND message

-  SC_CLOSE* = 61536

-  SC_CONTEXTHELP* = 61824

-  SC_DEFAULT* = 61792

-  SC_HOTKEY* = 61776

-  SC_HSCROLL* = 61568

-  SC_KEYMENU* = 61696

-  SC_MAXIMIZE* = 61488

-  SC_ZOOM* = 61488

-  SC_MINIMIZE* = 61472

-  SC_ICON* = 61472

-  SC_MONITORPOWER* = 61808

-  SC_MOUSEMENU* = 61584

-  SC_MOVE* = 61456

-  SC_NEXTWINDOW* = 61504

-  SC_PREVWINDOW* = 61520

-  SC_RESTORE* = 61728

-  SC_SCREENSAVE* = 61760

-  SC_SIZE* = 61440

-  SC_TASKLIST* = 61744

-  SC_VSCROLL* = 61552

-  # DM_GETDEFID message

-  DC_HASDEFID* = 21323

-  # WM_GETDLGCODE message

-  DLGC_BUTTON* = 8192

-  DLGC_DEFPUSHBUTTON* = 16

-  DLGC_HASSETSEL* = 8

-  DLGC_RADIOBUTTON* = 64

-  DLGC_STATIC* = 256

-  DLGC_UNDEFPUSHBUTTON* = 32

-  DLGC_WANTALLKEYS* = 4

-  DLGC_WANTARROWS* = 1

-  DLGC_WANTCHARS* = 128

-  DLGC_WANTMESSAGE* = 4

-  DLGC_WANTTAB* = 2

-  # EM_SETMARGINS message

-  EC_LEFTMARGIN* = 1

-  EC_RIGHTMARGIN* = 2

-  EC_USEFONTINFO* = 65535

-  # LB_SETCOUNT message

-  LB_ERR* = -1

-  LB_ERRSPACE* = -2

-  LB_OKAY* = 0

-  # CB_DIR message

-  CB_ERR* = -1

-  CB_ERRSPACE* = -2

-  # WM_IME_CONTROL message

-  IMC_GETCANDIDATEPOS* = 7

-  IMC_GETCOMPOSITIONFONT* = 9

-  IMC_GETCOMPOSITIONWINDOW* = 11

-  IMC_GETSTATUSWINDOWPOS* = 15

-  IMC_CLOSESTATUSWINDOW* = 33

-  IMC_OPENSTATUSWINDOW* = 34

-  IMC_SETCANDIDATEPOS* = 8

-  IMC_SETCOMPOSITIONFONT* = 10

-  IMC_SETCOMPOSITIONWINDOW* = 12

-  IMC_SETSTATUSWINDOWPOS* = 16

-  # WM_IME_CONTROL message

-  IMN_CHANGECANDIDATE* = 3

-  IMN_CLOSECANDIDATE* = 4

-  IMN_CLOSESTATUSWINDOW* = 1

-  IMN_GUIDELINE* = 13

-  IMN_OPENCANDIDATE* = 5

-  IMN_OPENSTATUSWINDOW* = 2

-  IMN_SETCANDIDATEPOS* = 9

-  IMN_SETCOMPOSITIONFONT* = 10

-  IMN_SETCOMPOSITIONWINDOW* = 11

-  IMN_SETCONVERSIONMODE* = 6

-  IMN_SETOPENSTATUS* = 8

-  IMN_SETSENTENCEMODE* = 7

-  IMN_SETSTATUSWINDOWPOS* = 12

-  IMN_PRIVATE* = 14

-  # STICKYKEYS structure

-  SKF_AUDIBLEFEEDBACK* = 64

-  SKF_AVAILABLE* = 2

-  SKF_CONFIRMHOTKEY* = 8

-  SKF_HOTKEYACTIVE* = 4

-  SKF_HOTKEYSOUND* = 16

-  SKF_INDICATOR* = 32

-  SKF_STICKYKEYSON* = 1

-  SKF_TRISTATE* = 128

-  SKF_TWOKEYSOFF* = 256

-  # MOUSEKEYS structure

-  MKF_AVAILABLE* = 2

-  MKF_CONFIRMHOTKEY* = 8

-  MKF_HOTKEYACTIVE* = 4

-  MKF_HOTKEYSOUND* = 16

-  MKF_INDICATOR* = 32

-  MKF_MOUSEKEYSON* = 1

-  MKF_MODIFIERS* = 64

-  MKF_REPLACENUMBERS* = 128

-  # SOUNDSENTRY structure

-  SSF_AVAILABLE* = 2

-  SSF_SOUNDSENTRYON* = 1

-  SSTF_BORDER* = 2

-  SSTF_CHARS* = 1

-  SSTF_DISPLAY* = 3

-  SSTF_NONE* = 0

-  SSGF_DISPLAY* = 3

-  SSGF_NONE* = 0

-  SSWF_CUSTOM* = 4

-  SSWF_DISPLAY* = 3

-  SSWF_NONE* = 0

-  SSWF_TITLE* = 1

-  SSWF_WINDOW* = 2

-  # ACCESSTIMEOUT structure

-  ATF_ONOFFFEEDBACK* = 2

-  ATF_TIMEOUTON* = 1

-  # HIGHCONTRAST structure

-  HCF_AVAILABLE* = 2

-  HCF_CONFIRMHOTKEY* = 8

-  HCF_HIGHCONTRASTON* = 1

-  HCF_HOTKEYACTIVE* = 4

-  HCF_HOTKEYAVAILABLE* = 64

-  HCF_HOTKEYSOUND* = 16

-  HCF_INDICATOR* = 32

-  # TOGGLEKEYS structure

-  TKF_AVAILABLE* = 2

-  TKF_CONFIRMHOTKEY* = 8

-  TKF_HOTKEYACTIVE* = 4

-  TKF_HOTKEYSOUND* = 16

-  TKF_TOGGLEKEYSON* = 1

-  # Installable Policy

-  PP_DISPLAYERRORS* = 1

-  # SERVICE_INFO structure

-  RESOURCEDISPLAYTYPE_DOMAIN* = 1

-  RESOURCEDISPLAYTYPE_FILE* = 4

-  RESOURCEDISPLAYTYPE_GENERIC* = 0

-  RESOURCEDISPLAYTYPE_GROUP* = 5

-  RESOURCEDISPLAYTYPE_SERVER* = 2

-  RESOURCEDISPLAYTYPE_SHARE* = 3

-  # KEY_EVENT_RECORD structure

-  CAPSLOCK_ON* = 128

-  ENHANCED_KEY* = 256

-  LEFT_ALT_PRESSED* = 2

-  LEFT_CTRL_PRESSED* = 8

-  NUMLOCK_ON* = 32

-  RIGHT_ALT_PRESSED* = 1

-  RIGHT_CTRL_PRESSED* = 4

-  SCROLLLOCK_ON* = 64

-  SHIFT_PRESSED* = 16

-  # MOUSE_EVENT_RECORD structure

-  FROM_LEFT_1ST_BUTTON_PRESSED* = 1

-  RIGHTMOST_BUTTON_PRESSED* = 2

-  FROM_LEFT_2ND_BUTTON_PRESSED* = 4

-  FROM_LEFT_3RD_BUTTON_PRESSED* = 8

-  FROM_LEFT_4TH_BUTTON_PRESSED* = 16

-  DOUBLE_CLICK* = 2

-  MOUSE_MOVED* = 1

-  # INPUT_RECORD structure

-  KEY_EVENT* = 1

-  cMOUSE_EVENT* = 2

-  WINDOW_BUFFER_SIZE_EVENT* = 4

-  MENU_EVENT* = 8

-  FOCUS_EVENT* = 16

-  # BITMAPINFOHEADER structure

-  BI_RGB* = 0

-  BI_RLE8* = 1

-  BI_RLE4* = 2

-  BI_BITFIELDS* = 3

-  # Extensions to OpenGL

-  # ChoosePixelFormat

-  PFD_DOUBLEBUFFER* = 0x00000001

-  PFD_STEREO* = 0x00000002

-  PFD_DRAW_TO_WINDOW* = 0x00000004

-  PFD_DRAW_TO_BITMAP* = 0x00000008

-  PFD_SUPPORT_GDI* = 0x00000010

-  PFD_SUPPORT_OPENGL* = 0x00000020

-  PFD_DEPTH_DONTCARE* = 0x20000000

-  PFD_DOUBLEBUFFER_DONTCARE* = 0x40000000

-  PFD_STEREO_DONTCARE* = 0x80000000

-  PFD_TYPE_RGBA* = 0

-  PFD_TYPE_COLORINDEX* = 1

-  PFD_MAIN_PLANE* = 0

-  PFD_OVERLAY_PLANE* = 1

-  PFD_UNDERLAY_PLANE* = -1

-  # wglUseFontOutlines

-  WGL_FONT_LINES* = 0

-  WGL_FONT_POLYGONS* = 1

-  PFD_GENERIC_FORMAT* = 0x00000040

-  PFD_NEED_PALETTE* = 0x00000080

-  PFD_NEED_SYSTEM_PALETTE* = 0x00000100

-  PFD_SWAP_EXCHANGE* = 0x00000200

-  PFD_SWAP_COPY* = 0x00000400

-  PFD_SWAP_LAYER_BUFFERS* = 0x00000800

-  PFD_GENERIC_ACCELERATED* = 0x00001000

-  PFD_SUPPORT_DIRECTDRAW* = 0x00002000

-  TMPF_FIXED_PITCH* = 0x00000001

-  TMPF_VECTOR* = 0x00000002

-  TMPF_TRUETYPE* = 0x00000004

-  TMPF_DEVICE* = 0x00000008

-  WM_CTLCOLOR* = 25

-  LWA_COLORKEY* = 0x00000001

-  LWA_ALPHA* = 0x00000002

-  ULW_COLORKEY* = 0x00000001

-  ULW_ALPHA* = 0x00000002

-  ULW_OPAQUE* = 0x00000004

-  WS_EX_LAYERED* = 0x00080000

-  WS_EX_NOINHERITLAYOUT* = 0x00100000

-  WS_EX_LAYOUTRTL* = 0x00400000

-  WS_EX_COMPOSITED* = 0x02000000

-  WS_EX_NOACTIVATE* = 0x08000000

-  C3_LEXICAL* = 1024

-

-# --------------------- old stuff, need to organize! ---------------

-# BEGINNING of windowsx.h stuff from old headers:

-

-# was #define dname(params) def_expr

-proc GetFirstChild*(h: HWND): HWND

-  # was #define dname(params) def_expr

-proc GetNextSibling*(h: HWND): HWND

-  # was #define dname(params) def_expr

-proc GetWindowID*(h: HWND): int32

-  # was #define dname(params) def_expr

-proc SubclassWindow*(h: HWND, p: LONG): LONG

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_COMMAND_CMD*(w, L: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_COMMAND_ID*(w, L: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_CTLCOLOR_HDC*(w, L, msg: int32): HDC

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_CTLCOLOR_HWND*(w, L, msg: int32): HWND

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_HSCROLL_CODE*(w, L: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_HSCROLL_HWND*(w, L: int32): HWND

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_HSCROLL_POS*(w, L: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_MDIACTIVATE_FACTIVATE*(h, a, b: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_MDIACTIVATE_HWNDACTIVATE*(a, b: int32): HWND

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_MDIACTIVATE_HWNDDEACT*(a, b: int32): HWND

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_VSCROLL_CODE*(w, L: int32): int32

-  # return type might be wrong

-  # was #define dname(params) def_expr

-  # argument types are unknown

-proc GET_WM_VSCROLL_HWND*(w, L: int32): HWND

-  # was #define dname(params) def_expr

-  # argument types are unknown

-  # return type might be wrong

-proc GET_WM_VSCROLL_POS*(w, L: int32): int32

-  # return type might be wrong

-  #  Not convertable by H2PAS

-  # END OF windowsx.h stuff from old headers

-  # ------------------------------------------------------------------

-

-const

-  # BEGINNING of shellapi.h stuff from old headers

-  SE_ERR_SHARE* = 26

-  SE_ERR_ASSOCINCOMPLETE* = 27

-  SE_ERR_DDETIMEOUT* = 28

-  SE_ERR_DDEFAIL* = 29

-  SE_ERR_DDEBUSY* = 30

-  SE_ERR_NOASSOC* = 31

-  # END OF shellapi.h stuff from old headers

-  #

-  # ------------------------------------------------------------------

-  # From ddeml.h in old Cygnus headers

-  XCLASS_BOOL* = 0x00001000

-  XCLASS_DATA* = 0x00002000

-  XCLASS_FLAGS* = 0x00004000

-  XCLASS_MASK* = 0x0000FC00

-  XCLASS_NOTIFICATION* = 0x00008000

-  XTYPF_NOBLOCK* = 0x00000002

-  XTYP_ADVDATA* = 0x00004010

-  XTYP_ADVREQ* = 0x00002022

-  XTYP_ADVSTART* = 0x00001030

-  XTYP_ADVSTOP* = 0x00008040

-  XTYP_CONNECT* = 0x00001062

-  XTYP_CONNECT_CONFIRM* = 0x00008072

-  XTYP_DISCONNECT* = 0x000080C2

-  XTYP_EXECUTE* = 0x00004050

-  XTYP_POKE* = 0x00004090

-  XTYP_REQUEST* = 0x000020B0

-  XTYP_WILDCONNECT* = 0x000020E2

-  XTYP_REGISTER* = 0x000080A2

-  XTYP_ERROR* = 0x00008002

-  XTYP_XACT_COMPLETE* = 0x00008080

-  XTYP_UNREGISTER* = 0x000080D2

-  DMLERR_DLL_USAGE* = 0x00004004

-  DMLERR_INVALIDPARAMETER* = 0x00004006

-  DMLERR_NOTPROCESSED* = 0x00004009

-  DMLERR_POSTMSG_FAILED* = 0x0000400C

-  DMLERR_SERVER_DIED* = 0x0000400E

-  DMLERR_SYS_ERROR* = 0x0000400F

-  DMLERR_BUSY* = 0x00004001

-  DMLERR_DATAACKTIMEOUT* = 0x00004002

-  DMLERR_ADVACKTIMEOUT* = 0x00004000

-  DMLERR_DLL_NOT_INITIALIZED* = 0x00004003

-  DMLERR_LOW_MEMORY* = 0x00004007

-  DMLERR_MEMORY_ERROR* = 0x00004008

-  DMLERR_POKEACKTIMEOUT* = 0x0000400B

-  DMLERR_NO_CONV_ESTABLISHED* = 0x0000400A

-  DMLERR_REENTRANCY* = 0x0000400D

-  DMLERR_UNFOUND_QUEUE_ID* = 0x00004011

-  DMLERR_UNADVACKTIMEOUT* = 0x00004010

-  DMLERR_EXECACKTIMEOUT* = 0x00004005

-  DDE_FACK* = 0x00008000

-  DDE_FNOTPROCESSED* = 0x00000000

-  DNS_REGISTER* = 0x00000001

-  DNS_UNREGISTER* = 0x00000002

-  CP_WINANSI* = 1004

-  CP_WINUNICODE* = 1200

-  #  Not convertable by H2PAS

-  #  #define EXPENTRY CALLBACK

-  APPCLASS_STANDARD* = 0x00000000

-  # End of stuff from ddeml.h in old Cygnus headers

-

-  BKMODE_LAST* = 2

-  CTLCOLOR_MSGBOX* = 0

-  CTLCOLOR_EDIT* = 1

-  CTLCOLOR_LISTBOX* = 2

-  CTLCOLOR_BTN* = 3

-  CTLCOLOR_DLG* = 4

-  CTLCOLOR_SCROLLBAR* = 5

-  CTLCOLOR_STATIC* = 6

-  CTLCOLOR_MAX* = 7

-  META_SETMAPMODE* = 0x00000103

-  META_SETWINDOWORG* = 0x0000020B

-  META_SETWINDOWEXT* = 0x0000020C

-  POLYFILL_LAST* = 2

-  STATUS_WAIT_0* = 0x00000000

-  STATUS_ABANDONED_WAIT_0* = 0x00000080

-  STATUS_USER_APC* = 0x000000C0

-  STATUS_TIMEOUT* = 0x00000102

-  STATUS_PENDING* = 0x00000103

-  STATUS_GUARD_PAGE_VIOLATION* = 0x80000001

-  STATUS_DATATYPE_MISALIGNMENT* = 0x80000002

-  STATUS_BREAKPOINT* = 0x80000003

-  STATUS_SINGLE_STEP* = 0x80000004

-  STATUS_IN_PAGE_ERROR* = 0xC0000006

-  STATUS_INVALID_HANDLE* = 0xC0000008

-  STATUS_ILLEGAL_INSTRUCTION* = 0xC000001D

-  STATUS_NONCONTINUABLE_EXCEPTION* = 0xC0000025

-  STATUS_INVALID_DISPOSITION* = 0xC0000026

-  STATUS_ARRAY_BOUNDS_EXCEEDED* = 0xC000008C

-  STATUS_FLOAT_DENORMAL_OPERAND* = 0xC000008D

-  STATUS_FLOAT_DIVIDE_BY_ZERO* = 0xC000008E

-  STATUS_FLOAT_INEXACT_RESULT* = 0xC000008F

-  STATUS_FLOAT_INVALID_OPERATION* = 0xC0000090

-  STATUS_FLOAT_OVERFLOW* = 0xC0000091

-  STATUS_FLOAT_STACK_CHECK* = 0xC0000092

-  STATUS_FLOAT_UNDERFLOW* = 0xC0000093

-  STATUS_INTEGER_DIVIDE_BY_ZERO* = 0xC0000094

-  STATUS_INTEGER_OVERFLOW* = 0xC0000095

-  STATUS_PRIVILEGED_INSTRUCTION* = 0xC0000096

-  STATUS_STACK_OVERFLOW* = 0xC00000FD

-  STATUS_CONTROL_C_EXIT* = 0xC000013A

-  PROCESSOR_ARCHITECTURE_INTEL* = 0

-  PROCESSOR_ARCHITECTURE_MIPS* = 1

-  PROCESSOR_ARCHITECTURE_ALPHA* = 2

-  PROCESSOR_ARCHITECTURE_PPC* = 3

-

-const

-  SIZEFULLSCREEN* = SIZE_MAXIMIZED

-  SIZENORMAL* = SIZE_RESTORED

-  SIZEICONIC* = SIZE_MINIMIZED

-

-const

-  EXCEPTION_READ_FAULT* = 0   # Access violation was caused by a read

-  EXCEPTION_WRITE_FAULT* = 1  # Access violation was caused by a write

-

-when hostCPU == "ia64":

-  const

-    EXCEPTION_EXECUTE_FAULT* = 2 # Access violation was caused by an instruction fetch

-else:

-  const

-    EXCEPTION_EXECUTE_FAULT* = 8

-when hostCPU == "powerpc":

-  # ppc

-  const

-    CONTEXT_CONTROL* = 1

-    CONTEXT_FLOATING_POINT* = 2

-    CONTEXT_INTEGER* = 4

-    CONTEXT_DEBUG_REGISTERS* = 8

-    CONTEXT_FULL* = CONTEXT_CONTROL or CONTEXT_FLOATING_POINT or CONTEXT_INTEGER

-    CONTEXT_DEBUGGER* = CONTEXT_FULL

-when hostCPU == "i386":

-  # x86

-  # The doc refered me to winnt.h, so I had to look...

-  const

-    SIZE_OF_80387_REGISTERS* = 80 # Values for contextflags

-    CONTEXT_i386* = 0x00010000 # this assumes that i386 and

-    CONTEXT_i486* = 0x00010000 # i486 have identical context records

-    CONTEXT_CONTROL* = CONTEXT_i386 or 1 # SS:SP, CS:IP, FLAGS, BP

-    CONTEXT_INTEGER* = CONTEXT_i386 or 2 # AX, BX, CX, DX, SI, DI

-    CONTEXT_SEGMENTS* = CONTEXT_i386 or 4 # DS, ES, FS, GS

-    CONTEXT_FLOATING_POINT* = CONTEXT_i386 or 8 # 387 state

-    CONTEXT_DEBUG_REGISTERS* = CONTEXT_i386 or 0x00000010 # DB 0-3,6,7

-    CONTEXT_EXTENDED_REGISTERS* = CONTEXT_i386 or 0x00000020 # cpu specific extensions

-    CONTEXT_FULL* = (CONTEXT_CONTROL or CONTEXT_INTEGER) or CONTEXT_SEGMENTS

-    CONTEXT_ALL* = CONTEXT_FULL or CONTEXT_FLOATING_POINT or

-        CONTEXT_DEBUG_REGISTERS or CONTEXT_EXTENDED_REGISTERS # our own invention

-    FLAG_TRACE_BIT* = 0x00000100

-    CONTEXT_DEBUGGER* = CONTEXT_FULL or CONTEXT_FLOATING_POINT

-when hostCPU == "amd64":

-  const

-    INITIAL_MXCSR* = 0x00001F80 # initial MXCSR value

-    INITIAL_FPCSR* = 0x0000027F # initial FPCSR value

-    CONTEXT_AMD64* = 0x00100000

-    CONTEXT_CONTROL* = (CONTEXT_AMD64 or 0x00000001)

-    CONTEXT_INTEGER* = (CONTEXT_AMD64 or 0x00000002)

-    CONTEXT_SEGMENTS* = (CONTEXT_AMD64 or 0x00000004)

-    CONTEXT_FLOATING_POINT* = (CONTEXT_AMD64 or 0x00000008)

-    CONTEXT_DEBUG_REGISTERS* = (CONTEXT_AMD64 or 0x00000010)

-    CONTEXT_FULL* = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_FLOATING_POINT

-    CONTEXT_ALL* = CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS or

-        CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS

-    CONTEXT_EXCEPTION_ACTIVE* = 0x08000000

-    CONTEXT_SERVICE_ACTIVE* = 0x10000000

-    CONTEXT_EXCEPTION_REQUEST* = 0x40000000

-    CONTEXT_EXCEPTION_REPORTING* = 0x80000000

-

-const

-  FILTER_TEMP_DUPLICATE_ACCOUNT* = 0x00000001

-  FILTER_NORMAL_ACCOUNT* = 0x00000002

-  FILTER_INTERDOMAIN_TRUST_ACCOUNT* = 0x00000008

-  FILTER_WORKSTATION_TRUST_ACCOUNT* = 0x00000010

-  FILTER_SERVER_TRUST_ACCOUNT* = 0x00000020

-  LOGON32_LOGON_INTERACTIVE* = 0x00000002

-  LOGON32_LOGON_BATCH* = 0x00000004

-  LOGON32_LOGON_SERVICE* = 0x00000005

-  LOGON32_PROVIDER_DEFAULT* = 0x00000000

-  LOGON32_PROVIDER_WINNT35* = 0x00000001

-  QID_SYNC* = 0xFFFFFFFF

-  # Magic numbers in PE executable header. # e_magic field

-  IMAGE_DOS_SIGNATURE* = 0x00005A4D

-  # nt_signature field

-  IMAGE_NT_SIGNATURE* = 0x00004550

-  # Severity values

-  SEVERITY_SUCCESS* = 0

-  SEVERITY_ERROR* = 1

-  # Variant type codes (wtypes.h).

-  #    Some, not all though

-  VT_EMPTY* = 0

-  VT_NULL* = 1

-  VT_I2* = 2

-  VT_I4* = 3

-  VT_R4* = 4

-  VT_R8* = 5

-  VT_BSTR* = 8

-  VT_ERROR* = 10

-  VT_BOOL* = 11

-  VT_UI1* = 17

-  VT_BYREF* = 0x00004000

-  VT_RESERVED* = 0x00008000

-

-const

-  # Define the facility codes

-  FACILITY_WINDOWS* = 8

-  FACILITY_STORAGE* = 3

-  FACILITY_RPC* = 1

-  FACILITY_SSPI* = 9

-  FACILITY_WIN32* = 7

-  FACILITY_CONTROL* = 10

-  FACILITY_NULL* = 0

-  FACILITY_INTERNET* = 12

-  FACILITY_ITF* = 4

-  FACILITY_DISPATCH* = 2

-  FACILITY_CERT* = 11         # Manually added, bug 2672

-  ICON_SMALL* = 0

-  ICON_BIG* = 1

-  # For the TrackMouseEvent

-  TME_HOVER* = 0x00000001

-  TME_LEAVE* = 0x00000002

-  TME_QUERY* = 0x40000000

-  TME_CANCEL* = DWORD(0x80000000)

-  HOVER_DEFAULT* = DWORD(0xFFFFFFFF) # Manually added, bug 3270

-  COLOR_HOTLIGHT* = 26

-  COLOR_GRADIENTACTIVECAPTION* = 27

-  COLOR_GRADIENTINACTIVECAPTION* = 28

-  COLOR_MENUHILIGHT* = 29

-  COLOR_MENUBAR* = 30

-  WM_APP* = 0x00008000

-  SYSRGN* = 4

-  UIS_SET* = 1

-  UIS_CLEAR* = 2

-  UIS_INITIALIZE* = 3

-  UISF_HIDEFOCUS* = 0x00000001

-  UISF_HIDEACCEL* = 0x00000002

-  UISF_ACTIVE* = 0x00000004

-

-type

-  # WARNING

-  #      the variable argument list

-  #      is not implemented for FPC

-  #      va_list is just a dummy record

-  #      MvdV: Nevertheless it should be a pointer type, not a record

-  va_list* = cstring

-  ABC* {.final, pure.} = object

-    abcA*: int32

-    abcB*: WINUINT

-    abcC*: int32

-

-  LPABC* = ptr ABC

-  PABC* = ptr ABC

-  ABCFLOAT* {.final, pure.} = object

-    abcfA*: float32

-    abcfB*: float32

-    abcfC*: float32

-  LPABCFLOAT* = ptr ABCFLOAT

-  PABCFLOAT* = ptr ABCFLOAT

-

-  ACCEL* {.final, pure.} = object

-    fVirt*: int8

-    key*: int16

-    cmd*: int16

-  LPACCEL* = ptr ACCEL

-  PACCEL* = ptr ACCEL

-  ACE_HEADER* {.final, pure.} = object

-    AceType*: int8

-    AceFlags*: int8

-    AceSize*: int16

-

-  PACE_HEADER* = ptr ACE_HEADER

-  ACCESS_MASK* = DWORD

-  REGSAM* = ACCESS_MASK

-  ACCESS_ALLOWED_ACE* {.final, pure.} = object

-    Header*: ACE_HEADER

-    Mask*: ACCESS_MASK

-    SidStart*: DWORD

-

-  PACCESS_ALLOWED_ACE* = ptr ACCESS_ALLOWED_ACE

-  ACCESS_DENIED_ACE* {.final, pure.} = object

-    Header*: ACE_HEADER

-    Mask*: ACCESS_MASK

-    SidStart*: DWORD

-

-  ACCESSTIMEOUT* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwFlags*: DWORD

-    iTimeOutMSec*: DWORD

-

-  PACCESSTIMEOUT* = ptr ACCESSTIMEOUT

-  ACL* {.final, pure.} = object

-    AclRevision*: int8

-    Sbz1*: int8

-    AclSize*: int16

-    AceCount*: int16

-    Sbz2*: int16

-

-  PACL* = ptr ACL

-  TACL_REVISION_INFORMATION* {.final, pure.} = object # Name conflit if we drop the `T`

-    AclRevision*: DWORD

-  PACLREVISIONINFORMATION* = ptr TACL_REVISION_INFORMATION

-

-  TACL_SIZE_INFORMATION* {.final, pure.} = object # Name conflict if we drop the `T`

-    AceCount*: DWORD

-    AclBytesInUse*: DWORD

-    AclBytesFree*: DWORD

-  PACLSIZEINFORMATION* = ptr TACL_SIZE_INFORMATION

-  ACTION_HEADER* {.final, pure.} = object

-    transport_id*: ULONG

-    action_code*: USHORT

-    reserved*: USHORT

-

-  PACTIONHEADER* = ptr ACTION_HEADER

-  ADAPTER_STATUS* {.final, pure.} = object

-    adapter_address*: array[0..5, UCHAR]

-    rev_major*: UCHAR

-    reserved0*: UCHAR

-    adapter_type*: UCHAR

-    rev_minor*: UCHAR

-    duration*: int16

-    frmr_recv*: int16

-    frmr_xmit*: int16

-    iframe_recv_err*: int16

-    xmit_aborts*: int16

-    xmit_success*: DWORD

-    recv_success*: DWORD

-    iframe_xmit_err*: int16

-    recv_buff_unavail*: int16

-    t1_timeouts*: int16

-    ti_timeouts*: int16

-    reserved1*: DWORD

-    free_ncbs*: int16

-    max_cfg_ncbs*: int16

-    max_ncbs*: int16

-    xmit_buf_unavail*: int16

-    max_dgram_size*: int16

-    pending_sess*: int16

-    max_cfg_sess*: int16

-    max_sess*: int16

-    max_sess_pkt_size*: int16

-    name_count*: int16

-

-  PADAPTERSTATUS* = ptr ADAPTER_STATUS

-  ADDJOB_INFO_1* {.final, pure.} = object

-    Path*: LPTSTR

-    JobId*: DWORD

-

-  PADDJOB_INFO_1* = ptr ADDJOB_INFO_1

-  ANIMATIONINFO* {.final, pure.} = object

-    cbSize*: WINUINT

-    iMinAnimate*: int32

-

-  LPANIMATIONINFO* = ptr ANIMATIONINFO

-  PANIMATIONINFO* = ptr ANIMATIONINFO

-

-  APPBARDATA* {.final, pure.} = object

-    cbSize*: DWORD

-    hWnd*: HWND

-    uCallbackMessage*: WINUINT

-    uEdge*: WINUINT

-    rc*: RECT

-    lParam*: LPARAM

-

-  PAppBarData* = ptr APPBARDATA

-  BITMAP* {.final, pure.} = object

-    bmType*: LONG

-    bmWidth*: LONG

-    bmHeight*: LONG

-    bmWidthBytes*: LONG

-    bmPlanes*: int16

-    bmBitsPixel*: int16

-    bmBits*: LPVOID

-

-  PBITMAP* = ptr BITMAP

-  NPBITMAP* = ptr BITMAP

-  LPBITMAP* = ptr BITMAP

-  BITMAPCOREHEADER* {.final, pure.} = object

-    bcSize*: DWORD

-    bcWidth*: int16

-    bcHeight*: int16

-    bcPlanes*: int16

-    bcBitCount*: int16

-

-  PBITMAPCOREHEADER* = ptr BITMAPCOREHEADER

-  RGBTRIPLE* {.final, pure.} = object

-    rgbtBlue*: int8

-    rgbtGreen*: int8

-    rgbtRed*: int8

-

-  PRGBTRIPLE* = ptr RGBTRIPLE

-  BITMAPCOREINFO* {.final, pure.} = object

-    bmciHeader*: BITMAPCOREHEADER

-    bmciColors*: array[0..0, RGBTRIPLE]

-

-  PBITMAPCOREINFO* = ptr BITMAPCOREINFO

-  LPBITMAPCOREINFO* = ptr BITMAPCOREINFO

-# TBITMAPCOREINFO* = BITMAPCOREINFO # error

-                                    #  WORD    bfReserved1;

-                                    #  WORD    bfReserved2;

-                                    # in declarator_list

-  BITMAPINFOHEADER* {.final, pure.} = object

-    biSize*: DWORD

-    biWidth*: LONG

-    biHeight*: LONG

-    biPlanes*: int16

-    biBitCount*: int16

-    biCompression*: DWORD

-    biSizeImage*: DWORD

-    biXPelsPerMeter*: LONG

-    biYPelsPerMeter*: LONG

-    biClrUsed*: DWORD

-    biClrImportant*: DWORD

-

-  LPBITMAPINFOHEADER* = ptr BITMAPINFOHEADER

-  PBITMAPINFOHEADER* = ptr BITMAPINFOHEADER

-  RGBQUAD* {.final, pure.} = object

-    rgbBlue*: int8

-    rgbGreen*: int8

-    rgbRed*: int8

-    rgbReserved*: int8

-

-  PRGBQUAD* = ptr RGBQUAD

-  BITMAPINFO* {.final, pure.} = object

-    bmiHeader*: BITMAPINFOHEADER

-    bmiColors*: array[0..0, RGBQUAD]

-

-  LPBITMAPINFO* = ptr BITMAPINFO

-  PBITMAPINFO* = ptr BITMAPINFO

-  FXPT2DOT30* = int32

-  LPFXPT2DOT30* = ptr FXPT2DOT30

-  TPFXPT2DOT30* = FXPT2DOT30

-  PPFXPT2DOT30* = ptr FXPT2DOT30

-  CIEXYZ* {.final, pure.} = object

-    ciexyzX*: FXPT2DOT30

-    ciexyzY*: FXPT2DOT30

-    ciexyzZ*: FXPT2DOT30

-

-  LPCIEXYZ* = ptr CIEXYZ

-  PCIEXYZ* = ptr CIEXYZ

-  CIEXYZTRIPLE* {.final, pure.} = object

-    ciexyzRed*: CIEXYZ

-    ciexyzGreen*: CIEXYZ

-    ciexyzBlue*: CIEXYZ

-

-  LPCIEXYZTRIPLE* = ptr CIEXYZTRIPLE

-  PCIEXYZTRIPLE* = ptr CIEXYZTRIPLE

-  BITMAPV4HEADER* {.final, pure.} = object

-    bV4Size*: DWORD

-    bV4Width*: LONG

-    bV4Height*: LONG

-    bV4Planes*: int16

-    bV4BitCount*: int16

-    bV4V4Compression*: DWORD

-    bV4SizeImage*: DWORD

-    bV4XPelsPerMeter*: LONG

-    bV4YPelsPerMeter*: LONG

-    bV4ClrUsed*: DWORD

-    bV4ClrImportant*: DWORD

-    bV4RedMask*: DWORD

-    bV4GreenMask*: DWORD

-    bV4BlueMask*: DWORD

-    bV4AlphaMask*: DWORD

-    bV4CSType*: DWORD

-    bV4Endpoints*: CIEXYZTRIPLE

-    bV4GammaRed*: DWORD

-    bV4GammaGreen*: DWORD

-    bV4GammaBlue*: DWORD

-

-  LPBITMAPV4HEADER* = ptr BITMAPV4HEADER

-  PBITMAPV4HEADER* = ptr BITMAPV4HEADER

-  BITMAPFILEHEADER* {.final, pure.} = object

-    bfType*: int16

-    bfSize*: DWord

-    bfReserved1*: int16

-    bfReserved2*: int16

-    bfOffBits*: DWord

-

-  BLOB* {.final, pure.} = object

-    cbSize*: ULONG

-    pBlobData*: ptr int8

-

-  PBLOB* = ptr BLOB

-  SHITEMID* {.final, pure.} = object

-    cb*: USHORT

-    abID*: array[0..0, int8]

-

-  LPSHITEMID* = ptr SHITEMID

-  LPCSHITEMID* = ptr SHITEMID

-  PSHITEMID* = ptr SHITEMID

-  ITEMIDLIST* {.final, pure.} = object

-    mkid*: SHITEMID

-

-  LPITEMIDLIST* = ptr ITEMIDLIST

-  LPCITEMIDLIST* = ptr ITEMIDLIST

-  PITEMIDLIST* = ptr ITEMIDLIST

-  BROWSEINFO* {.final, pure.} = object

-    hwndOwner*: HWND

-    pidlRoot*: LPCITEMIDLIST

-    pszDisplayName*: LPSTR

-    lpszTitle*: LPCSTR

-    ulFlags*: WINUINT

-    lpfn*: BFFCALLBACK

-    lParam*: LPARAM

-    iImage*: int32

-

-  LPBROWSEINFO* = ptr BROWSEINFO

-  PBROWSEINFO* = ptr BROWSEINFO

-

-  BY_HANDLE_FILE_INFORMATION* {.final, pure.} = object

-    dwFileAttributes*: DWORD

-    ftCreationTime*: FILETIME

-    ftLastAccessTime*: FILETIME

-    ftLastWriteTime*: FILETIME

-    dwVolumeSerialNumber*: DWORD

-    nFileSizeHigh*: DWORD

-    nFileSizeLow*: DWORD

-    nNumberOfLinks*: DWORD

-    nFileIndexHigh*: DWORD

-    nFileIndexLow*: DWORD

-

-  LPBY_HANDLE_FILE_INFORMATION* = ptr BY_HANDLE_FILE_INFORMATION

-  PBYHANDLEFILEINFORMATION* = ptr BY_HANDLE_FILE_INFORMATION

-  FIXED* {.final, pure.} = object

-    fract*: int16

-    value*: SHORT

-

-  PFIXED* = ptr FIXED

-  POINTFX* {.final, pure.} = object

-    x*: FIXED

-    y*: FIXED

-

-  PPOINTFX* = ptr POINTFX

-

-  SmallPoint* {.final, pure.} = object

-    X*, Y*: SHORT

-

-  CANDIDATEFORM* {.final, pure.} = object

-    dwIndex*: DWORD

-    dwStyle*: DWORD

-    ptCurrentPos*: POINT

-    rcArea*: RECT

-

-  LPCANDIDATEFORM* = ptr CANDIDATEFORM

-  PCANDIDATEFORM* = ptr CANDIDATEFORM

-  CANDIDATELIST* {.final, pure.} = object

-    dwSize*: DWORD

-    dwStyle*: DWORD

-    dwCount*: DWORD

-    dwSelection*: DWORD

-    dwPageStart*: DWORD

-    dwPageSize*: DWORD

-    dwOffset*: array[0..0, DWORD]

-

-  LPCANDIDATELIST* = ptr CANDIDATELIST

-  PCANDIDATELIST* = ptr CANDIDATELIST

-  CREATESTRUCT* {.final, pure.} = object

-    lpCreateParams*: LPVOID

-    hInstance*: HINST

-    hMenu*: HMENU

-    hwndParent*: HWND

-    cy*: int32

-    cx*: int32

-    y*: int32

-    x*: int32

-    style*: LONG

-    lpszName*: LPCTSTR

-    lpszClass*: LPCTSTR

-    dwExStyle*: DWORD

-

-  LPCREATESTRUCT* = ptr CREATESTRUCT

-  PCREATESTRUCT* = ptr CREATESTRUCT

-  CBT_CREATEWND* {.final, pure.} = object

-    lpcs*: LPCREATESTRUCT

-    hwndInsertAfter*: HWND

-

-  PCBT_CREATEWND* = ptr CBT_CREATEWND

-  CBTACTIVATESTRUCT* {.final, pure.} = object

-    fMouse*: WINBOOL

-    hWndActive*: HWND

-

-  PCBTACTIVATESTRUCT* = ptr CBTACTIVATESTRUCT

-  CHAR_INFO* {.final, pure.} = object

-    UnicodeChar*: WCHAR

-    Attributes*: int16        # other union part: AsciiChar : CHAR

-

-  PCHAR_INFO* = ptr CHAR_INFO

-  CHARFORMAT* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwMask*: DWORD

-    dwEffects*: DWORD

-    yHeight*: LONG

-    yOffset*: LONG

-    crTextColor*: COLORREF

-    bCharSet*: int8

-    bPitchAndFamily*: int8

-    szFaceName*: array[0..(LF_FACESIZE) - 1, CHAR]

-

-  Pcharformat* = ptr CHARFORMAT

-  CHARRANGE* {.final, pure.} = object

-    cpMin*: LONG

-    cpMax*: LONG

-

-  Pcharrange* = ptr CHARRANGE

-  CHARSET* {.final, pure.} = object

-    aflBlock*: array[0..2, DWORD]

-    flLang*: DWORD

-

-  PCHARSET* = ptr CHARSET

-  FONTSIGNATURE* {.final, pure.} = object

-    fsUsb*: array[0..3, DWORD]

-    fsCsb*: array[0..1, DWORD]

-

-  LPFONTSIGNATURE* = ptr FONTSIGNATURE

-  PFONTSIGNATURE* = ptr FONTSIGNATURE

-  CHARSETINFO* {.final, pure.} = object

-    ciCharset*: WINUINT

-    ciACP*: WINUINT

-    fs*: FONTSIGNATURE

-

-  LPCHARSETINFO* = ptr CHARSETINFO

-  PCHARSETINFO* = ptr CHARSETINFO

-  #CHOOSECOLOR = record confilcts with function ChooseColor

-  TCHOOSECOLOR* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hInstance*: HWND

-    rgbResult*: COLORREF

-    lpCustColors*: ptr COLORREF

-    Flags*: DWORD

-    lCustData*: LPARAM

-    lpfnHook*: LPCCHOOKPROC

-    lpTemplateName*: LPCTSTR

-

-  LPCHOOSECOLOR* = ptr TCHOOSECOLOR

-  PCHOOSECOLOR* = ptr TCHOOSECOLOR

-  LOGFONT* {.final, pure.} = object

-    lfHeight*: LONG

-    lfWidth*: LONG

-    lfEscapement*: LONG

-    lfOrientation*: LONG

-    lfWeight*: LONG

-    lfItalic*: int8

-    lfUnderline*: int8

-    lfStrikeOut*: int8

-    lfCharSet*: int8

-    lfOutPrecision*: int8

-    lfClipPrecision*: int8

-    lfQuality*: int8

-    lfPitchAndFamily*: int8

-    lfFaceName*: array[0..(LF_FACESIZE) - 1, CHAR]

-

-  LPLOGFONT* = ptr LOGFONT

-  PLOGFONT* = ptr LOGFONT

-  PLOGFONTA* = PLOGFONT

-  LOGFONTW* {.final, pure.} = object

-    lfHeight*: LONG

-    lfWidth*: LONG

-    lfEscapement*: LONG

-    lfOrientation*: LONG

-    lfWeight*: LONG

-    lfItalic*: int8

-    lfUnderline*: int8

-    lfStrikeOut*: int8

-    lfCharSet*: int8

-    lfOutPrecision*: int8

-    lfClipPrecision*: int8

-    lfQuality*: int8

-    lfPitchAndFamily*: int8

-    lfFaceName*: array[0..LF_FACESIZE - 1, WCHAR]

-

-  LPLOGFONTW* = ptr LOGFONTW

-  NPLOGFONTW* = ptr LOGFONTW

-  PLogFontW* = ptr LogFontW

-  TCHOOSEFONT* {.final, pure.} = object # Name conflict if we drop the `T`

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hDC*: HDC

-    lpLogFont*: LPLOGFONT

-    iPointSize*: WINT

-    Flags*: DWORD

-    rgbColors*: DWORD

-    lCustData*: LPARAM

-    lpfnHook*: LPCFHOOKPROC

-    lpTemplateName*: LPCTSTR

-    hInstance*: HINST

-    lpszStyle*: LPTSTR

-    nFontType*: int16

-    MISSING_ALIGNMENT*: int16

-    nSizeMin*: WINT

-    nSizeMax*: WINT

-

-  LPCHOOSEFONT* = ptr TCHOOSEFONT

-  PCHOOSEFONT* = ptr TCHOOSEFONT

-  CIDA* {.final, pure.} = object

-    cidl*: WINUINT

-    aoffset*: array[0..0, WINUINT]

-

-  LPIDA* = ptr CIDA

-  PIDA* = ptr CIDA

-  CLIENTCREATESTRUCT* {.final, pure.} = object

-    hWindowMenu*: HANDLE

-    idFirstChild*: WINUINT

-

-  LPCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT

-  PCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT

-  CMINVOKECOMMANDINFO* {.final, pure.} = object

-    cbSize*: DWORD

-    fMask*: DWORD

-    hwnd*: HWND

-    lpVerb*: LPCSTR

-    lpParameters*: LPCSTR

-    lpDirectory*: LPCSTR

-    nShow*: int32

-    dwHotKey*: DWORD

-    hIcon*: HANDLE

-

-  LPCMINVOKECOMMANDINFO* = ptr CMINVOKECOMMANDINFO

-  PCMInvokeCommandInfo* = ptr CMINVOKECOMMANDINFO

-  COLORADJUSTMENT* {.final, pure.} = object

-    caSize*: int16

-    caFlags*: int16

-    caIlluminantIndex*: int16

-    caRedGamma*: int16

-    caGreenGamma*: int16

-    caBlueGamma*: int16

-    caReferenceBlack*: int16

-    caReferenceWhite*: int16

-    caContrast*: SHORT

-    caBrightness*: SHORT

-    caColorfulness*: SHORT

-    caRedGreenTint*: SHORT

-

-  LPCOLORADJUSTMENT* = ptr COLORADJUSTMENT

-  PCOLORADJUSTMENT* = ptr COLORADJUSTMENT

-  COLORMAP* {.final, pure.} = object

-    `from`*: COLORREF

-    `to`*: COLORREF          # XXX!

-

-  LPCOLORMAP* = ptr COLORMAP

-  PCOLORMAP* = ptr COLORMAP

-  DCB* {.final, pure.} = object

-    DCBlength*: DWORD

-    BaudRate*: DWORD

-    flags*: DWORD

-    wReserved*: int16

-    XonLim*: int16

-    XoffLim*: int16

-    ByteSize*: int8

-    Parity*: int8

-    StopBits*: int8

-    XonChar*: char

-    XoffChar*: char

-    ErrorChar*: char

-    EofChar*: char

-    EvtChar*: char

-    wReserved1*: int16

-

-  LPDCB* = ptr DCB

-  PDCB* = ptr DCB

-{.deprecated: [TABC: ABC, TABCFLOAT: ABCFLOAT, TACCEL: ACCEL, TACE_HEADER: ACE_HEADER,

-    TACCESS_ALLOWED_ACE: ACCESS_ALLOWED_ACE, TACCESS_DENIED_ACE: ACCESS_DENIED_ACE,

-    TACCESSTIMEOUT: ACCESSTIMEOUT, TACL: ACL, TACTIONHEADER: ACTION_HEADER,

-    TADAPTERSTATUS: ADAPTER_STATUS, TADDJOB_INFO_1: ADDJOB_INFO_1,

-    TANIMATIONINFO: ANIMATIONINFO, TAppBarData: APPBARDATA, TBITMAP: BITMAP,

-    TBITMAPCOREHEADER: BITMAPCOREHEADER, TRGBTRIPLE: RGBTRIPLE,

-    TBITMAPCOREINFO: BITMAPCOREINFO, TBITMAPINFOHEADER: BITMAPINFOHEADER,

-    TRGBQUAD: RGBQUAD, TBITMAPINFO: BITMAPINFO, TPCIEXYZ: CIEXYZ,

-    TCIEXYZTRIPLE: CIEXYZTRIPLE, TBITMAPV4HEADER: BITMAPV4HEADER, TBLOB: BLOB,

-    TSHITEMID: SHITEMID, TITEMIDLIST: ITEMIDLIST, Tbrowseinfo: BROWSEINFO,

-    TBYHANDLEFILEINFORMATION: BY_HANDLE_FILE_INFORMATION, TFIXED: FIXED,

-    TPOINTFX: POINTFX, TSmallPoint: SmallPoint, TCANDIDATEFORM: CANDIDATEFORM,

-    TCANDIDATELIST: CANDIDATELIST, TCREATESTRUCT: CREATESTRUCT,

-    TCBT_CREATEWND: CBT_CREATEWND, TCBTACTIVATESTRUCT: CBTACTIVATESTRUCT,

-    TCHAR_INFO: CHAR_INFO, Tcharformat: CHARFORMAT, Tcharrange: CHARRANGE,

-    TCHARSET: CHARSET, TFONTSIGNATURE: FONTSIGNATURE, TCHARSETINFO: CHARSETINFO,

-    TLOGFONT: LOGFONT, TLOGFONTA: LOGFONT, TLogFontW: LOGFONTW,

-    TIDA: CIDA, TCLIENTCREATESTRUCT: CLIENTCREATESTRUCT,

-    TCMInvokeCommandInfo: CMINVOKECOMMANDINFO, TCOLORADJUSTMENT: COLORADJUSTMENT,

-    TCOLORMAP: COLORMAP, TDCB: DCB

-].}

-

-const

-  bm_DCB_fBinary* = 1

-  bp_DCB_fBinary* = 0'i32

-  bm_DCB_fParity* = 0x00000002

-  bp_DCB_fParity* = 1'i32

-  bm_DCB_fOutxCtsFlow* = 0x00000004

-  bp_DCB_fOutxCtsFlow* = 2'i32

-  bm_DCB_fOutxDsrFlow* = 0x00000008

-  bp_DCB_fOutxDsrFlow* = 3'i32

-  bm_DCB_fDtrControl* = 0x00000030

-  bp_DCB_fDtrControl* = 4'i32

-  bm_DCB_fDsrSensitivity* = 0x00000040

-  bp_DCB_fDsrSensitivity* = 6'i32

-  bm_DCB_fTXContinueOnXoff* = 0x00000080

-  bp_DCB_fTXContinueOnXoff* = 7'i32

-  bm_DCB_fOutX* = 0x00000100

-  bp_DCB_fOutX* = 8'i32

-  bm_DCB_fInX* = 0x00000200

-  bp_DCB_fInX* = 9'i32

-  bm_DCB_fErrorChar* = 0x00000400

-  bp_DCB_fErrorChar* = 10'i32

-  bm_DCB_fNull* = 0x00000800

-  bp_DCB_fNull* = 11'i32

-  bm_DCB_fRtsControl* = 0x00003000

-  bp_DCB_fRtsControl* = 12'i32

-  bm_DCB_fAbortOnError* = 0x00004000

-  bp_DCB_fAbortOnError* = 14'i32

-  bm_DCB_fDummy2* = 0xFFFF8000'i32

-  bp_DCB_fDummy2* = 15'i32

-

-proc fBinary*(a: var DCB): DWORD

-proc set_fBinary*(a: var DCB, fBinary: DWORD)

-proc fParity*(a: var DCB): DWORD

-proc set_fParity*(a: var DCB, fParity: DWORD)

-proc fOutxCtsFlow*(a: var DCB): DWORD

-proc set_fOutxCtsFlow*(a: var DCB, fOutxCtsFlow: DWORD)

-proc fOutxDsrFlow*(a: var DCB): DWORD

-proc set_fOutxDsrFlow*(a: var DCB, fOutxDsrFlow: DWORD)

-proc fDtrControl*(a: var DCB): DWORD

-proc set_fDtrControl*(a: var DCB, fDtrControl: DWORD)

-proc fDsrSensitivity*(a: var DCB): DWORD

-proc set_fDsrSensitivity*(a: var DCB, fDsrSensitivity: DWORD)

-proc fTXContinueOnXoff*(a: var DCB): DWORD

-proc set_fTXContinueOnXoff*(a: var DCB, fTXContinueOnXoff: DWORD)

-proc fOutX*(a: var DCB): DWORD

-proc set_fOutX*(a: var DCB, fOutX: DWORD)

-proc fInX*(a: var DCB): DWORD

-proc set_fInX*(a: var DCB, fInX: DWORD)

-proc fErrorChar*(a: var DCB): DWORD

-proc set_fErrorChar*(a: var DCB, fErrorChar: DWORD)

-proc fNull*(a: var DCB): DWORD

-proc set_fNull*(a: var DCB, fNull: DWORD)

-proc fRtsControl*(a: var DCB): DWORD

-proc set_fRtsControl*(a: var DCB, fRtsControl: DWORD)

-proc fAbortOnError*(a: var DCB): DWORD

-proc set_fAbortOnError*(a: var DCB, fAbortOnError: DWORD)

-proc fDummy2*(a: var DCB): DWORD

-proc set_fDummy2*(a: var DCB, fDummy2: DWORD)

-type

-  COMMCONFIG* {.final, pure.} = object

-    dwSize*: DWORD

-    wVersion*: int16

-    wReserved*: int16

-    dcb*: DCB

-    dwProviderSubType*: DWORD

-    dwProviderOffset*: DWORD

-    dwProviderSize*: DWORD

-    wcProviderData*: array[0..0, WCHAR]

-

-  LPCOMMCONFIG* = ptr COMMCONFIG

-  PCOMMCONFIG* = ptr COMMCONFIG

-  COMMPROP* {.final, pure.} = object

-    wPacketLength*: int16

-    wPacketVersion*: int16

-    dwServiceMask*: DWORD

-    dwReserved1*: DWORD

-    dwMaxTxQueue*: DWORD

-    dwMaxRxQueue*: DWORD

-    dwMaxBaud*: DWORD

-    dwProvSubType*: DWORD

-    dwProvCapabilities*: DWORD

-    dwSettableParams*: DWORD

-    dwSettableBaud*: DWORD

-    wSettableData*: int16

-    wSettableStopParity*: int16

-    dwCurrentTxQueue*: DWORD

-    dwCurrentRxQueue*: DWORD

-    dwProvSpec1*: DWORD

-    dwProvSpec2*: DWORD

-    wcProvChar*: array[0..0, WCHAR]

-

-  LPCOMMPROP* = ptr COMMPROP

-  PCOMMPROP* = ptr COMMPROP

-  COMMTIMEOUTS* {.final, pure.} = object

-    ReadIntervalTimeout*: DWORD

-    ReadTotalTimeoutMultiplier*: DWORD

-    ReadTotalTimeoutConstant*: DWORD

-    WriteTotalTimeoutMultiplier*: DWORD

-    WriteTotalTimeoutConstant*: DWORD

-

-  LPCOMMTIMEOUTS* = ptr COMMTIMEOUTS

-  PCOMMTIMEOUTS* = ptr COMMTIMEOUTS

-  COMPAREITEMSTRUCT* {.final, pure.} = object

-    CtlType*: WINUINT

-    CtlID*: WINUINT

-    hwndItem*: HWND

-    itemID1*: WINUINT

-    itemData1*: ULONG_PTR

-    itemID2*: WINUINT

-    itemData2*: ULONG_PTR

-

-  PCOMPAREITEMSTRUCT* = ptr COMPAREITEMSTRUCT

-  COMPCOLOR* {.final, pure.} = object

-    crText*: COLORREF

-    crBackground*: COLORREF

-    dwEffects*: DWORD

-

-  PCOMPCOLOR* = ptr COMPCOLOR

-  COMPOSITIONFORM* {.final, pure.} = object

-    dwStyle*: DWORD

-    ptCurrentPos*: POINT

-    rcArea*: RECT

-

-  LPCOMPOSITIONFORM* = ptr COMPOSITIONFORM

-  PCOMPOSITIONFORM* = ptr COMPOSITIONFORM #     ComStatFlags = set of (fCtsHold, fDsrHold, fRlsdHold , fXoffHold ,

-                                          #                    fXoffSent , fEof ,  fTxim  , fReserved);

-  COMSTAT* {.final, pure.} = object

-    flag0*: DWORD             # can't use comstatflags, set packing issues

-                              # and conflicts with macro's

-    cbInQue*: DWORD

-    cbOutQue*: DWORD

-

-  LPCOMSTAT* = ptr COMSTAT

-  PCOMSTAT* = ptr COMSTAT

-{.deprecated: [TCOMSTAT: COMSTAT, TCOMPOSITIONFORM: COMPOSITIONFORM,

-    TCOMPCOLOR: COMPCOLOR, TCOMPAREITEMSTRUCT: COMPAREITEMSTRUCT,

-    TCOMMTIMEOUTS: COMMTIMEOUTS, TCOMMPROP: COMMPROP, TCOMMCONFIG: COMMCONFIG].}

-

-const

-  bm_COMSTAT_fCtsHold* = 0x00000001

-  bp_COMSTAT_fCtsHold* = 0'i32

-  bm_COMSTAT_fDsrHold* = 0x00000002

-  bp_COMSTAT_fDsrHold* = 1'i32

-  bm_COMSTAT_fRlsdHold* = 0x00000004

-  bp_COMSTAT_fRlsdHold* = 2'i32

-  bm_COMSTAT_fXoffHold* = 0x00000008

-  bp_COMSTAT_fXoffHold* = 3'i32

-  bm_COMSTAT_fXoffSent* = 0x00000010

-  bp_COMSTAT_fXoffSent* = 4'i32

-  bm_COMSTAT_fEof* = 0x00000020

-  bp_COMSTAT_fEof* = 5'i32

-  bm_COMSTAT_fTxim* = 0x00000040

-  bp_COMSTAT_fTxim* = 6'i32

-  bm_COMSTAT_fReserved* = 0xFFFFFF80'i32

-  bp_COMSTAT_fReserved* = 7'i32

-

-proc fCtsHold*(a: var COMSTAT): DWORD

-  # should be renamed to get_<x>?

-proc set_fCtsHold*(a: var COMSTAT, fCtsHold: DWORD)

-proc fDsrHold*(a: var COMSTAT): DWORD

-proc set_fDsrHold*(a: var COMSTAT, fDsrHold: DWORD)

-proc fRlsdHold*(a: var COMSTAT): DWORD

-proc set_fRlsdHold*(a: var COMSTAT, fRlsdHold: DWORD)

-proc fXoffHold*(a: var COMSTAT): DWORD

-proc set_fXoffHold*(a: var COMSTAT, fXoffHold: DWORD)

-proc fXoffSent*(a: var COMSTAT): DWORD

-proc set_fXoffSent*(a: var COMSTAT, fXoffSent: DWORD)

-proc fEof*(a: var COMSTAT): DWORD

-proc set_fEof*(a: var COMSTAT, fEof: DWORD)

-proc fTxim*(a: var COMSTAT): DWORD

-proc set_fTxim*(a: var COMSTAT, fTxim: DWORD)

-proc fReserved*(a: var COMSTAT): DWORD

-proc set_fReserved*(a: var COMSTAT, fReserved: DWORD)

-type

-  CONSOLE_CURSOR_INFO* {.final, pure.} = object

-    dwSize*: DWORD

-    bVisible*: WINBOOL

-

-  PCONSOLE_CURSOR_INFO* = ptr CONSOLE_CURSOR_INFO

-  COORD* {.final, pure.} = object

-    X*: SHORT

-    Y*: SHORT

-

-  PCOORD* = ptr COORD

-  SMALL_RECT* {.final, pure.} = object

-    Left*: SHORT

-    Top*: SHORT

-    Right*: SHORT

-    Bottom*: SHORT

-

-  PSMALL_RECT* = ptr SMALL_RECT

-  CONSOLE_SCREEN_BUFFER_INFO* {.final, pure.} = object

-    dwSize*: COORD

-    dwCursorPosition*: COORD

-    wAttributes*: int16

-    srWindow*: SMALL_RECT

-    dwMaximumWindowSize*: COORD

-

-  PCONSOLE_SCREEN_BUFFER_INFO* = ptr CONSOLE_SCREEN_BUFFER_INFO

-

-{.deprecated: [TCONSOLECURSORINFO: CONSOLE_CURSOR_INFO,

-      TCURSORINFO: CONSOLE_CURSOR_INFO, TCOORD: COORD, TSMALL_RECT: SMALL_RECT,

-      TCONSOLESCREENBUFFERINFO: CONSOLE_SCREEN_BUFFER_INFO].}

-

-when defined(i386):

-  type

-    FLOATING_SAVE_AREA* {.final, pure.} = object

-      ControlWord*: DWORD

-      StatusWord*: DWORD

-      TagWord*: DWORD

-      ErrorOffset*: DWORD

-      ErrorSelector*: DWORD

-      DataOffset*: DWORD

-      DataSelector*: DWORD

-      RegisterArea*: array[0..79, int8]

-      Cr0NpxState*: DWORD

-

-    PFLOATINGSAVEAREA* = ptr FLOATING_SAVE_AREA

-    CONTEXT* {.final, pure.} = object

-      ContextFlags*: DWORD

-      Dr0*: DWORD

-      Dr1*: DWORD

-      Dr2*: DWORD

-      Dr3*: DWORD

-      Dr6*: DWORD

-      Dr7*: DWORD

-      FloatSave*: FLOATING_SAVE_AREA

-      SegGs*: DWORD

-      SegFs*: DWORD

-      SegEs*: DWORD

-      SegDs*: DWORD

-      Edi*: DWORD

-      Esi*: DWORD

-      Ebx*: DWORD

-      Edx*: DWORD

-      Ecx*: DWORD

-      Eax*: DWORD

-      Ebp*: DWORD

-      Eip*: DWORD

-      SegCs*: DWORD

-      EFlags*: DWORD

-      Esp*: DWORD

-      SegSs*: DWORD

-  {.deprecated: [TFLOATINGSAVEAREA: FLOATING_SAVE_AREA].}

-

-elif defined(x86_64):

-  #

-  # Define 128-bit 16-byte aligned xmm register type.

-  #

-  type

-    M128A* {.final, pure.} = object

-      Low*: ULONGLONG

-      High*: LONGLONG

-

-    PM128A* = M128A #typedef struct _XMM_SAVE_AREA32 {

-    XMM_SAVE_AREA32* {.final, pure.} = object

-      ControlWord*: int16

-      StatusWord*: int16

-      TagWord*: int8

-      Reserved1*: int8

-      ErrorOpcode*: int16

-      ErrorOffset*: DWORD

-      ErrorSelector*: int16

-      Reserved2*: int16

-      DataOffset*: DWORD

-      DataSelector*: int16

-      Reserved3*: int16

-      MxCsr*: DWORD

-      MxCsr_Mask*: DWORD

-      FloatRegisters*: array[0..7, M128A]

-      XmmRegisters*: array[0..16, M128A]

-      Reserved4*: array[0..95, int8]

-

-    PXmmSaveArea* = ptr XmmSaveArea32

-  {.deprecated: [TM128A: M128A, TXmmSaveArea: XMM_SAVE_AREA32].}

-    

-  type

-    CONTEXT* {.final, pure.} = object

-      P1Home*: DWORD64

-      P2Home*: DWORD64

-      P3Home*: DWORD64

-      P4Home*: DWORD64

-      P5Home*: DWORD64

-      P6Home*: DWORD64        #

-                              # Control flags.

-                              #

-      ContextFlags*: DWORD

-      MxCsr*: DWORD           #

-                              # Segment Registers and processor flags.

-                              #

-      SegCs*: int16

-      SegDs*: int16

-      SegEs*: int16

-      SegFs*: int16

-      SegGs*: int16

-      SegSs*: int16

-      EFlags*: DWORD          #

-                              # Debug registers

-                              #

-      Dr0*: DWORD64

-      Dr1*: DWORD64

-      Dr2*: DWORD64

-      Dr3*: DWORD64

-      Dr6*: DWORD64

-      Dr7*: DWORD64           #

-                              # Integer registers.

-                              #

-      Rax*: DWORD64

-      Rcx*: DWORD64

-      Rdx*: DWORD64

-      Rbx*: DWORD64

-      Rsp*: DWORD64

-      Rbp*: DWORD64

-      Rsi*: DWORD64

-      Rdi*: DWORD64

-      R8*: DWORD64

-      R9*: DWORD64

-      R10*: DWORD64

-      R11*: DWORD64

-      R12*: DWORD64

-      R13*: DWORD64

-      R14*: DWORD64

-      R15*: DWORD64           #

-                              # Program counter.

-                              #

-      Rip*: DWORD64           #

-                              # Floating point state.

-                              #

-      FltSave*: XMM_SAVE_AREA32 # MWE: only translated the FltSave part of the union

-                                #

-                                # Vector registers.

-                                #

-      VectorRegister*: array[0..25, M128A]

-      VectorControl*: DWORD64 #

-                              # Special debug control registers.

-                              #

-      DebugControl*: DWORD64

-      LastBranchToRip*: DWORD64

-      LastBranchFromRip*: DWORD64

-      LastExceptionToRip*: DWORD64

-      LastExceptionFromRip*: DWORD64

-

-elif hostCPU == "powerpc":

-  # ppc

-  # Floating point registers returned when CONTEXT_FLOATING_POINT is set

-  # Integer registers returned when CONTEXT_INTEGER is set.

-  # Condition register

-  # Fixed point exception register

-  # The following are set when CONTEXT_CONTROL is set.

-  # Machine status register

-  # Instruction address register

-  # Link register

-  # Control register

-  # Control which context values are returned

-  # Registers returned if CONTEXT_DEBUG_REGISTERS is set.

-  # Breakpoint Register 1

-  # Breakpoint Register 2

-  # Breakpoint Register 3

-  # Breakpoint Register 4

-  # Breakpoint Register 5

-  # Breakpoint Register 6

-  # Debug Status Register

-  # Debug Control Register

-  type

-    CONTEXT* {.final, pure.} = object

-      Fpr0*: float64

-      Fpr1*: float64

-      Fpr2*: float64

-      Fpr3*: float64

-      Fpr4*: float64

-      Fpr5*: float64

-      Fpr6*: float64

-      Fpr7*: float64

-      Fpr8*: float64

-      Fpr9*: float64

-      Fpr10*: float64

-      Fpr11*: float64

-      Fpr12*: float64

-      Fpr13*: float64

-      Fpr14*: float64

-      Fpr15*: float64

-      Fpr16*: float64

-      Fpr17*: float64

-      Fpr18*: float64

-      Fpr19*: float64

-      Fpr20*: float64

-      Fpr21*: float64

-      Fpr22*: float64

-      Fpr23*: float64

-      Fpr24*: float64

-      Fpr25*: float64

-      Fpr26*: float64

-      Fpr27*: float64

-      Fpr28*: float64

-      Fpr29*: float64

-      Fpr30*: float64

-      Fpr31*: float64

-      Fpscr*: float64

-      Gpr0*: DWORD

-      Gpr1*: DWORD

-      Gpr2*: DWORD

-      Gpr3*: DWORD

-      Gpr4*: DWORD

-      Gpr5*: DWORD

-      Gpr6*: DWORD

-      Gpr7*: DWORD

-      Gpr8*: DWORD

-      Gpr9*: DWORD

-      Gpr10*: DWORD

-      Gpr11*: DWORD

-      Gpr12*: DWORD

-      Gpr13*: DWORD

-      Gpr14*: DWORD

-      Gpr15*: DWORD

-      Gpr16*: DWORD

-      Gpr17*: DWORD

-      Gpr18*: DWORD

-      Gpr19*: DWORD

-      Gpr20*: DWORD

-      Gpr21*: DWORD

-      Gpr22*: DWORD

-      Gpr23*: DWORD

-      Gpr24*: DWORD

-      Gpr25*: DWORD

-      Gpr26*: DWORD

-      Gpr27*: DWORD

-      Gpr28*: DWORD

-      Gpr29*: DWORD

-      Gpr30*: DWORD

-      Gpr31*: DWORD

-      Cr*: DWORD

-      Xer*: DWORD

-      Msr*: DWORD

-      Iar*: DWORD

-      Lr*: DWORD

-      Ctr*: DWORD

-      ContextFlags*: DWORD

-      Fill*: array[0..2, DWORD]

-      Dr0*: DWORD

-      Dr1*: DWORD

-      Dr2*: DWORD

-      Dr3*: DWORD

-      Dr4*: DWORD

-      Dr5*: DWORD

-      Dr6*: DWORD

-      Dr7*: DWORD

-

-else:

-  # dummy CONTEXT so that it compiles:

-  type

-    CONTEXT* {.final, pure.} = object

-      data: array [0..255, float64]

-

-type

-  LPCONTEXT* = ptr CONTEXT

-  PCONTEXT* = ptr CONTEXT

-{.deprecated: [TCONTEXT: CONTEXT].}

-

-type

-  LIST_ENTRY* {.final, pure.} = object

-    Flink*: ptr LIST_ENTRY

-    Blink*: ptr LIST_ENTRY

-

-  PLISTENTRY* = ptr LIST_ENTRY

-  CRITICAL_SECTION_DEBUG* {.final, pure.} = object

-    `type`*: int16

-    CreatorBackTraceIndex*: int16

-    CriticalSection*: ptr TRTL_CRITICAL_SECTION

-    ProcessLocksList*: LIST_ENTRY

-    EntryCount*: DWORD

-    ContentionCount*: DWORD

-    Depth*: DWORD

-    OwnerBackTrace*: array[0..4, PVOID]

-

-  TRTL_CRITICAL_SECTION* {.final, pure.} = object

-    DebugInfo*: ptr CRITICAL_SECTION_DEBUG

-    LockCount*: int32

-    RecursionCount*: int32

-    OwningThread*: Handle

-    LockSemaphore*: Handle

-    Reserved*: DWORD

-

-  PRTLCriticalSection* = ptr TRTLCriticalSection

-

-  LPCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG

-  PCRITICAL_SECTION_DEBUG* = ptr CRITICAL_SECTION_DEBUG

-  PCRITICAL_SECTION* = PRTLCriticalSection

-  LPCRITICAL_SECTION* = PRTLCriticalSection

-  SECURITY_QUALITY_OF_SERVICE* {.final, pure.} = object

-    len*: DWORD

-    ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL

-    ContextTrackingMode*: WINBOOL

-    EffectiveOnly*: bool

-

-  PSECURITY_QUALITY_OF_SERVICE* = ptr SECURITY_QUALITY_OF_SERVICE

-  CONVCONTEXT* {.final, pure.} = object

-    cb*: WINUINT

-    wFlags*: WINUINT

-    wCountryID*: WINUINT

-    iCodePage*: int32

-    dwLangID*: DWORD

-    dwSecurity*: DWORD

-    qos*: SECURITY_QUALITY_OF_SERVICE

-

-  PCONVCONTEXT* = ptr CONVCONTEXT

-  CONVINFO* {.final, pure.} = object

-    cb*: DWORD

-    hUser*: DWORD

-    hConvPartner*: HCONV

-    hszSvcPartner*: HSZ

-    hszServiceReq*: HSZ

-    hszTopic*: HSZ

-    hszItem*: HSZ

-    wFmt*: WINUINT

-    wType*: WINUINT

-    wStatus*: WINUINT

-    wConvst*: WINUINT

-    wLastError*: WINUINT

-    hConvList*: HCONVLIST

-    ConvCtxt*: CONVCONTEXT

-    hwnd*: HWND

-    hwndPartner*: HWND

-

-  PCONVINFO* = ptr CONVINFO

-  COPYDATASTRUCT* {.final, pure.} = object

-    dwData*: DWORD

-    cbData*: DWORD

-    lpData*: PVOID

-

-  PCOPYDATASTRUCT* = ptr COPYDATASTRUCT

-  CPINFO* {.final, pure.} = object

-    MaxCharSize*: WINUINT

-    DefaultChar*: array[0..(MAX_DEFAULTCHAR) - 1, int8]

-    LeadByte*: array[0..(MAX_LEADBYTES) - 1, int8]

-

-  LPCPINFO* = ptr CPINFO

-  Pcpinfo* = ptr CPINFO

-  CPLINFO* {.final, pure.} = object

-    idIcon*: int32

-    idName*: int32

-    idInfo*: int32

-    lData*: LONG

-

-  PCPLINFO* = ptr CPLINFO

-  CREATE_PROCESS_DEBUG_INFO* {.final, pure.} = object

-    hFile*: HANDLE

-    hProcess*: HANDLE

-    hThread*: HANDLE

-    lpBaseOfImage*: LPVOID

-    dwDebugInfoFileOffset*: DWORD

-    nDebugInfoSize*: DWORD

-    lpThreadLocalBase*: LPVOID

-    lpStartAddress*: LPTHREAD_START_ROUTINE

-    lpImageName*: LPVOID

-    fUnicode*: int16

-

-  PCREATEPROCESSDEBUGINFO* = ptr CREATE_PROCESS_DEBUG_INFO

-  CREATE_THREAD_DEBUG_INFO* {.final, pure.} = object

-    hThread*: HANDLE

-    lpThreadLocalBase*: LPVOID

-    lpStartAddress*: LPTHREAD_START_ROUTINE

-  

-  PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO

-

-  CURRENCYFMT* {.final, pure.} = object

-    NumDigits*: WINUINT

-    LeadingZero*: WINUINT

-    Grouping*: WINUINT

-    lpDecimalSep*: LPTSTR

-    lpThousandSep*: LPTSTR

-    NegativeOrder*: WINUINT

-    PositiveOrder*: WINUINT

-    lpCurrencySymbol*: LPTSTR

-

-  Pcurrencyfmt* = ptr CURRENCYFMT

-  CURSORSHAPE* {.final, pure.} = object

-    xHotSpot*: int32

-    yHotSpot*: int32

-    cx*: int32

-    cy*: int32

-    cbWidth*: int32

-    Planes*: int8

-    BitsPixel*: int8

-

-  LPCURSORSHAPE* = ptr CURSORSHAPE

-  PCURSORSHAPE* = ptr CURSORSHAPE

-  CWPRETSTRUCT* {.final, pure.} = object

-    lResult*: LRESULT

-    lParam*: LPARAM

-    wParam*: WPARAM

-    message*: DWORD

-    hwnd*: HWND

-

-  PCWPRETSTRUCT* = ptr CWPRETSTRUCT

-  CWPSTRUCT* {.final, pure.} = object

-    lParam*: LPARAM

-    wParam*: WPARAM

-    message*: WINUINT

-    hwnd*: HWND

-

-  PCWPSTRUCT* = ptr CWPSTRUCT

-  DATATYPES_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-

-  PDATATYPESINFO1* = ptr DATATYPES_INFO_1

-  DDEACK* {.final, pure.} = object

-    flag0*: int16

-

-  PDDEACK* = ptr DDEACK

-{.deprecated: [TLISTENTRY: LIST_ENTRY, TDATATYPESINFO1: DATATYPES_INFO_1,

-  TCWPSTRUCT: CWPSTRUCT, TCWPRETSTRUCT: CWPRETSTRUCT, TCURSORSHAPE: CURSORSHAPE,

-  Tcurrencyfmt: CURRENCYFMT, TCREATETHREADDEBUGINFO: CREATE_THREAD_DEBUG_INFO,

-  TCREATEPROCESSDEBUGINFO: CREATE_PROCESS_DEBUG_INFO, TCPLINFO: CPLINFO,

-  Tcpinfo: CPINFO, TCOPYDATASTRUCT: COPYDATASTRUCT, TCONVINFO: CONVINFO,

-  TCONVCONTEXT: CONVCONTEXT, TSECURITYQUALITYOFSERVICE: SECURITY_QUALITY_OF_SERVICE,

-  TCRITICAL_SECTION: TRTLCriticalSection, TCRITICALSECTIONDEBUG: CRITICAL_SECTION_DEBUG,

-  TDDEACK: DDEACK

-].}

-

-const

-  bm_DDEACK_bAppReturnCode* = 0x000000FF'i16

-  bp_DDEACK_bAppReturnCode* = 0'i16

-  bm_DDEACK_reserved* = 0x00003F00'i16

-  bp_DDEACK_reserved* = 8'i16

-  bm_DDEACK_fBusy* = 0x00004000'i16

-  bp_DDEACK_fBusy* = 14'i16

-  bm_DDEACK_fAck* = 0x00008000'i16

-  bp_DDEACK_fAck* = 15'i16

-

-proc bAppReturnCode*(a: var DDEACK): int16

-proc set_bAppReturnCode*(a: var DDEACK, bAppReturnCode: int16)

-proc reserved*(a: var DDEACK): int16

-proc set_reserved*(a: var DDEACK, reserved: int16)

-proc fBusy*(a: var DDEACK): int16

-proc set_fBusy*(a: var DDEACK, fBusy: int16)

-proc fAck*(a: var DDEACK): int16

-proc set_fAck*(a: var DDEACK, fAck: int16)

-type

-  DDEADVISE* {.final, pure.} = object

-    flag0*: int16

-    cfFormat*: SHORT

-

-  PDDEADVISE* = ptr DDEADVISE

-{.deprecated: [TDDEADVISE: DDEADVISE].}

-

-const

-  bm_DDEADVISE_reserved* = 0x00003FFF'i16

-  bp_DDEADVISE_reserved* = 0'i16

-  bm_DDEADVISE_fDeferUpd* = 0x00004000'i16

-  bp_DDEADVISE_fDeferUpd* = 14'i16

-  bm_DDEADVISE_fAckReq* = 0x00008000'i16

-  bp_DDEADVISE_fAckReq* = 15'i16

-

-proc reserved*(a: var DDEADVISE): int16

-proc set_reserved*(a: var DDEADVISE, reserved: int16)

-proc fDeferUpd*(a: var DDEADVISE): int16

-proc set_fDeferUpd*(a: var DDEADVISE, fDeferUpd: int16)

-proc fAckReq*(a: var DDEADVISE): int16

-proc set_fAckReq*(a: var DDEADVISE, fAckReq: int16)

-type

-  DDEDATA* {.final, pure.} = object

-    flag0*: int16

-    cfFormat*: SHORT

-    Value*: array[0..0, int8]

-

-  PDDEDATA* = ptr DDEDATA

-

-const

-  bm_DDEDATA_unused* = 0x00000FFF'i16

-  bp_DDEDATA_unused* = 0'i16

-  bm_DDEDATA_fResponse* = 0x00001000'i16

-  bp_DDEDATA_fResponse* = 12'i16

-  bm_DDEDATA_fRelease* = 0x00002000'i16

-  bp_DDEDATA_fRelease* = 13'i16

-  bm_DDEDATA_reserved* = 0x00004000'i16

-  bp_DDEDATA_reserved* = 14'i16

-  bm_DDEDATA_fAckReq* = 0x00008000'i16

-  bp_DDEDATA_fAckReq* = 15'i16

-

-proc unused*(a: var DDEDATA): int16

-proc set_unused*(a: var DDEDATA, unused: int16)

-proc fResponse*(a: var DDEDATA): int16

-proc set_fResponse*(a: var DDEDATA, fResponse: int16)

-proc fRelease*(a: var DDEDATA): int16

-proc set_fRelease*(a: var DDEDATA, fRelease: int16)

-proc reserved*(a: var DDEDATA): int16

-proc set_reserved*(a: var DDEDATA, reserved: int16)

-proc fAckReq*(a: var DDEDATA): int16

-proc set_fAckReq*(a: var DDEDATA, fAckReq: int16)

-type

-  DDELN* {.final, pure.} = object

-    flag0*: int16

-    cfFormat*: SHORT

-

-  PDDELN* = ptr DDELN

-{.deprecated: [TDDELN: DDELN].}

-

-const

-  bm_DDELN_unused* = 0x00001FFF'i16

-  bp_DDELN_unused* = 0'i16

-  bm_DDELN_fRelease* = 0x00002000'i16

-  bp_DDELN_fRelease* = 13'i16

-  bm_DDELN_fDeferUpd* = 0x00004000'i16

-  bp_DDELN_fDeferUpd* = 14'i16

-  bm_DDELN_fAckReq* = 0x00008000'i16

-  bp_DDELN_fAckReq* = 15'i16

-

-proc unused*(a: var DDELN): int16

-proc set_unused*(a: var DDELN, unused: int16)

-proc fRelease*(a: var DDELN): int16

-proc set_fRelease*(a: var DDELN, fRelease: int16)

-proc fDeferUpd*(a: var DDELN): int16

-proc set_fDeferUpd*(a: var DDELN, fDeferUpd: int16)

-proc fAckReq*(a: var DDELN): int16

-proc set_fAckReq*(a: var DDELN, fAckReq: int16)

-type

-  DDEML_MSG_HOOK_DATA* {.final, pure.} = object

-    uiLo*: WINUINT

-    uiHi*: WINUINT

-    cbData*: DWORD

-    Data*: array[0..7, DWORD]

-

-  PDDEMLMSGHOOKDATA* = ptr DDEML_MSG_HOOK_DATA

-  DDEPOKE* {.final, pure.} = object

-    flag0*: int16

-    cfFormat*: SHORT

-    Value*: array[0..0, int8]

-

-  PDDEPOKE* = ptr DDEPOKE

-{.deprecated: [TDDEMLMSGHOOKDATA: DDEML_MSG_HOOK_DATA, TDDEPOKE: DDEPOKE].}

-

-const

-  bm_DDEPOKE_unused* = 0x00001FFF'i16

-  bp_DDEPOKE_unused* = 0'i16

-  bm_DDEPOKE_fRelease* = 0x00002000'i16

-  bp_DDEPOKE_fRelease* = 13'i16

-  bm_DDEPOKE_fReserved* = 0x0000C000'i16

-  bp_DDEPOKE_fReserved* = 14'i16

-

-proc unused*(a: var DDEPOKE): int16

-proc set_unused*(a: var DDEPOKE, unused: int16)

-proc fRelease*(a: var DDEPOKE): int16

-proc set_fRelease*(a: var DDEPOKE, fRelease: int16)

-proc fReserved*(a: var DDEPOKE): int16

-proc set_fReserved*(a: var DDEPOKE, fReserved: int16)

-type

-  DDEUP* {.final, pure.} = object

-    flag0*: int16

-    cfFormat*: SHORT

-    rgb*: array[0..0, int8]

-

-  PDDEUP* = ptr DDEUP

-{.deprecated: [TDDEUP: DDEUP].}

-

-const

-  bm_DDEUP_unused* = 0x00000FFF'i16

-  bp_DDEUP_unused* = 0'i16

-  bm_DDEUP_fAck* = 0x00001000'i16

-  bp_DDEUP_fAck* = 12'i16

-  bm_DDEUP_fRelease* = 0x00002000'i16

-  bp_DDEUP_fRelease* = 13'i16

-  bm_DDEUP_fReserved* = 0x00004000'i16

-  bp_DDEUP_fReserved* = 14'i16

-  bm_DDEUP_fAckReq* = 0x00008000'i16

-  bp_DDEUP_fAckReq* = 15'i16

-

-proc unused*(a: var DDEUP): int16

-proc set_unused*(a: var DDEUP, unused: int16)

-proc fAck*(a: var DDEUP): int16

-proc set_fAck*(a: var DDEUP, fAck: int16)

-proc fRelease*(a: var DDEUP): int16

-proc set_fRelease*(a: var DDEUP, fRelease: int16)

-proc fReserved*(a: var DDEUP): int16

-proc set_fReserved*(a: var DDEUP, fReserved: int16)

-proc fAckReq*(a: var DDEUP): int16

-proc set_fAckReq*(a: var DDEUP, fAckReq: int16)

-type

-  EXCEPTION_RECORD* {.final, pure.} = object

-    ExceptionCode*: DWORD

-    ExceptionFlags*: DWORD

-    ExceptionRecord*: ptr EXCEPTION_RECORD

-    ExceptionAddress*: PVOID

-    NumberParameters*: DWORD

-    ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1,

-                                 ULONG_PTR]

-

-  PEXCEPTION_RECORD* = ptr EXCEPTION_RECORD

-  EXCEPTION_DEBUG_INFO* {.final, pure.} = object

-    ExceptionRecord*: EXCEPTION_RECORD

-    dwFirstChance*: DWORD

-

-  PEXCEPTION_DEBUG_INFO* = ptr EXCEPTION_DEBUG_INFO

-  EXCEPTION_RECORD32* {.final, pure.} = object

-    ExceptionCode*: DWORD

-    ExceptionFlags*: DWORD

-    ExceptionRecord*: DWORD

-    ExceptionAddress*: DWORD

-    NumberParameters*: DWORD

-    ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD]

-

-  PEXCEPTION_RECORD32* = ptr EXCEPTION_RECORD32

-  EXCEPTION_DEBUG_INFO32* {.final, pure.} = object

-    ExceptionRecord*: EXCEPTION_RECORD32

-    dwFirstChance*: DWORD

-

-  PEXCEPTION_DEBUG_INFO32* = ptr EXCEPTION_DEBUG_INFO32

-  EXCEPTION_RECORD64* {.final, pure.} = object

-    ExceptionCode*: DWORD

-    ExceptionFlags*: DWORD

-    ExceptionRecord*: DWORD64

-    ExceptionAddress*: DWORD64

-    NumberParameters*: DWORD

-    unusedAlignment*: DWORD

-    ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD64]

-

-  PEXCEPTION_RECORD64* = ptr EXCEPTION_RECORD64

-  EXCEPTION_DEBUG_INFO64* {.final, pure.} = object

-    ExceptionRecord*: EXCEPTION_RECORD64

-    dwFirstChance*: DWORD

-

-  PEXCEPTION_DEBUG_INFO64* = ptr EXCEPTION_DEBUG_INFO64

-  EXIT_PROCESS_DEBUG_INFO* {.final, pure.} = object

-    dwExitCode*: DWORD

-

-  PEXITPROCESSDEBUGINFO* = ptr EXIT_PROCESS_DEBUG_INFO

-  EXIT_THREAD_DEBUG_INFO* {.final, pure.} = object

-    dwExitCode*: DWORD

-

-  PEXITTHREADDEBUGINFO* = ptr EXIT_THREAD_DEBUG_INFO

-  LOAD_DLL_DEBUG_INFO* {.final, pure.} = object

-    hFile*: HANDLE

-    lpBaseOfDll*: LPVOID

-    dwDebugInfoFileOffset*: DWORD

-    nDebugInfoSize*: DWORD

-    lpImageName*: LPVOID

-    fUnicode*: int16

-

-  PLOADDLLDEBUGINFO* = ptr LOAD_DLL_DEBUG_INFO

-  UNLOAD_DLL_DEBUG_INFO* {.final, pure.} = object

-    lpBaseOfDll*: LPVOID

-

-  PUNLOADDLLDEBUGINFO* = ptr UNLOAD_DLL_DEBUG_INFO

-  OUTPUT_DEBUG_STRING_INFO* {.final, pure.} = object

-    lpDebugStringData*: LPSTR

-    fUnicode*: int16

-    nDebugStringLength*: int16

-

-  POUTPUTDEBUGSTRINGINFO* = ptr OUTPUT_DEBUG_STRING_INFO

-  RIP_INFO* {.final, pure.} = object

-    dwError*: DWORD

-    dwType*: DWORD

-

-  PRIPINFO* = ptr RIP_INFO

-  DEBUG_EVENT* {.final, pure.} = object

-    dwDebugEventCode*: DWORD

-    dwProcessId*: DWORD

-    dwThreadId*: DWORD

-    data*: array[0..15, DWORD]

-

-  LPDEBUG_EVENT* = ptr DEBUG_EVENT

-  PDEBUGEVENT* = ptr DEBUG_EVENT

-  DEBUGHOOKINFO* {.final, pure.} = object

-    idThread*: DWORD

-    idThreadInstaller*: DWORD

-    lParam*: LPARAM

-    wParam*: WPARAM

-    code*: int32

-

-  PDEBUGHOOKINFO* = ptr DEBUGHOOKINFO

-  DELETEITEMSTRUCT* {.final, pure.} = object

-    CtlType*: WINUINT

-    CtlID*: WINUINT

-    itemID*: WINUINT

-    hwndItem*: HWND

-    itemData*: ULONG_PTR

-

-  PDELETEITEMSTRUCT* = ptr DELETEITEMSTRUCT

-  DEV_BROADCAST_HDR* {.final, pure.} = object

-    dbch_size*: ULONG

-    dbch_devicetype*: ULONG

-    dbch_reserved*: ULONG

-

-  PDEV_BROADCAST_HDR* = ptr DEV_BROADCAST_HDR

-  DEV_BROADCAST_OEM* {.final, pure.} = object

-    dbco_size*: ULONG

-    dbco_devicetype*: ULONG

-    dbco_reserved*: ULONG

-    dbco_identifier*: ULONG

-    dbco_suppfunc*: ULONG

-

-  PDEV_BROADCAST_OEM* = ptr DEV_BROADCAST_OEM

-  DEV_BROADCAST_PORT* {.final, pure.} = object

-    dbcp_size*: ULONG

-    dbcp_devicetype*: ULONG

-    dbcp_reserved*: ULONG

-    dbcp_name*: array[0..0, char]

-

-  PDEV_BROADCAST_PORT* = ptr DEV_BROADCAST_PORT

-  DEV_BROADCAST_USERDEFINED* {.final, pure.} = object

-    dbud_dbh*: DEV_BROADCAST_HDR

-    dbud_szName*: array[0..0, char]

-    dbud_rgbUserDefined*: array[0..0, int8]

-

-  PDEVBROADCASTUSERDEFINED* = ptr DEV_BROADCAST_USERDEFINED

-  DEV_BROADCAST_VOLUME* {.final, pure.} = object

-    dbcv_size*: ULONG

-    dbcv_devicetype*: ULONG

-    dbcv_reserved*: ULONG

-    dbcv_unitmask*: ULONG

-    dbcv_flags*: USHORT

-

-  PDEV_BROADCAST_VOLUME* = ptr DEV_BROADCAST_VOLUME

-  DEVMODE* {.final, pure.} = object

-    dmDeviceName*: array[0..(CCHDEVICENAME) - 1, BCHAR]

-    dmSpecVersion*: int16

-    dmDriverVersion*: int16

-    dmSize*: int16

-    dmDriverExtra*: int16

-    dmFields*: DWORD

-    dmOrientation*: int16

-    dmPaperSize*: int16

-    dmPaperLength*: int16

-    dmPaperWidth*: int16

-    dmScale*: int16

-    dmCopies*: int16

-    dmDefaultSource*: int16

-    dmPrintQuality*: int16

-    dmColor*: int16

-    dmDuplex*: int16

-    dmYResolution*: int16

-    dmTTOption*: int16

-    dmCollate*: int16

-    dmFormName*: array[0..(CCHFORMNAME) - 1, BCHAR]

-    dmLogPixels*: int16

-    dmBitsPerPel*: DWORD

-    dmPelsWidth*: DWORD

-    dmPelsHeight*: DWORD

-    dmDisplayFlags*: DWORD

-    dmDisplayFrequency*: DWORD

-    dmICMMethod*: DWORD

-    dmICMIntent*: DWORD

-    dmMediaType*: DWORD

-    dmDitherType*: DWORD

-    dmICCManufacturer*: DWORD

-    dmICCModel*: DWORD        # other union part:

-                              # dmPosition: POINTL;

-                              # dmDisplayOrientation: DWORD;

-                              # dmDisplayFixedOutput: DWORD;

-

-  LPDEVMODE* = ptr DEVMODE

-  Devicemode* = DEVMODE

-  PDeviceModeA* = LPDEVMODE

-  PDeviceMode* = LPDEVMODE

-  PDEVMODE* = LPDEVMODE

-  DEVMODEW* {.final, pure.} = object

-    dmDeviceName*: array[0..CCHDEVICENAME - 1, WCHAR]

-    dmSpecVersion*: int16

-    dmDriverVersion*: int16

-    dmSize*: int16

-    dmDriverExtra*: int16

-    dmFields*: DWORD

-    dmOrientation*: SHORT

-    dmPaperSize*: SHORT

-    dmPaperLength*: SHORT

-    dmPaperWidth*: SHORT

-    dmScale*: SHORT

-    dmCopies*: SHORT

-    dmDefaultSource*: SHORT

-    dmPrintQuality*: SHORT

-    dmColor*: SHORT

-    dmDuplex*: SHORT

-    dmYResolution*: SHORT

-    dmTTOption*: SHORT

-    dmCollate*: SHORT

-    dmFormName*: array[0..CCHFORMNAME - 1, WCHAR]

-    dmLogPixels*: int16

-    dmBitsPerPel*: DWORD

-    dmPelsWidth*: DWORD

-    dmPelsHeight*: DWORD

-    dmDisplayFlags*: DWORD

-    dmDisplayFrequency*: DWORD

-    dmICMMethod*: DWORD

-    dmICMIntent*: DWORD

-    dmMediaType*: DWORD

-    dmDitherType*: DWORD

-    dmReserved1*: DWORD

-    dmReserved2*: DWORD

-    dmPanningWidth*: DWORD

-    dmPanningHeight*: DWORD

-

-  LPDEVMODEW* = ptr DEVMODEW

-  DevicemodeW* = DEVMODEW

-  PDeviceModeW* = LPDEVMODEW

-  PDEVMODEW* = LPDEVMODEW

-  DEVNAMES* {.final, pure.} = object

-    wDriverOffset*: int16

-    wDeviceOffset*: int16

-    wOutputOffset*: int16

-    wDefault*: int16

-

-  LPDEVNAMES* = ptr DEVNAMES

-  PDEVNAMES* = ptr DEVNAMES

-  DIBSECTION* {.final, pure.} = object

-    dsBm*: BITMAP

-    dsBmih*: BITMAPINFOHEADER

-    dsBitfields*: array[0..2, DWORD]

-    dshSection*: HANDLE

-    dsOffset*: DWORD

-

-  PDIBSECTION* = ptr DIBSECTION #

-                                #     LARGE_INTEGER = record

-                                #        case byte of

-                                #          0: (LowPart : DWORD;

-                                #              HighPart : LONG);

-                                #          1: (QuadPart : LONGLONG);

-                                #       end;     ULARGE_INTEGER = record

-                                #        case byte of

-                                #          0: (LowPart : DWORD;

-                                #              HighPart : DWORD);

-                                #          1: (QuadPart : LONGLONG);

-                                #       end;

-                                #

-  LARGE_INTEGER* = int64

-  ULARGE_INTEGER* = int64

-  PLARGE_INTEGER* = ptr LARGE_INTEGER

-  PULARGE_INTEGER* = ptr ULARGE_INTEGER

-  DISK_GEOMETRY* {.final, pure.} = object

-    Cylinders*: LARGE_INTEGER

-    MediaType*: MEDIA_TYPE

-    TracksPerCylinder*: DWORD

-    SectorsPerTrack*: DWORD

-    BytesPerSector*: DWORD

-

-  PDISKGEOMETRY* = ptr DISK_GEOMETRY

-  DISK_PERFORMANCE* {.final, pure.} = object

-    BytesRead*: LARGE_INTEGER

-    BytesWritten*: LARGE_INTEGER

-    ReadTime*: LARGE_INTEGER

-    WriteTime*: LARGE_INTEGER

-    ReadCount*: DWORD

-    WriteCount*: DWORD

-    QueueDepth*: DWORD

-

-  PDISKPERFORMANCE* = ptr DISK_PERFORMANCE

-  DLGITEMTEMPLATE* {.final, pure.} = object

-    style*: DWORD

-    dwExtendedStyle*: DWORD

-    x*: int16

-    y*: int16

-    cx*: int16

-    cy*: int16

-    id*: int16

-

-  LPDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE

-  PDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE

-  DLGTEMPLATE* {.final, pure.} = object

-    style*: DWORD

-    dwExtendedStyle*: DWORD

-    cdit*: int16

-    x*: int16

-    y*: int16

-    cx*: int16

-    cy*: int16

-

-  LPDLGTEMPLATE* = ptr DLGTEMPLATE

-  LPCDLGTEMPLATE* = ptr DLGTEMPLATE

-  PDLGTEMPLATE* = ptr DLGTEMPLATE

-  DOC_INFO_1* {.final, pure.} = object

-    pDocName*: LPTSTR

-    pOutputFile*: LPTSTR

-    pDatatype*: LPTSTR

-

-  PDOCINFO1* = ptr DOC_INFO_1

-  DOC_INFO_2* {.final, pure.} = object

-    pDocName*: LPTSTR

-    pOutputFile*: LPTSTR

-    pDatatype*: LPTSTR

-    dwMode*: DWORD

-    JobId*: DWORD

-

-  PDOCINFO2* = ptr DOC_INFO_2

-  DOCINFO* {.final, pure.} = object

-    cbSize*: int32

-    lpszDocName*: LPCTSTR

-    lpszOutput*: LPCTSTR

-    lpszDatatype*: LPCTSTR

-    fwType*: DWORD

-

-  PDOCINFO* = ptr DOCINFO

-  DRAGLISTINFO* {.final, pure.} = object

-    uNotification*: WINUINT

-    hWnd*: HWND

-    ptCursor*: POINT

-

-  LPDRAGLISTINFO* = ptr DRAGLISTINFO

-  PDRAGLISTINFO* = ptr DRAGLISTINFO

-  DRAWITEMSTRUCT* {.final, pure.} = object

-    CtlType*: WINUINT

-    CtlID*: WINUINT

-    itemID*: WINUINT

-    itemAction*: WINUINT

-    itemState*: WINUINT

-    hwndItem*: HWND

-    hDC*: HDC

-    rcItem*: RECT

-    itemData*: ULONG_PTR

-

-  LPDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT

-  PDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT

-  DRAWTEXTPARAMS* {.final, pure.} = object

-    cbSize*: WINUINT

-    iTabLength*: int32

-    iLeftMargin*: int32

-    iRightMargin*: int32

-    uiLengthDrawn*: WINUINT

-

-  LPDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS

-  PDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS

-  PARTITION_INFORMATION* {.final, pure.} = object

-    PartitionType*: int8

-    BootIndicator*: bool

-    RecognizedPartition*: bool

-    RewritePartition*: bool

-    StartingOffset*: LARGE_INTEGER

-    PartitionLength*: LARGE_INTEGER

-    HiddenSectors*: LARGE_INTEGER

-

-  PPARTITIONINFORMATION* = ptr PARTITION_INFORMATION

-  DRIVE_LAYOUT_INFORMATION* {.final, pure.} = object

-    PartitionCount*: DWORD

-    Signature*: DWORD

-    PartitionEntry*: array[0..0, PARTITION_INFORMATION]

-

-  PDRIVELAYOUTINFORMATION* = ptr DRIVE_LAYOUT_INFORMATION

-  DRIVER_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-

-  PDRIVERINFO1* = ptr DRIVER_INFO_1

-  DRIVER_INFO_2* {.final, pure.} = object

-    cVersion*: DWORD

-    pName*: LPTSTR

-    pEnvironment*: LPTSTR

-    pDriverPath*: LPTSTR

-    pDataFile*: LPTSTR

-    pConfigFile*: LPTSTR

-

-  PDRIVERINFO2* = ptr DRIVER_INFO_2

-  DRIVER_INFO_3* {.final, pure.} = object

-    cVersion*: DWORD

-    pName*: LPTSTR

-    pEnvironment*: LPTSTR

-    pDriverPath*: LPTSTR

-    pDataFile*: LPTSTR

-    pConfigFile*: LPTSTR

-    pHelpFile*: LPTSTR

-    pDependentFiles*: LPTSTR

-    pMonitorName*: LPTSTR

-    pDefaultDataType*: LPTSTR

-

-  PDRIVERINFO3* = ptr DRIVER_INFO_3

-  EDITSTREAM* {.final, pure.} = object

-    dwCookie*: DWORD

-    dwError*: DWORD

-    pfnCallback*: EDITSTREAMCALLBACK

-

-  Peditstream* = ptr EDITSTREAM

-  EMR* {.final, pure.} = object

-    iType*: DWORD

-    nSize*: DWORD

-

-  PEMR* = ptr EMR

-  EMRANGLEARC* {.final, pure.} = object

-    emr*: EMR

-    ptlCenter*: POINTL

-    nRadius*: DWORD

-    eStartAngle*: float32

-    eSweepAngle*: float32

-

-  PEMRANGLEARC* = ptr EMRANGLEARC

-  EMRARC* {.final, pure.} = object

-    emr*: EMR

-    rclBox*: RECTL

-    ptlStart*: POINTL

-    ptlEnd*: POINTL

-

-  PEMRARC* = ptr EMRARC

-  EMRARCTO* = EMRARC

-  PEMRARCTO* = ptr EMRARC

-  EMRCHORD* = EMRARC

-  PEMRCHORD* = ptr EMRARC

-  EMRPIE* = EMRARC

-  PEMRPIE* = ptr EMRARC

-  XFORM* {.final, pure.} = object

-    eM11*: float32

-    eM12*: float32

-    eM21*: float32

-    eM22*: float32

-    eDx*: float32

-    eDy*: float32

-

-  LPXFORM* = ptr XFORM

-  PXFORM* = ptr XFORM

-  EMRBITBLT* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    xDest*: LONG

-    yDest*: LONG

-    cxDest*: LONG

-    cyDest*: LONG

-    dwRop*: DWORD

-    xSrc*: LONG

-    ySrc*: LONG

-    xformSrc*: XFORM

-    crBkColorSrc*: COLORREF

-    iUsageSrc*: DWORD

-    offBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-

-  PEMRBITBLT* = ptr EMRBITBLT

-  LOGBRUSH* {.final, pure.} = object

-    lbStyle*: WINUINT

-    lbColor*: COLORREF

-    lbHatch*: LONG

-

-  PLOGBRUSH* = ptr LOGBRUSH

-  EMRCREATEBRUSHINDIRECT* {.final, pure.} = object

-    emr*: EMR

-    ihBrush*: DWORD

-    lb*: LOGBRUSH

-

-  PEMRCREATEBRUSHINDIRECT* = ptr EMRCREATEBRUSHINDIRECT

-  LCSCSTYPE* = LONG

-  LCSGAMUTMATCH* = LONG

-  LOGCOLORSPACE* {.final, pure.} = object

-    lcsSignature*: DWORD

-    lcsVersion*: DWORD

-    lcsSize*: DWORD

-    lcsCSType*: LCSCSTYPE

-    lcsIntent*: LCSGAMUTMATCH

-    lcsEndpoints*: CIEXYZTRIPLE

-    lcsGammaRed*: DWORD

-    lcsGammaGreen*: DWORD

-    lcsGammaBlue*: DWORD

-    lcsFilename*: array[0..(MAX_PATH) - 1, CHAR]

-

-  LPLOGCOLORSPACE* = ptr LOGCOLORSPACE

-  PLOGCOLORSPACE* = ptr LOGCOLORSPACE

-  EMRCREATECOLORSPACE* {.final, pure.} = object

-    emr*: EMR

-    ihCS*: DWORD

-    lcs*: LOGCOLORSPACE

-

-  PEMRCREATECOLORSPACE* = ptr EMRCREATECOLORSPACE

-  EMRCREATEDIBPATTERNBRUSHPT* {.final, pure.} = object

-    emr*: EMR

-    ihBrush*: DWORD

-    iUsage*: DWORD

-    offBmi*: DWORD

-    cbBmi*: DWORD

-    offBits*: DWORD

-    cbBits*: DWORD

-

-  PEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT

-  EMRCREATEMONOBRUSH* {.final, pure.} = object

-    emr*: EMR

-    ihBrush*: DWORD

-    iUsage*: DWORD

-    offBmi*: DWORD

-    cbBmi*: DWORD

-    offBits*: DWORD

-    cbBits*: DWORD

-

-  PEMRCREATEMONOBRUSH* = ptr EMRCREATEMONOBRUSH

-  PALETTEENTRY* {.final, pure.} = object

-    peRed*: int8

-    peGreen*: int8

-    peBlue*: int8

-    peFlags*: int8

-

-  LPPALETTEENTRY* = ptr PALETTEENTRY

-  PPALETTEENTRY* = ptr PALETTEENTRY

-  LOGPALETTE* {.final, pure.} = object

-    palVersion*: int16

-    palNumEntries*: int16

-    palPalEntry*: array[0..0, PALETTEENTRY]

-

-  LPLOGPALETTE* = ptr LOGPALETTE

-  NPLOGPALETTE* = ptr LOGPALETTE

-  PLOGPALETTE* = ptr LOGPALETTE

-  EMRCREATEPALETTE* {.final, pure.} = object

-    emr*: EMR

-    ihPal*: DWORD

-    lgpl*: LOGPALETTE

-

-  PEMRCREATEPALETTE* = ptr EMRCREATEPALETTE

-  LOGPEN* {.final, pure.} = object

-    lopnStyle*: WINUINT

-    lopnWidth*: POINT

-    lopnColor*: COLORREF

-

-  PLOGPEN* = ptr LOGPEN

-  EMRCREATEPEN* {.final, pure.} = object

-    emr*: EMR

-    ihPen*: DWORD

-    lopn*: LOGPEN

-

-  PEMRCREATEPEN* = ptr EMRCREATEPEN

-  EMRELLIPSE* {.final, pure.} = object

-    emr*: EMR

-    rclBox*: RECTL

-

-  PEMRELLIPSE* = ptr EMRELLIPSE

-  EMRRECTANGLE* = EMRELLIPSE

-  PEMRRECTANGLE* = ptr EMRELLIPSE

-  EMREOF* {.final, pure.} = object

-    emr*: EMR

-    nPalEntries*: DWORD

-    offPalEntries*: DWORD

-    nSizeLast*: DWORD

-

-  PEMREOF* = ptr EMREOF

-  EMREXCLUDECLIPRECT* {.final, pure.} = object

-    emr*: EMR

-    rclClip*: RECTL

-

-  PEMREXCLUDECLIPRECT* = ptr EMREXCLUDECLIPRECT

-  EMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT

-  PEMRINTERSECTCLIPRECT* = ptr EMREXCLUDECLIPRECT

-  PANOSE* {.final, pure.} = object

-    bFamilyType*: int8

-    bSerifStyle*: int8

-    bWeight*: int8

-    bProportion*: int8

-    bContrast*: int8

-    bStrokeVariation*: int8

-    bArmStyle*: int8

-    bLetterform*: int8

-    bMidline*: int8

-    bXHeight*: int8

-

-  PPANOSE* = ptr PANOSE

-  EXTLOGFONT* {.final, pure.} = object

-    elfLogFont*: LOGFONT

-    elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR]

-    elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR]

-    elfVersion*: DWORD

-    elfStyleSize*: DWORD

-    elfMatch*: DWORD

-    elfReserved*: DWORD

-    elfVendorId*: array[0..(ELF_VENDOR_SIZE) - 1, int8]

-    elfCulture*: DWORD

-    elfPanose*: PANOSE

-

-  PEXTLOGFONT* = ptr EXTLOGFONT

-  EMREXTCREATEFONTINDIRECTW* {.final, pure.} = object

-    emr*: EMR

-    ihFont*: DWORD

-    elfw*: EXTLOGFONT

-

-  PEMREXTCREATEFONTINDIRECTW* = ptr EMREXTCREATEFONTINDIRECTW

-  EXTLOGPEN* {.final, pure.} = object

-    elpPenStyle*: WINUINT

-    elpWidth*: WINUINT

-    elpBrushStyle*: WINUINT

-    elpColor*: COLORREF

-    elpHatch*: LONG

-    elpNumEntries*: DWORD

-    elpStyleEntry*: array[0..0, DWORD]

-

-  PEXTLOGPEN* = ptr EXTLOGPEN

-  EMREXTCREATEPEN* {.final, pure.} = object

-    emr*: EMR

-    ihPen*: DWORD

-    offBmi*: DWORD

-    cbBmi*: DWORD

-    offBits*: DWORD

-    cbBits*: DWORD

-    elp*: EXTLOGPEN

-

-  PEMREXTCREATEPEN* = ptr EMREXTCREATEPEN

-  EMREXTFLOODFILL* {.final, pure.} = object

-    emr*: EMR

-    ptlStart*: POINTL

-    crColor*: COLORREF

-    iMode*: DWORD

-

-  PEMREXTFLOODFILL* = ptr EMREXTFLOODFILL

-  EMREXTSELECTCLIPRGN* {.final, pure.} = object

-    emr*: EMR

-    cbRgnData*: DWORD

-    iMode*: DWORD

-    RgnData*: array[0..0, int8]

-

-  PEMREXTSELECTCLIPRGN* = ptr EMREXTSELECTCLIPRGN

-  EMRTEXT* {.final, pure.} = object

-    ptlReference*: POINTL

-    nChars*: DWORD

-    offString*: DWORD

-    fOptions*: DWORD

-    rcl*: RECTL

-    offDx*: DWORD

-

-  PEMRTEXT* = ptr EMRTEXT

-  EMREXTTEXTOUTA* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    iGraphicsMode*: DWORD

-    exScale*: float32

-    eyScale*: float32

-    emrtext*: EMRTEXT

-

-  PEMREXTTEXTOUTA* = ptr EMREXTTEXTOUTA

-  EMREXTTEXTOUTW* = EMREXTTEXTOUTA

-  PEMREXTTEXTOUTW* = ptr EMREXTTEXTOUTA

-  EMRFILLPATH* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-

-  PEMRFILLPATH* = ptr EMRFILLPATH

-  EMRSTROKEANDFILLPATH* = EMRFILLPATH

-  PEMRSTROKEANDFILLPATH* = ptr EMRFILLPATH

-  EMRSTROKEPATH* = EMRFILLPATH

-  PEMRSTROKEPATH* = ptr EMRFILLPATH

-  EMRFILLRGN* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cbRgnData*: DWORD

-    ihBrush*: DWORD

-    RgnData*: array[0..0, int8]

-

-  PEMRFILLRGN* = ptr EMRFILLRGN

-  EMRFORMAT* {.final, pure.} = object

-    dSignature*: DWORD

-    nVersion*: DWORD

-    cbData*: DWORD

-    offData*: DWORD

-

-  PEMRFORMAT* = ptr EMRFORMAT

-

-  EMRFRAMERGN* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cbRgnData*: DWORD

-    ihBrush*: DWORD

-    szlStroke*: SIZEL

-    RgnData*: array[0..0, int8]

-

-  PEMRFRAMERGN* = ptr EMRFRAMERGN

-  EMRGDICOMMENT* {.final, pure.} = object

-    emr*: EMR

-    cbData*: DWORD

-    Data*: array[0..0, int8]

-

-  PEMRGDICOMMENT* = ptr EMRGDICOMMENT

-  EMRINVERTRGN* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cbRgnData*: DWORD

-    RgnData*: array[0..0, int8]

-

-  PEMRINVERTRGN* = ptr EMRINVERTRGN

-  EMRPAINTRGN* = EMRINVERTRGN

-  PEMRPAINTRGN* = ptr EMRINVERTRGN

-  EMRLINETO* {.final, pure.} = object

-    emr*: EMR

-    ptl*: POINTL

-

-  PEMRLINETO* = ptr EMRLINETO

-  EMRMOVETOEX* = EMRLINETO

-  PEMRMOVETOEX* = ptr EMRLINETO

-  EMRMASKBLT* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    xDest*: LONG

-    yDest*: LONG

-    cxDest*: LONG

-    cyDest*: LONG

-    dwRop*: DWORD

-    xSrc*: LONG

-    ySrc*: LONG

-    xformSrc*: XFORM

-    crBkColorSrc*: COLORREF

-    iUsageSrc*: DWORD

-    offBmiSrc*: DWORD

-    cbBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-    xMask*: LONG

-    yMask*: LONG

-    iUsageMask*: DWORD

-    offBmiMask*: DWORD

-    cbBmiMask*: DWORD

-    offBitsMask*: DWORD

-    cbBitsMask*: DWORD

-

-  PEMRMASKBLT* = ptr EMRMASKBLT

-  EMRMODIFYWORLDTRANSFORM* {.final, pure.} = object

-    emr*: EMR

-    xform*: XFORM

-    iMode*: DWORD

-

-  PEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM

-  EMROFFSETCLIPRGN* {.final, pure.} = object

-    emr*: EMR

-    ptlOffset*: POINTL

-

-  PEMROFFSETCLIPRGN* = ptr EMROFFSETCLIPRGN

-  EMRPLGBLT* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    aptlDest*: array[0..2, POINTL]

-    xSrc*: LONG

-    ySrc*: LONG

-    cxSrc*: LONG

-    cySrc*: LONG

-    xformSrc*: XFORM

-    crBkColorSrc*: COLORREF

-    iUsageSrc*: DWORD

-    offBmiSrc*: DWORD

-    cbBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-    xMask*: LONG

-    yMask*: LONG

-    iUsageMask*: DWORD

-    offBmiMask*: DWORD

-    cbBmiMask*: DWORD

-    offBitsMask*: DWORD

-    cbBitsMask*: DWORD

-

-  PEMRPLGBLT* = ptr EMRPLGBLT

-  EMRPOLYDRAW* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cptl*: DWORD

-    aptl*: array[0..0, POINTL]

-    abTypes*: array[0..0, int8]

-

-  PEMRPOLYDRAW* = ptr EMRPOLYDRAW

-  EMRPOLYDRAW16* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cpts*: DWORD

-    apts*: array[0..0, POINTS]

-    abTypes*: array[0..0, int8]

-

-  PEMRPOLYDRAW16* = ptr EMRPOLYDRAW16

-  EMRPOLYLINE* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cptl*: DWORD

-    aptl*: array[0..0, POINTL]

-

-  PEMRPOLYLINE* = ptr EMRPOLYLINE

-  EMRPOLYBEZIER* = EMRPOLYLINE

-  PEMRPOLYBEZIER* = ptr EMRPOLYLINE

-  EMRPOLYGON* = EMRPOLYLINE

-  PEMRPOLYGON* = ptr EMRPOLYLINE

-  EMRPOLYBEZIERTO* = EMRPOLYLINE

-  PEMRPOLYBEZIERTO* = ptr EMRPOLYLINE

-  EMRPOLYLINETO* = EMRPOLYLINE

-  PEMRPOLYLINETO* = ptr EMRPOLYLINE

-  EMRPOLYLINE16* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    cpts*: DWORD

-    apts*: array[0..0, POINTL]

-

-  PEMRPOLYLINE16* = ptr EMRPOLYLINE16

-  EMRPOLYBEZIER16* = EMRPOLYLINE16

-  PEMRPOLYBEZIER16* = ptr EMRPOLYLINE16

-  EMRPOLYGON16* = EMRPOLYLINE16

-  PEMRPOLYGON16* = ptr EMRPOLYLINE16

-  EMRPOLYBEZIERTO16* = EMRPOLYLINE16

-  PEMRPOLYBEZIERTO16* = ptr EMRPOLYLINE16

-  EMRPOLYLINETO16* = EMRPOLYLINE16

-  PEMRPOLYLINETO16* = ptr EMRPOLYLINE16

-  EMRPOLYPOLYLINE* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    nPolys*: DWORD

-    cptl*: DWORD

-    aPolyCounts*: array[0..0, DWORD]

-    aptl*: array[0..0, POINTL]

-

-  PEMRPOLYPOLYLINE* = ptr EMRPOLYPOLYLINE

-  EMRPOLYPOLYGON* = EMRPOLYPOLYLINE

-  PEMRPOLYPOLYGON* = ptr EMRPOLYPOLYLINE

-  EMRPOLYPOLYLINE16* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    nPolys*: DWORD

-    cpts*: DWORD

-    aPolyCounts*: array[0..0, DWORD]

-    apts*: array[0..0, POINTS]

-

-  PEMRPOLYPOLYLINE16* = ptr EMRPOLYPOLYLINE16

-  EMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16

-  PEMRPOLYPOLYGON16* = ptr EMRPOLYPOLYLINE16

-  EMRPOLYTEXTOUTA* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    iGraphicsMode*: DWORD

-    exScale*: float32

-    eyScale*: float32

-    cStrings*: LONG

-    aemrtext*: array[0..0, EMRTEXT]

-

-  PEMRPOLYTEXTOUTA* = ptr EMRPOLYTEXTOUTA

-  EMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA

-  PEMRPOLYTEXTOUTW* = ptr EMRPOLYTEXTOUTA

-  EMRRESIZEPALETTE* {.final, pure.} = object

-    emr*: EMR

-    ihPal*: DWORD

-    cEntries*: DWORD

-

-  PEMRRESIZEPALETTE* = ptr EMRRESIZEPALETTE

-  EMRRESTOREDC* {.final, pure.} = object

-    emr*: EMR

-    iRelative*: LONG

-

-  PEMRRESTOREDC* = ptr EMRRESTOREDC

-  EMRROUNDRECT* {.final, pure.} = object

-    emr*: EMR

-    rclBox*: RECTL

-    szlCorner*: SIZEL

-

-  PEMRROUNDRECT* = ptr EMRROUNDRECT

-  EMRSCALEVIEWPORTEXTEX* {.final, pure.} = object

-    emr*: EMR

-    xNum*: LONG

-    xDenom*: LONG

-    yNum*: LONG

-    yDenom*: LONG

-

-  PEMRSCALEVIEWPORTEXTEX* = ptr EMRSCALEVIEWPORTEXTEX

-  EMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX

-  PEMRSCALEWINDOWEXTEX* = ptr EMRSCALEVIEWPORTEXTEX

-  EMRSELECTCOLORSPACE* {.final, pure.} = object

-    emr*: EMR

-

-    ihCS*: DWORD

-

-  PEMRSELECTCOLORSPACE* = ptr EMRSELECTCOLORSPACE

-  EMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE

-  PEMRDELETECOLORSPACE* = ptr EMRSELECTCOLORSPACE

-  EMRSELECTOBJECT* {.final, pure.} = object

-    emr*: EMR

-    ihObject*: DWORD

-

-  PEMRSELECTOBJECT* = ptr EMRSELECTOBJECT

-  EMRDELETEOBJECT* = EMRSELECTOBJECT

-  PEMRDELETEOBJECT* = ptr EMRSELECTOBJECT

-  EMRSELECTPALETTE* {.final, pure.} = object

-    emr*: EMR

-    ihPal*: DWORD

-

-  PEMRSELECTPALETTE* = ptr EMRSELECTPALETTE

-  EMRSETARCDIRECTION* {.final, pure.} = object

-    emr*: EMR

-    iArcDirection*: DWORD

-

-  PEMRSETARCDIRECTION* = ptr EMRSETARCDIRECTION

-  EMRSETBKCOLOR* {.final, pure.} = object

-    emr*: EMR

-    crColor*: COLORREF

-

-  PEMRSETBKCOLOR* = ptr EMRSETBKCOLOR

-  EMRSETTEXTCOLOR* = EMRSETBKCOLOR

-  PEMRSETTEXTCOLOR* = ptr EMRSETBKCOLOR

-  EMRSETCOLORADJUSTMENT* {.final, pure.} = object

-    emr*: EMR

-    ColorAdjustment*: COLORADJUSTMENT

-

-  PEMRSETCOLORADJUSTMENT* = ptr EMRSETCOLORADJUSTMENT

-  EMRSETDIBITSTODEVICE* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    xDest*: LONG

-    yDest*: LONG

-    xSrc*: LONG

-    ySrc*: LONG

-    cxSrc*: LONG

-    cySrc*: LONG

-    offBmiSrc*: DWORD

-    cbBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-    iUsageSrc*: DWORD

-    iStartScan*: DWORD

-    cScans*: DWORD

-

-  PEMRSETDIBITSTODEVICE* = ptr EMRSETDIBITSTODEVICE

-  EMRSETMAPPERFLAGS* {.final, pure.} = object

-    emr*: EMR

-    dwFlags*: DWORD

-

-  PEMRSETMAPPERFLAGS* = ptr EMRSETMAPPERFLAGS

-  EMRSETMITERLIMIT* {.final, pure.} = object

-    emr*: EMR

-    eMiterLimit*: float32

-

-  PEMRSETMITERLIMIT* = ptr EMRSETMITERLIMIT

-  EMRSETPALETTEENTRIES* {.final, pure.} = object

-    emr*: EMR

-    ihPal*: DWORD

-    iStart*: DWORD

-    cEntries*: DWORD

-    aPalEntries*: array[0..0, PALETTEENTRY]

-

-  PEMRSETPALETTEENTRIES* = ptr EMRSETPALETTEENTRIES

-  EMRSETPIXELV* {.final, pure.} = object

-    emr*: EMR

-    ptlPixel*: POINTL

-    crColor*: COLORREF

-

-  PEMRSETPIXELV* = ptr EMRSETPIXELV

-  EMRSETVIEWPORTEXTEX* {.final, pure.} = object

-    emr*: EMR

-    szlExtent*: SIZEL

-

-  PEMRSETVIEWPORTEXTEX* = ptr EMRSETVIEWPORTEXTEX

-  EMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX

-  PEMRSETWINDOWEXTEX* = ptr EMRSETVIEWPORTEXTEX

-  EMRSETVIEWPORTORGEX* {.final, pure.} = object

-    emr*: EMR

-    ptlOrigin*: POINTL

-

-  PEMRSETVIEWPORTORGEX* = ptr EMRSETVIEWPORTORGEX

-  EMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX

-  PEMRSETWINDOWORGEX* = ptr EMRSETVIEWPORTORGEX

-  EMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX

-  PEMRSETBRUSHORGEX* = ptr EMRSETVIEWPORTORGEX

-  EMRSETWORLDTRANSFORM* {.final, pure.} = object

-    emr*: EMR

-    xform*: XFORM

-

-  PEMRSETWORLDTRANSFORM* = ptr EMRSETWORLDTRANSFORM

-  EMRSTRETCHBLT* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    xDest*: LONG

-    yDest*: LONG

-    cxDest*: LONG

-    cyDest*: LONG

-    dwRop*: DWORD

-    xSrc*: LONG

-    ySrc*: LONG

-    xformSrc*: XFORM

-    crBkColorSrc*: COLORREF

-    iUsageSrc*: DWORD

-    offBmiSrc*: DWORD

-    cbBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-    cxSrc*: LONG

-    cySrc*: LONG

-

-  PEMRSTRETCHBLT* = ptr EMRSTRETCHBLT

-  EMRSTRETCHDIBITS* {.final, pure.} = object

-    emr*: EMR

-    rclBounds*: RECTL

-    xDest*: LONG

-    yDest*: LONG

-    xSrc*: LONG

-    ySrc*: LONG

-    cxSrc*: LONG

-    cySrc*: LONG

-    offBmiSrc*: DWORD

-    cbBmiSrc*: DWORD

-    offBitsSrc*: DWORD

-    cbBitsSrc*: DWORD

-    iUsageSrc*: DWORD

-    dwRop*: DWORD

-    cxDest*: LONG

-    cyDest*: LONG

-

-  PEMRSTRETCHDIBITS* = ptr EMRSTRETCHDIBITS

-  EMRABORTPATH* {.final, pure.} = object

-    emr*: EMR

-

-  PEMRABORTPATH* = ptr EMRABORTPATH

-  EMRBEGINPATH* = EMRABORTPATH

-  PEMRBEGINPATH* = ptr EMRABORTPATH

-  EMRENDPATH* = EMRABORTPATH

-  PEMRENDPATH* = ptr EMRABORTPATH

-  EMRCLOSEFIGURE* = EMRABORTPATH

-  PEMRCLOSEFIGURE* = ptr EMRABORTPATH

-  EMRFLATTENPATH* = EMRABORTPATH

-  PEMRFLATTENPATH* = ptr EMRABORTPATH

-  EMRWIDENPATH* = EMRABORTPATH

-  PEMRWIDENPATH* = ptr EMRABORTPATH

-  EMRSETMETARGN* = EMRABORTPATH

-  PEMRSETMETARGN* = ptr EMRABORTPATH

-  EMRSAVEDC* = EMRABORTPATH

-  PEMRSAVEDC* = ptr EMRABORTPATH

-  EMRREALIZEPALETTE* = EMRABORTPATH

-  PEMRREALIZEPALETTE* = ptr EMRABORTPATH

-  EMRSELECTCLIPPATH* {.final, pure.} = object

-    emr*: EMR

-    iMode*: DWORD

-

-  PEMRSELECTCLIPPATH* = ptr EMRSELECTCLIPPATH

-  EMRSETBKMODE* = EMRSELECTCLIPPATH

-  PEMRSETBKMODE* = ptr EMRSELECTCLIPPATH

-  EMRSETMAPMODE* = EMRSELECTCLIPPATH

-  PEMRSETMAPMODE* = ptr EMRSELECTCLIPPATH

-  EMRSETPOLYFILLMODE* = EMRSELECTCLIPPATH

-  PEMRSETPOLYFILLMODE* = ptr EMRSELECTCLIPPATH

-  EMRSETROP2* = EMRSELECTCLIPPATH

-  PEMRSETROP2* = ptr EMRSELECTCLIPPATH

-  EMRSETSTRETCHBLTMODE* = EMRSELECTCLIPPATH

-  PEMRSETSTRETCHBLTMODE* = ptr EMRSELECTCLIPPATH

-  EMRSETTEXTALIGN* = EMRSELECTCLIPPATH

-  PEMRSETTEXTALIGN* = ptr EMRSELECTCLIPPATH

-  EMRENABLEICM* = EMRSELECTCLIPPATH

-  PEMRENABLEICM* = ptr EMRSELECTCLIPPATH

-  NMHDR* {.final, pure.} = object

-    hwndFrom*: HWND

-    idFrom*: WINUINT

-    code*: WINUINT

-

-  PNMHDR* = ptr NMHDR

-  TENCORRECTTEXT* {.final, pure.} = object # Name conflict if we drop the `T`

-    nmhdr*: NMHDR

-    chrg*: CHARRANGE

-    seltyp*: int16

-

-  Pencorrecttext* = ptr TENCORRECTTEXT

-  TENDROPFILES* {.final, pure.} = object # Name conflict if we drop the `T`

-    nmhdr*: NMHDR

-    hDrop*: HANDLE

-    cp*: LONG

-    fProtected*: WINBOOL

-

-  Pendropfiles* = ptr TENDROPFILES

-  TENSAVECLIPBOARD* {.final, pure.} = object # Name conflict if we drop the `T`

-    nmhdr*: NMHDR

-    cObjectCount*: LONG

-    cch*: LONG

-

-  PENSAVECLIPBOARD* = ptr TENSAVECLIPBOARD

-  TENOLEOPFAILED* {.final, pure.} = object # Name conflict if we drop the `T`

-    nmhdr*: NMHDR

-    iob*: LONG

-    lOper*: LONG

-    hr*: HRESULT

-

-  PENOLEOPFAILED* = ptr TENOLEOPFAILED

-  ENHMETAHEADER* {.final, pure.} = object

-    iType*: DWORD

-    nSize*: DWORD

-    rclBounds*: RECTL

-    rclFrame*: RECTL

-    dSignature*: DWORD

-    nVersion*: DWORD

-    nBytes*: DWORD

-    nRecords*: DWORD

-    nHandles*: int16

-    sReserved*: int16

-    nDescription*: DWORD

-    offDescription*: DWORD

-    nPalEntries*: DWORD

-    szlDevice*: SIZEL

-    szlMillimeters*: SIZEL

-

-  LPENHMETAHEADER* = ptr ENHMETAHEADER

-  PENHMETAHEADER* = ptr ENHMETAHEADER

-  ENHMETARECORD* {.final, pure.} = object

-    iType*: DWORD

-    nSize*: DWORD

-    dParm*: array[0..0, DWORD]

-

-  LPENHMETARECORD* = ptr ENHMETARECORD

-  PENHMETARECORD* = ptr ENHMETARECORD

-  TENPROTECTED* {.final, pure.} = object # Name conflict if we drop the `T`

-    nmhdr*: NMHDR

-    msg*: WINUINT

-    wParam*: WPARAM

-    lParam*: LPARAM

-    chrg*: CHARRANGE

-

-  Penprotected* = ptr TENPROTECTED

-  SERVICE_STATUS* {.final, pure.} = object

-    dwServiceType*: DWORD

-    dwCurrentState*: DWORD

-    dwControlsAccepted*: DWORD

-    dwWin32ExitCode*: DWORD

-    dwServiceSpecificExitCode*: DWORD

-    dwCheckPoint*: DWORD

-    dwWaitHint*: DWORD

-

-  LPSERVICE_STATUS* = ptr SERVICE_STATUS

-  PSERVICESTATUS* = ptr SERVICE_STATUS

-  ENUM_SERVICE_STATUS* {.final, pure.} = object

-    lpServiceName*: LPTSTR

-    lpDisplayName*: LPTSTR

-    ServiceStatus*: SERVICE_STATUS

-

-  LPENUM_SERVICE_STATUS* = ptr ENUM_SERVICE_STATUS

-  PENUMSERVICESTATUS* = ptr ENUM_SERVICE_STATUS

-  ENUMLOGFONT* {.final, pure.} = object

-    elfLogFont*: LOGFONT

-    elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR]

-    elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR]

-

-  PENUMLOGFONT* = ptr ENUMLOGFONT

-  ENUMLOGFONTEX* {.final, pure.} = object

-    elfLogFont*: LOGFONT

-    elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR]

-    elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR]

-    elfScript*: array[0..(LF_FACESIZE) - 1, BCHAR]

-

-  PENUMLOGFONTEX* = ptr ENUMLOGFONTEX

-

-  EVENTLOGRECORD* {.final, pure.} = object

-    Length*: DWORD

-    Reserved*: DWORD

-    RecordNumber*: DWORD

-    TimeGenerated*: DWORD

-    TimeWritten*: DWORD

-    EventID*: DWORD

-    EventType*: int16

-    NumStrings*: int16

-    EventCategory*: int16

-    ReservedFlags*: int16

-    ClosingRecordNumber*: DWORD

-    StringOffset*: DWORD

-    UserSidLength*: DWORD

-    UserSidOffset*: DWORD

-    DataLength*: DWORD

-    DataOffset*: DWORD

-

-  PEVENTLOGRECORD* = ptr EVENTLOGRECORD

-  EVENTMSG* {.final, pure.} = object

-    message*: WINUINT

-    paramL*: WINUINT

-    paramH*: WINUINT

-    time*: DWORD

-    hwnd*: HWND

-

-  PEVENTMSG* = ptr EVENTMSG

-  EXCEPTION_POINTERS* {.final, pure.} = object

-    ExceptionRecord*: PEXCEPTION_RECORD

-    ContextRecord*: PCONTEXT

-

-  LPEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS

-  PEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS

-  EXT_BUTTON* {.final, pure.} = object

-    idCommand*: int16

-    idsHelp*: int16

-    fsStyle*: int16

-

-  LPEXT_BUTTON* = ptr EXT_BUTTON

-  PEXTBUTTON* = ptr EXT_BUTTON

-  FILTERKEYS* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwFlags*: DWORD

-    iWaitMSec*: DWORD

-    iDelayMSec*: DWORD

-    iRepeatMSec*: DWORD

-    iBounceMSec*: DWORD

-

-  PFILTERKEYS* = ptr FILTERKEYS

-  FIND_NAME_BUFFER* {.final, pure.} = object

-    len*: UCHAR

-    access_control*: UCHAR

-    frame_control*: UCHAR

-    destination_addr*: array[0..5, UCHAR]

-    source_addr*: array[0..5, UCHAR]

-    routing_info*: array[0..17, UCHAR]

-

-  PFINDNAMEBUFFER* = ptr FIND_NAME_BUFFER

-  FIND_NAME_HEADER* {.final, pure.} = object

-    node_count*: int16

-    reserved*: UCHAR

-    unique_group*: UCHAR

-

-  PFINDNAMEHEADER* = ptr FIND_NAME_HEADER

-  FINDREPLACE* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hInstance*: HINST

-    Flags*: DWORD

-    lpstrFindWhat*: LPTSTR

-    lpstrReplaceWith*: LPTSTR

-    wFindWhatLen*: int16

-    wReplaceWithLen*: int16

-    lCustData*: LPARAM

-    lpfnHook*: LPFRHOOKPROC

-    lpTemplateName*: LPCTSTR

-

-  LPFINDREPLACE* = ptr FINDREPLACE

-  PFINDREPLACE* = ptr FINDREPLACE

-  #FINDTEXT = record conflicts with FindText function

-  TFINDTEXT* {.final, pure.} = object

-    chrg*: CHARRANGE

-    lpstrText*: LPSTR

-

-  Pfindtext* = ptr TFINDTEXT

-  FINDTEXTEX* {.final, pure.} = object

-    chrg*: CHARRANGE

-    lpstrText*: LPSTR

-    chrgText*: CHARRANGE

-

-  Pfindtextex* = ptr FINDTEXTEX

-  FMS_GETDRIVEINFO* {.final, pure.} = object

-    dwTotalSpace*: DWORD

-    dwFreeSpace*: DWORD

-    szPath*: array[0..259, CHAR]

-    szVolume*: array[0..13, CHAR]

-    szShare*: array[0..127, CHAR]

-

-  PFMSGETDRIVEINFO* = ptr FMS_GETDRIVEINFO

-  FMS_GETFILESEL* {.final, pure.} = object

-    ftTime*: FILETIME

-    dwSize*: DWORD

-    bAttr*: int8

-    szName*: array[0..259, CHAR]

-

-  PFMSGETFILESEL* = ptr FMS_GETFILESEL

-  FMS_LOAD* {.final, pure.} = object

-    dwSize*: DWORD

-    szMenuName*: array[0..(MENU_TEXT_LEN) - 1, CHAR]

-    hMenu*: HMENU

-    wMenuDelta*: WINUINT

-

-  PFMSLOAD* = ptr FMS_LOAD

-  FMS_TOOLBARLOAD* {.final, pure.} = object

-    dwSize*: DWORD

-    lpButtons*: LPEXT_BUTTON

-    cButtons*: int16

-    cBitmaps*: int16

-    idBitmap*: int16

-    hBitmap*: HBITMAP

-

-  PFMSTOOLBARLOAD* = ptr FMS_TOOLBARLOAD

-  FOCUS_EVENT_RECORD* {.final, pure.} = object

-    bSetFocus*: WINBOOL

-

-  PFOCUSEVENTRECORD* = ptr FOCUS_EVENT_RECORD

-  FORM_INFO_1* {.final, pure.} = object

-    Flags*: DWORD

-    pName*: LPTSTR

-    Size*: SIZEL

-    ImageableArea*: RECTL

-

-  PFORMINFO1* = ptr FORM_INFO_1

-  FORMAT_PARAMETERS* {.final, pure.} = object

-    MediaType*: MEDIA_TYPE

-    StartCylinderNumber*: DWORD

-    EndCylinderNumber*: DWORD

-    StartHeadNumber*: DWORD

-    EndHeadNumber*: DWORD

-

-  PFORMATPARAMETERS* = ptr FORMAT_PARAMETERS

-  FORMATRANGE* {.final, pure.} = object

-    hdc*: HDC

-    hdcTarget*: HDC

-    rc*: RECT

-    rcPage*: RECT

-    chrg*: CHARRANGE

-

-  Pformatrange* = ptr FORMATRANGE

-  GCP_RESULTS* {.final, pure.} = object

-    lStructSize*: DWORD

-    lpOutString*: LPTSTR

-    lpOrder*: ptr WINUINT

-    lpDx*: ptr WINT

-    lpCaretPos*: ptr WINT

-    lpClass*: LPTSTR

-    lpGlyphs*: ptr WINUINT

-    nGlyphs*: WINUINT

-    nMaxFit*: WINUINT

-

-  LPGCP_RESULTS* = ptr GCP_RESULTS

-  PGCPRESULTS* = ptr GCP_RESULTS

-  GENERIC_MAPPING* {.final, pure.} = object

-    GenericRead*: ACCESS_MASK

-    GenericWrite*: ACCESS_MASK

-    GenericExecute*: ACCESS_MASK

-    GenericAll*: ACCESS_MASK

-

-  PGENERIC_MAPPING* = ptr GENERIC_MAPPING

-  GLYPHMETRICS* {.final, pure.} = object

-    gmBlackBoxX*: WINUINT

-    gmBlackBoxY*: WINUINT

-    gmptGlyphOrigin*: POINT

-    gmCellIncX*: SHORT

-    gmCellIncY*: SHORT

-

-  LPGLYPHMETRICS* = ptr GLYPHMETRICS

-  PGLYPHMETRICS* = ptr GLYPHMETRICS

-  HANDLETABLE* {.final, pure.} = object

-    objectHandle*: array[0..0, HGDIOBJ]

-

-  LPHANDLETABLE* = ptr HANDLETABLE

-  HD_HITTESTINFO* {.final, pure.} = object

-    pt*: POINT

-    flags*: WINUINT

-    iItem*: int32

-

-  PHDHITTESTINFO* = ptr HD_HITTESTINFO

-  HD_ITEM* {.final, pure.} = object

-    mask*: WINUINT

-    cxy*: int32

-    pszText*: LPTSTR

-    hbm*: HBITMAP

-    cchTextMax*: int32

-    fmt*: int32

-    lParam*: LPARAM

-

-  PHDITEM* = ptr HD_ITEM

-  WINDOWPOS* {.final, pure.} = object

-    hwnd*: HWND

-    hwndInsertAfter*: HWND

-    x*: int32

-    y*: int32

-    cx*: int32

-    cy*: int32

-    flags*: WINUINT

-

-  LPWINDOWPOS* = ptr WINDOWPOS

-  PWINDOWPOS* = ptr WINDOWPOS

-  HD_LAYOUT* {.final, pure.} = object

-    prc*: ptr RECT

-    pwpos*: ptr WINDOWPOS

-

-  PHDLAYOUT* = ptr HD_LAYOUT

-  HD_NOTIFY* {.final, pure.} = object

-    hdr*: NMHDR

-    iItem*: int32

-    iButton*: int32

-    pitem*: ptr HD_ITEM

-

-  PHDNOTIFY* = ptr HD_NOTIFY

-  HELPINFO* {.final, pure.} = object

-    cbSize*: WINUINT

-    iContextType*: int32

-    iCtrlId*: int32

-    hItemHandle*: HANDLE

-    dwContextId*: DWORD

-    MousePos*: POINT

-

-  LPHELPINFO* = ptr HELPINFO

-  PHELPINFO* = ptr HELPINFO

-  HELPWININFO* {.final, pure.} = object

-    wStructSize*: int32

-    x*: int32

-    y*: int32

-    dx*: int32

-    dy*: int32

-    wMax*: int32

-    rgchMember*: array[0..1, CHAR]

-

-  PHELPWININFO* = ptr HELPWININFO

-  HIGHCONTRAST* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwFlags*: DWORD

-    lpszDefaultScheme*: LPTSTR

-

-  LPHIGHCONTRAST* = ptr HIGHCONTRAST

-  PHIGHCONTRAST* = ptr HIGHCONTRAST

-  HSZPAIR* {.final, pure.} = object

-    hszSvc*: HSZ

-    hszTopic*: HSZ

-

-  PHSZPAIR* = ptr HSZPAIR

-  ICONINFO* {.final, pure.} = object

-    fIcon*: WINBOOL

-    xHotspot*: DWORD

-    yHotspot*: DWORD

-    hbmMask*: HBITMAP

-    hbmColor*: HBITMAP

-

-  PICONINFO* = ptr ICONINFO

-  ICONMETRICS* {.final, pure.} = object

-    cbSize*: WINUINT

-    iHorzSpacing*: int32

-    iVertSpacing*: int32

-    iTitleWrap*: int32

-    lfFont*: LOGFONT

-

-  LPICONMETRICS* = ptr ICONMETRICS

-  PICONMETRICS* = ptr ICONMETRICS

-  IMAGEINFO* {.final, pure.} = object

-    hbmImage*: HBITMAP

-    hbmMask*: HBITMAP

-    Unused1*: int32

-    Unused2*: int32

-    rcImage*: RECT

-

-  PIMAGEINFO* = ptr IMAGEINFO

-  KEY_EVENT_RECORD* {.final, pure.} = object

-    bKeyDown*: WINBOOL

-    wRepeatCount*: int16

-    wVirtualKeyCode*: int16

-    wVirtualScanCode*: int16

-    UnicodeChar*: WCHAR

-    dwControlKeyState*: DWORD # other union part: AsciiChar: CHAR

-

-  PKEYEVENTRECORD* = ptr KEY_EVENT_RECORD

-  MOUSE_EVENT_RECORD* {.final, pure.} = object

-    dwMousePosition*: COORD

-    dwButtonState*: DWORD

-    dwControlKeyState*: DWORD

-    dwEventFlags*: DWORD

-

-  PMOUSEEVENTRECORD* = ptr MOUSE_EVENT_RECORD

-  WINDOW_BUFFER_SIZE_RECORD* {.final, pure.} = object

-    dwSize*: COORD

-

-  PWINDOWBUFFERSIZERECORD* = ptr WINDOW_BUFFER_SIZE_RECORD

-  MENU_EVENT_RECORD* {.final, pure.} = object

-    dwCommandId*: WINUINT

-

-  PMENU_EVENT_RECORD* = ptr MENU_EVENT_RECORD

-  INPUT_RECORD* {.final, pure.} = object

-    EventType*: int16

-    Reserved*: int16

-    event*: array[0..5, DWORD]

-

-  PINPUT_RECORD* = ptr INPUT_RECORD

-  SYSTEMTIME* {.final, pure.} = object

-    wYear*: int16

-    wMonth*: int16

-    wDayOfWeek*: int16

-    wDay*: int16

-    wHour*: int16

-    wMinute*: int16

-    wSecond*: int16

-    wMilliseconds*: int16

-

-  LPSYSTEMTIME* = ptr SYSTEMTIME

-  PSYSTEMTIME* = ptr SYSTEMTIME

-  JOB_INFO_1* {.final, pure.} = object

-    JobId*: DWORD

-    pPrinterName*: LPTSTR

-    pMachineName*: LPTSTR

-    pUserName*: LPTSTR

-    pDocument*: LPTSTR

-    pDatatype*: LPTSTR

-    pStatus*: LPTSTR

-    Status*: DWORD

-    Priority*: DWORD

-    Position*: DWORD

-    TotalPages*: DWORD

-    PagesPrinted*: DWORD

-    Submitted*: SYSTEMTIME

-

-  PJOBINFO1* = ptr JOB_INFO_1

-  SID_IDENTIFIER_AUTHORITY* {.final, pure.} = object

-    Value*: array[0..5, int8]

-

-  LPSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY

-  PSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY

-  SID* {.final, pure.} = object

-    Revision*: int8

-    SubAuthorityCount*: int8

-    IdentifierAuthority*: SID_IDENTIFIER_AUTHORITY

-    SubAuthority*: array[0..(ANYSIZE_ARRAY) - 1, DWORD]

-

-  PSID* = ptr SID

-  SECURITY_DESCRIPTOR_CONTROL* = int16

-  PSECURITY_DESCRIPTOR_CONTROL* = ptr SECURITY_DESCRIPTOR_CONTROL

-  SECURITY_DESCRIPTOR* {.final, pure.} = object

-    Revision*: int8

-    Sbz1*: int8

-    Control*: SECURITY_DESCRIPTOR_CONTROL

-    Owner*: PSID

-    Group*: PSID

-    Sacl*: PACL

-    Dacl*: PACL

-

-  PSECURITY_DESCRIPTOR* = ptr SECURITY_DESCRIPTOR

-  JOB_INFO_2* {.final, pure.} = object

-    JobId*: DWORD

-    pPrinterName*: LPTSTR

-    pMachineName*: LPTSTR

-    pUserName*: LPTSTR

-    pDocument*: LPTSTR

-    pNotifyName*: LPTSTR

-    pDatatype*: LPTSTR

-    pPrintProcessor*: LPTSTR

-    pParameters*: LPTSTR

-    pDriverName*: LPTSTR

-    pDevMode*: LPDEVMODE

-    pStatus*: LPTSTR

-    pSecurityDescriptor*: PSECURITY_DESCRIPTOR

-    Status*: DWORD

-    Priority*: DWORD

-    Position*: DWORD

-    StartTime*: DWORD

-    UntilTime*: DWORD

-    TotalPages*: DWORD

-    Size*: DWORD

-    Submitted*: SYSTEMTIME

-    Time*: DWORD

-    PagesPrinted*: DWORD

-

-  PJOBINFO2* = ptr JOB_INFO_2

-  KERNINGPAIR* {.final, pure.} = object

-    wFirst*: int16

-    wSecond*: int16

-    iKernAmount*: int32

-

-  LPKERNINGPAIR* = ptr KERNINGPAIR

-  TKERNINGPAIR* = KERNINGPAIR

-  PKERNINGPAIR* = ptr KERNINGPAIR

-  LANA_ENUM* {.final, pure.} = object

-    len*: UCHAR

-    lana*: array[0..(MAX_LANA) - 1, UCHAR]

-

-  PLANAENUM* = ptr LANA_ENUM

-  LDT_ENTRY* {.final, pure.} = object

-    LimitLow*: int16

-    BaseLow*: int16

-    BaseMid*: int8

-    Flags1*: int8

-    Flags2*: int8

-    BaseHi*: int8

-

-  LPLDT_ENTRY* = ptr LDT_ENTRY

-  PLDT_ENTRY* = ptr LDT_ENTRY

-

-{.deprecated: [TEXCEPTIONRECORD: EXCEPTION_RECORD, TEXCEPTIONDEBUGINFO: EXCEPTION_DEBUG_INFO,

-  TExceptionRecord32: EXCEPTION_RECORD32, TExceptionDebugInfo32: EXCEPTION_DEBUG_INFO32,

-  TExceptionRecord64: EXCEPTION_RECORD64, TExceptionDebugInfo64: EXCEPTION_DEBUG_INFO64,

-  TEXITPROCESSDEBUGINFO: EXIT_PROCESS_DEBUG_INFO, TEXITTHREADDEBUGINFO: EXIT_THREAD_DEBUG_INFO,

-  TLOADDLLDEBUGINFO: LOAD_DLL_DEBUG_INFO, TUNLOADDLLDEBUGINFO: UNLOAD_DLL_DEBUG_INFO,

-  TOUTPUTDEBUGSTRINGINFO: OUTPUT_DEBUG_STRING_INFO, TRIPINFO: RIP_INFO, TDEBUGEVENT: DEBUG_EVENT,

-  TDEBUGHOOKINFO: DEBUGHOOKINFO, TDELETEITEMSTRUCT: DELETEITEMSTRUCT, TDEVBROADCASTHDR: DEV_BROADCAST_HDR,

-  TDEVBROADCASTOEM: DEV_BROADCAST_OEM, TDEVBROADCASTPORT: DEV_BROADCAST_PORT,

-  TDEVBROADCASTUSERDEFINED: DEV_BROADCAST_USERDEFINED, TDEVBROADCASTVOLUME: DEV_BROADCAST_VOLUME,

-  TDevicemode: DEVMODE, TDevicemodeA: DEVMODE, TDEVMODE: DEVMODE, TDEVNAMES: DEVNAMES, TDEVMODEW: DEVMODEW,

-  TDeviceModeW: DEVMODEW, TDIBSECTION: DIBSECTION, TLargeInteger: LargeInteger,

-  TULargeInteger: ULargeInteger, TDISKPERFORMANCE: DISK_PERFORMANCE, TDISKGEOMETRY: DISK_GEOMETRY,

-  TDOCINFO1: DOC_INFO_1, TDLGTEMPLATE: DLGTEMPLATE, TDLGITEMTEMPLATE: DLGITEMTEMPLATE,

-  TDRAWTEXTPARAMS: DRAWTEXTPARAMS, TDRAWITEMSTRUCT: DRAWITEMSTRUCT, TDRAGLISTINFO: DRAGLISTINFO,

-  TDOCINFO: DOCINFO, TDOCINFOA: DOCINFO, TDOCINFO2: DOC_INFO_2, TPARTITIONINFORMATION: PARTITION_INFORMATION,

-  TDRIVELAYOUTINFORMATION: DRIVE_LAYOUT_INFORMATION, TEMRARC: EMRARC, TEMRANGLEARC: EMRANGLEARC,

-  TEMR: EMR, Teditstream: EDITSTREAM, TDRIVERINFO3: DRIVER_INFO_3, TDRIVERINFO2: DRIVER_INFO_2,

-  TDRIVERINFO1: DRIVER_INFO_1, TEMREXTCREATEFONTINDIRECTW: EMREXTCREATEFONTINDIRECTW].}

-

-{.deprecated: [TEXTLOGFONT: EXTLOGFONT, TPANOSE: PANOSE, TEMRINTERSECTCLIPRECT: EMREXCLUDECLIPRECT,

-  TEMREXCLUDECLIPRECT: EMREXCLUDECLIPRECT, TEMREOF: EMREOF, TEMRRECTANGLE: EMRELLIPSE,

-  TEMRELLIPSE: EMRELLIPSE, TEMRCREATEPEN: EMRCREATEPEN, TLOGPEN: LOGPEN, TEMRCREATEPALETTE: EMRCREATEPALETTE,

-  TLOGPALETTE: LOGPALETTE, TPALETTEENTRY: PALETTEENTRY, TEMRCREATEMONOBRUSH: EMRCREATEMONOBRUSH,

-  TEMRCREATEDIBPATTERNBRUSHPT: EMRCREATEDIBPATTERNBRUSHPT, TEMRCREATECOLORSPACE: EMRCREATECOLORSPACE,

-  TLOGCOLORSPACE: LOGCOLORSPACE, TLOGCOLORSPACEA: LOGCOLORSPACE, TEMRCREATEBRUSHINDIRECT: EMRCREATEBRUSHINDIRECT,

-  TLOGBRUSH: LOGBRUSH, TEMRBITBLT: EMRBITBLT, TXFORM: XFORM, TEMRPIE: EMRARC, TEMRCHORD: EMRARC,

-  TEMRARCTO: EMRARC, TSERVICESTATUS: SERVICE_STATUS, TENUMSERVICESTATUS: ENUM_SERVICE_STATUS,

-  TENUMLOGFONT: ENUMLOGFONT, TENUMLOGFONTEX: ENUMLOGFONTEX, TEVENTLOGRECORD: EVENTLOGRECORD,

-  TEVENTMSG: EVENTMSG, TEXCEPTIONPOINTERS: EXCEPTION_POINTERS, TEXTBUTTON: EXT_BUTTON,

-  TFILTERKEYS: FILTERKEYS, TFINDNAMEBUFFER: FIND_NAME_BUFFER, TFINDNAMEHEADER: FIND_NAME_HEADER,

-  TFINDREPLACE: FINDREPLACE, Tfindtextex: FINDTEXTEX, TFMSGETDRIVEINFO: FMS_GETDRIVEINFO,

-  TFMSGETFILESEL: FMS_GETFILESEL, TFMSLOAD: FMS_LOAD, TFMSTOOLBARLOAD: FMS_TOOLBARLOAD,

-  TFOCUSEVENTRECORD: FOCUS_EVENT_RECORD, TFORMINFO1: FORM_INFO_1, TFORMATPARAMETERS: FORMAT_PARAMETERS,

-  Tformatrange: FORMATRANGE, TGCPRESULTS: GCP_RESULTS, TGENERICMAPPING: GENERIC_MAPPING,

-  TGLYPHMETRICS: GLYPHMETRICS, THANDLETABLE: HANDLETABLE, THDHITTESTINFO: HD_HITTESTINFO,

-  THDITEM: HD_ITEM, TWINDOWPOS: WINDOWPOS, THDLAYOUT: HD_LAYOUT, THDNOTIFY: HD_NOTIFY,

-  THELPINFO: HELPINFO, THELPWININFO: HELPWININFO, THIGHCONTRAST: HIGHCONTRAST, THSZPAIR: HSZPAIR,

-  TICONINFO: ICONINFO, TICONMETRICS: ICONMETRICS, TIMAGEINFO: IMAGEINFO, TKEYEVENTRECORD: KEY_EVENT_RECORD,

-  TMOUSEEVENTRECORD: MOUSE_EVENT_RECORD, TWINDOWBUFFERSIZERECORD: WINDOW_BUFFER_SIZE_RECORD,

-  TMENUEVENTRECORD: MENU_EVENT_RECORD, TINPUTRECORD: INPUT_RECORD, TSYSTEMTIME: SYSTEMTIME,

-  TJOBINFO1: JOB_INFO_1].}

-

-{.deprecated: [TSIDIDENTIFIERAUTHORITY: SID_IDENTIFIER_AUTHORITY, TSID: SID,

-  TSECURITYDESCRIPTORCONTROL: SECURITY_DESCRIPTOR_CONTROL, TSECURITYDESCRIPTOR: SECURITY_DESCRIPTOR,

-  TJOBINFO2: JOB_INFO_2, TLANAENUM: LANA_ENUM, TLDTENTRY: LDT_ENTRY, TEMRPOLYPOLYGON: EMRPOLYPOLYLINE,

-  TEMRPOLYPOLYLINE: EMRPOLYPOLYLINE, TEMRPOLYLINETO16: EMRPOLYLINE16, TEMRPOLYBEZIERTO16: EMRPOLYLINE16,

-  TEMRPOLYGON16: EMRPOLYLINE16, TEMRPOLYBEZIER16: EMRPOLYLINE16, TEMRPOLYLINE16: EMRPOLYLINE16,

-  TEMRPOLYLINETO: EMRPOLYLINE, TEMRPOLYBEZIERTO: EMRPOLYLINE, TEMRPOLYGON: EMRPOLYLINE,

-  TEMRPOLYBEZIER: EMRPOLYLINE, TEMRPOLYLINE: EMRPOLYLINE, TEMRPOLYDRAW16: EMRPOLYDRAW16,

-  TEMRPOLYDRAW: EMRPOLYDRAW, TEMRPLGBLT: EMRPLGBLT, TEMROFFSETCLIPRGN: EMROFFSETCLIPRGN,

-  TEMRMODIFYWORLDTRANSFORM: EMRMODIFYWORLDTRANSFORM, TEMRMASKBLT: EMRMASKBLT, TEMRMOVETOEX: EMRLINETO,

-  TEMRLINETO: EMRLINETO, TEMRPAINTRGN: EMRINVERTRGN, TEMRINVERTRGN: EMRINVERTRGN,

-  TEMRGDICOMMENT: EMRGDICOMMENT, TEMRFRAMERGN: EMRFRAMERGN, TEMRFORMAT: EMRFORMAT, TEMRFILLRGN: EMRFILLRGN,

-  TEMRSTROKEPATH: EMRFILLPATH, TEMRSTROKEANDFILLPATH: EMRFILLPATH, TEMRFILLPATH: EMRFILLPATH,

-  TEMREXTTEXTOUTW: EMREXTTEXTOUTA, TEMREXTTEXTOUTA: EMREXTTEXTOUTA, TEMRTEXT: EMRTEXT,

-  TEMREXTSELECTCLIPRGN: EMREXTSELECTCLIPRGN, TEMREXTFLOODFILL: EMREXTFLOODFILL,

-  TEMREXTCREATEPEN: EMREXTCREATEPEN, TEXTLOGPEN: EXTLOGPEN, TNMHDR: NMHDR, TEMRENABLEICM: EMRSELECTCLIPPATH,

-  TEMRSETTEXTALIGN: EMRSELECTCLIPPATH, TEMRSETSTRETCHBLTMODE: EMRSELECTCLIPPATH,

-  TEMRSETROP2: EMRSELECTCLIPPATH, TEMRSETPOLYFILLMODE: EMRSELECTCLIPPATH, TEMRSETMAPMODE: EMRSELECTCLIPPATH,

-  TEMRSETBKMODE: EMRSELECTCLIPPATH, TEMRSELECTCLIPPATH: EMRSELECTCLIPPATH, TEMRREALIZEPALETTE: EMRABORTPATH,

-  TEMRSAVEDC: EMRABORTPATH, TEMRSETMETARGN: EMRABORTPATH, TEMRWIDENPATH: EMRABORTPATH].}

-

-{.deprecated: [TEMRFLATTENPATH: EMRABORTPATH, TEMRCLOSEFIGURE: EMRABORTPATH, TEMRENDPATH: EMRABORTPATH,

-  TEMRBEGINPATH: EMRABORTPATH, TABORTPATH: EMRABORTPATH, TEMRABORTPATH: EMRABORTPATH,

-  TEMRSTRETCHDIBITS: EMRSTRETCHDIBITS, TEMRSTRETCHBLT: EMRSTRETCHBLT,

-  TEMRSETWORLDTRANSFORM: EMRSETWORLDTRANSFORM, TEMRSETBRUSHORGEX: EMRSETVIEWPORTORGEX,

-  TEMRSETWINDOWORGEX: EMRSETVIEWPORTORGEX, TEMRSETVIEWPORTORGEX: EMRSETVIEWPORTORGEX,

-  TEMRSETWINDOWEXTEX: EMRSETVIEWPORTEXTEX, TEMRSETVIEWPORTEXTEX: EMRSETVIEWPORTEXTEX,

-  TEMRSETPIXELV: EMRSETPIXELV, TEMRSETPALETTEENTRIES: EMRSETPALETTEENTRIES,

-  TEMRSETMITERLIMIT: EMRSETMITERLIMIT, TEMRSETMAPPERFLAGS: EMRSETMAPPERFLAGS,

-  TEMRSETDIBITSTODEVICE: EMRSETDIBITSTODEVICE, TEMRSETCOLORADJUSTMENT: EMRSETCOLORADJUSTMENT,

-  TEMRSETTEXTCOLOR: EMRSETBKCOLOR, TEMRSETBKCOLOR: EMRSETBKCOLOR, TEMRSETARCDIRECTION: EMRSETARCDIRECTION,

-  TEMRSELECTPALETTE: EMRSELECTPALETTE, TEMRDELETEOBJECT: EMRSELECTOBJECT, TEMRSELECTOBJECT: EMRSELECTOBJECT,

-  TEMRDELETECOLORSPACE: EMRSELECTCOLORSPACE, TEMRSELECTCOLORSPACE: EMRSELECTCOLORSPACE,

-  TEMRSCALEWINDOWEXTEX: EMRSCALEVIEWPORTEXTEX, TEMRSCALEVIEWPORTEXTEX: EMRSCALEVIEWPORTEXTEX,

-  TEMRROUNDRECT: EMRROUNDRECT, TEMRRESTOREDC: EMRRESTOREDC, TEMRRESIZEPALETTE: EMRRESIZEPALETTE,

-  TEMRPOLYTEXTOUTW: EMRPOLYTEXTOUTA, TEMRPOLYTEXTOUTA: EMRPOLYTEXTOUTA,

-  TEMRPOLYPOLYGON16: EMRPOLYPOLYLINE16, TEMRPOLYPOLYLINE16: EMRPOLYPOLYLINE16,

-  TENHMETAHEADER: ENHMETAHEADER, TENHMETARECORD: ENHMETARECORD].}

-

-

-

-const

-  bm_LDT_ENTRY_BaseMid* = 0x000000FF

-  bp_LDT_ENTRY_BaseMid* = 0'i32

-  bm_LDT_ENTRY_Type* = 0x00001F00

-  bp_LDT_ENTRY_Type* = 8'i32

-  bm_LDT_ENTRY_Dpl* = 0x00006000

-  bp_LDT_ENTRY_Dpl* = 13'i32

-  bm_LDT_ENTRY_Pres* = 0x00008000

-  bp_LDT_ENTRY_Pres* = 15'i32

-  bm_LDT_ENTRY_LimitHi* = 0x000F0000

-  bp_LDT_ENTRY_LimitHi* = 16'i32

-  bm_LDT_ENTRY_Sys* = 0x00100000

-  bp_LDT_ENTRY_Sys* = 20'i32

-  bm_LDT_ENTRY_Reserved_0* = 0x00200000

-  bp_LDT_ENTRY_Reserved_0* = 21'i32

-  bm_LDT_ENTRY_Default_Big* = 0x00400000

-  bp_LDT_ENTRY_Default_Big* = 22'i32

-  bm_LDT_ENTRY_Granularity* = 0x00800000

-  bp_LDT_ENTRY_Granularity* = 23'i32

-  bm_LDT_ENTRY_BaseHi* = 0xFF000000

-  bp_LDT_ENTRY_BaseHi* = 24'i32

-

-type

-  LOCALESIGNATURE* {.final, pure.} = object

-    lsUsb*: array[0..3, DWORD]

-    lsCsbDefault*: array[0..1, DWORD]

-    lsCsbSupported*: array[0..1, DWORD]

-

-  PLOCALESIGNATURE* = ptr LOCALESIGNATURE

-  LOCALGROUP_MEMBERS_INFO_0* {.final, pure.} = object

-    lgrmi0_sid*: PSID

-

-  PLOCALGROUPMEMBERSINFO0* = ptr LOCALGROUP_MEMBERS_INFO_0

-  LOCALGROUP_MEMBERS_INFO_3* {.final, pure.} = object

-    lgrmi3_domainandname*: LPWSTR

-

-  PLOCALGROUPMEMBERSINFO3* = ptr LOCALGROUP_MEMBERS_INFO_3

-  FXPT16DOT16* = int32

-  LPFXPT16DOT16* = ptr FXPT16DOT16

-  PFXPT16DOT16* = ptr FXPT16DOT16

-  LUID* = LargeInteger

-  PLUID* = ptr LUID

-  LUID_AND_ATTRIBUTES* {.final, pure.} = object

-    Luid*: LUID

-    Attributes*: DWORD

-

-  PLUIDANDATTRIBUTES* = ptr LUID_AND_ATTRIBUTES

-  LUID_AND_ATTRIBUTES_ARRAY* = array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES]

-  PLUID_AND_ATTRIBUTES_ARRAY* = ptr LUID_AND_ATTRIBUTES_ARRAY

-  LV_COLUMN* {.final, pure.} = object

-    mask*: WINUINT

-    fmt*: int32

-    cx*: int32

-    pszText*: LPTSTR

-    cchTextMax*: int32

-    iSubItem*: int32

-

-  PLVCOLUMN* = ptr LV_COLUMN

-  LV_ITEM* {.final, pure.} = object

-    mask*: WINUINT

-    iItem*: int32

-    iSubItem*: int32

-    state*: WINUINT

-    stateMask*: WINUINT

-    pszText*: LPTSTR

-    cchTextMax*: int32

-    iImage*: int32

-    lParam*: LPARAM

-

-  PLVITEM* = ptr LV_ITEM

-  LV_DISPINFO* {.final, pure.} = object

-    hdr*: NMHDR

-    item*: LV_ITEM

-

-  PLVDISPINFO* = ptr LV_DISPINFO

-  LV_FINDINFO* {.final, pure.} = object

-    flags*: WINUINT

-    psz*: LPCTSTR

-    lParam*: LPARAM

-    pt*: POINT

-    vkDirection*: WINUINT

-

-  PLVFINDINFO* = ptr LV_FINDINFO

-  LV_HITTESTINFO* {.final, pure.} = object

-    pt*: POINT

-    flags*: WINUINT

-    iItem*: int32

-

-  PLVHITTESTINFO* = ptr LV_HITTESTINFO

-  LV_KEYDOWN* {.final, pure.} = object

-    hdr*: NMHDR

-    wVKey*: int16

-    flags*: WINUINT

-

-  PLVKEYDOWN* = ptr LV_KEYDOWN

-  MAT2* {.final, pure.} = object

-    eM11*: FIXED

-    eM12*: FIXED

-    eM21*: FIXED

-    eM22*: FIXED

-

-  PMAT2* = ptr MAT2

-  MDICREATESTRUCT* {.final, pure.} = object

-    szClass*: LPCTSTR

-    szTitle*: LPCTSTR

-    hOwner*: HANDLE

-    x*: int32

-    y*: int32

-    cx*: int32

-    cy*: int32

-    style*: DWORD

-    lParam*: LPARAM

-

-  LPMDICREATESTRUCT* = ptr MDICREATESTRUCT

-  PMDICREATESTRUCT* = ptr MDICREATESTRUCT

-  MEASUREITEMSTRUCT* {.final, pure.} = object

-    CtlType*: WINUINT

-    CtlID*: WINUINT

-    itemID*: WINUINT

-    itemWidth*: WINUINT

-    itemHeight*: WINUINT

-    itemData*: ULONG_PTR

-

-  LPMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT

-  PMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT

-  MEMORY_BASIC_INFORMATION* {.final, pure.} = object

-    BaseAddress*: PVOID

-    AllocationBase*: PVOID

-    AllocationProtect*: DWORD

-    RegionSize*: DWORD

-    State*: DWORD

-    Protect*: DWORD

-    `type`*: DWORD

-

-  PMEMORY_BASIC_INFORMATION* = ptr MEMORY_BASIC_INFORMATION

-  MEMORYSTATUS* {.final, pure.} = object

-    dwLength*: DWORD

-    dwMemoryLoad*: DWORD

-    dwTotalPhys*: int

-    dwAvailPhys*: int

-    dwTotalPageFile*: int

-    dwAvailPageFile*: int

-    dwTotalVirtual*: int

-    dwAvailVirtual*: int

-

-  GUID* {.final, pure.} = object

-    D1*: int32

-    D2*: int16

-    D3*: int16

-    D4*: array [0..7, int8]

-

-  LPMEMORYSTATUS* = ptr MEMORYSTATUS

-  PMEMORYSTATUS* = ptr MEMORYSTATUS

-  MENUEX_TEMPLATE_HEADER* {.final, pure.} = object

-    wVersion*: int16

-    wOffset*: int16

-    dwHelpId*: DWORD

-

-  PMENUXTEMPLATEHEADER* = ptr MENUEX_TEMPLATE_HEADER

-  MENUEX_TEMPLATE_ITEM* {.final, pure.} = object

-    dwType*: DWORD

-    dwState*: DWORD

-    uId*: WINUINT

-    bResInfo*: int8

-    szText*: array[0..0, WCHAR]

-    dwHelpId*: DWORD

-

-  PMENUEXTEMPLATEITEM* = ptr MENUEX_TEMPLATE_ITEM

-  MENUINFO* {.final, pure.} = object

-    cbSize*: DWORD

-    fMask*: DWORD

-    dwStyle*: DWORD

-    cyMax*: WINUINT

-    hbrBack*: HBRUSH

-    dwContextHelpID*: DWORD

-    dwMenuData*: ULONG_PTR

-

-  LPMENUINFO* = ptr MENUINFO

-  LPCMENUINFO* = ptr MENUINFO

-  PMENUINFO* = ptr MENUINFO

-  MENUITEMINFO* {.final, pure.} = object

-    cbSize*: WINUINT

-    fMask*: WINUINT

-    fType*: WINUINT

-    fState*: WINUINT

-    wID*: WINUINT

-    hSubMenu*: HMENU

-    hbmpChecked*: HBITMAP

-    hbmpUnchecked*: HBITMAP

-    dwItemData*: ULONG_PTR

-    dwTypeData*: LPTSTR

-    cch*: WINUINT

-    hbmpItem*: HBITMAP

-

-  LPMENUITEMINFO* = ptr MENUITEMINFO

-  LPCMENUITEMINFO* = ptr MENUITEMINFO

-  PMENUITEMINFO* = ptr MENUITEMINFO

-  MENUITEMTEMPLATE* {.final, pure.} = object

-    mtOption*: int16

-    mtID*: int16

-    mtString*: array[0..0, WCHAR]

-

-  PMENUITEMTEMPLATE* = ptr MENUITEMTEMPLATE

-  MENUITEMTEMPLATEHEADER* {.final, pure.} = object

-    versionNumber*: int16

-    offset*: int16

-

-  PMENUITEMTEMPLATEHEADER* = ptr MENUITEMTEMPLATEHEADER

-  MENUTEMPLATE* {.final, pure.} = object

-  LPMENUTEMPLATE* = ptr MENUTEMPLATE

-  PMENUTEMPLATE* = ptr MENUTEMPLATE

-  METAFILEPICT* {.final, pure.} = object

-    mm*: LONG

-    xExt*: LONG

-    yExt*: LONG

-    hMF*: HMETAFILE

-

-  LPMETAFILEPICT* = ptr METAFILEPICT

-  PMETAFILEPICT* = ptr METAFILEPICT

-  METAHEADER* {.final, pure.} = object

-    mtType*: int16

-    mtHeaderSize*: int16

-    mtVersion*: int16

-    mtSize*: DWORD

-    mtNoObjects*: int16

-    mtMaxRecord*: DWORD

-    mtNoParameters*: int16

-

-  PMETAHEADER* = ptr METAHEADER

-  METARECORD* {.final, pure.} = object

-    rdSize*: DWORD

-    rdFunction*: int16

-    rdParm*: array[0..0, int16]

-

-  LPMETARECORD* = ptr METARECORD

-  PMETARECORD* = ptr METARECORD

-  MINIMIZEDMETRICS* {.final, pure.} = object

-    cbSize*: WINUINT

-    iWidth*: int32

-    iHorzGap*: int32

-    iVertGap*: int32

-    iArrange*: int32

-

-  LPMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS

-  PMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS

-  MINMAXINFO* {.final, pure.} = object

-    ptReserved*: POINT

-    ptMaxSize*: POINT

-    ptMaxPosition*: POINT

-    ptMinTrackSize*: POINT

-    ptMaxTrackSize*: POINT

-

-  PMINMAXINFO* = ptr MINMAXINFO

-  MODEMDEVCAPS* {.final, pure.} = object

-    dwActualSize*: DWORD

-    dwRequiredSize*: DWORD

-    dwDevSpecificOffset*: DWORD

-    dwDevSpecificSize*: DWORD

-    dwModemProviderVersion*: DWORD

-    dwModemManufacturerOffset*: DWORD

-    dwModemManufacturerSize*: DWORD

-    dwModemModelOffset*: DWORD

-    dwModemModelSize*: DWORD

-    dwModemVersionOffset*: DWORD

-    dwModemVersionSize*: DWORD

-    dwDialOptions*: DWORD

-    dwCallSetupFailTimer*: DWORD

-    dwInactivityTimeout*: DWORD

-    dwSpeakerVolume*: DWORD

-    dwSpeakerMode*: DWORD

-    dwModemOptions*: DWORD

-    dwMaxDTERate*: DWORD

-    dwMaxDCERate*: DWORD

-    abVariablePortion*: array[0..0, int8]

-

-  LPMODEMDEVCAPS* = ptr MODEMDEVCAPS

-  PMODEMDEVCAPS* = ptr MODEMDEVCAPS

-  MODEMSETTINGS* {.final, pure.} = object

-    dwActualSize*: DWORD

-    dwRequiredSize*: DWORD

-    dwDevSpecificOffset*: DWORD

-    dwDevSpecificSize*: DWORD

-    dwCallSetupFailTimer*: DWORD

-    dwInactivityTimeout*: DWORD

-    dwSpeakerVolume*: DWORD

-    dwSpeakerMode*: DWORD

-    dwPreferredModemOptions*: DWORD

-    dwNegotiatedModemOptions*: DWORD

-    dwNegotiatedDCERate*: DWORD

-    abVariablePortion*: array[0..0, int8]

-

-  LPMODEMSETTINGS* = ptr MODEMSETTINGS

-  PMODEMSETTINGS* = ptr MODEMSETTINGS

-  MONCBSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    dwTime*: DWORD

-    hTask*: HANDLE

-    dwRet*: DWORD

-    wType*: WINUINT

-    wFmt*: WINUINT

-    hConv*: HCONV

-    hsz1*: HSZ

-    hsz2*: HSZ

-    hData*: HDDEDATA

-    dwData1*: DWORD

-    dwData2*: DWORD

-    cc*: CONVCONTEXT

-    cbData*: DWORD

-    Data*: array[0..7, DWORD]

-

-  PMONCBSTRUCT* = ptr MONCBSTRUCT

-  MONCONVSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    fConnect*: WINBOOL

-    dwTime*: DWORD

-    hTask*: HANDLE

-    hszSvc*: HSZ

-    hszTopic*: HSZ

-    hConvClient*: HCONV

-    hConvServer*: HCONV

-

-  PMONCONVSTRUCT* = ptr MONCONVSTRUCT

-  MONERRSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    wLastError*: WINUINT

-    dwTime*: DWORD

-    hTask*: HANDLE

-

-  PMONERRSTRUCT* = ptr MONERRSTRUCT

-  MONHSZSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    fsAction*: WINBOOL

-    dwTime*: DWORD

-    hsz*: HSZ

-    hTask*: HANDLE

-    str*: array[0..0, CHAR]

-

-  PMONHSZSTRUCT* = ptr MONHSZSTRUCT

-  MONITOR_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-

-  PMONITORINFO1* = ptr MONITOR_INFO_1

-  MONITOR_INFO_2* {.final, pure.} = object

-    pName*: LPTSTR

-    pEnvironment*: LPTSTR

-    pDLLName*: LPTSTR

-

-  PMONITORINFO2* = ptr MONITOR_INFO_2

-  MONLINKSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    dwTime*: DWORD

-    hTask*: HANDLE

-    fEstablished*: WINBOOL

-    fNoData*: WINBOOL

-    hszSvc*: HSZ

-    hszTopic*: HSZ

-    hszItem*: HSZ

-    wFmt*: WINUINT

-    fServer*: WINBOOL

-    hConvServer*: HCONV

-    hConvClient*: HCONV

-

-  PMONLINKSTRUCT* = ptr MONLINKSTRUCT

-  MONMSGSTRUCT* {.final, pure.} = object

-    cb*: WINUINT

-    hwndTo*: HWND

-    dwTime*: DWORD

-    hTask*: HANDLE

-    wMsg*: WINUINT

-    wParam*: WPARAM

-    lParam*: LPARAM

-    dmhd*: DDEML_MSG_HOOK_DATA

-

-  PMONMSGSTRUCT* = ptr MONMSGSTRUCT

-  MOUSEHOOKSTRUCT* {.final, pure.} = object

-    pt*: POINT

-    hwnd*: HWND

-    wHitTestCode*: WINUINT

-    dwExtraInfo*: DWORD

-

-  LPMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT

-  PMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT

-  MOUSEKEYS* {.final, pure.} = object

-    cbSize*: DWORD

-    dwFlags*: DWORD

-    iMaxSpeed*: DWORD

-    iTimeToMaxSpeed*: DWORD

-    iCtrlSpeed*: DWORD

-    dwReserved1*: DWORD

-    dwReserved2*: DWORD

-

-  PMOUSEKEYS* = ptr MOUSEKEYS

-  MSGBOXCALLBACK* = proc (lpHelpInfo: LPHELPINFO){.stdcall.}

-  TMSGBOXCALLBACK* = MSGBOXCALLBACK

-  MSGBOXPARAMS* {.final, pure.} = object

-    cbSize*: WINUINT

-    hwndOwner*: HWND

-    hInstance*: HINST

-    lpszText*: LPCSTR

-    lpszCaption*: LPCSTR

-    dwStyle*: DWORD

-    lpszIcon*: LPCSTR

-    dwContextHelpId*: DWORD

-    lpfnMsgBoxCallback*: MSGBOXCALLBACK

-    dwLanguageId*: DWORD

-

-  LPMSGBOXPARAMS* = ptr MSGBOXPARAMS

-  PMSGBOXPARAMS* = ptr MSGBOXPARAMS

-  MSGFILTER* {.final, pure.} = object

-    nmhdr*: NMHDR

-    msg*: WINUINT

-    wParam*: WPARAM

-    lParam*: LPARAM

-

-  Pmsgfilter* = ptr MSGFILTER

-  MULTIKEYHELP* {.final, pure.} = object

-    mkSize*: DWORD

-    mkKeylist*: CHAR

-    szKeyphrase*: array[0..0, CHAR]

-

-  PMULTIKEYHELP* = ptr MULTIKEYHELP

-  NAME_BUFFER* {.final, pure.} = object

-    name*: array[0..(NCBNAMSZ) - 1, UCHAR]

-    name_num*: UCHAR

-    name_flags*: UCHAR

-

-  PNAMEBUFFER* = ptr NAME_BUFFER

-  p_NCB* = ptr NCB

-  NCB* {.final, pure.} = object

-    ncb_command*: UCHAR

-    ncb_retcode*: UCHAR

-    ncb_lsn*: UCHAR

-    ncb_num*: UCHAR

-    ncb_buffer*: PUCHAR

-    ncb_length*: int16

-    ncb_callname*: array[0..(NCBNAMSZ) - 1, UCHAR]

-    ncb_name*: array[0..(NCBNAMSZ) - 1, UCHAR]

-    ncb_rto*: UCHAR

-    ncb_sto*: UCHAR

-    ncb_post*: proc (para1: p_NCB){.cdecl.}

-    ncb_lana_num*: UCHAR

-    ncb_cmd_cplt*: UCHAR

-    ncb_reserve*: array[0..9, UCHAR]

-    ncb_event*: HANDLE

-

-  NCCALCSIZE_PARAMS* {.final, pure.} = object

-    rgrc*: array[0..2, RECT]

-    lppos*: PWINDOWPOS

-

-  TNCCALCSIZEPARAMS* = NCCALCSIZE_PARAMS

-  PNCCALCSIZEPARAMS* = ptr NCCALCSIZE_PARAMS

-  NDDESHAREINFO* {.final, pure.} = object

-    lRevision*: LONG

-    lpszShareName*: LPTSTR

-    lShareType*: LONG

-    lpszAppTopicList*: LPTSTR

-    fSharedFlag*: LONG

-    fService*: LONG

-    fStartAppFlag*: LONG

-    nCmdShow*: LONG

-    qModifyId*: array[0..1, LONG]

-    cNumItems*: LONG

-    lpszItemList*: LPTSTR

-

-  PNDDESHAREINFO* = ptr NDDESHAREINFO

-  NETRESOURCE* {.final, pure.} = object

-    dwScope*: DWORD

-    dwType*: DWORD

-    dwDisplayType*: DWORD

-    dwUsage*: DWORD

-    lpLocalName*: LPTSTR

-    lpRemoteName*: LPTSTR

-    lpComment*: LPTSTR

-    lpProvider*: LPTSTR

-

-  LPNETRESOURCE* = ptr NETRESOURCE

-  PNETRESOURCE* = ptr NETRESOURCE

-  PNETRESOURCEA* = ptr NETRESOURCE

-  NEWCPLINFO* {.final, pure.} = object

-    dwSize*: DWORD

-    dwFlags*: DWORD

-    dwHelpContext*: DWORD

-    lData*: LONG

-    hIcon*: HICON

-    szName*: array[0..31, CHAR]

-    szInfo*: array[0..63, CHAR]

-    szHelpFile*: array[0..127, CHAR]

-

-  PNEWCPLINFO* = ptr NEWCPLINFO

-  NEWTEXTMETRIC* {.final, pure.} = object

-    tmHeight*: LONG

-    tmAscent*: LONG

-    tmDescent*: LONG

-    tmInternalLeading*: LONG

-    tmExternalLeading*: LONG

-    tmAveCharWidth*: LONG

-    tmMaxCharWidth*: LONG

-    tmWeight*: LONG

-    tmOverhang*: LONG

-    tmDigitizedAspectX*: LONG

-    tmDigitizedAspectY*: LONG

-    tmFirstChar*: BCHAR

-    tmLastChar*: BCHAR

-    tmDefaultChar*: BCHAR

-    tmBreakChar*: BCHAR

-    tmItalic*: int8

-    tmUnderlined*: int8

-    tmStruckOut*: int8

-    tmPitchAndFamily*: int8

-    tmCharSet*: int8

-    ntmFlags*: DWORD

-    ntmSizeEM*: WINUINT

-    ntmCellHeight*: WINUINT

-    ntmAvgWidth*: WINUINT

-

-  PNEWTEXTMETRIC* = ptr NEWTEXTMETRIC

-  NEWTEXTMETRICEX* {.final, pure.} = object

-    ntmentm*: NEWTEXTMETRIC

-    ntmeFontSignature*: FONTSIGNATURE

-

-  PNEWTEXTMETRICEX* = ptr NEWTEXTMETRICEX

-  NM_LISTVIEW* {.final, pure.} = object

-    hdr*: NMHDR

-    iItem*: int32

-    iSubItem*: int32

-    uNewState*: WINUINT

-    uOldState*: WINUINT

-    uChanged*: WINUINT

-    ptAction*: POINT

-    lParam*: LPARAM

-

-  PNMLISTVIEW* = ptr NM_LISTVIEW

-  TV_ITEM* {.final, pure.} = object

-    mask*: WINUINT

-    hItem*: HTREEITEM

-    state*: WINUINT

-    stateMask*: WINUINT

-    pszText*: LPTSTR

-    cchTextMax*: int32

-    iImage*: int32

-    iSelectedImage*: int32

-    cChildren*: int32

-    lParam*: LPARAM

-

-  LPTV_ITEM* = ptr TV_ITEM

-  PTVITEM* = ptr TV_ITEM

-  NM_TREEVIEW* {.final, pure.} = object

-    hdr*: NMHDR

-    action*: WINUINT

-    itemOld*: TV_ITEM

-    itemNew*: TV_ITEM

-    ptDrag*: POINT

-

-  LPNM_TREEVIEW* = ptr NM_TREEVIEW

-  PNMTREEVIEW* = ptr NM_TREEVIEW

-  NM_UPDOWNW* {.final, pure.} = object

-    hdr*: NMHDR

-    iPos*: int32

-    iDelta*: int32

-

-  PNMUPDOWN* = ptr NM_UPDOWNW

-  NONCLIENTMETRICS* {.final, pure.} = object

-    cbSize*: WINUINT

-    iBorderWidth*: int32

-    iScrollWidth*: int32

-    iScrollHeight*: int32

-    iCaptionWidth*: int32

-    iCaptionHeight*: int32

-    lfCaptionFont*: LOGFONT

-    iSmCaptionWidth*: int32

-    iSmCaptionHeight*: int32

-    lfSmCaptionFont*: LOGFONT

-    iMenuWidth*: int32

-    iMenuHeight*: int32

-    lfMenuFont*: LOGFONT

-    lfStatusFont*: LOGFONT

-    lfMessageFont*: LOGFONT

-

-  LPNONCLIENTMETRICS* = ptr NONCLIENTMETRICS

-  PNONCLIENTMETRICS* = ptr NONCLIENTMETRICS

-  SERVICE_ADDRESS* {.final, pure.} = object

-    dwAddressType*: DWORD

-    dwAddressFlags*: DWORD

-    dwAddressLength*: DWORD

-    dwPrincipalLength*: DWORD

-    lpAddress*: ptr int8

-    lpPrincipal*: ptr int8

-

-  PSERVICEADDRESS* = ptr SERVICE_ADDRESS

-  SERVICE_ADDRESSES* {.final, pure.} = object

-    dwAddressCount*: DWORD

-    Addresses*: array[0..0, SERVICE_ADDRESS]

-

-  LPSERVICE_ADDRESSES* = ptr SERVICE_ADDRESSES

-  PSERVICEADDRESSES* = ptr SERVICE_ADDRESSES

-  LPGUID* = ptr GUID

-  PGUID* = ptr GUID

-  CLSID* = GUID

-  LPCLSID* = ptr CLSID

-  PCLSID* = ptr CLSID

-  SERVICE_INFO* {.final, pure.} = object

-    lpServiceType*: LPGUID

-    lpServiceName*: LPTSTR

-    lpComment*: LPTSTR

-    lpLocale*: LPTSTR

-    dwDisplayHint*: DWORD

-    dwVersion*: DWORD

-    dwTime*: DWORD

-    lpMachineName*: LPTSTR

-    lpServiceAddress*: LPSERVICE_ADDRESSES

-    ServiceSpecificInfo*: BLOB

-

-  PSERVICEINFO* = ptr SERVICE_INFO

-  NS_SERVICE_INFO* {.final, pure.} = object

-    dwNameSpace*: DWORD

-    ServiceInfo*: SERVICE_INFO

-

-  PNSSERVICEINFO* = ptr NS_SERVICE_INFO

-  NUMBERFMT* {.final, pure.} = object

-    NumDigits*: WINUINT

-    LeadingZero*: WINUINT

-    Grouping*: WINUINT

-    lpDecimalSep*: LPTSTR

-    lpThousandSep*: LPTSTR

-    NegativeOrder*: WINUINT

-

-  Pnumberfmt* = ptr NUMBERFMT

-  OFSTRUCT* {.final, pure.} = object

-    cBytes*: int8

-    fFixedDisk*: int8

-    nErrCode*: int16

-    Reserved1*: int16

-    Reserved2*: int16

-    szPathName*: array[0..(OFS_MAXPATHNAME) - 1, char]

-

-  LPOFSTRUCT* = ptr OFSTRUCT

-  POFSTRUCT* = ptr OFSTRUCT

-  OPENFILENAME_NT4* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hInstance*: HINST

-    lpstrFilter*: LPCTSTR

-    lpstrCustomFilter*: LPTSTR

-    nMaxCustFilter*: DWORD

-    nFilterIndex*: DWORD

-    lpstrFile*: LPTSTR

-    nMaxFile*: DWORD

-    lpstrFileTitle*: LPTSTR

-    nMaxFileTitle*: DWORD

-    lpstrInitialDir*: LPCTSTR

-    lpstrTitle*: LPCTSTR

-    Flags*: DWORD

-    nFileOffset*: int16

-    nFileExtension*: int16

-    lpstrDefExt*: LPCTSTR

-    lCustData*: LPARAM

-    lpfnHook*: LPOFNHOOKPROC

-    lpTemplateName*: LPCTSTR

-

-  LPOPENFILENAME_NT4* = ptr OPENFILENAME_NT4

-  POPENFILENAME_NT4* = ptr OPENFILENAME_NT4

-  OPENFILENAME* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hInstance*: HINST

-    lpstrFilter*: LPCTSTR

-    lpstrCustomFilter*: LPTSTR

-    nMaxCustFilter*: DWORD

-    nFilterIndex*: DWORD

-    lpstrFile*: LPTSTR

-    nMaxFile*: DWORD

-    lpstrFileTitle*: LPTSTR

-    nMaxFileTitle*: DWORD

-    lpstrInitialDir*: LPCTSTR

-    lpstrTitle*: LPCTSTR

-    flags*: DWORD

-    nFileOffset*: int16

-    nFileExtension*: int16

-    lpstrDefExt*: LPCTSTR

-    lCustData*: LPARAM

-    lpfnHook*: LPOFNHOOKPROC

-    lpTemplateName*: LPCTSTR

-    pvReserved*: pointer

-    dwreserved*: DWORD

-    FlagsEx*: DWORD

-

-  LPOPENFILENAME* = ptr OPENFILENAME

-  POPENFILENAME* = ptr OPENFILENAME

-  OFN* = OPENFILENAME

-  POFN* = ptr OPENFILENAME

-  OFNOTIFY* {.final, pure.} = object

-    hdr*: NMHDR

-    lpOFN*: LPOPENFILENAME

-    pszFile*: LPTSTR

-

-  LPOFNOTIFY* = ptr OFNOTIFY

-  POFNOTIFY* = ptr OFNOTIFY

-  OSVERSIONINFO* {.final, pure.} = object

-    dwOSVersionInfoSize*: DWORD

-    dwMajorVersion*: DWORD

-    dwMinorVersion*: DWORD

-    dwBuildNumber*: DWORD

-    dwPlatformId*: DWORD

-    szCSDVersion*: array[0..127, CHAR]

-

-  LPOSVERSIONINFO* = ptr OSVERSIONINFO

-  POSVERSIONINFO* = ptr OSVERSIONINFO

-  OSVERSIONINFOW* {.final, pure.} = object

-    dwOSVersionInfoSize*: DWORD

-    dwMajorVersion*: DWORD

-    dwMinorVersion*: DWORD

-    dwBuildNumber*: DWORD

-    dwPlatformId*: DWORD

-    szCSDVersion*: array[0..127, WCHAR]

-

-  LPOSVERSIONINFOW* = ptr OSVERSIONINFOW

-  POSVERSIONINFOW* = ptr OSVERSIONINFOW

-  TEXTMETRIC* {.final, pure.} = object

-    tmHeight*: LONG

-    tmAscent*: LONG

-    tmDescent*: LONG

-    tmInternalLeading*: LONG

-    tmExternalLeading*: LONG

-    tmAveCharWidth*: LONG

-    tmMaxCharWidth*: LONG

-    tmWeight*: LONG

-    tmOverhang*: LONG

-    tmDigitizedAspectX*: LONG

-    tmDigitizedAspectY*: LONG

-    tmFirstChar*: BCHAR

-    tmLastChar*: BCHAR

-    tmDefaultChar*: BCHAR

-    tmBreakChar*: BCHAR

-    tmItalic*: int8

-    tmUnderlined*: int8

-    tmStruckOut*: int8

-    tmPitchAndFamily*: int8

-    tmCharSet*: int8

-

-  LPTEXTMETRIC* = ptr TEXTMETRIC

-  PTEXTMETRIC* = ptr TEXTMETRIC

-  TEXTMETRICW* {.final, pure.} = object

-    tmHeight*: LONG

-    tmAscent*: LONG

-    tmDescent*: LONG

-    tmInternalLeading*: LONG

-    tmExternalLeading*: LONG

-    tmAveCharWidth*: LONG

-    tmMaxCharWidth*: LONG

-    tmWeight*: LONG

-    tmOverhang*: LONG

-    tmDigitizedAspectX*: LONG

-    tmDigitizedAspectY*: LONG

-    tmFirstChar*: WCHAR

-    tmLastChar*: WCHAR

-    tmDefaultChar*: WCHAR

-    tmBreakChar*: WCHAR

-    tmItalic*: int8

-    tmUnderlined*: int8

-    tmStruckOut*: int8

-    tmPitchAndFamily*: int8

-    tmCharSet*: int8

-

-  LPTEXTMETRICW* = ptr TEXTMETRICW

-  PTEXTMETRICW* = ptr TEXTMETRICW

-  OUTLINETEXTMETRIC* {.final, pure.} = object

-    otmSize*: WINUINT

-    otmTextMetrics*: TEXTMETRIC

-    otmFiller*: int8

-    otmPanoseNumber*: PANOSE

-    otmfsSelection*: WINUINT

-    otmfsType*: WINUINT

-    otmsCharSlopeRise*: int32

-    otmsCharSlopeRun*: int32

-    otmItalicAngle*: int32

-    otmEMSquare*: WINUINT

-    otmAscent*: int32

-    otmDescent*: int32

-    otmLineGap*: WINUINT

-    otmsCapEmHeight*: WINUINT

-    otmsXHeight*: WINUINT

-    otmrcFontBox*: RECT

-    otmMacAscent*: int32

-    otmMacDescent*: int32

-    otmMacLineGap*: WINUINT

-    otmusMinimumPPEM*: WINUINT

-    otmptSubscriptSize*: POINT

-    otmptSubscriptOffset*: POINT

-    otmptSuperscriptSize*: POINT

-    otmptSuperscriptOffset*: POINT

-    otmsStrikeoutSize*: WINUINT

-    otmsStrikeoutPosition*: int32

-    otmsUnderscoreSize*: int32

-    otmsUnderscorePosition*: int32

-    otmpFamilyName*: PSTR

-    otmpFaceName*: PSTR

-    otmpStyleName*: PSTR

-    otmpFullName*: PSTR

-

-  LPOUTLINETEXTMETRIC* = ptr OUTLINETEXTMETRIC

-  POUTLINETEXTMETRIC* = ptr OUTLINETEXTMETRIC

-  OVERLAPPED* {.final, pure.} = object

-    Internal*: DWORD

-    InternalHigh*: DWORD

-    Offset*: DWORD

-    OffsetHigh*: DWORD

-    hEvent*: HANDLE

-

-  LPOVERLAPPED* = ptr OVERLAPPED

-  POVERLAPPED* = ptr OVERLAPPED

-  #PAGESETUPDLG = record conflicts with function PageSetupDlg

-  TPAGESETUPDLG* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hDevMode*: HGLOBAL

-    hDevNames*: HGLOBAL

-    Flags*: DWORD

-    ptPaperSize*: POINT

-    rtMinMargin*: RECT

-    rtMargin*: RECT

-    hInstance*: HINST

-    lCustData*: LPARAM

-    lpfnPageSetupHook*: LPPAGESETUPHOOK

-    lpfnPagePaintHook*: LPPAGEPAINTHOOK

-    lpPageSetupTemplateName*: LPCTSTR

-    hPageSetupTemplate*: HGLOBAL

-

-  LPPAGESETUPDLG* = ptr TPAGESETUPDLG

-  PPAGESETUPDLG* = ptr TPAGESETUPDLG

-  PPSD* = ptr TPAGESETUPDLG

-  PAINTSTRUCT* {.final, pure.} = object

-    hdc*: HDC

-    fErase*: WINBOOL

-    rcPaint*: RECT

-    fRestore*: WINBOOL

-    fIncUpdate*: WINBOOL

-    rgbReserved*: array[0..31, int8]

-

-  LPPAINTSTRUCT* = ptr PAINTSTRUCT

-  PPAINTSTRUCT* = ptr PAINTSTRUCT

-  PARAFORMAT* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwMask*: DWORD

-    wNumbering*: int16

-    wReserved*: int16

-    dxStartIndent*: LONG

-    dxRightIndent*: LONG

-    dxOffset*: LONG

-    wAlignment*: int16

-    cTabCount*: SHORT

-    rgxTabs*: array[0..(MAX_TAB_STOPS) - 1, LONG]

-

-  Pparaformat* = ptr PARAFORMAT

-  PERF_COUNTER_BLOCK* {.final, pure.} = object

-    ByteLength*: DWORD

-

-  PPERFCOUNTERBLOCK* = ptr PERF_COUNTER_BLOCK

-  PERF_COUNTER_DEFINITION* {.final, pure.} = object

-    ByteLength*: DWORD

-    CounterNameTitleIndex*: DWORD

-    CounterNameTitle*: LPWSTR

-    CounterHelpTitleIndex*: DWORD

-    CounterHelpTitle*: LPWSTR

-    DefaultScale*: DWORD

-    DetailLevel*: DWORD

-    CounterType*: DWORD

-    CounterSize*: DWORD

-    CounterOffset*: DWORD

-

-  PPERFCOUNTERDEFINITION* = ptr PERF_COUNTER_DEFINITION

-  PERF_DATA_BLOCK* {.final, pure.} = object

-    Signature*: array[0..3, WCHAR]

-    LittleEndian*: DWORD

-    Version*: DWORD

-    Revision*: DWORD

-    TotalByteLength*: DWORD

-    HeaderLength*: DWORD

-    NumObjectTypes*: DWORD

-    DefaultObject*: DWORD

-    SystemTime*: SYSTEMTIME

-    PerfTime*: LARGE_INTEGER

-    PerfFreq*: LARGE_INTEGER

-    PerfTime100nSec*: LARGE_INTEGER

-    SystemNameLength*: DWORD

-    SystemNameOffset*: DWORD

-

-  PPERFDATABLOCK* = ptr PERF_DATA_BLOCK

-  PERF_INSTANCE_DEFINITION* {.final, pure.} = object

-    ByteLength*: DWORD

-    ParentObjectTitleIndex*: DWORD

-    ParentObjectInstance*: DWORD

-    UniqueID*: DWORD

-    NameOffset*: DWORD

-    NameLength*: DWORD

-

-  PPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION

-  PERF_OBJECT_TYPE* {.final, pure.} = object

-    TotalByteLength*: DWORD

-    DefinitionLength*: DWORD

-    HeaderLength*: DWORD

-    ObjectNameTitleIndex*: DWORD

-    ObjectNameTitle*: LPWSTR

-    ObjectHelpTitleIndex*: DWORD

-    ObjectHelpTitle*: LPWSTR

-    DetailLevel*: DWORD

-    NumCounters*: DWORD

-    DefaultCounter*: DWORD

-    NumInstances*: DWORD

-    CodePage*: DWORD

-    PerfTime*: LARGE_INTEGER

-    PerfFreq*: LARGE_INTEGER

-

-  PPERFOBJECTTYPE* = ptr PERF_OBJECT_TYPE

-  POLYTEXT* {.final, pure.} = object

-    x*: int32

-    y*: int32

-    n*: WINUINT

-    lpstr*: LPCTSTR

-    uiFlags*: WINUINT

-    rcl*: RECT

-    pdx*: ptr int32

-

-  PPOLYTEXT* = ptr POLYTEXT

-  PORT_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-

-  PPORTINFO1* = ptr PORT_INFO_1

-  PORT_INFO_2* {.final, pure.} = object

-    pPortName*: LPSTR

-    pMonitorName*: LPSTR

-    pDescription*: LPSTR

-    fPortType*: DWORD

-    Reserved*: DWORD

-

-  PPORTINFO2* = ptr PORT_INFO_2

-  PREVENT_MEDIA_REMOVAL* {.final, pure.} = object

-    PreventMediaRemoval*: bool

-

-  PPREVENTMEDIAREMOVAL* = ptr PREVENT_MEDIA_REMOVAL

-  #PRINTDLG = record conflicts with PrintDlg function

-  TPRINTDLG* {.final, pure.} = object

-    lStructSize*: DWORD

-    hwndOwner*: HWND

-    hDevMode*: HANDLE

-    hDevNames*: HANDLE

-    hDC*: HDC

-    Flags*: DWORD

-    nFromPage*: int16

-    nToPage*: int16

-    nMinPage*: int16

-    nMaxPage*: int16

-    nCopies*: int16

-    hInstance*: HINST

-    lCustData*: DWORD

-    lpfnPrintHook*: LPPRINTHOOKPROC

-    lpfnSetupHook*: LPSETUPHOOKPROC

-    lpPrintTemplateName*: LPCTSTR

-    lpSetupTemplateName*: LPCTSTR

-    hPrintTemplate*: HANDLE

-    hSetupTemplate*: HANDLE

-

-  LPPRINTDLG* = ptr TPRINTDLG

-  PPRINTDLG* = ptr TPRINTDLG

-  PPD* = ptr TPRINTDLG

-  PRINTER_DEFAULTS* {.final, pure.} = object

-    pDatatype*: LPTSTR

-    pDevMode*: LPDEVMODE

-    DesiredAccess*: ACCESS_MASK

-

-  PPRINTERDEFAULTS* = ptr PRINTER_DEFAULTS

-  PRINTER_INFO_1* {.final, pure.} = object

-    Flags*: DWORD

-    pDescription*: LPTSTR

-    pName*: LPTSTR

-    pComment*: LPTSTR

-

-  LPPRINTER_INFO_1* = ptr PRINTER_INFO_1

-  PPRINTER_INFO_1* = ptr PRINTER_INFO_1

-  PRINTER_INFO_2* {.final, pure.} = object

-    pServerName*: LPTSTR

-    pPrinterName*: LPTSTR

-    pShareName*: LPTSTR

-    pPortName*: LPTSTR

-    pDriverName*: LPTSTR

-    pComment*: LPTSTR

-    pLocation*: LPTSTR

-    pDevMode*: LPDEVMODE

-    pSepFile*: LPTSTR

-    pPrintProcessor*: LPTSTR

-    pDatatype*: LPTSTR

-    pParameters*: LPTSTR

-    pSecurityDescriptor*: PSECURITY_DESCRIPTOR

-    Attributes*: DWORD

-    Priority*: DWORD

-    DefaultPriority*: DWORD

-    StartTime*: DWORD

-    UntilTime*: DWORD

-    Status*: DWORD

-    cJobs*: DWORD

-    AveragePPM*: DWORD

-

-  PPRINTERINFO2* = ptr PRINTER_INFO_2

-  PRINTER_INFO_3* {.final, pure.} = object

-    pSecurityDescriptor*: PSECURITY_DESCRIPTOR

-

-  PPRINTERINFO3* = ptr PRINTER_INFO_3

-  PRINTER_INFO_4* {.final, pure.} = object

-    pPrinterName*: LPTSTR

-    pServerName*: LPTSTR

-    Attributes*: DWORD

-

-  PPRINTERINFO4* = ptr PRINTER_INFO_4

-  PRINTER_INFO_5* {.final, pure.} = object

-    pPrinterName*: LPTSTR

-    pPortName*: LPTSTR

-    Attributes*: DWORD

-    DeviceNotSelectedTimeout*: DWORD

-    TransmissionRetryTimeout*: DWORD

-

-  PPRINTERINFO5* = ptr PRINTER_INFO_5

-  PRINTER_NOTIFY_INFO_DATA* {.final, pure.} = object

-    `type`*: int16

-    Field*: int16

-    Reserved*: DWORD

-    Id*: DWORD

-    cbBuf*: DWORD

-    pBuf*: LPVOID

-

-  PPRINTERNOTIFYINFODATA* = ptr PRINTER_NOTIFY_INFO_DATA

-  PRINTER_NOTIFY_INFO* {.final, pure.} = object

-    Version*: DWORD

-    Flags*: DWORD

-    Count*: DWORD

-    aData*: array[0..0, PRINTER_NOTIFY_INFO_DATA]

-

-  PPRINTERNOTIFYINFO* = ptr PRINTER_NOTIFY_INFO

-  PRINTER_NOTIFY_OPTIONS_TYPE* {.final, pure.} = object

-    `type`*: int16

-    Reserved0*: int16

-    Reserved1*: DWORD

-    Reserved2*: DWORD

-    Count*: DWORD

-    pFields*: PWORD

-

-  PPRINTER_NOTIFY_OPTIONS_TYPE* = ptr PRINTER_NOTIFY_OPTIONS_TYPE

-  PRINTER_NOTIFY_OPTIONS* {.final, pure.} = object

-    Version*: DWORD

-    Flags*: DWORD

-    Count*: DWORD

-    pTypes*: PPRINTER_NOTIFY_OPTIONS_TYPE

-

-  PPRINTERNOTIFYOPTIONS* = ptr PRINTER_NOTIFY_OPTIONS

-  PRINTPROCESSOR_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-

-  PPRINTPROCESSORINFO1* = ptr PRINTPROCESSOR_INFO_1

-  PRIVILEGE_SET* {.final, pure.} = object

-    PrivilegeCount*: DWORD

-    Control*: DWORD

-    Privilege*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES]

-

-  LPPRIVILEGE_SET* = ptr PRIVILEGE_SET

-  PPRIVILEGE_SET* = ptr PRIVILEGE_SET

-  PROCESS_HEAPENTRY* {.final, pure.} = object

-    lpData*: PVOID

-    cbData*: DWORD

-    cbOverhead*: int8

-    iRegionIndex*: int8

-    wFlags*: int16

-    dwCommittedSize*: DWORD

-    dwUnCommittedSize*: DWORD

-    lpFirstBlock*: LPVOID

-    lpLastBlock*: LPVOID

-    hMem*: HANDLE

-

-  LPPROCESS_HEAP_ENTRY* = ptr PROCESS_HEAPENTRY

-  PPROCESSHEAPENTRY* = ptr PROCESS_HEAPENTRY

-  PROCESS_INFORMATION* {.final, pure.} = object

-    hProcess*: HANDLE

-    hThread*: HANDLE

-    dwProcessId*: DWORD

-    dwThreadId*: DWORD

-

-  LPPROCESS_INFORMATION* = ptr PROCESS_INFORMATION

-  PPROCESSINFORMATION* = ptr PROCESS_INFORMATION

-  LPFNPSPCALLBACK* = proc (para1: HWND, para2: WINUINT, para3: LPVOID): WINUINT{.

-      stdcall.}

-  PROPSHEETPAGE* {.final, pure.} = object

-    dwSize*: DWORD

-    dwFlags*: DWORD

-    hInstance*: HINST

-    pszIcon*: LPCTSTR

-    pszTitle*: LPCTSTR

-    pfnDlgProc*: DLGPROC

-    lParam*: LPARAM

-    pfnCallback*: LPFNPSPCALLBACK

-    pcRefParent*: ptr WINUINT

-

-  LPPROPSHEETPAGE* = ptr PROPSHEETPAGE

-  LPCPROPSHEETPAGE* = ptr PROPSHEETPAGE

-  PPROPSHEETPAGE* = ptr PROPSHEETPAGE

-  emptyrecord* {.final, pure.} = object

-  lpemptyrecord* = ptr emptyrecord

-  HPROPSHEETPAGE* = ptr emptyrecord

-  PROPSHEETHEADER* {.final, pure.} = object

-    dwSize*: DWORD

-    dwFlags*: DWORD

-    hwndParent*: HWND

-    hInstance*: HINST

-    pszIcon*: LPCTSTR

-    pszCaption*: LPCTSTR

-    nPages*: WINUINT

-    pStartPage*: LPCTSTR

-    phpage*: ptr HPROPSHEETPAGE

-    pfnCallback*: PFNPROPSHEETCALLBACK

-    pszbmWatermark*: LPCTSTR

-    hplWatermark*: HPALETTE

-    pszbmHeader*: cstring

-

-  LPPROPSHEETHEADER* = ptr PROPSHEETHEADER

-  LPCPROPSHEETHEADER* = ptr PROPSHEETHEADER

-  PPROPSHEETHEADER* = ptr PROPSHEETHEADER

-  # PropertySheet callbacks

-  LPFNADDPROPSHEETPAGE* = proc (para1: HPROPSHEETPAGE, para2: LPARAM): WINBOOL{.

-      stdcall.}

-  LPFNADDPROPSHEETPAGES* = proc (para1: LPVOID, para2: LPFNADDPROPSHEETPAGE,

-                                 para3: LPARAM): WINBOOL{.stdcall.}

-  PROTOCOL_INFO* {.final, pure.} = object

-    dwServiceFlags*: DWORD

-    iAddressFamily*: WINT

-    iMaxSockAddr*: WINT

-    iMinSockAddr*: WINT

-    iSocketType*: WINT

-    iProtocol*: WINT

-    dwMessageSize*: DWORD

-    lpProtocol*: LPTSTR

-

-  PPROTOCOLINFO* = ptr PROTOCOL_INFO

-  PROVIDOR_INFO_1* {.final, pure.} = object

-    pName*: LPTSTR

-    pEnvironment*: LPTSTR

-    pDLLName*: LPTSTR

-

-  PPROVIDORINFO1* = ptr PROVIDOR_INFO_1

-  PSHNOTIFY* {.final, pure.} = object

-    hdr*: NMHDR

-    lParam*: LPARAM

-

-  LPPSHNOTIFY* = ptr PSHNOTIFY

-  PPSHNOTIFY* = ptr PSHNOTIFY

-  PUNCTUATION* {.final, pure.} = object

-    iSize*: WINUINT

-    szPunctuation*: LPSTR

-

-  Ppunctuation* = ptr PUNCTUATION

-  TQUERY_SERVICE_CONFIG* {.final, pure.} = object # Name conflict if we drop the `T`

-    dwServiceType*: DWORD

-    dwStartType*: DWORD

-    dwErrorControl*: DWORD

-    lpBinaryPathName*: LPTSTR

-    lpLoadOrderGroup*: LPTSTR

-    dwTagId*: DWORD

-    lpDependencies*: LPTSTR

-    lpServiceStartName*: LPTSTR

-    lpDisplayName*: LPTSTR

-

-  LPQUERY_SERVICE_CONFIG* = ptr TQUERY_SERVICE_CONFIG

-  PQUERYSERVICECONFIG* = ptr TQUERY_SERVICE_CONFIG

-  TQUERY_SERVICE_LOCK_STATUS* {.final, pure.} = object # Name conflict if we drop the `T`

-    fIsLocked*: DWORD

-    lpLockOwner*: LPTSTR

-    dwLockDuration*: DWORD

-

-  LPQUERY_SERVICE_LOCK_STATUS* = ptr TQUERY_SERVICE_LOCK_STATUS

-  PQUERYSERVICELOCKSTATUS* = ptr TQUERY_SERVICE_LOCK_STATUS

-  RASAMB* {.final, pure.} = object

-    dwSize*: DWORD

-    dwError*: DWORD

-    szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, CHAR]

-    bLana*: int8

-

-  PRASAMB* = ptr RASAMB

-  RASCONN* {.final, pure.} = object

-    dwSize*: DWORD

-    hrasconn*: HRASCONN

-    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, CHAR]

-    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, char]

-    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, char]

-

-  PRASCONN* = ptr RASCONN

-  RASCONNSTATUS* {.final, pure.} = object

-    dwSize*: DWORD

-    rasconnstate*: RASCONNSTATE

-    dwError*: DWORD

-    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, CHAR]

-    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, CHAR]

-

-  PRASCONNSTATUS* = ptr RASCONNSTATUS

-  RASDIALEXTENSIONS* {.final, pure.} = object

-    dwSize*: DWORD

-    dwfOptions*: DWORD

-    hwndParent*: HWND

-    reserved*: DWORD

-

-  PRASDIALEXTENSIONS* = ptr RASDIALEXTENSIONS

-  RASDIALPARAMS* {.final, pure.} = object

-    dwSize*: DWORD

-    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, CHAR]

-    szPhoneNumber*: array[0..(RAS_MaxPhoneNumber + 1) - 1, CHAR]

-    szCallbackNumber*: array[0..(RAS_MaxCallbackNumber + 1) - 1, CHAR]

-    szUserName*: array[0..(UNLEN + 1) - 1, CHAR]

-    szPassword*: array[0..(PWLEN + 1) - 1, CHAR]

-    szDomain*: array[0..(DNLEN + 1) - 1, CHAR]

-

-  PRASDIALPARAMS* = ptr RASDIALPARAMS

-  RASENTRYNAME* {.final, pure.} = object

-    dwSize*: DWORD

-    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, CHAR]

-

-  PRASENTRYNAME* = ptr RASENTRYNAME

-  RASPPPIP* {.final, pure.} = object

-    dwSize*: DWORD

-    dwError*: DWORD

-    szIpAddress*: array[0..(RAS_MaxIpAddress + 1) - 1, CHAR]

-

-  PRASPPPIP* = ptr RASPPPIP

-  RASPPPIPX* {.final, pure.} = object

-    dwSize*: DWORD

-    dwError*: DWORD

-    szIpxAddress*: array[0..(RAS_MaxIpxAddress + 1) - 1, CHAR]

-

-  PRASPPPIPX* = ptr RASPPPIPX

-  RASPPPNBF* {.final, pure.} = object

-    dwSize*: DWORD

-    dwError*: DWORD

-    dwNetBiosError*: DWORD

-    szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, CHAR]

-    szWorkstationName*: array[0..(NETBIOS_NAME_LEN + 1) - 1, CHAR]

-    bLana*: int8

-

-  PRASPPPNBF* = ptr RASPPPNBF

-  RASTERIZER_STATUS* {.final, pure.} = object

-    nSize*: SHORT

-    wFlags*: SHORT

-    nLanguageID*: SHORT

-

-  LPRASTERIZER_STATUS* = ptr RASTERIZER_STATUS

-  PRASTERIZERSTATUS* = ptr RASTERIZER_STATUS

-  REASSIGN_BLOCKS* {.final, pure.} = object

-    Reserved*: int16

-    Count*: int16

-    BlockNumber*: array[0..0, DWORD]

-

-  PREASSIGNBLOCKS* = ptr REASSIGN_BLOCKS

-  REMOTE_NAME_INFO* {.final, pure.} = object

-    lpUniversalName*: LPTSTR

-    lpConnectionName*: LPTSTR

-    lpRemainingPath*: LPTSTR

-

-  PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO

-

-  REPASTESPECIAL* {.final, pure.} = object

-    dwAspect*: DWORD

-    dwParam*: DWORD

-

-  Prepastespecial* = ptr REPASTESPECIAL

-  REQRESIZE* {.final, pure.} = object

-    nmhdr*: NMHDR

-    rc*: RECT

-

-  Preqresize* = ptr REQRESIZE

-  RGNDATAHEADER* {.final, pure.} = object

-    dwSize*: DWORD

-    iType*: DWORD

-    nCount*: DWORD

-    nRgnSize*: DWORD

-    rcBound*: RECT

-

-  PRGNDATAHEADER* = ptr RGNDATAHEADER

-  RGNDATA* {.final, pure.} = object

-    rdh*: RGNDATAHEADER

-    Buffer*: array[0..0, char]

-

-  LPRGNDATA* = ptr RGNDATA

-  PRGNDATA* = ptr RGNDATA

-  SCROLLINFO* {.final, pure.} = object

-    cbSize*: WINUINT

-    fMask*: WINUINT

-    nMin*: int32

-    nMax*: int32

-    nPage*: WINUINT

-    nPos*: int32

-    nTrackPos*: int32

-

-  LPSCROLLINFO* = ptr SCROLLINFO

-  LPCSCROLLINFO* = ptr SCROLLINFO

-  PSCROLLINFO* = ptr SCROLLINFO

-  SECURITY_ATTRIBUTES* {.final, pure.} = object

-    nLength*: DWORD

-    lpSecurityDescriptor*: LPVOID

-    bInheritHandle*: WINBOOL

-

-  LPSECURITY_ATTRIBUTES* = ptr SECURITY_ATTRIBUTES

-  PSECURITYATTRIBUTES* = ptr SECURITY_ATTRIBUTES

-  SECURITY_INFORMATION* = DWORD

-  PSECURITY_INFORMATION* = ptr SECURITY_INFORMATION

-  SELCHANGE* {.final, pure.} = object

-    nmhdr*: NMHDR

-    chrg*: CHARRANGE

-    seltyp*: int16

-

-  Pselchange* = ptr SELCHANGE

-  SERIALKEYS* {.final, pure.} = object

-    cbSize*: DWORD

-    dwFlags*: DWORD

-    lpszActivePort*: LPSTR

-    lpszPort*: LPSTR

-    iBaudRate*: DWORD

-    iPortState*: DWORD

-

-  LPSERIALKEYS* = ptr SERIALKEYS

-  PSERIALKEYS* = ptr SERIALKEYS

-  SERVICE_TABLE_ENTRY* {.final, pure.} = object

-    lpServiceName*: LPTSTR

-    lpServiceProc*: LPSERVICE_MAIN_FUNCTION

-

-  LPSERVICE_TABLE_ENTRY* = ptr SERVICE_TABLE_ENTRY

-  PSERVICETABLEENTRY* = ptr SERVICE_TABLE_ENTRY

-  SERVICE_TYPE_VALUE_ABS* {.final, pure.} = object

-    dwNameSpace*: DWORD

-    dwValueType*: DWORD

-    dwValueSize*: DWORD

-    lpValueName*: LPTSTR

-    lpValue*: PVOID

-

-  PSERVICETYPEVALUEABS* = ptr SERVICE_TYPE_VALUE_ABS

-  SERVICE_TYPE_INFO_ABS* {.final, pure.} = object

-    lpTypeName*: LPTSTR

-    dwValueCount*: DWORD

-    Values*: array[0..0, SERVICE_TYPE_VALUE_ABS]

-

-  PSERVICETYPEINFOABS* = ptr SERVICE_TYPE_INFO_ABS

-  SESSION_BUFFER* {.final, pure.} = object

-    lsn*: UCHAR

-    state*: UCHAR

-    local_name*: array[0..(NCBNAMSZ) - 1, UCHAR]

-    remote_name*: array[0..(NCBNAMSZ) - 1, UCHAR]

-    rcvs_outstanding*: UCHAR

-    sends_outstanding*: UCHAR

-

-  PSESSIONBUFFER* = ptr SESSION_BUFFER

-  SESSION_HEADER* {.final, pure.} = object

-    sess_name*: UCHAR

-    num_sess*: UCHAR

-    rcv_dg_outstanding*: UCHAR

-    rcv_any_outstanding*: UCHAR

-

-  PSESSIONHEADER* = ptr SESSION_HEADER

-  SET_PARTITION_INFORMATION* {.final, pure.} = object

-    PartitionType*: int8

-

-  PSETPARTITIONINFORMATION* = ptr SET_PARTITION_INFORMATION

-  SHCONTF* = enum

-    SHCONTF_FOLDERS = 32, SHCONTF_NONFOLDERS = 64, SHCONTF_INCLUDEHIDDEN = 128

-  SHFILEINFO* {.final, pure.} = object

-    hIcon*: HICON

-    iIcon*: int32

-    dwAttributes*: DWORD

-    szDisplayName*: array[0..(MAX_PATH) - 1, char]

-    szTypeName*: array[0..79, char]

-

-  PSHFILEINFO* = ptr SHFILEINFO

-  FILEOP_FLAGS* = int16

-  PFILEOPFLAGS* = ptr FILEOP_FLAGS

-  SHFILEOPSTRUCT* {.final, pure.} = object

-    hwnd*: HWND

-    wFunc*: WINUINT

-    pFrom*: LPCSTR

-    pTo*: LPCSTR

-    fFlags*: FILEOP_FLAGS

-    fAnyOperationsAborted*: WINBOOL

-    hNameMappings*: LPVOID

-    lpszProgressTitle*: LPCSTR

-

-  LPSHFILEOPSTRUCT* = ptr SHFILEOPSTRUCT

-  PSHFILEOPSTRUCT* = ptr SHFILEOPSTRUCT

-  SHGNO* = enum

-    SHGDN_NORMAL = 0, SHGDN_INFOLDER = 1, SHGDN_FORPARSING = 0x00008000

-  SHNAMEMAPPING* {.final, pure.} = object

-    pszOldPath*: LPSTR

-    pszNewPath*: LPSTR

-    cchOldPath*: int32

-    cchNewPath*: int32

-

-  LPSHNAMEMAPPING* = ptr SHNAMEMAPPING

-  PSHNAMEMAPPING* = ptr SHNAMEMAPPING

-  SID_AND_ATTRIBUTES* {.final, pure.} = object

-    Sid*: PSID

-    Attributes*: DWORD

-

-  PSIDANDATTRIBUTES* = ptr SID_AND_ATTRIBUTES

-  SID_AND_ATTRIBUTES_ARRAY* = array[0..(ANYSIZE_ARRAY) - 1, SID_AND_ATTRIBUTES]

-  PSID_AND_ATTRIBUTES_ARRAY* = ptr SID_AND_ATTRIBUTES_ARRAY

-  SINGLE_LIST_ENTRY* {.final, pure.} = object

-    Next*: ptr SINGLE_LIST_ENTRY

-

-  PSINGLELISTENTRY* = ptr SINGLE_LIST_ENTRY

-  SOUNDSENTRY* {.final, pure.} = object

-    cbSize*: WINUINT

-    dwFlags*: DWORD

-    iFSTextEffect*: DWORD

-    iFSTextEffectMSec*: DWORD

-    iFSTextEffectColorBits*: DWORD

-    iFSGrafEffect*: DWORD

-    iFSGrafEffectMSec*: DWORD

-    iFSGrafEffectColor*: DWORD

-    iWindowsEffect*: DWORD

-    iWindowsEffectMSec*: DWORD

-    lpszWindowsEffectDLL*: LPTSTR

-    iWindowsEffectOrdinal*: DWORD

-

-  LPSOUNDSENTRY* = ptr SOUNDSENTRY

-  PSOUNDSENTRY* = ptr SOUNDSENTRY

-  STARTUPINFO* {.final, pure.} = object

-    cb*: DWORD

-    lpReserved*: LPTSTR

-    lpDesktop*: LPTSTR

-    lpTitle*: LPTSTR

-    dwX*: DWORD

-    dwY*: DWORD

-    dwXSize*: DWORD

-    dwYSize*: DWORD

-    dwXCountChars*: DWORD

-    dwYCountChars*: DWORD

-    dwFillAttribute*: DWORD

-    dwFlags*: DWORD

-    wShowWindow*: int16

-    cbReserved2*: int16

-    lpReserved2*: LPBYTE

-    hStdInput*: HANDLE

-    hStdOutput*: HANDLE

-    hStdError*: HANDLE

-

-  LPSTARTUPINFO* = ptr STARTUPINFO

-  PSTARTUPINFO* = ptr STARTUPINFO

-  STICKYKEYS* {.final, pure.} = object

-    cbSize*: DWORD

-    dwFlags*: DWORD

-

-  LPSTICKYKEYS* = ptr STICKYKEYS

-  PSTICKYKEYS* = ptr STICKYKEYS

-  STRRET* {.final, pure.} = object

-    uType*: WINUINT

-    cStr*: array[0..(MAX_PATH) - 1, char]

-

-  LPSTRRET* = ptr STRRET

-  PSTRRET* = ptr STRRET

-  STYLEBUF* {.final, pure.} = object

-    dwStyle*: DWORD

-    szDescription*: array[0..31, char]

-

-  LPSTYLEBUF* = ptr STYLEBUF

-  PSTYLEBUF* = ptr STYLEBUF

-  STYLESTRUCT* {.final, pure.} = object

-    styleOld*: DWORD

-    styleNew*: DWORD

-

-  LPSTYLESTRUCT* = ptr STYLESTRUCT

-  PSTYLESTRUCT* = ptr STYLESTRUCT

-  SYSTEM_AUDIT_ACE* {.final, pure.} = object

-    Header*: ACE_HEADER

-    Mask*: ACCESS_MASK

-    SidStart*: DWORD

-

-  PSYSTEMAUDITACE* = ptr SYSTEM_AUDIT_ACE

-  SYSTEM_INFO* {.final, pure.} = object

-    dwOemId*: DWORD

-    dwPageSize*: DWORD

-    lpMinimumApplicationAddress*: LPVOID

-    lpMaximumApplicationAddress*: LPVOID

-    dwActiveProcessorMask*: DWORD_PTR

-    dwNumberOfProcessors*: DWORD

-    dwProcessorType*: DWORD

-    dwAllocationGranularity*: DWORD

-    wProcessorLevel*: int16

-    wProcessorRevision*: int16

-

-  LPSYSTEM_INFO* = ptr SYSTEM_INFO

-  PSYSTEMINFO* = ptr SYSTEM_INFO

-  SYSTEM_POWER_STATUS* {.final, pure.} = object

-    ACLineStatus*: int8

-    BatteryFlag*: int8

-    BatteryLifePercent*: int8

-    Reserved1*: int8

-    BatteryLifeTime*: DWORD

-    BatteryFullLifeTime*: DWORD

-

-  PSYSTEMPOWERSTATUS* = ptr SYSTEM_POWER_STATUS

-  LPSYSTEM_POWER_STATUS* = ptr emptyrecord

-  TAPE_ERASE* {.final, pure.} = object

-    `type`*: ULONG

-

-  PTAPEERASE* = ptr TAPE_ERASE

-  TAPE_GET_DRIVE_PARAMETERS* {.final, pure.} = object

-    ECC*: bool

-    Compression*: bool

-    DataPadding*: bool

-    ReportSetmarks*: bool

-    DefaultBlockSize*: ULONG

-    MaximumBlockSize*: ULONG

-    MinimumBlockSize*: ULONG

-    MaximumPartitionCount*: ULONG

-    FeaturesLow*: ULONG

-    FeaturesHigh*: ULONG

-    EOTWarningZoneSize*: ULONG

-

-  PTAPEGETDRIVEPARAMETERS* = ptr TAPE_GET_DRIVE_PARAMETERS

-  TAPE_GET_MEDIA_PARAMETERS* {.final, pure.} = object

-    Capacity*: LARGE_INTEGER

-    Remaining*: LARGE_INTEGER

-    BlockSize*: DWORD

-    PartitionCount*: DWORD

-    WriteProtected*: bool

-

-  PTAPEGETMEDIAPARAMETERS* = ptr TAPE_GET_MEDIA_PARAMETERS

-  TAPE_GET_POSITION* {.final, pure.} = object

-    `type`*: ULONG

-    Partition*: ULONG

-    OffsetLow*: ULONG

-    OffsetHigh*: ULONG

-

-  PTAPEGETPOSITION* = ptr TAPE_GET_POSITION

-  TAPE_PREPARE* {.final, pure.} = object

-    Operation*: ULONG

-

-  PTAPEPREPARE* = ptr TAPE_PREPARE

-  TAPE_SET_DRIVE_PARAMETERS* {.final, pure.} = object

-    ECC*: bool

-    Compression*: bool

-    DataPadding*: bool

-    ReportSetmarks*: bool

-    EOTWarningZoneSize*: ULONG

-

-  PTAPESETDRIVEPARAMETERS* = ptr TAPE_SET_DRIVE_PARAMETERS

-  TAPE_SET_MEDIA_PARAMETERS* {.final, pure.} = object

-    BlockSize*: ULONG

-

-  PTAPESETMEDIAPARAMETERS* = ptr TAPE_SET_MEDIA_PARAMETERS

-  TAPE_SET_POSITION* {.final, pure.} = object

-    `Method`*: ULONG

-    Partition*: ULONG

-    OffsetLow*: ULONG

-    OffsetHigh*: ULONG

-

-  PTAPESETPOSITION* = ptr TAPE_SET_POSITION

-  TAPE_WRITE_MARKS* {.final, pure.} = object

-    `type`*: ULONG

-    Count*: ULONG

-

-  PTAPEWRITEMARKS* = ptr TAPE_WRITE_MARKS

-  TTBADDBITMAP* {.final, pure.} = object # Name conflict if we drop the `T`

-    hInst*: HINST

-    nID*: WINUINT

-

-  LPTBADDBITMAP* = ptr TTBADDBITMAP

-  PTBADDBITMAP* = ptr TTBADDBITMAP

-  TBBUTTON* {.final, pure.} = object

-    iBitmap*: int32

-    idCommand*: int32

-    fsState*: int8

-    fsStyle*: int8

-    dwData*: DWORD

-    iString*: int32

-

-  LPTBBUTTON* = ptr TBBUTTON

-  LPCTBBUTTON* = ptr TBBUTTON

-  PTBBUTTON* = ptr TBBUTTON

-  TBNOTIFY* {.final, pure.} = object

-    hdr*: NMHDR

-    iItem*: int32

-    tbButton*: TBBUTTON

-    cchText*: int32

-    pszText*: LPTSTR

-

-  LPTBNOTIFY* = ptr TBNOTIFY

-  PTBNOTIFY* = ptr TBNOTIFY

-  TBSAVEPARAMS* {.final, pure.} = object

-    hkr*: HKEY

-    pszSubKey*: LPCTSTR

-    pszValueName*: LPCTSTR

-

-  PTBSAVEPARAMS* = ptr TBSAVEPARAMS

-  TC_HITTESTINFO* {.final, pure.} = object

-    pt*: POINT

-    flags*: WINUINT

-

-  PTCHITTESTINFO* = ptr TC_HITTESTINFO

-  TC_ITEM* {.final, pure.} = object

-    mask*: WINUINT

-    lpReserved1*: WINUINT

-    lpReserved2*: WINUINT

-    pszText*: LPTSTR

-    cchTextMax*: int32

-    iImage*: int32

-    lParam*: LPARAM

-

-  PTCITEM* = ptr TC_ITEM

-  TC_ITEMHEADER* {.final, pure.} = object

-    mask*: WINUINT

-    lpReserved1*: WINUINT

-    lpReserved2*: WINUINT

-    pszText*: LPTSTR

-    cchTextMax*: int32

-    iImage*: int32

-

-  PTCITEMHEADER* = ptr TC_ITEMHEADER

-  TC_KEYDOWN* {.final, pure.} = object

-    hdr*: NMHDR

-    wVKey*: int16

-    flags*: WINUINT

-

-  PTCKEYDOWN* = ptr TC_KEYDOWN

-  TEXTRANGE* {.final, pure.} = object

-    chrg*: CHARRANGE

-    lpstrText*: LPSTR

-

-  Ptextrange* = ptr TEXTRANGE

-  TIME_ZONE_INFORMATION* {.final, pure.} = object

-    Bias*: LONG

-    StandardName*: array[0..31, WCHAR]

-    StandardDate*: SYSTEMTIME

-    StandardBias*: LONG

-    DaylightName*: array[0..31, WCHAR]

-    DaylightDate*: SYSTEMTIME

-    DaylightBias*: LONG

-

-  LPTIME_ZONE_INFORMATION* = ptr TIME_ZONE_INFORMATION

-  PTIMEZONEINFORMATION* = ptr TIME_ZONE_INFORMATION

-  TOGGLEKEYS* {.final, pure.} = object

-    cbSize*: DWORD

-    dwFlags*: DWORD

-

-  PTOGGLEKEYS* = ptr TOGGLEKEYS

-  TTOKEN_SOURCE* {.final, pure.} = object # Name confict if we drop the `T`

-    SourceName*: array[0..7, char]

-    SourceIdentifier*: LUID

-

-  PTOKENSOURCE* = ptr TTOKEN_SOURCE

-  TOKEN_CONTROL* {.final, pure.} = object

-    TokenId*: LUID

-    AuthenticationId*: LUID

-    ModifiedId*: LUID

-    TokenSource*: TTOKEN_SOURCE

-

-  PTOKENCONTROL* = ptr TOKEN_CONTROL

-  TTOKEN_DEFAULT_DACL* {.final, pure.} = object

-    DefaultDacl*: PACL

-

-  PTOKENDEFAULTDACL* = ptr TTOKEN_DEFAULT_DACL # Name conflict if we drop the `T`

-  TTOKEN_GROUPS* {.final, pure.} = object # Name conflict if we drop the `T`

-    GroupCount*: DWORD

-    Groups*: array[0..(ANYSIZE_ARRAY) - 1, SID_AND_ATTRIBUTES]

-

-  LPTOKEN_GROUPS* = ptr TTOKEN_GROUPS

-  PTOKENGROUPS* = ptr TTOKEN_GROUPS

-  TTOKEN_OWNER* {.final, pure.} = object # Name conflict if we drop the `T`

-    Owner*: PSID

-

-  PTOKENOWNER* = ptr TTOKEN_OWNER

-  TTOKEN_PRIMARY_GROUP* {.final, pure.} = object

-    PrimaryGroup*: PSID

-

-  PTOKENPRIMARYGROUP* = ptr TTOKEN_PRIMARY_GROUP # Name conflict if we drop the `T`

-  TTOKEN_PRIVILEGES* {.final, pure.} = object # Name conflict if we drop the `T`

-    PrivilegeCount*: DWORD

-    Privileges*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES]

-

-  PTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES

-  LPTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES

-  TTOKEN_STATISTICS* {.final, pure.} = object # Name conflict if we drop the `T`

-    TokenId*: LUID

-    AuthenticationId*: LUID

-    ExpirationTime*: LARGE_INTEGER

-    TokenType*: TTOKEN_TYPE

-    ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL

-    DynamicCharged*: DWORD

-    DynamicAvailable*: DWORD

-    GroupCount*: DWORD

-    PrivilegeCount*: DWORD

-    ModifiedId*: LUID

-

-  PTOKENSTATISTICS* = ptr TTOKEN_STATISTICS

-  TTOKEN_USER* {.final, pure.} = object # Name conflict if we drop the `T`

-    User*: SID_AND_ATTRIBUTES

-

-  PTOKENUSER* = ptr TTOKEN_USER

-  TOOLINFO* {.final, pure.} = object

-    cbSize*: WINUINT

-    uFlags*: WINUINT

-    hwnd*: HWND

-    uId*: WINUINT

-    rect*: RECT

-    hinst*: HINST

-    lpszText*: LPTSTR

-

-  LPTOOLINFO* = ptr TOOLINFO

-  PTOOLINFO* = ptr TOOLINFO

-  TOOLTIPTEXT* {.final, pure.} = object

-    hdr*: NMHDR

-    lpszText*: LPTSTR

-    szText*: array[0..79, char]

-    hinst*: HINST

-    uFlags*: WINUINT

-

-  LPTOOLTIPTEXT* = ptr TOOLTIPTEXT

-  PTOOLTIPTEXT* = ptr TOOLTIPTEXT

-  TPMPARAMS* {.final, pure.} = object

-    cbSize*: WINUINT

-    rcExclude*: RECT

-

-  LPTPMPARAMS* = ptr TPMPARAMS

-  PTPMPARAMS* = ptr TPMPARAMS

-  TRANSMIT_FILE_BUFFERS* {.final, pure.} = object

-    Head*: PVOID

-    HeadLength*: DWORD

-    Tail*: PVOID

-    TailLength*: DWORD

-

-  PTRANSMITFILEBUFFERS* = ptr TRANSMIT_FILE_BUFFERS

-  TTHITTESTINFO* {.final, pure.} = object

-    hwnd*: HWND

-    pt*: POINT

-    ti*: TOOLINFO

-

-  LPHITTESTINFO* = ptr TTHITTESTINFO

-  PTTHITTESTINFO* = ptr TTHITTESTINFO

-  TTPOLYCURVE* {.final, pure.} = object

-    wType*: int16

-    cpfx*: int16

-    apfx*: array[0..0, POINTFX]

-

-  LPTTPOLYCURVE* = ptr TTPOLYCURVE

-  PTTPOLYCURVE* = ptr TTPOLYCURVE

-  TTPOLYGONHEADER* {.final, pure.} = object

-    cb*: DWORD

-    dwType*: DWORD

-    pfxStart*: POINTFX

-

-  LPTTPOLYGONHEADER* = ptr TTPOLYGONHEADER

-  PTTPOLYGONHEADER* = ptr TTPOLYGONHEADER

-  TV_DISPINFO* {.final, pure.} = object

-    hdr*: NMHDR

-    item*: TV_ITEM

-

-  PTVDISPINFO* = ptr TV_DISPINFO

-  TV_HITTESTINFO* {.final, pure.} = object

-    pt*: POINT

-    flags*: WINUINT

-    hItem*: HTREEITEM

-

-  LPTV_HITTESTINFO* = ptr TV_HITTESTINFO

-  PTVHITTESTINFO* = ptr TV_HITTESTINFO

-  TV_INSERTSTRUCT* {.final, pure.} = object

-    hParent*: HTREEITEM

-    hInsertAfter*: HTREEITEM

-    item*: TV_ITEM

-

-  LPTV_INSERTSTRUCT* = ptr TV_INSERTSTRUCT

-  PTVINSERTSTRUCT* = ptr TV_INSERTSTRUCT

-  TV_KEYDOWN* {.final, pure.} = object

-    hdr*: NMHDR

-    wVKey*: int16

-    flags*: WINUINT

-

-  PTVKEYDOWN* = ptr TV_KEYDOWN

-  TV_SORTCB* {.final, pure.} = object

-    hParent*: HTREEITEM

-    lpfnCompare*: PFNTVCOMPARE

-    lParam*: LPARAM

-

-  LPTV_SORTCB* = ptr TV_SORTCB

-  PTVSORTCB* = ptr TV_SORTCB

-  UDACCEL* {.final, pure.} = object

-    nSec*: WINUINT

-    nInc*: WINUINT

-

-  PUDACCEL* = ptr UDACCEL

-  UNIVERSAL_NAME_INFO* {.final, pure.} = object

-    lpUniversalName*: LPTSTR

-

-  PUNIVERSALNAMEINFO* = ptr UNIVERSAL_NAME_INFO

-  USEROBJECTFLAGS* {.final, pure.} = object

-    fInherit*: WINBOOL

-    fReserved*: WINBOOL

-    dwFlags*: DWORD

-

-  PUSEROBJECTFLAGS* = ptr USEROBJECTFLAGS

-  VALENT* {.final, pure.} = object

-    ve_valuename*: LPTSTR

-    ve_valuelen*: DWORD

-    ve_valueptr*: DWORD

-    ve_type*: DWORD

-

-  PVALENT* = ptr VALENT

-  value_ent* = VALENT

-  Pvalue_ent* = ptr VALENT

-  VERIFY_INFORMATION* {.final, pure.} = object

-    StartingOffset*: LARGE_INTEGER

-    len*: DWORD

-

-  PVERIFYINFORMATION* = ptr VERIFY_INFORMATION

-  VS_FIXEDFILEINFO* {.final, pure.} = object

-    dwSignature*: DWORD

-    dwStrucVersion*: DWORD

-    dwFileVersionMS*: DWORD

-    dwFileVersionLS*: DWORD

-    dwProductVersionMS*: DWORD

-    dwProductVersionLS*: DWORD

-    dwFileFlagsMask*: DWORD

-    dwFileFlags*: DWORD

-    dwFileOS*: DWORD

-    dwFileType*: DWORD

-    dwFileSubtype*: DWORD

-    dwFileDateMS*: DWORD

-    dwFileDateLS*: DWORD

-

-  PVSFIXEDFILEINFO* = ptr VS_FIXEDFILEINFO

-  WIN32_FIND_DATA* {.final, pure.} = object

-    dwFileAttributes*: DWORD

-    ftCreationTime*: FILETIME

-    ftLastAccessTime*: FILETIME

-    ftLastWriteTime*: FILETIME

-    nFileSizeHigh*: DWORD

-    nFileSizeLow*: DWORD

-    dwReserved0*: DWORD

-    dwReserved1*: DWORD

-    cFileName*: array[0..(MAX_PATH) - 1, CHAR]

-    cAlternateFileName*: array[0..13, CHAR]

-

-  LPWIN32_FIND_DATA* = ptr WIN32_FIND_DATA

-  PWIN32_FIND_DATA* = ptr WIN32_FIND_DATA

-  WIN32_FIND_DATAW* {.final, pure.} = object

-    dwFileAttributes*: DWORD

-    ftCreationTime*: FILETIME

-    ftLastAccessTime*: FILETIME

-    ftLastWriteTime*: FILETIME

-    nFileSizeHigh*: DWORD

-    nFileSizeLow*: DWORD

-    dwReserved0*: DWORD

-    dwReserved1*: DWORD

-    cFileName*: array[0..(MAX_PATH) - 1, WCHAR]

-    cAlternateFileName*: array[0..13, WCHAR]

-

-  LPWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW

-  PWIN32_FIND_DATAW* = ptr WIN32_FIND_DATAW

-  WIN32_STREAM_ID* {.final, pure.} = object

-    dwStreamId*: DWORD

-    dwStreamAttributes*: DWORD

-    Size*: LARGE_INTEGER

-    dwStreamNameSize*: DWORD

-    cStreamName*: ptr WCHAR

-

-  PWIN32STREAMID* = ptr WIN32_STREAM_ID

-  WINDOWPLACEMENT* {.final, pure.} = object

-    len*: WINUINT

-    flags*: WINUINT

-    showCmd*: WINUINT

-    ptMinPosition*: POINT

-    ptMaxPosition*: POINT

-    rcNormalPosition*: RECT

-

-  PWINDOWPLACEMENT* = ptr WINDOWPLACEMENT

-  WNDCLASS* {.final, pure.} = object

-    style*: WINUINT

-    lpfnWndProc*: WNDPROC

-    cbClsExtra*: int32

-    cbWndExtra*: int32

-    hInstance*: HANDLE

-    hIcon*: HICON

-    hCursor*: HCURSOR

-    hbrBackground*: HBRUSH

-    lpszMenuName*: LPCTSTR

-    lpszClassName*: LPCTSTR

-

-  LPWNDCLASS* = ptr WNDCLASS

-  PWNDCLASS* = ptr WNDCLASS

-  WNDCLASSW* {.final, pure.} = object

-    style*: WINUINT

-    lpfnWndProc*: WNDPROC

-    cbClsExtra*: int32

-    cbWndExtra*: int32

-    hInstance*: HANDLE

-    hIcon*: HICON

-    hCursor*: HCURSOR

-    hbrBackground*: HBRUSH

-    lpszMenuName*: LPCWSTR

-    lpszClassName*: LPCWSTR

-

-  LPWNDCLASSW* = ptr WNDCLASSW

-  PWNDCLASSW* = ptr WNDCLASSW

-  WNDCLASSEX* {.final, pure.} = object

-    cbSize*: WINUINT

-    style*: WINUINT

-    lpfnWndProc*: WNDPROC

-    cbClsExtra*: int32

-    cbWndExtra*: int32

-    hInstance*: HANDLE

-    hIcon*: HICON

-    hCursor*: HCURSOR

-    hbrBackground*: HBRUSH

-    lpszMenuName*: LPCTSTR

-    lpszClassName*: LPCTSTR

-    hIconSm*: HANDLE

-

-  LPWNDCLASSEX* = ptr WNDCLASSEX

-  PWNDCLASSEX* = ptr WNDCLASSEX

-  WNDCLASSEXW* {.final, pure.} = object

-    cbSize*: WINUINT

-    style*: WINUINT

-    lpfnWndProc*: WNDPROC

-    cbClsExtra*: int32

-    cbWndExtra*: int32

-    hInstance*: HANDLE

-    hIcon*: HICON

-    hCursor*: HCURSOR

-    hbrBackground*: HBRUSH

-    lpszMenuName*: LPCWSTR

-    lpszClassName*: LPCWSTR

-    hIconSm*: HANDLE

-

-  LPWNDCLASSEXW* = ptr WNDCLASSEXW

-  PWNDCLASSEXW* = ptr WNDCLASSEXW

-  CONNECTDLGSTRUCT* {.final, pure.} = object

-    cbStructure*: DWORD

-    hwndOwner*: HWND

-    lpConnRes*: LPNETRESOURCE

-    dwFlags*: DWORD

-    dwDevNum*: DWORD

-

-  LPCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT

-  PCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT

-  DISCDLGSTRUCT* {.final, pure.} = object

-    cbStructure*: DWORD

-    hwndOwner*: HWND

-    lpLocalName*: LPTSTR

-    lpRemoteName*: LPTSTR

-    dwFlags*: DWORD

-

-  LPDISCDLGSTRUCT* = ptr DISCDLGSTRUCT

-  PDISCDLGSTRUCT* = ptr DISCDLGSTRUCT

-  NETINFOSTRUCT* {.final, pure.} = object

-    cbStructure*: DWORD

-    dwProviderVersion*: DWORD

-    dwStatus*: DWORD

-    dwCharacteristics*: DWORD

-    dwHandle*: DWORD

-    wNetType*: int16

-    dwPrinters*: DWORD

-    dwDrives*: DWORD

-

-  LPNETINFOSTRUCT* = ptr NETINFOSTRUCT

-  PNETINFOSTRUCT* = ptr NETINFOSTRUCT

-  NETCONNECTINFOSTRUCT* {.final, pure.} = object

-    cbStructure*: DWORD

-    dwFlags*: DWORD

-    dwSpeed*: DWORD

-    dwDelay*: DWORD

-    dwOptDataSize*: DWORD

-

-  LPNETCONNECTINFOSTRUCT* = ptr NETCONNECTINFOSTRUCT

-  PNETCONNECTINFOSTRUCT* = ptr NETCONNECTINFOSTRUCT

-  ENUMMETAFILEPROC* = proc (para1: HDC, para2: HANDLETABLE, para3: METARECORD,

-                            para4: int32, para5: LPARAM): int32{.stdcall.}

-  ENHMETAFILEPROC* = proc (para1: HDC, para2: HANDLETABLE, para3: ENHMETARECORD,

-                           para4: int32, para5: LPARAM): int32{.stdcall.}

-  ENUMFONTSPROC* = proc (para1: LPLOGFONT, para2: LPTEXTMETRIC, para3: DWORD,

-                         para4: LPARAM): int32{.stdcall.}

-  FONTENUMPROC* = proc (para1: var ENUMLOGFONT, para2: var NEWTEXTMETRIC,

-                        para3: int32, para4: LPARAM): int32{.stdcall.}

-  FONTENUMEXPROC* = proc (para1: var ENUMLOGFONTEX, para2: var NEWTEXTMETRICEX,

-                          para3: int32, para4: LPARAM): int32{.stdcall.}

-  LPOVERLAPPED_COMPLETION_ROUTINE* = proc (para1: DWORD, para2: DWORD,

-      para3: LPOVERLAPPED){.stdcall.}

-  # Structures for the extensions to OpenGL

-  POINTFLOAT* {.final, pure.} = object

-    x*: float32

-    y*: float32

-

-  PPOINTFLOAT* = ptr POINTFLOAT

-  GLYPHMETRICSFLOAT* {.final, pure.} = object

-    gmfBlackBoxX*: float32

-    gmfBlackBoxY*: float32

-    gmfptGlyphOrigin*: POINTFLOAT

-    gmfCellIncX*: float32

-    gmfCellIncY*: float32

-

-  LPGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT

-  PGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT

-  LAYERPLANEDESCRIPTOR* {.final, pure.} = object

-    nSize*: int16

-    nVersion*: int16

-    dwFlags*: DWORD

-    iPixelType*: int8

-    cColorBits*: int8

-    cRedBits*: int8

-    cRedShift*: int8

-    cGreenBits*: int8

-    cGreenShift*: int8

-    cBlueBits*: int8

-    cBlueShift*: int8

-    cAlphaBits*: int8

-    cAlphaShift*: int8

-    cAccumBits*: int8

-    cAccumRedBits*: int8

-    cAccumGreenBits*: int8

-    cAccumBlueBits*: int8

-    cAccumAlphaBits*: int8

-    cDepthBits*: int8

-    cStencilBits*: int8

-    cAuxBuffers*: int8

-    iLayerPlane*: int8

-    bReserved*: int8

-    crTransparent*: COLORREF

-

-  LPLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR

-  PLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR

-  PIXELFORMATDESCRIPTOR* {.final, pure.} = object

-    nSize*: int16

-    nVersion*: int16

-    dwFlags*: DWORD

-    iPixelType*: int8

-    cColorBits*: int8

-    cRedBits*: int8

-    cRedShift*: int8

-    cGreenBits*: int8

-    cGreenShift*: int8

-    cBlueBits*: int8

-    cBlueShift*: int8

-    cAlphaBits*: int8

-    cAlphaShift*: int8

-    cAccumBits*: int8

-    cAccumRedBits*: int8

-    cAccumGreenBits*: int8

-    cAccumBlueBits*: int8

-    cAccumAlphaBits*: int8

-    cDepthBits*: int8

-    cStencilBits*: int8

-    cAuxBuffers*: int8

-    iLayerType*: int8

-    bReserved*: int8

-    dwLayerMask*: DWORD

-    dwVisibleMask*: DWORD

-    dwDamageMask*: DWORD

-

-  LPPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR

-  PPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR

-  USER_INFO_2* {.final, pure.} = object

-    usri2_name*: LPWSTR

-    usri2_password*: LPWSTR

-    usri2_password_age*: DWORD

-    usri2_priv*: DWORD

-    usri2_home_dir*: LPWSTR

-    usri2_comment*: LPWSTR

-    usri2_flags*: DWORD

-    usri2_script_path*: LPWSTR

-    usri2_auth_flags*: DWORD

-    usri2_full_name*: LPWSTR

-    usri2_usr_comment*: LPWSTR

-    usri2_parms*: LPWSTR

-    usri2_workstations*: LPWSTR

-    usri2_last_logon*: DWORD

-    usri2_last_logoff*: DWORD

-    usri2_acct_expires*: DWORD

-    usri2_max_storage*: DWORD

-    usri2_units_per_week*: DWORD

-    usri2_logon_hours*: PBYTE

-    usri2_bad_pw_count*: DWORD

-    usri2_num_logons*: DWORD

-    usri2_logon_server*: LPWSTR

-    usri2_country_code*: DWORD

-    usri2_code_page*: DWORD

-

-  PUSER_INFO_2* = ptr USER_INFO_2

-  LPUSER_INFO_2* = ptr USER_INFO_2

-  USER_INFO_0* {.final, pure.} = object

-    usri0_name*: LPWSTR

-

-  PUSER_INFO_0* = ptr USER_INFO_0

-  LPUSER_INFO_0* = ptr USER_INFO_0

-  USER_INFO_3* {.final, pure.} = object

-    usri3_name*: LPWSTR

-    usri3_password*: LPWSTR

-    usri3_password_age*: DWORD

-    usri3_priv*: DWORD

-    usri3_home_dir*: LPWSTR

-    usri3_comment*: LPWSTR

-    usri3_flags*: DWORD

-    usri3_script_path*: LPWSTR

-    usri3_auth_flags*: DWORD

-    usri3_full_name*: LPWSTR

-    usri3_usr_comment*: LPWSTR

-    usri3_parms*: LPWSTR

-    usri3_workstations*: LPWSTR

-    usri3_last_logon*: DWORD

-    usri3_last_logoff*: DWORD

-    usri3_acct_expires*: DWORD

-    usri3_max_storage*: DWORD

-    usri3_units_per_week*: DWORD

-    usri3_logon_hours*: PBYTE

-    usri3_bad_pw_count*: DWORD

-    usri3_num_logons*: DWORD

-    usri3_logon_server*: LPWSTR

-    usri3_country_code*: DWORD

-    usri3_code_page*: DWORD

-    usri3_user_id*: DWORD

-    usri3_primary_group_id*: DWORD

-    usri3_profile*: LPWSTR

-    usri3_home_dir_drive*: LPWSTR

-    usri3_password_expired*: DWORD

-

-  PUSER_INFO_3* = ptr USER_INFO_3

-  LPUSER_INFO_3* = ptr USER_INFO_3

-  GROUP_INFO_2* {.final, pure.} = object

-    grpi2_name*: LPWSTR

-    grpi2_comment*: LPWSTR

-    grpi2_group_id*: DWORD

-    grpi2_attributes*: DWORD

-

-  PGROUP_INFO_2* = ptr GROUP_INFO_2

-  LOCALGROUP_INFO_0* {.final, pure.} = object

-    lgrpi0_name*: LPWSTR

-

-  PLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0

-  LPLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0

-  IMAGE_DOS_HEADER* {.final, pure.} = object

-    e_magic*: int16

-    e_cblp*: int16

-    e_cp*: int16

-    e_crlc*: int16

-    e_cparhdr*: int16

-    e_minalloc*: int16

-    e_maxalloc*: int16

-    e_ss*: int16

-    e_sp*: int16

-    e_csum*: int16

-    e_ip*: int16

-    e_cs*: int16

-    e_lfarlc*: int16

-    e_ovno*: int16

-    e_res*: array[0..3, int16]

-    e_oemid*: int16

-    e_oeminfo*: int16

-    e_res2*: array[0..9, int16]

-    e_lfanew*: LONG

-

-  PIMAGE_DOS_HEADER* = ptr IMAGE_DOS_HEADER

-  NOTIFYICONDATAA* {.final, pure.} = object

-    cbSize*: DWORD

-    Wnd*: HWND

-    uID*: WINUINT

-    uFlags*: WINUINT

-    uCallbackMessage*: WINUINT

-    hIcon*: HICON

-    szTip*: array[0..63, char]

-

-  NOTIFYICONDATA* = NOTIFYICONDATAA

-  NOTIFYICONDATAW* {.final, pure.} = object

-    cbSize*: DWORD

-    Wnd*: HWND

-    uID*: WINUINT

-    uFlags*: WINUINT

-    uCallbackMessage*: WINUINT

-    hIcon*: HICON

-    szTip*: array[0..63, int16]

-

-  PNotifyIconDataA* = ptr NotifyIconDataA

-  PNotifyIconDataW* = ptr NotifyIconDataW

-  PNotifyIconData* = PNotifyIconDataA

-  WOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, HANDLE]

-  PWOHandleArray* = ptr WOHandleArray

-  MMRESULT* = int32

-{.deprecated: [TPRINTERNOTIFYINFO: PRINTER_NOTIFY_INFO, TPRINTERNOTIFYINFODATA: PRINTER_NOTIFY_INFO_DATA,

-  TPRINTERINFO5: PRINTER_INFO_5, TPRINTERINFO4: PRINTER_INFO_4, TPRINTERINFO3: PRINTER_INFO_3,

-  TPRINTERINFO2: PRINTER_INFO_2, TPRINTERINFO1: PRINTER_INFO_1, TPRINTERDEFAULTS: PRINTER_DEFAULTS,

-  TPD: TPRINTDLG, TPREVENTMEDIAREMOVAL: PREVENT_MEDIA_REMOVAL, TPORTINFO2: PORT_INFO_2,

-  TPORTINFO1: PORT_INFO_1, TPOLYTEXT: POLYTEXT, TPERFOBJECTTYPE: PERF_OBJECT_TYPE,

-  TPERFINSTANCEDEFINITION: PERF_INSTANCE_DEFINITION, TPERFDATABLOCK: PERF_DATA_BLOCK,

-  TPERFCOUNTERDEFINITION: PERF_COUNTER_DEFINITION, TPERFCOUNTERBLOCK: PERF_COUNTER_BLOCK,

-  Tparaformat: PARAFORMAT, TPAINTSTRUCT: PAINTSTRUCT, TPSD: TPAGESETUPDLG, TOVERLAPPED: OVERLAPPED,

-  TOUTLINETEXTMETRIC: OUTLINETEXTMETRIC, TTEXTMETRICW: TEXTMETRICW, TTEXTMETRIC: TEXTMETRIC,

-  TOSVERSIONINFOW: OSVERSIONINFOW, TOSVERSIONINFO: OSVERSIONINFO, TOFNOTIFY: OFNOTIFY,

-  TOPENFILENAME_NT4: OPENFILENAME_NT4, TOFSTRUCT: OFSTRUCT, Tnumberfmt: NUMBERFMT,

-  TNSSERVICEINFO: NS_SERVICE_INFO, TSERVICEINFO: SERVICE_INFO, TCLSID: CLSID,

-  TSERVICEADDRESSES: SERVICE_ADDRESSES, TSERVICEADDRESS: SERVICE_ADDRESS,

-  TNONCLIENTMETRICS: NONCLIENTMETRICS, TNMUPDOWN: NM_UPDOWNW, TNMTREEVIEW: NM_TREEVIEW,

-  TTVITEM: TV_ITEM, TNMLISTVIEW: NM_LISTVIEW, TNEWTEXTMETRICEX: NEWTEXTMETRICEX,

-  TNEWTEXTMETRIC: NEWTEXTMETRIC].}

-

-{.deprecated: [TNEWCPLINFO: NEWCPLINFO, TNETRESOURCE: NETRESOURCE, TNETRESOURCEA: NETRESOURCE,

-  TNDDESHAREINFO: NDDESHAREINFO, TNCB: NCB, TNAMEBUFFER: NAME_BUFFER, TMULTIKEYHELP: MULTIKEYHELP,

-  Tmsgfilter: MSGFILTER, TMSGBOXPARAMS: MSGBOXPARAMS, TMSGBOXPARAMSA: MSGBOXPARAMS, TMOUSEKEYS: MOUSEKEYS,

-  TMOUSEHOOKSTRUCT: MOUSEHOOKSTRUCT, TMONMSGSTRUCT: MONMSGSTRUCT, TMONLINKSTRUCT: MONLINKSTRUCT,

-  TMONITORINFO2: MONITOR_INFO_2, TMONITORINFO1: MONITOR_INFO_1, TMONHSZSTRUCT: MONHSZSTRUCT,

-  TMONERRSTRUCT: MONERRSTRUCT, TMONCONVSTRUCT: MONCONVSTRUCT, TMONCBSTRUCT: MONCBSTRUCT,

-  TMODEMSETTINGS: MODEMSETTINGS, TMODEMDEVCAPS: MODEMDEVCAPS, TMINMAXINFO: MINMAXINFO,

-  TMINIMIZEDMETRICS: MINIMIZEDMETRICS, TMETARECORD: METARECORD, TMETAHEADER: METAHEADER,

-  TMETAFILEPICT: METAFILEPICT, TMENUTEMPLATE: MENUTEMPLATE, TMENUITEMTEMPLATEHEADER: MENUITEMTEMPLATEHEADER,

-  TMENUITEMTEMPLATE: MENUITEMTEMPLATE, TMENUITEMINFOA: MENUITEMINFO, TMENUITEMINFO: MENUITEMINFO,

-  TMENUINFO: MENUINFO, TMENUEXTEMPLATEITEM: MENUEX_TEMPLATE_ITEM,

-  TMENUXTEMPLATEHEADER: MENUEX_TEMPLATE_HEADER, TMEMORYSTATUS: MEMORYSTATUS,

-  TMEMORYBASICINFORMATION: MEMORY_BASIC_INFORMATION, TMEASUREITEMSTRUCT: MEASUREITEMSTRUCT,

-  TMDICREATESTRUCT: MDICREATESTRUCT, TMAT2: MAT2, TLVKEYDOWN: LV_KEYDOWN, TLVHITTESTINFO: LV_HITTESTINFO,

-  TLVFINDINFO: LV_FINDINFO, TLVDISPINFO: LV_DISPINFO, TLVITEM: LV_ITEM, TLVCOLUMN: LV_COLUMN,

-  TLUIDANDATTRIBUTESARRAY: LUID_AND_ATTRIBUTES_ARRAY, TLUIDANDATTRIBUTES: LUID_AND_ATTRIBUTES,

-  TLUID: LUID, TFXPT16DOT16: FXPT16DOT16, TLOCALGROUPMEMBERSINFO3: LOCALGROUP_MEMBERS_INFO_3,

-  TLOCALGROUPMEMBERSINFO0: LOCALGROUP_MEMBERS_INFO_0, TLOCALESIGNATURE: LOCALESIGNATURE,

-  TGUID: GUID, TOPENFILENAME: OPENFILENAME].}

-

-{.deprecated: [TTOGGLEKEYS: TOGGLEKEYS, TTIMEZONEINFORMATION: TIME_ZONE_INFORMATION,

-  Ttextrange: TEXTRANGE, TTCKEYDOWN: TC_KEYDOWN, TTCITEMHEADER: TC_ITEMHEADER, TTCITEM: TC_ITEM,

-  TTCHITTESTINFO: TC_HITTESTINFO, TTBSAVEPARAMS: TBSAVEPARAMS, TTBNOTIFY: TBNOTIFY, TTBBUTTON: TBBUTTON,

-  TTAPEWRITEMARKS: TAPE_WRITE_MARKS, TTAPESETPOSITION: TAPE_SET_POSITION,

-  TTAPESETMEDIAPARAMETERS: TAPE_SET_MEDIA_PARAMETERS, TTAPESETDRIVEPARAMETERS: TAPE_SET_DRIVE_PARAMETERS,

-  TTAPEPREPARE: TAPE_PREPARE, TTAPEGETPOSITION: TAPE_GET_POSITION,

-  TTAPEGETMEDIAPARAMETERS: TAPE_GET_MEDIA_PARAMETERS, TTAPEGETDRIVEPARAMETERS: TAPE_GET_DRIVE_PARAMETERS,

-  TTAPEERASE: TAPE_ERASE, TSYSTEMPOWERSTATUS: SYSTEM_POWER_STATUS, TSYSTEMINFO: SYSTEM_INFO,

-  TSYSTEMAUDITACE: SYSTEM_AUDIT_ACE, TSTYLESTRUCT: STYLESTRUCT, TSTYLEBUF: STYLEBUF, TSTRRET: STRRET,

-  TSTICKYKEYS: STICKYKEYS, TSTARTUPINFO: STARTUPINFO, TSOUNDSENTRY: SOUNDSENTRY,

-  TSINGLELISTENTRY: SINGLE_LIST_ENTRY, TSIDANDATTRIBUTESARRAY: SID_AND_ATTRIBUTES_ARRAY,

-  TSIDANDATTRIBUTES: SID_AND_ATTRIBUTES, TSHNAMEMAPPING: SHNAMEMAPPING, TSHGDN: SHGNO,

-  TSHFILEOPSTRUCT: SHFILEOPSTRUCT, TFILEOPFLAGS: FILEOP_FLAGS, TSHFILEINFO: SHFILEINFO, TSHCONTF: SHCONTF,

-  TSETPARTITIONINFORMATION: SET_PARTITION_INFORMATION, TSESSIONHEADER: SESSION_HEADER].}

-

-{.deprecated: [TSESSIONBUFFER: SESSION_BUFFER, TSERVICETYPEINFOABS: SERVICE_TYPE_INFO_ABS,

-  TSERVICETYPEVALUEABS: SERVICE_TYPE_VALUE_ABS, TSERVICETABLEENTRY: SERVICE_TABLE_ENTRY,

-  TSERIALKEYS: SERIALKEYS, Tselchange: SELCHANGE, TSECURITYINFORMATION: SECURITY_INFORMATION,

-  TSECURITYATTRIBUTES: SECURITY_ATTRIBUTES, TSCROLLINFO: SCROLLINFO, TRGNDATA: RGNDATA,

-  TRGNDATAHEADER: RGNDATAHEADER, Treqresize: REQRESIZE, Trepastespecial: REPASTESPECIAL,

-  TREMOTENAMEINFO: REMOTE_NAME_INFO, TREASSIGNBLOCKS: REASSIGN_BLOCKS, TRASTERIZERSTATUS: RASTERIZER_STATUS,

-  TRASPPPNBF: RASPPPNBF, TRASPPPIPX: RASPPPIPX, TRASPPPIP: RASPPPIP, TRASENTRYNAME: RASENTRYNAME,

-  TRASDIALPARAMS: RASDIALPARAMS, TRASDIALEXTENSIONS: RASDIALEXTENSIONS, TRASCONNSTATUS: RASCONNSTATUS,

-  TRASCONN: RASCONN, TRASAMB: RASAMB, Tpunctuation: PUNCTUATION, TPSHNOTIFY: PSHNOTIFY,

-  TPROVIDORINFO1: PROVIDOR_INFO_1, TPROTOCOLINFO: PROTOCOL_INFO,

-  TFNADDPROPSHEETPAGES: LPFNADDPROPSHEETPAGES, TFNADDPROPSHEETPAGE: LPFNADDPROPSHEETPAGE,

-  TPROPSHEETHEADER: PROPSHEETHEADER, TPROPSHEETPAGE: PROPSHEETPAGE, TFNPSPCALLBACK: LPFNPSPCALLBACK,

-  TPROCESSINFORMATION: PROCESS_INFORMATION, TPROCESSHEAPENTRY: PROCESS_HEAPENTRY,

-  TPRIVILEGESET: PRIVILEGE_SET, TPRINTPROCESSORINFO1: PRINTPROCESSOR_INFO_1,

-  TPRINTERNOTIFYOPTIONS: PRINTER_NOTIFY_OPTIONS, TPRINTERNOTIFYOPTIONSTYPE: PRINTER_NOTIFY_OPTIONS_TYPE].}

-

-{.deprecated: [TNotifyIconDataA: NOTIFYICONDATAA, TNotifyIconDataW: NOTIFYICONDATAW,

-  TNotifyIconData: NotifyIconDataA, TIMAGEDOSHEADER: IMAGE_DOS_HEADER, TLOCALGROUPINFO0: LOCALGROUP_INFO_0,

-  TGROUPINFO2: GROUP_INFO_2, TUSERINFO3: USER_INFO_3, TUSERINFO0: USER_INFO_0, TUSERINFO2: USER_INFO_2,

-  TPIXELFORMATDESCRIPTOR: PIXELFORMATDESCRIPTOR, TLAYERPLANEDESCRIPTOR: LAYERPLANEDESCRIPTOR,

-  TGLYPHMETRICSFLOAT: GLYPHMETRICSFLOAT, TPOINTFLOAT: POINTFLOAT,

-  TNETCONNECTINFOSTRUCT: NETCONNECTINFOSTRUCT, TNETINFOSTRUCT: NETINFOSTRUCT,

-  TDISCDLGSTRUCT: DISCDLGSTRUCT, TDISCDLGSTRUCTA: DISCDLGSTRUCT, TCONNECTDLGSTRUCT: CONNECTDLGSTRUCT,

-  TWNDCLASSEXW: WNDCLASSEXW, TWNDCLASSEX: WNDCLASSEX, TWNDCLASSEXA: WNDCLASSEX, TWNDCLASSW: WNDCLASSW,

-  TWNDCLASS: WNDCLASS, TWNDCLASSA: WNDCLASS, TWINDOWPLACEMENT: WINDOWPLACEMENT,

-  TWIN32STREAMID: WIN32_STREAM_ID, TWIN32FINDDATAW: WIN32_FIND_DATAW, TWIN32FINDDATAA: WIN32_FIND_DATA,

-  TWIN32FINDDATA: WIN32_FIND_DATA, TVSFIXEDFILEINFO: VS_FIXEDFILEINFO,

-  TVERIFYINFORMATION: VERIFY_INFORMATION, Tvalue_ent: VALENT, TVALENT: VALENT,

-  TUSEROBJECTFLAGS: USEROBJECTFLAGS, TUNIVERSALNAMEINFO: UNIVERSAL_NAME_INFO, TUDACCEL: UDACCEL,

-  TTVSORTCB: TV_SORTCB, TTVKEYDOWN: TV_KEYDOWN, TTVINSERTSTRUCT: TV_INSERTSTRUCT,

-  TTVHITTESTINFO: TV_HITTESTINFO, TTVDISPINFO: TV_DISPINFO, TTTPOLYGONHEADER: TTPOLYGONHEADER,

-  TTTPOLYCURVE: TTPOLYCURVE, TTTHITTESTINFO: TTHITTESTINFO, TTRANSMITFILEBUFFERS: TRANSMIT_FILE_BUFFERS,

-  TTPMPARAMS: TPMPARAMS, TTOOLTIPTEXT: TOOLTIPTEXT, TTOOLINFO: TOOLINFO,

-  TTOKENCONTROL: TOKEN_CONTROL, TWOHandleArray: WOHandleArray].}

-

-

-type

-  PWaveFormatEx* = ptr TWaveFormatEx

-  TWaveFormatEx* {.final, pure.} = object

-    wFormatTag*: int16        # format type

-    nChannels*: int16         # number of channels (i.e. mono, stereo, etc.)

-    nSamplesPerSec*: DWORD    # sample rate

-    nAvgBytesPerSec*: DWORD   # for buffer estimation

-    nBlockAlign*: int16       # block size of data

-    wBitsPerSample*: int16    # number of bits per sample of mono data

-    cbSize*: int16            # the count in bytes of the size of

-

-  WIN32_FILE_ATTRIBUTE_DATA* {.final, pure.} = object

-    dwFileAttributes*: DWORD

-    ftCreationTime*: FILETIME

-    ftLastAccessTime*: FILETIME

-    ftLastWriteTime*: FILETIME

-    nFileSizeHigh*: DWORD

-    nFileSizeLow*: DWORD

-

-  LPWIN32_FILE_ATTRIBUTE_DATA* = ptr WIN32_FILE_ATTRIBUTE_DATA

-  TWIN32FILEATTRIBUTEDATA* = WIN32_FILE_ATTRIBUTE_DATA

-  PWIN32FILEATTRIBUTEDATA* = ptr WIN32_FILE_ATTRIBUTE_DATA

-  # TrackMouseEvent. NT or higher only.

-  TTrackMouseEvent* {.final, pure.} = object

-    cbSize*: DWORD

-    dwFlags*: DWORD

-    hwndTrack*: HWND

-    dwHoverTime*: DWORD

-

-  PTrackMouseEvent* = ptr TTrackMouseEvent

-

-const

-  ACM_OPENW* = 1127

-  ACM_OPENA* = 1124

-

-when defined(winUnicode):

-  const

-    ACM_OPEN* = ACM_OPENW

-else:

-  const

-    ACM_OPEN* = ACM_OPENA

-# UNICODE

-

-const

-  ACM_PLAY* = 1125

-  ACM_STOP* = 1126

-  ACN_START* = 1

-  ACN_STOP* = 2

-  # Buttons

-  BM_CLICK* = 245

-  BM_GETCHECK* = 240

-  BM_GETIMAGE* = 246

-  BM_GETSTATE* = 242

-  BM_SETCHECK* = 241

-  BM_SETIMAGE* = 247

-  BM_SETSTATE* = 243

-  BM_SETSTYLE* = 244

-  BN_CLICKED* = 0

-  BN_DBLCLK* = 5

-  BN_DISABLE* = 4

-  BN_DOUBLECLICKED* = 5

-  BN_HILITE* = 2

-  BN_KILLFOCUS* = 7

-  BN_PAINT* = 1

-  BN_PUSHED* = 2

-  BN_SETFOCUS* = 6

-  BN_UNHILITE* = 3

-  BN_UNPUSHED* = 3

-  # Combo Box

-  CB_ADDSTRING* = 323

-  CB_DELETESTRING* = 324

-  CB_DIR* = 325

-  CB_FINDSTRING* = 332

-  CB_FINDSTRINGEXACT* = 344

-  CB_GETCOUNT* = 326

-  CB_GETCURSEL* = 327

-  CB_GETDROPPEDCONTROLRECT* = 338

-  CB_GETDROPPEDSTATE* = 343

-  CB_GETDROPPEDWIDTH* = 351

-  CB_GETEDITSEL* = 320

-  CB_GETEXTENDEDUI* = 342

-  CB_GETHORIZONTALEXTENT* = 349

-  CB_GETITEMDATA* = 336

-  CB_GETITEMHEIGHT* = 340

-  CB_GETLBTEXT* = 328

-  CB_GETLBTEXTLEN* = 329

-  CB_GETLOCALE* = 346

-  CB_GETTOPINDEX* = 347

-  CB_INITSTORAGE* = 353

-  CB_INSERTSTRING* = 330

-  CB_LIMITTEXT* = 321

-  CB_RESETCONTENT* = 331

-  CB_SELECTSTRING* = 333

-  CB_SETCURSEL* = 334

-  CB_SETDROPPEDWIDTH* = 352

-  CB_SETEDITSEL* = 322

-  CB_SETEXTENDEDUI* = 341

-  CB_SETHORIZONTALEXTENT* = 350

-  CB_SETITEMDATA* = 337

-  CB_SETITEMHEIGHT* = 339

-  CB_SETLOCALE* = 345

-  CB_SETTOPINDEX* = 348

-  CB_SHOWDROPDOWN* = 335

-  # Combo Box notifications

-  CBN_CLOSEUP* = 8

-  CBN_DBLCLK* = 2

-  CBN_DROPDOWN* = 7

-  CBN_EDITCHANGE* = 5

-  CBN_EDITUPDATE* = 6

-  CBN_ERRSPACE* = -1

-  CBN_KILLFOCUS* = 4

-  CBN_SELCHANGE* = 1

-  CBN_SELENDCANCEL* = 10

-  CBN_SELENDOK* = 9

-  CBN_SETFOCUS* = 3

-  # Control Panel

-  # Device messages

-  # Drag list box

-  DL_BEGINDRAG* = 1157

-  DL_CANCELDRAG* = 1160

-  DL_DRAGGING* = 1158

-  DL_DROPPED* = 1159

-  # Default push button

-  DM_GETDEFID* = 1024

-  DM_REPOSITION* = 1026

-  DM_SETDEFID* = 1025

-  # RTF control

-  EM_CANPASTE* = 1074

-  EM_CANUNDO* = 198

-  EM_CHARFROMPOS* = 215

-  EM_DISPLAYBAND* = 1075

-  EM_EMPTYUNDOBUFFER* = 205

-  EM_EXGETSEL* = 1076

-  EM_EXLIMITTEXT* = 1077

-  EM_EXLINEFROMCHAR* = 1078

-  EM_EXSETSEL* = 1079

-  EM_FINDTEXT* = 1080

-  EM_FINDTEXTEX* = 1103

-  EM_FINDWORDBREAK* = 1100

-  EM_FMTLINES* = 200

-  EM_FORMATRANGE* = 1081

-  EM_GETCHARFORMAT* = 1082

-  EM_GETEVENTMASK* = 1083

-  EM_GETFIRSTVISIBLELINE* = 206

-  EM_GETHANDLE* = 189

-  EM_GETLIMITTEXT* = 213

-  EM_GETLINE* = 196

-  EM_GETLINECOUNT* = 186

-  EM_GETMARGINS* = 212

-  EM_GETMODIFY* = 184

-  EM_GETIMECOLOR* = 1129

-  EM_GETIMEOPTIONS* = 1131

-  EM_GETOPTIONS* = 1102

-  EM_GETOLEINTERFACE* = 1084

-  EM_GETPARAFORMAT* = 1085

-  EM_GETPASSWORDCHAR* = 210

-  EM_GETPUNCTUATION* = 1125

-  EM_GETRECT* = 178

-  EM_GETSEL* = 176

-  EM_GETSELTEXT* = 1086

-  EM_GETTEXTRANGE* = 1099

-  EM_GETTHUMB* = 190

-  EM_GETWORDBREAKPROC* = 209

-  EM_GETWORDBREAKPROCEX* = 1104

-  EM_GETWORDWRAPMODE* = 1127

-  EM_HIDESELECTION* = 1087

-  EM_LIMITTEXT* = 197

-  EM_LINEFROMCHAR* = 201

-  EM_LINEINDEX* = 187

-  EM_LINELENGTH* = 193

-  EM_LINESCROLL* = 182

-  EM_PASTESPECIAL* = 1088

-  EM_POSFROMCHAR* = 214

-  EM_REPLACESEL* = 194

-  EM_REQUESTRESIZE* = 1089

-  EM_SCROLL* = 181

-  EM_SCROLLCARET* = 183

-  EM_SELECTIONTYPE* = 1090

-  EM_SETBKGNDCOLOR* = 1091

-  EM_SETCHARFORMAT* = 1092

-  EM_SETEVENTMASK* = 1093

-  EM_SETHANDLE* = 188

-  EM_SETIMECOLOR* = 1128

-  EM_SETIMEOPTIONS* = 1130

-  EM_SETLIMITTEXT* = 197

-  EM_SETMARGINS* = 211

-  EM_SETMODIFY* = 185

-  EM_SETOLECALLBACK* = 1094

-  EM_SETOPTIONS* = 1101

-  EM_SETPARAFORMAT* = 1095

-  EM_SETPASSWORDCHAR* = 204

-  EM_SETPUNCTUATION* = 1124

-  EM_SETREADONLY* = 207

-  EM_SETRECT* = 179

-  EM_SETRECTNP* = 180

-  EM_SETSEL* = 177

-  EM_SETTABSTOPS* = 203

-  EM_SETTARGETDEVICE* = 1096

-  EM_SETWORDBREAKPROC* = 208

-  EM_SETWORDBREAKPROCEX* = 1105

-  EM_SETWORDWRAPMODE* = 1126

-  EM_STREAMIN* = 1097

-  EM_STREAMOUT* = 1098

-  EM_UNDO* = 199

-  # Edit control

-  EN_CHANGE* = 768

-  EN_CORRECTTEXT* = 1797

-  EN_DROPFILES* = 1795

-  EN_ERRSPACE* = 1280

-  EN_HSCROLL* = 1537

-  EN_IMECHANGE* = 1799

-  EN_KILLFOCUS* = 512

-  EN_MAXTEXT* = 1281

-  EN_MSGFILTER* = 1792

-  EN_OLEOPFAILED* = 1801

-  EN_PROTECTED* = 1796

-  EN_REQUESTRESIZE* = 1793

-  EN_SAVECLIPBOARD* = 1800

-  EN_SELCHANGE* = 1794

-  EN_SETFOCUS* = 256

-  EN_STOPNOUNDO* = 1798

-  EN_UPDATE* = 1024

-  EN_VSCROLL* = 1538

-  # File Manager extensions

-  # File Manager extensions DLL events

-  # Header control

-  HDM_DELETEITEM* = 4610

-  HDM_GETITEMW* = 4619

-  HDM_INSERTITEMW* = 4618

-  HDM_SETITEMW* = 4620

-  HDM_GETITEMA* = 4611

-  HDM_INSERTITEMA* = 4609

-  HDM_SETITEMA* = 4612

-

-when defined(winUnicode):

-  const

-    HDM_GETITEM* = HDM_GETITEMW

-    HDM_INSERTITEM* = HDM_INSERTITEMW

-    HDM_SETITEM* = HDM_SETITEMW

-else:

-  const

-    HDM_GETITEM* = HDM_GETITEMA

-    HDM_INSERTITEM* = HDM_INSERTITEMA

-    HDM_SETITEM* = HDM_SETITEMA

-# UNICODE

-

-const

-  HDM_GETITEMCOUNT* = 4608

-  HDM_HITTEST* = 4614

-  HDM_LAYOUT* = 4613

-  # Header control notifications

-  HDN_BEGINTRACKW* = -326

-  HDN_DIVIDERDBLCLICKW* = -325

-  HDN_ENDTRACKW* = -327

-  HDN_ITEMCHANGEDW* = -321

-  HDN_ITEMCHANGINGW* = -320

-  HDN_ITEMCLICKW* = -322

-  HDN_ITEMDBLCLICKW* = -323

-  HDN_TRACKW* = -328

-  HDN_BEGINTRACKA* = -306

-  HDN_DIVIDERDBLCLICKA* = -305

-  HDN_ENDTRACKA* = -307

-  HDN_ITEMCHANGEDA* = -301

-  HDN_ITEMCHANGINGA* = -300

-  HDN_ITEMCLICKA* = -302

-  HDN_ITEMDBLCLICKA* = -303

-  HDN_TRACKA* = -308

-

-when defined(winUnicode):

-  const

-    HDN_BEGINTRACK* = HDN_BEGINTRACKW

-    HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKW

-    HDN_ENDTRACK* = HDN_ENDTRACKW

-    HDN_ITEMCHANGED* = HDN_ITEMCHANGEDW

-    HDN_ITEMCHANGING* = HDN_ITEMCHANGINGW

-    HDN_ITEMCLICK* = HDN_ITEMCLICKW

-    HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKW

-    HDN_TRACK* = HDN_TRACKW

-else:

-  const

-    HDN_BEGINTRACK* = HDN_BEGINTRACKA

-    HDN_DIVIDERDBLCLICK* = HDN_DIVIDERDBLCLICKA

-    HDN_ENDTRACK* = HDN_ENDTRACKA

-    HDN_ITEMCHANGED* = HDN_ITEMCHANGEDA

-    HDN_ITEMCHANGING* = HDN_ITEMCHANGINGA

-    HDN_ITEMCLICK* = HDN_ITEMCLICKA

-    HDN_ITEMDBLCLICK* = HDN_ITEMDBLCLICKA

-    HDN_TRACK* = HDN_TRACKA

-# UNICODE

-

-const

-  # Hot key control

-  HKM_GETHOTKEY* = 1026

-  HKM_SETHOTKEY* = 1025

-  HKM_SETRULES* = 1027

-  # List box

-  LB_ADDFILE* = 406

-  LB_ADDSTRING* = 384

-  LB_DELETESTRING* = 386

-  LB_DIR* = 397

-  LB_FINDSTRING* = 399

-  LB_FINDSTRINGEXACT* = 418

-  LB_GETANCHORINDEX* = 413

-  LB_GETCARETINDEX* = 415

-  LB_GETCOUNT* = 395

-  LB_GETCURSEL* = 392

-  LB_GETHORIZONTALEXTENT* = 403

-  LB_GETITEMDATA* = 409

-  LB_GETITEMHEIGHT* = 417

-  LB_GETITEMRECT* = 408

-  LB_GETLOCALE* = 422

-  LB_GETSEL* = 391

-  LB_GETSELCOUNT* = 400

-  LB_GETSELITEMS* = 401

-  LB_GETTEXT* = 393

-  LB_GETTEXTLEN* = 394

-  LB_GETTOPINDEX* = 398

-  LB_INITSTORAGE* = 424

-  LB_INSERTSTRING* = 385

-  LB_ITEMFROMPOINT* = 425

-  LB_RESETCONTENT* = 388

-  LB_SELECTSTRING* = 396

-  LB_SELITEMRANGE* = 411

-  LB_SELITEMRANGEEX* = 387

-  LB_SETANCHORINDEX* = 412

-  LB_SETCARETINDEX* = 414

-  LB_SETCOLUMNWIDTH* = 405

-  LB_SETCOUNT* = 423

-  LB_SETCURSEL* = 390

-  LB_SETHORIZONTALEXTENT* = 404

-  LB_SETITEMDATA* = 410

-  LB_SETITEMHEIGHT* = 416

-  LB_SETLOCALE* = 421

-  LB_SETSEL* = 389

-  LB_SETTABSTOPS* = 402

-  LB_SETTOPINDEX* = 407

-  # List box notifications

-  LBN_DBLCLK* = 2

-  LBN_ERRSPACE* = -2

-  LBN_KILLFOCUS* = 5

-  LBN_SELCANCEL* = 3

-  LBN_SELCHANGE* = 1

-  LBN_SETFOCUS* = 4

-  # List view control

-  LVM_ARRANGE* = 4118

-  LVM_CREATEDRAGIMAGE* = 4129

-  LVM_DELETEALLITEMS* = 4105

-  LVM_DELETECOLUMN* = 4124

-  LVM_DELETEITEM* = 4104

-  LVM_ENSUREVISIBLE* = 4115

-  LVM_GETBKCOLOR* = 4096

-  LVM_GETCALLBACKMASK* = 4106

-  LVM_GETCOLUMNWIDTH* = 4125

-  LVM_GETCOUNTPERPAGE* = 4136

-  LVM_GETEDITCONTROL* = 4120

-  LVM_GETIMAGELIST* = 4098

-  LVM_EDITLABELW* = 4214

-  LVM_FINDITEMW* = 4179

-  LVM_GETCOLUMNW* = 4191

-  LVM_GETISEARCHSTRINGW* = 4213

-  LVM_GETITEMW* = 4171

-  LVM_GETITEMTEXTW* = 4211

-  LVM_GETSTRINGWIDTHW* = 4183

-  LVM_INSERTCOLUMNW* = 4193

-  LVM_INSERTITEMW* = 4173

-  LVM_SETCOLUMNW* = 4192

-  LVM_SETITEMW* = 4172

-  LVM_SETITEMTEXTW* = 4212

-  LVM_EDITLABELA* = 4119

-  LVM_FINDITEMA* = 4109

-  LVM_GETCOLUMNA* = 4121

-  LVM_GETISEARCHSTRINGA* = 4148

-  LVM_GETITEMA* = 4101

-  LVM_GETITEMTEXTA* = 4141

-  LVM_GETSTRINGWIDTHA* = 4113

-  LVM_INSERTCOLUMNA* = 4123

-  LVM_INSERTITEMA* = 4103

-  LVM_SETCOLUMNA* = 4122

-  LVM_SETITEMA* = 4102

-  LVM_SETITEMTEXTA* = 4142

-

-when defined(winUnicode):

-  const

-    LVM_EDITLABEL* = LVM_EDITLABELW

-    LVM_FINDITEM* = LVM_FINDITEMW

-    LVM_GETCOLUMN* = LVM_GETCOLUMNW

-    LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGW

-    LVM_GETITEM* = LVM_GETITEMW

-    LVM_GETITEMTEXT* = LVM_GETITEMTEXTW

-    LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHW

-    LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNW

-    LVM_INSERTITEM* = LVM_INSERTITEMW

-    LVM_SETCOLUMN* = LVM_SETCOLUMNW

-    LVM_SETITEM* = LVM_SETITEMW

-    LVM_SETITEMTEXT* = LVM_SETITEMTEXTW

-else:

-  const

-    LVM_EDITLABEL* = LVM_EDITLABELA

-    LVM_FINDITEM* = LVM_FINDITEMA

-    LVM_GETCOLUMN* = LVM_GETCOLUMNA

-    LVM_GETISEARCHSTRING* = LVM_GETISEARCHSTRINGA

-    LVM_GETITEM* = LVM_GETITEMA

-    LVM_GETITEMTEXT* = LVM_GETITEMTEXTA

-    LVM_GETSTRINGWIDTH* = LVM_GETSTRINGWIDTHA

-    LVM_INSERTCOLUMN* = LVM_INSERTCOLUMNA

-    LVM_INSERTITEM* = LVM_INSERTITEMA

-    LVM_SETCOLUMN* = LVM_SETCOLUMNA

-    LVM_SETITEM* = LVM_SETITEMA

-    LVM_SETITEMTEXT* = LVM_SETITEMTEXTA

-# UNICODE

-

-const

-  LVM_GETITEMCOUNT* = 4100

-  LVM_GETITEMPOSITION* = 4112

-  LVM_GETITEMRECT* = 4110

-  LVM_GETITEMSPACING* = 4147

-  LVM_GETITEMSTATE* = 4140

-  LVM_GETNEXTITEM* = 4108

-  LVM_GETORIGIN* = 4137

-  LVM_GETSELECTEDCOUNT* = 4146

-  LVM_GETTEXTBKCOLOR* = 4133

-  LVM_GETTEXTCOLOR* = 4131

-  LVM_GETTOPINDEX* = 4135

-  LVM_GETVIEWRECT* = 4130

-  LVM_HITTEST* = 4114

-  LVM_REDRAWITEMS* = 4117

-  LVM_SCROLL* = 4116

-  LVM_SETBKCOLOR* = 4097

-  LVM_SETCALLBACKMASK* = 4107

-  LVM_SETCOLUMNWIDTH* = 4126

-  LVM_SETIMAGELIST* = 4099

-  LVM_SETITEMCOUNT* = 4143

-  LVM_SETITEMPOSITION* = 4111

-  LVM_SETITEMPOSITION32* = 4145

-  LVM_SETITEMSTATE* = 4139

-  LVM_SETTEXTBKCOLOR* = 4134

-  LVM_SETTEXTCOLOR* = 4132

-  LVM_SORTITEMS* = 4144

-  LVM_UPDATE* = 4138

-  # List view control notifications

-  LVN_BEGINDRAG* = -109

-  LVN_BEGINRDRAG* = -111

-  LVN_COLUMNCLICK* = -108

-  LVN_DELETEALLITEMS* = -104

-  LVN_DELETEITEM* = -103

-  LVN_BEGINLABELEDITW* = -175

-  LVN_ENDLABELEDITW* = -176

-  LVN_GETDISPINFOW* = -177

-  LVN_SETDISPINFOW* = -178

-  LVN_BEGINLABELEDITA* = -105

-  LVN_ENDLABELEDITA* = -106

-  LVN_GETDISPINFOA* = -150

-  LVN_SETDISPINFOA* = -151

-

-when defined(winUnicode):

-  const

-    LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITW

-    LVN_ENDLABELEDIT* = LVN_ENDLABELEDITW

-    LVN_GETDISPINFO* = LVN_GETDISPINFOW

-    LVN_SETDISPINFO* = LVN_SETDISPINFOW

-else:

-  const

-    LVN_BEGINLABELEDIT* = LVN_BEGINLABELEDITA

-    LVN_ENDLABELEDIT* = LVN_ENDLABELEDITA

-    LVN_GETDISPINFO* = LVN_GETDISPINFOA

-    LVN_SETDISPINFO* = LVN_SETDISPINFOA

-# UNICODE

-

-const

-  LVN_INSERTITEM* = -102

-  LVN_ITEMCHANGED* = -101

-  LVN_ITEMCHANGING* = -100

-  LVN_KEYDOWN* = -155

-  # Control notification

-  NM_CLICK* = -2

-  NM_DBLCLK* = -3

-  NM_KILLFOCUS* = -8

-  NM_OUTOFMEMORY* = -1

-  NM_RCLICK* = -5

-  NM_RDBLCLK* = -6

-  NM_RETURN* = -4

-  NM_SETFOCUS* = -7

-  # Power status

-  # Progress bar control

-  PBM_DELTAPOS* = 1027

-  PBM_SETPOS* = 1026

-  PBM_SETRANGE* = 1025

-  PBM_SETRANGE32* = 1030

-  PBM_SETSTEP* = 1028

-  PBM_STEPIT* = 1029

-  # Property sheets

-  PSM_ADDPAGE* = 1127

-  PSM_APPLY* = 1134

-  PSM_CANCELTOCLOSE* = 1131

-  PSM_CHANGED* = 1128

-  PSM_GETTABCONTROL* = 1140

-  PSM_GETCURRENTPAGEHWND* = 1142

-  PSM_ISDIALOGMESSAGE* = 1141

-  PSM_PRESSBUTTON* = 1137

-  PSM_QUERYSIBLINGS* = 1132

-  PSM_REBOOTSYSTEM* = 1130

-  PSM_REMOVEPAGE* = 1126

-  PSM_RESTARTWINDOWS* = 1129

-  PSM_SETCURSEL* = 1125

-  PSM_SETCURSELID* = 1138

-  PSM_SETFINISHTEXTW* = 1145

-  PSM_SETTITLEW* = 1144

-  PSM_SETFINISHTEXTA* = 1139

-  PSM_SETTITLEA* = 1135

-

-when defined(winUnicode):

-  const

-    PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTW

-    PSM_SETTITLE* = PSM_SETTITLEW

-else:

-  const

-    PSM_SETFINISHTEXT* = PSM_SETFINISHTEXTA

-    PSM_SETTITLE* = PSM_SETTITLEA

-# UNICODE

-

-const

-  PSM_SETWIZBUTTONS* = 1136

-  PSM_UNCHANGED* = 1133

-  # Property sheet notifications

-  PSN_APPLY* = -202

-  PSN_HELP* = -205

-  PSN_KILLACTIVE* = -201

-  PSN_QUERYCANCEL* = -209

-  PSN_RESET* = -203

-  PSN_SETACTIVE* = -200

-  PSN_WIZBACK* = -206

-  PSN_WIZFINISH* = -208

-  PSN_WIZNEXT* = -207

-  # Status window

-  SB_GETBORDERS* = 1031

-  SB_GETPARTS* = 1030

-  SB_GETRECT* = 1034

-  SB_GETTEXTW* = 1037

-  SB_GETTEXTLENGTHW* = 1036

-  SB_SETTEXTW* = 1035

-  SB_GETTEXTA* = 1026

-  SB_GETTEXTLENGTHA* = 1027

-  SB_SETTEXTA* = 1025

-

-when defined(winUnicode):

-  const

-    SB_GETTEXT* = SB_GETTEXTW

-    SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHW

-    SB_SETTEXT* = SB_SETTEXTW

-else:

-  const

-    SB_GETTEXT* = SB_GETTEXTA

-    SB_GETTEXTLENGTH* = SB_GETTEXTLENGTHA

-    SB_SETTEXT* = SB_SETTEXTA

-# UNICODE

-

-const

-  SB_SETMINHEIGHT* = 1032

-  SB_SETPARTS* = 1028

-  SB_SIMPLE* = 1033

-  # Scroll bar control

-  SBM_ENABLE_ARROWS* = 228

-  SBM_GETPOS* = 225

-  SBM_GETRANGE* = 227

-  SBM_GETSCROLLINFO* = 234

-  SBM_SETPOS* = 224

-  SBM_SETRANGE* = 226

-  SBM_SETRANGEREDRAW* = 230

-  SBM_SETSCROLLINFO* = 233

-  # Static control

-  STM_GETICON* = 369

-  STM_GETIMAGE* = 371

-  STM_SETICON* = 368

-  STM_SETIMAGE* = 370

-  # Static control notifications

-  STN_CLICKED* = 0

-  STN_DBLCLK* = 1

-  STN_DISABLE* = 3

-  STN_ENABLE* = 2

-  # Toolbar control

-  TB_ADDBITMAP* = 1043

-  TB_ADDBUTTONS* = 1044

-  TB_AUTOSIZE* = 1057

-  TB_BUTTONCOUNT* = 1048

-  TB_BUTTONSTRUCTSIZE* = 1054

-  TB_CHANGEBITMAP* = 1067

-  TB_CHECKBUTTON* = 1026

-  TB_COMMANDTOINDEX* = 1049

-  TB_CUSTOMIZE* = 1051

-  TB_DELETEBUTTON* = 1046

-  TB_ENABLEBUTTON* = 1025

-  TB_GETBITMAP* = 1068

-  TB_GETBITMAPFLAGS* = 1065

-  TB_GETBUTTON* = 1047

-  TB_ADDSTRINGW* = 1101

-  TB_GETBUTTONTEXTW* = 1099

-  TB_SAVERESTOREW* = 1100

-  TB_ADDSTRINGA* = 1052

-  TB_GETBUTTONTEXTA* = 1069

-  TB_SAVERESTOREA* = 1050

-

-when defined(winUnicode):

-  const

-    TB_ADDSTRING* = TB_ADDSTRINGW

-    TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTW

-    TB_SAVERESTORE* = TB_SAVERESTOREW

-else:

-  const

-    TB_ADDSTRING* = TB_ADDSTRINGA

-    TB_GETBUTTONTEXT* = TB_GETBUTTONTEXTA

-    TB_SAVERESTORE* = TB_SAVERESTOREA

-# UNICODE

-

-const

-  TB_GETITEMRECT* = 1053

-  TB_GETROWS* = 1064

-  TB_GETSTATE* = 1042

-  TB_GETTOOLTIPS* = 1059

-  TB_HIDEBUTTON* = 1028

-  TB_INDETERMINATE* = 1029

-  TB_INSERTBUTTON* = 1045

-  TB_ISBUTTONCHECKED* = 1034

-  TB_ISBUTTONENABLED* = 1033

-  TB_ISBUTTONHIDDEN* = 1036

-  TB_ISBUTTONINDETERMINATE* = 1037

-  TB_ISBUTTONPRESSED* = 1035

-  TB_PRESSBUTTON* = 1027

-  TB_SETBITMAPSIZE* = 1056

-  TB_SETBUTTONSIZE* = 1055

-  TB_SETCMDID* = 1066

-  TB_SETPARENT* = 1061

-  TB_SETROWS* = 1063

-  TB_SETSTATE* = 1041

-  TB_SETTOOLTIPS* = 1060

-  # Track bar control

-  TBM_CLEARSEL* = 1043

-  TBM_CLEARTICS* = 1033

-  TBM_GETCHANNELRECT* = 1050

-  TBM_GETLINESIZE* = 1048

-  TBM_GETNUMTICS* = 1040

-  TBM_GETPAGESIZE* = 1046

-  TBM_GETPOS* = 1024

-  TBM_GETPTICS* = 1038

-  TBM_GETRANGEMAX* = 1026

-  TBM_GETRANGEMIN* = 1025

-  TBM_GETSELEND* = 1042

-  TBM_GETSELSTART* = 1041

-  TBM_GETTHUMBLENGTH* = 1052

-  TBM_GETTHUMBRECT* = 1049

-  TBM_GETTIC* = 1027

-  TBM_GETTICPOS* = 1039

-  TBM_SETLINESIZE* = 1047

-  TBM_SETPAGESIZE* = 1045

-  TBM_SETPOS* = 1029

-  TBM_SETRANGE* = 1030

-  TBM_SETRANGEMAX* = 1032

-  TBM_SETRANGEMIN* = 1031

-  TBM_SETSEL* = 1034

-  TBM_SETSELEND* = 1036

-  TBM_SETSELSTART* = 1035

-  TBM_SETTHUMBLENGTH* = 1051

-  TBM_SETTIC* = 1028

-  TBM_SETTICFREQ* = 1044

-  # Tool bar control notifications

-  TBN_BEGINADJUST* = -703

-  TBN_BEGINDRAG* = -701

-  TBN_CUSTHELP* = -709

-  TBN_ENDADJUST* = -704

-  TBN_ENDDRAG* = -702

-  TBN_GETBUTTONINFOW* = -720

-  TBN_GETBUTTONINFOA* = -700

-

-when defined(winUnicode):

-  const

-    TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOW

-else:

-  const

-    TBN_GETBUTTONINFO* = TBN_GETBUTTONINFOA

-# UNICODE

-

-const

-  TBN_QUERYDELETE* = -707

-  TBN_QUERYINSERT* = -706

-  TBN_RESET* = -705

-  TBN_TOOLBARCHANGE* = -708

-  # Tab control

-  TCM_ADJUSTRECT* = 4904

-  TCM_DELETEALLITEMS* = 4873

-  TCM_DELETEITEM* = 4872

-  TCM_GETCURFOCUS* = 4911

-  TCM_GETCURSEL* = 4875

-  TCM_GETIMAGELIST* = 4866

-  TCM_GETITEMW* = 4924

-  TCM_INSERTITEMW* = 4926

-  TCM_SETITEMW* = 4925

-  TCM_GETITEMA* = 4869

-  TCM_INSERTITEMA* = 4871

-  TCM_SETITEMA* = 4870

-

-when defined(winUnicode):

-  const

-    TCM_GETITEM* = TCM_GETITEM

-    TCM_INSERTITEM* = TCM_INSERTITEMW

-    TCM_SETITEM* = TCM_SETITEMW

-else:

-  const

-    TCM_GETITEM* = TCM_GETITEMA

-    TCM_INSERTITEM* = TCM_INSERTITEMA

-    TCM_SETITEM* = TCM_SETITEMA

-# UNICODE

-

-const

-  TCM_GETITEMCOUNT* = 4868

-  TCM_GETITEMRECT* = 4874

-  TCM_GETROWCOUNT* = 4908

-  TCM_GETTOOLTIPS* = 4909

-  TCM_HITTEST* = 4877

-  TCM_REMOVEIMAGE* = 4906

-  TCM_SETCURFOCUS* = 4912

-  TCM_SETCURSEL* = 4876

-  TCM_SETIMAGELIST* = 4867

-  TCM_SETITEMEXTRA* = 4878

-  TCM_SETITEMSIZE* = 4905

-  TCM_SETPADDING* = 4907

-  TCM_SETTOOLTIPS* = 4910

-  # Tab control notifications

-  TCN_KEYDOWN* = -550

-  TCN_SELCHANGE* = -551

-  TCN_SELCHANGING* = -552

-  # Tool tip control

-  TTM_ACTIVATE* = 1025

-  TTM_ADDTOOLW* = 1074

-  TTM_DELTOOLW* = 1075

-  TTM_ENUMTOOLSW* = 1082

-  TTM_GETCURRENTTOOLW* = 1083

-  TTM_GETTEXTW* = 1080

-  TTM_GETTOOLINFOW* = 1077

-  TTM_HITTESTW* = 1079

-  TTM_NEWTOOLRECTW* = 1076

-  TTM_SETTOOLINFOW* = 1078

-  TTM_UPDATETIPTEXTW* = 1081

-  TTM_ADDTOOLA* = 1028

-  TTM_DELTOOLA* = 1029

-  TTM_ENUMTOOLSA* = 1038

-  TTM_GETCURRENTTOOLA* = 1039

-  TTM_GETTEXTA* = 1035

-  TTM_GETTOOLINFOA* = 1032

-  TTM_HITTESTA* = 1034

-  TTM_NEWTOOLRECTA* = 1030

-  TTM_SETTOOLINFOA* = 1033

-  TTM_UPDATETIPTEXTA* = 1036

-

-when defined(winUnicode):

-  const

-    TTM_ADDTOOL* = TTM_ADDTOOLW

-    TTM_DELTOOL* = TTM_DELTOOLW

-    TTM_ENUMTOOLS* = TTM_ENUMTOOLSW

-    TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLW

-    TTM_GETTEXT* = TTM_GETTEXTW

-    TTM_GETTOOLINFO* = TTM_GETTOOLINFOW

-    TTM_HITTEST* = TTM_HITTESTW

-    TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTW

-    TTM_SETTOOLINFO* = TTM_SETTOOLINFOW

-    TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTW

-else:

-  const

-    TTM_ADDTOOL* = TTM_ADDTOOLA

-    TTM_DELTOOL* = TTM_DELTOOLA

-    TTM_ENUMTOOLS* = TTM_ENUMTOOLSA

-    TTM_GETCURRENTTOOL* = TTM_GETCURRENTTOOLA

-    TTM_GETTEXT* = TTM_GETTEXTA

-    TTM_GETTOOLINFO* = TTM_GETTOOLINFOA

-    TTM_HITTEST* = TTM_HITTESTA

-    TTM_NEWTOOLRECT* = TTM_NEWTOOLRECTA

-    TTM_SETTOOLINFO* = TTM_SETTOOLINFOA

-    TTM_UPDATETIPTEXT* = TTM_UPDATETIPTEXTA

-# UNICODE

-

-const

-  TTM_GETTOOLCOUNT* = 1037

-  TTM_RELAYEVENT* = 1031

-  TTM_SETDELAYTIME* = 1027

-  TTM_WINDOWFROMPOINT* = 1040

-  # Tool tip control notification

-  TTN_NEEDTEXTW* = -530

-  TTN_NEEDTEXTA* = -520

-

-when defined(winUnicode):

-  const

-    TTN_NEEDTEXT* = TTN_NEEDTEXTW

-else:

-  const

-    TTN_NEEDTEXT* = TTN_NEEDTEXTA

-# UNICODE

-

-const

-  TTN_POP* = -522

-  TTN_SHOW* = -521

-  # Tree view control

-  TVM_CREATEDRAGIMAGE* = 4370

-  TVM_DELETEITEM* = 4353

-  TVM_ENDEDITLABELNOW* = 4374

-  TVM_ENSUREVISIBLE* = 4372

-  TVM_EXPAND* = 4354

-  TVM_GETCOUNT* = 4357

-  TVM_GETEDITCONTROL* = 4367

-  TVM_GETIMAGELIST* = 4360

-  TVM_GETINDENT* = 4358

-  TVM_GETITEMRECT* = 4356

-  TVM_GETNEXTITEM* = 4362

-  TVM_GETVISIBLECOUNT* = 4368

-  TVM_HITTEST* = 4369

-  TVM_EDITLABELW* = 4417

-  TVM_GETISEARCHSTRINGW* = 4416

-  TVM_GETITEMW* = 4414

-  TVM_INSERTITEMW* = 4402

-  TVM_SETITEMW* = 4415

-  TVM_EDITLABELA* = 4366

-  TVM_GETISEARCHSTRINGA* = 4375

-  TVM_GETITEMA* = 4364

-  TVM_INSERTITEMA* = 4352

-  TVM_SETITEMA* = 4365

-

-when defined(winUnicode):

-  const

-    TVM_EDITLABEL* = TVM_EDITLABELW

-    TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGW

-    TVM_GETITEM* = TVM_GETITEMW

-    TVM_INSERTITEM* = TVM_INSERTITEMW

-    TVM_SETITEM* = TVM_SETITEMW

-else:

-  const

-    TVM_EDITLABEL* = TVM_EDITLABELA

-    TVM_GETISEARCHSTRING* = TVM_GETISEARCHSTRINGA

-    TVM_GETITEM* = TVM_GETITEMA

-    TVM_INSERTITEM* = TVM_INSERTITEMA

-    TVM_SETITEM* = TVM_SETITEMA

-# UNICODE

-

-const

-  TVM_SELECTITEM* = 4363

-  TVM_SETIMAGELIST* = 4361

-  TVM_SETINDENT* = 4359

-  TVM_SORTCHILDREN* = 4371

-  TVM_SORTCHILDRENCB* = 4373

-  # Tree view control notification

-  TVN_KEYDOWN* = -412

-  TVN_BEGINDRAGW* = -456

-  TVN_BEGINLABELEDITW* = -459

-  TVN_BEGINRDRAGW* = -457

-  TVN_DELETEITEMW* = -458

-  TVN_ENDLABELEDITW* = -460

-  TVN_GETDISPINFOW* = -452

-  TVN_ITEMEXPANDEDW* = -455

-  TVN_ITEMEXPANDINGW* = -454

-  TVN_SELCHANGEDW* = -451

-  TVN_SELCHANGINGW* = -450

-  TVN_SETDISPINFOW* = -453

-  TVN_BEGINDRAGA* = -407

-  TVN_BEGINLABELEDITA* = -410

-  TVN_BEGINRDRAGA* = -408

-  TVN_DELETEITEMA* = -409

-  TVN_ENDLABELEDITA* = -411

-  TVN_GETDISPINFOA* = -403

-  TVN_ITEMEXPANDEDA* = -406

-  TVN_ITEMEXPANDINGA* = -405

-  TVN_SELCHANGEDA* = -402

-  TVN_SELCHANGINGA* = -401

-  TVN_SETDISPINFOA* = -404

-

-when defined(winUnicode):

-  const

-    TVN_BEGINDRAG* = TVN_BEGINDRAGW

-    TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITW

-    TVN_BEGINRDRAG* = TVN_BEGINRDRAGW

-    TVN_DELETEITEM* = TVN_DELETEITEMW

-    TVN_ENDLABELEDIT* = TVN_ENDLABELEDITW

-    TVN_GETDISPINFO* = TVN_GETDISPINFOW

-    TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDW

-    TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGW

-    TVN_SELCHANGED* = TVN_SELCHANGEDW

-    TVN_SELCHANGING* = TVN_SELCHANGINGW

-    TVN_SETDISPINFO* = TVN_SETDISPINFOW

-else:

-  const

-    TVN_BEGINDRAG* = TVN_BEGINDRAGA

-    TVN_BEGINLABELEDIT* = TVN_BEGINLABELEDITA

-    TVN_BEGINRDRAG* = TVN_BEGINRDRAGA

-    TVN_DELETEITEM* = TVN_DELETEITEMA

-    TVN_ENDLABELEDIT* = TVN_ENDLABELEDITA

-    TVN_GETDISPINFO* = TVN_GETDISPINFOA

-    TVN_ITEMEXPANDED* = TVN_ITEMEXPANDEDA

-    TVN_ITEMEXPANDING* = TVN_ITEMEXPANDINGA

-    TVN_SELCHANGED* = TVN_SELCHANGEDA

-    TVN_SELCHANGING* = TVN_SELCHANGINGA

-    TVN_SETDISPINFO* = TVN_SETDISPINFOA

-# UNICODE

-

-const

-  # Up/down control

-  UDM_GETACCEL* = 1132

-  UDM_GETBASE* = 1134

-  UDM_GETBUDDY* = 1130

-  UDM_GETPOS* = 1128

-  UDM_GETPOS32* = 1138

-  UDM_GETRANGE* = 1126

-  UDM_GETRANGE32* = 1136

-  UDM_SETACCEL* = 1131

-  UDM_SETBASE* = 1133

-  UDM_SETBUDDY* = 1129

-  UDM_SETPOS* = 1127

-  UDM_SETPOS32* = 1137

-  UDM_SETRANGE* = 1125

-  UDM_SETRANGE32* = 1135

-  # Up/down control notification

-  UDN_DELTAPOS* = -722

-  # Window messages

-  WM_ACTIVATE* = 6

-  WM_ACTIVATEAPP* = 28

-  WM_ASKCBFORMATNAME* = 780

-  WM_CANCELJOURNAL* = 75

-  WM_CANCELMODE* = 31

-  WM_CAPTURECHANGED* = 533

-  WM_CHANGECBCHAIN* = 781

-  WM_CHAR* = 258

-  WM_CHARTOITEM* = 47

-  WM_CHILDACTIVATE* = 34

-  WM_CHOOSEFONT_GETLOGFONT* = 1025

-  WM_CHOOSEFONT_SETLOGFONT* = 1125

-  WM_CHOOSEFONT_SETFLAGS* = 1126

-  WM_CLEAR* = 771

-  WM_CLOSE* = 16

-  WM_COMMAND* = 273

-  WM_COMPACTING* = 65

-  WM_COMPAREITEM* = 57

-  WM_CONTEXTMENU* = 123

-  WM_COPY* = 769

-  WM_COPYDATA* = 74

-  WM_CREATE* = 1

-  WM_CTLCOLORBTN* = 309

-  WM_CTLCOLORDLG* = 310

-  WM_CTLCOLOREDIT* = 307

-  WM_CTLCOLORLISTBOX* = 308

-  WM_CTLCOLORMSGBOX* = 306

-  WM_CTLCOLORSCROLLBAR* = 311

-  WM_CTLCOLORSTATIC* = 312

-  WM_CUT* = 768

-  WM_DEADCHAR* = 259

-  WM_DELETEITEM* = 45

-  WM_DESTROY* = 2

-  WM_DESTROYCLIPBOARD* = 775

-  WM_DEVICECHANGE* = 537

-  WM_DEVMODECHANGE* = 27

-  WM_DISPLAYCHANGE* = 126

-  WM_DRAWCLIPBOARD* = 776

-  WM_DRAWITEM* = 43

-  WM_DROPFILES* = 563

-  WM_ENABLE* = 10

-  WM_ENDSESSION* = 22

-  WM_ENTERIDLE* = 289

-  WM_ENTERMENULOOP* = 529

-  WM_ENTERSIZEMOVE* = 561

-  WM_ERASEBKGND* = 20

-  WM_EXITMENULOOP* = 530

-  WM_EXITSIZEMOVE* = 562

-  WM_FONTCHANGE* = 29

-  WM_GETDLGCODE* = 135

-  WM_GETFONT* = 49

-  WM_GETHOTKEY* = 51

-  WM_GETICON* = 127

-  WM_GETMINMAXINFO* = 36

-  WM_GETTEXT* = 13

-  WM_GETTEXTLENGTH* = 14

-  WM_HELP* = 83

-  WM_HOTKEY* = 786

-  WM_HSCROLL* = 276

-  WM_HSCROLLCLIPBOARD* = 782

-  WM_ICONERASEBKGND* = 39

-  WM_IME_CHAR* = 646

-  WM_IME_COMPOSITION* = 271

-  WM_IME_COMPOSITIONFULL* = 644

-  WM_IME_CONTROL* = 643

-  WM_IME_ENDCOMPOSITION* = 270

-  WM_IME_KEYDOWN* = 656

-  WM_IME_KEYUP* = 657

-  WM_IME_NOTIFY* = 642

-  WM_IME_SELECT* = 645

-  WM_IME_SETCONTEXT* = 641

-  WM_IME_STARTCOMPOSITION* = 269

-  WM_INITDIALOG* = 272

-  WM_INITMENU* = 278

-  WM_INITMENUPOPUP* = 279

-  WM_INPUTLANGCHANGE* = 81

-  WM_INPUTLANGCHANGEREQUEST* = 80

-  WM_KEYDOWN* = 256

-  WM_KEYUP* = 257

-  WM_KILLFOCUS* = 8

-  WM_LBUTTONDBLCLK* = 515

-  WM_LBUTTONDOWN* = 513

-  WM_LBUTTONUP* = 514

-  WM_MBUTTONDBLCLK* = 521

-  WM_MBUTTONDOWN* = 519

-  WM_MBUTTONUP* = 520

-  WM_MDIACTIVATE* = 546

-  WM_MDICASCADE* = 551

-  WM_MDICREATE* = 544

-  WM_MDIDESTROY* = 545

-  WM_MDIGETACTIVE* = 553

-  WM_MDIICONARRANGE* = 552

-  WM_MDIMAXIMIZE* = 549

-  WM_MDINEXT* = 548

-  WM_MDIREFRESHMENU* = 564

-  WM_MDIRESTORE* = 547

-  WM_MDISETMENU* = 560

-  WM_MDITILE* = 550

-  WM_MEASUREITEM* = 44

-  WM_MENUCHAR* = 288

-  WM_MENUSELECT* = 287

-  WM_MOUSEACTIVATE* = 33

-  WM_MOUSEMOVE* = 512

-  WM_MOUSEWHEEL* = 522

-  WM_MOUSEHOVER* = 673

-  WM_MOUSELEAVE* = 675

-  WM_MOVE* = 3

-  WM_MOVING* = 534

-  WM_NCACTIVATE* = 134

-  WM_NCCALCSIZE* = 131

-  WM_NCCREATE* = 129

-  WM_NCDESTROY* = 130

-  WM_NCHITTEST* = 132

-  WM_NCLBUTTONDBLCLK* = 163

-  WM_NCLBUTTONDOWN* = 161

-  WM_NCLBUTTONUP* = 162

-  WM_NCMBUTTONDBLCLK* = 169

-  WM_NCMBUTTONDOWN* = 167

-  WM_NCMBUTTONUP* = 168

-  WM_NCMOUSEMOVE* = 160

-  WM_NCPAINT* = 133

-  WM_NCRBUTTONDBLCLK* = 166

-  WM_NCRBUTTONDOWN* = 164

-  WM_NCRBUTTONUP* = 165

-  WM_NEXTDLGCTL* = 40

-  WM_NOTIFY* = 78

-  WM_NOTIFYFORMAT* = 85

-  WM_NULL* = 0

-  WM_PAINT* = 15

-  WM_PAINTCLIPBOARD* = 777

-  WM_PAINTICON* = 38

-  WM_PALETTECHANGED* = 785

-  WM_PALETTEISCHANGING* = 784

-  WM_PARENTNOTIFY* = 528

-  WM_PASTE* = 770

-  WM_PENWINFIRST* = 896

-  WM_PENWINLAST* = 911

-  WM_POWER* = 72

-  WM_POWERBROADCAST* = 536

-  WM_PRINT* = 791

-  WM_PRINTCLIENT* = 792

-  WM_PSD_ENVSTAMPRECT* = 1029

-  WM_PSD_FULLPAGERECT* = 1025

-  WM_PSD_GREEKTEXTRECT* = 1028

-  WM_PSD_MARGINRECT* = 1027

-  WM_PSD_MINMARGINRECT* = 1026

-  WM_PSD_PAGESETUPDLG* = 1024

-  WM_PSD_YAFULLPAGERECT* = 1030

-  WM_QUERYDRAGICON* = 55

-  WM_QUERYENDSESSION* = 17

-  WM_QUERYNEWPALETTE* = 783

-  WM_QUERYOPEN* = 19

-  WM_QUEUESYNC* = 35

-  WM_QUIT* = 18

-  WM_RBUTTONDBLCLK* = 518

-  WM_RBUTTONDOWN* = 516

-  WM_RBUTTONUP* = 517

-  WM_RENDERALLFORMATS* = 774

-  WM_RENDERFORMAT* = 773

-  WM_SETCURSOR* = 32

-  WM_SETFOCUS* = 7

-  WM_SETFONT* = 48

-  WM_SETHOTKEY* = 50

-  WM_SETICON* = 128

-  WM_SETREDRAW* = 11

-  WM_SETTEXT* = 12

-  WM_SETTINGCHANGE* = 26

-  WM_SHOWWINDOW* = 24

-  WM_SIZE* = 5

-  WM_SIZECLIPBOARD* = 779

-  WM_SIZING* = 532

-  WM_SPOOLERSTATUS* = 42

-  WM_STYLECHANGED* = 125

-  WM_STYLECHANGING* = 124

-  WM_SYSCHAR* = 262

-  WM_SYSCOLORCHANGE* = 21

-  WM_SYSCOMMAND* = 274

-  WM_SYSDEADCHAR* = 263

-  WM_SYSKEYDOWN* = 260

-  WM_SYSKEYUP* = 261

-  WM_TCARD* = 82

-  WM_TIMECHANGE* = 30

-  WM_TIMER* = 275

-  WM_UNDO* = 772

-  WM_USER* = 1024

-  WM_USERCHANGED* = 84

-  WM_VKEYTOITEM* = 46

-  WM_VSCROLL* = 277

-  WM_VSCROLLCLIPBOARD* = 778

-  WM_WINDOWPOSCHANGED* = 71

-  WM_WINDOWPOSCHANGING* = 70

-  WM_WININICHANGE* = 26

-  # Window message ranges

-  WM_KEYFIRST* = 256

-  WM_KEYLAST* = 264

-  WM_MOUSEFIRST* = 512

-  WM_MOUSELAST* = 525

-  WM_XBUTTONDOWN* = 523

-  WM_XBUTTONUP* = 524

-  WM_XBUTTONDBLCLK* = 525

-

-when defined(cpu64):

-  type

-    HALFLRESULT* = DWORD

-    HALFPARAM* = DWORD

-    HALFPARAMBOOL* = WINBOOL

-else:

-  type

-    HALFLRESULT* = int16

-    HALFPARAM* = int16

-    HALFPARAMBOOL* = WORDBOOL

-type

-  MSG* {.final, pure.} = object

-    hwnd*: HWND

-    message*: WINUINT

-    wParam*: WPARAM

-    lParam*: LPARAM

-    time*: DWORD

-    pt*: POINT

-

-  LPMSG* = ptr MSG

-  TMSG* = MSG

-  PMSG* = ptr MSG

-  PMessage* = ptr TMessage

-  TMessage* {.final, pure.} = object          #fields according to ICS

-    msg*: WINUINT

-    wParam*: WPARAM

-    lParam*: LPARAM

-    Result*: LRESULT

-

-  TWMSize* {.final, pure.} = object

-    Msg*: WINUINT

-    SizeType*: WPARAM

-    Width*: HALFPARAM

-    Height*: HALFPARAM

-    Result*: LRESULT

-

-  TWMNoParams* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: array[0..3, HALFPARAM]

-    Result*: LRESULT

-

-  TWMCancelMode* = TWMNoParams

-  TWMNCDestroy* = TWMNoParams

-  TWMDestroy* = TWMNoParams

-  TWMClose* = TWMNoParams

-  TWMQueryUIState* = TWMNoParams

-  TWMUIState* {.final, pure.} = object

-    Msg*: WINUINT

-    Action*: int16

-    Flags*: int16

-    Unused*: HRESULT

-

-  TWMChangeUIState* = TWMUIState

-  TWMUpdateUIState* = TWMUIState

-  TWMKey* {.final, pure.} = object

-    Msg*: WINUINT

-    CharCode*: int16

-    Unused*: int16

-    KeyData*: int32

-    Result*: LRESULT

-

-  TWMKeyDown* = TWMKey

-  TWMKeyUp* = TWMKey

-  TWMChar* = TWMKey

-  TWMSysChar* = TWMKey

-  TWMSysKeyDown* = TWMKey

-  TWMSysKeyUp* = TWMKey

-  TWMMenuChar* {.final, pure.} = object

-    Msg*: WINUINT

-    User*: char

-    MenuFlag*: int16

-    Menu*: HMENU

-    Result*: LRESULT

-

-  TWMGetDlgCode* = TWMNoParams

-  TWMFontChange* = TWMNoParams

-  TWMGetFont* = TWMNoParams

-  TWMSysColorChange* = TWMNoParams

-  TWMQueryDragIcon* = TWMNoParams

-  TWMScroll* {.final, pure.} = object

-    Msg*: WINUINT

-    ScrollCode*: HALFPARAM

-    Pos*: HALFPARAM

-    ScrollBar*: HWND

-    Result*: LRESULT

-

-  TWMHScroll* = TWMScroll

-  TWMVScroll* = TWMScroll

-  TWMGetText* {.final, pure.} = object

-    Msg*: WINUINT

-    TextMax*: LPARAM

-    Text*: cstring

-    Result*: LRESULT

-

-  TWMGetTextLength* = TWMNoParams

-  TWMKillFocus* {.final, pure.} = object

-    Msg*: WINUINT

-    FocusedWnd*: HWND

-    UnUsed*: WPARAM

-    Result*: LRESULT

-

-  TWMSetCursor* {.final, pure.} = object

-    Msg*: WINUINT

-    CursorWnd*: HWND

-    HitTest*: HALFPARAM

-    MouseMsg*: HALFPARAM

-    Result*: LRESULT

-

-  TWMSetFocus* {.final, pure.} = object

-    Msg*: WINUINT

-    FocusedWnd*: HWND

-    Unused*: WPARAM

-    Result*: LRESULT

-

-  TWMSetFont* {.final, pure.} = object

-    Msg*: WINUINT

-    Font*: HFONT

-    Redraw*: HALFPARAMBOOL

-    Unused*: HALFPARAM

-    Result*: LRESULT

-

-  TWMShowWindow* {.final, pure.} = object

-    Msg*: WINUINT

-    Show*: HALFPARAMBOOL

-    Unused*: HALFPARAM

-    Status*: WPARAM

-    Result*: LRESULT

-

-  TWMEraseBkgnd* {.final, pure.} = object

-    Msg*: WINUINT

-    DC*: HDC

-    Unused*: LPARAM

-    Result*: LRESULT

-

-  TWMNCHitTest* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int32

-    Pos*: SmallPoint

-    Result*: LRESULT

-

-  TWMMouse* {.final, pure.} = object

-    Msg*: WINUINT

-    Keys*: int32

-    Pos*: SmallPoint

-    Result*: LRESULT

-

-  TWMLButtonDblClk* = TWMMouse

-  TWMLButtonDown* = TWMMouse

-  TWMLButtonUp* = TWMMouse

-  TWMMButtonDblClk* = TWMMouse

-  TWMMButtonDown* = TWMMouse

-  TWMMButtonUp* = TWMMouse

-  TWMMouseWheel* {.final, pure.} = object

-    Msg*: WINUINT

-    Keys*: int16

-    WheelDelta*: int16

-    Pos*: SmallPoint

-    Result*: LRESULT

-

-  TWMNCHitMessage* {.final, pure.} = object

-    Msg*: WINUINT

-    HitTest*: int32

-    XCursor*: int16

-    YCursor*: int16

-    Result*: LRESULT

-

-  TWMNCLButtonDblClk* = TWMNCHitMessage

-  TWMNCLButtonDown* = TWMNCHitMessage

-  TWMNCLButtonUp* = TWMNCHitMessage

-  TWMNCMButtonDblClk* = TWMNCHitMessage

-  TWMNCMButtonDown* = TWMNCHitMessage

-  TWMNCMButtonUp* = TWMNCHitMessage

-  TWMNCMouseMove* = TWMNCHitMessage

-  TWMRButtonDblClk* = TWMMouse

-  TWMRButtonDown* = TWMMouse

-  TWMRButtonUp* = TWMMouse

-  TWMMouseMove* = TWMMouse

-  TWMPaint* {.final, pure.} = object

-    Msg*: WINUINT

-    DC*: HDC

-    Unused*: int32

-    Result*: LRESULT

-

-  TWMCommand* {.final, pure.} = object

-    Msg*: WINUINT

-    ItemID*: int16

-    NotifyCode*: int16

-    Ctl*: HWND

-    Result*: LRESULT

-

-  TWMNotify* {.final, pure.} = object

-    Msg*: WINUINT

-    IDCtrl*: int32

-    NMHdr*: PNMHdr

-    Result*: LRESULT

-

-  TWMPrint* {.final, pure.} = object

-    Msg*: WINUINT

-    DC*: HDC

-    Flags*: int

-    Result*: LRESULT

-

-  TWMPrintClient* = TWMPrint

-  TWMWinIniChange* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    Section*: cstring

-    Result*: LRESULT

-

-  TWMContextMenu* {.final, pure.} = object

-    Msg*: WINUINT

-    hWnd*: HWND

-    Pos*: SmallPoint

-    Result*: LRESULT

-

-  TWMNCCalcSize* {.final, pure.} = object

-    Msg*: WINUINT

-    CalcValidRects*: WINBOOL

-    CalcSize_Params*: PNCCalcSizeParams

-    Result*: LRESULT

-

-  TWMCharToItem* {.final, pure.} = object

-    Msg*: WINUINT

-    Key*: int16

-    CaretPos*: int16

-    ListBox*: HWND

-    Result*: LRESULT

-

-  TWMVKeyToItem* = TWMCharToItem

-  TMyEventRange = range[0'i16..16000'i16]

-  TWMParentNotify* {.final, pure.} = object

-    Msg*: WINUINT

-    case Event*: TMyEventRange

-    of TMyEventRange(WM_CREATE), TMyEventRange(WM_DESTROY):

-        ChildID*: int16

-        ChildWnd*: HWnd

-

-    of TMyEventRange(WM_LBUTTONDOWN),

-      TMyEventRange(WM_MBUTTONDOWN),

-      TMyEventRange(WM_RBUTTONDOWN):

-        Value*: int16

-        XPos*: int16

-        YPos*: int16

-

-    else:

-        Value1*: int16

-        Value2*: int32

-        Result*: LRESULT

-

-  TWMSysCommand* {.final, pure.} = object

-    Msg*: WINUINT

-    CmdType*: int32

-    XPos*: int16

-    YPos*: int16

-    Result*: LRESULT

-  #  case CmdType*: int32

-  #  of SC_HOTKEY:

-  #      ActivateWnd*: HWND

-  #  of SC_CLOSE, SC_HSCROLL, SC_MAXIMIZE, SC_MINIMIZE, SC_MOUSEMENU, SC_MOVE,

-  #     SC_NEXTWINDOW, SC_PREVWINDOW, SC_RESTORE, SC_SCREENSAVE, SC_SIZE,

-  #     SC_TASKLIST, SC_VSCROLL:

-  #      XPos*: int16

-  #      YPos*: int16

-  #      Result*: LRESULT

-  #  else: # of SC_KEYMENU:

-  #      Key*: int16

-

-  TWMMove* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    Pos*: SmallPoint

-    Result*: LRESULT

-

-  TWMWindowPosMsg* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    WindowPos*: PWindowPos

-    Result*: LRESULT

-

-  TWMWindowPosChanged* = TWMWindowPosMsg

-  TWMWindowPosChanging* = TWMWindowPosMsg

-  TWMCompareItem* {.final, pure.} = object

-    Msg*: WINUINT

-    Ctl*: HWnd

-    CompareItemStruct*: PCompareItemStruct

-    Result*: LRESULT

-

-  TWMDeleteItem* {.final, pure.} = object

-    Msg*: WINUINT

-    Ctl*: HWND

-    DeleteItemStruct*: PDeleteItemStruct

-    Result*: LRESULT

-

-  TWMDrawItem* {.final, pure.} = object

-    Msg*: WINUINT

-    Ctl*: HWND

-    DrawItemStruct*: PDrawItemStruct

-    Result*: LRESULT

-

-  TWMMeasureItem* {.final, pure.} = object

-    Msg*: WINUINT

-    IDCtl*: HWnd

-    MeasureItemStruct*: PMeasureItemStruct

-    Result*: LRESULT

-

-  TWMNCCreate* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    CreateStruct*: PCreateStruct

-    Result*: LRESULT

-

-  TWMInitMenuPopup* {.final, pure.} = object

-    Msg*: WINUINT

-    MenuPopup*: HMENU

-    Pos*: int16

-    SystemMenu*: WordBool

-    Result*: LRESULT

-

-  TWMMenuSelect* {.final, pure.} = object

-    Msg*: WINUINT

-    IDItem*: int16

-    MenuFlag*: int16

-    Menu*: HMENU

-    Result*: LRESULT

-

-  TWMActivate* {.final, pure.} = object

-    Msg*: WINUINT

-    Active*: int16

-    Minimized*: WordBool

-    ActiveWindow*: HWND

-    Result*: LRESULT

-

-  TWMQueryEndSession* {.final, pure.} = object

-    Msg*: WINUINT

-    Source*: int32

-    Unused*: int32

-    Result*: LRESULT

-

-  TWMMDIActivate* {.final, pure.} = object

-    Msg*: WINUINT

-    DeactiveWnd*: HWND

-    ActiveWnd*: HWND

-    Result*: LRESULT

-

-  TWMNextDlgCtl* {.final, pure.} = object

-    Msg*: WINUINT

-    CtlFocus*: int32

-    Handle*: WordBool

-    Unused*: int16

-    Result*: LRESULT

-

-  TWMHelp* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    HelpInfo*: PHelpInfo

-    Result*: LRESULT

-

-  TWMGetMinMaxInfo* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    MinMaxInfo*: PMinMaxInfo

-    Result*: LRESULT

-

-  TWMSettingChange* {.final, pure.} = object

-    Msg*: WINUINT

-    Flag*: int

-    Section*: cstring

-    Result*: LRESULT

-

-  TWMCreate* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int

-    CreateStruct*: PCreateStruct

-    Result*: LRESULT

-

-  TWMCtlColor* {.final, pure.} = object

-    Msg*: WINUINT

-    ChildDC*: HDC

-    ChildWnd*: HWND

-    Result*: LRESULT

-

-  TWMCtlColorScrollbar* = TWMCtlColor

-  TWMCtlColorStatic* = TWMCtlColor

-  TWMCtlColorBtn* = TWMCtlColor

-  TWMCtlColorListbox* = TWMCtlColor

-  TWMCtlColorMsgbox* = TWMCtlColor

-  TWMCtlColorDlg* = TWMCtlColor

-  TWMCtlColorEdit* = TWMCtlColor

-  TWMInitDialog* {.final, pure.} = object

-    Msg*: WINUINT

-    Focus*: HWND

-    InitParam*: int32

-    Result*: LRESULT

-

-  TWMNCPaint* {.final, pure.} = object

-    Msg*: WINUINT

-    RGN*: HRGN

-    Unused*: int32

-    Result*: LRESULT

-

-  TWMSetText* {.final, pure.} = object

-    Msg*: WINUINT

-    Unused*: int32

-    Text*: cstring

-    Result*: LRESULT

-

-  TWMSizeClipboard* {.final, pure.} = object

-    Msg*: WINUINT

-    Viewer*: HWND

-    RC*: Handle

-    Result*: LRESULT

-

-  TWMSpoolerStatus* {.final, pure.} = object

-    Msg*: WINUINT

-    JobStatus*: LPARAM

-    JobsLeft*: WPARAM

-    Unused*: WPARAM

-    Result*: LRESULT

-

-  TWMStyleChange* {.final, pure.} = object

-    Msg*: WINUINT

-    StyleType*: LPARAM

-    StyleStruct*: PStyleStruct

-    Result*: LRESULT

-

-  TWMStyleChanged* = TWMStyleChange

-  TWMStyleChanging* = TWMStyleChange

-  TWMSysDeadChar* {.final, pure.} = object

-    Msg*: WINUINT

-    CharCode*: WPARAM

-    Unused*: WPARAM

-    KeyData*: LPARAM

-    Result*: LRESULT

-

-  TWMSystemError* {.final, pure.} = object

-    Msg*: WINUINT

-    ErrSpec*: WPARAM

-    Unused*: LPARAM

-    Result*: LRESULT

-

-  TWMTimeChange* = TWMNoParams

-  TWMTimer* {.final, pure.} = object

-    Msg*: WINUINT

-    TimerID*: LPARAM

-    TimerProc*: FarProc

-    Result*: LRESULT

-

-  TWMUndo* = TWMNoParams

-  TWMVScrollClipboard* {.final, pure.} = object

-    Msg*: WINUINT

-    Viewer*: HWND

-    ScollCode*: WPARAM

-    ThumbPos*: WPARAM

-    Result*: LRESULT

-

-  TWMDisplayChange* {.final, pure.} = object

-    Msg*: WINUINT

-    BitsPerPixel*: int

-    Width*: WPARAM

-    Height*: WPARAM

-    Result*: LRESULT

-

-  TWMDropFiles* {.final, pure.} = object

-    Msg*: WINUINT

-    Drop*: HANDLE

-    Unused*: LPARAM

-    Result*: LRESULT

-

-  TWMEnable* {.final, pure.} = object

-    Msg*: int

-    Enabled*: WINBOOL

-    Unused*: int32

-    Result*: int32

-

-  TWMMouseActivate* {.final, pure.} = object

-    Msg*: int

-    TopLevel*: HWND

-    HitTestCode*: int16

-    MouseMsg*: int16

-    Result*: int32

-

-

-proc GetBinaryTypeA*(lpApplicationName: LPCSTR, lpBinaryType: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".}

-

-proc GetShortPathNameA*(lpszLongPath: LPCSTR, lpszShortPath: LPSTR,

-                        cchBuffer: DWORD): DWORD{.stdcall,

-                        dynlib: "kernel32", importc.}

-proc GetEnvironmentStringsA*(): LPSTR{.stdcall, dynlib: "kernel32", importc.}

-proc FreeEnvironmentStringsA*(para1: LPSTR): WINBOOL{.stdcall, dynlib: "kernel32", importc.}

-proc FormatMessageA*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD,

-                     dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD,

-                     Arguments: va_list): DWORD{.stdcall,dynlib: "kernel32", importc.}

-proc CreateMailslotA*(lpName: LPCSTR, nMaxMessageSize: DWORD,

-                      lReadTimeout: DWORD,

-                      lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc lstrcmpA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall,

-  dynlib: "kernel32", importc.}

-proc lstrcmpiA*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall, dynlib: "kernel32", importc.}

-proc lstrcpynA*(lpString1: LPSTR, lpString2: LPCSTR, iMaxLength: int32): LPSTR{.

-    stdcall, dynlib: "kernel32", importc.}

-proc CreateMutexA*(lpMutexAttributes: LPSECURITY_ATTRIBUTES,

-                   bInitialOwner: WINBOOL, lpName: LPCSTR): HANDLE{.stdcall,

-                   dynlib: "kernel32", importc.}

-proc OpenMutexA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc CreateEventA*(lpEventAttributes: LPSECURITY_ATTRIBUTES,

-                   bManualReset: WINBOOL, bInitialState: WINBOOL, lpName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc OpenEventA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc CreateSemaphoreA*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES,

-                       lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc OpenSemaphoreA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                     lpName: LPCSTR): HANDLE{.stdcall,

-                     dynlib: "kernel32", importc.}

-proc CreateFileMappingA*(hFile: HANDLE,

-                         lpFileMappingAttributes: LPSECURITY_ATTRIBUTES,

-                         flProtect: DWORD, dwMaximumSizeHigh: DWORD,

-                         dwMaximumSizeLow: DWORD, lpName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc.}

-proc OpenFileMappingA*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                       lpName: LPCSTR): HANDLE{.stdcall,

-                       dynlib: "kernel32", importc.}

-proc GetLogicalDriveStringsA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc.}

-proc LoadLibraryA*(lpLibFileName: LPCSTR): HINST{.stdcall,

-  dynlib: "kernel32", importc.}

-proc LoadLibraryExA*(lpLibFileName: LPCSTR, hFile: HANDLE, dwFlags: DWORD): HINST{.

-    stdcall, dynlib: "kernel32", importc.}

-proc GetModuleFileNameA*(hModule: HINST, lpFilename: LPSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc.}

-proc GetModuleHandleA*(lpModuleName: LPCSTR): HMODULE{.stdcall,

-     dynlib: "kernel32", importc.}

-proc FatalAppExitA*(uAction: WINUINT, lpMessageText: LPCSTR){.stdcall,

-     dynlib: "kernel32", importc.}

-proc GetCommandLineA*(): LPSTR{.stdcall, dynlib: "kernel32", importc.}

-proc GetEnvironmentVariableA*(lpName: LPCSTR, lpBuffer: LPSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc.}

-proc SetEnvironmentVariableA*(lpName: LPCSTR, lpValue: LPCSTR): WINBOOL{.stdcall,

-  dynlib: "kernel32", importc.}

-proc ExpandEnvironmentStringsA*(lpSrc: LPCSTR, lpDst: LPSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc.}

-proc OutputDebugStringA*(lpOutputString: LPCSTR){.stdcall,

-   dynlib: "kernel32", importc.}

-proc FindResourceA*(hModule: HINST, lpName: LPCSTR, lpType: LPCSTR): HRSRC{.

-    stdcall, dynlib: "kernel32", importc.}

-proc FindResourceExA*(hModule: HINST, lpType: LPCSTR, lpName: LPCSTR,

-                      wLanguage: int16): HRSRC{.stdcall,

-                      dynlib: "kernel32", importc.}

-proc EnumResourceTypesA*(hModule: HINST, lpEnumFunc: ENUMRESTYPEPROC,

-                         lParam: LONG): WINBOOL{.stdcall,

-                         dynlib: "kernel32", importc.}

-proc EnumResourceNamesA*(hModule: HINST, lpType: LPCSTR,

-                         lpEnumFunc: ENUMRESNAMEPROC, lParam: LONG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc.}

-proc EnumResourceLanguagesA*(hModule: HINST, lpType: LPCSTR, lpName: LPCSTR,

-                             lpEnumFunc: ENUMRESLANGPROC, lParam: LONG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumResourceLanguagesA".}

-

-proc BeginUpdateResourceA*(pFileName: LPCSTR, bDeleteExistingResources: WINBOOL): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "BeginUpdateResourceA".}

-

-proc UpdateResourceA*(hUpdate: HANDLE, lpType: LPCSTR, lpName: LPCSTR,

-                      wLanguage: int16, lpData: LPVOID, cbData: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "UpdateResourceA".}

-proc EndUpdateResourceA*(hUpdate: HANDLE, fDiscard: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "EndUpdateResourceA".}

-proc GlobalAddAtomA*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "GlobalAddAtomA".}

-proc GlobalFindAtomA*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "GlobalFindAtomA".}

-proc GlobalGetAtomNameA*(nAtom: ATOM, lpBuffer: LPSTR, nSize: int32): WINUINT{.

-    stdcall, dynlib: "kernel32", importc: "GlobalGetAtomNameA".}

-proc AddAtomA*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-                                        importc: "AddAtomA".}

-proc FindAtomA*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "FindAtomA".}

-proc GetAtomNameA*(nAtom: ATOM, lpBuffer: LPSTR, nSize: int32): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetAtomNameA".}

-proc GetProfileIntA*(lpAppName: LPCSTR, lpKeyName: LPCSTR, nDefault: WINT): WINUINT{.

-    stdcall, dynlib: "kernel32", importc: "GetProfileIntA".}

-proc GetProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR, lpDefault: LPCSTR,

-                        lpReturnedString: LPSTR, nSize: DWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetProfileStringA".}

-proc WriteProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR, lpString: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteProfileStringA".}

-proc GetProfileSectionA*(lpAppName: LPCSTR, lpReturnedString: LPSTR,

-                         nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetProfileSectionA".}

-proc WriteProfileSectionA*(lpAppName: LPCSTR, lpString: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteProfileSectionA".}

-proc GetPrivateProfileIntA*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                            nDefault: WINT, lpFileName: LPCSTR): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetPrivateProfileIntA".}

-proc GetPrivateProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                               lpDefault: LPCSTR, lpReturnedString: LPSTR,

-                               nSize: DWORD, lpFileName: LPCSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringA".}

-

-proc WritePrivateProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                                 lpString: LPCSTR, lpFileName: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringA".}

-proc GetPrivateProfileSectionA*(lpAppName: LPCSTR, lpReturnedString: LPSTR,

-                                nSize: DWORD, lpFileName: LPCSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileSectionA".}

-proc WritePrivateProfileSectionA*(lpAppName: LPCSTR, lpString: LPCSTR,

-                                  lpFileName: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WritePrivateProfileSectionA".}

-proc GetDriveTypeA*(lpRootPathName: LPCSTR): WINUINT{.stdcall, dynlib: "kernel32",

-    importc: "GetDriveTypeA".}

-proc GetSystemDirectoryA*(lpBuffer: LPSTR, uSize: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetSystemDirectoryA".}

-proc GetTempPathA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetTempPathA".}

-proc GetTempFileNameA*(lpPathName: LPCSTR, lpPrefixString: LPCSTR,

-                       uUnique: WINUINT, lpTempFileName: LPSTR): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetTempFileNameA".}

-proc GetWindowsDirectoryA*(lpBuffer: LPSTR, uSize: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetWindowsDirectoryA".}

-proc SetCurrentDirectoryA*(lpPathName: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetCurrentDirectoryA".}

-proc GetCurrentDirectoryA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetCurrentDirectoryA".}

-proc GetDiskFreeSpaceA*(lpRootPathName: LPCSTR, lpSectorsPerCluster: LPDWORD,

-                        lpBytesPerSector: LPDWORD,

-                        lpNumberOfFreeClusters: LPDWORD,

-                        lpTotalNumberOfClusters: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDiskFreeSpaceA".}

-proc CreateDirectoryA*(lpPathName: LPCSTR,

-

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateDirectoryA".}

-proc CreateDirectoryExA*(lpTemplateDirectory: LPCSTR, lpNewDirectory: LPCSTR,

-                         lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateDirectoryExA".}

-proc RemoveDirectoryA*(lpPathName: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "RemoveDirectoryA".}

-proc GetFullPathNameA*(lpFileName: LPCSTR, nBufferLength: DWORD,

-                       lpBuffer: LPSTR, lpFilePart: var LPSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetFullPathNameA".}

-proc DefineDosDeviceA*(dwFlags: DWORD, lpDeviceName: LPCSTR,

-                       lpTargetPath: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DefineDosDeviceA".}

-proc QueryDosDeviceA*(lpDeviceName: LPCSTR, lpTargetPath: LPSTR, ucchMax: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "QueryDosDeviceA".}

-proc CreateFileA*(lpFileName: LPCSTR, dwDesiredAccess: DWORD,

-                  dwShareMode: DWORD,

-                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                  dwCreationDisposition: DWORD, dwFlagsAndAttributes: DWORD,

-                  hTemplateFile: HANDLE): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "CreateFileA".}

-proc SetFileAttributesA*(lpFileName: LPCSTR, dwFileAttributes: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetFileAttributesA".}

-proc GetFileAttributesA*(lpFileName: LPCSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetFileAttributesA".}

-proc GetCompressedFileSizeA*(lpFileName: LPCSTR, lpFileSizeHigh: LPDWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetCompressedFileSizeA".}

-proc DeleteFileA*(lpFileName: LPCSTR): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "DeleteFileA".}

-proc SearchPathA*(lpPath: LPCSTR, lpFileName: LPCSTR, lpExtension: LPCSTR,

-                  nBufferLength: DWORD, lpBuffer: LPSTR, lpFilePart: LPSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "SearchPathA".}

-proc CopyFileA*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR,

-                bFailIfExists: WINBOOL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CopyFileA".}

-proc MoveFileA*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "MoveFileA".}

-proc MoveFileExA*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR,

-                  dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "MoveFileExA".}

-proc CreateNamedPipeA*(lpName: LPCSTR, dwOpenMode: DWORD, dwPipeMode: DWORD,

-                       nMaxInstances: DWORD, nOutBufferSize: DWORD,

-                       nInBufferSize: DWORD, nDefaultTimeOut: DWORD,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateNamedPipeA".}

-proc GetNamedPipeHandleStateA*(hNamedPipe: HANDLE, lpState: LPDWORD,

-                               lpCurInstances: LPDWORD,

-                               lpMaxCollectionCount: LPDWORD,

-                               lpCollectDataTimeout: LPDWORD, lpUserName: LPSTR,

-                               nMaxUserNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetNamedPipeHandleStateA".}

-proc CallNamedPipeA*(lpNamedPipeName: LPCSTR, lpInBuffer: LPVOID,

-                     nInBufferSize: DWORD, lpOutBuffer: LPVOID,

-                     nOutBufferSize: DWORD, lpBytesRead: LPDWORD,

-                     nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CallNamedPipeA".}

-proc WaitNamedPipeA*(lpNamedPipeName: LPCSTR, nTimeOut: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WaitNamedPipeA".}

-proc SetVolumeLabelA*(lpRootPathName: LPCSTR, lpVolumeName: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetVolumeLabelA".}

-proc GetVolumeInformationA*(lpRootPathName: LPCSTR, lpVolumeNameBuffer: LPSTR,

-                            nVolumeNameSize: DWORD,

-                            lpVolumeSerialNumber: LPDWORD,

-                            lpMaximumComponentLength: LPDWORD,

-                            lpFileSystemFlags: LPDWORD,

-                            lpFileSystemNameBuffer: LPSTR,

-                            nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVolumeInformationA".}

-proc ClearEventLogA*(hEventLog: HANDLE, lpBackupFileName: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ClearEventLogA".}

-proc BackupEventLogA*(hEventLog: HANDLE, lpBackupFileName: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "BackupEventLogA".}

-proc OpenEventLogA*(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "OpenEventLogA".}

-proc RegisterEventSourceA*(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "RegisterEventSourceA".}

-proc OpenBackupEventLogA*(lpUNCServerName: LPCSTR, lpFileName: LPCSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "OpenBackupEventLogA".}

-proc ReadEventLogA*(hEventLog: HANDLE, dwReadFlags: DWORD,

-                    dwRecordOffset: DWORD, lpBuffer: LPVOID,

-                    nNumberOfBytesToRead: DWORD, pnBytesRead: LPDWORD,

-                    pnMinNumberOfBytesNeeded: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ReadEventLogA".}

-proc ReportEventA*(hEventLog: HANDLE, wType: int16, wCategory: int16,

-                   dwEventID: DWORD, lpUserSid: PSID, wNumStrings: int16,

-                   dwDataSize: DWORD, lpStrings: LPPCSTR, lpRawData: LPVOID): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ReportEventA".}

-proc AccessCheckAndAuditAlarmA*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                                ObjectTypeName: LPSTR, ObjectName: LPSTR,

-                                SecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                DesiredAccess: DWORD,

-                                GenericMapping: PGENERIC_MAPPING,

-                                ObjectCreation: WINBOOL, GrantedAccess: LPDWORD,

-                                AccessStatus: LPBOOL, pfGenerateOnClose: LPBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AccessCheckAndAuditAlarmA".}

-proc ObjectOpenAuditAlarmA*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                            ObjectTypeName: LPSTR, ObjectName: LPSTR,

-                            pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                            ClientToken: HANDLE, DesiredAccess: DWORD,

-                            GrantedAccess: DWORD, Privileges: PPRIVILEGE_SET,

-                            ObjectCreation: WINBOOL, AccessGranted: WINBOOL,

-                            GenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-proc ObjectPrivilegeAuditAlarmA*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                                 ClientToken: HANDLE, DesiredAccess: DWORD,

-                                 Privileges: PPRIVILEGE_SET,

-                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-proc ObjectCloseAuditAlarmA*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                             GenerateOnClose: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectCloseAuditAlarmA".}

-proc PrivilegedServiceAuditAlarmA*(SubsystemName: LPCSTR, ServiceName: LPCSTR,

-                                   ClientToken: HANDLE,

-                                   Privileges: PPRIVILEGE_SET,

-                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}

-proc SetFileSecurityA*(lpFileName: LPCSTR,

-                       SecurityInformation: SECURITY_INFORMATION,

-                       pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetFileSecurityA".}

-proc GetFileSecurityA*(lpFileName: LPCSTR,

-                       RequestedInformation: SECURITY_INFORMATION,

-                       pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                       nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetFileSecurityA".}

-proc FindFirstChangeNotificationA*(lpPathName: LPCSTR, bWatchSubtree: WINBOOL,

-                                   dwNotifyFilter: DWORD): HANDLE{.stdcall,

-    dynlib: "kernel32", importc: "FindFirstChangeNotificationA".}

-proc IsBadStringPtrA*(lpsz: LPCSTR, ucchMax: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadStringPtrA".}

-proc LookupAccountSidA*(lpSystemName: LPCSTR, Sid: PSID, Name: LPSTR,

-                        cbName: LPDWORD, ReferencedDomainName: LPSTR,

-                        cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupAccountSidA".}

-proc LookupAccountNameA*(lpSystemName: LPCSTR, lpAccountName: LPCSTR, Sid: PSID,

-                         cbSid: LPDWORD, ReferencedDomainName: LPSTR,

-                         cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupAccountNameA".}

-proc LookupPrivilegeValueA*(lpSystemName: LPCSTR, lpName: LPCSTR, lpLuid: PLUID): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupPrivilegeValueA".}

-proc LookupPrivilegeNameA*(lpSystemName: LPCSTR, lpLuid: PLUID, lpName: LPSTR,

-                           cbName: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeNameA".}

-proc LookupPrivilegeDisplayNameA*(lpSystemName: LPCSTR, lpName: LPCSTR,

-                                  lpDisplayName: LPSTR, cbDisplayName: LPDWORD,

-                                  lpLanguageId: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameA".}

-proc BuildCommDCBA*(lpDef: LPCSTR, lpDCB: LPDCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "BuildCommDCBA".}

-proc BuildCommDCBAndTimeoutsA*(lpDef: LPCSTR, lpDCB: LPDCB,

-                               lpCommTimeouts: LPCOMMTIMEOUTS): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}

-proc CommConfigDialogA*(lpszName: LPCSTR, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}

-proc GetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG,

-                            lpdwSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDefaultCommConfigA".}

-proc SetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".}

-proc GetComputerNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetComputerNameA".}

-proc SetComputerNameA*(lpComputerName: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetComputerNameA".}

-proc GetUserNameA*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetUserNameA".}

-proc LoadKeyboardLayoutA*(pwszKLID: LPCSTR, Flags: WINUINT): HKL{.stdcall,

-    dynlib: "user32", importc: "LoadKeyboardLayoutA".}

-proc GetKeyboardLayoutNameA*(pwszKLID: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetKeyboardLayoutNameA".}

-proc CreateDesktopA*(lpszDesktop: LPSTR, lpszDevice: LPSTR, pDevmode: LPDEVMODE,

-                     dwFlags: DWORD, dwDesiredAccess: DWORD,

-                     lpsa: LPSECURITY_ATTRIBUTES): HDESK{.stdcall,

-    dynlib: "user32", importc: "CreateDesktopA".}

-proc OpenDesktopA*(lpszDesktop: LPSTR, dwFlags: DWORD, fInherit: WINBOOL,

-                   dwDesiredAccess: DWORD): HDESK{.stdcall, dynlib: "user32",

-    importc: "OpenDesktopA".}

-proc EnumDesktopsA*(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROC,

-                    lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "EnumDesktopsA".}

-proc CreateWindowStationA*(lpwinsta: LPSTR, dwReserved: DWORD,

-                           dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{.

-    stdcall, dynlib: "user32", importc: "CreateWindowStationA".}

-proc OpenWindowStationA*(lpszWinSta: LPSTR, fInherit: WINBOOL,

-                         dwDesiredAccess: DWORD): HWINSTA{.stdcall,

-    dynlib: "user32", importc: "OpenWindowStationA".}

-proc EnumWindowStationsA*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumWindowStationsA".}

-proc GetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-proc SetUserObjectInformationA*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                nLength: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetUserObjectInformationA".}

-proc RegisterWindowMessageA*(lpString: LPCSTR): WINUINT{.stdcall, dynlib: "user32",

-    importc: "RegisterWindowMessageA".}

-proc GetMessageA*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                  wMsgFilterMax: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetMessageA".}

-proc DispatchMessageA*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",

-    importc: "DispatchMessageA".}

-proc PeekMessageA*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                   wMsgFilterMax: WINUINT, wRemoveMsg: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "PeekMessageA".}

-proc SendMessageA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageA".}

-proc SendMessageTimeoutA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

-                          fuFlags: WINUINT, uTimeout: WINUINT, lpdwResult: LPDWORD): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}

-proc SendNotifyMessageA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SendNotifyMessageA".}

-proc SendMessageCallbackA*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                           lp: LPARAM, lpResultCallBack: SENDASYNCPROC,

-                           dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SendMessageCallbackA".}

-proc PostMessageA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "PostMessageA".}

-proc PostThreadMessageA*(idThread: DWORD, Msg: WINUINT, wp: WPARAM,

-                         lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "PostThreadMessageA".}

-proc DefWindowProcA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefWindowProcA".}

-proc CallWindowProcA*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: WINUINT,

-                      wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-    dynlib: "user32", importc: "CallWindowProcA".}

-proc RegisterClassA*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassA".}

-proc UnregisterClassA*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "UnregisterClassA".}

-proc GetClassInfoA*(hInstance: HINST, lpClassName: LPCSTR,

-                    lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetClassInfoA".}

-proc RegisterClassExA*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassExA".}

-proc GetClassInfoExA*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetClassInfoExA".}

-proc CreateWindowExA*(dwExStyle: DWORD, lpClassName: LPCSTR,

-                      lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32,

-                      nWidth: int32, nHeight: int32, hWndParent: HWND,

-                      menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{.

-    stdcall, dynlib: "user32", importc: "CreateWindowExA".}

-proc CreateDialogParamA*(hInstance: HINST, lpTemplateName: LPCSTR,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC,

-                         dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32",

-    importc: "CreateDialogParamA".}

-proc CreateDialogIndirectParamA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                                 hWndParent: HWND, lpDialogFunc: DLGPROC,

-                                 dwInitParam: LPARAM): HWND{.stdcall,

-    dynlib: "user32", importc: "CreateDialogIndirectParamA".}

-proc DialogBoxParamA*(hInstance: HINST, lpTemplateName: LPCSTR,

-                      hWndParent: HWND, lpDialogFunc: DLGPROC,

-                      dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32",

-    importc: "DialogBoxParamA".}

-proc DialogBoxIndirectParamA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                              hWndParent: HWND, lpDialogFunc: DLGPROC,

-                              dwInitParam: LPARAM): int32{.stdcall,

-    dynlib: "user32", importc: "DialogBoxIndirectParamA".}

-proc SetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetDlgItemTextA".}

-proc GetDlgItemTextA*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR,

-                      nMaxCount: int32): WINUINT{.stdcall, dynlib: "user32",

-    importc: "GetDlgItemTextA".}

-proc SendDlgItemMessageA*(hDlg: HWND, nIDDlgItem: int32, Msg: WINUINT,

-                          wp: WPARAM, lp: LPARAM): LONG{.stdcall,

-    dynlib: "user32", importc: "SendDlgItemMessageA".}

-proc DefDlgProcA*(hDlg: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefDlgProcA".}

-proc CallMsgFilterA*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CallMsgFilterA".}

-proc RegisterClipboardFormatA*(lpszFormat: LPCSTR): WINUINT{.stdcall,

-    dynlib: "user32", importc: "RegisterClipboardFormatA".}

-proc GetClipboardFormatNameA*(format: WINUINT, lpszFormatName: LPSTR,

-                              cchMaxCount: int32): int32{.stdcall,

-    dynlib: "user32", importc: "GetClipboardFormatNameA".}

-proc CharToOemA*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CharToOemA".}

-proc OemToCharA*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "OemToCharA".}

-proc CharToOemBuffA*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "CharToOemBuffA".}

-proc OemToCharBuffA*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "OemToCharBuffA".}

-proc CharUpperA*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                      importc: "CharUpperA".}

-proc CharUpperBuffA*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharUpperBuffA".}

-proc CharLowerA*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                      importc: "CharLowerA".}

-proc CharLowerBuffA*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharLowerBuffA".}

-proc CharNextA*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32",

-                                      importc: "CharNextA".}

-proc CharPrevA*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall,

-    dynlib: "user32", importc: "CharPrevA".}

-proc IsCharAlphaA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                       importc: "IsCharAlphaA".}

-proc IsCharAlphaNumericA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsCharAlphaNumericA".}

-proc IsCharUpperA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                       importc: "IsCharUpperA".}

-proc IsCharLowerA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                       importc: "IsCharLowerA".}

-proc GetKeyNameTextA*(lParam: LONG, lpString: LPSTR, nSize: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetKeyNameTextA".}

-proc VkKeyScanA*(ch: char): SHORT{.stdcall, dynlib: "user32",

-                                   importc: "VkKeyScanA".}

-proc VkKeyScanExA*(ch: char, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

-    importc: "VkKeyScanExA".}

-proc MapVirtualKeyA*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

-    dynlib: "user32", importc: "MapVirtualKeyA".}

-proc MapVirtualKeyExA*(uCode: WINUINT, uMapType: WINUINT, dwhkl: HKL): WINUINT{.stdcall,

-    dynlib: "user32", importc: "MapVirtualKeyExA".}

-proc LoadAcceleratorsA*(hInstance: HINST, lpTableName: LPCSTR): HACCEL{.stdcall,

-    dynlib: "user32", importc: "LoadAcceleratorsA".}

-proc CreateAcceleratorTableA*(para1: LPACCEL, para2: int32): HACCEL{.stdcall,

-    dynlib: "user32", importc: "CreateAcceleratorTableA".}

-proc CopyAcceleratorTableA*(hAccelSrc: HACCEL, lpAccelDst: LPACCEL,

-                            cAccelEntries: int32): int32{.stdcall,

-    dynlib: "user32", importc: "CopyAcceleratorTableA".}

-proc TranslateAcceleratorA*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{.

-    stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}

-proc LoadMenuA*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall,

-    dynlib: "user32", importc: "LoadMenuA".}

-proc LoadMenuIndirectA*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall,

-    dynlib: "user32", importc: "LoadMenuIndirectA".}

-proc ChangeMenuA*(menu: HMENU, cmd: WINUINT, lpszNewItem: LPCSTR, cmdInsert: WINUINT,

-                  flags: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ChangeMenuA".}

-proc GetMenuStringA*(menu: HMENU, uIDItem: WINUINT, lpString: LPSTR,

-                     nMaxCount: int32, uFlag: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "GetMenuStringA".}

-proc InsertMenuA*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "InsertMenuA".}

-proc AppendMenuA*(menu: HMENU, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "AppendMenuA".}

-proc ModifyMenuA*(hMnu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ModifyMenuA".}

-proc InsertMenuItemA*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                      para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "InsertMenuItemA".}

-proc GetMenuItemInfoA*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetMenuItemInfoA".}

-proc SetMenuItemInfoA*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetMenuItemInfoA".}

-proc DrawTextA*(hDC: HDC, lpString: LPCSTR, nCount: int32, lpRect: LPRECT,

-                uFormat: WINUINT): int32{.stdcall, dynlib: "user32",

-                                       importc: "DrawTextA".}

-proc DrawTextExA*(para1: HDC, para2: LPSTR, para3: int32, para4: LPRECT,

-                  para5: WINUINT, para6: LPDRAWTEXTPARAMS): int32{.stdcall,

-    dynlib: "user32", importc: "DrawTextExA".}

-proc GrayStringA*(hDC: HDC, hBrush: HBRUSH, lpOutputFunc: GRAYSTRINGPROC,

-                  lpData: LPARAM, nCount: int32, X: int32, Y: int32,

-                  nWidth: int32, nHeight: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GrayStringA".}

-proc DrawStateA*(para1: HDC, para2: HBRUSH, para3: DRAWSTATEPROC, para4: LPARAM,

-                 para5: WPARAM, para6: int32, para7: int32, para8: int32,

-                 para9: int32, para10: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DrawStateA".}

-proc TabbedTextOutA*(hDC: HDC, X: int32, Y: int32, lpString: LPCSTR,

-                     nCount: int32, nTabPositions: int32,

-                     lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{.

-    stdcall, dynlib: "user32", importc: "TabbedTextOutA".}

-proc GetTabbedTextExtentA*(hDC: HDC, lpString: LPCSTR, nCount: int32,

-                           nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{.

-    stdcall, dynlib: "user32", importc: "GetTabbedTextExtentA".}

-proc SetPropA*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetPropA".}

-proc GetPropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, dynlib: "user32",

-    importc: "GetPropA".}

-proc RemovePropA*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,

-    dynlib: "user32", importc: "RemovePropA".}

-proc EnumPropsExA*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{.

-    stdcall, dynlib: "user32", importc: "EnumPropsExA".}

-proc EnumPropsA*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,

-    dynlib: "user32", importc: "EnumPropsA".}

-proc SetWindowTextA*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetWindowTextA".}

-proc GetWindowTextA*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetWindowTextA".}

-proc GetWindowTextLengthA*(wnd: HWND): int32{.stdcall, dynlib: "user32",

-    importc: "GetWindowTextLengthA".}

-proc MessageBoxA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: int): int32{.

-    stdcall, dynlib: "user32", importc: "MessageBoxA".}

-proc MessageBoxExA*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: WINUINT,

-                    wLanguageId: int16): int32{.stdcall, dynlib: "user32",

-    importc: "MessageBoxExA".}

-proc MessageBoxIndirectA*(para1: LPMSGBOXPARAMS): int32{.stdcall,

-    dynlib: "user32", importc: "MessageBoxIndirectA".}

-proc GetWindowLongA*(wnd: HWND, nIndex: int32): LONG{.stdcall,

-    dynlib: "user32", importc: "GetWindowLongA".}

-proc SetWindowLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall,

-    dynlib: "user32", importc: "SetWindowLongA".}

-proc GetClassLongA*(wnd: HWND, nIndex: int32): DWORD{.stdcall,

-    dynlib: "user32", importc: "GetClassLongA".}

-proc SetClassLongA*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall,

-    dynlib: "user32", importc: "SetClassLongA".}

-when defined(cpu64):

-  proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongPtrA".}

-  proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".}

-  proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetClassLongPtrA".}

-  proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetClassLongPtrA".}

-else:

-  proc GetWindowLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongA".}

-  proc SetWindowLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongA".}

-  proc GetClassLongPtrA*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetClassLongA".}

-  proc SetClassLongPtrA*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetClassLongA".}

-proc FindWindowA*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall,

-    dynlib: "user32", importc: "FindWindowA".}

-proc FindWindowExA*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{.

-    stdcall, dynlib: "user32", importc: "FindWindowExA".}

-proc GetClassNameA*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetClassNameA".}

-proc SetWindowsHookExA*(idHook: int32, lpfn: HOOKPROC, hmod: HINST,

-                        dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32",

-    importc: "SetWindowsHookExA".}

-proc LoadBitmapA*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall,

-    dynlib: "user32", importc: "LoadBitmapA".}

-proc LoadCursorA*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall,

-    dynlib: "user32", importc: "LoadCursorA".}

-proc LoadCursorFromFileA*(lpFileName: LPCSTR): HCURSOR{.stdcall,

-    dynlib: "user32", importc: "LoadCursorFromFileA".}

-proc LoadIconA*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall,

-    dynlib: "user32", importc: "LoadIconA".}

-proc LoadImageA*(para1: HINST, para2: LPCSTR, para3: WINUINT, para4: int32,

-                 para5: int32, para6: WINUINT): HANDLE{.stdcall, dynlib: "user32",

-    importc: "LoadImageA".}

-proc LoadStringA*(hInstance: HINST, uID: WINUINT, lpBuffer: LPSTR,

-                  nBufferMax: int32): int32{.stdcall, dynlib: "user32",

-    importc: "LoadStringA".}

-proc IsDialogMessageA*(hDlg: HWND, lpMsg: LPMSG): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsDialogMessageA".}

-proc DlgDirListA*(hDlg: HWND, lpPathSpec: LPSTR, nIDListBox: int32,

-                  nIDStaticPath: int32, uFileType: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "DlgDirListA".}

-proc DlgDirSelectExA*(hDlg: HWND, lpString: LPSTR, nCount: int32,

-                      nIDListBox: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DlgDirSelectExA".}

-proc DlgDirListComboBoxA*(hDlg: HWND, lpPathSpec: LPSTR, nIDComboBox: int32,

-                          nIDStaticPath: int32, uFiletype: WINUINT): int32{.

-    stdcall, dynlib: "user32", importc: "DlgDirListComboBoxA".}

-proc DlgDirSelectComboBoxExA*(hDlg: HWND, lpString: LPSTR, nCount: int32,

-                              nIDComboBox: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DlgDirSelectComboBoxExA".}

-proc DefFrameProcA*(wnd: HWND, hWndMDIClient: HWND, uMsg: WINUINT, wp: WPARAM,

-                    lp: LPARAM): LRESULT{.stdcall, dynlib: "user32",

-    importc: "DefFrameProcA".}

-proc DefMDIChildProcA*(wnd: HWND, uMsg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefMDIChildProcA".}

-proc CreateMDIWindowA*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD,

-                       X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                       hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{.

-    stdcall, dynlib: "user32", importc: "CreateMDIWindowA".}

-proc WinHelpA*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: WINUINT, dwData: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "WinHelpA".}

-proc ChangeDisplaySettingsA*(lpDevMode: LPDEVMODE, dwFlags: DWORD): LONG{.

-    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}

-proc EnumDisplaySettingsA*(lpszDeviceName: LPCSTR, iModeNum: DWORD,

-                           lpDevMode: LPDEVMODE): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnumDisplaySettingsA".}

-proc SystemParametersInfoA*(uiAction: WINUINT, uiParam: WINUINT, pvParam: PVOID,

-                            fWinIni: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SystemParametersInfoA".}

-proc AddFontResourceA*(para1: LPCSTR): int32{.stdcall, dynlib: "gdi32",

-    importc: "AddFontResourceA".}

-proc CopyMetaFileA*(para1: HMETAFILE, para2: LPCSTR): HMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "CopyMetaFileA".}

-proc CreateFontA*(para1: int32, para2: int32, para3: int32, para4: int32,

-                  para5: int32, para6: DWORD, para7: DWORD, para8: DWORD,

-                  para9: DWORD, para10: DWORD, para11: DWORD, para12: DWORD,

-                  para13: DWORD, para14: LPCSTR): HFONT{.stdcall,

-    dynlib: "gdi32", importc: "CreateFontA".}

-proc CreateFontIndirectA*(para1: LPLOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-    importc: "CreateFontIndirectA".}

-proc CreateFontIndirectA*(para1: var LOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-    importc: "CreateFontIndirectA".}

-proc CreateICA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: LPDEVMODE): HDC{.

-    stdcall, dynlib: "gdi32", importc: "CreateICA".}

-proc CreateMetaFileA*(para1: LPCSTR): HDC{.stdcall, dynlib: "gdi32",

-    importc: "CreateMetaFileA".}

-proc CreateScalableFontResourceA*(para1: DWORD, para2: LPCSTR, para3: LPCSTR,

-                                  para4: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "CreateScalableFontResourceA".}

-proc EnumFontFamiliesExA*(para1: HDC, para2: LPLOGFONT, para3: FONTENUMEXPROC,

-                          para4: LPARAM, para5: DWORD): int32{.stdcall,

-    dynlib: "gdi32", importc: "EnumFontFamiliesExA".}

-proc EnumFontFamiliesA*(para1: HDC, para2: LPCSTR, para3: FONTENUMPROC,

-                        para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-    importc: "EnumFontFamiliesA".}

-proc EnumFontsA*(para1: HDC, para2: LPCSTR, para3: ENUMFONTSPROC, para4: LPARAM): int32{.

-    stdcall, dynlib: "gdi32", importc: "EnumFontsA".}

-proc EnumFontsA*(para1: HDC, para2: LPCSTR, para3: ENUMFONTSPROC, para4: pointer): int32{.

-    stdcall, dynlib: "gdi32", importc: "EnumFontsA".}

-proc GetCharWidthA*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthA".}

-proc GetCharWidth32A*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidth32A".}

-proc GetCharWidthFloatA*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: ptr float32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}

-proc GetCharABCWidthsA*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPABC): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}

-proc GetCharABCWidthsFloatA*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                             para4: LPABCFLOAT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}

-proc GetGlyphOutlineA*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                       para4: LPGLYPHMETRICS, para5: DWORD, para6: LPVOID,

-                       para7: PMAT2): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetGlyphOutlineA".}

-proc GetMetaFileA*(para1: LPCSTR): HMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "GetMetaFileA".}

-proc GetOutlineTextMetricsA*(para1: HDC, para2: WINUINT, para3: LPOUTLINETEXTMETRIC): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetOutlineTextMetricsA".}

-proc GetTextExtentPointA*(para1: HDC, para2: LPCSTR, para3: int32, para4: LPSIZE): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointA".}

-proc GetTextExtentPoint32A*(para1: HDC, para2: LPCSTR, para3: int32,

-                            para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentPoint32A".}

-proc GetTextExtentExPointA*(para1: HDC, para2: LPCSTR, para3: int32,

-                            para4: int32, para5: LPINT, para6: LPINT,

-                            para7: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentExPointA".}

-proc GetCharacterPlacementA*(para1: HDC, para2: LPCSTR, para3: int32,

-                             para4: int32, para5: LPGCP_RESULTS, para6: DWORD): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetCharacterPlacementA".}

-proc ResetDCA*(para1: HDC, para2: LPDEVMODE): HDC{.stdcall, dynlib: "gdi32",

-    importc: "ResetDCA".}

-proc RemoveFontResourceA*(para1: LPCSTR): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "RemoveFontResourceA".}

-proc CopyEnhMetaFileA*(para1: HENHMETAFILE, para2: LPCSTR): HENHMETAFILE{.

-    stdcall, dynlib: "gdi32", importc: "CopyEnhMetaFileA".}

-proc CreateEnhMetaFileA*(para1: HDC, para2: LPCSTR, para3: LPRECT, para4: LPCSTR): HDC{.

-    stdcall, dynlib: "gdi32", importc: "CreateEnhMetaFileA".}

-proc GetEnhMetaFileA*(para1: LPCSTR): HENHMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "GetEnhMetaFileA".}

-proc GetEnhMetaFileDescriptionA*(para1: HENHMETAFILE, para2: WINUINT, para3: LPSTR): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileDescriptionA".}

-proc GetTextMetricsA*(para1: HDC, para2: LPTEXTMETRIC): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetTextMetricsA".}

-proc StartDocA*(para1: HDC, para2: PDOCINFO): int32{.stdcall, dynlib: "gdi32",

-    importc: "StartDocA".}

-proc GetObjectA*(para1: HGDIOBJ, para2: int32, para3: LPVOID): int32{.stdcall,

-    dynlib: "gdi32", importc: "GetObjectA".}

-proc TextOutA*(para1: HDC, para2: int32, para3: int32, para4: LPCSTR,

-               para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                       importc: "TextOutA".}

-proc ExtTextOutA*(para1: HDC, para2: int32, para3: int32, para4: WINUINT,

-                  para5: LPRECT, para6: LPCSTR, para7: WINUINT, para8: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "ExtTextOutA".}

-proc PolyTextOutA*(para1: HDC, para2: PPOLYTEXT, para3: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyTextOutA".}

-proc GetTextFaceA*(para1: HDC, para2: int32, para3: LPSTR): int32{.stdcall,

-    dynlib: "gdi32", importc: "GetTextFaceA".}

-proc GetKerningPairsA*(para1: HDC, para2: DWORD, para3: LPKERNINGPAIR): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetKerningPairsA".}

-proc CreateColorSpaceA*(para1: LPLOGCOLORSPACE): HCOLORSPACE{.stdcall,

-    dynlib: "gdi32", importc: "CreateColorSpaceA".}

-proc GetLogColorSpaceA*(para1: HCOLORSPACE, para2: LPLOGCOLORSPACE, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetLogColorSpaceA".}

-proc GetICMProfileA*(para1: HDC, para2: DWORD, para3: LPSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetICMProfileA".}

-proc SetICMProfileA*(para1: HDC, para2: LPSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SetICMProfileA".}

-proc UpdateICMRegKeyA*(para1: DWORD, para2: DWORD, para3: LPSTR, para4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "UpdateICMRegKeyA".}

-proc EnumICMProfilesA*(para1: HDC, para2: ICMENUMPROC, para3: LPARAM): int32{.

-    stdcall, dynlib: "gdi32", importc: "EnumICMProfilesA".}

-proc PropertySheetA*(lppsph: LPCPROPSHEETHEADER): int32{.stdcall,

-    dynlib: "comctl32", importc: "PropertySheetA".}

-proc ImageList_LoadImageA*(hi: HINST, lpbmp: LPCSTR, cx: int32, cGrow: int32,

-                           crMask: COLORREF, uType: WINUINT, uFlags: WINUINT): HIMAGELIST{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageA".}

-proc CreateStatusWindowA*(style: LONG, lpszText: LPCSTR, hwndParent: HWND,

-                          wID: WINUINT): HWND{.stdcall, dynlib: "comctl32",

-    importc: "CreateStatusWindowA".}

-proc DrawStatusTextA*(hDC: HDC, lprc: LPRECT, pszText: LPCSTR, uFlags: WINUINT){.

-    stdcall, dynlib: "comctl32", importc: "DrawStatusTextA".}

-proc GetOpenFileNameA*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "GetOpenFileNameA".}

-proc GetSaveFileNameA*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "GetSaveFileNameA".}

-proc GetFileTitleA*(para1: LPCSTR, para2: LPSTR, para3: int16): int{.stdcall,

-    dynlib: "comdlg32", importc: "GetFileTitleA".}

-proc ChooseColorA*(para1: LPCHOOSECOLOR): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "ChooseColorA".}

-proc FindTextA*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-    importc: "FindTextA".}

-proc ReplaceTextA*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-    importc: "ReplaceTextA".}

-proc ChooseFontA*(para1: LPCHOOSEFONT): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "ChooseFontA".}

-proc PrintDlgA*(para1: LPPRINTDLG): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "PrintDlgA".}

-proc PageSetupDlgA*(para1: LPPAGESETUPDLG): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "PageSetupDlgA".}

-proc CreateProcessA*(lpApplicationName: LPCSTR, lpCommandLine: LPSTR,

-                     lpProcessAttributes: LPSECURITY_ATTRIBUTES,

-                     lpThreadAttributes: LPSECURITY_ATTRIBUTES,

-                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR,

-                     lpStartupInfo: LPSTARTUPINFO,

-                     lpProcessInformation: LPPROCESS_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

-proc GetStartupInfoA*(lpStartupInfo: LPSTARTUPINFO){.stdcall,

-    dynlib: "kernel32", importc: "GetStartupInfoA".}

-proc FindFirstFileA*(lpFileName: LPCSTR, lpFindFileData: LPWIN32_FIND_DATA): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}

-proc FindNextFileA*(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATA): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

-proc GetVersionExA*(VersionInformation: LPOSVERSIONINFO): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVersionExA".}

-proc CreateWindowA*(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD,

-                    X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                    lpParam: LPVOID): HWND

-proc CreateDialogA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                    lpDialogFunc: DLGPROC): HWND

-proc CreateDialogIndirectA*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                            hWndParent: HWND, lpDialogFunc: DLGPROC): HWND

-proc DialogBoxA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                 lpDialogFunc: DLGPROC): int32

-proc DialogBoxIndirectA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-proc CreateDCA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: PDEVMODE): HDC{.

-    stdcall, dynlib: "gdi32", importc: "CreateDCA".}

-proc VerInstallFileA*(uFlags: DWORD, szSrcFileName: LPSTR,

-                      szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR,

-                      szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{.

-    stdcall, dynlib: "version", importc: "VerInstallFileA".}

-proc GetFileVersionInfoSizeA*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{.

-    stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".}

-proc GetFileVersionInfoA*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD,

-                          lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version",

-    importc: "GetFileVersionInfoA".}

-proc VerLanguageNameA*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".}

-proc VerQueryValueA*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID,

-                     puLen: PUINT): WINBOOL{.stdcall, dynlib: "version",

-    importc: "VerQueryValueA".}

-proc VerFindFileA*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR,

-                   szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT,

-                   szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall,

-    dynlib: "version", importc: "VerFindFileA".}

-proc RegConnectRegistryA*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}

-proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}

-proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD,

-                      lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM,

-                      lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                      phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".}

-proc RegDeleteKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegDeleteKeyA".}

-proc RegDeleteValueA*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegDeleteValueA".}

-proc RegEnumKeyA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".}

-proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPSTR,

-                    lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR,

-                    lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

-proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR,

-                    lpcbValueName: LPDWORD, lpReserved: LPDWORD,

-                    lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

-proc RegLoadKeyA*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegLoadKeyA".}

-proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}

-proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,

-                    samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegOpenKeyExA".}

-proc RegQueryInfoKeyA*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD,

-                       lpReserved: LPDWORD, lpcSubKeys: LPDWORD,

-                       lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD,

-                       lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD,

-                       lpcbMaxValueLen: LPDWORD,

-                       lpcbSecurityDescriptor: LPDWORD,

-                       lpftLastWriteTime: PFILETIME): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegQueryInfoKeyA".}

-proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR,

-                     lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",

-    importc: "RegQueryValueA".}

-proc RegQueryMultipleValuesA*(key: HKEY, val_list: PVALENT, num_vals: DWORD,

-                              lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}

-proc RegQueryValueExA*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD,

-                       lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".}

-proc RegReplaceKeyA*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR,

-                     lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32",

-    importc: "RegReplaceKeyA".}

-proc RegRestoreKeyA*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegRestoreKeyA".}

-proc RegSaveKeyA*(key: HKEY, lpFile: LPCSTR,

-                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegSaveKeyA".}

-proc RegSetValueA*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR,

-                   cbData: DWORD): LONG{.stdcall, dynlib: "advapi32",

-    importc: "RegSetValueA".}

-proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD,

-                     dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}

-proc RegUnLoadKeyA*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegUnLoadKeyA".}

-proc InitiateSystemShutdownA*(lpMachineName: LPSTR, lpMessage: LPSTR,

-                              dwTimeout: DWORD, bForceAppsClosed: WINBOOL,

-                              bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "InitiateSystemShutdownA".}

-proc AbortSystemShutdownA*(lpMachineName: LPSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AbortSystemShutdownA".}

-proc CompareStringA*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR,

-                     cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "CompareStringA".}

-proc LCMapStringA*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR,

-                   cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "LCMapStringA".}

-proc GetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR,

-                     cchData: int32): int32{.stdcall, dynlib: "kernel32",

-    importc: "GetLocaleInfoA".}

-proc SetLocaleInfoA*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".}

-proc GetTimeFormatA*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME,

-                     lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".}

-proc GetDateFormatA*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME,

-                     lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "GetDateFormatA".}

-proc GetNumberFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR,

-                       lpFormat: PNUMBERFMT, lpNumberStr: LPSTR,

-                       cchNumber: int32): int32{.stdcall, dynlib: "kernel32",

-    importc: "GetNumberFormatA".}

-proc GetCurrencyFormatA*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR,

-                         lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR,

-                         cchCurrency: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "GetCurrencyFormatA".}

-proc EnumCalendarInfoA*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID,

-                        Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "EnumCalendarInfoA".}

-proc EnumTimeFormatsA*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID,

-                       dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "EnumTimeFormatsA".}

-proc EnumDateFormatsA*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID,

-                       dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "EnumDateFormatsA".}

-proc GetStringTypeExA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                       cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeExA".}

-proc GetStringTypeA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                     cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeA".}

-proc FoldStringA*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32,

-                  lpDestStr: LPSTR, cchDest: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "FoldStringA".}

-proc EnumSystemLocalesA*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".}

-proc EnumSystemCodePagesA*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesA".}

-proc PeekConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                        nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}

-proc ReadConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                        nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}

-proc WriteConsoleInputA*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}

-proc ReadConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                         dwBufferSize: COORD, dwBufferCoord: COORD,

-                         lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-proc WriteConsoleOutputA*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                          dwBufferSize: COORD, dwBufferCoord: COORD,

-                          lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-proc ReadConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPSTR,

-                                  nLength: DWORD, dwReadCoord: COORD,

-                                  lpNumberOfCharsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}

-proc WriteConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR,

-                                   nLength: DWORD, dwWriteCoord: COORD,

-                                   lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-proc FillConsoleOutputCharacterA*(hConsoleOutput: HANDLE, cCharacter: char,

-                                  nLength: DWORD, dwWriteCoord: COORD,

-                                  lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

-proc ScrollConsoleScreenBufferA*(hConsoleOutput: HANDLE,

-                                 lpScrollRectangle: PSMALL_RECT,

-                                 lpClipRectangle: PSMALL_RECT,

-                                 dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}

-proc GetConsoleTitleA*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetConsoleTitleA".}

-proc SetConsoleTitleA*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleTitleA".}

-proc ReadConsoleA*(hConsoleInput: HANDLE, lpBuffer: LPVOID,

-                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD,

-                   lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReadConsoleA".}

-proc WriteConsoleA*(hConsoleOutput: HANDLE, lpBuffer: pointer,

-                    nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

-proc WNetAddConnectionA*(lpRemoteName: LPCSTR, lpPassword: LPCSTR,

-                         lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetAddConnectionA".}

-proc WNetAddConnection2A*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR,

-                          lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetAddConnection2A".}

-proc WNetAddConnection3A*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                          lpPassword: LPCSTR, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".}

-proc WNetCancelConnectionA*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetCancelConnectionA".}

-proc WNetCancelConnection2A*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".}

-proc WNetGetConnectionA*(lpLocalName: LPCSTR, lpRemoteName: LPSTR,

-                         lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetConnectionA".}

-proc WNetUseConnectionA*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                         lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD,

-                         lpAccessName: LPSTR, lpBufferSize: LPDWORD,

-                         lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetUseConnectionA".}

-proc WNetSetConnectionA*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".}

-proc WNetConnectionDialog1A*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}

-proc WNetDisconnectDialog1A*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetDisconnectDialog1A".}

-proc WNetOpenEnumA*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD,

-                    lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".}

-proc WNetEnumResourceA*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID,

-                        lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetEnumResourceA".}

-proc WNetGetUniversalNameA*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD,

-                            lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

-proc WNetGetUserA*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUserA".}

-proc WNetGetProviderNameA*(dwNetType: DWORD, lpProviderName: LPSTR,

-                           lpBufferSize: LPDWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetProviderNameA".}

-proc WNetGetNetworkInformationA*(lpProvider: LPCSTR,

-                                 lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}

-proc WNetGetLastErrorA*(lpError: LPDWORD, lpErrorBuf: LPSTR,

-                        nErrorBufSize: DWORD, lpNameBuf: LPSTR,

-                        nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetLastErrorA".}

-proc MultinetGetConnectionPerformanceA*(lpNetResource: LPNETRESOURCE,

-    lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall,

-    dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".}

-proc ChangeServiceConfigA*(hService: SC_HANDLE, dwServiceType: DWORD,

-                           dwStartType: DWORD, dwErrorControl: DWORD,

-                           lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR,

-                           lpdwTagId: LPDWORD, lpDependencies: LPCSTR,

-                           lpServiceStartName: LPCSTR, lpPassword: LPCSTR,

-                           lpDisplayName: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ChangeServiceConfigA".}

-proc CreateServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                     lpDisplayName: LPCSTR, dwDesiredAccess: DWORD,

-                     dwServiceType: DWORD, dwStartType: DWORD,

-                     dwErrorControl: DWORD, lpBinaryPathName: LPCSTR,

-                     lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD,

-                     lpDependencies: LPCSTR, lpServiceStartName: LPCSTR,

-                     lpPassword: LPCSTR): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "CreateServiceA".}

-proc EnumDependentServicesA*(hService: SC_HANDLE, dwServiceState: DWORD,

-                             lpServices: LPENUM_SERVICE_STATUS,

-                             cbBufSize: DWORD, pcbBytesNeeded: LPDWORD,

-                             lpServicesReturned: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "EnumDependentServicesA".}

-proc EnumServicesStatusA*(hSCManager: SC_HANDLE, dwServiceType: DWORD,

-                          dwServiceState: DWORD,

-                          lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD,

-                          pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD,

-                          lpResumeHandle: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "EnumServicesStatusA".}

-proc GetServiceKeyNameA*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR,

-                         lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".}

-proc GetServiceDisplayNameA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                             lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".}

-proc OpenSCManagerA*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR,

-                     dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "OpenSCManagerA".}

-proc OpenServiceA*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                   dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "OpenServiceA".}

-proc QueryServiceConfigA*(hService: SC_HANDLE,

-                          lpServiceConfig: LPQUERY_SERVICE_CONFIG,

-                          cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".}

-proc QueryServiceLockStatusA*(hSCManager: SC_HANDLE,

-                              lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS,

-                              cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".}

-proc RegisterServiceCtrlHandlerA*(lpServiceName: LPCSTR,

-                                  lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".}

-proc StartServiceCtrlDispatcherA*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".}

-proc StartServiceA*(hService: SC_HANDLE, dwNumServiceArgs: DWORD,

-                    lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "StartServiceA".}

-proc DragQueryFileA*(para1: HDROP, para2: int, para3: cstring, para4: int): int{.

-    stdcall, dynlib: "shell32", importc: "DragQueryFileA".}

-proc ExtractAssociatedIconA*(para1: HINST, para2: cstring, para3: LPWORD): HICON{.

-    stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".}

-proc ExtractIconA*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall,

-    dynlib: "shell32", importc: "ExtractIconA".}

-proc FindExecutableA*(para1: cstring, para2: cstring, para3: cstring): HINST{.

-    stdcall, dynlib: "shell32", importc: "FindExecutableA".}

-proc ShellAboutA*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{.

-    stdcall, dynlib: "shell32", importc: "ShellAboutA".}

-proc ShellExecuteA*(para1: HWND, para2: cstring, para3: cstring, para4: cstring,

-                    para5: cstring, para6: int32): HINST{.stdcall,

-    dynlib: "shell32", importc: "ShellExecuteA".}

-proc Shell_NotifyIconA*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{.

-    stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".}

-proc DdeCreateStringHandleA*(para1: DWORD, para2: cstring, para3: int32): HSZ{.

-    stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".}

-proc DdeInitializeA*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD,

-                     para4: DWORD): WINUINT{.stdcall, dynlib: "user32",

-    importc: "DdeInitializeA".}

-proc DdeQueryStringA*(para1: DWORD, para2: HSZ, para3: cstring, para4: DWORD,

-                      para5: int32): DWORD{.stdcall, dynlib: "user32",

-    importc: "DdeQueryStringA".}

-proc LogonUserA*(para1: LPSTR, para2: LPSTR, para3: LPSTR, para4: DWORD,

-                 para5: DWORD, para6: PHANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LogonUserA".}

-proc CreateProcessAsUserA*(para1: HANDLE, para2: LPCTSTR, para3: LPTSTR,

-                           para4: LPSECURITY_ATTRIBUTES,

-                           para5: LPSECURITY_ATTRIBUTES, para6: WINBOOL,

-                           para7: DWORD, para8: LPVOID, para9: LPCTSTR,

-                           para10: LPSTARTUPINFO, para11: LPPROCESS_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "CreateProcessAsUserA".}

-proc GetBinaryTypeW*(lpApplicationName: LPCWSTR, lpBinaryType: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetBinaryTypeW".}

-proc GetShortPathNameW*(lpszLongPath: LPCWSTR, lpszShortPath: LPWSTR,

-                        cchBuffer: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetShortPathNameW".}

-proc GetEnvironmentStringsW*(): LPWSTR{.stdcall, dynlib: "kernel32",

-                                        importc: "GetEnvironmentStringsW".}

-proc FreeEnvironmentStringsW*(para1: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FreeEnvironmentStringsW".}

-proc FormatMessageW*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD,

-                     dwLanguageId: DWORD, lpBuffer: LPWSTR, nSize: DWORD,

-                     Arguments: va_list): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "FormatMessageW".}

-proc CreateMailslotW*(lpName: LPCWSTR, nMaxMessageSize: DWORD,

-                      lReadTimeout: DWORD,

-                      lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateMailslotW".}

-proc lstrcmpW*(lpString1: LPCWSTR, lpString2: LPCWSTR): int32{.stdcall,

-    dynlib: "kernel32", importc: "lstrcmpW".}

-proc lstrcmpiW*(lpString1: LPCWSTR, lpString2: LPCWSTR): int32{.stdcall,

-    dynlib: "kernel32", importc: "lstrcmpiW".}

-proc lstrcpynW*(lpString1: LPWSTR, lpString2: LPCWSTR, iMaxLength: int32): LPWSTR{.

-    stdcall, dynlib: "kernel32", importc: "lstrcpynW".}

-proc lstrcpyW*(lpString1: LPWSTR, lpString2: LPCWSTR): LPWSTR{.stdcall,

-    dynlib: "kernel32", importc: "lstrcpyW".}

-proc lstrcatW*(lpString1: LPWSTR, lpString2: LPCWSTR): LPWSTR{.stdcall,

-    dynlib: "kernel32", importc: "lstrcatW".}

-proc lstrlenW*(lpString: LPCWSTR): int32{.stdcall, dynlib: "kernel32",

-    importc: "lstrlenW".}

-proc CreateMutexW*(lpMutexAttributes: LPSECURITY_ATTRIBUTES,

-                   bInitialOwner: WINBOOL, lpName: LPCWSTR): HANDLE{.stdcall,

-    dynlib: "kernel32", importc: "CreateMutexW".}

-proc OpenMutexW*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                 lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "OpenMutexW".}

-proc CreateEventW*(lpEventAttributes: LPSECURITY_ATTRIBUTES,

-                   bManualReset: WINBOOL, bInitialState: WINBOOL,

-                   lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "CreateEventW".}

-proc OpenEventW*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                 lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "OpenEventW".}

-proc CreateSemaphoreW*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES,

-                       lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCWSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateSemaphoreW".}

-proc OpenSemaphoreW*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                     lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "OpenSemaphoreW".}

-proc CreateFileMappingW*(hFile: HANDLE,

-                         lpFileMappingAttributes: LPSECURITY_ATTRIBUTES,

-                         flProtect: DWORD, dwMaximumSizeHigh: DWORD,

-                         dwMaximumSizeLow: DWORD, lpName: LPCWSTR): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateFileMappingW".}

-proc OpenFileMappingW*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                       lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "OpenFileMappingW".}

-proc GetLogicalDriveStringsW*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetLogicalDriveStringsW".}

-proc LoadLibraryW*(lpLibFileName: LPCWSTR): HINST{.stdcall, dynlib: "kernel32",

-    importc: "LoadLibraryW".}

-proc LoadLibraryExW*(lpLibFileName: LPCWSTR, hFile: HANDLE, dwFlags: DWORD): HINST{.

-    stdcall, dynlib: "kernel32", importc: "LoadLibraryExW".}

-proc GetModuleFileNameW*(hModule: HINST, lpFilename: LPWSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetModuleFileNameW".}

-proc GetModuleHandleW*(lpModuleName: LPCWSTR): HMODULE{.stdcall,

-    dynlib: "kernel32", importc: "GetModuleHandleW".}

-proc FatalAppExitW*(uAction: WINUINT, lpMessageText: LPCWSTR){.stdcall,

-    dynlib: "kernel32", importc: "FatalAppExitW".}

-proc GetCommandLineW*(): LPWSTR{.stdcall, dynlib: "kernel32",

-                                 importc: "GetCommandLineW".}

-proc GetEnvironmentVariableW*(lpName: LPCWSTR, lpBuffer: LPWSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetEnvironmentVariableW".}

-proc SetEnvironmentVariableW*(lpName: LPCWSTR, lpValue: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableW".}

-proc ExpandEnvironmentStringsW*(lpSrc: LPCWSTR, lpDst: LPWSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "ExpandEnvironmentStringsW".}

-proc OutputDebugStringW*(lpOutputString: LPCWSTR){.stdcall, dynlib: "kernel32",

-    importc: "OutputDebugStringW".}

-proc FindResourceW*(hModule: HINST, lpName: LPCWSTR, lpType: LPCWSTR): HRSRC{.

-    stdcall, dynlib: "kernel32", importc: "FindResourceW".}

-proc FindResourceExW*(hModule: HINST, lpType: LPCWSTR, lpName: LPCWSTR,

-                      wLanguage: int16): HRSRC{.stdcall, dynlib: "kernel32",

-    importc: "FindResourceExW".}

-proc EnumResourceTypesW*(hModule: HINST, lpEnumFunc: ENUMRESTYPEPROC,

-                         lParam: LONG): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "EnumResourceTypesW".}

-proc EnumResourceNamesW*(hModule: HINST, lpType: LPCWSTR,

-                         lpEnumFunc: ENUMRESNAMEPROC, lParam: LONG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumResourceNamesW".}

-proc EnumResourceLanguagesW*(hModule: HINST, lpType: LPCWSTR, lpName: LPCWSTR,

-                             lpEnumFunc: ENUMRESLANGPROC, lParam: LONG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumResourceLanguagesW".}

-proc BeginUpdateResourceW*(pFileName: LPCWSTR, bDeleteExistingResources: WINBOOL): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "BeginUpdateResourceW".}

-proc UpdateResourceW*(hUpdate: HANDLE, lpType: LPCWSTR, lpName: LPCWSTR,

-                      wLanguage: int16, lpData: LPVOID, cbData: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "UpdateResourceW".}

-proc EndUpdateResourceW*(hUpdate: HANDLE, fDiscard: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "EndUpdateResourceW".}

-proc GlobalAddAtomW*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "GlobalAddAtomW".}

-proc GlobalFindAtomW*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "GlobalFindAtomW".}

-proc GlobalGetAtomNameW*(nAtom: ATOM, lpBuffer: LPWSTR, nSize: int32): WINUINT{.

-    stdcall, dynlib: "kernel32", importc: "GlobalGetAtomNameW".}

-proc AddAtomW*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "AddAtomW".}

-proc FindAtomW*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "FindAtomW".}

-proc GetAtomNameW*(nAtom: ATOM, lpBuffer: LPWSTR, nSize: int32): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetAtomNameW".}

-proc GetProfileIntW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR, nDefault: WINT): WINUINT{.

-    stdcall, dynlib: "kernel32", importc: "GetProfileIntW".}

-proc GetProfileStringW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                        lpDefault: LPCWSTR, lpReturnedString: LPWSTR,

-                        nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetProfileStringW".}

-proc WriteProfileStringW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                          lpString: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteProfileStringW".}

-proc GetProfileSectionW*(lpAppName: LPCWSTR, lpReturnedString: LPWSTR,

-                         nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetProfileSectionW".}

-proc WriteProfileSectionW*(lpAppName: LPCWSTR, lpString: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteProfileSectionW".}

-proc GetPrivateProfileIntW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                            nDefault: WINT, lpFileName: LPCWSTR): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetPrivateProfileIntW".}

-proc GetPrivateProfileStringW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                               lpDefault: LPCWSTR, lpReturnedString: LPWSTR,

-                               nSize: DWORD, lpFileName: LPCWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringW".}

-proc WritePrivateProfileStringW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                                 lpString: LPCWSTR, lpFileName: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringW".}

-proc GetPrivateProfileSectionW*(lpAppName: LPCWSTR, lpReturnedString: LPWSTR,

-                                nSize: DWORD, lpFileName: LPCWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileSectionW".}

-proc WritePrivateProfileSectionW*(lpAppName: LPCWSTR, lpString: LPCWSTR,

-                                  lpFileName: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WritePrivateProfileSectionW".}

-proc GetDriveTypeW*(lpRootPathName: LPCWSTR): WINUINT{.stdcall, dynlib: "kernel32",

-    importc: "GetDriveTypeW".}

-proc GetSystemDirectoryW*(lpBuffer: LPWSTR, uSize: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetSystemDirectoryW".}

-proc GetTempPathW*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetTempPathW".}

-proc GetTempFileNameW*(lpPathName: LPCWSTR, lpPrefixString: LPCWSTR,

-                       uUnique: WINUINT, lpTempFileName: LPWSTR): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetTempFileNameW".}

-proc GetWindowsDirectoryW*(lpBuffer: LPWSTR, uSize: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "GetWindowsDirectoryW".}

-proc SetCurrentDirectoryW*(lpPathName: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetCurrentDirectoryW".}

-proc GetCurrentDirectoryW*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetCurrentDirectoryW".}

-proc GetDiskFreeSpaceW*(lpRootPathName: LPCWSTR, lpSectorsPerCluster: LPDWORD,

-                        lpBytesPerSector: LPDWORD,

-                        lpNumberOfFreeClusters: LPDWORD,

-                        lpTotalNumberOfClusters: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDiskFreeSpaceW".}

-proc CreateDirectoryW*(lpPathName: LPCWSTR,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateDirectoryW".}

-proc CreateDirectoryExW*(lpTemplateDirectory: LPCWSTR, lpNewDirectory: LPCWSTR,

-                         lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateDirectoryExW".}

-proc RemoveDirectoryW*(lpPathName: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "RemoveDirectoryW".}

-proc GetFullPathNameW*(lpFileName: LPCWSTR, nBufferLength: DWORD,

-                       lpBuffer: LPWSTR, lpFilePart: var LPWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetFullPathNameW".}

-proc DefineDosDeviceW*(dwFlags: DWORD, lpDeviceName: LPCWSTR,

-                       lpTargetPath: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DefineDosDeviceW".}

-proc QueryDosDeviceW*(lpDeviceName: LPCWSTR, lpTargetPath: LPWSTR,

-                      ucchMax: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "QueryDosDeviceW".}

-proc CreateFileW*(lpFileName: LPCWSTR, dwDesiredAccess: DWORD,

-                  dwShareMode: DWORD,

-                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                  dwCreationDisposition: DWORD, dwFlagsAndAttributes: DWORD,

-                  hTemplateFile: HANDLE): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "CreateFileW".}

-proc SetFileAttributesW*(lpFileName: LPCWSTR, dwFileAttributes: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetFileAttributesW".}

-proc GetFileAttributesW*(lpFileName: LPCWSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetFileAttributesW".}

-proc GetCompressedFileSizeW*(lpFileName: LPCWSTR, lpFileSizeHigh: LPDWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetCompressedFileSizeW".}

-proc DeleteFileW*(lpFileName: LPCWSTR): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "DeleteFileW".}

-proc SearchPathW*(lpPath: LPCWSTR, lpFileName: LPCWSTR, lpExtension: LPCWSTR,

-                  nBufferLength: DWORD, lpBuffer: LPWSTR, lpFilePart: LPWSTR): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "SearchPathW".}

-proc CopyFileW*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR,

-                bFailIfExists: WINBOOL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CopyFileW".}

-proc MoveFileW*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "MoveFileW".}

-proc MoveFileExW*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR,

-                  dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "MoveFileExW".}

-proc CreateNamedPipeW*(lpName: LPCWSTR, dwOpenMode: DWORD, dwPipeMode: DWORD,

-                       nMaxInstances: DWORD, nOutBufferSize: DWORD,

-                       nInBufferSize: DWORD, nDefaultTimeOut: DWORD,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateNamedPipeW".}

-proc GetNamedPipeHandleStateW*(hNamedPipe: HANDLE, lpState: LPDWORD,

-                               lpCurInstances: LPDWORD,

-                               lpMaxCollectionCount: LPDWORD,

-                               lpCollectDataTimeout: LPDWORD,

-                               lpUserName: LPWSTR, nMaxUserNameSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetNamedPipeHandleStateW".}

-proc CallNamedPipeW*(lpNamedPipeName: LPCWSTR, lpInBuffer: LPVOID,

-                     nInBufferSize: DWORD, lpOutBuffer: LPVOID,

-                     nOutBufferSize: DWORD, lpBytesRead: LPDWORD,

-                     nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CallNamedPipeW".}

-proc WaitNamedPipeW*(lpNamedPipeName: LPCWSTR, nTimeOut: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WaitNamedPipeW".}

-proc SetVolumeLabelW*(lpRootPathName: LPCWSTR, lpVolumeName: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetVolumeLabelW".}

-proc GetVolumeInformationW*(lpRootPathName: LPCWSTR, lpVolumeNameBuffer: LPWSTR,

-                            nVolumeNameSize: DWORD,

-                            lpVolumeSerialNumber: LPDWORD,

-                            lpMaximumComponentLength: LPDWORD,

-                            lpFileSystemFlags: LPDWORD,

-                            lpFileSystemNameBuffer: LPWSTR,

-                            nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVolumeInformationW".}

-proc ClearEventLogW*(hEventLog: HANDLE, lpBackupFileName: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ClearEventLogW".}

-proc BackupEventLogW*(hEventLog: HANDLE, lpBackupFileName: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "BackupEventLogW".}

-proc OpenEventLogW*(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "OpenEventLogW".}

-proc RegisterEventSourceW*(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "RegisterEventSourceW".}

-proc OpenBackupEventLogW*(lpUNCServerName: LPCWSTR, lpFileName: LPCWSTR): HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "OpenBackupEventLogW".}

-proc ReadEventLogW*(hEventLog: HANDLE, dwReadFlags: DWORD,

-                    dwRecordOffset: DWORD, lpBuffer: LPVOID,

-                    nNumberOfBytesToRead: DWORD, pnBytesRead: LPDWORD,

-                    pnMinNumberOfBytesNeeded: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ReadEventLogW".}

-proc ReportEventW*(hEventLog: HANDLE, wType: int16, wCategory: int16,

-                   dwEventID: DWORD, lpUserSid: PSID, wNumStrings: int16,

-                   dwDataSize: DWORD, lpStrings: LPPCWSTR, lpRawData: LPVOID): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ReportEventW".}

-proc AccessCheckAndAuditAlarmW*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                                ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

-                                SecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                DesiredAccess: DWORD,

-                                GenericMapping: PGENERIC_MAPPING,

-                                ObjectCreation: WINBOOL, GrantedAccess: LPDWORD,

-                                AccessStatus: LPBOOL, pfGenerateOnClose: LPBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AccessCheckAndAuditAlarmW".}

-proc ObjectOpenAuditAlarmW*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                            ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

-                            pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                            ClientToken: HANDLE, DesiredAccess: DWORD,

-                            GrantedAccess: DWORD, Privileges: PPRIVILEGE_SET,

-                            ObjectCreation: WINBOOL, AccessGranted: WINBOOL,

-                            GenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmW".}

-proc ObjectPrivilegeAuditAlarmW*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                                 ClientToken: HANDLE, DesiredAccess: DWORD,

-                                 Privileges: PPRIVILEGE_SET,

-                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmW".}

-proc ObjectCloseAuditAlarmW*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                             GenerateOnClose: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectCloseAuditAlarmW".}

-proc PrivilegedServiceAuditAlarmW*(SubsystemName: LPCWSTR, ServiceName: LPCWSTR,

-                                   ClientToken: HANDLE,

-                                   Privileges: PPRIVILEGE_SET,

-                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmW".}

-proc SetFileSecurityW*(lpFileName: LPCWSTR,

-                       SecurityInformation: SECURITY_INFORMATION,

-                       pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetFileSecurityW".}

-proc GetFileSecurityW*(lpFileName: LPCWSTR,

-                       RequestedInformation: SECURITY_INFORMATION,

-                       pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                       nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetFileSecurityW".}

-proc FindFirstChangeNotificationW*(lpPathName: LPCWSTR, bWatchSubtree: WINBOOL,

-                                   dwNotifyFilter: DWORD): HANDLE{.stdcall,

-    dynlib: "kernel32", importc: "FindFirstChangeNotificationW".}

-proc IsBadStringPtrW*(lpsz: LPCWSTR, ucchMax: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadStringPtrW".}

-proc LookupAccountSidW*(lpSystemName: LPCWSTR, Sid: PSID, Name: LPWSTR,

-                        cbName: LPDWORD, ReferencedDomainName: LPWSTR,

-                        cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupAccountSidW".}

-proc LookupAccountNameW*(lpSystemName: LPCWSTR, lpAccountName: LPCWSTR,

-                         Sid: PSID, cbSid: LPDWORD,

-                         ReferencedDomainName: LPWSTR,

-                         cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupAccountNameW".}

-proc LookupPrivilegeValueW*(lpSystemName: LPCWSTR, lpName: LPCWSTR,

-                            lpLuid: PLUID): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeValueW".}

-proc LookupPrivilegeNameW*(lpSystemName: LPCWSTR, lpLuid: PLUID, lpName: LPWSTR,

-                           cbName: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeNameW".}

-proc LookupPrivilegeDisplayNameW*(lpSystemName: LPCWSTR, lpName: LPCWSTR,

-                                  lpDisplayName: LPWSTR, cbDisplayName: LPDWORD,

-                                  lpLanguageId: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameW".}

-proc BuildCommDCBW*(lpDef: LPCWSTR, lpDCB: LPDCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "BuildCommDCBW".}

-proc BuildCommDCBAndTimeoutsW*(lpDef: LPCWSTR, lpDCB: LPDCB,

-                               lpCommTimeouts: LPCOMMTIMEOUTS): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsW".}

-proc CommConfigDialogW*(lpszName: LPCWSTR, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".}

-proc GetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG,

-                            lpdwSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDefaultCommConfigW".}

-proc SetDefaultCommConfigW*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigW".}

-proc GetComputerNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetComputerNameW".}

-proc SetComputerNameW*(lpComputerName: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetComputerNameW".}

-proc GetUserNameW*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetUserNameW".}

-proc LoadKeyboardLayoutW*(pwszKLID: LPCWSTR, Flags: WINUINT): HKL{.stdcall,

-    dynlib: "user32", importc: "LoadKeyboardLayoutW".}

-proc GetKeyboardLayoutNameW*(pwszKLID: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetKeyboardLayoutNameW".}

-proc CreateDesktopW*(lpszDesktop: LPWSTR, lpszDevice: LPWSTR,

-                     pDevmodew: LPDEVMODEw, dwFlags: DWORD,

-                     dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HDESK{.

-    stdcall, dynlib: "user32", importc: "CreateDesktopW".}

-proc OpenDesktopW*(lpszDesktop: LPWSTR, dwFlags: DWORD, fInherit: WINBOOL,

-                   dwDesiredAccess: DWORD): HDESK{.stdcall, dynlib: "user32",

-    importc: "OpenDesktopW".}

-proc EnumDesktopsW*(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROC,

-                    lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "EnumDesktopsW".}

-proc CreateWindowStationW*(lpwinsta: LPWSTR, dwReserved: DWORD,

-                           dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{.

-    stdcall, dynlib: "user32", importc: "CreateWindowStationW".}

-proc OpenWindowStationW*(lpszWinSta: LPWSTR, fInherit: WINBOOL,

-                         dwDesiredAccess: DWORD): HWINSTA{.stdcall,

-    dynlib: "user32", importc: "OpenWindowStationW".}

-proc EnumWindowStationsW*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumWindowStationsW".}

-proc GetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".}

-proc SetUserObjectInformationW*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                nLength: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetUserObjectInformationW".}

-proc RegisterWindowMessageW*(lpString: LPCWSTR): WINUINT{.stdcall,

-    dynlib: "user32", importc: "RegisterWindowMessageW".}

-proc GetMessageW*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                  wMsgFilterMax: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetMessageW".}

-proc DispatchMessageW*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",

-    importc: "DispatchMessageW".}

-proc PeekMessageW*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                   wMsgFilterMax: WINUINT, wRemoveMsg: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "PeekMessageW".}

-proc SendMessageW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageW".}

-proc SendMessageTimeoutW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

-                          fuFlags: WINUINT, uTimeout: WINUINT, lpdwResult: LPDWORD): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".}

-proc SendNotifyMessageW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SendNotifyMessageW".}

-proc SendMessageCallbackW*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                           lp: LPARAM, lpResultCallBack: SENDASYNCPROC,

-                           dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SendMessageCallbackW".}

-proc PostMessageW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "PostMessageW".}

-proc PostThreadMessageW*(idThread: DWORD, Msg: WINUINT, wp: WPARAM,

-                         lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "PostThreadMessageW".}

-proc DefWindowProcW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefWindowProcW".}

-proc CallWindowProcW*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: WINUINT,

-                      wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-    dynlib: "user32", importc: "CallWindowProcW".}

-proc RegisterClassW*(lpWndClass: LPWNDCLASSW): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassW".}

-proc UnregisterClassW*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "UnregisterClassW".}

-proc GetClassInfoW*(hInstance: HINST, lpClassName: LPCWSTR,

-                    lpWndClass: LPWNDCLASS): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetClassInfoW".}

-proc RegisterClassExW*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassExW".}

-proc GetClassInfoExW*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetClassInfoExW".}

-proc CreateWindowExW*(dwExStyle: DWORD, lpClassName: LPCWSTR,

-                      lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32, Y: int32,

-                      nWidth: int32, nHeight: int32, hWndParent: HWND,

-                      menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{.

-    stdcall, dynlib: "user32", importc: "CreateWindowExW".}

-proc CreateDialogParamW*(hInstance: HINST, lpTemplateName: LPCWSTR,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC,

-                         dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32",

-    importc: "CreateDialogParamW".}

-proc CreateDialogIndirectParamW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                                 hWndParent: HWND, lpDialogFunc: DLGPROC,

-                                 dwInitParam: LPARAM): HWND{.stdcall,

-    dynlib: "user32", importc: "CreateDialogIndirectParamW".}

-proc DialogBoxParamW*(hInstance: HINST, lpTemplateName: LPCWSTR,

-                      hWndParent: HWND, lpDialogFunc: DLGPROC,

-                      dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32",

-    importc: "DialogBoxParamW".}

-proc DialogBoxIndirectParamW*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                              hWndParent: HWND, lpDialogFunc: DLGPROC,

-                              dwInitParam: LPARAM): int32{.stdcall,

-    dynlib: "user32", importc: "DialogBoxIndirectParamW".}

-proc SetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetDlgItemTextW".}

-proc GetDlgItemTextW*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR,

-                      nMaxCount: int32): WINUINT{.stdcall, dynlib: "user32",

-    importc: "GetDlgItemTextW".}

-proc SendDlgItemMessageW*(hDlg: HWND, nIDDlgItem: int32, Msg: WINUINT,

-                          wp: WPARAM, lp: LPARAM): LONG{.stdcall,

-    dynlib: "user32", importc: "SendDlgItemMessageW".}

-proc DefDlgProcW*(hDlg: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefDlgProcW".}

-proc CallMsgFilterW*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CallMsgFilterW".}

-proc RegisterClipboardFormatW*(lpszFormat: LPCWSTR): WINUINT{.stdcall,

-    dynlib: "user32", importc: "RegisterClipboardFormatW".}

-proc GetClipboardFormatNameW*(format: WINUINT, lpszFormatName: LPWSTR,

-                              cchMaxCount: int32): int32{.stdcall,

-    dynlib: "user32", importc: "GetClipboardFormatNameW".}

-proc CharToOemW*(lpszSrc: LPCWSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CharToOemW".}

-proc OemToCharW*(lpszSrc: LPCSTR, lpszDst: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "OemToCharW".}

-proc CharToOemBuffW*(lpszSrc: LPCWSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "CharToOemBuffW".}

-proc OemToCharBuffW*(lpszSrc: LPCSTR, lpszDst: LPWSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "OemToCharBuffW".}

-proc CharUpperW*(lpsz: LPWSTR): LPWSTR{.stdcall, dynlib: "user32",

-                                        importc: "CharUpperW".}

-proc CharUpperBuffW*(lpsz: LPWSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharUpperBuffW".}

-proc CharLowerW*(lpsz: LPWSTR): LPWSTR{.stdcall, dynlib: "user32",

-                                        importc: "CharLowerW".}

-proc CharLowerBuffW*(lpsz: LPWSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharLowerBuffW".}

-proc CharNextW*(lpsz: LPCWSTR): LPWSTR{.stdcall, dynlib: "user32",

-                                        importc: "CharNextW".}

-proc CharPrevW*(lpszStart: LPCWSTR, lpszCurrent: LPCWSTR): LPWSTR{.stdcall,

-    dynlib: "user32", importc: "CharPrevW".}

-proc IsCharAlphaW*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharAlphaW".}

-proc IsCharAlphaNumericW*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsCharAlphaNumericW".}

-proc IsCharUpperW*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharUpperW".}

-proc IsCharLowerW*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharLowerW".}

-proc GetKeyNameTextW*(lParam: LONG, lpString: LPWSTR, nSize: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetKeyNameTextW".}

-proc VkKeyScanW*(ch: WCHAR): SHORT{.stdcall, dynlib: "user32",

-                                    importc: "VkKeyScanW".}

-proc VkKeyScanExW*(ch: WCHAR, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

-    importc: "VkKeyScanExW".}

-proc MapVirtualKeyW*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

-    dynlib: "user32", importc: "MapVirtualKeyW".}

-proc MapVirtualKeyExW*(uCode: WINUINT, uMapType: WINUINT, dwhkl: HKL): WINUINT{.stdcall,

-    dynlib: "user32", importc: "MapVirtualKeyExW".}

-proc LoadAcceleratorsW*(hInstance: HINST, lpTableName: LPCWSTR): HACCEL{.

-    stdcall, dynlib: "user32", importc: "LoadAcceleratorsW".}

-proc CreateAcceleratorTableW*(para1: LPACCEL, para2: int32): HACCEL{.stdcall,

-    dynlib: "user32", importc: "CreateAcceleratorTableW".}

-proc CopyAcceleratorTableW*(hAccelSrc: HACCEL, lpAccelDst: LPACCEL,

-                            cAccelEntries: int32): int32{.stdcall,

-    dynlib: "user32", importc: "CopyAcceleratorTableW".}

-proc TranslateAcceleratorW*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{.

-    stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".}

-proc LoadMenuW*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall,

-    dynlib: "user32", importc: "LoadMenuW".}

-proc LoadMenuIndirectW*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall,

-    dynlib: "user32", importc: "LoadMenuIndirectW".}

-proc ChangeMenuW*(menu: HMENU, cmd: WINUINT, lpszNewItem: LPCWSTR,

-                  cmdInsert: WINUINT, flags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ChangeMenuW".}

-proc GetMenuStringW*(menu: HMENU, uIDItem: WINUINT, lpString: LPWSTR,

-                     nMaxCount: int32, uFlag: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "GetMenuStringW".}

-proc InsertMenuW*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "InsertMenuW".}

-proc AppendMenuW*(menu: HMENU, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "AppendMenuW".}

-proc ModifyMenuW*(hMnu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ModifyMenuW".}

-proc InsertMenuItemW*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                      para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "InsertMenuItemW".}

-proc GetMenuItemInfoW*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetMenuItemInfoW".}

-proc SetMenuItemInfoW*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetMenuItemInfoW".}

-proc DrawTextW*(hDC: HDC, lpString: LPCWSTR, nCount: int32, lpRect: LPRECT,

-                uFormat: WINUINT): int32{.stdcall, dynlib: "user32",

-                                       importc: "DrawTextW".}

-proc DrawTextExW*(para1: HDC, para2: LPWSTR, para3: int32, para4: LPRECT,

-                  para5: WINUINT, para6: LPDRAWTEXTPARAMS): int32{.stdcall,

-    dynlib: "user32", importc: "DrawTextExW".}

-proc GrayStringW*(hDC: HDC, hBrush: HBRUSH, lpOutputFunc: GRAYSTRINGPROC,

-                  lpData: LPARAM, nCount: int32, X: int32, Y: int32,

-                  nWidth: int32, nHeight: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GrayStringW".}

-proc DrawStateW*(para1: HDC, para2: HBRUSH, para3: DRAWSTATEPROC, para4: LPARAM,

-                 para5: WPARAM, para6: int32, para7: int32, para8: int32,

-                 para9: int32, para10: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DrawStateW".}

-proc TabbedTextOutW*(hDC: HDC, X: int32, Y: int32, lpString: LPCWSTR,

-                     nCount: int32, nTabPositions: int32,

-                     lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{.

-    stdcall, dynlib: "user32", importc: "TabbedTextOutW".}

-proc GetTabbedTextExtentW*(hDC: HDC, lpString: LPCWSTR, nCount: int32,

-                           nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{.

-    stdcall, dynlib: "user32", importc: "GetTabbedTextExtentW".}

-proc SetPropW*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetPropW".}

-proc GetPropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,

-    dynlib: "user32", importc: "GetPropW".}

-proc RemovePropW*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,

-    dynlib: "user32", importc: "RemovePropW".}

-proc EnumPropsExW*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{.

-    stdcall, dynlib: "user32", importc: "EnumPropsExW".}

-proc EnumPropsW*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,

-    dynlib: "user32", importc: "EnumPropsW".}

-proc SetWindowTextW*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetWindowTextW".}

-proc GetWindowTextW*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetWindowTextW".}

-proc GetWindowTextLengthW*(wnd: HWND): int32{.stdcall, dynlib: "user32",

-    importc: "GetWindowTextLengthW".}

-proc MessageBoxW*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: WINUINT): int32{.

-    stdcall, dynlib: "user32", importc: "MessageBoxW".}

-proc MessageBoxExW*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR,

-                    uType: WINUINT, wLanguageId: int16): int32{.stdcall,

-    dynlib: "user32", importc: "MessageBoxExW".}

-proc MessageBoxIndirectW*(para1: LPMSGBOXPARAMS): int32{.stdcall,

-    dynlib: "user32", importc: "MessageBoxIndirectW".}

-proc GetWindowLongW*(wnd: HWND, nIndex: int32): LONG{.stdcall,

-    dynlib: "user32", importc: "GetWindowLongW".}

-proc SetWindowLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall,

-    dynlib: "user32", importc: "SetWindowLongW".}

-proc GetClassLongW*(wnd: HWND, nIndex: int32): DWORD{.stdcall,

-    dynlib: "user32", importc: "GetClassLongW".}

-proc SetClassLongW*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall,

-    dynlib: "user32", importc: "SetClassLongW".}

-when defined(cpu64):

-  proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongPtrW".}

-  proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".}

-  proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetClassLongPtrW".}

-  proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetClassLongPtrW".}

-else:

-  proc GetWindowLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongW".}

-  proc SetWindowLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongW".}

-  proc GetClassLongPtrW*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-      dynlib: "user32", importc: "GetClassLongW".}

-  proc SetClassLongPtrW*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-      stdcall, dynlib: "user32", importc: "SetClassLongW".}

-proc FindWindowW*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall,

-    dynlib: "user32", importc: "FindWindowW".}

-proc FindWindowExW*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{.

-    stdcall, dynlib: "user32", importc: "FindWindowExW".}

-proc GetClassNameW*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetClassNameW".}

-proc SetWindowsHookExW*(idHook: int32, lpfn: HOOKPROC, hmod: HINST,

-                        dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32",

-    importc: "SetWindowsHookExW".}

-proc LoadBitmapW*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall,

-    dynlib: "user32", importc: "LoadBitmapW".}

-proc LoadCursorW*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall,

-    dynlib: "user32", importc: "LoadCursorW".}

-proc LoadCursorFromFileW*(lpFileName: LPCWSTR): HCURSOR{.stdcall,

-    dynlib: "user32", importc: "LoadCursorFromFileW".}

-proc LoadIconW*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall,

-    dynlib: "user32", importc: "LoadIconW".}

-proc LoadImageW*(para1: HINST, para2: LPCWSTR, para3: WINUINT, para4: int32,

-                 para5: int32, para6: WINUINT): HANDLE{.stdcall, dynlib: "user32",

-    importc: "LoadImageW".}

-proc LoadStringW*(hInstance: HINST, uID: WINUINT, lpBuffer: LPWSTR,

-                  nBufferMax: int32): int32{.stdcall, dynlib: "user32",

-    importc: "LoadStringW".}

-proc IsDialogMessageW*(hDlg: HWND, lpMsg: LPMSG): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsDialogMessageW".}

-proc DlgDirListW*(hDlg: HWND, lpPathSpec: LPWSTR, nIDListBox: int32,

-                  nIDStaticPath: int32, uFileType: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "DlgDirListW".}

-proc DlgDirSelectExW*(hDlg: HWND, lpString: LPWSTR, nCount: int32,

-                      nIDListBox: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DlgDirSelectExW".}

-proc DlgDirListComboBoxW*(hDlg: HWND, lpPathSpec: LPWSTR, nIDComboBox: int32,

-                          nIDStaticPath: int32, uFiletype: WINUINT): int32{.

-    stdcall, dynlib: "user32", importc: "DlgDirListComboBoxW".}

-proc DlgDirSelectComboBoxExW*(hDlg: HWND, lpString: LPWSTR, nCount: int32,

-                              nIDComboBox: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DlgDirSelectComboBoxExW".}

-proc DefFrameProcW*(wnd: HWND, hWndMDIClient: HWND, uMsg: WINUINT, w: WPARAM,

-                    lp: LPARAM): LRESULT{.stdcall, dynlib: "user32",

-    importc: "DefFrameProcW".}

-proc DefMDIChildProcW*(wnd: HWND, uMsg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "DefMDIChildProcW".}

-proc CreateMDIWindowW*(lpClassName: LPWSTR, lpWindowName: LPWSTR,

-                       dwStyle: DWORD, X: int32, Y: int32, nWidth: int32,

-                       nHeight: int32, hWndParent: HWND, hInstance: HINST,

-                       lp: LPARAM): HWND{.stdcall, dynlib: "user32",

-    importc: "CreateMDIWindowW".}

-proc WinHelpW*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: WINUINT, dwData: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "WinHelpW".}

-proc ChangeDisplaySettingsW*(lpDevMode: LPDEVMODEW, dwFlags: DWORD): LONG{.

-    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsW".}

-proc EnumDisplaySettingsW*(lpszDeviceName: LPCWSTR, iModeNum: DWORD,

-                           lpDevMode: LPDEVMODEW): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnumDisplaySettingsW".}

-proc SystemParametersInfoW*(uiAction: WINUINT, uiParam: WINUINT, pvParam: PVOID,

-                            fWinIni: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SystemParametersInfoW".}

-proc AddFontResourceW*(para1: LPCWSTR): int32{.stdcall, dynlib: "gdi32",

-    importc: "AddFontResourceW".}

-proc CopyMetaFileW*(para1: HMETAFILE, para2: LPCWSTR): HMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "CopyMetaFileW".}

-proc CreateFontIndirectW*(para1: PLOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-    importc: "CreateFontIndirectW".}

-proc CreateFontIndirectW*(para1: var LOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-    importc: "CreateFontIndirectW".}

-proc CreateFontW*(para1: int32, para2: int32, para3: int32, para4: int32,

-                  para5: int32, para6: DWORD, para7: DWORD, para8: DWORD,

-                  para9: DWORD, para10: DWORD, para11: DWORD, para12: DWORD,

-                  para13: DWORD, para14: LPCWSTR): HFONT{.stdcall,

-    dynlib: "gdi32", importc: "CreateFontW".}

-proc CreateICW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR,

-                para4: LPDEVMODEw): HDC{.stdcall, dynlib: "gdi32",

-    importc: "CreateICW".}

-proc CreateMetaFileW*(para1: LPCWSTR): HDC{.stdcall, dynlib: "gdi32",

-    importc: "CreateMetaFileW".}

-proc CreateScalableFontResourceW*(para1: DWORD, para2: LPCWSTR, para3: LPCWSTR,

-                                  para4: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "CreateScalableFontResourceW".}

-proc EnumFontFamiliesExW*(para1: HDC, para2: LPLOGFONT, para3: FONTENUMEXPROC,

-                          para4: LPARAM, para5: DWORD): int32{.stdcall,

-    dynlib: "gdi32", importc: "EnumFontFamiliesExW".}

-proc EnumFontFamiliesW*(para1: HDC, para2: LPCWSTR, para3: FONTENUMPROC,

-                        para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-    importc: "EnumFontFamiliesW".}

-proc EnumFontsW*(para1: HDC, para2: LPCWSTR, para3: ENUMFONTSPROC, para4: LPARAM): int32{.

-    stdcall, dynlib: "gdi32", importc: "EnumFontsW".}

-proc EnumFontsW*(para1: HDC, para2: LPCWSTR, para3: ENUMFONTSPROC,

-                 para4: pointer): int32{.stdcall, dynlib: "gdi32",

-    importc: "EnumFontsW".}

-proc GetCharWidthW*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthW".}

-proc GetCharWidth32W*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidth32W".}

-proc GetCharWidthFloatW*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: ptr float32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}

-proc GetCharABCWidthsW*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPABC): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}

-proc GetCharABCWidthsFloatW*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                             para4: LPABCFLOAT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}

-proc GetGlyphOutlineW*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                       para4: LPGLYPHMETRICS, para5: DWORD, para6: LPVOID,

-                       para7: PMAT2): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetGlyphOutlineW".}

-proc GetMetaFileW*(para1: LPCWSTR): HMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "GetMetaFileW".}

-proc GetOutlineTextMetricsW*(para1: HDC, para2: WINUINT, para3: LPOUTLINETEXTMETRIC): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetOutlineTextMetricsW".}

-proc GetTextExtentPointW*(para1: HDC, para2: LPCWSTR, para3: int32,

-                          para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentPointW".}

-proc GetTextExtentPoint32W*(para1: HDC, para2: LPCWSTR, para3: int32,

-                            para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentPoint32W".}

-proc GetTextExtentExPointW*(para1: HDC, para2: LPCWSTR, para3: int32,

-                            para4: int32, para5: LPINT, para6: LPINT,

-                            para7: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentExPointW".}

-proc GetCharacterPlacementW*(para1: HDC, para2: LPCWSTR, para3: int32,

-                             para4: int32, para5: LPGCP_RESULTS, para6: DWORD): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetCharacterPlacementW".}

-proc ResetDCW*(para1: HDC, para2: LPDEVMODEW): HDC{.stdcall, dynlib: "gdi32",

-    importc: "ResetDCW".}

-proc RemoveFontResourceW*(para1: LPCWSTR): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "RemoveFontResourceW".}

-proc CopyEnhMetaFileW*(para1: HENHMETAFILE, para2: LPCWSTR): HENHMETAFILE{.

-    stdcall, dynlib: "gdi32", importc: "CopyEnhMetaFileW".}

-proc CreateEnhMetaFileW*(para1: HDC, para2: LPCWSTR, para3: LPRECT,

-                         para4: LPCWSTR): HDC{.stdcall, dynlib: "gdi32",

-    importc: "CreateEnhMetaFileW".}

-proc GetEnhMetaFileW*(para1: LPCWSTR): HENHMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "GetEnhMetaFileW".}

-proc GetEnhMetaFileDescriptionW*(para1: HENHMETAFILE, para2: WINUINT, para3: LPWSTR): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileDescriptionW".}

-proc GetTextMetricsW*(para1: HDC, para2: LPTEXTMETRIC): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetTextMetricsW".}

-proc StartDocW*(para1: HDC, para2: PDOCINFO): int32{.stdcall, dynlib: "gdi32",

-    importc: "StartDocW".}

-proc GetObjectW*(para1: HGDIOBJ, para2: int32, para3: LPVOID): int32{.stdcall,

-    dynlib: "gdi32", importc: "GetObjectW".}

-proc TextOutW*(para1: HDC, para2: int32, para3: int32, para4: LPCWSTR,

-               para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                       importc: "TextOutW".}

-proc ExtTextOutW*(para1: HDC, para2: int32, para3: int32, para4: WINUINT,

-                  para5: LPRECT, para6: LPCWSTR, para7: WINUINT, para8: LPINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "ExtTextOutW".}

-proc PolyTextOutW*(para1: HDC, para2: PPOLYTEXT, para3: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyTextOutW".}

-proc GetTextFaceW*(para1: HDC, para2: int32, para3: LPWSTR): int32{.stdcall,

-    dynlib: "gdi32", importc: "GetTextFaceW".}

-proc GetKerningPairsW*(para1: HDC, para2: DWORD, para3: LPKERNINGPAIR): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetKerningPairsW".}

-proc GetLogColorSpaceW*(para1: HCOLORSPACE, para2: LPLOGCOLORSPACE, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetLogColorSpaceW".}

-proc CreateColorSpaceW*(para1: LPLOGCOLORSPACE): HCOLORSPACE{.stdcall,

-    dynlib: "gdi32", importc: "CreateColorSpaceW".}

-proc GetICMProfileW*(para1: HDC, para2: DWORD, para3: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetICMProfileW".}

-proc SetICMProfileW*(para1: HDC, para2: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SetICMProfileW".}

-proc UpdateICMRegKeyW*(para1: DWORD, para2: DWORD, para3: LPWSTR, para4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "UpdateICMRegKeyW".}

-proc EnumICMProfilesW*(para1: HDC, para2: ICMENUMPROC, para3: LPARAM): int32{.

-    stdcall, dynlib: "gdi32", importc: "EnumICMProfilesW".}

-proc CreatePropertySheetPageW*(lppsp: LPCPROPSHEETPAGE): HPROPSHEETPAGE{.

-    stdcall, dynlib: "comctl32", importc: "CreatePropertySheetPageW".}

-proc PropertySheetW*(lppsph: LPCPROPSHEETHEADER): int32{.stdcall,

-    dynlib: "comctl32", importc: "PropertySheetW".}

-proc ImageList_LoadImageW*(hi: HINST, lpbmp: LPCWSTR, cx: int32, cGrow: int32,

-                           crMask: COLORREF, uType: WINUINT, uFlags: WINUINT): HIMAGELIST{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageW".}

-proc CreateStatusWindowW*(style: LONG, lpszText: LPCWSTR, hwndParent: HWND,

-                          wID: WINUINT): HWND{.stdcall, dynlib: "comctl32",

-    importc: "CreateStatusWindowW".}

-proc DrawStatusTextW*(hDC: HDC, lprc: LPRECT, pszText: LPCWSTR, uFlags: WINUINT){.

-    stdcall, dynlib: "comctl32", importc: "DrawStatusTextW".}

-proc GetOpenFileNameW*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "GetOpenFileNameW".}

-proc GetSaveFileNameW*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "GetSaveFileNameW".}

-proc GetFileTitleW*(para1: LPCWSTR, para2: LPWSTR, para3: int16): int{.stdcall,

-    dynlib: "comdlg32", importc: "GetFileTitleW".}

-proc ChooseColorW*(para1: LPCHOOSECOLOR): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "ChooseColorW".}

-proc ReplaceTextW*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-    importc: "ReplaceTextW".}

-proc ChooseFontW*(para1: LPCHOOSEFONT): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "ChooseFontW".}

-proc FindTextW*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-    importc: "FindTextW".}

-proc PrintDlgW*(para1: LPPRINTDLG): WINBOOL{.stdcall, dynlib: "comdlg32",

-    importc: "PrintDlgW".}

-proc PageSetupDlgW*(para1: LPPAGESETUPDLG): WINBOOL{.stdcall,

-    dynlib: "comdlg32", importc: "PageSetupDlgW".}

-proc CreateProcessW*(lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR,

-                     lpProcessAttributes: LPSECURITY_ATTRIBUTES,

-                     lpThreadAttributes: LPSECURITY_ATTRIBUTES,

-                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR,

-                     lpStartupInfo: LPSTARTUPINFO,

-                     lpProcessInformation: LPPROCESS_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateProcessW".}

-proc GetStartupInfoW*(lpStartupInfo: LPSTARTUPINFO){.stdcall,

-    dynlib: "kernel32", importc: "GetStartupInfoW".}

-proc FindFirstFileW*(lpFileName: LPCWSTR, lpFindFileData: LPWIN32_FIND_DATAW): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "FindFirstFileW".}

-proc FindNextFileW*(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATAW): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FindNextFileW".}

-proc GetVersionExW*(VersionInformation: LPOSVERSIONINFOW): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVersionExW".}

-proc CreateWindowW*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD,

-                    X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                    lpParam: LPVOID): HWND

-proc CreateDialogW*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

-                    lpDialogFunc: DLGPROC): HWND

-proc CreateDialogIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                            hWndParent: HWND, lpDialogFunc: DLGPROC): HWND

-proc DialogBoxW*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND,

-                 lpDialogFunc: DLGPROC): int32

-proc DialogBoxIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-proc CreateDCW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: PDEVMODEW): HDC{.

-    stdcall, dynlib: "gdi32", importc: "CreateDCW".}

-proc VerInstallFileW*(uFlags: DWORD, szSrcFileName: LPWSTR,

-                      szDestFileName: LPWSTR, szSrcDir: LPWSTR,

-                      szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR,

-                      lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version",

-    importc: "VerInstallFileW".}

-proc GetFileVersionInfoSizeW*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{.

-    stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".}

-proc GetFileVersionInfoW*(lptstrFilename: LPWSTR, dwHandle: DWORD, dwLen: DWORD,

-                          lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version",

-    importc: "GetFileVersionInfoW".}

-proc VerLanguageNameW*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".}

-proc VerQueryValueW*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID,

-                     puLen: PUINT): WINBOOL{.stdcall, dynlib: "version",

-    importc: "VerQueryValueW".}

-proc VerFindFileW*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR,

-                   szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT,

-                   szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall,

-    dynlib: "version", importc: "VerFindFileW".}

-proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,

-                     dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}

-proc RegUnLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegUnLoadKeyW".}

-proc InitiateSystemShutdownW*(lpMachineName: LPWSTR, lpMessage: LPWSTR,

-                              dwTimeout: DWORD, bForceAppsClosed: WINBOOL,

-                              bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "InitiateSystemShutdownW".}

-proc AbortSystemShutdownW*(lpMachineName: LPWSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AbortSystemShutdownW".}

-proc RegRestoreKeyW*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".}

-proc RegSaveKeyW*(key: HKEY, lpFile: LPCWSTR,

-                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegSaveKeyW".}

-proc RegSetValueW*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD,

-                   lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegSetValueW".}

-proc RegQueryValueW*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR,

-                     lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",

-    importc: "RegQueryValueW".}

-proc RegQueryMultipleValuesW*(key: HKEY, val_list: PVALENT, num_vals: DWORD,

-                              lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}

-proc RegQueryValueExW*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD,

-                       lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".}

-proc RegReplaceKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR,

-                     lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32",

-    importc: "RegReplaceKeyW".}

-proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}

-proc RegCreateKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}

-proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD,

-                      lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM,

-                      lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                      phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".}

-proc RegDeleteKeyW*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegDeleteKeyW".}

-proc RegDeleteValueW*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegDeleteValueW".}

-proc RegEnumKeyW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".}

-proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR,

-                    lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR,

-                    lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}

-proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR,

-                    lpcbValueName: LPDWORD, lpReserved: LPDWORD,

-                    lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}

-proc RegLoadKeyW*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".}

-proc RegOpenKeyW*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}

-proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD,

-                    samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegOpenKeyExW".}

-proc RegQueryInfoKeyW*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD,

-                       lpReserved: LPDWORD, lpcSubKeys: LPDWORD,

-                       lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD,

-                       lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD,

-                       lpcbMaxValueLen: LPDWORD,

-                       lpcbSecurityDescriptor: LPDWORD,

-                       lpftLastWriteTime: PFILETIME): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegQueryInfoKeyW".}

-proc CompareStringW*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR,

-                     cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "CompareStringW".}

-proc LCMapStringW*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR,

-                   cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "LCMapStringW".}

-proc GetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR,

-                     cchData: int32): int32{.stdcall, dynlib: "kernel32",

-    importc: "GetLocaleInfoW".}

-proc SetLocaleInfoW*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".}

-proc GetTimeFormatW*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME,

-                     lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".}

-proc GetDateFormatW*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME,

-                     lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "GetDateFormatW".}

-proc GetNumberFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR,

-                       lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR,

-                       cchNumber: int32): int32{.stdcall, dynlib: "kernel32",

-    importc: "GetNumberFormatW".}

-proc GetCurrencyFormatW*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR,

-                         lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR,

-                         cchCurrency: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "GetCurrencyFormatW".}

-proc EnumCalendarInfoW*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID,

-                        Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "EnumCalendarInfoW".}

-proc EnumTimeFormatsW*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID,

-                       dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "EnumTimeFormatsW".}

-proc EnumDateFormatsW*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID,

-                       dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "EnumDateFormatsW".}

-proc GetStringTypeExW*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR,

-                       cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeExW".}

-proc GetStringTypeW*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32,

-                     lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GetStringTypeW".}

-proc FoldStringW*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32,

-                  lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "FoldStringW".}

-proc EnumSystemLocalesW*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".}

-proc EnumSystemCodePagesW*(lpCodePageEnumProc: CODEPAGE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "EnumSystemCodePagesW".}

-proc PeekConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                        nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".}

-proc ReadConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                        nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}

-proc WriteConsoleInputW*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".}

-proc ReadConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                         dwBufferSize: COORD, dwBufferCoord: COORD,

-                         lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadConsoleOutputW".}

-proc WriteConsoleOutputW*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                          dwBufferSize: COORD, dwBufferCoord: COORD,

-                          lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteConsoleOutputW".}

-proc ReadConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR,

-                                  nLength: DWORD, dwReadCoord: COORD,

-                                  lpNumberOfCharsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".}

-proc WriteConsoleOutputCharacterW*(hConsoleOutput: HANDLE, lpCharacter: LPCWSTR,

-                                   nLength: DWORD, dwWriteCoord: COORD,

-                                   lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".}

-proc FillConsoleOutputCharacterW*(hConsoleOutput: HANDLE, cCharacter: WCHAR,

-                                  nLength: DWORD, dwWriteCoord: COORD,

-                                  lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".}

-proc ScrollConsoleScreenBufferW*(hConsoleOutput: HANDLE,

-                                 lpScrollRectangle: PSMALL_RECT,

-                                 lpClipRectangle: PSMALL_RECT,

-                                 dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".}

-proc GetConsoleTitleW*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetConsoleTitleW".}

-proc SetConsoleTitleW*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleTitleW".}

-proc ReadConsoleW*(hConsoleInput: HANDLE, lpBuffer: LPVOID,

-                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD,

-                   lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReadConsoleW".}

-proc WriteConsoleW*(hConsoleOutput: HANDLE, lpBuffer: pointer,

-                    nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleW".}

-proc WNetAddConnectionW*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR,

-                         lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetAddConnectionW".}

-proc WNetAddConnection2W*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR,

-                          lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetAddConnection2W".}

-proc WNetAddConnection3W*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                          lpPassword: LPCWSTR, lpUserName: LPCWSTR,

-                          dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetAddConnection3W".}

-proc WNetCancelConnectionW*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetCancelConnectionW".}

-proc WNetCancelConnection2W*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".}

-proc WNetGetConnectionW*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR,

-                         lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetConnectionW".}

-proc WNetUseConnectionW*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                         lpUserID: LPCWSTR, lpPassword: LPCWSTR, dwFlags: DWORD,

-                         lpAccessName: LPWSTR, lpBufferSize: LPDWORD,

-                         lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetUseConnectionW".}

-proc WNetSetConnectionW*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".}

-proc WNetConnectionDialog1W*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".}

-proc WNetDisconnectDialog1W*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetDisconnectDialog1W".}

-proc WNetOpenEnumW*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD,

-                    lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".}

-proc WNetEnumResourceW*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID,

-                        lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetEnumResourceW".}

-proc WNetGetUniversalNameW*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD,

-                            lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".}

-proc WNetGetUserW*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUserW".}

-proc WNetGetProviderNameW*(dwNetType: DWORD, lpProviderName: LPWSTR,

-                           lpBufferSize: LPDWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetProviderNameW".}

-proc WNetGetNetworkInformationW*(lpProvider: LPCWSTR,

-                                 lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".}

-proc WNetGetLastErrorW*(lpError: LPDWORD, lpErrorBuf: LPWSTR,

-                        nErrorBufSize: DWORD, lpNameBuf: LPWSTR,

-                        nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetLastErrorW".}

-proc MultinetGetConnectionPerformanceW*(lpNetResource: LPNETRESOURCE,

-    lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall,

-    dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".}

-proc ChangeServiceConfigW*(hService: SC_HANDLE, dwServiceType: DWORD,

-                           dwStartType: DWORD, dwErrorControl: DWORD,

-                           lpBinaryPathName: LPCWSTR, lpLoadOrderGroup: LPCWSTR,

-                           lpdwTagId: LPDWORD, lpDependencies: LPCWSTR,

-                           lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR,

-                           lpDisplayName: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ChangeServiceConfigW".}

-proc CreateServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                     lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD,

-                     dwServiceType: DWORD, dwStartType: DWORD,

-                     dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR,

-                     lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD,

-                     lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR,

-                     lpPassword: LPCWSTR): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "CreateServiceW".}

-proc EnumDependentServicesW*(hService: SC_HANDLE, dwServiceState: DWORD,

-                             lpServices: LPENUM_SERVICE_STATUS,

-                             cbBufSize: DWORD, pcbBytesNeeded: LPDWORD,

-                             lpServicesReturned: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "EnumDependentServicesW".}

-proc EnumServicesStatusW*(hSCManager: SC_HANDLE, dwServiceType: DWORD,

-                          dwServiceState: DWORD,

-                          lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD,

-                          pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD,

-                          lpResumeHandle: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "EnumServicesStatusW".}

-proc GetServiceKeyNameW*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR,

-                         lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".}

-proc GetServiceDisplayNameW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                             lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".}

-proc OpenSCManagerW*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR,

-                     dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "OpenSCManagerW".}

-proc OpenServiceW*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                   dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-    dynlib: "advapi32", importc: "OpenServiceW".}

-proc QueryServiceConfigW*(hService: SC_HANDLE,

-                          lpServiceConfig: LPQUERY_SERVICE_CONFIG,

-                          cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".}

-proc QueryServiceLockStatusW*(hSCManager: SC_HANDLE,

-                              lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS,

-                              cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".}

-proc RegisterServiceCtrlHandlerW*(lpServiceName: LPCWSTR,

-                                  lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{.

-    stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".}

-proc StartServiceCtrlDispatcherW*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".}

-proc StartServiceW*(hService: SC_HANDLE, dwNumServiceArgs: DWORD,

-                    lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "StartServiceW".}

-proc DragQueryFileW*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{.

-    stdcall, dynlib: "shell32", importc: "DragQueryFileW".}

-proc ExtractAssociatedIconW*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{.

-    stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".}

-proc ExtractIconW*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall,

-    dynlib: "shell32", importc: "ExtractIconW".}

-proc FindExecutableW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{.

-    stdcall, dynlib: "shell32", importc: "FindExecutableW".}

-proc ShellAboutW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{.

-    stdcall, dynlib: "shell32", importc: "ShellAboutW".}

-proc ShellExecuteW*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: LPCWSTR,

-                    para5: LPCWSTR, para6: int32): HINST{.stdcall,

-    dynlib: "shell32", importc: "ShellExecuteW".}

-proc Shell_NotifyIconW*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{.

-    stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".}

-proc DdeCreateStringHandleW*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{.

-    stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".}

-proc DdeInitializeW*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD,

-                     para4: DWORD): WINUINT{.stdcall, dynlib: "user32",

-    importc: "DdeInitializeW".}

-proc DdeQueryStringW*(para1: DWORD, para2: HSZ, para3: LPCWSTR, para4: DWORD,

-                      para5: int32): DWORD{.stdcall, dynlib: "user32",

-    importc: "DdeQueryStringW".}

-proc LogonUserW*(para1: LPWSTR, para2: LPWSTR, para3: LPWSTR, para4: DWORD,

-                 para5: DWORD, para6: PHANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LogonUserW".}

-proc CreateProcessAsUserW*(para1: HANDLE, para2: LPCWSTR, para3: LPWSTR,

-                           para4: LPSECURITY_ATTRIBUTES,

-                           para5: LPSECURITY_ATTRIBUTES, para6: WINBOOL,

-                           para7: DWORD, para8: LPVOID, para9: LPCWSTR,

-                           para10: LPSTARTUPINFO, para11: LPPROCESS_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "CreateProcessAsUserW".}

-when defined(winUnicode):

-  proc GetBinaryType*(lpApplicationName: LPCWSTR, lpBinaryType: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "GetBinaryTypeW".}

-  proc GetShortPathName*(lpszLongPath: LPCWSTR, lpszShortPath: LPWSTR,

-                         cchBuffer: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetShortPathNameW".}

-  proc GetEnvironmentStrings*(): LPWSTR{.stdcall, dynlib: "kernel32",

-      importc: "GetEnvironmentStringsW".}

-  proc FreeEnvironmentStrings*(para1: LPWSTR): WINBOOL{.stdcall,

-

-      dynlib: "kernel32", importc: "FreeEnvironmentStringsW".}

-  proc FormatMessage*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD,

-                      dwLanguageId: DWORD, lpBuffer: LPWSTR, nSize: DWORD,

-                      Arguments: va_list): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "FormatMessageW".}

-  proc CreateMailslot*(lpName: LPCWSTR, nMaxMessageSize: DWORD,

-                       lReadTimeout: DWORD,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateMailslotW".}

-  proc lstrcmp*(lpString1: LPCWSTR, lpString2: LPCWSTR): int32{.stdcall,

-      dynlib: "kernel32", importc: "lstrcmpW".}

-  proc lstrcmpi*(lpString1: LPCWSTR, lpString2: LPCWSTR): int32{.stdcall,

-      dynlib: "kernel32", importc: "lstrcmpiW".}

-  proc lstrcpyn*(lpString1: LPWSTR, lpString2: LPCWSTR, iMaxLength: int32): LPWSTR{.

-      stdcall, dynlib: "kernel32", importc: "lstrcpynW".}

-  proc lstrcpy*(lpString1: LPWSTR, lpString2: LPCWSTR): LPWSTR{.stdcall,

-      dynlib: "kernel32", importc: "lstrcpyW".}

-  proc lstrcat*(lpString1: LPWSTR, lpString2: LPCWSTR): LPWSTR{.stdcall,

-      dynlib: "kernel32", importc: "lstrcatW".}

-  proc lstrlen*(lpString: LPCWSTR): int32{.stdcall, dynlib: "kernel32",

-      importc: "lstrlenW".}

-  proc CreateMutex*(lpMutexAttributes: LPSECURITY_ATTRIBUTES,

-                    bInitialOwner: WINBOOL, lpName: LPCWSTR): HANDLE{.stdcall,

-      dynlib: "kernel32", importc: "CreateMutexW".}

-  proc OpenMutex*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                  lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenMutexW".}

-  proc CreateEvent*(lpEventAttributes: LPSECURITY_ATTRIBUTES,

-                    bManualReset: WINBOOL, bInitialState: WINBOOL,

-                    lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "CreateEventW".}

-  proc OpenEvent*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                  lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenEventW".}

-  proc CreateSemaphore*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES,

-                        lInitialCount: LONG, lMaximumCount: LONG,

-                        lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "CreateSemaphoreW".}

-  proc OpenSemaphore*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                      lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenSemaphoreW".}

-  proc CreateFileMapping*(hFile: HANDLE,

-                          lpFileMappingAttributes: LPSECURITY_ATTRIBUTES,

-                          flProtect: DWORD, dwMaximumSizeHigh: DWORD,

-                          dwMaximumSizeLow: DWORD, lpName: LPCWSTR): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateFileMappingW".}

-  proc OpenFileMapping*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                        lpName: LPCWSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenFileMappingW".}

-  proc GetLogicalDriveStrings*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetLogicalDriveStringsW".}

-  proc LoadLibrary*(lpLibFileName: LPCWSTR): HINST{.stdcall, dynlib: "kernel32",

-      importc: "LoadLibraryW".}

-  proc LoadLibraryEx*(lpLibFileName: LPCWSTR, hFile: HANDLE, dwFlags: DWORD): HINST{.

-      stdcall, dynlib: "kernel32", importc: "LoadLibraryExW".}

-  proc GetModuleFileName*(hModule: HINST, lpFilename: LPWSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetModuleFileNameW".}

-  proc GetModuleHandle*(lpModuleName: LPCWSTR): HMODULE{.stdcall,

-      dynlib: "kernel32", importc: "GetModuleHandleW".}

-  proc FatalAppExit*(uAction: WINUINT, lpMessageText: LPCWSTR){.stdcall,

-      dynlib: "kernel32", importc: "FatalAppExitW".}

-  proc GetCommandLine*(): LPWSTR{.stdcall, dynlib: "kernel32",

-                                  importc: "GetCommandLineW".}

-  proc GetEnvironmentVariable*(lpName: LPCWSTR, lpBuffer: LPWSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetEnvironmentVariableW".}

-  proc SetEnvironmentVariable*(lpName: LPCWSTR, lpValue: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableW".}

-  proc ExpandEnvironmentStrings*(lpSrc: LPCWSTR, lpDst: LPWSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "ExpandEnvironmentStringsW".}

-  proc OutputDebugString*(lpOutputString: LPCWSTR){.stdcall, dynlib: "kernel32",

-      importc: "OutputDebugStringW".}

-  proc FindResource*(hModule: HINST, lpName: LPCWSTR, lpType: LPCWSTR): HRSRC{.

-      stdcall, dynlib: "kernel32", importc: "FindResourceW".}

-  proc FindResourceEx*(hModule: HINST, lpType: LPCWSTR, lpName: LPCWSTR,

-                       wLanguage: int16): HRSRC{.stdcall, dynlib: "kernel32",

-      importc: "FindResourceExW".}

-  proc EnumResourceTypes*(hModule: HINST, lpEnumFunc: ENUMRESTYPEPROC,

-                          lParam: LONG): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumResourceTypesW".}

-  proc EnumResourceNames*(hModule: HINST, lpType: LPCWSTR,

-                          lpEnumFunc: ENUMRESNAMEPROC, lParam: LONG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumResourceNamesW".}

-  proc EnumResourceLanguages*(hModule: HINST, lpType: LPCWSTR, lpName: LPCWSTR,

-                              lpEnumFunc: ENUMRESLANGPROC, lParam: LONG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumResourceLanguagesW".}

-  proc BeginUpdateResource*(pFileName: LPCWSTR,

-                            bDeleteExistingResources: WINBOOL): HANDLE{.stdcall,

-      dynlib: "kernel32", importc: "BeginUpdateResourceW".}

-  proc UpdateResource*(hUpdate: HANDLE, lpType: LPCWSTR, lpName: LPCWSTR,

-                       wLanguage: int16, lpData: LPVOID, cbData: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "UpdateResourceW".}

-  proc EndUpdateResource*(hUpdate: HANDLE, fDiscard: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EndUpdateResourceW".}

-  proc GlobalAddAtom*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "GlobalAddAtomW".}

-  proc GlobalFindAtom*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "GlobalFindAtomW".}

-  proc GlobalGetAtomName*(nAtom: ATOM, lpBuffer: LPWSTR, nSize: int32): WINUINT{.

-      stdcall, dynlib: "kernel32", importc: "GlobalGetAtomNameW".}

-  proc AddAtom*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "AddAtomW".}

-  proc FindAtom*(lpString: LPCWSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "FindAtomW".}

-  proc GetAtomName*(nAtom: ATOM, lpBuffer: LPWSTR, nSize: int32): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetAtomNameW".}

-  proc GetProfileInt*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR, nDefault: WINT): WINUINT{.

-      stdcall, dynlib: "kernel32", importc: "GetProfileIntW".}

-  proc GetProfileString*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                         lpDefault: LPCWSTR, lpReturnedString: LPWSTR,

-                         nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetProfileStringW".}

-  proc WriteProfileString*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                           lpString: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WriteProfileStringW".}

-  proc GetProfileSection*(lpAppName: LPCWSTR, lpReturnedString: LPWSTR,

-                          nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetProfileSectionW".}

-  proc WriteProfileSection*(lpAppName: LPCWSTR, lpString: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteProfileSectionW".}

-  proc GetPrivateProfileInt*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                             nDefault: WINT, lpFileName: LPCWSTR): WINUINT{.

-      stdcall, dynlib: "kernel32", importc: "GetPrivateProfileIntW".}

-  proc GetPrivateProfileString*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                                lpDefault: LPCWSTR, lpReturnedString: LPWSTR,

-                                nSize: DWORD, lpFileName: LPCWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringW".}

-  proc WritePrivateProfileString*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR,

-                                  lpString: LPCWSTR, lpFileName: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringW".}

-  proc GetPrivateProfileSection*(lpAppName: LPCWSTR, lpReturnedString: LPWSTR,

-                                 nSize: DWORD, lpFileName: LPCWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetPrivateProfileSectionW".}

-  proc WritePrivateProfileSection*(lpAppName: LPCWSTR, lpString: LPCWSTR,

-                                   lpFileName: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WritePrivateProfileSectionW".}

-  proc GetDriveType*(lpRootPathName: LPCWSTR): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetDriveTypeW".}

-  proc GetSystemDirectory*(lpBuffer: LPWSTR, uSize: WINUINT): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetSystemDirectoryW".}

-  proc GetTempPath*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetTempPathW".}

-  proc GetTempFileName*(lpPathName: LPCWSTR, lpPrefixString: LPCWSTR,

-                        uUnique: WINUINT, lpTempFileName: LPWSTR): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetTempFileNameW".}

-  proc GetWindowsDirectory*(lpBuffer: LPWSTR, uSize: WINUINT): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetWindowsDirectoryW".}

-  proc SetCurrentDirectory*(lpPathName: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetCurrentDirectoryW".}

-  proc GetCurrentDirectory*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetCurrentDirectoryW".}

-  proc GetDiskFreeSpace*(lpRootPathName: LPCWSTR, lpSectorsPerCluster: LPDWORD,

-                         lpBytesPerSector: LPDWORD,

-                         lpNumberOfFreeClusters: LPDWORD,

-                         lpTotalNumberOfClusters: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetDiskFreeSpaceW".}

-  proc CreateDirectory*(lpPathName: LPCWSTR,

-                        lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateDirectoryW".}

-  proc CreateDirectoryEx*(lpTemplateDirectory: LPCWSTR, lpNewDirectory: LPCWSTR,

-                          lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateDirectoryExW".}

-  proc RemoveDirectory*(lpPathName: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "RemoveDirectoryW".}

-  proc GetFullPathName*(lpFileName: LPCWSTR, nBufferLength: DWORD,

-                        lpBuffer: LPWSTR, lpFilePart: var LPWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetFullPathNameW".}

-  proc DefineDosDevice*(dwFlags: DWORD, lpDeviceName: LPCWSTR,

-                        lpTargetPath: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "DefineDosDeviceW".}

-  proc QueryDosDevice*(lpDeviceName: LPCWSTR, lpTargetPath: LPWSTR,

-                       ucchMax: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "QueryDosDeviceW".}

-  proc CreateFile*(lpFileName: LPCWSTR, dwDesiredAccess: DWORD,

-                   dwShareMode: DWORD,

-                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                   dwCreationDisposition: DWORD, dwFlagsAndAttributes: DWORD,

-                   hTemplateFile: HANDLE): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "CreateFileW".}

-  proc SetFileAttributes*(lpFileName: LPCWSTR, dwFileAttributes: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetFileAttributesW".}

-  proc GetFileAttributes*(lpFileName: LPCWSTR): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetFileAttributesW".}

-  proc GetCompressedFileSize*(lpFileName: LPCWSTR, lpFileSizeHigh: LPDWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetCompressedFileSizeW".}

-  proc DeleteFile*(lpFileName: LPCWSTR): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "DeleteFileW".}

-  proc SearchPath*(lpPath: LPCWSTR, lpFileName: LPCWSTR, lpExtension: LPCWSTR,

-                   nBufferLength: DWORD, lpBuffer: LPWSTR, lpFilePart: LPWSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "SearchPathW".}

-  proc CopyFile*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR,

-                 bFailIfExists: WINBOOL): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "CopyFileW".}

-  proc MoveFile*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "MoveFileW".}

-  proc MoveFileEx*(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR,

-                   dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "MoveFileExW".}

-  proc CreateNamedPipe*(lpName: LPCWSTR, dwOpenMode: DWORD, dwPipeMode: DWORD,

-                        nMaxInstances: DWORD, nOutBufferSize: DWORD,

-                        nInBufferSize: DWORD, nDefaultTimeOut: DWORD,

-                        lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateNamedPipeW".}

-  proc GetNamedPipeHandleState*(hNamedPipe: HANDLE, lpState: LPDWORD,

-                                lpCurInstances: LPDWORD,

-                                lpMaxCollectionCount: LPDWORD,

-                                lpCollectDataTimeout: LPDWORD,

-                                lpUserName: LPWSTR, nMaxUserNameSize: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "GetNamedPipeHandleStateW".}

-  proc CallNamedPipe*(lpNamedPipeName: LPCWSTR, lpInBuffer: LPVOID,

-                      nInBufferSize: DWORD, lpOutBuffer: LPVOID,

-                      nOutBufferSize: DWORD, lpBytesRead: LPDWORD,

-                      nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "CallNamedPipeW".}

-  proc WaitNamedPipe*(lpNamedPipeName: LPCWSTR, nTimeOut: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WaitNamedPipeW".}

-  proc SetVolumeLabel*(lpRootPathName: LPCWSTR, lpVolumeName: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetVolumeLabelW".}

-  proc GetVolumeInformation*(lpRootPathName: LPCWSTR,

-                             lpVolumeNameBuffer: LPWSTR, nVolumeNameSize: DWORD,

-                             lpVolumeSerialNumber: LPDWORD,

-                             lpMaximumComponentLength: LPDWORD,

-                             lpFileSystemFlags: LPDWORD,

-                             lpFileSystemNameBuffer: LPWSTR,

-                             nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetVolumeInformationW".}

-  proc ClearEventLog*(hEventLog: HANDLE, lpBackupFileName: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "ClearEventLogW".}

-  proc BackupEventLog*(hEventLog: HANDLE, lpBackupFileName: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "BackupEventLogW".}

-  proc OpenEventLog*(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "OpenEventLogW".}

-  proc RegisterEventSource*(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "RegisterEventSourceW".}

-  proc OpenBackupEventLog*(lpUNCServerName: LPCWSTR, lpFileName: LPCWSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "OpenBackupEventLogW".}

-  proc ReadEventLog*(hEventLog: HANDLE, dwReadFlags: DWORD,

-                     dwRecordOffset: DWORD, lpBuffer: LPVOID,

-                     nNumberOfBytesToRead: DWORD, pnBytesRead: LPDWORD,

-                     pnMinNumberOfBytesNeeded: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ReadEventLogW".}

-  proc ReportEvent*(hEventLog: HANDLE, wType: int16, wCategory: int16,

-                    dwEventID: DWORD, lpUserSid: PSID, wNumStrings: int16,

-                    dwDataSize: DWORD, lpStrings: LPPCWSTR, lpRawData: LPVOID): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "ReportEventW".}

-  proc AccessCheckAndAuditAlarm*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                                 ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

-                                 SecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 DesiredAccess: DWORD,

-                                 GenericMapping: PGENERIC_MAPPING,

-                                 ObjectCreation: WINBOOL,

-                                 GrantedAccess: LPDWORD, AccessStatus: LPBOOL,

-                                 pfGenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "AccessCheckAndAuditAlarmW".}

-  proc ObjectOpenAuditAlarm*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                             ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

-                             pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                             ClientToken: HANDLE, DesiredAccess: DWORD,

-                             GrantedAccess: DWORD, Privileges: PPRIVILEGE_SET,

-                             ObjectCreation: WINBOOL, AccessGranted: WINBOOL,

-                             GenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectOpenAuditAlarmW".}

-  proc ObjectPrivilegeAuditAlarm*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                                  ClientToken: HANDLE, DesiredAccess: DWORD,

-                                  Privileges: PPRIVILEGE_SET,

-                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmW".}

-  proc ObjectCloseAuditAlarm*(SubsystemName: LPCWSTR, HandleId: LPVOID,

-                              GenerateOnClose: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectCloseAuditAlarmW".}

-  proc PrivilegedServiceAuditAlarm*(SubsystemName: LPCWSTR,

-                                    ServiceName: LPCWSTR, ClientToken: HANDLE,

-                                    Privileges: PPRIVILEGE_SET,

-                                    AccessGranted: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmW".}

-  proc SetFileSecurity*(lpFileName: LPCWSTR,

-                        SecurityInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "SetFileSecurityW".}

-  proc GetFileSecurity*(lpFileName: LPCWSTR,

-                        RequestedInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                        nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetFileSecurityW".}

-  proc FindFirstChangeNotification*(lpPathName: LPCWSTR, bWatchSubtree: WINBOOL,

-                                    dwNotifyFilter: DWORD): HANDLE{.stdcall,

-      dynlib: "kernel32", importc: "FindFirstChangeNotificationW".}

-  proc IsBadStringPtr*(lpsz: LPCWSTR, ucchMax: WINUINT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "IsBadStringPtrW".}

-  proc LookupAccountSid*(lpSystemName: LPCWSTR, Sid: PSID, Name: LPWSTR,

-                         cbName: LPDWORD, ReferencedDomainName: LPWSTR,

-                         cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupAccountSidW".}

-  proc LookupAccountName*(lpSystemName: LPCWSTR, lpAccountName: LPCWSTR,

-                          Sid: PSID, cbSid: LPDWORD,

-                          ReferencedDomainName: LPWSTR,

-                          cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupAccountNameW".}

-  proc LookupPrivilegeValue*(lpSystemName: LPCWSTR, lpName: LPCWSTR,

-                             lpLuid: PLUID): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LookupPrivilegeValueW".}

-  proc LookupPrivilegeName*(lpSystemName: LPCWSTR, lpLuid: PLUID,

-                            lpName: LPWSTR, cbName: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LookupPrivilegeNameW".}

-  proc LookupPrivilegeDisplayName*(lpSystemName: LPCWSTR, lpName: LPCWSTR,

-                                   lpDisplayName: LPWSTR,

-                                   cbDisplayName: LPDWORD, lpLanguageId: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameW".}

-  proc BuildCommDCB*(lpDef: LPCWSTR, lpDCB: LPDCB): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "BuildCommDCBW".}

-  proc BuildCommDCBAndTimeouts*(lpDef: LPCWSTR, lpDCB: LPDCB,

-                                lpCommTimeouts: LPCOMMTIMEOUTS): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsW".}

-  proc CommConfigDialog*(lpszName: LPCWSTR, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".}

-  proc GetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG,

-                             lpdwSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetDefaultCommConfigW".}

-  proc SetDefaultCommConfig*(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG,

-                             dwSize: DWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetDefaultCommConfigW".}

-  proc GetComputerName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetComputerNameW".}

-  proc SetComputerName*(lpComputerName: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetComputerNameW".}

-  proc GetUserName*(lpBuffer: LPWSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "GetUserNameW".}

-  proc LoadKeyboardLayout*(pwszKLID: LPCWSTR, Flags: WINUINT): HKL{.stdcall,

-      dynlib: "user32", importc: "LoadKeyboardLayoutW".}

-  proc GetKeyboardLayoutName*(pwszKLID: LPWSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetKeyboardLayoutNameW".}

-  proc CreateDesktop*(lpszDesktop: LPWSTR, lpszDevice: LPWSTR,

-                      pDevmode: LPDEVMODE, dwFlags: DWORD,

-                      dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HDESK{.

-      stdcall, dynlib: "user32", importc: "CreateDesktopW".}

-  proc OpenDesktop*(lpszDesktop: LPWSTR, dwFlags: DWORD, fInherit: WINBOOL,

-                    dwDesiredAccess: DWORD): HDESK{.stdcall, dynlib: "user32",

-      importc: "OpenDesktopW".}

-  proc EnumDesktops*(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROC,

-                     lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "EnumDesktopsW".}

-  proc CreateWindowStation*(lpwinsta: LPWSTR, dwReserved: DWORD,

-                            dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{.

-      stdcall, dynlib: "user32", importc: "CreateWindowStationW".}

-  proc OpenWindowStation*(lpszWinSta: LPWSTR, fInherit: WINBOOL,

-                          dwDesiredAccess: DWORD): HWINSTA{.stdcall,

-      dynlib: "user32", importc: "OpenWindowStationW".}

-  proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "EnumWindowStationsW".}

-  proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                 nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".}

-  proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                 nLength: DWORD): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetUserObjectInformationW".}

-  proc RegisterWindowMessage*(lpString: LPCWSTR): WINUINT{.stdcall,

-      dynlib: "user32", importc: "RegisterWindowMessageW".}

-  proc GetMessage*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                   wMsgFilterMax: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "GetMessageW".}

-  proc DispatchMessage*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",

-      importc: "DispatchMessageW".}

-  proc PeekMessage*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                    wMsgFilterMax: WINUINT, wRemoveMsg: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "PeekMessageW".}

-  proc SendMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "SendMessageW".}

-  proc SendMessageTimeout*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                           lp: LPARAM, fuFlags: WINUINT, uTimeout: WINUINT,

-                           lpdwResult: LPDWORD): LRESULT{.stdcall,

-      dynlib: "user32", importc: "SendMessageTimeoutW".}

-  proc SendNotifyMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "SendNotifyMessageW".}

-  proc SendMessageCallback*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                            lp: LPARAM, lpResultCallBack: SENDASYNCPROC,

-                            dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "SendMessageCallbackW".}

-  proc PostMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "PostMessageW".}

-  proc PostThreadMessage*(idThread: DWORD, Msg: WINUINT, wp: WPARAM,

-                          lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "PostThreadMessageW".}

-  proc DefWindowProc*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefWindowProcW".}

-  proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: WINUINT,

-                       wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-      dynlib: "user32", importc: "CallWindowProcW".}

-  proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32",

-      importc: "RegisterClassW".}

-  proc UnregisterClass*(lpClassName: LPCWSTR, hInstance: HINST): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "UnregisterClassW".}

-  proc GetClassInfo*(hInstance: HINST, lpClassName: LPCWSTR,

-                     lpWndClass: LPWNDCLASS): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetClassInfoW".}

-  proc RegisterClassEx*(para1: LPWNDCLASSEXW): ATOM{.stdcall, dynlib: "user32",

-      importc: "RegisterClassExW".}

-  proc GetClassInfoEx*(para1: HINST, para2: LPCWSTR, para3: LPWNDCLASSEX): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "GetClassInfoExW".}

-  proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCWSTR,

-                       lpWindowName: LPCWSTR, dwStyle: DWORD, X: int32,

-                       Y: int32, nWidth: int32, nHeight: int32,

-                       hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                       lpParam: LPVOID): HWND{.stdcall, dynlib: "user32",

-      importc: "CreateWindowExW".}

-  proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCWSTR,

-                          hWndParent: HWND, lpDialogFunc: DLGPROC,

-                          dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32",

-      importc: "CreateDialogParamW".}

-  proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                                  hWndParent: HWND, lpDialogFunc: DLGPROC,

-                                  dwInitParam: LPARAM): HWND{.stdcall,

-      dynlib: "user32", importc: "CreateDialogIndirectParamW".}

-  proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCWSTR,

-                       hWndParent: HWND, lpDialogFunc: DLGPROC,

-                       dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32",

-      importc: "DialogBoxParamW".}

-  proc DialogBoxIndirectParam*(hInstance: HINST,

-                               hDialogTemplate: LPCDLGTEMPLATE,

-                               hWndParent: HWND, lpDialogFunc: DLGPROC,

-                               dwInitParam: LPARAM): int32{.stdcall,

-      dynlib: "user32", importc: "DialogBoxIndirectParamW".}

-  proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "SetDlgItemTextW".}

-  proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPWSTR,

-                       nMaxCount: int32): WINUINT{.stdcall, dynlib: "user32",

-      importc: "GetDlgItemTextW".}

-  proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: WINUINT,

-                           wp: WPARAM, lp: LPARAM): LONG{.stdcall,

-      dynlib: "user32", importc: "SendDlgItemMessageW".}

-  proc DefDlgProc*(hDlg: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefDlgProcW".}

-  proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "CallMsgFilterW".}

-  proc RegisterClipboardFormat*(lpszFormat: LPCWSTR): WINUINT{.stdcall,

-      dynlib: "user32", importc: "RegisterClipboardFormatW".}

-  proc GetClipboardFormatName*(format: WINUINT, lpszFormatName: LPWSTR,

-                               cchMaxCount: int32): int32{.stdcall,

-      dynlib: "user32", importc: "GetClipboardFormatNameW".}

-  proc CharToOem*(lpszSrc: LPCWSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "CharToOemW".}

-  proc OemToChar*(lpszSrc: LPCSTR, lpszDst: LPWSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "OemToCharW".}

-  proc CharToOemBuff*(lpszSrc: LPCWSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "CharToOemBuffW".}

-  proc OemToCharBuff*(lpszSrc: LPCSTR, lpszDst: LPWSTR, cchDstLength: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "OemToCharBuffW".}

-  proc CharUpper*(lpsz: LPWSTR): LPWSTR{.stdcall, dynlib: "user32",

-      importc: "CharUpperW".}

-  proc CharUpperBuff*(lpsz: LPWSTR, cchLength: DWORD): DWORD{.stdcall,

-      dynlib: "user32", importc: "CharUpperBuffW".}

-  proc CharLower*(lpsz: LPWSTR): LPWSTR{.stdcall, dynlib: "user32",

-      importc: "CharLowerW".}

-  proc CharLowerBuff*(lpsz: LPWSTR, cchLength: DWORD): DWORD{.stdcall,

-      dynlib: "user32", importc: "CharLowerBuffW".}

-  proc CharNext*(lpsz: LPCWSTR): LPWSTR{.stdcall, dynlib: "user32",

-      importc: "CharNextW".}

-  proc CharPrev*(lpszStart: LPCWSTR, lpszCurrent: LPCWSTR): LPWSTR{.stdcall,

-      dynlib: "user32", importc: "CharPrevW".}

-  proc IsCharAlpha*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "IsCharAlphaW".}

-  proc IsCharAlphaNumeric*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "IsCharAlphaNumericW".}

-  proc IsCharUpper*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "IsCharUpperW".}

-  proc IsCharLower*(ch: WCHAR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "IsCharLowerW".}

-  proc GetKeyNameText*(lParam: LONG, lpString: LPWSTR, nSize: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetKeyNameTextW".}

-  proc VkKeyScan*(ch: WCHAR): SHORT{.stdcall, dynlib: "user32",

-                                     importc: "VkKeyScanW".}

-  proc VkKeyScanEx*(ch: WCHAR, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

-      importc: "VkKeyScanExW".}

-  proc MapVirtualKey*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

-      dynlib: "user32", importc: "MapVirtualKeyW".}

-  proc MapVirtualKeyEx*(uCode: WINUINT, uMapType: WINUINT, dwhkl: HKL): WINUINT{.stdcall,

-      dynlib: "user32", importc: "MapVirtualKeyExW".}

-  proc LoadAccelerators*(hInstance: HINST, lpTableName: LPCWSTR): HACCEL{.

-      stdcall, dynlib: "user32", importc: "LoadAcceleratorsW".}

-  proc CreateAcceleratorTable*(para1: LPACCEL, para2: int32): HACCEL{.stdcall,

-      dynlib: "user32", importc: "CreateAcceleratorTableW".}

-  proc CopyAcceleratorTable*(hAccelSrc: HACCEL, lpAccelDst: LPACCEL,

-                             cAccelEntries: int32): int32{.stdcall,

-      dynlib: "user32", importc: "CopyAcceleratorTableW".}

-  proc TranslateAccelerator*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{.

-      stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".}

-  proc LoadMenu*(hInstance: HINST, lpMenuName: LPCWSTR): HMENU{.stdcall,

-      dynlib: "user32", importc: "LoadMenuW".}

-  proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall,

-      dynlib: "user32", importc: "LoadMenuIndirectW".}

-  proc ChangeMenu*(menu: HMENU, cmd: WINUINT, lpszNewItem: LPCWSTR,

-                   cmdInsert: WINUINT, flags: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "ChangeMenuW".}

-  proc GetMenuString*(menu: HMENU, uIDItem: WINUINT, lpString: LPWSTR,

-                      nMaxCount: int32, uFlag: WINUINT): int32{.stdcall,

-      dynlib: "user32", importc: "GetMenuStringW".}

-  proc InsertMenu*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT,

-                   uIDNewItem: WINUINT, lpNewItem: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "InsertMenuW".}

-  proc AppendMenu*(menu: HMENU, uFlags: WINUINT, uIDNewItem: WINUINT,

-                   lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "AppendMenuW".}

-  proc ModifyMenu*(hMnu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                   lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "ModifyMenuW".}

-  proc InsertMenuItem*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "InsertMenuItemW".}

-  proc GetMenuItemInfo*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                        para4: LPMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetMenuItemInfoW".}

-  proc SetMenuItemInfo*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                        para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetMenuItemInfoW".}

-  proc DrawText*(hDC: HDC, lpString: LPCWSTR, nCount: int32, lpRect: LPRECT,

-                 uFormat: WINUINT): int32{.stdcall, dynlib: "user32",

-                                        importc: "DrawTextW".}

-  proc DrawTextEx*(para1: HDC, para2: LPWSTR, para3: int32, para4: LPRECT,

-                   para5: WINUINT, para6: LPDRAWTEXTPARAMS): int32{.stdcall,

-      dynlib: "user32", importc: "DrawTextExW".}

-  proc GrayString*(hDC: HDC, hBrush: HBRUSH, lpOutputFunc: GRAYSTRINGPROC,

-                   lpData: LPARAM, nCount: int32, X: int32, Y: int32,

-                   nWidth: int32, nHeight: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GrayStringW".}

-  proc DrawState*(para1: HDC, para2: HBRUSH, para3: DRAWSTATEPROC,

-                  para4: LPARAM, para5: WPARAM, para6: int32, para7: int32,

-                  para8: int32, para9: int32, para10: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "DrawStateW".}

-  proc TabbedTextOut*(hDC: HDC, X: int32, Y: int32, lpString: LPCWSTR,

-                      nCount: int32, nTabPositions: int32,

-                      lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{.

-      stdcall, dynlib: "user32", importc: "TabbedTextOutW".}

-  proc GetTabbedTextExtent*(hDC: HDC, lpString: LPCWSTR, nCount: int32,

-                            nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{.

-      stdcall, dynlib: "user32", importc: "GetTabbedTextExtentW".}

-  proc SetProp*(wnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetPropW".}

-  proc GetProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,

-      dynlib: "user32", importc: "GetPropW".}

-  proc RemoveProp*(wnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,

-      dynlib: "user32", importc: "RemovePropW".}

-  proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{.

-      stdcall, dynlib: "user32", importc: "EnumPropsExW".}

-  proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,

-      dynlib: "user32", importc: "EnumPropsW".}

-  proc SetWindowText*(wnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetWindowTextW".}

-  proc GetWindowText*(wnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetWindowTextW".}

-  proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32",

-      importc: "GetWindowTextLengthW".}

-  proc MessageBox*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: WINUINT): int32{.

-      stdcall, dynlib: "user32", importc: "MessageBoxW".}

-  proc MessageBoxEx*(wnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR,

-                     uType: WINUINT, wLanguageId: int16): int32{.stdcall,

-      dynlib: "user32", importc: "MessageBoxExW".}

-  proc MessageBoxIndirect*(para1: LPMSGBOXPARAMS): int32{.stdcall,

-      dynlib: "user32", importc: "MessageBoxIndirectW".}

-  proc GetWindowLong*(wnd: HWND, nIndex: int32): LONG{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongW".}

-  proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongW".}

-  proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall,

-      dynlib: "user32", importc: "GetClassLongW".}

-  proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.

-      stdcall, dynlib: "user32", importc: "SetClassLongW".}

-  when defined(cpu64):

-    proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetWindowLongPtrW".}

-    proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".}

-    proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetClassLongPtrW".}

-    proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetClassLongPtrW".}

-  else:

-    proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetWindowLongW".}

-    proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetWindowLongW".}

-    proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetClassLongW".}

-    proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetClassLongW".}

-  proc FindWindow*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR): HWND{.stdcall,

-      dynlib: "user32", importc: "FindWindowW".}

-  proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCWSTR, para4: LPCWSTR): HWND{.

-      stdcall, dynlib: "user32", importc: "FindWindowExW".}

-  proc GetClassName*(wnd: HWND, lpClassName: LPWSTR, nMaxCount: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetClassNameW".}

-  proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST,

-                         dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32",

-      importc: "SetWindowsHookExW".}

-  proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCWSTR): HBITMAP{.stdcall,

-      dynlib: "user32", importc: "LoadBitmapW".}

-  proc LoadCursor*(hInstance: HINST, lpCursorName: LPCWSTR): HCURSOR{.stdcall,

-      dynlib: "user32", importc: "LoadCursorW".}

-  proc LoadCursorFromFile*(lpFileName: LPCWSTR): HCURSOR{.stdcall,

-      dynlib: "user32", importc: "LoadCursorFromFileW".}

-  proc LoadIcon*(hInstance: HINST, lpIconName: LPCWSTR): HICON{.stdcall,

-      dynlib: "user32", importc: "LoadIconW".}

-  proc LoadImage*(para1: HINST, para2: LPCWSTR, para3: WINUINT, para4: int32,

-                  para5: int32, para6: WINUINT): HANDLE{.stdcall, dynlib: "user32",

-      importc: "LoadImageW".}

-  proc LoadString*(hInstance: HINST, uID: WINUINT, lpBuffer: LPWSTR,

-                   nBufferMax: int32): int32{.stdcall, dynlib: "user32",

-      importc: "LoadStringW".}

-  proc IsDialogMessage*(hDlg: HWND, lpMsg: LPMSG): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "IsDialogMessageW".}

-  proc DlgDirList*(hDlg: HWND, lpPathSpec: LPWSTR, nIDListBox: int32,

-                   nIDStaticPath: int32, uFileType: WINUINT): int32{.stdcall,

-      dynlib: "user32", importc: "DlgDirListW".}

-  proc DlgDirSelectEx*(hDlg: HWND, lpString: LPWSTR, nCount: int32,

-                       nIDListBox: int32): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "DlgDirSelectExW".}

-  proc DlgDirListComboBox*(hDlg: HWND, lpPathSpec: LPWSTR, nIDComboBox: int32,

-                           nIDStaticPath: int32, uFiletype: WINUINT): int32{.

-      stdcall, dynlib: "user32", importc: "DlgDirListComboBoxW".}

-  proc DlgDirSelectComboBoxEx*(hDlg: HWND, lpString: LPWSTR, nCount: int32,

-                               nIDComboBox: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "DlgDirSelectComboBoxExW".}

-  proc DefFrameProc*(wnd: HWND, hWndMDIClient: HWND, uMsg: WINUINT,

-                     wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-      dynlib: "user32", importc: "DefFrameProcW".}

-  proc DefMDIChildProc*(wnd: HWND, uMsg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefMDIChildProcW".}

-  proc CreateMDIWindow*(lpClassName: LPWSTR, lpWindowName: LPWSTR,

-                        dwStyle: DWORD, X: int32, Y: int32, nWidth: int32,

-                        nHeight: int32, hWndParent: HWND, hInstance: HINST,

-                        lp: LPARAM): HWND{.stdcall, dynlib: "user32",

-      importc: "CreateMDIWindowW".}

-  proc WinHelp*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: WINUINT, dwData: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "WinHelpW".}

-  proc ChangeDisplaySettings*(lpDevMode: LPDEVMODE, dwFlags: DWORD): LONG{.

-      stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsW".}

-  proc EnumDisplaySettings*(lpszDeviceName: LPCWSTR, iModeNum: DWORD,

-                            lpDevMode: LPDEVMODEW): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "EnumDisplaySettingsW".}

-  proc SystemParametersInfo*(uiAction: WINUINT, uiParam: WINUINT, pvParam: PVOID,

-                             fWinIni: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "SystemParametersInfoW".}

-  proc AddFontResource*(para1: LPCWSTR): int32{.stdcall, dynlib: "gdi32",

-      importc: "AddFontResourceW".}

-  proc CopyMetaFile*(para1: HMETAFILE, para2: LPCWSTR): HMETAFILE{.stdcall,

-      dynlib: "gdi32", importc: "CopyMetaFileW".}

-  proc CreateFontIndirect*(para1: PLOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-      importc: "CreateFontIndirectW".}

-  proc CreateFontIndirect*(para1: var LOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-      importc: "CreateFontIndirectW".}

-  proc CreateFont*(para1: int32, para2: int32, para3: int32, para4: int32,

-                   para5: int32, para6: DWORD, para7: DWORD, para8: DWORD,

-                   para9: DWORD, para10: DWORD, para11: DWORD, para12: DWORD,

-                   para13: DWORD, para14: LPCWSTR): HFONT{.stdcall,

-      dynlib: "gdi32", importc: "CreateFontW".}

-  proc CreateIC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR,

-                 para4: LPDEVMODE): HDC{.stdcall, dynlib: "gdi32",

-      importc: "CreateICW".}

-  proc CreateMetaFile*(para1: LPCWSTR): HDC{.stdcall, dynlib: "gdi32",

-      importc: "CreateMetaFileW".}

-  proc CreateScalableFontResource*(para1: DWORD, para2: LPCWSTR, para3: LPCWSTR,

-                                   para4: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "CreateScalableFontResourceW".}

-  proc EnumFontFamiliesEx*(para1: HDC, para2: LPLOGFONT, para3: FONTENUMEXPROC,

-                           para4: LPARAM, para5: DWORD): int32{.stdcall,

-      dynlib: "gdi32", importc: "EnumFontFamiliesExW".}

-  proc EnumFontFamilies*(para1: HDC, para2: LPCWSTR, para3: FONTENUMPROC,

-                         para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-      importc: "EnumFontFamiliesW".}

-  proc EnumFonts*(para1: HDC, para2: LPCWSTR, para3: ENUMFONTSPROC,

-                  para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-      importc: "EnumFontsW".}

-  proc EnumFonts*(para1: HDC, para2: LPCWSTR, para3: ENUMFONTSPROC,

-                  para4: pointer): int32{.stdcall, dynlib: "gdi32",

-      importc: "EnumFontsW".}

-  proc GetCharWidth*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidthW".}

-  proc GetCharWidth32*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidth32W".}

-  proc GetCharWidthFloat*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: ptr float32): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}

-  proc GetCharABCWidths*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPABC): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}

-  proc GetCharABCWidthsFloat*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                              para4: LPABCFLOAT): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}

-  proc GetGlyphOutline*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                        para4: LPGLYPHMETRICS, para5: DWORD, para6: LPVOID,

-                        para7: PMAT2): DWORD{.stdcall, dynlib: "gdi32",

-      importc: "GetGlyphOutlineW".}

-  proc GetMetaFile*(para1: LPCWSTR): HMETAFILE{.stdcall, dynlib: "gdi32",

-      importc: "GetMetaFileW".}

-  proc GetOutlineTextMetrics*(para1: HDC, para2: WINUINT,

-                              para3: LPOUTLINETEXTMETRIC): WINUINT{.stdcall,

-      dynlib: "gdi32", importc: "GetOutlineTextMetricsW".}

-  proc GetTextExtentPoint*(para1: HDC, para2: LPCWSTR, para3: int32,

-                           para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentPointW".}

-  proc GetTextExtentPoint32*(para1: HDC, para2: LPCWSTR, para3: int32,

-                             para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentPoint32W".}

-  proc GetTextExtentExPoint*(para1: HDC, para2: LPCWSTR, para3: int32,

-                             para4: int32, para5: LPINT, para6: LPINT,

-                             para7: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentExPointW".}

-  proc GetCharacterPlacement*(para1: HDC, para2: LPCWSTR, para3: int32,

-                              para4: int32, para5: LPGCP_RESULTS, para6: DWORD): DWORD{.

-      stdcall, dynlib: "gdi32", importc: "GetCharacterPlacementW".}

-  proc ResetDC*(para1: HDC, para2: LPDEVMODE): HDC{.stdcall, dynlib: "gdi32",

-      importc: "ResetDCW".}

-  proc RemoveFontResource*(para1: LPCWSTR): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "RemoveFontResourceW".}

-  proc CopyEnhMetaFile*(para1: HENHMETAFILE, para2: LPCWSTR): HENHMETAFILE{.

-      stdcall, dynlib: "gdi32", importc: "CopyEnhMetaFileW".}

-  proc CreateEnhMetaFile*(para1: HDC, para2: LPCWSTR, para3: LPRECT,

-                          para4: LPCWSTR): HDC{.stdcall, dynlib: "gdi32",

-      importc: "CreateEnhMetaFileW".}

-  proc GetEnhMetaFile*(para1: LPCWSTR): HENHMETAFILE{.stdcall, dynlib: "gdi32",

-      importc: "GetEnhMetaFileW".}

-  proc GetEnhMetaFileDescription*(para1: HENHMETAFILE, para2: WINUINT,

-                                  para3: LPWSTR): WINUINT{.stdcall,

-      dynlib: "gdi32", importc: "GetEnhMetaFileDescriptionW".}

-  proc GetTextMetrics*(para1: HDC, para2: LPTEXTMETRIC): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "GetTextMetricsW".}

-  proc StartDoc*(para1: HDC, para2: PDOCINFO): int32{.stdcall, dynlib: "gdi32",

-      importc: "StartDocW".}

-  proc GetObject*(para1: HGDIOBJ, para2: int32, para3: LPVOID): int32{.stdcall,

-      dynlib: "gdi32", importc: "GetObjectW".}

-  proc TextOut*(para1: HDC, para2: int32, para3: int32, para4: LPCWSTR,

-                para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "TextOutW".}

-  proc ExtTextOut*(para1: HDC, para2: int32, para3: int32, para4: WINUINT,

-                   para5: LPRECT, para6: LPCWSTR, para7: WINUINT, para8: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "ExtTextOutW".}

-  proc PolyTextOut*(para1: HDC, para2: PPOLYTEXT, para3: int32): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "PolyTextOutW".}

-  proc GetTextFace*(para1: HDC, para2: int32, para3: LPWSTR): int32{.stdcall,

-      dynlib: "gdi32", importc: "GetTextFaceW".}

-  proc GetKerningPairs*(para1: HDC, para2: DWORD, para3: LPKERNINGPAIR): DWORD{.

-      stdcall, dynlib: "gdi32", importc: "GetKerningPairsW".}

-  proc GetLogColorSpace*(para1: HCOLORSPACE, para2: LPLOGCOLORSPACE,

-                         para3: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetLogColorSpaceW".}

-  proc CreateColorSpace*(para1: LPLOGCOLORSPACE): HCOLORSPACE{.stdcall,

-      dynlib: "gdi32", importc: "CreateColorSpaceW".}

-  proc GetICMProfile*(para1: HDC, para2: DWORD, para3: LPWSTR): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetICMProfileW".}

-  proc SetICMProfile*(para1: HDC, para2: LPWSTR): WINBOOL{.stdcall,

-

-      dynlib: "gdi32", importc: "SetICMProfileW".}

-  proc UpdateICMRegKey*(para1: DWORD, para2: DWORD, para3: LPWSTR, para4: WINUINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "UpdateICMRegKeyW".}

-  proc EnumICMProfiles*(para1: HDC, para2: ICMENUMPROC, para3: LPARAM): int32{.

-      stdcall, dynlib: "gdi32", importc: "EnumICMProfilesW".}

-  proc CreatePropertySheetPage*(lppsp: LPCPROPSHEETPAGE): HPROPSHEETPAGE{.

-      stdcall, dynlib: "comctl32", importc: "CreatePropertySheetPageW".}

-  proc PropertySheet*(lppsph: LPCPROPSHEETHEADER): int32{.stdcall,

-      dynlib: "comctl32", importc: "PropertySheetW".}

-  proc ImageList_LoadImage*(hi: HINST, lpbmp: LPCWSTR, cx: int32, cGrow: int32,

-                            crMask: COLORREF, uType: WINUINT, uFlags: WINUINT): HIMAGELIST{.

-      stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageW".}

-  proc CreateStatusWindow*(style: LONG, lpszText: LPCWSTR, hwndParent: HWND,

-                           wID: WINUINT): HWND{.stdcall, dynlib: "comctl32",

-      importc: "CreateStatusWindowW".}

-  proc DrawStatusText*(hDC: HDC, lprc: LPRECT, pszText: LPCWSTR, uFlags: WINUINT){.

-      stdcall, dynlib: "comctl32", importc: "DrawStatusTextW".}

-  proc GetOpenFileName*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "GetOpenFileNameW".}

-  proc GetSaveFileName*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "GetSaveFileNameW".}

-  proc GetFileTitle*(para1: LPCWSTR, para2: LPWSTR, para3: int16): int{.stdcall,

-      dynlib: "comdlg32", importc: "GetFileTitleW".}

-  proc ChooseColor*(para1: LPCHOOSECOLOR): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "ChooseColorW".}

-  proc ReplaceText*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-      importc: "ReplaceTextW".}

-  proc ChooseFont*(para1: LPCHOOSEFONT): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "ChooseFontW".}

-  proc FindText*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-      importc: "FindTextW".}

-  proc PrintDlg*(para1: LPPRINTDLG): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "PrintDlgW".}

-  proc PageSetupDlg*(para1: LPPAGESETUPDLG): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "PageSetupDlgW".}

-  proc CreateProcess*(lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR,

-                      lpProcessAttributes: LPSECURITY_ATTRIBUTES,

-                      lpThreadAttributes: LPSECURITY_ATTRIBUTES,

-                      bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                      lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR,

-                      lpStartupInfo: LPSTARTUPINFO,

-                      lpProcessInformation: LPPROCESS_INFORMATION): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateProcessW".}

-  proc GetStartupInfo*(lpStartupInfo: LPSTARTUPINFO){.stdcall,

-      dynlib: "kernel32", importc: "GetStartupInfoW".}

-  proc FindFirstFile*(lpFileName: LPCWSTR, lpFindFileData: LPWIN32_FIND_DATA): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "FindFirstFileW".}

-  proc FindNextFile*(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATA): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "FindNextFileW".}

-  proc GetVersionEx*(VersionInformation: LPOSVERSIONINFOW): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetVersionExW".}

-  proc GetVersionExW*(VersionInformation: LPOSVERSIONINFOW): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetVersionExW".}

-  proc CreateWindow*(lpClassName: LPCWSTR, lpWindowName: LPCWSTR,

-                     dwStyle: DWORD, X: int32, Y: int32, nWidth: int32,

-                     nHeight: int32, hWndParent: HWND, menu: HMENU,

-                     hInstance: HINST, lpParam: LPVOID): HWND

-  proc CreateDialog*(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

-                     lpDialogFunc: DLGPROC): HWND

-  proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                             hWndParent: HWND, lpDialogFunc: DLGPROC): HWND

-  proc DialogBox*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND,

-                  lpDialogFunc: DLGPROC): int32

-  proc DialogBoxIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                          hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-  proc CreateDC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: PDEVMODE): HDC{.

-      stdcall, dynlib: "gdi32", importc: "CreateDCW".}

-  proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPWSTR,

-                       szDestFileName: LPWSTR, szSrcDir: LPWSTR,

-                       szDestDir: LPWSTR, szCurDir: LPWSTR, szTmpFile: LPWSTR,

-                       lpuTmpFileLen: PUINT): DWORD{.stdcall, dynlib: "version",

-      importc: "VerInstallFileW".}

-  proc GetFileVersionInfoSize*(lptstrFilename: LPWSTR, lpdwHandle: LPDWORD): DWORD{.

-      stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".}

-  proc GetFileVersionInfo*(lptstrFilename: LPWSTR, dwHandle: DWORD,

-                           dwLen: DWORD, lpData: LPVOID): WINBOOL{.stdcall,

-      dynlib: "version", importc: "GetFileVersionInfoW".}

-  proc VerLanguageName*(wLang: DWORD, szLang: LPWSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "VerLanguageNameW".}

-  proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPWSTR, lplpBuffer: LPVOID,

-                      puLen: PUINT): WINBOOL{.stdcall, dynlib: "version",

-      importc: "VerQueryValueW".}

-  proc VerFindFile*(uFlags: DWORD, szFileName: LPWSTR, szWinDir: LPWSTR,

-                    szAppDir: LPWSTR, szCurDir: LPWSTR, lpuCurDirLen: PUINT,

-                    szDestDir: LPWSTR, lpuDestDirLen: PUINT): DWORD{.stdcall,

-      dynlib: "version", importc: "VerFindFileW".}

-  proc RegSetValueEx*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,

-                      dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}

-  proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegUnLoadKeyW".}

-  proc InitiateSystemShutdown*(lpMachineName: LPWSTR, lpMessage: LPWSTR,

-                               dwTimeout: DWORD, bForceAppsClosed: WINBOOL,

-                               bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "InitiateSystemShutdownW".}

-  proc AbortSystemShutdown*(lpMachineName: LPWSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "AbortSystemShutdownW".}

-  proc RegRestoreKey*(key: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".}

-  proc RegSaveKey*(key: HKEY, lpFile: LPCWSTR,

-                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegSaveKeyW".}

-  proc RegSetValue*(key: HKEY, lpSubKey: LPCWSTR, dwType: DWORD,

-                    lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegSetValueW".}

-  proc RegQueryValue*(key: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR,

-                      lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",

-      importc: "RegQueryValueW".}

-  proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD,

-                               lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}

-  proc RegQueryValueEx*(key: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD,

-                        lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".}

-  proc RegReplaceKey*(key: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR,

-                      lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32",

-      importc: "RegReplaceKeyW".}

-  proc RegConnectRegistry*(lpMachineName: LPWSTR, key: HKEY, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}

-  proc RegCreateKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}

-  proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCWSTR, Reserved: DWORD,

-                       lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                       phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".}

-  proc RegDeleteKey*(key: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegDeleteKeyW".}

-  proc RegDeleteValue*(key: HKEY, lpValueName: LPCWSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegDeleteValueW".}

-  proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".}

-  proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR,

-                     lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR,

-                     lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}

-  proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPWSTR,

-                     lpcbValueName: LPDWORD, lpReserved: LPDWORD,

-                     lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}

-  proc RegLoadKey*(key: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".}

-  proc RegOpenKey*(key: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}

-  proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD,

-                     samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegOpenKeyExW".}

-  proc RegQueryInfoKey*(key: HKEY, lpClass: LPWSTR, lpcbClass: LPDWORD,

-                        lpReserved: LPDWORD, lpcSubKeys: LPDWORD,

-                        lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD,

-                        lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD,

-                        lpcbMaxValueLen: LPDWORD,

-                        lpcbSecurityDescriptor: LPDWORD,

-                        lpftLastWriteTime: PFILETIME): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegQueryInfoKeyW".}

-  proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCWSTR,

-                      cchCount1: int32, lpString2: LPCWSTR, cchCount2: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "CompareStringW".}

-  proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCWSTR,

-                    cchSrc: int32, lpDestStr: LPWSTR, cchDest: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "LCMapStringW".}

-  proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPWSTR,

-                      cchData: int32): int32{.stdcall, dynlib: "kernel32",

-      importc: "GetLocaleInfoW".}

-  proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetLocaleInfoW".}

-  proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME,

-                      lpFormat: LPCWSTR, lpTimeStr: LPWSTR, cchTime: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "GetTimeFormatW".}

-  proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME,

-                      lpFormat: LPCWSTR, lpDateStr: LPWSTR, cchDate: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "GetDateFormatW".}

-  proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR,

-                        lpFormat: PNUMBERFMT, lpNumberStr: LPWSTR,

-                        cchNumber: int32): int32{.stdcall, dynlib: "kernel32",

-      importc: "GetNumberFormatW".}

-  proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCWSTR,

-                          lpFormat: PCURRENCYFMT, lpCurrencyStr: LPWSTR,

-                          cchCurrency: int32): int32{.stdcall,

-      dynlib: "kernel32", importc: "GetCurrencyFormatW".}

-  proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID,

-                         Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EnumCalendarInfoW".}

-  proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID,

-                        dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumTimeFormatsW".}

-  proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID,

-                        dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumDateFormatsW".}

-  proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCWSTR,

-                        cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetStringTypeExW".}

-  proc GetStringType*(dwInfoType: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32,

-                      lpCharType: LPWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "GetStringTypeW".}

-  proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCWSTR, cchSrc: int32,

-                   lpDestStr: LPWSTR, cchDest: int32): int32{.stdcall,

-      dynlib: "kernel32", importc: "FoldStringW".}

-  proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesW".}

-  proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC,

-                            dwFlags: DWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EnumSystemCodePagesW".}

-  proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".}

-  proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}

-  proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                          nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".}

-  proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                          dwBufferSize: COORD, dwBufferCoord: COORD,

-                          lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "ReadConsoleOutputW".}

-  proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                           dwBufferSize: COORD, dwBufferCoord: COORD,

-                           lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WriteConsoleOutputW".}

-  proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPWSTR,

-                                   nLength: DWORD, dwReadCoord: COORD,

-                                   lpNumberOfCharsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".}

-  proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE,

-                                    lpCharacter: LPCWSTR, nLength: DWORD,

-                                    dwWriteCoord: COORD,

-                                    lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".}

-  proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: WCHAR,

-                                   nLength: DWORD, dwWriteCoord: COORD,

-                                   lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".}

-  proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE,

-                                  lpScrollRectangle: PSMALL_RECT,

-                                  lpClipRectangle: PSMALL_RECT,

-                                  dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".}

-  proc GetConsoleTitle*(lpConsoleTitle: LPWSTR, nSize: DWORD): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetConsoleTitleW".}

-  proc SetConsoleTitle*(lpConsoleTitle: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetConsoleTitleW".}

-  proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID,

-                    nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD,

-                    lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "ReadConsoleW".}

-  proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer,

-                     nNumberOfCharsToWrite: DWORD,

-                     lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleW".}

-  proc WNetAddConnection*(lpRemoteName: LPCWSTR, lpPassword: LPCWSTR,

-                          lpLocalName: LPCWSTR): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetAddConnectionW".}

-  proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCWSTR,

-                           lpUserName: LPCWSTR, dwFlags: DWORD): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetAddConnection2W".}

-  proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                           lpPassword: LPCWSTR, lpUserName: LPCWSTR,

-                           dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetAddConnection3W".}

-  proc WNetCancelConnection*(lpName: LPCWSTR, fForce: WINBOOL): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetCancelConnectionW".}

-  proc WNetCancelConnection2*(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetCancelConnection2W".}

-  proc WNetGetConnection*(lpLocalName: LPCWSTR, lpRemoteName: LPWSTR,

-                          lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetGetConnectionW".}

-  proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                          lpUserID: LPCWSTR, lpPassword: LPCWSTR,

-                          dwFlags: DWORD, lpAccessName: LPWSTR,

-                          lpBufferSize: LPDWORD, lpResult: LPDWORD): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetUseConnectionW".}

-  proc WNetSetConnection*(lpName: LPCWSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetSetConnectionW".}

-  proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1W".}

-  proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetDisconnectDialog1W".}

-  proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD,

-                     lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetOpenEnumW".}

-  proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID,

-                         lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetEnumResourceW".}

-  proc WNetGetUniversalName*(lpLocalPath: LPCWSTR, dwInfoLevel: DWORD,

-                             lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".}

-  proc WNetGetUser*(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetUserW".}

-  proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPWSTR,

-                            lpBufferSize: LPDWORD): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetGetProviderNameW".}

-  proc WNetGetNetworkInformation*(lpProvider: LPCWSTR,

-                                  lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".}

-  proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPWSTR,

-                         nErrorBufSize: DWORD, lpNameBuf: LPWSTR,

-                         nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetGetLastErrorW".}

-  proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE,

-      lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall,

-      dynlib: "mpr", importc: "MultinetGetConnectionPerformanceW".}

-  proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD,

-                            dwStartType: DWORD, dwErrorControl: DWORD,

-                            lpBinaryPathName: LPCWSTR,

-                            lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD,

-                            lpDependencies: LPCWSTR,

-                            lpServiceStartName: LPCWSTR, lpPassword: LPCWSTR,

-                            lpDisplayName: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ChangeServiceConfigW".}

-  proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                      lpDisplayName: LPCWSTR, dwDesiredAccess: DWORD,

-                      dwServiceType: DWORD, dwStartType: DWORD,

-                      dwErrorControl: DWORD, lpBinaryPathName: LPCWSTR,

-                      lpLoadOrderGroup: LPCWSTR, lpdwTagId: LPDWORD,

-                      lpDependencies: LPCWSTR, lpServiceStartName: LPCWSTR,

-                      lpPassword: LPCWSTR): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "CreateServiceW".}

-  proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD,

-                              lpServices: LPENUM_SERVICE_STATUS,

-                              cbBufSize: DWORD, pcbBytesNeeded: LPDWORD,

-                              lpServicesReturned: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "EnumDependentServicesW".}

-  proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD,

-                           dwServiceState: DWORD,

-                           lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD,

-                           pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD,

-                           lpResumeHandle: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "EnumServicesStatusW".}

-  proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCWSTR,

-                          lpServiceName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameW".}

-  proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                              lpDisplayName: LPWSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameW".}

-  proc OpenSCManager*(lpMachineName: LPCWSTR, lpDatabaseName: LPCWSTR,

-                      dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "OpenSCManagerW".}

-  proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCWSTR,

-                    dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "OpenServiceW".}

-  proc QueryServiceConfig*(hService: SC_HANDLE,

-                           lpServiceConfig: LPQUERY_SERVICE_CONFIG,

-                           cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "QueryServiceConfigW".}

-  proc QueryServiceLockStatus*(hSCManager: SC_HANDLE,

-                               lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS,

-                               cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusW".}

-  proc RegisterServiceCtrlHandler*(lpServiceName: LPCWSTR,

-                                   lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerW".}

-  proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherW".}

-  proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD,

-                     lpServiceArgVectors: LPCWSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "StartServiceW".}

-  proc DragQueryFile*(para1: HDROP, para2: int, para3: LPCWSTR, para4: int): int{.

-      stdcall, dynlib: "shell32", importc: "DragQueryFileW".}

-  proc ExtractAssociatedIcon*(para1: HINST, para2: LPCWSTR, para3: LPWORD): HICON{.

-      stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconW".}

-  proc ExtractIcon*(para1: HINST, para2: LPCWSTR, para3: int): HICON{.stdcall,

-      dynlib: "shell32", importc: "ExtractIconW".}

-  proc FindExecutable*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR): HINST{.

-      stdcall, dynlib: "shell32", importc: "FindExecutableW".}

-  proc ShellAbout*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR, para4: HICON): int32{.

-      stdcall, dynlib: "shell32", importc: "ShellAboutW".}

-  proc ShellExecute*(para1: HWND, para2: LPCWSTR, para3: LPCWSTR,

-                     para4: LPCWSTR, para5: LPCWSTR, para6: int32): HINST{.

-      stdcall, dynlib: "shell32", importc: "ShellExecuteW".}

-  proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{.

-      stdcall, dynlib: "shell32", importc: "Shell_NotifyIconW".}

-  proc DdeCreateStringHandle*(para1: DWORD, para2: LPCWSTR, para3: int32): HSZ{.

-      stdcall, dynlib: "user32", importc: "DdeCreateStringHandleW".}

-  proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD,

-                      para4: DWORD): WINUINT{.stdcall, dynlib: "user32",

-      importc: "DdeInitializeW".}

-  proc DdeQueryString*(para1: DWORD, para2: HSZ, para3: LPCWSTR, para4: DWORD,

-                       para5: int32): DWORD{.stdcall, dynlib: "user32",

-      importc: "DdeQueryStringW".}

-  proc LogonUser*(para1: LPWSTR, para2: LPWSTR, para3: LPWSTR, para4: DWORD,

-                  para5: DWORD, para6: PHANDLE): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LogonUserW".}

-  proc CreateProcessAsUser*(para1: HANDLE, para2: LPCWSTR, para3: LPWSTR,

-                            para4: LPSECURITY_ATTRIBUTES,

-                            para5: LPSECURITY_ATTRIBUTES, para6: WINBOOL,

-                            para7: DWORD, para8: LPVOID, para9: LPCWSTR,

-                            para10: LPSTARTUPINFO, para11: LPPROCESS_INFORMATION): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "CreateProcessAsUserW".}

-else:

-  proc GetBinaryType*(lpApplicationName: LPCSTR, lpBinaryType: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".}

-  proc GetShortPathName*(lpszLongPath: LPCSTR, lpszShortPath: LPSTR,

-                         cchBuffer: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetShortPathNameA".}

-  proc GetEnvironmentStrings*(): LPSTR{.stdcall, dynlib: "kernel32",

-                                        importc: "GetEnvironmentStringsA".}

-  proc FreeEnvironmentStrings*(para1: LPSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "FreeEnvironmentStringsA".}

-  proc FormatMessage*(dwFlags: DWORD, lpSource: LPCVOID, dwMessageId: DWORD,

-                      dwLanguageId: DWORD, lpBuffer: LPSTR, nSize: DWORD,

-                      Arguments: va_list): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "FormatMessageA".}

-  proc CreateMailslot*(lpName: LPCSTR, nMaxMessageSize: DWORD,

-                       lReadTimeout: DWORD,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateMailslotA".}

-  proc lstrcmp*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall,

-      dynlib: "kernel32", importc: "lstrcmpA".}

-  proc lstrcmpi*(lpString1: LPCSTR, lpString2: LPCSTR): int32{.stdcall,

-      dynlib: "kernel32", importc: "lstrcmpiA".}

-  proc lstrcpyn*(lpString1: LPSTR, lpString2: LPCSTR, iMaxLength: int32): LPSTR{.

-      stdcall, dynlib: "kernel32", importc: "lstrcpynA".}

-  proc lstrcpy*(lpString1: LPSTR, lpString2: LPCSTR): LPSTR{.stdcall,

-      dynlib: "kernel32", importc: "lstrcpyA".}

-  proc lstrcat*(lpString1: LPSTR, lpString2: LPCSTR): LPSTR{.stdcall,

-      dynlib: "kernel32", importc: "lstrcatA".}

-  proc lstrlen*(lpString: LPCSTR): int32{.stdcall, dynlib: "kernel32",

-      importc: "lstrlenA".}

-  proc CreateMutex*(lpMutexAttributes: LPSECURITY_ATTRIBUTES,

-                    bInitialOwner: WINBOOL, lpName: LPCSTR): HANDLE{.stdcall,

-      dynlib: "kernel32", importc: "CreateMutexA".}

-  proc OpenMutex*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                  lpName: LPCSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenMutexA".}

-  proc CreateEvent*(lpEventAttributes: LPSECURITY_ATTRIBUTES,

-                    bManualReset: WINBOOL, bInitialState: WINBOOL,

-                    lpName: LPCSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "CreateEventA".}

-  proc OpenEvent*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                  lpName: LPCSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenEventA".}

-  proc CreateSemaphore*(lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES,

-                        lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateSemaphoreA".}

-  proc OpenSemaphore*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                      lpName: LPCSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenSemaphoreA".}

-  proc CreateFileMapping*(hFile: HANDLE,

-                          lpFileMappingAttributes: LPSECURITY_ATTRIBUTES,

-                          flProtect: DWORD, dwMaximumSizeHigh: DWORD,

-                          dwMaximumSizeLow: DWORD, lpName: LPCSTR): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateFileMappingA".}

-  proc OpenFileMapping*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                        lpName: LPCSTR): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "OpenFileMappingA".}

-  proc GetLogicalDriveStrings*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetLogicalDriveStringsA".}

-  proc LoadLibrary*(lpLibFileName: LPCSTR): HINST{.stdcall, dynlib: "kernel32",

-      importc: "LoadLibraryA".}

-  proc LoadLibraryEx*(lpLibFileName: LPCSTR, hFile: HANDLE, dwFlags: DWORD): HINST{.

-      stdcall, dynlib: "kernel32", importc: "LoadLibraryExA".}

-  proc GetModuleFileName*(hModule: HINST, lpFilename: LPSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetModuleFileNameA".}

-  proc GetModuleHandle*(lpModuleName: LPCSTR): HMODULE{.stdcall,

-      dynlib: "kernel32", importc: "GetModuleHandleA".}

-  proc FatalAppExit*(uAction: WINUINT, lpMessageText: LPCSTR){.stdcall,

-      dynlib: "kernel32", importc: "FatalAppExitA".}

-  proc GetCommandLine*(): LPSTR{.stdcall, dynlib: "kernel32",

-                                 importc: "GetCommandLineA".}

-  proc GetEnvironmentVariable*(lpName: LPCSTR, lpBuffer: LPSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetEnvironmentVariableA".}

-  proc SetEnvironmentVariable*(lpName: LPCSTR, lpValue: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableA".}

-  proc ExpandEnvironmentStrings*(lpSrc: LPCSTR, lpDst: LPSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "ExpandEnvironmentStringsA".}

-  proc OutputDebugString*(lpOutputString: LPCSTR){.stdcall, dynlib: "kernel32",

-      importc: "OutputDebugStringA".}

-  proc FindResource*(hModule: HINST, lpName: LPCSTR, lpType: LPCSTR): HRSRC{.

-      stdcall, dynlib: "kernel32", importc: "FindResourceA".}

-  proc FindResourceEx*(hModule: HINST, lpType: LPCSTR, lpName: LPCSTR,

-                       wLanguage: int16): HRSRC{.stdcall, dynlib: "kernel32",

-      importc: "FindResourceExA".}

-  proc EnumResourceTypes*(hModule: HINST, lpEnumFunc: ENUMRESTYPEPROC,

-                          lParam: LONG): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumResourceTypesA".}

-  proc EnumResourceNames*(hModule: HINST, lpType: LPCSTR,

-                          lpEnumFunc: ENUMRESNAMEPROC, lParam: LONG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumResourceNamesA".}

-  proc EnumResourceLanguages*(hModule: HINST, lpType: LPCSTR, lpName: LPCSTR,

-                              lpEnumFunc: ENUMRESLANGPROC, lParam: LONG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumResourceLanguagesA".}

-  proc BeginUpdateResource*(pFileName: LPCSTR, bDeleteExistingResources: WINBOOL): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "BeginUpdateResourceA".}

-  proc UpdateResource*(hUpdate: HANDLE, lpType: LPCSTR, lpName: LPCSTR,

-                       wLanguage: int16, lpData: LPVOID, cbData: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "UpdateResourceA".}

-  proc EndUpdateResource*(hUpdate: HANDLE, fDiscard: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EndUpdateResourceA".}

-  proc GlobalAddAtom*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "GlobalAddAtomA".}

-  proc GlobalFindAtom*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "GlobalFindAtomA".}

-  proc GlobalGetAtomName*(nAtom: ATOM, lpBuffer: LPSTR, nSize: int32): WINUINT{.

-      stdcall, dynlib: "kernel32", importc: "GlobalGetAtomNameA".}

-  proc AddAtom*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "AddAtomA".}

-  proc FindAtom*(lpString: LPCSTR): ATOM{.stdcall, dynlib: "kernel32",

-      importc: "FindAtomA".}

-  proc GetAtomName*(nAtom: ATOM, lpBuffer: LPSTR, nSize: int32): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetAtomNameA".}

-  proc GetProfileInt*(lpAppName: LPCSTR, lpKeyName: LPCSTR, nDefault: WINT): WINUINT{.

-      stdcall, dynlib: "kernel32", importc: "GetProfileIntA".}

-  proc GetProfileString*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                         lpDefault: LPCSTR, lpReturnedString: LPSTR,

-                         nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetProfileStringA".}

-  proc WriteProfileString*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                           lpString: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WriteProfileStringA".}

-  proc GetProfileSection*(lpAppName: LPCSTR, lpReturnedString: LPSTR,

-                          nSize: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-      importc: "GetProfileSectionA".}

-  proc WriteProfileSection*(lpAppName: LPCSTR, lpString: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteProfileSectionA".}

-  proc GetPrivateProfileInt*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                             nDefault: WINT, lpFileName: LPCSTR): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetPrivateProfileIntA".}

-  proc GetPrivateProfileString*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                                lpDefault: LPCSTR, lpReturnedString: LPSTR,

-                                nSize: DWORD, lpFileName: LPCSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringA".}

-  proc WritePrivateProfileString*(lpAppName: LPCSTR, lpKeyName: LPCSTR,

-                                  lpString: LPCSTR, lpFileName: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringA".}

-  proc GetPrivateProfileSection*(lpAppName: LPCSTR, lpReturnedString: LPSTR,

-                                 nSize: DWORD, lpFileName: LPCSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetPrivateProfileSectionA".}

-  proc WritePrivateProfileSection*(lpAppName: LPCSTR, lpString: LPCSTR,

-                                   lpFileName: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WritePrivateProfileSectionA".}

-  proc GetDriveType*(lpRootPathName: LPCSTR): WINUINT{.stdcall, dynlib: "kernel32",

-      importc: "GetDriveTypeA".}

-  proc GetSystemDirectory*(lpBuffer: LPSTR, uSize: WINUINT): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetSystemDirectoryA".}

-  proc GetTempPath*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetTempPathA".}

-  proc GetTempFileName*(lpPathName: LPCSTR, lpPrefixString: LPCSTR,

-                        uUnique: WINUINT, lpTempFileName: LPSTR): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetTempFileNameA".}

-  proc GetWindowsDirectory*(lpBuffer: LPSTR, uSize: WINUINT): WINUINT{.stdcall,

-      dynlib: "kernel32", importc: "GetWindowsDirectoryA".}

-  proc SetCurrentDirectory*(lpPathName: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetCurrentDirectoryA".}

-  proc GetCurrentDirectory*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetCurrentDirectoryA".}

-  proc GetDiskFreeSpace*(lpRootPathName: LPCSTR, lpSectorsPerCluster: LPDWORD,

-                         lpBytesPerSector: LPDWORD,

-                         lpNumberOfFreeClusters: LPDWORD,

-                         lpTotalNumberOfClusters: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetDiskFreeSpaceA".}

-  proc CreateDirectory*(lpPathName: LPCSTR,

-                        lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateDirectoryA".}

-  proc CreateDirectoryEx*(lpTemplateDirectory: LPCSTR, lpNewDirectory: LPCSTR,

-                          lpSecurityAttributes: LPSECURITY_ATTRIBUTES): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateDirectoryExA".}

-  proc RemoveDirectory*(lpPathName: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "RemoveDirectoryA".}

-  proc GetFullPathName*(lpFileName: LPCSTR, nBufferLength: DWORD,

-                        lpBuffer: LPSTR, lpFilePart: var LPSTR): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetFullPathNameA".}

-  proc DefineDosDevice*(dwFlags: DWORD, lpDeviceName: LPCSTR,

-                        lpTargetPath: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "DefineDosDeviceA".}

-  proc QueryDosDevice*(lpDeviceName: LPCSTR, lpTargetPath: LPSTR, ucchMax: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "QueryDosDeviceA".}

-  proc CreateFile*(lpFileName: LPCSTR, dwDesiredAccess: DWORD,

-                   dwShareMode: DWORD,

-                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                   dwCreationDisposition: DWORD, dwFlagsAndAttributes: DWORD,

-                   hTemplateFile: HANDLE): HANDLE{.stdcall, dynlib: "kernel32",

-      importc: "CreateFileA".}

-  proc SetFileAttributes*(lpFileName: LPCSTR, dwFileAttributes: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetFileAttributesA".}

-  proc GetFileAttributes*(lpFileName: LPCSTR): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetFileAttributesA".}

-  proc GetCompressedFileSize*(lpFileName: LPCSTR, lpFileSizeHigh: LPDWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "GetCompressedFileSizeA".}

-  proc DeleteFile*(lpFileName: LPCSTR): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "DeleteFileA".}

-  proc SearchPath*(lpPath: LPCSTR, lpFileName: LPCSTR, lpExtension: LPCSTR,

-                   nBufferLength: DWORD, lpBuffer: LPSTR, lpFilePart: LPSTR): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "SearchPathA".}

-  proc CopyFile*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR,

-                 bFailIfExists: WINBOOL): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "CopyFileA".}

-  proc MoveFile*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "MoveFileA".}

-  proc MoveFileEx*(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR,

-                   dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "MoveFileExA".}

-  proc CreateNamedPipe*(lpName: LPCSTR, dwOpenMode: DWORD, dwPipeMode: DWORD,

-                        nMaxInstances: DWORD, nOutBufferSize: DWORD,

-                        nInBufferSize: DWORD, nDefaultTimeOut: DWORD,

-                        lpSecurityAttributes: LPSECURITY_ATTRIBUTES): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "CreateNamedPipeA".}

-  proc GetNamedPipeHandleState*(hNamedPipe: HANDLE, lpState: LPDWORD,

-                                lpCurInstances: LPDWORD,

-                                lpMaxCollectionCount: LPDWORD,

-                                lpCollectDataTimeout: LPDWORD,

-                                lpUserName: LPSTR, nMaxUserNameSize: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "GetNamedPipeHandleStateA".}

-  proc CallNamedPipe*(lpNamedPipeName: LPCSTR, lpInBuffer: LPVOID,

-                      nInBufferSize: DWORD, lpOutBuffer: LPVOID,

-                      nOutBufferSize: DWORD, lpBytesRead: LPDWORD,

-                      nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "CallNamedPipeA".}

-  proc WaitNamedPipe*(lpNamedPipeName: LPCSTR, nTimeOut: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WaitNamedPipeA".}

-  proc SetVolumeLabel*(lpRootPathName: LPCSTR, lpVolumeName: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetVolumeLabelA".}

-  proc GetVolumeInformation*(lpRootPathName: LPCSTR, lpVolumeNameBuffer: LPSTR,

-                             nVolumeNameSize: DWORD,

-                             lpVolumeSerialNumber: LPDWORD,

-                             lpMaximumComponentLength: LPDWORD,

-                             lpFileSystemFlags: LPDWORD,

-                             lpFileSystemNameBuffer: LPSTR,

-                             nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetVolumeInformationA".}

-  proc ClearEventLog*(hEventLog: HANDLE, lpBackupFileName: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "ClearEventLogA".}

-  proc BackupEventLog*(hEventLog: HANDLE, lpBackupFileName: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "BackupEventLogA".}

-  proc OpenEventLog*(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "OpenEventLogA".}

-  proc RegisterEventSource*(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "RegisterEventSourceA".}

-  proc OpenBackupEventLog*(lpUNCServerName: LPCSTR, lpFileName: LPCSTR): HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "OpenBackupEventLogA".}

-  proc ReadEventLog*(hEventLog: HANDLE, dwReadFlags: DWORD,

-                     dwRecordOffset: DWORD, lpBuffer: LPVOID,

-                     nNumberOfBytesToRead: DWORD, pnBytesRead: LPDWORD,

-                     pnMinNumberOfBytesNeeded: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ReadEventLogA".}

-  proc ReportEvent*(hEventLog: HANDLE, wType: int16, wCategory: int16,

-                    dwEventID: DWORD, lpUserSid: PSID, wNumStrings: int16,

-                    dwDataSize: DWORD, lpStrings: LPPCSTR, lpRawData: LPVOID): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "ReportEventA".}

-  proc AccessCheckAndAuditAlarm*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                                 ObjectTypeName: LPSTR, ObjectName: LPSTR,

-                                 SecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 DesiredAccess: DWORD,

-                                 GenericMapping: PGENERIC_MAPPING,

-                                 ObjectCreation: WINBOOL,

-                                 GrantedAccess: LPDWORD, AccessStatus: LPBOOL,

-                                 pfGenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "AccessCheckAndAuditAlarmA".}

-  proc ObjectOpenAuditAlarm*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                             ObjectTypeName: LPSTR, ObjectName: LPSTR,

-                             pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                             ClientToken: HANDLE, DesiredAccess: DWORD,

-                             GrantedAccess: DWORD, Privileges: PPRIVILEGE_SET,

-                             ObjectCreation: WINBOOL, AccessGranted: WINBOOL,

-                             GenerateOnClose: LPBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-  proc ObjectPrivilegeAuditAlarm*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                                  ClientToken: HANDLE, DesiredAccess: DWORD,

-                                  Privileges: PPRIVILEGE_SET,

-                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-  proc ObjectCloseAuditAlarm*(SubsystemName: LPCSTR, HandleId: LPVOID,

-                              GenerateOnClose: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ObjectCloseAuditAlarmA".}

-  proc PrivilegedServiceAuditAlarm*(SubsystemName: LPCSTR, ServiceName: LPCSTR,

-                                    ClientToken: HANDLE,

-                                    Privileges: PPRIVILEGE_SET,

-                                    AccessGranted: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}

-  proc SetFileSecurity*(lpFileName: LPCSTR,

-                        SecurityInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "SetFileSecurityA".}

-  proc GetFileSecurity*(lpFileName: LPCSTR,

-                        RequestedInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                        nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetFileSecurityA".}

-  proc FindFirstChangeNotification*(lpPathName: LPCSTR, bWatchSubtree: WINBOOL,

-                                    dwNotifyFilter: DWORD): HANDLE{.stdcall,

-      dynlib: "kernel32", importc: "FindFirstChangeNotificationA".}

-  proc IsBadStringPtr*(lpsz: LPCSTR, ucchMax: WINUINT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "IsBadStringPtrA".}

-  proc LookupAccountSid*(lpSystemName: LPCSTR, Sid: PSID, Name: LPSTR,

-                         cbName: LPDWORD, ReferencedDomainName: LPSTR,

-                         cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupAccountSidA".}

-  proc LookupAccountName*(lpSystemName: LPCSTR, lpAccountName: LPCSTR,

-                          Sid: PSID, cbSid: LPDWORD,

-                          ReferencedDomainName: LPSTR,

-                          cbReferencedDomainName: LPDWORD, peUse: PSID_NAME_USE): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupAccountNameA".}

-  proc LookupPrivilegeValue*(lpSystemName: LPCSTR, lpName: LPCSTR, lpLuid: PLUID): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "LookupPrivilegeValueA".}

-  proc LookupPrivilegeName*(lpSystemName: LPCSTR, lpLuid: PLUID, lpName: LPSTR,

-                            cbName: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LookupPrivilegeNameA".}

-  proc LookupPrivilegeDisplayName*(lpSystemName: LPCSTR, lpName: LPCSTR,

-                                   lpDisplayName: LPSTR, cbDisplayName: LPDWORD,

-                                   lpLanguageId: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameA".}

-  proc BuildCommDCB*(lpDef: LPCSTR, lpDCB: LPDCB): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "BuildCommDCBA".}

-  proc BuildCommDCBAndTimeouts*(lpDef: LPCSTR, lpDCB: LPDCB,

-                                lpCommTimeouts: LPCOMMTIMEOUTS): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}

-  proc CommConfigDialog*(lpszName: LPCSTR, wnd: HWND, lpCC: LPCOMMCONFIG): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}

-  proc GetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG,

-                             lpdwSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetDefaultCommConfigA".}

-  proc SetDefaultCommConfig*(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetDefaultCommConfigA".}

-  proc GetComputerName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetComputerNameA".}

-  proc SetComputerName*(lpComputerName: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetComputerNameA".}

-  proc GetUserName*(lpBuffer: LPSTR, nSize: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "GetUserNameA".}

-  proc wvsprintf*(para1: LPSTR, para2: LPCSTR, arglist: va_list): int32{.

-      stdcall, dynlib: "user32", importc: "wvsprintfA".}

-  proc LoadKeyboardLayout*(pwszKLID: LPCSTR, Flags: WINUINT): HKL{.stdcall,

-      dynlib: "user32", importc: "LoadKeyboardLayoutA".}

-  proc GetKeyboardLayoutName*(pwszKLID: LPSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetKeyboardLayoutNameA".}

-  proc CreateDesktop*(lpszDesktop: LPSTR, lpszDevice: LPSTR,

-                      pDevmode: LPDEVMODE, dwFlags: DWORD,

-                      dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HDESK{.

-      stdcall, dynlib: "user32", importc: "CreateDesktopA".}

-  proc OpenDesktop*(lpszDesktop: LPSTR, dwFlags: DWORD, fInherit: WINBOOL,

-                    dwDesiredAccess: DWORD): HDESK{.stdcall, dynlib: "user32",

-      importc: "OpenDesktopA".}

-  proc EnumDesktops*(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROC,

-                     lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "EnumDesktopsA".}

-  proc CreateWindowStation*(lpwinsta: LPSTR, dwReserved: DWORD,

-                            dwDesiredAccess: DWORD, lpsa: LPSECURITY_ATTRIBUTES): HWINSTA{.

-      stdcall, dynlib: "user32", importc: "CreateWindowStationA".}

-  proc OpenWindowStation*(lpszWinSta: LPSTR, fInherit: WINBOOL,

-                          dwDesiredAccess: DWORD): HWINSTA{.stdcall,

-      dynlib: "user32", importc: "OpenWindowStationA".}

-  proc EnumWindowStations*(lpEnumFunc: ENUMWINDOWSTATIONPROC, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "EnumWindowStationsA".}

-  proc GetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                 nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-  proc SetUserObjectInformation*(hObj: HANDLE, nIndex: int32, pvInfo: PVOID,

-                                 nLength: DWORD): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetUserObjectInformationA".}

-  proc RegisterWindowMessage*(lpString: LPCSTR): WINUINT{.stdcall,

-      dynlib: "user32", importc: "RegisterWindowMessageA".}

-  proc GetMessage*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                   wMsgFilterMax: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "GetMessageA".}

-  proc DispatchMessage*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",

-      importc: "DispatchMessageA".}

-  proc PeekMessage*(lpMsg: LPMSG, wnd: HWND, wMsgFilterMin: WINUINT,

-                    wMsgFilterMax: WINUINT, wRemoveMsg: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "PeekMessageA".}

-  proc SendMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "SendMessageA".}

-  proc SendMessageTimeout*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                           lp: LPARAM, fuFlags: WINUINT, uTimeout: WINUINT,

-                           lpdwResult: LPDWORD): LRESULT{.stdcall,

-      dynlib: "user32", importc: "SendMessageTimeoutA".}

-  proc SendNotifyMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "SendNotifyMessageA".}

-  proc SendMessageCallback*(wnd: HWND, Msg: WINUINT, wp: WPARAM,

-                            lp: LPARAM, lpResultCallBack: SENDASYNCPROC,

-                            dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "SendMessageCallbackA".}

-  proc PostMessage*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "PostMessageA".}

-  proc PostThreadMessage*(idThread: DWORD, Msg: WINUINT, wp: WPARAM,

-                          lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "PostThreadMessageA".}

-  proc DefWindowProc*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefWindowProcA".}

-  proc CallWindowProc*(lpPrevWndFunc: WNDPROC, wnd: HWND, Msg: WINUINT,

-                       wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-      dynlib: "user32", importc: "CallWindowProcA".}

-  proc RegisterClass*(lpWndClass: LPWNDCLASS): ATOM{.stdcall, dynlib: "user32",

-      importc: "RegisterClassA".}

-  proc UnregisterClass*(lpClassName: LPCSTR, hInstance: HINST): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "UnregisterClassA".}

-  proc GetClassInfo*(hInstance: HINST, lpClassName: LPCSTR,

-                     lpWndClass: LPWNDCLASS): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetClassInfoA".}

-  proc RegisterClassEx*(para1: LPWNDCLASSEX): ATOM{.stdcall, dynlib: "user32",

-      importc: "RegisterClassExA".}

-  proc GetClassInfoEx*(para1: HINST, para2: LPCSTR, para3: LPWNDCLASSEX): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "GetClassInfoExA".}

-  proc CreateWindowEx*(dwExStyle: DWORD, lpClassName: LPCSTR,

-                       lpWindowName: LPCSTR, dwStyle: DWORD, X: int32, Y: int32,

-                       nWidth: int32, nHeight: int32, hWndParent: HWND,

-                       menu: HMENU, hInstance: HINST, lpParam: LPVOID): HWND{.

-      stdcall, dynlib: "user32", importc: "CreateWindowExA".}

-  proc CreateDialogParam*(hInstance: HINST, lpTemplateName: LPCSTR,

-                          hWndParent: HWND, lpDialogFunc: DLGPROC,

-                          dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32",

-      importc: "CreateDialogParamA".}

-  proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-

-                                  hWndParent: HWND, lpDialogFunc: DLGPROC,

-                                  dwInitParam: LPARAM): HWND{.stdcall,

-      dynlib: "user32", importc: "CreateDialogIndirectParamA".}

-  proc DialogBoxParam*(hInstance: HINST, lpTemplateName: LPCSTR,

-                       hWndParent: HWND, lpDialogFunc: DLGPROC,

-                       dwInitParam: LPARAM): int32{.stdcall, dynlib: "user32",

-      importc: "DialogBoxParamA".}

-  proc DialogBoxIndirectParam*(hInstance: HINST,

-                               hDialogTemplate: LPCDLGTEMPLATE,

-                               hWndParent: HWND, lpDialogFunc: DLGPROC,

-                               dwInitParam: LPARAM): int32{.stdcall,

-      dynlib: "user32", importc: "DialogBoxIndirectParamA".}

-  proc SetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "SetDlgItemTextA".}

-  proc GetDlgItemText*(hDlg: HWND, nIDDlgItem: int32, lpString: LPSTR,

-                       nMaxCount: int32): WINUINT{.stdcall, dynlib: "user32",

-      importc: "GetDlgItemTextA".}

-  proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: WINUINT,

-                           wp: WPARAM, lp: LPARAM): LONG{.stdcall,

-      dynlib: "user32", importc: "SendDlgItemMessageA".}

-  proc DefDlgProc*(hDlg: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefDlgProcA".}

-  proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "CallMsgFilterA".}

-  proc RegisterClipboardFormat*(lpszFormat: LPCSTR): WINUINT{.stdcall,

-      dynlib: "user32", importc: "RegisterClipboardFormatA".}

-  proc GetClipboardFormatName*(format: WINUINT, lpszFormatName: LPSTR,

-                               cchMaxCount: int32): int32{.stdcall,

-      dynlib: "user32", importc: "GetClipboardFormatNameA".}

-  proc CharToOem*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "CharToOemA".}

-  proc OemToChar*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "OemToCharA".}

-  proc CharToOemBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "CharToOemBuffA".}

-  proc OemToCharBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "OemToCharBuffA".}

-  proc CharUpper*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                       importc: "CharUpperA".}

-  proc CharUpperBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-      dynlib: "user32", importc: "CharUpperBuffA".}

-  proc CharLower*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                       importc: "CharLowerA".}

-  proc CharLowerBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-      dynlib: "user32", importc: "CharLowerBuffA".}

-  proc CharNext*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32",

-                                       importc: "CharNextA".}

-  proc CharPrev*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall,

-      dynlib: "user32", importc: "CharPrevA".}

-  proc IsCharAlpha*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharAlphaA".}

-  proc IsCharAlphaNumeric*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "IsCharAlphaNumericA".}

-  proc IsCharUpper*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharUpperA".}

-  proc IsCharLower*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "IsCharLowerA".}

-  proc GetKeyNameText*(lParam: LONG, lpString: LPSTR, nSize: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetKeyNameTextA".}

-  proc VkKeyScan*(ch: char): SHORT{.stdcall, dynlib: "user32",

-                                    importc: "VkKeyScanA".}

-  proc VkKeyScanEx*(ch: char, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

-      importc: "VkKeyScanExA".}

-  proc MapVirtualKey*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

-      dynlib: "user32", importc: "MapVirtualKeyA".}

-  proc MapVirtualKeyEx*(uCode: WINUINT, uMapType: WINUINT, dwhkl: HKL): WINUINT{.stdcall,

-      dynlib: "user32", importc: "MapVirtualKeyExA".}

-  proc LoadAccelerators*(hInstance: HINST, lpTableName: LPCSTR): HACCEL{.

-      stdcall, dynlib: "user32", importc: "LoadAcceleratorsA".}

-  proc CreateAcceleratorTable*(para1: LPACCEL, para2: int32): HACCEL{.stdcall,

-      dynlib: "user32", importc: "CreateAcceleratorTableA".}

-  proc CopyAcceleratorTable*(hAccelSrc: HACCEL, lpAccelDst: LPACCEL,

-                             cAccelEntries: int32): int32{.stdcall,

-      dynlib: "user32", importc: "CopyAcceleratorTableA".}

-  proc TranslateAccelerator*(wnd: HWND, hAccTable: HACCEL, lpMsg: LPMSG): int32{.

-      stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}

-  proc LoadMenu*(hInstance: HINST, lpMenuName: LPCSTR): HMENU{.stdcall,

-      dynlib: "user32", importc: "LoadMenuA".}

-  proc LoadMenuIndirect*(lpMenuTemplate: LPMENUTEMPLATE): HMENU{.stdcall,

-      dynlib: "user32", importc: "LoadMenuIndirectA".}

-  proc ChangeMenu*(menu: HMENU, cmd: WINUINT, lpszNewItem: LPCSTR,

-                   cmdInsert: WINUINT, flags: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "ChangeMenuA".}

-  proc GetMenuString*(menu: HMENU, uIDItem: WINUINT, lpString: LPSTR,

-                      nMaxCount: int32, uFlag: WINUINT): int32{.stdcall,

-      dynlib: "user32", importc: "GetMenuStringA".}

-  proc InsertMenu*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT,

-                   uIDNewItem: WINUINT, lpNewItem: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "InsertMenuA".}

-  proc AppendMenu*(menu: HMENU, uFlags: WINUINT, uIDNewItem: WINUINT,

-                   lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "AppendMenuA".}

-  proc ModifyMenu*(hMnu: HMENU, uPosition: WINUINT, uFlags: WINUINT, uIDNewItem: WINUINT,

-                   lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "ModifyMenuA".}

-  proc InsertMenuItem*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "InsertMenuItemA".}

-  proc GetMenuItemInfo*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                        para4: LPMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GetMenuItemInfoA".}

-  proc SetMenuItemInfo*(para1: HMENU, para2: WINUINT, para3: WINBOOL,

-                        para4: LPCMENUITEMINFO): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetMenuItemInfoA".}

-  proc DrawText*(hDC: HDC, lpString: LPCSTR, nCount: int32, lpRect: LPRECT,

-                 uFormat: WINUINT): int32{.stdcall, dynlib: "user32",

-                                        importc: "DrawTextA".}

-  proc DrawTextEx*(para1: HDC, para2: LPSTR, para3: int32, para4: LPRECT,

-                   para5: WINUINT, para6: LPDRAWTEXTPARAMS): int32{.stdcall,

-      dynlib: "user32", importc: "DrawTextExA".}

-  proc GrayString*(hDC: HDC, hBrush: HBRUSH, lpOutputFunc: GRAYSTRINGPROC,

-                   lpData: LPARAM, nCount: int32, X: int32, Y: int32,

-                   nWidth: int32, nHeight: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "GrayStringA".}

-  proc DrawState*(para1: HDC, para2: HBRUSH, para3: DRAWSTATEPROC,

-                  para4: LPARAM, para5: WPARAM, para6: int32, para7: int32,

-                  para8: int32, para9: int32, para10: WINUINT): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "DrawStateA".}

-  proc TabbedTextOut*(dc: HDC, X: int32, Y: int32, lpString: LPCSTR,

-                      nCount: int32, nTabPositions: int32,

-                      lpnTabStopPositions: LPINT, nTabOrigin: int32): LONG{.

-      stdcall, dynlib: "user32", importc: "TabbedTextOutA".}

-  proc GetTabbedTextExtent*(hDC: HDC, lpString: LPCSTR, nCount: int32,

-                            nTabPositions: int32, lpnTabStopPositions: LPINT): DWORD{.

-      stdcall, dynlib: "user32", importc: "GetTabbedTextExtentA".}

-  proc SetProp*(wnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetPropA".}

-  proc GetProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,

-      dynlib: "user32", importc: "GetPropA".}

-  proc RemoveProp*(wnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,

-      dynlib: "user32", importc: "RemovePropA".}

-  proc EnumPropsEx*(wnd: HWND, lpEnumFunc: PROPENUMPROCEX, lp: LPARAM): int32{.

-      stdcall, dynlib: "user32", importc: "EnumPropsExA".}

-  proc EnumProps*(wnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,

-      dynlib: "user32", importc: "EnumPropsA".}

-  proc SetWindowText*(wnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "SetWindowTextA".}

-  proc GetWindowText*(wnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetWindowTextA".}

-  proc GetWindowTextLength*(wnd: HWND): int32{.stdcall, dynlib: "user32",

-      importc: "GetWindowTextLengthA".}

-  proc MessageBox*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: WINUINT): int32{.

-      stdcall, dynlib: "user32", importc: "MessageBoxA".}

-  proc MessageBoxEx*(wnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: WINUINT,

-                     wLanguageId: int16): int32{.stdcall, dynlib: "user32",

-      importc: "MessageBoxExA".}

-  proc MessageBoxIndirect*(para1: LPMSGBOXPARAMS): int32{.stdcall,

-      dynlib: "user32", importc: "MessageBoxIndirectA".}

-  proc GetWindowLong*(wnd: HWND, nIndex: int32): LONG{.stdcall,

-      dynlib: "user32", importc: "GetWindowLongA".}

-  proc SetWindowLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.

-      stdcall, dynlib: "user32", importc: "SetWindowLongA".}

-  proc GetClassLong*(wnd: HWND, nIndex: int32): DWORD{.stdcall,

-      dynlib: "user32", importc: "GetClassLongA".}

-  proc SetClassLong*(wnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.

-      stdcall, dynlib: "user32", importc: "SetClassLongA".}

-  when defined(cpu64):

-    proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetWindowLongPtrA".}

-    proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".}

-    proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetClassLongPtrA".}

-    proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetClassLongPtrA".}

-  else:

-    proc GetWindowLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetWindowLongA".}

-    proc SetWindowLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetWindowLongA".}

-    proc GetClassLongPtr*(wnd: HWND, nIndex: int32): LONG_PTR{.stdcall,

-        dynlib: "user32", importc: "GetClassLongA".}

-    proc SetClassLongPtr*(wnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.

-        stdcall, dynlib: "user32", importc: "SetClassLongA".}

-  proc FindWindow*(lpClassName: LPCSTR, lpWindowName: LPCSTR): HWND{.stdcall,

-      dynlib: "user32", importc: "FindWindowA".}

-  proc FindWindowEx*(para1: HWND, para2: HWND, para3: LPCSTR, para4: LPCSTR): HWND{.

-      stdcall, dynlib: "user32", importc: "FindWindowExA".}

-  proc GetClassName*(wnd: HWND, lpClassName: LPSTR, nMaxCount: int32): int32{.

-      stdcall, dynlib: "user32", importc: "GetClassNameA".}

-  proc SetWindowsHookEx*(idHook: int32, lpfn: HOOKPROC, hmod: HINST,

-                         dwThreadId: DWORD): HHOOK{.stdcall, dynlib: "user32",

-      importc: "SetWindowsHookExA".}

-  proc LoadBitmap*(hInstance: HINST, lpBitmapName: LPCSTR): HBITMAP{.stdcall,

-      dynlib: "user32", importc: "LoadBitmapA".}

-  proc LoadCursor*(hInstance: HINST, lpCursorName: LPCSTR): HCURSOR{.stdcall,

-      dynlib: "user32", importc: "LoadCursorA".}

-  proc LoadCursorFromFile*(lpFileName: LPCSTR): HCURSOR{.stdcall,

-      dynlib: "user32", importc: "LoadCursorFromFileA".}

-  proc LoadIcon*(hInstance: HINST, lpIconName: LPCSTR): HICON{.stdcall,

-      dynlib: "user32", importc: "LoadIconA".}

-  proc LoadImage*(para1: HINST, para2: LPCSTR, para3: WINUINT, para4: int32,

-                  para5: int32, para6: WINUINT): HANDLE{.stdcall, dynlib: "user32",

-      importc: "LoadImageA".}

-  proc LoadString*(hInstance: HINST, uID: WINUINT, lpBuffer: LPSTR,

-                   nBufferMax: int32): int32{.stdcall, dynlib: "user32",

-      importc: "LoadStringA".}

-  proc IsDialogMessage*(hDlg: HWND, lpMsg: LPMSG): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "IsDialogMessageA".}

-  proc DlgDirList*(hDlg: HWND, lpPathSpec: LPSTR, nIDListBox: int32,

-                   nIDStaticPath: int32, uFileType: WINUINT): int32{.stdcall,

-      dynlib: "user32", importc: "DlgDirListA".}

-  proc DlgDirSelectEx*(hDlg: HWND, lpString: LPSTR, nCount: int32,

-                       nIDListBox: int32): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "DlgDirSelectExA".}

-  proc DlgDirListComboBox*(hDlg: HWND, lpPathSpec: LPSTR, nIDComboBox: int32,

-                           nIDStaticPath: int32, uFiletype: WINUINT): int32{.

-      stdcall, dynlib: "user32", importc: "DlgDirListComboBoxA".}

-  proc DlgDirSelectComboBoxEx*(hDlg: HWND, lpString: LPSTR, nCount: int32,

-                               nIDComboBox: int32): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "DlgDirSelectComboBoxExA".}

-  proc DefFrameProc*(wnd: HWND, hWndMDIClient: HWND, uMsg: WINUINT,

-                     wp: WPARAM, lp: LPARAM): LRESULT{.stdcall,

-      dynlib: "user32", importc: "DefFrameProcA".}

-  proc DefMDIChildProc*(wnd: HWND, uMsg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT{.

-      stdcall, dynlib: "user32", importc: "DefMDIChildProcA".}

-  proc CreateMDIWindow*(lpClassName: LPSTR, lpWindowName: LPSTR, dwStyle: DWORD,

-                        X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                        hWndParent: HWND, hInstance: HINST, lp: LPARAM): HWND{.

-      stdcall, dynlib: "user32", importc: "CreateMDIWindowA".}

-  proc WinHelp*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: WINUINT, dwData: DWORD): WINBOOL{.

-      stdcall, dynlib: "user32", importc: "WinHelpA".}

-  proc ChangeDisplaySettings*(lpDevMode: LPDEVMODE, dwFlags: DWORD): LONG{.

-      stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}

-  proc EnumDisplaySettings*(lpszDeviceName: LPCSTR, iModeNum: DWORD,

-                            lpDevMode: LPDEVMODE): WINBOOL{.stdcall,

-      dynlib: "user32", importc: "EnumDisplaySettingsA".}

-  proc SystemParametersInfo*(uiAction: WINUINT, uiParam: WINUINT, pvParam: PVOID,

-                             fWinIni: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-      importc: "SystemParametersInfoA".}

-  proc AddFontResource*(para1: LPCSTR): int32{.stdcall, dynlib: "gdi32",

-      importc: "AddFontResourceA".}

-  proc CopyMetaFile*(para1: HMETAFILE, para2: LPCSTR): HMETAFILE{.stdcall,

-      dynlib: "gdi32", importc: "CopyMetaFileA".}

-  proc CreateFont*(para1: int32, para2: int32, para3: int32, para4: int32,

-                   para5: int32, para6: DWORD, para7: DWORD, para8: DWORD,

-                   para9: DWORD, para10: DWORD, para11: DWORD, para12: DWORD,

-                   para13: DWORD, para14: LPCSTR): HFONT{.stdcall,

-      dynlib: "gdi32", importc: "CreateFontA".}

-  proc CreateFontIndirect*(para1: LPLOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-      importc: "CreateFontIndirectA".}

-  proc CreateFontIndirect*(para1: var LOGFONT): HFONT{.stdcall, dynlib: "gdi32",

-      importc: "CreateFontIndirectA".}

-  proc CreateIC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: LPDEVMODE): HDC{.

-      stdcall, dynlib: "gdi32", importc: "CreateICA".}

-  proc CreateMetaFile*(para1: LPCSTR): HDC{.stdcall, dynlib: "gdi32",

-      importc: "CreateMetaFileA".}

-  proc CreateScalableFontResource*(para1: DWORD, para2: LPCSTR, para3: LPCSTR,

-                                   para4: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "CreateScalableFontResourceA".}

-  proc EnumFontFamiliesEx*(para1: HDC, para2: LPLOGFONT, para3: FONTENUMEXPROC,

-                           para4: LPARAM, para5: DWORD): int32{.stdcall,

-      dynlib: "gdi32", importc: "EnumFontFamiliesExA".}

-  proc EnumFontFamilies*(para1: HDC, para2: LPCSTR, para3: FONTENUMPROC,

-                         para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-      importc: "EnumFontFamiliesA".}

-  proc EnumFonts*(para1: HDC, para2: LPCSTR, para3: ENUMFONTSPROC, para4: LPARAM): int32{.

-      stdcall, dynlib: "gdi32", importc: "EnumFontsA".}

-  proc EnumFonts*(para1: HDC, para2: LPCSTR, para3: ENUMFONTSPROC,

-                  para4: pointer): int32{.stdcall, dynlib: "gdi32",

-      importc: "EnumFontsA".}

-  proc GetCharWidth*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidthA".}

-  proc GetCharWidth32*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidth32A".}

-  proc GetCharWidthFloat*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: ptr float32): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}

-  proc GetCharABCWidths*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: LPABC): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}

-  proc GetCharABCWidthsFloat*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                              para4: LPABCFLOAT): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}

-  proc GetGlyphOutline*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                        para4: LPGLYPHMETRICS, para5: DWORD, para6: LPVOID,

-                        para7: PMAT2): DWORD{.stdcall, dynlib: "gdi32",

-      importc: "GetGlyphOutlineA".}

-  proc GetMetaFile*(para1: LPCSTR): HMETAFILE{.stdcall, dynlib: "gdi32",

-      importc: "GetMetaFileA".}

-  proc GetOutlineTextMetrics*(para1: HDC, para2: WINUINT,

-                              para3: LPOUTLINETEXTMETRIC): WINUINT{.stdcall,

-      dynlib: "gdi32", importc: "GetOutlineTextMetricsA".}

-  proc GetTextExtentPoint*(para1: HDC, para2: LPCSTR, para3: int32,

-                           para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentPointA".}

-  proc GetTextExtentPoint32*(para1: HDC, para2: LPCSTR, para3: int32,

-                             para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentPoint32A".}

-  proc GetTextExtentExPoint*(para1: HDC, para2: LPCSTR, para3: int32,

-                             para4: int32, para5: LPINT, para6: LPINT,

-                             para7: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetTextExtentExPointA".}

-  proc GetCharacterPlacement*(para1: HDC, para2: LPCSTR, para3: int32,

-                              para4: int32, para5: LPGCP_RESULTS, para6: DWORD): DWORD{.

-      stdcall, dynlib: "gdi32", importc: "GetCharacterPlacementA".}

-  proc ResetDC*(para1: HDC, para2: LPDEVMODE): HDC{.stdcall, dynlib: "gdi32",

-      importc: "ResetDCA".}

-  proc RemoveFontResource*(para1: LPCSTR): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "RemoveFontResourceA".}

-  proc CopyEnhMetaFile*(para1: HENHMETAFILE, para2: LPCSTR): HENHMETAFILE{.

-      stdcall, dynlib: "gdi32", importc: "CopyEnhMetaFileA".}

-  proc CreateEnhMetaFile*(para1: HDC, para2: LPCSTR, para3: LPRECT,

-                          para4: LPCSTR): HDC{.stdcall, dynlib: "gdi32",

-      importc: "CreateEnhMetaFileA".}

-  proc GetEnhMetaFile*(para1: LPCSTR): HENHMETAFILE{.stdcall, dynlib: "gdi32",

-      importc: "GetEnhMetaFileA".}

-  proc GetEnhMetaFileDescription*(para1: HENHMETAFILE, para2: WINUINT, para3: LPSTR): WINUINT{.

-      stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileDescriptionA".}

-  proc GetTextMetrics*(para1: HDC, para2: LPTEXTMETRIC): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "GetTextMetricsA".}

-  proc StartDoc*(para1: HDC, para2: PDOCINFO): int32{.stdcall, dynlib: "gdi32",

-      importc: "StartDocA".}

-  proc GetObject*(para1: HGDIOBJ, para2: int32, para3: LPVOID): int32{.stdcall,

-      dynlib: "gdi32", importc: "GetObjectA".}

-  proc TextOut*(para1: HDC, para2: int32, para3: int32, para4: LPCSTR,

-                para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "TextOutA".}

-  proc ExtTextOut*(para1: HDC, para2: int32, para3: int32, para4: WINUINT,

-                   para5: LPRECT, para6: LPCSTR, para7: WINUINT, para8: LPINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "ExtTextOutA".}

-  proc PolyTextOut*(para1: HDC, para2: PPOLYTEXT, para3: int32): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "PolyTextOutA".}

-  proc GetTextFace*(para1: HDC, para2: int32, para3: LPSTR): int32{.stdcall,

-      dynlib: "gdi32", importc: "GetTextFaceA".}

-  proc GetKerningPairs*(para1: HDC, para2: DWORD, para3: LPKERNINGPAIR): DWORD{.

-      stdcall, dynlib: "gdi32", importc: "GetKerningPairsA".}

-  proc CreateColorSpace*(para1: LPLOGCOLORSPACE): HCOLORSPACE{.stdcall,

-      dynlib: "gdi32", importc: "CreateColorSpaceA".}

-  proc GetLogColorSpace*(para1: HCOLORSPACE, para2: LPLOGCOLORSPACE,

-                         para3: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

-      importc: "GetLogColorSpaceA".}

-  proc GetICMProfile*(para1: HDC, para2: DWORD, para3: LPSTR): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "GetICMProfileA".}

-  proc SetICMProfile*(para1: HDC, para2: LPSTR): WINBOOL{.stdcall,

-      dynlib: "gdi32", importc: "SetICMProfileA".}

-  proc UpdateICMRegKey*(para1: DWORD, para2: DWORD, para3: LPSTR, para4: WINUINT): WINBOOL{.

-      stdcall, dynlib: "gdi32", importc: "UpdateICMRegKeyA".}

-  proc EnumICMProfiles*(para1: HDC, para2: ICMENUMPROC, para3: LPARAM): int32{.

-      stdcall, dynlib: "gdi32", importc: "EnumICMProfilesA".}

-  proc PropertySheet*(lppsph: LPCPROPSHEETHEADER): int32{.stdcall,

-      dynlib: "comctl32", importc: "PropertySheetA".}

-  proc ImageList_LoadImage*(hi: HINST, lpbmp: LPCSTR, cx: int32, cGrow: int32,

-                            crMask: COLORREF, uType: WINUINT, uFlags: WINUINT): HIMAGELIST{.

-      stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageA".}

-  proc CreateStatusWindow*(style: LONG, lpszText: LPCSTR, hwndParent: HWND,

-                           wID: WINUINT): HWND{.stdcall, dynlib: "comctl32",

-      importc: "CreateStatusWindowA".}

-  proc DrawStatusText*(hDC: HDC, lprc: LPRECT, pszText: LPCSTR, uFlags: WINUINT){.

-      stdcall, dynlib: "comctl32", importc: "DrawStatusTextA".}

-  proc GetOpenFileName*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "GetOpenFileNameA".}

-  proc GetSaveFileName*(para1: LPOPENFILENAME): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "GetSaveFileNameA".}

-  proc GetFileTitle*(para1: LPCSTR, para2: LPSTR, para3: int16): int{.stdcall,

-      dynlib: "comdlg32", importc: "GetFileTitleA".}

-  proc ChooseColor*(para1: LPCHOOSECOLOR): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "ChooseColorA".}

-  proc FindText*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-      importc: "FindTextA".}

-  proc ReplaceText*(para1: LPFINDREPLACE): HWND{.stdcall, dynlib: "comdlg32",

-      importc: "ReplaceTextA".}

-  proc ChooseFont*(para1: LPCHOOSEFONT): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "ChooseFontA".}

-  proc PrintDlg*(para1: LPPRINTDLG): WINBOOL{.stdcall, dynlib: "comdlg32",

-      importc: "PrintDlgA".}

-  proc PageSetupDlg*(para1: LPPAGESETUPDLG): WINBOOL{.stdcall,

-      dynlib: "comdlg32", importc: "PageSetupDlgA".}

-  proc CreateProcess*(lpApplicationName: LPCSTR, lpCommandLine: LPSTR,

-                      lpProcessAttributes: LPSECURITY_ATTRIBUTES,

-                      lpThreadAttributes: LPSECURITY_ATTRIBUTES,

-                      bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                      lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR,

-                      lpStartupInfo: LPSTARTUPINFO,

-                      lpProcessInformation: LPPROCESS_INFORMATION): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

-  proc GetStartupInfo*(lpStartupInfo: LPSTARTUPINFO){.stdcall,

-      dynlib: "kernel32", importc: "GetStartupInfoA".}

-  proc FindFirstFile*(lpFileName: LPCSTR, lpFindFileData: LPWIN32_FIND_DATA): HANDLE{.

-      stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}

-  proc FindNextFile*(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATA): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

-  proc GetVersionEx*(VersionInformation: LPOSVERSIONINFO): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetVersionExA".}

-  proc CreateWindow*(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD,

-                     X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                     hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                     lpParam: LPVOID): HWND

-  proc CreateDialog*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                     lpDialogFunc: DLGPROC): HWND

-  proc CreateDialogIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                             hWndParent: HWND, lpDialogFunc: DLGPROC): HWND

-  proc DialogBox*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                  lpDialogFunc: DLGPROC): int32

-  proc DialogBoxIndirect*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                          hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-  proc CreateDC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: PDEVMODE): HDC{.

-      stdcall, dynlib: "gdi32", importc: "CreateDCA".}

-  proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPSTR,

-                       szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR,

-                       szCurDir: LPSTR, szTmpFile: LPSTR, lpuTmpFileLen: PUINT): DWORD{.

-      stdcall, dynlib: "version", importc: "VerInstallFileA".}

-  proc GetFileVersionInfoSize*(lptstrFilename: LPSTR, lpdwHandle: LPDWORD): DWORD{.

-      stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".}

-  proc GetFileVersionInfo*(lptstrFilename: LPSTR, dwHandle: DWORD, dwLen: DWORD,

-                           lpData: LPVOID): WINBOOL{.stdcall, dynlib: "version",

-      importc: "GetFileVersionInfoA".}

-  proc VerLanguageName*(wLang: DWORD, szLang: LPSTR, nSize: DWORD): DWORD{.

-      stdcall, dynlib: "kernel32", importc: "VerLanguageNameA".}

-  proc VerQueryValue*(pBlock: LPVOID, lpSubBlock: LPSTR, lplpBuffer: LPVOID,

-                      puLen: PUINT): WINBOOL{.stdcall, dynlib: "version",

-      importc: "VerQueryValueA".}

-  proc VerFindFile*(uFlags: DWORD, szFileName: LPSTR, szWinDir: LPSTR,

-                    szAppDir: LPSTR, szCurDir: LPSTR, lpuCurDirLen: PUINT,

-                    szDestDir: LPSTR, lpuDestDirLen: PUINT): DWORD{.stdcall,

-      dynlib: "version", importc: "VerFindFileA".}

-  proc RegConnectRegistry*(lpMachineName: LPSTR, key: HKEY, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}

-  proc RegCreateKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}

-  proc RegCreateKeyEx*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD,

-                       lpClass: LPSTR, dwOptions: DWORD, samDesired: REGSAM,

-                       lpSecurityAttributes: LPSECURITY_ATTRIBUTES,

-                       phkResult: PHKEY, lpdwDisposition: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".}

-  proc RegDeleteKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegDeleteKeyA".}

-  proc RegDeleteValue*(key: HKEY, lpValueName: LPCSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegDeleteValueA".}

-  proc RegEnumKey*(key: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".}

-  proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: LPSTR,

-                     lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR,

-                     lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

-  proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: LPSTR,

-                     lpcbValueName: LPDWORD, lpReserved: LPDWORD,

-                     lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

-  proc RegLoadKey*(key: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegLoadKeyA".}

-  proc RegOpenKey*(key: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}

-  proc RegOpenKeyEx*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,

-                     samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegOpenKeyExA".}

-  proc RegQueryInfoKey*(key: HKEY, lpClass: LPSTR, lpcbClass: LPDWORD,

-                        lpReserved: LPDWORD, lpcSubKeys: LPDWORD,

-                        lpcbMaxSubKeyLen: LPDWORD, lpcbMaxClassLen: LPDWORD,

-                        lpcValues: LPDWORD, lpcbMaxValueNameLen: LPDWORD,

-                        lpcbMaxValueLen: LPDWORD,

-                        lpcbSecurityDescriptor: LPDWORD,

-                        lpftLastWriteTime: PFILETIME): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegQueryInfoKeyA".}

-  proc RegQueryValue*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR,

-                      lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",

-      importc: "RegQueryValueA".}

-  proc RegQueryMultipleValues*(key: HKEY, val_list: PVALENT, num_vals: DWORD,

-                               lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}

-  proc RegQueryValueEx*(key: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD,

-                        lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".}

-  proc RegReplaceKey*(key: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR,

-                      lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32",

-      importc: "RegReplaceKeyA".}

-  proc RegRestoreKey*(key: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegRestoreKeyA".}

-  proc RegSaveKey*(key: HKEY, lpFile: LPCSTR,

-                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegSaveKeyA".}

-  proc RegSetValue*(key: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR,

-                    cbData: DWORD): LONG{.stdcall, dynlib: "advapi32",

-      importc: "RegSetValueA".}

-  proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD,

-                      dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.

-      stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}

-  proc RegUnLoadKey*(key: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,

-      dynlib: "advapi32", importc: "RegUnLoadKeyA".}

-  proc InitiateSystemShutdown*(lpMachineName: LPSTR, lpMessage: LPSTR,

-                               dwTimeout: DWORD, bForceAppsClosed: WINBOOL,

-                               bRebootAfterShutdown: WINBOOL): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "InitiateSystemShutdownA".}

-  proc AbortSystemShutdown*(lpMachineName: LPSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "AbortSystemShutdownA".}

-  proc CompareString*(Locale: LCID, dwCmpFlags: DWORD, lpString1: LPCSTR,

-                      cchCount1: int32, lpString2: LPCSTR, cchCount2: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "CompareStringA".}

-  proc LCMapString*(Locale: LCID, dwMapFlags: DWORD, lpSrcStr: LPCSTR,

-                    cchSrc: int32, lpDestStr: LPSTR, cchDest: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "LCMapStringA".}

-  proc GetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPSTR,

-                      cchData: int32): int32{.stdcall, dynlib: "kernel32",

-      importc: "GetLocaleInfoA".}

-  proc SetLocaleInfo*(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "SetLocaleInfoA".}

-  proc GetTimeFormat*(Locale: LCID, dwFlags: DWORD, lpTime: LPSYSTEMTIME,

-                      lpFormat: LPCSTR, lpTimeStr: LPSTR, cchTime: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "GetTimeFormatA".}

-  proc GetDateFormat*(Locale: LCID, dwFlags: DWORD, lpDate: LPSYSTEMTIME,

-                      lpFormat: LPCSTR, lpDateStr: LPSTR, cchDate: int32): int32{.

-      stdcall, dynlib: "kernel32", importc: "GetDateFormatA".}

-  proc GetNumberFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR,

-                        lpFormat: PNUMBERFMT, lpNumberStr: LPSTR,

-                        cchNumber: int32): int32{.stdcall, dynlib: "kernel32",

-      importc: "GetNumberFormatA".}

-  proc GetCurrencyFormat*(Locale: LCID, dwFlags: DWORD, lpValue: LPCSTR,

-                          lpFormat: PCURRENCYFMT, lpCurrencyStr: LPSTR,

-                          cchCurrency: int32): int32{.stdcall,

-      dynlib: "kernel32", importc: "GetCurrencyFormatA".}

-  proc EnumCalendarInfo*(lpCalInfoEnumProc: CALINFO_ENUMPROC, Locale: LCID,

-                         Calendar: CALID, CalType: CALTYPE): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EnumCalendarInfoA".}

-  proc EnumTimeFormats*(lpTimeFmtEnumProc: TIMEFMT_ENUMPROC, Locale: LCID,

-                        dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumTimeFormatsA".}

-  proc EnumDateFormats*(lpDateFmtEnumProc: DATEFMT_ENUMPROC, Locale: LCID,

-                        dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "EnumDateFormatsA".}

-  proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                        cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetStringTypeExA".}

-  proc GetStringType*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                      cchSrc: int32, lpCharType: LPWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "GetStringTypeA".}

-  proc FoldString*(dwMapFlags: DWORD, lpSrcStr: LPCSTR, cchSrc: int32,

-                   lpDestStr: LPSTR, cchDest: int32): int32{.stdcall,

-      dynlib: "kernel32", importc: "FoldStringA".}

-  proc EnumSystemLocales*(lpLocaleEnumProc: LOCALE_ENUMPROC, dwFlags: DWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "EnumSystemLocalesA".}

-  proc EnumSystemCodePages*(lpCodePageEnumProc: CODEPAGE_ENUMPROC,

-                            dwFlags: DWORD): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "EnumSystemCodePagesA".}

-  proc PeekConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}

-  proc ReadConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                         nLength: DWORD, lpNumberOfEventsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}

-  proc WriteConsoleInput*(hConsoleInput: HANDLE, lpBuffer: PINPUTRECORD,

-                          nLength: DWORD, lpNumberOfEventsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}

-  proc ReadConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                          dwBufferSize: COORD, dwBufferCoord: COORD,

-                          lpReadRegion: PSMALL_RECT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-  proc WriteConsoleOutput*(hConsoleOutput: HANDLE, lpBuffer: PCHAR_INFO,

-                           dwBufferSize: COORD, dwBufferCoord: COORD,

-                           lpWriteRegion: PSMALL_RECT): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-  proc ReadConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPSTR,

-                                   nLength: DWORD, dwReadCoord: COORD,

-                                   lpNumberOfCharsRead: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}

-  proc WriteConsoleOutputCharacter*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR,

-                                    nLength: DWORD, dwWriteCoord: COORD,

-                                    lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-  proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: char,

-                                   nLength: DWORD, dwWriteCoord: COORD,

-                                   lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

-  proc ScrollConsoleScreenBuffer*(hConsoleOutput: HANDLE,

-                                  lpScrollRectangle: PSMALL_RECT,

-                                  lpClipRectangle: PSMALL_RECT,

-                                  dwDestinationOrigin: COORD, lpFill: PCHAR_INFO): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}

-  proc GetConsoleTitle*(lpConsoleTitle: LPSTR, nSize: DWORD): DWORD{.stdcall,

-      dynlib: "kernel32", importc: "GetConsoleTitleA".}

-  proc SetConsoleTitle*(lpConsoleTitle: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "kernel32", importc: "SetConsoleTitleA".}

-  proc ReadConsole*(hConsoleInput: HANDLE, lpBuffer: LPVOID,

-                    nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD,

-                    lpReserved: LPVOID): WINBOOL{.stdcall, dynlib: "kernel32",

-      importc: "ReadConsoleA".}

-  proc WriteConsole*(hConsoleOutput: HANDLE, lpBuffer: pointer,

-                     nNumberOfCharsToWrite: DWORD,

-                     lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID): WINBOOL{.

-      stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

-  proc WNetAddConnection*(lpRemoteName: LPCSTR, lpPassword: LPCSTR,

-                          lpLocalName: LPCSTR): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetAddConnectionA".}

-  proc WNetAddConnection2*(lpNetResource: LPNETRESOURCE, lpPassword: LPCSTR,

-                           lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetAddConnection2A".}

-  proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                           lpPassword: LPCSTR, lpUserName: LPCSTR,

-                           dwFlags: DWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetAddConnection3A".}

-  proc WNetCancelConnection*(lpName: LPCSTR, fForce: WINBOOL): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetCancelConnectionA".}

-  proc WNetCancelConnection2*(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetCancelConnection2A".}

-  proc WNetGetConnection*(lpLocalName: LPCSTR, lpRemoteName: LPSTR,

-                          lpnLength: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetGetConnectionA".}

-  proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: LPNETRESOURCE,

-                          lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD,

-                          lpAccessName: LPSTR, lpBufferSize: LPDWORD,

-                          lpResult: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetUseConnectionA".}

-  proc WNetSetConnection*(lpName: LPCSTR, dwProperties: DWORD, pvValues: LPVOID): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetSetConnectionA".}

-  proc WNetConnectionDialog1*(lpConnDlgStruct: LPCONNECTDLGSTRUCT): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}

-  proc WNetDisconnectDialog1*(lpConnDlgStruct: LPDISCDLGSTRUCT): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetDisconnectDialog1A".}

-  proc WNetOpenEnum*(dwScope: DWORD, dwType: DWORD, dwUsage: DWORD,

-                     lpNetResource: LPNETRESOURCE, lphEnum: LPHANDLE): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".}

-  proc WNetEnumResource*(hEnum: HANDLE, lpcCount: LPDWORD, lpBuffer: LPVOID,

-                         lpBufferSize: LPDWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetEnumResourceA".}

-  proc WNetGetUniversalName*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD,

-                             lpBuffer: LPVOID, lpBufferSize: LPDWORD): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

-  proc WNetGetUser*(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetUserA".}

-  proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: LPSTR,

-                            lpBufferSize: LPDWORD): DWORD{.stdcall,

-      dynlib: "mpr", importc: "WNetGetProviderNameA".}

-  proc WNetGetNetworkInformation*(lpProvider: LPCSTR,

-                                  lpNetInfoStruct: LPNETINFOSTRUCT): DWORD{.

-      stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}

-  proc WNetGetLastError*(lpError: LPDWORD, lpErrorBuf: LPSTR,

-                         nErrorBufSize: DWORD, lpNameBuf: LPSTR,

-                         nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-      importc: "WNetGetLastErrorA".}

-  proc MultinetGetConnectionPerformance*(lpNetResource: LPNETRESOURCE,

-      lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT): DWORD{.stdcall,

-      dynlib: "mpr", importc: "MultinetGetConnectionPerformanceA".}

-  proc ChangeServiceConfig*(hService: SC_HANDLE, dwServiceType: DWORD,

-                            dwStartType: DWORD, dwErrorControl: DWORD,

-                            lpBinaryPathName: LPCSTR, lpLoadOrderGroup: LPCSTR,

-                            lpdwTagId: LPDWORD, lpDependencies: LPCSTR,

-                            lpServiceStartName: LPCSTR, lpPassword: LPCSTR,

-                            lpDisplayName: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "ChangeServiceConfigA".}

-  proc CreateService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                      lpDisplayName: LPCSTR, dwDesiredAccess: DWORD,

-                      dwServiceType: DWORD, dwStartType: DWORD,

-                      dwErrorControl: DWORD, lpBinaryPathName: LPCSTR,

-                      lpLoadOrderGroup: LPCSTR, lpdwTagId: LPDWORD,

-                      lpDependencies: LPCSTR, lpServiceStartName: LPCSTR,

-                      lpPassword: LPCSTR): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "CreateServiceA".}

-  proc EnumDependentServices*(hService: SC_HANDLE, dwServiceState: DWORD,

-                              lpServices: LPENUM_SERVICE_STATUS,

-                              cbBufSize: DWORD, pcbBytesNeeded: LPDWORD,

-                              lpServicesReturned: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "EnumDependentServicesA".}

-  proc EnumServicesStatus*(hSCManager: SC_HANDLE, dwServiceType: DWORD,

-                           dwServiceState: DWORD,

-                           lpServices: LPENUM_SERVICE_STATUS, cbBufSize: DWORD,

-                           pcbBytesNeeded: LPDWORD, lpServicesReturned: LPDWORD,

-                           lpResumeHandle: LPDWORD): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "EnumServicesStatusA".}

-  proc GetServiceKeyName*(hSCManager: SC_HANDLE, lpDisplayName: LPCSTR,

-                          lpServiceName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetServiceKeyNameA".}

-  proc GetServiceDisplayName*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                              lpDisplayName: LPSTR, lpcchBuffer: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "GetServiceDisplayNameA".}

-  proc OpenSCManager*(lpMachineName: LPCSTR, lpDatabaseName: LPCSTR,

-                      dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "OpenSCManagerA".}

-  proc OpenService*(hSCManager: SC_HANDLE, lpServiceName: LPCSTR,

-                    dwDesiredAccess: DWORD): SC_HANDLE{.stdcall,

-      dynlib: "advapi32", importc: "OpenServiceA".}

-  proc QueryServiceConfig*(hService: SC_HANDLE,

-                           lpServiceConfig: LPQUERY_SERVICE_CONFIG,

-                           cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "QueryServiceConfigA".}

-  proc QueryServiceLockStatus*(hSCManager: SC_HANDLE,

-                               lpLockStatus: LPQUERY_SERVICE_LOCK_STATUS,

-                               cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "QueryServiceLockStatusA".}

-  proc RegisterServiceCtrlHandler*(lpServiceName: LPCSTR,

-                                   lpHandlerProc: LPHANDLER_FUNCTION): SERVICE_STATUS_HANDLE{.

-      stdcall, dynlib: "advapi32", importc: "RegisterServiceCtrlHandlerA".}

-  proc StartServiceCtrlDispatcher*(lpServiceStartTable: LPSERVICE_TABLE_ENTRY): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "StartServiceCtrlDispatcherA".}

-  proc StartService*(hService: SC_HANDLE, dwNumServiceArgs: DWORD,

-                     lpServiceArgVectors: LPCSTR): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "StartServiceA".}

-  proc DragQueryFile*(para1: HDROP, para2: int, para3: cstring, para4: int): int{.

-      stdcall, dynlib: "shell32", importc: "DragQueryFileA".}

-  proc ExtractAssociatedIcon*(para1: HINST, para2: cstring, para3: LPWORD): HICON{.

-      stdcall, dynlib: "shell32", importc: "ExtractAssociatedIconA".}

-  proc ExtractIcon*(para1: HINST, para2: cstring, para3: int): HICON{.stdcall,

-      dynlib: "shell32", importc: "ExtractIconA".}

-  proc FindExecutable*(para1: cstring, para2: cstring, para3: cstring): HINST{.

-      stdcall, dynlib: "shell32", importc: "FindExecutableA".}

-  proc ShellAbout*(para1: HWND, para2: cstring, para3: cstring, para4: HICON): int32{.

-      stdcall, dynlib: "shell32", importc: "ShellAboutA".}

-  proc ShellExecute*(para1: HWND, para2: cstring, para3: cstring,

-                     para4: cstring, para5: cstring, para6: int32): HINST{.

-      stdcall, dynlib: "shell32", importc: "ShellExecuteA".}

-  proc Shell_NotifyIcon*(dwMessage: DWORD, lpData: PNotifyIconDataA): WINBOOL{.

-      stdcall, dynlib: "shell32", importc: "Shell_NotifyIconA".}

-  proc DdeCreateStringHandle*(para1: DWORD, para2: cstring, para3: int32): HSZ{.

-      stdcall, dynlib: "user32", importc: "DdeCreateStringHandleA".}

-  proc DdeInitialize*(para1: LPDWORD, para2: PFNCALLBACK, para3: DWORD,

-                      para4: DWORD): WINUINT{.stdcall, dynlib: "user32",

-      importc: "DdeInitializeA".}

-  proc DdeQueryString*(para1: DWORD, para2: HSZ, para3: cstring, para4: DWORD,

-                       para5: int32): DWORD{.stdcall, dynlib: "user32",

-      importc: "DdeQueryStringA".}

-  proc LogonUser*(para1: LPSTR, para2: LPSTR, para3: LPSTR, para4: DWORD,

-                  para5: DWORD, para6: PHANDLE): WINBOOL{.stdcall,

-      dynlib: "advapi32", importc: "LogonUserA".}

-  proc CreateProcessAsUser*(para1: HANDLE, para2: LPCTSTR, para3: LPTSTR,

-                            para4: LPSECURITY_ATTRIBUTES,

-                            para5: LPSECURITY_ATTRIBUTES, para6: WINBOOL,

-                            para7: DWORD, para8: LPVOID, para9: LPCTSTR,

-                            para10: LPSTARTUPINFO, para11: LPPROCESS_INFORMATION): WINBOOL{.

-      stdcall, dynlib: "advapi32", importc: "CreateProcessAsUserA".}

-proc GetRandomRgn*(aHDC: HDC, aHRGN: HRGN, iNum: WINT): WINT{.stdcall,

-     importc, dynlib: "gdi32".}

-

-proc AccessCheck*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                  ClientToken: HANDLE, DesiredAccess: DWORD,

-                  GenericMapping: PGENERIC_MAPPING,

-                  PrivilegeSet: PPRIVILEGE_SET, PrivilegeSetLength: LPDWORD,

-                  GrantedAccess: LPDWORD, AccessStatus: LPBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AccessCheck".}

-proc FreeResource*(hResData: HGLOBAL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "FreeResource".}

-proc LockResource*(hResData: HGLOBAL): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "LockResource".}

-proc FreeLibrary*(hLibModule: HINST): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "FreeLibrary".}

-proc FreeLibraryAndExitThread*(hLibModule: HMODULE, dwExitCode: DWORD){.stdcall,

-    dynlib: "kernel32", importc: "FreeLibraryAndExitThread".}

-proc DisableThreadLibraryCalls*(hLibModule: HMODULE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DisableThreadLibraryCalls".}

-proc GetProcAddress*(hModule: HINST, lpProcName: LPCSTR): FARPROC{.stdcall,

-    dynlib: "kernel32", importc: "GetProcAddress".}

-proc GetVersion*(): DWORD{.stdcall, dynlib: "kernel32", importc: "GetVersion".}

-proc GlobalAlloc*(uFlags: int32, dwBytes: SIZE_T): HGLOBAL{.stdcall,

-    dynlib: "kernel32", importc: "GlobalAlloc".}

-proc GlobalAlloc*(uFlags: int32, dwBytes: DWORD): HGLOBAL{.stdcall,

-    dynlib: "kernel32", importc: "GlobalAlloc", deprecated.}

-proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: SIZE_T, uFlags: int32): HGLOBAL{.

-    stdcall, dynlib: "kernel32", importc: "GlobalReAlloc".}

-proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: int32): HGLOBAL{.

-    stdcall, dynlib: "kernel32", importc: "GlobalReAlloc", deprecated.}

-proc GlobalSize*(hMem: HGLOBAL): SIZE_T{.stdcall, dynlib: "kernel32",

-                                        importc: "GlobalSize".}

-proc GlobalFlags*(hMem: HGLOBAL): WINUINT{.stdcall, dynlib: "kernel32",

-                                        importc: "GlobalFlags".}

-proc GlobalLock*(hMem: HGLOBAL): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "GlobalLock".}

-proc GlobalHandle*(pMem: LPCVOID): HGLOBAL{.stdcall, dynlib: "kernel32",

-    importc: "GlobalHandle".}

-proc GlobalUnlock*(hMem: HGLOBAL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GlobalUnlock".}

-proc GlobalFree*(hMem: HGLOBAL): HGLOBAL{.stdcall, dynlib: "kernel32",

-    importc: "GlobalFree".}

-proc GlobalCompact*(dwMinFree: DWORD): WINUINT{.stdcall, dynlib: "kernel32",

-    importc: "GlobalCompact".}

-proc GlobalFix*(hMem: HGLOBAL){.stdcall, dynlib: "kernel32",

-                                importc: "GlobalFix".}

-proc GlobalUnfix*(hMem: HGLOBAL){.stdcall, dynlib: "kernel32",

-                                  importc: "GlobalUnfix".}

-proc GlobalWire*(hMem: HGLOBAL): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "GlobalWire".}

-proc GlobalUnWire*(hMem: HGLOBAL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GlobalUnWire".}

-proc GlobalMemoryStatus*(lpBuffer: LPMEMORYSTATUS){.stdcall, dynlib: "kernel32",

-    importc: "GlobalMemoryStatus".}

-proc LocalAlloc*(uFlags: WINUINT, uBytes: SIZE_T): HLOCAL{.stdcall,

-    dynlib: "kernel32", importc: "LocalAlloc".}

-proc LocalAlloc*(uFlags: WINUINT, uBytes: DWORD): HLOCAL{.stdcall,

-    dynlib: "kernel32", importc: "LocalAlloc", deprecated.}

-proc LocalReAlloc*(hMem: HLOCAL, uBytes: SIZE_T, uFlags: WINUINT): HLOCAL{.stdcall,

-    dynlib: "kernel32", importc: "LocalReAlloc".}

-proc LocalReAlloc*(hMem: HLOCAL, uBytes: DWORD, uFlags: WINUINT): HLOCAL{.stdcall,

-    dynlib: "kernel32", importc: "LocalReAlloc", deprecated.}

-proc LocalLock*(hMem: HLOCAL): LPVOID{.stdcall, dynlib: "kernel32",

-                                       importc: "LocalLock".}

-proc LocalHandle*(pMem: LPCVOID): HLOCAL{.stdcall, dynlib: "kernel32",

-    importc: "LocalHandle".}

-proc LocalUnlock*(hMem: HLOCAL): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "LocalUnlock".}

-proc LocalSize*(hMem: HLOCAL): WINUINT{.stdcall, dynlib: "kernel32",

-                                     importc: "LocalSize".}

-proc LocalFlags*(hMem: HLOCAL): WINUINT{.stdcall, dynlib: "kernel32",

-                                      importc: "LocalFlags".}

-proc LocalFree*(hMem: HLOCAL): HLOCAL{.stdcall, dynlib: "kernel32",

-                                       importc: "LocalFree".}

-proc LocalShrink*(hMem: HLOCAL, cbNewSize: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "LocalShrink".}

-proc LocalCompact*(uMinFree: WINUINT): WINUINT{.stdcall, dynlib: "kernel32",

-    importc: "LocalCompact".}

-proc FlushInstructionCache*(hProcess: HANDLE, lpBaseAddress: LPCVOID,

-                            dwSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FlushInstructionCache".}

-proc VirtualAlloc*(lpAddress: LPVOID, dwSize: SIZE_T, flAllocationType: DWORD,

-                   flProtect: DWORD): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "VirtualAlloc".}

-proc VirtualAlloc*(lpAddress: LPVOID, dwSize: DWORD, flAllocationType: DWORD,

-                   flProtect: DWORD): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "VirtualAlloc", deprecated.}

-proc VirtualAllocEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: SIZE_T,

-                     flAllocationType: DWORD, flProtect: DWORD): LPVOID

-                     {.stdcall, dynlib: "kernel32", importc: "VirtualAllocEx".}

-proc VirtualAllocEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: DWORD,

-                     flAllocationType: DWORD, flProtect: DWORD): LPVOID

-                     {.stdcall, dynlib: "kernel32", importc: "VirtualAllocEx", 

-                       deprecated.}

-proc VirtualFree*(lpAddress: LPVOID, dwSize: SIZE_T, dwFreeType: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "VirtualFree".}

-proc VirtualFree*(lpAddress: LPVOID, dwSize: DWORD, dwFreeType: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "VirtualFree", deprecated.}

-proc VirtualFreeEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: SIZE_T,

-                    dwFreeType: DWORD): WINBOOL

-                    {.stdcall, dynlib: "kernel32", importc: "VirtualFree".}

-proc VirtualFreeEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: DWORD,

-                    dwFreeType: DWORD): WINBOOL

-                    {.stdcall, dynlib: "kernel32", importc: "VirtualFree".}

-proc VirtualProtect*(lpAddress: LPVOID, dwSize: SIZE_T, flNewProtect: DWORD,

-                     lpflOldProtect: PDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualProtect".}

-proc VirtualProtect*(lpAddress: LPVOID, dwSize: DWORD, flNewProtect: DWORD,

-                     lpflOldProtect: PDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualProtect", deprecated.}

-proc VirtualQuery*(lpAddress: LPCVOID, lpBuffer: PMEMORY_BASIC_INFORMATION,

-                   dwLength: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "VirtualQuery".}

-proc VirtualProtectEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: SIZE_T,

-                       flNewProtect: DWORD, lpflOldProtect: PDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "VirtualProtectEx".}

-proc VirtualProtectEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: DWORD,

-                       flNewProtect: DWORD, lpflOldProtect: PDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "VirtualProtectEx", deprecated.}

-proc VirtualQueryEx*(hProcess: HANDLE, lpAddress: LPCVOID,

-                     lpBuffer: PMEMORY_BASIC_INFORMATION, dwLength: SIZE_T): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "VirtualQueryEx".}

-proc VirtualQueryEx*(hProcess: HANDLE, lpAddress: LPCVOID,

-                     lpBuffer: PMEMORY_BASIC_INFORMATION, dwLength: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "VirtualQueryEx", deprecated.}

-proc HeapCreate*(flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "HeapCreate".}

-proc HeapCreate*(flOptions: DWORD, dwInitialSize: DWORD, dwMaximumSize: DWORD): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "HeapCreate", deprecated.}

-proc HeapDestroy*(hHeap: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "HeapDestroy".}

-proc HeapAlloc*(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T): LPVOID{.stdcall,

-    dynlib: "kernel32", importc: "HeapAlloc".}

-proc HeapAlloc*(hHeap: HANDLE, dwFlags: DWORD, dwBytes: DWORD): LPVOID{.stdcall,

-    dynlib: "kernel32", importc: "HeapAlloc", deprecated.}

-proc HeapReAlloc*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: SIZE_T): LPVOID{.

-    stdcall, dynlib: "kernel32", importc: "HeapReAlloc".}

-proc HeapReAlloc*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: DWORD): LPVOID{.

-    stdcall, dynlib: "kernel32", importc: "HeapReAlloc", deprecated.}

-proc HeapFree*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "HeapFree".}

-proc HeapSize*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID): SIZE_T{.stdcall,

-    dynlib: "kernel32", importc: "HeapSize".}

-proc HeapValidate*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "HeapValidate".}

-proc HeapCompact*(hHeap: HANDLE, dwFlags: DWORD): SIZE_T{.stdcall,

-    dynlib: "kernel32", importc: "HeapCompact".}

-proc GetProcessHeap*(): HANDLE{.stdcall, dynlib: "kernel32",

-                                importc: "GetProcessHeap".}

-proc GetProcessHeaps*(NumberOfHeaps: DWORD, ProcessHeaps: PHANDLE): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessHeaps".}

-proc HeapLock*(hHeap: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-                                        importc: "HeapLock".}

-proc HeapUnlock*(hHeap: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "HeapUnlock".}

-proc HeapWalk*(hHeap: HANDLE, lpEntry: LPPROCESS_HEAP_ENTRY): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "HeapWalk".}

-proc GetProcessAffinityMask*(hProcess: HANDLE, lpProcessAffinityMask: LPDWORD,

-                             lpSystemAffinityMask: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetProcessAffinityMask".}

-proc GetProcessTimes*(hProcess: HANDLE, lpCreationTime: LPFILETIME,

-                      lpExitTime: LPFILETIME, lpKernelTime: LPFILETIME,

-                      lpUserTime: LPFILETIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetProcessTimes".}

-proc GetProcessWorkingSetSize*(hProcess: HANDLE,

-                               lpMinimumWorkingSetSize: LPDWORD,

-                               lpMaximumWorkingSetSize: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessWorkingSetSize".}

-proc SetProcessWorkingSetSize*(hProcess: HANDLE, dwMinimumWorkingSetSize: DWORD,

-                               dwMaximumWorkingSetSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetProcessWorkingSetSize".}

-proc OpenProcess*(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                  dwProcessId: DWORD): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "OpenProcess".}

-proc GetCurrentProcess*(): HANDLE{.stdcall, dynlib: "kernel32",

-                                   importc: "GetCurrentProcess".}

-proc GetCurrentProcessId*(): DWORD{.stdcall, dynlib: "kernel32",

-                                    importc: "GetCurrentProcessId".}

-proc ExitProcess*(uExitCode: WINUINT){.stdcall, dynlib: "kernel32",

-                                    importc: "ExitProcess".}

-proc TerminateProcess*(hProcess: HANDLE, uExitCode: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TerminateProcess".}

-proc SetProcessAffinityMask*(hProcess: Handle, dwProcessAffinityMask: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetProcessAffinityMask".}

-proc GetExitCodeProcess*(hProcess: HANDLE, lpExitCode: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".}

-proc FatalExit*(ExitCode: int32){.stdcall, dynlib: "kernel32",

-                                  importc: "FatalExit".}

-proc RaiseException*(dwExceptionCode: DWORD, dwExceptionFlags: DWORD,

-                     nNumberOfArguments: DWORD, lpArguments: LPDWORD){.stdcall,

-    dynlib: "kernel32", importc: "RaiseException".}

-proc UnhandledExceptionFilter*(ExceptionInfo: lpemptyrecord): LONG{.stdcall,

-    dynlib: "kernel32", importc: "UnhandledExceptionFilter".}

-proc CreateRemoteThread*(hProcess: HANDLE,

-                         lpThreadAttributes: LPSECURITY_ATTRIBUTES,

-                         dwStackSize: DWORD,

-                         lpStartAddress: LPTHREAD_START_ROUTINE,

-                         lpParameter: LPVOID, dwCreationFlags: DWORD,

-                         lpThreadId: LPDWORD): HANDLE{.stdcall,

-    dynlib: "kernel32", importc: "CreateRemoteThread".}

-proc GetCurrentThread*(): HANDLE{.stdcall, dynlib: "kernel32",

-                                  importc: "GetCurrentThread".}

-proc GetCurrentThreadId*(): DWORD{.stdcall, dynlib: "kernel32",

-                                   importc: "GetCurrentThreadId".}

-proc SetThreadAffinityMask*(hThread: HANDLE, dwThreadAffinityMask: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "SetThreadAffinityMask".}

-proc SetThreadPriority*(hThread: HANDLE, nPriority: int32): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetThreadPriority".}

-proc GetThreadPriority*(hThread: HANDLE): int32{.stdcall, dynlib: "kernel32",

-    importc: "GetThreadPriority".}

-proc GetThreadTimes*(hThread: HANDLE, lpCreationTime: LPFILETIME,

-                     lpExitTime: LPFILETIME, lpKernelTime: LPFILETIME,

-                     lpUserTime: LPFILETIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetThreadTimes".}

-proc ExitThread*(dwExitCode: DWORD){.stdcall, dynlib: "kernel32",

-                                     importc: "ExitThread".}

-proc TerminateThread*(hThread: HANDLE, dwExitCode: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TerminateThread".}

-proc GetExitCodeThread*(hThread: HANDLE, lpExitCode: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetExitCodeThread".}

-proc GetThreadSelectorEntry*(hThread: HANDLE, dwSelector: DWORD,

-                             lpSelectorEntry: LPLDT_ENTRY): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetThreadSelectorEntry".}

-proc GetLastError*(): DWORD{.stdcall, dynlib: "kernel32",

-                             importc: "GetLastError".}

-proc SetLastError*(dwErrCode: DWORD){.stdcall, dynlib: "kernel32",

-                                      importc: "SetLastError".}

-proc CreateIoCompletionPort*(FileHandle: HANDLE, ExistingCompletionPort: HANDLE,

-                             CompletionKey: DWORD,

-                             NumberOfConcurrentThreads: DWORD): HANDLE{.stdcall,

-    dynlib: "kernel32", importc: "CreateIoCompletionPort".}

-proc SetErrorMode*(uMode: WINUINT): WINUINT{.stdcall, dynlib: "kernel32",

-                                       importc: "SetErrorMode".}

-proc ReadProcessMemory*(hProcess: HANDLE, lpBaseAddress: LPCVOID,

-                        lpBuffer: LPVOID, nSize: DWORD,

-                        lpNumberOfBytesRead: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadProcessMemory".}

-proc WriteProcessMemory*(hProcess: HANDLE, lpBaseAddress: LPVOID,

-                         lpBuffer: LPVOID, nSize: DWORD,

-                         lpNumberOfBytesWritten: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteProcessMemory".}

-proc GetThreadContext*(hThread: HANDLE, lpContext: LPCONTEXT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetThreadContext".}

-proc SuspendThread*(hThread: HANDLE): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "SuspendThread".}

-proc ResumeThread*(hThread: HANDLE): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "ResumeThread".}

-proc DebugBreak*(){.stdcall, dynlib: "kernel32", importc: "DebugBreak".}

-proc WaitForDebugEvent*(lpDebugEvent: LPDEBUG_EVENT, dwMilliseconds: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WaitForDebugEvent".}

-proc ContinueDebugEvent*(dwProcessId: DWORD, dwThreadId: DWORD,

-                         dwContinueStatus: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ContinueDebugEvent".}

-proc DebugActiveProcess*(dwProcessId: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DebugActiveProcess".}

-proc InitializeCriticalSection*(lpCriticalSection: LPCRITICAL_SECTION){.stdcall,

-    dynlib: "kernel32", importc: "InitializeCriticalSection".}

-proc EnterCriticalSection*(lpCriticalSection: LPCRITICAL_SECTION){.stdcall,

-    dynlib: "kernel32", importc: "EnterCriticalSection".}

-proc LeaveCriticalSection*(lpCriticalSection: LPCRITICAL_SECTION){.stdcall,

-    dynlib: "kernel32", importc: "LeaveCriticalSection".}

-proc DeleteCriticalSection*(lpCriticalSection: LPCRITICAL_SECTION){.stdcall,

-    dynlib: "kernel32", importc: "DeleteCriticalSection".}

-proc TryEnterCriticalSection*(lpCriticalSection: LPCRITICAL_SECTION): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "TryEnterCriticalSection".}

-proc SetEvent*(hEvent: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "SetEvent".}

-proc ResetEvent*(hEvent: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ResetEvent".}

-proc PulseEvent*(hEvent: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "PulseEvent".}

-proc ReleaseSemaphore*(hSemaphore: HANDLE, lReleaseCount: LONG,

-                       lpPreviousCount: LPLONG): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReleaseSemaphore".}

-proc ReleaseMutex*(hMutex: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReleaseMutex".}

-proc WaitForSingleObject*(hHandle: HANDLE, dwMilliseconds: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "WaitForSingleObject".}

-

-proc Sleep*(dwMilliseconds: DWORD){.stdcall, dynlib: "kernel32",

-                                    importc: "Sleep".}

-proc LoadResource*(hModule: HINST, hResInfo: HRSRC): HGLOBAL{.stdcall,

-    dynlib: "kernel32", importc: "LoadResource".}

-proc SizeofResource*(hModule: HINST, hResInfo: HRSRC): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "SizeofResource".}

-proc GlobalDeleteAtom*(nAtom: ATOM): ATOM{.stdcall, dynlib: "kernel32",

-    importc: "GlobalDeleteAtom".}

-proc InitAtomTable*(nSize: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "InitAtomTable".}

-proc DeleteAtom*(nAtom: ATOM): ATOM{.stdcall, dynlib: "kernel32",

-                                     importc: "DeleteAtom".}

-proc SetHandleCount*(uNumber: WINUINT): WINUINT{.stdcall, dynlib: "kernel32",

-    importc: "SetHandleCount".}

-proc GetLogicalDrives*(): DWORD{.stdcall, dynlib: "kernel32",

-                                 importc: "GetLogicalDrives".}

-proc LockFile*(hFile: HANDLE, dwFileOffsetLow: DWORD, dwFileOffsetHigh: DWORD,

-               nNumberOfBytesToLockLow: DWORD, nNumberOfBytesToLockHigh: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "LockFile".}

-proc UnlockFile*(hFile: HANDLE, dwFileOffsetLow: DWORD, dwFileOffsetHigh: DWORD,

-                 nNumberOfBytesToUnlockLow: DWORD,

-                 nNumberOfBytesToUnlockHigh: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "UnlockFile".}

-proc LockFileEx*(hFile: HANDLE, dwFlags: DWORD, dwReserved: DWORD,

-                 nNumberOfBytesToLockLow: DWORD,

-                 nNumberOfBytesToLockHigh: DWORD, lpOverlapped: LPOVERLAPPED): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "LockFileEx".}

-proc UnlockFileEx*(hFile: HANDLE, dwReserved: DWORD,

-                   nNumberOfBytesToUnlockLow: DWORD,

-                   nNumberOfBytesToUnlockHigh: DWORD, lpOverlapped: LPOVERLAPPED): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "UnlockFileEx".}

-proc GetFileInformationByHandle*(hFile: HANDLE, lpFileInformation: LPBY_HANDLE_FILE_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetFileInformationByHandle".}

-proc GetFileType*(hFile: HANDLE): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetFileType".}

-proc GetFileSize*(hFile: HANDLE, lpFileSizeHigh: LPDWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetFileSize".}

-proc GetStdHandle*(nStdHandle: DWORD): HANDLE{.stdcall, dynlib: "kernel32",

-    importc: "GetStdHandle".}

-proc SetStdHandle*(nStdHandle: DWORD, hHandle: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetStdHandle".}

-proc FlushFileBuffers*(hFile: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "FlushFileBuffers".}

-proc DeviceIoControl*(hDevice: HANDLE, dwIoControlCode: DWORD,

-                      lpInBuffer: LPVOID, nInBufferSize: DWORD,

-                      lpOutBuffer: LPVOID, nOutBufferSize: DWORD,

-                      lpBytesReturned: LPDWORD, lpOverlapped: LPOVERLAPPED): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "DeviceIoControl".}

-proc SetEndOfFile*(hFile: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "SetEndOfFile".}

-proc SetFilePointer*(hFile: HANDLE, lDistanceToMove: LONG,

-                     lpDistanceToMoveHigh: PLONG, dwMoveMethod: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "SetFilePointer".}

-proc FindClose*(hFindFile: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "FindClose".}

-proc GetFileTime*(hFile: HANDLE, lpCreationTime: LPFILETIME,

-                  lpLastAccessTime: LPFILETIME, lpLastWriteTime: LPFILETIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetFileTime".}

-proc SetFileTime*(hFile: HANDLE, lpCreationTime: LPFILETIME,

-                  lpLastAccessTime: LPFILETIME, lpLastWriteTime: LPFILETIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetFileTime".}

-proc CloseHandle*(hObject: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CloseHandle".}

-proc DuplicateHandle*(hSourceProcessHandle: HANDLE, hSourceHandle: HANDLE,

-                      hTargetProcessHandle: HANDLE, lpTargetHandle: LPHANDLE,

-                      dwDesiredAccess: DWORD, bInheritHandle: WINBOOL,

-                      dwOptions: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "DuplicateHandle".}

-proc GetHandleInformation*(hObject: HANDLE, lpdwFlags: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetHandleInformation".}

-proc SetHandleInformation*(hObject: HANDLE, dwMask: DWORD, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetHandleInformation".}

-proc LoadModule*(lpModuleName: LPCSTR, lpParameterBlock: LPVOID): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "LoadModule".}

-proc WinExec*(lpCmdLine: LPCSTR, uCmdShow: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "WinExec".}

-proc ClearCommBreak*(hFile: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ClearCommBreak".}

-proc ClearCommError*(hFile: HANDLE, lpErrors: LPDWORD, lpStat: LPCOMSTAT): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ClearCommError".}

-proc SetupComm*(hFile: HANDLE, dwInQueue: DWORD, dwOutQueue: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetupComm".}

-proc EscapeCommFunction*(hFile: HANDLE, dwFunc: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "EscapeCommFunction".}

-proc GetCommConfig*(hCommDev: HANDLE, lpCC: LPCOMMCONFIG, lpdwSize: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommConfig".}

-proc GetCommProperties*(hFile: HANDLE, lpCommProp: LPCOMMPROP): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommProperties".}

-proc GetCommModemStatus*(hFile: HANDLE, lpModemStat: PDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCommModemStatus".}

-proc GetCommState*(hFile: HANDLE, lpDCB: PDCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCommState".}

-proc GetCommTimeouts*(hFile: HANDLE, lpCommTimeouts: PCOMMTIMEOUTS): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommTimeouts".}

-proc PurgeComm*(hFile: HANDLE, dwFlags: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "PurgeComm".}

-proc SetCommBreak*(hFile: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "SetCommBreak".}

-proc SetCommConfig*(hCommDev: HANDLE, lpCC: LPCOMMCONFIG, dwSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetCommConfig".}

-proc SetCommMask*(hFile: HANDLE, dwEvtMask: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetCommMask".}

-proc SetCommState*(hFile: HANDLE, lpDCB: LPDCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetCommState".}

-proc SetCommTimeouts*(hFile: HANDLE, lpCommTimeouts: LPCOMMTIMEOUTS): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetCommTimeouts".}

-proc TransmitCommChar*(hFile: HANDLE, cChar: char): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TransmitCommChar".}

-proc WaitCommEvent*(hFile: HANDLE, lpEvtMask: LPDWORD,

-                    lpOverlapped: LPOVERLAPPED): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WaitCommEvent".}

-proc SetTapePosition*(hDevice: HANDLE, dwPositionMethod: DWORD,

-                      dwPartition: DWORD, dwOffsetLow: DWORD,

-                      dwOffsetHigh: DWORD, bImmediate: WINBOOL): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "SetTapePosition".}

-proc GetTapePosition*(hDevice: HANDLE, dwPositionType: DWORD,

-                      lpdwPartition: LPDWORD, lpdwOffsetLow: LPDWORD,

-                      lpdwOffsetHigh: LPDWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetTapePosition".}

-proc PrepareTape*(hDevice: HANDLE, dwOperation: DWORD, bImmediate: WINBOOL): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "PrepareTape".}

-proc EraseTape*(hDevice: HANDLE, dwEraseType: DWORD, bImmediate: WINBOOL): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "EraseTape".}

-proc CreateTapePartition*(hDevice: HANDLE, dwPartitionMethod: DWORD,

-                          dwCount: DWORD, dwSize: DWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "CreateTapePartition".}

-proc WriteTapemark*(hDevice: HANDLE, dwTapemarkType: DWORD,

-                    dwTapemarkCount: DWORD, bImmediate: WINBOOL): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "WriteTapemark".}

-proc GetTapeStatus*(hDevice: HANDLE): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetTapeStatus".}

-proc GetTapeParameters*(hDevice: HANDLE, dwOperation: DWORD, lpdwSize: LPDWORD,

-                        lpTapeInformation: LPVOID): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetTapeParameters".}

-proc SetTapeParameters*(hDevice: HANDLE, dwOperation: DWORD,

-                        lpTapeInformation: LPVOID): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "SetTapeParameters".}

-proc Beep*(dwFreq: DWORD, dwDuration: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "Beep".}

-proc MulDiv*(nNumber: int32, nNumerator: int32, nDenominator: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "MulDiv".}

-proc GetSystemTime*(lpSystemTime: LPSYSTEMTIME){.stdcall, dynlib: "kernel32",

-    importc: "GetSystemTime".}

-proc GetSystemTimeAsFileTime*(lpSystemTimeAsFileTime: LPFILETIME){.stdcall,

-    dynlib: "kernel32", importc: "GetSystemTimeAsFileTime".}

-proc SetSystemTime*(lpSystemTime: LPSYSTEMTIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetSystemTime".}

-proc GetLocalTime*(lpSystemTime: LPSYSTEMTIME){.stdcall, dynlib: "kernel32",

-    importc: "GetLocalTime".}

-proc SetLocalTime*(lpSystemTime: LPSYSTEMTIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetLocalTime".}

-proc GetSystemInfo*(lpSystemInfo: LPSYSTEM_INFO){.stdcall, dynlib: "kernel32",

-    importc: "GetSystemInfo".}

-proc SystemTimeToTzSpecificLocalTime*(lpTimeZoneInformation: LPTIME_ZONE_INFORMATION,

-                                      lpUniversalTime: LPSYSTEMTIME,

-                                      lpLocalTime: LPSYSTEMTIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SystemTimeToTzSpecificLocalTime".}

-proc GetTimeZoneInformation*(lpTimeZoneInformation: LPTIME_ZONE_INFORMATION): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetTimeZoneInformation".}

-proc SetTimeZoneInformation*(lpTimeZoneInformation: LPTIME_ZONE_INFORMATION): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetTimeZoneInformation".}

-proc SystemTimeToFileTime*(lpSystemTime: LPSYSTEMTIME, lpFileTime: LPFILETIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SystemTimeToFileTime".}

-proc FileTimeToLocalFileTime*(FileTime: LPFILETIME,

-                              lpLocalFileTime: LPFILETIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FileTimeToLocalFileTime".}

-proc LocalFileTimeToFileTime*(lpLocalFileTime: LPFILETIME,

-                              lpFileTime: LPFILETIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "LocalFileTimeToFileTime".}

-proc FileTimeToSystemTime*(lpFileTime: LPFILETIME, lpSystemTime: LPSYSTEMTIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FileTimeToSystemTime".}

-proc CompareFileTime*(lpFileTime1: LPFILETIME, lpFileTime2: LPFILETIME): LONG{.

-    stdcall, dynlib: "kernel32", importc: "CompareFileTime".}

-proc FileTimeToDosDateTime*(lpFileTime: LPFILETIME, lpFatDate: LPWORD,

-                            lpFatTime: LPWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FileTimeToDosDateTime".}

-proc DosDateTimeToFileTime*(wFatDate: int16, wFatTime: int16,

-                            lpFileTime: LPFILETIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DosDateTimeToFileTime".}

-proc GetTickCount*(): DWORD{.stdcall, dynlib: "kernel32",

-                             importc: "GetTickCount".}

-proc SetSystemTimeAdjustment*(dwTimeAdjustment: DWORD,

-                              bTimeAdjustmentDisabled: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetSystemTimeAdjustment".}

-proc GetSystemTimeAdjustment*(lpTimeAdjustment: PDWORD, lpTimeIncrement: PDWORD,

-                              lpTimeAdjustmentDisabled: PWINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetSystemTimeAdjustment".}

-proc CreatePipe*(hReadPipe: PHANDLE, hWritePipe: PHANDLE,

-                 lpPipeAttributes: LPSECURITY_ATTRIBUTES, nSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreatePipe".}

-proc ConnectNamedPipe*(hNamedPipe: HANDLE, lpOverlapped: LPOVERLAPPED): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ConnectNamedPipe".}

-proc DisconnectNamedPipe*(hNamedPipe: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "DisconnectNamedPipe".}

-proc SetNamedPipeHandleState*(hNamedPipe: HANDLE, lpMode: LPDWORD,

-                              lpMaxCollectionCount: LPDWORD,

-                              lpCollectDataTimeout: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetNamedPipeHandleState".}

-proc GetNamedPipeInfo*(hNamedPipe: HANDLE, lpFlags: LPDWORD,

-                       lpOutBufferSize: LPDWORD, lpInBufferSize: LPDWORD,

-                       lpMaxInstances: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetNamedPipeInfo".}

-proc PeekNamedPipe*(hNamedPipe: HANDLE, lpBuffer: LPVOID, nBufferSize: DWORD,

-                    lpBytesRead: LPDWORD, lpTotalBytesAvail: LPDWORD,

-                    lpBytesLeftThisMessage: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "PeekNamedPipe".}

-proc TransactNamedPipe*(hNamedPipe: HANDLE, lpInBuffer: LPVOID,

-                        nInBufferSize: DWORD, lpOutBuffer: LPVOID,

-                        nOutBufferSize: DWORD, lpBytesRead: LPDWORD,

-                        lpOverlapped: LPOVERLAPPED): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TransactNamedPipe".}

-proc GetMailslotInfo*(hMailslot: HANDLE, lpMaxMessageSize: LPDWORD,

-                      lpNextSize: LPDWORD, lpMessageCount: LPDWORD,

-                      lpReadTimeout: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetMailslotInfo".}

-proc SetMailslotInfo*(hMailslot: HANDLE, lReadTimeout: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetMailslotInfo".}

-proc MapViewOfFile*(hFileMappingObject: HANDLE, dwDesiredAccess: DWORD,

-                    dwFileOffsetHigh: DWORD, dwFileOffsetLow: DWORD,

-                    dwNumberOfBytesToMap: DWORD): LPVOID{.stdcall,

-    dynlib: "kernel32", importc: "MapViewOfFile".}

-proc FlushViewOfFile*(lpBaseAddress: LPCVOID, dwNumberOfBytesToFlush: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FlushViewOfFile".}

-proc UnmapViewOfFile*(lpBaseAddress: LPVOID): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "UnmapViewOfFile".}

-proc OpenFile*(lpFileName: LPCSTR, lpReOpenBuff: LPOFSTRUCT, uStyle: WINUINT): HFILE{.

-    stdcall, dynlib: "kernel32", importc: "OpenFile".}

-proc lopen*(lpPathName: LPCSTR, iReadWrite: int32): HFILE{.stdcall,

-    dynlib: "kernel32", importc: "_lopen".}

-proc lcreat*(lpPathName: LPCSTR, iAttribute: int32): HFILE{.stdcall,

-    dynlib: "kernel32", importc: "_lcreat".}

-proc lread*(hFile: HFILE, lpBuffer: LPVOID, uBytes: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "_lread".}

-proc lwrite*(hFile: HFILE, lpBuffer: LPCSTR, uBytes: WINUINT): WINUINT{.stdcall,

-    dynlib: "kernel32", importc: "_lwrite".}

-proc hread*(hFile: HFILE, lpBuffer: LPVOID, lBytes: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "_hread".}

-proc hwrite*(hFile: HFILE, lpBuffer: LPCSTR, lBytes: int32): int32{.stdcall,

-    dynlib: "kernel32", importc: "_hwrite".}

-proc lclose*(file: HFILE): HFILE{.stdcall, dynlib: "kernel32",

-                                   importc: "_lclose".}

-proc llseek*(file: HFILE, lOffset: LONG, iOrigin: int32): LONG{.stdcall,

-    dynlib: "kernel32", importc: "_llseek".}

-proc IsTextUnicode*(lpBuffer: LPVOID, cb: int32, lpi: LPINT): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "IsTextUnicode".}

-proc TlsAlloc*(): DWORD{.stdcall, dynlib: "kernel32", importc: "TlsAlloc".}

-proc TlsGetValue*(dwTlsIndex: DWORD): LPVOID{.stdcall, dynlib: "kernel32",

-    importc: "TlsGetValue".}

-proc TlsSetValue*(dwTlsIndex: DWORD, lpTlsValue: LPVOID): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TlsSetValue".}

-proc TlsFree*(dwTlsIndex: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "TlsFree".}

-proc SleepEx*(dwMilliseconds: DWORD, bAlertable: WINBOOL): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "SleepEx".}

-proc WaitForSingleObjectEx*(hHandle: HANDLE, dwMilliseconds: DWORD,

-                            bAlertable: WINBOOL): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "WaitForSingleObjectEx".}

-proc WaitForMultipleObjectsEx*(nCount: DWORD, lpHandles: LPHANDLE,

-                               bWaitAll: WINBOOL, dwMilliseconds: DWORD,

-                               bAlertable: WINBOOL): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "WaitForMultipleObjectsEx".}

-proc ReadFileEx*(hFile: HANDLE, lpBuffer: LPVOID, nNumberOfBytesToRead: DWORD,

-                 lpOverlapped: LPOVERLAPPED,

-                 lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadFileEx".}

-proc WriteFileEx*(hFile: HANDLE, lpBuffer: LPCVOID,

-                  nNumberOfBytesToWrite: DWORD, lpOverlapped: LPOVERLAPPED,

-                  lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteFileEx".}

-proc BackupRead*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToRead: DWORD,

-                 lpNumberOfBytesRead: LPDWORD, bAbort: WINBOOL,

-                 bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BackupRead".}

-proc BackupSeek*(hFile: HANDLE, dwLowBytesToSeek: DWORD,

-                 dwHighBytesToSeek: DWORD, lpdwLowByteSeeked: LPDWORD,

-                 lpdwHighByteSeeked: LPDWORD, lpContext: var LPVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BackupSeek".}

-proc BackupWrite*(hFile: HANDLE, lpBuffer: LPBYTE, nNumberOfBytesToWrite: DWORD,

-                  lpNumberOfBytesWritten: LPDWORD, bAbort: WINBOOL,

-                  bProcessSecurity: WINBOOL, lpContext: var LPVOID): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BackupWrite".}

-proc SetProcessShutdownParameters*(dwLevel: DWORD, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetProcessShutdownParameters".}

-proc GetProcessShutdownParameters*(lpdwLevel: LPDWORD, lpdwFlags: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessShutdownParameters".}

-proc SetFileApisToOEM*(){.stdcall, dynlib: "kernel32",

-                          importc: "SetFileApisToOEM".}

-proc SetFileApisToANSI*(){.stdcall, dynlib: "kernel32",

-                           importc: "SetFileApisToANSI".}

-proc AreFileApisANSI*(): WINBOOL{.stdcall, dynlib: "kernel32",

-                                  importc: "AreFileApisANSI".}

-proc CloseEventLog*(hEventLog: HANDLE): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "CloseEventLog".}

-proc DeregisterEventSource*(hEventLog: HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "DeregisterEventSource".}

-proc NotifyChangeEventLog*(hEventLog: HANDLE, hEvent: HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "NotifyChangeEventLog".}

-proc GetNumberOfEventLogRecords*(hEventLog: HANDLE, NumberOfRecords: PDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetNumberOfEventLogRecords".}

-proc GetOldestEventLogRecord*(hEventLog: HANDLE, OldestRecord: PDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetOldestEventLogRecord".}

-proc DuplicateToken*(ExistingTokenHandle: HANDLE,

-                     ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL,

-                     DuplicateTokenHandle: PHANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "DuplicateToken".}

-proc GetKernelObjectSecurity*(Handle: HANDLE,

-                              RequestedInformation: SECURITY_INFORMATION,

-                              pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                              nLength: DWORD, lpnLengthNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetKernelObjectSecurity".}

-proc ImpersonateNamedPipeClient*(hNamedPipe: HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ImpersonateNamedPipeClient".}

-proc ImpersonateLoggedOnUser*(hToken: HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ImpersonateLoggedOnUser".}

-proc ImpersonateSelf*(ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ImpersonateSelf".}

-proc RevertToSelf*(): WINBOOL{.stdcall, dynlib: "advapi32",

-                               importc: "RevertToSelf".}

-proc SetThreadToken*(Thread: PHANDLE, Token: HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetThreadToken".}

-proc OpenProcessToken*(ProcessHandle: HANDLE, DesiredAccess: DWORD,

-                       TokenHandle: PHANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "OpenProcessToken".}

-proc OpenThreadToken*(ThreadHandle: HANDLE, DesiredAccess: DWORD,

-                      OpenAsSelf: WINBOOL, TokenHandle: PHANDLE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "OpenThreadToken".}

-proc GetTokenInformation*(TokenHandle: HANDLE,

-                          TokenInformationClass: TOKEN_INFORMATION_CLASS,

-                          TokenInformation: LPVOID,

-                          TokenInformationLength: DWORD, ReturnLength: PDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetTokenInformation".}

-proc SetTokenInformation*(TokenHandle: HANDLE,

-                          TokenInformationClass: TOKEN_INFORMATION_CLASS,

-                          TokenInformation: LPVOID,

-                          TokenInformationLength: DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetTokenInformation".}

-proc AdjustTokenPrivileges*(TokenHandle: HANDLE, DisableAllPrivileges: WINBOOL,

-                            NewState: PTOKEN_PRIVILEGES, BufferLength: DWORD,

-                            PreviousState: PTOKEN_PRIVILEGES,

-                            ReturnLength: PDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AdjustTokenPrivileges".}

-proc AdjustTokenGroups*(TokenHandle: HANDLE, ResetToDefault: WINBOOL,

-                        NewState: PTOKEN_GROUPS, BufferLength: DWORD,

-                        PreviousState: PTOKEN_GROUPS, ReturnLength: PDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AdjustTokenGroups".}

-proc PrivilegeCheck*(ClientToken: HANDLE, RequiredPrivileges: PPRIVILEGE_SET,

-                     pfResult: LPBOOL): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "PrivilegeCheck".}

-proc IsValidSid*(pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32",

-                                       importc: "IsValidSid".}

-proc EqualSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "EqualSid".}

-proc EqualPrefixSid*(pSid1: PSID, pSid2: PSID): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "EqualPrefixSid".}

-proc GetSidLengthRequired*(nSubAuthorityCount: UCHAR): DWORD{.stdcall,

-    dynlib: "advapi32", importc: "GetSidLengthRequired".}

-proc AllocateAndInitializeSid*(pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY,

-                               nSubAuthorityCount: int8, nSubAuthority0: DWORD,

-                               nSubAuthority1: DWORD, nSubAuthority2: DWORD,

-                               nSubAuthority3: DWORD, nSubAuthority4: DWORD,

-                               nSubAuthority5: DWORD, nSubAuthority6: DWORD,

-                               nSubAuthority7: DWORD, pSid: var PSID): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AllocateAndInitializeSid".}

-proc FreeSid*(pSid: PSID): PVOID{.stdcall, dynlib: "advapi32",

-                                  importc: "FreeSid".}

-proc InitializeSid*(Sid: PSID, pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY,

-                    nSubAuthorityCount: int8): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "InitializeSid".}

-proc GetSidIdentifierAuthority*(pSid: PSID): PSID_IDENTIFIER_AUTHORITY{.stdcall,

-    dynlib: "advapi32", importc: "GetSidIdentifierAuthority".}

-proc GetSidSubAuthority*(pSid: PSID, nSubAuthority: DWORD): PDWORD{.stdcall,

-    dynlib: "advapi32", importc: "GetSidSubAuthority".}

-proc GetSidSubAuthorityCount*(pSid: PSID): PUCHAR{.stdcall, dynlib: "advapi32",

-    importc: "GetSidSubAuthorityCount".}

-proc GetLengthSid*(pSid: PSID): DWORD{.stdcall, dynlib: "advapi32",

-                                       importc: "GetLengthSid".}

-proc CopySid*(nDestinationSidLength: DWORD, pDestinationSid: PSID,

-              pSourceSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "CopySid".}

-proc AreAllAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AreAllAccessesGranted".}

-proc AreAnyAccessesGranted*(GrantedAccess: DWORD, DesiredAccess: DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "AreAnyAccessesGranted".}

-proc MapGenericMask*(AccessMask: PDWORD, GenericMapping: PGENERIC_MAPPING){.

-    stdcall, dynlib: "advapi32", importc: "MapGenericMask".}

-proc IsValidAcl*(pAcl: PACL): WINBOOL{.stdcall, dynlib: "advapi32",

-                                       importc: "IsValidAcl".}

-proc InitializeAcl*(pAcl: PACL, nAclLength: DWORD, dwAclRevision: DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "InitializeAcl".}

-proc GetAclInformation*(pAcl: PACL, pAclInformation: LPVOID,

-                        nAclInformationLength: DWORD,

-                        dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetAclInformation".}

-proc SetAclInformation*(pAcl: PACL, pAclInformation: LPVOID,

-                        nAclInformationLength: DWORD,

-                        dwAclInformationClass: ACL_INFORMATION_CLASS): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetAclInformation".}

-proc AddAce*(pAcl: PACL, dwAceRevision: DWORD, dwStartingAceIndex: DWORD,

-             pAceList: LPVOID, nAceListLength: DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AddAce".}

-proc DeleteAce*(pAcl: PACL, dwAceIndex: DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "DeleteAce".}

-proc GetAce*(pAcl: PACL, dwAceIndex: DWORD, pAce: var LPVOID): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetAce".}

-proc AddAccessAllowedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD,

-                          pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "AddAccessAllowedAce".}

-proc AddAccessDeniedAce*(pAcl: PACL, dwAceRevision: DWORD, AccessMask: DWORD,

-                         pSid: PSID): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "AddAccessDeniedAce".}

-proc AddAuditAccessAce*(pAcl: PACL, dwAceRevision: DWORD, dwAccessMask: DWORD,

-                        pSid: PSID, bAuditSuccess: WINBOOL,

-                        bAuditFailure: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AddAuditAccessAce".}

-proc FindFirstFreeAce*(pAcl: PACL, pAce: var LPVOID): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "FindFirstFreeAce".}

-proc InitializeSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                   dwRevision: DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "InitializeSecurityDescriptor".}

-proc IsValidSecurityDescriptor*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "IsValidSecurityDescriptor".}

-proc GetSecurityDescriptorLength*(pSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD{.

-    stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorLength".}

-proc GetSecurityDescriptorControl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                   pControl: PSECURITY_DESCRIPTOR_CONTROL,

-                                   lpdwRevision: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetSecurityDescriptorControl".}

-proc SetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                bDaclPresent: WINBOOL, pDacl: PACL,

-                                bDaclDefaulted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetSecurityDescriptorDacl".}

-proc GetSecurityDescriptorDacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                lpbDaclPresent: LPBOOL, pDacl: var PACL,

-                                lpbDaclDefaulted: LPBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetSecurityDescriptorDacl".}

-proc SetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                bSaclPresent: WINBOOL, pSacl: PACL,

-                                bSaclDefaulted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetSecurityDescriptorSacl".}

-proc GetSecurityDescriptorSacl*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                lpbSaclPresent: LPBOOL, pSacl: var PACL,

-                                lpbSaclDefaulted: LPBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetSecurityDescriptorSacl".}

-proc SetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 pOwner: PSID, bOwnerDefaulted: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorOwner".}

-proc GetSecurityDescriptorOwner*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 pOwner: var PSID, lpbOwnerDefaulted: LPBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorOwner".}

-proc SetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 pGroup: PSID, bGroupDefaulted: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetSecurityDescriptorGroup".}

-proc GetSecurityDescriptorGroup*(pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 pGroup: var PSID, lpbGroupDefaulted: LPBOOL): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetSecurityDescriptorGroup".}

-proc CreatePrivateObjectSecurity*(ParentDescriptor: PSECURITY_DESCRIPTOR,

-                                  CreatorDescriptor: PSECURITY_DESCRIPTOR,

-                                  NewDescriptor: var PSECURITY_DESCRIPTOR,

-                                  IsDirectoryObject: WINBOOL, Token: HANDLE,

-                                  GenericMapping: PGENERIC_MAPPING): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "CreatePrivateObjectSecurity".}

-proc SetPrivateObjectSecurity*(SecurityInformation: SECURITY_INFORMATION,

-                               ModificationDescriptor: PSECURITY_DESCRIPTOR,

-    ObjectsSecurityDescriptor: var PSECURITY_DESCRIPTOR,

-                               GenericMapping: PGENERIC_MAPPING, Token: HANDLE): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetPrivateObjectSecurity".}

-proc GetPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR,

-                               SecurityInformation: SECURITY_INFORMATION,

-                               ResultantDescriptor: PSECURITY_DESCRIPTOR,

-                               DescriptorLength: DWORD, ReturnLength: PDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "GetPrivateObjectSecurity".}

-proc DestroyPrivateObjectSecurity*(ObjectDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "DestroyPrivateObjectSecurity".}

-proc MakeSelfRelativeSD*(pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                         pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                         lpdwBufferLength: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "MakeSelfRelativeSD".}

-proc MakeAbsoluteSD*(pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                     pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                     lpdwAbsoluteSecurityDescriptorSize: LPDWORD, pDacl: PACL,

-                     lpdwDaclSize: LPDWORD, pSacl: PACL, lpdwSaclSize: LPDWORD,

-                     pOwner: PSID, lpdwOwnerSize: LPDWORD, pPrimaryGroup: PSID,

-                     lpdwPrimaryGroupSize: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "MakeAbsoluteSD".}

-proc SetKernelObjectSecurity*(Handle: HANDLE,

-                              SecurityInformation: SECURITY_INFORMATION,

-                              SecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetKernelObjectSecurity".}

-proc FindNextChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FindNextChangeNotification".}

-proc FindCloseChangeNotification*(hChangeHandle: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FindCloseChangeNotification".}

-proc VirtualLock*(lpAddress: LPVOID, dwSize: SIZE_T): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualLock".}

-proc VirtualLock*(lpAddress: LPVOID, dwSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualLock", deprecated.}

-proc VirtualUnlock*(lpAddress: LPVOID, dwSize: SIZE_T): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualUnlock".}

-proc VirtualUnlock*(lpAddress: LPVOID, dwSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "VirtualUnlock", deprecated.}

-proc MapViewOfFileEx*(hFileMappingObject: HANDLE, dwDesiredAccess: DWORD,

-                      dwFileOffsetHigh: DWORD, dwFileOffsetLow: DWORD,

-                      dwNumberOfBytesToMap: DWORD, lpBaseAddress: LPVOID): LPVOID{.

-    stdcall, dynlib: "kernel32", importc: "MapViewOfFileEx".}

-proc SetPriorityClass*(hProcess: HANDLE, dwPriorityClass: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetPriorityClass".}

-proc GetPriorityClass*(hProcess: HANDLE): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "GetPriorityClass".}

-proc IsBadReadPtr*(lp: pointer, ucb: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadReadPtr".}

-proc IsBadWritePtr*(lp: LPVOID, ucb: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadWritePtr".}

-proc IsBadHugeReadPtr*(lp: pointer, ucb: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadHugeReadPtr".}

-proc IsBadHugeWritePtr*(lp: LPVOID, ucb: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsBadHugeWritePtr".}

-proc IsBadCodePtr*(lpfn: FARPROC): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "IsBadCodePtr".}

-proc AllocateLocallyUniqueId*(Luid: PLUID): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AllocateLocallyUniqueId".}

-proc QueryPerformanceCounter*(lpPerformanceCount: PLARGE_INTEGER): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "QueryPerformanceCounter".}

-proc QueryPerformanceFrequency*(lpFrequency: PLARGE_INTEGER): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "QueryPerformanceFrequency".}

-proc ActivateKeyboardLayout*(hkl: HKL, Flags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ActivateKeyboardLayout".}

-proc UnloadKeyboardLayout*(hkl: HKL): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "UnloadKeyboardLayout".}

-proc GetKeyboardLayoutList*(nBuff: int32, lpList: var HKL): int32{.stdcall,

-    dynlib: "user32", importc: "GetKeyboardLayoutList".}

-proc GetKeyboardLayout*(dwLayout: DWORD): HKL{.stdcall, dynlib: "user32",

-    importc: "GetKeyboardLayout".}

-proc OpenInputDesktop*(dwFlags: DWORD, fInherit: WINBOOL, dwDesiredAccess: DWORD): HDESK{.

-    stdcall, dynlib: "user32", importc: "OpenInputDesktop".}

-proc EnumDesktopWindows*(hDesktop: HDESK, lpfn: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumDesktopWindows".}

-proc SwitchDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SwitchDesktop".}

-proc SetThreadDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetThreadDesktop".}

-proc CloseDesktop*(hDesktop: HDESK): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "CloseDesktop".}

-proc GetThreadDesktop*(dwThreadId: DWORD): HDESK{.stdcall, dynlib: "user32",

-    importc: "GetThreadDesktop".}

-proc CloseWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "CloseWindowStation".}

-proc SetProcessWindowStation*(hWinSta: HWINSTA): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetProcessWindowStation".}

-proc GetProcessWindowStation*(): HWINSTA{.stdcall, dynlib: "user32",

-    importc: "GetProcessWindowStation".}

-proc SetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION,

-                            pSID: PSECURITY_DESCRIPTOR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetUserObjectSecurity".}

-proc GetUserObjectSecurity*(hObj: HANDLE, pSIRequested: PSECURITY_INFORMATION,

-                            pSID: PSECURITY_DESCRIPTOR, nLength: DWORD,

-                            lpnLengthNeeded: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetUserObjectSecurity".}

-proc TranslateMessage*(lpMsg: LPMSG): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "TranslateMessage".}

-proc SetMessageQueue*(cMessagesMax: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetMessageQueue".}

-proc RegisterHotKey*(wnd: HWND, anID: int32, fsModifiers: WINUINT, vk: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "RegisterHotKey".}

-proc UnregisterHotKey*(wnd: HWND, anID: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "UnregisterHotKey".}

-proc ExitWindowsEx*(uFlags: WINUINT, dwReserved: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ExitWindowsEx".}

-proc SwapMouseButton*(fSwap: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SwapMouseButton".}

-proc GetMessagePos*(): DWORD{.stdcall, dynlib: "user32",

-                              importc: "GetMessagePos".}

-proc GetMessageTime*(): LONG{.stdcall, dynlib: "user32",

-                              importc: "GetMessageTime".}

-proc GetMessageExtraInfo*(): LONG{.stdcall, dynlib: "user32",

-                                   importc: "GetMessageExtraInfo".}

-proc SetMessageExtraInfo*(lp: LPARAM): LPARAM{.stdcall, dynlib: "user32",

-    importc: "SetMessageExtraInfo".}

-proc BroadcastSystemMessage*(para1: DWORD, para2: LPDWORD, para3: WINUINT,

-                             para4: WPARAM, para5: LPARAM): int32{.stdcall,

-    dynlib: "user32", importc: "BroadcastSystemMessage".}

-proc AttachThreadInput*(idAttach: DWORD, idAttachTo: DWORD, fAttach: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "AttachThreadInput".}

-proc ReplyMessage*(lResult: LRESULT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ReplyMessage".}

-proc WaitMessage*(): WINBOOL{.stdcall, dynlib: "user32", importc: "WaitMessage".}

-proc WaitForInputIdle*(hProcess: HANDLE, dwMilliseconds: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "WaitForInputIdle".}

-proc PostQuitMessage*(nExitCode: int32){.stdcall, dynlib: "user32",

-    importc: "PostQuitMessage".}

-proc InSendMessage*(): WINBOOL{.stdcall, dynlib: "user32",

-                                importc: "InSendMessage".}

-proc GetDoubleClickTime*(): WINUINT{.stdcall, dynlib: "user32",

-                                  importc: "GetDoubleClickTime".}

-proc SetDoubleClickTime*(para1: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetDoubleClickTime".}

-proc IsWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                     importc: "IsWindow".}

-proc IsMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32",

-                                     importc: "IsMenu".}

-proc IsChild*(hWndParent: HWND, wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsChild".}

-proc DestroyWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DestroyWindow".}

-proc ShowWindow*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ShowWindow".}

-proc ShowWindowAsync*(wnd: HWND, nCmdShow: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ShowWindowAsync".}

-proc FlashWindow*(wnd: HWND, bInvert: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "FlashWindow".}

-proc ShowOwnedPopups*(wnd: HWND, fShow: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ShowOwnedPopups".}

-proc OpenIcon*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                     importc: "OpenIcon".}

-proc CloseWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "CloseWindow".}

-proc MoveWindow*(wnd: HWND, X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                 bRepaint: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "MoveWindow".}

-proc SetWindowPos*(wnd: HWND, hWndInsertAfter: HWND, X: int32, Y: int32,

-                   cx: int32, cy: int32, uFlags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetWindowPos".}

-proc GetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetWindowPlacement".}

-proc SetWindowPlacement*(wnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetWindowPlacement".}

-proc GetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetWindowPlacement".}

-proc SetWindowPlacement*(wnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetWindowPlacement".}

-proc BeginDeferWindowPos*(nNumWindows: int32): HDWP{.stdcall, dynlib: "user32",

-    importc: "BeginDeferWindowPos".}

-proc DeferWindowPos*(hWinPosInfo: HDWP, wnd: HWND, hWndInsertAfter: HWND,

-                     x: int32, y: int32, cx: int32, cy: int32, uFlags: WINUINT): HDWP{.

-    stdcall, dynlib: "user32", importc: "DeferWindowPos".}

-proc EndDeferWindowPos*(hWinPosInfo: HDWP): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "EndDeferWindowPos".}

-proc IsWindowVisible*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsWindowVisible".}

-proc IsIconic*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                     importc: "IsIconic".}

-proc AnyPopup*(): WINBOOL{.stdcall, dynlib: "user32", importc: "AnyPopup".}

-proc BringWindowToTop*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "BringWindowToTop".}

-proc IsZoomed*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                     importc: "IsZoomed".}

-proc EndDialog*(hDlg: HWND, nResult: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "EndDialog".}

-proc GetDlgItem*(hDlg: HWND, nIDDlgItem: int32): HWND{.stdcall,

-    dynlib: "user32", importc: "GetDlgItem".}

-proc SetDlgItemInt*(hDlg: HWND, nIDDlgItem: int32, uValue: WINUINT,

-                    bSigned: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetDlgItemInt".}

-proc GetDlgItemInt*(hDlg: HWND, nIDDlgItem: int32, lpTranslated: var WINBOOL,

-                    bSigned: WINBOOL): WINUINT{.stdcall, dynlib: "user32",

-    importc: "GetDlgItemInt".}

-proc CheckDlgButton*(hDlg: HWND, nIDButton: int32, uCheck: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "CheckDlgButton".}

-proc CheckRadioButton*(hDlg: HWND, nIDFirstButton: int32, nIDLastButton: int32,

-                       nIDCheckButton: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CheckRadioButton".}

-proc IsDlgButtonChecked*(hDlg: HWND, nIDButton: int32): WINUINT{.stdcall,

-    dynlib: "user32", importc: "IsDlgButtonChecked".}

-proc GetNextDlgGroupItem*(hDlg: HWND, hCtl: HWND, bPrevious: WINBOOL): HWND{.

-    stdcall, dynlib: "user32", importc: "GetNextDlgGroupItem".}

-proc GetNextDlgTabItem*(hDlg: HWND, hCtl: HWND, bPrevious: WINBOOL): HWND{.

-    stdcall, dynlib: "user32", importc: "GetNextDlgTabItem".}

-proc GetDlgCtrlID*(wnd: HWND): int32{.stdcall, dynlib: "user32",

-                                       importc: "GetDlgCtrlID".}

-proc GetDialogBaseUnits*(): int32{.stdcall, dynlib: "user32",

-                                   importc: "GetDialogBaseUnits".}

-proc OpenClipboard*(hWndNewOwner: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "OpenClipboard".}

-proc CloseClipboard*(): WINBOOL{.stdcall, dynlib: "user32",

-                                 importc: "CloseClipboard".}

-proc GetClipboardOwner*(): HWND{.stdcall, dynlib: "user32",

-                                 importc: "GetClipboardOwner".}

-proc SetClipboardViewer*(hWndNewViewer: HWND): HWND{.stdcall, dynlib: "user32",

-    importc: "SetClipboardViewer".}

-proc GetClipboardViewer*(): HWND{.stdcall, dynlib: "user32",

-                                  importc: "GetClipboardViewer".}

-proc ChangeClipboardChain*(hWndRemove: HWND, hWndNewNext: HWND): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "ChangeClipboardChain".}

-proc SetClipboardData*(uFormat: WINUINT, hMem: HANDLE): HANDLE{.stdcall,

-    dynlib: "user32", importc: "SetClipboardData".}

-proc GetClipboardData*(uFormat: WINUINT): HANDLE{.stdcall, dynlib: "user32",

-    importc: "GetClipboardData".}

-proc CountClipboardFormats*(): int32{.stdcall, dynlib: "user32",

-                                      importc: "CountClipboardFormats".}

-proc EnumClipboardFormats*(format: WINUINT): WINUINT{.stdcall, dynlib: "user32",

-    importc: "EnumClipboardFormats".}

-proc EmptyClipboard*(): WINBOOL{.stdcall, dynlib: "user32",

-                                 importc: "EmptyClipboard".}

-proc IsClipboardFormatAvailable*(format: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsClipboardFormatAvailable".}

-proc GetPriorityClipboardFormat*(paFormatPriorityList: var WINUINT, cFormats: int32): int32{.

-    stdcall, dynlib: "user32", importc: "GetPriorityClipboardFormat".}

-proc GetOpenClipboardWindow*(): HWND{.stdcall, dynlib: "user32",

-                                      importc: "GetOpenClipboardWindow".}

-proc CharNextExA*(CodePage: int16, lpCurrentChar: LPCSTR, dwFlags: DWORD): LPSTR{.

-    stdcall, dynlib: "user32", importc: "CharNextExA".}

-proc CharPrevExA*(CodePage: int16, lpStart: LPCSTR, lpCurrentChar: LPCSTR,

-                  dwFlags: DWORD): LPSTR{.stdcall, dynlib: "user32",

-    importc: "CharPrevExA".}

-proc SetFocus*(wnd: HWND): HWND{.stdcall, dynlib: "user32", importc: "SetFocus".}

-proc GetActiveWindow*(): HWND{.stdcall, dynlib: "user32",

-                               importc: "GetActiveWindow".}

-proc GetFocus*(): HWND{.stdcall, dynlib: "user32", importc: "GetFocus".}

-proc GetKBCodePage*(): WINUINT{.stdcall, dynlib: "user32", importc: "GetKBCodePage".}

-proc GetKeyState*(nVirtKey: int32): SHORT{.stdcall, dynlib: "user32",

-    importc: "GetKeyState".}

-proc GetAsyncKeyState*(vKey: int32): SHORT{.stdcall, dynlib: "user32",

-    importc: "GetAsyncKeyState".}

-proc GetKeyboardState*(lpKeyState: PBYTE): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetKeyboardState".}

-proc SetKeyboardState*(lpKeyState: LPBYTE): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetKeyboardState".}

-proc GetKeyboardType*(nTypeFlag: int32): int32{.stdcall, dynlib: "user32",

-    importc: "GetKeyboardType".}

-proc ToAscii*(uVirtKey: WINUINT, uScanCode: WINUINT, lpKeyState: PBYTE,

-              lpChar: LPWORD, uFlags: WINUINT): int32{.stdcall, dynlib: "user32",

-    importc: "ToAscii".}

-proc ToAsciiEx*(uVirtKey: WINUINT, uScanCode: WINUINT, lpKeyState: PBYTE,

-                lpChar: LPWORD, uFlags: WINUINT, dwhkl: HKL): int32{.stdcall,

-    dynlib: "user32", importc: "ToAsciiEx".}

-proc ToUnicode*(wVirtKey: WINUINT, wScanCode: WINUINT, lpKeyState: PBYTE,

-                pwszBuff: LPWSTR, cchBuff: int32, wFlags: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "ToUnicode".}

-proc OemKeyScan*(wOemChar: int16): DWORD{.stdcall, dynlib: "user32",

-    importc: "OemKeyScan".}

-proc keybd_event*(bVk: int8, bScan: int8, dwFlags: DWORD, dwExtraInfo: DWORD){.

-    stdcall, dynlib: "user32", importc: "keybd_event".}

-proc mouse_event*(dwFlags: DWORD, dx: DWORD, dy: DWORD, cButtons: DWORD,

-                  dwExtraInfo: DWORD){.stdcall, dynlib: "user32",

-                                       importc: "mouse_event".}

-proc GetInputState*(): WINBOOL{.stdcall, dynlib: "user32",

-                                importc: "GetInputState".}

-proc GetQueueStatus*(flags: WINUINT): DWORD{.stdcall, dynlib: "user32",

-    importc: "GetQueueStatus".}

-proc GetCapture*(): HWND{.stdcall, dynlib: "user32", importc: "GetCapture".}

-proc SetCapture*(wnd: HWND): HWND{.stdcall, dynlib: "user32",

-                                    importc: "SetCapture".}

-proc ReleaseCapture*(): WINBOOL{.stdcall, dynlib: "user32",

-                                 importc: "ReleaseCapture".}

-proc MsgWaitForMultipleObjects*(nCount: DWORD, pHandles: LPHANDLE,

-                                fWaitAll: WINBOOL, dwMilliseconds: DWORD,

-                                dwWakeMask: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "MsgWaitForMultipleObjects".}

-proc SetTimer*(wnd: HWND, nIDEvent: WINUINT, uElapse: WINUINT, lpTimerFunc: TIMERPROC): WINUINT{.

-    stdcall, dynlib: "user32", importc: "SetTimer".}

-proc KillTimer*(wnd: HWND, uIDEvent: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "KillTimer".}

-proc IsWindowUnicode*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsWindowUnicode".}

-proc EnableWindow*(wnd: HWND, bEnable: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnableWindow".}

-proc IsWindowEnabled*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsWindowEnabled".}

-proc DestroyAcceleratorTable*(hAccel: HACCEL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DestroyAcceleratorTable".}

-proc GetSystemMetrics*(nIndex: int32): int32{.stdcall, dynlib: "user32",

-    importc: "GetSystemMetrics".}

-proc GetMenu*(wnd: HWND): HMENU{.stdcall, dynlib: "user32", importc: "GetMenu".}

-proc SetMenu*(wnd: HWND, menu: HMENU): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetMenu".}

-proc HiliteMenuItem*(wnd: HWND, menu: HMENU, uIDHiliteItem: WINUINT,

-                     uHilite: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "HiliteMenuItem".}

-proc GetMenuState*(menu: HMENU, uId: WINUINT, uFlags: WINUINT): WINUINT{.stdcall,

-    dynlib: "user32", importc: "GetMenuState".}

-proc DrawMenuBar*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "DrawMenuBar".}

-proc GetSystemMenu*(wnd: HWND, bRevert: WINBOOL): HMENU{.stdcall,

-    dynlib: "user32", importc: "GetSystemMenu".}

-proc CreateMenu*(): HMENU{.stdcall, dynlib: "user32", importc: "CreateMenu".}

-proc CreatePopupMenu*(): HMENU{.stdcall, dynlib: "user32",

-                                importc: "CreatePopupMenu".}

-proc DestroyMenu*(menu: HMENU): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DestroyMenu".}

-proc CheckMenuItem*(menu: HMENU, uIDCheckItem: WINUINT, uCheck: WINUINT): DWORD{.

-    stdcall, dynlib: "user32", importc: "CheckMenuItem".}

-proc EnableMenuItem*(menu: HMENU, uIDEnableItem: WINUINT, uEnable: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnableMenuItem".}

-proc GetSubMenu*(menu: HMENU, nPos: int32): HMENU{.stdcall, dynlib: "user32",

-    importc: "GetSubMenu".}

-proc GetMenuItemID*(menu: HMENU, nPos: int32): WINUINT{.stdcall, dynlib: "user32",

-    importc: "GetMenuItemID".}

-proc GetMenuItemCount*(menu: HMENU): int32{.stdcall, dynlib: "user32",

-    importc: "GetMenuItemCount".}

-proc RemoveMenu*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "RemoveMenu".}

-proc DeleteMenu*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DeleteMenu".}

-proc SetMenuItemBitmaps*(menu: HMENU, uPosition: WINUINT, uFlags: WINUINT,

-                         hBitmapUnchecked: HBITMAP, hBitmapChecked: HBITMAP): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetMenuItemBitmaps".}

-proc GetMenuCheckMarkDimensions*(): LONG{.stdcall, dynlib: "user32",

-    importc: "GetMenuCheckMarkDimensions".}

-proc TrackPopupMenu*(menu: HMENU, uFlags: WINUINT, x: int32, y: int32,

-                     nReserved: int32, wnd: HWND, prcRect: var RECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "TrackPopupMenu".}

-proc GetMenuDefaultItem*(menu: HMENU, fByPos: WINUINT, gmdiFlags: WINUINT): WINUINT{.

-    stdcall, dynlib: "user32", importc: "GetMenuDefaultItem".}

-proc SetMenuDefaultItem*(menu: HMENU, uItem: WINUINT, fByPos: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetMenuDefaultItem".}

-proc GetMenuItemRect*(wnd: HWND, menu: HMENU, uItem: WINUINT, lprcItem: LPRECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetMenuItemRect".}

-proc MenuItemFromPoint*(wnd: HWND, menu: HMENU, ptScreen: POINT): int32{.

-    stdcall, dynlib: "user32", importc: "MenuItemFromPoint".}

-proc DragObject*(para1: HWND, para2: HWND, para3: WINUINT, para4: DWORD,

-                 para5: HCURSOR): DWORD{.stdcall, dynlib: "user32",

-    importc: "DragObject".}

-proc DragDetect*(wnd: HWND, pt: POINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DragDetect".}

-proc DrawIcon*(hDC: HDC, X: int32, Y: int32, icon: HICON): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DrawIcon".}

-proc UpdateWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "UpdateWindow".}

-proc SetActiveWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32",

-    importc: "SetActiveWindow".}

-proc GetForegroundWindow*(): HWND{.stdcall, dynlib: "user32",

-                                   importc: "GetForegroundWindow".}

-proc PaintDesktop*(hdc: HDC): WINBOOL{.stdcall, dynlib: "user32",

-                                       importc: "PaintDesktop".}

-proc SetForegroundWindow*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetForegroundWindow".}

-proc WindowFromDC*(hDC: HDC): HWND{.stdcall, dynlib: "user32",

-                                    importc: "WindowFromDC".}

-proc GetDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32", importc: "GetDC".}

-proc GetDCEx*(wnd: HWND, hrgnClip: HRGN, flags: DWORD): HDC{.stdcall,

-    dynlib: "user32", importc: "GetDCEx".}

-proc GetWindowDC*(wnd: HWND): HDC{.stdcall, dynlib: "user32",

-                                    importc: "GetWindowDC".}

-proc ReleaseDC*(wnd: HWND, hDC: HDC): int32{.stdcall, dynlib: "user32",

-    importc: "ReleaseDC".}

-proc BeginPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): HDC{.stdcall,

-    dynlib: "user32", importc: "BeginPaint".}

-proc EndPaint*(wnd: HWND, lpPaint: LPPAINTSTRUCT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EndPaint".}

-proc GetUpdateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUpdateRect".}

-proc GetUpdateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): int32{.stdcall,

-    dynlib: "user32", importc: "GetUpdateRgn".}

-proc SetWindowRgn*(wnd: HWND, hRgn: HRGN, bRedraw: WINBOOL): int32{.stdcall,

-    dynlib: "user32", importc: "SetWindowRgn".}

-proc GetWindowRgn*(wnd: HWND, hRgn: HRGN): int32{.stdcall, dynlib: "user32",

-    importc: "GetWindowRgn".}

-proc ExcludeUpdateRgn*(hDC: HDC, wnd: HWND): int32{.stdcall, dynlib: "user32",

-    importc: "ExcludeUpdateRgn".}

-proc InvalidateRect*(wnd: HWND, lpRect: var RECT, bErase: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "InvalidateRect".}

-proc InvalidateRect*(wnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "InvalidateRect".}

-proc ValidateRect*(wnd: HWND, lpRect: var RECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ValidateRect".}

-proc ValidateRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ValidateRect".}

-proc InvalidateRgn*(wnd: HWND, hRgn: HRGN, bErase: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "InvalidateRgn".}

-proc ValidateRgn*(wnd: HWND, hRgn: HRGN): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ValidateRgn".}

-proc RedrawWindow*(wnd: HWND, lprcUpdate: var RECT, hrgnUpdate: HRGN,

-                   flags: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "RedrawWindow".}

-proc RedrawWindow*(wnd: HWND, lprcUpdate: LPRECT, hrgnUpdate: HRGN, flags: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "RedrawWindow".}

-proc LockWindowUpdate*(hWndLock: HWND): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "LockWindowUpdate".}

-proc ScrollWindow*(wnd: HWND, XAmount: int32, YAmount: int32, lpRect: var RECT,

-                   lpClipRect: var RECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ScrollWindow".}

-proc ScrollDC*(hDC: HDC, dx: int32, dy: int32, lprcScroll: var RECT,

-               lprcClip: var RECT, hrgnUpdate: HRGN, lprcUpdate: LPRECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "ScrollDC".}

-proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: var RECT,

-                     prcClip: var RECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,

-                     flags: WINUINT): int32{.stdcall, dynlib: "user32",

-    importc: "ScrollWindowEx".}

-proc SetScrollPos*(wnd: HWND, nBar: int32, nPos: int32, bRedraw: WINBOOL): int32{.

-    stdcall, dynlib: "user32", importc: "SetScrollPos".}

-proc GetScrollPos*(wnd: HWND, nBar: int32): int32{.stdcall, dynlib: "user32",

-    importc: "GetScrollPos".}

-proc SetScrollRange*(wnd: HWND, nBar: int32, nMinPos: int32, nMaxPos: int32,

-                     bRedraw: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetScrollRange".}

-proc GetScrollRange*(wnd: HWND, nBar: int32, lpMinPos: LPINT, lpMaxPos: LPINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetScrollRange".}

-proc ShowScrollBar*(wnd: HWND, wBar: int32, bShow: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ShowScrollBar".}

-proc EnableScrollBar*(wnd: HWND, wSBflags: WINUINT, wArrows: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnableScrollBar".}

-proc GetClientRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetClientRect".}

-proc GetWindowRect*(wnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetWindowRect".}

-proc AdjustWindowRect*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "AdjustWindowRect".}

-proc AdjustWindowRectEx*(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL,

-                         dwExStyle: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "AdjustWindowRectEx".}

-proc SetWindowContextHelpId*(para1: HWND, para2: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetWindowContextHelpId".}

-proc GetWindowContextHelpId*(para1: HWND): DWORD{.stdcall, dynlib: "user32",

-    importc: "GetWindowContextHelpId".}

-proc SetMenuContextHelpId*(para1: HMENU, para2: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetMenuContextHelpId".}

-proc GetMenuContextHelpId*(para1: HMENU): DWORD{.stdcall, dynlib: "user32",

-    importc: "GetMenuContextHelpId".}

-proc MessageBeep*(uType: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "MessageBeep".}

-proc ShowCursor*(bShow: WINBOOL): int32{.stdcall, dynlib: "user32",

-    importc: "ShowCursor".}

-proc SetCursorPos*(X: int32, Y: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetCursorPos".}

-proc SetCursor*(cursor: HCURSOR): HCURSOR{.stdcall, dynlib: "user32",

-    importc: "SetCursor".}

-proc GetCursorPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetCursorPos".}

-proc ClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ClipCursor".}

-proc GetClipCursor*(lpRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetClipCursor".}

-proc GetCursor*(): HCURSOR{.stdcall, dynlib: "user32", importc: "GetCursor".}

-proc CreateCaret*(wnd: HWND, hBitmap: HBITMAP, nWidth: int32, nHeight: int32): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "CreateCaret".}

-proc GetCaretBlinkTime*(): WINUINT{.stdcall, dynlib: "user32",

-                                 importc: "GetCaretBlinkTime".}

-proc SetCaretBlinkTime*(uMSeconds: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetCaretBlinkTime".}

-proc DestroyCaret*(): WINBOOL{.stdcall, dynlib: "user32",

-                               importc: "DestroyCaret".}

-proc HideCaret*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                      importc: "HideCaret".}

-proc ShowCaret*(wnd: HWND): WINBOOL{.stdcall, dynlib: "user32",

-                                      importc: "ShowCaret".}

-proc SetCaretPos*(X: int32, Y: int32): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetCaretPos".}

-proc GetCaretPos*(lpPoint: LPPOINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetCaretPos".}

-proc ClientToScreen*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ClientToScreen".}

-proc ScreenToClient*(wnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ScreenToClient".}

-proc MapWindowPoints*(hWndFrom: HWND, hWndTo: HWND, lpPoints: LPPOINT,

-                      cPoints: WINUINT): int32{.stdcall, dynlib: "user32",

-    importc: "MapWindowPoints".}

-proc WindowFromPoint*(Point: POINT): HWND{.stdcall, dynlib: "user32",

-    importc: "WindowFromPoint".}

-proc ChildWindowFromPoint*(hWndParent: HWND, Point: POINT): HWND{.stdcall,

-    dynlib: "user32", importc: "ChildWindowFromPoint".}

-proc GetSysColor*(nIndex: int32): DWORD{.stdcall, dynlib: "user32",

-    importc: "GetSysColor".}

-proc GetSysColorBrush*(nIndex: int32): HBRUSH{.stdcall, dynlib: "user32",

-    importc: "GetSysColorBrush".}

-proc SetSysColors*(cElements: int32, lpaElements: var WINT,

-                   lpaRgbValues: var COLORREF): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetSysColors".}

-proc DrawFocusRect*(hDC: HDC, lprc: var RECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DrawFocusRect".}

-proc FillRect*(hDC: HDC, lprc: var RECT, hbr: HBRUSH): int32{.stdcall,

-    dynlib: "user32", importc: "FillRect".}

-proc FrameRect*(hDC: HDC, lprc: var RECT, hbr: HBRUSH): int32{.stdcall,

-    dynlib: "user32", importc: "FrameRect".}

-proc InvertRect*(hDC: HDC, lprc: var RECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "InvertRect".}

-proc SetRect*(lprc: LPRECT, xLeft: int32, yTop: int32, xRight: int32,

-              yBottom: int32): WINBOOL{.stdcall, dynlib: "user32",

-                                        importc: "SetRect".}

-proc SetRectEmpty*(lprc: LPRECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetRectEmpty".}

-proc CopyRect*(lprcDst: LPRECT, lprcSrc: var RECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CopyRect".}

-proc InflateRect*(lprc: LPRECT, dx: int32, dy: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "InflateRect".}

-proc IntersectRect*(lprcDst: LPRECT, lprcSrc1: var RECT, lprcSrc2: var RECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "IntersectRect".}

-proc UnionRect*(lprcDst: LPRECT, lprcSrc1: var RECT, lprcSrc2: var RECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "UnionRect".}

-proc SubtractRect*(lprcDst: LPRECT, lprcSrc1: var RECT, lprcSrc2: var RECT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SubtractRect".}

-proc OffsetRect*(lprc: LPRECT, dx: int32, dy: int32): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "OffsetRect".}

-proc IsRectEmpty*(lprc: var RECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "IsRectEmpty".}

-proc EqualRect*(lprc1: var RECT, lprc2: var RECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EqualRect".}

-proc PtInRect*(lprc: var RECT, pt: POINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "PtInRect".}

-proc PtInRect*(lprc: LPRECT, pt: POINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "PtInRect".}

-proc GetWindowWord*(wnd: HWND, nIndex: int32): int16{.stdcall,

-    dynlib: "user32", importc: "GetWindowWord".}

-proc SetWindowWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall,

-    dynlib: "user32", importc: "SetWindowWord".}

-proc GetClassWord*(wnd: HWND, nIndex: int32): int16{.stdcall, dynlib: "user32",

-    importc: "GetClassWord".}

-proc SetClassWord*(wnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall,

-    dynlib: "user32", importc: "SetClassWord".}

-proc GetDesktopWindow*(): HWND{.stdcall, dynlib: "user32",

-                                importc: "GetDesktopWindow".}

-proc GetParent*(wnd: HWND): HWND{.stdcall, dynlib: "user32",

-                                   importc: "GetParent".}

-proc SetParent*(hWndChild: HWND, hWndNewParent: HWND): HWND{.stdcall,

-    dynlib: "user32", importc: "SetParent".}

-proc EnumChildWindows*(hWndParent: HWND, lpEnumFunc: ENUMWINDOWSPROC,

-                       lp: LPARAM): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "EnumChildWindows".}

-proc EnumWindows*(lpEnumFunc: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumWindows".}

-proc EnumThreadWindows*(dwThreadId: DWORD, lpfn: ENUMWINDOWSPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumThreadWindows".}

-proc EnumTaskWindows*(hTask: HWND, lpfn: FARPROC, lp: LPARAM): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "EnumThreadWindows".}

-proc GetTopWindow*(wnd: HWND): HWND{.stdcall, dynlib: "user32",

-                                      importc: "GetTopWindow".}

-proc GetWindowThreadProcessId*(wnd: HWND, lpdwProcessId: LPDWORD): DWORD{.

-    stdcall, dynlib: "user32", importc: "GetWindowThreadProcessId".}

-proc GetLastActivePopup*(wnd: HWND): HWND{.stdcall, dynlib: "user32",

-    importc: "GetLastActivePopup".}

-proc GetWindow*(wnd: HWND, uCmd: WINUINT): HWND{.stdcall, dynlib: "user32",

-    importc: "GetWindow".}

-proc UnhookWindowsHook*(nCode: int32, pfnFilterProc: HOOKPROC): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "UnhookWindowsHook".}

-proc UnhookWindowsHookEx*(hhk: HHOOK): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "UnhookWindowsHookEx".}

-proc CallNextHookEx*(hhk: HHOOK, nCode: int32, wp: WPARAM, lp: LPARAM): LRESULT{.

-    stdcall, dynlib: "user32", importc: "CallNextHookEx".}

-proc CheckMenuRadioItem*(para1: HMENU, para2: WINUINT, para3: WINUINT, para4: WINUINT,

-                         para5: WINUINT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "CheckMenuRadioItem".}

-proc CreateCursor*(hInst: HINST, xHotSpot: int32, yHotSpot: int32,

-                   nWidth: int32, nHeight: int32, pvANDPlane: pointer,

-                   pvXORPlane: pointer): HCURSOR{.stdcall, dynlib: "user32",

-    importc: "CreateCursor".}

-proc DestroyCursor*(cursor: HCURSOR): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DestroyCursor".}

-proc SetSystemCursor*(hcur: HCURSOR, anID: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetSystemCursor".}

-proc CreateIcon*(hInstance: HINST, nWidth: int32, nHeight: int32, cPlanes: int8,

-                 cBitsPixel: int8, lpbANDbits: var int8, lpbXORbits: var int8): HICON{.

-    stdcall, dynlib: "user32", importc: "CreateIcon".}

-proc DestroyIcon*(icon: HICON): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DestroyIcon".}

-proc LookupIconIdFromDirectory*(presbits: PBYTE, fIcon: WINBOOL): int32{.

-    stdcall, dynlib: "user32", importc: "LookupIconIdFromDirectory".}

-proc LookupIconIdFromDirectoryEx*(presbits: PBYTE, fIcon: WINBOOL,

-                                  cxDesired: int32, cyDesired: int32,

-                                  Flags: WINUINT): int32{.stdcall,

-    dynlib: "user32", importc: "LookupIconIdFromDirectoryEx".}

-proc CreateIconFromResource*(presbits: PBYTE, dwResSize: DWORD, fIcon: WINBOOL,

-                             dwVer: DWORD): HICON{.stdcall, dynlib: "user32",

-    importc: "CreateIconFromResource".}

-proc CreateIconFromResourceEx*(presbits: PBYTE, dwResSize: DWORD,

-                               fIcon: WINBOOL, dwVer: DWORD, cxDesired: int32,

-                               cyDesired: int32, Flags: WINUINT): HICON{.stdcall,

-    dynlib: "user32", importc: "CreateIconFromResourceEx".}

-proc CopyImage*(para1: HANDLE, para2: WINUINT, para3: int32, para4: int32,

-                para5: WINUINT): HICON{.stdcall, dynlib: "user32",

-                                     importc: "CopyImage".}

-proc CreateIconIndirect*(piconinfo: PICONINFO): HICON{.stdcall,

-    dynlib: "user32", importc: "CreateIconIndirect".}

-proc CopyIcon*(icon: HICON): HICON{.stdcall, dynlib: "user32",

-                                     importc: "CopyIcon".}

-proc GetIconInfo*(icon: HICON, piconinfo: PICONINFO): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetIconInfo".}

-proc MapDialogRect*(hDlg: HWND, lpRect: LPRECT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "MapDialogRect".}

-proc SetScrollInfo*(para1: HWND, para2: int32, para3: LPCSCROLLINFO,

-                    para4: WINBOOL): int32{.stdcall, dynlib: "user32",

-    importc: "SetScrollInfo".}

-proc GetScrollInfo*(para1: HWND, para2: int32, para3: LPSCROLLINFO): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetScrollInfo".}

-proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: LPMSG): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "TranslateMDISysAccel".}

-proc ArrangeIconicWindows*(wnd: HWND): WINUINT{.stdcall, dynlib: "user32",

-    importc: "ArrangeIconicWindows".}

-proc TileWindows*(hwndParent: HWND, wHow: WINUINT, lpRect: var RECT, cKids: WINUINT,

-                  lpKids: var HWND): int16{.stdcall, dynlib: "user32",

-    importc: "TileWindows".}

-proc CascadeWindows*(hwndParent: HWND, wHow: WINUINT, lpRect: var RECT,

-                     cKids: WINUINT, lpKids: var HWND): int16{.stdcall,

-    dynlib: "user32", importc: "CascadeWindows".}

-proc SetLastErrorEx*(dwErrCode: DWORD, dwType: DWORD){.stdcall,

-    dynlib: "user32", importc: "SetLastErrorEx".}

-proc SetDebugErrorLevel*(dwLevel: DWORD){.stdcall, dynlib: "user32",

-    importc: "SetDebugErrorLevel".}

-proc DrawEdge*(hdc: HDC, qrc: LPRECT, edge: WINUINT, grfFlags: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DrawEdge".}

-proc DrawFrameControl*(para1: HDC, para2: LPRECT, para3: WINUINT, para4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DrawFrameControl".}

-proc DrawCaption*(para1: HWND, para2: HDC, para3: var RECT, para4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DrawCaption".}

-proc DrawAnimatedRects*(wnd: HWND, idAni: int32, lprcFrom: var RECT,

-                        lprcTo: var RECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DrawAnimatedRects".}

-proc TrackPopupMenuEx*(para1: HMENU, para2: WINUINT, para3: int32, para4: int32,

-                       para5: HWND, para6: LPTPMPARAMS): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "TrackPopupMenuEx".}

-proc ChildWindowFromPointEx*(para1: HWND, para2: POINT, para3: WINUINT): HWND{.

-    stdcall, dynlib: "user32", importc: "ChildWindowFromPointEx".}

-proc DrawIconEx*(hdc: HDC, xLeft: int32, yTop: int32, icon: HICON,

-                 cxWidth: int32, cyWidth: int32, istepIfAniCur: WINUINT,

-                 hbrFlickerFreeDraw: HBRUSH, diFlags: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DrawIconEx".}

-proc AnimatePalette*(para1: HPALETTE, para2: WINUINT, para3: WINUINT,

-                     para4: var PALETTEENTRY): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "AnimatePalette".}

-proc Arc*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-          para6: int32, para7: int32, para8: int32, para9: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "Arc".}

-proc BitBlt*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-             para6: HDC, para7: int32, para8: int32, para9: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "BitBlt".}

-proc CancelDC*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                     importc: "CancelDC".}

-proc Chord*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-            para6: int32, para7: int32, para8: int32, para9: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "Chord".}

-proc CloseMetaFile*(para1: HDC): HMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "CloseMetaFile".}

-proc CombineRgn*(para1: HRGN, para2: HRGN, para3: HRGN, para4: int32): int32{.

-    stdcall, dynlib: "gdi32", importc: "CombineRgn".}

-proc CreateBitmap*(para1: int32, para2: int32, para3: WINUINT, para4: WINUINT,

-                   para5: pointer): HBITMAP{.stdcall, dynlib: "gdi32",

-    importc: "CreateBitmap".}

-proc CreateBitmapIndirect*(para1: var BITMAP): HBITMAP{.stdcall,

-    dynlib: "gdi32", importc: "CreateBitmapIndirect".}

-proc CreateBrushIndirect*(para1: var LOGBRUSH): HBRUSH{.stdcall,

-    dynlib: "gdi32", importc: "CreateBrushIndirect".}

-proc CreateCompatibleBitmap*(para1: HDC, para2: int32, para3: int32): HBITMAP{.

-    stdcall, dynlib: "gdi32", importc: "CreateCompatibleBitmap".}

-proc CreateDiscardableBitmap*(para1: HDC, para2: int32, para3: int32): HBITMAP{.

-    stdcall, dynlib: "gdi32", importc: "CreateDiscardableBitmap".}

-proc CreateCompatibleDC*(para1: HDC): HDC{.stdcall, dynlib: "gdi32",

-    importc: "CreateCompatibleDC".}

-proc CreateDIBitmap*(para1: HDC, para2: var BITMAPINFOHEADER, para3: DWORD,

-                     para4: pointer, para5: var BITMAPINFO, para6: WINUINT): HBITMAP{.

-    stdcall, dynlib: "gdi32", importc: "CreateDIBitmap".}

-proc CreateDIBPatternBrush*(para1: HGLOBAL, para2: WINUINT): HBRUSH{.stdcall,

-    dynlib: "gdi32", importc: "CreateDIBPatternBrush".}

-proc CreateDIBPatternBrushPt*(para1: pointer, para2: WINUINT): HBRUSH{.stdcall,

-    dynlib: "gdi32", importc: "CreateDIBPatternBrushPt".}

-proc CreateEllipticRgn*(para1: int32, para2: int32, para3: int32, para4: int32): HRGN{.

-    stdcall, dynlib: "gdi32", importc: "CreateEllipticRgn".}

-proc CreateEllipticRgnIndirect*(para1: var RECT): HRGN{.stdcall,

-    dynlib: "gdi32", importc: "CreateEllipticRgnIndirect".}

-proc CreateHatchBrush*(para1: int32, para2: COLORREF): HBRUSH{.stdcall,

-    dynlib: "gdi32", importc: "CreateHatchBrush".}

-proc CreatePalette*(para1: var LOGPALETTE): HPALETTE{.stdcall, dynlib: "gdi32",

-    importc: "CreatePalette".}

-proc CreatePen*(para1: int32, para2: int32, para3: COLORREF): HPEN{.stdcall,

-    dynlib: "gdi32", importc: "CreatePen".}

-proc CreatePenIndirect*(para1: var LOGPEN): HPEN{.stdcall, dynlib: "gdi32",

-    importc: "CreatePenIndirect".}

-proc CreatePolyPolygonRgn*(para1: var POINT, para2: var WINT, para3: int32,

-                           para4: int32): HRGN{.stdcall, dynlib: "gdi32",

-    importc: "CreatePolyPolygonRgn".}

-proc CreatePatternBrush*(para1: HBITMAP): HBRUSH{.stdcall, dynlib: "gdi32",

-    importc: "CreatePatternBrush".}

-proc CreateRectRgn*(para1: int32, para2: int32, para3: int32, para4: int32): HRGN{.

-    stdcall, dynlib: "gdi32", importc: "CreateRectRgn".}

-proc CreateRectRgnIndirect*(para1: var RECT): HRGN{.stdcall, dynlib: "gdi32",

-    importc: "CreateRectRgnIndirect".}

-proc CreateRoundRectRgn*(para1: int32, para2: int32, para3: int32, para4: int32,

-                         para5: int32, para6: int32): HRGN{.stdcall,

-    dynlib: "gdi32", importc: "CreateRoundRectRgn".}

-proc CreateSolidBrush*(para1: COLORREF): HBRUSH{.stdcall, dynlib: "gdi32",

-    importc: "CreateSolidBrush".}

-proc DeleteDC*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                     importc: "DeleteDC".}

-proc DeleteMetaFile*(para1: HMETAFILE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "DeleteMetaFile".}

-proc DeleteObject*(para1: HGDIOBJ): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "DeleteObject".}

-proc DrawEscape*(para1: HDC, para2: int32, para3: int32, para4: LPCSTR): int32{.

-    stdcall, dynlib: "gdi32", importc: "DrawEscape".}

-proc Ellipse*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "Ellipse".}

-proc EnumObjects*(para1: HDC, para2: int32, para3: ENUMOBJECTSPROC,

-                  para4: LPARAM): int32{.stdcall, dynlib: "gdi32",

-    importc: "EnumObjects".}

-proc EqualRgn*(para1: HRGN, para2: HRGN): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "EqualRgn".}

-proc Escape*(para1: HDC, para2: int32, para3: int32, para4: LPCSTR,

-             para5: LPVOID): int32{.stdcall, dynlib: "gdi32", importc: "Escape".}

-proc ExtEscape*(para1: HDC, para2: int32, para3: int32, para4: LPCSTR,

-                para5: int32, para6: LPSTR): int32{.stdcall, dynlib: "gdi32",

-    importc: "ExtEscape".}

-proc ExcludeClipRect*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                      para5: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "ExcludeClipRect".}

-proc ExtCreateRegion*(para1: var XFORM, para2: DWORD, para3: var RGNDATA): HRGN{.

-    stdcall, dynlib: "gdi32", importc: "ExtCreateRegion".}

-proc ExtFloodFill*(para1: HDC, para2: int32, para3: int32, para4: COLORREF,

-                   para5: WINUINT): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "ExtFloodFill".}

-proc FillRgn*(para1: HDC, para2: HRGN, para3: HBRUSH): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "FillRgn".}

-proc FloodFill*(para1: HDC, para2: int32, para3: int32, para4: COLORREF): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "FloodFill".}

-proc FrameRgn*(para1: HDC, para2: HRGN, para3: HBRUSH, para4: int32,

-               para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                       importc: "FrameRgn".}

-proc GetROP2*(para1: HDC): int32{.stdcall, dynlib: "gdi32", importc: "GetROP2".}

-proc GetAspectRatioFilterEx*(para1: HDC, para2: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetAspectRatioFilterEx".}

-proc GetBkColor*(para1: HDC): COLORREF{.stdcall, dynlib: "gdi32",

-                                        importc: "GetBkColor".}

-proc GetBkMode*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-                                    importc: "GetBkMode".}

-proc GetBitmapBits*(para1: HBITMAP, para2: LONG, para3: LPVOID): LONG{.stdcall,

-    dynlib: "gdi32", importc: "GetBitmapBits".}

-proc GetBitmapDimensionEx*(para1: HBITMAP, para2: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetBitmapDimensionEx".}

-proc GetBoundsRect*(para1: HDC, para2: LPRECT, para3: WINUINT): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetBoundsRect".}

-proc GetBrushOrgEx*(para1: HDC, para2: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetBrushOrgEx".}

-proc GetClipBox*(para1: HDC, para2: LPRECT): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetClipBox".}

-proc GetClipRgn*(para1: HDC, para2: HRGN): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetClipRgn".}

-proc GetMetaRgn*(para1: HDC, para2: HRGN): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetMetaRgn".}

-proc GetCurrentObject*(para1: HDC, para2: WINUINT): HGDIOBJ{.stdcall,

-    dynlib: "gdi32", importc: "GetCurrentObject".}

-proc GetCurrentPositionEx*(para1: HDC, para2: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCurrentPositionEx".}

-proc GetDeviceCaps*(para1: HDC, para2: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetDeviceCaps".}

-proc GetDIBits*(para1: HDC, para2: HBITMAP, para3: WINUINT, para4: WINUINT,

-                para5: LPVOID, para6: LPBITMAPINFO, para7: WINUINT): int32{.

-    stdcall, dynlib: "gdi32", importc: "GetDIBits".}

-proc GetFontData*(para1: HDC, para2: DWORD, para3: DWORD, para4: LPVOID,

-                  para5: DWORD): DWORD{.stdcall, dynlib: "gdi32",

-                                        importc: "GetFontData".}

-proc GetGraphicsMode*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetGraphicsMode".}

-proc GetMapMode*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-                                     importc: "GetMapMode".}

-proc GetMetaFileBitsEx*(para1: HMETAFILE, para2: WINUINT, para3: LPVOID): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetMetaFileBitsEx".}

-proc GetNearestColor*(para1: HDC, para2: COLORREF): COLORREF{.stdcall,

-    dynlib: "gdi32", importc: "GetNearestColor".}

-proc GetNearestPaletteIndex*(para1: HPALETTE, para2: COLORREF): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetNearestPaletteIndex".}

-proc GetObjectType*(h: HGDIOBJ): DWORD{.stdcall, dynlib: "gdi32",

-                                        importc: "GetObjectType".}

-proc GetPaletteEntries*(para1: HPALETTE, para2: WINUINT, para3: WINUINT,

-                        para4: LPPALETTEENTRY): WINUINT{.stdcall, dynlib: "gdi32",

-    importc: "GetPaletteEntries".}

-proc GetPixel*(para1: HDC, para2: int32, para3: int32): COLORREF{.stdcall,

-    dynlib: "gdi32", importc: "GetPixel".}

-proc GetPixelFormat*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetPixelFormat".}

-proc GetPolyFillMode*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetPolyFillMode".}

-proc GetRasterizerCaps*(para1: LPRASTERIZER_STATUS, para2: WINUINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetRasterizerCaps".}

-proc GetRegionData*(para1: HRGN, para2: DWORD, para3: LPRGNDATA): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetRegionData".}

-proc GetRgnBox*(para1: HRGN, para2: LPRECT): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetRgnBox".}

-proc GetStockObject*(para1: int32): HGDIOBJ{.stdcall, dynlib: "gdi32",

-    importc: "GetStockObject".}

-proc GetStretchBltMode*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetStretchBltMode".}

-proc GetSystemPaletteEntries*(para1: HDC, para2: WINUINT, para3: WINUINT,

-                              para4: LPPALETTEENTRY): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetSystemPaletteEntries".}

-proc GetSystemPaletteUse*(para1: HDC): WINUINT{.stdcall, dynlib: "gdi32",

-    importc: "GetSystemPaletteUse".}

-proc GetTextCharacterExtra*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetTextCharacterExtra".}

-proc GetTextAlign*(para1: HDC): WINUINT{.stdcall, dynlib: "gdi32",

-                                      importc: "GetTextAlign".}

-proc GetTextColor*(para1: HDC): COLORREF{.stdcall, dynlib: "gdi32",

-    importc: "GetTextColor".}

-proc GetTextCharset*(hdc: HDC): int32{.stdcall, dynlib: "gdi32",

-                                       importc: "GetTextCharset".}

-proc GetTextCharsetInfo*(hdc: HDC, lpSig: LPFONTSIGNATURE, dwFlags: DWORD): int32{.

-    stdcall, dynlib: "gdi32", importc: "GetTextCharsetInfo".}

-proc TranslateCharsetInfo*(lpSrc: var DWORD, lpCs: LPCHARSETINFO, dwFlags: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "TranslateCharsetInfo".}

-proc GetFontLanguageInfo*(para1: HDC): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetFontLanguageInfo".}

-proc GetViewportExtEx*(para1: HDC, para2: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetViewportExtEx".}

-proc GetViewportOrgEx*(para1: HDC, para2: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetViewportOrgEx".}

-proc GetWindowExtEx*(para1: HDC, para2: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWindowExtEx".}

-proc GetWindowOrgEx*(para1: HDC, para2: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWindowOrgEx".}

-proc IntersectClipRect*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                        para5: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "IntersectClipRect".}

-proc InvertRgn*(para1: HDC, para2: HRGN): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "InvertRgn".}

-proc LineDDA*(para1: int32, para2: int32, para3: int32, para4: int32,

-              para5: LINEDDAPROC, para6: LPARAM): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "LineDDA".}

-proc LineTo*(para1: HDC, para2: int32, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "LineTo".}

-proc MaskBlt*(para1: HDC, para2: int32, para3: int32, para4: int32,

-              para5: int32, para6: HDC, para7: int32, para8: int32,

-              para9: HBITMAP, para10: int32, para11: int32, para12: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "MaskBlt".}

-proc PlgBlt*(para1: HDC, para2: var POINT, para3: HDC, para4: int32,

-             para5: int32, para6: int32, para7: int32, para8: HBITMAP,

-             para9: int32, para10: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "PlgBlt".}

-proc OffsetClipRgn*(para1: HDC, para2: int32, para3: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "OffsetClipRgn".}

-proc OffsetRgn*(para1: HRGN, para2: int32, para3: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "OffsetRgn".}

-proc PatBlt*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-             para6: DWORD): WINBOOL{.stdcall, dynlib: "gdi32", importc: "PatBlt".}

-proc Pie*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-          para6: int32, para7: int32, para8: int32, para9: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "Pie".}

-proc PlayMetaFile*(para1: HDC, para2: HMETAFILE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PlayMetaFile".}

-proc PaintRgn*(para1: HDC, para2: HRGN): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "PaintRgn".}

-proc PolyPolygon*(para1: HDC, para2: var POINT, para3: var WINT, para4: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyPolygon".}

-proc PtInRegion*(para1: HRGN, para2: int32, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PtInRegion".}

-proc PtVisible*(para1: HDC, para2: int32, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PtVisible".}

-proc RectInRegion*(para1: HRGN, para2: var RECT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "RectInRegion".}

-proc RectVisible*(para1: HDC, para2: var RECT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "RectVisible".}

-proc Rectangle*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "Rectangle".}

-proc RestoreDC*(para1: HDC, para2: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "RestoreDC".}

-proc RealizePalette*(para1: HDC): WINUINT{.stdcall, dynlib: "gdi32",

-                                        importc: "RealizePalette".}

-proc RoundRect*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                para5: int32, para6: int32, para7: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "RoundRect".}

-proc ResizePalette*(para1: HPALETTE, para2: WINUINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "ResizePalette".}

-proc SaveDC*(para1: HDC): int32{.stdcall, dynlib: "gdi32", importc: "SaveDC".}

-proc SelectClipRgn*(para1: HDC, para2: HRGN): int32{.stdcall, dynlib: "gdi32",

-    importc: "SelectClipRgn".}

-proc ExtSelectClipRgn*(para1: HDC, para2: HRGN, para3: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "ExtSelectClipRgn".}

-proc SetMetaRgn*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-                                     importc: "SetMetaRgn".}

-proc SelectObject*(para1: HDC, para2: HGDIOBJ): HGDIOBJ{.stdcall,

-    dynlib: "gdi32", importc: "SelectObject".}

-proc SelectPalette*(para1: HDC, para2: HPALETTE, para3: WINBOOL): HPALETTE{.

-    stdcall, dynlib: "gdi32", importc: "SelectPalette".}

-proc SetBkColor*(para1: HDC, para2: COLORREF): COLORREF{.stdcall,

-    dynlib: "gdi32", importc: "SetBkColor".}

-proc SetBkMode*(para1: HDC, para2: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetBkMode".}

-proc SetBitmapBits*(para1: HBITMAP, para2: DWORD, para3: pointer): LONG{.

-    stdcall, dynlib: "gdi32", importc: "SetBitmapBits".}

-proc SetBoundsRect*(para1: HDC, para2: var RECT, para3: WINUINT): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "SetBoundsRect".}

-proc SetDIBits*(para1: HDC, para2: HBITMAP, para3: WINUINT, para4: WINUINT,

-                para5: pointer, para6: PBITMAPINFO, para7: WINUINT): int32{.

-    stdcall, dynlib: "gdi32", importc: "SetDIBits".}

-proc SetDIBitsToDevice*(para1: HDC, para2: int32, para3: int32, para4: DWORD,

-                        para5: DWORD, para6: int32, para7: int32, para8: WINUINT,

-                        para9: WINUINT, para10: pointer, para11: var BITMAPINFO,

-                        para12: WINUINT): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetDIBitsToDevice".}

-proc SetMapperFlags*(para1: HDC, para2: DWORD): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "SetMapperFlags".}

-proc SetGraphicsMode*(hdc: HDC, iMode: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetGraphicsMode".}

-proc SetMapMode*(para1: HDC, para2: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetMapMode".}

-proc SetMetaFileBitsEx*(para1: WINUINT, para2: var int8): HMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "SetMetaFileBitsEx".}

-proc SetPaletteEntries*(para1: HPALETTE, para2: WINUINT, para3: WINUINT,

-                        para4: var PALETTEENTRY): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "SetPaletteEntries".}

-proc SetPixel*(para1: HDC, para2: int32, para3: int32, para4: COLORREF): COLORREF{.

-    stdcall, dynlib: "gdi32", importc: "SetPixel".}

-proc SetPixelV*(para1: HDC, para2: int32, para3: int32, para4: COLORREF): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetPixelV".}

-proc SetPolyFillMode*(para1: HDC, para2: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "SetPolyFillMode".}

-proc StretchBlt*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                 para5: int32, para6: HDC, para7: int32, para8: int32,

-                 para9: int32, para10: int32, para11: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "StretchBlt".}

-proc SetRectRgn*(para1: HRGN, para2: int32, para3: int32, para4: int32,

-                 para5: int32): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "SetRectRgn".}

-proc StretchDIBits*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                    para5: int32, para6: int32, para7: int32, para8: int32,

-                    para9: int32, para10: pointer, para11: var BITMAPINFO,

-                    para12: WINUINT, para13: DWORD): int32{.stdcall,

-    dynlib: "gdi32", importc: "StretchDIBits".}

-proc SetROP2*(para1: HDC, para2: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetROP2".}

-proc SetStretchBltMode*(para1: HDC, para2: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "SetStretchBltMode".}

-proc SetSystemPaletteUse*(para1: HDC, para2: WINUINT): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "SetSystemPaletteUse".}

-proc SetTextCharacterExtra*(para1: HDC, para2: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "SetTextCharacterExtra".}

-proc SetTextColor*(para1: HDC, para2: COLORREF): COLORREF{.stdcall,

-    dynlib: "gdi32", importc: "SetTextColor".}

-proc SetTextAlign*(para1: HDC, para2: WINUINT): WINUINT{.stdcall, dynlib: "gdi32",

-    importc: "SetTextAlign".}

-proc SetTextJustification*(para1: HDC, para2: int32, para3: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetTextJustification".}

-proc UpdateColors*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "UpdateColors".}

-proc PlayMetaFileRecord*(para1: HDC, para2: LPHANDLETABLE, para3: LPMETARECORD,

-                         para4: WINUINT): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "PlayMetaFileRecord".}

-proc EnumMetaFile*(para1: HDC, para2: HMETAFILE, para3: ENUMMETAFILEPROC,

-                   para4: LPARAM): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "EnumMetaFile".}

-proc CloseEnhMetaFile*(para1: HDC): HENHMETAFILE{.stdcall, dynlib: "gdi32",

-    importc: "CloseEnhMetaFile".}

-proc DeleteEnhMetaFile*(para1: HENHMETAFILE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "DeleteEnhMetaFile".}

-proc EnumEnhMetaFile*(para1: HDC, para2: HENHMETAFILE, para3: ENHMETAFILEPROC,

-                      para4: LPVOID, para5: var RECT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "EnumEnhMetaFile".}

-proc GetEnhMetaFileHeader*(para1: HENHMETAFILE, para2: WINUINT,

-                           para3: LPENHMETAHEADER): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetEnhMetaFileHeader".}

-proc GetEnhMetaFilePaletteEntries*(para1: HENHMETAFILE, para2: WINUINT,

-                                   para3: LPPALETTEENTRY): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetEnhMetaFilePaletteEntries".}

-proc GetEnhMetaFileBits*(para1: HENHMETAFILE, para2: WINUINT, para3: LPBYTE): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileBits".}

-proc GetWinMetaFileBits*(para1: HENHMETAFILE, para2: WINUINT, para3: LPBYTE,

-                         para4: WINT, para5: HDC): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetWinMetaFileBits".}

-proc PlayEnhMetaFile*(para1: HDC, para2: HENHMETAFILE, para3: RECT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PlayEnhMetaFile".}

-proc PlayEnhMetaFileRecord*(para1: HDC, para2: LPHANDLETABLE,

-                            para3: var ENHMETARECORD, para4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PlayEnhMetaFileRecord".}

-proc SetEnhMetaFileBits*(para1: WINUINT, para2: var int8): HENHMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "SetEnhMetaFileBits".}

-proc SetWinMetaFileBits*(para1: WINUINT, para2: var int8, para3: HDC,

-                         para4: var METAFILEPICT): HENHMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "SetWinMetaFileBits".}

-proc GdiComment*(para1: HDC, para2: WINUINT, para3: var int8): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GdiComment".}

-proc AngleArc*(para1: HDC, para2: int32, para3: int32, para4: DWORD,

-               para5: float32, para6: float32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "AngleArc".}

-proc PolyPolyline*(para1: HDC, para2: var POINT, para3: var DWORD, para4: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyPolyline".}

-proc GetWorldTransform*(para1: HDC, para2: LPXFORM): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWorldTransform".}

-proc SetWorldTransform*(para1: HDC, para2: var XFORM): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SetWorldTransform".}

-proc ModifyWorldTransform*(para1: HDC, para2: var XFORM, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "ModifyWorldTransform".}

-proc CombineTransform*(para1: LPXFORM, para2: var XFORM, para3: var XFORM): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "CombineTransform".}

-proc CreateDIBSection*(para1: HDC, para2: var BITMAPINFO, para3: WINUINT,

-                       para4: var pointer, para5: HANDLE, para6: DWORD): HBITMAP{.

-    stdcall, dynlib: "gdi32", importc: "CreateDIBSection".}

-proc GetDIBColorTable*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: var RGBQUAD): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetDIBColorTable".}

-proc SetDIBColorTable*(para1: HDC, para2: WINUINT, para3: WINUINT, para4: var RGBQUAD): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "SetDIBColorTable".}

-proc SetColorAdjustment*(para1: HDC, para2: var COLORADJUSTMENT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetColorAdjustment".}

-proc GetColorAdjustment*(para1: HDC, para2: LPCOLORADJUSTMENT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetColorAdjustment".}

-proc CreateHalftonePalette*(para1: HDC): HPALETTE{.stdcall, dynlib: "gdi32",

-    importc: "CreateHalftonePalette".}

-proc EndDoc*(para1: HDC): int32{.stdcall, dynlib: "gdi32", importc: "EndDoc".}

-proc StartPage*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-                                    importc: "StartPage".}

-proc EndPage*(para1: HDC): int32{.stdcall, dynlib: "gdi32", importc: "EndPage".}

-proc AbortDoc*(para1: HDC): int32{.stdcall, dynlib: "gdi32", importc: "AbortDoc".}

-proc SetAbortProc*(para1: HDC, para2: ABORTPROC): int32{.stdcall,

-    dynlib: "gdi32", importc: "SetAbortProc".}

-proc ArcTo*(para1: HDC, para2: int32, para3: int32, para4: int32, para5: int32,

-            para6: int32, para7: int32, para8: int32, para9: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "ArcTo".}

-proc BeginPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                      importc: "BeginPath".}

-proc CloseFigure*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "CloseFigure".}

-proc EndPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32", importc: "EndPath".}

-proc FillPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                     importc: "FillPath".}

-proc FlattenPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "FlattenPath".}

-proc GetPath*(para1: HDC, para2: LPPOINT, para3: LPBYTE, para4: int32): int32{.

-    stdcall, dynlib: "gdi32", importc: "GetPath".}

-proc PathToRegion*(para1: HDC): HRGN{.stdcall, dynlib: "gdi32",

-                                      importc: "PathToRegion".}

-proc PolyDraw*(para1: HDC, para2: var POINT, para3: var int8, para4: int32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyDraw".}

-proc SelectClipPath*(para1: HDC, para2: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SelectClipPath".}

-proc SetArcDirection*(para1: HDC, para2: int32): int32{.stdcall,

-    dynlib: "gdi32", importc: "SetArcDirection".}

-proc SetMiterLimit*(para1: HDC, para2: float32, para3: ptr float32): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetMiterLimit".}

-proc StrokeAndFillPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "StrokeAndFillPath".}

-proc StrokePath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                       importc: "StrokePath".}

-proc WidenPath*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                      importc: "WidenPath".}

-proc ExtCreatePen*(para1: DWORD, para2: DWORD, para3: var LOGBRUSH,

-                   para4: DWORD, para5: var DWORD): HPEN{.stdcall,

-    dynlib: "gdi32", importc: "ExtCreatePen".}

-proc GetMiterLimit*(para1: HDC, para2: ptr float32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetMiterLimit".}

-proc GetArcDirection*(para1: HDC): int32{.stdcall, dynlib: "gdi32",

-    importc: "GetArcDirection".}

-proc MoveToEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "MoveToEx".}

-proc CreatePolygonRgn*(para1: var POINT, para2: int32, para3: int32): HRGN{.

-    stdcall, dynlib: "gdi32", importc: "CreatePolygonRgn".}

-proc DPtoLP*(para1: HDC, para2: LPPOINT, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "DPtoLP".}

-proc LPtoDP*(para1: HDC, para2: LPPOINT, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "LPtoDP".}

-proc Polygon*(para1: HDC, para2: LPPOINT, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "Polygon".}

-proc Polyline*(para1: HDC, para2: LPPOINT, para3: int32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "Polyline".}

-proc PolyBezier*(para1: HDC, para2: LPPOINT, para3: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolyBezier".}

-proc PolyBezierTo*(para1: HDC, para2: POINT, para3: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolyBezierTo".}

-proc PolylineTo*(para1: HDC, para2: LPPOINT, para3: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolylineTo".}

-proc SetViewportExtEx*(para1: HDC, para2: int32, para3: int32, para4: LPSIZE): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetViewportExtEx".}

-proc SetViewportOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetViewportOrgEx".}

-proc SetWindowExtEx*(para1: HDC, para2: int32, para3: int32, para4: LPSIZE): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetWindowExtEx".}

-proc SetWindowOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetWindowOrgEx".}

-proc OffsetViewportOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "OffsetViewportOrgEx".}

-proc OffsetWindowOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "OffsetWindowOrgEx".}

-proc ScaleViewportExtEx*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                         para5: int32, para6: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "ScaleViewportExtEx".}

-proc ScaleWindowExtEx*(para1: HDC, para2: int32, para3: int32, para4: int32,

-                       para5: int32, para6: LPSIZE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "ScaleWindowExtEx".}

-proc SetBitmapDimensionEx*(para1: HBITMAP, para2: int32, para3: int32,

-                           para4: LPSIZE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "SetBitmapDimensionEx".}

-proc SetBrushOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetBrushOrgEx".}

-proc GetDCOrgEx*(para1: HDC, para2: LPPOINT): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetDCOrgEx".}

-proc FixBrushOrgEx*(para1: HDC, para2: int32, para3: int32, para4: LPPOINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "FixBrushOrgEx".}

-proc UnrealizeObject*(para1: HGDIOBJ): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "UnrealizeObject".}

-proc GdiFlush*(): WINBOOL{.stdcall, dynlib: "gdi32", importc: "GdiFlush".}

-proc GdiSetBatchLimit*(para1: DWORD): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GdiSetBatchLimit".}

-proc GdiGetBatchLimit*(): DWORD{.stdcall, dynlib: "gdi32",

-                                 importc: "GdiGetBatchLimit".}

-proc SetICMMode*(para1: HDC, para2: int32): int32{.stdcall, dynlib: "gdi32",

-    importc: "SetICMMode".}

-proc CheckColorsInGamut*(para1: HDC, para2: LPVOID, para3: LPVOID, para4: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "CheckColorsInGamut".}

-proc GetColorSpace*(para1: HDC): HANDLE{.stdcall, dynlib: "gdi32",

-    importc: "GetColorSpace".}

-proc SetColorSpace*(para1: HDC, para2: HCOLORSPACE): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SetColorSpace".}

-proc DeleteColorSpace*(para1: HCOLORSPACE): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "DeleteColorSpace".}

-proc GetDeviceGammaRamp*(para1: HDC, para2: LPVOID): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetDeviceGammaRamp".}

-proc SetDeviceGammaRamp*(para1: HDC, para2: LPVOID): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "SetDeviceGammaRamp".}

-proc ColorMatchToTarget*(para1: HDC, para2: HDC, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "ColorMatchToTarget".}

-proc CreatePropertySheetPageA*(lppsp: LPCPROPSHEETPAGE): HPROPSHEETPAGE{.

-    stdcall, dynlib: "comctl32", importc: "CreatePropertySheetPageA".}

-proc DestroyPropertySheetPage*(hPSPage: HPROPSHEETPAGE): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "DestroyPropertySheetPage".}

-proc InitCommonControls*(){.stdcall, dynlib: "comctl32",

-                            importc: "InitCommonControls".}

-proc ImageList_AddIcon*(himl: HIMAGELIST, hicon: HICON): int32

-proc ImageList_Create*(cx: int32, cy: int32, flags: WINUINT, cInitial: int32,

-                       cGrow: int32): HIMAGELIST{.stdcall, dynlib: "comctl32",

-    importc: "ImageList_Create".}

-proc ImageList_Destroy*(himl: HIMAGELIST): WINBOOL{.stdcall, dynlib: "comctl32",

-    importc: "ImageList_Destroy".}

-proc ImageList_GetImageCount*(himl: HIMAGELIST): int32{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_GetImageCount".}

-proc ImageList_Add*(himl: HIMAGELIST, hbmImage: HBITMAP, hbmMask: HBITMAP): int32{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_Add".}

-proc ImageList_ReplaceIcon*(himl: HIMAGELIST, i: int32, hicon: HICON): int32{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_ReplaceIcon".}

-proc ImageList_SetBkColor*(himl: HIMAGELIST, clrBk: COLORREF): COLORREF{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_SetBkColor".}

-proc ImageList_GetBkColor*(himl: HIMAGELIST): COLORREF{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_GetBkColor".}

-proc ImageList_SetOverlayImage*(himl: HIMAGELIST, iImage: int32, iOverlay: int32): WINBOOL{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_SetOverlayImage".}

-proc ImageList_Draw*(himl: HIMAGELIST, i: int32, hdcDst: HDC, x: int32,

-                     y: int32, fStyle: WINUINT): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_Draw".}

-proc ImageList_Replace*(himl: HIMAGELIST, i: int32, hbmImage: HBITMAP,

-                        hbmMask: HBITMAP): WINBOOL{.stdcall, dynlib: "comctl32",

-    importc: "ImageList_Replace".}

-proc ImageList_AddMasked*(himl: HIMAGELIST, hbmImage: HBITMAP, crMask: COLORREF): int32{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_AddMasked".}

-proc ImageList_DrawEx*(himl: HIMAGELIST, i: int32, hdcDst: HDC, x: int32,

-                       y: int32, dx: int32, dy: int32, rgbBk: COLORREF,

-                       rgbFg: COLORREF, fStyle: WINUINT): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_DrawEx".}

-proc ImageList_Remove*(himl: HIMAGELIST, i: int32): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_Remove".}

-proc ImageList_GetIcon*(himl: HIMAGELIST, i: int32, flags: WINUINT): HICON{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_GetIcon".}

-proc ImageList_BeginDrag*(himlTrack: HIMAGELIST, iTrack: int32,

-                          dxHotspot: int32, dyHotspot: int32): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_BeginDrag".}

-proc ImageList_EndDrag*(){.stdcall, dynlib: "comctl32",

-                           importc: "ImageList_EndDrag".}

-proc ImageList_DragEnter*(hwndLock: HWND, x: int32, y: int32): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_DragEnter".}

-proc ImageList_DragLeave*(hwndLock: HWND): WINBOOL{.stdcall, dynlib: "comctl32",

-    importc: "ImageList_DragLeave".}

-proc ImageList_DragMove*(x: int32, y: int32): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_DragMove".}

-proc ImageList_SetDragCursorImage*(himlDrag: HIMAGELIST, iDrag: int32,

-                                   dxHotspot: int32, dyHotspot: int32): WINBOOL{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_SetDragCursorImage".}

-proc ImageList_DragShowNolock*(fShow: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_DragShowNolock".}

-proc ImageList_GetDragImage*(ppt: LPPOINT, pptHotspot: LPPOINT): HIMAGELIST{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_GetDragImage".}

-proc ImageList_GetIconSize*(himl: HIMAGELIST, cx: var int32, cy: var int32): WINBOOL{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_GetIconSize".}

-proc ImageList_SetIconSize*(himl: HIMAGELIST, cx: int32, cy: int32): WINBOOL{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_SetIconSize".}

-proc ImageList_GetImageInfo*(himl: HIMAGELIST, i: int32,

-                             pImageInfo: var IMAGEINFO): WINBOOL{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_GetImageInfo".}

-proc ImageList_Merge*(himl1: HIMAGELIST, i1: int32, himl2: HIMAGELIST,

-                      i2: int32, dx: int32, dy: int32): HIMAGELIST{.stdcall,

-    dynlib: "comctl32", importc: "ImageList_Merge".}

-proc ImageList_SetImageCount*(himl: HIMAGELIST, uNewCount: WINUINT): int{.stdcall,

-    dynlib: "comctl32.dll", importc: "ImageList_SetImageCount".}

-proc CreateToolbarEx*(wnd: HWND, ws: DWORD, wID: WINUINT, nBitmaps: int32,

-                      hBMInst: HINST, wBMID: WINUINT, lpButtons: LPCTBBUTTON,

-                      iNumButtons: int32, dxButton: int32, dyButton: int32,

-                      dxBitmap: int32, dyBitmap: int32, uStructSize: WINUINT): HWND{.

-    stdcall, dynlib: "comctl32", importc: "CreateToolbarEx".}

-proc CreateMappedBitmap*(hInstance: HINST, idBitmap: int32, wFlags: WINUINT,

-                         lpColorMap: LPCOLORMAP, iNumMaps: int32): HBITMAP{.

-    stdcall, dynlib: "comctl32", importc: "CreateMappedBitmap".}

-proc MenuHelp*(uMsg: WINUINT, wp: WPARAM, lp: LPARAM, hMainMenu: HMENU,

-               hInst: HINST, hwndStatus: HWND, lpwIDs: var WINUINT){.stdcall,

-    dynlib: "comctl32", importc: "MenuHelp".}

-proc ShowHideMenuCtl*(wnd: HWND, uFlags: WINUINT, lpInfo: LPINT): WINBOOL{.

-    stdcall, dynlib: "comctl32", importc: "ShowHideMenuCtl".}

-proc GetEffectiveClientRect*(wnd: HWND, lprc: LPRECT, lpInfo: LPINT){.stdcall,

-    dynlib: "comctl32", importc: "GetEffectiveClientRect".}

-proc MakeDragList*(hLB: HWND): WINBOOL{.stdcall, dynlib: "comctl32",

-                                        importc: "MakeDragList".}

-proc DrawInsert*(handParent: HWND, hLB: HWND, nItem: int32){.stdcall,

-    dynlib: "comctl32", importc: "DrawInsert".}

-proc LBItemFromPt*(hLB: HWND, pt: POINT, bAutoScroll: WINBOOL): int32{.stdcall,

-    dynlib: "comctl32", importc: "LBItemFromPt".}

-proc CreateUpDownControl*(dwStyle: DWORD, x: int32, y: int32, cx: int32,

-                          cy: int32, hParent: HWND, nID: int32, hInst: HINST,

-                          hBuddy: HWND, nUpper: int32, nLower: int32,

-                          nPos: int32): HWND{.stdcall, dynlib: "comctl32",

-    importc: "CreateUpDownControl".}

-proc RegCloseKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32",

-                                     importc: "RegCloseKey".}

-proc RegSetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetKeySecurity".}

-proc RegFlushKey*(key: HKEY): LONG{.stdcall, dynlib: "advapi32",

-                                     importc: "RegFlushKey".}

-proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                        lpcbSecurityDescriptor: LPDWORD): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegGetKeySecurity".}

-proc RegNotifyChangeKeyValue*(key: HKEY, bWatchSubtree: WINBOOL,

-                              dwNotifyFilter: DWORD, hEvent: HANDLE,

-                              fAsynchronus: WINBOOL): LONG{.stdcall,

-    dynlib: "advapi32", importc: "RegNotifyChangeKeyValue".}

-proc IsValidCodePage*(CodePage: WINUINT): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "IsValidCodePage".}

-proc GetACP*(): WINUINT{.stdcall, dynlib: "kernel32", importc: "GetACP".}

-proc GetOEMCP*(): WINUINT{.stdcall, dynlib: "kernel32", importc: "GetOEMCP".}

-proc GetCPInfo*(para1: WINUINT, para2: LPCPINFO): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCPInfo".}

-proc IsDBCSLeadByte*(TestChar: int8): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "IsDBCSLeadByte".}

-proc IsDBCSLeadByteEx*(CodePage: WINUINT, TestChar: int8): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsDBCSLeadByteEx".}

-proc MultiByteToWideChar*(CodePage: WINUINT, dwFlags: DWORD,

-                          lpMultiByteStr: LPCSTR, cchMultiByte: int32,

-                          lpWideCharStr: LPWSTR, cchWideChar: int32): int32{.

-    stdcall, dynlib: "kernel32", importc: "MultiByteToWideChar".}

-proc WideCharToMultiByte*(CodePage: WINUINT, dwFlags: DWORD,

-                          lpWideCharStr: LPCWSTR, cchWideChar: int32,

-                          lpMultiByteStr: LPSTR, cchMultiByte: int32,

-                          lpDefaultChar: LPCSTR, lpUsedDefaultChar: LPBOOL): int32{.

-    stdcall, dynlib: "kernel32", importc: "WideCharToMultiByte".}

-proc IsValidLocale*(Locale: LCID, dwFlags: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "IsValidLocale".}

-proc ConvertDefaultLocale*(Locale: LCID): LCID{.stdcall, dynlib: "kernel32",

-    importc: "ConvertDefaultLocale".}

-proc GetThreadLocale*(): LCID{.stdcall, dynlib: "kernel32",

-                               importc: "GetThreadLocale".}

-proc SetThreadLocale*(Locale: LCID): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "SetThreadLocale".}

-proc GetSystemDefaultLangID*(): LANGID{.stdcall, dynlib: "kernel32",

-                                        importc: "GetSystemDefaultLangID".}

-proc GetUserDefaultLangID*(): LANGID{.stdcall, dynlib: "kernel32",

-                                      importc: "GetUserDefaultLangID".}

-proc GetSystemDefaultLCID*(): LCID{.stdcall, dynlib: "kernel32",

-                                    importc: "GetSystemDefaultLCID".}

-proc GetUserDefaultLCID*(): LCID{.stdcall, dynlib: "kernel32",

-                                  importc: "GetUserDefaultLCID".}

-proc ReadConsoleOutputAttribute*(hConsoleOutput: HANDLE, lpAttribute: LPWORD,

-                                 nLength: DWORD, dwReadCoord: COORD,

-                                 lpNumberOfAttrsRead: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputAttribute".}

-proc WriteConsoleOutputAttribute*(hConsoleOutput: HANDLE,

-                                  lpAttribute: var int16, nLength: DWORD,

-                                  dwWriteCoord: COORD,

-                                  lpNumberOfAttrsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputAttribute".}

-proc FillConsoleOutputAttribute*(hConsoleOutput: HANDLE, wAttribute: int16,

-                                 nLength: DWORD, dwWriteCoord: COORD,

-                                 lpNumberOfAttrsWritten: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputAttribute".}

-proc GetConsoleMode*(hConsoleHandle: HANDLE, lpMode: LPDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetConsoleMode".}

-proc GetNumberOfConsoleInputEvents*(hConsoleInput: HANDLE,

-                                    lpNumberOfEvents: PDWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetNumberOfConsoleInputEvents".}

-proc GetConsoleScreenBufferInfo*(hConsoleOutput: HANDLE,

-    lpConsoleScreenBufferInfo: PCONSOLE_SCREEN_BUFFER_INFO): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetConsoleScreenBufferInfo".}

-proc GetLargestConsoleWindowSize*(hConsoleOutput: HANDLE): COORD

-proc GetConsoleCursorInfo*(hConsoleOutput: HANDLE,

-                           lpConsoleCursorInfo: PCONSOLE_CURSOR_INFO): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetConsoleCursorInfo".}

-proc GetNumberOfConsoleMouseButtons*(lpNumberOfMouseButtons: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetNumberOfConsoleMouseButtons".}

-proc SetConsoleMode*(hConsoleHandle: HANDLE, dwMode: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleMode".}

-proc SetConsoleActiveScreenBuffer*(hConsoleOutput: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleActiveScreenBuffer".}

-proc FlushConsoleInputBuffer*(hConsoleInput: HANDLE): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FlushConsoleInputBuffer".}

-proc SetConsoleScreenBufferSize*(hConsoleOutput: HANDLE, dwSize: COORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleScreenBufferSize".}

-proc SetConsoleCursorPosition*(hConsoleOutput: HANDLE, dwCursorPosition: COORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleCursorPosition".}

-proc SetConsoleCursorInfo*(hConsoleOutput: HANDLE,

-                           lpConsoleCursorInfo: PCONSOLE_CURSOR_INFO): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleCursorInfo".}

-proc SetConsoleWindowInfo*(hConsoleOutput: HANDLE, bAbsolute: WINBOOL,

-                           lpConsoleWindow: var SMALL_RECT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleWindowInfo".}

-proc SetConsoleTextAttribute*(hConsoleOutput: HANDLE, wAttributes: int16): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleTextAttribute".}

-proc SetConsoleCtrlHandler*(HandlerRoutine: PHANDLER_ROUTINE, Add: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleCtrlHandler".}

-proc GenerateConsoleCtrlEvent*(dwCtrlEvent: DWORD, dwProcessGroupId: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GenerateConsoleCtrlEvent".}

-proc AllocConsole*(): WINBOOL{.stdcall, dynlib: "kernel32",

-                               importc: "AllocConsole".}

-proc FreeConsole*(): WINBOOL{.stdcall, dynlib: "kernel32",

-                              importc: "FreeConsole".}

-proc CreateConsoleScreenBuffer*(dwDesiredAccess: DWORD, dwShareMode: DWORD,

-                                lpSecurityAttributes: var SECURITY_ATTRIBUTES,

-                                dwFlags: DWORD, lpScreenBufferData: LPVOID): HANDLE{.

-    stdcall, dynlib: "kernel32", importc: "CreateConsoleScreenBuffer".}

-proc GetConsoleCP*(): WINUINT{.stdcall, dynlib: "kernel32", importc: "GetConsoleCP".}

-proc SetConsoleCP*(wCodePageID: WINUINT): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "SetConsoleCP".}

-proc GetConsoleOutputCP*(): WINUINT{.stdcall, dynlib: "kernel32",

-                                  importc: "GetConsoleOutputCP".}

-proc SetConsoleOutputCP*(wCodePageID: WINUINT): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetConsoleOutputCP".}

-proc WNetConnectionDialog*(wnd: HWND, dwType: DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetConnectionDialog".}

-proc WNetDisconnectDialog*(wnd: HWND, dwType: DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetDisconnectDialog".}

-proc WNetCloseEnum*(hEnum: HANDLE): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetCloseEnum".}

-proc CloseServiceHandle*(hSCObject: SC_HANDLE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "CloseServiceHandle".}

-proc ControlService*(hService: SC_HANDLE, dwControl: DWORD,

-                     lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ControlService".}

-proc DeleteService*(hService: SC_HANDLE): WINBOOL{.stdcall, dynlib: "advapi32",

-    importc: "DeleteService".}

-proc LockServiceDatabase*(hSCManager: SC_HANDLE): SC_LOCK{.stdcall,

-    dynlib: "advapi32", importc: "LockServiceDatabase".}

-proc NotifyBootConfigStatus*(BootAcceptable: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "NotifyBootConfigStatus".}

-proc QueryServiceObjectSecurity*(hService: SC_HANDLE,

-                                 dwSecurityInformation: SECURITY_INFORMATION,

-                                 lpSecurityDescriptor: PSECURITY_DESCRIPTOR,

-                                 cbBufSize: DWORD, pcbBytesNeeded: LPDWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceObjectSecurity".}

-proc QueryServiceStatus*(hService: SC_HANDLE, lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "QueryServiceStatus".}

-proc SetServiceObjectSecurity*(hService: SC_HANDLE,

-                               dwSecurityInformation: SECURITY_INFORMATION,

-                               lpSecurityDescriptor: PSECURITY_DESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "SetServiceObjectSecurity".}

-proc SetServiceStatus*(hServiceStatus: SERVICE_STATUS_HANDLE,

-                       lpServiceStatus: LPSERVICE_STATUS): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetServiceStatus".}

-proc UnlockServiceDatabase*(ScLock: SC_LOCK): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "UnlockServiceDatabase".}

-proc ChoosePixelFormat*(para1: HDC, para2: PPIXELFORMATDESCRIPTOR): int32{.

-    stdcall, dynlib: "gdi32", importc: "ChoosePixelFormat".}

-proc DescribePixelFormat*(para1: HDC, para2: int32, para3: WINUINT,

-                          para4: LPPIXELFORMATDESCRIPTOR): int32{.stdcall,

-    dynlib: "gdi32", importc: "DescribePixelFormat".}

-proc SetPixelFormat*(para1: HDC, para2: int32, para3: PPIXELFORMATDESCRIPTOR): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "SetPixelFormat".}

-proc SwapBuffers*(para1: HDC): WINBOOL{.stdcall, dynlib: "gdi32",

-                                        importc: "SwapBuffers".}

-proc DragQueryPoint*(para1: HDROP, para2: LPPOINT): WINBOOL{.stdcall,

-    dynlib: "shell32", importc: "DragQueryPoint".}

-proc DragFinish*(para1: HDROP){.stdcall, dynlib: "shell32",

-                                importc: "DragFinish".}

-proc DragAcceptFiles*(para1: HWND, para2: WINBOOL){.stdcall, dynlib: "shell32",

-    importc: "DragAcceptFiles".}

-proc DuplicateIcon*(para1: HINST, para2: HICON): HICON{.stdcall,

-    dynlib: "shell32", importc: "DuplicateIcon".}

-proc DdeAbandonTransaction*(para1: DWORD, para2: HCONV, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DdeAbandonTransaction".}

-proc DdeAccessData*(para1: HDDEDATA, para2: PDWORD): PBYTE{.stdcall,

-    dynlib: "user32", importc: "DdeAccessData".}

-proc DdeAddData*(para1: HDDEDATA, para2: PBYTE, para3: DWORD, para4: DWORD): HDDEDATA{.

-    stdcall, dynlib: "user32", importc: "DdeAddData".}

-proc DdeClientTransaction*(para1: PBYTE, para2: DWORD, para3: HCONV, para4: HSZ,

-                           para5: WINUINT, para6: WINUINT, para7: DWORD, para8: PDWORD): HDDEDATA{.

-    stdcall, dynlib: "user32", importc: "DdeClientTransaction".}

-proc DdeCmpStringHandles*(para1: HSZ, para2: HSZ): int32{.stdcall,

-    dynlib: "user32", importc: "DdeCmpStringHandles".}

-proc DdeConnect*(para1: DWORD, para2: HSZ, para3: HSZ, para4: var CONVCONTEXT): HCONV{.

-    stdcall, dynlib: "user32", importc: "DdeConnect".}

-proc DdeConnectList*(para1: DWORD, para2: HSZ, para3: HSZ, para4: HCONVLIST,

-                     para5: PCONVCONTEXT): HCONVLIST{.stdcall, dynlib: "user32",

-    importc: "DdeConnectList".}

-proc DdeCreateDataHandle*(para1: DWORD, para2: LPBYTE, para3: DWORD,

-                          para4: DWORD, para5: HSZ, para6: WINUINT, para7: WINUINT): HDDEDATA{.

-    stdcall, dynlib: "user32", importc: "DdeCreateDataHandle".}

-proc DdeDisconnect*(para1: HCONV): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeDisconnect".}

-proc DdeDisconnectList*(para1: HCONVLIST): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeDisconnectList".}

-proc DdeEnableCallback*(para1: DWORD, para2: HCONV, para3: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DdeEnableCallback".}

-proc DdeFreeDataHandle*(para1: HDDEDATA): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeFreeDataHandle".}

-proc DdeFreeStringHandle*(para1: DWORD, para2: HSZ): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DdeFreeStringHandle".}

-proc DdeGetData*(para1: HDDEDATA, para2: LPBYTE, para3: DWORD, para4: DWORD): DWORD{.

-    stdcall, dynlib: "user32", importc: "DdeGetData".}

-proc DdeGetLastError*(para1: DWORD): WINUINT{.stdcall, dynlib: "user32",

-    importc: "DdeGetLastError".}

-proc DdeImpersonateClient*(para1: HCONV): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeImpersonateClient".}

-proc DdeKeepStringHandle*(para1: DWORD, para2: HSZ): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DdeKeepStringHandle".}

-proc DdeNameService*(para1: DWORD, para2: HSZ, para3: HSZ, para4: WINUINT): HDDEDATA{.

-    stdcall, dynlib: "user32", importc: "DdeNameService".}

-proc DdePostAdvise*(para1: DWORD, para2: HSZ, para3: HSZ): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "DdePostAdvise".}

-proc DdeQueryConvInfo*(para1: HCONV, para2: DWORD, para3: PCONVINFO): WINUINT{.

-    stdcall, dynlib: "user32", importc: "DdeQueryConvInfo".}

-proc DdeQueryNextServer*(para1: HCONVLIST, para2: HCONV): HCONV{.stdcall,

-    dynlib: "user32", importc: "DdeQueryNextServer".}

-proc DdeReconnect*(para1: HCONV): HCONV{.stdcall, dynlib: "user32",

-    importc: "DdeReconnect".}

-proc DdeSetUserHandle*(para1: HCONV, para2: DWORD, para3: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DdeSetUserHandle".}

-proc DdeUnaccessData*(para1: HDDEDATA): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeUnaccessData".}

-proc DdeUninitialize*(para1: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "DdeUninitialize".}

-proc SHAddToRecentDocs*(para1: WINUINT, para2: LPCVOID){.stdcall,

-    dynlib: "shell32", importc: "SHAddToRecentDocs".}

-proc SHBrowseForFolder*(para1: LPBROWSEINFO): LPITEMIDLIST{.stdcall,

-    dynlib: "shell32", importc: "SHBrowseForFolder".}

-proc SHChangeNotify*(para1: LONG, para2: WINUINT, para3: LPCVOID, para4: LPCVOID){.

-    stdcall, dynlib: "shell32", importc: "SHChangeNotify".}

-proc SHFileOperation*(para1: LPSHFILEOPSTRUCT): int32{.stdcall,

-    dynlib: "shell32", importc: "SHFileOperation".}

-proc SHFreeNameMappings*(para1: HANDLE){.stdcall, dynlib: "shell32",

-    importc: "SHFreeNameMappings".}

-proc SHGetFileInfo*(para1: LPCTSTR, para2: DWORD, para3: var SHFILEINFO,

-                    para4: WINUINT, para5: WINUINT): DWORD{.stdcall,

-    dynlib: "shell32", importc: "SHGetFileInfo".}

-proc SHGetPathFromIDList*(para1: LPCITEMIDLIST, para2: LPTSTR): WINBOOL{.

-    stdcall, dynlib: "shell32", importc: "SHGetPathFromIDList".}

-proc SHGetSpecialFolderLocation*(para1: HWND, para2: int32,

-                                 para3: var LPITEMIDLIST): HRESULT{.stdcall,

-    dynlib: "shell32", importc: "SHGetSpecialFolderLocation".}

-proc CommDlgExtendedError*(): DWORD{.stdcall, dynlib: "comdlg32",

-                                     importc: "CommDlgExtendedError".}

-  # wgl Windows OpenGL helper functions

-proc wglUseFontBitmaps*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD): WINBOOL{.

-    stdcall, dynlib: "opengl32", importc: "wglUseFontBitmapsA".}

-proc wglCreateContext*(para1: HDC): HGLRC{.stdcall, dynlib: "opengl32",

-    importc: "wglCreateContext".}

-proc wglCreateLayerContext*(para1: HDC, para2: int32): HGLRC{.stdcall,

-    dynlib: "opengl32", importc: "wglCreateLayerContext".}

-proc wglCopyContext*(para1: HGLRC, para2: HGLRC, para3: WINUINT): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglCopyContext".}

-proc wglDeleteContext*(para1: HGLRC): WINBOOL{.stdcall, dynlib: "opengl32",

-    importc: "wglDeleteContext".}

-proc wglGetCurrentContext*(): HGLRC{.stdcall, dynlib: "opengl32",

-                                     importc: "wglGetCurrentContext".}

-proc wglGetCurrentDC*(): HDC{.stdcall, dynlib: "opengl32",

-                              importc: "wglGetCurrentDC".}

-proc wglMakeCurrent*(para1: HDC, para2: HGLRC): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglMakeCurrent".}

-proc wglShareLists*(para1: HGLRC, para2: HGLRC): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglShareLists".}

-proc wglUseFontBitmapsW*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD): WINBOOL{.

-    stdcall, dynlib: "opengl32", importc: "wglUseFontBitmapsW".}

-proc wglUseFontOutlines*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD,

-                         para5: float32, para6: float32, para7: int32,

-                         para8: LPGLYPHMETRICSFLOAT): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglUseFontOutlinesA".}

-proc wglUseFontBitmapsA*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD): WINBOOL{.

-    stdcall, dynlib: "opengl32", importc: "wglUseFontBitmapsA".}

-proc wglUseFontOutlinesA*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD,

-                          para5: float32, para6: float32, para7: int32,

-                          para8: LPGLYPHMETRICSFLOAT): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglUseFontOutlinesA".}

-proc wglDescribeLayerPlane*(para1: HDC, para2: int32, para3: int32, para4: WINUINT,

-                            para5: LPLAYERPLANEDESCRIPTOR): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglDescribeLayerPlane".}

-proc wglGetLayerPaletteEntries*(para1: HDC, para2: int32, para3: int32,

-                                para4: int32, para5: var COLORREF): int32{.

-    stdcall, dynlib: "opengl32", importc: "wglGetLayerPaletteEntries".}

-proc wglGetProcAddress*(para1: LPCSTR): Proc{.stdcall, dynlib: "opengl32",

-    importc: "wglGetProcAddress".}

-proc wglRealizeLayerPalette*(para1: HDC, para2: int32, para3: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "opengl32", importc: "wglRealizeLayerPalette".}

-proc wglSetLayerPaletteEntries*(para1: HDC, para2: int32, para3: int32,

-                                para4: int32, para5: var COLORREF): int32{.

-    stdcall, dynlib: "opengl32", importc: "wglSetLayerPaletteEntries".}

-proc wglSwapLayerBuffers*(para1: HDC, para2: WINUINT): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglSwapLayerBuffers".}

-proc wglUseFontOutlinesW*(para1: HDC, para2: DWORD, para3: DWORD, para4: DWORD,

-                          para5: float32, para6: float32, para7: int32,

-                          para8: LPGLYPHMETRICSFLOAT): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglUseFontOutlinesW".}

-  # translated macros

-proc Animate_Create*(hWndP: HWND, id: HMENU, dwStyle: DWORD, hInstance: HINST): HWND

-proc Animate_Open*(wnd: HWND, szName: LPTSTR): LRESULT

-proc Animate_Play*(wnd: HWND, `from`, `to`: int32, rep: WINUINT): LRESULT

-

-proc Animate_Stop*(wnd: HWND): LRESULT

-proc Animate_Close*(wnd: HWND): LRESULT

-proc Animate_Seek*(wnd: HWND, frame: int32): LRESULT

-proc PropSheet_AddPage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT

-proc PropSheet_Apply*(hPropSheetDlg: HWND): LRESULT

-proc PropSheet_CancelToClose*(hPropSheetDlg: HWND): LRESULT

-proc PropSheet_Changed*(hPropSheetDlg, hwndPage: HWND): LRESULT

-proc PropSheet_GetCurrentPageHwnd*(hDlg: HWND): LRESULT

-proc PropSheet_GetTabControl*(hPropSheetDlg: HWND): LRESULT

-proc PropSheet_IsDialogMessage*(hDlg: HWND, pMsg: int32): LRESULT

-proc PropSheet_PressButton*(hPropSheetDlg: HWND, iButton: int32): LRESULT

-proc PropSheet_QuerySiblings*(hPropSheetDlg: HWND, param1, param2: int32): LRESULT

-proc PropSheet_RebootSystem*(hPropSheetDlg: HWND): LRESULT

-proc PropSheet_RemovePage*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE,

-                           index: int32): LRESULT

-proc PropSheet_RestartWindows*(hPropSheetDlg: HWND): LRESULT

-proc PropSheet_SetCurSel*(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE,

-                          index: int32): LRESULT

-proc PropSheet_SetCurSelByID*(hPropSheetDlg: HWND, id: int32): LRESULT

-proc PropSheet_SetFinishText*(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT

-proc PropSheet_SetTitle*(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT

-proc PropSheet_SetWizButtons*(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT

-proc PropSheet_UnChanged*(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT

-proc Header_DeleteItem*(hwndHD: HWND, index: int32): WINBOOL

-proc Header_GetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL

-proc Header_GetItemCount*(hwndHD: HWND): int32

-proc Header_InsertItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32

-proc Header_Layout*(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL

-proc Header_SetItem*(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL

-proc ListView_Arrange*(hwndLV: HWND, code: WINUINT): LRESULT

-proc ListView_CreateDragImage*(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT

-proc ListView_DeleteAllItems*(wnd: HWND): LRESULT

-proc ListView_DeleteColumn*(wnd: HWND, iCol: int32): LRESULT

-proc ListView_DeleteItem*(wnd: HWND, iItem: int32): LRESULT

-proc ListView_EditLabel*(hwndLV: HWND, i: int32): LRESULT

-proc ListView_EnsureVisible*(hwndLV: HWND, i, fPartialOK: int32): LRESULT

-proc ListView_FindItem*(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32

-proc ListView_GetBkColor*(wnd: HWND): LRESULT

-proc ListView_GetCallbackMask*(wnd: HWND): LRESULT

-proc ListView_GetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT

-proc ListView_GetColumnWidth*(wnd: HWND, iCol: int32): LRESULT

-proc ListView_GetCountPerPage*(hwndLV: HWND): LRESULT

-proc ListView_GetEditControl*(hwndLV: HWND): LRESULT

-proc ListView_GetImageList*(wnd: HWND, iImageList: WINT): LRESULT

-proc ListView_GetISearchString*(hwndLV: HWND, lpsz: LPTSTR): LRESULT

-proc ListView_GetItem*(wnd: HWND, item: var LV_ITEM): LRESULT

-proc ListView_GetItemCount*(wnd: HWND): LRESULT

-proc ListView_GetItemPosition*(hwndLV: HWND, i: int32, pt: var POINT): int32

-proc ListView_GetItemSpacing*(hwndLV: HWND, fSmall: int32): LRESULT

-proc ListView_GetItemState*(hwndLV: HWND, i, mask: int32): LRESULT

-proc ListView_GetNextItem*(wnd: HWND, iStart, flags: int32): LRESULT

-proc ListView_GetOrigin*(hwndLV: HWND, pt: var POINT): LRESULT

-proc ListView_GetSelectedCount*(hwndLV: HWND): LRESULT

-proc ListView_GetStringWidth*(hwndLV: HWND, psz: LPCTSTR): LRESULT

-proc ListView_GetTextBkColor*(wnd: HWND): LRESULT

-proc ListView_GetTextColor*(wnd: HWND): LRESULT

-proc ListView_GetTopIndex*(hwndLV: HWND): LRESULT

-proc ListView_GetViewRect*(wnd: HWND, rc: var RECT): LRESULT

-proc ListView_HitTest*(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT

-proc ListView_InsertColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT

-proc ListView_InsertItem*(wnd: HWND, item: var LV_ITEM): LRESULT

-proc ListView_RedrawItems*(hwndLV: HWND, iFirst, iLast: int32): LRESULT

-proc ListView_Scroll*(hwndLV: HWND, dx, dy: int32): LRESULT

-proc ListView_SetBkColor*(wnd: HWND, clrBk: COLORREF): LRESULT

-proc ListView_SetCallbackMask*(wnd: HWND, mask: WINUINT): LRESULT

-proc ListView_SetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT

-proc ListView_SetColumnWidth*(wnd: HWND, iCol, cx: int32): LRESULT

-proc ListView_SetImageList*(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT

-proc ListView_SetItem*(wnd: HWND, item: var LV_ITEM): LRESULT

-proc ListView_SetItemCount*(hwndLV: HWND, cItems: int32): LRESULT

-proc ListView_SetItemPosition*(hwndLV: HWND, i, x, y: int32): LRESULT

-proc ListView_SetItemPosition32*(hwndLV: HWND, i, x, y: int32): LRESULT

-proc ListView_SetItemState*(hwndLV: HWND, i, data, mask: int32): LRESULT

-proc ListView_SetItemText*(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT

-proc ListView_SetTextBkColor*(wnd: HWND, clrTextBk: COLORREF): LRESULT

-proc ListView_SetTextColor*(wnd: HWND, clrText: COLORREF): LRESULT

-proc ListView_SortItems*(hwndLV: HWND, pfnCompare: PFNLVCOMPARE, lPrm: LPARAM): LRESULT

-proc ListView_Update*(hwndLV: HWND, i: int32): LRESULT

-proc TreeView_InsertItem*(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT

-proc TreeView_DeleteItem*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_DeleteAllItems*(wnd: HWND): LRESULT

-proc TreeView_Expand*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT

-proc TreeView_GetCount*(wnd: HWND): LRESULT

-proc TreeView_GetIndent*(wnd: HWND): LRESULT

-proc TreeView_SetIndent*(wnd: HWND, indent: int32): LRESULT

-proc TreeView_GetImageList*(wnd: HWND, iImage: WPARAM): LRESULT

-proc TreeView_SetImageList*(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT

-proc TreeView_GetNextItem*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT

-proc TreeView_GetChild*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetNextSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetPrevSibling*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetParent*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetFirstVisible*(wnd: HWND): LRESULT

-proc TreeView_GetNextVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetPrevVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetSelection*(wnd: HWND): LRESULT

-proc TreeView_GetDropHilight*(wnd: HWND): LRESULT

-proc TreeView_GetRoot*(wnd: HWND): LRESULT

-proc TreeView_Select*(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT

-proc TreeView_SelectItem*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_SelectDropTarget*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_SelectSetFirstVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetItem*(wnd: HWND, item: var TV_ITEM): LRESULT

-proc TreeView_SetItem*(wnd: HWND, item: var TV_ITEM): LRESULT

-proc TreeView_EditLabel*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_GetEditControl*(wnd: HWND): LRESULT

-proc TreeView_GetVisibleCount*(wnd: HWND): LRESULT

-proc TreeView_HitTest*(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT

-proc TreeView_CreateDragImage*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_SortChildren*(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT

-proc TreeView_EnsureVisible*(wnd: HWND, hitem: HTREEITEM): LRESULT

-proc TreeView_SortChildrenCB*(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT

-proc TreeView_EndEditLabelNow*(wnd: HWND, fCancel: int32): LRESULT

-proc TreeView_GetISearchString*(hwndTV: HWND, lpsz: LPTSTR): LRESULT

-proc TabCtrl_GetImageList*(wnd: HWND): LRESULT

-proc TabCtrl_SetImageList*(wnd: HWND, himl: HIMAGELIST): LRESULT

-proc TabCtrl_GetItemCount*(wnd: HWND): LRESULT

-proc TabCtrl_GetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT

-proc TabCtrl_SetItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT

-

-proc TabCtrl_InsertItem*(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT

-proc TabCtrl_DeleteItem*(wnd: HWND, i: int32): LRESULT

-proc TabCtrl_DeleteAllItems*(wnd: HWND): LRESULT

-proc TabCtrl_GetItemRect*(wnd: HWND, i: int32, rc: var RECT): LRESULT

-proc TabCtrl_GetCurSel*(wnd: HWND): LRESULT

-proc TabCtrl_SetCurSel*(wnd: HWND, i: int32): LRESULT

-proc TabCtrl_HitTest*(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT

-proc TabCtrl_SetItemExtra*(hwndTC: HWND, cb: int32): LRESULT

-proc TabCtrl_AdjustRect*(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT

-proc TabCtrl_SetItemSize*(wnd: HWND, x, y: int32): LRESULT

-proc TabCtrl_RemoveImage*(wnd: HWND, i: WPARAM): LRESULT

-proc TabCtrl_SetPadding*(wnd: HWND, cx, cy: int32): LRESULT

-proc TabCtrl_GetRowCount*(wnd: HWND): LRESULT

-proc TabCtrl_GetToolTips*(wnd: HWND): LRESULT

-proc TabCtrl_SetToolTips*(wnd: HWND, hwndTT: int32): LRESULT

-proc TabCtrl_GetCurFocus*(wnd: HWND): LRESULT

-proc TabCtrl_SetCurFocus*(wnd: HWND, i: int32): LRESULT

-proc SNDMSG*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT

-proc CommDlg_OpenSave_GetSpecA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetSpecW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-else:

-  proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetFilePathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetFilePathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-else:

-  proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetFolderPathA*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetFolderPathW*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT

-else:

-  proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_GetFolderIDList*(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT

-proc CommDlg_OpenSave_SetControlText*(hdlg: HWND, id: int32, text: LPSTR): LRESULT

-proc CommDlg_OpenSave_HideControl*(hdlg: HWND, id: int32): LRESULT

-proc CommDlg_OpenSave_SetDefExt*(hdlg: HWND, pszext: LPSTR): LRESULT

-proc GetNextWindow*(wnd: HWND, uCmd: WINUINT): HWND{.stdcall, dynlib: "user32",

-    importc: "GetWindow".}

-proc GlobalAllocPtr*(flags, cb: DWord): pointer

-proc GlobalFreePtr*(lp: pointer): pointer

-proc GlobalUnlockPtr*(lp: pointer): pointer

-proc GlobalLockPtr*(lp: pointer): pointer

-proc GlobalReAllocPtr*(lp: pointer, cbNew, flags: DWord): pointer

-proc GlobalPtrHandle*(lp: pointer): pointer

-proc SetLayeredWindowAttributes*(hwnd: HWND, crKey: COLORREF, bAlpha: int8,

-                                 dwFlags: DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetLayeredWindowAttributes".}

-type

-  PIID* = PGUID

-  TIID* = GUID

-  TFNDlgProc* = FARPROC

-  TFNThreadStartRoutine* = FARPROC

-  TFNTimerAPCRoutine* = FARPROC

-  TFNFiberStartRoutine* = FARPROC

-  TFNHookProc* = HOOKPROC

-  PObjectTypeList* = ptr TObjectTypeList

-  OBJECT_TYPE_LIST* {.final, pure.} = object

-    Level*: int16

-    Sbz*: int16

-    ObjectType*: PGUID

-

-  TObjectTypeList* = OBJECT_TYPE_LIST

-  AUDIT_EVENT_TYPE* = DWORD

-  PBlendFunction* = ptr TBlendFunction

-  BLENDFUNCTION* {.final, pure.} = object

-    BlendOp*: int8

-    BlendFlags*: int8

-    SourceConstantAlpha*: int8

-    AlphaFormat*: int8

-

-  TBlendFunction* = BLENDFUNCTION

-  WIN_CERTIFICATE* {.final, pure.} = object

-    dwLength*: DWord

-    wRevision*: int16

-    wCertificateType*: int16

-    bCertificate*: array[0..0, int8]

-

-  TWinCertificate* = WIN_CERTIFICATE

-  PWinCertificate* = ptr TWinCertificate

-  TMaxLogPalette* {.final, pure.} = object

-    palVersion*: int16

-    palNumEntries*: int16

-    palPalEntry*: array[int8, PaletteEntry]

-

-  PMaxLogPalette* = ptr TMaxLogPalette

-  POSVersionInfoA* = POSVERSIONINFO

-  TBitmapFileHeader* = BITMAPFILEHEADER

-  PBitmapFileHeader* = ptr TBitmapFileHeader

-

-const

-  # dll names

-  advapi32* = "advapi32.dll"

-  kernel32* = "kernel32.dll"

-  mpr* = "mpr.dll"

-  version* = "version.dll"

-  comctl32* = "comctl32.dll"

-  gdi32* = "gdi32.dll"

-  opengl32* = "opengl32.dll"

-  user32* = "user32.dll"

-  wintrust* = "wintrust.dll"

-  # Openfile Share modes normally declared in sysutils

-  fmShareCompat* = 0x00000000

-  fmShareExclusive* = 0x00000010

-  fmShareDenyWrite* = 0x00000020

-  fmShareDenyRead* = 0x00000030

-  fmShareDenyNone* = 0x00000040

-  # HRESULT codes, delphilike

-  SIF_TRACKPOS* = 0x00000010

-  HTBORDER* = 18

-  CP_UTF7* = 65000

-  CP_UTF8* = 65001

-  CREATE_NO_WINDOW* = 0x08000000

-  VK_ATTN* = 246

-  VK_CRSEL* = 247

-  VK_EXSEL* = 248

-  VK_EREOF* = 249

-  VK_PLAY* = 250

-  VK_ZOOM* = 251

-  VK_NONAME* = 252

-  VK_PA1* = 253

-  VK_OEM_CLEAR* = 254

-

-const                         # Severity values

-  FACILITY_NT_BIT* = 0x10000000

-

-                            #  A language ID is a 16 bit value which is the combination of a

-                            #  primary language ID and a secondary language ID.  The bits are

-                            #  allocated as follows:

-                            #

-                            #       +-----------------------+-------------------------+

-                            #       |     Sublanguage ID    |   Primary Language ID   |

-                            #       +-----------------------+-------------------------+

-                            #        15                   10 9                       0   bit

-                            #

-                            #

-                            #  Language ID creation/extraction macros:

-                            #

-                            #    MAKELANGID    - construct language id from a primary language id and

-                            #                    a sublanguage id.

-                            #    PRIMARYLANGID - extract primary language id from a language id.

-                            #    SUBLANGID     - extract sublanguage id from a language id.

-                            #

-proc MAKELANGID*(PrimaryLang, SubLang: USHORT): int16

-proc PRIMARYLANGID*(LangId: int16): int16

-proc SUBLANGID*(LangId: int16): int16

-

-  #

-  #  A locale ID is a 32 bit value which is the combination of a

-  #  language ID, a sort ID, and a reserved area.  The bits are

-  #  allocated as follows:

-  #

-  #       +-------------+---------+-------------------------+

-  #       |   Reserved  | Sort ID |      Language ID        |

-  #       +-------------+---------+-------------------------+

-  #        31         20 19     16 15                      0   bit

-  #

-  #

-  #  Locale ID creation/extraction macros:

-  #

-  #    MAKELCID            - construct the locale id from a language id and a sort id.

-  #    MAKESORTLCID        - construct the locale id from a language id, sort id, and sort version.

-  #    LANGIDFROMLCID      - extract the language id from a locale id.

-  #    SORTIDFROMLCID      - extract the sort id from a locale id.

-  #    SORTVERSIONFROMLCID - extract the sort version from a locale id.

-  #

-const

-  NLS_VALID_LOCALE_MASK* = 0x000FFFFF

-

-proc MAKELCID*(LangId, SortId: int16): DWORD

-proc MAKESORTLCID*(LangId, SortId, SortVersion: int16): DWORD

-proc LANGIDFROMLCID*(LocaleId: LCID): int16

-proc SORTIDFROMLCID*(LocaleId: LCID): int16

-proc SORTVERSIONFROMLCID*(LocaleId: LCID): int16

-

-  #

-  #  Default System and User IDs for language and locale.

-  #

-proc LANG_SYSTEM_DEFAULT*(): int16

-proc LANG_USER_DEFAULT*(): int16

-proc LOCALE_NEUTRAL*(): DWORD

-proc LOCALE_INVARIANT*(): DWORD

-proc Succeeded*(Status: HRESULT): WINBOOL

-proc Failed*(Status: HRESULT): WINBOOL

-proc IsError*(Status: HRESULT): WINBOOL

-proc HResultCode*(hr: HRESULT): int32

-proc HResultFacility*(hr: HRESULT): int32

-proc HResultSeverity*(hr: HRESULT): int32

-proc MakeResult*(p1, p2, mask: int32): HRESULT

-proc HResultFromWin32*(x: int32): HRESULT

-proc HResultFromNT*(x: int32): HRESULT

-proc InitializeCriticalSection*(CriticalSection: var TRTLCriticalSection){.

-    stdcall, dynlib: "kernel32", importc: "InitializeCriticalSection".}

-proc EnterCriticalSection*(CriticalSection: var TRTLCriticalSection){.stdcall,

-    dynlib: "kernel32", importc: "EnterCriticalSection".}

-proc LeaveCriticalSection*(CriticalSection: var TRTLCriticalSection){.stdcall,

-    dynlib: "kernel32", importc: "LeaveCriticalSection".}

-proc DeleteCriticalSection*(CriticalSection: var TRTLCriticalSection){.stdcall,

-    dynlib: "kernel32", importc: "DeleteCriticalSection".}

-proc InitializeCriticalSectionAndSpinCount*(

-    CriticalSection: var TRTLCriticalSection, dwSpinCount: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32",

-    importc: "InitializeCriticalSectionAndSpinCount".}

-proc SetCriticalSectionSpinCount*(CriticalSection: var TRTLCriticalSection,

-                                  dwSpinCount: DWORD): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "SetCriticalSectionSpinCount".}

-proc TryEnterCriticalSection*(CriticalSection: var TRTLCriticalSection): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "TryEnterCriticalSection".}

-proc ControlService*(hService: SC_HANDLE, dwControl: DWORD,

-                     ServiceStatus: var SERVICESTATUS): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ControlService".}

-proc QueryServiceStatus*(hService: SC_HANDLE,

-                         lpServiceStatus: var SERVICESTATUS): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "QueryServiceStatus".}

-proc SetServiceStatus*(hServiceStatus: SERVICE_STATUS_HANDLE,

-                       ServiceStatus: SERVICESTATUS): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "SetServiceStatus".}

-proc AdjustTokenPrivileges*(TokenHandle: Handle, DisableAllPrivileges: WINBOOL,

-                            NewState: TTokenPrivileges, BufferLength: DWORD,

-                            PreviousState: var TTokenPrivileges,

-                            ReturnLength: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AdjustTokenPrivileges".}

-proc AdjustWindowRect*(lpRect: var Rect, dwStyle: DWORD, bMenu: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "AdjustWindowRect".}

-proc AdjustWindowRectEx*(lpRect: var Rect, dwStyle: DWORD, bMenu: WINBOOL,

-                         dwExStyle: DWORD): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "AdjustWindowRectEx".}

-proc AllocateAndInitializeSid*(pIdentifierAuthority: SIDIdentifierAuthority,

-                               nSubAuthorityCount: int8,

-                               nSubAuthority0, nSubAuthority1: DWORD,

-    nSubAuthority2, nSubAuthority3, nSubAuthority4: DWORD, nSubAuthority5,

-    nSubAuthority6, nSubAuthority7: DWORD, pSid: var pointer): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AllocateAndInitializeSid".}

-proc AllocateLocallyUniqueId*(Luid: var LargeInteger): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "AllocateLocallyUniqueId".}

-proc BackupRead*(hFile: Handle, lpBuffer: PByte, nNumberOfBytesToRead: DWORD,

-                 lpNumberOfBytesRead: var DWORD, bAbort: WINBOOL,

-                 bProcessSecurity: WINBOOL, lpContext: var pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BackupRead".}

-proc BackupSeek*(hFile: Handle, dwLowBytesToSeek, dwHighBytesToSeek: DWORD,

-                 lpdwLowByteSeeked, lpdwHighByteSeeked: var DWORD,

-                 lpContext: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "BackupSeek".}

-proc BackupWrite*(hFile: Handle, lpBuffer: PByte, nNumberOfBytesToWrite: DWORD,

-                  lpNumberOfBytesWritten: var DWORD,

-                  bAbort, bProcessSecurity: WINBOOL, lpContext: var pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BackupWrite".}

-proc BeginPaint*(wnd: HWND, lpPaint: var PaintStruct): HDC{.stdcall,

-    dynlib: "user32", importc: "BeginPaint".}

-proc BuildCommDCB*(lpDef: cstring, lpDCB: var DCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "BuildCommDCBA".}

-proc BuildCommDCBA*(lpDef: LPCSTR, lpDCB: var DCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "BuildCommDCBA".}

-proc BuildCommDCBAndTimeouts*(lpDef: cstring, lpDCB: var DCB,

-                              lpCommTimeouts: var CommTimeouts): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}

-proc BuildCommDCBAndTimeoutsA*(lpDef: LPCSTR, lpDCB: var DCB,

-                               lpCommTimeouts: var CommTimeouts): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}

-proc BuildCommDCBAndTimeoutsW*(lpDef: LPWSTR, lpDCB: var DCB,

-                               lpCommTimeouts: var CommTimeouts): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsW".}

-proc BuildCommDCBW*(lpDef: LPWSTR, lpDCB: var DCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "BuildCommDCBW".}

-proc CallMsgFilter*(lpMsg: var TMsg, nCode: int): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CallMsgFilterA".}

-proc CallMsgFilterA*(lpMsg: var TMsg, nCode: int): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CallMsgFilterA".}

-proc CallMsgFilterW*(lpMsg: var TMsg, nCode: int): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CallMsgFilterW".}

-proc CallNamedPipe*(lpNamedPipeName: cstring, lpInBuffer: pointer,

-                    nInBufferSize: DWORD, lpOutBuffer: pointer,

-                    nOutBufferSize: DWORD, lpBytesRead: var DWORD,

-                    nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CallNamedPipeA".}

-proc CallNamedPipeA*(lpNamedPipeName: LPCSTR, lpInBuffer: pointer,

-                     nInBufferSize: DWORD, lpOutBuffer: pointer,

-                     nOutBufferSize: DWORD, lpBytesRead: var DWORD,

-                     nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CallNamedPipeA".}

-proc CallNamedPipeW*(lpNamedPipeName: LPWSTR, lpInBuffer: pointer,

-                     nInBufferSize: DWORD, lpOutBuffer: pointer,

-                     nOutBufferSize: DWORD, lpBytesRead: var DWORD,

-                     nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "CallNamedPipeW".}

-proc CoRegisterClassObject*(para1: CLSID, para2: pointer, para3: DWORD,

-                            para4: DWORD, out_para5: DWORD): HRESULT{.stdcall,

-    dynlib: "ole32.dll", importc: "CoRegisterClassObject".}

-proc ChangeDisplaySettings*(lpDevMode: var DevMode, dwFlags: DWORD): int32{.

-    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}

-proc ChangeDisplaySettingsA*(lpDevMode: var DevMode, dwFlags: DWORD): int32{.

-    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}

-proc ChangeDisplaySettingsEx*(lpszDeviceName: cstring,

-                              lpDevMode: var DevMode, wnd: HWND,

-                              dwFlags: DWORD, lParam: pointer): int32{.stdcall,

-    dynlib: "user32", importc: "ChangeDisplaySettingsExA".}

-proc ChangeDisplaySettingsExA*(lpszDeviceName: LPCSTR,

-                               lpDevMode: var DevMode, wnd: HWND,

-                               dwFlags: DWORD, lParam: pointer): int32{.stdcall,

-    dynlib: "user32", importc: "ChangeDisplaySettingsExA".}

-proc ChangeDisplaySettingsExW*(lpszDeviceName: LPWSTR,

-                               lpDevMode: var DevModeW, wnd: HWND,

-                               dwFlags: DWORD, lParam: pointer): int32{.stdcall,

-    dynlib: "user32", importc: "ChangeDisplaySettingsExW".}

-proc ChangeDisplaySettingsW*(lpDevMode: var DevModeW, dwFlags: DWORD): int32{.

-    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsW".}

-  #function CheckColorsInGamut(DC: HDC; var RGBQuads, Results; Count: DWORD): WINBOOL; stdcall; external 'gdi32' name 'CheckColorsInGamut';

-proc ChoosePixelFormat*(para1: HDC, para2: var PIXELFORMATDESCRIPTOR): int32{.

-    stdcall, dynlib: "gdi32", importc: "ChoosePixelFormat".}

-proc ClearCommError*(hFile: Handle, lpErrors: var DWORD, lpStat: PComStat): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ClearCommError".}

-proc ClientToScreen*(wnd: HWND, lpPoint: var Point): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ClientToScreen".}

-proc ClipCursor*(lpRect: var RECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ClipCursor".}

-  #function CombineTransform(var p1: XForm; const p2, p3: XForm): WINBOOL; stdcall; external 'gdi32' name 'CombineTransform';

-proc CommConfigDialog*(lpszName: cstring, wnd: HWND, lpCC: var CommConfig): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}

-proc CommConfigDialogA*(lpszName: LPCSTR, wnd: HWND, lpCC: var CommConfig): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}

-proc CommConfigDialogW*(lpszName: LPWSTR, wnd: HWND, lpCC: var CommConfig): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".}

-  #function CompareFileTime(const lpFileTime1, lpFileTime2: FileTime): Longint; stdcall; external 'kernel32' name 'CompareFileTime';

-  #function ConvertToAutoInheritPrivateObjectSecurity(ParentDescriptor, CurrentSecurityDescriptor: PSecurityDescriptor; var NewDescriptor: PSecurityDescriptor; ObjectType: PGUID; IsDirectoryObject: WINBOOL; const GenericMapping: GenericMapping): WINBOOL;

-  #  stdcall; external 'advapi32' name 'ConvertToAutoInheritPrivateObjectSecurity';

-proc CopyAcceleratorTable*(hAccelSrc: HACCEL, lpAccelDst: pointer,

-                           cAccelEntries: int): int{.stdcall, dynlib: "user32",

-    importc: "CopyAcceleratorTableA".}

-proc CopyAcceleratorTableA*(hAccelSrc: HACCEL, lpAccelDst: pointer,

-                            cAccelEntries: int): int{.stdcall, dynlib: "user32",

-    importc: "CopyAcceleratorTableA".}

-proc CopyAcceleratorTableW*(hAccelSrc: HACCEL, lpAccelDst: pointer,

-                            cAccelEntries: int): int{.stdcall, dynlib: "user32",

-    importc: "CopyAcceleratorTableW".}

-proc CopyRect*(lprcDst: var Rect, lprcSrc: Rect): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CopyRect".}

-proc CreateAcceleratorTable*(Accel: pointer, Count: int): HACCEL{.stdcall,

-    dynlib: "user32", importc: "CreateAcceleratorTableA".}

-proc CreateAcceleratorTableA*(Accel: pointer, Count: int): HACCEL{.stdcall,

-    dynlib: "user32", importc: "CreateAcceleratorTableA".}

-proc CreateAcceleratorTableW*(Accel: pointer, Count: int): HACCEL{.stdcall,

-    dynlib: "user32", importc: "CreateAcceleratorTableW".}

-  #function CreateBitmapIndirect(const p1: Bitmap): HBITMAP; stdcall; external 'gdi32' name 'CreateBitmapIndirect';

-  #function CreateBrushIndirect(const p1: LogBrush): HBRUSH; stdcall; external 'gdi32' name 'CreateBrushIndirect';

-proc CreateColorSpace*(ColorSpace: var LogColorSpace): HCOLORSPACE{.stdcall,

-    dynlib: "gdi32", importc: "CreateColorSpaceA".}

-proc CreateColorSpaceA*(ColorSpace: var LogColorSpace): HCOLORSPACE{.stdcall,

-    dynlib: "gdi32", importc: "CreateColorSpaceA".}

-  #function CreateColorSpaceW(var ColorSpace: LogColorSpaceW): HCOLORSPACE; stdcall; external 'gdi32' name 'CreateColorSpaceW';

-proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: DlgTemplate,

-                                hWndParent: HWND, lpDialogFunc: TFNDlgProc,

-                                dwInitParam: LPARAM): HWND{.stdcall,

-    dynlib: "user32", importc: "CreateDialogIndirectParamA".}

-  #function CreateDialogIndirectParamA(hInstance: HINST; const lpTemplate: DlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamA';

-  #function CreateDialogIndirectParamW(hInstance: HINST; const lpTemplate: DlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamW';

-  #function CreateDIBitmap(DC: HDC; var InfoHeader: BitmapInfoHeader; dwUsage: DWORD; InitBits: PChar; var InitInfo: BitmapInfo; wUsage: WINUINT): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBitmap';

-  #function CreateDIBPatternBrushPt(const p1: pointer; p2: WINUINT): HBRUSH; stdcall; external 'gdi32' name 'CreateDIBPatternBrushPt';

-  #function CreateDIBSection(DC: HDC; const p2: BitmapInfo; p3: WINUINT; var p4: pointer; p5: Handle; p6: DWORD): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBSection';

-  #function CreateEllipticRgnIndirect(const p1: Rect): HRGN; stdcall; external 'gdi32' name 'CreateEllipticRgnIndirect';

-  #function CreateFontIndirect(const p1: LogFont): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectA';

-  #function CreateFontIndirectA(const p1: LogFont): HFONT; stdcall; external 'gdi32' name 'CreateFontIndirectA';

-  #function CreateFontIndirectEx(const p1: PEnumLogFontExDV): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectExA';

-  #function CreateFontIndirectExA(const p1: PEnumLogFontExDVA): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectExA';

-  #function CreateFontIndirectExW(const p1: PEnumLogFontExDVW): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectExW';

-  #function CreateFontIndirectW(const p1: LogFontW): HFONT; stdcall; external 'gdi32' name 'CreateFontIndirectW';

-proc CreateIconIndirect*(piconinfo: var IconInfo): HICON{.stdcall,

-    dynlib: "user32", importc: "CreateIconIndirect".}

-  #function CreatePalette(const LogPalette: LogPalette): HPalette; stdcall; external 'gdi32' name 'CreatePalette';

-  #function CreatePenIndirect(const LogPen: LogPen): HPEN; stdcall; external 'gdi32' name 'CreatePenIndirect';

-proc CreatePipe*(hReadPipe, hWritePipe: var Handle,

-                 lpPipeAttributes: PSecurityAttributes, nSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreatePipe".}

-proc CreatePolygonRgn*(Points: pointer, Count, FillMode: int): HRGN{.stdcall,

-    dynlib: "gdi32", importc: "CreatePolygonRgn".}

-proc CreatePolyPolygonRgn*(pPtStructs: pointer, pIntArray: pointer, p3, p4: int): HRGN{.

-    stdcall, dynlib: "gdi32", importc: "CreatePolyPolygonRgn".}

-  #function CreatePrivateObjectSecurity(ParentDescriptor, CreatorDescriptor: PSecurityDescriptor; var NewDescriptor: PSecurityDescriptor; IsDirectoryObject: WINBOOL; Token: Handle; const GenericMapping: GenericMapping): WINBOOL;

-  #  stdcall; external 'advapi32' name 'CreatePrivateObjectSecurity';

-  #function CreatePrivateObjectSecurityEx(ParentDescriptor, CreatorDescriptor: PSecurityDescriptor; var NewDescriptor: PSecurityDescriptor; ObjectType: PGUID; IsContainerObject: WINBOOL; AutoInheritFlags: ULONG; Token: Handle;

-  #  const GenericMapping: GenericMapping): WINBOOL;stdcall; external 'advapi32' name 'CreatePrivateObjectSecurityEx';

-proc CreateProcess*(lpApplicationName: cstring, lpCommandLine: cstring,

-    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

-                    bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                    lpEnvironment: pointer, lpCurrentDirectory: cstring,

-                    lpStartupInfo: StartupInfo,

-                    lpProcessInformation: var ProcessInformation): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

-proc CreateProcessA*(lpApplicationName: LPCSTR, lpCommandLine: LPCSTR,

-    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

-                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: pointer, lpCurrentDirectory: LPCSTR,

-                     lpStartupInfo: StartupInfo,

-                     lpProcessInformation: var ProcessInformation): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

-  #function CreateProcessAsUser(hToken: Handle; lpApplicationName: PChar; lpCommandLine: PChar; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  # lpEnvironment: pointer; lpCurrentDirectory: PChar; const lpStartupInfo: StartupInfo; var lpProcessInformation: ProcessInformation): WINBOOL;stdcall; external 'advapi32' name 'CreateProcessAsUserA';

-  #function CreateProcessAsUserA(hToken: Handle; lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  #  lpEnvironment: pointer; lpCurrentDirectory: LPCSTR; const lpStartupInfo: StartupInfo; var lpProcessInformation: ProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserA';

-  #function CreateProcessAsUserW(hToken: Handle; lpApplicationName: LPWSTR; lpCommandLine: LPWSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  #  lpEnvironment: pointer; lpCurrentDirectory: LPWSTR; const lpStartupInfo: StartupInfo; var lpProcessInformation: ProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserW';

-proc CreateProcessW*(lpApplicationName: LPWSTR, lpCommandLine: LPWSTR,

-    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

-                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: pointer, lpCurrentDirectory: LPWSTR,

-                     lpStartupInfo: StartupInfo,

-                     lpProcessInformation: var ProcessInformation): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "CreateProcessW".}

-  #function CreateRectRgnIndirect(const p1: Rect): HRGN; stdcall; external 'gdi32' name 'CreateRectRgnIndirect';

-proc CreateRemoteThread*(hProcess: Handle, lpThreadAttributes: pointer,

-                         dwStackSize: DWORD,

-                         lpStartAddress: TFNThreadStartRoutine,

-                         lpParameter: pointer, dwCreationFlags: DWORD,

-                         lpThreadId: var DWORD): Handle{.stdcall,

-    dynlib: "kernel32", importc: "CreateRemoteThread".}

-proc CreateThread*(lpThreadAttributes: pointer, dwStackSize: DWORD,

-                   lpStartAddress: TFNThreadStartRoutine, lpParameter: pointer,

-                   dwCreationFlags: DWORD, lpThreadId: var DWORD): Handle{.

-    stdcall, dynlib: "kernel32", importc: "CreateThread".}

-proc DdeSetQualityOfService*(hWndClient: HWnd,

-                             pqosNew: SecurityQualityOfService,

-                             pqosPrev: PSecurityQualityOfService): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DdeSetQualityOfService".}

-  #function DeleteAce(var pAcl: ACL; dwAceIndex: DWORD): WINBOOL; stdcall; external 'advapi32' name 'DeleteAce';

-proc DescribePixelFormat*(DC: HDC, p2: int, p3: WINUINT,

-                          p4: var PixelFormatDescriptor): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "DescribePixelFormat".}

-  #function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): WINBOOL; stdcall; external 'advapi32' name 'DestroyPrivateObjectSecurity';

-proc DeviceIoControl*(hDevice: Handle, dwIoControlCode: DWORD,

-                      lpInBuffer: pointer, nInBufferSize: DWORD,

-                      lpOutBuffer: pointer, nOutBufferSize: DWORD,

-                      lpBytesReturned: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "DeviceIoControl".}

-proc DialogBoxIndirectParam*(hInstance: HINST, lpDialogTemplate: DlgTemplate,

-                             hWndParent: HWND, lpDialogFunc: TFNDlgProc,

-                             dwInitParam: LPARAM): int{.stdcall,

-    dynlib: "user32", importc: "DialogBoxIndirectParamA".}

-proc DialogBoxIndirectParamA*(hInstance: HINST, lpDialogTemplate: DlgTemplate,

-                              hWndParent: HWND, lpDialogFunc: TFNDlgProc,

-                              dwInitParam: LPARAM): int{.stdcall,

-    dynlib: "user32", importc: "DialogBoxIndirectParamA".}

-proc DialogBoxIndirectParamW*(hInstance: HINST, lpDialogTemplate: DlgTemplate,

-                              hWndParent: HWND, lpDialogFunc: TFNDlgProc,

-                              dwInitParam: LPARAM): int{.stdcall,

-    dynlib: "user32", importc: "DialogBoxIndirectParamW".}

-proc DispatchMessage*(lpMsg: TMsg): int32{.stdcall, dynlib: "user32",

-    importc: "DispatchMessageA".}

-proc DispatchMessageA*(lpMsg: TMsg): int32{.stdcall, dynlib: "user32",

-    importc: "DispatchMessageA".}

-proc DispatchMessageW*(lpMsg: TMsg): int32{.stdcall, dynlib: "user32",

-    importc: "DispatchMessageW".}

-proc DosDateTimeToFileTime*(wFatDate, wFatTime: int16, lpFileTime: var FileTime): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "DosDateTimeToFileTime".}

-proc DPtoLP*(DC: HDC, Points: pointer, Count: int): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "DPtoLP".}

-  # function DrawAnimatedRects(wnd: HWND; idAni: Integer; const lprcFrom, lprcTo: Rect): WINBOOL; stdcall; external 'user32' name 'DrawAnimatedRects';

-  #function DrawCaption(p1: HWND; p2: HDC; const p3: Rect; p4: WINUINT): WINBOOL; stdcall; external 'user32' name 'DrawCaption';

-proc DrawEdge*(hdc: HDC, qrc: var Rect, edge: WINUINT, grfFlags: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DrawEdge".}

-  #function DrawFocusRect(hDC: HDC; const lprc: Rect): WINBOOL; stdcall; external 'user32' name 'DrawFocusRect';

-proc DrawFrameControl*(DC: HDC, Rect: Rect, uType, uState: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "DrawFrameControl".}

-proc DrawText*(hDC: HDC, lpString: cstring, nCount: int, lpRect: var Rect,

-               uFormat: WINUINT): int{.stdcall, dynlib: "user32",

-                                    importc: "DrawTextA".}

-proc DrawTextA*(hDC: HDC, lpString: LPCSTR, nCount: int, lpRect: var Rect,

-                uFormat: WINUINT): int{.stdcall, dynlib: "user32",

-                                     importc: "DrawTextA".}

-proc DrawTextEx*(DC: HDC, lpchText: cstring, cchText: int, p4: var Rect,

-                 dwDTFormat: WINUINT, DTParams: PDrawTextParams): int{.stdcall,

-    dynlib: "user32", importc: "DrawTextExA".}

-proc DrawTextExA*(DC: HDC, lpchText: LPCSTR, cchText: int, p4: var Rect,

-                  dwDTFormat: WINUINT, DTParams: PDrawTextParams): int{.stdcall,

-    dynlib: "user32", importc: "DrawTextExA".}

-proc DrawTextExW*(DC: HDC, lpchText: LPWSTR, cchText: int, p4: var Rect,

-                  dwDTFormat: WINUINT, DTParams: PDrawTextParams): int{.stdcall,

-    dynlib: "user32", importc: "DrawTextExW".}

-proc DrawTextW*(hDC: HDC, lpString: LPWSTR, nCount: int, lpRect: var Rect,

-                uFormat: WINUINT): int{.stdcall, dynlib: "user32",

-                                     importc: "DrawTextW".}

-  #function DuplicateTokenEx(hExistingToken: Handle; dwDesiredAccess: DWORD; lpTokenAttributes: PSecurityAttributes; ImpersonationLevel: TSecurityImpersonationLevel; TokenType: TTokenType; var phNewToken: Handle): WINBOOL;

-  #  stdcall; external 'advapi32' name 'DuplicateTokenEx';

-proc EndPaint*(wnd: HWND, lpPaint: PaintStruct): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EndPaint".}

-  #function EnumDisplayDevices(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDevice; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

-  #function EnumDisplayDevicesA(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceA; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

-  #function EnumDisplayDevicesW(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceW; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesW';

-proc EnumDisplaySettings*(lpszDeviceName: cstring, iModeNum: DWORD,

-                          lpDevMode: var DevMode): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnumDisplaySettingsA".}

-proc EnumDisplaySettingsA*(lpszDeviceName: LPCSTR, iModeNum: DWORD,

-                           lpDevMode: var DevMode): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnumDisplaySettingsA".}

-proc EnumDisplaySettingsW*(lpszDeviceName: LPWSTR, iModeNum: DWORD,

-                           lpDevMode: var DevModeW): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "EnumDisplaySettingsW".}

-  #function EnumEnhMetaFile(DC: HDC; p2: HENHMETAFILE; p3: TFNEnhMFEnumProc; p4: pointer; const p5: Rect): WINBOOL; stdcall; external 'gdi32' name 'EnumEnhMetaFile';

-  #function EnumFontFamiliesEx(DC: HDC; var p2: LogFont; p3: TFNFontEnumProc; p4: LPARAM; p5: DWORD): WINBOOL;stdcall; external 'gdi32' name 'EnumFontFamiliesExA';

-  #function EnumFontFamiliesExA(DC: HDC; var p2: LogFont; p3: TFNFontEnumProcA; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExA';

-  #function EnumFontFamiliesExW(DC: HDC; var p2: LogFontW; p3: TFNFontEnumProcW; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExW';

-  #function EqualRect(const lprc1, lprc2: Rect): WINBOOL; stdcall; external 'user32' name 'EqualRect';

-proc ExtCreatePen*(PenStyle, Width: DWORD, Brush: LogBrush, StyleCount: DWORD,

-                   Style: pointer): HPEN{.stdcall, dynlib: "gdi32",

-    importc: "ExtCreatePen".}

-proc ExtCreateRegion*(p1: PXForm, p2: DWORD, p3: RgnData): HRGN{.stdcall,

-    dynlib: "gdi32", importc: "ExtCreateRegion".}

-  # function ExtEscape(DC: HDC; p2, p3: Integer; const p4: LPCSTR; p5: Integer; p6: LPSTR): Integer; stdcall; external 'gdi32' name 'ExtEscape';

-proc FileTimeToDosDateTime*(lpFileTime: FileTime,

-                            lpFatDate, lpFatTime: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FileTimeToDosDateTime".}

-proc FileTimeToLocalFileTime*(lpFileTime: FileTime,

-                              lpLocalFileTime: var FileTime): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "FileTimeToLocalFileTime".}

-proc FileTimeToSystemTime*(lpFileTime: FileTime, lpSystemTime: var SystemTime): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FileTimeToSystemTime".}

-proc FillConsoleOutputAttribute*(hConsoleOutput: Handle, wAttribute: int16,

-                                 nLength: DWORD, dwWriteCoord: Coord,

-                                 lpNumberOfAttrsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputAttribute".}

-proc FillConsoleOutputCharacter*(hConsoleOutput: Handle, cCharacter: char,

-                                 nLength: DWORD, dwWriteCoord: Coord,

-                                 lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

-proc FillConsoleOutputCharacterA*(hConsoleOutput: Handle, cCharacter: char,

-                                  nLength: DWORD, dwWriteCoord: Coord,

-                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

-proc FillConsoleOutputCharacterW*(hConsoleOutput: Handle, cCharacter: WideChar,

-                                  nLength: DWORD, dwWriteCoord: Coord,

-                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".}

-  #function FillRect(hDC: HDC; const lprc: Rect; hbr: HBRUSH): Integer; stdcall; external 'user32' name 'FillRect';

-proc FindFirstFile*(lpFileName: cstring, lpFindFileData: var WIN32FindData): Handle{.

-    stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}

-proc FindFirstFileA*(lpFileName: LPCSTR, lpFindFileData: var WIN32FindData): Handle{.

-    stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}

-proc FindFirstFileW*(lpFileName: LPWSTR, lpFindFileData: var WIN32FindDataW): Handle{.

-    stdcall, dynlib: "kernel32", importc: "FindFirstFileW".}

-  #function FindFirstFreeAce(var pAcl: ACL; var pAce: pointer): WINBOOL; stdcall; external 'advapi32' name 'FindFirstFreeAce';

-proc FindNextFile*(hFindFile: Handle, lpFindFileData: var WIN32FindData): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

-proc FindNextFileA*(hFindFile: Handle, lpFindFileData: var WIN32FindData): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

-proc FindNextFileW*(hFindFile: Handle, lpFindFileData: var WIN32FindDataW): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "FindNextFileW".}

-  #function FlushInstructionCache(hProcess: Handle; const lpBaseAddress: pointer; dwSize: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushInstructionCache';

-  #function FlushViewOfFile(const lpBaseAddress: pointer; dwNumberOfBytesToFlush: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushViewOfFile';

-  #function FrameRect(hDC: HDC; const lprc: Rect; hbr: HBRUSH): Integer; stdcall; external 'user32' name 'FrameRect';

-  #function GetAce(const pAcl: ACL; dwAceIndex: DWORD; var pAce: pointer): WINBOOL; stdcall; external 'advapi32' name 'GetAce';

-  #function GetAclInformation(const pAcl: ACL; pAclInformation: pointer; nAclInformationLength: DWORD; dwAclInformationClass: AclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'GetAclInformation';

-  #function GetAltTabInfo(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: PChar; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';

-  #function GetAltTabInfoA(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPCSTR; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';

-  #function GetAltTabInfoW(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPWSTR; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoW';

-proc GetAspectRatioFilterEx*(DC: HDC, p2: var Size): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetAspectRatioFilterEx".}

-proc GetBinaryType*(lpApplicationName: cstring, lpBinaryType: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".}

-proc GetBinaryTypeA*(lpApplicationName: LPCSTR, lpBinaryType: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetBinaryTypeA".}

-proc GetBinaryTypeW*(lpApplicationName: LPWSTR, lpBinaryType: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetBinaryTypeW".}

-proc GetBitmapDimensionEx*(p1: HBITMAP, p2: var Size): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetBitmapDimensionEx".}

-proc GetBoundsRect*(DC: HDC, p2: var Rect, p3: WINUINT): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetBoundsRect".}

-proc GetBrushOrgEx*(DC: HDC, p2: var Point): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetBrushOrgEx".}

-proc GetCaretPos*(lpPoint: var Point): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetCaretPos".}

-proc GetCharABCWidths*(DC: HDC, p2, p3: WINUINT, ABCStructs: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}

-proc GetCharABCWidthsA*(DC: HDC, p2, p3: WINUINT, ABCStructs: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}

-proc GetCharABCWidthsFloat*(DC: HDC, p2, p3: WINUINT, ABCFloatSturcts: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}

-proc GetCharABCWidthsFloatA*(DC: HDC, p2, p3: WINUINT, ABCFloatSturcts: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}

-proc GetCharABCWidthsFloatW*(DC: HDC, p2, p3: WINUINT, ABCFloatSturcts: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}

-  #function GetCharABCWidthsI(DC: HDC; p2, p3: WINUINT; p4: PWORD; const Widths): WINBOOL;stdcall; external 'gdi32' name 'GetCharABCWidthsI';

-proc GetCharABCWidthsW*(DC: HDC, p2, p3: WINUINT, ABCStructs: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}

-proc GetCharacterPlacement*(DC: HDC, p2: cstring, p3, p4: WINBOOL,

-                            p5: var GCPResults, p6: DWORD): DWORD{.stdcall,

-    dynlib: "gdi32", importc: "GetCharacterPlacementA".}

-proc GetCharacterPlacementA*(DC: HDC, p2: LPCSTR, p3, p4: WINBOOL,

-                             p5: var GCPResults, p6: DWORD): DWORD{.stdcall,

-    dynlib: "gdi32", importc: "GetCharacterPlacementA".}

-proc GetCharacterPlacementW*(DC: HDC, p2: LPWSTR, p3, p4: WINBOOL,

-                             p5: var GCPResults, p6: DWORD): DWORD{.stdcall,

-    dynlib: "gdi32", importc: "GetCharacterPlacementW".}

-proc GetCharWidth*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidthA".}

-proc GetCharWidth32*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidth32A".}

-proc GetCharWidth32A*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidth32A".}

-proc GetCharWidth32W*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidth32W".}

-proc GetCharWidthA*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidthA".}

-proc GetCharWidthFloat*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}

-proc GetCharWidthFloatA*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}

-proc GetCharWidthFloatW*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}

-  #function GetCharWidthI(DC: HDC; p2, p3: WINUINT; p4: PWORD; const Widths:pointer): WINBOOL;stdcall; external 'gdi32' name 'GetCharWidthI';

-proc GetCharWidthW*(DC: HDC, p2, p3: WINUINT, Widths: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetCharWidthW".}

-proc GetClassInfo*(hInstance: HINST, lpClassName: cstring,

-                   lpWndClass: var WndClass): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetClassInfoA".}

-proc GetClassInfoA*(hInstance: HINST, lpClassName: LPCSTR,

-                    lpWndClass: var WndClass): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetClassInfoA".}

-proc GetClassInfoEx*(Instance: HINST, Classname: cstring,

-                     WndClass: var WndClassEx): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetClassInfoExA".}

-  #function GetClassInfoExA(Instance: HINST; Classname: LPCSTR; var WndClass: WndClassEx): WINBOOL; stdcall; external 'user32' name 'GetClassInfoExA';

-  #function GetClassInfoExW(Instance: HINST; Classname: LPWSTR; var WndClass: WndClassExW): WINBOOL; stdcall; external 'user32' name 'GetClassInfoExW';

-  #function GetClassInfoW(hInstance: HINST; lpClassName: LPWSTR; var lpWndClass: WndClassW): WINBOOL; stdcall; external 'user32' name 'GetClassInfoW';

-proc GetClientRect*(wnd: HWND, lpRect: var Rect): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetClientRect".}

-proc GetClipBox*(DC: HDC, Rect: var Rect): int{.stdcall, dynlib: "gdi32",

-    importc: "GetClipBox".}

-proc GetClipCursor*(lpRect: var Rect): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetClipCursor".}

-proc GetColorAdjustment*(DC: HDC, p2: var ColorAdjustment): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetColorAdjustment".}

-proc GetCommConfig*(hCommDev: Handle, lpCC: var CommConfig,

-                    lpdwSize: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GetCommConfig".}

-proc GetCommMask*(hFile: Handle, lpEvtMask: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCommMask".}

-proc GetCommModemStatus*(hFile: Handle, lpModemStat: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommModemStatus".}

-proc GetCommProperties*(hFile: Handle, lpCommProp: var CommProp): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommProperties".}

-proc GetCommState*(hFile: Handle, lpDCB: var DCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCommState".}

-proc GetCommTimeouts*(hFile: Handle, lpCommTimeouts: var CommTimeouts): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetCommTimeouts".}

-proc GetComputerName*(lpBuffer: cstring, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetComputerNameA".}

-proc GetComputerNameA*(lpBuffer: LPCSTR, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetComputerNameA".}

-proc GetComputerNameW*(lpBuffer: LPWSTR, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetComputerNameW".}

-proc GetConsoleCursorInfo*(hConsoleOutput: Handle,

-                           lpConsoleCursorInfo: var ConsoleCursorInfo): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetConsoleCursorInfo".}

-proc GetConsoleMode*(hConsoleHandle: Handle, lpMode: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetConsoleMode".}

-proc GetConsoleScreenBufferInfo*(hConsoleOutput: Handle,

-    lpConsoleScreenBufferInfo: var ConsoleScreenBufferInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetConsoleScreenBufferInfo".}

-proc GetCPInfo*(CodePage: WINUINT, lpCPInfo: var CPInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetCPInfo".}

-  #function GetCurrentHwProfile(var lpHwProfileInfo: THWProfileInfo): WINBOOL;stdcall; external 'advapi32' name 'GetCurrentHwProfileA';

-  #function GetCurrentHwProfileA(var lpHwProfileInfo: THWProfileInfoA): WINBOOL;stdcall; external 'advapi32' name 'GetCurrentHwProfileA';

-  #function GetCurrentHwProfileW(var lpHwProfileInfo: THWProfileInfoW): WINBOOL;stdcall; external 'advapi32' name 'GetCurrentHwProfileW';

-proc GetCursorInfo*(pci: var ConsoleCursorInfo): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetCursorInfo".}

-proc GetCursorPos*(lpPoint: var Point): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "GetCursorPos".}

-proc GetDCOrgEx*(DC: HDC, Origin: var Point): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetDCOrgEx".}

-proc GetDefaultCommConfig*(lpszName: cstring, lpCC: var CommConfig,

-                           lpdwSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDefaultCommConfigA".}

-proc GetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: var CommConfig,

-                            lpdwSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDefaultCommConfigA".}

-proc GetDefaultCommConfigW*(lpszName: LPWSTR, lpCC: var CommConfig,

-                            lpdwSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetDefaultCommConfigW".}

-proc GetDIBColorTable*(DC: HDC, p2, p3: WINUINT, RGBQuadStructs: pointer): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "GetDIBColorTable".}

-proc GetDIBits*(DC: HDC, Bitmap: HBitmap, StartScan, NumScans: WINUINT,

-                Bits: pointer, BitInfo: var BitmapInfo, Usage: WINUINT): int{.

-    stdcall, dynlib: "gdi32", importc: "GetDIBits".}

-proc GetDiskFreeSpace*(lpRootPathName: cstring, lpSectorsPerCluster,

-    lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceA".}

-proc GetDiskFreeSpaceA*(lpRootPathName: LPCSTR, lpSectorsPerCluster,

-    lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceA".}

-proc GetDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: var LargeInteger,

-                         lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

-proc GetDiskFreeSpaceExA*(lpDirectoryName: LPCSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: var LargeInteger,

-                          lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

-proc GetDiskFreeSpaceExW*(lpDirectoryName: LPWSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: var LargeInteger,

-                          lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExW".}

-proc GetDiskFreeSpaceW*(lpRootPathName: LPWSTR, lpSectorsPerCluster,

-    lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceW".}

-proc GetDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

-proc GetDiskFreeSpaceExA*(lpDirectoryName: LPCSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

-proc GetDiskFreeSpaceExW*(lpDirectoryName: LPWSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExW".}

-  #function GetEnhMetaFilePixelFormat(p1: HENHMETAFILE; p2: Cardinal; var p3: PixelFormatDescriptor): WINUINT;stdcall; external 'gdi32' name 'GetEnhMetaFilePixelFormat';

-proc GetExitCodeProcess*(hProcess: Handle, lpExitCode: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".}

-proc GetExitCodeThread*(hThread: Handle, lpExitCode: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetExitCodeThread".}

-proc GetFileInformationByHandle*(hFile: Handle, lpFileInformation: var ByHandleFileInformation): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetFileInformationByHandle".}

-  #function GetFileSecurity(lpFileName: PChar; RequestedInformation: SECURITY_INFORMATION; pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): WINBOOL;stdcall; external 'advapi32' name 'GetFileSecurityA';

-  #function GetFileSecurityA(lpFileName: LPCSTR; RequestedInformation: SECURITY_INFORMATION; pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetFileSecurityA';

-  #function GetFileSecurityW(lpFileName: LPWSTR; RequestedInformation: SECURITY_INFORMATION; pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetFileSecurityW';

-proc GetFileVersionInfoSize*(lptstrFilename: cstring, lpdwHandle: var DWORD): DWORD{.

-    stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".}

-proc GetFileVersionInfoSizeA*(lptstrFilename: LPCSTR, lpdwHandle: var DWORD): DWORD{.

-    stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeA".}

-proc GetFileVersionInfoSizeW*(lptstrFilename: LPWSTR, lpdwHandle: var DWORD): DWORD{.

-    stdcall, dynlib: "version", importc: "GetFileVersionInfoSizeW".}

-  # removed because old definition was wrong !

-  # function GetFullPathName(lpFileName: PChar; nBufferLength: DWORD; lpBuffer: PChar; var lpFilePart: PChar): DWORD;stdcall; external 'kernel32' name 'GetFullPathNameA';

-  # function GetFullPathNameA(lpFileName: LPCSTR; nBufferLength: DWORD; lpBuffer: LPCSTR; var lpFilePart: LPCSTR): DWORD; stdcall; external 'kernel32' name 'GetFullPathNameA';

-  # function GetFullPathNameW(lpFileName: LPWSTR; nBufferLength: DWORD; lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall; external 'kernel32' name 'GetFullPathNameW';

-proc GetGlyphOutline*(DC: HDC, p2, p3: WINUINT, p4: GlyphMetrics, p5: DWORD,

-                      p6: pointer, p7: Mat2): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetGlyphOutlineA".}

-proc GetGlyphOutlineA*(DC: HDC, p2, p3: WINUINT, p4: GlyphMetrics, p5: DWORD,

-                       p6: pointer, p7: Mat2): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetGlyphOutlineA".}

-proc GetGlyphOutlineW*(DC: HDC, p2, p3: WINUINT, p4: GlyphMetrics, p5: DWORD,

-                       p6: pointer, p7: Mat2): DWORD{.stdcall, dynlib: "gdi32",

-    importc: "GetGlyphOutlineW".}

-  #function GetGUIThreadInfo(idThread: DWORD; var pgui: TGUIThreadinfo): WINBOOL;stdcall; external 'user32' name 'GetGUIThreadInfo';

-proc GetHandleInformation*(hObject: Handle, lpdwFlags: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetHandleInformation".}

-  #function GetICMProfile(DC: HDC; var Size: DWORD; Name: PChar): WINBOOL;stdcall; external 'gdi32' name 'GetICMProfileA';

-  #function GetICMProfileA(DC: HDC; var Size: DWORD; Name: LPCSTR): WINBOOL; stdcall; external 'gdi32' name 'GetICMProfileA';

-  #function GetICMProfileW(DC: HDC; var Size: DWORD; Name: LPWSTR): WINBOOL; stdcall; external 'gdi32' name 'GetICMProfileW';

-proc GetIconInfo*(icon: HICON, piconinfo: var IconInfo): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetIconInfo".}

-  #function GetKernelObjectSecurity(Handle: Handle; RequestedInformation: SECURITY_INFORMATION; pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetKernelObjectSecurity';

-proc GetKerningPairs*(DC: HDC, Count: DWORD, KerningPairs: pointer): DWORD{.

-    stdcall, dynlib: "gdi32", importc: "GetKerningPairs".}

-proc GetKeyboardLayoutList*(nBuff: int, List: pointer): WINUINT{.stdcall,

-    dynlib: "user32", importc: "GetKeyboardLayoutList".}

-  #function GetKeyboardState(var KeyState: TKeyboardState): WINBOOL; stdcall; external 'user32' name 'GetKeyboardState';

-  #function GetLastInputInfo(var plii: TLastInputInfo): WINBOOL;stdcall; external 'user32' name 'GetLastInputInfo';

-proc GetSystemTime*(lpSystemTime: var SYSTEMTIME){.stdcall, dynlib: "kernel32",

-    importc: "GetSystemTime".}

-proc GetLocalTime*(SystemTime: var SYSTEMTIME){.stdcall, dynlib: "kernel32",

-    importc: "GetLocalTime".}

-proc GetSystemInfo*(SystemInfo: var SYSTEM_INFO){.stdcall, dynlib: "kernel32",

-    importc: "GetSystemInfo".}

-proc SetSystemTime*(lpSystemTime: var SYSTEMTIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetSystemTime".}

-proc SetLocalTime*(lpSystemTime: var SYSTEMTIME): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetLocalTime".}

-proc GetLogColorSpace*(p1: HCOLORSPACE, ColorSpace: var LogColorSpace,

-                       Size: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetLogColorSpaceA".}

-proc GetLogColorSpaceA*(p1: HCOLORSPACE, ColorSpace: var LogColorSpace,

-                        Size: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetLogColorSpaceA".}

-  #function GetLogColorSpaceW(p1: HCOLORSPACE; var ColorSpace: LogColorSpaceW; Size: DWORD): WINBOOL; stdcall; external 'gdi32' name 'GetLogColorSpaceW';

-proc GetMailslotInfo*(hMailslot: Handle, lpMaxMessageSize: pointer,

-                      lpNextSize: var DWORD,

-                      lpMessageCount, lpReadTimeout: pointer): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetMailslotInfo".}

-  #function GetMenuBarInfo(hend: HWND; idObject, idItem: Longint; var pmbi: TMenuBarInfo): WINBOOL;stdcall; external 'user32' name 'GetMenuBarInfo';

-  #function GetMenuInfo(menu: HMENU; var lpmi: TMenuInfo): WINBOOL;stdcall; external 'user32' name 'GetMenuInfo';

-proc GetMenuItemInfo*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: var MenuItemInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetMenuItemInfoA".}

-proc GetMenuItemInfoA*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: var MenuItemInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetMenuItemInfoA".}

-  #function GetMenuItemInfoW(p1: HMENU; p2: WINUINT; p3: WINBOOL; var p4: MenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'GetMenuItemInfoW';

-proc GetMenuItemRect*(wnd: HWND, menu: HMENU, uItem: WINUINT, lprcItem: var Rect): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetMenuItemRect".}

-proc GetMessage*(lpMsg: var TMsg, wnd: HWND, wMsgFilterMin, wMsgFilterMax: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetMessageA".}

-proc GetMessageA*(lpMsg: var TMsg, wnd: HWND,

-                  wMsgFilterMin, wMsgFilterMax: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetMessageA".}

-proc GetMessageW*(lpMsg: var TMsg, wnd: HWND,

-                  wMsgFilterMin, wMsgFilterMax: WINUINT): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetMessageW".}

-proc GetMiterLimit*(DC: HDC, Limit: var float32): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetMiterLimit".}

-  #function GetMouseMovePoints(cbSize: WINUINT; var lppt, lpptBuf: TMouseMovePoint; nBufPoints: Integer; resolution: DWORD): Integer;stdcall; external 'user32' name 'GetMouseMovePoints';

-proc GetNamedPipeInfo*(hNamedPipe: Handle, lpFlags: var DWORD,

-                       lpOutBufferSize, lpInBufferSize, lpMaxInstances: pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetNamedPipeInfo".}

-proc GetNumberOfConsoleInputEvents*(hConsoleInput: Handle,

-                                    lpNumberOfEvents: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetNumberOfConsoleInputEvents".}

-proc GetNumberOfConsoleMouseButtons*(lpNumberOfMouseButtons: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetNumberOfConsoleMouseButtons".}

-  #function GetNumberOfEventLogRecords(hEventLog: Handle; var NumberOfRecords: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetNumberOfEventLogRecords';

-  #function GetOldestEventLogRecord(hEventLog: Handle; var OldestRecord: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetOldestEventLogRecord';

-proc GetOverlappedResult*(hFile: Handle, lpOverlapped: Overlapped,

-                          lpNumberOfBytesTransferred: var DWORD, bWait: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetOverlappedResult".}

-proc GetPaletteEntries*(Palette: HPALETTE, StartIndex, NumEntries: WINUINT,

-                        PaletteEntries: pointer): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetPaletteEntries".}

-proc GetPath*(DC: HDC, Points, Types: pointer, nSize: int): int{.stdcall,

-    dynlib: "gdi32", importc: "GetPath".}

-proc GetPriorityClipboardFormat*(paFormatPriorityList: pointer, cFormats: int): int{.

-    stdcall, dynlib: "user32", importc: "GetPriorityClipboardFormat".}

-  #function GetPrivateObjectSecurity(ObjectDescriptor: PSecurityDescriptor; SecurityInformation: SECURITY_INFORMATION; ResultantDescriptor: PSecurityDescriptor; DescriptorLength: DWORD; var ReturnLength: DWORD): WINBOOL;

-  #  stdcall; external 'advapi32' name 'GetPrivateObjectSecurity';

-proc GetPrivateProfileSectionNamesA*(lpszReturnBuffer: LPSTR, nSize: DWORD,

-                                     lpFileName: LPCSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetPrivateProfileSectionNamesA".}

-proc GetPrivateProfileSectionNamesW*(lpszReturnBuffer: LPWSTR, nSize: DWORD,

-                                     lpFileName: LPCWSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetPrivateProfileSectionNamesW".}

-proc GetPrivateProfileSectionNames*(lpszReturnBuffer: LPTSTR, nSize: DWORD,

-                                    lpFileName: LPCTSTR): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetPrivateProfileSectionNamesA".}

-proc GetPrivateProfileStructA*(lpszSection, lpszKey: LPCSTR, lpStruct: LPVOID,

-                               uSizeStruct: WINUINT, szFile: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructA".}

-proc GetPrivateProfileStructW*(lpszSection, lpszKey: LPCWSTR, lpStruct: LPVOID,

-                               uSizeStruct: WINUINT, szFile: LPCWSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructW".}

-proc GetPrivateProfileStruct*(lpszSection, lpszKey: LPCTSTR, lpStruct: LPVOID,

-                              uSizeStruct: WINUINT, szFile: LPCTSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructA".}

-proc GetProcessAffinityMask*(hProcess: Handle, lpProcessAffinityMask,

-    lpSystemAffinityMask: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GetProcessAffinityMask".}

-proc GetProcessHeaps*(NumberOfHeaps: DWORD, ProcessHeaps: var Handle): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessHeaps".}

-proc GetProcessPriorityBoost*(hThread: Handle,

-                              DisablePriorityBoost: var WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessPriorityBoost".}

-proc GetProcessShutdownParameters*(lpdwLevel, lpdwFlags: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetProcessShutdownParameters".}

-proc GetProcessTimes*(hProcess: Handle, lpCreationTime, lpExitTime,

-    lpKernelTime, lpUserTime: var FileTime): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetProcessTimes".}

-proc GetProcessWorkingSetSize*(hProcess: Handle, lpMinimumWorkingSetSize,

-    lpMaximumWorkingSetSize: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "GetProcessWorkingSetSize".}

-proc GetQueuedCompletionStatus*(CompletionPort: Handle,

-    lpNumberOfBytesTransferred, lpCompletionKey: var DWORD,

-                                lpOverlapped: var POverlapped,

-                                dwMilliseconds: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetQueuedCompletionStatus".}

-proc GetRasterizerCaps*(p1: var RasterizerStatus, p2: WINUINT): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetRasterizerCaps".}

-proc GetRgnBox*(RGN: HRGN, p2: var Rect): int{.stdcall, dynlib: "gdi32",

-    importc: "GetRgnBox".}

-proc GetScrollInfo*(wnd: HWND, BarFlag: int, ScrollInfo: var ScrollInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetScrollInfo".}

-proc GetScrollRange*(wnd: HWND, nBar: int, lpMinPos, lpMaxPos: var int): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetScrollRange".}

-  #function GetSecurityDescriptorControl(pSecurityDescriptor: PSecurityDescriptor; var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorControl';

-  #function GetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor; var lpbDaclPresent: WINBOOL; var pDacl: PACL; var lpbDaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorDacl';

-  #function GetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor; var pGroup: PSID; var lpbGroupDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorGroup';

-  #function GetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor; var pOwner: PSID; var lpbOwnerDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorOwner';

-  #function GetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor; var lpbSaclPresent: WINBOOL; var pSacl: PACL; var lpbSaclDefaulted: WINBOOL): WINBOOL; stdcall; external 'advapi32' name 'GetSecurityDescriptorSacl';

-proc GetStartupInfo*(lpStartupInfo: var STARTUPINFO){.stdcall,

-    dynlib: "kernel32", importc: "GetStartupInfoA".}

-proc GetStringTypeA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                     cchSrc: WINBOOL, lpCharType: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeA".}

-proc GetStringTypeEx*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: cstring,

-                      cchSrc: int, lpCharType: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeExA".}

-proc GetStringTypeExA*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPCSTR,

-                       cchSrc: int, lpCharType: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeExA".}

-proc GetStringTypeExW*(Locale: LCID, dwInfoType: DWORD, lpSrcStr: LPWSTR,

-                       cchSrc: int, lpCharType: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeExW".}

-proc GetStringTypeW*(dwInfoType: DWORD, lpSrcStr: WCHAR, cchSrc: WINBOOL,

-                     lpCharType: var int16): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetStringTypeW".}

-proc GetSystemPaletteEntries*(DC: HDC, StartIndex, NumEntries: WINUINT,

-                              PaletteEntries: pointer): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "GetSystemPaletteEntries".}

-proc GetSystemPowerStatus*(lpSystemPowerStatus: var SystemPowerStatus): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetSystemPowerStatus".}

-proc GetSystemTimeAdjustment*(lpTimeAdjustment, lpTimeIncrement: var DWORD,

-                              lpTimeAdjustmentDisabled: var WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetSystemTimeAdjustment".}

-proc GetSystemTimeAsFileTime*(lpSystemTimeAsFileTime: var FILETIME){.stdcall,

-    dynlib: "kernel32", importc: "GetSystemTimeAsFileTime".}

-proc GetTabbedTextExtent*(hDC: HDC, lpString: cstring,

-                          nCount, nTabPositions: int,

-                          lpnTabStopPositions: pointer): DWORD{.stdcall,

-    dynlib: "user32", importc: "GetTabbedTextExtentA".}

-proc GetTabbedTextExtentA*(hDC: HDC, lpString: LPCSTR,

-                           nCount, nTabPositions: int,

-                           lpnTabStopPositions: pointer): DWORD{.stdcall,

-    dynlib: "user32", importc: "GetTabbedTextExtentA".}

-proc GetTabbedTextExtentW*(hDC: HDC, lpString: LPWSTR,

-                           nCount, nTabPositions: int,

-                           lpnTabStopPositions: pointer): DWORD{.stdcall,

-    dynlib: "user32", importc: "GetTabbedTextExtentW".}

-proc GetTapeParameters*(hDevice: Handle, dwOperation: DWORD,

-                        lpdwSize: var DWORD, lpTapeInformation: pointer): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetTapeParameters".}

-proc GetTapePosition*(hDevice: Handle, dwPositionType: DWORD,

-                      lpdwPartition, lpdwOffsetLow: var DWORD,

-                      lpdwOffsetHigh: pointer): DWORD{.stdcall,

-    dynlib: "kernel32", importc: "GetTapePosition".}

-proc GetTextExtentExPoint*(DC: HDC, p2: cstring, p3, p4: int, p5, p6: PInteger,

-                           p7: var Size): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentExPointA".}

-proc GetTextExtentExPointA*(DC: HDC, p2: LPCSTR, p3, p4: int, p5, p6: PInteger,

-                            p7: var Size): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentExPointA".}

-  #function GetTextExtentExPointI(DC: HDC; p2: PWORD; p3, p4: Integer; p5, p6: PINT; var p7: Size): WINBOOL;stdcall; external 'gdi32' name 'GetTextExtentExPointI';

-proc GetTextExtentExPointW*(DC: HDC, p2: LPWSTR, p3, p4: int, p5, p6: PInteger,

-                            p7: var Size): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "GetTextExtentExPointW".}

-proc GetTextExtentPoint*(DC: HDC, Str: cstring, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointA".}

-proc GetTextExtentPoint32*(DC: HDC, Str: cstring, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32A".}

-proc GetTextExtentPoint32A*(DC: HDC, Str: LPCSTR, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32A".}

-proc GetTextExtentPoint32W*(DC: HDC, Str: LPWSTR, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32W".}

-proc GetTextExtentPointA*(DC: HDC, Str: LPCSTR, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointA".}

-  #function GetTextExtentPointI(DC: HDC; p2: PWORD; p3: Integer; var p4: Size): WINBOOL;stdcall; external 'gdi32' name 'GetTextExtentPointI';

-proc GetTextExtentPointW*(DC: HDC, Str: LPWSTR, Count: int, Size: var Size): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointW".}

-proc GetTextMetrics*(DC: HDC, TM: var TextMetric): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetTextMetricsA".}

-  #function GetTextMetricsA(DC: HDC; var TM: TextMetricA): WINBOOL; stdcall; external 'gdi32' name 'GetTextMetricsA';

-  #function GetTextMetricsW(DC: HDC; var TM: TextMetricW): WINBOOL; stdcall; external 'gdi32' name 'GetTextMetricsW';

-proc GetThreadContext*(hThread: Handle, lpContext: var Context): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetThreadContext".}

-proc GetThreadPriorityBoost*(hThread: Handle, DisablePriorityBoost: var WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetThreadPriorityBoost".}

-proc GetThreadSelectorEntry*(hThread: Handle, dwSelector: DWORD,

-                             lpSelectorEntry: var LDTEntry): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetThreadSelectorEntry".}

-proc GetThreadTimes*(hThread: Handle, lpCreationTime, lpExitTime, lpKernelTime,

-                                       lpUserTime: var FileTime): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetThreadTimes".}

-proc GetTimeZoneInformation*(lpTimeZoneInformation: var TimeZoneInformation): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "GetTimeZoneInformation".}

-  #function GetTitleBarInfo(wnd: HWND; var pti: TTitleBarInfo): WINBOOL;stdcall; external 'user32' name 'GetTitleBarInfo';

-  #function GetTokenInformation(TokenHandle: Handle; TokenInformationClass: TokenInformationClass; TokenInformation: pointer; TokenInformationLength: DWORD; var ReturnLength: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetTokenInformation';

-proc GetUpdateRect*(wnd: HWND, lpRect: var Rect, bErase: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUpdateRect".}

-proc GetUserName*(lpBuffer: cstring, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetUserNameA".}

-proc GetUserNameA*(lpBuffer: LPCSTR, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetUserNameA".}

-proc GetUserNameW*(lpBuffer: LPWSTR, nSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "GetUserNameW".}

-proc GetUserObjectInformation*(hObj: Handle, nIndex: int, pvInfo: pointer,

-                               nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-proc GetUserObjectInformationA*(hObj: Handle, nIndex: int, pvInfo: pointer,

-                                nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-proc GetUserObjectInformationW*(hObj: Handle, nIndex: int, pvInfo: pointer,

-                                nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".}

-proc GetUserObjectSecurity*(hObj: Handle, pSIRequested: var DWORD,

-                            pSID: PSecurityDescriptor, nLength: DWORD,

-                            lpnLengthNeeded: var DWORD): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetUserObjectSecurity".}

-proc GetVersionEx*(lpVersionInformation: var OSVersionInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVersionExA".}

-proc GetVersionExA*(lpVersionInformation: var OSVersionInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVersionExA".}

-proc GetVersionExW*(lpVersionInformation: var OSVersionInfoW): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "GetVersionExW".}

-proc GetViewportExtEx*(DC: HDC, Size: var Size): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetViewportExtEx".}

-proc GetViewportOrgEx*(DC: HDC, Point: var Point): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetViewportOrgEx".}

-proc GetVolumeInformation*(lpRootPathName: cstring, lpVolumeNameBuffer: cstring,

-                           nVolumeNameSize: DWORD, lpVolumeSerialNumber: PDWORD,

-    lpMaximumComponentLength, lpFileSystemFlags: var DWORD,

-                           lpFileSystemNameBuffer: cstring,

-                           nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVolumeInformationA".}

-proc GetVolumeInformationA*(lpRootPathName: LPCSTR, lpVolumeNameBuffer: LPCSTR,

-                            nVolumeNameSize: DWORD,

-                            lpVolumeSerialNumber: PDWORD,

-    lpMaximumComponentLength, lpFileSystemFlags: var DWORD,

-                            lpFileSystemNameBuffer: LPCSTR,

-                            nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVolumeInformationA".}

-proc GetVolumeInformationW*(lpRootPathName: LPWSTR, lpVolumeNameBuffer: LPWSTR,

-                            nVolumeNameSize: DWORD,

-                            lpVolumeSerialNumber: PDWORD,

-    lpMaximumComponentLength, lpFileSystemFlags: var DWORD,

-                            lpFileSystemNameBuffer: LPWSTR,

-                            nFileSystemNameSize: DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "GetVolumeInformationW".}

-proc GetWindowExtEx*(DC: HDC, Size: var Size): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWindowExtEx".}

-  #function GetWindowInfo(wnd: HWND; var pwi: TWindowInfo): WINBOOL;stdcall; external 'user32' name 'GetWindowInfo';

-proc GetWindowOrgEx*(DC: HDC, Point: var Point): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWindowOrgEx".}

-proc GetWindowRect*(wnd: HWND, lpRect: var Rect): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "GetWindowRect".}

-proc GetWorldTransform*(DC: HDC, p2: var XForm): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "GetWorldTransform".}

-  #function GradientFill(DC: HDC; var p2: TTriVertex; p3: ULONG; p4: pointer; p5, p6: ULONG): WINBOOL;stdcall; external 'gdi32' name 'GradientFill';

-proc GlobalMemoryStatus*(Buffer: var MEMORYSTATUS){.stdcall, dynlib: "kernel32",

-    importc: "GlobalMemoryStatus".}

-proc HeapWalk*(hHeap: Handle, lpEntry: var ProcessHeapEntry): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "HeapWalk".}

-proc ImageList_GetDragImage*(ppt: var POINT, pptHotspot: var POINT): HIMAGELIST{.

-    stdcall, dynlib: "comctl32", importc: "ImageList_GetDragImage".}

-proc InflateRect*(lprc: var Rect, dx, dy: int): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "InflateRect".}

-proc InitializeAcl*(pAcl: var ACL, nAclLength, dwAclRevision: DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "InitializeAcl".}

-proc InitializeSid*(Sid: pointer, pIdentifierAuthority: SIDIdentifierAuthority,

-                    nSubAuthorityCount: int8): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "InitializeSid".}

-proc InsertMenuItemA*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: MenuItemInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "InsertMenuItemA".}

-  #function InsertMenuItemW(p1: HMENU; p2: WINUINT; p3: WINBOOL; const p4: MenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'InsertMenuItemW';

-proc IntersectRect*(lprcDst: var Rect, lprcSrc1, lprcSrc2: Rect): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "IntersectRect".}

-  #function InvertRect(hDC: HDC; const lprc: Rect): WINBOOL; stdcall; external 'user32' name 'InvertRect';

-proc IsDialogMessage*(hDlg: HWND, lpMsg: var TMsg): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsDialogMessageA".}

-proc IsDialogMessageA*(hDlg: HWND, lpMsg: var TMsg): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsDialogMessageA".}

-proc IsDialogMessageW*(hDlg: HWND, lpMsg: var TMsg): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "IsDialogMessageW".}

-  #function IsRectEmpty(const lprc: Rect): WINBOOL; stdcall; external 'user32' name 'IsRectEmpty';

-proc IsValidAcl*(pAcl: ACL): WINBOOL{.stdcall, dynlib: "advapi32",

-                                       importc: "IsValidAcl".}

-proc LocalFileTimeToFileTime*(lpLocalFileTime: FileTime,

-                              lpFileTime: var FileTime): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "LocalFileTimeToFileTime".}

-proc LockFileEx*(hFile: Handle, dwFlags, dwReserved: DWORD,

-                 nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD,

-                 lpOverlapped: Overlapped): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "LockFileEx".}

-proc LogonUser*(lpszUsername, lpszDomain, lpszPassword: cstring,

-                dwLogonType, dwLogonProvider: DWORD, phToken: var Handle): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LogonUserA".}

-proc LogonUserA*(lpszUsername, lpszDomain, lpszPassword: LPCSTR,

-                 dwLogonType, dwLogonProvider: DWORD, phToken: var Handle): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LogonUserA".}

-proc LogonUserW*(lpszUsername, lpszDomain, lpszPassword: LPWSTR,

-                 dwLogonType, dwLogonProvider: DWORD, phToken: var Handle): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LogonUserW".}

-proc LookupAccountName*(lpSystemName, lpAccountName: cstring, Sid: PSID,

-                        cbSid: var DWORD, ReferencedDomainName: cstring,

-                        cbReferencedDomainName: var DWORD,

-                        peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountNameA".}

-proc LookupAccountNameA*(lpSystemName, lpAccountName: LPCSTR, Sid: PSID,

-                         cbSid: var DWORD, ReferencedDomainName: LPCSTR,

-                         cbReferencedDomainName: var DWORD,

-                         peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountNameA".}

-proc LookupAccountNameW*(lpSystemName, lpAccountName: LPWSTR, Sid: PSID,

-                         cbSid: var DWORD, ReferencedDomainName: LPWSTR,

-                         cbReferencedDomainName: var DWORD,

-                         peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountNameW".}

-proc LookupAccountSid*(lpSystemName: cstring, Sid: PSID, Name: cstring,

-                       cbName: var DWORD, ReferencedDomainName: cstring,

-                       cbReferencedDomainName: var DWORD,

-                       peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountSidA".}

-proc LookupAccountSidA*(lpSystemName: LPCSTR, Sid: PSID, Name: LPCSTR,

-                        cbName: var DWORD, ReferencedDomainName: LPCSTR,

-                        cbReferencedDomainName: var DWORD,

-                        peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountSidA".}

-proc LookupAccountSidW*(lpSystemName: LPWSTR, Sid: PSID, Name: LPWSTR,

-                        cbName: var DWORD, ReferencedDomainName: LPWSTR,

-                        cbReferencedDomainName: var DWORD,

-                        peUse: var SID_NAME_USE): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupAccountSidW".}

-proc LookupPrivilegeDisplayName*(lpSystemName, lpName: LPCSTR,

-                                 lpDisplayName: cstring,

-                                 cbDisplayName, lpLanguageId: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameA".}

-proc LookupPrivilegeDisplayNameA*(lpSystemName, lpName: LPCSTR,

-                                  lpDisplayName: LPCSTR,

-                                  cbDisplayName, lpLanguageId: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameA".}

-proc LookupPrivilegeDisplayNameW*(lpSystemName, lpName: LPCSTR,

-                                  lpDisplayName: LPWSTR,

-                                  cbDisplayName, lpLanguageId: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "LookupPrivilegeDisplayNameW".}

-proc LookupPrivilegeName*(lpSystemName: cstring, lpLuid: var LargeInteger,

-                          lpName: cstring, cbName: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeNameA".}

-proc LookupPrivilegeNameA*(lpSystemName: LPCSTR, lpLuid: var LargeInteger,

-                           lpName: LPCSTR, cbName: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeNameA".}

-proc LookupPrivilegeNameW*(lpSystemName: LPWSTR, lpLuid: var LargeInteger,

-                           lpName: LPWSTR, cbName: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeNameW".}

-proc LookupPrivilegeValue*(lpSystemName, lpName: cstring,

-                           lpLuid: var LargeInteger): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeValueA".}

-proc LookupPrivilegeValueA*(lpSystemName, lpName: LPCSTR,

-                            lpLuid: var LargeInteger): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeValueA".}

-proc LookupPrivilegeValueW*(lpSystemName, lpName: LPWSTR,

-                            lpLuid: var LargeInteger): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "LookupPrivilegeValueW".}

-proc LPtoDP*(DC: HDC, Points: pointer, Count: int): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "LPtoDP".}

-proc MakeAbsoluteSD*(pSelfRelativeSecurityDescriptor: PSecurityDescriptor,

-                     pAbsoluteSecurityDescriptor: PSecurityDescriptor,

-                     lpdwAbsoluteSecurityDescriptorSi: var DWORD,

-                     pDacl: var ACL, lpdwDaclSize: var DWORD, pSacl: var ACL,

-

-                     lpdwSaclSize: var DWORD, pOwner: PSID,

-                     lpdwOwnerSize: var DWORD, pPrimaryGroup: pointer,

-                     lpdwPrimaryGroupSize: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "MakeAbsoluteSD".}

-proc MakeSelfRelativeSD*(pAbsoluteSecurityDescriptor: PSecurityDescriptor,

-                         pSelfRelativeSecurityDescriptor: PSecurityDescriptor,

-                         lpdwBufferLength: var DWORD): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "MakeSelfRelativeSD".}

-proc MapDialogRect*(hDlg: HWND, lpRect: var Rect): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "MapDialogRect".}

-proc MapWindowPoints*(hWndFrom, hWndTo: HWND, lpPoints: pointer, cPoints: WINUINT): int{.

-    stdcall, dynlib: "user32", importc: "MapWindowPoints".}

-proc MessageBoxIndirect*(MsgBoxParams: MsgBoxParams): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "MessageBoxIndirectA".}

-proc MessageBoxIndirectA*(MsgBoxParams: MsgBoxParams): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "MessageBoxIndirectA".}

-  #function MessageBoxIndirectW(const MsgBoxParams: MsgBoxParamsW): WINBOOL; stdcall; external 'user32' name 'MessageBoxIndirectW';

-  #function ModifyWorldTransform(DC: HDC; const p2: XForm; p3: DWORD): WINBOOL; stdcall; external 'gdi32' name 'ModifyWorldTransform';

-proc MsgWaitForMultipleObjects*(nCount: DWORD, pHandles: pointer,

-                                fWaitAll: WINBOOL,

-                                dwMilliseconds, dwWakeMask: DWORD): DWORD{.

-    stdcall, dynlib: "user32", importc: "MsgWaitForMultipleObjects".}

-proc MsgWaitForMultipleObjectsEx*(nCount: DWORD, pHandles: pointer,

-                                  dwMilliseconds, dwWakeMask, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "user32", importc: "MsgWaitForMultipleObjectsEx".}

-  # function MultiByteToWideChar(CodePage: WINUINT; dwFlags: DWORD; const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; lLPWSTRStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; external 'kernel32' name 'MultiByteToWideChar';

-proc ObjectOpenAuditAlarm*(SubsystemName: cstring, HandleId: pointer,

-                           ObjectTypeName: cstring, ObjectName: cstring,

-                           pSecurityDescriptor: PSecurityDescriptor,

-                           ClientToken: Handle,

-                           DesiredAccess, GrantedAccess: DWORD,

-                           Privileges: var PrivilegeSet,

-                           ObjectCreation, AccessGranted: WINBOOL,

-                           GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-proc ObjectOpenAuditAlarmA*(SubsystemName: LPCSTR, HandleId: pointer,

-                            ObjectTypeName: LPCSTR, ObjectName: LPCSTR,

-                            pSecurityDescriptor: PSecurityDescriptor,

-                            ClientToken: Handle,

-                            DesiredAccess, GrantedAccess: DWORD,

-                            Privileges: var PrivilegeSet,

-                            ObjectCreation, AccessGranted: WINBOOL,

-                            GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-proc ObjectOpenAuditAlarmW*(SubsystemName: LPWSTR, HandleId: pointer,

-                            ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

-                            pSecurityDescriptor: PSecurityDescriptor,

-                            ClientToken: Handle,

-                            DesiredAccess, GrantedAccess: DWORD,

-                            Privileges: var PrivilegeSet,

-                            ObjectCreation, AccessGranted: WINBOOL,

-                            GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmW".}

-proc ObjectPrivilegeAuditAlarm*(SubsystemName: cstring, HandleId: pointer,

-                                ClientToken: Handle, DesiredAccess: DWORD,

-                                Privileges: var PrivilegeSet,

-                                AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-proc ObjectPrivilegeAuditAlarmA*(SubsystemName: LPCSTR, HandleId: pointer,

-                                 ClientToken: Handle, DesiredAccess: DWORD,

-                                 Privileges: var PrivilegeSet,

-                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-proc ObjectPrivilegeAuditAlarmW*(SubsystemName: LPWSTR, HandleId: pointer,

-                                 ClientToken: Handle, DesiredAccess: DWORD,

-                                 Privileges: var PrivilegeSet,

-                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmW".}

-proc OffsetRect*(lprc: var Rect, dx, dy: int): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "OffsetRect".}

-proc OffsetViewportOrgEx*(DC: HDC, X, Y: int, Points: pointer): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "OffsetViewportOrgEx".}

-proc OffsetWindowOrgEx*(DC: HDC, X, Y: int, Points: pointer): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "OffsetWindowOrgEx".}

-proc OpenFile*(lpFileName: LPCSTR, lpReOpenBuff: var OFStruct, uStyle: WINUINT): HFILE{.

-    stdcall, dynlib: "kernel32", importc: "OpenFile".}

-proc OpenProcessToken*(ProcessHandle: Handle, DesiredAccess: DWORD,

-                       TokenHandle: var Handle): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "OpenProcessToken".}

-proc OpenThreadToken*(ThreadHandle: Handle, DesiredAccess: DWORD,

-                      OpenAsSelf: WINBOOL, TokenHandle: var Handle): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "OpenThreadToken".}

-proc PeekConsoleInput*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                       nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}

-proc PeekConsoleInputA*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}

-proc PeekConsoleInputW*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".}

-proc PeekMessage*(lpMsg: var TMsg, wnd: HWND,

-                  wMsgFilterMin, wMsgFilterMax, wRemoveMsg: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "PeekMessageA".}

-proc PeekMessageA*(lpMsg: var TMsg, wnd: HWND,

-                   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "PeekMessageA".}

-proc PeekMessageW*(lpMsg: var TMsg, wnd: HWND,

-                   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: WINUINT): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "PeekMessageW".}

-  #function PlayEnhMetaFile(DC: HDC; p2: HENHMETAFILE; const p3: Rect): WINBOOL; stdcall; external 'gdi32' name 'PlayEnhMetaFile';

-proc PlayEnhMetaFileRecord*(DC: HDC, p2: var HandleTable, p3: EnhMetaRecord,

-                            p4: WINUINT): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "PlayEnhMetaFileRecord".}

-proc PlayMetaFileRecord*(DC: HDC, p2: HandleTable, p3: MetaRecord, p4: WINUINT): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PlayMetaFileRecord".}

-proc PlgBlt*(DC: HDC, PointsArray: pointer, p3: HDC, p4, p5, p6, p7: int,

-             p8: HBITMAP, p9, p10: int): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "PlgBlt".}

-proc PolyBezier*(DC: HDC, Points: pointer, Count: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolyBezier".}

-proc PolyBezierTo*(DC: HDC, Points: pointer, Count: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolyBezierTo".}

-proc PolyDraw*(DC: HDC, Points, Types: pointer, cCount: int): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolyDraw".}

-proc Polygon*(DC: HDC, Points: pointer, Count: int): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "Polygon".}

-proc Polyline*(DC: HDC, Points: pointer, Count: int): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "Polyline".}

-proc PolyLineTo*(DC: HDC, Points: pointer, Count: DWORD): WINBOOL{.stdcall,

-    dynlib: "gdi32", importc: "PolylineTo".}

-proc PolyPolygon*(DC: HDC, Points: pointer, nPoints: pointer, p4: int): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyPolygon".}

-proc PolyPolyline*(DC: HDC, PointStructs: pointer, Points: pointer, p4: DWORD): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyPolyline".}

-proc PolyTextOut*(DC: HDC, PolyTextArray: pointer, Strings: int): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyTextOutA".}

-proc PolyTextOutA*(DC: HDC, PolyTextArray: pointer, Strings: int): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyTextOutA".}

-proc PolyTextOutW*(DC: HDC, PolyTextArray: pointer, Strings: int): WINBOOL{.

-    stdcall, dynlib: "gdi32", importc: "PolyTextOutW".}

-proc PrivilegeCheck*(ClientToken: Handle, RequiredPrivileges: PrivilegeSet,

-                     pfResult: var WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegeCheck".}

-proc PrivilegedServiceAuditAlarm*(SubsystemName, ServiceName: cstring,

-                                  ClientToken: Handle,

-                                  Privileges: var PrivilegeSet,

-                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}

-proc PrivilegedServiceAuditAlarmA*(SubsystemName, ServiceName: LPCSTR,

-                                   ClientToken: Handle,

-                                   Privileges: var PrivilegeSet,

-                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}

-proc PrivilegedServiceAuditAlarmW*(SubsystemName, ServiceName: LPWSTR,

-                                   ClientToken: Handle,

-                                   Privileges: var PrivilegeSet,

-                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,

-    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmW".}

-  #function PtInRect(const lprc: Rect; pt: Point): WINBOOL; stdcall; external 'user32' name 'PtInRect';

-proc QueryPerformanceCounter*(lpPerformanceCount: var LargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "QueryPerformanceCounter".}

-proc QueryPerformanceFrequency*(lpFrequency: var LargeInteger): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "QueryPerformanceFrequency".}

-  #function QueryRecoveryAgents(p1: PChar; var p2: pointer; var p3: TRecoveryAgentInformation): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

-  #function QueryRecoveryAgentsA(p1: LPCSTR; var p2: pointer; var p3: TRecoveryAgentInformationA): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

-  #function QueryRecoveryAgentsW(p1: LPWSTR; var p2: pointer; var p3: TRecoveryAgentInformationW): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsW';

-proc RaiseException*(dwExceptionCode: DWORD, dwExceptionFlags: DWORD,

-                     nNumberOfArguments: DWORD, lpArguments: var DWORD){.

-    stdcall, dynlib: "kernel32", importc: "RaiseException".}

-proc UnhandledExceptionFilter*(ExceptionInfo: var emptyrecord): LONG{.stdcall,

-    dynlib: "kernel32", importc: "UnhandledExceptionFilter".}

-proc ReadConsole*(hConsoleInput: Handle, lpBuffer: pointer,

-                  nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                  lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReadConsoleA".}

-proc ReadConsoleA*(hConsoleInput: Handle, lpBuffer: pointer,

-                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                   lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReadConsoleA".}

-proc ReadConsoleInput*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                       nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}

-proc ReadConsoleInputA*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}

-proc ReadConsoleInputW*(hConsoleInput: Handle, lpBuffer: var InputRecord,

-                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}

-proc ReadConsoleOutput*(hConsoleOutput: Handle, lpBuffer: pointer,

-                        dwBufferSize, dwBufferCoord: Coord,

-                        lpReadRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-proc ReadConsoleOutputA*(hConsoleOutput: Handle, lpBuffer: pointer,

-                         dwBufferSize, dwBufferCoord: Coord,

-                         lpReadRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-proc ReadConsoleOutputAttribute*(hConsoleOutput: Handle, lpAttribute: pointer,

-                                 nLength: DWORD, dwReadCoord: Coord,

-                                 lpNumberOfAttrsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputAttribute".}

-proc ReadConsoleOutputCharacter*(hConsoleOutput: Handle, lpCharacter: LPCSTR,

-                                 nLength: DWORD, dwReadCoord: Coord,

-                                 lpNumberOfCharsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}

-proc ReadConsoleOutputCharacterA*(hConsoleOutput: Handle, lpCharacter: LPCSTR,

-                                  nLength: DWORD, dwReadCoord: Coord,

-                                  lpNumberOfCharsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}

-proc ReadConsoleOutputCharacterW*(hConsoleOutput: Handle, lpCharacter: LPCSTR,

-                                  nLength: DWORD, dwReadCoord: Coord,

-                                  lpNumberOfCharsRead: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".}

-proc ReadConsoleOutputW*(hConsoleOutput: Handle, lpBuffer: pointer,

-                         dwBufferSize, dwBufferCoord: Coord,

-                         lpReadRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadConsoleOutputW".}

-proc ReadConsoleW*(hConsoleInput: Handle, lpBuffer: pointer,

-                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                   lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

-    importc: "ReadConsoleW".}

-proc ReadEventLog*(hEventLog: Handle, dwReadFlags, dwRecordOffset: DWORD,

-                   lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

-                   pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}

-proc ReadEventLogA*(hEventLog: Handle, dwReadFlags, dwRecordOffset: DWORD,

-                    lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

-                    pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}

-proc ReadEventLogW*(hEventLog: Handle, dwReadFlags, dwRecordOffset: DWORD,

-                    lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

-                    pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

-    stdcall, dynlib: "advapi32", importc: "ReadEventLogW".}

-proc ReadFile*(hFile: Handle, Buffer: pointer, nNumberOfBytesToRead: DWORD,

-               lpNumberOfBytesRead: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "ReadFile".}

-proc ReadProcessMemory*(hProcess: Handle, lpBaseAddress: pointer,

-                        lpBuffer: pointer, nSize: DWORD,

-                        lpNumberOfBytesRead: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ReadProcessMemory".}

-  #function RectInRegion(RGN: HRGN; const p2: Rect): WINBOOL; stdcall; external 'gdi32' name 'RectInRegion';

-  #function RectVisible(DC: HDC; const Rect: Rect): WINBOOL; stdcall; external 'gdi32' name 'RectVisible';

-proc RegConnectRegistry*(lpMachineName: cstring, key: HKEY, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}

-proc RegConnectRegistryA*(lpMachineName: LPCSTR, key: HKEY, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}

-proc RegConnectRegistryW*(lpMachineName: LPWSTR, key: HKEY, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}

-proc RegCreateKey*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}

-proc RegCreateKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}

-proc RegCreateKeyEx*(key: HKEY, lpSubKey: cstring, Reserved: DWORD,

-                     lpClass: cstring, dwOptions: DWORD, samDesired: REGSAM,

-                     lpSecurityAttributes: PSecurityAttributes,

-                     phkResult: var HKEY, lpdwDisposition: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".}

-proc RegCreateKeyExA*(key: HKEY, lpSubKey: LPCSTR, Reserved: DWORD,

-                      lpClass: LPCSTR, dwOptions: DWORD, samDesired: REGSAM,

-                      lpSecurityAttributes: PSecurityAttributes,

-                      phkResult: var HKEY, lpdwDisposition: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyExA".}

-proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPWSTR, Reserved: DWORD,

-                      lpClass: LPWSTR, dwOptions: DWORD, samDesired: REGSAM,

-                      lpSecurityAttributes: PSecurityAttributes,

-                      phkResult: var HKEY, lpdwDisposition: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyExW".}

-proc RegCreateKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}

-proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: cstring,

-                   lpcbName: var DWORD, lpReserved: pointer, lpClass: cstring,

-                   lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

-proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPCSTR,

-                    lpcbName: var DWORD, lpReserved: pointer, lpClass: LPCSTR,

-                    lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

-proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR,

-                    lpcbName: var DWORD, lpReserved: pointer, lpClass: LPWSTR,

-                    lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}

-proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                   lpcbValueName: var DWORD, lpReserved: pointer,

-                   lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

-proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                    lpcbValueName: var DWORD, lpReserved: pointer,

-                    lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

-proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                    lpcbValueName: var DWORD, lpReserved: pointer,

-                    lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}

-proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION,

-                        pSecurityDescriptor: PSecurityDescriptor,

-                        lpcbSecurityDescriptor: var DWORD): int32{.stdcall,

-    dynlib: "advapi32", importc: "RegGetKeySecurity".}

-proc RegSetValueEx*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD,

-                    dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}

-proc RegSetValueExA*(key: HKEY, lpValueName: LPCSTR, Reserved: DWORD,

-                     dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}

-proc RegSetValueExW*(key: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,

-                     dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.

-    stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}

-proc RegisterClass*(lpWndClass: WndClass): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassA".}

-proc RegisterClassA*(lpWndClass: WndClass): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassA".}

-proc RegisterClassEx*(WndClass: WndClassEx): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassExA".}

-proc RegisterClassExA*(WndClass: WndClassEx): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassExA".}

-proc RegisterClassExW*(WndClass: WndClassExW): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassExW".}

-proc RegisterClassW*(lpWndClass: WndClassW): ATOM{.stdcall, dynlib: "user32",

-    importc: "RegisterClassW".}

-proc RegOpenKey*(key: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}

-proc RegOpenKeyA*(key: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}

-proc RegOpenKeyEx*(key: HKEY, lpSubKey: cstring, ulOptions: DWORD,

-                   samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,

-    dynlib: "advapi32", importc: "RegOpenKeyExA".}

-proc RegOpenKeyExA*(key: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,

-                    samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,

-    dynlib: "advapi32", importc: "RegOpenKeyExA".}

-proc RegOpenKeyExW*(key: HKEY, lpSubKey: LPWSTR, ulOptions: DWORD,

-                    samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,

-    dynlib: "advapi32", importc: "RegOpenKeyExW".}

-proc RegOpenKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}

-proc RegQueryMultipleValues*(key: HKEY, ValList: pointer, NumVals: DWORD,

-                             lpValueBuf: cstring, ldwTotsize: var DWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}

-proc RegQueryMultipleValuesA*(key: HKEY, ValList: pointer, NumVals: DWORD,

-                              lpValueBuf: LPCSTR, ldwTotsize: var DWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}

-proc RegQueryMultipleValuesW*(key: HKEY, ValList: pointer, NumVals: DWORD,

-                              lpValueBuf: LPWSTR, ldwTotsize: var DWORD): int32{.

-    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}

-proc RegQueryValue*(key: HKEY, lpSubKey: cstring, lpValue: cstring,

-                    lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",

-    importc: "RegQueryValueA".}

-proc RegQueryValueA*(key: HKEY, lpSubKey: LPCSTR, lpValue: LPCSTR,

-                     lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",

-    importc: "RegQueryValueA".}

-proc RegQueryValueW*(key: HKEY, lpSubKey: LPWSTR, lpValue: LPWSTR,

-                     lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",

-    importc: "RegQueryValueW".}

-proc ResetDC*(DC: HDC, p2: DevMode): HDC{.stdcall, dynlib: "gdi32",

-    importc: "ResetDCA".}

-proc ResetDCA*(DC: HDC, p2: DevMode): HDC{.stdcall, dynlib: "gdi32",

-    importc: "ResetDCA".}

-  #function ResetDCW(DC: HDC; const p2: DevModeW): HDC; stdcall; external 'gdi32' name 'ResetDCW';

-proc ScreenToClient*(wnd: HWND, lpPoint: var Point): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "ScreenToClient".}

-proc ScrollConsoleScreenBuffer*(hConsoleOutput: Handle,

-                                lpScrollRectangle: SmallRect,

-                                lpClipRectangle: SmallRect,

-                                dwDestinationOrigin: Coord,

-                                lpFill: var CharInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}

-proc ScrollConsoleScreenBufferA*(hConsoleOutput: Handle,

-                                 lpScrollRectangle: SmallRect,

-                                 lpClipRectangle: SmallRect,

-                                 dwDestinationOrigin: Coord,

-                                 lpFill: var CharInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}

-proc ScrollConsoleScreenBufferW*(hConsoleOutput: Handle,

-                                 lpScrollRectangle: SmallRect,

-                                 lpClipRectangle: SmallRect,

-                                 dwDestinationOrigin: Coord,

-                                 lpFill: var CharInfo): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".}

-proc ScrollWindow*(wnd: HWND, XAmount: int32, YAmount: int32, rect: LPRECT,

-                   lpClipRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "ScrollWindow".}

-proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: LPRECT,

-                     prcClip: LPRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,

-                     flags: WINUINT): int32{.stdcall, dynlib: "user32",

-    importc: "ScrollWindowEx".}

-  #function ScrollDC(DC: HDC; DX, DY: Integer; var Scroll, Clip: Rect; Rgn: HRGN; Update: PRect): WINBOOL; stdcall; external 'user32' name 'ScrollDC';

-  #function SearchPath(lpPath, lpFileName, lpExtension: PChar; nBufferLength: DWORD; lpBuffer: PChar; var lpFilePart: PChar): DWORD;stdcall; external 'kernel32' name 'SearchPathA';

-  #function SearchPathA(lpPath, lpFileName, lpExtension: LPCSTR; nBufferLength: DWORD; lpBuffer: LPCSTR; var lpFilePart: LPCSTR): DWORD; stdcall; external 'kernel32' name 'SearchPathA';

-  #function SearchPathW(lpPath, lpFileName, lpExtension: LPWSTR; nBufferLength: DWORD; lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall; external 'kernel32' name 'SearchPathW';

-  #function SendInput(cInputs: WINUINT; var pInputs: TInput; cbSize: Integer): WINUINT;stdcall; external 'user32' name 'SendInput';

-proc SendMessageTimeout*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

-                         fuFlags, uTimeout: WINUINT, lpdwResult: var DWORD): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}

-proc SendMessageTimeoutA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

-                          fuFlags, uTimeout: WINUINT, lpdwResult: var DWORD): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}

-proc SendMessageTimeoutW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

-                          fuFlags, uTimeout: WINUINT, lpdwResult: var DWORD): LRESULT{.

-    stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".}

-  #function SetAclInformation(var pAcl: ACL; pAclInformation: pointer; nAclInformationLength: DWORD; dwAclInformationClass: AclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'SetAclInformation';

-  #function SetColorAdjustment(DC: HDC; const p2: ColorAdjustment): WINBOOL; stdcall; external 'gdi32' name 'SetColorAdjustment';

-proc SetCommConfig*(hCommDev: Handle, lpCC: CommConfig, dwSize: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetCommConfig".}

-proc SetCommState*(hFile: Handle, lpDCB: DCB): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetCommState".}

-proc SetCommTimeouts*(hFile: Handle, lpCommTimeouts: CommTimeouts): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetCommTimeouts".}

-proc SetConsoleCursorInfo*(hConsoleOutput: Handle,

-                           lpConsoleCursorInfo: ConsoleCursorInfo): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetConsoleCursorInfo".}

-  #function SetConsoleWindowInfo(hConsoleOutput: Handle; bAbsolute: WINBOOL; const lpConsoleWindow: SmallRect): WINBOOL; stdcall; external 'kernel32' name 'SetConsoleWindowInfo';

-proc SetDIBColorTable*(DC: HDC, p2, p3: WINUINT, RGBQuadSTructs: pointer): WINUINT{.

-    stdcall, dynlib: "gdi32", importc: "SetDIBColorTable".}

-proc SetDIBits*(DC: HDC, Bitmap: HBITMAP, StartScan, NumScans: WINUINT,

-                Bits: pointer, BitsInfo: var BitmapInfo, Usage: WINUINT): int{.

-    stdcall, dynlib: "gdi32", importc: "SetDIBits".}

-  #function SetDIBitsToDevice(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD; SrcX, SrcY: Integer; nStartScan, NumScans: WINUINT; Bits: pointer; var BitsInfo: BitmapInfo; Usage: WINUINT): Integer; stdcall; external 'gdi32' name 'SetDIBitsToDevice';

-proc SetEnhMetaFileBits*(para1: WINUINT, para2: pointer): HENHMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "SetEnhMetaFileBits".}

-proc SetFileTime*(hFile: HANDLE, lpCreationTime: var FILETIME,

-                  lpLastAccessTime: var FILETIME, lpLastWriteTime: var FILETIME): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetFileTime".}

-  #function SetKeyboardState(var KeyState: TKeyboardState): WINBOOL; stdcall; external 'user32' name 'SetKeyboardState';

-  #function SetLocalTime(const lpSystemTime: SystemTime): WINBOOL; stdcall; external 'kernel32' name 'SetLocalTime';

-  #function SetMenuInfo(menu: HMENU; const lpcmi: TMenuInfo): WINBOOL;stdcall; external 'user32' name 'SetMenuInfo';

-proc SetMenuItemInfo*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: MenuItemInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetMenuItemInfoA".}

-proc SetMenuItemInfoA*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: MenuItemInfo): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetMenuItemInfoA".}

-  #function SetMenuItemInfoW(p1: HMENU; p2: WINUINT; p3: WINBOOL; const p4: MenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'SetMenuItemInfoW';

-proc SetMetaFileBitsEx*(p1: WINUINT, p2: cstring): HMETAFILE{.stdcall,

-    dynlib: "gdi32", importc: "SetMetaFileBitsEx".}

-proc SetNamedPipeHandleState*(hNamedPipe: Handle, lpMode: var DWORD,

-    lpMaxCollectionCount, lpCollectDataTimeout: pointer): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetNamedPipeHandleState".}

-proc SetPaletteEntries*(Palette: HPALETTE, StartIndex, NumEntries: WINUINT,

-                        PaletteEntries: pointer): WINUINT{.stdcall,

-    dynlib: "gdi32", importc: "SetPaletteEntries".}

-  #function SetPrivateObjectSecurity(SecurityInformation: SECURITY_INFORMATION; ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor; const GenericMapping: GenericMapping; Token: Handle): WINBOOL;

-  #  stdcall; external 'advapi32' name 'SetPrivateObjectSecurity';

-  #function SetPrivateObjectSecurityEx(SecurityInformation: SECURITY_INFORMATION; ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor; AutoInheritFlags: ULONG;

-  #  const GenericMapping: GenericMapping; Token: Handle): WINBOOL;stdcall; external 'advapi32' name 'SetPrivateObjectSecurityEx';

-proc SetRect*(lprc: var Rect, xLeft, yTop, xRight, yBottom: int): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetRect".}

-proc SetRectEmpty*(lprc: var Rect): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "SetRectEmpty".}

-proc SetScrollInfo*(wnd: HWND, BarFlag: int, ScrollInfo: ScrollInfo,

-                    Redraw: WINBOOL): int{.stdcall, dynlib: "user32",

-    importc: "SetScrollInfo".}

-proc SetSysColors*(cElements: int, lpaElements: pointer, lpaRgbValues: pointer): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SetSysColors".}

-  #function SetSystemTime(const lpSystemTime: SystemTime): WINBOOL; stdcall; external 'kernel32' name 'SetSystemTime';

-proc SetThreadContext*(hThread: Handle, lpContext: Context): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SetThreadContext".}

-  #function SetTimeZoneInformation(const lpTimeZoneInformation: TimeZoneInformation): WINBOOL; stdcall; external 'kernel32' name 'SetTimeZoneInformation';

-proc SetUserObjectSecurity*(hObj: Handle, pSIRequested: var DWORD,

-                            pSID: PSecurityDescriptor): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "SetUserObjectSecurity".}

-proc SetWaitableTimer*(hTimer: Handle, lpDueTime: var LargeInteger,

-                       lPeriod: int32, pfnCompletionRoutine: TFNTimerAPCRoutine,

-                       lpArgToCompletionRoutine: pointer, fResume: WINBOOL): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SetWaitableTimer".}

-proc SetWinMetaFileBits*(p1: WINUINT, p2: cstring, p3: HDC, p4: MetaFilePict): HENHMETAFILE{.

-    stdcall, dynlib: "gdi32", importc: "SetWinMetaFileBits".}

-  #function SetWorldTransform(DC: HDC; const p2: XForm): WINBOOL; stdcall; external 'gdi32' name 'SetWorldTransform';

-proc StartDoc*(DC: HDC, p2: DocInfo): int{.stdcall, dynlib: "gdi32",

-    importc: "StartDocA".}

-proc StartDocA*(DC: HDC, p2: DocInfo): int{.stdcall, dynlib: "gdi32",

-    importc: "StartDocA".}

-  #function StartDocW(DC: HDC; const p2: DocInfoW): Integer; stdcall; external 'gdi32' name 'StartDocW';

-  #function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX, SrcY, SrcWidth, SrcHeight: Integer; Bits: pointer; var BitsInfo: BitmapInfo; Usage: WINUINT; Rop: DWORD): Integer; stdcall; external 'gdi32' name 'StretchDIBits';

-proc SubtractRect*(lprcDst: var Rect, lprcSrc1, lprcSrc2: Rect): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "SubtractRect".}

-proc SystemTimeToFileTime*(lpSystemTime: SystemTime, lpFileTime: var FileTime): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "SystemTimeToFileTime".}

-proc SystemTimeToTzSpecificLocalTime*(lpTimeZoneInformation: PTimeZoneInformation,

-    lpUniversalTime, lpLocalTime: var SystemTime): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "SystemTimeToTzSpecificLocalTime".}

-proc TabbedTextOut*(hDC: HDC, X, Y: int, lpString: cstring,

-                    nCount, nTabPositions: int, lpnTabStopPositions: pointer,

-                    nTabOrigin: int): int32{.stdcall, dynlib: "user32",

-    importc: "TabbedTextOutA".}

-proc TabbedTextOutA*(hDC: HDC, X, Y: int, lpString: LPCSTR,

-                     nCount, nTabPositions: int, lpnTabStopPositions: pointer,

-                     nTabOrigin: int): int32{.stdcall, dynlib: "user32",

-    importc: "TabbedTextOutA".}

-proc TabbedTextOutW*(hDC: HDC, X, Y: int, lpString: LPWSTR,

-                     nCount, nTabPositions: int, lpnTabStopPositions: pointer,

-                     nTabOrigin: int): int32{.stdcall, dynlib: "user32",

-    importc: "TabbedTextOutW".}

-  #function ToAscii(uVirtKey, uScanCode: WINUINT; const KeyState: TKeyboardState; lpChar: PChar; uFlags: WINUINT): Integer; stdcall; external 'user32' name 'ToAscii';

-  #function ToAsciiEx(uVirtKey: WINUINT; uScanCode: WINUINT; const KeyState: TKeyboardState; lpChar: PChar; uFlags: WINUINT; dwhkl: HKL): Integer; stdcall; external 'user32' name 'ToAsciiEx';

-  #function ToUnicode(wVirtKey, wScanCode: WINUINT; const KeyState: TKeyboardState; var pwszBuff; cchBuff: Integer; wFlags: WINUINT): Integer; stdcall; external 'user32' name 'ToUnicode';

-  # Careful, NT and higher only.

-proc TrackMouseEvent*(EventTrack: var TTrackMouseEvent): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "TrackMouseEvent".}

-proc TrackMouseEvent*(lpEventTrack: PTrackMouseEvent): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "TrackMouseEvent".}

-proc TrackPopupMenu*(menu: HMENU, uFlags: WINUINT, x: int32, y: int32,

-                     nReserved: int32, wnd: HWND, prcRect: PRect): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "TrackPopupMenu".}

-proc TransactNamedPipe*(hNamedPipe: Handle, lpInBuffer: pointer,

-                        nInBufferSize: DWORD, lpOutBuffer: pointer,

-                        nOutBufferSize: DWORD, lpBytesRead: var DWORD,

-                        lpOverlapped: POverlapped): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "TransactNamedPipe".}

-proc TranslateAccelerator*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.

-    stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}

-proc TranslateAcceleratorA*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.

-    stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}

-proc TranslateAcceleratorW*(wnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.

-    stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".}

-proc TranslateCharsetInfo*(lpSrc: var DWORD, lpCs: var CharsetInfo,

-                           dwFlags: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

-    importc: "TranslateCharsetInfo".}

-proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: TMsg): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "TranslateMDISysAccel".}

-proc TranslateMessage*(lpMsg: TMsg): WINBOOL{.stdcall, dynlib: "user32",

-    importc: "TranslateMessage".}

-  #function TransparentDIBits(DC: HDC; p2, p3, p4, p5: Integer; const p6: pointer; const p7: PBitmapInfo; p8: WINUINT; p9, p10, p11, p12: Integer; p13: WINUINT): WINBOOL;stdcall; external 'gdi32' name 'TransparentDIBits';

-proc UnhandledExceptionFilter*(ExceptionInfo: Exceptionpointers): int32{.

-    stdcall, dynlib: "kernel32", importc: "UnhandledExceptionFilter".}

-proc UnionRect*(lprcDst: var Rect, lprcSrc1, lprcSrc2: Rect): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "UnionRect".}

-proc UnlockFileEx*(hFile: Handle, dwReserved, nNumberOfBytesToUnlockLow: DWORD,

-                   nNumberOfBytesToUnlockHigh: DWORD, lpOverlapped: Overlapped): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "UnlockFileEx".}

-proc VerFindFile*(uFlags: DWORD,

-                  szFileName, szWinDir, szAppDir, szCurDir: cstring,

-                  lpuCurDirLen: var WINUINT, szDestDir: cstring,

-                  lpuDestDirLen: var WINUINT): DWORD{.stdcall, dynlib: "version",

-    importc: "VerFindFileA".}

-proc VerFindFileA*(uFlags: DWORD,

-                   szFileName, szWinDir, szAppDir, szCurDir: LPCSTR,

-                   lpuCurDirLen: var WINUINT, szDestDir: LPCSTR,

-                   lpuDestDirLen: var WINUINT): DWORD{.stdcall, dynlib: "version",

-    importc: "VerFindFileA".}

-proc VerFindFileW*(uFlags: DWORD,

-                   szFileName, szWinDir, szAppDir, szCurDir: LPWSTR,

-                   lpuCurDirLen: var WINUINT, szDestDir: LPWSTR,

-                   lpuDestDirLen: var WINUINT): DWORD{.stdcall, dynlib: "version",

-    importc: "VerFindFileW".}

-proc VerInstallFile*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,

-                                    szDestDir, szCurDir, szTmpFile: cstring,

-                     lpuTmpFileLen: var WINUINT): DWORD{.stdcall,

-    dynlib: "version", importc: "VerInstallFileA".}

-proc VerInstallFileA*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,

-                                     szDestDir, szCurDir, szTmpFile: LPCSTR,

-                      lpuTmpFileLen: var WINUINT): DWORD{.stdcall,

-    dynlib: "version", importc: "VerInstallFileA".}

-proc VerInstallFileW*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,

-                                     szDestDir, szCurDir, szTmpFile: LPWSTR,

-                      lpuTmpFileLen: var WINUINT): DWORD{.stdcall,

-    dynlib: "version", importc: "VerInstallFileW".}

-proc VerQueryValue*(pBlock: pointer, lpSubBlock: cstring,

-                    lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.stdcall,

-    dynlib: "version", importc: "VerQueryValueA".}

-proc VerQueryValueA*(pBlock: pointer, lpSubBlock: LPCSTR,

-                     lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.

-    stdcall, dynlib: "version", importc: "VerQueryValueA".}

-proc VerQueryValueW*(pBlock: pointer, lpSubBlock: LPWSTR,

-                     lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.

-    stdcall, dynlib: "version", importc: "VerQueryValueW".}

-proc VirtualQuery*(lpAddress: pointer, lpBuffer: var MemoryBasicInformation,

-                   dwLength: DWORD): DWORD{.stdcall, dynlib: "kernel32",

-    importc: "VirtualQuery".}

-proc VirtualQueryEx*(hProcess: Handle, lpAddress: pointer,

-                     lpBuffer: var MemoryBasicInformation, dwLength: DWORD): DWORD{.

-    stdcall, dynlib: "kernel32", importc: "VirtualQueryEx".}

-proc WaitCommEvent*(hFile: Handle, lpEvtMask: var DWORD,

-                    lpOverlapped: POverlapped): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WaitCommEvent".}

-proc WaitForDebugEvent*(lpDebugEvent: var DebugEvent, dwMilliseconds: DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WaitForDebugEvent".}

-proc wglDescribeLayerPlane*(p1: HDC, p2, p3: int, p4: int,

-                            p5: var LayerPlaneDescriptor): WINBOOL{.stdcall,

-    dynlib: "opengl32", importc: "wglDescribeLayerPlane".}

-proc wglGetLayerPaletteEntries*(p1: HDC, p2, p3, p4: int, pcr: pointer): int{.

-    stdcall, dynlib: "opengl32", importc: "wglGetLayerPaletteEntries".}

-proc wglSetLayerPaletteEntries*(p1: HDC, p2, p3, p4: int, pcr: pointer): int{.

-    stdcall, dynlib: "opengl32", importc: "wglSetLayerPaletteEntries".}

-  #function wglSwapMultipleBuffers(p1: WINUINT; const p2: PWGLSwap): DWORD;stdcall; external 'opengl32' name 'wglSwapMultipleBuffers';

-  #function WinSubmitCertificate(var lpCertificate: TWinCertificate): WINBOOL;stdcall; external 'imaghlp' name 'WinSubmitCertificate';

-  #function WinVerifyTrust(wnd: HWND; const ActionID: GUID; ActionData: pointer): Longint;stdcall; external 'imaghlp' name 'WinVerifyTrust';

-proc WNetAddConnection2*(lpNetResource: var NetResource,

-                         lpPassword, lpUserName: cstring, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetAddConnection2A".}

-proc WNetAddConnection2A*(lpNetResource: var NetResource,

-                          lpPassword, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetAddConnection2A".}

-  #function WNetAddConnection2W(var lpNetResource: NetResourceW; lpPassword, lpUserName: LPWSTR; dwFlags: DWORD): DWORD; stdcall; external 'mpr' name 'WNetAddConnection2W';

-proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: var NetResource,

-                         lpPassword, lpUserName: cstring, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".}

-proc WNetAddConnection3A*(hwndOwner: HWND, lpNetResource: var NetResource,

-                          lpPassword, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".}

-  #function WNetAddConnection3W(hwndOwner: HWND; var lpNetResource: NetResourceW; lpPassword, lpUserName: LPWSTR; dwFlags: DWORD): DWORD; stdcall; external 'mpr' name 'WNetAddConnection3W';

-proc WNetConnectionDialog1*(lpConnDlgStruct: var ConnectDlgStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}

-proc WNetConnectionDialog1A*(lpConnDlgStruct: var ConnectDlgStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}

-  #function WNetConnectionDialog1W(var lpConnDlgStruct: ConnectDlgStruct): DWORD; stdcall; external 'mpr' name 'WNetConnectionDialog1W';

-proc WNetDisconnectDialog1*(lpConnDlgStruct: var DiscDlgStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetDisconnectDialog1A".}

-proc WNetDisconnectDialog1A*(lpConnDlgStruct: var DiscDlgStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetDisconnectDialog1A".}

-  #function WNetDisconnectDialog1W(var lpConnDlgStruct: DiscDlgStructW): DWORD; stdcall; external 'mpr' name 'WNetDisconnectDialog1W';

-proc WNetEnumResource*(hEnum: Handle, lpcCount: var DWORD, lpBuffer: pointer,

-                       lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetEnumResourceA".}

-proc WNetEnumResourceA*(hEnum: Handle, lpcCount: var DWORD, lpBuffer: pointer,

-                        lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetEnumResourceA".}

-proc WNetEnumResourceW*(hEnum: Handle, lpcCount: var DWORD, lpBuffer: pointer,

-                        lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetEnumResourceW".}

-proc WNetGetConnection*(lpLocalName: cstring, lpRemoteName: cstring,

-                        lpnLength: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetConnectionA".}

-proc WNetGetConnectionA*(lpLocalName: LPCSTR, lpRemoteName: LPCSTR,

-                         lpnLength: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetConnectionA".}

-proc WNetGetConnectionW*(lpLocalName: LPWSTR, lpRemoteName: LPWSTR,

-                         lpnLength: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetConnectionW".}

-proc WNetGetLastError*(lpError: var DWORD, lpErrorBuf: cstring,

-                       nErrorBufSize: DWORD, lpNameBuf: cstring,

-                       nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetLastErrorA".}

-proc WNetGetLastErrorA*(lpError: var DWORD, lpErrorBuf: LPCSTR,

-                        nErrorBufSize: DWORD, lpNameBuf: LPCSTR,

-                        nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetLastErrorA".}

-proc WNetGetLastErrorW*(lpError: var DWORD, lpErrorBuf: LPWSTR,

-                        nErrorBufSize: DWORD, lpNameBuf: LPWSTR,

-                        nNameBufSize: DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetLastErrorW".}

-proc WNetGetNetworkInformation*(lpProvider: cstring,

-                                lpNetInfoStruct: var NetInfoStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}

-proc WNetGetNetworkInformationA*(lpProvider: LPCSTR,

-                                 lpNetInfoStruct: var NetInfoStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}

-proc WNetGetNetworkInformationW*(lpProvider: LPWSTR,

-                                 lpNetInfoStruct: var NetInfoStruct): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationW".}

-proc WNetGetProviderName*(dwNetType: DWORD, lpProviderName: cstring,

-                          lpBufferSize: var DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetProviderNameA".}

-proc WNetGetProviderNameA*(dwNetType: DWORD, lpProviderName: LPCSTR,

-                           lpBufferSize: var DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetProviderNameA".}

-proc WNetGetProviderNameW*(dwNetType: DWORD, lpProviderName: LPWSTR,

-                           lpBufferSize: var DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetProviderNameW".}

-proc WNetGetResourceParent*(lpNetResource: PNetResource, lpBuffer: pointer,

-                            cbBuffer: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetGetResourceParentA".}

-proc WNetGetResourceParentA*(lpNetResource: PNetResourceA, lpBuffer: pointer,

-                             cbBuffer: var DWORD): DWORD{.stdcall,

-    dynlib: "mpr", importc: "WNetGetResourceParentA".}

-  #function WNetGetResourceParentW(lpNetResource: PNetResourceW; lpBuffer: pointer; var cbBuffer: DWORD): DWORD;stdcall; external 'mpr' name 'WNetGetResourceParentW';

-proc WNetGetUniversalName*(lpLocalPath: cstring, dwInfoLevel: DWORD,

-                           lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

-proc WNetGetUniversalNameA*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD,

-                            lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

-proc WNetGetUniversalNameW*(lpLocalPath: LPWSTR, dwInfoLevel: DWORD,

-                            lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".}

-proc WNetGetUser*(lpName: cstring, lpUserName: cstring, lpnLength: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUserA".}

-proc WNetGetUserA*(lpName: LPCSTR, lpUserName: LPCSTR, lpnLength: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUserA".}

-proc WNetGetUserW*(lpName: LPWSTR, lpUserName: LPWSTR, lpnLength: var DWORD): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetGetUserW".}

-proc WNetOpenEnum*(dwScope, dwType, dwUsage: DWORD, lpNetResource: PNetResource,

-                   lphEnum: var Handle): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetOpenEnumA".}

-proc WNetOpenEnumA*(dwScope, dwType, dwUsage: DWORD,

-                    lpNetResource: PNetResourceA, lphEnum: var Handle): DWORD{.

-    stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".}

-  #function WNetOpenEnumW(dwScope, dwType, dwUsage: DWORD; lpNetResource: PNetResourceW; var lphEnum: Handle): DWORD; stdcall; external 'mpr' name 'WNetOpenEnumW';

-proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: var NetResource,

-                        lpUserID: cstring, lpPassword: cstring, dwFlags: DWORD,

-                        lpAccessName: cstring, lpBufferSize: var DWORD,

-                        lpResult: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetUseConnectionA".}

-proc WNetUseConnectionA*(hwndOwner: HWND, lpNetResource: var NetResource,

-                         lpUserID: LPCSTR, lpPassword: LPCSTR, dwFlags: DWORD,

-                         lpAccessName: LPCSTR, lpBufferSize: var DWORD,

-                         lpResult: var DWORD): DWORD{.stdcall, dynlib: "mpr",

-    importc: "WNetUseConnectionA".}

-  #function WNetUseConnectionW(hwndOwner: HWND; var lpNetResource: NetResourceW; lpUserID: LPWSTR; lpPassword: LPWSTR; dwFlags: DWORD; lpAccessName: LPWSTR; var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall; external 'mpr' name 'WNetUseConnectionW';

-proc WriteConsole*(hConsoleOutput: Handle, lpBuffer: pointer,

-                   nNumberOfCharsToWrite: DWORD,

-                   lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

-proc WriteConsoleA*(hConsoleOutput: Handle, lpBuffer: pointer,

-                    nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

-proc WriteConsoleInput*(hConsoleInput: Handle, lpBuffer: InputRecord,

-                        nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}

-proc WriteConsoleInputA*(hConsoleInput: Handle, lpBuffer: InputRecord,

-                         nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}

-proc WriteConsoleInputW*(hConsoleInput: Handle, lpBuffer: InputRecord,

-                         nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".}

-proc WriteConsoleOutput*(hConsoleOutput: Handle, lpBuffer: pointer,

-                         dwBufferSize, dwBufferCoord: Coord,

-                         lpWriteRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-proc WriteConsoleOutputA*(hConsoleOutput: Handle, lpBuffer: pointer,

-                          dwBufferSize, dwBufferCoord: Coord,

-                          lpWriteRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-proc WriteConsoleOutputAttribute*(hConsoleOutput: Handle, lpAttribute: pointer,

-                                  nLength: DWORD, dwWriteCoord: Coord,

-                                  lpNumberOfAttrsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputAttribute".}

-proc WriteConsoleOutputCharacter*(hConsoleOutput: Handle, lpCharacter: cstring,

-                                  nLength: DWORD, dwWriteCoord: Coord,

-                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-proc WriteConsoleOutputCharacterA*(hConsoleOutput: Handle, lpCharacter: LPCSTR,

-                                   nLength: DWORD, dwWriteCoord: Coord,

-                                   lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-proc WriteConsoleOutputCharacterW*(hConsoleOutput: Handle, lpCharacter: LPWSTR,

-                                   nLength: DWORD, dwWriteCoord: Coord,

-                                   lpNumberOfCharsWritten: var DWORD): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".}

-proc WriteConsoleOutputW*(hConsoleOutput: Handle, lpBuffer: pointer,

-                          dwBufferSize, dwBufferCoord: Coord,

-                          lpWriteRegion: var SmallRect): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteConsoleOutputW".}

-proc WriteConsoleW*(hConsoleOutput: Handle, lpBuffer: pointer,

-                    nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteConsoleW".}

-proc WriteFile*(hFile: Handle, Buffer: pointer, nNumberOfBytesToWrite: DWORD,

-                lpNumberOfBytesWritten: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WriteFile".}

-proc WriteFileEx*(hFile: Handle, lpBuffer: pointer,

-                  nNumberOfBytesToWrite: DWORD, lpOverlapped: Overlapped,

-                  lpCompletionRoutine: FARPROC): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteFileEx".}

-proc WritePrivateProfileStructA*(lpszSection, lpszKey: LPCSTR, lpStruct: LPVOID,

-                                 uSizeStruct: WINUINT, szFile: LPCSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStructA".}

-proc WritePrivateProfileStructW*(lpszSection, lpszKey: LPCWSTR,

-                                 lpStruct: LPVOID, uSizeStruct: WINUINT,

-                                 szFile: LPCWSTR): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WritePrivateProfileStructW".}

-proc WritePrivateProfileStruct*(lpszSection, lpszKey: LPCTSTR, lpStruct: LPVOID,

-                                uSizeStruct: WINUINT, szFile: LPCTSTR): WINBOOL{.

-    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStructA".}

-proc WriteProcessMemory*(hProcess: Handle, lpBaseAddress: pointer,

-                         lpBuffer: pointer, nSize: DWORD,

-                         lpNumberOfBytesWritten: var DWORD): WINBOOL{.stdcall,

-    dynlib: "kernel32", importc: "WriteProcessMemory".}

-proc SHFileOperation*(para1: var SHFILEOPSTRUCT): int32{.stdcall,

-    dynlib: "shell32", importc: "SHFileOperation".}

-

-  # these are old Win16 funcs that under win32 are aliases for several char* funcs.

-# exist under Win32 (even in SDK's from 2002), but are officially "deprecated"

-proc AnsiNext*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32",

-                                     importc: "CharNextA".}

-proc AnsiPrev*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall,

-    dynlib: "user32", importc: "CharPrevA".}

-proc AnsiToOem*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "CharToOemA".}

-proc OemToAnsi*(lpszSrc: LPCSTR, lpszDst: LPSTR): WINBOOL{.stdcall,

-    dynlib: "user32", importc: "OemToCharA".}

-proc AnsiToOemBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "CharToOemBuffA".}

-proc OemToAnsiBuff*(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD): WINBOOL{.

-    stdcall, dynlib: "user32", importc: "OemToCharBuffA".}

-proc AnsiUpper*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                     importc: "CharUpperA".}

-proc AnsiUpperBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharUpperBuffA".}

-proc AnsiLower*(lpsz: LPSTR): LPSTR{.stdcall, dynlib: "user32",

-                                     importc: "CharLowerA".}

-proc AnsiLowerBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,

-    dynlib: "user32", importc: "CharLowerBuffA".}

-

-#== Implementation of macros

-

-# WinBase.h

-

-proc FreeModule*(h: HINST): WINBOOL =

-  result = FreeLibrary(h)

-

-proc MakeProcInstance*(p, i: pointer): pointer =

-  result = p

-

-proc FreeProcInstance*(p: pointer): pointer =

-  result = p

-

-proc GlobalDiscard*(hglbMem: HGLOBAL): HGLOBAL =

-  result = GlobalReAlloc(hglbMem, 0, GMEM_MOVEABLE)

-

-proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL =

-  result = LocalReAlloc(hlocMem, 0, LMEM_MOVEABLE)

-

-# WinGDI.h

-

-discard """proc GetGValue*(rgb: int32): int8 =

-  result = toU8(rgb shr 8'i32)"""

-proc RGB*(r, g, b: int): COLORREF =

-  result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16)

-proc RGB*(r, g, b: range[0 .. 255]): COLORREF =

-  result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16)

-

-proc PALETTERGB*(r, g, b: range[0..255]): COLORREF =

-  result = 0x02000000 or RGB(r, g, b)

-

-proc PALETTEINDEX*(i: DWORD): COLORREF =

-  result = COLORREF(0x01000000'i32 or i and 0xffff'i32)

-

-

-proc GetRValue*(rgb: COLORREF): int8 =

-  result = toU8(rgb)

-

-proc GetGValue*(rgb: COLORREF): int8 =

-  result = toU8(rgb shr 8)

-

-proc GetBValue*(rgb: COLORREF): int8 =

-  result = toU8(rgb shr 16)

-

-#

-

-proc HIBYTE*(w: int32): int8 =

-  result = toU8(w shr 8'i32 and 0x000000FF'i32)

-

-proc HIWORD*(L: int32): int16 =

-  result = toU16(L shr 16'i32 and 0x0000FFFF'i32)

-

-proc LOBYTE*(w: int32): int8 =

-  result = toU8(w)

-

-proc LOWORD*(L: int32): int16 =

-  result = toU16(L)

-

-proc MAKELONG*(a, b: int32): LONG =

-  result = a and 0x0000ffff'i32 or b shl 16'i32

-

-proc MAKEWORD*(a, b: int32): int16 =

-  result = toU16(a and 0xff'i32) or toU16(b shl 8'i32)

-

-proc SEXT_HIWORD*(L: int32): int32 =

-  # return type might be wrong

-  result = HIWORD(L)

-

-proc ZEXT_HIWORD*(L: int32): int32 =

-  # return type might be wrong

-  result = HIWORD(L) and 0xffff'i32

-

-proc SEXT_LOWORD*(L: int32): int32 =

-  result = LOWORD(L)

-

-proc INDEXTOOVERLAYMASK*(i: int32): int32 =

-  # return type might be wrong

-  result = i shl 8'i32

-

-proc INDEXTOSTATEIMAGEMASK*(i: int32): int32 =

-  # return type might be wrong

-  result = i shl 12'i32

-

-proc MAKEINTATOM*(i: int32): LPTSTR =

-  result = cast[LPTSTR](cast[ULONG_PTR](toU16(i)))

-

-proc MAKELANGID*(p, s: int32): int32 =

-  # return type might be wrong

-  result = toU16(s) shl 10'i16 or toU16(p)

-

-proc PRIMARYLANGID*(lgid: int32): int16 =

-  result = toU16(lgid) and 0x000003FF'i16

-

-proc SUBLANGID*(lgid: int32): int32 =

-  # return type might be wrong

-  result = toU16(lgid) shr 10'i16

-

-proc MAKELCID*(lgid, srtid: int32): DWORD =

-  result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32)

-

-proc MAKELPARAM*(L, h: int32): LPARAM =

-  result = LPARAM(MAKELONG(L, h))

-

-proc MAKELRESULT*(L, h: int32): LRESULT =

-  result = LRESULT(MAKELONG(L, h))

-

-proc MAKEROP4*(fore, back: int32): DWORD =

-  result = back shl 8'i32 and 0xFF000000'i32 or fore

-

-proc MAKEWPARAM*(L, h: int32): WPARAM =

-  result = WPARAM(MAKELONG(L, h))

-

-proc GET_X_LPARAM*(lp: windows.LParam): int32 =

-  result = LOWORD(lp.int32)

-

-proc GET_Y_LPARAM*(lp: windows.LParam): int32 =

-  result = HIWORD(lp.int32)

-

-proc UNICODE_NULL*(): WCHAR =

-  result = 0'u16

-

-

-

-proc GetFirstChild*(h: HWND): HWND =

-  result = GetTopWindow(h)

-

-proc GetNextSibling*(h: HWND): HWND =

-  result = GetWindow(h, GW_HWNDNEXT)

-

-proc GetWindowID*(h: HWND): int32 =

-  result = GetDlgCtrlID(h)

-

-proc SubclassWindow*(h: HWND, p: LONG): LONG =

-  result = SetWindowLong(h, GWL_WNDPROC, p)

-

-proc GET_WM_COMMAND_CMD*(w, L: int32): int32 =

-  # return type might be wrong

-  result = HIWORD(w)

-

-proc GET_WM_COMMAND_ID(w, L: int32): int32 =

-  # return type might be wrong

-  result = LOWORD(w)

-

-proc GET_WM_CTLCOLOR_HDC(w, L, msg: int32): HDC =

-  result = HDC(w)

-

-proc GET_WM_CTLCOLOR_HWND(w, L, msg: int32): HWND =

-  result = HWND(L)

-

-proc GET_WM_HSCROLL_CODE(w, L: int32): int32 =

-  # return type might be wrong

-  result = LOWORD(w)

-

-proc GET_WM_HSCROLL_HWND(w, L: int32): HWND =

-  result = HWND(L)

-

-proc GET_WM_HSCROLL_POS(w, L: int32): int32 =

-  # return type might be wrong

-  result = HIWORD(w)

-

-proc GET_WM_MDIACTIVATE_FACTIVATE(h, a, b: int32): int32 =

-  # return type might be wrong

-  result = ord(b == h)

-

-proc GET_WM_MDIACTIVATE_HWNDACTIVATE(a, b: int32): HWND =

-  result = HWND(b)

-

-proc GET_WM_MDIACTIVATE_HWNDDEACT(a, b: int32): HWND =

-  result = HWND(a)

-

-proc GET_WM_VSCROLL_CODE(w, L: int32): int32 =

-  # return type might be wrong

-  result = LOWORD(w)

-

-proc GET_WM_VSCROLL_HWND(w, L: int32): HWND =

-  result = HWND(L)

-

-proc GET_WM_VSCROLL_POS(w, L: int32): int32 =

-  # return type might be wrong

-  result = HIWORD(w)

-

-proc fBinary(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fBinary) shr bp_DCB_fBinary

-

-proc set_fBinary(a: var DCB, fBinary: DWORD) =

-  a.flags = a.flags or ((fBinary shl bp_DCB_fBinary) and bm_DCB_fBinary)

-

-proc fParity(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fParity) shr bp_DCB_fParity

-

-proc set_fParity(a: var DCB, fParity: DWORD) =

-  a.flags = a.flags or ((fParity shl bp_DCB_fParity) and bm_DCB_fParity)

-

-proc fOutxCtsFlow(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fOutxCtsFlow) shr bp_DCB_fOutxCtsFlow

-

-proc set_fOutxCtsFlow(a: var DCB, fOutxCtsFlow: DWORD) =

-  a.flags = a.flags or

-      ((fOutxCtsFlow shl bp_DCB_fOutxCtsFlow) and bm_DCB_fOutxCtsFlow)

-

-proc fOutxDsrFlow(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fOutxDsrFlow) shr bp_DCB_fOutxDsrFlow

-

-proc set_fOutxDsrFlow(a: var DCB, fOutxDsrFlow: DWORD) =

-  a.flags = a.flags or

-      ((fOutxDsrFlow shl bp_DCB_fOutxDsrFlow) and bm_DCB_fOutxDsrFlow)

-

-proc fDtrControl(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fDtrControl) shr bp_DCB_fDtrControl

-

-proc set_fDtrControl(a: var DCB, fDtrControl: DWORD) =

-  a.flags = a.flags or

-      ((fDtrControl shl bp_DCB_fDtrControl) and bm_DCB_fDtrControl)

-

-proc fDsrSensitivity(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fDsrSensitivity) shr bp_DCB_fDsrSensitivity

-

-proc set_fDsrSensitivity(a: var DCB, fDsrSensitivity: DWORD) =

-  a.flags = a.flags or

-      ((fDsrSensitivity shl bp_DCB_fDsrSensitivity) and

-      bm_DCB_fDsrSensitivity)

-

-proc fTXContinueOnXoff(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fTXContinueOnXoff) shr

-      bp_DCB_fTXContinueOnXoff

-

-proc set_fTXContinueOnXoff(a: var DCB, fTXContinueOnXoff: DWORD) =

-  a.flags = a.flags or

-      ((fTXContinueOnXoff shl bp_DCB_fTXContinueOnXoff) and

-      bm_DCB_fTXContinueOnXoff)

-

-proc fOutX(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fOutX) shr bp_DCB_fOutX

-

-proc set_fOutX(a: var DCB, fOutX: DWORD) =

-  a.flags = a.flags or ((fOutX shl bp_DCB_fOutX) and bm_DCB_fOutX)

-

-proc fInX(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fInX) shr bp_DCB_fInX

-

-proc set_fInX(a: var DCB, fInX: DWORD) =

-  a.flags = a.flags or ((fInX shl bp_DCB_fInX) and bm_DCB_fInX)

-

-proc fErrorChar(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fErrorChar) shr bp_DCB_fErrorChar

-

-proc set_fErrorChar(a: var DCB, fErrorChar: DWORD) =

-  a.flags = a.flags or

-      ((fErrorChar shl bp_DCB_fErrorChar) and bm_DCB_fErrorChar)

-

-proc fNull(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fNull) shr bp_DCB_fNull

-

-proc set_fNull(a: var DCB, fNull: DWORD) =

-  a.flags = a.flags or ((fNull shl bp_DCB_fNull) and bm_DCB_fNull)

-

-proc fRtsControl(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fRtsControl) shr bp_DCB_fRtsControl

-

-proc set_fRtsControl(a: var DCB, fRtsControl: DWORD) =

-  a.flags = a.flags or

-      ((fRtsControl shl bp_DCB_fRtsControl) and bm_DCB_fRtsControl)

-

-proc fAbortOnError(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fAbortOnError) shr bp_DCB_fAbortOnError

-

-proc set_fAbortOnError(a: var DCB, fAbortOnError: DWORD) =

-  a.flags = a.flags or

-      ((fAbortOnError shl bp_DCB_fAbortOnError) and bm_DCB_fAbortOnError)

-

-proc fDummy2(a: var DCB): DWORD =

-  result = (a.flags and bm_DCB_fDummy2) shr bp_DCB_fDummy2

-

-proc set_fDummy2(a: var DCB, fDummy2: DWORD) =

-  a.flags = a.flags or ((fDummy2 shl bp_DCB_fDummy2) and bm_DCB_fDummy2)

-

-proc fCtsHold(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fCtsHold) shr bp_COMSTAT_fCtsHold

-

-proc set_fCtsHold(a: var COMSTAT, fCtsHold: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fCtsHold shl bp_COMSTAT_fCtsHold) and bm_COMSTAT_fCtsHold)

-

-proc fDsrHold(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fDsrHold) shr bp_COMSTAT_fDsrHold

-

-proc set_fDsrHold(a: var COMSTAT, fDsrHold: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fDsrHold shl bp_COMSTAT_fDsrHold) and bm_COMSTAT_fDsrHold)

-

-proc fRlsdHold(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fRlsdHold) shr bp_COMSTAT_fRlsdHold

-

-proc set_fRlsdHold(a: var COMSTAT, fRlsdHold: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fRlsdHold shl bp_COMSTAT_fRlsdHold) and bm_COMSTAT_fRlsdHold)

-

-proc fXoffHold(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fXoffHold) shr bp_COMSTAT_fXoffHold

-

-proc set_fXoffHold(a: var COMSTAT, fXoffHold: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fXoffHold shl bp_COMSTAT_fXoffHold) and bm_COMSTAT_fXoffHold)

-

-proc fXoffSent(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fXoffSent) shr bp_COMSTAT_fXoffSent

-

-proc set_fXoffSent(a: var COMSTAT, fXoffSent: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fXoffSent shl bp_COMSTAT_fXoffSent) and bm_COMSTAT_fXoffSent)

-

-proc fEof(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fEof) shr bp_COMSTAT_fEof

-

-proc set_fEof(a: var COMSTAT, fEof: DWORD) =

-  a.flag0 = a.flag0 or ((fEof shl bp_COMSTAT_fEof) and bm_COMSTAT_fEof)

-

-proc fTxim(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fTxim) shr bp_COMSTAT_fTxim

-

-proc set_fTxim(a: var COMSTAT, fTxim: DWORD) =

-  a.flag0 = a.flag0 or ((fTxim shl bp_COMSTAT_fTxim) and bm_COMSTAT_fTxim)

-

-proc fReserved(a: var COMSTAT): DWORD =

-  result = (a.flag0 and bm_COMSTAT_fReserved) shr bp_COMSTAT_fReserved

-

-proc set_fReserved(a: var COMSTAT, fReserved: DWORD) =

-  a.flag0 = a.flag0 or

-      ((fReserved shl bp_COMSTAT_fReserved) and bm_COMSTAT_fReserved)

-

-proc bAppReturnCode(a: var DDEACK): int16 =

-  result = (a.flag0 and bm_DDEACK_bAppReturnCode) shr

-      bp_DDEACK_bAppReturnCode

-

-proc set_bAppReturnCode(a: var DDEACK, bAppReturnCode: int16) =

-  a.flag0 = a.flag0 or

-      ((bAppReturnCode shl bp_DDEACK_bAppReturnCode) and

-      bm_DDEACK_bAppReturnCode)

-

-proc reserved(a: var DDEACK): int16 =

-  result = (a.flag0 and bm_DDEACK_reserved) shr bp_DDEACK_reserved

-

-proc set_reserved(a: var DDEACK, reserved: int16) =

-  a.flag0 = a.flag0 or

-      ((reserved shl bp_DDEACK_reserved) and bm_DDEACK_reserved)

-

-proc fBusy(a: var DDEACK): int16 =

-  result = (a.flag0 and bm_DDEACK_fBusy) shr bp_DDEACK_fBusy

-

-proc set_fBusy(a: var DDEACK, fBusy: int16) =

-  a.flag0 = a.flag0 or ((fBusy shl bp_DDEACK_fBusy) and bm_DDEACK_fBusy)

-

-proc fAck(a: var DDEACK): int16 =

-  result = (a.flag0 and bm_DDEACK_fAck) shr bp_DDEACK_fAck

-

-proc set_fAck(a: var DDEACK, fAck: int16) =

-  a.flag0 = a.flag0 or ((fAck shl bp_DDEACK_fAck) and bm_DDEACK_fAck)

-

-proc reserved(a: var DDEADVISE): int16 =

-  result = (a.flag0 and bm_DDEADVISE_reserved) shr bp_DDEADVISE_reserved

-

-proc set_reserved(a: var DDEADVISE, reserved: int16) =

-  a.flag0 = a.flag0 or

-      ((reserved shl bp_DDEADVISE_reserved) and bm_DDEADVISE_reserved)

-

-proc fDeferUpd(a: var DDEADVISE): int16 =

-  result = (a.flag0 and bm_DDEADVISE_fDeferUpd) shr bp_DDEADVISE_fDeferUpd

-

-proc set_fDeferUpd(a: var DDEADVISE, fDeferUpd: int16) =

-  a.flag0 = a.flag0 or

-      ((fDeferUpd shl bp_DDEADVISE_fDeferUpd) and bm_DDEADVISE_fDeferUpd)

-

-proc fAckReq(a: var DDEADVISE): int16 =

-  result = (a.flag0 and bm_DDEADVISE_fAckReq) shr bp_DDEADVISE_fAckReq

-

-proc set_fAckReq(a: var DDEADVISE, fAckReq: int16) =

-  a.flag0 = a.flag0 or

-      ((fAckReq shl bp_DDEADVISE_fAckReq) and bm_DDEADVISE_fAckReq)

-

-proc unused(a: var DDEDATA): int16 =

-  result = (a.flag0 and bm_DDEDATA_unused) shr bp_DDEDATA_unused

-

-proc set_unused(a: var DDEDATA, unused: int16) =

-  a.flag0 = a.flag0 or ((unused shl bp_DDEDATA_unused) and bm_DDEDATA_unused)

-

-proc fResponse(a: var DDEDATA): int16 =

-  result = (a.flag0 and bm_DDEDATA_fResponse) shr bp_DDEDATA_fResponse

-

-proc set_fResponse(a: var DDEDATA, fResponse: int16) =

-  a.flag0 = a.flag0 or

-      ((fResponse shl bp_DDEDATA_fResponse) and bm_DDEDATA_fResponse)

-

-proc fRelease(a: var DDEDATA): int16 =

-  result = (a.flag0 and bm_DDEDATA_fRelease) shr bp_DDEDATA_fRelease

-

-proc set_fRelease(a: var DDEDATA, fRelease: int16) =

-  a.flag0 = a.flag0 or

-      ((fRelease shl bp_DDEDATA_fRelease) and bm_DDEDATA_fRelease)

-

-proc reserved(a: var DDEDATA): int16 =

-  result = (a.flag0 and bm_DDEDATA_reserved) shr bp_DDEDATA_reserved

-

-proc set_reserved(a: var DDEDATA, reserved: int16) =

-  a.flag0 = a.flag0 or

-      ((reserved shl bp_DDEDATA_reserved) and bm_DDEDATA_reserved)

-

-proc fAckReq(a: var DDEDATA): int16 =

-  result = (a.flag0 and bm_DDEDATA_fAckReq) shr bp_DDEDATA_fAckReq

-

-proc set_fAckReq(a: var DDEDATA, fAckReq: int16) =

-  a.flag0 = a.flag0 or

-      ((fAckReq shl bp_DDEDATA_fAckReq) and bm_DDEDATA_fAckReq)

-

-proc unused(a: var DDELN): int16 =

-  result = (a.flag0 and bm_DDELN_unused) shr bp_DDELN_unused

-

-proc set_unused(a: var DDELN, unused: int16) =

-  a.flag0 = a.flag0 or ((unused shl bp_DDELN_unused) and bm_DDELN_unused)

-

-proc fRelease(a: var DDELN): int16 =

-  result = (a.flag0 and bm_DDELN_fRelease) shr bp_DDELN_fRelease

-

-proc set_fRelease(a: var DDELN, fRelease: int16) =

-  a.flag0 = a.flag0 or

-      ((fRelease shl bp_DDELN_fRelease) and bm_DDELN_fRelease)

-

-proc fDeferUpd(a: var DDELN): int16 =

-  result = (a.flag0 and bm_DDELN_fDeferUpd) shr bp_DDELN_fDeferUpd

-

-proc set_fDeferUpd(a: var DDELN, fDeferUpd: int16) =

-  a.flag0 = a.flag0 or

-      ((fDeferUpd shl bp_DDELN_fDeferUpd) and bm_DDELN_fDeferUpd)

-

-proc fAckReq(a: var DDELN): int16 =

-  result = (a.flag0 and bm_DDELN_fAckReq) shr bp_DDELN_fAckReq

-

-proc set_fAckReq(a: var DDELN, fAckReq: int16) =

-  a.flag0 = a.flag0 or ((fAckReq shl bp_DDELN_fAckReq) and bm_DDELN_fAckReq)

-

-proc unused(a: var DDEPOKE): int16 =

-  result = (a.flag0 and bm_DDEPOKE_unused) shr bp_DDEPOKE_unused

-

-proc set_unused(a: var DDEPOKE, unused: int16) =

-  a.flag0 = a.flag0 or ((unused shl bp_DDEPOKE_unused) and bm_DDEPOKE_unused)

-

-proc fRelease(a: var DDEPOKE): int16 =

-  result = (a.flag0 and bm_DDEPOKE_fRelease) shr bp_DDEPOKE_fRelease

-

-proc set_fRelease(a: var DDEPOKE, fRelease: int16) =

-  a.flag0 = a.flag0 or

-      ((fRelease shl bp_DDEPOKE_fRelease) and bm_DDEPOKE_fRelease)

-

-proc fReserved(a: var DDEPOKE): int16 =

-  result = (a.flag0 and bm_DDEPOKE_fReserved) shr bp_DDEPOKE_fReserved

-

-proc set_fReserved(a: var DDEPOKE, fReserved: int16) =

-  a.flag0 = a.flag0 or

-      ((fReserved shl bp_DDEPOKE_fReserved) and bm_DDEPOKE_fReserved)

-

-proc unused(a: var DDEUP): int16 =

-  result = (a.flag0 and bm_DDEUP_unused) shr bp_DDEUP_unused

-

-proc set_unused(a: var DDEUP, unused: int16) =

-  a.flag0 = a.flag0 or ((unused shl bp_DDEUP_unused) and bm_DDEUP_unused)

-

-proc fAck(a: var DDEUP): int16 =

-  result = (a.flag0 and bm_DDEUP_fAck) shr bp_DDEUP_fAck

-

-proc set_fAck(a: var DDEUP, fAck: int16) =

-  a.flag0 = a.flag0 or ((fAck shl bp_DDEUP_fAck) and bm_DDEUP_fAck)

-

-proc fRelease(a: var DDEUP): int16 =

-  result = (a.flag0 and bm_DDEUP_fRelease) shr bp_DDEUP_fRelease

-

-proc set_fRelease(a: var DDEUP, fRelease: int16) =

-  a.flag0 = a.flag0 or

-      ((fRelease shl bp_DDEUP_fRelease) and bm_DDEUP_fRelease)

-

-proc fReserved(a: var DDEUP): int16 =

-  result = (a.flag0 and bm_DDEUP_fReserved) shr bp_DDEUP_fReserved

-

-proc set_fReserved(a: var DDEUP, fReserved: int16) =

-  a.flag0 = a.flag0 or

-      ((fReserved shl bp_DDEUP_fReserved) and bm_DDEUP_fReserved)

-

-proc fAckReq(a: var DDEUP): int16 =

-  result = (a.flag0 and bm_DDEUP_fAckReq) shr bp_DDEUP_fAckReq

-

-proc set_fAckReq(a: var DDEUP, fAckReq: int16) =

-  a.flag0 = a.flag0 or ((fAckReq shl bp_DDEUP_fAckReq) and bm_DDEUP_fAckReq)

-

-proc CreateWindowA(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD,

-                   X, Y, nWidth, nHeight: int32,

-                   hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                   lpParam: LPVOID): HWND =

-  result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

-                           nHeight, hWndParent, menu, hInstance, lpParam)

-

-proc CreateDialogA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                   lpDialogFunc: DLGPROC): HWND =

-  result = CreateDialogParamA(hInstance, lpTemplateName, hWndParent,

-                              lpDialogFunc, 0)

-

-proc CreateDialogIndirectA(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                           hWndParent: HWND, lpDialogFunc: DLGPROC): HWND =

-  result = CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent,

-                                      lpDialogFunc, 0)

-

-proc DialogBoxA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                lpDialogFunc: DLGPROC): int32 =

-  result = DialogBoxParamA(hInstance, lpTemplateName, hWndParent, lpDialogFunc,

-                           0)

-

-proc DialogBoxIndirectA(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                        hWndParent: HWND, lpDialogFunc: DLGPROC): int32 =

-  result = DialogBoxIndirectParamA(hInstance, hDialogTemplate, hWndParent,

-                                   lpDialogFunc, 0)

-

-proc CreateWindowW(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD,

-                   X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                   hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                   lpParam: LPVOID): HWND =

-  result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

-                           nHeight, hWndParent, menu, hInstance, lpParam)

-

-proc CreateDialogW(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

-                   lpDialogFunc: DLGPROC): HWND =

-  result = CreateDialogParamW(hInstance, lpName, hWndParent, lpDialogFunc, 0)

-

-proc CreateDialogIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                           hWndParent: HWND, lpDialogFunc: DLGPROC): HWND =

-  result = CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent,

-                                      lpDialogFunc, 0)

-

-proc DialogBoxW(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND,

-                lpDialogFunc: DLGPROC): int32 =

-  result = DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)

-

-proc DialogBoxIndirectW(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                        hWndParent: HWND, lpDialogFunc: DLGPROC): int32 =

-  result = DialogBoxIndirectParamW(hInstance, lpTemplate, hWndParent,

-                                   lpDialogFunc, 0)

-

-when defined(winUnicode):

-  proc CreateWindow(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD,

-                    X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                    lpParam: LPVOID): HWND =

-    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

-                            nHeight, hWndParent, hMenu, hInstance, lpParam)

-

-  proc CreateDialog(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

-                    lpDialogFunc: DLGPROC): HWND =

-    result = CreateDialogParam(hInstance, lpName, hWndParent, lpDialogFunc, 0)

-

-  proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                            hWndParent: HWND, lpDialogFunc: DLGPROC): HWND =

-    result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent,

-                                       lpDialogFunc, 0)

-

-  proc DialogBox(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND,

-                 lpDialogFunc: DLGPROC): int32 =

-    result = DialogBoxParam(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0)

-

-  proc DialogBoxIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC): int32 =

-    result = DialogBoxIndirectParam(hInstance, lpTemplate, hWndParent,

-                                    lpDialogFunc, 0)

-

-else:

-  proc CreateWindow(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD,

-                    X: int32, Y: int32, nWidth: int32, nHeight: int32,

-                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

-                    lpParam: LPVOID): HWND =

-    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

-                            nHeight, hWndParent, menu, hInstance, lpParam)

-

-  proc CreateDialog(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                    lpDialogFunc: DLGPROC): HWND =

-    result = CreateDialogParam(hInstance, lpTemplateName, hWndParent,

-                               lpDialogFunc, 0)

-

-  proc CreateDialogIndirect(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

-                            hWndParent: HWND, lpDialogFunc: DLGPROC): HWND =

-    result = CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent,

-                                       lpDialogFunc, 0)

-

-  proc DialogBox(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

-                 lpDialogFunc: DLGPROC): int32 =

-    result = DialogBoxParam(hInstance, lpTemplateName, hWndParent, lpDialogFunc,

-                            0)

-

-  proc DialogBoxIndirect(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

-                         hWndParent: HWND, lpDialogFunc: DLGPROC): int32 =

-    result = DialogBoxIndirectParam(hInstance, hDialogTemplate, hWndParent,

-                                    lpDialogFunc, 0)

-

-proc GlobalAllocPtr(flags, cb: DWord): pointer =

-  result = GlobalLock(GlobalAlloc(flags, cb))

-

-proc GlobalFreePtr(lp: pointer): pointer =

-  result = cast[pointer](GlobalFree(cast[HWND](GlobalUnlockPtr(lp))))

-

-proc GlobalUnlockPtr(lp: pointer): pointer =

-  discard GlobalUnlock(GlobalHandle(lp))

-  result = lp

-

-proc GlobalLockPtr(lp: pointer): pointer =

-  result = GlobalLock(GlobalHandle(lp))

-

-proc GlobalReAllocPtr(lp: pointer, cbNew, flags: DWord): pointer =

-  result = GlobalLock(GlobalReAlloc(cast[HWND](GlobalUnlockPtr(lp)), cbNew, flags))

-

-proc GlobalPtrHandle(lp: pointer): pointer =

-  result = cast[pointer](GlobalHandle(lp))

-

-proc ImageList_AddIcon(himl: HIMAGELIST, hicon: HICON): int32 =

-  result = ImageList_ReplaceIcon(himl, -1, hicon)

-

-proc Animate_Create(hWndP: HWND, id: HMENU, dwStyle: DWORD, hInstance: HINST): HWND =

-  result = CreateWindow(cast[LPCSTR](ANIMATE_CLASS), nil, dwStyle, 0, 0, 0, 0, hwndP,

-                        id, hInstance, nil)

-

-proc Animate_Open(wnd: HWND, szName: LPTSTR): LRESULT =

-  result = SendMessage(wnd, ACM_OPEN, 0, cast[LPARAM](szName))

-

-proc Animate_Play(wnd: HWND, `from`, `to`: int32, rep: WINUINT): LRESULT =

-  result = SendMessage(wnd, ACM_PLAY, WPARAM(rep),

-                       LPARAM(MAKELONG(`from`, `to`)))

-

-proc Animate_Stop(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, ACM_STOP, 0, 0)

-

-proc Animate_Close(wnd: HWND): LRESULT =

-  result = Animate_Open(wnd, nil)

-

-proc Animate_Seek(wnd: HWND, frame: int32): LRESULT =

-  result = Animate_Play(wnd, frame, frame, 1)

-

-proc PropSheet_AddPage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_ADDPAGE, 0, cast[LPARAM](hpage))

-

-proc PropSheet_Apply(hPropSheetDlg: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_APPLY, 0, 0)

-

-proc PropSheet_CancelToClose(hPropSheetDlg: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_CANCELTOCLOSE, 0, 0)

-

-proc PropSheet_Changed(hPropSheetDlg, hwndPage: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_CHANGED, WPARAM(hwndPage), 0)

-

-proc PropSheet_GetCurrentPageHwnd(hDlg: HWND): LRESULT =

-  result = SendMessage(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0)

-

-proc PropSheet_GetTabControl(hPropSheetDlg: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_GETTABCONTROL, 0, 0)

-

-proc PropSheet_IsDialogMessage(hDlg: HWND, pMsg: int32): LRESULT =

-  result = SendMessage(hDlg, PSM_ISDIALOGMESSAGE, 0, LPARAM(pMsg))

-

-proc PropSheet_PressButton(hPropSheetDlg: HWND, iButton: int32): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_PRESSBUTTON, WPARAM(int32(iButton)), 0)

-

-proc PropSheet_QuerySiblings(hPropSheetDlg: HWND, param1, param2: int32): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_QUERYSIBLINGS, WPARAM(param1),

-                       LPARAM(param2))

-

-proc PropSheet_RebootSystem(hPropSheetDlg: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_REBOOTSYSTEM, 0, 0)

-

-proc PropSheet_RemovePage(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE,

-                          index: int32): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_REMOVEPAGE, WPARAM(index),

-                       cast[LPARAM](hpage))

-

-proc PropSheet_RestartWindows(hPropSheetDlg: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_RESTARTWINDOWS, 0, 0)

-

-proc PropSheet_SetCurSel(hPropSheetDlg: HWND, hpage: HPROPSHEETPAGE,

-                         index: int32): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_SETCURSEL, WPARAM(index),

-                       cast[LPARAM](hpage))

-

-proc PropSheet_SetCurSelByID(hPropSheetDlg: HWND, id: int32): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_SETCURSELID, 0, LPARAM(id))

-

-proc PropSheet_SetFinishText(hPropSheetDlg: HWND, lpszText: LPTSTR): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_SETFINISHTEXT, 0, cast[LPARAM](lpszText))

-

-proc PropSheet_SetTitle(hPropSheetDlg: HWND, dwStyle: DWORD, lpszText: LPCTSTR): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_SETTITLE, WPARAM(dwStyle),

-                       cast[LPARAM](lpszText))

-

-proc PropSheet_SetWizButtons(hPropSheetDlg: HWND, dwFlags: DWORD): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_SETWIZBUTTONS, 0, LPARAM(dwFlags))

-

-proc PropSheet_UnChanged(hPropSheetDlg: HWND, hwndPage: HWND): LRESULT =

-  result = SendMessage(hPropSheetDlg, PSM_UNCHANGED, WPARAM(hwndPage), 0)

-

-proc Header_DeleteItem(hwndHD: HWND, index: int32): WINBOOL =

-  result = WINBOOL(SendMessage(hwndHD, HDM_DELETEITEM, WPARAM(index), 0))

-

-proc Header_GetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL =

-  result = WINBOOL(SendMessage(hwndHD, HDM_GETITEM, WPARAM(index),

-                               cast[LPARAM](addr(hdi))))

-

-proc Header_GetItemCount(hwndHD: HWND): int32 =

-  result = int32(SendMessage(hwndHD, HDM_GETITEMCOUNT, 0, 0))

-

-proc Header_InsertItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): int32 =

-  result = int32(SendMessage(hwndHD, HDM_INSERTITEM, WPARAM(index),

-                             cast[LPARAM](addr(hdi))))

-

-proc Header_Layout(hwndHD: HWND, layout: var HD_LAYOUT): WINBOOL =

-  result = WINBOOL(SendMessage(hwndHD, HDM_LAYOUT, 0,

-                   cast[LPARAM](addr(layout))))

-

-proc Header_SetItem(hwndHD: HWND, index: int32, hdi: var HD_ITEM): WINBOOL =

-  result = WINBOOL(SendMessage(hwndHD, HDM_SETITEM, WPARAM(index),

-                               cast[LPARAM](addr(hdi))))

-

-proc ListView_Arrange(hwndLV: HWND, code: WINUINT): LRESULT =

-  result = SendMessage(hwndLV, LVM_ARRANGE, WPARAM(code), 0)

-

-proc ListView_CreateDragImage(wnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT =

-  result = SendMessage(wnd, LVM_CREATEDRAGIMAGE, WPARAM(i), cast[LPARAM](lpptUpLeft))

-

-proc ListView_DeleteAllItems(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_DELETEALLITEMS, 0, 0)

-

-proc ListView_DeleteColumn(wnd: HWND, iCol: int32): LRESULT =

-  result = SendMessage(wnd, LVM_DELETECOLUMN, WPARAM(iCol), 0)

-

-proc ListView_DeleteItem(wnd: HWND, iItem: int32): LRESULT =

-  result = SendMessage(wnd, LVM_DELETEITEM, WPARAM(iItem), 0)

-

-proc ListView_EditLabel(hwndLV: HWND, i: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_EDITLABEL, WPARAM(int32(i)), 0)

-

-proc ListView_EnsureVisible(hwndLV: HWND, i, fPartialOK: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_ENSUREVISIBLE, WPARAM(i),

-                       MAKELPARAM(fPartialOK, 0))

-

-proc ListView_FindItem(wnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 =

-  result = SendMessage(wnd, LVM_FINDITEM, WPARAM(iStart),

-                       cast[LPARAM](addr(lvfi))).int32

-

-proc ListView_GetBkColor(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_GETBKCOLOR, 0, 0)

-

-proc ListView_GetCallbackMask(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_GETCALLBACKMASK, 0, 0)

-

-proc ListView_GetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =

-  result = SendMessage(wnd, LVM_GETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))

-

-proc ListView_GetColumnWidth(wnd: HWND, iCol: int32): LRESULT =

-  result = SendMessage(wnd, LVM_GETCOLUMNWIDTH, WPARAM(iCol), 0)

-

-proc ListView_GetCountPerPage(hwndLV: HWND): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETCOUNTPERPAGE, 0, 0)

-

-proc ListView_GetEditControl(hwndLV: HWND): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETEDITCONTROL, 0, 0)

-

-proc ListView_GetImageList(wnd: HWND, iImageList: WINT): LRESULT =

-  result = SendMessage(wnd, LVM_GETIMAGELIST, WPARAM(iImageList), 0)

-

-proc ListView_GetISearchString(hwndLV: HWND, lpsz: LPTSTR): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz))

-

-proc ListView_GetItem(wnd: HWND, item: var LV_ITEM): LRESULT =

-  result = SendMessage(wnd, LVM_GETITEM, 0, cast[LPARAM](addr(item)))

-

-proc ListView_GetItemCount(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_GETITEMCOUNT, 0, 0)

-

-proc ListView_GetItemPosition(hwndLV: HWND, i: int32, pt: var POINT): int32 =

-  result = SendMessage(hwndLV, LVM_GETITEMPOSITION, WPARAM(int32(i)),

-                       cast[LPARAM](addr(pt))).int32

-

-proc ListView_GetItemSpacing(hwndLV: HWND, fSmall: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETITEMSPACING, fSmall, 0)

-

-proc ListView_GetItemState(hwndLV: HWND, i, mask: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETITEMSTATE, WPARAM(i), LPARAM(mask))

-

-proc ListView_GetNextItem(wnd: HWND, iStart, flags: int32): LRESULT =

-  result = SendMessage(wnd, LVM_GETNEXTITEM, WPARAM(iStart), LPARAM(flags))

-

-proc ListView_GetOrigin(hwndLV: HWND, pt: var POINT): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETORIGIN, WPARAM(0), cast[LPARAM](addr(pt)))

-

-proc ListView_GetSelectedCount(hwndLV: HWND): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETSELECTEDCOUNT, 0, 0)

-

-proc ListView_GetStringWidth(hwndLV: HWND, psz: LPCTSTR): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETSTRINGWIDTH, 0, cast[LPARAM](psz))

-

-proc ListView_GetTextBkColor(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_GETTEXTBKCOLOR, 0, 0)

-

-proc ListView_GetTextColor(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, LVM_GETTEXTCOLOR, 0, 0)

-

-proc ListView_GetTopIndex(hwndLV: HWND): LRESULT =

-  result = SendMessage(hwndLV, LVM_GETTOPINDEX, 0, 0)

-

-proc ListView_GetViewRect(wnd: HWND, rc: var RECT): LRESULT =

-  result = SendMessage(wnd, LVM_GETVIEWRECT, 0, cast[LPARAM](addr(rc)))

-

-proc ListView_HitTest(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT =

-  result = SendMessage(hwndLV, LVM_HITTEST, 0, cast[LPARAM](addr(info)))

-

-proc ListView_InsertColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =

-  result = SendMessage(wnd, LVM_INSERTCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))

-

-proc ListView_InsertItem(wnd: HWND, item: var LV_ITEM): LRESULT =

-  result = SendMessage(wnd, LVM_INSERTITEM, 0, cast[LPARAM](addr(item)))

-

-proc ListView_RedrawItems(hwndLV: HWND, iFirst, iLast: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_REDRAWITEMS, WPARAM(iFirst), LPARAM(iLast))

-

-proc ListView_Scroll(hwndLV: HWND, dx, dy: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_SCROLL, WPARAM(dx), LPARAM(dy))

-

-proc ListView_SetBkColor(wnd: HWND, clrBk: COLORREF): LRESULT =

-  result = SendMessage(wnd, LVM_SETBKCOLOR, 0, LPARAM(clrBk))

-

-proc ListView_SetCallbackMask(wnd: HWND, mask: WINUINT): LRESULT =

-  result = SendMessage(wnd, LVM_SETCALLBACKMASK, WPARAM(mask), 0)

-

-proc ListView_SetColumn(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =

-  result = SendMessage(wnd, LVM_SETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))

-

-proc ListView_SetColumnWidth(wnd: HWND, iCol, cx: int32): LRESULT =

-  result = SendMessage(wnd, LVM_SETCOLUMNWIDTH, WPARAM(iCol), MAKELPARAM(cx, 0))

-

-proc ListView_SetImageList(wnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT =

-  result = SendMessage(wnd, LVM_SETIMAGELIST, WPARAM(iImageList),

-                       LPARAM(WINUINT(himl)))

-

-proc ListView_SetItem(wnd: HWND, item: var LV_ITEM): LRESULT =

-  result = SendMessage(wnd, LVM_SETITEM, 0, cast[LPARAM](addr(item)))

-

-proc ListView_SetItemCount(hwndLV: HWND, cItems: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_SETITEMCOUNT, WPARAM(cItems), 0)

-

-proc ListView_SetItemPosition(hwndLV: HWND, i, x, y: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_SETITEMPOSITION, WPARAM(i), MAKELPARAM(x, y))

-

-proc ListView_SetItemPosition32(hwndLV: HWND, i, x, y: int32): LRESULT =

-  var ptNewPos: POINT

-  ptNewPos.x = x

-  ptNewPos.y = y

-  result = SendMessage(hwndLV, LVM_SETITEMPOSITION32, WPARAM(i),

-                       cast[LPARAM](addr(ptNewPos)))

-

-proc ListView_SetItemState(hwndLV: HWND, i, data, mask: int32): LRESULT =

-  var gnu_lvi: LV_ITEM

-  gnu_lvi.stateMask = WINUINT(mask)

-  gnu_lvi.state = WINUINT(data)

-  result = SendMessage(hwndLV, LVM_SETITEMSTATE, WPARAM(i),

-                       cast[LPARAM](addr(gnu_lvi)))

-

-proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT =

-  var gnu_lvi: LV_ITEM

-  gnu_lvi.iSubItem = iSubItem

-  gnu_lvi.pszText = pszText

-  result = SendMessage(hwndLV, LVM_SETITEMTEXT, WPARAM(i),

-                       cast[LPARAM](addr(gnu_lvi)))

-

-proc ListView_SetTextBkColor(wnd: HWND, clrTextBk: COLORREF): LRESULT =

-  result = SendMessage(wnd, LVM_SETTEXTBKCOLOR, 0, LPARAM(clrTextBk))

-

-proc ListView_SetTextColor(wnd: HWND, clrText: COLORREF): LRESULT =

-  result = SendMessage(wnd, LVM_SETTEXTCOLOR, 0, LPARAM(clrText))

-

-proc ListView_SortItems(hwndLV: HWND, pfnCompare: PFNLVCOMPARE,

-                        lPrm: LPARAM): LRESULT =

-  result = SendMessage(hwndLV, LVM_SORTITEMS, WPARAM(lPrm),

-                       cast[LPARAM](pfnCompare))

-

-proc ListView_Update(hwndLV: HWND, i: int32): LRESULT =

-  result = SendMessage(hwndLV, LVM_UPDATE, WPARAM(i), 0)

-

-proc TreeView_InsertItem(wnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT =

-  result = SendMessage(wnd, TVM_INSERTITEM, 0, cast[LPARAM](lpis))

-

-proc TreeView_DeleteItem(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](hitem))

-

-proc TreeView_DeleteAllItems(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TVM_DELETEITEM, 0, cast[LPARAM](TVI_ROOT))

-

-proc TreeView_Expand(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =

-  result = SendMessage(wnd, TVM_EXPAND, WPARAM(code), cast[LPARAM](hitem))

-

-proc TreeView_GetCount(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TVM_GETCOUNT, 0, 0)

-

-proc TreeView_GetIndent(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TVM_GETINDENT, 0, 0)

-

-proc TreeView_SetIndent(wnd: HWND, indent: int32): LRESULT =

-  result = SendMessage(wnd, TVM_SETINDENT, WPARAM(indent), 0)

-

-proc TreeView_GetImageList(wnd: HWND, iImage: WPARAM): LRESULT =

-  result = SendMessage(wnd, TVM_GETIMAGELIST, iImage, 0)

-

-proc TreeView_SetImageList(wnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT =

-  result = SendMessage(wnd, TVM_SETIMAGELIST, iImage, LPARAM(WINUINT(himl)))

-

-proc TreeView_GetNextItem(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =

-  result = SendMessage(wnd, TVM_GETNEXTITEM, WPARAM(code), cast[LPARAM](hitem))

-

-proc TreeView_GetChild(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_CHILD)

-

-proc TreeView_GetNextSibling(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXT)

-

-proc TreeView_GetPrevSibling(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUS)

-

-proc TreeView_GetParent(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_PARENT)

-

-proc TreeView_GetFirstVisible(wnd: HWND): LRESULT =

-  result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_FIRSTVISIBLE)

-

-proc TreeView_GetNextVisible(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_NEXTVISIBLE)

-

-proc TreeView_GetPrevVisible(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_GetNextItem(wnd, hitem, TVGN_PREVIOUSVISIBLE)

-

-proc TreeView_GetSelection(wnd: HWND): LRESULT =

-  result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_CARET)

-

-proc TreeView_GetDropHilight(wnd: HWND): LRESULT =

-  result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_DROPHILITE)

-

-proc TreeView_GetRoot(wnd: HWND): LRESULT =

-  result = TreeView_GetNextItem(wnd, HTREEITEM(nil), TVGN_ROOT)

-

-proc TreeView_Select(wnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =

-  result = SendMessage(wnd, TVM_SELECTITEM, WPARAM(code), cast[LPARAM](hitem))

-

-proc TreeView_SelectItem(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_Select(wnd, hitem, TVGN_CARET)

-

-proc TreeView_SelectDropTarget(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_Select(wnd, hitem, TVGN_DROPHILITE)

-

-proc TreeView_SelectSetFirstVisible(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = TreeView_Select(wnd, hitem, TVGN_FIRSTVISIBLE)

-

-proc TreeView_GetItem(wnd: HWND, item: var TV_ITEM): LRESULT =

-  result = SendMessage(wnd, TVM_GETITEM, 0, cast[LPARAM](addr(item)))

-

-proc TreeView_SetItem(wnd: HWND, item: var TV_ITEM): LRESULT =

-  result = SendMessage(wnd, TVM_SETITEM, 0, cast[LPARAM](addr(item)))

-

-proc TreeView_EditLabel(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = SendMessage(wnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem))

-

-proc TreeView_GetEditControl(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TVM_GETEDITCONTROL, 0, 0)

-

-proc TreeView_GetVisibleCount(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TVM_GETVISIBLECOUNT, 0, 0)

-

-proc TreeView_HitTest(wnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT =

-  result = SendMessage(wnd, TVM_HITTEST, 0, cast[LPARAM](lpht))

-

-proc TreeView_CreateDragImage(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = SendMessage(wnd, TVM_CREATEDRAGIMAGE, 0, cast[LPARAM](hitem))

-

-proc TreeView_SortChildren(wnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT =

-  result = SendMessage(wnd, TVM_SORTCHILDREN, WPARAM(recurse), cast[LPARAM](hitem))

-

-proc TreeView_EnsureVisible(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  result = SendMessage(wnd, TVM_ENSUREVISIBLE, 0, cast[LPARAM](hitem))

-

-proc TreeView_SortChildrenCB(wnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT =

-  result = SendMessage(wnd, TVM_SORTCHILDRENCB, WPARAM(recurse), cast[LPARAM](psort))

-

-proc TreeView_EndEditLabelNow(wnd: HWND, fCancel: int32): LRESULT =

-  result = SendMessage(wnd, TVM_ENDEDITLABELNOW, WPARAM(fCancel), 0)

-

-proc TreeView_GetISearchString(hwndTV: HWND, lpsz: LPTSTR): LRESULT =

-  result = SendMessage(hwndTV, TVM_GETISEARCHSTRING, 0, cast[LPARAM](lpsz))

-

-proc TabCtrl_GetImageList(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETIMAGELIST, 0, 0)

-

-proc TabCtrl_SetImageList(wnd: HWND, himl: HIMAGELIST): LRESULT =

-  result = SendMessage(wnd, TCM_SETIMAGELIST, 0, LPARAM(WINUINT(himl)))

-

-proc TabCtrl_GetItemCount(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETITEMCOUNT, 0, 0)

-

-proc TabCtrl_GetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =

-  result = SendMessage(wnd, TCM_GETITEM, WPARAM(iItem), cast[LPARAM](addr(item)))

-

-proc TabCtrl_SetItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =

-  result = SendMessage(wnd, TCM_SETITEM, WPARAM(iItem), cast[LPARAM](addr(item)))

-

-proc TabCtrl_InsertItem(wnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =

-  result = SendMessage(wnd, TCM_INSERTITEM, WPARAM(iItem), cast[LPARAM](addr(item)))

-

-proc TabCtrl_DeleteItem(wnd: HWND, i: int32): LRESULT =

-  result = SendMessage(wnd, TCM_DELETEITEM, WPARAM(i), 0)

-

-proc TabCtrl_DeleteAllItems(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_DELETEALLITEMS, 0, 0)

-

-proc TabCtrl_GetItemRect(wnd: HWND, i: int32, rc: var RECT): LRESULT =

-  result = SendMessage(wnd, TCM_GETITEMRECT, WPARAM(int32(i)), cast[LPARAM](addr(rc)))

-

-proc TabCtrl_GetCurSel(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETCURSEL, 0, 0)

-

-proc TabCtrl_SetCurSel(wnd: HWND, i: int32): LRESULT =

-  result = SendMessage(wnd, TCM_SETCURSEL, WPARAM(i), 0)

-

-proc TabCtrl_HitTest(hwndTC: HWND, info: var TC_HITTESTINFO): LRESULT =

-  result = SendMessage(hwndTC, TCM_HITTEST, 0, cast[LPARAM](addr(info)))

-

-proc TabCtrl_SetItemExtra(hwndTC: HWND, cb: int32): LRESULT =

-  result = SendMessage(hwndTC, TCM_SETITEMEXTRA, WPARAM(cb), 0)

-

-proc TabCtrl_AdjustRect(wnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT =

-  result = SendMessage(wnd, TCM_ADJUSTRECT, WPARAM(bLarger), cast[LPARAM](addr(rc)))

-

-proc TabCtrl_SetItemSize(wnd: HWND, x, y: int32): LRESULT =

-  result = SendMessage(wnd, TCM_SETITEMSIZE, 0, MAKELPARAM(x, y))

-

-proc TabCtrl_RemoveImage(wnd: HWND, i: WPARAM): LRESULT =

-  result = SendMessage(wnd, TCM_REMOVEIMAGE, i, 0)

-

-proc TabCtrl_SetPadding(wnd: HWND, cx, cy: int32): LRESULT =

-  result = SendMessage(wnd, TCM_SETPADDING, 0, MAKELPARAM(cx, cy))

-

-proc TabCtrl_GetRowCount(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETROWCOUNT, 0, 0)

-

-proc TabCtrl_GetToolTips(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETTOOLTIPS, 0, 0)

-

-proc TabCtrl_SetToolTips(wnd: HWND, hwndTT: int32): LRESULT =

-  result = SendMessage(wnd, TCM_SETTOOLTIPS, WPARAM(hwndTT), 0)

-

-proc TabCtrl_GetCurFocus(wnd: HWND): LRESULT =

-  result = SendMessage(wnd, TCM_GETCURFOCUS, 0, 0)

-

-proc TabCtrl_SetCurFocus(wnd: HWND, i: int32): LRESULT =

-  result = SendMessage(wnd, TCM_SETCURFOCUS, i, 0)

-

-proc SNDMSG(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM): LRESULT =

-  result = SendMessage(wnd, Msg, wp, lp)

-

-proc CommDlg_OpenSave_GetSpecA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetSpecW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz))

-

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz))

-else:

-  proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetFilePathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetFilePathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz))

-else:

-  proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetFolderPathA(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetFolderPathW(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-when defined(winUnicode):

-  proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPWSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM]((psz)))

-else:

-  proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =

-    result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz))

-

-proc CommDlg_OpenSave_GetFolderIDList(hdlg: HWND, pidl: LPVOID, cbmax: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_GETFOLDERIDLIST, WPARAM(cbmax), cast[LPARAM](pidl))

-

-proc CommDlg_OpenSave_SetControlText(hdlg: HWND, id: int32, text: LPSTR): LRESULT =

-  result = SNDMSG(hdlg, CDM_SETCONTROLTEXT, WPARAM(id), cast[LPARAM](text))

-

-proc CommDlg_OpenSave_HideControl(hdlg: HWND, id: int32): LRESULT =

-  result = SNDMSG(hdlg, CDM_HIDECONTROL, WPARAM(id), 0)

-

-proc CommDlg_OpenSave_SetDefExt(hdlg: HWND, pszext: LPSTR): LRESULT =

-  result = SNDMSG(hdlg, CDM_SETDEFEXT, 0, cast[LPARAM](pszext))

-

-proc InternalGetLargestConsoleWindowSize(hConsoleOutput: HANDLE): DWord{.

-    stdcall, dynlib: "kernel32", importc: "GetLargestConsoleWindowSize".}

-proc GetLargestConsoleWindowSize(hConsoleOutput: HANDLE): COORD =

-  var res: DWORD

-  res = InternalGetLargestConsoleWindowSize(hConsoleOutput)

-  result.Y = toU16(res and 0x0000ffff) # XXX: correct?

-  result.X = toU16(res shr 16)

-

-proc Succeeded(Status: HRESULT): WINBOOL =

-  result = (Status and 0x80000000).WinBool

-

-proc Failed(Status: HRESULT): WINBOOL =

-  result = (Status and 0x80000000).WinBool

-

-proc IsError(Status: HRESULT): WINBOOL =

-  result = ord((int(Status) shr 31) == SEVERITY_ERROR)

-

-proc HResultCode(hr: HRESULT): int32 =

-  result = hr and 0x0000FFFF'i32

-

-proc HResultFacility(hr: HRESULT): int32 =

-  result = (hr shr 16'i32) and 0x00001FFF'i32

-

-proc HResultSeverity(hr: HRESULT): int32 =

-  result = (hr shr 31'i32) and 0x00000001'i32

-

-proc MakeResult(p1, p2, mask: int32): HRESULT =

-  result = (p1 shl 31'i32) or (p2 shl 16'i32) or mask

-

-proc HResultFromWin32(x: int32): HRESULT =

-  result = x

-  if result != 0'i32:

-    result = ((result and 0x0000FFFF'i32) or (int32(FACILITY_WIN32) shl 16'i32) or

-        0x80000000'i32)

-

-proc HResultFromNT(x: int32): HRESULT =

-  result = x or int32(FACILITY_NT_BIT)

-

-proc MAKELANGID(PrimaryLang, SubLang: USHORT): int16 =

-  result = (SubLang shl 10'i16) or PrimaryLang

-

-proc PRIMARYLANGID(LangId: int16): int16 =

-  result = LangId and 0x000003FF'i16

-

-proc SUBLANGID(LangId: int16): int16 =

-  result = LangId shr 10'i16

-

-proc MAKELCID(LangId, SortId: int16): DWORD =

-  result = toU32((ze(SortId) shl 16) or ze(LangId))

-

-proc MAKESORTLCID(LangId, SortId, SortVersion: int16): DWORD =

-  result = MAKELCID(LangId, SortId) or (SortVersion shl 20'i32)

-

-proc LANGIDFROMLCID(LocaleId: LCID): int16 =

-  result = toU16(LocaleId)

-

-proc SORTIDFROMLCID(LocaleId: LCID): int16 =

-  result = toU16((DWORD(LocaleId) shr 16) and 0x0000000F)

-

-proc SORTVERSIONFROMLCID(LocaleId: LCID): int16 =

-  result = toU16((DWORD(LocaleId) shr 20) and 0x0000000F)

-

-proc LANG_SYSTEM_DEFAULT(): int16 =

-  result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_SYS_DEFAULT))

-

-proc LANG_USER_DEFAULT(): int16 =

-  result = toU16(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_DEFAULT))

-

-proc LOCALE_NEUTRAL(): DWORD =

-  result = MAKELCID(MAKELANGID(toU16(LANG_NEUTRAL), SUBLANG_NEUTRAL), SORT_DEFAULT)

-

-proc LOCALE_INVARIANT(): DWORD =

-  result = MAKELCID(MAKELANGID(toU16(LANG_INVARIANT), SUBLANG_NEUTRAL), SORT_DEFAULT)

-

-{.pop.}

diff --git a/lib/wrappers/claro.nim b/lib/wrappers/claro.nim
deleted file mode 100644
index 41956c28a..000000000
--- a/lib/wrappers/claro.nim
+++ /dev/null
@@ -1,2748 +0,0 @@
-# Claro Graphics - an abstraction layer for native UI libraries

-#  

-#  $Id$

-#  

-#  The contents of this file are subject to the Mozilla Public License

-#  Version 1.1 (the "License"); you may not use this file except in

-#  compliance with the License. You may obtain a copy of the License at

-#  http://www.mozilla.org/MPL/

-#  

-#  Software distributed under the License is distributed on an "AS IS"

-#  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the

-#  License for the specific language governing rights and limitations

-#  under the License.

-#  

-#  See the LICENSE file for more details.

-# 

-

-## Wrapper for the Claro GUI library. 

-## This wrapper calls ``claro_base_init`` and ``claro_graphics_init`` 

-## automatically on startup, so you don't have to do it and in fact cannot do

-## it because they are not exported.

-

-{.deadCodeElim: on.}

-

-when defined(windows): 

-  const 

-    clarodll = "claro.dll"

-elif defined(macosx): 

-  const 

-    clarodll = "libclaro.dylib"

-else: 

-  const 

-    clarodll = "libclaro.so"

-

-import cairo

-

-type 

-  Node* {.pure.} = object 

-    next*: ptr Node

-    prev*: ptr Node        # pointer to real structure 

-    data*: pointer

-

-  List* {.pure.} = object 

-    head*: ptr Node

-    tail*: ptr Node

-    count*: int32

-{.deprecated: [TNode: Node, TList: List].}

-

-proc list_init*(){.cdecl, importc: "list_init", dynlib: clarodll.}

-proc list_create*(list: ptr List){.cdecl, importc: "list_create", 

-                                      dynlib: clarodll.}

-proc node_create*(): ptr Node{.cdecl, importc: "node_create", 

-                                  dynlib: clarodll.}

-proc node_free*(n: ptr Node){.cdecl, importc: "node_free", dynlib: clarodll.}

-proc node_add*(data: pointer, n: ptr Node, L: ptr List){.cdecl, 

-    importc: "node_add", dynlib: clarodll.}

-proc node_prepend*(data: pointer, n: ptr Node, L: ptr List){.cdecl, 

-    importc: "node_prepend", dynlib: clarodll.}

-proc node_del*(n: ptr Node, L: ptr List){.cdecl, importc: "node_del", 

-    dynlib: clarodll.}

-proc node_find*(data: pointer, L: ptr List): ptr Node{.cdecl, 

-    importc: "node_find", dynlib: clarodll.}

-proc node_move*(n: ptr Node, oldlist: ptr List, newlist: ptr List){.

-    cdecl, importc: "node_move", dynlib: clarodll.}

-

-type 

-  ClaroObj*{.pure, inheritable.} = object 

-    typ*: array[0..64 - 1, char]

-    destroy_pending*: cint

-    event_handlers*: List

-    children*: List

-    parent*: ptr ClaroObj

-    appdata*: pointer         # !! this is for APPLICATION USE ONLY !! 

-  

-  Event*{.pure.} = object 

-    obj*: ptr ClaroObj    # the object which this event was sent to 

-    name*: array[0..64 - 1, char]

-    handled*: cint

-    arg_num*: cint            # number of arguments 

-    format*: array[0..16 - 1, char] # format of the arguments sent 

-    arglist*: ptr pointer     # list of args, as per format. 

-  

-  EventFunc* = proc (obj: ptr ClaroObj, event: ptr Event){.cdecl.}

-  EventIfaceFunc* = proc (obj: ptr ClaroObj, event: ptr Event, 

-                           data: pointer){.cdecl.}

-  EventHandler*{.pure.} = object 

-    typ*: array[0..32 - 1, char]

-    data*: pointer

-    fun*: EventFunc   # the function that handles this event 

-{.deprecated: [TEvent: Event, TEventFunc: EventFunc, TClaroObj: ClaroObj,

-              TEventIfaceFunc: EventIfaceFunc, TEventHandler: EventHandler].}

-

-# #define event_handler(n) void n ( ClaroObj *object, event_t *event )

-#CLVEXP list_t object_list;

-

-proc object_init*(){.cdecl, importc: "object_init", dynlib: clarodll.}

-

-proc object_override_next_size*(size: cint){.cdecl, 

-    importc: "object_override_next_size", dynlib: clarodll.}

-  ## Overrides the size of next object to be created, providing the 

-  ## size is more than is requested by default.

-  ## 

-  ## `size` specifies the full size, which is greater than both ClaroObj

-  ## and the size that will be requested automatically.

-    

-proc event_get_arg_ptr*(e: ptr Event, arg: cint): pointer{.cdecl, 

-    importc: "event_get_arg_ptr", dynlib: clarodll.}

-proc event_get_arg_double*(e: ptr Event, arg: cint): cdouble{.cdecl, 

-    importc: "event_get_arg_double", dynlib: clarodll.}

-proc event_get_arg_int*(e: ptr Event, arg: cint): cint{.cdecl, 

-    importc: "event_get_arg_int", dynlib: clarodll.}

-proc object_create*(parent: ptr ClaroObj, size: int32, 

-                    typ: cstring): ptr ClaroObj{.

-    cdecl, importc: "object_create", dynlib: clarodll.}

-proc object_destroy*(obj: ptr ClaroObj){.cdecl, importc: "object_destroy", 

-    dynlib: clarodll.}

-proc object_set_parent*(obj: ptr ClaroObj, parent: ptr ClaroObj){.cdecl, 

-    importc: "object_set_parent", dynlib: clarodll.}

-

-##define object_cmptype(o,t) (!strcmp(((ClaroObj *)o)->type,t))

-

-# event functions 

-

-proc object_addhandler*(obj: ptr ClaroObj, event: cstring, 

-                        fun: EventFunc){.cdecl, 

-    importc: "object_addhandler", dynlib: clarodll.}

-proc object_addhandler_interface*(obj: ptr ClaroObj, event: cstring, 

-                                  fun: EventFunc, data: pointer){.cdecl, 

-    importc: "object_addhandler_interface", dynlib: clarodll.}

-proc event_send*(obj: ptr ClaroObj, event: cstring, fmt: cstring): cint{.

-    varargs, cdecl, importc: "event_send", dynlib: clarodll.}

-proc event_get_name*(event: ptr Event): cstring{.cdecl, 

-    importc: "event_get_name", dynlib: clarodll.}

-proc claro_base_init(){.cdecl, importc: "claro_base_init", dynlib: clarodll.}

-proc claro_loop*(){.cdecl, importc: "claro_loop", dynlib: clarodll.}

-proc claro_run*(){.cdecl, importc: "claro_run", dynlib: clarodll.}

-proc claro_shutdown*(){.cdecl, importc: "claro_shutdown", dynlib: clarodll.}

-proc mssleep*(ms: cint){.cdecl, importc: "mssleep", dynlib: clarodll.}

-proc claro_graphics_init(){.cdecl, importc: "claro_graphics_init", 

-                            dynlib: clarodll.}

-

-const 

-  cWidgetNoBorder* = (1 shl 24)

-  cWidgetCustomDraw* = (1 shl 25)

-

-type 

-  Bounds*{.pure.} = object 

-    x*: cint

-    y*: cint

-    w*: cint

-    h*: cint

-    owner*: ptr ClaroObj

-{.deprecated: [TBounds: Bounds].}

-

-const 

-  cSizeRequestChanged* = 1

-

-type 

-  Font*{.pure.} = object 

-    used*: cint

-    face*: cstring

-    size*: cint

-    weight*: cint

-    slant*: cint

-    decoration*: cint

-    native*: pointer

-

-  Color*{.pure.} = object 

-    used*: cint

-    r*: cfloat

-    g*: cfloat

-    b*: cfloat

-    a*: cfloat

-

-  Widget* {.pure.} = object of ClaroObj

-    size_req*: ptr Bounds

-    size*: Bounds

-    size_ct*: Bounds

-    supports_alpha*: cint

-    size_flags*: cint

-    flags*: cint

-    visible*: cint

-    notify_flags*: cint

-    font*: Font

-    native*: pointer          # native widget 

-    ndata*: pointer           # additional native data 

-    container*: pointer       # native widget container (if not ->native) 

-    naddress*: array[0..3, pointer] # addressed for something 

-                                    # we override or need to remember 

-{.deprecated: [TFont: Font, TColor: Color, TWidget: Widget].}

-

-proc clipboard_set_text*(w: ptr Widget, text: cstring): cint{.cdecl, 

-    importc: "clipboard_set_text", dynlib: clarodll.}

-  ## Sets the (text) clipboard to the specified text value.

-  ##

-  ## `w` The widget requesting the action, some platforms may use this value.

-  ## `text` The text to place in the clipboard.

-  ## returns 1 on success, 0 on failure.

-

-const 

-  cNotifyMouse* = 1'i32

-  cNotifyKey* = 2'i32

-

-  cFontSlantNormal* = 0

-  cFontSlantItalic* = 1

-  cFontWeightNormal* = 0

-  cFontWeightBold* = 1

-  cFontDecorationNormal* = 0

-  cFontDecorationUnderline* = 1

-

-

-proc widget_set_font*(widget: ptr ClaroObj, face: cstring, size: cint, 

-                      weight: cint, slant: cint, decoration: cint){.cdecl, 

-    importc: "widget_set_font", dynlib: clarodll.}

-  ## Sets the font details of the specified widget.

-  ## 

-  ##  `widget` A widget

-  ##  `face` Font face string

-  ##  `size` Size of the font in pixels

-  ##  `weight` The weight of the font

-  ##  `slant` The sland of the font

-  ##  `decoration` The decoration of the font

-    

-proc widget_font_string_width*(widget: ptr ClaroObj, text: cstring, 

-                               chars: cint): cint {.

-    cdecl, importc: "widget_font_string_width", dynlib: clarodll.}

-  ## Calculates the pixel width of the text in the widget's font.

-  ## `chars` is the number of characters of text to calculate. Return value

-  ## is the width of the specified text in pixels.

-

-const 

-  CLARO_APPLICATION* = "claro.graphics"

-

-type 

-  Image* {.pure.} = object of ClaroObj

-    width*: cint

-    height*: cint

-    native*: pointer

-    native2*: pointer

-    native3*: pointer

-    icon*: pointer

-{.deprecated: [TImage: Image].}

-

-proc image_load*(parent: ptr ClaroObj, file: cstring): ptr Image{.cdecl, 

-    importc: "image_load", dynlib: clarodll.}

-  ## Loads an image from a file and returns a new image object.

-  ## 

-  ## The supported formats depend on the platform.

-  ## The main effort is to ensure that PNG images will always work.

-  ## Generally, JPEGs and possibly GIFs will also work.

-  ##

-  ## `Parent` object (usually the application's main window), can be nil.

-    

-proc image_load_inline_png*(parent: ptr ClaroObj, data: cstring, 

-                            len: cint): ptr Image{.cdecl, 

-    importc: "image_load_inline_png", dynlib: clarodll.}

-  ## Loads an image from inline data and returns a new image object.

-  ## `Parent` object (usually the application's main window), can be nil.

-  ##  data raw PNG image

-  ##  len size of data

-

-when true:

-  discard

-else:

-  # status icons are not supported on all platforms yet:

-  type 

-    StatusIcon* {.pure.} = object of ClaroObj

-      icon*: ptr Image

-      native*: pointer

-      native2*: pointer

-  {.deprecated: [TStatusIcon: StatusIcon].}

-

-  #*

-  #  \brief Creates a status icon

-  # 

-  #  \param parent Parent object (usually the application's main window),

-  #                can be NULL.

-  #  \param image The image object for the icon NOT NULL

-  #  \param flags Flags

-  #  \return New status_icon_t object

-  # 

-

-  proc status_icon_create*(parent: ptr ClaroObj, icon: ptr Image, 

-                           flags: cint): ptr StatusIcon {.

-      cdecl, importc: "status_icon_create", dynlib: clarodll.}

-

-  #*

-  #  \brief sets the status icon's image 

-  # 

-  #  \param status Status Icon

-  #  \param image The image object for the icon

-  # 

-

-  proc status_icon_set_icon*(status: ptr StatusIcon, icon: ptr Image){.cdecl, 

-      importc: "status_icon_set_icon", dynlib: clarodll.}

-

-  #*

-  #  \brief sets the status icons's menu

-  # 

-  #  \param status Status Icon

-  #  \param menu The menu object for the popup menu

-  # 

-

-  proc status_icon_set_menu*(status: ptr StatusIcon, menu: ptr ClaroObj){.cdecl, 

-      importc: "status_icon_set_menu", dynlib: clarodll.}

-  #*

-  #  \brief sets the status icon's visibility

-  # 

-  #  \param status Status Icon

-  #  \param visible whether the status icon is visible or not

-  # 

-

-  proc status_icon_set_visible*(status: ptr StatusIcon, visible: cint){.cdecl, 

-      importc: "status_icon_set_visible", dynlib: clarodll.}

-  #*

-  #  \brief sets the status icon's tooltip

-  # 

-  #  \param status Status Icon

-  #  \param tooltip Tooltip string

-  # 

-

-  proc status_icon_set_tooltip*(status: ptr StatusIcon, tooltip: cstring){.cdecl, 

-      importc: "status_icon_set_tooltip", dynlib: clarodll.}

-    

-#*

-#  \brief Makes the specified widget visible.

-# 

-#  \param widget A widget

-# 

-

-proc widget_show*(widget: ptr Widget){.cdecl, importc: "widget_show", 

-    dynlib: clarodll.}

-#*

-#  \brief Makes the specified widget invisible.

-# 

-#  \param widget A widget

-# 

-

-proc widget_hide*(widget: ptr Widget){.cdecl, importc: "widget_hide", 

-    dynlib: clarodll.}

-#*

-#  \brief Enables the widget, allowing focus

-# 

-#  \param widget A widget

-# 

-

-proc widget_enable*(widget: ptr Widget){.cdecl, importc: "widget_enable", 

-    dynlib: clarodll.}

-#*

-#  \brief Disables the widget

-#  When disabled, a widget appears greyed and cannot

-#  receive focus.

-# 

-#  \param widget A widget

-# 

-

-proc widget_disable*(widget: ptr Widget){.cdecl, importc: "widget_disable", 

-    dynlib: clarodll.}

-#*

-#  \brief Give focus to the specified widget

-# 

-#  \param widget A widget

-# 

-

-proc widget_focus*(widget: ptr Widget){.cdecl, importc: "widget_focus", 

-    dynlib: clarodll.}

-#*

-#  \brief Closes a widget

-# 

-#  Requests that a widget be closed by the platform code. 

-#  This may or may not result in immediate destruction of the widget,

-#  however the actual Claro widget object will remain valid until at

-#  least the next loop iteration.

-# 

-#  \param widget A widget

-# 

-

-proc widget_close*(widget: ptr Widget){.cdecl, importc: "widget_close", 

-    dynlib: clarodll.}

-#*

-#  \brief Retrieve the screen offset of the specified widget.

-# 

-#  Retrieves the X and Y screen positions of the widget.

-# 

-#  \param widget A widget

-#  \param dx Pointer to the location to place the X position.

-#  \param dy Pointer to the location to place the Y position.

-# 

-

-proc widget_screen_offset*(widget: ptr Widget, dx: ptr cint, dy: ptr cint){.

-    cdecl, importc: "widget_screen_offset", dynlib: clarodll.}

-#*

-#  \brief Sets the additional notify events that should be sent.

-# 

-#  For performance reasons, some events, like mouse and key events,

-#  are not sent by default. By specifying such events here, you can

-#  elect to receive these events.

-# 

-#  \param widget A widget

-#  \param flags Any number of cWidgetNotify flags ORed together.

-# 

-

-proc widget_set_notify*(widget: ptr Widget, flags: cint){.cdecl, 

-    importc: "widget_set_notify", dynlib: clarodll.}

-

-

-type

-  CursorType* {.size: sizeof(cint).} = enum

-    cCursorNormal = 0,

-    cCursorTextEdit = 1,

-    cCursorWait = 2,

-    cCursorPoint = 3

-{.deprecated: [TCursorType: CursorType].}

-

-#*

-#  \brief Sets the mouse cursor for the widget

-# 

-#  \param widget A widget

-#  \param cursor A valid cCursor* value

-# 

-

-proc widget_set_cursor*(widget: ptr Widget, cursor: CursorType){.cdecl, 

-    importc: "widget_set_cursor", dynlib: clarodll.}

-

-#*

-#  \brief Retrieves the key pressed in a key notify event.

-# 

-#  \param widget A widget

-#  \param event An event resource

-#  \return The keycode of the key pressed.

-# 

-

-proc widget_get_notify_key*(widget: ptr Widget, event: ptr Event): cint{.

-    cdecl, importc: "widget_get_notify_key", dynlib: clarodll.}

-

-#*

-#  \brief Updates the bounds structure with new values

-# 

-#  This function should \b always be used instead of setting the

-#  members manually. In the future, there may be a \b real reason

-#  for this.

-# 

-#  \param bounds A bounds structure

-#  \param x The new X position

-#  \param y The new Y position

-#  \param w The new width

-#  \param h The new height

-# 

-

-proc bounds_set*(bounds: ptr Bounds, x: cint, y: cint, w: cint, h: cint){.

-    cdecl, importc: "bounds_set", dynlib: clarodll.}

-#*

-#  \brief Create a new bounds object

-# 

-#  Creates a new bounds_t for the specified bounds.

-# 

-#  \param x X position

-#  \param y Y position

-#  \param w Width

-#  \param h Height

-#  \return A new bounds_t structure

-# 

-

-proc new_bounds*(x: cint, y: cint, w: cint, h: cint): ptr Bounds{.cdecl, 

-    importc: "new_bounds", dynlib: clarodll.}

-proc get_req_bounds*(widget: ptr Widget): ptr Bounds{.cdecl, 

-    importc: "get_req_bounds", dynlib: clarodll.}

-    

-var

-  noBoundsVar: Bounds # set to all zero which is correct

-    

-template noBounds*: expr = (addr(bind noBoundsVar))

-

-#* \internal

-#  \brief Internal pre-inititalisation hook

-# 

-#  \param widget A widget

-# 

-

-proc widget_pre_init*(widget: ptr Widget){.cdecl, importc: "widget_pre_init", 

-    dynlib: clarodll.}

-#* \internal

-#  \brief Internal post-inititalisation hook

-# 

-#  \param widget A widget

-# 

-

-proc widget_post_init*(widget: ptr Widget){.cdecl, 

-    importc: "widget_post_init", dynlib: clarodll.}

-#* \internal

-#  \brief Internal resize event handler

-# 

-#  \param obj An object

-#  \param event An event resource

-# 

-

-proc widget_resized_handle*(obj: ptr Widget, event: ptr Event){.cdecl, 

-    importc: "widget_resized_handle", dynlib: clarodll.}

-# CLVEXP bounds_t no_bounds;

-#* \internal

-#  \brief Internal default widget creation function

-# 

-#  \param parent The parent of the widget

-#  \param widget_size The size in bytes of the widget's structure

-#  \param widget_name The object type of the widget (claro.graphics.widgets.*)

-#  \param size_req The initial bounds of the widget

-#  \param flags Widget flags

-#  \param creator The platform function that will be called to actually create

-#                 the widget natively.

-#  \return A new widget object

-# 

-

-type

-  CgraphicsCreateFunction* = proc (widget: ptr Widget) {.cdecl.}

-{.deprecated: [TcgraphicsCreateFunction: CgraphicsCreateFunction].}

-

-proc newdefault*(parent: ptr Widget, widget_size: int, 

-                 widget_name: cstring, size_req: ptr Bounds, flags: cint, 

-                 creator: CgraphicsCreateFunction): ptr Widget{.cdecl, 

-    importc: "default_widget_create", dynlib: clarodll.}

-#* \internal

-#  \brief Retrieves the native container of the widget's children

-# 

-#  \param widget A widget

-#  \return A pointer to the native widget that will hold w's children

-# 

-

-proc widget_get_container*(widget: ptr Widget): pointer{.cdecl, 

-    importc: "widget_get_container", dynlib: clarodll.}

-#* \internal

-#  \brief Sets the content size of the widget.

-# 

-#  \param widget A widget

-#  \param w New width of the content area of the widget

-#  \param h New height of the content area of the widget

-#  \param event Whether to send a content_size event

-# 

-

-proc widget_set_content_size*(widget: ptr Widget, w: cint, h: cint, 

-                              event: cint){.cdecl, 

-    importc: "widget_set_content_size", dynlib: clarodll.}

-#* \internal

-#  \brief Sets the size of the widget.

-# 

-#  \param widget A widget

-#  \param w New width of the widget

-#  \param h New height of the widget

-#  \param event Whether to send a resize event

-# 

-

-proc widget_set_size*(widget: ptr Widget, w: cint, h: cint, event: cint){.

-    cdecl, importc: "widget_set_size", dynlib: clarodll.}

-#* \internal

-#  \brief Sets the position of the widget's content area.

-# 

-#  \param widget A widget

-#  \param x New X position of the widget's content area

-#  \param y New Y position of the widget's content area

-#  \param event Whether to send a content_move event

-# 

-

-proc widget_set_content_position*(widget: ptr Widget, x: cint, y: cint, 

-                                  event: cint){.cdecl, 

-    importc: "widget_set_content_position", dynlib: clarodll.}

-#* \internal

-#  \brief Sets the position of the widget.

-# 

-#  \param widget A widget

-#  \param x New X position of the widget's content area

-#  \param y New Y position of the widget's content area

-#  \param event Whether to send a moved event

-# 

-

-proc widget_set_position*(widget: ptr Widget, x: cint, y: cint, event: cint){.

-    cdecl, importc: "widget_set_position", dynlib: clarodll.}

-#* \internal

-#  \brief Sends a destroy event to the specified widget.

-# 

-#  You should use widget_close() in application code instead.

-# 

-#  \param widget A widget

-# 

-

-proc widget_destroy*(widget: ptr Widget){.cdecl, importc: "widget_destroy", 

-    dynlib: clarodll.}

-

-type 

-  OpenglWidget* {.pure.} = object of Widget

-    gldata*: pointer

-{.deprecated: [TOpenglWidget: OpenglWidget].}

-

-# functions 

-#*

-#  \brief Creates a OpenGL widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new OpenGL widget object.

-# 

-

-proc newopengl*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                flags: cint): ptr OpenglWidget {.

-    cdecl, importc: "opengl_widget_create", dynlib: clarodll.}

-#*

-#  \brief Flips the front and back buffers

-#  

-#  \param widget A valid OpenGL widget object

-# 

-

-proc opengl_flip*(widget: ptr OpenglWidget) {.cdecl, importc: "opengl_flip", 

-    dynlib: clarodll.}

-#*

-#  \brief Activates this OpenGL widget's context

-#  

-#  \param widget A valid OpenGL widget object

-# 

-

-proc opengl_activate*(widget: ptr OpenglWidget) {.

-    cdecl, importc: "opengl_activate", dynlib: clarodll.}

-

-type 

-  Button* {.pure.} = object of Widget

-    text*: array[0..256-1, char]

-{.deprecated: [TButton: Button].}

-

-# functions 

-#*

-#  \brief Creates a Button widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Button widget object.

-# 

-

-proc newbutton*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                flags: cint): ptr Button {.

-    cdecl, importc: "button_widget_create", dynlib: clarodll.}

-#*

-#  \brief Creates a Button widget with a label

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \param label The label for the button

-#  \return A new Button widget object.

-# 

-

-proc newbutton*(parent: ptr ClaroObj, 

-                bounds: ptr Bounds, flags: cint, 

-                label: cstring): ptr Button{.cdecl, 

-    importc: "button_widget_create_with_label", dynlib: clarodll.}

-#*

-#  \brief Changes the label of the button

-#  

-#  \param obj A valid Button widget object

-#  \param label The new label for the button

-# 

-

-proc button_set_text*(obj: ptr Button, label: cstring){.cdecl, 

-    importc: "button_set_label", dynlib: clarodll.}

-

-#*

-#  \brief Changes the image of the button

-# 

-#  \warning This function is not implemented yet and is not portable.

-#           Do not use it.

-#  

-#  \param obj A valid Button widget object

-#  \param image The new image for the button

-# 

-

-proc button_set_image*(obj: ptr Button, image: ptr Image){.cdecl, 

-    importc: "button_set_image", dynlib: clarodll.}

-

-const 

-  CTEXT_SLANT_NORMAL* = cFontSlantNormal

-  CTEXT_SLANT_ITALIC* = cFontSlantItalic

-  CTEXT_WEIGHT_NORMAL* = cFontWeightNormal

-  CTEXT_WEIGHT_BOLD* = cFontWeightBold

-  CTEXT_EXTRA_NONE* = cFontDecorationNormal

-  CTEXT_EXTRA_UNDERLINE* = cFontDecorationUnderline

-

-# END OLD 

-

-type 

-  Canvas*{.pure.} = object of Widget

-    surface*: cairo.PSurface

-    cr*: cairo.PContext

-    surfdata*: pointer

-    fontdata*: pointer

-    font_height*: cint

-    fr*: cfloat

-    fg*: cfloat

-    fb*: cfloat

-    fa*: cfloat

-    br*: cfloat

-    bg*: cfloat

-    bb*: cfloat

-    ba*: cfloat

-    charsize*: array[0..256 - 1, cairo.TTextExtents]

-    csz_loaded*: cint

-    fontsize*: cint

-{.deprecated: [TCanvas: Canvas].}

-

-# functions 

-#*

-#  \brief Creates a Canvas widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Canvas widget object.

-# 

-

-proc newcanvas*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                flags: cint): ptr Canvas{.

-    cdecl, importc: "canvas_widget_create", dynlib: clarodll.}

-#*

-#  \brief Invalidates and redraws a canvas widget

-#  

-#  \param widget A valid Canvas widget object.

-# 

-

-proc canvas_redraw*(widget: ptr Canvas){.cdecl, importc: "canvas_redraw", 

-    dynlib: clarodll.}

-# claro text functions 

-#*

-#  \brief Set the current text color

-#  

-#  \param widget A valid Canvas widget object.

-#  \param r Red component (0.0 - 1.0)

-#  \param g Green component (0.0 - 1.0)

-#  \param b Blue component (0.0 - 1.0)

-#  \param a Alpha component (0.0 - 1.0)

-# 

-

-proc canvas_set_text_color*(widget: ptr Canvas, r: cdouble, g: cdouble, 

-                            b: cdouble, a: cdouble){.cdecl, 

-    importc: "canvas_set_text_color", dynlib: clarodll.}

-#*

-#  \brief Set the current text background color

-#  

-#  \param widget A valid Canvas widget object.

-#  \param r Red component (0.0 - 1.0)

-#  \param g Green component (0.0 - 1.0)

-#  \param b Blue component (0.0 - 1.0)

-#  \param a Alpha component (0.0 - 1.0)

-# 

-

-proc canvas_set_text_bgcolor*(widget: ptr Canvas, r: cdouble, g: cdouble, 

-                              b: cdouble, a: cdouble){.cdecl, 

-    importc: "canvas_set_text_bgcolor", dynlib: clarodll.}

-#*

-#  \brief Set the current canvas font

-#  

-#  \param widget A valid Canvas widget object.

-#  \param face The font face

-#  \param size The font height in pixels

-#  \param weight The weight of the font

-#  \param slant The slant of the font

-#  \param decoration Font decorations

-# 

-

-proc canvas_set_text_font*(widget: ptr Canvas, face: cstring, size: cint, 

-                           weight: cint, slant: cint, decoration: cint){.cdecl, 

-    importc: "canvas_set_text_font", dynlib: clarodll.}

-#*

-#  \brief Calculates the width of the specified text

-#  

-#  \param widget A valid Canvas widget object.

-#  \param text The text to calulate the length of

-#  \param len The number of characters of text to calulcate

-#  \return Width of the text in pixels

-# 

-

-proc canvas_text_width*(widget: ptr Canvas, text: cstring, len: cint): cint{.

-    cdecl, importc: "canvas_text_width", dynlib: clarodll.}

-#*

-#  \brief Calculates the width of the specified text's bounding box

-#  

-#  \param widget A valid Canvas widget object.

-#  \param text The text to calulate the length of

-#  \param len The number of characters of text to calulcate

-#  \return Width of the text's bounding box in pixels

-# 

-

-proc canvas_text_box_width*(widget: ptr Canvas, text: cstring, 

-                            len: cint): cint{.

-    cdecl, importc: "canvas_text_box_width", dynlib: clarodll.}

-#*

-#  \brief Calculates the number of characters of text that can be displayed

-#         before width pixels.

-#  

-#  \param widget A valid Canvas widget object.

-#  \param text The text to calulate the length of

-#  \param width The width to fit the text in

-#  \return The number of characters of text that will fit in width pixels.

-# 

-

-proc canvas_text_display_count*(widget: ptr Canvas, text: cstring, 

-                                width: cint): cint{.cdecl, 

-    importc: "canvas_text_display_count", dynlib: clarodll.}

-#*

-#  \brief Displays the specified text on the canvas

-#  

-#  \param widget A valid Canvas widget object.

-#  \param x The X position at which the text will be drawn

-#  \param y The Y position at which the text will be drawn

-#  \param text The text to calulate the length of

-#  \param len The number of characters of text to calulcate

-# 

-

-proc canvas_show_text*(widget: ptr Canvas, x: cint, y: cint, text: cstring, 

-                       len: cint){.cdecl, importc: "canvas_show_text", 

-                                   dynlib: clarodll.}

-#*

-#  \brief Draws a filled rectangle

-#  

-#  \param widget A valid Canvas widget object.

-#  \param x The X position at which the rectangle will start

-#  \param y The Y position at which the rectangle will start

-#  \param w The width of the rectangle

-#  \param h The height of the rectangle

-#  \param r Red component (0.0 - 1.0)

-#  \param g Green component (0.0 - 1.0)

-#  \param b Blue component (0.0 - 1.0)

-#  \param a Alpha component (0.0 - 1.0)

-# 

-

-proc canvas_fill_rect*(widget: ptr Canvas, x: cint, y: cint, w: cint, 

-                       h: cint, r, g, b, a: cdouble){.

-    cdecl, importc: "canvas_fill_rect", dynlib: clarodll.}

-#*

-#  \brief Draws the specified image on the canvas

-#  

-#  \param widget A valid Canvas widget object.

-#  \param image The image to draw

-#  \param x The X position at which the image will be drawn

-#  \param y The Y position at which the image will be drawn

-# 

-

-proc canvas_draw_image*(widget: ptr Canvas, image: ptr Image, x: cint, 

-                        y: cint){.cdecl, importc: "canvas_draw_image", 

-                                  dynlib: clarodll.}

-# claro "extensions" of cairo 

-#* \internal

-#  \brief Internal claro extension of cairo text functions

-# 

-

-proc canvas_cairo_buffered_text_width*(widget: ptr Canvas, 

-                                       text: cstring, len: cint): cint{.cdecl, 

-    importc: "canvas_cairo_buffered_text_width", dynlib: clarodll.}

-#* \internal

-#  \brief Internal claro extension of cairo text functions

-# 

-

-proc canvas_cairo_buffered_text_display_count*(widget: ptr Canvas, 

-    text: cstring, width: cint): cint{.cdecl, 

-    importc: "canvas_cairo_buffered_text_display_count", 

-    dynlib: clarodll.}

-proc canvas_get_cairo_context*(widget: ptr Canvas): cairo.PContext {.cdecl, 

-    importc: "canvas_get_cairo_context", dynlib: clarodll.}

-

-type 

-  CheckBox*{.pure.} = object of Widget

-    text*: array[0..256-1, char]

-    checked*: cint

-{.deprecated: [TCheckBox: CheckBox].}

-#*

-#  \brief Creates a Checkbox widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Checkbox widget object.

-# 

-

-proc newcheckbox*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                  flags: cint): ptr CheckBox{.

-    cdecl, importc: "checkbox_widget_create", dynlib: clarodll.}

-#*

-#  \brief Creates a Checkbox widget with a label

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \param label The label for the checkbox

-#  \return A new Checkbox widget object.

-# 

-

-proc newcheckbox*(parent: ptr ClaroObj, 

-                  bounds: ptr Bounds, flags: cint, 

-                  label: cstring): ptr CheckBox {.cdecl, 

-    importc: "checkbox_widget_create_with_label", dynlib: clarodll.}

-#*

-#  \brief Sets a new label for the Checkbox widget

-#  

-#  \param obj A valid Checkbox widget object.

-#  \param label The new label for the checkbox

-# 

-

-proc checkbox_set_text*(obj: ptr CheckBox, label: cstring){.cdecl, 

-    importc: "checkbox_set_label", dynlib: clarodll.}

-#*

-#  \brief Retrieves the checkbox's check state

-#  

-#  \param obj A valid Checkbox widget object.

-#  \return 1 if the checkbox is checked, otherwise 0

-# 

-

-proc checkbox_checked*(obj: ptr CheckBox): cint{.cdecl, 

-    importc: "checkbox_get_checked", dynlib: clarodll.}

-#*

-#  \brief Sets the checkbox's checked state

-#  

-#  \param obj A valid Checkbox widget object.

-#  \param checked 1 if the checkbox should become checked, otherwise 0

-# 

-

-proc checkbox_set_checked*(obj: ptr CheckBox, checked: cint){.cdecl, 

-    importc: "checkbox_set_checked", dynlib: clarodll.}

-

-

-#*

-#  List items define items in a list_widget

-# 

-

-type 

-  ListItem*{.pure.} = object of ClaroObj

-    row*: cint

-    native*: pointer

-    nativeid*: int

-    menu*: ptr ClaroObj

-    enabled*: cint

-    data*: ptr pointer

-    ListItemChildren*: List

-    ListItemParent*: ptr List

-    parent_item*: ptr ListItem # drawing related info, not always required

-    text_color*: Color

-    sel_text_color*: Color

-    back_color*: Color

-    sel_back_color*: Color

-    font*: Font

-

-  ListWidget* {.pure.} = object of Widget ## List widget, base for 

-                                            ## widgets containing items

-    columns*: cint

-    coltypes*: ptr cint

-    items*: List

-

-  Combo*{.pure.} = object of ListWidget

-    selected*: ptr ListItem

-{.deprecated: [TListItem: ListItem, TListWidget: ListWidget, TCombo: Combo].}

-

-# functions 

-#*

-#  \brief Creates a Combo widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Combo widget object.

-# 

-

-proc newcombo*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-               flags: cint): ptr Combo{.

-    cdecl, importc: "combo_widget_create", dynlib: clarodll.}

-#*

-#  \brief Append a row to a Combo widget

-#  

-#  \param combo A valid Combo widget object.

-#  \param text The text for the item.

-#  \return A new list item.

-# 

-

-proc combo_append_row*(combo: ptr Combo, text: cstring): ptr ListItem {.

-    cdecl, importc: "combo_append_row", dynlib: clarodll.}

-#*

-#  \brief Insert a row at the specified position into a Combo widget

-#  

-#  \param combo A valid Combo widget object.

-#  \param pos The index at which this item will be placed.

-#  \param text The text for the item.

-#  \return A new list item.

-# 

-

-proc combo_insert_row*(combo: ptr Combo, pos: cint, 

-                       text: cstring): ptr ListItem {.

-    cdecl, importc: "combo_insert_row", dynlib: clarodll.}

-#*

-#  \brief Move a row in a Combo widget

-#  

-#  \param combo A valid Combo widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc combo_move_row*(combo: ptr Combo, item: ptr ListItem, row: cint){.

-    cdecl, importc: "combo_move_row", dynlib: clarodll.}

-#*

-#  \brief Remove a row from a Combo widget

-#  

-#  \param combo A valid Combo widget object.

-#  \param item A valid list item

-# 

-

-proc combo_remove_row*(combo: ptr Combo, item: ptr ListItem){.cdecl, 

-    importc: "combo_remove_row", dynlib: clarodll.}

-#*

-#  \brief Returns the currently selected Combo item

-#  

-#  \param obj A valid Combo widget object.

-#  \return The currently selected Combo item, or NULL if no item is selected.

-# 

-

-proc combo_get_selected*(obj: ptr Combo): ptr ListItem{.cdecl, 

-    importc: "combo_get_selected", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a Combo widget

-#  

-#  \param obj A valid Combo widget object.

-#  \return Number of rows

-# 

-

-proc combo_get_rows*(obj: ptr Combo): cint{.cdecl, 

-    importc: "combo_get_rows", dynlib: clarodll.}

-#*

-#  \brief Selects a row in a Combo widget

-#  

-#  \param obj A valid Combo widget object.

-#  \param item A valid list item

-# 

-

-proc combo_select_item*(obj: ptr Combo, item: ptr ListItem){.cdecl, 

-    importc: "combo_select_item", dynlib: clarodll.}

-#*

-#  \brief Removes all entries from a Combo widget

-#  

-#  \param obj A valid Combo widget object.

-# 

-

-proc combo_clear*(obj: ptr Combo){.cdecl, importc: "combo_clear", 

-                                    dynlib: clarodll.}

-

-type 

-  ContainerWidget* {.pure.} = object of Widget

-{.deprecated: [TContainerWidget: ContainerWidget].}

-

-

-# functions 

-#*

-#  \brief Creates a Container widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Container widget object.

-# 

-

-proc newcontainer*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                   flags: cint): ptr ContainerWidget{.

-    cdecl, importc: "container_widget_create", dynlib: clarodll.}

-

-proc newdialog*(parent: ptr ClaroObj, bounds: ptr Bounds, format: cstring, 

-                flags: cint): ptr ClaroObj{.cdecl, 

-    importc: "dialog_widget_create", dynlib: clarodll.}

-proc dialog_set_text*(obj: ptr ClaroObj, text: cstring){.cdecl, 

-    importc: "dialog_set_text", dynlib: clarodll.}

-proc dialog_set_default_icon*(typ: cstring, file: cstring){.cdecl, 

-    importc: "dialog_set_default_icon", dynlib: clarodll.}

-proc dialog_get_default_icon*(dialog_type: cint): cstring{.cdecl, 

-    importc: "dialog_get_default_icon", dynlib: clarodll.}

-proc dialog_warning*(format: cstring, text: cstring): cint{.cdecl, 

-    importc: "dialog_warning", dynlib: clarodll.}

-proc dialog_info*(format: cstring, text: cstring): cint{.cdecl, 

-    importc: "dialog_info", dynlib: clarodll.}

-proc dialog_error*(format: cstring, text: cstring): cint{.cdecl, 

-    importc: "dialog_error", dynlib: clarodll.}

-proc dialog_other*(format: cstring, text: cstring, default_icon: cstring): cint{.

-    cdecl, importc: "dialog_other", dynlib: clarodll.}

-

-type 

-  FontDialog* {.pure.} = object of Widget

-    selected*: Font

-{.deprecated: [TFontDialog: FontDialog].}

-

-# functions 

-#*

-#  \brief Creates a Font Selection widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new Font Selection widget object.

-# 

-

-proc newFontDialog*(parent: ptr ClaroObj, flags: cint): ptr FontDialog {.

-    cdecl, importc: "font_dialog_widget_create", dynlib: clarodll.}

-#*

-#  \brief Changes the selected font

-#  

-#  \param obj A valid Font Selection widget object

-#  \param font The name of the font

-# 

-

-proc font_dialog_set_font*(obj: ptr FontDialog, face: cstring, size: cint, 

-                           weight: cint, slant: cint, decoration: cint){.cdecl, 

-    importc: "font_dialog_set_font", dynlib: clarodll.}

-#*

-#  \brief Returns a structure representing the currently selected font

-#  

-#  \param obj A valid Font Selection widget object

-#  \return A font_t structure containing information about the selected font.

-# 

-

-proc font_dialog_get_font*(obj: ptr FontDialog): ptr Font{.cdecl, 

-    importc: "font_dialog_get_font", dynlib: clarodll.}

-

-type 

-  Frame* {.pure.} = object of Widget

-    text*: array[0..256-1, char]

-{.deprecated: [TFrame: Frame].}

-

-#*

-#  \brief Creates a Frame widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Frame widget object.

-# 

-

-proc newframe*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-               flags: cint): ptr Frame{.

-    cdecl, importc: "frame_widget_create", dynlib: clarodll.}

-#*

-#  \brief Creates a Frame widget with a label

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \param label The initial label for the frame

-#  \return A new Frame widget object.

-# 

-

-proc newframe*(parent: ptr ClaroObj, bounds: ptr Bounds, flags: cint, 

-                                     label: cstring): ptr Frame {.cdecl, 

-    importc: "frame_widget_create_with_label", dynlib: clarodll.}

-#*

-#  \brief Creates a Container widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Container widget object.

-# 

-

-proc frame_set_text*(frame: ptr Frame, label: cstring){.cdecl, 

-    importc: "frame_set_label", dynlib: clarodll.}

-

-type 

-  ImageWidget* {.pure.} = object of Widget

-    src*: ptr Image

-{.deprecated: [TImageWidget: ImageWidget].}

-

-#*

-#  \brief Creates an Image widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Image widget object.

-# 

-

-proc newimageWidget*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                     flags: cint): ptr ImageWidget{.

-    cdecl, importc: "image_widget_create", dynlib: clarodll.}

-#*

-#  \brief Creates an Image widget with an image

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \param image A valid Image object.

-#  \return A new Image widget object.

-# 

-

-proc newimageWidget*(parent: ptr ClaroObj, 

-                     bounds: ptr Bounds, flags: cint, 

-                     image: ptr Image): ptr ImageWidget{.cdecl, 

-    importc: "image_widget_create_with_image", dynlib: clarodll.}

-#*

-#  \brief Sets the image object of the image widget

-#  

-#  \param image A valid image widget

-#  \param src The source image object

-# 

-

-proc image_set_image*(image: ptr ImageWidget, src: ptr Image){.cdecl, 

-    importc: "image_set_image", dynlib: clarodll.}

-    

-type 

-  Label*{.pure.} = object of Widget

-    text*: array[0..256-1, char]

-

-  CLabelJustify* = enum 

-    cLabelLeft = 0x00000001, cLabelRight = 0x00000002, 

-    cLabelCenter = 0x00000004, cLabelFill = 0x00000008

-{.deprecated: [TLabel: Label, TcLabelJustify: CLabelJustify].}

-

-#*

-#  \brief Creates a Label widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Label widget object.

-# 

-

-proc newlabel*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-               flags: cint): ptr Label{.

-    cdecl, importc: "label_widget_create", dynlib: clarodll.}

-#*

-#  \brief Creates a Label widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Label widget object.

-# 

-

-proc newLabel*(parent: ptr ClaroObj, 

-               bounds: ptr Bounds, flags: cint, 

-               text: cstring): ptr Label{.cdecl, 

-    importc: "label_widget_create_with_text", dynlib: clarodll.}

-#*

-#  \brief Sets the text of a label widget

-#  

-#  \param obj A valid label widget

-#  \param text The text this label widget will show

-# 

-

-proc label_set_text*(obj: ptr Label, text: cstring){.cdecl, 

-    importc: "label_set_text", dynlib: clarodll.}

-    

-#*

-#  \brief Sets the alignment/justification of a label

-#  

-#  \param obj A valid label widget

-#  \param text The justification (see cLabelJustify enum)

-# 

-

-proc label_set_justify*(obj: ptr Label, flags: cint){.cdecl, 

-    importc: "label_set_justify", dynlib: clarodll.}

-    

-const 

-  CLIST_TYPE_PTR* = 0

-  CLIST_TYPE_STRING* = 1

-  CLIST_TYPE_INT* = 2

-  CLIST_TYPE_UINT* = 3

-  CLIST_TYPE_DOUBLE* = 4

-

-# functions 

-#*

-#  \brief Initialises a list_widget_t derivative's storage space.

-# 

-#  \param obj list widget

-#  \param col_num number of columns to be used

-#  \param cols An array of col_num integers, specifying the 

-#              types of the columns.

-# 

-

-proc list_widget_init_ptr*(obj: ptr ListWidget, col_num: cint, 

-                           cols: ptr cint) {.cdecl, 

-    importc: "list_widget_init_ptr", dynlib: clarodll.}

-#*

-#  \brief Copies and passes on the arg list to list_widget_init_ptr.

-# 

-#  \param obj list widget

-#  \param col_num number of columns to be used

-#  \param argpi A pointer to a va_list to parse

-# 

-

-#proc list_widget_init_vaptr*(obj: ptr ClaroObj, col_num: cunsignedint, 

-#                             argpi: va_list){.cdecl, 

-#    importc: "list_widget_init_vaptr", dynlib: clarodll.}

-

-#*

-#  Shortcut function, simply calls list_widget_init_ptr with

-#  it's own arguments, and a pointer to the first variable argument.

-# 

-

-proc list_widget_init*(obj: ptr ListWidget, col_num: cint){.varargs, 

-    cdecl, importc: "list_widget_init", dynlib: clarodll.}

-#*

-#  \brief Inserts a row to a list under parent at the position specified.

-# 

-#  \param list list to insert item in

-#  \param parent item in tree to be used as parent. NULL specifies

-#   that it should be a root node.

-#  \param row item will be inserted before the item currently at

-#   this position. -1 specifies an append.

-#  \param argp points to the first element of an array containing

-#  the column data as specified by the types in list_widget_init.

-# 

-

-#*

-#  Shortcut function, calls list_widget_row_insert_ptr with

-#  it's own arguments, a position at the end of the list, and

-#  a pointer to the first variable argument.

-# 

-

-proc list_widget_row_append*(list: ptr ListWidget, 

-                             parent: ptr ListItem): ptr ListItem{.

-    varargs, cdecl, importc: "list_widget_row_append", dynlib: clarodll.}

-#*

-#  Shortcut function, calls list_widget_row_insert_ptr with

-#  it's own arguments, and a pointer to the first variable argument.

-# 

-

-proc list_widget_row_insert*(list: ptr ListWidget, parent: ptr ListItem, 

-                             pos: cint): ptr ListItem {.varargs, cdecl, 

-    importc: "list_widget_row_insert", dynlib: clarodll.}

-#*

-#  \brief Removes a row from a list

-# 

-#  \param list List widget to operate on

-#  \param item The item to remove

-# 

-

-proc list_widget_row_remove*(list: ptr ListWidget, item: ptr ListItem){.

-    cdecl, importc: "list_widget_row_remove", dynlib: clarodll.}

-#*

-#  \brief Moves a row to a new position in the list

-# 

-#  \param list List widget to operate on

-#  \param item The item to move 

-#  \param row Row position to place item before. Passing the current

-#             position will result in no change.

-# 

-

-proc list_widget_row_move*(list: ptr ListWidget, item: ptr ListItem, 

-                           row: cint){.cdecl, importc: "list_widget_row_move", 

-                                       dynlib: clarodll.}

-#*

-#  \brief Return the nth row under parent in the list

-# 

-#  \param list List widget search

-#  \param parent Parent of the item

-#  \param row Row index of item to return

-# 

-

-proc list_widget_get_row*(list: ptr ListWidget, parent: ptr ListItem, 

-                          row: cint): ptr ListItem{.cdecl, 

-    importc: "list_widget_get_row", dynlib: clarodll.}

-#*

-#  \brief Edit items of a row in the list.

-# 

-#  \param list List widget to edit

-#  \param item Row to modify

-#  \param args num,val,...,-1 where num is the column and val is the new 

-#              value of the column's type. Terminate with -1. 

-#              Don't forget the -1.

-# 

-

-#*

-#  \brief Edit items of a row in the list.

-# 

-#  \param list List-based (list_widget_t) object

-#  \param item Row to modify

-#  \param ... num,val,...,-1 where num is the column and val is the new 

-#              value of the column's type. Terminate with -1. 

-#              Don't forget the -1.

-# 

-

-proc list_widget_edit_row*(list: ptr ListWidget, item: ptr ListItem){.

-    varargs, cdecl, importc: "list_widget_edit_row", dynlib: clarodll.}

-#*

-#  \brief Set the text color of an item.

-#  This is currently only supported by the TreeView widget.

-# 

-#  \param item Target list item

-#  \param r Red component between 0.0 and 1.0

-#  \param g Green component between 0.0 and 1.0

-#  \param b Blue component between 0.0 and 1.0

-#  \param a Alpha component between 0.0 and 1.0 (reserved for future use,

-#          should be 1.0)

-# 

-

-proc list_item_set_text_color*(item: ptr ListItem, r: cfloat, g: cfloat, 

-                               b: cfloat, a: cfloat){.cdecl, 

-    importc: "list_item_set_text_color", dynlib: clarodll.}

-#*

-#  \brief Set the text background color of an item.

-#  This is currently only supported by the TreeView widget.

-# 

-#  \param item Target list item

-#  \param r Red component between 0.0 and 1.0

-#  \param g Green component between 0.0 and 1.0

-#  \param b Blue component between 0.0 and 1.0

-#  \param a Alpha component between 0.0 and 1.0 (reserved for future use,

-#           should be 1.0)

-# 

-

-proc list_item_set_text_bgcolor*(item: ptr ListItem, r: cfloat, g: cfloat, 

-                                 b: cfloat, a: cfloat){.cdecl, 

-    importc: "list_item_set_text_bgcolor", dynlib: clarodll.}

-#*

-#  \brief Set the text color of a selected item.

-#  This is currently only supported by the TreeView widget.

-# 

-#  \param item Target list item

-#  \param r Red component between 0.0 and 1.0

-#  \param g Green component between 0.0 and 1.0

-#  \param b Blue component between 0.0 and 1.0

-#  \param a Alpha component between 0.0 and 1.0 (reserved for future use,

-#         should be 1.0)

-# 

-

-proc list_item_set_sel_text_color*(item: ptr ListItem, r: cfloat, g: cfloat, 

-                                   b: cfloat, a: cfloat){.cdecl, 

-    importc: "list_item_set_sel_text_color", dynlib: clarodll.}

-#*

-#  \brief Set the text background color of a selected item.

-#  This is currently only supported by the TreeView widget.

-# 

-#  \param item Target list item

-#  \param r Red component between 0.0 and 1.0

-#  \param g Green component between 0.0 and 1.0

-#  \param b Blue component between 0.0 and 1.0

-#  \param a Alpha component between 0.0 and 1.0 (reserved for future use,

-#          should be 1.0)

-# 

-

-proc list_item_set_sel_text_bgcolor*(item: ptr ListItem, r: cfloat, 

-                                     g: cfloat, b: cfloat, a: cfloat){.cdecl, 

-    importc: "list_item_set_sel_text_bgcolor", dynlib: clarodll.}

-#*

-#  \brief Set the font details of the specified item.

-# 

-#  \param item Target list item

-#  \param weight The weight of the font

-#  \param slant The slant of the font

-#  \param decoration Font decorations

-# 

-

-proc list_item_set_font_extra*(item: ptr ListItem, weight: cint, 

-                               slant: cint, decoration: cint){.cdecl, 

-    importc: "list_item_set_font_extra", dynlib: clarodll.}

-

-type 

-  Listbox* {.pure.} = object of ListWidget

-    selected*: ptr ListItem

-{.deprecated: [TListbox: Listbox].}

-

-# functions 

-#*

-#  \brief Creates a ListBox widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new ListBox widget object.

-# 

-

-proc newlistbox*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                 flags: cint): ptr Listbox{.

-    cdecl, importc: "listbox_widget_create", dynlib: clarodll.}

-#*

-#  \brief Insert a row at the specified position into a ListBox widget

-#  

-#  \param listbox A valid ListBox widget object.

-#  \param pos The index at which this item will be placed.

-#  \param text The text for the item.

-#  \return A new list item.

-# 

-

-proc listbox_insert_row*(listbox: ptr Listbox, pos: cint, 

-                         text: cstring): ptr ListItem{.

-    cdecl, importc: "listbox_insert_row", dynlib: clarodll.}

-#*

-#  \brief Append a row to a ListBox widget

-#  

-#  \param listbox A valid ListBox widget object.

-#  \param text The text for the item.

-#  \return A new list item.

-# 

-

-proc listbox_append_row*(listbox: ptr Listbox, text: cstring): ptr ListItem{.

-    cdecl, importc: "listbox_append_row", dynlib: clarodll.}

-#*

-#  \brief Move a row in a ListBox widget

-#  

-#  \param listbox A valid ListBox widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc listbox_move_row*(listbox: ptr Listbox, item: ptr ListItem, row: cint){.

-    cdecl, importc: "listbox_move_row", dynlib: clarodll.}

-#*

-#  \brief Remove a row from a ListBox widget

-#  

-#  \param listbox A valid ListBox widget object.

-#  \param item A valid list item

-# 

-

-proc listbox_remove_row*(listbox: ptr Listbox, item: ptr ListItem){.cdecl, 

-    importc: "listbox_remove_row", dynlib: clarodll.}

-#*

-#  \brief Returns the currently selected ListBox item

-#  

-#  \param obj A valid ListBox widget object.

-#  \return The currently selected ListBox item, or NULL if no item is selected.

-# 

-

-proc listbox_get_selected*(obj: ptr Listbox): ptr ListItem{.cdecl, 

-    importc: "listbox_get_selected", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a ListBox widget

-#  

-#  \param obj A valid ListBox widget object.

-#  \return Number of rows

-# 

-

-proc listbox_get_rows*(obj: ptr Listbox): cint{.cdecl, 

-    importc: "listbox_get_rows", dynlib: clarodll.}

-#*

-#  \brief Selects a row in a ListBox widget

-#  

-#  \param obj A valid ListBox widget object.

-#  \param item A valid list item

-# 

-

-proc listbox_select_item*(obj: ptr Listbox, item: ptr ListItem){.cdecl, 

-    importc: "listbox_select_item", dynlib: clarodll.}

-

-const 

-  cListViewTypeNone* = 0

-  cListViewTypeText* = 1

-  cListViewTypeCheckBox* = 2

-  cListViewTypeProgress* = 3

-

-# whole row checkboxes.. will we really need this? hmm.

-

-const 

-  cListViewRowCheckBoxes* = 1

-

-type 

-  Listview* {.pure.} = object of ListWidget

-    titles*: cstringArray

-    nativep*: pointer

-    selected*: ptr ListItem

-{.deprecated: [TListview: Listview].}

-

-# functions 

-#*

-#  \brief Creates a ListView widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \param columns The number of columns in the listview

-#  \param ... specifies the titles and types of each column. 

-#             ("Enable",cListViewTypeCheckBox,"Title",cListViewTypeText,...)

-#  \return A new ListView widget object.

-# 

-

-proc newlistview*(parent: ptr ClaroObj, bounds: ptr Bounds, columns: cint, 

-                  flags: cint): ptr Listview {.varargs, cdecl, 

-    importc: "listview_widget_create", dynlib: clarodll.}

-#*

-#  \brief Append a row to a ListView widget

-#  

-#  \param listview A valid ListView widget object.

-#  \param ... A list of values for each column

-#  \return A new list item.

-# 

-

-proc listview_append_row*(listview: ptr Listview): ptr ListItem{.varargs, 

-    cdecl, importc: "listview_append_row", dynlib: clarodll.}

-#*

-#  \brief Insert a row at the specified position into a ListView widget

-#  

-#  \param listview A valid ListView widget object.

-#  \param pos The index at which this item will be placed.

-#  \param ... A list of values for each column

-#  \return A new list item.

-# 

-

-proc listview_insert_row*(listview: ptr Listview, pos: cint): ptr ListItem{.

-    varargs, cdecl, importc: "listview_insert_row", dynlib: clarodll.}

-#*

-#  \brief Move a row in a ListView widget

-#  

-#  \param listview A valid ListView widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc listview_move_row*(listview: ptr Listview, item: ptr ListItem, 

-                        row: cint){.cdecl, importc: "listview_move_row", 

-                                    dynlib: clarodll.}

-#*

-#  \brief Remove a row from a ListView widget

-#  

-#  \param listview A valid ListView widget object.

-#  \param item A valid list item

-# 

-

-proc listview_remove_row*(listview: ptr Listview, item: ptr ListItem){.

-    cdecl, importc: "listview_remove_row", dynlib: clarodll.}

-#*

-#  \brief Returns the currently selected ListView item

-#  

-#  \param obj A valid ListView widget object.

-#  \return The currently selected ListView item, or NULL if no item is selected.

-# 

-

-proc listview_get_selected*(obj: ptr Listview): ptr ListItem{.cdecl, 

-    importc: "listview_get_selected", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a ListView widget

-#  

-#  \param obj A valid ListView widget object.

-#  \return Number of rows

-# 

-

-proc listview_get_rows*(obj: ptr Listview): cint{.cdecl, 

-    importc: "listview_get_rows", dynlib: clarodll.}

-#*

-#  \brief Selects a row in a ListView widget

-#  

-#  \param obj A valid ListView widget object.

-#  \param item A valid list item

-# 

-

-proc listview_select_item*(obj: ptr Listview, item: ptr ListItem){.cdecl, 

-    importc: "listview_select_item", dynlib: clarodll.}

-

-const 

-  cMenuPopupAtCursor* = 1

-

-type 

-  Menu* {.pure.} = object of ListWidget

-{.deprecated: [TMenu: Menu].}

-

-#*

-#  \brief Creates a Menu widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new Menu widget object.

-# 

-

-proc newmenu*(parent: ptr ClaroObj, flags: cint): ptr Menu {.cdecl, 

-    importc: "menu_widget_create", dynlib: clarodll.}

-#*

-#  \brief Append a row to a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \return A new list item.

-# 

-

-proc menu_append_item*(menu: ptr Menu, parent: ptr ListItem, 

-                       image: ptr Image, title: cstring): ptr ListItem{.

-    cdecl, importc: "menu_append_item", dynlib: clarodll.}

-#*

-#  \brief Insert a row into a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param pos The position at which to insert this item

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \return A new list item.

-# 

-

-proc menu_insert_item*(menu: ptr Menu, parent: ptr ListItem, pos: cint, 

-                       image: ptr Image, title: cstring): ptr ListItem{.

-    cdecl, importc: "menu_insert_item", dynlib: clarodll.}

-#*

-#  \brief Append a separator to a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \return A new list item.

-# 

-

-proc menu_append_separator*(menu: ptr Menu, 

-                            parent: ptr ListItem): ptr ListItem{.

-    cdecl, importc: "menu_append_separator", dynlib: clarodll.}

-#*

-#  \brief Insert a separator into a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param pos The position at which to insert this item

-#  \return A new list item.

-# 

-

-proc menu_insert_separator*(menu: ptr Menu, parent: ptr ListItem, 

-                            pos: cint): ptr ListItem{.cdecl, 

-    importc: "menu_insert_separator", dynlib: clarodll.}

-#*

-#  \brief Move a row in a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc menu_move_item*(menu: ptr Menu, item: ptr ListItem, row: cint){.

-    cdecl, importc: "menu_move_item", dynlib: clarodll.}

-#*

-#  \brief Remove a row from a Menu widget

-#  

-#  \param menu A valid Menu widget object.

-#  \param item A valid list item

-# 

-

-proc menu_remove_item*(menu: ptr Menu, item: ptr ListItem){.cdecl, 

-    importc: "menu_remove_item", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a Menu widget

-#  

-#  \param obj A valid Menu widget object.

-#  \param parent Item whose children count to return, 

-#  or NULL for root item count.

-#  \return Number of rows

-# 

-

-proc menu_item_count*(obj: ptr Menu, parent: ptr ListItem): cint{.

-    cdecl, importc: "menu_item_count", dynlib: clarodll.}

-#*

-#  \brief Disables a menu item (no focus and greyed out)

-#  

-#  \param menu A valid Menu widget object.

-#  \param item A valid list item

-# 

-

-proc menu_disable_item*(menu: ptr Menu, item: ptr ListItem){.cdecl, 

-    importc: "menu_disable_item", dynlib: clarodll.}

-#*

-#  \brief Enables a menu item (allows focus and not greyed out)

-#  

-#  \param menu A valid Menu widget object.

-#  \param item A valid list item

-# 

-

-proc menu_enable_item*(menu: ptr Menu, item: ptr ListItem){.cdecl, 

-    importc: "menu_enable_item", dynlib: clarodll.}

-#*

-#  \brief Pops up the menu at the position specified

-#  

-#  \param menu A valid Menu widget object.

-#  \param x The X position

-#  \param y The Y position

-#  \param flags Flags

-# 

-

-proc menu_popup*(menu: ptr Menu, x: cint, y: cint, flags: cint){.cdecl, 

-    importc: "menu_popup", dynlib: clarodll.}

-#

-#   Menu modifiers

-# 

-

-const 

-  cModifierShift* = 1 shl 0

-  cModifierCommand* = 1 shl 1

-

-type 

-  Menubar* {.pure.} = object of ListWidget

-{.deprecated: [TMenubar: Menubar].}

-#*

-#  \brief Creates a MenuBar widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new MenuBar widget object.

-# 

-

-proc newmenubar*(parent: ptr ClaroObj, flags: cint): ptr Menubar {.cdecl, 

-    importc: "menubar_widget_create", dynlib: clarodll.}

-#*

-#  \brief Add a key binding to a menu items

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param item The item

-#  \param utf8_key The key to use, NOT NULL.

-#  \param modifier The modifier key, or 0.

-# 

-

-proc menubar_add_key_binding*(menubar: ptr Menubar, item: ptr ListItem, 

-                              utf8_key: cstring, modifier: cint){.cdecl, 

-    importc: "menubar_add_key_binding", dynlib: clarodll.}

-#*

-#  \brief Append a row to a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \return A new list item.

-# 

-

-proc menubar_append_item*(menubar: ptr Menubar, parent: ptr ListItem, 

-                          image: ptr Image, title: cstring): ptr ListItem{.

-    cdecl, importc: "menubar_append_item", dynlib: clarodll.}

-#*

-#  \brief Insert a row into a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param pos The position at which to insert this item

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \return A new list item.

-# 

-

-proc menubar_insert_item*(menubar: ptr Menubar, parent: ptr ListItem, 

-                          pos: cint, image: ptr Image, 

-                          title: cstring): ptr ListItem{.

-    cdecl, importc: "menubar_insert_item", dynlib: clarodll.}

-#*

-#  \brief Append a separator to a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \return A new list item.

-# 

-

-proc menubar_append_separator*(menubar: ptr Menubar, 

-                               parent: ptr ListItem): ptr ListItem{.

-    cdecl, importc: "menubar_append_separator", dynlib: clarodll.}

-#*

-#  \brief Insert a separator into a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param parent The item to place the new item under, or NULL for a root item.

-#  \param pos The position at which to insert this item

-#  \return A new list item.

-# 

-

-proc menubar_insert_separator*(menubar: ptr Menubar, parent: ptr ListItem, 

-                               pos: cint): ptr ListItem{.cdecl, 

-    importc: "menubar_insert_separator", dynlib: clarodll.}

-#*

-#  \brief Move a row in a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc menubar_move_item*(menubar: ptr Menubar, item: ptr ListItem, 

-                        row: cint){.cdecl, importc: "menubar_move_item", 

-                                    dynlib: clarodll.}

-#*

-#  \brief Remove a row from a MenuBar widget

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param item A valid list item

-# 

-

-proc menubar_remove_item*(menubar: ptr Menubar, item: ptr ListItem) {.

-    cdecl, importc: "menubar_remove_item", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a MenuBar widget

-#  

-#  \param obj A valid MenuBar widget object.

-#  \param parent Item whose children count to return, or NULL for root

-#         item count.

-#  \return Number of rows

-# 

-

-proc menubar_item_count*(obj: ptr Menubar, parent: ptr ListItem): cint{.

-    cdecl, importc: "menubar_item_count", dynlib: clarodll.}

-#*

-#  \brief Disables a menu item (no focus and greyed out)

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param item A valid list item

-# 

-

-proc menubar_disable_item*(menubar: ptr Menubar, item: ptr ListItem){.

-    cdecl, importc: "menubar_disable_item", dynlib: clarodll.}

-#*

-#  \brief Enables a menu item (allows focus and not greyed out)

-#  

-#  \param menubar A valid MenuBar widget object.

-#  \param item A valid list item

-# 

-

-proc menubar_enable_item*(menubar: ptr Menubar, item: ptr ListItem){.

-    cdecl, importc: "menubar_enable_item", dynlib: clarodll.}

-

-type 

-  Progress* {.pure.} = object of Widget

-

-  CProgressStyle* = enum 

-    cProgressLeftRight = 0x00000000, cProgressRightLeft = 0x00000001, 

-    cProgressTopBottom = 0x00000002, cProgressBottomTop = 0x00000004

-{.deprecated: [TProgress: Progress, TcProgressStyle: CProgressStyle].}

-

-#*

-#  \brief Creates a Progress widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Progress widget object.

-# 

-

-proc newprogress*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                  flags: cint): ptr Progress {.

-    cdecl, importc: "progress_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the value of a progress widget

-#  

-#  \param progress A valid progress widget object

-#  \param percentage Progress value

-# 

-

-proc progress_set_level*(progress: ptr Progress, percentage: cdouble){.cdecl, 

-    importc: "progress_set_level", dynlib: clarodll.}

-#*

-#  \brief Sets the orientation of a progress widget

-#  

-#  \param progress A valid progress widget object

-#  \param flags One of the cProgressStyle values

-# 

-

-proc progress_set_orientation*(progress: ptr Progress, flags: cint){.cdecl, 

-    importc: "progress_set_orientation", dynlib: clarodll.}

-

-type 

-  RadioGroup* {.pure.} = object of ClaroObj

-    buttons*: List

-    selected*: ptr ClaroObj

-    ndata*: pointer

-

-  RadioButton* {.pure.} = object of Widget

-    text*: array[0..256-1, char]

-    group*: ptr RadioGroup

-{.deprecated: [TRadioGroup: RadioGroup, TRadioButton: RadioButton].}

-

-#*

-#  \brief Creates a Radio Group widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new Radio Group widget object.

-# 

-

-proc newRadiogroup*(parent: ptr ClaroObj, flags: cint): ptr RadioGroup {.

-    cdecl, importc: "radiogroup_create", dynlib: clarodll.}

-#*

-#  \brief Creates a Radio Button widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param group A valid Radio Group widget object

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param label The label of the radio widget

-#  \param flags Widget flags.

-#  \return A new Radio Button widget object.

-# 

-

-proc newradiobutton*(parent: ptr ClaroObj, group: ptr RadioGroup, 

-                     bounds: ptr Bounds, label: cstring, 

-                     flags: cint): ptr RadioButton{.

-    cdecl, importc: "radiobutton_widget_create", dynlib: clarodll.}

-#*

-#  \brief Set the label of a Radio Button

-#  

-#  \param obj A valid Radio Button widget

-#  \param label The new label for the Radio Button

-# 

-

-proc radiobutton_set_text*(obj: ptr RadioButton, label: cstring){.cdecl, 

-    importc: "radiobutton_set_label", dynlib: clarodll.}

-#*

-#  \brief Set the group of a Radio Button

-#  

-#  \param rbutton A valid Radio Button widget

-#  \param group A valid Radio Group widget object

-# 

-

-proc radiobutton_set_group*(rbutton: ptr RadioButton, group: ptr RadioGroup){.

-    cdecl, importc: "radiobutton_set_group", dynlib: clarodll.}

-

-const 

-  CLARO_SCROLLBAR_MAXIMUM* = 256

-

-type 

-  Scrollbar* {.pure.} = object of Widget

-    min*: cint

-    max*: cint

-    pagesize*: cint

-{.deprecated: [TScrollbar: Scrollbar].}

-

-const 

-  cScrollbarHorizontal* = 0

-  cScrollbarVertical* = 1

-

-# functions 

-#*

-#  \brief Creates a ScrollBar widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new ScrollBar widget object.

-# 

-

-proc newscrollbar*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                   flags: cint): ptr Scrollbar{.

-    cdecl, importc: "scrollbar_widget_create", dynlib: clarodll.}

-#*

-#  \brief Returns the width that scrollbars should be on this platform

-#  

-#  \return Width of vertical scrollbars

-# 

-

-proc scrollbar_get_sys_width*(): cint{.cdecl, 

-                                       importc: "scrollbar_get_sys_width", 

-                                       dynlib: clarodll.}

-#*

-#  \brief Sets the range of a ScrollBar widget

-#  

-#  \param w A valid ScrollBar widget object

-#  \param min The minimum value

-#  \param max The maximum value

-# 

-

-proc scrollbar_set_range*(w: ptr Scrollbar, min: cint, max: cint){.cdecl, 

-    importc: "scrollbar_set_range", dynlib: clarodll.}

-#*

-#  \brief Sets the position of a ScrollBar widget

-#  

-#  \param w A valid ScrollBar widget object

-#  \param pos The new position

-# 

-

-proc scrollbar_set_pos*(w: ptr Scrollbar, pos: cint){.cdecl, 

-    importc: "scrollbar_set_pos", dynlib: clarodll.}

-#*

-#  \brief Gets the position of a ScrollBar widget

-#  

-#  \param w A valid ScrollBar widget object

-#  \return The current position

-# 

-

-proc scrollbar_get_pos*(w: ptr Scrollbar): cint{.cdecl, 

-    importc: "scrollbar_get_pos", dynlib: clarodll.}

-#*

-#  \brief Sets the page size of a ScrollBar widget

-# 

-#  \param w A valid ScrollBar widget object

-#  \param pagesize The size of a page (the number of units visible at one time)

-# 

-

-proc scrollbar_set_pagesize*(w: ptr Scrollbar, pagesize: cint){.cdecl, 

-    importc: "scrollbar_set_pagesize", dynlib: clarodll.}

-    

-type 

-  CSplitterChildren* = enum 

-    cSplitterFirst = 0, cSplitterSecond = 1

-  SplitterChild* {.pure.} = object 

-    flex*: cint

-    size*: cint

-    w*: ptr Widget

-

-  Splitter* {.pure.} = object of Widget

-    pair*: array[0..1, SplitterChild]

-{.deprecated: [TcSplitterChildren: CSplitterChildren, TSplitter: Splitter,

-              TSplitterChild: SplitterChild].}

-

-const 

-  cSplitterHorizontal* = 0

-  cSplitterVertical* = 1

-

-# functions 

-#*

-#  \brief Creates a Splitter widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Splitter widget object.

-# 

-

-proc newsplitter*(parent: ptr ClaroObj, bounds: ptr Bounds,

-                  flags: cint): ptr Splitter{.

-    cdecl, importc: "splitter_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the sizing information of a child

-#  

-#  \param splitter A valid splitter widget object

-#  \param child The child number, either cSplitterFirst or cSplitterSecond.

-#  \param flex 1 if this child should receive extra space as the splitter 

-#         expands, 0 if not

-#  \param size The size of this child

-# 

-

-proc splitter_set_info*(splitter: ptr Splitter, child: cint, flex: cint, 

-                        size: cint){.cdecl, importc: "splitter_set_info", 

-                                     dynlib: clarodll.}

-                                     

-type 

-  Statusbar* {.pure.} = object of Widget

-    text*: array[0..256 - 1, char]

-{.deprecated: [TStatusbar: Statusbar].}

-

-

-#*

-#  \brief Creates a StatusBar widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new StatusBar widget object.

-# 

-

-proc newstatusbar*(parent: ptr ClaroObj, flags: cint): ptr Statusbar {.cdecl, 

-    importc: "statusbar_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the text of a statusbar

-#  

-#  \param obj A valid StatusBar widget

-#  \param text The new text

-# 

-

-proc statusbar_set_text*(obj: ptr Statusbar, text: cstring){.cdecl, 

-    importc: "statusbar_set_text", dynlib: clarodll.}

-#*

-#  \brief obtains a stock image

-#  

-#  \param stock_id The string ID of the stock image, NOT NULL.

-#  \return The Image object.

-# 

-

-proc stock_get_image*(stock_id: cstring): ptr Image{.cdecl, 

-    importc: "stock_get_image", dynlib: clarodll.}

-#*

-#  \brief adds a stock id image

-#  

-#  \param stock_id The string ID of the stock image, NOT NULL.

-#  \param img The Image object to add.

-#  \return The Image object.

-# 

-

-proc stock_add_image*(stock_id: cstring, img: ptr Image){.cdecl, 

-    importc: "stock_add_image", dynlib: clarodll.}

-

-const 

-  CLARO_TEXTAREA_MAXIMUM = (1024 * 1024)

-

-type 

-  TextArea* {.pure.} = object of Widget

-    text*: array[0..CLARO_TEXTAREA_MAXIMUM - 1, char]

-{.deprecated: [TTextArea: TextArea].}

-

-

-#*

-#  \brief Creates a TextArea widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new TextArea widget object.

-# 

-

-proc newtextarea*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                  flags: cint): ptr TextArea{.

-    cdecl, importc: "textarea_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the text of a textarea

-#  

-#  \param obj A valid TextArea widget

-#  \param text The new text

-# 

-

-proc textarea_set_text*(obj: ptr TextArea, text: cstring){.cdecl, 

-    importc: "textarea_set_text", dynlib: clarodll.}

-#*

-#  \brief Retrieve the text of a textarea

-#  

-#  \param obj A valid TextArea widget

-#  \return Pointer to an internal reference of the text. Should not be changed.

-# 

-

-proc textarea_get_text*(obj: ptr TextArea): cstring{.cdecl, 

-    importc: "textarea_get_text", dynlib: clarodll.}

-

-const 

-  CLARO_TEXTBOX_MAXIMUM = 8192

-

-type 

-  TextBox* {.pure.} = object of Widget

-    text*: array[0..CLARO_TEXTBOX_MAXIMUM-1, char]

-{.deprecated: [TTextBox: TextBox].}

-

-const 

-  cTextBoxTypePassword* = 1

-

-# functions 

-#*

-#  \brief Creates a TextBox widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new TextBox widget object.

-# 

-

-proc newtextbox*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                 flags: cint): ptr TextBox{.

-    cdecl, importc: "textbox_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the text of a textbox

-#  

-#  \param obj A valid TextBox widget

-#  \param text The new text

-# 

-

-proc textbox_set_text*(obj: ptr TextBox, text: cstring){.cdecl, 

-    importc: "textbox_set_text", dynlib: clarodll.}

-#*

-#  \brief Retrieve the text of a textbox

-#  

-#  \param obj A valid TextBox widget

-#  \return Pointer to an internal reference of the text. Should not be changed.

-# 

-

-proc textbox_get_text*(obj: ptr TextBox): cstring{.cdecl, 

-    importc: "textbox_get_text", dynlib: clarodll.}

-#*

-#  \brief Retrieve the cursor position inside a textbox

-#  

-#  \param obj A valid TextBox widget

-#  \return Cursor position inside TextBox

-# 

-

-proc textbox_get_pos*(obj: ptr TextBox): cint{.cdecl, 

-    importc: "textbox_get_pos", dynlib: clarodll.}

-#*

-#  \brief Sets the cursor position inside a textbox

-#  

-#  \param obj A valid TextBox widget

-#  \param pos New cursor position inside TextBox

-# 

-

-proc textbox_set_pos*(obj: ptr TextBox, pos: cint){.cdecl, 

-    importc: "textbox_set_pos", dynlib: clarodll.}

-

-const 

-  cToolbarShowText* = 1

-  cToolbarShowImages* = 2

-  cToolbarShowBoth* = 3

-  cToolbarAutoSizeButtons* = 4

-

-type 

-  Toolbar* {.pure.} = object of ListWidget

-{.deprecated: [TToolbar: Toolbar].}

-#*

-#  \brief Creates a ToolBar widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param flags Widget flags.

-#  \return A new ToolBar widget object.

-# 

-

-proc newtoolbar*(parent: ptr ClaroObj, flags: cint): ptr Toolbar{.cdecl, 

-    importc: "toolbar_widget_create", dynlib: clarodll.}

-#*

-#  \brief Append a row to a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \param tooltip A string tooltip, or NULL.

-#  \return A new list item.

-# 

-

-proc toolbar_append_icon*(toolbar: ptr Toolbar, image: ptr Image, 

-                          title: cstring, tooltip: cstring): ptr ListItem{.

-    cdecl, importc: "toolbar_append_icon", dynlib: clarodll.}

-#*

-#  \brief Insert a row into a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param pos The position at which to insert this item

-#  \param image An image object, or NULL.

-#  \param title A string title, or NULL.

-#  \param tooltip A string tooltip, or NULL.

-#  \return A new list item.

-# 

-

-proc toolbar_insert_icon*(toolbar: ptr Toolbar, pos: cint, 

-                          image: ptr Image, title: cstring, 

-                          tooltip: cstring): ptr ListItem{.

-    cdecl, importc: "toolbar_insert_icon", dynlib: clarodll.}

-#*

-#  \brief Append a separator to a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \return A new list item.

-# 

-

-proc toolbar_append_separator*(toolbar: ptr Toolbar): ptr ListItem{.cdecl, 

-    importc: "toolbar_append_separator", dynlib: clarodll.}

-#*

-#  \brief Insert a separator into a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param pos The position at which to insert this item

-#  \return A new list item.

-# 

-

-proc toolbar_insert_separator*(toolbar: ptr Toolbar, 

-                               pos: cint): ptr ListItem {.

-    cdecl, importc: "toolbar_insert_separator", dynlib: clarodll.}

-#*

-#  \brief Assign a menu widget to an item.

-# 

-#  This will show a small down arrow next to the item

-#  that will open this menu.

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param item Toolbar item the menu is for.

-#  \param menu Menu widget object, or NULL to remove a menu.

-# 

-

-proc toolbar_set_item_menu*(toolbar: ptr Toolbar, item: ptr ListItem, 

-                            menu: ptr Menu){.cdecl, 

-    importc: "toolbar_set_item_menu", dynlib: clarodll.}

-#*

-#  \brief Move a row in a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc toolbar_move_icon*(toolbar: ptr Toolbar, item: ptr ListItem, 

-                        row: cint){.cdecl, importc: "toolbar_move_icon", 

-                                    dynlib: clarodll.}

-#*

-#  \brief Remove a row from a ToolBar widget

-#  

-#  \param toolbar A valid ToolBar widget object.

-#  \param item A valid list item

-# 

-

-proc toolbar_remove_icon*(toolbar: ptr Toolbar, item: ptr ListItem){.

-    cdecl, importc: "toolbar_remove_icon", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a ToolBar widget

-#  

-#  \param obj A valid ToolBar widget object.

-#  \return Number of rows

-# 

-

-proc toolbar_item_count*(obj: ptr Toolbar): cint{.cdecl, 

-    importc: "toolbar_item_count", dynlib: clarodll.}

-#*

-#  \brief TreeView widget

-# 

-

-type 

-  Treeview* {.pure.} = object of ListWidget

-    selected*: ptr ListItem

-{.deprecated: [TTreeview: Treeview].}

-

-# functions 

-#*

-#  \brief Creates a TreeView widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new TreeView widget object.

-# 

-

-proc newtreeview*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                  flags: cint): ptr Treeview{.

-    cdecl, importc: "treeview_widget_create", dynlib: clarodll.}

-#*

-#  \brief Append a row to a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param parent The item under which to place the new item, or NULL for a root node.

-#  \param image An image to go to the left of the item, or NULL for no image.

-#  \param title The text for the item.

-#  \return A new list item.

-# 

-

-proc treeview_append_row*(treeview: ptr Treeview, parent: ptr ListItem, 

-                          image: ptr Image, title: cstring): ptr ListItem{.

-    cdecl, importc: "treeview_append_row", dynlib: clarodll.}

-#*

-#  \brief Insert a row at the specified position into a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param parent The item under which to place the new item, or NULL for a root node.

-#  \param pos The index at which this item will be placed.

-#  \param image An image to go to the left of the item, or NULL for no image.

-#  \param title The text for the item.

-#  \return A new list item.

-# 

-

-proc treeview_insert_row*(treeview: ptr Treeview, parent: ptr ListItem, 

-                          pos: cint, image: ptr Image, 

-                          title: cstring): ptr ListItem{.

-    cdecl, importc: "treeview_insert_row", dynlib: clarodll.}

-#*

-#  \brief Move a row in a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param item A valid list item

-#  \param row New position to place this item

-# 

-

-proc treeview_move_row*(treeview: ptr Treeview, item: ptr ListItem, 

-                        row: cint){.cdecl, importc: "treeview_move_row", 

-                                    dynlib: clarodll.}

-#*

-#  \brief Remove a row from a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param item A valid list item

-# 

-

-proc treeview_remove_row*(treeview: ptr Treeview, item: ptr ListItem){.

-    cdecl, importc: "treeview_remove_row", dynlib: clarodll.}

-#*

-#  \brief Expand a row in a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param item A valid list item

-# 

-

-proc treeview_expand*(treeview: ptr Treeview, item: ptr ListItem){.cdecl, 

-    importc: "treeview_expand", dynlib: clarodll.}

-#*

-#  \brief Collapse a row in a TreeView

-#  

-#  \param treeview A valid TreeView widget object.

-#  \param item A valid list item

-# 

-

-proc treeview_collapse*(treeview: ptr Treeview, item: ptr ListItem){.cdecl, 

-    importc: "treeview_collapse", dynlib: clarodll.}

-#*

-#  \brief Returns the currently selected TreeView item

-#  

-#  \param obj A valid TreeView widget object.

-#  \return The currently selected TreeView item, or NULL if no item is selected.

-# 

-

-proc treeview_get_selected*(obj: ptr Treeview): ptr ListItem{.cdecl, 

-    importc: "treeview_get_selected", dynlib: clarodll.}

-#*

-#  \brief Returns the number of rows in a TreeView

-#  

-#  \param obj A valid TreeView widget object.

-#  \param parent Return the number of children of this item, or the number of

-#                root items if NULL

-#  \return Number of rows

-# 

-

-proc treeview_get_rows*(obj: ptr Treeview, parent: ptr ListItem): cint{.

-    cdecl, importc: "treeview_get_rows", dynlib: clarodll.}

-#*

-#  \brief Selects a row in a TreeView

-#  

-#  \param obj A valid TreeView widget object.

-#  \param item A valid list item

-# 

-

-proc treeview_select_item*(obj: ptr Treeview, item: ptr ListItem){.cdecl, 

-    importc: "treeview_select_item", dynlib: clarodll.}

-

-const 

-  cWindowModalDialog* = 1

-  cWindowCenterParent* = 2

-  cWindowNoResizing* = 4

-

-type 

-  Window* {.pure.} = object of Widget

-    title*: array[0..512 - 1, char]

-    icon*: ptr Image

-    menubar*: ptr Widget

-    workspace*: ptr Widget

-    exsp_tools*: cint

-    exsp_status*: cint

-    exsp_init*: cint

-{.deprecated: [TWindow: Window].}

-

-const 

-  cWindowFixedSize* = 1

-

-# functions 

-#*

-#  \brief Creates a Window widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Window widget object.

-# 

-

-proc newwindow*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                flags: cint): ptr Window {.

-    cdecl, importc: "window_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets a Window's title

-#  

-#  \param w A valid Window widget object

-#  \param title The new title for the window

-# 

-

-proc window_set_title*(w: ptr Window, title: cstring){.cdecl, 

-    importc: "window_set_title", dynlib: clarodll.}

-#*

-#  \brief Makes a window visible

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_show*(w: ptr Window){.cdecl, importc: "window_show", 

-                                     dynlib: clarodll.}

-#*

-#  \brief Makes a window invisible

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_hide*(w: ptr Window){.cdecl, importc: "window_hide", 

-                                     dynlib: clarodll.}

-#*

-#  \brief Gives focus to a window

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_focus*(w: ptr Window){.cdecl, importc: "window_focus", 

-                                      dynlib: clarodll.}

-#*

-#  \brief Maximises a window

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_maximize*(w: ptr Window){.cdecl, importc: "window_maximise", 

-    dynlib: clarodll.}

-#*

-#  \brief Minimises a window

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_minimize*(w: ptr Window){.cdecl, importc: "window_minimise", 

-    dynlib: clarodll.}

-#*

-#  \brief Restores a window

-#  

-#  \param w A valid Window widget object

-# 

-

-proc window_restore*(w: ptr Window){.cdecl, importc: "window_restore", 

-                                        dynlib: clarodll.}

-#*

-#  \brief Sets a window's icon

-#  

-#  \param w A valid Window widget object

-#  \param icon A valid Image object

-# 

-

-proc window_set_icon*(w: ptr Window, icon: ptr Image){.cdecl, 

-    importc: "window_set_icon", dynlib: clarodll.}

-

-const 

-  cWorkspaceTileHorizontally* = 0

-  cWorkspaceTileVertically* = 1

-

-type 

-  Workspace*{.pure.} = object of Widget

-

-  WorkspaceWindow*{.pure.} = object of Widget

-    icon*: ptr Image

-    title*: array[0..512 - 1, char]

-    workspace*: ptr Workspace

-{.deprecated: [TWorkspace: Workspace, TWorkspaceWindow: WorkspaceWindow].}

-

-# functions (workspace) 

-#*

-#  \brief Creates a Workspace widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Workspace widget object.

-# 

-

-proc newworkspace*(parent: ptr ClaroObj, bounds: ptr Bounds, 

-                   flags: cint): ptr Workspace{.

-    cdecl, importc: "workspace_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the active (visible) workspace child

-#  

-#  \param workspace A valid workspace widget

-#  \param child A valid workspace window widget

-# 

-

-proc workspace_set_active*(workspace: ptr Workspace, child: ptr ClaroObj){.

-    cdecl, importc: "workspace_set_active", dynlib: clarodll.}

-#*

-#  \brief Returns the active (visible) workspace child

-#  

-#  \param workspace A valid workspace widget

-#  \return The active workspace window widget

-# 

-

-proc workspace_get_active*(workspace: ptr Workspace): ptr Workspace{.cdecl, 

-    importc: "workspace_get_active", dynlib: clarodll.}

-#*

-#  \brief Cascades all workspace windows

-#  

-#  \param workspace A valid workspace widget

-# 

-

-proc workspace_cascade*(workspace: ptr Workspace){.cdecl, 

-    importc: "workspace_cascade", dynlib: clarodll.}

-#*

-#  \brief Tiles all workspace windows

-#  

-#  \param workspace A valid workspace widget

-#  \param dir The direction to tile child widgets

-# 

-

-proc workspace_tile*(workspace: ptr Workspace, dir: cint){.cdecl, 

-    importc: "workspace_tile", dynlib: clarodll.}

-# functions (workspace_window) 

-#*

-#  \brief Creates a Workspace widget

-#  

-#  \param parent The parent widget of this widget, NOT NULL.

-#  \param bounds The initial bounds of this widget, or NO_BOUNDS.

-#  \param flags Widget flags.

-#  \return A new Workspace widget object.

-# 

-

-proc newWorkspaceWindow*(parent: ptr ClaroObj, 

-                         bounds: ptr Bounds, 

-                         flags: cint): ptr WorkspaceWindow{.

-    cdecl, importc: "workspace_window_widget_create", dynlib: clarodll.}

-#*

-#  \brief Sets the title of a Workspace Window widget

-#  

-#  \param window A valid Workspace Window widget

-#  \param title The new title for the widget

-# 

-

-proc workspace_window_set_title*(window: ptr WorkspaceWindow, 

-                                 title: cstring){.cdecl, 

-    importc: "workspace_window_set_title", dynlib: clarodll.}

-#*

-#  \brief Makes a Workspace Window widget visible

-#  

-#  \param window A valid Workspace Window widget

-# 

-

-proc workspace_window_show*(window: ptr WorkspaceWindow){.cdecl, 

-    importc: "workspace_window_show", dynlib: clarodll.}

-#*

-#  \brief Makes a Workspace Window widget invisible

-#  

-#  \param window A valid Workspace Window widget

-# 

-

-proc workspace_window_hide*(window: ptr WorkspaceWindow){.cdecl, 

-    importc: "workspace_window_hide", dynlib: clarodll.}

-#*

-#  \brief Restores a Workspace Window widget

-#  

-#  \param window A valid Workspace Window widget

-# 

-

-proc workspace_window_restore*(window: ptr WorkspaceWindow){.cdecl, 

-    importc: "workspace_window_restore", dynlib: clarodll.}

-# American spelling 

-

-#*

-#  \brief Minimises a Workspace Window widget

-#  

-#  \param window A valid Workspace Window widget

-# 

-

-proc workspace_window_minimize*(window: ptr WorkspaceWindow){.cdecl, 

-    importc: "workspace_window_minimise", dynlib: clarodll.}

-#*

-#  \brief Maxmimises a Workspace Window widget

-#  

-#  \param window A valid Workspace Window widget

-# 

-

-proc workspace_window_maximize*(window: ptr WorkspaceWindow){.cdecl, 

-    importc: "workspace_window_maximise", dynlib: clarodll.}

-#*

-#  \brief Sets the icon of a Workspace Window widget

-#  

-#  \param window A valid Workspace Window widget

-#  \param icon A valid Image object.

-# 

-

-proc workspace_window_set_icon*(w: ptr WorkspaceWindow, icon: ptr Image){.

-    cdecl, importc: "workspace_window_set_icon", dynlib: clarodll.}

-    

-claro_base_init()

-claro_graphics_init()

-

-when not defined(testing) and isMainModule:

-  var w = newWindow(nil, newBounds(100, 100, 230, 230), 0)

-  window_set_title(w, "Hello, World!")

-

-  var t = newTextbox(w, new_bounds(10, 10, 210, -1), 0)

-  widget_set_notify(t, cNotifyKey)

-  textbox_set_text(t, "Yeehaw!")

-

-  var b = newButton(w, new_bounds(40, 45, 150, -1), 0, "Push my button!")

-

-  proc push_my_button(obj: ptr ClaroObj, event: ptr Event) {.cdecl.} =

-    textbox_set_text(t, "You pushed my button!")

-    var button = cast[ptr Button](obj)

-    button_set_text(button, "Ouch!")

-

-  object_addhandler(b, "pushed", push_my_button)

-

-  window_show(w)

-  window_focus(w)

-

-  claro_loop()

-

diff --git a/lib/wrappers/expat.nim b/lib/wrappers/expat.nim
deleted file mode 100644
index e1897e2b4..000000000
--- a/lib/wrappers/expat.nim
+++ /dev/null
@@ -1,899 +0,0 @@
-# Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
-#   See the file COPYING for copying permission.
-#
-
-when not defined(expatDll): 
-  when defined(windows): 
-    const 
-      expatDll = "expat.dll"
-  elif defined(macosx): 
-    const 
-      expatDll = "libexpat.dylib"
-  else: 
-    const 
-      expatDll = "libexpat.so(.1|)"
-type 
-  ParserStruct{.pure, final.} = object 
-  
-  PParser* = ptr ParserStruct
-
-# The XML_Status enum gives the possible return values for several
-#   API functions.  The preprocessor #defines are included so this
-#   stanza can be added to code that still needs to support older
-#   versions of Expat 1.95.x:
-#
-#   #ifndef XML_STATUS_OK
-#   #define XML_STATUS_OK    1
-#   #define XML_STATUS_ERROR 0
-#   #endif
-#
-#   Otherwise, the #define hackery is quite ugly and would have been
-#   dropped.
-#
-{.deprecated: [TParserStruct: ParserStruct].}
-
-type 
-  Status*{.size: sizeof(cint).} = enum 
-    STATUS_ERROR = 0, STATUS_OK = 1, STATUS_SUSPENDED = 2
-  Error*{.size: sizeof(cint).} = enum 
-    ERROR_NONE, ERROR_NO_MEMORY, ERROR_SYNTAX, ERROR_NO_ELEMENTS, 
-    ERROR_INVALID_TOKEN, ERROR_UNCLOSED_TOKEN, ERROR_PARTIAL_CHAR, 
-    ERROR_TAG_MISMATCH, ERROR_DUPLICATE_ATTRIBUTE,
-    ERROR_JUNK_AFTER_DOC_ELEMENT, 
-    ERROR_PARAM_ENTITY_REF, ERROR_UNDEFINED_ENTITY, ERROR_RECURSIVE_ENTITY_REF, 
-    ERROR_ASYNC_ENTITY, ERROR_BAD_CHAR_REF, ERROR_BINARY_ENTITY_REF, 
-    ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, ERROR_MISPLACED_XML_PI, 
-    ERROR_UNKNOWN_ENCODING, ERROR_INCORRECT_ENCODING, 
-    ERROR_UNCLOSED_CDATA_SECTION, ERROR_EXTERNAL_ENTITY_HANDLING, 
-    ERROR_NOT_STANDALONE, ERROR_UNEXPECTED_STATE, ERROR_ENTITY_DECLARED_IN_PE, 
-    ERROR_FEATURE_REQUIRES_XML_DTD, ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,  
-    ERROR_UNBOUND_PREFIX,     
-    ERROR_UNDECLARING_PREFIX, ERROR_INCOMPLETE_PE, ERROR_XML_DECL, 
-    ERROR_TEXT_DECL, ERROR_PUBLICID, ERROR_SUSPENDED, ERROR_NOT_SUSPENDED, 
-    ERROR_ABORTED, ERROR_FINISHED, ERROR_SUSPEND_PE, 
-    ERROR_RESERVED_PREFIX_XML, ERROR_RESERVED_PREFIX_XMLNS, 
-    ERROR_RESERVED_NAMESPACE_URI
-  ContentType*{.size: sizeof(cint).} = enum 
-    CTYPE_EMPTY = 1, CTYPE_ANY, CTYPE_MIXED, CTYPE_NAME, CTYPE_CHOICE, CTYPE_SEQ
-  ContentQuant*{.size: sizeof(cint).} = enum 
-    CQUANT_NONE, CQUANT_OPT, CQUANT_REP, CQUANT_PLUS
-{.deprecated: [TStatus: Status, TError: Error, TContent_Type: ContentType,
-              TContent_Quant: ContentQuant].}
-
-# If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
-#   XML_CQUANT_NONE, and the other fields will be zero or NULL.
-#   If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
-#   numchildren will contain number of elements that may be mixed in
-#   and children point to an array of XML_Content cells that will be
-#   all of XML_CTYPE_NAME type with no quantification.
-#
-#   If type == XML_CTYPE_NAME, then the name points to the name, and
-#   the numchildren field will be zero and children will be NULL. The
-#   quant fields indicates any quantifiers placed on the name.
-#
-#   CHOICE and SEQ will have name NULL, the number of children in
-#   numchildren and children will point, recursively, to an array
-#   of XML_Content cells.
-#
-#   The EMPTY, ANY, and MIXED types will only occur at top level.
-#
-
-type 
-  Content*{.pure, final.} = object 
-    typ*: ContentType
-    quant*: ContentQuant
-    name*: cstring
-    numchildren*: cint
-    children*: ptr Content
-{.deprecated: [TContent: Content].}
-
-# This is called for an element declaration. See above for
-#   description of the model argument. It's the caller's responsibility
-#   to free model when finished with it.
-#
-
-type 
-  ElementDeclHandler* = proc (userData: pointer, name: cstring, 
-                               model: ptr Content){.cdecl.}
-{.deprecated: [TElementDeclHandler: ElementDeclHandler].}
-
-proc setElementDeclHandler*(parser: PParser, eldecl: ElementDeclHandler){.
-    cdecl, importc: "XML_SetElementDeclHandler", dynlib: expatDll.}
-# The Attlist declaration handler is called for *each* attribute. So
-#   a single Attlist declaration with multiple attributes declared will
-#   generate multiple calls to this handler. The "default" parameter
-#   may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
-#   keyword. The "isrequired" parameter will be true and the default
-#   value will be NULL in the case of "#REQUIRED". If "isrequired" is
-#   true and default is non-NULL, then this is a "#FIXED" default.
-#
-
-type 
-  AttlistDeclHandler* = proc (userData: pointer, elname: cstring, 
-                               attname: cstring, attType: cstring, 
-                               dflt: cstring, isrequired: cint){.cdecl.}
-{.deprecated: [TAttlistDeclHandler: AttlistDeclHandler].}
-
-proc setAttlistDeclHandler*(parser: PParser, attdecl: AttlistDeclHandler){.
-    cdecl, importc: "XML_SetAttlistDeclHandler", dynlib: expatDll.}
-# The XML declaration handler is called for *both* XML declarations
-#   and text declarations. The way to distinguish is that the version
-#   parameter will be NULL for text declarations. The encoding
-#   parameter may be NULL for XML declarations. The standalone
-#   parameter will be -1, 0, or 1 indicating respectively that there
-#   was no standalone parameter in the declaration, that it was given
-#   as no, or that it was given as yes.
-#
-
-type 
-  XmlDeclHandler* = proc (userData: pointer, version: cstring, 
-                           encoding: cstring, standalone: cint){.cdecl.}
-{.deprecated: [TXmlDeclHandler: XmlDeclHandler].}
-
-proc setXmlDeclHandler*(parser: PParser, xmldecl: XmlDeclHandler){.cdecl, 
-    importc: "XML_SetXmlDeclHandler", dynlib: expatDll.}
-type 
-  Memory_Handling_Suite*{.pure, final.} = object 
-    mallocFcn*: proc (size: int): pointer{.cdecl.}
-    reallocFcn*: proc (p: pointer, size: int): pointer{.cdecl.}
-    freeFcn*: proc (p: pointer){.cdecl.}
-{.deprecated: [TMemory_Handling_Suite: MemoryHandlingSuite].}
-
-# Constructs a new parser; encoding is the encoding specified by the
-#   external protocol or NULL if there is none specified.
-#
-
-proc parserCreate*(encoding: cstring): PParser{.cdecl, 
-    importc: "XML_ParserCreate", dynlib: expatDll.}
-# Constructs a new parser and namespace processor.  Element type
-#   names and attribute names that belong to a namespace will be
-#   expanded; unprefixed attribute names are never expanded; unprefixed
-#   element type names are expanded only if there is a default
-#   namespace. The expanded name is the concatenation of the namespace
-#   URI, the namespace separator character, and the local part of the
-#   name.  If the namespace separator is '\0' then the namespace URI
-#   and the local part will be concatenated without any separator.
-#   It is a programming error to use the separator '\0' with namespace
-#   triplets (see XML_SetReturnNSTriplet).
-#
-
-proc parserCreateNS*(encoding: cstring, namespaceSeparator: char): PParser{.
-    cdecl, importc: "XML_ParserCreateNS", dynlib: expatDll.}
-# Constructs a new parser using the memory management suite referred to
-#   by memsuite. If memsuite is NULL, then use the standard library memory
-#   suite. If namespaceSeparator is non-NULL it creates a parser with
-#   namespace processing as described above. The character pointed at
-#   will serve as the namespace separator.
-#
-#   All further memory operations used for the created parser will come from
-#   the given suite.
-#
-
-proc parserCreateMM*(encoding: cstring, memsuite: ptr TMemoryHandlingSuite, 
-                      namespaceSeparator: cstring): PParser{.cdecl, 
-    importc: "XML_ParserCreate_MM", dynlib: expatDll.}
-# Prepare a parser object to be re-used.  This is particularly
-#   valuable when memory allocation overhead is disproportionatly high,
-#   such as when a large number of small documnents need to be parsed.
-#   All handlers are cleared from the parser, except for the
-#   unknownEncodingHandler. The parser's external state is re-initialized
-#   except for the values of ns and ns_triplets.
-#
-#   Added in Expat 1.95.3.
-#
-
-proc parserReset*(parser: PParser, encoding: cstring): bool{.cdecl, 
-    importc: "XML_ParserReset", dynlib: expatDll.}
-# atts is array of name/value pairs, terminated by 0;
-#   names and values are 0 terminated.
-#
-
-type 
-  StartElementHandler* = proc (userData: pointer, name: cstring, 
-                                atts: cstringArray){.cdecl.}
-  EndElementHandler* = proc (userData: pointer, name: cstring){.cdecl.}
-{.deprecated: [TStartElementHandler: StartElementHandler,
-              TEndElementHandler: EndElementHandler].}
-# s is not 0 terminated. 
-
-type 
-  CharacterDataHandler* = proc (userData: pointer, s: cstring, len: cint){.
-      cdecl.}
-{.deprecated: [TCharacterDataHandler: CharacterDataHandler].}
-# target and data are 0 terminated 
-
-type 
-  ProcessingInstructionHandler* = proc (userData: pointer, target: cstring, 
-      data: cstring){.cdecl.}
-{.deprecated: [TProcessingInstructionHandler: ProcessingInstructionHandler].}
-
-# data is 0 terminated 
-
-type 
-  CommentHandler* = proc (userData: pointer, data: cstring){.cdecl.}
-  StartCdataSectionHandler* = proc (userData: pointer){.cdecl.}
-  EndCdataSectionHandler* = proc (userData: pointer){.cdecl.}
-{.deprecated: [TCommentHandler: CommentHandler,
-              TStartCdataSectionHandler: StartCdataSectionHandler,
-              TEndCdataSectionHandler: EndCdataSectionHandler].}
-# This is called for any characters in the XML document for which
-#   there is no applicable handler.  This includes both characters that
-#   are part of markup which is of a kind that is not reported
-#   (comments, markup declarations), or characters that are part of a
-#   construct which could be reported but for which no handler has been
-#   supplied. The characters are passed exactly as they were in the XML
-#   document except that they will be encoded in UTF-8 or UTF-16.
-#   Line boundaries are not normalized. Note that a byte order mark
-#   character is not passed to the default handler. There are no
-#   guarantees about how characters are divided between calls to the
-#   default handler: for example, a comment might be split between
-#   multiple calls.
-#
-
-type 
-  DefaultHandler* = proc (userData: pointer, s: cstring, len: cint){.cdecl.}
-{.deprecated: [TDefaultHandler: DefaultHandler].}
-# This is called for the start of the DOCTYPE declaration, before
-#   any DTD or internal subset is parsed.
-#
-
-type 
-  StartDoctypeDeclHandler* = proc (userData: pointer, doctypeName: cstring, 
-                                    sysid: cstring, pubid: cstring, 
-                                    hasInternalSubset: cint){.cdecl.}
-{.deprecated: [TStartDoctypeDeclHandler: StartDoctypeDeclHandler].}
-
-# This is called for the start of the DOCTYPE declaration when the
-#   closing > is encountered, but after processing any external
-#   subset.
-#
-
-type 
-  EndDoctypeDeclHandler* = proc (userData: pointer){.cdecl.}
-{.deprecated: [TEndDoctypeDeclHandler: EndDoctypeDeclHandler].}
-
-# This is called for entity declarations. The is_parameter_entity
-#   argument will be non-zero if the entity is a parameter entity, zero
-#   otherwise.
-#
-#   For internal entities (<!ENTITY foo "bar">), value will
-#   be non-NULL and systemId, publicID, and notationName will be NULL.
-#   The value string is NOT nul-terminated; the length is provided in
-#   the value_length argument. Since it is legal to have zero-length
-#   values, do not use this argument to test for internal entities.
-#
-#   For external entities, value will be NULL and systemId will be
-#   non-NULL. The publicId argument will be NULL unless a public
-#   identifier was provided. The notationName argument will have a
-#   non-NULL value only for unparsed entity declarations.
-#
-#   Note that is_parameter_entity can't be changed to XML_Bool, since
-#   that would break binary compatibility.
-#
-
-type 
-  EntityDeclHandler* = proc (userData: pointer, entityName: cstring, 
-                              isParameterEntity: cint, value: cstring, 
-                              valueLength: cint, base: cstring, 
-                              systemId: cstring, publicId: cstring, 
-                              notationName: cstring){.cdecl.}
-{.deprecated: [TEntityDeclHandler: EntityDeclHandler].}
-
-proc setEntityDeclHandler*(parser: PParser, handler: EntityDeclHandler){.cdecl, 
-    importc: "XML_SetEntityDeclHandler", dynlib: expatDll.}
-# OBSOLETE -- OBSOLETE -- OBSOLETE
-#   This handler has been superceded by the EntityDeclHandler above.
-#   It is provided here for backward compatibility.
-#
-#   This is called for a declaration of an unparsed (NDATA) entity.
-#   The base argument is whatever was set by XML_SetBase. The
-#   entityName, systemId and notationName arguments will never be
-#   NULL. The other arguments may be.
-#
-
-type 
-  UnparsedEntityDeclHandler* = proc (userData: pointer, entityName: cstring, 
-                                      base: cstring, systemId: cstring, 
-                                      publicId, notationName: cstring){.
-      cdecl.}
-{.deprecated: [TUnparsedEntityDeclHandler: UnparsedEntityDeclHandler].}
-
-# This is called for a declaration of notation.  The base argument is
-#   whatever was set by XML_SetBase. The notationName will never be
-#   NULL.  The other arguments can be.
-#
-
-type 
-  NotationDeclHandler* = proc (userData: pointer, notationName: cstring, 
-                                base: cstring, systemId: cstring, 
-                                publicId: cstring){.cdecl.}
-{.deprecated: [TNotationDeclHandler: NotationDeclHandler].}
-
-# When namespace processing is enabled, these are called once for
-#   each namespace declaration. The call to the start and end element
-#   handlers occur between the calls to the start and end namespace
-#   declaration handlers. For an xmlns attribute, prefix will be
-#   NULL.  For an xmlns="" attribute, uri will be NULL.
-#
-
-type 
-  StartNamespaceDeclHandler* = proc (userData: pointer, prefix: cstring, 
-                                      uri: cstring){.cdecl.}
-  EndNamespaceDeclHandler* = proc (userData: pointer, prefix: cstring){.cdecl.}
-{.deprecated: [TStartNamespaceDeclHandler: StartNamespaceDeclHandler,
-              TEndNamespaceDeclHandler: EndNamespaceDeclHandler].}
-# This is called if the document is not standalone, that is, it has an
-#   external subset or a reference to a parameter entity, but does not
-#   have standalone="yes". If this handler returns XML_STATUS_ERROR,
-#   then processing will not continue, and the parser will return a
-#   XML_ERROR_NOT_STANDALONE error.
-#   If parameter entity parsing is enabled, then in addition to the
-#   conditions above this handler will only be called if the referenced
-#   entity was actually read.
-#
-
-type 
-  NotStandaloneHandler* = proc (userData: pointer): cint{.cdecl.}
-{.deprecated: [TNotStandaloneHandler: NotStandaloneHandler].}
-
-# This is called for a reference to an external parsed general
-#   entity.  The referenced entity is not automatically parsed.  The
-#   application can parse it immediately or later using
-#   XML_ExternalEntityParserCreate.
-#
-#   The parser argument is the parser parsing the entity containing the
-#   reference; it can be passed as the parser argument to
-#   XML_ExternalEntityParserCreate.  The systemId argument is the
-#   system identifier as specified in the entity declaration; it will
-#   not be NULL.
-#
-#   The base argument is the system identifier that should be used as
-#   the base for resolving systemId if systemId was relative; this is
-#   set by XML_SetBase; it may be NULL.
-#
-#   The publicId argument is the public identifier as specified in the
-#   entity declaration, or NULL if none was specified; the whitespace
-#   in the public identifier will have been normalized as required by
-#   the XML spec.
-#
-#   The context argument specifies the parsing context in the format
-#   expected by the context argument to XML_ExternalEntityParserCreate;
-#   context is valid only until the handler returns, so if the
-#   referenced entity is to be parsed later, it must be copied.
-#   context is NULL only when the entity is a parameter entity.
-#
-#   The handler should return XML_STATUS_ERROR if processing should not
-#   continue because of a fatal error in the handling of the external
-#   entity.  In this case the calling parser will return an
-#   XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
-#
-#   Note that unlike other handlers the first argument is the parser,
-#   not userData.
-#
-
-type 
-  ExternalEntityRefHandler* = proc (parser: PParser, context: cstring, 
-                                     base: cstring, systemId: cstring, 
-                                     publicId: cstring): cint{.cdecl.}
-{.deprecated: [TExternalEntityRefHandler: ExternalEntityRefHandler].}
-# This is called in two situations:
-#   1) An entity reference is encountered for which no declaration
-#      has been read *and* this is not an error.
-#   2) An internal entity reference is read, but not expanded, because
-#      XML_SetDefaultHandler has been called.
-#   Note: skipped parameter entities in declarations and skipped general
-#         entities in attribute values cannot be reported, because
-#         the event would be out of sync with the reporting of the
-#         declarations or attribute values
-#
-
-type 
-  SkippedEntityHandler* = proc (userData: pointer, entityName: cstring, 
-                                 isParameterEntity: cint){.cdecl.}
-{.deprecated: [TSkippedEntityHandler: SkippedEntityHandler].}
-
-# This structure is filled in by the XML_UnknownEncodingHandler to
-#   provide information to the parser about encodings that are unknown
-#   to the parser.
-#
-#   The map[b] member gives information about byte sequences whose
-#   first byte is b.
-#
-#   If map[b] is c where c is >= 0, then b by itself encodes the
-#   Unicode scalar value c.
-#
-#   If map[b] is -1, then the byte sequence is malformed.
-#
-#   If map[b] is -n, where n >= 2, then b is the first byte of an
-#   n-byte sequence that encodes a single Unicode scalar value.
-#
-#   The data member will be passed as the first argument to the convert
-#   function.
-#
-#   The convert function is used to convert multibyte sequences; s will
-#   point to a n-byte sequence where map[(unsigned char)*s] == -n.  The
-#   convert function must return the Unicode scalar value represented
-#   by this byte sequence or -1 if the byte sequence is malformed.
-#
-#   The convert function may be NULL if the encoding is a single-byte
-#   encoding, that is if map[b] >= -1 for all bytes b.
-#
-#   When the parser is finished with the encoding, then if release is
-#   not NULL, it will call release passing it the data member; once
-#   release has been called, the convert function will not be called
-#   again.
-#
-#   Expat places certain restrictions on the encodings that are supported
-#   using this mechanism.
-#
-#   1. Every ASCII character that can appear in a well-formed XML document,
-#      other than the characters
-#
-#      $@\^`{}~
-#
-#      must be represented by a single byte, and that byte must be the
-#      same byte that represents that character in ASCII.
-#
-#   2. No character may require more than 4 bytes to encode.
-#
-#   3. All characters encoded must have Unicode scalar values <=
-#      0xFFFF, (i.e., characters that would be encoded by surrogates in
-#      UTF-16 are  not allowed).  Note that this restriction doesn't
-#      apply to the built-in support for UTF-8 and UTF-16.
-#
-#   4. No Unicode character may be encoded by more than one distinct
-#      sequence of bytes.
-#
-
-type 
-  Encoding*{.pure, final.} = object 
-    map*: array[0..256 - 1, cint]
-    data*: pointer
-    convert*: proc (data: pointer, s: cstring): cint{.cdecl.}
-    release*: proc (data: pointer){.cdecl.}
-{.deprecated: [TEncoding: Encoding].}
-
-
-# This is called for an encoding that is unknown to the parser.
-#
-#   The encodingHandlerData argument is that which was passed as the
-#   second argument to XML_SetUnknownEncodingHandler.
-#
-#   The name argument gives the name of the encoding as specified in
-#   the encoding declaration.
-#
-#   If the callback can provide information about the encoding, it must
-#   fill in the XML_Encoding structure, and return XML_STATUS_OK.
-#   Otherwise it must return XML_STATUS_ERROR.
-#
-#   If info does not describe a suitable encoding, then the parser will
-#   return an XML_UNKNOWN_ENCODING error.
-#
-
-type 
-  UnknownEncodingHandler* = proc (encodingHandlerData: pointer, name: cstring, 
-                                   info: ptr Encoding): cint{.cdecl.}
-{.deprecated: [TUnknownEncodingHandler: UnknownEncodingHandler].}
-
-proc setElementHandler*(parser: PParser, start: StartElementHandler, 
-                        endHandler: EndElementHandler){.cdecl, 
-    importc: "XML_SetElementHandler", dynlib: expatDll.}
-proc setStartElementHandler*(parser: PParser, handler: StartElementHandler){.
-    cdecl, importc: "XML_SetStartElementHandler", dynlib: expatDll.}
-proc setEndElementHandler*(parser: PParser, handler: EndElementHandler){.cdecl, 
-    importc: "XML_SetEndElementHandler", dynlib: expatDll.}
-proc setCharacterDataHandler*(parser: PParser, handler: CharacterDataHandler){.
-    cdecl, importc: "XML_SetCharacterDataHandler", dynlib: expatDll.}
-proc setProcessingInstructionHandler*(parser: PParser, 
-                                      handler: ProcessingInstructionHandler){.
-    cdecl, importc: "XML_SetProcessingInstructionHandler", dynlib: expatDll.}
-proc setCommentHandler*(parser: PParser, handler: CommentHandler){.cdecl, 
-    importc: "XML_SetCommentHandler", dynlib: expatDll.}
-proc setCdataSectionHandler*(parser: PParser, start: StartCdataSectionHandler, 
-                             endHandler: EndCdataSectionHandler){.cdecl, 
-    importc: "XML_SetCdataSectionHandler", dynlib: expatDll.}
-proc setStartCdataSectionHandler*(parser: PParser, 
-                                  start: StartCdataSectionHandler){.cdecl, 
-    importc: "XML_SetStartCdataSectionHandler", dynlib: expatDll.}
-proc setEndCdataSectionHandler*(parser: PParser, 
-                                endHandler: EndCdataSectionHandler){.cdecl, 
-    importc: "XML_SetEndCdataSectionHandler", dynlib: expatDll.}
-# This sets the default handler and also inhibits expansion of
-#   internal entities. These entity references will be passed to the
-#   default handler, or to the skipped entity handler, if one is set.
-#
-
-proc setDefaultHandler*(parser: PParser, handler: DefaultHandler){.cdecl, 
-    importc: "XML_SetDefaultHandler", dynlib: expatDll.}
-# This sets the default handler but does not inhibit expansion of
-#   internal entities.  The entity reference will not be passed to the
-#   default handler.
-#
-
-proc setDefaultHandlerExpand*(parser: PParser, handler: DefaultHandler){.cdecl, 
-    importc: "XML_SetDefaultHandlerExpand", dynlib: expatDll.}
-proc setDoctypeDeclHandler*(parser: PParser, start: StartDoctypeDeclHandler, 
-                            endHandler: EndDoctypeDeclHandler){.cdecl, 
-    importc: "XML_SetDoctypeDeclHandler", dynlib: expatDll.}
-proc setStartDoctypeDeclHandler*(parser: PParser, 
-                                 start: StartDoctypeDeclHandler){.cdecl, 
-    importc: "XML_SetStartDoctypeDeclHandler", dynlib: expatDll.}
-proc setEndDoctypeDeclHandler*(parser: PParser, 
-                               endHandler: EndDoctypeDeclHandler){.cdecl, 
-    importc: "XML_SetEndDoctypeDeclHandler", dynlib: expatDll.}
-proc setUnparsedEntityDeclHandler*(parser: PParser, 
-                                   handler: UnparsedEntityDeclHandler){.cdecl, 
-    importc: "XML_SetUnparsedEntityDeclHandler", dynlib: expatDll.}
-proc setNotationDeclHandler*(parser: PParser, handler: NotationDeclHandler){.
-    cdecl, importc: "XML_SetNotationDeclHandler", dynlib: expatDll.}
-proc setNamespaceDeclHandler*(parser: PParser, 
-                              start: StartNamespaceDeclHandler, 
-                              endHandler: EndNamespaceDeclHandler){.cdecl, 
-    importc: "XML_SetNamespaceDeclHandler", dynlib: expatDll.}
-proc setStartNamespaceDeclHandler*(parser: PParser, 
-                                   start: StartNamespaceDeclHandler){.cdecl, 
-    importc: "XML_SetStartNamespaceDeclHandler", dynlib: expatDll.}
-proc setEndNamespaceDeclHandler*(parser: PParser, 
-                                 endHandler: EndNamespaceDeclHandler){.cdecl, 
-    importc: "XML_SetEndNamespaceDeclHandler", dynlib: expatDll.}
-proc setNotStandaloneHandler*(parser: PParser, handler: NotStandaloneHandler){.
-    cdecl, importc: "XML_SetNotStandaloneHandler", dynlib: expatDll.}
-proc setExternalEntityRefHandler*(parser: PParser, 
-                                  handler: ExternalEntityRefHandler){.cdecl, 
-    importc: "XML_SetExternalEntityRefHandler", dynlib: expatDll.}
-# If a non-NULL value for arg is specified here, then it will be
-#   passed as the first argument to the external entity ref handler
-#   instead of the parser object.
-#
-
-proc setExternalEntityRefHandlerArg*(parser: PParser, arg: pointer){.cdecl, 
-    importc: "XML_SetExternalEntityRefHandlerArg", dynlib: expatDll.}
-proc setSkippedEntityHandler*(parser: PParser, handler: SkippedEntityHandler){.
-    cdecl, importc: "XML_SetSkippedEntityHandler", dynlib: expatDll.}
-proc setUnknownEncodingHandler*(parser: PParser, 
-                                handler: UnknownEncodingHandler, 
-                                encodingHandlerData: pointer){.cdecl, 
-    importc: "XML_SetUnknownEncodingHandler", dynlib: expatDll.}
-# This can be called within a handler for a start element, end
-#   element, processing instruction or character data.  It causes the
-#   corresponding markup to be passed to the default handler.
-#
-
-proc defaultCurrent*(parser: PParser){.cdecl, importc: "XML_DefaultCurrent", 
-                                       dynlib: expatDll.}
-# If do_nst is non-zero, and namespace processing is in effect, and
-#   a name has a prefix (i.e. an explicit namespace qualifier) then
-#   that name is returned as a triplet in a single string separated by
-#   the separator character specified when the parser was created: URI
-#   + sep + local_name + sep + prefix.
-#
-#   If do_nst is zero, then namespace information is returned in the
-#   default manner (URI + sep + local_name) whether or not the name
-#   has a prefix.
-#
-#   Note: Calling XML_SetReturnNSTriplet after XML_Parse or
-#     XML_ParseBuffer has no effect.
-#
-
-proc setReturnNSTriplet*(parser: PParser, doNst: cint){.cdecl, 
-    importc: "XML_SetReturnNSTriplet", dynlib: expatDll.}
-# This value is passed as the userData argument to callbacks. 
-
-proc setUserData*(parser: PParser, userData: pointer){.cdecl, 
-    importc: "XML_SetUserData", dynlib: expatDll.}
-# Returns the last value set by XML_SetUserData or NULL. 
-
-template getUserData*(parser: expr): expr = 
-  (cast[ptr pointer]((parser))[] )
-
-# This is equivalent to supplying an encoding argument to
-#   XML_ParserCreate. On success XML_SetEncoding returns non-zero,
-#   zero otherwise.
-#   Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
-#     has no effect and returns XML_STATUS_ERROR.
-#
-
-proc setEncoding*(parser: PParser, encoding: cstring): Status{.cdecl, 
-    importc: "XML_SetEncoding", dynlib: expatDll.}
-# If this function is called, then the parser will be passed as the
-#   first argument to callbacks instead of userData.  The userData will
-#   still be accessible using XML_GetUserData.
-#
-
-proc useParserAsHandlerArg*(parser: PParser){.cdecl, 
-    importc: "XML_UseParserAsHandlerArg", dynlib: expatDll.}
-# If useDTD == XML_TRUE is passed to this function, then the parser
-#   will assume that there is an external subset, even if none is
-#   specified in the document. In such a case the parser will call the
-#   externalEntityRefHandler with a value of NULL for the systemId
-#   argument (the publicId and context arguments will be NULL as well).
-#   Note: For the purpose of checking WFC: Entity Declared, passing
-#     useDTD == XML_TRUE will make the parser behave as if the document
-#     had a DTD with an external subset.
-#   Note: If this function is called, then this must be done before
-#     the first call to XML_Parse or XML_ParseBuffer, since it will
-#     have no effect after that.  Returns
-#     XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
-#   Note: If the document does not have a DOCTYPE declaration at all,
-#     then startDoctypeDeclHandler and endDoctypeDeclHandler will not
-#     be called, despite an external subset being parsed.
-#   Note: If XML_DTD is not defined when Expat is compiled, returns
-#     XML_ERROR_FEATURE_REQUIRES_XML_DTD.
-#
-
-proc useForeignDTD*(parser: PParser, useDTD: bool): Error{.cdecl, 
-    importc: "XML_UseForeignDTD", dynlib: expatDll.}
-# Sets the base to be used for resolving relative URIs in system
-#   identifiers in declarations.  Resolving relative identifiers is
-#   left to the application: this value will be passed through as the
-#   base argument to the XML_ExternalEntityRefHandler,
-#   XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
-#   argument will be copied.  Returns XML_STATUS_ERROR if out of memory,
-#   XML_STATUS_OK otherwise.
-#
-
-proc setBase*(parser: PParser, base: cstring): Status{.cdecl, 
-    importc: "XML_SetBase", dynlib: expatDll.}
-proc getBase*(parser: PParser): cstring{.cdecl, importc: "XML_GetBase", 
-    dynlib: expatDll.}
-# Returns the number of the attribute/value pairs passed in last call
-#   to the XML_StartElementHandler that were specified in the start-tag
-#   rather than defaulted. Each attribute/value pair counts as 2; thus
-#   this correspondds to an index into the atts array passed to the
-#   XML_StartElementHandler.
-#
-
-proc getSpecifiedAttributeCount*(parser: PParser): cint{.cdecl, 
-    importc: "XML_GetSpecifiedAttributeCount", dynlib: expatDll.}
-# Returns the index of the ID attribute passed in the last call to
-#   XML_StartElementHandler, or -1 if there is no ID attribute.  Each
-#   attribute/value pair counts as 2; thus this correspondds to an
-#   index into the atts array passed to the XML_StartElementHandler.
-#
-
-proc getIdAttributeIndex*(parser: PParser): cint{.cdecl, 
-    importc: "XML_GetIdAttributeIndex", dynlib: expatDll.}
-# Parses some input. Returns XML_STATUS_ERROR if a fatal error is
-#   detected.  The last call to XML_Parse must have isFinal true; len
-#   may be zero for this call (or any other).
-#
-#   Though the return values for these functions has always been
-#   described as a Boolean value, the implementation, at least for the
-#   1.95.x series, has always returned exactly one of the XML_Status
-#   values.
-#
-
-proc parse*(parser: PParser, s: cstring, len: cint, isFinal: cint): Status{.
-    cdecl, importc: "XML_Parse", dynlib: expatDll.}
-proc getBuffer*(parser: PParser, len: cint): pointer{.cdecl, 
-    importc: "XML_GetBuffer", dynlib: expatDll.}
-proc parseBuffer*(parser: PParser, len: cint, isFinal: cint): Status{.cdecl, 
-    importc: "XML_ParseBuffer", dynlib: expatDll.}
-# Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
-#   Must be called from within a call-back handler, except when aborting
-#   (resumable = 0) an already suspended parser. Some call-backs may
-#   still follow because they would otherwise get lost. Examples:
-#   - endElementHandler() for empty elements when stopped in
-#     startElementHandler(), 
-#   - endNameSpaceDeclHandler() when stopped in endElementHandler(), 
-#   and possibly others.
-#
-#   Can be called from most handlers, including DTD related call-backs,
-#   except when parsing an external parameter entity and resumable != 0.
-#   Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
-#   Possible error codes: 
-#   - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
-#   - XML_ERROR_FINISHED: when the parser has already finished.
-#   - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
-#
-#   When resumable != 0 (true) then parsing is suspended, that is, 
-#   XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. 
-#   Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
-#   return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
-#
-#   Note*:
-#   This will be applied to the current parser instance only, that is, if
-#   there is a parent parser then it will continue parsing when the
-#   externalEntityRefHandler() returns. It is up to the implementation of
-#   the externalEntityRefHandler() to call XML_StopParser() on the parent
-#   parser (recursively), if one wants to stop parsing altogether.
-#
-#   When suspended, parsing can be resumed by calling XML_ResumeParser(). 
-#
-
-proc stopParser*(parser: PParser, resumable: bool): Status{.cdecl, 
-    importc: "XML_StopParser", dynlib: expatDll.}
-# Resumes parsing after it has been suspended with XML_StopParser().
-#   Must not be called from within a handler call-back. Returns same
-#   status codes as XML_Parse() or XML_ParseBuffer().
-#   Additional error code XML_ERROR_NOT_SUSPENDED possible.   
-#
-#   Note*:
-#   This must be called on the most deeply nested child parser instance
-#   first, and on its parent parser only after the child parser has finished,
-#   to be applied recursively until the document entity's parser is restarted.
-#   That is, the parent parser will not resume by itself and it is up to the
-#   application to call XML_ResumeParser() on it at the appropriate moment.
-#
-
-proc resumeParser*(parser: PParser): Status{.cdecl, 
-    importc: "XML_ResumeParser", dynlib: expatDll.}
-type 
-  TParsing* = enum 
-    INITIALIZED, PARSING, FINISHED, SUSPENDED
-  ParsingStatus*{.pure, final.} = object 
-    parsing*: TParsing
-    finalBuffer*: bool
-{.deprecated: [#TParsing: Parsing, # Naming conflict if we drop the `T`
-              TParsingStatus: ParsingStatus].}
-
-# Returns status of parser with respect to being initialized, parsing,
-#   finished, or suspended and processing the final buffer.
-#   XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
-#   XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
-#
-
-proc getParsingStatus*(parser: PParser, status: ptr ParsingStatus){.cdecl, 
-    importc: "XML_GetParsingStatus", dynlib: expatDll.}
-# Creates an XML_Parser object that can parse an external general
-#   entity; context is a '\0'-terminated string specifying the parse
-#   context; encoding is a '\0'-terminated string giving the name of
-#   the externally specified encoding, or NULL if there is no
-#   externally specified encoding.  The context string consists of a
-#   sequence of tokens separated by formfeeds (\f); a token consisting
-#   of a name specifies that the general entity of the name is open; a
-#   token of the form prefix=uri specifies the namespace for a
-#   particular prefix; a token of the form =uri specifies the default
-#   namespace.  This can be called at any point after the first call to
-#   an ExternalEntityRefHandler so longer as the parser has not yet
-#   been freed.  The new parser is completely independent and may
-#   safely be used in a separate thread.  The handlers and userData are
-#   initialized from the parser argument.  Returns NULL if out of memory.
-#   Otherwise returns a new XML_Parser object.
-#
-
-proc externalEntityParserCreate*(parser: PParser, context: cstring, 
-                                 encoding: cstring): PParser{.cdecl, 
-    importc: "XML_ExternalEntityParserCreate", dynlib: expatDll.}
-type 
-  ParamEntityParsing* = enum 
-    PARAM_ENTITY_PARSING_NEVER, PARAM_ENTITY_PARSING_UNLESS_STANDALONE, 
-    PARAM_ENTITY_PARSING_ALWAYS
-{.deprecated: [TParamEntityParsing: ParamEntityParsing].}
-
-# Controls parsing of parameter entities (including the external DTD
-#   subset). If parsing of parameter entities is enabled, then
-#   references to external parameter entities (including the external
-#   DTD subset) will be passed to the handler set with
-#   XML_SetExternalEntityRefHandler.  The context passed will be 0.
-#
-#   Unlike external general entities, external parameter entities can
-#   only be parsed synchronously.  If the external parameter entity is
-#   to be parsed, it must be parsed during the call to the external
-#   entity ref handler: the complete sequence of
-#   XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
-#   XML_ParserFree calls must be made during this call.  After
-#   XML_ExternalEntityParserCreate has been called to create the parser
-#   for the external parameter entity (context must be 0 for this
-#   call), it is illegal to make any calls on the old parser until
-#   XML_ParserFree has been called on the newly created parser.
-#   If the library has been compiled without support for parameter
-#   entity parsing (ie without XML_DTD being defined), then
-#   XML_SetParamEntityParsing will return 0 if parsing of parameter
-#   entities is requested; otherwise it will return non-zero.
-#   Note: If XML_SetParamEntityParsing is called after XML_Parse or
-#      XML_ParseBuffer, then it has no effect and will always return 0.
-#
-
-proc setParamEntityParsing*(parser: PParser, parsing: ParamEntityParsing): cint{.
-    cdecl, importc: "XML_SetParamEntityParsing", dynlib: expatDll.}
-# If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
-#   XML_GetErrorCode returns information about the error.
-#
-
-proc getErrorCode*(parser: PParser): Error{.cdecl, importc: "XML_GetErrorCode", 
-    dynlib: expatDll.}
-# These functions return information about the current parse
-#   location.  They may be called from any callback called to report
-#   some parse event; in this case the location is the location of the
-#   first of the sequence of characters that generated the event.  When
-#   called from callbacks generated by declarations in the document
-#   prologue, the location identified isn't as neatly defined, but will
-#   be within the relevant markup.  When called outside of the callback
-#   functions, the position indicated will be just past the last parse
-#   event (regardless of whether there was an associated callback).
-#   
-#   They may also be called after returning from a call to XML_Parse
-#   or XML_ParseBuffer.  If the return value is XML_STATUS_ERROR then
-#   the location is the location of the character at which the error
-#   was detected; otherwise the location is the location of the last
-#   parse event, as described above.
-#
-
-proc getCurrentLineNumber*(parser: PParser): int{.cdecl, 
-    importc: "XML_GetCurrentLineNumber", dynlib: expatDll.}
-proc getCurrentColumnNumber*(parser: PParser): int{.cdecl, 
-    importc: "XML_GetCurrentColumnNumber", dynlib: expatDll.}
-proc getCurrentByteIndex*(parser: PParser): int{.cdecl, 
-    importc: "XML_GetCurrentByteIndex", dynlib: expatDll.}
-# Return the number of bytes in the current event.
-#   Returns 0 if the event is in an internal entity.
-#
-
-proc getCurrentByteCount*(parser: PParser): cint{.cdecl, 
-    importc: "XML_GetCurrentByteCount", dynlib: expatDll.}
-# If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
-#   the integer pointed to by offset to the offset within this buffer
-#   of the current parse position, and sets the integer pointed to by size
-#   to the size of this buffer (the number of input bytes). Otherwise
-#   returns a NULL pointer. Also returns a NULL pointer if a parse isn't
-#   active.
-#
-#   NOTE: The character pointer returned should not be used outside
-#   the handler that makes the call.
-#
-
-proc getInputContext*(parser: PParser, offset: ptr cint, size: ptr cint): cstring{.
-    cdecl, importc: "XML_GetInputContext", dynlib: expatDll.}
-# Frees the content model passed to the element declaration handler 
-
-proc freeContentModel*(parser: PParser, model: ptr Content){.cdecl, 
-    importc: "XML_FreeContentModel", dynlib: expatDll.}
-# Exposing the memory handling functions used in Expat 
-
-proc memMalloc*(parser: PParser, size: int): pointer{.cdecl, 
-    importc: "XML_MemMalloc", dynlib: expatDll.}
-proc memRealloc*(parser: PParser, p: pointer, size: int): pointer{.cdecl, 
-    importc: "XML_MemRealloc", dynlib: expatDll.}
-proc memFree*(parser: PParser, p: pointer){.cdecl, importc: "XML_MemFree", 
-    dynlib: expatDll.}
-# Frees memory used by the parser. 
-
-proc parserFree*(parser: PParser){.cdecl, importc: "XML_ParserFree", 
-                                   dynlib: expatDll.}
-# Returns a string describing the error. 
-
-proc errorString*(code: Error): cstring{.cdecl, importc: "XML_ErrorString", 
-    dynlib: expatDll.}
-# Return a string containing the version number of this expat 
-
-proc expatVersion*(): cstring{.cdecl, importc: "XML_ExpatVersion", 
-                               dynlib: expatDll.}
-type 
-  Expat_Version*{.pure, final.} = object 
-    major*: cint
-    minor*: cint
-    micro*: cint
-{.deprecated: [TExpat_Version: ExpatVersion].}
-
-# Return an XML_Expat_Version structure containing numeric version
-#   number information for this version of expat.
-#
-
-proc expatVersionInfo*(): ExpatVersion{.cdecl, 
-    importc: "XML_ExpatVersionInfo", dynlib: expatDll.}
-# Added in Expat 1.95.5. 
-
-type 
-  FeatureEnum* = enum 
-    FEATURE_END = 0, FEATURE_UNICODE, FEATURE_UNICODE_WCHAR_T, FEATURE_DTD, 
-    FEATURE_CONTEXT_BYTES, FEATURE_MIN_SIZE, FEATURE_SIZEOF_XML_CHAR, 
-    FEATURE_SIZEOF_XML_LCHAR, FEATURE_NS, FEATURE_LARGE_SIZE # Additional features must be added to the end of this enum. 
-  Feature*{.pure, final.} = object 
-    feature*: FeatureEnum
-    name*: cstring
-    value*: int
-{.deprecated: [TFeatureEnum: FeatureEnum, TFeature: Feature].}
-
-proc getFeatureList*(): ptr Feature{.cdecl, importc: "XML_GetFeatureList", 
-                                      dynlib: expatDll.}
-# Expat follows the GNU/Linux convention of odd number minor version for
-#   beta/development releases and even number minor version for stable
-#   releases. Micro is bumped with each release, and set to 0 with each
-#   change to major or minor version.
-#
-
-const 
-  MAJOR_VERSION* = 2
-  MINOR_VERSION* = 0
-  MICRO_VERSION* = 1
diff --git a/lib/wrappers/iup.nim b/lib/wrappers/iup.nim
index 93e14cccd..cbd9b5ae9 100644
--- a/lib/wrappers/iup.nim
+++ b/lib/wrappers/iup.nim
@@ -1,6 +1,12 @@
 #
-#    Binding for the IUP GUI toolkit
-#       (c) 2012 Andreas Rumpf
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2012 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 #    C header files translated by hand
 #    Licence of IUP follows:
 
diff --git a/lib/wrappers/joyent_http_parser.nim b/lib/wrappers/joyent_http_parser.nim
index 2fed392b9..f7412d2b8 100644
--- a/lib/wrappers/joyent_http_parser.nim
+++ b/lib/wrappers/joyent_http_parser.nim
@@ -1,6 +1,15 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 type
   csize = int
-  
+
   HttpDataProc* = proc (a2: ptr HttpParser, at: cstring, length: csize): cint {.cdecl.}
   HttpProc* = proc (a2: ptr HttpParser): cint {.cdecl.}
 
diff --git a/lib/wrappers/libcurl.nim b/lib/wrappers/libcurl.nim
deleted file mode 100644
index 924879e75..000000000
--- a/lib/wrappers/libcurl.nim
+++ /dev/null
@@ -1,512 +0,0 @@
-#
-#    $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $
-#    This file is part of the Free Pascal packages
-#    Copyright (c) 1999-2000 by the Free Pascal development team
-#
-#    See the file COPYING.FPC, included in this distribution,
-#    for details about the copyright.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# **********************************************************************
-#
-#   the curl library is governed by its own copyright, see the curl
-#   website for this. 
-# 
-
-{.deadCodeElim: on.}
-
-import 
-  times
-
-when defined(windows): 
-  const 
-    libname = "libcurl.dll"
-elif defined(macosx): 
-  const 
-    libname = "libcurl-7.19.3.dylib"
-elif defined(unix): 
-  const 
-    libname = "libcurl.so.4"
-type 
-  Pcalloc_callback* = ptr Calloc_callback
-  Pclosepolicy* = ptr Closepolicy
-  Pforms* = ptr Forms
-  Pftpauth* = ptr Ftpauth
-  Pftpmethod* = ptr Ftpmethod
-  Pftpssl* = ptr Ftpssl
-  PHTTP_VERSION* = ptr HTTP_VERSION
-  Phttppost* = ptr Httppost
-  PPcurl_httppost* = ptr Phttppost
-  Pinfotype* = ptr Infotype
-  Plock_access* = ptr Lock_access
-  Plock_data* = ptr Lock_data
-  Pmalloc_callback* = ptr Malloc_callback
-  PNETRC_OPTION* = ptr NETRC_OPTION
-  Pproxytype* = ptr Proxytype
-  Prealloc_callback* = ptr Realloc_callback
-  Pslist* = ptr Slist
-  Psocket* = ptr Socket
-  PSSL_VERSION* = ptr SSL_VERSION
-  Pstrdup_callback* = ptr Strdup_callback
-  PTIMECOND* = ptr TIMECOND
-  Pversion_info_data* = ptr Version_info_data
-  Pcode* = ptr Code
-  PFORMcode* = ptr FORMcode
-  Pformoption* = ptr Formoption
-  PINFO* = ptr INFO
-  Piocmd* = ptr Iocmd
-  Pioerr* = ptr Ioerr
-  PM* = ptr M
-  PMcode* = ptr Mcode
-  PMoption* = ptr Moption
-  PMSG* = ptr MSG
-  Poption* = ptr Option
-  PSH* = ptr SH
-  PSHcode* = ptr SHcode
-  PSHoption* = ptr SHoption
-  Pversion* = ptr Version
-  Pfd_set* = pointer
-  PCurl* = ptr Curl
-  Curl* = pointer
-  Httppost*{.final, pure.} = object 
-    next*: Phttppost
-    name*: cstring
-    namelength*: int32
-    contents*: cstring
-    contentslength*: int32
-    buffer*: cstring
-    bufferlength*: int32
-    contenttype*: cstring
-    contentheader*: Pslist
-    more*: Phttppost
-    flags*: int32
-    showfilename*: cstring
-
-  Progress_callback* = proc (clientp: pointer, dltotal: float64, 
-                              dlnow: float64, ultotal: float64, 
-                              ulnow: float64): int32 {.cdecl.}
-  Write_callback* = proc (buffer: cstring, size: int, nitems: int, 
-                           outstream: pointer): int{.cdecl.}
-  Read_callback* = proc (buffer: cstring, size: int, nitems: int, 
-                          instream: pointer): int{.cdecl.}
-  Passwd_callback* = proc (clientp: pointer, prompt: cstring, buffer: cstring, 
-                            buflen: int32): int32{.cdecl.}
-  Ioerr* = enum 
-    IOE_OK, IOE_UNKNOWNCMD, IOE_FAILRESTART, IOE_LAST
-  Iocmd* = enum 
-    IOCMD_NOP, IOCMD_RESTARTREAD, IOCMD_LAST
-  Ioctl_callback* = proc (handle: PCurl, cmd: int32, clientp: pointer): Ioerr{.
-      cdecl.}
-  Malloc_callback* = proc (size: int): pointer{.cdecl.}
-  Free_callback* = proc (p: pointer){.cdecl.}
-  Realloc_callback* = proc (p: pointer, size: int): pointer{.cdecl.}
-  Strdup_callback* = proc (str: cstring): cstring{.cdecl.}
-  Calloc_callback* = proc (nmemb: int, size: int): pointer{.noconv.}
-  Infotype* = enum 
-    INFO_TEXT = 0, INFO_HEADER_IN, INFO_HEADER_OUT, INFO_DATA_IN, INFO_DATA_OUT, 
-    INFO_SSL_DATA_IN, INFO_SSL_DATA_OUT, INFO_END
-  Debug_callback* = proc (handle: PCurl, theType: Infotype, data: cstring, 
-                           size: int, userptr: pointer): int32{.cdecl.}
-  Code* = enum 
-    E_OK = 0, E_UNSUPPORTED_PROTOCOL, E_FAILED_INIT, E_URL_MALFORMAT, 
-    E_URL_MALFORMAT_USER, E_COULDNT_RESOLVE_PROXY, E_COULDNT_RESOLVE_HOST, 
-    E_COULDNT_CONNECT, E_FTP_WEIRD_SERVER_REPLY, E_FTP_ACCESS_DENIED, 
-    E_FTP_USER_PASSWORD_INCORRECT, E_FTP_WEIRD_PASS_REPLY, 
-    E_FTP_WEIRD_USER_REPLY, E_FTP_WEIRD_PASV_REPLY, E_FTP_WEIRD_227_FORMAT, 
-    E_FTP_CANT_GET_HOST, E_FTP_CANT_RECONNECT, E_FTP_COULDNT_SET_BINARY, 
-    E_PARTIAL_FILE, E_FTP_COULDNT_RETR_FILE, E_FTP_WRITE_ERROR, 
-    E_FTP_QUOTE_ERROR, E_HTTP_RETURNED_ERROR, E_WRITE_ERROR, E_MALFORMAT_USER, 
-    E_FTP_COULDNT_STOR_FILE, E_READ_ERROR, E_OUT_OF_MEMORY, 
-    E_OPERATION_TIMEOUTED, E_FTP_COULDNT_SET_ASCII, E_FTP_PORT_FAILED, 
-    E_FTP_COULDNT_USE_REST, E_FTP_COULDNT_GET_SIZE, E_HTTP_RANGE_ERROR, 
-    E_HTTP_POST_ERROR, E_SSL_CONNECT_ERROR, E_BAD_DOWNLOAD_RESUME, 
-    E_FILE_COULDNT_READ_FILE, E_LDAP_CANNOT_BIND, E_LDAP_SEARCH_FAILED, 
-    E_LIBRARY_NOT_FOUND, E_FUNCTION_NOT_FOUND, E_ABORTED_BY_CALLBACK, 
-    E_BAD_FUNCTION_ARGUMENT, E_BAD_CALLING_ORDER, E_INTERFACE_FAILED, 
-    E_BAD_PASSWORD_ENTERED, E_TOO_MANY_REDIRECTS, E_UNKNOWN_TELNET_OPTION, 
-    E_TELNET_OPTION_SYNTAX, E_OBSOLETE, E_SSL_PEER_CERTIFICATE, E_GOT_NOTHING, 
-    E_SSL_ENGINE_NOTFOUND, E_SSL_ENGINE_SETFAILED, E_SEND_ERROR, E_RECV_ERROR, 
-    E_SHARE_IN_USE, E_SSL_CERTPROBLEM, E_SSL_CIPHER, E_SSL_CACERT, 
-    E_BAD_CONTENT_ENCODING, E_LDAP_INVALID_URL, E_FILESIZE_EXCEEDED, 
-    E_FTP_SSL_FAILED, E_SEND_FAIL_REWIND, E_SSL_ENGINE_INITFAILED, 
-    E_LOGIN_DENIED, E_TFTP_NOTFOUND, E_TFTP_PERM, E_TFTP_DISKFULL, 
-    E_TFTP_ILLEGAL, E_TFTP_UNKNOWNID, E_TFTP_EXISTS, E_TFTP_NOSUCHUSER, 
-    E_CONV_FAILED, E_CONV_REQD, LAST
-  Conv_callback* = proc (buffer: cstring, len: int): Code{.cdecl.}
-  Ssl_ctx_callback* = proc (curl: PCurl, ssl_ctx, userptr: pointer): Code{.cdecl.}
-  Proxytype* = enum 
-    PROXY_HTTP = 0, PROXY_SOCKS4 = 4, PROXY_SOCKS5 = 5
-  Ftpssl* = enum 
-    FTPSSL_NONE, FTPSSL_TRY, FTPSSL_CONTROL, FTPSSL_ALL, FTPSSL_LAST
-  Ftpauth* = enum 
-    FTPAUTH_DEFAULT, FTPAUTH_SSL, FTPAUTH_TLS, FTPAUTH_LAST
-  Ftpmethod* = enum 
-    FTPMETHOD_DEFAULT, FTPMETHOD_MULTICWD, FTPMETHOD_NOCWD, FTPMETHOD_SINGLECWD, 
-    FTPMETHOD_LAST
-  Option* = enum 
-    OPT_PORT = 0 + 3, OPT_TIMEOUT = 0 + 13, OPT_INFILESIZE = 0 + 14, 
-    OPT_LOW_SPEED_LIMIT = 0 + 19, OPT_LOW_SPEED_TIME = 0 + 20, 
-    OPT_RESUME_FROM = 0 + 21, OPT_CRLF = 0 + 27, OPT_SSLVERSION = 0 + 32, 
-    OPT_TIMECONDITION = 0 + 33, OPT_TIMEVALUE = 0 + 34, OPT_VERBOSE = 0 + 41, 
-    OPT_HEADER = 0 + 42, OPT_NOPROGRESS = 0 + 43, OPT_NOBODY = 0 + 44, 
-    OPT_FAILONERROR = 0 + 45, OPT_UPLOAD = 0 + 46, OPT_POST = 0 + 47, 
-    OPT_FTPLISTONLY = 0 + 48, OPT_FTPAPPEND = 0 + 50, OPT_NETRC = 0 + 51, 
-    OPT_FOLLOWLOCATION = 0 + 52, OPT_TRANSFERTEXT = 0 + 53, OPT_PUT = 0 + 54, 
-    OPT_AUTOREFERER = 0 + 58, OPT_PROXYPORT = 0 + 59, 
-    OPT_POSTFIELDSIZE = 0 + 60, OPT_HTTPPROXYTUNNEL = 0 + 61, 
-    OPT_SSL_VERIFYPEER = 0 + 64, OPT_MAXREDIRS = 0 + 68, OPT_FILETIME = 0 + 69, 
-    OPT_MAXCONNECTS = 0 + 71, OPT_CLOSEPOLICY = 0 + 72, 
-    OPT_FRESH_CONNECT = 0 + 74, OPT_FORBID_REUSE = 0 + 75, 
-    OPT_CONNECTTIMEOUT = 0 + 78, OPT_HTTPGET = 0 + 80, 
-    OPT_SSL_VERIFYHOST = 0 + 81, OPT_HTTP_VERSION = 0 + 84, 
-    OPT_FTP_USE_EPSV = 0 + 85, OPT_SSLENGINE_DEFAULT = 0 + 90, 
-    OPT_DNS_USE_GLOBAL_CACHE = 0 + 91, OPT_DNS_CACHE_TIMEOUT = 0 + 92, 
-    OPT_COOKIESESSION = 0 + 96, OPT_BUFFERSIZE = 0 + 98, OPT_NOSIGNAL = 0 + 99, 
-    OPT_PROXYTYPE = 0 + 101, OPT_UNRESTRICTED_AUTH = 0 + 105, 
-    OPT_FTP_USE_EPRT = 0 + 106, OPT_HTTPAUTH = 0 + 107, 
-    OPT_FTP_CREATE_MISSING_DIRS = 0 + 110, OPT_PROXYAUTH = 0 + 111, 
-    OPT_FTP_RESPONSE_TIMEOUT = 0 + 112, OPT_IPRESOLVE = 0 + 113, 
-    OPT_MAXFILESIZE = 0 + 114, OPT_FTP_SSL = 0 + 119, OPT_TCP_NODELAY = 0 + 121, 
-    OPT_FTPSSLAUTH = 0 + 129, OPT_IGNORE_CONTENT_LENGTH = 0 + 136, 
-    OPT_FTP_SKIP_PASV_IP = 0 + 137, OPT_FTP_FILEMETHOD = 0 + 138, 
-    OPT_LOCALPORT = 0 + 139, OPT_LOCALPORTRANGE = 0 + 140, 
-    OPT_CONNECT_ONLY = 0 + 141, OPT_FILE = 10000 + 1, OPT_URL = 10000 + 2, 
-    OPT_PROXY = 10000 + 4, OPT_USERPWD = 10000 + 5, 
-    OPT_PROXYUSERPWD = 10000 + 6, OPT_RANGE = 10000 + 7, OPT_INFILE = 10000 + 9, 
-    OPT_ERRORBUFFER = 10000 + 10, OPT_POSTFIELDS = 10000 + 15, 
-    OPT_REFERER = 10000 + 16, OPT_FTPPORT = 10000 + 17, 
-    OPT_USERAGENT = 10000 + 18, OPT_COOKIE = 10000 + 22, 
-    OPT_HTTPHEADER = 10000 + 23, OPT_HTTPPOST = 10000 + 24, 
-    OPT_SSLCERT = 10000 + 25, OPT_SSLCERTPASSWD = 10000 + 26, 
-    OPT_QUOTE = 10000 + 28, OPT_WRITEHEADER = 10000 + 29, 
-    OPT_COOKIEFILE = 10000 + 31, OPT_CUSTOMREQUEST = 10000 + 36, 
-    OPT_STDERR = 10000 + 37, OPT_POSTQUOTE = 10000 + 39, 
-    OPT_WRITEINFO = 10000 + 40, OPT_PROGRESSDATA = 10000 + 57, 
-    OPT_INTERFACE = 10000 + 62, OPT_KRB4LEVEL = 10000 + 63, 
-    OPT_CAINFO = 10000 + 65, OPT_TELNETOPTIONS = 10000 + 70, 
-    OPT_RANDOM_FILE = 10000 + 76, OPT_EGDSOCKET = 10000 + 77, 
-    OPT_COOKIEJAR = 10000 + 82, OPT_SSL_CIPHER_LIST = 10000 + 83, 
-    OPT_SSLCERTTYPE = 10000 + 86, OPT_SSLKEY = 10000 + 87, 
-    OPT_SSLKEYTYPE = 10000 + 88, OPT_SSLENGINE = 10000 + 89, 
-    OPT_PREQUOTE = 10000 + 93, OPT_DEBUGDATA = 10000 + 95, 
-    OPT_CAPATH = 10000 + 97, OPT_SHARE = 10000 + 100, 
-    OPT_ENCODING = 10000 + 102, OPT_PRIVATE = 10000 + 103, 
-    OPT_HTTP200ALIASES = 10000 + 104, OPT_SSL_CTX_DATA = 10000 + 109, 
-    OPT_NETRC_FILE = 10000 + 118, OPT_SOURCE_USERPWD = 10000 + 123, 
-    OPT_SOURCE_PREQUOTE = 10000 + 127, OPT_SOURCE_POSTQUOTE = 10000 + 128, 
-    OPT_IOCTLDATA = 10000 + 131, OPT_SOURCE_URL = 10000 + 132, 
-    OPT_SOURCE_QUOTE = 10000 + 133, OPT_FTP_ACCOUNT = 10000 + 134, 
-    OPT_COOKIELIST = 10000 + 135, OPT_FTP_ALTERNATIVE_TO_USER = 10000 + 147, 
-    OPT_LASTENTRY = 10000 + 148, OPT_WRITEFUNCTION = 20000 + 11, 
-    OPT_READFUNCTION = 20000 + 12, OPT_PROGRESSFUNCTION = 20000 + 56, 
-    OPT_HEADERFUNCTION = 20000 + 79, OPT_DEBUGFUNCTION = 20000 + 94, 
-    OPT_SSL_CTX_FUNCTION = 20000 + 108, OPT_IOCTLFUNCTION = 20000 + 130, 
-    OPT_CONV_FROM_NETWORK_FUNCTION = 20000 + 142, 
-    OPT_CONV_TO_NETWORK_FUNCTION = 20000 + 143, 
-    OPT_CONV_FROM_UTF8_FUNCTION = 20000 + 144, 
-    OPT_INFILESIZE_LARGE = 30000 + 115, OPT_RESUME_FROM_LARGE = 30000 + 116, 
-    OPT_MAXFILESIZE_LARGE = 30000 + 117, OPT_POSTFIELDSIZE_LARGE = 30000 + 120, 
-    OPT_MAX_SEND_SPEED_LARGE = 30000 + 145, 
-    OPT_MAX_RECV_SPEED_LARGE = 30000 + 146
-  HTTP_VERSION* = enum 
-    HTTP_VERSION_NONE, HTTP_VERSION_1_0, HTTP_VERSION_1_1, HTTP_VERSION_LAST
-  NETRC_OPTION* = enum 
-    NETRC_IGNORED, NETRC_OPTIONAL, NETRC_REQUIRED, NETRC_LAST
-  SSL_VERSION* = enum 
-    SSLVERSION_DEFAULT, SSLVERSION_TLSv1, SSLVERSION_SSLv2, SSLVERSION_SSLv3, 
-    SSLVERSION_LAST
-  TIMECOND* = enum 
-    TIMECOND_NONE, TIMECOND_IFMODSINCE, TIMECOND_IFUNMODSINCE, TIMECOND_LASTMOD, 
-    TIMECOND_LAST
-  Formoption* = enum 
-    FORM_NOTHING, FORM_COPYNAME, FORM_PTRNAME, FORM_NAMELENGTH, 
-    FORM_COPYCONTENTS, FORM_PTRCONTENTS, FORM_CONTENTSLENGTH, FORM_FILECONTENT, 
-    FORM_ARRAY, FORM_OBSOLETE, FORM_FILE, FORM_BUFFER, FORM_BUFFERPTR, 
-    FORM_BUFFERLENGTH, FORM_CONTENTTYPE, FORM_CONTENTHEADER, FORM_FILENAME, 
-    FORM_END, FORM_OBSOLETE2, FORM_LASTENTRY
-  Forms*{.pure, final.} = object 
-    option*: Formoption
-    value*: cstring
-
-  FORMcode* = enum 
-    FORMADD_OK, FORMADD_MEMORY, FORMADD_OPTION_TWICE, FORMADD_NULL, 
-    FORMADD_UNKNOWN_OPTION, FORMADD_INCOMPLETE, FORMADD_ILLEGAL_ARRAY, 
-    FORMADD_DISABLED, FORMADD_LAST
-  Formget_callback* = proc (arg: pointer, buf: cstring, length: int): int{.
-      cdecl.}
-  Slist*{.pure, final.} = object 
-    data*: cstring
-    next*: Pslist
-
-  INFO* = enum 
-    INFO_NONE = 0, INFO_LASTONE = 30, INFO_EFFECTIVE_URL = 0x00100000 + 1, 
-    INFO_CONTENT_TYPE = 0x00100000 + 18, INFO_PRIVATE = 0x00100000 + 21, 
-    INFO_FTP_ENTRY_PATH = 0x00100000 + 30, INFO_RESPONSE_CODE = 0x00200000 + 2, 
-    INFO_HEADER_SIZE = 0x00200000 + 11, INFO_REQUEST_SIZE = 0x00200000 + 12, 
-    INFO_SSL_VERIFYRESULT = 0x00200000 + 13, INFO_FILETIME = 0x00200000 + 14, 
-    INFO_REDIRECT_COUNT = 0x00200000 + 20, 
-    INFO_HTTP_CONNECTCODE = 0x00200000 + 22, 
-    INFO_HTTPAUTH_AVAIL = 0x00200000 + 23, 
-    INFO_PROXYAUTH_AVAIL = 0x00200000 + 24, INFO_OS_ERRNO = 0x00200000 + 25, 
-    INFO_NUM_CONNECTS = 0x00200000 + 26, INFO_LASTSOCKET = 0x00200000 + 29, 
-    INFO_TOTAL_TIME = 0x00300000 + 3, INFO_NAMELOOKUP_TIME = 0x00300000 + 4, 
-    INFO_CONNECT_TIME = 0x00300000 + 5, INFO_PRETRANSFER_TIME = 0x00300000 + 6, 
-    INFO_SIZE_UPLOAD = 0x00300000 + 7, INFO_SIZE_DOWNLOAD = 0x00300000 + 8, 
-    INFO_SPEED_DOWNLOAD = 0x00300000 + 9, INFO_SPEED_UPLOAD = 0x00300000 + 10, 
-    INFO_CONTENT_LENGTH_DOWNLOAD = 0x00300000 + 15, 
-    INFO_CONTENT_LENGTH_UPLOAD = 0x00300000 + 16, 
-    INFO_STARTTRANSFER_TIME = 0x00300000 + 17, 
-    INFO_REDIRECT_TIME = 0x00300000 + 19, INFO_SSL_ENGINES = 0x00400000 + 27, 
-    INFO_COOKIELIST = 0x00400000 + 28
-  Closepolicy* = enum 
-    CLOSEPOLICY_NONE, CLOSEPOLICY_OLDEST, CLOSEPOLICY_LEAST_RECENTLY_USED, 
-    CLOSEPOLICY_LEAST_TRAFFIC, CLOSEPOLICY_SLOWEST, CLOSEPOLICY_CALLBACK, 
-    CLOSEPOLICY_LAST
-  Lock_data* = enum 
-    LOCK_DATA_NONE = 0, LOCK_DATA_SHARE, LOCK_DATA_COOKIE, LOCK_DATA_DNS, 
-    LOCK_DATA_SSL_SESSION, LOCK_DATA_CONNECT, LOCK_DATA_LAST
-  Lock_access* = enum 
-    LOCK_ACCESS_NONE = 0, LOCK_ACCESS_SHARED = 1, LOCK_ACCESS_SINGLE = 2, 
-    LOCK_ACCESS_LAST
-  Lock_function* = proc (handle: PCurl, data: Lock_data,
-                          locktype: Lock_access, 
-                          userptr: pointer){.cdecl.}
-  Unlock_function* = proc (handle: PCurl, data: Lock_data, userptr: pointer){.
-      cdecl.}
-  SH* = pointer
-  SHcode* = enum 
-    SHE_OK, SHE_BAD_OPTION, SHE_IN_USE, SHE_INVALID, SHE_NOMEM, SHE_LAST
-  SHoption* = enum 
-    SHOPT_NONE, SHOPT_SHARE, SHOPT_UNSHARE, SHOPT_LOCKFUNC, SHOPT_UNLOCKFUNC, 
-    SHOPT_USERDATA, SHOPT_LAST
-  Version* = enum 
-    VERSION_FIRST, VERSION_SECOND, VERSION_THIRD, VERSION_LAST
-  Version_info_data*{.pure, final.} = object 
-    age*: Version
-    version*: cstring
-    version_num*: int32
-    host*: cstring
-    features*: int32
-    ssl_version*: cstring
-    ssl_version_num*: int32
-    libz_version*: cstring
-    protocols*: cstringArray
-    ares*: cstring
-    ares_num*: int32
-    libidn*: cstring
-    iconv_ver_num*: int32
-
-  M* = pointer
-  Socket* = int32
-  Mcode* = enum 
-    M_CALL_MULTI_PERFORM = - 1, M_OK = 0, M_BAD_HANDLE, M_BAD_EASY_HANDLE, 
-    M_OUT_OF_MEMORY, M_INTERNAL_ERROR, M_BAD_SOCKET, M_UNKNOWN_OPTION, M_LAST
-  MSGEnum* = enum 
-    MSG_NONE, MSG_DONE, MSG_LAST
-  Msg*{.pure, final.} = object 
-    msg*: MSGEnum
-    easy_handle*: PCurl
-    whatever*: pointer        #data : record
-                              #      case longint of
-                              #        0 : ( whatever : pointer );
-                              #        1 : ( result : CURLcode );
-                              #    end;
-  
-  Socket_callback* = proc (easy: PCurl, s: Socket, what: int32, 
-                            userp, socketp: pointer): int32{.cdecl.}
-  Moption* = enum 
-    MOPT_SOCKETDATA = 10000 + 2, MOPT_LASTENTRY = 10000 + 3, 
-    MOPT_SOCKETFUNCTION = 20000 + 1
-{.deprecated: [TMsg: Msg, TCurl: Curl, Thttppost: Httppost,
-    Tprogress_callback: Progress_callback, Twrite_callback: Write_callback,
-    Tread_callback: Read_callback, Tpasswd_callback: Passwd_callback, Tioerr: Ioerr,
-    Tiocmd: Iocmd, Tioctl_callback: Ioctl_callback, Tmalloc_callback: Malloc_callback,
-    Tfree_callback: Free_callback, Trealloc_callback: Realloc_callback,
-    Tstrdup_callback: Strdup_callback, Tcalloc_callback: Calloc_callback,
-    Tinfotype: Infotype, Tdebug_callback: Debug_callback, Tcode: Code,
-    Tconv_callback: Conv_callback, Tssl_ctx_callback: Ssl_ctx_callback,
-    Tproxytype: Proxytype, Tftpssl: Ftpssl, Tftpauth: Ftpauth, Tftpmethod: Ftpmethod,
-    Toption: Option, THTTP_VERSION: HTTP_VERSION, TNETRC_OPTION: NETRC_OPTION,
-    TSSL_VERSION: SSL_VERSION, TTIMECOND: TIMECOND, Tformoption: Formoption,
-    Tforms: Forms, TFORMcode: FORMcode, Tformget_callback: Formget_callback,
-    Tslist: Slist, TINFO: INFO, Tclosepolicy: Closepolicy, Tlock_data: Lock_data,
-    Tlock_access: Lock_access, Tlock_function: Lock_function,
-    Tunlock_function: Unlock_function, TSH: Sh, TSHcode: SHcode, TSHoption: SHoption,
-    Tversion: Version, Tversion_info_data: Version_info_data, TM: M, Tsocket: Socket,
-    TMcode: Mcode, TMSGEnum: MsGEnum, Tsocket_callback: Socket_callback,
-    TMoption: Moption].}
-
-const 
-  OPT_SSLKEYPASSWD* = OPT_SSLCERTPASSWD
-  AUTH_ANY* = not (0)
-  AUTH_BASIC* = 1 shl 0
-  AUTH_ANYSAFE* = not (AUTH_BASIC)
-  AUTH_DIGEST* = 1 shl 1
-  AUTH_GSSNEGOTIATE* = 1 shl 2
-  AUTH_NONE* = 0
-  AUTH_NTLM* = 1 shl 3
-  E_ALREADY_COMPLETE* = 99999
-  E_FTP_BAD_DOWNLOAD_RESUME* = E_BAD_DOWNLOAD_RESUME
-  E_FTP_PARTIAL_FILE* = E_PARTIAL_FILE
-  E_HTTP_NOT_FOUND* = E_HTTP_RETURNED_ERROR
-  E_HTTP_PORT_FAILED* = E_INTERFACE_FAILED
-  E_OPERATION_TIMEDOUT* = E_OPERATION_TIMEOUTED
-  ERROR_SIZE* = 256
-  FORMAT_OFF_T* = "%ld"
-  GLOBAL_NOTHING* = 0
-  GLOBAL_SSL* = 1 shl 0
-  GLOBAL_WIN32* = 1 shl 1
-  GLOBAL_ALL* = GLOBAL_SSL or GLOBAL_WIN32
-  GLOBAL_DEFAULT* = GLOBAL_ALL
-  INFO_DOUBLE* = 0x00300000
-  INFO_HTTP_CODE* = INFO_RESPONSE_CODE
-  INFO_LONG* = 0x00200000
-  INFO_MASK* = 0x000FFFFF
-  INFO_SLIST* = 0x00400000
-  INFO_STRING* = 0x00100000
-  INFO_TYPEMASK* = 0x00F00000
-  IPRESOLVE_V4* = 1
-  IPRESOLVE_V6* = 2
-  IPRESOLVE_WHATEVER* = 0
-  MAX_WRITE_SIZE* = 16384
-  M_CALL_MULTI_SOCKET* = M_CALL_MULTI_PERFORM
-  OPT_CLOSEFUNCTION* = - (5)
-  OPT_FTPASCII* = OPT_TRANSFERTEXT
-  OPT_HEADERDATA* = OPT_WRITEHEADER
-  OPT_HTTPREQUEST* = - (1)
-  OPT_MUTE* = - (2)
-  OPT_PASSWDDATA* = - (4)
-  OPT_PASSWDFUNCTION* = - (3)
-  OPT_PASV_HOST* = - (9)
-  OPT_READDATA* = OPT_INFILE
-  OPT_SOURCE_HOST* = - (6)
-  OPT_SOURCE_PATH* = - (7)
-  OPT_SOURCE_PORT* = - (8)
-  OPTTYPE_FUNCTIONPOINT* = 20000
-  OPTTYPE_LONG* = 0
-  OPTTYPE_OBJECTPOINT* = 10000
-  OPTTYPE_OFF_T* = 30000
-  OPT_WRITEDATA* = OPT_FILE
-  POLL_IN* = 1
-  POLL_INOUT* = 3
-  POLL_NONE* = 0
-  POLL_OUT* = 2
-  POLL_REMOVE* = 4
-  READFUNC_ABORT* = 0x10000000
-  SOCKET_BAD* = - (1)
-  SOCKET_TIMEOUT* = SOCKET_BAD
-  VERSION_ASYNCHDNS* = 1 shl 7
-  VERSION_CONV* = 1 shl 12
-  VERSION_DEBUG* = 1 shl 6
-  VERSION_GSSNEGOTIATE* = 1 shl 5
-  VERSION_IDN* = 1 shl 10
-  VERSION_IPV6* = 1 shl 0
-  VERSION_KERBEROS4* = 1 shl 1
-  VERSION_LARGEFILE* = 1 shl 9
-  VERSION_LIBZ* = 1 shl 3
-  VERSION_NOW* = VERSION_THIRD
-  VERSION_NTLM* = 1 shl 4
-  VERSION_SPNEGO* = 1 shl 8
-  VERSION_SSL* = 1 shl 2
-  VERSION_SSPI* = 1 shl 11
-  FILE_OFFSET_BITS* = 0
-  FILESIZEBITS* = 0
-  FUNCTIONPOINT* = OPTTYPE_FUNCTIONPOINT
-  HTTPPOST_BUFFER* = 1 shl 4
-  HTTPPOST_FILENAME* = 1 shl 0
-  HTTPPOST_PTRBUFFER* = 1 shl 5
-  HTTPPOST_PTRCONTENTS* = 1 shl 3
-  HTTPPOST_PTRNAME* = 1 shl 2
-  HTTPPOST_READFILE* = 1 shl 1
-  LIBCURL_VERSION* = "7.15.5"
-  LIBCURL_VERSION_MAJOR* = 7
-  LIBCURL_VERSION_MINOR* = 15
-  LIBCURL_VERSION_NUM* = 0x00070F05
-  LIBCURL_VERSION_PATCH* = 5
-
-proc strequal*(s1, s2: cstring): int32{.cdecl, dynlib: libname, 
-                                        importc: "curl_strequal".}
-proc strnequal*(s1, s2: cstring, n: int): int32{.cdecl, dynlib: libname, 
-    importc: "curl_strnequal".}
-proc formadd*(httppost, last_post: PPcurl_httppost): FORMcode{.cdecl, varargs, 
-    dynlib: libname, importc: "curl_formadd".}
-proc formget*(form: Phttppost, arg: pointer, append: Formget_callback): int32{.
-    cdecl, dynlib: libname, importc: "curl_formget".}
-proc formfree*(form: Phttppost){.cdecl, dynlib: libname, 
-                                 importc: "curl_formfree".}
-proc getenv*(variable: cstring): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_getenv".}
-proc version*(): cstring{.cdecl, dynlib: libname, importc: "curl_version".}
-proc easy_escape*(handle: PCurl, str: cstring, len: int32): cstring{.cdecl, 
-    dynlib: libname, importc: "curl_easy_escape".}
-proc escape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_escape".}
-proc easy_unescape*(handle: PCurl, str: cstring, len: int32, outlength: var int32): cstring{.
-    cdecl, dynlib: libname, importc: "curl_easy_unescape".}
-proc unescape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_unescape".}
-proc free*(p: pointer){.cdecl, dynlib: libname, importc: "curl_free".}
-proc global_init*(flags: int32): Code{.cdecl, dynlib: libname, 
-                                        importc: "curl_global_init".}
-proc global_init_mem*(flags: int32, m: Malloc_callback, f: Free_callback, 
-                      r: Realloc_callback, s: Strdup_callback, 
-                      c: Calloc_callback): Code{.cdecl, dynlib: libname, 
-    importc: "curl_global_init_mem".}
-proc global_cleanup*(){.cdecl, dynlib: libname, importc: "curl_global_cleanup".}
-proc slist_append*(slist: Pslist, p: cstring): Pslist{.cdecl, dynlib: libname, 
-    importc: "curl_slist_append".}
-proc slist_free_all*(para1: Pslist){.cdecl, dynlib: libname, 
-                                     importc: "curl_slist_free_all".}
-proc getdate*(p: cstring, unused: ptr Time): Time{.cdecl, dynlib: libname, 
-    importc: "curl_getdate".}
-proc share_init*(): PSH{.cdecl, dynlib: libname, importc: "curl_share_init".}
-proc share_setopt*(para1: PSH, option: SHoption): SHcode{.cdecl, varargs, 
-    dynlib: libname, importc: "curl_share_setopt".}
-proc share_cleanup*(para1: PSH): SHcode{.cdecl, dynlib: libname, 
-    importc: "curl_share_cleanup".}
-proc version_info*(para1: Version): Pversion_info_data{.cdecl, dynlib: libname, 
-    importc: "curl_version_info".}
-proc easy_strerror*(para1: Code): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_easy_strerror".}
-proc share_strerror*(para1: SHcode): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_share_strerror".}
-proc easy_init*(): PCurl{.cdecl, dynlib: libname, importc: "curl_easy_init".}
-proc easy_setopt*(curl: PCurl, option: Option): Code{.cdecl, varargs, dynlib: libname, 
-    importc: "curl_easy_setopt".}
-proc easy_perform*(curl: PCurl): Code{.cdecl, dynlib: libname, 
-                                importc: "curl_easy_perform".}
-proc easy_cleanup*(curl: PCurl){.cdecl, dynlib: libname, importc: "curl_easy_cleanup".}
-proc easy_getinfo*(curl: PCurl, info: INFO): Code{.cdecl, varargs, dynlib: libname, 
-    importc: "curl_easy_getinfo".}
-proc easy_duphandle*(curl: PCurl): PCurl{.cdecl, dynlib: libname, 
-                              importc: "curl_easy_duphandle".}
-proc easy_reset*(curl: PCurl){.cdecl, dynlib: libname, importc: "curl_easy_reset".}
-proc multi_init*(): PM{.cdecl, dynlib: libname, importc: "curl_multi_init".}
-proc multi_add_handle*(multi_handle: PM, handle: PCurl): Mcode{.cdecl, 
-    dynlib: libname, importc: "curl_multi_add_handle".}
-proc multi_remove_handle*(multi_handle: PM, handle: PCurl): Mcode{.cdecl, 
-    dynlib: libname, importc: "curl_multi_remove_handle".}
-proc multi_fdset*(multi_handle: PM, read_fd_set: Pfd_set, write_fd_set: Pfd_set, 
-                  exc_fd_set: Pfd_set, max_fd: var int32): Mcode{.cdecl, 
-    dynlib: libname, importc: "curl_multi_fdset".}
-proc multi_perform*(multi_handle: PM, running_handles: var int32): Mcode{.
-    cdecl, dynlib: libname, importc: "curl_multi_perform".}
-proc multi_cleanup*(multi_handle: PM): Mcode{.cdecl, dynlib: libname, 
-    importc: "curl_multi_cleanup".}
-proc multi_info_read*(multi_handle: PM, msgs_in_queue: var int32): PMsg{.cdecl, 
-    dynlib: libname, importc: "curl_multi_info_read".}
-proc multi_strerror*(para1: Mcode): cstring{.cdecl, dynlib: libname, 
-    importc: "curl_multi_strerror".}
-proc multi_socket*(multi_handle: PM, s: Socket, running_handles: var int32): Mcode{.
-    cdecl, dynlib: libname, importc: "curl_multi_socket".}
-proc multi_socket_all*(multi_handle: PM, running_handles: var int32): Mcode{.
-    cdecl, dynlib: libname, importc: "curl_multi_socket_all".}
-proc multi_timeout*(multi_handle: PM, milliseconds: var int32): Mcode{.cdecl, 
-    dynlib: libname, importc: "curl_multi_timeout".}
-proc multi_setopt*(multi_handle: PM, option: Moption): Mcode{.cdecl, varargs, 
-    dynlib: libname, importc: "curl_multi_setopt".}
-proc multi_assign*(multi_handle: PM, sockfd: Socket, sockp: pointer): Mcode{.
-    cdecl, dynlib: libname, importc: "curl_multi_assign".}
diff --git a/lib/wrappers/libffi/common/ffi.h b/lib/wrappers/libffi/common/ffi.h
deleted file mode 100644
index 07d650eac..000000000
--- a/lib/wrappers/libffi/common/ffi.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
-   libffi 2.00-beta - Copyright (c) 1996-2003  Red Hat, Inc.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-
-   ----------------------------------------------------------------------- */
-
-/* -------------------------------------------------------------------
-   The basic API is described in the README file.
-
-   The raw API is designed to bypass some of the argument packing
-   and unpacking on architectures for which it can be avoided.
-
-   The closure API allows interpreted functions to be packaged up
-   inside a C function pointer, so that they can be called as C functions,
-   with no understanding on the client side that they are interpreted.
-   It can also be used in other cases in which it is necessary to package
-   up a user specified parameter and a function pointer as a single
-   function pointer.
-
-   The closure API must be implemented in order to get its functionality,
-   e.g. for use by gij.  Routines are provided to emulate the raw API
-   if the underlying platform doesn't allow faster implementation.
-
-   More details on the raw and cloure API can be found in:
-
-   http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
-
-   and
-
-   http://gcc.gnu.org/ml/java/1999-q3/msg00174.html
-   -------------------------------------------------------------------- */
-
-#ifndef LIBFFI_H
-#define LIBFFI_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Specify which architecture libffi is configured for. */
-//XXX #define X86
-
-/* ---- System configuration information --------------------------------- */
-
-#include <ffitarget.h>
-
-#ifndef LIBFFI_ASM
-
-#include <stddef.h>
-#include <limits.h>
-
-/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
-   But we can find it either under the correct ANSI name, or under GNU
-   C's internal name.  */
-#ifdef LONG_LONG_MAX
-# define FFI_LONG_LONG_MAX LONG_LONG_MAX
-#else
-# ifdef LLONG_MAX
-#  define FFI_LONG_LONG_MAX LLONG_MAX
-# else
-#  ifdef __GNUC__
-#   define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
-#  endif
-#  ifdef _MSC_VER
-#   define FFI_LONG_LONG_MAX _I64_MAX
-#  endif
-# endif
-#endif
-
-#if SCHAR_MAX == 127
-# define ffi_type_uchar                ffi_type_uint8
-# define ffi_type_schar                ffi_type_sint8
-#else
- #error "char size not supported"
-#endif
-
-#if SHRT_MAX == 32767
-# define ffi_type_ushort       ffi_type_uint16
-# define ffi_type_sshort       ffi_type_sint16
-#elif SHRT_MAX == 2147483647
-# define ffi_type_ushort       ffi_type_uint32
-# define ffi_type_sshort       ffi_type_sint32
-#else
- #error "short size not supported"
-#endif
-
-#if INT_MAX == 32767
-# define ffi_type_uint         ffi_type_uint16
-# define ffi_type_sint         ffi_type_sint16
-#elif INT_MAX == 2147483647
-# define ffi_type_uint         ffi_type_uint32
-# define ffi_type_sint         ffi_type_sint32
-#elif INT_MAX == 9223372036854775807
-# define ffi_type_uint         ffi_type_uint64
-# define ffi_type_sint         ffi_type_sint64
-#else
- #error "int size not supported"
-#endif
-
-#define ffi_type_ulong         ffi_type_uint64
-#define ffi_type_slong         ffi_type_sint64
-#if LONG_MAX == 2147483647
-# if FFI_LONG_LONG_MAX != 9223372036854775807
-  #error "no 64-bit data type supported"
-# endif
-#elif LONG_MAX != 9223372036854775807
- #error "long size not supported"
-#endif
-
-/* The closure code assumes that this works on pointers, i.e. a size_t	*/
-/* can hold a pointer.							*/
-
-typedef struct _ffi_type
-{
-  size_t size;
-  unsigned short alignment;
-  unsigned short type;
-  /*@null@*/ struct _ffi_type **elements;
-} ffi_type;
-
-/* These are defined in types.c */
-extern const ffi_type ffi_type_void;
-extern const ffi_type ffi_type_uint8;
-extern const ffi_type ffi_type_sint8;
-extern const ffi_type ffi_type_uint16;
-extern const ffi_type ffi_type_sint16;
-extern const ffi_type ffi_type_uint32;
-extern const ffi_type ffi_type_sint32;
-extern const ffi_type ffi_type_uint64;
-extern const ffi_type ffi_type_sint64;
-extern const ffi_type ffi_type_float;
-extern const ffi_type ffi_type_double;
-extern const ffi_type ffi_type_longdouble;
-extern const ffi_type ffi_type_pointer;
-
-
-typedef enum {
-  FFI_OK = 0,
-  FFI_BAD_TYPEDEF,
-  FFI_BAD_ABI 
-} ffi_status;
-
-typedef unsigned FFI_TYPE;
-
-typedef struct {
-  ffi_abi abi;
-  unsigned nargs;
-  /*@dependent@*/ ffi_type **arg_types;
-  /*@dependent@*/ ffi_type *rtype;
-  unsigned bytes;
-  unsigned flags;
-#ifdef FFI_EXTRA_CIF_FIELDS
-  FFI_EXTRA_CIF_FIELDS;
-#endif
-} ffi_cif;
-
-/* ---- Definitions for the raw API -------------------------------------- */
-
-#ifdef _WIN64
-#define FFI_SIZEOF_ARG 8
-#else
-#define FFI_SIZEOF_ARG 4
-#endif
-
-typedef union {
-  ffi_sarg  sint;
-  ffi_arg   uint;
-  float	    flt;
-  char      data[FFI_SIZEOF_ARG];
-  void*     ptr;
-} ffi_raw;
-
-void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, 
-		   void (*fn)(), 
-		   /*@out@*/ void *rvalue, 
-		   /*@dependent@*/ ffi_raw *avalue);
-
-void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
-void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
-size_t ffi_raw_size (ffi_cif *cif);
-
-/* This is analogous to the raw API, except it uses Java parameter	*/
-/* packing, even on 64-bit machines.  I.e. on 64-bit machines		*/
-/* longs and doubles are followed by an empty 64-bit word.		*/
-
-void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, 
-		        void (*fn)(), 
-		        /*@out@*/ void *rvalue, 
-		        /*@dependent@*/ ffi_raw *avalue);
-
-void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
-void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
-size_t ffi_java_raw_size (ffi_cif *cif);
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#if FFI_CLOSURES
-
-typedef struct {
-  char tramp[FFI_TRAMPOLINE_SIZE];
-  ffi_cif   *cif;
-  void     (*fun)(ffi_cif*,void*,void**,void*);
-  void      *user_data;
-} ffi_closure;
-
-void ffi_closure_free(void *);
-void *ffi_closure_alloc (size_t size, void **code);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure*,
-		  ffi_cif *,
-		  void (*fun)(ffi_cif*,void*,void**,void*),
-		  void *user_data,
-		  void *codeloc);
-
-typedef struct {
-  char tramp[FFI_TRAMPOLINE_SIZE];
-
-  ffi_cif   *cif;
-
-#if !FFI_NATIVE_RAW_API
-
-  /* if this is enabled, then a raw closure has the same layout 
-     as a regular closure.  We use this to install an intermediate 
-     handler to do the transaltion, void** -> ffi_raw*. */
-
-  void     (*translate_args)(ffi_cif*,void*,void**,void*);
-  void      *this_closure;
-
-#endif
-
-  void     (*fun)(ffi_cif*,void*,ffi_raw*,void*);
-  void      *user_data;
-
-} ffi_raw_closure;
-
-ffi_status
-ffi_prep_raw_closure (ffi_raw_closure*,
-		      ffi_cif *cif,
-		      void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-		      void *user_data);
-
-ffi_status
-ffi_prep_java_raw_closure (ffi_raw_closure*,
-		           ffi_cif *cif,
-		           void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-		           void *user_data);
-
-#endif /* FFI_CLOSURES */
-
-/* ---- Public interface definition -------------------------------------- */
-
-ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, 
-			ffi_abi abi,
-			unsigned int nargs, 
-			/*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, 
-			/*@dependent@*/ ffi_type **atypes);
-
-void
-ffi_call(/*@dependent@*/ ffi_cif *cif, 
-	 void (*fn)(), 
-	 /*@out@*/ void *rvalue, 
-	 /*@dependent@*/ void **avalue);
-
-/* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)())f)
-
-/* ---- Definitions shared with assembly code ---------------------------- */
-
-#endif
-
-/* If these change, update src/mips/ffitarget.h. */
-#define FFI_TYPE_VOID       0    
-#define FFI_TYPE_INT        1
-#define FFI_TYPE_FLOAT      2    
-#define FFI_TYPE_DOUBLE     3
-#if 1
-#define FFI_TYPE_LONGDOUBLE 4
-#else
-#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
-#endif
-#define FFI_TYPE_UINT8      5   
-#define FFI_TYPE_SINT8      6
-#define FFI_TYPE_UINT16     7 
-#define FFI_TYPE_SINT16     8
-#define FFI_TYPE_UINT32     9
-#define FFI_TYPE_SINT32     10
-#define FFI_TYPE_UINT64     11
-#define FFI_TYPE_SINT64     12
-#define FFI_TYPE_STRUCT     13
-#define FFI_TYPE_POINTER    14
-
-/* This should always refer to the last type code (for sanity checks) */
-#define FFI_TYPE_LAST       FFI_TYPE_POINTER
-
-#define FFI_HIDDEN /* no idea what the origial definition looks like ... */
-
-#ifdef __GNUC__
-#  define LIKELY(x) __builtin_expect(x, 1)
-#  define UNLIKELY(x) __builtin_expect(x, 0)
-#else
-#  define LIKELY(x) (x)
-#  define UNLIKELY(x) (x)
-#endif
-
-#define MAYBE_UNUSED
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/lib/wrappers/libffi/common/ffi_common.h b/lib/wrappers/libffi/common/ffi_common.h
deleted file mode 100644
index 43fb83b48..000000000
--- a/lib/wrappers/libffi/common/ffi_common.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi_common.h - Copyright (c) 1996  Red Hat, Inc.
-
-   Common internal definitions and macros. Only necessary for building
-   libffi.
-   ----------------------------------------------------------------------- */
-
-#ifndef FFI_COMMON_H
-#define FFI_COMMON_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <fficonfig.h>
-#include <malloc.h>
-
-/* Check for the existence of memcpy. */
-#if STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#if defined(FFI_DEBUG) 
-#include <stdio.h>
-#endif
-
-#ifdef FFI_DEBUG
-/*@exits@*/ void ffi_assert(/*@temp@*/ char *expr, /*@temp@*/ char *file, int line);
-void ffi_stop_here(void);
-void ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a, /*@temp@*/ char *file, int line);
-
-#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
-#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
-#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__)
-#else
-#define FFI_ASSERT(x) 
-#define FFI_ASSERT_AT(x, f, l)
-#define FFI_ASSERT_VALID_TYPE(x)
-#endif
-
-#define ALIGN(v, a)  (((((size_t) (v))-1) | ((a)-1))+1)
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
-
-/* Extended cif, used in callback from assembly routine */
-typedef struct
-{
-  /*@dependent@*/ ffi_cif *cif;
-  /*@dependent@*/ void *rvalue;
-  /*@dependent@*/ void **avalue;
-} extended_cif;
-
-/* Terse sized type definitions.  */
-typedef unsigned int UINT8  __attribute__((__mode__(__QI__)));
-typedef signed int   SINT8  __attribute__((__mode__(__QI__)));
-typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
-typedef signed int   SINT16 __attribute__((__mode__(__HI__)));
-typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
-typedef signed int   SINT32 __attribute__((__mode__(__SI__)));
-typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
-typedef signed int   SINT64 __attribute__((__mode__(__DI__)));
-
-typedef float FLOAT32;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/lib/wrappers/libffi/common/fficonfig.h b/lib/wrappers/libffi/common/fficonfig.h
deleted file mode 100644
index c14f653ec..000000000
--- a/lib/wrappers/libffi/common/fficonfig.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* fficonfig.h.  Originally created by configure, now hand_maintained for MSVC. */
-
-/* fficonfig.h.  Generated automatically by configure.  */
-/* fficonfig.h.in.  Generated automatically from configure.in by autoheader.  */
-
-/* Define this for MSVC, but not for mingw32! */
-#ifdef _MSC_VER
-#define __attribute__(x) /* */
-#endif
-#define alloca _alloca
-
-/*----------------------------------------------------------------*/
-
-/* Define if using alloca.c.  */
-/* #undef C_ALLOCA */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro.  */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
-/* #define HAVE_ALLOCA_H 1 */
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if you have the ANSI C header files.  */
-#define STDC_HEADERS 1
-
-/* Define if you have the memcpy function.  */
-#define HAVE_MEMCPY 1
-
-/* Define if read-only mmap of a plain file works. */
-//#define HAVE_MMAP_FILE 1
-
-/* Define if mmap of /dev/zero works. */
-//#define HAVE_MMAP_DEV_ZERO 1
-
-/* Define if mmap with MAP_ANON(YMOUS) works. */
-//#define HAVE_MMAP_ANON 1
-
-/* The number of bytes in type double */
-#define SIZEOF_DOUBLE 8
-
-/* The number of bytes in type long double */
-#define SIZEOF_LONG_DOUBLE 12
-
-/* Define if you have the long double type and it is bigger than a double */
-#define HAVE_LONG_DOUBLE 1
-
-/* whether byteorder is bigendian */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define if the host machine stores words of multi-word integers in
-   big-endian order. */
-/* #undef HOST_WORDS_BIG_ENDIAN */
-
-/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-#define BYTEORDER 1234
-
-/* Define if your assembler and linker support unaligned PC relative relocs. */
-/* #undef HAVE_AS_SPARC_UA_PCREL */
-
-/* Define if your assembler supports .register. */
-/* #undef HAVE_AS_REGISTER_PSEUDO_OP */
-
-/* Define if .eh_frame sections should be read-only. */
-/* #undef HAVE_RO_EH_FRAME */
-
-/* Define to the flags needed for the .section .eh_frame directive. */
-/* #define EH_FRAME_FLAGS "aw" */
-
-/* Define to the flags needed for the .section .eh_frame directive. */
-/* #define EH_FRAME_FLAGS "aw" */
-
-/* Define this if you want extra debugging. */
-/* #undef FFI_DEBUG */
-
-/* Define this is you do not want support for aggregate types. */
-/* #undef FFI_NO_STRUCTS */
-
-/* Define this is you do not want support for the raw API. */
-/* #undef FFI_NO_RAW_API */
-
-/* Define this if you are using Purify and want to suppress spurious messages. */
-/* #undef USING_PURIFY */
-
diff --git a/lib/wrappers/libffi/common/ffitarget.h b/lib/wrappers/libffi/common/ffitarget.h
deleted file mode 100644
index d8d60f2e7..000000000
--- a/lib/wrappers/libffi/common/ffitarget.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
-   ffitarget.h - Copyright (c) 2012  Anthony Green
-                 Copyright (c) 1996-2003, 2010  Red Hat, Inc.
-                 Copyright (C) 2008  Free Software Foundation, Inc.
-
-   Target configuration macros for x86 and x86-64.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-
-   ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-/* For code common to all platforms on x86 and x86_64. */
-#define X86_ANY
-
-#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
-#  if defined(__x86_64__) || defined(__x86_64) || defined(_M_X64)
-#    define X86_64
-#    define X86_WIN64
-#  else
-#    define X86_32
-#    define X86_WIN32
-#  endif
-#endif
-
-#if defined (X86_64) && defined (__i386__)
-#undef X86_64
-#define X86
-#endif
-
-#ifdef X86_WIN64
-#define FFI_SIZEOF_ARG 8
-#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-#ifdef X86_WIN64
-#ifdef _MSC_VER
-typedef unsigned __int64       ffi_arg;
-typedef __int64                ffi_sarg;
-#else
-typedef unsigned long long     ffi_arg;
-typedef long long              ffi_sarg;
-#endif
-#else
-#if defined __x86_64__ && defined __ILP32__
-#define FFI_SIZEOF_ARG 8
-#define FFI_SIZEOF_JAVA_RAW  4
-typedef unsigned long long     ffi_arg;
-typedef long long              ffi_sarg;
-#else
-typedef unsigned long          ffi_arg;
-typedef signed long            ffi_sarg;
-#endif
-#endif
-
-typedef enum ffi_abi {
-  FFI_FIRST_ABI = 0,
-
-  /* ---- Intel x86 Win32 ---------- */
-#ifdef X86_WIN32
-  FFI_SYSV,
-  FFI_STDCALL,
-  FFI_THISCALL,
-  FFI_FASTCALL,
-  FFI_MS_CDECL,
-  FFI_LAST_ABI,
-#ifdef _MSC_VER
-  FFI_DEFAULT_ABI = FFI_MS_CDECL
-#else
-  FFI_DEFAULT_ABI = FFI_SYSV
-#endif
-
-#elif defined(X86_WIN64)
-  FFI_WIN64,
-  FFI_LAST_ABI,
-  FFI_DEFAULT_ABI = FFI_WIN64
-
-#else
-  /* ---- Intel x86 and AMD x86-64 - */
-  FFI_SYSV,
-  FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
-  FFI_LAST_ABI,
-#if defined(__i386__) || defined(__i386)
-  FFI_DEFAULT_ABI = FFI_SYSV
-#else
-  FFI_DEFAULT_ABI = FFI_UNIX64
-#endif
-#endif
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
-#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
-#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
-#define FFI_TYPE_MS_STRUCT       (FFI_TYPE_LAST + 4)
-
-#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
-#define FFI_TRAMPOLINE_SIZE 24
-#define FFI_NATIVE_RAW_API 0
-#else
-#ifdef X86_WIN32
-#define FFI_TRAMPOLINE_SIZE 52
-#else
-#ifdef X86_WIN64
-#define FFI_TRAMPOLINE_SIZE 29
-#define FFI_NATIVE_RAW_API 0
-#define FFI_NO_RAW_API 1
-#else
-#define FFI_TRAMPOLINE_SIZE 10
-#endif
-#endif
-#ifndef X86_WIN64
-#define FFI_NATIVE_RAW_API 1	/* x86 has native raw api support */
-#endif
-#endif
-
-#endif
-
diff --git a/lib/wrappers/libffi/common/malloc_closure.c b/lib/wrappers/libffi/common/malloc_closure.c
deleted file mode 100644
index 5b33aa4ca..000000000
--- a/lib/wrappers/libffi/common/malloc_closure.c
+++ /dev/null
@@ -1,110 +0,0 @@
-#include <ffi.h>
-#ifdef MS_WIN32
-#include <windows.h>
-#else
-#include <sys/mman.h>
-#include <unistd.h>
-# if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#  define MAP_ANONYMOUS MAP_ANON
-# endif
-#endif
-#include "ctypes.h"
-
-/* BLOCKSIZE can be adjusted.  Larger blocksize will take a larger memory
-   overhead, but allocate less blocks from the system.  It may be that some
-   systems have a limit of how many mmap'd blocks can be open.
-*/
-
-#define BLOCKSIZE _pagesize
-
-/* #define MALLOC_CLOSURE_DEBUG */ /* enable for some debugging output */
-
-/******************************************************************/
-
-typedef union _tagITEM {
-    ffi_closure closure;
-    union _tagITEM *next;
-} ITEM;
-
-static ITEM *free_list;
-static int _pagesize;
-
-static void more_core(void)
-{
-    ITEM *item;
-    int count, i;
-
-/* determine the pagesize */
-#ifdef MS_WIN32
-    if (!_pagesize) {
-        SYSTEM_INFO systeminfo;
-        GetSystemInfo(&systeminfo);
-        _pagesize = systeminfo.dwPageSize;
-    }
-#else
-    if (!_pagesize) {
-#ifdef _SC_PAGESIZE
-        _pagesize = sysconf(_SC_PAGESIZE);
-#else
-        _pagesize = getpagesize();
-#endif
-    }
-#endif
-
-    /* calculate the number of nodes to allocate */
-    count = BLOCKSIZE / sizeof(ITEM);
-
-    /* allocate a memory block */
-#ifdef MS_WIN32
-    item = (ITEM *)VirtualAlloc(NULL,
-                                           count * sizeof(ITEM),
-                                           MEM_COMMIT,
-                                           PAGE_EXECUTE_READWRITE);
-    if (item == NULL)
-        return;
-#else
-    item = (ITEM *)mmap(NULL,
-                        count * sizeof(ITEM),
-                        PROT_READ | PROT_WRITE | PROT_EXEC,
-                        MAP_PRIVATE | MAP_ANONYMOUS,
-                        -1,
-                        0);
-    if (item == (void *)MAP_FAILED)
-        return;
-#endif
-
-#ifdef MALLOC_CLOSURE_DEBUG
-    printf("block at %p allocated (%d bytes), %d ITEMs\n",
-           item, count * sizeof(ITEM), count);
-#endif
-    /* put them into the free list */
-    for (i = 0; i < count; ++i) {
-        item->next = free_list;
-        free_list = item;
-        ++item;
-    }
-}
-
-/******************************************************************/
-
-/* put the item back into the free list */
-void ffi_closure_free(void *p)
-{
-    ITEM *item = (ITEM *)p;
-    item->next = free_list;
-    free_list = item;
-}
-
-/* return one item from the free list, allocating more if needed */
-void *ffi_closure_alloc(size_t ignored, void** codeloc)
-{
-    ITEM *item;
-    if (!free_list)
-        more_core();
-    if (!free_list)
-        return NULL;
-    item = free_list;
-    free_list = item->next;
-    *codeloc = (void *)item;
-    return (void *)item;
-}
diff --git a/lib/wrappers/libffi/common/raw_api.c b/lib/wrappers/libffi/common/raw_api.c
deleted file mode 100644
index ce21372e2..000000000
--- a/lib/wrappers/libffi/common/raw_api.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* -----------------------------------------------------------------------
-   raw_api.c - Copyright (c) 1999, 2008  Red Hat, Inc.
-
-   Author: Kresten Krab Thorup <krab@gnu.org>
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-/* This file defines generic functions for use with the raw api. */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#if !FFI_NO_RAW_API
-
-size_t
-ffi_raw_size (ffi_cif *cif)
-{
-  size_t result = 0;
-  int i;
-
-  ffi_type **at = cif->arg_types;
-
-  for (i = cif->nargs-1; i >= 0; i--, at++)
-    {
-#if !FFI_NO_STRUCTS
-      if ((*at)->type == FFI_TYPE_STRUCT)
-	result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
-      else
-#endif
-	result += ALIGN ((*at)->size, FFI_SIZEOF_ARG);
-    }
-
-  return result;
-}
-
-
-void
-ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
-{
-  unsigned i;
-  ffi_type **tp = cif->arg_types;
-
-#if WORDS_BIGENDIAN
-
-  for (i = 0; i < cif->nargs; i++, tp++, args++)
-    {	  
-      switch ((*tp)->type)
-	{
-	case FFI_TYPE_UINT8:
-	case FFI_TYPE_SINT8:
-	  *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1);
-	  break;
-	  
-	case FFI_TYPE_UINT16:
-	case FFI_TYPE_SINT16:
-	  *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2);
-	  break;
-
-#if FFI_SIZEOF_ARG >= 4	  
-	case FFI_TYPE_UINT32:
-	case FFI_TYPE_SINT32:
-	  *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4);
-	  break;
-#endif
-	
-#if !FFI_NO_STRUCTS  
-	case FFI_TYPE_STRUCT:
-	  *args = (raw++)->ptr;
-	  break;
-#endif
-
-	case FFI_TYPE_POINTER:
-	  *args = (void*) &(raw++)->ptr;
-	  break;
-	  
-	default:
-	  *args = raw;
-	  raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
-	}
-    }
-
-#else /* WORDS_BIGENDIAN */
-
-#if !PDP
-
-  /* then assume little endian */
-  for (i = 0; i < cif->nargs; i++, tp++, args++)
-    {	  
-#if !FFI_NO_STRUCTS
-      if ((*tp)->type == FFI_TYPE_STRUCT)
-	{
-	  *args = (raw++)->ptr;
-	}
-      else
-#endif
-	{
-	  *args = (void*) raw;
-	  raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
-	}
-    }
-
-#else
-#error "pdp endian not supported"
-#endif /* ! PDP */
-
-#endif /* WORDS_BIGENDIAN */
-}
-
-void
-ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
-{
-  unsigned i;
-  ffi_type **tp = cif->arg_types;
-
-  for (i = 0; i < cif->nargs; i++, tp++, args++)
-    {	  
-      switch ((*tp)->type)
-	{
-	case FFI_TYPE_UINT8:
-	  (raw++)->uint = *(UINT8*) (*args);
-	  break;
-
-	case FFI_TYPE_SINT8:
-	  (raw++)->sint = *(SINT8*) (*args);
-	  break;
-
-	case FFI_TYPE_UINT16:
-	  (raw++)->uint = *(UINT16*) (*args);
-	  break;
-
-	case FFI_TYPE_SINT16:
-	  (raw++)->sint = *(SINT16*) (*args);
-	  break;
-
-#if FFI_SIZEOF_ARG >= 4
-	case FFI_TYPE_UINT32:
-	  (raw++)->uint = *(UINT32*) (*args);
-	  break;
-
-	case FFI_TYPE_SINT32:
-	  (raw++)->sint = *(SINT32*) (*args);
-	  break;
-#endif
-
-#if !FFI_NO_STRUCTS
-	case FFI_TYPE_STRUCT:
-	  (raw++)->ptr = *args;
-	  break;
-#endif
-
-	case FFI_TYPE_POINTER:
-	  (raw++)->ptr = **(void***) args;
-	  break;
-
-	default:
-	  memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
-	  raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
-	}
-    }
-}
-
-#if !FFI_NATIVE_RAW_API
-
-
-/* This is a generic definition of ffi_raw_call, to be used if the
- * native system does not provide a machine-specific implementation.
- * Having this, allows code to be written for the raw API, without
- * the need for system-specific code to handle input in that format;
- * these following couple of functions will handle the translation forth
- * and back automatically. */
-
-void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw)
-{
-  void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
-  ffi_raw_to_ptrarray (cif, raw, avalue);
-  ffi_call (cif, fn, rvalue, avalue);
-}
-
-#if FFI_CLOSURES		/* base system provides closures */
-
-static void
-ffi_translate_args (ffi_cif *cif, void *rvalue,
-		    void **avalue, void *user_data)
-{
-  ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif));
-  ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
-
-  ffi_ptrarray_to_raw (cif, avalue, raw);
-  (*cl->fun) (cif, rvalue, raw, cl->user_data);
-}
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure* cl,
-			  ffi_cif *cif,
-			  void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-			  void *user_data,
-			  void *codeloc)
-{
-  ffi_status status;
-
-  status = ffi_prep_closure_loc ((ffi_closure*) cl,
-				 cif,
-				 &ffi_translate_args,
-				 codeloc,
-				 codeloc);
-  if (status == FFI_OK)
-    {
-      cl->fun       = fun;
-      cl->user_data = user_data;
-    }
-
-  return status;
-}
-
-#endif /* FFI_CLOSURES */
-#endif /* !FFI_NATIVE_RAW_API */
-
-#if FFI_CLOSURES
-
-/* Again, here is the generic version of ffi_prep_raw_closure, which
- * will install an intermediate "hub" for translation of arguments from
- * the pointer-array format, to the raw format */
-
-ffi_status
-ffi_prep_raw_closure (ffi_raw_closure* cl,
-		      ffi_cif *cif,
-		      void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-		      void *user_data)
-{
-  return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl);
-}
-
-#endif /* FFI_CLOSURES */
-
-#endif /* !FFI_NO_RAW_API */
diff --git a/lib/wrappers/libffi/gcc/closures.c b/lib/wrappers/libffi/gcc/closures.c
deleted file mode 100644
index c0ee06891..000000000
--- a/lib/wrappers/libffi/gcc/closures.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* -----------------------------------------------------------------------
-   closures.c - Copyright (c) 2007, 2009, 2010  Red Hat, Inc.
-                Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc
-                Copyright (c) 2011 Plausible Labs Cooperative, Inc.
-
-   Code to allocate and deallocate memory for closures.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#if defined __linux__ && !defined _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__
-/* This macro indicates it may be forbidden to map anonymous memory
-   with both write and execute permission.  Code compiled when this
-   option is defined will attempt to map such pages once, but if it
-   fails, it falls back to creating a temporary file in a writable and
-   executable filesystem and mapping pages from it into separate
-   locations in the virtual memory space, one location writable and
-   another executable.  */
-#  define FFI_MMAP_EXEC_WRIT 1
-#  define HAVE_MNTENT 1
-# endif
-# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)
-/* Windows systems may have Data Execution Protection (DEP) enabled, 
-   which requires the use of VirtualMalloc/VirtualFree to alloc/free
-   executable memory. */
-#  define FFI_MMAP_EXEC_WRIT 1
-# endif
-#endif
-
-#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX
-# ifdef __linux__
-/* When defined to 1 check for SELinux and if SELinux is active,
-   don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that
-   might cause audit messages.  */
-#  define FFI_MMAP_EXEC_SELINUX 1
-# endif
-#endif
-
-#if FFI_CLOSURES
-
-# if FFI_EXEC_TRAMPOLINE_TABLE
-
-// Per-target implementation; It's unclear what can reasonable be shared
-// between two OS/architecture implementations.
-
-# elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */
-
-#define USE_LOCKS 1
-#define USE_DL_PREFIX 1
-#ifdef __GNUC__
-#ifndef USE_BUILTIN_FFS
-#define USE_BUILTIN_FFS 1
-#endif
-#endif
-
-/* We need to use mmap, not sbrk.  */
-#define HAVE_MORECORE 0
-
-/* We could, in theory, support mremap, but it wouldn't buy us anything.  */
-#define HAVE_MREMAP 0
-
-/* We have no use for this, so save some code and data.  */
-#define NO_MALLINFO 1
-
-/* We need all allocations to be in regular segments, otherwise we
-   lose track of the corresponding code address.  */
-#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-
-/* Don't allocate more than a page unless needed.  */
-#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize)
-
-#if FFI_CLOSURE_TEST
-/* Don't release single pages, to avoid a worst-case scenario of
-   continuously allocating and releasing single pages, but release
-   pairs of pages, which should do just as well given that allocations
-   are likely to be small.  */
-#define DEFAULT_TRIM_THRESHOLD ((size_t)malloc_getpagesize)
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <stdio.h>
-#if !defined(X86_WIN32) && !defined(X86_WIN64)
-#ifdef HAVE_MNTENT
-#include <mntent.h>
-#endif /* HAVE_MNTENT */
-#include <sys/param.h>
-#include <pthread.h>
-
-/* We don't want sys/mman.h to be included after we redefine mmap and
-   dlmunmap.  */
-#include <sys/mman.h>
-#define LACKS_SYS_MMAN_H 1
-
-#if FFI_MMAP_EXEC_SELINUX
-#include <sys/statfs.h>
-#include <stdlib.h>
-
-static int selinux_enabled = -1;
-
-static int
-selinux_enabled_check (void)
-{
-  struct statfs sfs;
-  FILE *f;
-  char *buf = NULL;
-  size_t len = 0;
-
-  if (statfs ("/selinux", &sfs) >= 0
-      && (unsigned int) sfs.f_type == 0xf97cff8cU)
-    return 1;
-  f = fopen ("/proc/mounts", "r");
-  if (f == NULL)
-    return 0;
-  while (getline (&buf, &len, f) >= 0)
-    {
-      char *p = strchr (buf, ' ');
-      if (p == NULL)
-        break;
-      p = strchr (p + 1, ' ');
-      if (p == NULL)
-        break;
-      if (strncmp (p + 1, "selinuxfs ", 10) == 0)
-        {
-          free (buf);
-          fclose (f);
-          return 1;
-        }
-    }
-  free (buf);
-  fclose (f);
-  return 0;
-}
-
-#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \
-			      : (selinux_enabled = selinux_enabled_check ()))
-
-#else
-
-#define is_selinux_enabled() 0
-
-#endif /* !FFI_MMAP_EXEC_SELINUX */
-
-/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */
-#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX
-#include <stdlib.h>
-
-static int emutramp_enabled = -1;
-
-static int
-emutramp_enabled_check (void)
-{
-  if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
-    return 1;
-  else
-    return 0;
-}
-
-#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
-                               : (emutramp_enabled = emutramp_enabled_check ()))
-#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
-#elif defined (__CYGWIN__) || defined(__INTERIX)
-
-#include <sys/mman.h>
-
-/* Cygwin is Linux-like, but not quite that Linux-like.  */
-#define is_selinux_enabled() 0
-
-#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
-
-#ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX
-#define is_emutramp_enabled() 0
-#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
-/* Use these for mmap and munmap within dlmalloc.c.  */
-static void *dlmmap(void *, size_t, int, int, int, off_t);
-static int dlmunmap(void *, size_t);
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
-
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
-
-/* A mutex used to synchronize access to *exec* variables in this file.  */
-static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/* A file descriptor of a temporary file from which we'll map
-   executable pages.  */
-static int execfd = -1;
-
-/* The amount of space already allocated from the temporary file.  */
-static size_t execsize = 0;
-
-/* Open a temporary file name, and immediately unlink it.  */
-static int
-open_temp_exec_file_name (char *name)
-{
-  int fd = mkstemp (name);
-
-  if (fd != -1)
-    unlink (name);
-
-  return fd;
-}
-
-/* Open a temporary file in the named directory.  */
-static int
-open_temp_exec_file_dir (const char *dir)
-{
-  static const char suffix[] = "/ffiXXXXXX";
-  int lendir = strlen (dir);
-  char *tempname = __builtin_alloca (lendir + sizeof (suffix));
-
-  if (!tempname)
-    return -1;
-
-  memcpy (tempname, dir, lendir);
-  memcpy (tempname + lendir, suffix, sizeof (suffix));
-
-  return open_temp_exec_file_name (tempname);
-}
-
-/* Open a temporary file in the directory in the named environment
-   variable.  */
-static int
-open_temp_exec_file_env (const char *envvar)
-{
-  const char *value = getenv (envvar);
-
-  if (!value)
-    return -1;
-
-  return open_temp_exec_file_dir (value);
-}
-
-#ifdef HAVE_MNTENT
-/* Open a temporary file in an executable and writable mount point
-   listed in the mounts file.  Subsequent calls with the same mounts
-   keep searching for mount points in the same file.  Providing NULL
-   as the mounts file closes the file.  */
-static int
-open_temp_exec_file_mnt (const char *mounts)
-{
-  static const char *last_mounts;
-  static FILE *last_mntent;
-
-  if (mounts != last_mounts)
-    {
-      if (last_mntent)
-	endmntent (last_mntent);
-
-      last_mounts = mounts;
-
-      if (mounts)
-	last_mntent = setmntent (mounts, "r");
-      else
-	last_mntent = NULL;
-    }
-
-  if (!last_mntent)
-    return -1;
-
-  for (;;)
-    {
-      int fd;
-      struct mntent mnt;
-      char buf[MAXPATHLEN * 3];
-
-      if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)) == NULL)
-	return -1;
-
-      if (hasmntopt (&mnt, "ro")
-	  || hasmntopt (&mnt, "noexec")
-	  || access (mnt.mnt_dir, W_OK))
-	continue;
-
-      fd = open_temp_exec_file_dir (mnt.mnt_dir);
-
-      if (fd != -1)
-	return fd;
-    }
-}
-#endif /* HAVE_MNTENT */
-
-/* Instructions to look for a location to hold a temporary file that
-   can be mapped in for execution.  */
-static struct
-{
-  int (*func)(const char *);
-  const char *arg;
-  int repeat;
-} open_temp_exec_file_opts[] = {
-  { open_temp_exec_file_env, "TMPDIR", 0 },
-  { open_temp_exec_file_dir, "/tmp", 0 },
-  { open_temp_exec_file_dir, "/var/tmp", 0 },
-  { open_temp_exec_file_dir, "/dev/shm", 0 },
-  { open_temp_exec_file_env, "HOME", 0 },
-#ifdef HAVE_MNTENT
-  { open_temp_exec_file_mnt, "/etc/mtab", 1 },
-  { open_temp_exec_file_mnt, "/proc/mounts", 1 },
-#endif /* HAVE_MNTENT */
-};
-
-/* Current index into open_temp_exec_file_opts.  */
-static int open_temp_exec_file_opts_idx = 0;
-
-/* Reset a current multi-call func, then advances to the next entry.
-   If we're at the last, go back to the first and return nonzero,
-   otherwise return zero.  */
-static int
-open_temp_exec_file_opts_next (void)
-{
-  if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
-    open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL);
-
-  open_temp_exec_file_opts_idx++;
-  if (open_temp_exec_file_opts_idx
-      == (sizeof (open_temp_exec_file_opts)
-	  / sizeof (*open_temp_exec_file_opts)))
-    {
-      open_temp_exec_file_opts_idx = 0;
-      return 1;
-    }
-
-  return 0;
-}
-
-/* Return a file descriptor of a temporary zero-sized file in a
-   writable and exexutable filesystem.  */
-static int
-open_temp_exec_file (void)
-{
-  int fd;
-
-  do
-    {
-      fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func
-	(open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg);
-
-      if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat
-	  || fd == -1)
-	{
-	  if (open_temp_exec_file_opts_next ())
-	    break;
-	}
-    }
-  while (fd == -1);
-
-  return fd;
-}
-
-/* Map in a chunk of memory from the temporary exec file into separate
-   locations in the virtual memory address space, one writable and one
-   executable.  Returns the address of the writable portion, after
-   storing an offset to the corresponding executable portion at the
-   last word of the requested chunk.  */
-static void *
-dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
-{
-  void *ptr;
-
-  if (execfd == -1)
-    {
-      open_temp_exec_file_opts_idx = 0;
-    retry_open:
-      execfd = open_temp_exec_file ();
-      if (execfd == -1)
-	return MFAIL;
-    }
-
-  offset = execsize;
-
-  if (ftruncate (execfd, offset + length))
-    return MFAIL;
-
-  flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS);
-  flags |= MAP_SHARED;
-
-  ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC,
-	      flags, execfd, offset);
-  if (ptr == MFAIL)
-    {
-      if (!offset)
-	{
-	  close (execfd);
-	  goto retry_open;
-	}
-      ftruncate (execfd, offset);
-      return MFAIL;
-    }
-  else if (!offset
-	   && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
-    open_temp_exec_file_opts_next ();
-
-  start = mmap (start, length, prot, flags, execfd, offset);
-
-  if (start == MFAIL)
-    {
-      munmap (ptr, length);
-      ftruncate (execfd, offset);
-      return start;
-    }
-
-  mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start;
-
-  execsize += length;
-
-  return start;
-}
-
-/* Map in a writable and executable chunk of memory if possible.
-   Failing that, fall back to dlmmap_locked.  */
-static void *
-dlmmap (void *start, size_t length, int prot,
-	int flags, int fd, off_t offset)
-{
-  void *ptr;
-
-  assert (start == NULL && length % malloc_getpagesize == 0
-	  && prot == (PROT_READ | PROT_WRITE)
-	  && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
-	  && fd == -1 && offset == 0);
-
-#if FFI_CLOSURE_TEST
-  printf ("mapping in %zi\n", length);
-#endif
-
-  if (execfd == -1 && is_emutramp_enabled ())
-    {
-      ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset);
-      return ptr;
-    }
-
-  if (execfd == -1 && !is_selinux_enabled ())
-    {
-      ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset);
-
-      if (ptr != MFAIL || (errno != EPERM && errno != EACCES))
-	/* Cool, no need to mess with separate segments.  */
-	return ptr;
-
-      /* If MREMAP_DUP is ever introduced and implemented, try mmap
-	 with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with
-	 MREMAP_DUP and prot at this point.  */
-    }
-
-  if (execsize == 0 || execfd == -1)
-    {
-      pthread_mutex_lock (&open_temp_exec_file_mutex);
-      ptr = dlmmap_locked (start, length, prot, flags, offset);
-      pthread_mutex_unlock (&open_temp_exec_file_mutex);
-
-      return ptr;
-    }
-
-  return dlmmap_locked (start, length, prot, flags, offset);
-}
-
-/* Release memory at the given address, as well as the corresponding
-   executable page if it's separate.  */
-static int
-dlmunmap (void *start, size_t length)
-{
-  /* We don't bother decreasing execsize or truncating the file, since
-     we can't quite tell whether we're unmapping the end of the file.
-     We don't expect frequent deallocation anyway.  If we did, we
-     could locate pages in the file by writing to the pages being
-     deallocated and checking that the file contents change.
-     Yuck.  */
-  msegmentptr seg = segment_holding (gm, start);
-  void *code;
-
-#if FFI_CLOSURE_TEST
-  printf ("unmapping %zi\n", length);
-#endif
-
-  if (seg && (code = add_segment_exec_offset (start, seg)) != start)
-    {
-      int ret = munmap (code, length);
-      if (ret)
-	return ret;
-    }
-
-  return munmap (start, length);
-}
-
-#if FFI_CLOSURE_FREE_CODE
-/* Return segment holding given code address.  */
-static msegmentptr
-segment_holding_code (mstate m, char* addr)
-{
-  msegmentptr sp = &m->seg;
-  for (;;) {
-    if (addr >= add_segment_exec_offset (sp->base, sp)
-	&& addr < add_segment_exec_offset (sp->base, sp) + sp->size)
-      return sp;
-    if ((sp = sp->next) == 0)
-      return 0;
-  }
-}
-#endif
-
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
-
-/* Allocate a chunk of memory with the given size.  Returns a pointer
-   to the writable address, and sets *CODE to the executable
-   corresponding virtual address.  */
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
-  *code = malloc(size);
-  return *code;
-#if 0
-  void *ptr;
-
-  if (!code)
-    return NULL;
-
-  ptr = dlmalloc (size);
-
-  if (ptr)
-    {
-      msegmentptr seg = segment_holding (gm, ptr);
-
-      *code = add_segment_exec_offset (ptr, seg);
-    }
-
-  return ptr;
-#endif
-}
-
-/* Release a chunk of memory allocated with ffi_closure_alloc.  If
-   FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
-   writable or the executable address given.  Otherwise, only the
-   writable address can be provided here.  */
-void
-ffi_closure_free (void *ptr)
-{
-#if 0
-#if FFI_CLOSURE_FREE_CODE
-  msegmentptr seg = segment_holding_code(gm, ptr);
-
-  if (seg)
-    ptr = sub_segment_exec_offset(ptr, seg);
-#endif
-
-  dlfree(ptr);
-#endif
-  free(ptr);
-}
-
-
-#if FFI_CLOSURE_TEST
-/* Do some internal sanity testing to make sure allocation and
-   deallocation of pages are working as intended.  */
-int main ()
-{
-  void *p[3];
-#define GET(idx, len) do { p[idx] = dlmalloc (len); printf ("allocated %zi for p[%i]\n", (len), (idx)); } while (0)
-#define PUT(idx) do { printf ("freeing p[%i]\n", (idx)); dlfree (p[idx]); } while (0)
-  GET (0, malloc_getpagesize / 2);
-  GET (1, 2 * malloc_getpagesize - 64 * sizeof (void*));
-  PUT (1);
-  GET (1, 2 * malloc_getpagesize);
-  GET (2, malloc_getpagesize / 2);
-  PUT (1);
-  PUT (0);
-  PUT (2);
-  return 0;
-}
-#endif /* FFI_CLOSURE_TEST */
-# else /* ! FFI_MMAP_EXEC_WRIT */
-
-/* On many systems, memory returned by malloc is writable and
-   executable, so just use it.  */
-
-#include <stdlib.h>
-
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
-  if (!code)
-    return NULL;
-
-  return *code = malloc (size);
-}
-
-void
-ffi_closure_free (void *ptr)
-{
-  free (ptr);
-}
-
-# endif /* ! FFI_MMAP_EXEC_WRIT */
-#endif /* FFI_CLOSURES */
diff --git a/lib/wrappers/libffi/gcc/ffi.c b/lib/wrappers/libffi/gcc/ffi.c
deleted file mode 100644
index 0600414d4..000000000
--- a/lib/wrappers/libffi/gcc/ffi.c
+++ /dev/null
@@ -1,841 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008  Red Hat, Inc.
-           Copyright (c) 2002  Ranjit Mathew
-           Copyright (c) 2002  Bo Thorsen
-           Copyright (c) 2002  Roger Sayle
-           Copyright (C) 2008, 2010  Free Software Foundation, Inc.
-
-   x86 Foreign Function Interface
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#if !defined(__x86_64__) || defined(_WIN64)
-
-#ifdef _WIN64
-#include <windows.h>
-#endif
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* ffi_prep_args is called by the assembly routine once stack space
-   has been allocated for the function's arguments */
-
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-#ifdef X86_WIN32
-  size_t p_stack_args[2];
-  void *p_stack_data[2];
-  char *argp2 = stack;
-  int stack_args_count = 0;
-  int cabi = ecif->cif->abi;
-#endif
-
-  argp = stack;
-
-  if ((ecif->cif->flags == FFI_TYPE_STRUCT
-       || ecif->cif->flags == FFI_TYPE_MS_STRUCT)
-#ifdef X86_WIN64
-      && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
-          && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
-#endif
-      )
-    {
-      *(void **) argp = ecif->rvalue;
-#ifdef X86_WIN32
-      /* For fastcall/thiscall this is first register-passed
-         argument.  */
-      if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
-	{
-	  p_stack_args[stack_args_count] = sizeof (void*);
-	  p_stack_data[stack_args_count] = argp;
-	  ++stack_args_count;
-	}
-#endif
-      argp += sizeof(void*);
-    }
-
-  p_argv = ecif->avalue;
-
-  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
-       i != 0;
-       i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(void*) - 1) & (size_t) argp)
-        argp = (char *) ALIGN(argp, sizeof(void*));
-
-      z = (*p_arg)->size;
-#ifdef X86_WIN64
-      if (z > sizeof(ffi_arg)
-          || ((*p_arg)->type == FFI_TYPE_STRUCT
-              && (z != 1 && z != 2 && z != 4 && z != 8))
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
-          || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
-#endif
-          )
-        {
-          z = sizeof(ffi_arg);
-          *(void **)argp = *p_argv;
-        }
-      else if ((*p_arg)->type == FFI_TYPE_FLOAT)
-        {
-          memcpy(argp, *p_argv, z);
-        }
-      else
-#endif
-      if (z < sizeof(ffi_arg))
-        {
-          z = sizeof(ffi_arg);
-          switch ((*p_arg)->type)
-            {
-            case FFI_TYPE_SINT8:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT8:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_SINT16:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT16:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_SINT32:
-              *(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_UINT32:
-              *(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv);
-              break;
-
-            case FFI_TYPE_STRUCT:
-              *(ffi_arg *) argp = *(ffi_arg *)(* p_argv);
-              break;
-
-            default:
-              FFI_ASSERT(0);
-            }
-        }
-      else
-        {
-          memcpy(argp, *p_argv, z);
-        }
-
-#ifdef X86_WIN32
-    /* For thiscall/fastcall convention register-passed arguments
-       are the first two none-floating-point arguments with a size
-       smaller or equal to sizeof (void*).  */
-    if ((cabi == FFI_THISCALL && stack_args_count < 1)
-        || (cabi == FFI_FASTCALL && stack_args_count < 2))
-      {
-	if (z <= 4
-	    && ((*p_arg)->type != FFI_TYPE_FLOAT
-	        && (*p_arg)->type != FFI_TYPE_STRUCT))
-	  {
-	    p_stack_args[stack_args_count] = z;
-	    p_stack_data[stack_args_count] = argp;
-	    ++stack_args_count;
-	  }
-      }
-#endif
-      p_argv++;
-#ifdef X86_WIN64
-      argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
-      argp += z;
-#endif
-    }
-
-#ifdef X86_WIN32
-  /* We need to move the register-passed arguments for thiscall/fastcall
-     on top of stack, so that those can be moved to registers ecx/edx by
-     call-handler.  */
-  if (stack_args_count > 0)
-    {
-      size_t zz = (p_stack_args[0] + 3) & ~3;
-      char *h;
-
-      /* Move first argument to top-stack position.  */
-      if (p_stack_data[0] != argp2)
-	{
-	  h = alloca (zz + 1);
-	  memcpy (h, p_stack_data[0], zz);
-	  memmove (argp2 + zz, argp2,
-	           (size_t) ((char *) p_stack_data[0] - (char*)argp2));
-	  memcpy (argp2, h, zz);
-	}
-
-      argp2 += zz;
-      --stack_args_count;
-      if (zz > 4)
-	stack_args_count = 0;
-
-      /* If we have a second argument, then move it on top
-         after the first one.  */
-      if (stack_args_count > 0 && p_stack_data[1] != argp2)
-	{
-	  zz = p_stack_args[1];
-	  zz = (zz + 3) & ~3;
-	  h = alloca (zz + 1);
-	  h = alloca (zz + 1);
-	  memcpy (h, p_stack_data[1], zz);
-	  memmove (argp2 + zz, argp2, (size_t) ((char*) p_stack_data[1] - (char*)argp2));
-	  memcpy (argp2, h, zz);
-	}
-    }
-#endif
-  return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
-  unsigned int i;
-  ffi_type **ptr;
-
-  /* Set the return type flag */
-  switch (cif->rtype->type)
-    {
-    case FFI_TYPE_VOID:
-    case FFI_TYPE_UINT8:
-    case FFI_TYPE_UINT16:
-    case FFI_TYPE_SINT8:
-    case FFI_TYPE_SINT16:
-#ifdef X86_WIN64
-    case FFI_TYPE_UINT32:
-    case FFI_TYPE_SINT32:
-#endif
-    case FFI_TYPE_SINT64:
-    case FFI_TYPE_FLOAT:
-    case FFI_TYPE_DOUBLE:
-#ifndef X86_WIN64
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
-    case FFI_TYPE_LONGDOUBLE:
-#endif
-#endif
-      cif->flags = (unsigned) cif->rtype->type;
-      break;
-
-    case FFI_TYPE_UINT64:
-#ifdef X86_WIN64
-    case FFI_TYPE_POINTER:
-#endif
-      cif->flags = FFI_TYPE_SINT64;
-      break;
-
-    case FFI_TYPE_STRUCT:
-#ifndef X86
-      if (cif->rtype->size == 1)
-        {
-          cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */
-        }
-      else if (cif->rtype->size == 2)
-        {
-          cif->flags = FFI_TYPE_SMALL_STRUCT_2B; /* same as short size */
-        }
-      else if (cif->rtype->size == 4)
-        {
-#ifdef X86_WIN64
-          cif->flags = FFI_TYPE_SMALL_STRUCT_4B;
-#else
-          cif->flags = FFI_TYPE_INT; /* same as int type */
-#endif
-        }
-      else if (cif->rtype->size == 8)
-        {
-          cif->flags = FFI_TYPE_SINT64; /* same as int64 type */
-        }
-      else
-#endif
-        {
-#ifdef X86_WIN32
-          if (cif->abi == FFI_MS_CDECL)
-            cif->flags = FFI_TYPE_MS_STRUCT;
-          else
-#endif
-            cif->flags = FFI_TYPE_STRUCT;
-          /* allocate space for return value pointer */
-          cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG);
-        }
-      break;
-
-    default:
-#ifdef X86_WIN64
-      cif->flags = FFI_TYPE_SINT64;
-      break;
-    case FFI_TYPE_INT:
-      cif->flags = FFI_TYPE_SINT32;
-#else
-      cif->flags = FFI_TYPE_INT;
-#endif
-      break;
-    }
-
-  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-    {
-      if (((*ptr)->alignment - 1) & cif->bytes)
-        cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
-      cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
-    }
-
-#ifdef X86_WIN64
-  /* ensure space for storing four registers */
-  cif->bytes += 4 * sizeof(ffi_arg);
-#endif
-
-  cif->bytes = (cif->bytes + 15) & ~0xF;
-
-  return FFI_OK;
-}
-
-#ifdef X86_WIN64
-extern int
-ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
-               unsigned, unsigned, unsigned *, void (*fn)(void));
-#elif defined(X86_WIN32)
-extern void
-ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
-               unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
-#else
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
-                          unsigned, unsigned, unsigned *, void (*fn)(void));
-#endif
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
-  extended_cif ecif;
-
-  ecif.cif = cif;
-  ecif.avalue = avalue;
-  
-  /* If the return value is a struct and we don't have a return */
-  /* value address then we need to make one                     */
-
-#ifdef X86_WIN64
-  if (rvalue == NULL
-      && cif->flags == FFI_TYPE_STRUCT
-      && cif->rtype->size != 1 && cif->rtype->size != 2
-      && cif->rtype->size != 4 && cif->rtype->size != 8)
-    {
-      ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
-    }
-#else
-  if (rvalue == NULL
-      && (cif->flags == FFI_TYPE_STRUCT
-          || cif->flags == FFI_TYPE_MS_STRUCT))
-    {
-      ecif.rvalue = alloca(cif->rtype->size);
-    }
-#endif
-  else
-    ecif.rvalue = rvalue;
-    
-  
-  switch (cif->abi) 
-    {
-#ifdef X86_WIN64
-    case FFI_WIN64:
-      ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
-                     cif->flags, ecif.rvalue, fn);
-      break;
-#elif defined(X86_WIN32)
-    case FFI_SYSV:
-    case FFI_STDCALL:
-    case FFI_MS_CDECL:
-      ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
-		     ecif.rvalue, fn);
-      break;
-    case FFI_THISCALL:
-    case FFI_FASTCALL:
-      {
-	unsigned int abi = cif->abi;
-	unsigned int i, passed_regs = 0;
-
-	if (cif->flags == FFI_TYPE_STRUCT)
-	  ++passed_regs;
-
-	for (i=0; i < cif->nargs && passed_regs < 2;i++)
-	  {
-	    size_t sz;
-
-	    if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
-	        || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
-	      continue;
-	    sz = (cif->arg_types[i]->size + 3) & ~3;
-	    if (sz == 0 || sz > 4)
-	      continue;
-	    ++passed_regs;
-	  }
-	if (passed_regs < 2 && abi == FFI_FASTCALL)
-	  abi = FFI_THISCALL;
-	if (passed_regs < 1 && abi == FFI_THISCALL)
-	  abi = FFI_STDCALL;
-        ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags,
-                       ecif.rvalue, fn);
-      }
-      break;
-#else
-    case FFI_SYSV:
-      ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
-                    fn);
-      break;
-#endif
-    default:
-      FFI_ASSERT(0);
-      break;
-    }
-}
-
-
-/** private members **/
-
-/* The following __attribute__((regparm(1))) decorations will have no effect
-   on MSVC or SUNPRO_C -- standard conventions apply. */
-static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
-                                         void** args, ffi_cif* cif);
-void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *)
-     __attribute__ ((regparm(1)));
-unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
-     __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
-     __attribute__ ((regparm(1)));
-#ifdef X86_WIN32
-void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
-     __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
-     __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *)
-     __attribute__ ((regparm(1)));
-#endif
-#ifdef X86_WIN64
-void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
-#endif
-
-/* This function is jumped to by the trampoline */
-
-#ifdef X86_WIN64
-void * FFI_HIDDEN
-ffi_closure_win64_inner (ffi_closure *closure, void *args) {
-  ffi_cif       *cif;
-  void         **arg_area;
-  void          *result;
-  void          *resp = &result;
-
-  cif         = closure->cif;
-  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
-
-  /* this call will initialize ARG_AREA, such that each
-   * element in that array points to the corresponding 
-   * value on the stack; and if the function returns
-   * a structure, it will change RESP to point to the
-   * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif);
-  
-  (closure->fun) (cif, resp, arg_area, closure->user_data);
-
-  /* The result is returned in rax.  This does the right thing for
-     result types except for floats; we have to 'mov xmm0, rax' in the
-     caller to correct this.
-     TODO: structure sizes of 3 5 6 7 are returned by reference, too!!!
-  */
-  return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp;
-}
-
-#else
-unsigned int FFI_HIDDEN __attribute__ ((regparm(1)))
-ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args)
-{
-  /* our various things...  */
-  ffi_cif       *cif;
-  void         **arg_area;
-
-  cif         = closure->cif;
-  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
-
-  /* this call will initialize ARG_AREA, such that each
-   * element in that array points to the corresponding 
-   * value on the stack; and if the function returns
-   * a structure, it will change RESP to point to the
-   * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
-
-  (closure->fun) (cif, *respp, arg_area, closure->user_data);
-
-  return cif->flags;
-}
-#endif /* !X86_WIN64 */
-
-static void
-ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
-                            ffi_cif *cif)
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-
-  argp = stack;
-
-#ifdef X86_WIN64
-  if (cif->rtype->size > sizeof(ffi_arg)
-      || (cif->flags == FFI_TYPE_STRUCT
-          && (cif->rtype->size != 1 && cif->rtype->size != 2
-              && cif->rtype->size != 4 && cif->rtype->size != 8))) {
-    *rvalue = *(void **) argp;
-    argp += sizeof(void *);
-  }
-#else
-  if ( cif->flags == FFI_TYPE_STRUCT
-       || cif->flags == FFI_TYPE_MS_STRUCT ) {
-    *rvalue = *(void **) argp;
-    argp += sizeof(void *);
-  }
-#endif
-
-  p_argv = avalue;
-
-  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(void*) - 1) & (size_t) argp) {
-        argp = (char *) ALIGN(argp, sizeof(void*));
-      }
-
-#ifdef X86_WIN64
-      if ((*p_arg)->size > sizeof(ffi_arg)
-          || ((*p_arg)->type == FFI_TYPE_STRUCT
-              && ((*p_arg)->size != 1 && (*p_arg)->size != 2
-                  && (*p_arg)->size != 4 && (*p_arg)->size != 8)))
-        {
-          z = sizeof(void *);
-          *p_argv = *(void **)argp;
-        }
-      else
-#endif
-        {
-          z = (*p_arg)->size;
-          
-          /* because we're little endian, this is what it turns into.   */
-          
-          *p_argv = (void*) argp;
-        }
-          
-      p_argv++;
-#ifdef X86_WIN64
-      argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
-      argp += z;
-#endif
-    }
-  
-  return;
-}
-
-#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   void*  __fun = (void*)(FUN); \
-   void*  __ctx = (void*)(CTX); \
-   *(unsigned char*) &__tramp[0] = 0x41; \
-   *(unsigned char*) &__tramp[1] = 0xbb; \
-   *(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \
-   *(unsigned char*) &__tramp[6] = 0x48; \
-   *(unsigned char*) &__tramp[7] = 0xb8; \
-   *(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \
-   *(unsigned char *)  &__tramp[16] = 0x49; \
-   *(unsigned char *)  &__tramp[17] = 0xba; \
-   *(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \
-   *(unsigned char *)  &__tramp[26] = 0x41; \
-   *(unsigned char *)  &__tramp[27] = 0xff; \
-   *(unsigned char *)  &__tramp[28] = 0xe2; /* jmp %r10 */ \
- }
-
-/* How to make a trampoline.  Derived from gcc/config/i386/i386.c. */
-
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   unsigned int  __fun = (unsigned int)(FUN); \
-   unsigned int  __ctx = (unsigned int)(CTX); \
-   unsigned int  __dis = __fun - (__ctx + 10);  \
-   *(unsigned char*) &__tramp[0] = 0xb8; \
-   *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
-   *(unsigned char *)  &__tramp[5] = 0xe9; \
-   *(unsigned int*)  &__tramp[6] = __dis; /* jmp __fun  */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   unsigned int  __fun = (unsigned int)(FUN); \
-   unsigned int  __ctx = (unsigned int)(CTX); \
-   unsigned int  __dis = __fun - (__ctx + 49);  \
-   unsigned short __size = (unsigned short)(SIZE); \
-   *(unsigned int *) &__tramp[0] = 0x8324048b;	/* mov (%esp), %eax */ \
-   *(unsigned int *) &__tramp[4] = 0x4c890cec;	/* sub $12, %esp */ \
-   *(unsigned int *) &__tramp[8] = 0x04890424;	/* mov %ecx, 4(%esp) */ \
-   *(unsigned char*) &__tramp[12] = 0x24;	/* mov %eax, (%esp) */ \
-   *(unsigned char*) &__tramp[13] = 0xb8; \
-   *(unsigned int *) &__tramp[14] = __size;	/* mov __size, %eax */ \
-   *(unsigned int *) &__tramp[18] = 0x08244c8d;	/* lea 8(%esp), %ecx */ \
-   *(unsigned int *) &__tramp[22] = 0x4802e8c1; /* shr $2, %eax ; dec %eax */ \
-   *(unsigned short*) &__tramp[26] = 0x0b74;	/* jz 1f */ \
-   *(unsigned int *) &__tramp[28] = 0x8908518b;	/* 2b: mov 8(%ecx), %edx */ \
-   *(unsigned int *) &__tramp[32] = 0x04c18311; /* mov %edx, (%ecx) ; add $4, %ecx */ \
-   *(unsigned char*) &__tramp[36] = 0x48;	/* dec %eax */ \
-   *(unsigned short*) &__tramp[37] = 0xf575;	/* jnz 2b ; 1f: */ \
-   *(unsigned char*) &__tramp[39] = 0xb8; \
-   *(unsigned int*)  &__tramp[40] = __ctx; /* movl __ctx, %eax */ \
-   *(unsigned char *)  &__tramp[44] = 0xe8; \
-   *(unsigned int*)  &__tramp[45] = __dis; /* call __fun  */ \
-   *(unsigned char*)  &__tramp[49] = 0xc2; /* ret  */ \
-   *(unsigned short*)  &__tramp[50] = (__size + 8); /* ret (__size + 8)  */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE)  \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
-   unsigned int  __fun = (unsigned int)(FUN); \
-   unsigned int  __ctx = (unsigned int)(CTX); \
-   unsigned int  __dis = __fun - (__ctx + 10); \
-   unsigned short __size = (unsigned short)(SIZE); \
-   *(unsigned char*) &__tramp[0] = 0xb8; \
-   *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
-   *(unsigned char *)  &__tramp[5] = 0xe8; \
-   *(unsigned int*)  &__tramp[6] = __dis; /* call __fun  */ \
-   *(unsigned char *)  &__tramp[10] = 0xc2; \
-   *(unsigned short*)  &__tramp[11] = __size; /* ret __size  */ \
- }
-
-/* the cif must already be prep'ed */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
-                      ffi_cif* cif,
-                      void (*fun)(ffi_cif*,void*,void**,void*),
-                      void *user_data,
-                      void *codeloc)
-{
-#ifdef X86_WIN64
-#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE)
-#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0)
-  if (cif->abi == FFI_WIN64) 
-    {
-      int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3);
-      FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0],
-                                 &ffi_closure_win64,
-                                 codeloc, mask);
-      /* make sure we can execute here */
-    }
-#else
-  if (cif->abi == FFI_SYSV)
-    {
-      FFI_INIT_TRAMPOLINE (&closure->tramp[0],
-                           &ffi_closure_SYSV,
-                           (void*)codeloc);
-    }
-#ifdef X86_WIN32
-  else if (cif->abi == FFI_THISCALL)
-    {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0],
-				    &ffi_closure_THISCALL,
-				    (void*)codeloc,
-				    cif->bytes);
-    }
-  else if (cif->abi == FFI_STDCALL)
-    {
-      FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
-                                   &ffi_closure_STDCALL,
-                                   (void*)codeloc, cif->bytes);
-    }
-  else if (cif->abi == FFI_MS_CDECL)
-    {
-      FFI_INIT_TRAMPOLINE (&closure->tramp[0],
-                           &ffi_closure_SYSV,
-                           (void*)codeloc);
-    }
-#endif /* X86_WIN32 */
-#endif /* !X86_WIN64 */
-  else
-    {
-      return FFI_BAD_ABI;
-    }
-    
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
-
-  return FFI_OK;
-}
-
-/* ------- Native raw API support -------------------------------- */
-
-#if !FFI_NO_RAW_API
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
-                          ffi_cif* cif,
-                          void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-                          void *user_data,
-                          void *codeloc)
-{
-  int i;
-
-  if (cif->abi != FFI_SYSV) {
-#ifdef X86_WIN32
-    if (cif->abi != FFI_THISCALL)
-#endif
-    return FFI_BAD_ABI;
-  }
-
-  /* we currently don't support certain kinds of arguments for raw
-     closures.  This should be implemented by a separate assembly
-     language routine, since it would require argument processing,
-     something we don't do now for performance.  */
-
-  for (i = cif->nargs-1; i >= 0; i--)
-    {
-      FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT);
-      FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE);
-    }
-  
-#ifdef X86_WIN32
-  if (cif->abi == FFI_SYSV)
-    {
-#endif
-  FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
-                       codeloc);
-#ifdef X86_WIN32
-    }
-  else if (cif->abi == FFI_THISCALL)
-    {
-      FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL,
-				    codeloc, cif->bytes);
-    }
-#endif
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
-
-  return FFI_OK;
-}
-
-static void 
-ffi_prep_args_raw(char *stack, extended_cif *ecif)
-{
-  memcpy (stack, ecif->avalue, ecif->cif->bytes);
-}
-
-/* we borrow this routine from libffi (it must be changed, though, to
- * actually call the function passed in the first argument.  as of
- * libffi-1.20, this is not the case.)
- */
-
-void
-ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
-{
-  extended_cif ecif;
-  void **avalue = (void **)fake_avalue;
-
-  ecif.cif = cif;
-  ecif.avalue = avalue;
-  
-  /* If the return value is a struct and we don't have a return */
-  /* value address then we need to make one                     */
-
-  if (rvalue == NULL
-      && (cif->flags == FFI_TYPE_STRUCT
-          || cif->flags == FFI_TYPE_MS_STRUCT))
-    {
-      ecif.rvalue = alloca(cif->rtype->size);
-    }
-  else
-    ecif.rvalue = rvalue;
-    
-  
-  switch (cif->abi) 
-    {
-#ifdef X86_WIN32
-    case FFI_SYSV:
-    case FFI_STDCALL:
-    case FFI_MS_CDECL:
-      ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
-		     ecif.rvalue, fn);
-      break;
-    case FFI_THISCALL:
-    case FFI_FASTCALL:
-      {
-	unsigned int abi = cif->abi;
-	unsigned int i, passed_regs = 0;
-
-	if (cif->flags == FFI_TYPE_STRUCT)
-	  ++passed_regs;
-
-	for (i=0; i < cif->nargs && passed_regs < 2;i++)
-	  {
-	    size_t sz;
-
-	    if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
-	        || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
-	      continue;
-	    sz = (cif->arg_types[i]->size + 3) & ~3;
-	    if (sz == 0 || sz > 4)
-	      continue;
-	    ++passed_regs;
-	  }
-	if (passed_regs < 2 && abi == FFI_FASTCALL)
-	  cif->abi = abi = FFI_THISCALL;
-	if (passed_regs < 1 && abi == FFI_THISCALL)
-	  cif->abi = abi = FFI_STDCALL;
-        ffi_call_win32(ffi_prep_args_raw, &ecif, abi, cif->bytes, cif->flags,
-                       ecif.rvalue, fn);
-      }
-      break;
-#else
-    case FFI_SYSV:
-      ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags,
-                    ecif.rvalue, fn);
-      break;
-#endif
-    default:
-      FFI_ASSERT(0);
-      break;
-    }
-}
-
-#endif
-
-#endif /* !__x86_64__  || X86_WIN64 */
-
diff --git a/lib/wrappers/libffi/gcc/ffi64.c b/lib/wrappers/libffi/gcc/ffi64.c
deleted file mode 100644
index 2014af24c..000000000
--- a/lib/wrappers/libffi/gcc/ffi64.c
+++ /dev/null
@@ -1,673 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi64.c - Copyright (c) 2013  The Written Word, Inc.
-             Copyright (c) 2011  Anthony Green
-             Copyright (c) 2008, 2010  Red Hat, Inc.
-             Copyright (c) 2002, 2007  Bo Thorsen <bo@suse.de>
-             
-   x86-64 Foreign Function Interface 
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdarg.h>
-
-#ifdef __x86_64__
-
-#define MAX_GPR_REGS 6
-#define MAX_SSE_REGS 8
-
-#if defined(__INTEL_COMPILER)
-#define UINT128 __m128
-#else
-#if defined(__SUNPRO_C)
-#include <sunmedia_types.h>
-#define UINT128 __m128i
-#else
-#define UINT128 __int128_t
-#endif
-#endif
-
-union big_int_union
-{
-  UINT32 i32;
-  UINT64 i64;
-  UINT128 i128;
-};
-
-struct register_args
-{
-  /* Registers for argument passing.  */
-  UINT64 gpr[MAX_GPR_REGS];
-  union big_int_union sse[MAX_SSE_REGS]; 
-};
-
-extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
-			     void *raddr, void (*fnaddr)(void), unsigned ssecount);
-
-/* All reference to register classes here is identical to the code in
-   gcc/config/i386/i386.c. Do *not* change one without the other.  */
-
-/* Register class used for passing given 64bit part of the argument.
-   These represent classes as documented by the PS ABI, with the
-   exception of SSESF, SSEDF classes, that are basically SSE class,
-   just gcc will use SF or DFmode move instead of DImode to avoid
-   reformatting penalties.
-
-   Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
-   whenever possible (upper half does contain padding).  */
-enum x86_64_reg_class
-  {
-    X86_64_NO_CLASS,
-    X86_64_INTEGER_CLASS,
-    X86_64_INTEGERSI_CLASS,
-    X86_64_SSE_CLASS,
-    X86_64_SSESF_CLASS,
-    X86_64_SSEDF_CLASS,
-    X86_64_SSEUP_CLASS,
-    X86_64_X87_CLASS,
-    X86_64_X87UP_CLASS,
-    X86_64_COMPLEX_X87_CLASS,
-    X86_64_MEMORY_CLASS
-  };
-
-#define MAX_CLASSES 4
-
-#define SSE_CLASS_P(X)	((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS)
-
-/* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
-   of this code is to classify each 8bytes of incoming argument by the register
-   class and assign registers accordingly.  */
-
-/* Return the union class of CLASS1 and CLASS2.
-   See the x86-64 PS ABI for details.  */
-
-static enum x86_64_reg_class
-merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
-{
-  /* Rule #1: If both classes are equal, this is the resulting class.  */
-  if (class1 == class2)
-    return class1;
-
-  /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
-     the other class.  */
-  if (class1 == X86_64_NO_CLASS)
-    return class2;
-  if (class2 == X86_64_NO_CLASS)
-    return class1;
-
-  /* Rule #3: If one of the classes is MEMORY, the result is MEMORY.  */
-  if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
-    return X86_64_MEMORY_CLASS;
-
-  /* Rule #4: If one of the classes is INTEGER, the result is INTEGER.  */
-  if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
-      || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
-    return X86_64_INTEGERSI_CLASS;
-  if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
-      || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
-    return X86_64_INTEGER_CLASS;
-
-  /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class,
-     MEMORY is used.  */
-  if (class1 == X86_64_X87_CLASS
-      || class1 == X86_64_X87UP_CLASS
-      || class1 == X86_64_COMPLEX_X87_CLASS
-      || class2 == X86_64_X87_CLASS
-      || class2 == X86_64_X87UP_CLASS
-      || class2 == X86_64_COMPLEX_X87_CLASS)
-    return X86_64_MEMORY_CLASS;
-
-  /* Rule #6: Otherwise class SSE is used.  */
-  return X86_64_SSE_CLASS;
-}
-
-/* Classify the argument of type TYPE and mode MODE.
-   CLASSES will be filled by the register class used to pass each word
-   of the operand.  The number of words is returned.  In case the parameter
-   should be passed in memory, 0 is returned. As a special case for zero
-   sized containers, classes[0] will be NO_CLASS and 1 is returned.
-
-   See the x86-64 PS ABI for details.
-*/
-static int
-classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
-		   size_t byte_offset)
-{
-  switch (type->type)
-    {
-    case FFI_TYPE_UINT8:
-    case FFI_TYPE_SINT8:
-    case FFI_TYPE_UINT16:
-    case FFI_TYPE_SINT16:
-    case FFI_TYPE_UINT32:
-    case FFI_TYPE_SINT32:
-    case FFI_TYPE_UINT64:
-    case FFI_TYPE_SINT64:
-    case FFI_TYPE_POINTER:
-      {
-	int size = byte_offset + type->size;
-
-	if (size <= 4)
-	  {
-	    classes[0] = X86_64_INTEGERSI_CLASS;
-	    return 1;
-	  }
-	else if (size <= 8)
-	  {
-	    classes[0] = X86_64_INTEGER_CLASS;
-	    return 1;
-	  }
-	else if (size <= 12)
-	  {
-	    classes[0] = X86_64_INTEGER_CLASS;
-	    classes[1] = X86_64_INTEGERSI_CLASS;
-	    return 2;
-	  }
-	else if (size <= 16)
-	  {
-	    classes[0] = classes[1] = X86_64_INTEGERSI_CLASS;
-	    return 2;
-	  }
-	else
-	  FFI_ASSERT (0);
-      }
-    case FFI_TYPE_FLOAT:
-      if (!(byte_offset % 8))
-	classes[0] = X86_64_SSESF_CLASS;
-      else
-	classes[0] = X86_64_SSE_CLASS;
-      return 1;
-    case FFI_TYPE_DOUBLE:
-      classes[0] = X86_64_SSEDF_CLASS;
-      return 1;
-    case FFI_TYPE_LONGDOUBLE:
-      classes[0] = X86_64_X87_CLASS;
-      classes[1] = X86_64_X87UP_CLASS;
-      return 2;
-    case FFI_TYPE_STRUCT:
-      {
-	const int UNITS_PER_WORD = 8;
-	int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
-	ffi_type **ptr; 
-	int i;
-	enum x86_64_reg_class subclasses[MAX_CLASSES];
-
-	/* If the struct is larger than 32 bytes, pass it on the stack.  */
-	if (type->size > 32)
-	  return 0;
-
-	for (i = 0; i < words; i++)
-	  classes[i] = X86_64_NO_CLASS;
-
-	/* Zero sized arrays or structures are NO_CLASS.  We return 0 to
-	   signalize memory class, so handle it as special case.  */
-	if (!words)
-	  {
-	    classes[0] = X86_64_NO_CLASS;
-	    return 1;
-	  }
-
-	/* Merge the fields of structure.  */
-	for (ptr = type->elements; *ptr != NULL; ptr++)
-	  {
-	    int num;
-
-	    byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
-
-	    num = classify_argument (*ptr, subclasses, byte_offset % 8);
-	    if (num == 0)
-	      return 0;
-	    for (i = 0; i < num; i++)
-	      {
-		int pos = byte_offset / 8;
-		classes[i + pos] =
-		  merge_classes (subclasses[i], classes[i + pos]);
-	      }
-
-	    byte_offset += (*ptr)->size;
-	  }
-
-	if (words > 2)
-	  {
-	    /* When size > 16 bytes, if the first one isn't
-	       X86_64_SSE_CLASS or any other ones aren't
-	       X86_64_SSEUP_CLASS, everything should be passed in
-	       memory.  */
-	    if (classes[0] != X86_64_SSE_CLASS)
-	      return 0;
-
-	    for (i = 1; i < words; i++)
-	      if (classes[i] != X86_64_SSEUP_CLASS)
-		return 0;
-	  }
-
-	/* Final merger cleanup.  */
-	for (i = 0; i < words; i++)
-	  {
-	    /* If one class is MEMORY, everything should be passed in
-	       memory.  */
-	    if (classes[i] == X86_64_MEMORY_CLASS)
-	      return 0;
-
-	    /* The X86_64_SSEUP_CLASS should be always preceded by
-	       X86_64_SSE_CLASS or X86_64_SSEUP_CLASS.  */
-	    if (classes[i] == X86_64_SSEUP_CLASS
-		&& classes[i - 1] != X86_64_SSE_CLASS
-		&& classes[i - 1] != X86_64_SSEUP_CLASS)
-	      {
-		/* The first one should never be X86_64_SSEUP_CLASS.  */
-		FFI_ASSERT (i != 0);
-		classes[i] = X86_64_SSE_CLASS;
-	      }
-
-	    /*  If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS,
-		everything should be passed in memory.  */
-	    if (classes[i] == X86_64_X87UP_CLASS
-		&& (classes[i - 1] != X86_64_X87_CLASS))
-	      {
-		/* The first one should never be X86_64_X87UP_CLASS.  */
-		FFI_ASSERT (i != 0);
-		return 0;
-	      }
-	  }
-	return words;
-      }
-
-    default:
-      FFI_ASSERT(0);
-    }
-  return 0; /* Never reached.  */
-}
-
-/* Examine the argument and return set number of register required in each
-   class.  Return zero iff parameter should be passed in memory, otherwise
-   the number of registers.  */
-
-static int
-examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
-		  _Bool in_return, int *pngpr, int *pnsse)
-{
-  int i, n, ngpr, nsse;
-
-  n = classify_argument (type, classes, 0);
-  if (n == 0)
-    return 0;
-
-  ngpr = nsse = 0;
-  for (i = 0; i < n; ++i)
-    switch (classes[i])
-      {
-      case X86_64_INTEGER_CLASS:
-      case X86_64_INTEGERSI_CLASS:
-	ngpr++;
-	break;
-      case X86_64_SSE_CLASS:
-      case X86_64_SSESF_CLASS:
-      case X86_64_SSEDF_CLASS:
-	nsse++;
-	break;
-      case X86_64_NO_CLASS:
-      case X86_64_SSEUP_CLASS:
-	break;
-      case X86_64_X87_CLASS:
-      case X86_64_X87UP_CLASS:
-      case X86_64_COMPLEX_X87_CLASS:
-	return in_return != 0;
-      default:
-	abort ();
-      }
-
-  *pngpr = ngpr;
-  *pnsse = nsse;
-
-  return n;
-}
-
-/* Perform machine dependent cif processing.  */
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
-  int gprcount, ssecount, i, avn, n, ngpr, nsse, flags;
-  enum x86_64_reg_class classes[MAX_CLASSES];
-  size_t bytes;
-
-  gprcount = ssecount = 0;
-
-  flags = cif->rtype->type;
-  if (flags != FFI_TYPE_VOID)
-    {
-      n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
-      if (n == 0)
-	{
-	  /* The return value is passed in memory.  A pointer to that
-	     memory is the first argument.  Allocate a register for it.  */
-	  gprcount++;
-	  /* We don't have to do anything in asm for the return.  */
-	  flags = FFI_TYPE_VOID;
-	}
-      else if (flags == FFI_TYPE_STRUCT)
-	{
-	  /* Mark which registers the result appears in.  */
-	  _Bool sse0 = SSE_CLASS_P (classes[0]);
-	  _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]);
-	  if (sse0 && !sse1)
-	    flags |= 1 << 8;
-	  else if (!sse0 && sse1)
-	    flags |= 1 << 9;
-	  else if (sse0 && sse1)
-	    flags |= 1 << 10;
-	  /* Mark the true size of the structure.  */
-	  flags |= cif->rtype->size << 12;
-	}
-    }
-
-  /* Go over all arguments and determine the way they should be passed.
-     If it's in a register and there is space for it, let that be so. If
-     not, add it's size to the stack byte count.  */
-  for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++)
-    {
-      if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0
-	  || gprcount + ngpr > MAX_GPR_REGS
-	  || ssecount + nsse > MAX_SSE_REGS)
-	{
-	  long align = cif->arg_types[i]->alignment;
-
-	  if (align < 8)
-	    align = 8;
-
-	  bytes = ALIGN (bytes, align);
-	  bytes += cif->arg_types[i]->size;
-	}
-      else
-	{
-	  gprcount += ngpr;
-	  ssecount += nsse;
-	}
-    }
-  if (ssecount)
-    flags |= 1 << 11;
-  cif->flags = flags;
-  cif->bytes = ALIGN (bytes, 8);
-
-  return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
-  enum x86_64_reg_class classes[MAX_CLASSES];
-  char *stack, *argp;
-  ffi_type **arg_types;
-  int gprcount, ssecount, ngpr, nsse, i, avn;
-  _Bool ret_in_memory;
-  struct register_args *reg_args;
-
-  /* Can't call 32-bit mode from 64-bit mode.  */
-  FFI_ASSERT (cif->abi == FFI_UNIX64);
-
-  /* If the return value is a struct and we don't have a return value
-     address then we need to make one.  Note the setting of flags to
-     VOID above in ffi_prep_cif_machdep.  */
-  ret_in_memory = (cif->rtype->type == FFI_TYPE_STRUCT
-		   && (cif->flags & 0xff) == FFI_TYPE_VOID);
-  if (rvalue == NULL && ret_in_memory)
-    rvalue = alloca (cif->rtype->size);
-
-  /* Allocate the space for the arguments, plus 4 words of temp space.  */
-  stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8);
-  reg_args = (struct register_args *) stack;
-  argp = stack + sizeof (struct register_args);
-
-  gprcount = ssecount = 0;
-
-  /* If the return value is passed in memory, add the pointer as the
-     first integer argument.  */
-  if (ret_in_memory)
-    reg_args->gpr[gprcount++] = (unsigned long) rvalue;
-
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-
-  for (i = 0; i < avn; ++i)
-    {
-      size_t size = arg_types[i]->size;
-      int n;
-
-      n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
-      if (n == 0
-	  || gprcount + ngpr > MAX_GPR_REGS
-	  || ssecount + nsse > MAX_SSE_REGS)
-	{
-	  long align = arg_types[i]->alignment;
-
-	  /* Stack arguments are *always* at least 8 byte aligned.  */
-	  if (align < 8)
-	    align = 8;
-
-	  /* Pass this argument in memory.  */
-	  argp = (void *) ALIGN (argp, align);
-	  memcpy (argp, avalue[i], size);
-	  argp += size;
-	}
-      else
-	{
-	  /* The argument is passed entirely in registers.  */
-	  char *a = (char *) avalue[i];
-	  int j;
-
-	  for (j = 0; j < n; j++, a += 8, size -= 8)
-	    {
-	      switch (classes[j])
-		{
-		case X86_64_INTEGER_CLASS:
-		case X86_64_INTEGERSI_CLASS:
-		  /* Sign-extend integer arguments passed in general
-		     purpose registers, to cope with the fact that
-		     LLVM incorrectly assumes that this will be done
-		     (the x86-64 PS ABI does not specify this). */
-		  switch (arg_types[i]->type)
-		    {
-		    case FFI_TYPE_SINT8:
-		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a);
-		      break;
-		    case FFI_TYPE_SINT16:
-		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a);
-		      break;
-		    case FFI_TYPE_SINT32:
-		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a);
-		      break;
-		    default:
-		      reg_args->gpr[gprcount] = 0;
-		      memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
-		    }
-		  gprcount++;
-		  break;
-		case X86_64_SSE_CLASS:
-		case X86_64_SSEDF_CLASS:
-		  reg_args->sse[ssecount++].i64 = *(UINT64 *) a;
-		  break;
-		case X86_64_SSESF_CLASS:
-		  reg_args->sse[ssecount++].i32 = *(UINT32 *) a;
-		  break;
-		default:
-		  abort();
-		}
-	    }
-	}
-    }
-
-  ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args),
-		   cif->flags, rvalue, fn, ssecount);
-}
-
-
-extern void ffi_closure_unix64(void);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
-		      ffi_cif* cif,
-		      void (*fun)(ffi_cif*, void*, void**, void*),
-		      void *user_data,
-		      void *codeloc)
-{
-  volatile unsigned short *tramp;
-
-  /* Sanity check on the cif ABI.  */
-  {
-    int abi = cif->abi;
-    if (UNLIKELY (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)))
-      return FFI_BAD_ABI;
-  }
-
-  tramp = (volatile unsigned short *) &closure->tramp[0];
-
-  tramp[0] = 0xbb49;		/* mov <code>, %r11	*/
-  *((unsigned long long * volatile) &tramp[1])
-    = (unsigned long) ffi_closure_unix64;
-  tramp[5] = 0xba49;		/* mov <data>, %r10	*/
-  *((unsigned long long * volatile) &tramp[6])
-    = (unsigned long) codeloc;
-
-  /* Set the carry bit iff the function uses any sse registers.
-     This is clc or stc, together with the first byte of the jmp.  */
-  tramp[10] = cif->flags & (1 << 11) ? 0x49f9 : 0x49f8;
-
-  tramp[11] = 0xe3ff;			/* jmp *%r11    */
-
-  closure->cif = cif;
-  closure->fun = fun;
-  closure->user_data = user_data;
-
-  return FFI_OK;
-}
-
-int
-ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
-			 struct register_args *reg_args, char *argp)
-{
-  ffi_cif *cif;
-  void **avalue;
-  ffi_type **arg_types;
-  long i, avn;
-  int gprcount, ssecount, ngpr, nsse;
-  int ret;
-
-  cif = closure->cif;
-  avalue = alloca(cif->nargs * sizeof(void *));
-  gprcount = ssecount = 0;
-
-  ret = cif->rtype->type;
-  if (ret != FFI_TYPE_VOID)
-    {
-      enum x86_64_reg_class classes[MAX_CLASSES];
-      int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
-      if (n == 0)
-	{
-	  /* The return value goes in memory.  Arrange for the closure
-	     return value to go directly back to the original caller.  */
-	  rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++];
-	  /* We don't have to do anything in asm for the return.  */
-	  ret = FFI_TYPE_VOID;
-	}
-      else if (ret == FFI_TYPE_STRUCT && n == 2)
-	{
-	  /* Mark which register the second word of the structure goes in.  */
-	  _Bool sse0 = SSE_CLASS_P (classes[0]);
-	  _Bool sse1 = SSE_CLASS_P (classes[1]);
-	  if (!sse0 && sse1)
-	    ret |= 1 << 8;
-	  else if (sse0 && !sse1)
-	    ret |= 1 << 9;
-	}
-    }
-
-  avn = cif->nargs;
-  arg_types = cif->arg_types;
-  
-  for (i = 0; i < avn; ++i)
-    {
-      enum x86_64_reg_class classes[MAX_CLASSES];
-      int n;
-
-      n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
-      if (n == 0
-	  || gprcount + ngpr > MAX_GPR_REGS
-	  || ssecount + nsse > MAX_SSE_REGS)
-	{
-	  long align = arg_types[i]->alignment;
-
-	  /* Stack arguments are *always* at least 8 byte aligned.  */
-	  if (align < 8)
-	    align = 8;
-
-	  /* Pass this argument in memory.  */
-	  argp = (void *) ALIGN (argp, align);
-	  avalue[i] = argp;
-	  argp += arg_types[i]->size;
-	}
-      /* If the argument is in a single register, or two consecutive
-	 integer registers, then we can use that address directly.  */
-      else if (n == 1
-	       || (n == 2 && !(SSE_CLASS_P (classes[0])
-			       || SSE_CLASS_P (classes[1]))))
-	{
-	  /* The argument is in a single register.  */
-	  if (SSE_CLASS_P (classes[0]))
-	    {
-	      avalue[i] = &reg_args->sse[ssecount];
-	      ssecount += n;
-	    }
-	  else
-	    {
-	      avalue[i] = &reg_args->gpr[gprcount];
-	      gprcount += n;
-	    }
-	}
-      /* Otherwise, allocate space to make them consecutive.  */
-      else
-	{
-	  char *a = alloca (16);
-	  int j;
-
-	  avalue[i] = a;
-	  for (j = 0; j < n; j++, a += 8)
-	    {
-	      if (SSE_CLASS_P (classes[j]))
-		memcpy (a, &reg_args->sse[ssecount++], 8);
-	      else
-		memcpy (a, &reg_args->gpr[gprcount++], 8);
-	    }
-	}
-    }
-
-  /* Invoke the closure.  */
-  closure->fun (cif, rvalue, avalue, closure->user_data);
-
-  /* Tell assembly how to perform return type promotions.  */
-  return ret;
-}
-
-#endif /* __x86_64__ */
diff --git a/lib/wrappers/libffi/gcc/prep_cif.c b/lib/wrappers/libffi/gcc/prep_cif.c
deleted file mode 100644
index e8ec5cf1e..000000000
--- a/lib/wrappers/libffi/gcc/prep_cif.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/* -----------------------------------------------------------------------
-   prep_cif.c - Copyright (c) 2011, 2012  Anthony Green
-                Copyright (c) 1996, 1998, 2007  Red Hat, Inc.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-
-/* Round up to FFI_SIZEOF_ARG. */
-
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
-
-/* Perform machine independent initialization of aggregate type
-   specifications. */
-
-static ffi_status initialize_aggregate(ffi_type *arg)
-{
-  ffi_type **ptr;
-
-  if (UNLIKELY(arg == NULL || arg->elements == NULL))
-    return FFI_BAD_TYPEDEF;
-
-  arg->size = 0;
-  arg->alignment = 0;
-
-  ptr = &(arg->elements[0]);
-
-  if (UNLIKELY(ptr == 0))
-    return FFI_BAD_TYPEDEF;
-
-  while ((*ptr) != NULL)
-    {
-      if (UNLIKELY(((*ptr)->size == 0)
-		    && (initialize_aggregate((*ptr)) != FFI_OK)))
-	return FFI_BAD_TYPEDEF;
-
-      /* Perform a sanity check on the argument type */
-      FFI_ASSERT_VALID_TYPE(*ptr);
-
-      arg->size = ALIGN(arg->size, (*ptr)->alignment);
-      arg->size += (*ptr)->size;
-
-      arg->alignment = (arg->alignment > (*ptr)->alignment) ?
-	arg->alignment : (*ptr)->alignment;
-
-      ptr++;
-    }
-
-  /* Structure size includes tail padding.  This is important for
-     structures that fit in one register on ABIs like the PowerPC64
-     Linux ABI that right justify small structs in a register.
-     It's also needed for nested structure layout, for example
-     struct A { long a; char b; }; struct B { struct A x; char y; };
-     should find y at an offset of 2*sizeof(long) and result in a
-     total size of 3*sizeof(long).  */
-  arg->size = ALIGN (arg->size, arg->alignment);
-
-  if (arg->size == 0)
-    return FFI_BAD_TYPEDEF;
-  else
-    return FFI_OK;
-}
-
-#ifndef __CRIS__
-/* The CRIS ABI specifies structure elements to have byte
-   alignment only, so it completely overrides this functions,
-   which assumes "natural" alignment and padding.  */
-
-/* Perform machine independent ffi_cif preparation, then call
-   machine dependent routine. */
-
-/* For non variadic functions isvariadic should be 0 and
-   nfixedargs==ntotalargs.
-
-   For variadic calls, isvariadic should be 1 and nfixedargs
-   and ntotalargs set as appropriate. nfixedargs must always be >=1 */
-
-
-ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
-			     unsigned int isvariadic,
-                             unsigned int nfixedargs,
-                             unsigned int ntotalargs,
-			     ffi_type *rtype, ffi_type **atypes)
-{
-  unsigned bytes = 0;
-  unsigned int i;
-  ffi_type **ptr;
-
-  FFI_ASSERT(cif != NULL);
-  FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
-  FFI_ASSERT(nfixedargs <= ntotalargs);
-
-#ifndef X86_WIN32
-  if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))
-    return FFI_BAD_ABI;
-#else
-  if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL))
-    return FFI_BAD_ABI;
-#endif
-
-  cif->abi = abi;
-  cif->arg_types = atypes;
-  cif->nargs = ntotalargs;
-  cif->rtype = rtype;
-
-  cif->flags = 0;
-
-  /* Initialize the return type if necessary */
-  if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
-    return FFI_BAD_TYPEDEF;
-
-  /* Perform a sanity check on the return type */
-  FFI_ASSERT_VALID_TYPE(cif->rtype);
-
-  /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */
-#if !defined M68K && !defined X86_ANY && !defined S390 && !defined PA
-  /* Make space for the return structure pointer */
-  if (cif->rtype->type == FFI_TYPE_STRUCT
-#ifdef SPARC
-      && (cif->abi != FFI_V9 || cif->rtype->size > 32)
-#endif
-#ifdef TILE
-      && (cif->rtype->size > 10 * FFI_SIZEOF_ARG)
-#endif
-#ifdef XTENSA
-      && (cif->rtype->size > 16)
-#endif
-
-     )
-    bytes = STACK_ARG_SIZE(sizeof(void*));
-#endif
-
-  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-    {
-
-      /* Initialize any uninitialized aggregate type definitions */
-      if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
-	return FFI_BAD_TYPEDEF;
-
-      /* Perform a sanity check on the argument type, do this
-	 check after the initialization.  */
-      FFI_ASSERT_VALID_TYPE(*ptr);
-
-#if !defined X86_ANY && !defined S390 && !defined PA
-#ifdef SPARC
-      if (((*ptr)->type == FFI_TYPE_STRUCT
-	   && ((*ptr)->size > 16 || cif->abi != FFI_V9))
-	  || ((*ptr)->type == FFI_TYPE_LONGDOUBLE
-	      && cif->abi != FFI_V9))
-	bytes += sizeof(void*);
-      else
-#endif
-	{
-	  /* Add any padding if necessary */
-	  if (((*ptr)->alignment - 1) & bytes)
-	    bytes = ALIGN(bytes, (*ptr)->alignment);
-
-#ifdef TILE
-	  if (bytes < 10 * FFI_SIZEOF_ARG &&
-	      bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG)
-	    {
-	      /* An argument is never split between the 10 parameter
-		 registers and the stack.  */
-	      bytes = 10 * FFI_SIZEOF_ARG;
-	    }
-#endif
-#ifdef XTENSA
-	  if (bytes <= 6*4 && bytes + STACK_ARG_SIZE((*ptr)->size) > 6*4)
-	    bytes = 6*4;
-#endif
-
-	  bytes += STACK_ARG_SIZE((*ptr)->size);
-	}
-#endif
-    }
-
-  cif->bytes = bytes;
-
-  /* Perform machine dependent cif processing */
-#ifdef FFI_TARGET_SPECIFIC_VARIADIC
-  if (isvariadic)
-	return ffi_prep_cif_machdep_var(cif, nfixedargs, ntotalargs);
-#endif
-
-  return ffi_prep_cif_machdep(cif);
-}
-#endif /* not __CRIS__ */
-
-ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
-			     ffi_type *rtype, ffi_type **atypes)
-{
-  return ffi_prep_cif_core(cif, abi, 0, nargs, nargs, rtype, atypes);
-}
-
-ffi_status ffi_prep_cif_var(ffi_cif *cif,
-                            ffi_abi abi,
-                            unsigned int nfixedargs,
-                            unsigned int ntotalargs,
-                            ffi_type *rtype,
-                            ffi_type **atypes)
-{
-  return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes);
-}
-
-#if FFI_CLOSURES
-
-ffi_status
-ffi_prep_closure (ffi_closure* closure,
-		  ffi_cif* cif,
-		  void (*fun)(ffi_cif*,void*,void**,void*),
-		  void *user_data)
-{
-  return ffi_prep_closure_loc (closure, cif, fun, user_data, closure);
-}
-
-#endif
diff --git a/lib/wrappers/libffi/gcc/types.c b/lib/wrappers/libffi/gcc/types.c
deleted file mode 100644
index 0a11eb0fb..000000000
--- a/lib/wrappers/libffi/gcc/types.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -----------------------------------------------------------------------
-   types.c - Copyright (c) 1996, 1998  Red Hat, Inc.
-   
-   Predefined ffi_types needed by libffi.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-/* Hide the basic type definitions from the header file, so that we
-   can redefine them here as "const".  */
-#define LIBFFI_HIDE_BASIC_TYPES
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-/* Type definitions */
-
-#define FFI_TYPEDEF(name, type, id)		\
-struct struct_align_##name {			\
-  char c;					\
-  type x;					\
-};						\
-const ffi_type ffi_type_##name = {		\
-  sizeof(type),					\
-  offsetof(struct struct_align_##name, x),	\
-  id, NULL					\
-}
-
-/* Size and alignment are fake here. They must not be 0. */
-const ffi_type ffi_type_void = {
-  1, 1, FFI_TYPE_VOID, NULL
-};
-
-FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8);
-FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8);
-FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16);
-FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16);
-FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32);
-FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32);
-FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64);
-FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64);
-
-FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER);
-
-FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT);
-FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE);
-
-#ifdef __alpha__
-/* Even if we're not configured to default to 128-bit long double, 
-   maintain binary compatibility, as -mlong-double-128 can be used
-   at any time.  */
-/* Validate the hard-coded number below.  */
-# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4
-#  error FFI_TYPE_LONGDOUBLE out of date
-# endif
-const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
-#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
-#endif
diff --git a/lib/wrappers/libffi/gcc/win32_asm.asm b/lib/wrappers/libffi/gcc/win32_asm.asm
deleted file mode 100644
index ce3c4f3f3..000000000
--- a/lib/wrappers/libffi/gcc/win32_asm.asm
+++ /dev/null
@@ -1,759 +0,0 @@
-/* -----------------------------------------------------------------------
-   win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009  Red Hat, Inc.
-	     Copyright (c) 2001  John Beniton
-	     Copyright (c) 2002  Ranjit Mathew
-	     Copyright (c) 2009  Daniel Witte
-			
- 
-   X86 Foreign Function Interface
- 
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
- 
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
- 
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   -----------------------------------------------------------------------
-   */
- 
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#include <ffitarget.h>
-
-	.text
- 
-        // This assumes we are using gas.
-        .balign 16
-	.globl	_ffi_call_win32
-#ifndef __OS2__
-	.def	_ffi_call_win32;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_call_win32:
-.LFB1:
-        pushl %ebp
-.LCFI0:
-        movl  %esp,%ebp
-.LCFI1:
-        // Make room for all of the new args.
-        movl  20(%ebp),%ecx                                                     
-        subl  %ecx,%esp
- 
-        movl  %esp,%eax
- 
-        // Place all of the ffi_prep_args in position
-        pushl 12(%ebp)
-        pushl %eax
-        call  *8(%ebp)
- 
-        // Return stack to previous state and call the function
-        addl  $8,%esp
-
-	// Handle fastcall and thiscall
-	cmpl $3, 16(%ebp)  // FFI_THISCALL
-	jz .do_thiscall
-	cmpl $4, 16(%ebp) // FFI_FASTCALL
-	jnz .do_fncall
-	movl (%esp), %ecx
-	movl 4(%esp), %edx
-	addl $8, %esp
-	jmp .do_fncall
-.do_thiscall:
-	movl (%esp), %ecx
-	addl $4, %esp
-
-.do_fncall:
-	 
-        // FIXME: Align the stack to a 128-bit boundary to avoid
-        // potential performance hits.
-
-        call  *32(%ebp)
- 
-        // stdcall functions pop arguments off the stack themselves
-
-        // Load %ecx with the return type code
-        movl  24(%ebp),%ecx
- 
-        // If the return value pointer is NULL, assume no return value.
-        cmpl  $0,28(%ebp)
-        jne   0f
- 
-        // Even if there is no space for the return value, we are
-        // obliged to handle floating-point values.
-        cmpl  $FFI_TYPE_FLOAT,%ecx
-        jne   .Lnoretval
-        fstp  %st(0)
- 
-        jmp   .Lepilogue
-
-0:
-	call	1f
-	// Do not insert anything here between the call and the jump table.
-.Lstore_table:
-	.long	.Lnoretval		/* FFI_TYPE_VOID */
-	.long	.Lretint		/* FFI_TYPE_INT */
-	.long	.Lretfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lretdouble		/* FFI_TYPE_DOUBLE */
-	.long	.Lretlongdouble		/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lretuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lretsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lretuint16		/* FFI_TYPE_UINT16 */
-	.long	.Lretsint16		/* FFI_TYPE_SINT16 */
-	.long	.Lretint		/* FFI_TYPE_UINT32 */
-	.long	.Lretint		/* FFI_TYPE_SINT32 */
-	.long	.Lretint64		/* FFI_TYPE_UINT64 */
-	.long	.Lretint64		/* FFI_TYPE_SINT64 */
-	.long	.Lretstruct		/* FFI_TYPE_STRUCT */
-	.long	.Lretint		/* FFI_TYPE_POINTER */
-	.long	.Lretstruct1b		/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lretstruct2b		/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lretstruct4b		/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lretstruct		/* FFI_TYPE_MS_STRUCT */
-1:
-	add	%ecx, %ecx
-	add	%ecx, %ecx
-	add	(%esp),%ecx
-	add	$4, %esp
-	jmp	*(%ecx)
-
-	/* Sign/zero extend as appropriate.  */
-.Lretsint8:
-	movsbl	%al, %eax
-	jmp	.Lretint
-
-.Lretsint16:
-	movswl	%ax, %eax
-	jmp	.Lretint
-
-.Lretuint8:
-	movzbl	%al, %eax
-	jmp	.Lretint
-
-.Lretuint16:
-	movzwl	%ax, %eax
-	jmp	.Lretint
-
-.Lretint:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        movl  %eax,0(%ecx)
-        jmp   .Lepilogue
- 
-.Lretfloat:
-         // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        fstps (%ecx)
-        jmp   .Lepilogue
- 
-.Lretdouble:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        fstpl (%ecx)
-        jmp   .Lepilogue
- 
-.Lretlongdouble:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        fstpt (%ecx)
-        jmp   .Lepilogue
- 
-.Lretint64:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        movl  %eax,0(%ecx)
-        movl  %edx,4(%ecx)
-	jmp   .Lepilogue
-
-.Lretstruct1b:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        movb  %al,0(%ecx)
-        jmp   .Lepilogue
- 
-.Lretstruct2b:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        movw  %ax,0(%ecx)
-        jmp   .Lepilogue
-
-.Lretstruct4b:
-        // Load %ecx with the pointer to storage for the return value
-        movl  28(%ebp),%ecx
-        movl  %eax,0(%ecx)
-        jmp   .Lepilogue
-
-.Lretstruct:
-        // Nothing to do!
- 
-.Lnoretval:
-.Lepilogue:
-        movl %ebp,%esp
-        popl %ebp
-        ret
-.ffi_call_win32_end:
-        .balign 16
-	.globl	_ffi_closure_THISCALL
-#ifndef __OS2__
-	.def	_ffi_closure_THISCALL;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_closure_THISCALL:
-	pushl	%ebp
-	movl	%esp, %ebp
-	subl	$40, %esp
-	leal	-24(%ebp), %edx
-	movl	%edx, -12(%ebp)	/* resp */
-	leal	12(%ebp), %edx  /* account for stub return address on stack */
-	jmp	.stub
-.LFE1:
-
-        // This assumes we are using gas.
-        .balign 16
-	.globl	_ffi_closure_SYSV
-#ifndef __OS2__
-	.def	_ffi_closure_SYSV;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_closure_SYSV:
-.LFB3:
-	pushl	%ebp
-.LCFI4:
-	movl	%esp, %ebp
-.LCFI5:
-	subl	$40, %esp
-	leal	-24(%ebp), %edx
-	movl	%edx, -12(%ebp)	/* resp */
-	leal	8(%ebp), %edx
-.stub:
-	movl	%edx, 4(%esp)	/* args = __builtin_dwarf_cfa () */
-	leal	-12(%ebp), %edx
-	movl	%edx, (%esp)	/* &resp */
-	call	_ffi_closure_SYSV_inner
-	movl	-12(%ebp), %ecx
-
-0:
-	call	1f
-	// Do not insert anything here between the call and the jump table.
-.Lcls_store_table:
-	.long	.Lcls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lcls_retint		/* FFI_TYPE_INT */
-	.long	.Lcls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lcls_retdouble		/* FFI_TYPE_DOUBLE */
-	.long	.Lcls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lcls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lcls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lcls_retuint16		/* FFI_TYPE_UINT16 */
-	.long	.Lcls_retsint16		/* FFI_TYPE_SINT16 */
-	.long	.Lcls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lcls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lcls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lcls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lcls_retstruct		/* FFI_TYPE_STRUCT */
-	.long	.Lcls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lcls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lcls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lcls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lcls_retmsstruct	/* FFI_TYPE_MS_STRUCT */
-
-1:
-	add	%eax, %eax
-	add	%eax, %eax
-	add	(%esp),%eax
-	add	$4, %esp
-	jmp	*(%eax)
-
-	/* Sign/zero extend as appropriate.  */
-.Lcls_retsint8:
-	movsbl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retsint16:
-	movswl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retuint8:
-	movzbl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retuint16:
-	movzwl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retint:
-	movl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retfloat:
-	flds	(%ecx)
-	jmp	.Lcls_epilogue
-
-.Lcls_retdouble:
-	fldl	(%ecx)
-	jmp	.Lcls_epilogue
-
-.Lcls_retldouble:
-	fldt	(%ecx)
-	jmp	.Lcls_epilogue
-
-.Lcls_retllong:
-	movl	(%ecx), %eax
-	movl	4(%ecx), %edx
-	jmp	.Lcls_epilogue
-
-.Lcls_retstruct1:
-	movsbl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retstruct2:
-	movswl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retstruct4:
-	movl	(%ecx), %eax
-	jmp	.Lcls_epilogue
-
-.Lcls_retstruct:
-        // Caller expects us to pop struct return value pointer hidden arg.
-	movl	%ebp, %esp
-	popl	%ebp
-	ret	$0x4
-
-.Lcls_retmsstruct:
-	// Caller expects us to return a pointer to the real return value.
-	mov	%ecx, %eax
-	// Caller doesn't expects us to pop struct return value pointer hidden arg.
-	jmp	.Lcls_epilogue
-
-.Lcls_noretval:
-.Lcls_epilogue:
-	movl	%ebp, %esp
-	popl	%ebp
-	ret
-.ffi_closure_SYSV_end:
-.LFE3:
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-        .balign 16
-	.globl	_ffi_closure_raw_THISCALL
-#ifndef __OS2__
-	.def	_ffi_closure_raw_THISCALL;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_closure_raw_THISCALL:
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%esi
-	subl	$36, %esp
-	movl	RAW_CLOSURE_CIF_OFFSET(%eax), %esi	 /* closure->cif */
-	movl	RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
-	movl	%edx, 12(%esp)	/* user_data */
-	leal	12(%ebp), %edx	/* __builtin_dwarf_cfa () */
-	jmp	.stubraw
-        // This assumes we are using gas.
-        .balign 16
-	.globl	_ffi_closure_raw_SYSV
-#ifndef __OS2__
-	.def	_ffi_closure_raw_SYSV;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_closure_raw_SYSV:
-.LFB4:
-	pushl	%ebp
-.LCFI6:
-	movl	%esp, %ebp
-.LCFI7:
-	pushl	%esi
-.LCFI8:
-	subl	$36, %esp
-	movl	RAW_CLOSURE_CIF_OFFSET(%eax), %esi	 /* closure->cif */
-	movl	RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
-	movl	%edx, 12(%esp)	/* user_data */
-	leal	8(%ebp), %edx	/* __builtin_dwarf_cfa () */
-.stubraw:
-	movl	%edx, 8(%esp)	/* raw_args */
-	leal	-24(%ebp), %edx
-	movl	%edx, 4(%esp)	/* &res */
-	movl	%esi, (%esp)	/* cif */
-	call	*RAW_CLOSURE_FUN_OFFSET(%eax)		 /* closure->fun */
-	movl	CIF_FLAGS_OFFSET(%esi), %eax		 /* rtype */
-0:
-	call	1f
-	// Do not insert anything here between the call and the jump table.
-.Lrcls_store_table:
-	.long	.Lrcls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lrcls_retint		/* FFI_TYPE_INT */
-	.long	.Lrcls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lrcls_retdouble	/* FFI_TYPE_DOUBLE */
-	.long	.Lrcls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lrcls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lrcls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lrcls_retuint16	/* FFI_TYPE_UINT16 */
-	.long	.Lrcls_retsint16	/* FFI_TYPE_SINT16 */
-	.long	.Lrcls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lrcls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lrcls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lrcls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lrcls_retstruct	/* FFI_TYPE_STRUCT */
-	.long	.Lrcls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lrcls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lrcls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lrcls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
-	.long	.Lrcls_retstruct	/* FFI_TYPE_MS_STRUCT */
-1:
-	add	%eax, %eax
-	add	%eax, %eax
-	add	(%esp),%eax
-	add	$4, %esp
-	jmp	*(%eax)
-
-	/* Sign/zero extend as appropriate.  */
-.Lrcls_retsint8:
-	movsbl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retsint16:
-	movswl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retuint8:
-	movzbl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retuint16:
-	movzwl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retint:
-	movl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retfloat:
-	flds	-24(%ebp)
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retdouble:
-	fldl	-24(%ebp)
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retldouble:
-	fldt	-24(%ebp)
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retllong:
-	movl	-24(%ebp), %eax
-	movl	-20(%ebp), %edx
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retstruct1:
-	movsbl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retstruct2:
-	movswl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retstruct4:
-	movl	-24(%ebp), %eax
-	jmp	.Lrcls_epilogue
-
-.Lrcls_retstruct:
-	// Nothing to do!
-
-.Lrcls_noretval:
-.Lrcls_epilogue:
-	addl	$36, %esp
-	popl	%esi
-	popl	%ebp
-	ret
-.ffi_closure_raw_SYSV_end:
-.LFE4:
-
-#endif /* !FFI_NO_RAW_API */
-
-        // This assumes we are using gas.
-	.balign	16
-	.globl	_ffi_closure_STDCALL
-#ifndef __OS2__
-	.def	_ffi_closure_STDCALL;	.scl	2;	.type	32;	.endef
-#endif
-_ffi_closure_STDCALL:
-.LFB5:
-	pushl	%ebp
-.LCFI9:
-	movl	%esp, %ebp
-.LCFI10:
-	subl	$40, %esp
-	leal	-24(%ebp), %edx
-	movl	%edx, -12(%ebp)	/* resp */
-	leal	12(%ebp), %edx  /* account for stub return address on stack */
-	movl	%edx, 4(%esp)	/* args */
-	leal	-12(%ebp), %edx
-	movl	%edx, (%esp)	/* &resp */
-	call	_ffi_closure_SYSV_inner
-	movl	-12(%ebp), %ecx
-0:
-	call	1f
-	// Do not insert anything here between the call and the jump table.
-.Lscls_store_table:
-	.long	.Lscls_noretval		/* FFI_TYPE_VOID */
-	.long	.Lscls_retint		/* FFI_TYPE_INT */
-	.long	.Lscls_retfloat		/* FFI_TYPE_FLOAT */
-	.long	.Lscls_retdouble	/* FFI_TYPE_DOUBLE */
-	.long	.Lscls_retldouble	/* FFI_TYPE_LONGDOUBLE */
-	.long	.Lscls_retuint8		/* FFI_TYPE_UINT8 */
-	.long	.Lscls_retsint8		/* FFI_TYPE_SINT8 */
-	.long	.Lscls_retuint16	/* FFI_TYPE_UINT16 */
-	.long	.Lscls_retsint16	/* FFI_TYPE_SINT16 */
-	.long	.Lscls_retint		/* FFI_TYPE_UINT32 */
-	.long	.Lscls_retint		/* FFI_TYPE_SINT32 */
-	.long	.Lscls_retllong		/* FFI_TYPE_UINT64 */
-	.long	.Lscls_retllong		/* FFI_TYPE_SINT64 */
-	.long	.Lscls_retstruct	/* FFI_TYPE_STRUCT */
-	.long	.Lscls_retint		/* FFI_TYPE_POINTER */
-	.long	.Lscls_retstruct1	/* FFI_TYPE_SMALL_STRUCT_1B */
-	.long	.Lscls_retstruct2	/* FFI_TYPE_SMALL_STRUCT_2B */
-	.long	.Lscls_retstruct4	/* FFI_TYPE_SMALL_STRUCT_4B */
-1:
-	add	%eax, %eax
-	add	%eax, %eax
-	add	(%esp),%eax
-	add	$4, %esp
-	jmp	*(%eax)
-
-	/* Sign/zero extend as appropriate.  */
-.Lscls_retsint8:
-	movsbl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retsint16:
-	movswl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retuint8:
-	movzbl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retuint16:
-	movzwl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retint:
-	movl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retfloat:
-	flds	(%ecx)
-	jmp	.Lscls_epilogue
-
-.Lscls_retdouble:
-	fldl	(%ecx)
-	jmp	.Lscls_epilogue
-
-.Lscls_retldouble:
-	fldt	(%ecx)
-	jmp	.Lscls_epilogue
-
-.Lscls_retllong:
-	movl	(%ecx), %eax
-	movl	4(%ecx), %edx
-	jmp	.Lscls_epilogue
-
-.Lscls_retstruct1:
-	movsbl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retstruct2:
-	movswl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retstruct4:
-	movl	(%ecx), %eax
-	jmp	.Lscls_epilogue
-
-.Lscls_retstruct:
-	// Nothing to do!
-
-.Lscls_noretval:
-.Lscls_epilogue:
-	movl	%ebp, %esp
-	popl	%ebp
-	ret
-.ffi_closure_STDCALL_end:
-.LFE5:
-
-#ifndef __OS2__
-	.section	.eh_frame,"w"
-#endif
-.Lframe1:
-.LSCIE1:
-	.long	.LECIE1-.LASCIE1  /* Length of Common Information Entry */
-.LASCIE1:
-	.long	0x0	/* CIE Identifier Tag */
-	.byte	0x1	/* CIE Version */
-#ifdef __PIC__
-	.ascii "zR\0"	/* CIE Augmentation */
-#else
-	.ascii "\0"	/* CIE Augmentation */
-#endif
-	.byte	0x1	/* .uleb128 0x1; CIE Code Alignment Factor */
-	.byte	0x7c	/* .sleb128 -4; CIE Data Alignment Factor */
-	.byte	0x8	/* CIE RA Column */
-#ifdef __PIC__
-	.byte	0x1	/* .uleb128 0x1; Augmentation size */
-	.byte	0x1b	/* FDE Encoding (pcrel sdata4) */
-#endif
-	.byte	0xc	/* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */
-	.byte	0x4	/* .uleb128 0x4 */
-	.byte	0x4	/* .uleb128 0x4 */
-	.byte	0x88	/* DW_CFA_offset, column 0x8 %eip at CFA + 1 * -4 */
-	.byte	0x1	/* .uleb128 0x1 */
-	.align 4
-.LECIE1:
-
-.LSFDE1:
-	.long	.LEFDE1-.LASFDE1	/* FDE Length */
-.LASFDE1:
-	.long	.LASFDE1-.Lframe1	/* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
-	.long	.LFB1-.	/* FDE initial location */
-#else
-	.long	.LFB1
-#endif
-	.long	.LFE1-.LFB1	/* FDE address range */
-#ifdef __PIC__
-	.byte	0x0	/* .uleb128 0x0; Augmentation size */
-#endif
-	/* DW_CFA_xxx CFI instructions go here.  */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI0-.LFB1
-	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
-	.byte	0x8	/* .uleb128 0x8 */
-	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
-	.byte	0x2	/* .uleb128 0x2 */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI1-.LCFI0
-	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
-	.byte	0x5	/* .uleb128 0x5 */
-
-	/* End of DW_CFA_xxx CFI instructions.  */
-	.align 4
-.LEFDE1:
-
-
-.LSFDE3:
-	.long	.LEFDE3-.LASFDE3	/* FDE Length */
-.LASFDE3:
-	.long	.LASFDE3-.Lframe1	/* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
-	.long	.LFB3-.	/* FDE initial location */
-#else
-	.long	.LFB3
-#endif
-	.long	.LFE3-.LFB3	/* FDE address range */
-#ifdef __PIC__
-	.byte	0x0	/* .uleb128 0x0; Augmentation size */
-#endif
-	/* DW_CFA_xxx CFI instructions go here.  */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI4-.LFB3
-	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
-	.byte	0x8	/* .uleb128 0x8 */
-	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
-	.byte	0x2	/* .uleb128 0x2 */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI5-.LCFI4
-	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
-	.byte	0x5	/* .uleb128 0x5 */
-
-	/* End of DW_CFA_xxx CFI instructions.  */
-	.align 4
-.LEFDE3:
-
-#if !FFI_NO_RAW_API
-
-.LSFDE4:
-	.long	.LEFDE4-.LASFDE4	/* FDE Length */
-.LASFDE4:
-	.long	.LASFDE4-.Lframe1	/* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
-	.long	.LFB4-.	/* FDE initial location */
-#else
-	.long	.LFB4
-#endif
-	.long	.LFE4-.LFB4	/* FDE address range */
-#ifdef __PIC__
-	.byte	0x0	/* .uleb128 0x0; Augmentation size */
-#endif
-	/* DW_CFA_xxx CFI instructions go here.  */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI6-.LFB4
-	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
-	.byte	0x8	/* .uleb128 0x8 */
-	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
-	.byte	0x2	/* .uleb128 0x2 */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI7-.LCFI6
-	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
-	.byte	0x5	/* .uleb128 0x5 */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI8-.LCFI7
-	.byte	0x86	/* DW_CFA_offset, column 0x6 %esi at CFA + 3 * -4 */
-	.byte	0x3	/* .uleb128 0x3 */
-
-	/* End of DW_CFA_xxx CFI instructions.  */
-	.align 4
-.LEFDE4:
-
-#endif /* !FFI_NO_RAW_API */
-
-.LSFDE5:
-	.long	.LEFDE5-.LASFDE5	/* FDE Length */
-.LASFDE5:
-	.long	.LASFDE5-.Lframe1	/* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
-	.long	.LFB5-.	/* FDE initial location */
-#else
-	.long	.LFB5
-#endif
-	.long	.LFE5-.LFB5	/* FDE address range */
-#ifdef __PIC__
-	.byte	0x0	/* .uleb128 0x0; Augmentation size */
-#endif
-	/* DW_CFA_xxx CFI instructions go here.  */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI9-.LFB5
-	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
-	.byte	0x8	/* .uleb128 0x8 */
-	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
-	.byte	0x2	/* .uleb128 0x2 */
-
-	.byte	0x4	/* DW_CFA_advance_loc4 */
-	.long	.LCFI10-.LCFI9
-	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
-	.byte	0x5	/* .uleb128 0x5 */
-
-	/* End of DW_CFA_xxx CFI instructions.  */
-	.align 4
-.LEFDE5:
diff --git a/lib/wrappers/libffi/gcc/win32_asm.s b/lib/wrappers/libffi/gcc/win32_asm.s
deleted file mode 100644
index 7a3e7f16c..000000000
--- a/lib/wrappers/libffi/gcc/win32_asm.s
+++ /dev/null
@@ -1,736 +0,0 @@
-# 1 "gcc\\win32_asm.asm"

-# 1 "<command-line>"

-# 1 "gcc\\win32_asm.asm"

-# 33 "gcc\\win32_asm.asm"

-# 1 "common/fficonfig.h" 1

-# 34 "gcc\\win32_asm.asm" 2

-# 1 "common/ffi.h" 1

-# 63 "common/ffi.h"

-# 1 "common/ffitarget.h" 1

-# 64 "common/ffi.h" 2

-# 35 "gcc\\win32_asm.asm" 2

-

-

- .text

-

-

-        .balign 16

- .globl _ffi_call_win32

-

- .def _ffi_call_win32; .scl 2; .type 32; .endef

-

-_ffi_call_win32:

-.LFB1:

-        pushl %ebp

-.LCFI0:

-        movl %esp,%ebp

-.LCFI1:

-

-        movl 20(%ebp),%ecx

-        subl %ecx,%esp

-

-        movl %esp,%eax

-

-

-        pushl 12(%ebp)

-        pushl %eax

-        call *8(%ebp)

-

-

-        addl $8,%esp

-

-

- cmpl $3, 16(%ebp)

- jz .do_thiscall

- cmpl $4, 16(%ebp)

- jnz .do_fncall

- movl (%esp), %ecx

- movl 4(%esp), %edx

- addl $8, %esp

- jmp .do_fncall

-.do_thiscall:

- movl (%esp), %ecx

- addl $4, %esp

-

-.do_fncall:

-

-

-

-

-        call *32(%ebp)

-

-

-

-

-        movl 24(%ebp),%ecx

-

-

-        cmpl $0,28(%ebp)

-        jne 0f

-

-

-

-        cmpl $2,%ecx

-        jne .Lnoretval

-        fstp %st(0)

-

-        jmp .Lepilogue

-

-0:

- call 1f

-

-.Lstore_table:

- .long .Lnoretval

- .long .Lretint

- .long .Lretfloat

- .long .Lretdouble

- .long .Lretlongdouble

- .long .Lretuint8

- .long .Lretsint8

- .long .Lretuint16

- .long .Lretsint16

- .long .Lretint

- .long .Lretint

- .long .Lretint64

- .long .Lretint64

- .long .Lretstruct

- .long .Lretint

- .long .Lretstruct1b

- .long .Lretstruct2b

- .long .Lretstruct4b

- .long .Lretstruct

-1:

- add %ecx, %ecx

- add %ecx, %ecx

- add (%esp),%ecx

- add $4, %esp

- jmp *(%ecx)

-

-

-.Lretsint8:

- movsbl %al, %eax

- jmp .Lretint

-

-.Lretsint16:

- movswl %ax, %eax

- jmp .Lretint

-

-.Lretuint8:

- movzbl %al, %eax

- jmp .Lretint

-

-.Lretuint16:

- movzwl %ax, %eax

- jmp .Lretint

-

-.Lretint:

-

-        movl 28(%ebp),%ecx

-        movl %eax,0(%ecx)

-        jmp .Lepilogue

-

-.Lretfloat:

-

-        movl 28(%ebp),%ecx

-        fstps (%ecx)

-        jmp .Lepilogue

-

-.Lretdouble:

-

-        movl 28(%ebp),%ecx

-        fstpl (%ecx)

-        jmp .Lepilogue

-

-.Lretlongdouble:

-

-        movl 28(%ebp),%ecx

-        fstpt (%ecx)

-        jmp .Lepilogue

-

-.Lretint64:

-

-        movl 28(%ebp),%ecx

-        movl %eax,0(%ecx)

-        movl %edx,4(%ecx)

- jmp .Lepilogue

-

-.Lretstruct1b:

-

-        movl 28(%ebp),%ecx

-        movb %al,0(%ecx)

-        jmp .Lepilogue

-

-.Lretstruct2b:

-

-        movl 28(%ebp),%ecx

-        movw %ax,0(%ecx)

-        jmp .Lepilogue

-

-.Lretstruct4b:

-

-        movl 28(%ebp),%ecx

-        movl %eax,0(%ecx)

-        jmp .Lepilogue

-

-.Lretstruct:

-

-

-.Lnoretval:

-.Lepilogue:

-        movl %ebp,%esp

-        popl %ebp

-        ret

-.ffi_call_win32_end:

-        .balign 16

- .globl _ffi_closure_THISCALL

-

- .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef

-

-_ffi_closure_THISCALL:

- pushl %ebp

- movl %esp, %ebp

- subl $40, %esp

- leal -24(%ebp), %edx

- movl %edx, -12(%ebp)

- leal 12(%ebp), %edx

- jmp .stub

-.LFE1:

-

-

-        .balign 16

- .globl _ffi_closure_SYSV

-

- .def _ffi_closure_SYSV; .scl 2; .type 32; .endef

-

-_ffi_closure_SYSV:

-.LFB3:

- pushl %ebp

-.LCFI4:

- movl %esp, %ebp

-.LCFI5:

- subl $40, %esp

- leal -24(%ebp), %edx

- movl %edx, -12(%ebp)

- leal 8(%ebp), %edx

-.stub:

- movl %edx, 4(%esp)

- leal -12(%ebp), %edx

- movl %edx, (%esp)

- call _ffi_closure_SYSV_inner

- movl -12(%ebp), %ecx

-

-0:

- call 1f

-

-.Lcls_store_table:

- .long .Lcls_noretval

- .long .Lcls_retint

- .long .Lcls_retfloat

- .long .Lcls_retdouble

- .long .Lcls_retldouble

- .long .Lcls_retuint8

- .long .Lcls_retsint8

- .long .Lcls_retuint16

- .long .Lcls_retsint16

- .long .Lcls_retint

- .long .Lcls_retint

- .long .Lcls_retllong

- .long .Lcls_retllong

- .long .Lcls_retstruct

- .long .Lcls_retint

- .long .Lcls_retstruct1

- .long .Lcls_retstruct2

- .long .Lcls_retstruct4

- .long .Lcls_retmsstruct

-

-1:

- add %eax, %eax

- add %eax, %eax

- add (%esp),%eax

- add $4, %esp

- jmp *(%eax)

-

-

-.Lcls_retsint8:

- movsbl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retsint16:

- movswl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retuint8:

- movzbl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retuint16:

- movzwl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retint:

- movl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retfloat:

- flds (%ecx)

- jmp .Lcls_epilogue

-

-.Lcls_retdouble:

- fldl (%ecx)

- jmp .Lcls_epilogue

-

-.Lcls_retldouble:

- fldt (%ecx)

- jmp .Lcls_epilogue

-

-.Lcls_retllong:

- movl (%ecx), %eax

- movl 4(%ecx), %edx

- jmp .Lcls_epilogue

-

-.Lcls_retstruct1:

- movsbl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retstruct2:

- movswl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retstruct4:

- movl (%ecx), %eax

- jmp .Lcls_epilogue

-

-.Lcls_retstruct:

-

- movl %ebp, %esp

- popl %ebp

- ret $0x4

-

-.Lcls_retmsstruct:

-

- mov %ecx, %eax

-

- jmp .Lcls_epilogue

-

-.Lcls_noretval:

-.Lcls_epilogue:

- movl %ebp, %esp

- popl %ebp

- ret

-.ffi_closure_SYSV_end:

-.LFE3:

-

-

-

-

-

-

-

-        .balign 16

- .globl _ffi_closure_raw_THISCALL

-

- .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef

-

-_ffi_closure_raw_THISCALL:

- pushl %ebp

- movl %esp, %ebp

- pushl %esi

- subl $36, %esp

- movl ((52 + 3) & ~3)(%eax), %esi

- movl ((((52 + 3) & ~3) + 4) + 4)(%eax), %edx

- movl %edx, 12(%esp)

- leal 12(%ebp), %edx

- jmp .stubraw

-

-        .balign 16

- .globl _ffi_closure_raw_SYSV

-

- .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef

-

-_ffi_closure_raw_SYSV:

-.LFB4:

- pushl %ebp

-.LCFI6:

- movl %esp, %ebp

-.LCFI7:

- pushl %esi

-.LCFI8:

- subl $36, %esp

- movl ((52 + 3) & ~3)(%eax), %esi

- movl ((((52 + 3) & ~3) + 4) + 4)(%eax), %edx

- movl %edx, 12(%esp)

- leal 8(%ebp), %edx

-.stubraw:

- movl %edx, 8(%esp)

- leal -24(%ebp), %edx

- movl %edx, 4(%esp)

- movl %esi, (%esp)

- call *(((52 + 3) & ~3) + 4)(%eax)

- movl 20(%esi), %eax

-0:

- call 1f

-

-.Lrcls_store_table:

- .long .Lrcls_noretval

- .long .Lrcls_retint

- .long .Lrcls_retfloat

- .long .Lrcls_retdouble

- .long .Lrcls_retldouble

- .long .Lrcls_retuint8

- .long .Lrcls_retsint8

- .long .Lrcls_retuint16

- .long .Lrcls_retsint16

- .long .Lrcls_retint

- .long .Lrcls_retint

- .long .Lrcls_retllong

- .long .Lrcls_retllong

- .long .Lrcls_retstruct

- .long .Lrcls_retint

- .long .Lrcls_retstruct1

- .long .Lrcls_retstruct2

- .long .Lrcls_retstruct4

- .long .Lrcls_retstruct

-1:

- add %eax, %eax

- add %eax, %eax

- add (%esp),%eax

- add $4, %esp

- jmp *(%eax)

-

-

-.Lrcls_retsint8:

- movsbl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retsint16:

- movswl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retuint8:

- movzbl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retuint16:

- movzwl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retint:

- movl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retfloat:

- flds -24(%ebp)

- jmp .Lrcls_epilogue

-

-.Lrcls_retdouble:

- fldl -24(%ebp)

- jmp .Lrcls_epilogue

-

-.Lrcls_retldouble:

- fldt -24(%ebp)

- jmp .Lrcls_epilogue

-

-.Lrcls_retllong:

- movl -24(%ebp), %eax

- movl -20(%ebp), %edx

- jmp .Lrcls_epilogue

-

-.Lrcls_retstruct1:

- movsbl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retstruct2:

- movswl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retstruct4:

- movl -24(%ebp), %eax

- jmp .Lrcls_epilogue

-

-.Lrcls_retstruct:

-

-

-.Lrcls_noretval:

-.Lrcls_epilogue:

- addl $36, %esp

- popl %esi

- popl %ebp

- ret

-.ffi_closure_raw_SYSV_end:

-.LFE4:

-

-

-

-

- .balign 16

- .globl _ffi_closure_STDCALL

-

- .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef

-

-_ffi_closure_STDCALL:

-.LFB5:

- pushl %ebp

-.LCFI9:

- movl %esp, %ebp

-.LCFI10:

- subl $40, %esp

- leal -24(%ebp), %edx

- movl %edx, -12(%ebp)

- leal 12(%ebp), %edx

- movl %edx, 4(%esp)

- leal -12(%ebp), %edx

- movl %edx, (%esp)

- call _ffi_closure_SYSV_inner

- movl -12(%ebp), %ecx

-0:

- call 1f

-

-.Lscls_store_table:

- .long .Lscls_noretval

- .long .Lscls_retint

- .long .Lscls_retfloat

- .long .Lscls_retdouble

- .long .Lscls_retldouble

- .long .Lscls_retuint8

- .long .Lscls_retsint8

- .long .Lscls_retuint16

- .long .Lscls_retsint16

- .long .Lscls_retint

- .long .Lscls_retint

- .long .Lscls_retllong

- .long .Lscls_retllong

- .long .Lscls_retstruct

- .long .Lscls_retint

- .long .Lscls_retstruct1

- .long .Lscls_retstruct2

- .long .Lscls_retstruct4

-1:

- add %eax, %eax

- add %eax, %eax

- add (%esp),%eax

- add $4, %esp

- jmp *(%eax)

-

-

-.Lscls_retsint8:

- movsbl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retsint16:

- movswl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retuint8:

- movzbl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retuint16:

- movzwl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retint:

- movl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retfloat:

- flds (%ecx)

- jmp .Lscls_epilogue

-

-.Lscls_retdouble:

- fldl (%ecx)

- jmp .Lscls_epilogue

-

-.Lscls_retldouble:

- fldt (%ecx)

- jmp .Lscls_epilogue

-

-.Lscls_retllong:

- movl (%ecx), %eax

- movl 4(%ecx), %edx

- jmp .Lscls_epilogue

-

-.Lscls_retstruct1:

- movsbl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retstruct2:

- movswl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retstruct4:

- movl (%ecx), %eax

- jmp .Lscls_epilogue

-

-.Lscls_retstruct:

-

-

-.Lscls_noretval:

-.Lscls_epilogue:

- movl %ebp, %esp

- popl %ebp

- ret

-.ffi_closure_STDCALL_end:

-.LFE5:

-

-

- .section .eh_frame,"w"

-

-.Lframe1:

-.LSCIE1:

- .long .LECIE1-.LASCIE1

-.LASCIE1:

- .long 0x0

- .byte 0x1

-

-

-

- .ascii "\0"

-

- .byte 0x1

- .byte 0x7c

- .byte 0x8

-

-

-

-

- .byte 0xc

- .byte 0x4

- .byte 0x4

- .byte 0x88

- .byte 0x1

- .align 4

-.LECIE1:

-

-.LSFDE1:

- .long .LEFDE1-.LASFDE1

-.LASFDE1:

- .long .LASFDE1-.Lframe1

-

-

-

- .long .LFB1

-

- .long .LFE1-.LFB1

-

-

-

-

-

- .byte 0x4

- .long .LCFI0-.LFB1

- .byte 0xe

- .byte 0x8

- .byte 0x85

- .byte 0x2

-

- .byte 0x4

- .long .LCFI1-.LCFI0

- .byte 0xd

- .byte 0x5

-

-

- .align 4

-.LEFDE1:

-

-

-.LSFDE3:

- .long .LEFDE3-.LASFDE3

-.LASFDE3:

- .long .LASFDE3-.Lframe1

-

-

-

- .long .LFB3

-

- .long .LFE3-.LFB3

-

-

-

-

-

- .byte 0x4

- .long .LCFI4-.LFB3

- .byte 0xe

- .byte 0x8

- .byte 0x85

- .byte 0x2

-

- .byte 0x4

- .long .LCFI5-.LCFI4

- .byte 0xd

- .byte 0x5

-

-

- .align 4

-.LEFDE3:

-

-

-

-.LSFDE4:

- .long .LEFDE4-.LASFDE4

-.LASFDE4:

- .long .LASFDE4-.Lframe1

-

-

-

- .long .LFB4

-

- .long .LFE4-.LFB4

-

-

-

-

-

- .byte 0x4

- .long .LCFI6-.LFB4

- .byte 0xe

- .byte 0x8

- .byte 0x85

- .byte 0x2

-

- .byte 0x4

- .long .LCFI7-.LCFI6

- .byte 0xd

- .byte 0x5

-

- .byte 0x4

- .long .LCFI8-.LCFI7

- .byte 0x86

- .byte 0x3

-

-

- .align 4

-.LEFDE4:

-

-

-

-.LSFDE5:

- .long .LEFDE5-.LASFDE5

-.LASFDE5:

- .long .LASFDE5-.Lframe1

-

-

-

- .long .LFB5

-

- .long .LFE5-.LFB5

-

-

-

-

-

- .byte 0x4

- .long .LCFI9-.LFB5

- .byte 0xe

- .byte 0x8

- .byte 0x85

- .byte 0x2

-

- .byte 0x4

- .long .LCFI10-.LCFI9

- .byte 0xd

- .byte 0x5

-

-

- .align 4

-.LEFDE5:

diff --git a/lib/wrappers/libffi/gcc/win64_asm.asm b/lib/wrappers/libffi/gcc/win64_asm.asm
deleted file mode 100644
index 1dc98f99a..000000000
--- a/lib/wrappers/libffi/gcc/win64_asm.asm
+++ /dev/null
@@ -1,467 +0,0 @@
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-	
-/* Constants for ffi_call_win64 */	
-#define STACK 0
-#define PREP_ARGS_FN 32
-#define ECIF 40
-#define CIF_BYTES 48
-#define CIF_FLAGS 56
-#define RVALUE 64
-#define FN 72
-
-/* ffi_call_win64 (void (*prep_args_fn)(char *, extended_cif *),
-                   extended_cif *ecif, unsigned bytes, unsigned flags,
-                   unsigned *rvalue, void (*fn)());
- */
-
-#ifdef _MSC_VER
-PUBLIC	ffi_call_win64
-
-EXTRN	__chkstk:NEAR
-EXTRN	ffi_closure_win64_inner:NEAR
-
-_TEXT	SEGMENT
-
-;;; ffi_closure_win64 will be called with these registers set:
-;;;    rax points to 'closure'
-;;;    r11 contains a bit mask that specifies which of the
-;;;    first four parameters are float or double
-;;;
-;;; It must move the parameters passed in registers to their stack location,
-;;; call ffi_closure_win64_inner for the actual work, then return the result.
-;;; 
-ffi_closure_win64 PROC FRAME
-	;; copy register arguments onto stack
-	test	r11, 1
-	jne	first_is_float	
-	mov	QWORD PTR [rsp+8], rcx
-	jmp	second
-first_is_float:
-	movlpd	QWORD PTR [rsp+8], xmm0
-
-second:
-	test	r11, 2
-	jne	second_is_float	
-	mov	QWORD PTR [rsp+16], rdx
-	jmp	third
-second_is_float:
-	movlpd	QWORD PTR [rsp+16], xmm1
-
-third:
-	test	r11, 4
-	jne	third_is_float	
-	mov	QWORD PTR [rsp+24], r8
-	jmp	fourth
-third_is_float:
-	movlpd	QWORD PTR [rsp+24], xmm2
-
-fourth:
-	test	r11, 8
-	jne	fourth_is_float	
-	mov	QWORD PTR [rsp+32], r9
-	jmp	done
-fourth_is_float:
-	movlpd	QWORD PTR [rsp+32], xmm3
-
-done:
-        .ALLOCSTACK 40
-	sub	rsp, 40
-        .ENDPROLOG
-	mov	rcx, rax	; context is first parameter
-	mov	rdx, rsp	; stack is second parameter
-	add	rdx, 48		; point to start of arguments
-	mov	rax, ffi_closure_win64_inner
-	call	rax		; call the real closure function
-	add	rsp, 40
-	movd	xmm0, rax	; If the closure returned a float,
-                                ; ffi_closure_win64_inner wrote it to rax
-	ret	0
-ffi_closure_win64 ENDP
-
-ffi_call_win64 PROC FRAME
-        ;; copy registers onto stack
-	mov	QWORD PTR [rsp+32], r9
-	mov	QWORD PTR [rsp+24], r8
-	mov	QWORD PTR [rsp+16], rdx
-	mov	QWORD PTR [rsp+8], rcx
-        .PUSHREG rbp
-	push	rbp
-        .ALLOCSTACK 48
-	sub	rsp, 48					; 00000030H
-        .SETFRAME rbp, 32
-	lea	rbp, QWORD PTR [rsp+32]
-        .ENDPROLOG
-
-	mov	eax, DWORD PTR CIF_BYTES[rbp]
-	add	rax, 15
-	and	rax, -16
-	call	__chkstk
-	sub	rsp, rax
-	lea	rax, QWORD PTR [rsp+32]
-	mov	QWORD PTR STACK[rbp], rax
-
-	mov	rdx, QWORD PTR ECIF[rbp]
-	mov	rcx, QWORD PTR STACK[rbp]
-	call	QWORD PTR PREP_ARGS_FN[rbp]
-
-	mov	rsp, QWORD PTR STACK[rbp]
-
-	movlpd	xmm3, QWORD PTR [rsp+24]
-	movd	r9, xmm3
-
-	movlpd	xmm2, QWORD PTR [rsp+16]
-	movd	r8, xmm2
-
-	movlpd	xmm1, QWORD PTR [rsp+8]
-	movd	rdx, xmm1
-
-	movlpd	xmm0, QWORD PTR [rsp]
-	movd	rcx, xmm0
-
-	call	QWORD PTR FN[rbp]
-ret_struct4b$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_4B
- 	jne	ret_struct2b$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	mov	DWORD PTR [rcx], eax
-	jmp	ret_void$
-
-ret_struct2b$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_2B
- 	jne	ret_struct1b$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	mov	WORD PTR [rcx], ax
-	jmp	ret_void$
-
-ret_struct1b$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_1B
- 	jne	ret_uint8$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	mov	BYTE PTR [rcx], al
-	jmp	ret_void$
-
-ret_uint8$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT8
- 	jne	ret_sint8$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	movzx   rax, al
-	mov	QWORD PTR [rcx], rax
-	jmp	ret_void$
-
-ret_sint8$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT8
- 	jne	ret_uint16$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	movsx   rax, al
-	mov	QWORD PTR [rcx], rax
-	jmp	ret_void$
-
-ret_uint16$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT16
- 	jne	ret_sint16$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	movzx   rax, ax
-	mov	QWORD PTR [rcx], rax
-	jmp	SHORT ret_void$
-
-ret_sint16$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT16
- 	jne	ret_uint32$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	movsx   rax, ax
-	mov	QWORD PTR [rcx], rax
-	jmp	SHORT ret_void$
-
-ret_uint32$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT32
- 	jne	ret_sint32$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	mov     eax, eax
-	mov	QWORD PTR [rcx], rax
-	jmp	SHORT ret_void$
-
-ret_sint32$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT32
- 	jne	ret_float$
-
-	mov	rcx, QWORD PTR RVALUE[rbp]
-	cdqe
-	mov	QWORD PTR [rcx], rax
-	jmp	SHORT ret_void$
-
-ret_float$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_FLOAT
- 	jne	SHORT ret_double$
-
- 	mov	rax, QWORD PTR RVALUE[rbp]
- 	movss	DWORD PTR [rax], xmm0
- 	jmp	SHORT ret_void$
-
-ret_double$:
- 	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_DOUBLE
- 	jne	SHORT ret_sint64$
-
- 	mov	rax, QWORD PTR RVALUE[rbp]
- 	movlpd	QWORD PTR [rax], xmm0
- 	jmp	SHORT ret_void$
-
-ret_sint64$:
-  	cmp	DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT64
-  	jne	ret_void$
-
- 	mov	rcx, QWORD PTR RVALUE[rbp]
- 	mov	QWORD PTR [rcx], rax
- 	jmp	SHORT ret_void$
-	
-ret_void$:
-	xor	rax, rax
-
-	lea	rsp, QWORD PTR [rbp+16]
-	pop	rbp
-	ret	0
-ffi_call_win64 ENDP
-_TEXT	ENDS
-END
-
-#else
-
-#ifdef SYMBOL_UNDERSCORE
-#define SYMBOL_NAME(name) _##name
-#else
-#define SYMBOL_NAME(name) name
-#endif
-
-.text
-
-.extern SYMBOL_NAME(ffi_closure_win64_inner)
-
-// ffi_closure_win64 will be called with these registers set:
-//    rax points to 'closure'
-//    r11 contains a bit mask that specifies which of the
-//    first four parameters are float or double
-// // It must move the parameters passed in registers to their stack location,
-// call ffi_closure_win64_inner for the actual work, then return the result.
-// 
-	.balign 16
-        .globl SYMBOL_NAME(ffi_closure_win64)
-SYMBOL_NAME(ffi_closure_win64):
-	// copy register arguments onto stack
-	test	$1,%r11
-	jne	.Lfirst_is_float	
-	mov	%rcx, 8(%rsp)
-	jmp	.Lsecond
-.Lfirst_is_float:
-	movlpd	%xmm0, 8(%rsp)
-
-.Lsecond:
-	test	$2, %r11
-	jne	.Lsecond_is_float	
-	mov	%rdx, 16(%rsp)
-	jmp	.Lthird
-.Lsecond_is_float:
-	movlpd	%xmm1, 16(%rsp)
-
-.Lthird:
-	test	$4, %r11
-	jne	.Lthird_is_float	
-	mov	%r8,24(%rsp)
-	jmp	.Lfourth
-.Lthird_is_float:
-	movlpd	%xmm2, 24(%rsp)
-
-.Lfourth:
-	test	$8, %r11
-	jne	.Lfourth_is_float	
-	mov	%r9, 32(%rsp)
-	jmp	.Ldone
-.Lfourth_is_float:
-	movlpd	%xmm3, 32(%rsp)
-
-.Ldone:
-// ALLOCSTACK 40
-	sub	$40, %rsp
-// ENDPROLOG
-	mov	%rax, %rcx	// context is first parameter
-	mov	%rsp, %rdx	// stack is second parameter
-	add	$48, %rdx	// point to start of arguments
-	mov	$SYMBOL_NAME(ffi_closure_win64_inner), %rax
-	callq	*%rax		// call the real closure function
-	add	$40, %rsp
-	movq	%rax, %xmm0	// If the closure returned a float,
-                                // ffi_closure_win64_inner wrote it to rax
-	retq
-.ffi_closure_win64_end:
-
-	.balign 16
-        .globl	SYMBOL_NAME(ffi_call_win64)
-SYMBOL_NAME(ffi_call_win64):
-        // copy registers onto stack
-	mov	%r9,32(%rsp)
-	mov	%r8,24(%rsp)
-	mov	%rdx,16(%rsp)
-	mov	%rcx,8(%rsp)
-        // PUSHREG rbp
-	push	%rbp
-        // ALLOCSTACK 48
-	sub	$48,%rsp
-        // SETFRAME rbp, 32
-	lea	32(%rsp),%rbp
-        // ENDPROLOG
-
-	mov	CIF_BYTES(%rbp),%eax
-	add	$15, %rax
-	and	$-16, %rax
-	cmpq	$0x1000, %rax
-	jb	Lch_done
-Lch_probe:
-	subq	$0x1000,%rsp
-	orl	$0x0, (%rsp)
-	subq	$0x1000,%rax
-	cmpq	$0x1000,%rax
-	ja	Lch_probe
-Lch_done:
-	subq	%rax, %rsp
-	orl	$0x0, (%rsp)
-	lea	32(%rsp), %rax
-	mov	%rax, STACK(%rbp)
-
-	mov	ECIF(%rbp), %rdx
-	mov	STACK(%rbp), %rcx
-	callq	*PREP_ARGS_FN(%rbp)
-
-	mov	STACK(%rbp), %rsp
-
-	movlpd	24(%rsp), %xmm3
-	movd	%xmm3, %r9
-
-	movlpd	16(%rsp), %xmm2
-	movd	%xmm2, %r8
-
-	movlpd	8(%rsp), %xmm1
-	movd	%xmm1, %rdx
-
-	movlpd	(%rsp), %xmm0
-	movd	%xmm0, %rcx
-
-	callq	*FN(%rbp)
-.Lret_struct4b:
- 	cmpl	$FFI_TYPE_SMALL_STRUCT_4B, CIF_FLAGS(%rbp)
- 	jne .Lret_struct2b
-
-	mov	RVALUE(%rbp), %rcx
-	mov	%eax, (%rcx)
-	jmp	.Lret_void
-
-.Lret_struct2b:
-	cmpl	$FFI_TYPE_SMALL_STRUCT_2B, CIF_FLAGS(%rbp)
-	jne .Lret_struct1b
-	
-	mov	RVALUE(%rbp), %rcx
-	mov	%ax, (%rcx)
-	jmp .Lret_void
-	
-.Lret_struct1b:
-	cmpl	$FFI_TYPE_SMALL_STRUCT_1B, CIF_FLAGS(%rbp)
-	jne .Lret_uint8
-	
-	mov	RVALUE(%rbp), %rcx
-	mov	%al, (%rcx)
-	jmp .Lret_void
-
-.Lret_uint8:
-	cmpl	$FFI_TYPE_UINT8, CIF_FLAGS(%rbp)
-	jne .Lret_sint8
-	
-        mov     RVALUE(%rbp), %rcx
-        movzbq  %al, %rax
-	movq    %rax, (%rcx)
-	jmp .Lret_void
-
-.Lret_sint8:
-	cmpl	$FFI_TYPE_SINT8, CIF_FLAGS(%rbp)
-	jne .Lret_uint16
-	
-        mov     RVALUE(%rbp), %rcx
-        movsbq  %al, %rax
-	movq    %rax, (%rcx)
-	jmp .Lret_void
-
-.Lret_uint16:
-	cmpl	$FFI_TYPE_UINT16, CIF_FLAGS(%rbp)
-	jne .Lret_sint16
-	
-        mov     RVALUE(%rbp), %rcx
-        movzwq  %ax, %rax
-	movq    %rax, (%rcx)
-	jmp .Lret_void
-
-.Lret_sint16:
-	cmpl	$FFI_TYPE_SINT16, CIF_FLAGS(%rbp)
-	jne .Lret_uint32
-	
-        mov     RVALUE(%rbp), %rcx
-        movswq  %ax, %rax
-	movq    %rax, (%rcx)
-	jmp .Lret_void
-
-.Lret_uint32:
-	cmpl	$FFI_TYPE_UINT32, CIF_FLAGS(%rbp)
-	jne .Lret_sint32
-	
-        mov     RVALUE(%rbp), %rcx
-        movl    %eax, %eax
-	movq    %rax, (%rcx)
-	jmp .Lret_void
-
-.Lret_sint32:
- 	cmpl	$FFI_TYPE_SINT32, CIF_FLAGS(%rbp)
- 	jne	.Lret_float
-
-	mov	RVALUE(%rbp), %rcx
-	cltq
-	movq	%rax, (%rcx)
-	jmp	.Lret_void
-
-.Lret_float:
- 	cmpl	$FFI_TYPE_FLOAT, CIF_FLAGS(%rbp)
- 	jne	.Lret_double
-
- 	mov	RVALUE(%rbp), %rax
- 	movss	%xmm0, (%rax)
- 	jmp	.Lret_void
-
-.Lret_double:
- 	cmpl	$FFI_TYPE_DOUBLE, CIF_FLAGS(%rbp)
- 	jne	.Lret_sint64
-
- 	mov	RVALUE(%rbp), %rax
- 	movlpd	%xmm0, (%rax)
- 	jmp	.Lret_void
-
-.Lret_sint64:
-  	cmpl	$FFI_TYPE_SINT64, CIF_FLAGS(%rbp)
-  	jne	.Lret_void
-
- 	mov	RVALUE(%rbp), %rcx
- 	mov	%rax, (%rcx)
- 	jmp	.Lret_void
-	
-.Lret_void:
-	xor	%rax, %rax
-
-	lea	16(%rbp), %rsp
-	pop	%rbp
-	retq
-.ffi_call_win64_end:
-#endif /* !_MSC_VER */
-
diff --git a/lib/wrappers/libffi/gcc/win64_asm.s b/lib/wrappers/libffi/gcc/win64_asm.s
deleted file mode 100644
index f2c2df10d..000000000
--- a/lib/wrappers/libffi/gcc/win64_asm.s
+++ /dev/null
@@ -1,227 +0,0 @@
-# 1 "gcc\\win64_asm.asm"

-# 1 "<command-line>"

-# 1 "gcc\\win64_asm.asm"

-

-# 1 "common/fficonfig.h" 1

-# 3 "gcc\\win64_asm.asm" 2

-# 1 "common/ffi.h" 1

-# 63 "common/ffi.h"

-# 1 "common/ffitarget.h" 1

-# 64 "common/ffi.h" 2

-# 4 "gcc\\win64_asm.asm" 2

-# 244 "gcc\\win64_asm.asm"

-.text

-

-.extern ffi_closure_win64_inner

-# 255 "gcc\\win64_asm.asm"

- .balign 16

-        .globl ffi_closure_win64

-ffi_closure_win64:

-

- test $1,%r11

- jne .Lfirst_is_float

- mov %rcx, 8(%rsp)

- jmp .Lsecond

-.Lfirst_is_float:

- movlpd %xmm0, 8(%rsp)

-

-.Lsecond:

- test $2, %r11

- jne .Lsecond_is_float

- mov %rdx, 16(%rsp)

- jmp .Lthird

-.Lsecond_is_float:

- movlpd %xmm1, 16(%rsp)

-

-.Lthird:

- test $4, %r11

- jne .Lthird_is_float

- mov %r8,24(%rsp)

- jmp .Lfourth

-.Lthird_is_float:

- movlpd %xmm2, 24(%rsp)

-

-.Lfourth:

- test $8, %r11

- jne .Lfourth_is_float

- mov %r9, 32(%rsp)

- jmp .Ldone

-.Lfourth_is_float:

- movlpd %xmm3, 32(%rsp)

-

-.Ldone:

-

- sub $40, %rsp

-

- mov %rax, %rcx

- mov %rsp, %rdx

- add $48, %rdx

- mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax

- callq *%rax

- add $40, %rsp

- movq %rax, %xmm0

-

- retq

-.ffi_closure_win64_end:

-

- .balign 16

-        .globl ffi_call_win64

-ffi_call_win64:

-

- mov %r9,32(%rsp)

- mov %r8,24(%rsp)

- mov %rdx,16(%rsp)

- mov %rcx,8(%rsp)

-

- push %rbp

-

- sub $48,%rsp

-

- lea 32(%rsp),%rbp

-

-

- mov 48(%rbp),%eax

- add $15, %rax

- and $-16, %rax

- cmpq $0x1000, %rax

- jb Lch_done

-Lch_probe:

- subq $0x1000,%rsp

- orl $0x0, (%rsp)

- subq $0x1000,%rax

- cmpq $0x1000,%rax

- ja Lch_probe

-Lch_done:

- subq %rax, %rsp

- orl $0x0, (%rsp)

- lea 32(%rsp), %rax

- mov %rax, 0(%rbp)

-

- mov 40(%rbp), %rdx

- mov 0(%rbp), %rcx

- callq *32(%rbp)

-

- mov 0(%rbp), %rsp

-

- movlpd 24(%rsp), %xmm3

- movd %xmm3, %r9

-

- movlpd 16(%rsp), %xmm2

- movd %xmm2, %r8

-

- movlpd 8(%rsp), %xmm1

- movd %xmm1, %rdx

-

- movlpd (%rsp), %xmm0

- movd %xmm0, %rcx

-

- callq *72(%rbp)

-.Lret_struct4b:

-  cmpl $FFI_TYPE_SMALL_STRUCT_4B, 56(%rbp)

-  jne .Lret_struct2b

-

- mov 64(%rbp), %rcx

- mov %eax, (%rcx)

- jmp .Lret_void

-

-.Lret_struct2b:

- cmpl $FFI_TYPE_SMALL_STRUCT_2B, 56(%rbp)

- jne .Lret_struct1b

-

- mov 64(%rbp), %rcx

- mov %ax, (%rcx)

- jmp .Lret_void

-

-.Lret_struct1b:

- cmpl $FFI_TYPE_SMALL_STRUCT_1B, 56(%rbp)

- jne .Lret_uint8

-

- mov 64(%rbp), %rcx

- mov %al, (%rcx)

- jmp .Lret_void

-

-.Lret_uint8:

- cmpl $FFI_TYPE_UINT8, 56(%rbp)

- jne .Lret_sint8

-

-        mov 64(%rbp), %rcx

-        movzbq %al, %rax

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_sint8:

- cmpl $FFI_TYPE_SINT8, 56(%rbp)

- jne .Lret_uint16

-

-        mov 64(%rbp), %rcx

-        movsbq %al, %rax

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_uint16:

- cmpl $FFI_TYPE_UINT16, 56(%rbp)

- jne .Lret_sint16

-

-        mov 64(%rbp), %rcx

-        movzwq %ax, %rax

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_sint16:

- cmpl $FFI_TYPE_SINT16, 56(%rbp)

- jne .Lret_uint32

-

-        mov 64(%rbp), %rcx

-        movswq %ax, %rax

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_uint32:

- cmpl $9, 56(%rbp)

- jne .Lret_sint32

-

-        mov 64(%rbp), %rcx

-        movl %eax, %eax

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_sint32:

-  cmpl $10, 56(%rbp)

-  jne .Lret_float

-

- mov 64(%rbp), %rcx

- cltq

- movq %rax, (%rcx)

- jmp .Lret_void

-

-.Lret_float:

-  cmpl $2, 56(%rbp)

-  jne .Lret_double

-

-  mov 64(%rbp), %rax

-  movss %xmm0, (%rax)

-  jmp .Lret_void

-

-.Lret_double:

-  cmpl $3, 56(%rbp)

-  jne .Lret_sint64

-

-  mov 64(%rbp), %rax

-  movlpd %xmm0, (%rax)

-  jmp .Lret_void

-

-.Lret_sint64:

-   cmpl $12, 56(%rbp)

-   jne .Lret_void

-

-  mov 64(%rbp), %rcx

-  mov %rax, (%rcx)

-  jmp .Lret_void

-

-.Lret_void:

- xor %rax, %rax

-

- lea 16(%rbp), %rsp

- pop %rbp

- retq

-.ffi_call_win64_end:

diff --git a/lib/wrappers/libffi/libffi.nim b/lib/wrappers/libffi/libffi.nim
deleted file mode 100644
index 34b91f8c7..000000000
--- a/lib/wrappers/libffi/libffi.nim
+++ /dev/null
@@ -1,176 +0,0 @@
-# -----------------------------------------------------------------*-C-*-
-#   libffi 3.0.10 - Copyright (c) 2011 Anthony Green
-#                    - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
-#
-#   Permission is hereby granted, free of charge, to any person
-#   obtaining a copy of this software and associated documentation
-#   files (the ``Software''), to deal in the Software without
-#   restriction, including without limitation the rights to use, copy,
-#   modify, merge, publish, distribute, sublicense, and/or sell copies
-#   of the Software, and to permit persons to whom the Software is
-#   furnished to do so, subject to the following conditions:
-#
-#   The above copyright notice and this permission notice shall be
-#   included in all copies or substantial portions of the Software.
-#
-#   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-#   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-#   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-#   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-#   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-#   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-#   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-#   DEALINGS IN THE SOFTWARE.
-#
-#   ----------------------------------------------------------------------- 
-
-{.deadCodeElim: on.}
-
-when defined(windows):
-  # on Windows we don't use a DLL but instead embed libffi directly:
-  {.pragma: mylib, header: r"ffi.h".}
-
-  #{.compile: r"common\malloc_closure.c".}
-  {.compile: r"common\raw_api.c".}
-  when defined(vcc):
-    {.compile: r"msvc\ffi.c".}
-    {.compile: r"msvc\prep_cif.c".}
-    {.compile: r"msvc\win32.c".}
-    {.compile: r"msvc\types.c".}
-    when defined(cpu64):
-      {.compile: r"msvc\win64_asm.asm".}
-    else:
-      {.compile: r"msvc\win32_asm.asm".}
-  else:
-    {.compile: r"gcc\ffi.c".}
-    {.compile: r"gcc\prep_cif.c".}
-    {.compile: r"gcc\types.c".}
-    {.compile: r"gcc\closures.c".}
-    when defined(cpu64):
-      {.compile: r"gcc\ffi64.c".}
-      {.compile: r"gcc\win64_asm.S".}
-    else:
-      {.compile: r"gcc\win32_asm.S".}
-
-elif defined(macosx):
-  {.pragma: mylib, dynlib: "libffi.dylib".}
-else:
-  {.pragma: mylib, dynlib: "libffi.so".}
-
-type
-  Arg* = int
-  SArg* = int
-{.deprecated: [TArg: Arg, TSArg: SArg].}
-
-when defined(windows) and defined(x86):
-  type
-    TABI* {.size: sizeof(cint).} = enum
-      FIRST_ABI, SYSV, STDCALL
-
-  const DEFAULT_ABI* = SYSV
-elif defined(amd64) and defined(windows):
-  type 
-    TABI* {.size: sizeof(cint).} = enum 
-      FIRST_ABI, WIN64
-  const DEFAULT_ABI* = WIN64
-else:
-  type 
-    TABI* {.size: sizeof(cint).} = enum
-      FIRST_ABI, SYSV, UNIX64
-
-  when defined(i386):
-    const DEFAULT_ABI* = SYSV
-  else: 
-    const DEFAULT_ABI* = UNIX64
-    
-const 
-  tkVOID* = 0
-  tkINT* = 1
-  tkFLOAT* = 2
-  tkDOUBLE* = 3
-  tkLONGDOUBLE* = 4
-  tkUINT8* = 5
-  tkSINT8* = 6
-  tkUINT16* = 7
-  tkSINT16* = 8
-  tkUINT32* = 9
-  tkSINT32* = 10
-  tkUINT64* = 11
-  tkSINT64* = 12
-  tkSTRUCT* = 13
-  tkPOINTER* = 14
-
-  tkLAST = tkPOINTER
-  tkSMALL_STRUCT_1B* = (tkLAST + 1)
-  tkSMALL_STRUCT_2B* = (tkLAST + 2)
-  tkSMALL_STRUCT_4B* = (tkLAST + 3)
-
-type
-  Type* = object
-    size*: int
-    alignment*: uint16
-    typ*: uint16
-    elements*: ptr ptr Type
-{.deprecated: [TType: Type].}
-
-var
-  type_void* {.importc: "ffi_type_void", mylib.}: Type
-  type_uint8* {.importc: "ffi_type_uint8", mylib.}: Type
-  type_sint8* {.importc: "ffi_type_sint8", mylib.}: Type
-  type_uint16* {.importc: "ffi_type_uint16", mylib.}: Type
-  type_sint16* {.importc: "ffi_type_sint16", mylib.}: Type
-  type_uint32* {.importc: "ffi_type_uint32", mylib.}: Type
-  type_sint32* {.importc: "ffi_type_sint32", mylib.}: Type
-  type_uint64* {.importc: "ffi_type_uint64", mylib.}: Type
-  type_sint64* {.importc: "ffi_type_sint64", mylib.}: Type
-  type_float* {.importc: "ffi_type_float", mylib.}: Type
-  type_double* {.importc: "ffi_type_double", mylib.}: Type
-  type_pointer* {.importc: "ffi_type_pointer", mylib.}: Type
-  type_longdouble* {.importc: "ffi_type_longdouble", mylib.}: Type
-
-type 
-  Status* {.size: sizeof(cint).} = enum 
-    OK, BAD_TYPEDEF, BAD_ABI
-  TypeKind* = cuint
-  TCif* {.pure, final.} = object 
-    abi*: TABI
-    nargs*: cuint
-    arg_types*: ptr ptr Type
-    rtype*: ptr Type
-    bytes*: cuint
-    flags*: cuint
-{.deprecated: [Tstatus: Status].}
-
-type
-  Raw* = object 
-    sint*: SArg
-{.deprecated: [TRaw: Raw].}
-
-proc raw_call*(cif: var Tcif; fn: proc () {.cdecl.}; rvalue: pointer; 
-               avalue: ptr Raw) {.cdecl, importc: "ffi_raw_call", mylib.}
-proc ptrarray_to_raw*(cif: var Tcif; args: ptr pointer; raw: ptr Raw) {.cdecl, 
-    importc: "ffi_ptrarray_to_raw", mylib.}
-proc raw_to_ptrarray*(cif: var Tcif; raw: ptr Raw; args: ptr pointer) {.cdecl, 
-    importc: "ffi_raw_to_ptrarray", mylib.}
-proc raw_size*(cif: var Tcif): int {.cdecl, importc: "ffi_raw_size", mylib.}
-
-proc prep_cif*(cif: var Tcif; abi: TABI; nargs: cuint; rtype: ptr Type; 
-               atypes: ptr ptr Type): Status {.cdecl, importc: "ffi_prep_cif", 
-    mylib.}
-proc call*(cif: var Tcif; fn: proc () {.cdecl.}; rvalue: pointer; 
-           avalue: ptr pointer) {.cdecl, importc: "ffi_call", mylib.}
-
-# the same with an easier interface:
-type
-  ParamList* = array[0..100, ptr Type]
-  ArgList* = array[0..100, pointer]
-{.deprecated: [TParamList: ParamList, TArgList: ArgList].}
-
-proc prep_cif*(cif: var Tcif; abi: TABI; nargs: cuint; rtype: ptr Type; 
-               atypes: ParamList): Status {.cdecl, importc: "ffi_prep_cif",
-    mylib.}
-proc call*(cif: var Tcif; fn, rvalue: pointer;
-           avalue: ArgList) {.cdecl, importc: "ffi_call", mylib.}
-
-# Useful for eliminating compiler warnings 
-##define FFI_FN(f) ((void (*)(void))f)
diff --git a/lib/wrappers/libffi/msvc/ffi.c b/lib/wrappers/libffi/msvc/ffi.c
deleted file mode 100644
index 6e595e9fe..000000000
--- a/lib/wrappers/libffi/msvc/ffi.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/* -----------------------------------------------------------------------
-   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
-           Copyright (c) 2002  Ranjit Mathew
-           Copyright (c) 2002  Bo Thorsen
-           Copyright (c) 2002  Roger Sayle
-   
-   x86 Foreign Function Interface 
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* ffi_prep_args is called by the assembly routine once stack space
-   has been allocated for the function's arguments */
-
-extern void Py_FatalError(const char *msg);
-
-/*@-exportheader@*/
-void ffi_prep_args(char *stack, extended_cif *ecif)
-/*@=exportheader@*/
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-
-  argp = stack;
-  if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
-    {
-      *(void **) argp = ecif->rvalue;
-      argp += sizeof(void *);
-    }
-
-  p_argv = ecif->avalue;
-
-  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
-       i != 0;
-       i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(void *) - 1) & (size_t) argp)
-	argp = (char *) ALIGN(argp, sizeof(void *));
-
-      z = (*p_arg)->size;
-      if (z < sizeof(int))
-	{
-	  z = sizeof(int);
-	  switch ((*p_arg)->type)
-	    {
-	    case FFI_TYPE_SINT8:
-	      *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_UINT8:
-	      *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_SINT16:
-	      *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_UINT16:
-	      *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_SINT32:
-	      *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_UINT32:
-	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
-	      break;
-
-	    case FFI_TYPE_STRUCT:
-	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
-	      break;
-
-	    default:
-	      FFI_ASSERT(0);
-	    }
-	}
-      else
-	{
-	  memcpy(argp, *p_argv, z);
-	}
-      p_argv++;
-      argp += z;
-    }
-
-  if (argp >= stack && (unsigned)(argp - stack) > ecif->cif->bytes) 
-    {
-      Py_FatalError("FFI BUG: not enough stack space for arguments");
-    }
-  return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
-  /* Set the return type flag */
-  switch (cif->rtype->type)
-    {
-    case FFI_TYPE_VOID:
-    case FFI_TYPE_STRUCT:
-    case FFI_TYPE_SINT64:
-    case FFI_TYPE_FLOAT:
-    case FFI_TYPE_DOUBLE:
-    case FFI_TYPE_LONGDOUBLE:
-      cif->flags = (unsigned) cif->rtype->type;
-      break;
-
-    case FFI_TYPE_UINT64:
-#ifdef _WIN64
-    case FFI_TYPE_POINTER:
-#endif
-      cif->flags = FFI_TYPE_SINT64;
-      break;
-
-    default:
-      cif->flags = FFI_TYPE_INT;
-      break;
-    }
-
-  return FFI_OK;
-}
-
-#ifdef _WIN32
-extern int
-ffi_call_x86(void (*)(char *, extended_cif *), 
-	     /*@out@*/ extended_cif *, 
-	     unsigned, unsigned, 
-	     /*@out@*/ unsigned *, 
-	     void (*fn)());
-#endif
-
-#ifdef _WIN64
-extern int
-ffi_call_AMD64(void (*)(char *, extended_cif *),
-		 /*@out@*/ extended_cif *,
-		 unsigned, unsigned,
-		 /*@out@*/ unsigned *,
-		 void (*fn)());
-#endif
-
-int
-ffi_call(/*@dependent@*/ ffi_cif *cif, 
-	 void (*fn)(), 
-	 /*@out@*/ void *rvalue, 
-	 /*@dependent@*/ void **avalue)
-{
-  extended_cif ecif;
-
-  ecif.cif = cif;
-  ecif.avalue = avalue;
-  
-  /* If the return value is a struct and we don't have a return	*/
-  /* value address then we need to make one		        */
-
-  if ((rvalue == NULL) && 
-      (cif->rtype->type == FFI_TYPE_STRUCT))
-    {
-      /*@-sysunrecog@*/
-      ecif.rvalue = alloca(cif->rtype->size);
-      /*@=sysunrecog@*/
-    }
-  else
-    ecif.rvalue = rvalue;
-    
-  
-  switch (cif->abi) 
-    {
-#if !defined(_WIN64)
-    case FFI_SYSV:
-    case FFI_STDCALL:
-      return ffi_call_x86(ffi_prep_args, &ecif, cif->bytes, 
-			  cif->flags, ecif.rvalue, fn);
-      break;
-#else
-    case FFI_SYSV:
-      /*@-usedef@*/
-      /* Function call needs at least 40 bytes stack size, on win64 AMD64 */
-      return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes ? cif->bytes : 40,
-			   cif->flags, ecif.rvalue, fn);
-      /*@=usedef@*/
-      break;
-#endif
-
-    default:
-      FFI_ASSERT(0);
-      break;
-    }
-  return -1; /* theller: Hrm. */
-}
-
-
-/** private members **/
-
-static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
-					  void** args, ffi_cif* cif);
-/* This function is jumped to by the trampoline */
-
-#ifdef _WIN64
-void *
-#else
-static void __fastcall
-#endif
-ffi_closure_SYSV (ffi_closure *closure, int *argp)
-{
-  // this is our return value storage
-  long double    res;
-
-  // our various things...
-  ffi_cif       *cif;
-  void         **arg_area;
-  unsigned short rtype;
-  void          *resp = (void*)&res;
-  void *args = &argp[1];
-
-  cif         = closure->cif;
-  arg_area    = (void**) alloca (cif->nargs * sizeof (void*));  
-
-  /* this call will initialize ARG_AREA, such that each
-   * element in that array points to the corresponding 
-   * value on the stack; and if the function returns
-   * a structure, it will re-set RESP to point to the
-   * structure return address.  */
-
-  ffi_prep_incoming_args_SYSV(args, (void**)&resp, arg_area, cif);
-  
-  (closure->fun) (cif, resp, arg_area, closure->user_data);
-
-  rtype = cif->flags;
-
-#if defined(_WIN32) && !defined(_WIN64)
-#ifdef _MSC_VER
-  /* now, do a generic return based on the value of rtype */
-  if (rtype == FFI_TYPE_INT)
-    {
-	    _asm mov eax, resp ;
-	    _asm mov eax, [eax] ;
-    }
-  else if (rtype == FFI_TYPE_FLOAT)
-    {
-	    _asm mov eax, resp ;
-	    _asm fld DWORD PTR [eax] ;
-//      asm ("flds (%0)" : : "r" (resp) : "st" );
-    }
-  else if (rtype == FFI_TYPE_DOUBLE)
-    {
-	    _asm mov eax, resp ;
-	    _asm fld QWORD PTR [eax] ;
-//      asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" );
-    }
-  else if (rtype == FFI_TYPE_LONGDOUBLE)
-    {
-//      asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" );
-    }
-  else if (rtype == FFI_TYPE_SINT64)
-    {
-	    _asm mov edx, resp ;
-	    _asm mov eax, [edx] ;
-	    _asm mov edx, [edx + 4] ;
-//      asm ("movl 0(%0),%%eax;"
-//	   "movl 4(%0),%%edx" 
-//	   : : "r"(resp)
-//	   : "eax", "edx");
-    }
-#else
-  /* now, do a generic return based on the value of rtype */
-  if (rtype == FFI_TYPE_INT)
-    {
-      asm ("movl (%0),%%eax" : : "r" (resp) : "eax");
-    }
-  else if (rtype == FFI_TYPE_FLOAT)
-    {
-      asm ("flds (%0)" : : "r" (resp) : "st" );
-    }
-  else if (rtype == FFI_TYPE_DOUBLE)
-    {
-      asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" );
-    }
-  else if (rtype == FFI_TYPE_LONGDOUBLE)
-    {
-      asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" );
-    }
-  else if (rtype == FFI_TYPE_SINT64)
-    {
-      asm ("movl 0(%0),%%eax;"
-	   "movl 4(%0),%%edx" 
-	   : : "r"(resp)
-	   : "eax", "edx");
-    }
-#endif
-#endif
-
-#ifdef _WIN64
-  /* The result is returned in rax.  This does the right thing for
-     result types except for floats; we have to 'mov xmm0, rax' in the
-     caller to correct this.
-  */
-  return *(void **)resp;
-#endif
-}
-
-/*@-exportheader@*/
-static void 
-ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
-			    void **avalue, ffi_cif *cif)
-/*@=exportheader@*/
-{
-  register unsigned int i;
-  register void **p_argv;
-  register char *argp;
-  register ffi_type **p_arg;
-
-  argp = stack;
-
-  if ( cif->rtype->type == FFI_TYPE_STRUCT ) {
-    *rvalue = *(void **) argp;
-    argp += 4;
-  }
-
-  p_argv = avalue;
-
-  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
-    {
-      size_t z;
-
-      /* Align if necessary */
-      if ((sizeof(char *) - 1) & (size_t) argp) {
-	argp = (char *) ALIGN(argp, sizeof(char*));
-      }
-
-      z = (*p_arg)->size;
-
-      /* because we're little endian, this is what it turns into.   */
-
-      *p_argv = (void*) argp;
-
-      p_argv++;
-      argp += z;
-    }
-  
-  return;
-}
-
-/* the cif must already be prep'ed */
-extern void ffi_closure_OUTER();
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
-					  ffi_cif* cif,
-					  void (*fun)(ffi_cif*,void*,void**,void*),
-					  void *user_data,
-					  void *codeloc)
-{
-  short bytes;
-  char *tramp;
-#ifdef _WIN64
-  int mask = 0;
-#endif
-  FFI_ASSERT (cif->abi == FFI_SYSV);
-  
-  if (cif->abi == FFI_SYSV)
-    bytes = 0;
-#if !defined(_WIN64)
-  else if (cif->abi == FFI_STDCALL)
-    bytes = cif->bytes;
-#endif
-  else
-    return FFI_BAD_ABI;
-
-  tramp = &closure->tramp[0];
-
-#define BYTES(text) memcpy(tramp, text, sizeof(text)), tramp += sizeof(text)-1
-#define POINTER(x) *(void**)tramp = (void*)(x), tramp += sizeof(void*)
-#define SHORT(x) *(short*)tramp = x, tramp += sizeof(short)
-#define INT(x) *(int*)tramp = x, tramp += sizeof(int)
-
-#ifdef _WIN64
-  if (cif->nargs >= 1 &&
-      (cif->arg_types[0]->type == FFI_TYPE_FLOAT
-       || cif->arg_types[0]->type == FFI_TYPE_DOUBLE))
-    mask |= 1;
-  if (cif->nargs >= 2 &&
-      (cif->arg_types[1]->type == FFI_TYPE_FLOAT
-       || cif->arg_types[1]->type == FFI_TYPE_DOUBLE))
-    mask |= 2;
-  if (cif->nargs >= 3 &&
-      (cif->arg_types[2]->type == FFI_TYPE_FLOAT
-       || cif->arg_types[2]->type == FFI_TYPE_DOUBLE))
-    mask |= 4;
-  if (cif->nargs >= 4 &&
-      (cif->arg_types[3]->type == FFI_TYPE_FLOAT
-       || cif->arg_types[3]->type == FFI_TYPE_DOUBLE))
-    mask |= 8;
-
-  /* 41 BB ----         mov         r11d,mask */
-  BYTES("\x41\xBB"); INT(mask);
-
-  /* 48 B8 --------     mov         rax, closure			*/
-  BYTES("\x48\xB8"); POINTER(closure);
-
-  /* 49 BA --------     mov         r10, ffi_closure_OUTER */
-  BYTES("\x49\xBA"); POINTER(ffi_closure_OUTER);
-
-  /* 41 FF E2           jmp         r10 */
-  BYTES("\x41\xFF\xE2");
-
-#else
-
-  /* mov ecx, closure */
-  BYTES("\xb9"); POINTER(closure);
-
-  /* mov edx, esp */
-  BYTES("\x8b\xd4");
-
-  /* call ffi_closure_SYSV */
-  BYTES("\xe8"); POINTER((char*)&ffi_closure_SYSV - (tramp + 4));
-
-  /* ret bytes */
-  BYTES("\xc2");
-  SHORT(bytes);
-  
-#endif
-
-  if (tramp - &closure->tramp[0] > FFI_TRAMPOLINE_SIZE)
-    Py_FatalError("FFI_TRAMPOLINE_SIZE too small in " __FILE__);
-
-  closure->cif  = cif;
-  closure->user_data = user_data;
-  closure->fun  = fun;
-  return FFI_OK;
-}
diff --git a/lib/wrappers/libffi/msvc/prep_cif.c b/lib/wrappers/libffi/msvc/prep_cif.c
deleted file mode 100644
index 2650fa052..000000000
--- a/lib/wrappers/libffi/msvc/prep_cif.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* -----------------------------------------------------------------------
-   prep_cif.c - Copyright (c) 1996, 1998  Red Hat, Inc.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-
-
-/* Round up to FFI_SIZEOF_ARG. */
-
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
-
-/* Perform machine independent initialization of aggregate type
-   specifications. */
-
-static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg)
-{
-  ffi_type **ptr; 
-
-  FFI_ASSERT(arg != NULL);
-
-  /*@-usedef@*/
-
-  FFI_ASSERT(arg->elements != NULL);
-  FFI_ASSERT(arg->size == 0);
-  FFI_ASSERT(arg->alignment == 0);
-
-  ptr = &(arg->elements[0]);
-
-  while ((*ptr) != NULL)
-    {
-      if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
-	return FFI_BAD_TYPEDEF;
-      
-      /* Perform a sanity check on the argument type */
-      FFI_ASSERT_VALID_TYPE(*ptr);
-
-      arg->size = ALIGN(arg->size, (*ptr)->alignment);
-      arg->size += (*ptr)->size;
-
-      arg->alignment = (arg->alignment > (*ptr)->alignment) ? 
-	arg->alignment : (*ptr)->alignment;
-
-      ptr++;
-    }
-
-  /* Structure size includes tail padding.  This is important for
-     structures that fit in one register on ABIs like the PowerPC64
-     Linux ABI that right justify small structs in a register.
-     It's also needed for nested structure layout, for example
-     struct A { long a; char b; }; struct B { struct A x; char y; };
-     should find y at an offset of 2*sizeof(long) and result in a
-     total size of 3*sizeof(long).  */
-  arg->size = ALIGN (arg->size, arg->alignment);
-
-  if (arg->size == 0)
-    return FFI_BAD_TYPEDEF;
-  else
-    return FFI_OK;
-
-  /*@=usedef@*/
-}
-
-/* Perform machine independent ffi_cif preparation, then call
-   machine dependent routine. */
-
-ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, 
-			ffi_abi abi, unsigned int nargs, 
-			/*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, 
-			/*@dependent@*/ ffi_type **atypes)
-{
-  unsigned bytes = 0;
-  unsigned int i;
-  ffi_type **ptr;
-
-  FFI_ASSERT(cif != NULL);
-  FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI));
-
-  cif->abi = abi;
-  cif->arg_types = atypes;
-  cif->nargs = nargs;
-  cif->rtype = rtype;
-
-  cif->flags = 0;
-
-  /* Initialize the return type if necessary */
-  /*@-usedef@*/
-  if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
-    return FFI_BAD_TYPEDEF;
-  /*@=usedef@*/
-
-  /* Perform a sanity check on the return type */
-  FFI_ASSERT_VALID_TYPE(cif->rtype);
-
-  /* x86-64 and s390 stack space allocation is handled in prep_machdep.  */
-#if !defined M68K && !defined __x86_64__ && !defined S390
-  /* Make space for the return structure pointer */
-  if (cif->rtype->type == FFI_TYPE_STRUCT
-      /* MSVC returns small structures in registers.  But we have a different
-      workaround: pretend int32 or int64 return type, and converting to
-      structure afterwards. */
-#ifdef SPARC
-      && (cif->abi != FFI_V9 || cif->rtype->size > 32)
-#endif
-      )
-    bytes = STACK_ARG_SIZE(sizeof(void*));
-#endif
-
-  for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
-    {
-
-      /* Initialize any uninitialized aggregate type definitions */
-      if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
-	return FFI_BAD_TYPEDEF;
-
-      /* Perform a sanity check on the argument type, do this 
-	 check after the initialization.  */
-      FFI_ASSERT_VALID_TYPE(*ptr);
-
-#if !defined __x86_64__ && !defined S390
-#ifdef SPARC
-      if (((*ptr)->type == FFI_TYPE_STRUCT
-	   && ((*ptr)->size > 16 || cif->abi != FFI_V9))
-	  || ((*ptr)->type == FFI_TYPE_LONGDOUBLE
-	      && cif->abi != FFI_V9))
-	bytes += sizeof(void*);
-      else
-#endif
-	{
-#if !defined(_MSC_VER) && !defined(__MINGW32__)
-		/* Don't know if this is a libffi bug or not.  At least on
-		   Windows with MSVC, function call parameters are *not*
-		   aligned in the same way as structure fields are, they are
-		   only aligned in integer boundaries.
-
-		   This doesn't do any harm for cdecl functions and closures,
-		   since the caller cleans up the stack, but it is wrong for
-		   stdcall functions where the callee cleans.
-		*/
-
-	  /* Add any padding if necessary */
-	  if (((*ptr)->alignment - 1) & bytes)
-	    bytes = ALIGN(bytes, (*ptr)->alignment);
-	  
-#endif
-	  bytes += STACK_ARG_SIZE((*ptr)->size);
-	}
-#endif
-    }
-
-  cif->bytes = bytes;
-
-  /* Perform machine dependent cif processing */
-  return ffi_prep_cif_machdep(cif);
-}
diff --git a/lib/wrappers/libffi/msvc/types.c b/lib/wrappers/libffi/msvc/types.c
deleted file mode 100644
index df32190d1..000000000
--- a/lib/wrappers/libffi/msvc/types.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -----------------------------------------------------------------------
-   types.c - Copyright (c) 1996, 1998  Red Hat, Inc.
-   
-   Predefined ffi_types needed by libffi.
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-/* Type definitions */
-
-#define FFI_INTEGRAL_TYPEDEF(n, s, a, t) ffi_type ffi_type_##n = { s, a, t, NULL }
-#define FFI_AGGREGATE_TYPEDEF(n, e) ffi_type ffi_type_##n = { 0, 0, FFI_TYPE_STRUCT, e }
-
-/* Size and alignment are fake here. They must not be 0. */
-FFI_INTEGRAL_TYPEDEF(void, 1, 1, FFI_TYPE_VOID);
-
-FFI_INTEGRAL_TYPEDEF(uint8, 1, 1, FFI_TYPE_UINT8);
-FFI_INTEGRAL_TYPEDEF(sint8, 1, 1, FFI_TYPE_SINT8);
-FFI_INTEGRAL_TYPEDEF(uint16, 2, 2, FFI_TYPE_UINT16);
-FFI_INTEGRAL_TYPEDEF(sint16, 2, 2, FFI_TYPE_SINT16);
-FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32);
-FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32);
-FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
-
-#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \
-    || defined IA64
-
-FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
-
-#else
-
-FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_TYPE_POINTER);
-
-#endif
-
-#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K
-
-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
-
-#elif defined SH
-
-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
-
-#else
-
-FFI_INTEGRAL_TYPEDEF(uint64, 8, 8, FFI_TYPE_UINT64);
-FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64);
-
-#endif
-
-
-#if defined X86 || defined X86_WIN32 || defined M68K
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
-
-#elif defined ARM || defined SH || defined POWERPC_AIX || defined POWERPC_DARWIN
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
-FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
-
-#elif defined SPARC
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
-#ifdef SPARC64
-FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
-#else
-FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE);
-#endif
-
-#elif defined X86_64
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
-FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
-
-#else
-
-FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
-FFI_INTEGRAL_TYPEDEF(longdouble, 8, 8, FFI_TYPE_LONGDOUBLE);
-
-#endif
-
diff --git a/lib/wrappers/libffi/msvc/win32.c b/lib/wrappers/libffi/msvc/win32.c
deleted file mode 100644
index 2754fd35d..000000000
--- a/lib/wrappers/libffi/msvc/win32.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -----------------------------------------------------------------------
-   win32.S - Copyright (c) 1996, 1998, 2001, 2002  Red Hat, Inc.
-	     Copyright (c) 2001  John Beniton
-	     Copyright (c) 2002  Ranjit Mathew
-			
- 
-   X86 Foreign Function Interface
- 
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
- 
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
- 
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-   ----------------------------------------------------------------------- */
-
-/* theller: almost verbatim translation from gas syntax to MSVC inline
-   assembler code. */
-
-/* theller: ffi_call_x86 now returns an integer - the difference of the stack
-   pointer before and after the function call.  If everything is ok, zero is
-   returned.  If stdcall functions are passed the wrong number of arguments,
-   the difference will be nonzero. */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-__declspec(naked) int
-ffi_call_x86(void (* prepfunc)(char *, extended_cif *), /* 8 */
-	     extended_cif *ecif, /* 12 */
-	     unsigned bytes, /* 16 */
-	     unsigned flags, /* 20 */
-	     unsigned *rvalue, /* 24 */
-	     void (*fn)()) /* 28 */
-{
-	_asm {
-		push ebp
-		mov ebp, esp
-
-		push esi // NEW: this register must be preserved across function calls
-// XXX SAVE ESP NOW!
-		mov esi, esp		// save stack pointer before the call
-
-// Make room for all of the new args.
-		mov ecx, [ebp+16]
-		sub esp, ecx		// sub esp, bytes
-		
-		mov eax, esp
-
-// Place all of the ffi_prep_args in position
-		push [ebp + 12] // ecif
-		push eax
-		call [ebp + 8] // prepfunc
-
-// Return stack to previous state and call the function
-		add esp, 8
-// FIXME: Align the stack to a 128-bit boundary to avoid
-// potential performance hits.
-		call [ebp + 28]
-
-// Load ecif->cif->abi
-		mov ecx, [ebp + 12]
-		mov ecx, [ecx]ecif.cif
-		mov ecx, [ecx]ecif.cif.abi
-		
-		cmp ecx, FFI_STDCALL
-		je noclean
-// STDCALL: Remove the space we pushed for the args
-		mov ecx, [ebp + 16]
-		add esp, ecx
-// CDECL: Caller has already cleaned the stack
-noclean:
-// Check that esp has the same value as before!
-		sub esi, esp
-
-// Load %ecx with the return type code
-		mov ecx, [ebp + 20]
-
-// If the return value pointer is NULL, assume no return value.
-/*
-  Intel asm is weird. We have to explicitly specify 'DWORD PTR' in the nexr instruction,
-  otherwise only one BYTE will be compared (instead of a DWORD)!
- */
-		cmp DWORD PTR [ebp + 24], 0
-		jne sc_retint
-
-// Even if there is no space for the return value, we are
-// obliged to handle floating-point values.
-		cmp ecx, FFI_TYPE_FLOAT
-		jne sc_noretval
-//        fstp  %st(0)
-		fstp st(0)
-
-		jmp sc_epilogue
-
-sc_retint:
-		cmp ecx, FFI_TYPE_INT
-		jne sc_retfloat
-//        # Load %ecx with the pointer to storage for the return value
-		mov ecx, [ebp + 24]
-		mov [ecx + 0], eax
-		jmp sc_epilogue
-
-sc_retfloat:
-		cmp ecx, FFI_TYPE_FLOAT
-		jne sc_retdouble
-// Load %ecx with the pointer to storage for the return value
-		mov ecx, [ebp+24]
-//        fstps (%ecx)
-		fstp DWORD PTR [ecx]
-		jmp sc_epilogue
-
-sc_retdouble:
-		cmp ecx, FFI_TYPE_DOUBLE
-		jne sc_retlongdouble
-//        movl  24(%ebp),%ecx
-		mov ecx, [ebp+24]
-		fstp QWORD PTR [ecx]
-		jmp sc_epilogue
-
-		jmp sc_retlongdouble // avoid warning about unused label
-sc_retlongdouble:
-		cmp ecx, FFI_TYPE_LONGDOUBLE
-		jne sc_retint64
-// Load %ecx with the pointer to storage for the return value
-		mov ecx, [ebp+24]
-//        fstpt (%ecx)
-		fstp QWORD PTR [ecx] /* XXX ??? */
-		jmp sc_epilogue
-
-sc_retint64:
-		cmp ecx, FFI_TYPE_SINT64
-		jne sc_retstruct
-// Load %ecx with the pointer to storage for the return value
-		mov ecx, [ebp+24]
-		mov [ecx+0], eax
-		mov [ecx+4], edx
-
-sc_retstruct:
-// Nothing to do!
-
-sc_noretval:
-sc_epilogue:
-		mov eax, esi
-		pop esi // NEW restore: must be preserved across function calls
-		mov esp, ebp
-		pop ebp
-		ret
-	}
-}
diff --git a/lib/wrappers/libffi/msvc/win32_asm.asm b/lib/wrappers/libffi/msvc/win32_asm.asm
deleted file mode 100644
index 407185e6a..000000000
--- a/lib/wrappers/libffi/msvc/win32_asm.asm
+++ /dev/null
@@ -1,470 +0,0 @@
-/* -----------------------------------------------------------------------
-   win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009  Red Hat, Inc.
-	     Copyright (c) 2001  John Beniton
-	     Copyright (c) 2002  Ranjit Mathew
-	     Copyright (c) 2009  Daniel Witte
-			
- 
-   X86 Foreign Function Interface
- 
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   ``Software''), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
- 
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
- 
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-   -----------------------------------------------------------------------
-   */
- 
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.386
-.MODEL FLAT, C
-
-EXTRN ffi_closure_SYSV_inner:NEAR
-
-_TEXT SEGMENT
-
-ffi_call_win32 PROC NEAR,
-    ffi_prep_args : NEAR PTR DWORD,
-    ecif          : NEAR PTR DWORD,
-    cif_abi       : DWORD,
-    cif_bytes     : DWORD,
-    cif_flags     : DWORD,
-    rvalue        : NEAR PTR DWORD,
-    fn            : NEAR PTR DWORD
-
-        ;; Make room for all of the new args.
-        mov  ecx, cif_bytes
-        sub  esp, ecx
-
-        mov  eax, esp
-
-        ;; Place all of the ffi_prep_args in position
-        push ecif
-        push eax
-        call ffi_prep_args
-
-        ;; Return stack to previous state and call the function
-        add  esp, 8
-
-	;; Handle thiscall and fastcall
-	cmp cif_abi, 3 ;; FFI_THISCALL
-	jz do_thiscall
-	cmp cif_abi, 4 ;; FFI_FASTCALL
-	jnz do_stdcall
-	mov ecx, DWORD PTR [esp]
-	mov edx, DWORD PTR [esp+4]
-	add esp, 8
-	jmp do_stdcall
-do_thiscall:
-	mov ecx, DWORD PTR [esp]
-	add esp, 4
-do_stdcall:
-        call fn
-
-        ;; cdecl:   we restore esp in the epilogue, so there's no need to
-        ;;          remove the space we pushed for the args.
-        ;; stdcall: the callee has already cleaned the stack.
-
-        ;; Load ecx with the return type code
-        mov  ecx, cif_flags
-
-        ;; If the return value pointer is NULL, assume no return value.
-        cmp  rvalue, 0
-        jne  ca_jumptable
-
-        ;; Even if there is no space for the return value, we are
-        ;; obliged to handle floating-point values.
-        cmp  ecx, FFI_TYPE_FLOAT
-        jne  ca_epilogue
-        fstp st(0)
-
-        jmp  ca_epilogue
-
-ca_jumptable:
-        jmp  [ca_jumpdata + 4 * ecx]
-ca_jumpdata:
-        ;; Do not insert anything here between label and jump table.
-        dd offset ca_epilogue       ;; FFI_TYPE_VOID
-        dd offset ca_retint         ;; FFI_TYPE_INT
-        dd offset ca_retfloat       ;; FFI_TYPE_FLOAT
-        dd offset ca_retdouble      ;; FFI_TYPE_DOUBLE
-        dd offset ca_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
-        dd offset ca_retuint8       ;; FFI_TYPE_UINT8
-        dd offset ca_retsint8       ;; FFI_TYPE_SINT8
-        dd offset ca_retuint16      ;; FFI_TYPE_UINT16
-        dd offset ca_retsint16      ;; FFI_TYPE_SINT16
-        dd offset ca_retint         ;; FFI_TYPE_UINT32
-        dd offset ca_retint         ;; FFI_TYPE_SINT32
-        dd offset ca_retint64       ;; FFI_TYPE_UINT64
-        dd offset ca_retint64       ;; FFI_TYPE_SINT64
-        dd offset ca_epilogue       ;; FFI_TYPE_STRUCT
-        dd offset ca_retint         ;; FFI_TYPE_POINTER
-        dd offset ca_retstruct1b    ;; FFI_TYPE_SMALL_STRUCT_1B
-        dd offset ca_retstruct2b    ;; FFI_TYPE_SMALL_STRUCT_2B
-        dd offset ca_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
-        dd offset ca_epilogue       ;; FFI_TYPE_MS_STRUCT
-
-        /* Sign/zero extend as appropriate.  */
-ca_retuint8:
-        movzx eax, al
-        jmp   ca_retint
-
-ca_retsint8:
-        movsx eax, al
-        jmp   ca_retint
-
-ca_retuint16:
-        movzx eax, ax
-        jmp   ca_retint
-
-ca_retsint16:
-        movsx eax, ax
-        jmp   ca_retint
-
-ca_retint:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        mov   [ecx + 0], eax
-        jmp   ca_epilogue
-
-ca_retint64:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        mov   [ecx + 0], eax
-        mov   [ecx + 4], edx
-        jmp   ca_epilogue
-
-ca_retfloat:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        fstp  DWORD PTR [ecx]
-        jmp   ca_epilogue
-
-ca_retdouble:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        fstp  QWORD PTR [ecx]
-        jmp   ca_epilogue
-
-ca_retlongdouble:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        fstp  TBYTE PTR [ecx]
-        jmp   ca_epilogue
-
-ca_retstruct1b:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        mov   [ecx + 0], al
-        jmp   ca_epilogue
-
-ca_retstruct2b:
-        ;; Load %ecx with the pointer to storage for the return value
-        mov   ecx, rvalue
-        mov   [ecx + 0], ax
-        jmp   ca_epilogue
-
-ca_epilogue:
-        ;; Epilogue code is autogenerated.
-        ret
-ffi_call_win32 ENDP
-
-ffi_closure_THISCALL PROC NEAR FORCEFRAME
-	sub	esp, 40
-	lea	edx, [ebp -24]
-	mov	[ebp - 12], edx	/* resp */
-	lea	edx, [ebp + 12]  /* account for stub return address on stack */
-	jmp	stub
-ffi_closure_THISCALL ENDP
-
-ffi_closure_SYSV PROC NEAR FORCEFRAME
-    ;; the ffi_closure ctx is passed in eax by the trampoline.
-
-        sub  esp, 40
-        lea  edx, [ebp - 24]
-        mov  [ebp - 12], edx         ;; resp
-        lea  edx, [ebp + 8]
-stub::
-        mov  [esp + 8], edx          ;; args
-        lea  edx, [ebp - 12]
-        mov  [esp + 4], edx          ;; &resp
-        mov  [esp], eax              ;; closure
-        call ffi_closure_SYSV_inner
-        mov  ecx, [ebp - 12]
-
-cs_jumptable:
-        jmp  [cs_jumpdata + 4 * eax]
-cs_jumpdata:
-        ;; Do not insert anything here between the label and jump table.
-        dd offset cs_epilogue       ;; FFI_TYPE_VOID
-        dd offset cs_retint         ;; FFI_TYPE_INT
-        dd offset cs_retfloat       ;; FFI_TYPE_FLOAT
-        dd offset cs_retdouble      ;; FFI_TYPE_DOUBLE
-        dd offset cs_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
-        dd offset cs_retuint8       ;; FFI_TYPE_UINT8
-        dd offset cs_retsint8       ;; FFI_TYPE_SINT8
-        dd offset cs_retuint16      ;; FFI_TYPE_UINT16
-        dd offset cs_retsint16      ;; FFI_TYPE_SINT16
-        dd offset cs_retint         ;; FFI_TYPE_UINT32
-        dd offset cs_retint         ;; FFI_TYPE_SINT32
-        dd offset cs_retint64       ;; FFI_TYPE_UINT64
-        dd offset cs_retint64       ;; FFI_TYPE_SINT64
-        dd offset cs_retstruct      ;; FFI_TYPE_STRUCT
-        dd offset cs_retint         ;; FFI_TYPE_POINTER
-        dd offset cs_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
-        dd offset cs_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
-        dd offset cs_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
-        dd offset cs_retmsstruct    ;; FFI_TYPE_MS_STRUCT
-
-cs_retuint8:
-        movzx eax, BYTE PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retsint8:
-        movsx eax, BYTE PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retuint16:
-        movzx eax, WORD PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retsint16:
-        movsx eax, WORD PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retint:
-        mov   eax, [ecx]
-        jmp   cs_epilogue
-
-cs_retint64:
-        mov   eax, [ecx + 0]
-        mov   edx, [ecx + 4]
-        jmp   cs_epilogue
-
-cs_retfloat:
-        fld   DWORD PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retdouble:
-        fld   QWORD PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retlongdouble:
-        fld   TBYTE PTR [ecx]
-        jmp   cs_epilogue
-
-cs_retstruct:
-        ;; Caller expects us to pop struct return value pointer hidden arg.
-        ;; Epilogue code is autogenerated.
-        ret	4
-
-cs_retmsstruct:
-        ;; Caller expects us to return a pointer to the real return value.
-        mov   eax, ecx
-        ;; Caller doesn't expects us to pop struct return value pointer hidden arg.
-        jmp   cs_epilogue
-
-cs_epilogue:
-        ;; Epilogue code is autogenerated.
-        ret
-ffi_closure_SYSV ENDP
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-
-ffi_closure_raw_THISCALL PROC NEAR USES esi FORCEFRAME
-	sub esp, 36
-	mov  esi, [eax + RAW_CLOSURE_CIF_OFFSET]        ;; closure->cif
-	mov  edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET]  ;; closure->user_data
-	mov [esp + 12], edx
-	lea edx, [ebp + 12]
-	jmp stubraw
-ffi_closure_raw_THISCALL ENDP
-
-ffi_closure_raw_SYSV PROC NEAR USES esi FORCEFRAME
-    ;; the ffi_closure ctx is passed in eax by the trampoline.
-
-        sub  esp, 40
-        mov  esi, [eax + RAW_CLOSURE_CIF_OFFSET]        ;; closure->cif
-        mov  edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET]  ;; closure->user_data
-        mov  [esp + 12], edx                            ;; user_data
-        lea  edx, [ebp + 8]
-stubraw::
-        mov  [esp + 8], edx                             ;; raw_args
-        lea  edx, [ebp - 24]
-        mov  [esp + 4], edx                             ;; &res
-        mov  [esp], esi                                 ;; cif
-        call DWORD PTR [eax + RAW_CLOSURE_FUN_OFFSET]   ;; closure->fun
-        mov  eax, [esi + CIF_FLAGS_OFFSET]              ;; cif->flags
-        lea  ecx, [ebp - 24]
-
-cr_jumptable:
-        jmp  [cr_jumpdata + 4 * eax]
-cr_jumpdata:
-        ;; Do not insert anything here between the label and jump table.
-        dd offset cr_epilogue       ;; FFI_TYPE_VOID
-        dd offset cr_retint         ;; FFI_TYPE_INT
-        dd offset cr_retfloat       ;; FFI_TYPE_FLOAT
-        dd offset cr_retdouble      ;; FFI_TYPE_DOUBLE
-        dd offset cr_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
-        dd offset cr_retuint8       ;; FFI_TYPE_UINT8
-        dd offset cr_retsint8       ;; FFI_TYPE_SINT8
-        dd offset cr_retuint16      ;; FFI_TYPE_UINT16
-        dd offset cr_retsint16      ;; FFI_TYPE_SINT16
-        dd offset cr_retint         ;; FFI_TYPE_UINT32
-        dd offset cr_retint         ;; FFI_TYPE_SINT32
-        dd offset cr_retint64       ;; FFI_TYPE_UINT64
-        dd offset cr_retint64       ;; FFI_TYPE_SINT64
-        dd offset cr_epilogue       ;; FFI_TYPE_STRUCT
-        dd offset cr_retint         ;; FFI_TYPE_POINTER
-        dd offset cr_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
-        dd offset cr_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
-        dd offset cr_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
-        dd offset cr_epilogue       ;; FFI_TYPE_MS_STRUCT
-
-cr_retuint8:
-        movzx eax, BYTE PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retsint8:
-        movsx eax, BYTE PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retuint16:
-        movzx eax, WORD PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retsint16:
-        movsx eax, WORD PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retint:
-        mov   eax, [ecx]
-        jmp   cr_epilogue
-
-cr_retint64:
-        mov   eax, [ecx + 0]
-        mov   edx, [ecx + 4]
-        jmp   cr_epilogue
-
-cr_retfloat:
-        fld   DWORD PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retdouble:
-        fld   QWORD PTR [ecx]
-        jmp   cr_epilogue
-
-cr_retlongdouble:
-        fld   TBYTE PTR [ecx]
-        jmp   cr_epilogue
-
-cr_epilogue:
-        ;; Epilogue code is autogenerated.
-        ret
-ffi_closure_raw_SYSV ENDP
-
-#endif /* !FFI_NO_RAW_API */
-
-ffi_closure_STDCALL PROC NEAR FORCEFRAME
-    ;; the ffi_closure ctx is passed in eax by the trampoline.
-
-        sub  esp, 40
-        lea  edx, [ebp - 24]
-        mov  [ebp - 12], edx         ;; resp
-        lea  edx, [ebp + 12]         ;; account for stub return address on stack
-        mov  [esp + 8], edx          ;; args
-        lea  edx, [ebp - 12]
-        mov  [esp + 4], edx          ;; &resp
-        mov  [esp], eax              ;; closure
-        call ffi_closure_SYSV_inner
-        mov  ecx, [ebp - 12]
-
-cd_jumptable:
-        jmp  [cd_jumpdata + 4 * eax]
-cd_jumpdata:
-        ;; Do not insert anything here between the label and jump table.
-        dd offset cd_epilogue       ;; FFI_TYPE_VOID
-        dd offset cd_retint         ;; FFI_TYPE_INT
-        dd offset cd_retfloat       ;; FFI_TYPE_FLOAT
-        dd offset cd_retdouble      ;; FFI_TYPE_DOUBLE
-        dd offset cd_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
-        dd offset cd_retuint8       ;; FFI_TYPE_UINT8
-        dd offset cd_retsint8       ;; FFI_TYPE_SINT8
-        dd offset cd_retuint16      ;; FFI_TYPE_UINT16
-        dd offset cd_retsint16      ;; FFI_TYPE_SINT16
-        dd offset cd_retint         ;; FFI_TYPE_UINT32
-        dd offset cd_retint         ;; FFI_TYPE_SINT32
-        dd offset cd_retint64       ;; FFI_TYPE_UINT64
-        dd offset cd_retint64       ;; FFI_TYPE_SINT64
-        dd offset cd_epilogue       ;; FFI_TYPE_STRUCT
-        dd offset cd_retint         ;; FFI_TYPE_POINTER
-        dd offset cd_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
-        dd offset cd_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
-        dd offset cd_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
-
-cd_retuint8:
-        movzx eax, BYTE PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retsint8:
-        movsx eax, BYTE PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retuint16:
-        movzx eax, WORD PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retsint16:
-        movsx eax, WORD PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retint:
-        mov   eax, [ecx]
-        jmp   cd_epilogue
-
-cd_retint64:
-        mov   eax, [ecx + 0]
-        mov   edx, [ecx + 4]
-        jmp   cd_epilogue
-
-cd_retfloat:
-        fld   DWORD PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retdouble:
-        fld   QWORD PTR [ecx]
-        jmp   cd_epilogue
-
-cd_retlongdouble:
-        fld   TBYTE PTR [ecx]
-        jmp   cd_epilogue
-
-cd_epilogue:
-        ;; Epilogue code is autogenerated.
-        ret
-ffi_closure_STDCALL ENDP
-
-_TEXT ENDS
-END
diff --git a/lib/wrappers/libffi/msvc/win64_asm.asm b/lib/wrappers/libffi/msvc/win64_asm.asm
deleted file mode 100644
index 301188bc9..000000000
--- a/lib/wrappers/libffi/msvc/win64_asm.asm
+++ /dev/null
@@ -1,156 +0,0 @@
-PUBLIC	ffi_call_AMD64
-
-EXTRN	__chkstk:NEAR
-EXTRN	ffi_closure_SYSV:NEAR
-
-_TEXT	SEGMENT
-
-;;; ffi_closure_OUTER will be called with these registers set:
-;;;    rax points to 'closure'
-;;;    r11 contains a bit mask that specifies which of the
-;;;    first four parameters are float or double
-;;;
-;;; It must move the parameters passed in registers to their stack location,
-;;; call ffi_closure_SYSV for the actual work, then return the result.
-;;; 
-ffi_closure_OUTER PROC FRAME
-	;; save actual arguments to their stack space.
-	test	r11, 1
-	jne	first_is_float	
-	mov	QWORD PTR [rsp+8], rcx
-	jmp	second
-first_is_float:
-	movlpd	QWORD PTR [rsp+8], xmm0
-
-second:
-	test	r11, 2
-	jne	second_is_float	
-	mov	QWORD PTR [rsp+16], rdx
-	jmp	third
-second_is_float:
-	movlpd	QWORD PTR [rsp+16], xmm1
-
-third:
-	test	r11, 4
-	jne	third_is_float	
-	mov	QWORD PTR [rsp+24], r8
-	jmp	forth
-third_is_float:
-	movlpd	QWORD PTR [rsp+24], xmm2
-
-forth:
-	test	r11, 8
-	jne	forth_is_float	
-	mov	QWORD PTR [rsp+32], r9
-	jmp	done
-forth_is_float:
-	movlpd	QWORD PTR [rsp+32], xmm3
-
-done:
-.ALLOCSTACK 40
-	sub	rsp, 40
-.ENDPROLOG
-	mov	rcx, rax	; context is first parameter
-	mov	rdx, rsp	; stack is second parameter
-	add	rdx, 40		; correct our own area
-	mov	rax, ffi_closure_SYSV
-	call	rax		; call the real closure function
-	;; Here, code is missing that handles float return values
-	add	rsp, 40
-	movd	xmm0, rax	; In case the closure returned a float.
-	ret	0
-ffi_closure_OUTER ENDP
-
-
-;;; ffi_call_AMD64
-
-stack$ = 0
-prepfunc$ = 32
-ecif$ = 40
-bytes$ = 48
-flags$ = 56
-rvalue$ = 64
-fn$ = 72
-
-ffi_call_AMD64 PROC FRAME
-
-	mov	QWORD PTR [rsp+32], r9
-	mov	QWORD PTR [rsp+24], r8
-	mov	QWORD PTR [rsp+16], rdx
-	mov	QWORD PTR [rsp+8], rcx
-.PUSHREG rbp
-	push	rbp
-.ALLOCSTACK 48
-	sub	rsp, 48					; 00000030H
-.SETFRAME rbp, 32
-	lea	rbp, QWORD PTR [rsp+32]
-.ENDPROLOG
-
-	mov	eax, DWORD PTR bytes$[rbp]
-	add	rax, 15
-	and	rax, -16
-	call	__chkstk
-	sub	rsp, rax
-	lea	rax, QWORD PTR [rsp+32]
-	mov	QWORD PTR stack$[rbp], rax
-
-	mov	rdx, QWORD PTR ecif$[rbp]
-	mov	rcx, QWORD PTR stack$[rbp]
-	call	QWORD PTR prepfunc$[rbp]
-
-	mov	rsp, QWORD PTR stack$[rbp]
-
-	movlpd	xmm3, QWORD PTR [rsp+24]
-	movd	r9, xmm3
-
-	movlpd	xmm2, QWORD PTR [rsp+16]
-	movd	r8, xmm2
-
-	movlpd	xmm1, QWORD PTR [rsp+8]
-	movd	rdx, xmm1
-
-	movlpd	xmm0, QWORD PTR [rsp]
-	movd	rcx, xmm0
-
-	call	QWORD PTR fn$[rbp]
-ret_int$:
- 	cmp	DWORD PTR flags$[rbp], 1 ; FFI_TYPE_INT
- 	jne	ret_float$
-
-	mov	rcx, QWORD PTR rvalue$[rbp]
-	mov	DWORD PTR [rcx], eax
-	jmp	SHORT ret_nothing$
-
-ret_float$:
- 	cmp	DWORD PTR flags$[rbp], 2 ; FFI_TYPE_FLOAT
- 	jne	SHORT ret_double$
-
- 	mov	rax, QWORD PTR rvalue$[rbp]
- 	movlpd	QWORD PTR [rax], xmm0
- 	jmp	SHORT ret_nothing$
-
-ret_double$:
- 	cmp	DWORD PTR flags$[rbp], 3 ; FFI_TYPE_DOUBLE
- 	jne	SHORT ret_int64$
-
- 	mov	rax, QWORD PTR rvalue$[rbp]
- 	movlpd	QWORD PTR [rax], xmm0
- 	jmp	SHORT ret_nothing$
-
-ret_int64$:
-  	cmp	DWORD PTR flags$[rbp], 12 ; FFI_TYPE_SINT64
-  	jne	ret_nothing$
-
- 	mov	rcx, QWORD PTR rvalue$[rbp]
- 	mov	QWORD PTR [rcx], rax
- 	jmp	SHORT ret_nothing$
-	
-ret_nothing$:
-	xor	eax, eax
-
-	lea	rsp, QWORD PTR [rbp+16]
-	pop	rbp
-	ret	0
-ffi_call_AMD64 ENDP
-_TEXT	ENDS
-END
diff --git a/lib/wrappers/libuv.nim b/lib/wrappers/libuv.nim
index 0cb14fb2b..3e28815ad 100644
--- a/lib/wrappers/libuv.nim
+++ b/lib/wrappers/libuv.nim
@@ -1,3 +1,12 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 ## libuv is still fast moving target
 ## This file was last updated against a development HEAD revision of https://github.com/joyent/libuv/
 
@@ -136,7 +145,7 @@ type
     fs_event_init* {.importc: "fs_event_init".}: uint64
 
   Loop* {.pure, final, importc: "uv_loop_t", header: "uv.h".} = object
-    # ares_handles_* {.importc: "uv_ares_handles_".}: pointer # XXX: This seems to be a private field? 
+    # ares_handles_* {.importc: "uv_ares_handles_".}: pointer # XXX: This seems to be a private field?
     eio_want_poll_notifier* {.importc: "uv_eio_want_poll_notifier".}: TAsync
     eio_done_poll_notifier* {.importc: "uv_eio_done_poll_notifier".}: TAsync
     eio_poller* {.importc: "uv_eio_poller".}: TIdle
diff --git a/lib/wrappers/odbcsql.nim b/lib/wrappers/odbcsql.nim
index 22297497c..971861a6a 100644
--- a/lib/wrappers/odbcsql.nim
+++ b/lib/wrappers/odbcsql.nim
@@ -1,3 +1,11 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
 
 {.deadCodeElim: on.}
 
@@ -27,7 +35,7 @@ else:
 #   ftMemo      SQL_BINARY // SQL_VARCHAR
 #
 
-type 
+type
   TSqlChar* = char
   TSqlSmallInt* = int16
   SqlUSmallInt* = int16
@@ -64,7 +72,7 @@ type
     # TSqlFloat: TSqlFloat, # Name conflict if we drop `T`
     TSqlHWND: SqlHWND].}
 
-const                         # SQL data type codes 
+const                         # SQL data type codes
   SQL_UNKNOWN_TYPE* = 0
   SQL_LONGVARCHAR* = (- 1)
   SQL_BINARY* = (- 2)
@@ -95,8 +103,8 @@ const                         # SQL data type codes
   SQL_INTERVAL* = 10
   SQL_GUID* = - 11            # interval codes
 
-when ODBCVER >= 0x0300: 
-  const 
+when ODBCVER >= 0x0300:
+  const
     SQL_CODE_YEAR* = 1
     SQL_CODE_MONTH* = 2
     SQL_CODE_DAY* = 3
@@ -123,8 +131,8 @@ when ODBCVER >= 0x0300:
     SQL_INTERVAL_HOUR_TO_MINUTE* = 100 + SQL_CODE_HOUR_TO_MINUTE
     SQL_INTERVAL_HOUR_TO_SECOND* = 100 + SQL_CODE_HOUR_TO_SECOND
     SQL_INTERVAL_MINUTE_TO_SECOND* = 100 + SQL_CODE_MINUTE_TO_SECOND
-else: 
-  const 
+else:
+  const
     SQL_INTERVAL_YEAR* = - 80
     SQL_INTERVAL_MONTH* = - 81
     SQL_INTERVAL_YEAR_TO_MONTH* = - 82
@@ -140,20 +148,20 @@ else:
     SQL_INTERVAL_MINUTE_TO_SECOND* = - 92
 
 
-when ODBCVER < 0x0300: 
-  const 
+when ODBCVER < 0x0300:
+  const
     SQL_UNICODE* = - 95
     SQL_UNICODE_VARCHAR* = - 96
     SQL_UNICODE_LONGVARCHAR* = - 97
     SQL_UNICODE_CHAR* = SQL_UNICODE
-else: 
-  # The previous definitions for SQL_UNICODE_ are historical and obsolete 
-  const 
+else:
+  # The previous definitions for SQL_UNICODE_ are historical and obsolete
+  const
     SQL_UNICODE* = SQL_WCHAR
     SQL_UNICODE_VARCHAR* = SQL_WVARCHAR
     SQL_UNICODE_LONGVARCHAR* = SQL_WLONGVARCHAR
     SQL_UNICODE_CHAR* = SQL_WCHAR
-const                         # C datatype to SQL datatype mapping 
+const                         # C datatype to SQL datatype mapping
   SQL_C_CHAR* = SQL_CHAR
   SQL_C_LONG* = SQL_INTEGER
   SQL_C_SHORT* = SQL_SMALLINT
@@ -197,30 +205,30 @@ const                         # C datatype to SQL datatype mapping
   SQL_C_GUID* = SQL_GUID
   SQL_TYPE_NULL* = 0
 
-when ODBCVER < 0x0300: 
-  const 
+when ODBCVER < 0x0300:
+  const
     SQL_TYPE_MIN* = SQL_BIT
     SQL_TYPE_MAX* = SQL_VARCHAR
 
-const 
+const
   SQL_C_VARBOOKMARK* = SQL_C_BINARY
   SQL_API_SQLDESCRIBEPARAM* = 58
   SQL_NO_TOTAL* = - 4
 
-type 
-  SQL_DATE_STRUCT* {.final, pure.} = object 
+type
+  SQL_DATE_STRUCT* {.final, pure.} = object
     Year*: TSqlSmallInt
     Month*: SqlUSmallInt
     Day*: SqlUSmallInt
 
   PSQL_DATE_STRUCT* = ptr SQL_DATE_STRUCT
-  SQL_TIME_STRUCT* {.final, pure.} = object 
+  SQL_TIME_STRUCT* {.final, pure.} = object
     Hour*: SqlUSmallInt
     Minute*: SqlUSmallInt
     Second*: SqlUSmallInt
 
   PSQL_TIME_STRUCT* = ptr SQL_TIME_STRUCT
-  SQL_TIMESTAMP_STRUCT* {.final, pure.} = object 
+  SQL_TIMESTAMP_STRUCT* {.final, pure.} = object
     Year*: SqlUSmallInt
     Month*: SqlUSmallInt
     Day*: SqlUSmallInt
@@ -231,34 +239,34 @@ type
 
   PSQL_TIMESTAMP_STRUCT* = ptr SQL_TIMESTAMP_STRUCT
 
-const 
+const
   SQL_NAME_LEN* = 128
   SQL_OV_ODBC3* = 3
   SQL_OV_ODBC2* = 2
-  SQL_ATTR_ODBC_VERSION* = 200 # Options for SQLDriverConnect 
+  SQL_ATTR_ODBC_VERSION* = 200 # Options for SQLDriverConnect
   SQL_DRIVER_NOPROMPT* = 0
   SQL_DRIVER_COMPLETE* = 1
   SQL_DRIVER_PROMPT* = 2
-  SQL_DRIVER_COMPLETE_REQUIRED* = 3 
-  SQL_IS_POINTER* = (- 4)  # whether an attribute is a pointer or not 
+  SQL_DRIVER_COMPLETE_REQUIRED* = 3
+  SQL_IS_POINTER* = (- 4)  # whether an attribute is a pointer or not
   SQL_IS_UINTEGER* = (- 5)
   SQL_IS_INTEGER* = (- 6)
   SQL_IS_USMALLINT* = (- 7)
-  SQL_IS_SMALLINT* = (- 8)    # SQLExtendedFetch "fFetchType" values 
+  SQL_IS_SMALLINT* = (- 8)    # SQLExtendedFetch "fFetchType" values
   SQL_FETCH_BOOKMARK* = 8
-  SQL_SCROLL_OPTIONS* = 44    # SQL_USE_BOOKMARKS options 
+  SQL_SCROLL_OPTIONS* = 44    # SQL_USE_BOOKMARKS options
   SQL_UB_OFF* = 0
   SQL_UB_ON* = 1
   SQL_UB_DEFAULT* = SQL_UB_OFF
   SQL_UB_FIXED* = SQL_UB_ON
-  SQL_UB_VARIABLE* = 2        # SQL_SCROLL_OPTIONS masks 
+  SQL_UB_VARIABLE* = 2        # SQL_SCROLL_OPTIONS masks
   SQL_SO_FORWARD_ONLY* = 0x00000001
   SQL_SO_KEYSET_DRIVEN* = 0x00000002
   SQL_SO_DYNAMIC* = 0x00000004
   SQL_SO_MIXED* = 0x00000008
   SQL_SO_STATIC* = 0x00000010
   SQL_BOOKMARK_PERSISTENCE* = 82
-  SQL_STATIC_SENSITIVITY* = 83 # SQL_BOOKMARK_PERSISTENCE values 
+  SQL_STATIC_SENSITIVITY* = 83 # SQL_BOOKMARK_PERSISTENCE values
   SQL_BP_CLOSE* = 0x00000001
   SQL_BP_DELETE* = 0x00000002
   SQL_BP_DROP* = 0x00000004
@@ -275,32 +283,32 @@ const
   SQL_KEYSET_CURSOR_ATTRIBUTES1* = 150
   SQL_KEYSET_CURSOR_ATTRIBUTES2* = 151
   SQL_STATIC_CURSOR_ATTRIBUTES1* = 167
-  SQL_STATIC_CURSOR_ATTRIBUTES2* = 168 # supported SQLFetchScroll FetchOrientation's 
+  SQL_STATIC_CURSOR_ATTRIBUTES2* = 168 # supported SQLFetchScroll FetchOrientation's
   SQL_CA1_NEXT* = 1
   SQL_CA1_ABSOLUTE* = 2
   SQL_CA1_RELATIVE* = 4
-  SQL_CA1_BOOKMARK* = 8       # supported SQLSetPos LockType's 
+  SQL_CA1_BOOKMARK* = 8       # supported SQLSetPos LockType's
   SQL_CA1_LOCK_NO_CHANGE* = 0x00000040
   SQL_CA1_LOCK_EXCLUSIVE* = 0x00000080
-  SQL_CA1_LOCK_UNLOCK* = 0x00000100 # supported SQLSetPos Operations 
+  SQL_CA1_LOCK_UNLOCK* = 0x00000100 # supported SQLSetPos Operations
   SQL_CA1_POS_POSITION* = 0x00000200
   SQL_CA1_POS_UPDATE* = 0x00000400
   SQL_CA1_POS_DELETE* = 0x00000800
-  SQL_CA1_POS_REFRESH* = 0x00001000 # positioned updates and deletes 
+  SQL_CA1_POS_REFRESH* = 0x00001000 # positioned updates and deletes
   SQL_CA1_POSITIONED_UPDATE* = 0x00002000
   SQL_CA1_POSITIONED_DELETE* = 0x00004000
-  SQL_CA1_SELECT_FOR_UPDATE* = 0x00008000 # supported SQLBulkOperations operations 
+  SQL_CA1_SELECT_FOR_UPDATE* = 0x00008000 # supported SQLBulkOperations operations
   SQL_CA1_BULK_ADD* = 0x00010000
   SQL_CA1_BULK_UPDATE_BY_BOOKMARK* = 0x00020000
   SQL_CA1_BULK_DELETE_BY_BOOKMARK* = 0x00040000
-  SQL_CA1_BULK_FETCH_BY_BOOKMARK* = 0x00080000 # supported values for SQL_ATTR_SCROLL_CONCURRENCY 
+  SQL_CA1_BULK_FETCH_BY_BOOKMARK* = 0x00080000 # supported values for SQL_ATTR_SCROLL_CONCURRENCY
   SQL_CA2_READ_ONLY_CONCURRENCY* = 1
   SQL_CA2_LOCK_CONCURRENCY* = 2
   SQL_CA2_OPT_ROWVER_CONCURRENCY* = 4
-  SQL_CA2_OPT_VALUES_CONCURRENCY* = 8 # sensitivity of the cursor to its own inserts, deletes, and updates 
+  SQL_CA2_OPT_VALUES_CONCURRENCY* = 8 # sensitivity of the cursor to its own inserts, deletes, and updates
   SQL_CA2_SENSITIVITY_ADDITIONS* = 0x00000010
   SQL_CA2_SENSITIVITY_DELETIONS* = 0x00000020
-  SQL_CA2_SENSITIVITY_UPDATES* = 0x00000040 #  semantics of SQL_ATTR_MAX_ROWS 
+  SQL_CA2_SENSITIVITY_UPDATES* = 0x00000040 #  semantics of SQL_ATTR_MAX_ROWS
   SQL_CA2_MAX_ROWS_SELECT* = 0x00000080
   SQL_CA2_MAX_ROWS_INSERT* = 0x00000100
   SQL_CA2_MAX_ROWS_DELETE* = 0x00000200
@@ -308,25 +316,25 @@ const
   SQL_CA2_MAX_ROWS_CATALOG* = 0x00000800
   SQL_CA2_MAX_ROWS_AFFECTS_ALL* = (SQL_CA2_MAX_ROWS_SELECT or
       SQL_CA2_MAX_ROWS_INSERT or SQL_CA2_MAX_ROWS_DELETE or
-      SQL_CA2_MAX_ROWS_UPDATE or SQL_CA2_MAX_ROWS_CATALOG) # semantics of 
-                                                           # SQL_DIAG_CURSOR_ROW_COUNT 
+      SQL_CA2_MAX_ROWS_UPDATE or SQL_CA2_MAX_ROWS_CATALOG) # semantics of
+                                                           # SQL_DIAG_CURSOR_ROW_COUNT
   SQL_CA2_CRC_EXACT* = 0x00001000
-  SQL_CA2_CRC_APPROXIMATE* = 0x00002000 #  the kinds of positioned statements that can be simulated 
+  SQL_CA2_CRC_APPROXIMATE* = 0x00002000 #  the kinds of positioned statements that can be simulated
   SQL_CA2_SIMULATE_NON_UNIQUE* = 0x00004000
   SQL_CA2_SIMULATE_TRY_UNIQUE* = 0x00008000
-  SQL_CA2_SIMULATE_UNIQUE* = 0x00010000 #  Operations in SQLBulkOperations 
+  SQL_CA2_SIMULATE_UNIQUE* = 0x00010000 #  Operations in SQLBulkOperations
   SQL_ADD* = 4
   SQL_SETPOS_MAX_OPTION_VALUE* = SQL_ADD
   SQL_UPDATE_BY_BOOKMARK* = 5
   SQL_DELETE_BY_BOOKMARK* = 6
-  SQL_FETCH_BY_BOOKMARK* = 7  # Operations in SQLSetPos 
+  SQL_FETCH_BY_BOOKMARK* = 7  # Operations in SQLSetPos
   SQL_POSITION* = 0
   SQL_REFRESH* = 1
   SQL_UPDATE* = 2
-  SQL_DELETE* = 3             # Lock options in SQLSetPos 
+  SQL_DELETE* = 3             # Lock options in SQLSetPos
   SQL_LOCK_NO_CHANGE* = 0
   SQL_LOCK_EXCLUSIVE* = 1
-  SQL_LOCK_UNLOCK* = 2        # SQLExtendedFetch "rgfRowStatus" element values 
+  SQL_LOCK_UNLOCK* = 2        # SQLExtendedFetch "rgfRowStatus" element values
   SQL_ROW_SUCCESS* = 0
   SQL_ROW_DELETED* = 1
   SQL_ROW_UPDATED* = 2
@@ -336,10 +344,10 @@ const
   SQL_ROW_SUCCESS_WITH_INFO* = 6
   SQL_ROW_PROCEED* = 0
   SQL_ROW_IGNORE* = 1
-  SQL_MAX_DSN_LENGTH* = 32    # maximum data source name size 
+  SQL_MAX_DSN_LENGTH* = 32    # maximum data source name size
   SQL_MAX_OPTION_STRING_LENGTH* = 256
   SQL_ODBC_CURSORS* = 110
-  SQL_ATTR_ODBC_CURSORS* = SQL_ODBC_CURSORS # SQL_ODBC_CURSORS options 
+  SQL_ATTR_ODBC_CURSORS* = SQL_ODBC_CURSORS # SQL_ODBC_CURSORS options
   SQL_CUR_USE_IF_NEEDED* = 0
   SQL_CUR_USE_ODBC* = 1
   SQL_CUR_USE_DRIVER* = 2
@@ -349,7 +357,7 @@ const
   SQL_PARAM_INPUT_OUTPUT* = 2
   SQL_RESULT_COL* = 3
   SQL_PARAM_OUTPUT* = 4
-  SQL_RETURN_VALUE* = 5       # special length/indicator values 
+  SQL_RETURN_VALUE* = 5       # special length/indicator values
   SQL_NULL_DATA* = (- 1)
   SQL_DATA_AT_EXEC* = (- 2)
   SQL_SUCCESS* = 0
@@ -358,20 +366,20 @@ const
   SQL_ERROR* = (- 1)
   SQL_INVALID_HANDLE* = (- 2)
   SQL_STILL_EXECUTING* = 2
-  SQL_NEED_DATA* = 99         # flags for null-terminated string 
-  SQL_NTS* = (- 3)            # maximum message length 
-  SQL_MAX_MESSAGE_LENGTH* = 512 # date/time length constants 
+  SQL_NEED_DATA* = 99         # flags for null-terminated string
+  SQL_NTS* = (- 3)            # maximum message length
+  SQL_MAX_MESSAGE_LENGTH* = 512 # date/time length constants
   SQL_DATE_LEN* = 10
-  SQL_TIME_LEN* = 8           # add P+1 if precision is nonzero 
-  SQL_TIMESTAMP_LEN* = 19     # add P+1 if precision is nonzero 
-                              # handle type identifiers 
+  SQL_TIME_LEN* = 8           # add P+1 if precision is nonzero
+  SQL_TIMESTAMP_LEN* = 19     # add P+1 if precision is nonzero
+                              # handle type identifiers
   SQL_HANDLE_ENV* = 1
   SQL_HANDLE_DBC* = 2
   SQL_HANDLE_STMT* = 3
-  SQL_HANDLE_DESC* = 4        # environment attribute 
-  SQL_ATTR_OUTPUT_NTS* = 10001 # connection attributes 
+  SQL_HANDLE_DESC* = 4        # environment attribute
+  SQL_ATTR_OUTPUT_NTS* = 10001 # connection attributes
   SQL_ATTR_AUTO_IPD* = 10001
-  SQL_ATTR_METADATA_ID* = 10014 # statement attributes 
+  SQL_ATTR_METADATA_ID* = 10014 # statement attributes
   SQL_ATTR_APP_ROW_DESC* = 10010
   SQL_ATTR_APP_PARAM_DESC* = 10011
   SQL_ATTR_IMP_ROW_DESC* = 10012
@@ -434,21 +442,21 @@ const
   SQL_MODE_DEFAULT* = SQL_MODE_READ_WRITE #* SQL_AUTOCOMMIT options */
   SQL_AUTOCOMMIT_OFF* = 0
   SQL_AUTOCOMMIT_ON* = 1
-  SQL_AUTOCOMMIT_DEFAULT* = SQL_AUTOCOMMIT_ON # SQL_ATTR_CURSOR_SCROLLABLE values 
+  SQL_AUTOCOMMIT_DEFAULT* = SQL_AUTOCOMMIT_ON # SQL_ATTR_CURSOR_SCROLLABLE values
   SQL_NONSCROLLABLE* = 0
-  SQL_SCROLLABLE* = 1         # SQL_CURSOR_TYPE options 
+  SQL_SCROLLABLE* = 1         # SQL_CURSOR_TYPE options
   SQL_CURSOR_FORWARD_ONLY* = 0
   SQL_CURSOR_KEYSET_DRIVEN* = 1
   SQL_CURSOR_DYNAMIC* = 2
   SQL_CURSOR_STATIC* = 3
-  SQL_CURSOR_TYPE_DEFAULT* = SQL_CURSOR_FORWARD_ONLY # Default value 
-                                                     # SQL_CONCURRENCY options 
+  SQL_CURSOR_TYPE_DEFAULT* = SQL_CURSOR_FORWARD_ONLY # Default value
+                                                     # SQL_CONCURRENCY options
   SQL_CONCUR_READ_ONLY* = 1
   SQL_CONCUR_LOCK* = 2
   SQL_CONCUR_ROWVER* = 3
   SQL_CONCUR_VALUES* = 4
-  SQL_CONCUR_DEFAULT* = SQL_CONCUR_READ_ONLY # Default value 
-                                             # identifiers of fields in the SQL descriptor 
+  SQL_CONCUR_DEFAULT* = SQL_CONCUR_READ_ONLY # Default value
+                                             # identifiers of fields in the SQL descriptor
   SQL_DESC_COUNT* = 1001
   SQL_DESC_TYPE* = 1002
   SQL_DESC_LENGTH* = 1003
@@ -462,7 +470,7 @@ const
   SQL_DESC_NAME* = 1011
   SQL_DESC_UNNAMED* = 1012
   SQL_DESC_OCTET_LENGTH* = 1013
-  SQL_DESC_ALLOC_TYPE* = 1099 # identifiers of fields in the diagnostics area 
+  SQL_DESC_ALLOC_TYPE* = 1099 # identifiers of fields in the diagnostics area
   SQL_DIAG_RETURNCODE* = 1
   SQL_DIAG_NUMBER* = 2
   SQL_DIAG_ROW_COUNT* = 3
@@ -474,7 +482,7 @@ const
   SQL_DIAG_SUBCLASS_ORIGIN* = 9
   SQL_DIAG_CONNECTION_NAME* = 10
   SQL_DIAG_SERVER_NAME* = 11
-  SQL_DIAG_DYNAMIC_FUNCTION_CODE* = 12 # dynamic function codes 
+  SQL_DIAG_DYNAMIC_FUNCTION_CODE* = 12 # dynamic function codes
   SQL_DIAG_ALTER_TABLE* = 4
   SQL_DIAG_CREATE_INDEX* = (- 1)
   SQL_DIAG_CREATE_TABLE* = 77
@@ -490,36 +498,36 @@ const
   SQL_DIAG_REVOKE* = 59
   SQL_DIAG_SELECT_CURSOR* = 85
   SQL_DIAG_UNKNOWN_STATEMENT* = 0
-  SQL_DIAG_UPDATE_WHERE* = 82 # Statement attribute values for cursor sensitivity 
+  SQL_DIAG_UPDATE_WHERE* = 82 # Statement attribute values for cursor sensitivity
   SQL_UNSPECIFIED* = 0
   SQL_INSENSITIVE* = 1
-  SQL_SENSITIVE* = 2          # GetTypeInfo() request for all data types 
-  SQL_ALL_TYPES* = 0          # Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() 
+  SQL_SENSITIVE* = 2          # GetTypeInfo() request for all data types
+  SQL_ALL_TYPES* = 0          # Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData()
   SQL_DEFAULT* = 99 # SQLGetData() code indicating that the application row descriptor
-                    #    specifies the data type 
-  SQL_ARD_TYPE* = (- 99)      # SQL date/time type subcodes 
+                    #    specifies the data type
+  SQL_ARD_TYPE* = (- 99)      # SQL date/time type subcodes
   SQL_CODE_DATE* = 1
   SQL_CODE_TIME* = 2
-  SQL_CODE_TIMESTAMP* = 3     # CLI option values 
+  SQL_CODE_TIMESTAMP* = 3     # CLI option values
   SQL_FALSE* = 0
-  SQL_TRUE* = 1               # values of NULLABLE field in descriptor 
+  SQL_TRUE* = 1               # values of NULLABLE field in descriptor
   SQL_NO_NULLS* = 0
   SQL_NULLABLE* = 1 # Value returned by SQLGetTypeInfo() to denote that it is
-                    # not known whether or not a data type supports null values. 
-  SQL_NULLABLE_UNKNOWN* = 2 
+                    # not known whether or not a data type supports null values.
+  SQL_NULLABLE_UNKNOWN* = 2
   SQL_CLOSE* = 0
   SQL_DROP* = 1
   SQL_UNBIND* = 2
   SQL_RESET_PARAMS* = 3 # Codes used for FetchOrientation in SQLFetchScroll(),
-                        #   and in SQLDataSources() 
+                        #   and in SQLDataSources()
   SQL_FETCH_NEXT* = 1
   SQL_FETCH_FIRST* = 2
   SQL_FETCH_FIRST_USER* = 31
-  SQL_FETCH_FIRST_SYSTEM* = 32 # Other codes used for FetchOrientation in SQLFetchScroll() 
+  SQL_FETCH_FIRST_SYSTEM* = 32 # Other codes used for FetchOrientation in SQLFetchScroll()
   SQL_FETCH_LAST* = 3
   SQL_FETCH_PRIOR* = 4
   SQL_FETCH_ABSOLUTE* = 5
-  SQL_FETCH_RELATIVE* = 6   
+  SQL_FETCH_RELATIVE* = 6
   SQL_NULL_HENV* = SqlHEnv(nil)
   SQL_NULL_HDBC* = SqlHDBC(nil)
   SQL_NULL_HSTMT* = SqlHStmt(nil)
@@ -529,7 +537,7 @@ const
   SQL_SCOPE_TRANSACTION* = 1
   SQL_SCOPE_SESSION* = 2      #* Column types and scopes in SQLSpecialColumns.  */
   SQL_BEST_ROWID* = 1
-  SQL_ROWVER* = 2             
+  SQL_ROWVER* = 2
   SQL_ROW_IDENTIFIER* = 1     #* Reserved values for UNIQUE argument of SQLStatistics() */
   SQL_INDEX_UNIQUE* = 0
   SQL_INDEX_ALL* = 1          #* Reserved values for RESERVED argument of SQLStatistics() */
@@ -538,13 +546,13 @@ const
   SQL_TABLE_STAT* = 0
   SQL_INDEX_CLUSTERED* = 1
   SQL_INDEX_HASHED* = 2
-  SQL_INDEX_OTHER* = 3 
+  SQL_INDEX_OTHER* = 3
   SQL_SCROLL_CONCURRENCY* = 43
   SQL_TXN_CAPABLE* = 46
   SQL_TRANSACTION_CAPABLE* = SQL_TXN_CAPABLE
   SQL_USER_NAME* = 47
   SQL_TXN_ISOLATION_OPTION* = 72
-  SQL_TRANSACTION_ISOLATION_OPTION* = SQL_TXN_ISOLATION_OPTION 
+  SQL_TRANSACTION_ISOLATION_OPTION* = SQL_TXN_ISOLATION_OPTION
   SQL_OJ_CAPABILITIES* = 115
   SQL_OUTER_JOIN_CAPABILITIES* = SQL_OJ_CAPABILITIES
   SQL_XOPEN_CLI_YEAR* = 10000
@@ -570,10 +578,10 @@ const
   SQL_TXN_REPEATABLE_READ* = 4
   SQL_TRANSACTION_REPEATABLE_READ* = SQL_TXN_REPEATABLE_READ
   SQL_TXN_SERIALIZABLE* = 8
-  SQL_TRANSACTION_SERIALIZABLE* = SQL_TXN_SERIALIZABLE 
+  SQL_TRANSACTION_SERIALIZABLE* = SQL_TXN_SERIALIZABLE
   SQL_SS_ADDITIONS* = 1
   SQL_SS_DELETIONS* = 2
-  SQL_SS_UPDATES* = 4         # SQLColAttributes defines 
+  SQL_SS_UPDATES* = 4         # SQLColAttributes defines
   SQL_COLUMN_COUNT* = 0
   SQL_COLUMN_NAME* = 1
   SQL_COLUMN_TYPE* = 2
@@ -633,166 +641,166 @@ const
   ODBC_CONFIG_SYS_DSN* = 5
   ODBC_REMOVE_SYS_DSN* = 6
 
-proc SQLAllocHandle*(HandleType: TSqlSmallInt, InputHandle: SqlHandle, 
+proc SQLAllocHandle*(HandleType: TSqlSmallInt, InputHandle: SqlHandle,
                      OutputHandlePtr: var SqlHandle): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLSetEnvAttr*(EnvironmentHandle: SqlHEnv, Attribute: TSqlInteger, 
+proc SQLSetEnvAttr*(EnvironmentHandle: SqlHEnv, Attribute: TSqlInteger,
                     Value: SqlPointer, StringLength: TSqlInteger): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLGetEnvAttr*(EnvironmentHandle: SqlHEnv, Attribute: TSqlInteger, 
-                    Value: SqlPointer, BufferLength: TSqlInteger, 
-                    StringLength: PSQLINTEGER): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLGetEnvAttr*(EnvironmentHandle: SqlHEnv, Attribute: TSqlInteger,
+                    Value: SqlPointer, BufferLength: TSqlInteger,
+                    StringLength: PSQLINTEGER): TSqlSmallInt{.dynlib: odbclib,
     importc.}
 proc SQLFreeHandle*(HandleType: TSqlSmallInt, Handle: SqlHandle): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLGetDiagRec*(HandleType: TSqlSmallInt, Handle: SqlHandle, 
-                    RecNumber: TSqlSmallInt, Sqlstate: PSQLCHAR, 
-                    NativeError: var TSqlInteger, MessageText: PSQLCHAR, 
+proc SQLGetDiagRec*(HandleType: TSqlSmallInt, Handle: SqlHandle,
+                    RecNumber: TSqlSmallInt, Sqlstate: PSQLCHAR,
+                    NativeError: var TSqlInteger, MessageText: PSQLCHAR,
                     BufferLength: TSqlSmallInt, TextLength: var TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLGetDiagField*(HandleType: TSqlSmallInt, Handle: SqlHandle, 
-                      RecNumber: TSqlSmallInt, DiagIdentifier: TSqlSmallInt, 
-                      DiagInfoPtr: SqlPointer, BufferLength: TSqlSmallInt, 
+proc SQLGetDiagField*(HandleType: TSqlSmallInt, Handle: SqlHandle,
+                      RecNumber: TSqlSmallInt, DiagIdentifier: TSqlSmallInt,
+                      DiagInfoPtr: SqlPointer, BufferLength: TSqlSmallInt,
                       StringLengthPtr: var TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLConnect*(ConnectionHandle: SqlHDBC, ServerName: PSQLCHAR, 
-                 NameLength1: TSqlSmallInt, UserName: PSQLCHAR, 
-                 NameLength2: TSqlSmallInt, Authentication: PSQLCHAR, 
+proc SQLConnect*(ConnectionHandle: SqlHDBC, ServerName: PSQLCHAR,
+                 NameLength1: TSqlSmallInt, UserName: PSQLCHAR,
+                 NameLength2: TSqlSmallInt, Authentication: PSQLCHAR,
                  NameLength3: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLDisconnect*(ConnectionHandle: SqlHDBC): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLDisconnect*(ConnectionHandle: SqlHDBC): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLDriverConnect*(hdbc: SqlHDBC, hwnd: SqlHWND, szCsin: cstring, 
-                       szCLen: TSqlSmallInt, szCsout: cstring, 
-                       cbCSMax: TSqlSmallInt, cbCsOut: var TSqlSmallInt, 
+proc SQLDriverConnect*(hdbc: SqlHDBC, hwnd: SqlHWND, szCsin: cstring,
+                       szCLen: TSqlSmallInt, szCsout: cstring,
+                       cbCSMax: TSqlSmallInt, cbCsOut: var TSqlSmallInt,
                        f: SqlUSmallInt): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLBrowseConnect*(hdbc: SqlHDBC, szConnStrIn: PSQLCHAR, 
-                       cbConnStrIn: TSqlSmallInt, szConnStrOut: PSQLCHAR, 
-                       cbConnStrOutMax: TSqlSmallInt, 
+proc SQLBrowseConnect*(hdbc: SqlHDBC, szConnStrIn: PSQLCHAR,
+                       cbConnStrIn: TSqlSmallInt, szConnStrOut: PSQLCHAR,
+                       cbConnStrOutMax: TSqlSmallInt,
                        cbConnStrOut: var TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLExecDirect*(StatementHandle: SqlHStmt, StatementText: PSQLCHAR, 
+proc SQLExecDirect*(StatementHandle: SqlHStmt, StatementText: PSQLCHAR,
                     TextLength: TSqlInteger): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLPrepare*(StatementHandle: SqlHStmt, StatementText: PSQLCHAR, 
+proc SQLPrepare*(StatementHandle: SqlHStmt, StatementText: PSQLCHAR,
                  TextLength: TSqlInteger): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLCloseCursor*(StatementHandle: SqlHStmt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLCloseCursor*(StatementHandle: SqlHStmt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
 proc SQLExecute*(StatementHandle: SqlHStmt): TSqlSmallInt{.dynlib: odbclib, importc.}
 proc SQLFetch*(StatementHandle: SqlHStmt): TSqlSmallInt{.dynlib: odbclib, importc.}
 proc SQLNumResultCols*(StatementHandle: SqlHStmt, ColumnCount: var TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLDescribeCol*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt, 
-                     ColumnName: PSQLCHAR, BufferLength: TSqlSmallInt, 
-                     NameLength: var TSqlSmallInt, DataType: var TSqlSmallInt, 
-                     ColumnSize: var SqlUInteger, 
+proc SQLDescribeCol*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt,
+                     ColumnName: PSQLCHAR, BufferLength: TSqlSmallInt,
+                     NameLength: var TSqlSmallInt, DataType: var TSqlSmallInt,
+                     ColumnSize: var SqlUInteger,
                      DecimalDigits: var TSqlSmallInt, Nullable: var TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLFetchScroll*(StatementHandle: SqlHStmt, FetchOrientation: TSqlSmallInt, 
-                     FetchOffset: TSqlInteger): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLFetchScroll*(StatementHandle: SqlHStmt, FetchOrientation: TSqlSmallInt,
+                     FetchOffset: TSqlInteger): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLExtendedFetch*(hstmt: SqlHStmt, fFetchType: SqlUSmallInt, 
-                       irow: TSqlInteger, pcrow: PSQLUINTEGER, 
-                       rgfRowStatus: PSQLUSMALLINT): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLExtendedFetch*(hstmt: SqlHStmt, fFetchType: SqlUSmallInt,
+                       irow: TSqlInteger, pcrow: PSQLUINTEGER,
+                       rgfRowStatus: PSQLUSMALLINT): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLGetData*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt, 
-                 TargetType: TSqlSmallInt, TargetValue: SqlPointer, 
+proc SQLGetData*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt,
+                 TargetType: TSqlSmallInt, TargetValue: SqlPointer,
                  BufferLength: TSqlInteger, StrLen_or_Ind: PSQLINTEGER): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLSetStmtAttr*(StatementHandle: SqlHStmt, Attribute: TSqlInteger, 
+proc SQLSetStmtAttr*(StatementHandle: SqlHStmt, Attribute: TSqlInteger,
                      Value: SqlPointer, StringLength: TSqlInteger): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLGetStmtAttr*(StatementHandle: SqlHStmt, Attribute: TSqlInteger, 
-                     Value: SqlPointer, BufferLength: TSqlInteger, 
-                     StringLength: PSQLINTEGER): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLGetStmtAttr*(StatementHandle: SqlHStmt, Attribute: TSqlInteger,
+                     Value: SqlPointer, BufferLength: TSqlInteger,
+                     StringLength: PSQLINTEGER): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLGetInfo*(ConnectionHandle: SqlHDBC, InfoType: SqlUSmallInt, 
-                 InfoValue: SqlPointer, BufferLength: TSqlSmallInt, 
-                 StringLength: PSQLSMALLINT): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLGetInfo*(ConnectionHandle: SqlHDBC, InfoType: SqlUSmallInt,
+                 InfoValue: SqlPointer, BufferLength: TSqlSmallInt,
+                 StringLength: PSQLSMALLINT): TSqlSmallInt{.dynlib: odbclib,
     importc.}
 proc SQLBulkOperations*(StatementHandle: SqlHStmt, Operation: TSqlSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLPutData*(StatementHandle: SqlHStmt, Data: SqlPointer, 
+proc SQLPutData*(StatementHandle: SqlHStmt, Data: SqlPointer,
                  StrLen_or_Ind: TSqlInteger): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLBindCol*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt, 
-                 TargetType: TSqlSmallInt, TargetValue: SqlPointer, 
+proc SQLBindCol*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt,
+                 TargetType: TSqlSmallInt, TargetValue: SqlPointer,
                  BufferLength: TSqlInteger, StrLen_or_Ind: PSQLINTEGER): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLSetPos*(hstmt: SqlHStmt, irow: SqlUSmallInt, fOption: SqlUSmallInt, 
+proc SQLSetPos*(hstmt: SqlHStmt, irow: SqlUSmallInt, fOption: SqlUSmallInt,
                 fLock: SqlUSmallInt): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLDataSources*(EnvironmentHandle: SqlHEnv, Direction: SqlUSmallInt, 
-                     ServerName: PSQLCHAR, BufferLength1: TSqlSmallInt, 
-                     NameLength1: PSQLSMALLINT, Description: PSQLCHAR, 
+proc SQLDataSources*(EnvironmentHandle: SqlHEnv, Direction: SqlUSmallInt,
+                     ServerName: PSQLCHAR, BufferLength1: TSqlSmallInt,
+                     NameLength1: PSQLSMALLINT, Description: PSQLCHAR,
                      BufferLength2: TSqlSmallInt, NameLength2: PSQLSMALLINT): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLDrivers*(EnvironmentHandle: SqlHEnv, Direction: SqlUSmallInt, 
-                 DriverDescription: PSQLCHAR, BufferLength1: TSqlSmallInt, 
-                 DescriptionLength1: PSQLSMALLINT, DriverAttributes: PSQLCHAR, 
+proc SQLDrivers*(EnvironmentHandle: SqlHEnv, Direction: SqlUSmallInt,
+                 DriverDescription: PSQLCHAR, BufferLength1: TSqlSmallInt,
+                 DescriptionLength1: PSQLSMALLINT, DriverAttributes: PSQLCHAR,
                  BufferLength2: TSqlSmallInt, AttributesLength2: PSQLSMALLINT): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLSetConnectAttr*(ConnectionHandle: SqlHDBC, Attribute: TSqlInteger, 
+proc SQLSetConnectAttr*(ConnectionHandle: SqlHDBC, Attribute: TSqlInteger,
                         Value: SqlPointer, StringLength: TSqlInteger): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLGetCursorName*(StatementHandle: SqlHStmt, CursorName: PSQLCHAR, 
+proc SQLGetCursorName*(StatementHandle: SqlHStmt, CursorName: PSQLCHAR,
                        BufferLength: TSqlSmallInt, NameLength: PSQLSMALLINT): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLSetCursorName*(StatementHandle: SqlHStmt, CursorName: PSQLCHAR, 
-                       NameLength: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLSetCursorName*(StatementHandle: SqlHStmt, CursorName: PSQLCHAR,
+                       NameLength: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
 proc SQLRowCount*(StatementHandle: SqlHStmt, RowCount: var TSqlInteger): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLBindParameter*(hstmt: SqlHStmt, ipar: SqlUSmallInt, 
-                       fParamType: TSqlSmallInt, fCType: TSqlSmallInt, 
-                       fSqlType: TSqlSmallInt, cbColDef: SqlUInteger, 
-                       ibScale: TSqlSmallInt, rgbValue: SqlPointer, 
+proc SQLBindParameter*(hstmt: SqlHStmt, ipar: SqlUSmallInt,
+                       fParamType: TSqlSmallInt, fCType: TSqlSmallInt,
+                       fSqlType: TSqlSmallInt, cbColDef: SqlUInteger,
+                       ibScale: TSqlSmallInt, rgbValue: SqlPointer,
                        cbValueMax: TSqlInteger, pcbValue: PSQLINTEGER): TSqlSmallInt{.
     dynlib: odbclib, importc.}
 proc SQLFreeStmt*(StatementHandle: SqlHStmt, Option: SqlUSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLColAttribute*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt, 
-                      FieldIdentifier: SqlUSmallInt, 
-                      CharacterAttribute: PSQLCHAR, BufferLength: TSqlSmallInt, 
-                      StringLength: PSQLSMALLINT, 
+proc SQLColAttribute*(StatementHandle: SqlHStmt, ColumnNumber: SqlUSmallInt,
+                      FieldIdentifier: SqlUSmallInt,
+                      CharacterAttribute: PSQLCHAR, BufferLength: TSqlSmallInt,
+                      StringLength: PSQLSMALLINT,
                       NumericAttribute: SqlPointer): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLEndTran*(HandleType: TSqlSmallInt, Handle: SqlHandle, 
-                 CompletionType: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLEndTran*(HandleType: TSqlSmallInt, Handle: SqlHandle,
+                 CompletionType: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLTables*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR, 
-                cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR, 
-                cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR, 
-                cbTableName: TSqlSmallInt, szTableType: PSQLCHAR, 
+proc SQLTables*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR,
+                cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR,
+                cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR,
+                cbTableName: TSqlSmallInt, szTableType: PSQLCHAR,
                 cbTableType: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLColumns*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR, 
-                 cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR, 
-                 cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR, 
-                 cbTableName: TSqlSmallInt, szColumnName: PSQLCHAR, 
+proc SQLColumns*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR,
+                 cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR,
+                 cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR,
+                 cbTableName: TSqlSmallInt, szColumnName: PSQLCHAR,
                  cbColumnName: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, importc.}
-proc SQLSpecialColumns*(StatementHandle: SqlHStmt, IdentifierType: SqlUSmallInt, 
-                        CatalogName: PSQLCHAR, NameLength1: TSqlSmallInt, 
-                        SchemaName: PSQLCHAR, NameLength2: TSqlSmallInt, 
-                        TableName: PSQLCHAR, NameLength3: TSqlSmallInt, 
-                        Scope: SqlUSmallInt, 
+proc SQLSpecialColumns*(StatementHandle: SqlHStmt, IdentifierType: SqlUSmallInt,
+                        CatalogName: PSQLCHAR, NameLength1: TSqlSmallInt,
+                        SchemaName: PSQLCHAR, NameLength2: TSqlSmallInt,
+                        TableName: PSQLCHAR, NameLength3: TSqlSmallInt,
+                        Scope: SqlUSmallInt,
                         Nullable: SqlUSmallInt): TSqlSmallInt{.
     dynlib: odbclib, importc.}
-proc SQLProcedures*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR, 
-                    cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR, 
-                    cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR, 
-                    cbTableName: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLProcedures*(hstmt: SqlHStmt, szTableQualifier: PSQLCHAR,
+                    cbTableQualifier: TSqlSmallInt, szTableOwner: PSQLCHAR,
+                    cbTableOwner: TSqlSmallInt, szTableName: PSQLCHAR,
+                    cbTableName: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLPrimaryKeys*(hstmt: SqlHStmt, CatalogName: PSQLCHAR, 
-                     NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR, 
-                     NameLength2: TSqlSmallInt, TableName: PSQLCHAR, 
-                     NameLength3: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLPrimaryKeys*(hstmt: SqlHStmt, CatalogName: PSQLCHAR,
+                     NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR,
+                     NameLength2: TSqlSmallInt, TableName: PSQLCHAR,
+                     NameLength3: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLProcedureColumns*(hstmt: SqlHStmt, CatalogName: PSQLCHAR, 
-                          NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR, 
-                          NameLength2: TSqlSmallInt, ProcName: PSQLCHAR, 
-                          NameLength3: TSqlSmallInt, ColumnName: PSQLCHAR, 
-                          NameLength4: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib, 
+proc SQLProcedureColumns*(hstmt: SqlHStmt, CatalogName: PSQLCHAR,
+                          NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR,
+                          NameLength2: TSqlSmallInt, ProcName: PSQLCHAR,
+                          NameLength3: TSqlSmallInt, ColumnName: PSQLCHAR,
+                          NameLength4: TSqlSmallInt): TSqlSmallInt{.dynlib: odbclib,
     importc.}
-proc SQLStatistics*(hstmt: SqlHStmt, CatalogName: PSQLCHAR, 
-                    NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR, 
-                    NameLength2: TSqlSmallInt, TableName: PSQLCHAR, 
-                    NameLength3: TSqlSmallInt, Unique: SqlUSmallInt, 
+proc SQLStatistics*(hstmt: SqlHStmt, CatalogName: PSQLCHAR,
+                    NameLength1: TSqlSmallInt, SchemaName: PSQLCHAR,
+                    NameLength2: TSqlSmallInt, TableName: PSQLCHAR,
+                    NameLength3: TSqlSmallInt, Unique: SqlUSmallInt,
                     Reserved: SqlUSmallInt): TSqlSmallInt {.
                     dynlib: odbclib, importc.}
 
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index 03729dbab..013f26943 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -1,41 +1,11 @@
-#==============================================================================#
-# Project: Ararat Synapse                                        | 003.004.001 #
-#==============================================================================#
-# Content: SSL support by OpenSSL                                              #
-#==============================================================================#
-# Copyright (c)1999-2005, Lukas Gebauer                                        #
-# All rights reserved.                                                         #
-#                                                                              #
-# Redistribution and use in source and binary forms, with or without           #
-# modification, are permitted provided that the following conditions are met:  #
-#                                                                              #
-# Redistributions of source code must retain the above copyright notice, this  #
-# list of conditions and the following disclaimer.                             #
-#                                                                              #
-# Redistributions in binary form must reproduce the above copyright notice,    #
-# this list of conditions and the following disclaimer in the documentation    #
-# and/or other materials provided with the distribution.                       #
-#                                                                              #
-# Neither the name of Lukas Gebauer nor the names of its contributors may      #
-# be used to endorse or promote products derived from this software without    #
-# specific prior written permission.                                           #
-#                                                                              #
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"  #
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE    #
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   #
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR  #
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL       #
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR   #
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER   #
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT           #
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY    #
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  #
-# DAMAGE.                                                                      #
-#==============================================================================#
-# The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).#
-# Portions created by Lukas Gebauer are Copyright (c)2002-2005.                #
-# All Rights Reserved.                                                         #
-#==============================================================================#
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
 
 ## OpenSSL support
 
@@ -43,8 +13,8 @@
 
 const useWinVersion = defined(Windows) or defined(nimdoc)
 
-when useWinVersion: 
-  const 
+when useWinVersion:
+  const
     DLLSSLName = "(ssleay32|libssl32).dll"
     DLLUtilName = "libeay32.dll"
   from winlean import SocketHandle
@@ -56,12 +26,12 @@ else:
       DLLSSLName = "libssl" & versions & ".dylib"
       DLLUtilName = "libcrypto" & versions & ".dylib"
   else:
-    const 
+    const
       DLLSSLName = "libssl.so" & versions
       DLLUtilName = "libcrypto.so" & versions
   from posix import SocketHandle
 
-type 
+type
   SslStruct {.final, pure.} = object
   SslPtr* = ptr SslStruct
   PSslPtr* = ptr SslPtr
@@ -80,7 +50,7 @@ type
   PFunction* = proc () {.cdecl.}
   DES_cblock* = array[0..7, int8]
   PDES_cblock* = ptr DES_cblock
-  des_ks_struct*{.final.} = object 
+  des_ks_struct*{.final.} = object
     ks*: DES_cblock
     weak_key*: cInt
 
@@ -88,7 +58,7 @@ type
 
 {.deprecated: [PSSL: SslPtr, PSSL_CTX: SslCtx, PBIO: BIO].}
 
-const 
+const
   SSL_SENT_SHUTDOWN* = 1
   SSL_RECEIVED_SHUTDOWN* = 2
   EVP_MAX_MD_SIZE* = 16 + 20
@@ -116,8 +86,8 @@ const
   SSL_CTRL_GET_FLAGS* = 13
   SSL_CTRL_EXTRA_CHAIN_CERT* = 14
   SSL_CTRL_SET_MSG_CALLBACK* = 15
-  SSL_CTRL_SET_MSG_CALLBACK_ARG* = 16 # only applies to datagram connections  
-  SSL_CTRL_SET_MTU* = 17      # Stats  
+  SSL_CTRL_SET_MSG_CALLBACK_ARG* = 16 # only applies to datagram connections
+  SSL_CTRL_SET_MTU* = 17      # Stats
   SSL_CTRL_SESS_NUMBER* = 20
   SSL_CTRL_SESS_CONNECT* = 21
   SSL_CTRL_SESS_CONNECT_GOOD* = 22
@@ -204,7 +174,7 @@ const
   SSL_FILETYPE_ASN1* = 2
   SSL_FILETYPE_PEM* = 1
   EVP_PKEY_RSA* = 6           # libssl.dll
-  
+
   BIO_C_SET_CONNECT = 100
   BIO_C_DO_STATE_MACHINE = 101
   BIO_C_GET_SSL = 110
@@ -237,7 +207,7 @@ proc SSL_CTX_use_certificate_chain_file*(ctx: SslCtx, filename: cstring): cInt{.
     stdcall, dynlib: DLLSSLName, importc.}
 proc SSL_CTX_use_PrivateKey_file*(ctx: SslCtx,
     filename: cstring, typ: cInt): cInt{.cdecl, dynlib: DLLSSLName, importc.}
-proc SSL_CTX_check_private_key*(ctx: SslCtx): cInt{.cdecl, dynlib: DLLSSLName, 
+proc SSL_CTX_check_private_key*(ctx: SslCtx): cInt{.cdecl, dynlib: DLLSSLName,
     importc.}
 
 proc SSL_set_fd*(ssl: SslPtr, fd: SocketHandle): cint{.cdecl, dynlib: DLLSSLName, importc.}
@@ -256,7 +226,7 @@ proc BIO_new_ssl_connect*(ctx: SslCtx): BIO{.cdecl,
     dynlib: DLLSSLName, importc.}
 proc BIO_ctrl*(bio: BIO, cmd: cint, larg: int, arg: cstring): int{.cdecl,
     dynlib: DLLSSLName, importc.}
-proc BIO_get_ssl*(bio: BIO, ssl: ptr SslPtr): int = 
+proc BIO_get_ssl*(bio: BIO, ssl: ptr SslPtr): int =
   return BIO_ctrl(bio, BIO_C_GET_SSL, 0, cast[cstring](ssl))
 proc BIO_set_conn_hostname*(bio: BIO, name: cstring): int =
   return BIO_ctrl(bio, BIO_C_SET_CONNECT, 0, name)
@@ -266,16 +236,16 @@ proc BIO_do_connect*(bio: BIO): int =
   return BIO_do_handshake(bio)
 
 when not defined(nimfix):
-  proc BIO_read*(b: BIO, data: cstring, length: cInt): cInt{.cdecl, 
+  proc BIO_read*(b: BIO, data: cstring, length: cInt): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc BIO_write*(b: BIO, data: cstring, length: cInt): cInt{.cdecl, 
+  proc BIO_write*(b: BIO, data: cstring, length: cInt): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
 
 proc BIO_free*(b: BIO): cInt{.cdecl, dynlib: DLLUtilName, importc.}
 
 proc ERR_print_errors_fp*(fp: File){.cdecl, dynlib: DLLSSLName, importc.}
 
-proc ERR_error_string*(e: cInt, buf: cstring): cstring{.cdecl, 
+proc ERR_error_string*(e: cInt, buf: cstring): cstring{.cdecl,
     dynlib: DLLUtilName, importc.}
 proc ERR_get_error*(): cInt{.cdecl, dynlib: DLLUtilName, importc.}
 proc ERR_peek_last_error*(): cInt{.cdecl, dynlib: DLLUtilName, importc.}
@@ -285,7 +255,7 @@ proc OpenSSL_add_all_algorithms*(){.cdecl, dynlib: DLLUtilName, importc: "OPENSS
 proc OPENSSL_config*(configName: cstring){.cdecl, dynlib: DLLSSLName, importc.}
 
 when not useWinVersion:
-  proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, 
+  proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl,
     dynlib: DLLUtilName, importc.}
 
   proc allocWrapper(size: int): pointer {.cdecl.} = alloc(size)
@@ -375,7 +345,7 @@ proc ErrRemoveState*(pid: cInt){.cdecl, dynlib: DLLUtilName, importc: "ERR_remov
 when true:
   discard
 else:
-  proc SslCtxSetCipherList*(arg0: PSSL_CTX, str: cstring): cInt{.cdecl, 
+  proc SslCtxSetCipherList*(arg0: PSSL_CTX, str: cstring): cInt{.cdecl,
       dynlib: DLLSSLName, importc.}
   proc SslCtxNew*(meth: PSSL_METHOD): PSSL_CTX{.cdecl,
       dynlib: DLLSSLName, importc.}
@@ -391,12 +361,12 @@ else:
   proc SslMethodV3*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.}
   proc SslMethodTLSV1*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.}
   proc SslMethodV23*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.}
-  proc SslCtxUsePrivateKey*(ctx: PSSL_CTX, pkey: SslPtr): cInt{.cdecl, 
+  proc SslCtxUsePrivateKey*(ctx: PSSL_CTX, pkey: SslPtr): cInt{.cdecl,
       dynlib: DLLSSLName, importc.}
   proc SslCtxUsePrivateKeyASN1*(pk: cInt, ctx: PSSL_CTX,
       d: cstring, length: int): cInt{.cdecl, dynlib: DLLSSLName, importc.}
 
-  proc SslCtxUseCertificate*(ctx: PSSL_CTX, x: SslPtr): cInt{.cdecl, 
+  proc SslCtxUseCertificate*(ctx: PSSL_CTX, x: SslPtr): cInt{.cdecl,
       dynlib: DLLSSLName, importc.}
   proc SslCtxUseCertificateASN1*(ctx: PSSL_CTX, length: int, d: cstring): cInt{.
       cdecl, dynlib: DLLSSLName, importc.}
@@ -404,9 +374,9 @@ else:
     #  function SslCtxUseCertificateChainFile(ctx: PSSL_CTX; const filename: PChar):cInt;
   proc SslCtxUseCertificateChainFile*(ctx: PSSL_CTX, filename: cstring): cInt{.
       cdecl, dynlib: DLLSSLName, importc.}
-  proc SslCtxSetDefaultPasswdCb*(ctx: PSSL_CTX, cb: PPasswdCb){.cdecl, 
+  proc SslCtxSetDefaultPasswdCb*(ctx: PSSL_CTX, cb: PPasswdCb){.cdecl,
       dynlib: DLLSSLName, importc.}
-  proc SslCtxSetDefaultPasswdCbUserdata*(ctx: PSSL_CTX, u: SslPtr){.cdecl, 
+  proc SslCtxSetDefaultPasswdCbUserdata*(ctx: PSSL_CTX, u: SslPtr){.cdecl,
       dynlib: DLLSSLName, importc.}
     #  function SslCtxLoadVerifyLocations(ctx: PSSL_CTX; const CAfile: PChar; const CApath: PChar):cInt;
   proc SslCtxLoadVerifyLocations*(ctx: PSSL_CTX, CAfile: cstring, CApath: cstring): cInt{.
@@ -416,15 +386,15 @@ else:
 
   proc SslConnect*(ssl: PSSL): cInt{.cdecl, dynlib: DLLSSLName, importc.}
 
-  
+
   proc SslGetVersion*(ssl: PSSL): cstring{.cdecl, dynlib: DLLSSLName, importc.}
-  proc SslGetPeerCertificate*(ssl: PSSL): PX509{.cdecl, dynlib: DLLSSLName, 
+  proc SslGetPeerCertificate*(ssl: PSSL): PX509{.cdecl, dynlib: DLLSSLName,
       importc.}
-  proc SslCtxSetVerify*(ctx: PSSL_CTX, mode: cInt, arg2: PFunction){.cdecl, 
+  proc SslCtxSetVerify*(ctx: PSSL_CTX, mode: cInt, arg2: PFunction){.cdecl,
       dynlib: DLLSSLName, importc.}
   proc SSLGetCurrentCipher*(s: PSSL): SslPtr{.cdecl, dynlib: DLLSSLName, importc.}
   proc SSLCipherGetName*(c: SslPtr): cstring{.cdecl, dynlib: DLLSSLName, importc.}
-  proc SSLCipherGetBits*(c: SslPtr, alg_bits: var cInt): cInt{.cdecl, 
+  proc SSLCipherGetBits*(c: SslPtr, alg_bits: var cInt): cInt{.cdecl,
       dynlib: DLLSSLName, importc.}
   proc SSLGetVerifyResult*(ssl: PSSL): int{.cdecl, dynlib: DLLSSLName, importc.}
     # libeay.dll
@@ -432,39 +402,39 @@ else:
   proc X509Free*(x: PX509){.cdecl, dynlib: DLLUtilName, importc.}
   proc X509NameOneline*(a: PX509_NAME, buf: cstring, size: cInt): cstring{.
       cdecl, dynlib: DLLUtilName, importc.}
-  proc X509GetSubjectName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName, 
+  proc X509GetSubjectName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName,
       importc.}
-  proc X509GetIssuerName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName, 
+  proc X509GetIssuerName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName,
       importc.}
   proc X509NameHash*(x: PX509_NAME): int{.cdecl, dynlib: DLLUtilName, importc.}
     #  function SslX509Digest(data: PX509; typ: PEVP_MD; md: PChar; len: PcInt):cInt;
   proc X509Digest*(data: PX509, typ: PEVP_MD, md: cstring, length: var cInt): cInt{.
       cdecl, dynlib: DLLUtilName, importc.}
   proc X509print*(b: PBIO, a: PX509): cInt{.cdecl, dynlib: DLLUtilName, importc.}
-  proc X509SetVersion*(x: PX509, version: cInt): cInt{.cdecl, dynlib: DLLUtilName, 
+  proc X509SetVersion*(x: PX509, version: cInt): cInt{.cdecl, dynlib: DLLUtilName,
       importc.}
-  proc X509SetPubkey*(x: PX509, pkey: EVP_PKEY): cInt{.cdecl, dynlib: DLLUtilName, 
+  proc X509SetPubkey*(x: PX509, pkey: EVP_PKEY): cInt{.cdecl, dynlib: DLLUtilName,
       importc.}
-  proc X509SetIssuerName*(x: PX509, name: PX509_NAME): cInt{.cdecl, 
+  proc X509SetIssuerName*(x: PX509, name: PX509_NAME): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc X509NameAddEntryByTxt*(name: PX509_NAME, field: cstring, typ: cInt, 
+  proc X509NameAddEntryByTxt*(name: PX509_NAME, field: cstring, typ: cInt,
                               bytes: cstring, length, loc, theSet: cInt): cInt{.
       cdecl, dynlib: DLLUtilName, importc.}
-  proc X509Sign*(x: PX509, pkey: EVP_PKEY, md: PEVP_MD): cInt{.cdecl, 
+  proc X509Sign*(x: PX509, pkey: EVP_PKEY, md: PEVP_MD): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc X509GmtimeAdj*(s: PASN1_UTCTIME, adj: cInt): PASN1_UTCTIME{.cdecl, 
+  proc X509GmtimeAdj*(s: PASN1_UTCTIME, adj: cInt): PASN1_UTCTIME{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc X509SetNotBefore*(x: PX509, tm: PASN1_UTCTIME): cInt{.cdecl, 
+  proc X509SetNotBefore*(x: PX509, tm: PASN1_UTCTIME): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc X509SetNotAfter*(x: PX509, tm: PASN1_UTCTIME): cInt{.cdecl, 
+  proc X509SetNotAfter*(x: PX509, tm: PASN1_UTCTIME): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc X509GetSerialNumber*(x: PX509): PASN1_cInt{.cdecl, dynlib: DLLUtilName, 
+  proc X509GetSerialNumber*(x: PX509): PASN1_cInt{.cdecl, dynlib: DLLUtilName,
       importc.}
   proc EvpPkeyNew*(): EVP_PKEY{.cdecl, dynlib: DLLUtilName, importc.}
   proc EvpPkeyFree*(pk: EVP_PKEY){.cdecl, dynlib: DLLUtilName, importc.}
-  proc EvpPkeyAssign*(pkey: EVP_PKEY, typ: cInt, key: Prsa): cInt{.cdecl, 
+  proc EvpPkeyAssign*(pkey: EVP_PKEY, typ: cInt, key: Prsa): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
-  proc EvpGetDigestByName*(Name: cstring): PEVP_MD{.cdecl, dynlib: DLLUtilName, 
+  proc EvpGetDigestByName*(Name: cstring): PEVP_MD{.cdecl, dynlib: DLLUtilName,
       importc.}
   proc EVPcleanup*(){.cdecl, dynlib: DLLUtilName, importc.}
     #  function ErrErrorString(e: cInt; buf: PChar): PChar;
@@ -475,7 +445,7 @@ else:
   proc CRYPTOcleanupAllExData*(){.cdecl, dynlib: DLLUtilName, importc.}
   proc RandScreen*(){.cdecl, dynlib: DLLUtilName, importc.}
 
-  proc d2iPKCS12bio*(b: PBIO, Pkcs12: SslPtr): SslPtr{.cdecl, dynlib: DLLUtilName, 
+  proc d2iPKCS12bio*(b: PBIO, Pkcs12: SslPtr): SslPtr{.cdecl, dynlib: DLLUtilName,
       importc.}
   proc PKCS12parse*(p12: SslPtr, pass: cstring, pkey, cert, ca: var SslPtr): cint{.
       dynlib: DLLUtilName, importc, cdecl.}
@@ -485,37 +455,37 @@ else:
       cdecl, dynlib: DLLUtilName, importc.}
   proc Asn1UtctimeNew*(): PASN1_UTCTIME{.cdecl, dynlib: DLLUtilName, importc.}
   proc Asn1UtctimeFree*(a: PASN1_UTCTIME){.cdecl, dynlib: DLLUtilName, importc.}
-  proc Asn1cIntSet*(a: PASN1_cInt, v: cInt): cInt{.cdecl, dynlib: DLLUtilName, 
+  proc Asn1cIntSet*(a: PASN1_cInt, v: cInt): cInt{.cdecl, dynlib: DLLUtilName,
       importc.}
   proc i2dX509bio*(b: PBIO, x: PX509): cInt{.cdecl, dynlib: DLLUtilName, importc.}
-  proc i2dPrivateKeyBio*(b: PBIO, pkey: EVP_PKEY): cInt{.cdecl, 
+  proc i2dPrivateKeyBio*(b: PBIO, pkey: EVP_PKEY): cInt{.cdecl,
       dynlib: DLLUtilName, importc.}
     # 3DES functions
   proc DESsetoddparity*(Key: des_cblock){.cdecl, dynlib: DLLUtilName, importc.}
   proc DESsetkeychecked*(key: des_cblock, schedule: des_key_schedule): cInt{.
       cdecl, dynlib: DLLUtilName, importc.}
-  proc DESecbencrypt*(Input: des_cblock, output: des_cblock, ks: des_key_schedule, 
+  proc DESecbencrypt*(Input: des_cblock, output: des_cblock, ks: des_key_schedule,
                       enc: cInt){.cdecl, dynlib: DLLUtilName, importc.}
   # implementation
 
-  proc SSLSetMode(s: PSSL, mode: int): int = 
+  proc SSLSetMode(s: PSSL, mode: int): int =
     result = SSLctrl(s, SSL_CTRL_MODE, mode, nil)
 
-  proc SSLCTXGetMode(ctx: PSSL_CTX): int = 
+  proc SSLCTXGetMode(ctx: PSSL_CTX): int =
     result = SSLCTXctrl(ctx, SSL_CTRL_MODE, 0, nil)
 
-  proc SSLGetMode(s: PSSL): int = 
+  proc SSLGetMode(s: PSSL): int =
     result = SSLctrl(s, SSL_CTRL_MODE, 0, nil)
 
 # <openssl/md5.h>
-type 
+type
   MD5_LONG* = cuint
-const 
+const
   MD5_CBLOCK* = 64
   MD5_LBLOCK* = int(MD5_CBLOCK div 4)
   MD5_DIGEST_LENGTH* = 16
-type 
-  MD5_CTX* = object 
+type
+  MD5_CTX* = object
     A,B,C,D,Nl,Nh: MD5_LONG
     data: array[MD5_LBLOCK, MD5_LONG]
     num: cuint
@@ -532,7 +502,7 @@ proc md5_Transform*(c: var MD5_CTX; b: ptr cuchar){.ic.}
 from strutils import toHex,toLower
 
 proc hexStr (buf:cstring): string =
-  # turn md5s output into a nice hex str 
+  # turn md5s output into a nice hex str
   result = newStringOfCap(32)
   for i in 0 .. <16:
     result.add toHex(buf[i].ord, 2).toLower
@@ -554,13 +524,13 @@ proc md5_File* (file: string): string {.raises: [IOError,Exception].} =
 
   discard md5_final( buf[0].addr, ctx )
   f.close
-  
+
   result = hexStr(buf)
 
 proc md5_Str* (str:string): string {.raises:[IOError].} =
   ##Generate MD5 hash for a string. Result is a 32 character
   #hex string with lowercase characters
-  var 
+  var
     ctx: MD5_CTX
     res: array[MD5_DIGEST_LENGTH,char]
     input = str.cstring
diff --git a/lib/wrappers/pcre.nim b/lib/wrappers/pcre.nim
index 67436f026..4b6acce01 100644
--- a/lib/wrappers/pcre.nim
+++ b/lib/wrappers/pcre.nim
@@ -1,38 +1,11 @@
-#************************************************
-#       Perl-Compatible Regular Expressions     *
-#************************************************
-# This is the public header file for the PCRE library, to be #included by
-# applications that call the PCRE functions.
 #
-#           Copyright (c) 1997-2014 University of Cambridge
 #
-#-----------------------------------------------------------------------------
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
 #
-#    * Redistributions of source code must retain the above copyright notice,
-#      this list of conditions and the following disclaimer.
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
 #
-#    * Redistributions in binary form must reproduce the above copyright
-#      notice, this list of conditions and the following disclaimer in the
-#      documentation and/or other materials provided with the distribution.
-#
-#    * Neither the name of the University of Cambridge nor the names of its
-#      contributors may be used to endorse or promote products derived from
-#      this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#-----------------------------------------------------------------------------
 
 {.deadCodeElim: on.}
 
@@ -77,9 +50,9 @@ const
 # C4   Affects compile, exec, dfa_exec, study
 # C5   Affects compile, exec, study
 #
-# Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged 
-# with E and D, respectively. They take precedence over C3, C4, and C5 settings 
-# passed from pcre_compile(). Those that are compatible with JIT execution are 
+# Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged
+# with E and D, respectively. They take precedence over C3, C4, and C5 settings
+# passed from pcre_compile(). Those that are compatible with JIT execution are
 # flagged with J.
 
 const
diff --git a/lib/wrappers/pdcurses.nim b/lib/wrappers/pdcurses.nim
index 7e7a6c47f..74993c515 100644
--- a/lib/wrappers/pdcurses.nim
+++ b/lib/wrappers/pdcurses.nim
@@ -1,3 +1,12 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 {.deadCodeElim: on.}
 
 discard """
@@ -32,7 +41,7 @@ pdcwin.h:
 
 when defined(windows):
   import windows
-  
+
   const
     pdcursesdll = "pdcurses.dll"
     unixOS = false
@@ -47,13 +56,13 @@ type
   cunsignedchar = char
   cunsignedlong = uint32
 
-const 
+const
   BUILD* = 3401
-  PDCURSES* = 1               # PDCurses-only routines 
-  XOPEN* = 1                  # X/Open Curses routines 
-  SYSVcurses* = 1             # System V Curses routines 
-  BSDcurses* = 1              # BSD Curses routines 
-  CHTYPE_LONG* = 1            # size of chtype; long 
+  PDCURSES* = 1               # PDCurses-only routines
+  XOPEN* = 1                  # X/Open Curses routines
+  SYSVcurses* = 1             # System V Curses routines
+  BSDcurses* = 1              # BSD Curses routines
+  CHTYPE_LONG* = 1            # size of chtype; long
   ERR* = (- 1)
   OK* = 0
   BUTTON_RELEASED* = 0x00000000
@@ -61,10 +70,10 @@ const
   BUTTON_CLICKED* = 0x00000002
   BUTTON_DOUBLE_CLICKED* = 0x00000003
   BUTTON_TRIPLE_CLICKED* = 0x00000004
-  BUTTON_MOVED* = 0x00000005  # PDCurses 
-  WHEEL_SCROLLED* = 0x00000006 # PDCurses 
-  BUTTON_ACTION_MASK* = 0x00000007 # PDCurses 
-  BUTTON_MODIFIER_MASK* = 0x00000038 # PDCurses 
+  BUTTON_MOVED* = 0x00000005  # PDCurses
+  WHEEL_SCROLLED* = 0x00000006 # PDCurses
+  BUTTON_ACTION_MASK* = 0x00000007 # PDCurses
+  BUTTON_MODIFIER_MASK* = 0x00000038 # PDCurses
   MOUSE_MOVED* = 0x00000008
   MOUSE_POSITION* = 0x00000010
   MOUSE_WHEEL_UP* = 0x00000020
@@ -74,19 +83,19 @@ const
   BUTTON1_CLICKED* = 0x00000004
   BUTTON1_DOUBLE_CLICKED* = 0x00000008
   BUTTON1_TRIPLE_CLICKED* = 0x00000010
-  BUTTON1_MOVED* = 0x00000010 # PDCurses 
+  BUTTON1_MOVED* = 0x00000010 # PDCurses
   BUTTON2_RELEASED* = 0x00000020
   BUTTON2_PRESSED* = 0x00000040
   BUTTON2_CLICKED* = 0x00000080
   BUTTON2_DOUBLE_CLICKED* = 0x00000100
   BUTTON2_TRIPLE_CLICKED* = 0x00000200
-  BUTTON2_MOVED* = 0x00000200 # PDCurses 
+  BUTTON2_MOVED* = 0x00000200 # PDCurses
   BUTTON3_RELEASED* = 0x00000400
   BUTTON3_PRESSED* = 0x00000800
   BUTTON3_CLICKED* = 0x00001000
   BUTTON3_DOUBLE_CLICKED* = 0x00002000
   BUTTON3_TRIPLE_CLICKED* = 0x00004000
-  BUTTON3_MOVED* = 0x00004000 # PDCurses 
+  BUTTON3_MOVED* = 0x00004000 # PDCurses
   BUTTON4_RELEASED* = 0x00008000
   BUTTON4_PRESSED* = 0x00010000
   BUTTON4_CLICKED* = 0x00020000
@@ -97,10 +106,10 @@ const
   BUTTON5_CLICKED* = 0x00400000
   BUTTON5_DOUBLE_CLICKED* = 0x00800000
   BUTTON5_TRIPLE_CLICKED* = 0x01000000
-  MOUSE_WHEEL_SCROLL* = 0x02000000 # PDCurses 
-  BUTTON_MODIFIER_SHIFT* = 0x04000000 # PDCurses 
-  BUTTON_MODIFIER_CONTROL* = 0x08000000 # PDCurses 
-  BUTTON_MODIFIER_ALT* = 0x10000000 # PDCurses 
+  MOUSE_WHEEL_SCROLL* = 0x02000000 # PDCurses
+  BUTTON_MODIFIER_SHIFT* = 0x04000000 # PDCurses
+  BUTTON_MODIFIER_CONTROL* = 0x08000000 # PDCurses
+  BUTTON_MODIFIER_ALT* = 0x10000000 # PDCurses
   ALL_MOUSE_EVENTS* = 0x1FFFFFFF
   REPORT_MOUSE_POSITION* = 0x20000000
   A_NORMAL* = 0
@@ -119,11 +128,11 @@ const
   A_PROTECT* = (A_UNDERLINE or A_LEFTLINE or A_RIGHTLINE)
   ATTR_SHIFT* = 19
   COLOR_SHIFT* = 24
-  A_STANDOUT* = (A_REVERSE or A_BOLD) # X/Open 
+  A_STANDOUT* = (A_REVERSE or A_BOLD) # X/Open
   A_DIM* = A_NORMAL
-  CHR_MSK* = A_CHARTEXT       # Obsolete 
-  ATR_MSK* = A_ATTRIBUTES     # Obsolete 
-  ATR_NRM* = A_NORMAL         # Obsolete 
+  CHR_MSK* = A_CHARTEXT       # Obsolete
+  ATR_MSK* = A_ATTRIBUTES     # Obsolete
+  ATR_NRM* = A_NORMAL         # Obsolete
   WA_ALTCHARSET* = A_ALTCHARSET
   WA_BLINK* = A_BLINK
   WA_BOLD* = A_BOLD
@@ -147,93 +156,93 @@ const
   COLOR_MAGENTA* = (COLOR_RED or COLOR_BLUE)
   COLOR_YELLOW* = (COLOR_RED or COLOR_GREEN)
   COLOR_WHITE* = 7
-  KEY_CODE_YES* = 0x00000100  # If get_wch() gives a key code 
-  KEY_BREAK* = 0x00000101     # Not on PC KBD 
-  KEY_DOWN* = 0x00000102      # Down arrow key 
-  KEY_UP* = 0x00000103        # Up arrow key 
-  KEY_LEFT* = 0x00000104      # Left arrow key 
-  KEY_RIGHT* = 0x00000105     # Right arrow key 
-  KEY_HOME* = 0x00000106      # home key 
-  KEY_BACKSPACE* = 0x00000107 # not on pc 
-  KEY_F0* = 0x00000108        # function keys; 64 reserved 
-  KEY_DL* = 0x00000148        # delete line 
-  KEY_IL* = 0x00000149        # insert line 
-  KEY_DC* = 0x0000014A        # delete character 
-  KEY_IC* = 0x0000014B        # insert char or enter ins mode 
-  KEY_EIC* = 0x0000014C       # exit insert char mode 
-  KEY_CLEAR* = 0x0000014D     # clear screen 
-  KEY_EOS* = 0x0000014E       # clear to end of screen 
-  KEY_EOL* = 0x0000014F       # clear to end of line 
-  KEY_SF* = 0x00000150        # scroll 1 line forward 
-  KEY_SR* = 0x00000151        # scroll 1 line back (reverse) 
-  KEY_NPAGE* = 0x00000152     # next page 
-  KEY_PPAGE* = 0x00000153     # previous page 
-  KEY_STAB* = 0x00000154      # set tab 
-  KEY_CTAB* = 0x00000155      # clear tab 
-  KEY_CATAB* = 0x00000156     # clear all tabs 
-  KEY_ENTER* = 0x00000157     # enter or send (unreliable) 
-  KEY_SRESET* = 0x00000158    # soft/reset (partial/unreliable) 
-  KEY_RESET* = 0x00000159     # reset/hard reset (unreliable) 
-  KEY_PRINT* = 0x0000015A     # print/copy 
-  KEY_LL* = 0x0000015B        # home down/bottom (lower left) 
-  KEY_ABORT* = 0x0000015C     # abort/terminate key (any) 
-  KEY_SHELP* = 0x0000015D     # short help 
-  KEY_LHELP* = 0x0000015E     # long help 
-  KEY_BTAB* = 0x0000015F      # Back tab key 
-  KEY_BEG* = 0x00000160       # beg(inning) key 
-  KEY_CANCEL* = 0x00000161    # cancel key 
-  KEY_CLOSE* = 0x00000162     # close key 
-  KEY_COMMAND* = 0x00000163   # cmd (command) key 
-  KEY_COPY* = 0x00000164      # copy key 
-  KEY_CREATE* = 0x00000165    # create key 
-  KEY_END* = 0x00000166       # end key 
-  KEY_EXIT* = 0x00000167      # exit key 
-  KEY_FIND* = 0x00000168      # find key 
-  KEY_HELP* = 0x00000169      # help key 
-  KEY_MARK* = 0x0000016A      # mark key 
-  KEY_MESSAGE* = 0x0000016B   # message key 
-  KEY_MOVE* = 0x0000016C      # move key 
-  KEY_NEXT* = 0x0000016D      # next object key 
-  KEY_OPEN* = 0x0000016E      # open key 
-  KEY_OPTIONS* = 0x0000016F   # options key 
-  KEY_PREVIOUS* = 0x00000170  # previous object key 
-  KEY_REDO* = 0x00000171      # redo key 
-  KEY_REFERENCE* = 0x00000172 # ref(erence) key 
-  KEY_REFRESH* = 0x00000173   # refresh key 
-  KEY_REPLACE* = 0x00000174   # replace key 
-  KEY_RESTART* = 0x00000175   # restart key 
-  KEY_RESUME* = 0x00000176    # resume key 
-  KEY_SAVE* = 0x00000177      # save key 
-  KEY_SBEG* = 0x00000178      # shifted beginning key 
-  KEY_SCANCEL* = 0x00000179   # shifted cancel key 
-  KEY_SCOMMAND* = 0x0000017A  # shifted command key 
-  KEY_SCOPY* = 0x0000017B     # shifted copy key 
-  KEY_SCREATE* = 0x0000017C   # shifted create key 
-  KEY_SDC* = 0x0000017D       # shifted delete char key 
-  KEY_SDL* = 0x0000017E       # shifted delete line key 
-  KEY_SELECT* = 0x0000017F    # select key 
-  KEY_SEND* = 0x00000180      # shifted end key 
-  KEY_SEOL* = 0x00000181      # shifted clear line key 
-  KEY_SEXIT* = 0x00000182     # shifted exit key 
-  KEY_SFIND* = 0x00000183     # shifted find key 
-  KEY_SHOME* = 0x00000184     # shifted home key 
-  KEY_SIC* = 0x00000185       # shifted input key 
-  KEY_SLEFT* = 0x00000187     # shifted left arrow key 
-  KEY_SMESSAGE* = 0x00000188  # shifted message key 
-  KEY_SMOVE* = 0x00000189     # shifted move key 
-  KEY_SNEXT* = 0x0000018A     # shifted next key 
-  KEY_SOPTIONS* = 0x0000018B  # shifted options key 
-  KEY_SPREVIOUS* = 0x0000018C # shifted prev key 
-  KEY_SPRINT* = 0x0000018D    # shifted print key 
-  KEY_SREDO* = 0x0000018E     # shifted redo key 
-  KEY_SREPLACE* = 0x0000018F  # shifted replace key 
-  KEY_SRIGHT* = 0x00000190    # shifted right arrow 
-  KEY_SRSUME* = 0x00000191    # shifted resume key 
-  KEY_SSAVE* = 0x00000192     # shifted save key 
-  KEY_SSUSPEND* = 0x00000193  # shifted suspend key 
-  KEY_SUNDO* = 0x00000194     # shifted undo key 
-  KEY_SUSPEND* = 0x00000195   # suspend key 
-  KEY_UNDO* = 0x00000196      # undo key 
+  KEY_CODE_YES* = 0x00000100  # If get_wch() gives a key code
+  KEY_BREAK* = 0x00000101     # Not on PC KBD
+  KEY_DOWN* = 0x00000102      # Down arrow key
+  KEY_UP* = 0x00000103        # Up arrow key
+  KEY_LEFT* = 0x00000104      # Left arrow key
+  KEY_RIGHT* = 0x00000105     # Right arrow key
+  KEY_HOME* = 0x00000106      # home key
+  KEY_BACKSPACE* = 0x00000107 # not on pc
+  KEY_F0* = 0x00000108        # function keys; 64 reserved
+  KEY_DL* = 0x00000148        # delete line
+  KEY_IL* = 0x00000149        # insert line
+  KEY_DC* = 0x0000014A        # delete character
+  KEY_IC* = 0x0000014B        # insert char or enter ins mode
+  KEY_EIC* = 0x0000014C       # exit insert char mode
+  KEY_CLEAR* = 0x0000014D     # clear screen
+  KEY_EOS* = 0x0000014E       # clear to end of screen
+  KEY_EOL* = 0x0000014F       # clear to end of line
+  KEY_SF* = 0x00000150        # scroll 1 line forward
+  KEY_SR* = 0x00000151        # scroll 1 line back (reverse)
+  KEY_NPAGE* = 0x00000152     # next page
+  KEY_PPAGE* = 0x00000153     # previous page
+  KEY_STAB* = 0x00000154      # set tab
+  KEY_CTAB* = 0x00000155      # clear tab
+  KEY_CATAB* = 0x00000156     # clear all tabs
+  KEY_ENTER* = 0x00000157     # enter or send (unreliable)
+  KEY_SRESET* = 0x00000158    # soft/reset (partial/unreliable)
+  KEY_RESET* = 0x00000159     # reset/hard reset (unreliable)
+  KEY_PRINT* = 0x0000015A     # print/copy
+  KEY_LL* = 0x0000015B        # home down/bottom (lower left)
+  KEY_ABORT* = 0x0000015C     # abort/terminate key (any)
+  KEY_SHELP* = 0x0000015D     # short help
+  KEY_LHELP* = 0x0000015E     # long help
+  KEY_BTAB* = 0x0000015F      # Back tab key
+  KEY_BEG* = 0x00000160       # beg(inning) key
+  KEY_CANCEL* = 0x00000161    # cancel key
+  KEY_CLOSE* = 0x00000162     # close key
+  KEY_COMMAND* = 0x00000163   # cmd (command) key
+  KEY_COPY* = 0x00000164      # copy key
+  KEY_CREATE* = 0x00000165    # create key
+  KEY_END* = 0x00000166       # end key
+  KEY_EXIT* = 0x00000167      # exit key
+  KEY_FIND* = 0x00000168      # find key
+  KEY_HELP* = 0x00000169      # help key
+  KEY_MARK* = 0x0000016A      # mark key
+  KEY_MESSAGE* = 0x0000016B   # message key
+  KEY_MOVE* = 0x0000016C      # move key
+  KEY_NEXT* = 0x0000016D      # next object key
+  KEY_OPEN* = 0x0000016E      # open key
+  KEY_OPTIONS* = 0x0000016F   # options key
+  KEY_PREVIOUS* = 0x00000170  # previous object key
+  KEY_REDO* = 0x00000171      # redo key
+  KEY_REFERENCE* = 0x00000172 # ref(erence) key
+  KEY_REFRESH* = 0x00000173   # refresh key
+  KEY_REPLACE* = 0x00000174   # replace key
+  KEY_RESTART* = 0x00000175   # restart key
+  KEY_RESUME* = 0x00000176    # resume key
+  KEY_SAVE* = 0x00000177      # save key
+  KEY_SBEG* = 0x00000178      # shifted beginning key
+  KEY_SCANCEL* = 0x00000179   # shifted cancel key
+  KEY_SCOMMAND* = 0x0000017A  # shifted command key
+  KEY_SCOPY* = 0x0000017B     # shifted copy key
+  KEY_SCREATE* = 0x0000017C   # shifted create key
+  KEY_SDC* = 0x0000017D       # shifted delete char key
+  KEY_SDL* = 0x0000017E       # shifted delete line key
+  KEY_SELECT* = 0x0000017F    # select key
+  KEY_SEND* = 0x00000180      # shifted end key
+  KEY_SEOL* = 0x00000181      # shifted clear line key
+  KEY_SEXIT* = 0x00000182     # shifted exit key
+  KEY_SFIND* = 0x00000183     # shifted find key
+  KEY_SHOME* = 0x00000184     # shifted home key
+  KEY_SIC* = 0x00000185       # shifted input key
+  KEY_SLEFT* = 0x00000187     # shifted left arrow key
+  KEY_SMESSAGE* = 0x00000188  # shifted message key
+  KEY_SMOVE* = 0x00000189     # shifted move key
+  KEY_SNEXT* = 0x0000018A     # shifted next key
+  KEY_SOPTIONS* = 0x0000018B  # shifted options key
+  KEY_SPREVIOUS* = 0x0000018C # shifted prev key
+  KEY_SPRINT* = 0x0000018D    # shifted print key
+  KEY_SREDO* = 0x0000018E     # shifted redo key
+  KEY_SREPLACE* = 0x0000018F  # shifted replace key
+  KEY_SRIGHT* = 0x00000190    # shifted right arrow
+  KEY_SRSUME* = 0x00000191    # shifted resume key
+  KEY_SSAVE* = 0x00000192     # shifted save key
+  KEY_SSUSPEND* = 0x00000193  # shifted suspend key
+  KEY_SUNDO* = 0x00000194     # shifted undo key
+  KEY_SUSPEND* = 0x00000195   # suspend key
+  KEY_UNDO* = 0x00000196      # undo key
   ALT_0* = 0x00000197
   ALT_1* = 0x00000198
   ALT_2* = 0x00000199
@@ -270,46 +279,46 @@ const
   ALT_X* = 0x000001B8
   ALT_Y* = 0x000001B9
   ALT_Z* = 0x000001BA
-  CTL_LEFT* = 0x000001BB      # Control-Left-Arrow 
+  CTL_LEFT* = 0x000001BB      # Control-Left-Arrow
   CTL_RIGHT* = 0x000001BC
   CTL_PGUP* = 0x000001BD
   CTL_PGDN* = 0x000001BE
   CTL_HOME* = 0x000001BF
   CTL_END* = 0x000001C0
-  KEY_A1* = 0x000001C1        # upper left on Virtual keypad 
-  KEY_A2* = 0x000001C2        # upper middle on Virt. keypad 
-  KEY_A3* = 0x000001C3        # upper right on Vir. keypad 
-  KEY_B1* = 0x000001C4        # middle left on Virt. keypad 
-  KEY_B2* = 0x000001C5        # center on Virt. keypad 
-  KEY_B3* = 0x000001C6        # middle right on Vir. keypad 
-  KEY_C1* = 0x000001C7        # lower left on Virt. keypad 
-  KEY_C2* = 0x000001C8        # lower middle on Virt. keypad 
-  KEY_C3* = 0x000001C9        # lower right on Vir. keypad 
-  PADSLASH* = 0x000001CA      # slash on keypad 
-  PADENTER* = 0x000001CB      # enter on keypad 
-  CTL_PADENTER* = 0x000001CC  # ctl-enter on keypad 
-  ALT_PADENTER* = 0x000001CD  # alt-enter on keypad 
-  PADSTOP* = 0x000001CE       # stop on keypad 
-  PADSTAR* = 0x000001CF       # star on keypad 
-  PADMINUS* = 0x000001D0      # minus on keypad 
-  PADPLUS* = 0x000001D1       # plus on keypad 
-  CTL_PADSTOP* = 0x000001D2   # ctl-stop on keypad 
-  CTL_PADCENTER* = 0x000001D3 # ctl-enter on keypad 
-  CTL_PADPLUS* = 0x000001D4   # ctl-plus on keypad 
-  CTL_PADMINUS* = 0x000001D5  # ctl-minus on keypad 
-  CTL_PADSLASH* = 0x000001D6  # ctl-slash on keypad 
-  CTL_PADSTAR* = 0x000001D7   # ctl-star on keypad 
-  ALT_PADPLUS* = 0x000001D8   # alt-plus on keypad 
-  ALT_PADMINUS* = 0x000001D9  # alt-minus on keypad 
-  ALT_PADSLASH* = 0x000001DA  # alt-slash on keypad 
-  ALT_PADSTAR* = 0x000001DB   # alt-star on keypad 
-  ALT_PADSTOP* = 0x000001DC   # alt-stop on keypad 
-  CTL_INS* = 0x000001DD       # ctl-insert 
-  ALT_DEL* = 0x000001DE       # alt-delete 
-  ALT_INS* = 0x000001DF       # alt-insert 
-  CTL_UP* = 0x000001E0        # ctl-up arrow 
-  CTL_DOWN* = 0x000001E1      # ctl-down arrow 
-  CTL_TAB* = 0x000001E2       # ctl-tab 
+  KEY_A1* = 0x000001C1        # upper left on Virtual keypad
+  KEY_A2* = 0x000001C2        # upper middle on Virt. keypad
+  KEY_A3* = 0x000001C3        # upper right on Vir. keypad
+  KEY_B1* = 0x000001C4        # middle left on Virt. keypad
+  KEY_B2* = 0x000001C5        # center on Virt. keypad
+  KEY_B3* = 0x000001C6        # middle right on Vir. keypad
+  KEY_C1* = 0x000001C7        # lower left on Virt. keypad
+  KEY_C2* = 0x000001C8        # lower middle on Virt. keypad
+  KEY_C3* = 0x000001C9        # lower right on Vir. keypad
+  PADSLASH* = 0x000001CA      # slash on keypad
+  PADENTER* = 0x000001CB      # enter on keypad
+  CTL_PADENTER* = 0x000001CC  # ctl-enter on keypad
+  ALT_PADENTER* = 0x000001CD  # alt-enter on keypad
+  PADSTOP* = 0x000001CE       # stop on keypad
+  PADSTAR* = 0x000001CF       # star on keypad
+  PADMINUS* = 0x000001D0      # minus on keypad
+  PADPLUS* = 0x000001D1       # plus on keypad
+  CTL_PADSTOP* = 0x000001D2   # ctl-stop on keypad
+  CTL_PADCENTER* = 0x000001D3 # ctl-enter on keypad
+  CTL_PADPLUS* = 0x000001D4   # ctl-plus on keypad
+  CTL_PADMINUS* = 0x000001D5  # ctl-minus on keypad
+  CTL_PADSLASH* = 0x000001D6  # ctl-slash on keypad
+  CTL_PADSTAR* = 0x000001D7   # ctl-star on keypad
+  ALT_PADPLUS* = 0x000001D8   # alt-plus on keypad
+  ALT_PADMINUS* = 0x000001D9  # alt-minus on keypad
+  ALT_PADSLASH* = 0x000001DA  # alt-slash on keypad
+  ALT_PADSTAR* = 0x000001DB   # alt-star on keypad
+  ALT_PADSTOP* = 0x000001DC   # alt-stop on keypad
+  CTL_INS* = 0x000001DD       # ctl-insert
+  ALT_DEL* = 0x000001DE       # alt-delete
+  ALT_INS* = 0x000001DF       # alt-insert
+  CTL_UP* = 0x000001E0        # ctl-up arrow
+  CTL_DOWN* = 0x000001E1      # ctl-down arrow
+  CTL_TAB* = 0x000001E2       # ctl-tab
   ALT_TAB* = 0x000001E3
   ALT_MINUS* = 0x000001E4
   ALT_EQUAL* = 0x000001E5
@@ -317,24 +326,24 @@ const
   ALT_PGUP* = 0x000001E7
   ALT_PGDN* = 0x000001E8
   ALT_END* = 0x000001E9
-  ALT_UP* = 0x000001EA        # alt-up arrow 
-  ALT_DOWN* = 0x000001EB      # alt-down arrow 
-  ALT_RIGHT* = 0x000001EC     # alt-right arrow 
-  ALT_LEFT* = 0x000001ED      # alt-left arrow 
-  ALT_ENTER* = 0x000001EE     # alt-enter 
-  ALT_ESC* = 0x000001EF       # alt-escape 
-  ALT_BQUOTE* = 0x000001F0    # alt-back quote 
-  ALT_LBRACKET* = 0x000001F1  # alt-left bracket 
-  ALT_RBRACKET* = 0x000001F2  # alt-right bracket 
-  ALT_SEMICOLON* = 0x000001F3 # alt-semi-colon 
-  ALT_FQUOTE* = 0x000001F4    # alt-forward quote 
-  ALT_COMMA* = 0x000001F5     # alt-comma 
-  ALT_STOP* = 0x000001F6      # alt-stop 
-  ALT_FSLASH* = 0x000001F7    # alt-forward slash 
-  ALT_BKSP* = 0x000001F8      # alt-backspace 
-  CTL_BKSP* = 0x000001F9      # ctl-backspace 
-  PAD0* = 0x000001FA          # keypad 0 
-  CTL_PAD0* = 0x000001FB      # ctl-keypad 0 
+  ALT_UP* = 0x000001EA        # alt-up arrow
+  ALT_DOWN* = 0x000001EB      # alt-down arrow
+  ALT_RIGHT* = 0x000001EC     # alt-right arrow
+  ALT_LEFT* = 0x000001ED      # alt-left arrow
+  ALT_ENTER* = 0x000001EE     # alt-enter
+  ALT_ESC* = 0x000001EF       # alt-escape
+  ALT_BQUOTE* = 0x000001F0    # alt-back quote
+  ALT_LBRACKET* = 0x000001F1  # alt-left bracket
+  ALT_RBRACKET* = 0x000001F2  # alt-right bracket
+  ALT_SEMICOLON* = 0x000001F3 # alt-semi-colon
+  ALT_FQUOTE* = 0x000001F4    # alt-forward quote
+  ALT_COMMA* = 0x000001F5     # alt-comma
+  ALT_STOP* = 0x000001F6      # alt-stop
+  ALT_FSLASH* = 0x000001F7    # alt-forward slash
+  ALT_BKSP* = 0x000001F8      # alt-backspace
+  CTL_BKSP* = 0x000001F9      # ctl-backspace
+  PAD0* = 0x000001FA          # keypad 0
+  CTL_PAD0* = 0x000001FB      # ctl-keypad 0
   CTL_PAD1* = 0x000001FC
   CTL_PAD2* = 0x000001FD
   CTL_PAD3* = 0x000001FE
@@ -344,7 +353,7 @@ const
   CTL_PAD7* = 0x00000202
   CTL_PAD8* = 0x00000203
   CTL_PAD9* = 0x00000204
-  ALT_PAD0* = 0x00000205      # alt-keypad 0 
+  ALT_PAD0* = 0x00000205      # alt-keypad 0
   ALT_PAD1* = 0x00000206
   ALT_PAD2* = 0x00000207
   ALT_PAD3* = 0x00000208
@@ -354,30 +363,30 @@ const
   ALT_PAD7* = 0x0000020C
   ALT_PAD8* = 0x0000020D
   ALT_PAD9* = 0x0000020E
-  CTL_DEL* = 0x0000020F       # clt-delete 
-  ALT_BSLASH* = 0x00000210    # alt-back slash 
-  CTL_ENTER* = 0x00000211     # ctl-enter 
-  SHF_PADENTER* = 0x00000212  # shift-enter on keypad 
-  SHF_PADSLASH* = 0x00000213  # shift-slash on keypad 
-  SHF_PADSTAR* = 0x00000214   # shift-star  on keypad 
-  SHF_PADPLUS* = 0x00000215   # shift-plus  on keypad 
-  SHF_PADMINUS* = 0x00000216  # shift-minus on keypad 
-  SHF_UP* = 0x00000217        # shift-up on keypad 
-  SHF_DOWN* = 0x00000218      # shift-down on keypad 
-  SHF_IC* = 0x00000219        # shift-insert on keypad 
-  SHF_DC* = 0x0000021A        # shift-delete on keypad 
-  KEY_MOUSE* = 0x0000021B     # "mouse" key 
-  KEY_SHIFT_L* = 0x0000021C   # Left-shift 
-  KEY_SHIFT_R* = 0x0000021D   # Right-shift 
-  KEY_CONTROL_L* = 0x0000021E # Left-control 
-  KEY_CONTROL_R* = 0x0000021F # Right-control 
-  KEY_ALT_L* = 0x00000220     # Left-alt 
-  KEY_ALT_R* = 0x00000221     # Right-alt 
-  KEY_RESIZE* = 0x00000222    # Window resize 
-  KEY_SUP* = 0x00000223       # Shifted up arrow 
-  KEY_SDOWN* = 0x00000224     # Shifted down arrow 
-  KEY_MIN* = KEY_BREAK        # Minimum curses key value 
-  KEY_MAX* = KEY_SDOWN        # Maximum curses key 
+  CTL_DEL* = 0x0000020F       # clt-delete
+  ALT_BSLASH* = 0x00000210    # alt-back slash
+  CTL_ENTER* = 0x00000211     # ctl-enter
+  SHF_PADENTER* = 0x00000212  # shift-enter on keypad
+  SHF_PADSLASH* = 0x00000213  # shift-slash on keypad
+  SHF_PADSTAR* = 0x00000214   # shift-star  on keypad
+  SHF_PADPLUS* = 0x00000215   # shift-plus  on keypad
+  SHF_PADMINUS* = 0x00000216  # shift-minus on keypad
+  SHF_UP* = 0x00000217        # shift-up on keypad
+  SHF_DOWN* = 0x00000218      # shift-down on keypad
+  SHF_IC* = 0x00000219        # shift-insert on keypad
+  SHF_DC* = 0x0000021A        # shift-delete on keypad
+  KEY_MOUSE* = 0x0000021B     # "mouse" key
+  KEY_SHIFT_L* = 0x0000021C   # Left-shift
+  KEY_SHIFT_R* = 0x0000021D   # Right-shift
+  KEY_CONTROL_L* = 0x0000021E # Left-control
+  KEY_CONTROL_R* = 0x0000021F # Right-control
+  KEY_ALT_L* = 0x00000220     # Left-alt
+  KEY_ALT_R* = 0x00000221     # Right-alt
+  KEY_RESIZE* = 0x00000222    # Window resize
+  KEY_SUP* = 0x00000223       # Shifted up arrow
+  KEY_SDOWN* = 0x00000224     # Shifted down arrow
+  KEY_MIN* = KEY_BREAK        # Minimum curses key value
+  KEY_MAX* = KEY_SDOWN        # Maximum curses key
   CLIP_SUCCESS* = 0
   CLIP_ACCESS_ERROR* = 1
   CLIP_EMPTY* = 2
@@ -394,58 +403,58 @@ when appType == "gui":
     BUTTON_CTRL* = BUTTON_MODIFIER_CONTROL
     BUTTON_ALT* = BUTTON_MODIFIER_ALT
 else:
-  const 
+  const
     BUTTON_SHIFT* = 0x00000008
     BUTTON_CONTROL* = 0x00000010
     BUTTON_ALT* = 0x00000020
 
-type 
-  TMOUSE_STATUS*{.pure, final.} = object 
-    x*: cint                  # absolute column, 0 based, measured in characters 
-    y*: cint                  # absolute row, 0 based, measured in characters 
-    button*: array[0..3 - 1, cshort] # state of each button 
-    changes*: cint            # flags indicating what has changed with the mouse 
-  
-  MEVENT*{.pure, final.} = object 
-    id*: cshort               # unused, always 0 
+type
+  TMOUSE_STATUS*{.pure, final.} = object
+    x*: cint                  # absolute column, 0 based, measured in characters
+    y*: cint                  # absolute row, 0 based, measured in characters
+    button*: array[0..3 - 1, cshort] # state of each button
+    changes*: cint            # flags indicating what has changed with the mouse
+
+  MEVENT*{.pure, final.} = object
+    id*: cshort               # unused, always 0
     x*: cint
     y*: cint
-    z*: cint                  # x, y same as TMOUSE_STATUS; z unused 
+    z*: cint                  # x, y same as TMOUSE_STATUS; z unused
     bstate*: cunsignedlong    # equivalent to changes + button[], but
-                              # in the same format as used for mousemask() 
-  
-  WINDOW*{.pure, final.} = object 
-    cury*: cint              # current pseudo-cursor 
+                              # in the same format as used for mousemask()
+
+  WINDOW*{.pure, final.} = object
+    cury*: cint              # current pseudo-cursor
     curx*: cint
-    maxy*: cint              # max window coordinates 
+    maxy*: cint              # max window coordinates
     maxx*: cint
-    begy*: cint              # origin on screen 
+    begy*: cint              # origin on screen
     begx*: cint
-    flags*: cint             # window properties 
-    attrs*: cunsignedlong    # standard attributes and colors 
-    bkgd*: cunsignedlong     # background, normally blank 
-    clear*: cunsignedchar    # causes clear at next refresh 
-    leaveit*: cunsignedchar  # leaves cursor where it is 
-    scroll*: cunsignedchar   # allows window scrolling 
-    nodelay*: cunsignedchar  # input character wait flag 
-    immed*: cunsignedchar    # immediate update flag 
-    sync*: cunsignedchar     # synchronise window ancestors 
-    use_keypad*: cunsignedchar # flags keypad key mode active 
-    y*: ptr ptr cunsignedlong # pointer to line pointer array 
-    firstch*: ptr cint       # first changed character in line 
-    lastch*: ptr cint        # last changed character in line 
-    tmarg*: cint             # top of scrolling region 
-    bmarg*: cint             # bottom of scrolling region 
-    delayms*: cint           # milliseconds of delay for getch() 
+    flags*: cint             # window properties
+    attrs*: cunsignedlong    # standard attributes and colors
+    bkgd*: cunsignedlong     # background, normally blank
+    clear*: cunsignedchar    # causes clear at next refresh
+    leaveit*: cunsignedchar  # leaves cursor where it is
+    scroll*: cunsignedchar   # allows window scrolling
+    nodelay*: cunsignedchar  # input character wait flag
+    immed*: cunsignedchar    # immediate update flag
+    sync*: cunsignedchar     # synchronise window ancestors
+    use_keypad*: cunsignedchar # flags keypad key mode active
+    y*: ptr ptr cunsignedlong # pointer to line pointer array
+    firstch*: ptr cint       # first changed character in line
+    lastch*: ptr cint        # last changed character in line
+    tmarg*: cint             # top of scrolling region
+    bmarg*: cint             # bottom of scrolling region
+    delayms*: cint           # milliseconds of delay for getch()
     parx*: cint
-    pary*: cint              # coords relative to parent (0,0) 
-    parent*: ptr WINDOW        # subwin's pointer to parent win 
-  
-  PANELOBS*{.pure, final.} = object 
+    pary*: cint              # coords relative to parent (0,0)
+    parent*: ptr WINDOW        # subwin's pointer to parent win
+
+  PANELOBS*{.pure, final.} = object
     above*: ptr PANELOBS
     pan*: ptr PANEL
 
-  PANEL*{.pure, final.} = object 
+  PANEL*{.pure, final.} = object
     win*: ptr WINDOW
     wstarty*: cint
     wendy*: cint
@@ -462,39 +471,39 @@ type
 
 when unixOS:
   type
-    SCREEN*{.pure, final.} = object 
-      alive*: cunsignedchar     # if initscr() called, and not endwin() 
-      autocr*: cunsignedchar    # if cr -> lf 
-      cbreak*: cunsignedchar    # if terminal unbuffered 
-      echo*: cunsignedchar      # if terminal echo 
-      raw_inp*: cunsignedchar   # raw input mode (v. cooked input) 
-      raw_out*: cunsignedchar   # raw output mode (7 v. 8 bits) 
-      audible*: cunsignedchar   # FALSE if the bell is visual 
-      mono*: cunsignedchar      # TRUE if current screen is mono 
-      resized*: cunsignedchar   # TRUE if TERM has been resized 
-      orig_attr*: cunsignedchar # TRUE if we have the original colors 
-      orig_fore*: cshort        # original screen foreground color 
-      orig_back*: cshort        # original screen foreground color 
-      cursrow*: cint            # position of physical cursor 
-      curscol*: cint            # position of physical cursor 
-      visibility*: cint         # visibility of cursor 
-      orig_cursor*: cint        # original cursor size 
-      lines*: cint              # new value for LINES 
-      cols*: cint               # new value for COLS 
-      trap_mbe*: cunsignedlong # trap these mouse button events 
-      map_mbe_to_key*: cunsignedlong # map mouse buttons to slk 
+    SCREEN*{.pure, final.} = object
+      alive*: cunsignedchar     # if initscr() called, and not endwin()
+      autocr*: cunsignedchar    # if cr -> lf
+      cbreak*: cunsignedchar    # if terminal unbuffered
+      echo*: cunsignedchar      # if terminal echo
+      raw_inp*: cunsignedchar   # raw input mode (v. cooked input)
+      raw_out*: cunsignedchar   # raw output mode (7 v. 8 bits)
+      audible*: cunsignedchar   # FALSE if the bell is visual
+      mono*: cunsignedchar      # TRUE if current screen is mono
+      resized*: cunsignedchar   # TRUE if TERM has been resized
+      orig_attr*: cunsignedchar # TRUE if we have the original colors
+      orig_fore*: cshort        # original screen foreground color
+      orig_back*: cshort        # original screen foreground color
+      cursrow*: cint            # position of physical cursor
+      curscol*: cint            # position of physical cursor
+      visibility*: cint         # visibility of cursor
+      orig_cursor*: cint        # original cursor size
+      lines*: cint              # new value for LINES
+      cols*: cint               # new value for COLS
+      trap_mbe*: cunsignedlong # trap these mouse button events
+      map_mbe_to_key*: cunsignedlong # map mouse buttons to slk
       mouse_wait*: cint # time to wait (in ms) for a button release after a press
-      slklines*: cint           # lines in use by slk_init() 
-      slk_winptr*: ptr WINDOW   # window for slk 
-      linesrippedoff*: cint     # lines ripped off via ripoffline() 
-      linesrippedoffontop*: cint # lines ripped off on top via ripoffline() 
-      delaytenths*: cint        # 1/10ths second to wait block getch() for 
-      preserve*: cunsignedchar # TRUE if screen background to be preserved 
-      restore*: cint           # specifies if screen background to be restored, and how 
-      save_key_modifiers*: cunsignedchar # TRUE if each key modifiers saved with each key press 
-      return_key_modifiers*: cunsignedchar # TRUE if modifier keys are returned as "real" keys 
+      slklines*: cint           # lines in use by slk_init()
+      slk_winptr*: ptr WINDOW   # window for slk
+      linesrippedoff*: cint     # lines ripped off via ripoffline()
+      linesrippedoffontop*: cint # lines ripped off on top via ripoffline()
+      delaytenths*: cint        # 1/10ths second to wait block getch() for
+      preserve*: cunsignedchar # TRUE if screen background to be preserved
+      restore*: cint           # specifies if screen background to be restored, and how
+      save_key_modifiers*: cunsignedchar # TRUE if each key modifiers saved with each key press
+      return_key_modifiers*: cunsignedchar # TRUE if modifier keys are returned as "real" keys
       key_code*: cunsignedchar # TRUE if last key is a special key;
-      XcurscrSize*: cint        # size of Xcurscr shared memory block 
+      XcurscrSize*: cint        # size of Xcurscr shared memory block
       sb_on*: cunsignedchar
       sb_viewport_y*: cint
       sb_viewport_x*: cint
@@ -502,43 +511,43 @@ when unixOS:
       sb_total_x*: cint
       sb_cur_y*: cint
       sb_cur_x*: cint
-      line_color*: cshort       # color of line attributes - default -1 
+      line_color*: cshort       # color of line attributes - default -1
   {.deprecated: [TSCREEN: SCREEN].}
 else:
   type
-    SCREEN*{.pure, final.} = object 
-      alive*: cunsignedchar     # if initscr() called, and not endwin() 
-      autocr*: cunsignedchar    # if cr -> lf 
-      cbreak*: cunsignedchar    # if terminal unbuffered 
-      echo*: cunsignedchar      # if terminal echo 
-      raw_inp*: cunsignedchar   # raw input mode (v. cooked input) 
-      raw_out*: cunsignedchar   # raw output mode (7 v. 8 bits) 
-      audible*: cunsignedchar   # FALSE if the bell is visual 
-      mono*: cunsignedchar      # TRUE if current screen is mono 
-      resized*: cunsignedchar   # TRUE if TERM has been resized 
-      orig_attr*: cunsignedchar # TRUE if we have the original colors 
-      orig_fore*: cshort        # original screen foreground color 
-      orig_back*: cshort        # original screen foreground color 
-      cursrow*: cint            # position of physical cursor 
-      curscol*: cint            # position of physical cursor 
-      visibility*: cint         # visibility of cursor 
-      orig_cursor*: cint        # original cursor size 
-      lines*: cint              # new value for LINES 
-      cols*: cint               # new value for COLS 
-      trap_mbe*: cunsignedlong # trap these mouse button events 
-      map_mbe_to_key*: cunsignedlong # map mouse buttons to slk 
+    SCREEN*{.pure, final.} = object
+      alive*: cunsignedchar     # if initscr() called, and not endwin()
+      autocr*: cunsignedchar    # if cr -> lf
+      cbreak*: cunsignedchar    # if terminal unbuffered
+      echo*: cunsignedchar      # if terminal echo
+      raw_inp*: cunsignedchar   # raw input mode (v. cooked input)
+      raw_out*: cunsignedchar   # raw output mode (7 v. 8 bits)
+      audible*: cunsignedchar   # FALSE if the bell is visual
+      mono*: cunsignedchar      # TRUE if current screen is mono
+      resized*: cunsignedchar   # TRUE if TERM has been resized
+      orig_attr*: cunsignedchar # TRUE if we have the original colors
+      orig_fore*: cshort        # original screen foreground color
+      orig_back*: cshort        # original screen foreground color
+      cursrow*: cint            # position of physical cursor
+      curscol*: cint            # position of physical cursor
+      visibility*: cint         # visibility of cursor
+      orig_cursor*: cint        # original cursor size
+      lines*: cint              # new value for LINES
+      cols*: cint               # new value for COLS
+      trap_mbe*: cunsignedlong # trap these mouse button events
+      map_mbe_to_key*: cunsignedlong # map mouse buttons to slk
       mouse_wait*: cint # time to wait (in ms) for a button release after a press
-      slklines*: cint           # lines in use by slk_init() 
-      slk_winptr*: ptr WINDOW   # window for slk 
-      linesrippedoff*: cint     # lines ripped off via ripoffline() 
-      linesrippedoffontop*: cint # lines ripped off on top via ripoffline() 
-      delaytenths*: cint        # 1/10ths second to wait block getch() for 
-      preserve*: cunsignedchar # TRUE if screen background to be preserved 
-      restore*: cint           # specifies if screen background to be restored, and how 
-      save_key_modifiers*: cunsignedchar # TRUE if each key modifiers saved with each key press 
-      return_key_modifiers*: cunsignedchar # TRUE if modifier keys are returned as "real" keys 
+      slklines*: cint           # lines in use by slk_init()
+      slk_winptr*: ptr WINDOW   # window for slk
+      linesrippedoff*: cint     # lines ripped off via ripoffline()
+      linesrippedoffontop*: cint # lines ripped off on top via ripoffline()
+      delaytenths*: cint        # 1/10ths second to wait block getch() for
+      preserve*: cunsignedchar # TRUE if screen background to be preserved
+      restore*: cint           # specifies if screen background to be restored, and how
+      save_key_modifiers*: cunsignedchar # TRUE if each key modifiers saved with each key press
+      return_key_modifiers*: cunsignedchar # TRUE if modifier keys are returned as "real" keys
       key_code*: cunsignedchar # TRUE if last key is a special key;
-      line_color*: cshort       # color of line attributes - default -1 
+      line_color*: cshort       # color of line attributes - default -1
   {.deprecated: [TSCREEN: SCREEN].}
 
 var
@@ -554,20 +563,20 @@ var
   acs_map*{.importc: "acs_map", dynlib: pdcursesdll.}: ptr cunsignedlong
   ttytype*{.importc: "ttytype", dynlib: pdcursesdll.}: cstring
 
-template BUTTON_CHANGED*(x: expr): expr = 
+template BUTTON_CHANGED*(x: expr): expr =
   (Mouse_status.changes and (1 shl ((x) - 1)))
 
-template BUTTON_STATUS*(x: expr): expr = 
+template BUTTON_STATUS*(x: expr): expr =
   (Mouse_status.button[(x) - 1])
 
 template ACS_PICK*(w, n: expr): expr = int32(w) or A_ALTCHARSET
 
 template KEY_F*(n: expr): expr = KEY_F0 + n
 
-template COLOR_PAIR*(n: expr): expr = 
+template COLOR_PAIR*(n: expr): expr =
   ((cunsignedlong(n) shl COLOR_SHIFT) and A_COLOR)
 
-template PAIR_NUMBER*(n: expr): expr = 
+template PAIR_NUMBER*(n: expr): expr =
   (((n) and A_COLOR) shr COLOR_SHIFT)
 
 const
@@ -665,75 +674,75 @@ discard """WACS_ULCORNER* = (addr((acs_map['l'])))
   WACS_SBSB* = WACS_VLINE
   WACS_SSSS* = WACS_PLUS"""
 
-proc addch*(a2: cunsignedlong): cint{.extdecl, importc: "addch", 
+proc addch*(a2: cunsignedlong): cint{.extdecl, importc: "addch",
                                       dynlib: pdcursesdll.}
-proc addchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc addchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "addchnstr", dynlib: pdcursesdll.}
-proc addchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "addchstr", 
+proc addchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "addchstr",
     dynlib: pdcursesdll.}
-proc addnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "addnstr", 
+proc addnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "addnstr",
     dynlib: pdcursesdll.}
 proc addstr*(a2: cstring): cint{.extdecl, importc: "addstr", dynlib: pdcursesdll.}
-proc attroff*(a2: cunsignedlong): cint{.extdecl, importc: "attroff", 
+proc attroff*(a2: cunsignedlong): cint{.extdecl, importc: "attroff",
                                         dynlib: pdcursesdll.}
-proc attron*(a2: cunsignedlong): cint{.extdecl, importc: "attron", 
+proc attron*(a2: cunsignedlong): cint{.extdecl, importc: "attron",
                                        dynlib: pdcursesdll.}
-proc attrset*(a2: cunsignedlong): cint{.extdecl, importc: "attrset", 
+proc attrset*(a2: cunsignedlong): cint{.extdecl, importc: "attrset",
                                         dynlib: pdcursesdll.}
-proc attr_get*(a2: ptr cunsignedlong; a3: ptr cshort; a4: pointer): cint{.extdecl, 
+proc attr_get*(a2: ptr cunsignedlong; a3: ptr cshort; a4: pointer): cint{.extdecl,
     importc: "attr_get", dynlib: pdcursesdll.}
-proc attr_off*(a2: cunsignedlong; a3: pointer): cint{.extdecl, 
+proc attr_off*(a2: cunsignedlong; a3: pointer): cint{.extdecl,
     importc: "attr_off", dynlib: pdcursesdll.}
-proc attr_on*(a2: cunsignedlong; a3: pointer): cint{.extdecl, importc: "attr_on", 
+proc attr_on*(a2: cunsignedlong; a3: pointer): cint{.extdecl, importc: "attr_on",
     dynlib: pdcursesdll.}
-proc attr_set*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl, 
+proc attr_set*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl,
     importc: "attr_set", dynlib: pdcursesdll.}
 proc baudrate*(): cint{.extdecl, importc: "baudrate", dynlib: pdcursesdll.}
 proc beep*(): cint{.extdecl, importc: "beep", dynlib: pdcursesdll.}
 proc bkgd*(a2: cunsignedlong): cint{.extdecl, importc: "bkgd", dynlib: pdcursesdll.}
 proc bkgdset*(a2: cunsignedlong){.extdecl, importc: "bkgdset", dynlib: pdcursesdll.}
-proc border*(a2: cunsignedlong; a3: cunsignedlong; a4: cunsignedlong; 
-             a5: cunsignedlong; a6: cunsignedlong; a7: cunsignedlong; 
-             a8: cunsignedlong; a9: cunsignedlong): cint{.extdecl, 
+proc border*(a2: cunsignedlong; a3: cunsignedlong; a4: cunsignedlong;
+             a5: cunsignedlong; a6: cunsignedlong; a7: cunsignedlong;
+             a8: cunsignedlong; a9: cunsignedlong): cint{.extdecl,
     importc: "border", dynlib: pdcursesdll.}
-proc box*(a2: ptr WINDOW; a3: cunsignedlong; a4: cunsignedlong): cint{.extdecl, 
+proc box*(a2: ptr WINDOW; a3: cunsignedlong; a4: cunsignedlong): cint{.extdecl,
     importc: "box", dynlib: pdcursesdll.}
-proc can_change_color*(): cunsignedchar{.extdecl, importc: "can_change_color", 
+proc can_change_color*(): cunsignedchar{.extdecl, importc: "can_change_color",
     dynlib: pdcursesdll.}
 proc cbreak*(): cint{.extdecl, importc: "cbreak", dynlib: pdcursesdll.}
-proc chgat*(a2: cint; a3: cunsignedlong; a4: cshort; a5: pointer): cint{.extdecl, 
+proc chgat*(a2: cint; a3: cunsignedlong; a4: cshort; a5: pointer): cint{.extdecl,
     importc: "chgat", dynlib: pdcursesdll.}
-proc clearok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc clearok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "clearok", dynlib: pdcursesdll.}
 proc clear*(): cint{.extdecl, importc: "clear", dynlib: pdcursesdll.}
 proc clrtobot*(): cint{.extdecl, importc: "clrtobot", dynlib: pdcursesdll.}
 proc clrtoeol*(): cint{.extdecl, importc: "clrtoeol", dynlib: pdcursesdll.}
 proc color_content*(a2: cshort; a3: ptr cshort; a4: ptr cshort; a5: ptr cshort): cint{.
     extdecl, importc: "color_content", dynlib: pdcursesdll.}
-proc color_set*(a2: cshort; a3: pointer): cint{.extdecl, importc: "color_set", 
+proc color_set*(a2: cshort; a3: pointer): cint{.extdecl, importc: "color_set",
     dynlib: pdcursesdll.}
-proc copywin*(a2: ptr WINDOW; a3: ptr WINDOW; a4: cint; a5: cint; a6: cint; 
-              a7: cint; a8: cint; a9: cint; a10: cint): cint{.extdecl, 
+proc copywin*(a2: ptr WINDOW; a3: ptr WINDOW; a4: cint; a5: cint; a6: cint;
+              a7: cint; a8: cint; a9: cint; a10: cint): cint{.extdecl,
     importc: "copywin", dynlib: pdcursesdll.}
 proc curs_set*(a2: cint): cint{.extdecl, importc: "curs_set", dynlib: pdcursesdll.}
-proc def_prog_mode*(): cint{.extdecl, importc: "def_prog_mode", 
+proc def_prog_mode*(): cint{.extdecl, importc: "def_prog_mode",
                              dynlib: pdcursesdll.}
-proc def_shell_mode*(): cint{.extdecl, importc: "def_shell_mode", 
+proc def_shell_mode*(): cint{.extdecl, importc: "def_shell_mode",
                               dynlib: pdcursesdll.}
-proc delay_output*(a2: cint): cint{.extdecl, importc: "delay_output", 
+proc delay_output*(a2: cint): cint{.extdecl, importc: "delay_output",
                                     dynlib: pdcursesdll.}
 proc delch*(): cint{.extdecl, importc: "delch", dynlib: pdcursesdll.}
 proc deleteln*(): cint{.extdecl, importc: "deleteln", dynlib: pdcursesdll.}
-proc delscreen*(a2: ptr SCREEN){.extdecl, importc: "delscreen", 
+proc delscreen*(a2: ptr SCREEN){.extdecl, importc: "delscreen",
                                  dynlib: pdcursesdll.}
-proc delwin*(a2: ptr WINDOW): cint{.extdecl, importc: "delwin", 
+proc delwin*(a2: ptr WINDOW): cint{.extdecl, importc: "delwin",
                                     dynlib: pdcursesdll.}
 proc derwin*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint): ptr WINDOW{.
     extdecl, importc: "derwin", dynlib: pdcursesdll.}
 proc doupdate*(): cint{.extdecl, importc: "doupdate", dynlib: pdcursesdll.}
-proc dupwin*(a2: ptr WINDOW): ptr WINDOW{.extdecl, importc: "dupwin", 
+proc dupwin*(a2: ptr WINDOW): ptr WINDOW{.extdecl, importc: "dupwin",
     dynlib: pdcursesdll.}
-proc echochar*(a2: cunsignedlong): cint{.extdecl, importc: "echochar", 
+proc echochar*(a2: cunsignedlong): cint{.extdecl, importc: "echochar",
     dynlib: pdcursesdll.}
 proc echo*(): cint{.extdecl, importc: "echo", dynlib: pdcursesdll.}
 proc endwin*(): cint{.extdecl, importc: "endwin", dynlib: pdcursesdll.}
@@ -742,115 +751,115 @@ proc erase*(): cint{.extdecl, importc: "erase", dynlib: pdcursesdll.}
 proc filter*(){.extdecl, importc: "filter", dynlib: pdcursesdll.}
 proc flash*(): cint{.extdecl, importc: "flash", dynlib: pdcursesdll.}
 proc flushinp*(): cint{.extdecl, importc: "flushinp", dynlib: pdcursesdll.}
-proc getbkgd*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "getbkgd", 
+proc getbkgd*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "getbkgd",
     dynlib: pdcursesdll.}
-proc getnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "getnstr", 
+proc getnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "getnstr",
     dynlib: pdcursesdll.}
 proc getstr*(a2: cstring): cint{.extdecl, importc: "getstr", dynlib: pdcursesdll.}
-proc getwin*(a2: File): ptr WINDOW{.extdecl, importc: "getwin", 
+proc getwin*(a2: File): ptr WINDOW{.extdecl, importc: "getwin",
                                         dynlib: pdcursesdll.}
-proc halfdelay*(a2: cint): cint{.extdecl, importc: "halfdelay", 
+proc halfdelay*(a2: cint): cint{.extdecl, importc: "halfdelay",
                                  dynlib: pdcursesdll.}
-proc has_colors*(): cunsignedchar{.extdecl, importc: "has_colors", 
+proc has_colors*(): cunsignedchar{.extdecl, importc: "has_colors",
                                    dynlib: pdcursesdll.}
 proc has_ic*(): cunsignedchar{.extdecl, importc: "has_ic", dynlib: pdcursesdll.}
 proc has_il*(): cunsignedchar{.extdecl, importc: "has_il", dynlib: pdcursesdll.}
-proc hline*(a2: cunsignedlong; a3: cint): cint{.extdecl, importc: "hline", 
+proc hline*(a2: cunsignedlong; a3: cint): cint{.extdecl, importc: "hline",
     dynlib: pdcursesdll.}
-proc idcok*(a2: ptr WINDOW; a3: cunsignedchar){.extdecl, importc: "idcok", 
+proc idcok*(a2: ptr WINDOW; a3: cunsignedchar){.extdecl, importc: "idcok",
     dynlib: pdcursesdll.}
-proc idlok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "idlok", 
+proc idlok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "idlok",
     dynlib: pdcursesdll.}
-proc immedok*(a2: ptr WINDOW; a3: cunsignedchar){.extdecl, importc: "immedok", 
+proc immedok*(a2: ptr WINDOW; a3: cunsignedchar){.extdecl, importc: "immedok",
     dynlib: pdcursesdll.}
-proc inchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc inchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "inchnstr", dynlib: pdcursesdll.}
-proc inchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "inchstr", 
+proc inchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "inchstr",
     dynlib: pdcursesdll.}
 proc inch*(): cunsignedlong{.extdecl, importc: "inch", dynlib: pdcursesdll.}
-proc init_color*(a2: cshort; a3: cshort; a4: cshort; a5: cshort): cint{.extdecl, 
+proc init_color*(a2: cshort; a3: cshort; a4: cshort; a5: cshort): cint{.extdecl,
     importc: "init_color", dynlib: pdcursesdll.}
-proc init_pair*(a2: cshort; a3: cshort; a4: cshort): cint{.extdecl, 
+proc init_pair*(a2: cshort; a3: cshort; a4: cshort): cint{.extdecl,
     importc: "init_pair", dynlib: pdcursesdll.}
 proc initscr*(): ptr WINDOW{.extdecl, importc: "initscr", dynlib: pdcursesdll.}
-proc innstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "innstr", 
+proc innstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "innstr",
     dynlib: pdcursesdll.}
-proc insch*(a2: cunsignedlong): cint{.extdecl, importc: "insch", 
+proc insch*(a2: cunsignedlong): cint{.extdecl, importc: "insch",
                                       dynlib: pdcursesdll.}
 proc insdelln*(a2: cint): cint{.extdecl, importc: "insdelln", dynlib: pdcursesdll.}
 proc insertln*(): cint{.extdecl, importc: "insertln", dynlib: pdcursesdll.}
-proc insnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "insnstr", 
+proc insnstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "insnstr",
     dynlib: pdcursesdll.}
 proc insstr*(a2: cstring): cint{.extdecl, importc: "insstr", dynlib: pdcursesdll.}
 proc instr*(a2: cstring): cint{.extdecl, importc: "instr", dynlib: pdcursesdll.}
-proc intrflush*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc intrflush*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "intrflush", dynlib: pdcursesdll.}
 proc isendwin*(): cunsignedchar{.extdecl, importc: "isendwin", dynlib: pdcursesdll.}
-proc is_linetouched*(a2: ptr WINDOW; a3: cint): cunsignedchar{.extdecl, 
+proc is_linetouched*(a2: ptr WINDOW; a3: cint): cunsignedchar{.extdecl,
     importc: "is_linetouched", dynlib: pdcursesdll.}
-proc is_wintouched*(a2: ptr WINDOW): cunsignedchar{.extdecl, 
+proc is_wintouched*(a2: ptr WINDOW): cunsignedchar{.extdecl,
     importc: "is_wintouched", dynlib: pdcursesdll.}
 proc keyname*(a2: cint): cstring{.extdecl, importc: "keyname", dynlib: pdcursesdll.}
-proc keypad*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "keypad", 
+proc keypad*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "keypad",
     dynlib: pdcursesdll.}
 proc killchar*(): char{.extdecl, importc: "killchar", dynlib: pdcursesdll.}
-proc leaveok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc leaveok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "leaveok", dynlib: pdcursesdll.}
 proc longname*(): cstring{.extdecl, importc: "longname", dynlib: pdcursesdll.}
-proc meta*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "meta", 
+proc meta*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "meta",
     dynlib: pdcursesdll.}
-proc move*(a2: cint; a3: cint): cint{.extdecl, importc: "move", 
+proc move*(a2: cint; a3: cint): cint{.extdecl, importc: "move",
                                       dynlib: pdcursesdll.}
-proc mvaddch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl, 
+proc mvaddch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl,
     importc: "mvaddch", dynlib: pdcursesdll.}
 proc mvaddchnstr*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvaddchnstr", dynlib: pdcursesdll.}
-proc mvaddchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvaddchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvaddchstr", dynlib: pdcursesdll.}
-proc mvaddnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvaddnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvaddnstr", dynlib: pdcursesdll.}
-proc mvaddstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvaddstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvaddstr", dynlib: pdcursesdll.}
-proc mvchgat*(a2: cint; a3: cint; a4: cint; a5: cunsignedlong; a6: cshort; 
+proc mvchgat*(a2: cint; a3: cint; a4: cint; a5: cunsignedlong; a6: cshort;
               a7: pointer): cint{.extdecl, importc: "mvchgat", dynlib: pdcursesdll.}
-proc mvcur*(a2: cint; a3: cint; a4: cint; a5: cint): cint{.extdecl, 
+proc mvcur*(a2: cint; a3: cint; a4: cint; a5: cint): cint{.extdecl,
     importc: "mvcur", dynlib: pdcursesdll.}
-proc mvdelch*(a2: cint; a3: cint): cint{.extdecl, importc: "mvdelch", 
+proc mvdelch*(a2: cint; a3: cint): cint{.extdecl, importc: "mvdelch",
     dynlib: pdcursesdll.}
-proc mvderwin*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc mvderwin*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "mvderwin", dynlib: pdcursesdll.}
-proc mvgetch*(a2: cint; a3: cint): cint{.extdecl, importc: "mvgetch", 
+proc mvgetch*(a2: cint; a3: cint): cint{.extdecl, importc: "mvgetch",
     dynlib: pdcursesdll.}
-proc mvgetnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvgetnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvgetnstr", dynlib: pdcursesdll.}
-proc mvgetstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvgetstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvgetstr", dynlib: pdcursesdll.}
-proc mvhline*(a2: cint; a3: cint; a4: cunsignedlong; a5: cint): cint{.extdecl, 
+proc mvhline*(a2: cint; a3: cint; a4: cunsignedlong; a5: cint): cint{.extdecl,
     importc: "mvhline", dynlib: pdcursesdll.}
-proc mvinch*(a2: cint; a3: cint): cunsignedlong{.extdecl, importc: "mvinch", 
+proc mvinch*(a2: cint; a3: cint): cunsignedlong{.extdecl, importc: "mvinch",
     dynlib: pdcursesdll.}
 proc mvinchnstr*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvinchnstr", dynlib: pdcursesdll.}
-proc mvinchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvinchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvinchstr", dynlib: pdcursesdll.}
-proc mvinnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvinnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvinnstr", dynlib: pdcursesdll.}
-proc mvinsch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl, 
+proc mvinsch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl,
     importc: "mvinsch", dynlib: pdcursesdll.}
-proc mvinsnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvinsnstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvinsnstr", dynlib: pdcursesdll.}
-proc mvinsstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvinsstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvinsstr", dynlib: pdcursesdll.}
-proc mvinstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, importc: "mvinstr", 
+proc mvinstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, importc: "mvinstr",
     dynlib: pdcursesdll.}
-proc mvprintw*(a2: cint; a3: cint; a4: cstring): cint{.varargs, extdecl, 
+proc mvprintw*(a2: cint; a3: cint; a4: cstring): cint{.varargs, extdecl,
     importc: "mvprintw", dynlib: pdcursesdll.}
-proc mvscanw*(a2: cint; a3: cint; a4: cstring): cint{.varargs, extdecl, 
+proc mvscanw*(a2: cint; a3: cint; a4: cstring): cint{.varargs, extdecl,
     importc: "mvscanw", dynlib: pdcursesdll.}
-proc mvvline*(a2: cint; a3: cint; a4: cunsignedlong; a5: cint): cint{.extdecl, 
+proc mvvline*(a2: cint; a3: cint; a4: cunsignedlong; a5: cint): cint{.extdecl,
     importc: "mvvline", dynlib: pdcursesdll.}
-proc mvwaddchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                   a6: cint): cint{.extdecl, importc: "mvwaddchnstr", 
+proc mvwaddchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                   a6: cint): cint{.extdecl, importc: "mvwaddchnstr",
                                     dynlib: pdcursesdll.}
 proc mvwaddchstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwaddchstr", dynlib: pdcursesdll.}
@@ -858,27 +867,27 @@ proc mvwaddch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong): cint{.
     extdecl, importc: "mvwaddch", dynlib: pdcursesdll.}
 proc mvwaddnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring; a6: cint): cint{.
     extdecl, importc: "mvwaddnstr", dynlib: pdcursesdll.}
-proc mvwaddstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl, 
+proc mvwaddstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl,
     importc: "mvwaddstr", dynlib: pdcursesdll.}
-proc mvwchgat*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cunsignedlong; 
-               a7: cshort; a8: pointer): cint{.extdecl, importc: "mvwchgat", 
+proc mvwchgat*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cunsignedlong;
+               a7: cshort; a8: pointer): cint{.extdecl, importc: "mvwchgat",
     dynlib: pdcursesdll.}
-proc mvwdelch*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc mvwdelch*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "mvwdelch", dynlib: pdcursesdll.}
-proc mvwgetch*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc mvwgetch*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "mvwgetch", dynlib: pdcursesdll.}
 proc mvwgetnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring; a6: cint): cint{.
     extdecl, importc: "mvwgetnstr", dynlib: pdcursesdll.}
-proc mvwgetstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl, 
+proc mvwgetstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl,
     importc: "mvwgetstr", dynlib: pdcursesdll.}
 proc mvwhline*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong; a6: cint): cint{.
     extdecl, importc: "mvwhline", dynlib: pdcursesdll.}
-proc mvwinchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                  a6: cint): cint{.extdecl, importc: "mvwinchnstr", 
+proc mvwinchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                  a6: cint): cint{.extdecl, importc: "mvwinchnstr",
                                    dynlib: pdcursesdll.}
 proc mvwinchstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwinchstr", dynlib: pdcursesdll.}
-proc mvwinch*(a2: ptr WINDOW; a3: cint; a4: cint): cunsignedlong{.extdecl, 
+proc mvwinch*(a2: ptr WINDOW; a3: cint; a4: cint): cunsignedlong{.extdecl,
     importc: "mvwinch", dynlib: pdcursesdll.}
 proc mvwinnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring; a6: cint): cint{.
     extdecl, importc: "mvwinnstr", dynlib: pdcursesdll.}
@@ -886,105 +895,105 @@ proc mvwinsch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong): cint{.
     extdecl, importc: "mvwinsch", dynlib: pdcursesdll.}
 proc mvwinsnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring; a6: cint): cint{.
     extdecl, importc: "mvwinsnstr", dynlib: pdcursesdll.}
-proc mvwinsstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl, 
+proc mvwinsstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl,
     importc: "mvwinsstr", dynlib: pdcursesdll.}
-proc mvwinstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl, 
+proc mvwinstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.extdecl,
     importc: "mvwinstr", dynlib: pdcursesdll.}
-proc mvwin*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, importc: "mvwin", 
+proc mvwin*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, importc: "mvwin",
     dynlib: pdcursesdll.}
-proc mvwprintw*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.varargs, 
+proc mvwprintw*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.varargs,
     extdecl, importc: "mvwprintw", dynlib: pdcursesdll.}
-proc mvwscanw*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.varargs, 
+proc mvwscanw*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.varargs,
     extdecl, importc: "mvwscanw", dynlib: pdcursesdll.}
 proc mvwvline*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong; a6: cint): cint{.
     extdecl, importc: "mvwvline", dynlib: pdcursesdll.}
 proc napms*(a2: cint): cint{.extdecl, importc: "napms", dynlib: pdcursesdll.}
-proc newpad*(a2: cint; a3: cint): ptr WINDOW{.extdecl, importc: "newpad", 
+proc newpad*(a2: cint; a3: cint): ptr WINDOW{.extdecl, importc: "newpad",
     dynlib: pdcursesdll.}
-proc newterm*(a2: cstring; a3: File; a4: File): ptr SCREEN{.extdecl, 
+proc newterm*(a2: cstring; a3: File; a4: File): ptr SCREEN{.extdecl,
     importc: "newterm", dynlib: pdcursesdll.}
-proc newwin*(a2: cint; a3: cint; a4: cint; a5: cint): ptr WINDOW{.extdecl, 
+proc newwin*(a2: cint; a3: cint; a4: cint; a5: cint): ptr WINDOW{.extdecl,
     importc: "newwin", dynlib: pdcursesdll.}
 proc nl*(): cint{.extdecl, importc: "nl", dynlib: pdcursesdll.}
 proc nocbreak*(): cint{.extdecl, importc: "nocbreak", dynlib: pdcursesdll.}
-proc nodelay*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc nodelay*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "nodelay", dynlib: pdcursesdll.}
 proc noecho*(): cint{.extdecl, importc: "noecho", dynlib: pdcursesdll.}
 proc nonl*(): cint{.extdecl, importc: "nonl", dynlib: pdcursesdll.}
 proc noqiflush*(){.extdecl, importc: "noqiflush", dynlib: pdcursesdll.}
 proc noraw*(): cint{.extdecl, importc: "noraw", dynlib: pdcursesdll.}
-proc notimeout*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc notimeout*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "notimeout", dynlib: pdcursesdll.}
-proc overlay*(a2: ptr WINDOW; a3: ptr WINDOW): cint{.extdecl, importc: "overlay", 
+proc overlay*(a2: ptr WINDOW; a3: ptr WINDOW): cint{.extdecl, importc: "overlay",
     dynlib: pdcursesdll.}
-proc overwrite*(a2: ptr WINDOW; a3: ptr WINDOW): cint{.extdecl, 
+proc overwrite*(a2: ptr WINDOW; a3: ptr WINDOW): cint{.extdecl,
     importc: "overwrite", dynlib: pdcursesdll.}
-proc pair_content*(a2: cshort; a3: ptr cshort; a4: ptr cshort): cint{.extdecl, 
+proc pair_content*(a2: cshort; a3: ptr cshort; a4: ptr cshort): cint{.extdecl,
     importc: "pair_content", dynlib: pdcursesdll.}
-proc pechochar*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc pechochar*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "pechochar", dynlib: pdcursesdll.}
-proc pnoutrefresh*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint; 
-                   a7: cint; a8: cint): cint{.extdecl, importc: "pnoutrefresh", 
+proc pnoutrefresh*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint;
+                   a7: cint; a8: cint): cint{.extdecl, importc: "pnoutrefresh",
     dynlib: pdcursesdll.}
-proc prefresh*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint; a7: cint; 
+proc prefresh*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint; a7: cint;
                a8: cint): cint{.extdecl, importc: "prefresh", dynlib: pdcursesdll.}
-proc printw*(a2: cstring): cint{.varargs, extdecl, importc: "printw", 
+proc printw*(a2: cstring): cint{.varargs, extdecl, importc: "printw",
                                  dynlib: pdcursesdll.}
-proc putwin*(a2: ptr WINDOW; a3: File): cint{.extdecl, importc: "putwin", 
+proc putwin*(a2: ptr WINDOW; a3: File): cint{.extdecl, importc: "putwin",
     dynlib: pdcursesdll.}
 proc qiflush*(){.extdecl, importc: "qiflush", dynlib: pdcursesdll.}
 proc raw*(): cint{.extdecl, importc: "raw", dynlib: pdcursesdll.}
-proc redrawwin*(a2: ptr WINDOW): cint{.extdecl, importc: "redrawwin", 
+proc redrawwin*(a2: ptr WINDOW): cint{.extdecl, importc: "redrawwin",
                                        dynlib: pdcursesdll.}
 proc refresh*(): cint{.extdecl, importc: "refresh", dynlib: pdcursesdll.}
-proc reset_prog_mode*(): cint{.extdecl, importc: "reset_prog_mode", 
+proc reset_prog_mode*(): cint{.extdecl, importc: "reset_prog_mode",
                                dynlib: pdcursesdll.}
-proc reset_shell_mode*(): cint{.extdecl, importc: "reset_shell_mode", 
+proc reset_shell_mode*(): cint{.extdecl, importc: "reset_shell_mode",
                                 dynlib: pdcursesdll.}
 proc resetty*(): cint{.extdecl, importc: "resetty", dynlib: pdcursesdll.}
 #int     ripoffline(int, int (*)(WINDOW *, int));
 proc savetty*(): cint{.extdecl, importc: "savetty", dynlib: pdcursesdll.}
-proc scanw*(a2: cstring): cint{.varargs, extdecl, importc: "scanw", 
+proc scanw*(a2: cstring): cint{.varargs, extdecl, importc: "scanw",
                                 dynlib: pdcursesdll.}
-proc scr_dump*(a2: cstring): cint{.extdecl, importc: "scr_dump", 
+proc scr_dump*(a2: cstring): cint{.extdecl, importc: "scr_dump",
                                    dynlib: pdcursesdll.}
-proc scr_init*(a2: cstring): cint{.extdecl, importc: "scr_init", 
+proc scr_init*(a2: cstring): cint{.extdecl, importc: "scr_init",
                                    dynlib: pdcursesdll.}
-proc scr_restore*(a2: cstring): cint{.extdecl, importc: "scr_restore", 
+proc scr_restore*(a2: cstring): cint{.extdecl, importc: "scr_restore",
                                       dynlib: pdcursesdll.}
 proc scr_set*(a2: cstring): cint{.extdecl, importc: "scr_set", dynlib: pdcursesdll.}
 proc scrl*(a2: cint): cint{.extdecl, importc: "scrl", dynlib: pdcursesdll.}
-proc scroll*(a2: ptr WINDOW): cint{.extdecl, importc: "scroll", 
+proc scroll*(a2: ptr WINDOW): cint{.extdecl, importc: "scroll",
                                     dynlib: pdcursesdll.}
-proc scrollok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, 
+proc scrollok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl,
     importc: "scrollok", dynlib: pdcursesdll.}
-proc set_term*(a2: ptr SCREEN): ptr SCREEN{.extdecl, importc: "set_term", 
+proc set_term*(a2: ptr SCREEN): ptr SCREEN{.extdecl, importc: "set_term",
     dynlib: pdcursesdll.}
-proc setscrreg*(a2: cint; a3: cint): cint{.extdecl, importc: "setscrreg", 
+proc setscrreg*(a2: cint; a3: cint): cint{.extdecl, importc: "setscrreg",
     dynlib: pdcursesdll.}
-proc slk_attroff*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attroff", 
+proc slk_attroff*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attroff",
     dynlib: pdcursesdll.}
-proc slk_attr_off*(a2: cunsignedlong; a3: pointer): cint{.extdecl, 
+proc slk_attr_off*(a2: cunsignedlong; a3: pointer): cint{.extdecl,
     importc: "slk_attr_off", dynlib: pdcursesdll.}
-proc slk_attron*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attron", 
+proc slk_attron*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attron",
     dynlib: pdcursesdll.}
-proc slk_attr_on*(a2: cunsignedlong; a3: pointer): cint{.extdecl, 
+proc slk_attr_on*(a2: cunsignedlong; a3: pointer): cint{.extdecl,
     importc: "slk_attr_on", dynlib: pdcursesdll.}
-proc slk_attrset*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attrset", 
+proc slk_attrset*(a2: cunsignedlong): cint{.extdecl, importc: "slk_attrset",
     dynlib: pdcursesdll.}
-proc slk_attr_set*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl, 
+proc slk_attr_set*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl,
     importc: "slk_attr_set", dynlib: pdcursesdll.}
 proc slk_clear*(): cint{.extdecl, importc: "slk_clear", dynlib: pdcursesdll.}
-proc slk_color*(a2: cshort): cint{.extdecl, importc: "slk_color", 
+proc slk_color*(a2: cshort): cint{.extdecl, importc: "slk_color",
                                    dynlib: pdcursesdll.}
 proc slk_init*(a2: cint): cint{.extdecl, importc: "slk_init", dynlib: pdcursesdll.}
-proc slk_label*(a2: cint): cstring{.extdecl, importc: "slk_label", 
+proc slk_label*(a2: cint): cstring{.extdecl, importc: "slk_label",
                                     dynlib: pdcursesdll.}
-proc slk_noutrefresh*(): cint{.extdecl, importc: "slk_noutrefresh", 
+proc slk_noutrefresh*(): cint{.extdecl, importc: "slk_noutrefresh",
                                dynlib: pdcursesdll.}
 proc slk_refresh*(): cint{.extdecl, importc: "slk_refresh", dynlib: pdcursesdll.}
 proc slk_restore*(): cint{.extdecl, importc: "slk_restore", dynlib: pdcursesdll.}
-proc slk_set*(a2: cint; a3: cstring; a4: cint): cint{.extdecl, importc: "slk_set", 
+proc slk_set*(a2: cint; a3: cstring; a4: cint): cint{.extdecl, importc: "slk_set",
     dynlib: pdcursesdll.}
 proc slk_touch*(): cint{.extdecl, importc: "slk_touch", dynlib: pdcursesdll.}
 proc standend*(): cint{.extdecl, importc: "standend", dynlib: pdcursesdll.}
@@ -994,30 +1003,30 @@ proc subpad*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint): ptr WINDOW
     extdecl, importc: "subpad", dynlib: pdcursesdll.}
 proc subwin*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint; a6: cint): ptr WINDOW{.
     extdecl, importc: "subwin", dynlib: pdcursesdll.}
-proc syncok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "syncok", 
+proc syncok*(a2: ptr WINDOW; a3: cunsignedchar): cint{.extdecl, importc: "syncok",
     dynlib: pdcursesdll.}
-proc termattrs*(): cunsignedlong{.extdecl, importc: "termattrs", 
+proc termattrs*(): cunsignedlong{.extdecl, importc: "termattrs",
                                   dynlib: pdcursesdll.}
-proc termattrs2*(): cunsignedlong{.extdecl, importc: "term_attrs", 
+proc termattrs2*(): cunsignedlong{.extdecl, importc: "term_attrs",
                                    dynlib: pdcursesdll.}
 proc termname*(): cstring{.extdecl, importc: "termname", dynlib: pdcursesdll.}
 proc timeout*(a2: cint){.extdecl, importc: "timeout", dynlib: pdcursesdll.}
-proc touchline*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc touchline*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "touchline", dynlib: pdcursesdll.}
-proc touchwin*(a2: ptr WINDOW): cint{.extdecl, importc: "touchwin", 
+proc touchwin*(a2: ptr WINDOW): cint{.extdecl, importc: "touchwin",
                                       dynlib: pdcursesdll.}
-proc typeahead*(a2: cint): cint{.extdecl, importc: "typeahead", 
+proc typeahead*(a2: cint): cint{.extdecl, importc: "typeahead",
                                  dynlib: pdcursesdll.}
-proc untouchwin*(a2: ptr WINDOW): cint{.extdecl, importc: "untouchwin", 
+proc untouchwin*(a2: ptr WINDOW): cint{.extdecl, importc: "untouchwin",
                                         dynlib: pdcursesdll.}
 proc use_env*(a2: cunsignedchar){.extdecl, importc: "use_env", dynlib: pdcursesdll.}
-proc vidattr*(a2: cunsignedlong): cint{.extdecl, importc: "vidattr", 
+proc vidattr*(a2: cunsignedlong): cint{.extdecl, importc: "vidattr",
                                         dynlib: pdcursesdll.}
-proc vid_attr*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl, 
+proc vid_attr*(a2: cunsignedlong; a3: cshort; a4: pointer): cint{.extdecl,
     importc: "vid_attr", dynlib: pdcursesdll.}
 #int     vidputs(chtype, int (*)(int));
 #int     vid_puts(attr_t, short, void *, int (*)(int));
-proc vline*(a2: cunsignedlong; a3: cint): cint{.extdecl, importc: "vline", 
+proc vline*(a2: cunsignedlong; a3: cint): cint{.extdecl, importc: "vline",
     dynlib: pdcursesdll.}
 proc vwprintw*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, varargs,
     importc: "vw_printw", dynlib: pdcursesdll.}
@@ -1027,203 +1036,203 @@ proc vwscanw*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, varargs,
     importc: "vw_scanw", dynlib: pdcursesdll.}
 proc vwscanw2*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, varargs,
     importc: "vwscanw", dynlib: pdcursesdll.}
-proc waddchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl, 
+proc waddchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl,
     importc: "waddchnstr", dynlib: pdcursesdll.}
-proc waddchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc waddchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "waddchstr", dynlib: pdcursesdll.}
-proc waddch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "waddch", 
+proc waddch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "waddch",
     dynlib: pdcursesdll.}
-proc waddnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc waddnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "waddnstr", dynlib: pdcursesdll.}
-proc waddstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "waddstr", 
+proc waddstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "waddstr",
     dynlib: pdcursesdll.}
-proc wattroff*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc wattroff*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "wattroff", dynlib: pdcursesdll.}
-proc wattron*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc wattron*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "wattron", dynlib: pdcursesdll.}
-proc wattrset*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc wattrset*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "wattrset", dynlib: pdcursesdll.}
-proc wattr_get*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: ptr cshort; 
-                a5: pointer): cint{.extdecl, importc: "wattr_get", 
+proc wattr_get*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: ptr cshort;
+                a5: pointer): cint{.extdecl, importc: "wattr_get",
                                     dynlib: pdcursesdll.}
-proc wattr_off*(a2: ptr WINDOW; a3: cunsignedlong; a4: pointer): cint{.extdecl, 
+proc wattr_off*(a2: ptr WINDOW; a3: cunsignedlong; a4: pointer): cint{.extdecl,
     importc: "wattr_off", dynlib: pdcursesdll.}
-proc wattr_on*(a2: ptr WINDOW; a3: cunsignedlong; a4: pointer): cint{.extdecl, 
+proc wattr_on*(a2: ptr WINDOW; a3: cunsignedlong; a4: pointer): cint{.extdecl,
     importc: "wattr_on", dynlib: pdcursesdll.}
 proc wattr_set*(a2: ptr WINDOW; a3: cunsignedlong; a4: cshort; a5: pointer): cint{.
     extdecl, importc: "wattr_set", dynlib: pdcursesdll.}
-proc wbkgdset*(a2: ptr WINDOW; a3: cunsignedlong){.extdecl, importc: "wbkgdset", 
+proc wbkgdset*(a2: ptr WINDOW; a3: cunsignedlong){.extdecl, importc: "wbkgdset",
     dynlib: pdcursesdll.}
-proc wbkgd*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "wbkgd", 
+proc wbkgd*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "wbkgd",
     dynlib: pdcursesdll.}
-proc wborder*(a2: ptr WINDOW; a3: cunsignedlong; a4: cunsignedlong; 
-              a5: cunsignedlong; a6: cunsignedlong; a7: cunsignedlong; 
+proc wborder*(a2: ptr WINDOW; a3: cunsignedlong; a4: cunsignedlong;
+              a5: cunsignedlong; a6: cunsignedlong; a7: cunsignedlong;
               a8: cunsignedlong; a9: cunsignedlong; a10: cunsignedlong): cint{.
     extdecl, importc: "wborder", dynlib: pdcursesdll.}
-proc wchgat*(a2: ptr WINDOW; a3: cint; a4: cunsignedlong; a5: cshort; 
+proc wchgat*(a2: ptr WINDOW; a3: cint; a4: cunsignedlong; a5: cshort;
              a6: pointer): cint{.extdecl, importc: "wchgat", dynlib: pdcursesdll.}
-proc wclear*(a2: ptr WINDOW): cint{.extdecl, importc: "wclear", 
+proc wclear*(a2: ptr WINDOW): cint{.extdecl, importc: "wclear",
                                     dynlib: pdcursesdll.}
-proc wclrtobot*(a2: ptr WINDOW): cint{.extdecl, importc: "wclrtobot", 
+proc wclrtobot*(a2: ptr WINDOW): cint{.extdecl, importc: "wclrtobot",
                                        dynlib: pdcursesdll.}
-proc wclrtoeol*(a2: ptr WINDOW): cint{.extdecl, importc: "wclrtoeol", 
+proc wclrtoeol*(a2: ptr WINDOW): cint{.extdecl, importc: "wclrtoeol",
                                        dynlib: pdcursesdll.}
-proc wcolor_set*(a2: ptr WINDOW; a3: cshort; a4: pointer): cint{.extdecl, 
+proc wcolor_set*(a2: ptr WINDOW; a3: cshort; a4: pointer): cint{.extdecl,
     importc: "wcolor_set", dynlib: pdcursesdll.}
-proc wcursyncup*(a2: ptr WINDOW){.extdecl, importc: "wcursyncup", 
+proc wcursyncup*(a2: ptr WINDOW){.extdecl, importc: "wcursyncup",
                                   dynlib: pdcursesdll.}
-proc wdelch*(a2: ptr WINDOW): cint{.extdecl, importc: "wdelch", 
+proc wdelch*(a2: ptr WINDOW): cint{.extdecl, importc: "wdelch",
                                     dynlib: pdcursesdll.}
-proc wdeleteln*(a2: ptr WINDOW): cint{.extdecl, importc: "wdeleteln", 
+proc wdeleteln*(a2: ptr WINDOW): cint{.extdecl, importc: "wdeleteln",
                                        dynlib: pdcursesdll.}
-proc wechochar*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc wechochar*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "wechochar", dynlib: pdcursesdll.}
-proc werase*(a2: ptr WINDOW): cint{.extdecl, importc: "werase", 
+proc werase*(a2: ptr WINDOW): cint{.extdecl, importc: "werase",
                                     dynlib: pdcursesdll.}
-proc wgetch*(a2: ptr WINDOW): cint{.extdecl, importc: "wgetch", 
+proc wgetch*(a2: ptr WINDOW): cint{.extdecl, importc: "wgetch",
                                     dynlib: pdcursesdll.}
-proc wgetnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc wgetnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "wgetnstr", dynlib: pdcursesdll.}
-proc wgetstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "wgetstr", 
+proc wgetstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "wgetstr",
     dynlib: pdcursesdll.}
-proc whline*(a2: ptr WINDOW; a3: cunsignedlong; a4: cint): cint{.extdecl, 
+proc whline*(a2: ptr WINDOW; a3: cunsignedlong; a4: cint): cint{.extdecl,
     importc: "whline", dynlib: pdcursesdll.}
-proc winchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl, 
+proc winchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl,
     importc: "winchnstr", dynlib: pdcursesdll.}
-proc winchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc winchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "winchstr", dynlib: pdcursesdll.}
-proc winch*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "winch", 
+proc winch*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "winch",
     dynlib: pdcursesdll.}
-proc winnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc winnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "winnstr", dynlib: pdcursesdll.}
-proc winsch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "winsch", 
+proc winsch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, importc: "winsch",
     dynlib: pdcursesdll.}
-proc winsdelln*(a2: ptr WINDOW; a3: cint): cint{.extdecl, importc: "winsdelln", 
+proc winsdelln*(a2: ptr WINDOW; a3: cint): cint{.extdecl, importc: "winsdelln",
     dynlib: pdcursesdll.}
-proc winsertln*(a2: ptr WINDOW): cint{.extdecl, importc: "winsertln", 
+proc winsertln*(a2: ptr WINDOW): cint{.extdecl, importc: "winsertln",
                                        dynlib: pdcursesdll.}
-proc winsnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc winsnstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "winsnstr", dynlib: pdcursesdll.}
-proc winsstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winsstr", 
+proc winsstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winsstr",
     dynlib: pdcursesdll.}
-proc winstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winstr", 
+proc winstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winstr",
     dynlib: pdcursesdll.}
-proc wmove*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, importc: "wmove", 
+proc wmove*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, importc: "wmove",
     dynlib: pdcursesdll.}
-proc wnoutrefresh*(a2: ptr WINDOW): cint{.extdecl, importc: "wnoutrefresh", 
+proc wnoutrefresh*(a2: ptr WINDOW): cint{.extdecl, importc: "wnoutrefresh",
     dynlib: pdcursesdll.}
-proc wprintw*(a2: ptr WINDOW; a3: cstring): cint{.varargs, extdecl, 
+proc wprintw*(a2: ptr WINDOW; a3: cstring): cint{.varargs, extdecl,
     importc: "wprintw", dynlib: pdcursesdll.}
-proc wredrawln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc wredrawln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "wredrawln", dynlib: pdcursesdll.}
-proc wrefresh*(a2: ptr WINDOW): cint{.extdecl, importc: "wrefresh", 
+proc wrefresh*(a2: ptr WINDOW): cint{.extdecl, importc: "wrefresh",
                                       dynlib: pdcursesdll.}
-proc wscanw*(a2: ptr WINDOW; a3: cstring): cint{.varargs, extdecl, 
+proc wscanw*(a2: ptr WINDOW; a3: cstring): cint{.varargs, extdecl,
     importc: "wscanw", dynlib: pdcursesdll.}
-proc wscrl*(a2: ptr WINDOW; a3: cint): cint{.extdecl, importc: "wscrl", 
+proc wscrl*(a2: ptr WINDOW; a3: cint): cint{.extdecl, importc: "wscrl",
     dynlib: pdcursesdll.}
-proc wsetscrreg*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc wsetscrreg*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "wsetscrreg", dynlib: pdcursesdll.}
-proc wstandend*(a2: ptr WINDOW): cint{.extdecl, importc: "wstandend", 
+proc wstandend*(a2: ptr WINDOW): cint{.extdecl, importc: "wstandend",
                                        dynlib: pdcursesdll.}
-proc wstandout*(a2: ptr WINDOW): cint{.extdecl, importc: "wstandout", 
+proc wstandout*(a2: ptr WINDOW): cint{.extdecl, importc: "wstandout",
                                        dynlib: pdcursesdll.}
-proc wsyncdown*(a2: ptr WINDOW){.extdecl, importc: "wsyncdown", 
+proc wsyncdown*(a2: ptr WINDOW){.extdecl, importc: "wsyncdown",
                                  dynlib: pdcursesdll.}
 proc wsyncup*(a2: ptr WINDOW){.extdecl, importc: "wsyncup", dynlib: pdcursesdll.}
-proc wtimeout*(a2: ptr WINDOW; a3: cint){.extdecl, importc: "wtimeout", 
+proc wtimeout*(a2: ptr WINDOW; a3: cint){.extdecl, importc: "wtimeout",
     dynlib: pdcursesdll.}
-proc wtouchln*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint): cint{.extdecl, 
+proc wtouchln*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cint): cint{.extdecl,
     importc: "wtouchln", dynlib: pdcursesdll.}
-proc wvline*(a2: ptr WINDOW; a3: cunsignedlong; a4: cint): cint{.extdecl, 
+proc wvline*(a2: ptr WINDOW; a3: cunsignedlong; a4: cint): cint{.extdecl,
     importc: "wvline", dynlib: pdcursesdll.}
-proc addnwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "addnwstr", 
+proc addnwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "addnwstr",
     dynlib: pdcursesdll.}
-proc addwstr*(a2: cstring): cint{.extdecl, importc: "addwstr", 
+proc addwstr*(a2: cstring): cint{.extdecl, importc: "addwstr",
                                       dynlib: pdcursesdll.}
-proc add_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "add_wch", 
+proc add_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "add_wch",
     dynlib: pdcursesdll.}
-proc add_wchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc add_wchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "add_wchnstr", dynlib: pdcursesdll.}
-proc add_wchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "add_wchstr", 
+proc add_wchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "add_wchstr",
     dynlib: pdcursesdll.}
-proc border_set*(a2: ptr cunsignedlong; a3: ptr cunsignedlong; 
-                 a4: ptr cunsignedlong; a5: ptr cunsignedlong; 
-                 a6: ptr cunsignedlong; a7: ptr cunsignedlong; 
-                 a8: ptr cunsignedlong; a9: ptr cunsignedlong): cint{.extdecl, 
+proc border_set*(a2: ptr cunsignedlong; a3: ptr cunsignedlong;
+                 a4: ptr cunsignedlong; a5: ptr cunsignedlong;
+                 a6: ptr cunsignedlong; a7: ptr cunsignedlong;
+                 a8: ptr cunsignedlong; a9: ptr cunsignedlong): cint{.extdecl,
     importc: "border_set", dynlib: pdcursesdll.}
 proc box_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: ptr cunsignedlong): cint{.
     extdecl, importc: "box_set", dynlib: pdcursesdll.}
-proc echo_wchar*(a2: ptr cunsignedlong): cint{.extdecl, importc: "echo_wchar", 
+proc echo_wchar*(a2: ptr cunsignedlong): cint{.extdecl, importc: "echo_wchar",
     dynlib: pdcursesdll.}
-proc erasewchar*(a2: cstring): cint{.extdecl, importc: "erasewchar", 
+proc erasewchar*(a2: cstring): cint{.extdecl, importc: "erasewchar",
     dynlib: pdcursesdll.}
-proc getbkgrnd*(a2: ptr cunsignedlong): cint{.extdecl, importc: "getbkgrnd", 
+proc getbkgrnd*(a2: ptr cunsignedlong): cint{.extdecl, importc: "getbkgrnd",
     dynlib: pdcursesdll.}
-proc getcchar*(a2: ptr cunsignedlong; a3: cstring; a4: ptr cunsignedlong; 
-               a5: ptr cshort; a6: pointer): cint{.extdecl, importc: "getcchar", 
+proc getcchar*(a2: ptr cunsignedlong; a3: cstring; a4: ptr cunsignedlong;
+               a5: ptr cshort; a6: pointer): cint{.extdecl, importc: "getcchar",
     dynlib: pdcursesdll.}
-proc getn_wstr*(a2: ptr cint; a3: cint): cint{.extdecl, importc: "getn_wstr", 
+proc getn_wstr*(a2: ptr cint; a3: cint): cint{.extdecl, importc: "getn_wstr",
     dynlib: pdcursesdll.}
-proc get_wch*(a2: ptr cint): cint{.extdecl, importc: "get_wch", 
+proc get_wch*(a2: ptr cint): cint{.extdecl, importc: "get_wch",
                                      dynlib: pdcursesdll.}
-proc get_wstr*(a2: ptr cint): cint{.extdecl, importc: "get_wstr", 
+proc get_wstr*(a2: ptr cint): cint{.extdecl, importc: "get_wstr",
                                       dynlib: pdcursesdll.}
-proc hline_set*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc hline_set*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "hline_set", dynlib: pdcursesdll.}
-proc innwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "innwstr", 
+proc innwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "innwstr",
     dynlib: pdcursesdll.}
-proc ins_nwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "ins_nwstr", 
+proc ins_nwstr*(a2: cstring; a3: cint): cint{.extdecl, importc: "ins_nwstr",
     dynlib: pdcursesdll.}
-proc ins_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "ins_wch", 
+proc ins_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "ins_wch",
     dynlib: pdcursesdll.}
-proc ins_wstr*(a2: cstring): cint{.extdecl, importc: "ins_wstr", 
+proc ins_wstr*(a2: cstring): cint{.extdecl, importc: "ins_wstr",
                                        dynlib: pdcursesdll.}
-proc inwstr*(a2: cstring): cint{.extdecl, importc: "inwstr", 
+proc inwstr*(a2: cstring): cint{.extdecl, importc: "inwstr",
                                      dynlib: pdcursesdll.}
-proc in_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "in_wch", 
+proc in_wch*(a2: ptr cunsignedlong): cint{.extdecl, importc: "in_wch",
     dynlib: pdcursesdll.}
-proc in_wchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc in_wchnstr*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "in_wchnstr", dynlib: pdcursesdll.}
-proc in_wchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "in_wchstr", 
+proc in_wchstr*(a2: ptr cunsignedlong): cint{.extdecl, importc: "in_wchstr",
     dynlib: pdcursesdll.}
-proc key_name*(a2: char): cstring{.extdecl, importc: "key_name", 
+proc key_name*(a2: char): cstring{.extdecl, importc: "key_name",
                                       dynlib: pdcursesdll.}
-proc killwchar*(a2: cstring): cint{.extdecl, importc: "killwchar", 
+proc killwchar*(a2: cstring): cint{.extdecl, importc: "killwchar",
                                         dynlib: pdcursesdll.}
-proc mvaddnwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvaddnwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvaddnwstr", dynlib: pdcursesdll.}
-proc mvaddwstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvaddwstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvaddwstr", dynlib: pdcursesdll.}
-proc mvadd_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvadd_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvadd_wch", dynlib: pdcursesdll.}
 proc mvadd_wchnstr*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvadd_wchnstr", dynlib: pdcursesdll.}
-proc mvadd_wchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvadd_wchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvadd_wchstr", dynlib: pdcursesdll.}
-proc mvgetn_wstr*(a2: cint; a3: cint; a4: ptr cint; a5: cint): cint{.extdecl, 
+proc mvgetn_wstr*(a2: cint; a3: cint; a4: ptr cint; a5: cint): cint{.extdecl,
     importc: "mvgetn_wstr", dynlib: pdcursesdll.}
-proc mvget_wch*(a2: cint; a3: cint; a4: ptr cint): cint{.extdecl, 
+proc mvget_wch*(a2: cint; a3: cint; a4: ptr cint): cint{.extdecl,
     importc: "mvget_wch", dynlib: pdcursesdll.}
-proc mvget_wstr*(a2: cint; a3: cint; a4: ptr cint): cint{.extdecl, 
+proc mvget_wstr*(a2: cint; a3: cint; a4: ptr cint): cint{.extdecl,
     importc: "mvget_wstr", dynlib: pdcursesdll.}
 proc mvhline_set*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvhline_set", dynlib: pdcursesdll.}
-proc mvinnwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvinnwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvinnwstr", dynlib: pdcursesdll.}
-proc mvins_nwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl, 
+proc mvins_nwstr*(a2: cint; a3: cint; a4: cstring; a5: cint): cint{.extdecl,
     importc: "mvins_nwstr", dynlib: pdcursesdll.}
-proc mvins_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvins_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvins_wch", dynlib: pdcursesdll.}
-proc mvins_wstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvins_wstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvins_wstr", dynlib: pdcursesdll.}
-proc mvinwstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl, 
+proc mvinwstr*(a2: cint; a3: cint; a4: cstring): cint{.extdecl,
     importc: "mvinwstr", dynlib: pdcursesdll.}
-proc mvin_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvin_wch*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvin_wch", dynlib: pdcursesdll.}
 proc mvin_wchnstr*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvin_wchnstr", dynlib: pdcursesdll.}
-proc mvin_wchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl, 
+proc mvin_wchstr*(a2: cint; a3: cint; a4: ptr cunsignedlong): cint{.extdecl,
     importc: "mvin_wchstr", dynlib: pdcursesdll.}
 proc mvvline_set*(a2: cint; a3: cint; a4: ptr cunsignedlong; a5: cint): cint{.
     extdecl, importc: "mvvline_set", dynlib: pdcursesdll.}
@@ -1233,8 +1242,8 @@ proc mvwaddwstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.
     extdecl, importc: "mvwaddwstr", dynlib: pdcursesdll.}
 proc mvwadd_wch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwadd_wch", dynlib: pdcursesdll.}
-proc mvwadd_wchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                     a6: cint): cint{.extdecl, importc: "mvwadd_wchnstr", 
+proc mvwadd_wchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                     a6: cint): cint{.extdecl, importc: "mvwadd_wchnstr",
                                       dynlib: pdcursesdll.}
 proc mvwadd_wchstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwadd_wchstr", dynlib: pdcursesdll.}
@@ -1244,8 +1253,8 @@ proc mvwget_wch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cint): cint{.
     extdecl, importc: "mvwget_wch", dynlib: pdcursesdll.}
 proc mvwget_wstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cint): cint{.
     extdecl, importc: "mvwget_wstr", dynlib: pdcursesdll.}
-proc mvwhline_set*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                   a6: cint): cint{.extdecl, importc: "mvwhline_set", 
+proc mvwhline_set*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                   a6: cint): cint{.extdecl, importc: "mvwhline_set",
                                     dynlib: pdcursesdll.}
 proc mvwinnwstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring; a6: cint): cint{.
     extdecl, importc: "mvwinnwstr", dynlib: pdcursesdll.}
@@ -1257,99 +1266,99 @@ proc mvwins_wstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.
     extdecl, importc: "mvwins_wstr", dynlib: pdcursesdll.}
 proc mvwin_wch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwin_wch", dynlib: pdcursesdll.}
-proc mvwin_wchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                    a6: cint): cint{.extdecl, importc: "mvwin_wchnstr", 
+proc mvwin_wchnstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                    a6: cint): cint{.extdecl, importc: "mvwin_wchnstr",
                                      dynlib: pdcursesdll.}
 proc mvwin_wchstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong): cint{.
     extdecl, importc: "mvwin_wchstr", dynlib: pdcursesdll.}
 proc mvwinwstr*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cstring): cint{.
     extdecl, importc: "mvwinwstr", dynlib: pdcursesdll.}
-proc mvwvline_set*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong; 
-                   a6: cint): cint{.extdecl, importc: "mvwvline_set", 
+proc mvwvline_set*(a2: ptr WINDOW; a3: cint; a4: cint; a5: ptr cunsignedlong;
+                   a6: cint): cint{.extdecl, importc: "mvwvline_set",
                                     dynlib: pdcursesdll.}
-proc pecho_wchar*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc pecho_wchar*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "pecho_wchar", dynlib: pdcursesdll.}
-proc setcchar*(a2: ptr cunsignedlong; a3: cstring; a4: cunsignedlong; 
-               a5: cshort; a6: pointer): cint{.extdecl, importc: "setcchar", 
+proc setcchar*(a2: ptr cunsignedlong; a3: cstring; a4: cunsignedlong;
+               a5: cshort; a6: pointer): cint{.extdecl, importc: "setcchar",
     dynlib: pdcursesdll.}
-proc slk_wset*(a2: cint; a3: cstring; a4: cint): cint{.extdecl, 
+proc slk_wset*(a2: cint; a3: cstring; a4: cint): cint{.extdecl,
     importc: "slk_wset", dynlib: pdcursesdll.}
-proc unget_wch*(a2: char): cint{.extdecl, importc: "unget_wch", 
+proc unget_wch*(a2: char): cint{.extdecl, importc: "unget_wch",
                                     dynlib: pdcursesdll.}
-proc vline_set*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl, 
+proc vline_set*(a2: ptr cunsignedlong; a3: cint): cint{.extdecl,
     importc: "vline_set", dynlib: pdcursesdll.}
-proc waddnwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc waddnwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "waddnwstr", dynlib: pdcursesdll.}
-proc waddwstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, 
+proc waddwstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl,
     importc: "waddwstr", dynlib: pdcursesdll.}
-proc wadd_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wadd_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wadd_wch", dynlib: pdcursesdll.}
 proc wadd_wchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.
     extdecl, importc: "wadd_wchnstr", dynlib: pdcursesdll.}
-proc wadd_wchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wadd_wchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wadd_wchstr", dynlib: pdcursesdll.}
-proc wbkgrnd*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wbkgrnd*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wbkgrnd", dynlib: pdcursesdll.}
-proc wbkgrndset*(a2: ptr WINDOW; a3: ptr cunsignedlong){.extdecl, 
+proc wbkgrndset*(a2: ptr WINDOW; a3: ptr cunsignedlong){.extdecl,
     importc: "wbkgrndset", dynlib: pdcursesdll.}
-proc wborder_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: ptr cunsignedlong; 
-                  a5: ptr cunsignedlong; a6: ptr cunsignedlong; 
-                  a7: ptr cunsignedlong; a8: ptr cunsignedlong; 
-                  a9: ptr cunsignedlong; a10: ptr cunsignedlong): cint{.extdecl, 
+proc wborder_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: ptr cunsignedlong;
+                  a5: ptr cunsignedlong; a6: ptr cunsignedlong;
+                  a7: ptr cunsignedlong; a8: ptr cunsignedlong;
+                  a9: ptr cunsignedlong; a10: ptr cunsignedlong): cint{.extdecl,
     importc: "wborder_set", dynlib: pdcursesdll.}
-proc wecho_wchar*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wecho_wchar*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wecho_wchar", dynlib: pdcursesdll.}
-proc wgetbkgrnd*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wgetbkgrnd*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wgetbkgrnd", dynlib: pdcursesdll.}
-proc wgetn_wstr*(a2: ptr WINDOW; a3: ptr cint; a4: cint): cint{.extdecl, 
+proc wgetn_wstr*(a2: ptr WINDOW; a3: ptr cint; a4: cint): cint{.extdecl,
     importc: "wgetn_wstr", dynlib: pdcursesdll.}
-proc wget_wch*(a2: ptr WINDOW; a3: ptr cint): cint{.extdecl, 
+proc wget_wch*(a2: ptr WINDOW; a3: ptr cint): cint{.extdecl,
     importc: "wget_wch", dynlib: pdcursesdll.}
-proc wget_wstr*(a2: ptr WINDOW; a3: ptr cint): cint{.extdecl, 
+proc wget_wstr*(a2: ptr WINDOW; a3: ptr cint): cint{.extdecl,
     importc: "wget_wstr", dynlib: pdcursesdll.}
-proc whline_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl, 
+proc whline_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl,
     importc: "whline_set", dynlib: pdcursesdll.}
-proc winnwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc winnwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "winnwstr", dynlib: pdcursesdll.}
-proc wins_nwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl, 
+proc wins_nwstr*(a2: ptr WINDOW; a3: cstring; a4: cint): cint{.extdecl,
     importc: "wins_nwstr", dynlib: pdcursesdll.}
-proc wins_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc wins_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "wins_wch", dynlib: pdcursesdll.}
-proc wins_wstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, 
+proc wins_wstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl,
     importc: "wins_wstr", dynlib: pdcursesdll.}
-proc winwstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winwstr", 
+proc winwstr*(a2: ptr WINDOW; a3: cstring): cint{.extdecl, importc: "winwstr",
     dynlib: pdcursesdll.}
-proc win_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc win_wch*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "win_wch", dynlib: pdcursesdll.}
-proc win_wchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl, 
+proc win_wchnstr*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl,
     importc: "win_wchnstr", dynlib: pdcursesdll.}
-proc win_wchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl, 
+proc win_wchstr*(a2: ptr WINDOW; a3: ptr cunsignedlong): cint{.extdecl,
     importc: "win_wchstr", dynlib: pdcursesdll.}
-proc wunctrl*(a2: ptr cunsignedlong): cstring{.extdecl, importc: "wunctrl", 
+proc wunctrl*(a2: ptr cunsignedlong): cstring{.extdecl, importc: "wunctrl",
     dynlib: pdcursesdll.}
-proc wvline_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl, 
+proc wvline_set*(a2: ptr WINDOW; a3: ptr cunsignedlong; a4: cint): cint{.extdecl,
     importc: "wvline_set", dynlib: pdcursesdll.}
-proc getattrs*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "getattrs", 
+proc getattrs*(a2: ptr WINDOW): cunsignedlong{.extdecl, importc: "getattrs",
     dynlib: pdcursesdll.}
-proc getbegx*(a2: ptr WINDOW): cint{.extdecl, importc: "getbegx", 
+proc getbegx*(a2: ptr WINDOW): cint{.extdecl, importc: "getbegx",
                                      dynlib: pdcursesdll.}
-proc getbegy*(a2: ptr WINDOW): cint{.extdecl, importc: "getbegy", 
+proc getbegy*(a2: ptr WINDOW): cint{.extdecl, importc: "getbegy",
                                      dynlib: pdcursesdll.}
-proc getmaxx*(a2: ptr WINDOW): cint{.extdecl, importc: "getmaxx", 
+proc getmaxx*(a2: ptr WINDOW): cint{.extdecl, importc: "getmaxx",
                                      dynlib: pdcursesdll.}
-proc getmaxy*(a2: ptr WINDOW): cint{.extdecl, importc: "getmaxy", 
+proc getmaxy*(a2: ptr WINDOW): cint{.extdecl, importc: "getmaxy",
                                      dynlib: pdcursesdll.}
-proc getparx*(a2: ptr WINDOW): cint{.extdecl, importc: "getparx", 
+proc getparx*(a2: ptr WINDOW): cint{.extdecl, importc: "getparx",
                                      dynlib: pdcursesdll.}
-proc getpary*(a2: ptr WINDOW): cint{.extdecl, importc: "getpary", 
+proc getpary*(a2: ptr WINDOW): cint{.extdecl, importc: "getpary",
                                      dynlib: pdcursesdll.}
-proc getcurx*(a2: ptr WINDOW): cint{.extdecl, importc: "getcurx", 
+proc getcurx*(a2: ptr WINDOW): cint{.extdecl, importc: "getcurx",
                                      dynlib: pdcursesdll.}
-proc getcury*(a2: ptr WINDOW): cint{.extdecl, importc: "getcury", 
+proc getcury*(a2: ptr WINDOW): cint{.extdecl, importc: "getcury",
                                      dynlib: pdcursesdll.}
 proc traceoff*(){.extdecl, importc: "traceoff", dynlib: pdcursesdll.}
 proc traceon*(){.extdecl, importc: "traceon", dynlib: pdcursesdll.}
-proc unctrl*(a2: cunsignedlong): cstring{.extdecl, importc: "unctrl", 
+proc unctrl*(a2: cunsignedlong): cstring{.extdecl, importc: "unctrl",
     dynlib: pdcursesdll.}
 proc crmode*(): cint{.extdecl, importc: "crmode", dynlib: pdcursesdll.}
 proc nocrmode*(): cint{.extdecl, importc: "nocrmode", dynlib: pdcursesdll.}
@@ -1357,156 +1366,156 @@ proc draino*(a2: cint): cint{.extdecl, importc: "draino", dynlib: pdcursesdll.}
 proc resetterm*(): cint{.extdecl, importc: "resetterm", dynlib: pdcursesdll.}
 proc fixterm*(): cint{.extdecl, importc: "fixterm", dynlib: pdcursesdll.}
 proc saveterm*(): cint{.extdecl, importc: "saveterm", dynlib: pdcursesdll.}
-proc setsyx*(a2: cint; a3: cint): cint{.extdecl, importc: "setsyx", 
+proc setsyx*(a2: cint; a3: cint): cint{.extdecl, importc: "setsyx",
                                         dynlib: pdcursesdll.}
-proc mouse_set*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_set", 
+proc mouse_set*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_set",
     dynlib: pdcursesdll.}
-proc mouse_on*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_on", 
+proc mouse_on*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_on",
     dynlib: pdcursesdll.}
-proc mouse_off*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_off", 
+proc mouse_off*(a2: cunsignedlong): cint{.extdecl, importc: "mouse_off",
     dynlib: pdcursesdll.}
-proc request_mouse_pos*(): cint{.extdecl, importc: "request_mouse_pos", 
+proc request_mouse_pos*(): cint{.extdecl, importc: "request_mouse_pos",
                                  dynlib: pdcursesdll.}
-proc map_button*(a2: cunsignedlong): cint{.extdecl, importc: "map_button", 
+proc map_button*(a2: cunsignedlong): cint{.extdecl, importc: "map_button",
     dynlib: pdcursesdll.}
-proc wmouse_position*(a2: ptr WINDOW; a3: ptr cint; a4: ptr cint){.extdecl, 
+proc wmouse_position*(a2: ptr WINDOW; a3: ptr cint; a4: ptr cint){.extdecl,
     importc: "wmouse_position", dynlib: pdcursesdll.}
 proc getmouse*(): cunsignedlong{.extdecl, importc: "getmouse", dynlib: pdcursesdll.}
 proc getbmap*(): cunsignedlong{.extdecl, importc: "getbmap", dynlib: pdcursesdll.}
-proc assume_default_colors*(a2: cint; a3: cint): cint{.extdecl, 
+proc assume_default_colors*(a2: cint; a3: cint): cint{.extdecl,
     importc: "assume_default_colors", dynlib: pdcursesdll.}
-proc curses_version*(): cstring{.extdecl, importc: "curses_version", 
+proc curses_version*(): cstring{.extdecl, importc: "curses_version",
                                  dynlib: pdcursesdll.}
-proc has_key*(a2: cint): cunsignedchar{.extdecl, importc: "has_key", 
+proc has_key*(a2: cint): cunsignedchar{.extdecl, importc: "has_key",
                                         dynlib: pdcursesdll.}
-proc use_default_colors*(): cint{.extdecl, importc: "use_default_colors", 
+proc use_default_colors*(): cint{.extdecl, importc: "use_default_colors",
                                   dynlib: pdcursesdll.}
-proc wresize*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc wresize*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "wresize", dynlib: pdcursesdll.}
-proc mouseinterval*(a2: cint): cint{.extdecl, importc: "mouseinterval", 
+proc mouseinterval*(a2: cint): cint{.extdecl, importc: "mouseinterval",
                                      dynlib: pdcursesdll.}
-proc mousemask*(a2: cunsignedlong; a3: ptr cunsignedlong): cunsignedlong{.extdecl, 
+proc mousemask*(a2: cunsignedlong; a3: ptr cunsignedlong): cunsignedlong{.extdecl,
     importc: "mousemask", dynlib: pdcursesdll.}
 proc mouse_trafo*(a2: ptr cint; a3: ptr cint; a4: cunsignedchar): cunsignedchar{.
     extdecl, importc: "mouse_trafo", dynlib: pdcursesdll.}
-proc nc_getmouse*(a2: ptr MEVENT): cint{.extdecl, importc: "nc_getmouse", 
+proc nc_getmouse*(a2: ptr MEVENT): cint{.extdecl, importc: "nc_getmouse",
     dynlib: pdcursesdll.}
-proc ungetmouse*(a2: ptr MEVENT): cint{.extdecl, importc: "ungetmouse", 
+proc ungetmouse*(a2: ptr MEVENT): cint{.extdecl, importc: "ungetmouse",
                                         dynlib: pdcursesdll.}
-proc wenclose*(a2: ptr WINDOW; a3: cint; a4: cint): cunsignedchar{.extdecl, 
+proc wenclose*(a2: ptr WINDOW; a3: cint; a4: cint): cunsignedchar{.extdecl,
     importc: "wenclose", dynlib: pdcursesdll.}
 proc wmouse_trafo*(a2: ptr WINDOW; a3: ptr cint; a4: ptr cint; a5: cunsignedchar): cunsignedchar{.
     extdecl, importc: "wmouse_trafo", dynlib: pdcursesdll.}
-proc addrawch*(a2: cunsignedlong): cint{.extdecl, importc: "addrawch", 
+proc addrawch*(a2: cunsignedlong): cint{.extdecl, importc: "addrawch",
     dynlib: pdcursesdll.}
-proc insrawch*(a2: cunsignedlong): cint{.extdecl, importc: "insrawch", 
+proc insrawch*(a2: cunsignedlong): cint{.extdecl, importc: "insrawch",
     dynlib: pdcursesdll.}
-proc is_termresized*(): cunsignedchar{.extdecl, importc: "is_termresized", 
+proc is_termresized*(): cunsignedchar{.extdecl, importc: "is_termresized",
                                        dynlib: pdcursesdll.}
-proc mvaddrawch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl, 
+proc mvaddrawch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl,
     importc: "mvaddrawch", dynlib: pdcursesdll.}
-proc mvdeleteln*(a2: cint; a3: cint): cint{.extdecl, importc: "mvdeleteln", 
+proc mvdeleteln*(a2: cint; a3: cint): cint{.extdecl, importc: "mvdeleteln",
     dynlib: pdcursesdll.}
-proc mvinsertln*(a2: cint; a3: cint): cint{.extdecl, importc: "mvinsertln", 
+proc mvinsertln*(a2: cint; a3: cint): cint{.extdecl, importc: "mvinsertln",
     dynlib: pdcursesdll.}
-proc mvinsrawch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl, 
+proc mvinsrawch*(a2: cint; a3: cint; a4: cunsignedlong): cint{.extdecl,
     importc: "mvinsrawch", dynlib: pdcursesdll.}
 proc mvwaddrawch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong): cint{.
     extdecl, importc: "mvwaddrawch", dynlib: pdcursesdll.}
-proc mvwdeleteln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc mvwdeleteln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "mvwdeleteln", dynlib: pdcursesdll.}
-proc mvwinsertln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl, 
+proc mvwinsertln*(a2: ptr WINDOW; a3: cint; a4: cint): cint{.extdecl,
     importc: "mvwinsertln", dynlib: pdcursesdll.}
 proc mvwinsrawch*(a2: ptr WINDOW; a3: cint; a4: cint; a5: cunsignedlong): cint{.
     extdecl, importc: "mvwinsrawch", dynlib: pdcursesdll.}
-proc raw_output*(a2: cunsignedchar): cint{.extdecl, importc: "raw_output", 
+proc raw_output*(a2: cunsignedchar): cint{.extdecl, importc: "raw_output",
     dynlib: pdcursesdll.}
-proc resize_term*(a2: cint; a3: cint): cint{.extdecl, importc: "resize_term", 
+proc resize_term*(a2: cint; a3: cint): cint{.extdecl, importc: "resize_term",
     dynlib: pdcursesdll.}
-proc resize_window*(a2: ptr WINDOW; a3: cint; a4: cint): ptr WINDOW{.extdecl, 
+proc resize_window*(a2: ptr WINDOW; a3: cint; a4: cint): ptr WINDOW{.extdecl,
     importc: "resize_window", dynlib: pdcursesdll.}
-proc waddrawch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc waddrawch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "waddrawch", dynlib: pdcursesdll.}
-proc winsrawch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl, 
+proc winsrawch*(a2: ptr WINDOW; a3: cunsignedlong): cint{.extdecl,
     importc: "winsrawch", dynlib: pdcursesdll.}
 proc wordchar*(): char{.extdecl, importc: "wordchar", dynlib: pdcursesdll.}
-proc slk_wlabel*(a2: cint): cstring{.extdecl, importc: "slk_wlabel", 
+proc slk_wlabel*(a2: cint): cstring{.extdecl, importc: "slk_wlabel",
     dynlib: pdcursesdll.}
-proc debug*(a2: cstring){.varargs, extdecl, importc: "PDC_debug", 
+proc debug*(a2: cstring){.varargs, extdecl, importc: "PDC_debug",
                           dynlib: pdcursesdll.}
-proc ungetch*(a2: cint): cint{.extdecl, importc: "PDC_ungetch", 
+proc ungetch*(a2: cint): cint{.extdecl, importc: "PDC_ungetch",
                                dynlib: pdcursesdll.}
-proc set_blink*(a2: cunsignedchar): cint{.extdecl, importc: "PDC_set_blink", 
+proc set_blink*(a2: cunsignedchar): cint{.extdecl, importc: "PDC_set_blink",
     dynlib: pdcursesdll.}
-proc set_line_color*(a2: cshort): cint{.extdecl, importc: "PDC_set_line_color", 
+proc set_line_color*(a2: cshort): cint{.extdecl, importc: "PDC_set_line_color",
                                         dynlib: pdcursesdll.}
-proc set_title*(a2: cstring){.extdecl, importc: "PDC_set_title", 
+proc set_title*(a2: cstring){.extdecl, importc: "PDC_set_title",
                               dynlib: pdcursesdll.}
-proc clearclipboard*(): cint{.extdecl, importc: "PDC_clearclipboard", 
+proc clearclipboard*(): cint{.extdecl, importc: "PDC_clearclipboard",
                               dynlib: pdcursesdll.}
-proc freeclipboard*(a2: cstring): cint{.extdecl, importc: "PDC_freeclipboard", 
+proc freeclipboard*(a2: cstring): cint{.extdecl, importc: "PDC_freeclipboard",
                                         dynlib: pdcursesdll.}
-proc getclipboard*(a2: cstringArray; a3: ptr clong): cint{.extdecl, 
+proc getclipboard*(a2: cstringArray; a3: ptr clong): cint{.extdecl,
     importc: "PDC_getclipboard", dynlib: pdcursesdll.}
-proc setclipboard*(a2: cstring; a3: clong): cint{.extdecl, 
+proc setclipboard*(a2: cstring; a3: clong): cint{.extdecl,
     importc: "PDC_setclipboard", dynlib: pdcursesdll.}
-proc get_input_fd*(): cunsignedlong{.extdecl, importc: "PDC_get_input_fd", 
+proc get_input_fd*(): cunsignedlong{.extdecl, importc: "PDC_get_input_fd",
                                      dynlib: pdcursesdll.}
-proc get_key_modifiers*(): cunsignedlong{.extdecl, 
+proc get_key_modifiers*(): cunsignedlong{.extdecl,
     importc: "PDC_get_key_modifiers", dynlib: pdcursesdll.}
-proc return_key_modifiers*(a2: cunsignedchar): cint{.extdecl, 
+proc return_key_modifiers*(a2: cunsignedchar): cint{.extdecl,
     importc: "PDC_return_key_modifiers", dynlib: pdcursesdll.}
-proc save_key_modifiers*(a2: cunsignedchar): cint{.extdecl, 
+proc save_key_modifiers*(a2: cunsignedchar): cint{.extdecl,
     importc: "PDC_save_key_modifiers", dynlib: pdcursesdll.}
-proc bottom_panel*(pan: ptr PANEL): cint{.extdecl, importc: "bottom_panel", 
+proc bottom_panel*(pan: ptr PANEL): cint{.extdecl, importc: "bottom_panel",
     dynlib: pdcursesdll.}
-proc del_panel*(pan: ptr PANEL): cint{.extdecl, importc: "del_panel", 
+proc del_panel*(pan: ptr PANEL): cint{.extdecl, importc: "del_panel",
                                        dynlib: pdcursesdll.}
-proc hide_panel*(pan: ptr PANEL): cint{.extdecl, importc: "hide_panel", 
+proc hide_panel*(pan: ptr PANEL): cint{.extdecl, importc: "hide_panel",
                                         dynlib: pdcursesdll.}
-proc move_panel*(pan: ptr PANEL; starty: cint; startx: cint): cint{.extdecl, 
+proc move_panel*(pan: ptr PANEL; starty: cint; startx: cint): cint{.extdecl,
     importc: "move_panel", dynlib: pdcursesdll.}
-proc new_panel*(win: ptr WINDOW): ptr PANEL{.extdecl, importc: "new_panel", 
+proc new_panel*(win: ptr WINDOW): ptr PANEL{.extdecl, importc: "new_panel",
     dynlib: pdcursesdll.}
-proc panel_above*(pan: ptr PANEL): ptr PANEL{.extdecl, importc: "panel_above", 
+proc panel_above*(pan: ptr PANEL): ptr PANEL{.extdecl, importc: "panel_above",
     dynlib: pdcursesdll.}
-proc panel_below*(pan: ptr PANEL): ptr PANEL{.extdecl, importc: "panel_below", 
+proc panel_below*(pan: ptr PANEL): ptr PANEL{.extdecl, importc: "panel_below",
     dynlib: pdcursesdll.}
-proc panel_hidden*(pan: ptr PANEL): cint{.extdecl, importc: "panel_hidden", 
+proc panel_hidden*(pan: ptr PANEL): cint{.extdecl, importc: "panel_hidden",
     dynlib: pdcursesdll.}
-proc panel_userptr*(pan: ptr PANEL): pointer{.extdecl, importc: "panel_userptr", 
+proc panel_userptr*(pan: ptr PANEL): pointer{.extdecl, importc: "panel_userptr",
     dynlib: pdcursesdll.}
-proc panel_window*(pan: ptr PANEL): ptr WINDOW{.extdecl, importc: "panel_window", 
+proc panel_window*(pan: ptr PANEL): ptr WINDOW{.extdecl, importc: "panel_window",
     dynlib: pdcursesdll.}
-proc replace_panel*(pan: ptr PANEL; win: ptr WINDOW): cint{.extdecl, 
+proc replace_panel*(pan: ptr PANEL; win: ptr WINDOW): cint{.extdecl,
     importc: "replace_panel", dynlib: pdcursesdll.}
-proc set_panel_userptr*(pan: ptr PANEL; uptr: pointer): cint{.extdecl, 
+proc set_panel_userptr*(pan: ptr PANEL; uptr: pointer): cint{.extdecl,
     importc: "set_panel_userptr", dynlib: pdcursesdll.}
-proc show_panel*(pan: ptr PANEL): cint{.extdecl, importc: "show_panel", 
+proc show_panel*(pan: ptr PANEL): cint{.extdecl, importc: "show_panel",
                                         dynlib: pdcursesdll.}
-proc top_panel*(pan: ptr PANEL): cint{.extdecl, importc: "top_panel", 
+proc top_panel*(pan: ptr PANEL): cint{.extdecl, importc: "top_panel",
                                        dynlib: pdcursesdll.}
 proc update_panels*(){.extdecl, importc: "update_panels", dynlib: pdcursesdll.}
 
 when unixOS:
-  proc Xinitscr*(a2: cint; a3: cstringArray): ptr WINDOW{.extdecl, 
+  proc Xinitscr*(a2: cint; a3: cstringArray): ptr WINDOW{.extdecl,
     importc: "Xinitscr", dynlib: pdcursesdll.}
   proc XCursesExit*(){.extdecl, importc: "XCursesExit", dynlib: pdcursesdll.}
   proc sb_init*(): cint{.extdecl, importc: "sb_init", dynlib: pdcursesdll.}
-  proc sb_set_horz*(a2: cint; a3: cint; a4: cint): cint{.extdecl, 
+  proc sb_set_horz*(a2: cint; a3: cint; a4: cint): cint{.extdecl,
     importc: "sb_set_horz", dynlib: pdcursesdll.}
-  proc sb_set_vert*(a2: cint; a3: cint; a4: cint): cint{.extdecl, 
+  proc sb_set_vert*(a2: cint; a3: cint; a4: cint): cint{.extdecl,
     importc: "sb_set_vert", dynlib: pdcursesdll.}
-  proc sb_get_horz*(a2: ptr cint; a3: ptr cint; a4: ptr cint): cint{.extdecl, 
+  proc sb_get_horz*(a2: ptr cint; a3: ptr cint; a4: ptr cint): cint{.extdecl,
     importc: "sb_get_horz", dynlib: pdcursesdll.}
-  proc sb_get_vert*(a2: ptr cint; a3: ptr cint; a4: ptr cint): cint{.extdecl, 
+  proc sb_get_vert*(a2: ptr cint; a3: ptr cint; a4: ptr cint): cint{.extdecl,
     importc: "sb_get_vert", dynlib: pdcursesdll.}
   proc sb_refresh*(): cint{.extdecl, importc: "sb_refresh", dynlib: pdcursesdll.}
 
-template getch*(): expr = 
+template getch*(): expr =
   wgetch(stdscr)
 
-template ungetch*(ch: expr): expr = 
+template ungetch*(ch: expr): expr =
   ungetch(ch)
 
 template getbegyx*(w, y, x: expr): expr =
@@ -1525,13 +1534,13 @@ template getyx*(w, y, x: expr): expr =
   y = getcury(w)
   x = getcurx(w)
 
-template getsyx*(y, x: expr): stmt = 
+template getsyx*(y, x: expr): stmt =
   if curscr.leaveit:
     (x) = - 1
     (y) = (x)
   else: getyx(curscr, (y), (x))
-  
-template getmouse*(x: expr): expr = 
+
+template getmouse*(x: expr): expr =
   nc_getmouse(x)
 
 when defined(windows):
@@ -1541,5 +1550,5 @@ when defined(windows):
     con_in*{.importc: "pdc_con_in", dynlib: pdcursesdll.}: HANDLE
     quick_edit*{.importc: "pdc_quick_edit", dynlib: pdcursesdll.}: DWORD
 
-  proc get_buffer_rows*(): cint{.extdecl, importc: "PDC_get_buffer_rows", 
+  proc get_buffer_rows*(): cint{.extdecl, importc: "PDC_get_buffer_rows",
                                dynlib: pdcursesdll.}
diff --git a/lib/wrappers/postgres.nim b/lib/wrappers/postgres.nim
index 3c35bc590..f9a10dccb 100644
--- a/lib/wrappers/postgres.nim
+++ b/lib/wrappers/postgres.nim
@@ -1,3 +1,12 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2015 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
 # This module contains the definitions for structures and externs for
 # functions used by frontend postgres applications. It is based on
 # Postgresql's libpq-fe.h.
@@ -8,43 +17,43 @@
 
 {.deadCodeElim: on.}
 
-when defined(windows): 
-  const 
+when defined(windows):
+  const
     dllName = "libpq.dll"
-elif defined(macosx): 
-  const 
+elif defined(macosx):
+  const
     dllName = "libpq.dylib"
-else: 
-  const 
+else:
+  const
     dllName = "libpq.so(.5|)"
-type 
+type
   POid* = ptr Oid
   Oid* = int32
 
-const 
+const
   ERROR_MSG_LENGTH* = 4096
   CMDSTATUS_LEN* = 40
 
-type 
+type
   SockAddr* = array[1..112, int8]
-  PGresAttDesc*{.pure, final.} = object 
+  PGresAttDesc*{.pure, final.} = object
     name*: cstring
     adtid*: Oid
     adtsize*: int
 
   PPGresAttDesc* = ptr PGresAttDesc
   PPPGresAttDesc* = ptr PPGresAttDesc
-  PGresAttValue*{.pure, final.} = object 
+  PGresAttValue*{.pure, final.} = object
     length*: int32
     value*: cstring
 
   PPGresAttValue* = ptr PGresAttValue
   PPPGresAttValue* = ptr PPGresAttValue
   PExecStatusType* = ptr ExecStatusType
-  ExecStatusType* = enum 
-    PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT, 
+  ExecStatusType* = enum
+    PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT,
     PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR
-  PGlobjfuncs*{.pure, final.} = object 
+  PGlobjfuncs*{.pure, final.} = object
     fn_lo_open*: Oid
     fn_lo_close*: Oid
     fn_lo_creat*: Oid
@@ -56,11 +65,11 @@ type
 
   PPGlobjfuncs* = ptr PGlobjfuncs
   PConnStatusType* = ptr ConnStatusType
-  ConnStatusType* = enum 
-    CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE, 
-    CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV, 
+  ConnStatusType* = enum
+    CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE,
+    CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV,
     CONNECTION_SSL_STARTUP, CONNECTION_NEEDED
-  PGconn*{.pure, final.} = object 
+  PGconn*{.pure, final.} = object
     pghost*: cstring
     pgtty*: cstring
     pgport*: cstring
@@ -82,7 +91,7 @@ type
     lobjfuncs*: PPGlobjfuncs
 
   PPGconn* = ptr PGconn
-  PGresult*{.pure, final.} = object 
+  PGresult*{.pure, final.} = object
     ntups*: int32
     numAttributes*: int32
     attDescs*: PPGresAttDesc
@@ -95,18 +104,18 @@ type
 
   PPGresult* = ptr PGresult
   PPostgresPollingStatusType* = ptr PostgresPollingStatusType
-  PostgresPollingStatusType* = enum 
-    PGRES_POLLING_FAILED = 0, PGRES_POLLING_READING, PGRES_POLLING_WRITING, 
+  PostgresPollingStatusType* = enum
+    PGRES_POLLING_FAILED = 0, PGRES_POLLING_READING, PGRES_POLLING_WRITING,
     PGRES_POLLING_OK, PGRES_POLLING_ACTIVE
   PPGTransactionStatusType* = ptr PGTransactionStatusType
-  PGTransactionStatusType* = enum 
-    PQTRANS_IDLE, PQTRANS_ACTIVE, PQTRANS_INTRANS, PQTRANS_INERROR, 
+  PGTransactionStatusType* = enum
+    PQTRANS_IDLE, PQTRANS_ACTIVE, PQTRANS_INTRANS, PQTRANS_INERROR,
     PQTRANS_UNKNOWN
   PPGVerbosity* = ptr PGVerbosity
-  PGVerbosity* = enum 
+  PGVerbosity* = enum
     PQERRORS_TERSE, PQERRORS_DEFAULT, PQERRORS_VERBOSE
   PpgNotify* = ptr pgNotify
-  pgNotify*{.pure, final.} = object 
+  pgNotify*{.pure, final.} = object
     relname*: cstring
     be_pid*: int32
     extra*: cstring
@@ -116,7 +125,7 @@ type
   Ppqbool* = ptr pqbool
   pqbool* = char
   P_PQprintOpt* = ptr PQprintOpt
-  PQprintOpt*{.pure, final.} = object 
+  PQprintOpt*{.pure, final.} = object
     header*: pqbool
     align*: pqbool
     standard*: pqbool
@@ -129,7 +138,7 @@ type
     fieldName*: ptr cstring
 
   P_PQconninfoOption* = ptr PQconninfoOption
-  PQconninfoOption*{.pure, final.} = object 
+  PQconninfoOption*{.pure, final.} = object
     keyword*: cstring
     envvar*: cstring
     compiled*: cstring
@@ -139,7 +148,7 @@ type
     dispsize*: int32
 
   PPQArgBlock* = ptr PQArgBlock
-  PQArgBlock*{.pure, final.} = object 
+  PQArgBlock*{.pure, final.} = object
     length*: int32
     isint*: int32
     p*: pointer
@@ -148,27 +157,27 @@ type
       TPGlobjfuncs: Pglobjfuncs, TConnStatusType: ConnStatusType, TPGconn: Pgconn,
       TPGresult: PGresult].}
 
-proc pqconnectStart*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName, 
+proc pqconnectStart*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName,
     importc: "PQconnectStart".}
-proc pqconnectPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl, 
+proc pqconnectPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl,
     dynlib: dllName, importc: "PQconnectPoll".}
-proc pqconnectdb*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName, 
+proc pqconnectdb*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName,
     importc: "PQconnectdb".}
-proc pqsetdbLogin*(pghost: cstring, pgport: cstring, pgoptions: cstring, 
+proc pqsetdbLogin*(pghost: cstring, pgport: cstring, pgoptions: cstring,
                    pgtty: cstring, dbName: cstring, login: cstring, pwd: cstring): PPGconn{.
     cdecl, dynlib: dllName, importc: "PQsetdbLogin".}
 proc pqsetdb*(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): Ppgconn
 proc pqfinish*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQfinish".}
-proc pqconndefaults*(): PPQconninfoOption{.cdecl, dynlib: dllName, 
+proc pqconndefaults*(): PPQconninfoOption{.cdecl, dynlib: dllName,
     importc: "PQconndefaults".}
-proc pqconninfoFree*(connOptions: PPQconninfoOption){.cdecl, dynlib: dllName, 
+proc pqconninfoFree*(connOptions: PPQconninfoOption){.cdecl, dynlib: dllName,
     importc: "PQconninfoFree".}
-proc pqresetStart*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqresetStart*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQresetStart".}
-proc pqresetPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl, 
+proc pqresetPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl,
     dynlib: dllName, importc: "PQresetPoll".}
 proc pqreset*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQreset".}
-proc pqrequestCancel*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqrequestCancel*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQrequestCancel".}
 proc pqdb*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQdb".}
 proc pquser*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQuser".}
@@ -176,44 +185,44 @@ proc pqpass*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQpass".
 proc pqhost*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQhost".}
 proc pqport*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQport".}
 proc pqtty*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQtty".}
-proc pqoptions*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, 
+proc pqoptions*(conn: PPGconn): cstring{.cdecl, dynlib: dllName,
     importc: "PQoptions".}
-proc pqstatus*(conn: PPGconn): ConnStatusType{.cdecl, dynlib: dllName, 
+proc pqstatus*(conn: PPGconn): ConnStatusType{.cdecl, dynlib: dllName,
     importc: "PQstatus".}
-proc pqtransactionStatus*(conn: PPGconn): PGTransactionStatusType{.cdecl, 
+proc pqtransactionStatus*(conn: PPGconn): PGTransactionStatusType{.cdecl,
     dynlib: dllName, importc: "PQtransactionStatus".}
-proc pqparameterStatus*(conn: PPGconn, paramName: cstring): cstring{.cdecl, 
+proc pqparameterStatus*(conn: PPGconn, paramName: cstring): cstring{.cdecl,
     dynlib: dllName, importc: "PQparameterStatus".}
-proc pqprotocolVersion*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqprotocolVersion*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQprotocolVersion".}
-proc pqerrorMessage*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, 
+proc pqerrorMessage*(conn: PPGconn): cstring{.cdecl, dynlib: dllName,
     importc: "PQerrorMessage".}
-proc pqsocket*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqsocket*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
                                       importc: "PQsocket".}
-proc pqbackendPID*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqbackendPID*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQbackendPID".}
-proc pqclientEncoding*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqclientEncoding*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQclientEncoding".}
-proc pqsetClientEncoding*(conn: PPGconn, encoding: cstring): int32{.cdecl, 
+proc pqsetClientEncoding*(conn: PPGconn, encoding: cstring): int32{.cdecl,
     dynlib: dllName, importc: "PQsetClientEncoding".}
-when defined(USE_SSL): 
-  # Get the SSL structure associated with a connection  
-  proc pqgetssl*(conn: PPGconn): PSSL{.cdecl, dynlib: dllName, 
+when defined(USE_SSL):
+  # Get the SSL structure associated with a connection
+  proc pqgetssl*(conn: PPGconn): PSSL{.cdecl, dynlib: dllName,
                                        importc: "PQgetssl".}
 proc pqsetErrorVerbosity*(conn: PPGconn, verbosity: PGVerbosity): PGVerbosity{.
     cdecl, dynlib: dllName, importc: "PQsetErrorVerbosity".}
-proc pqtrace*(conn: PPGconn, debug_port: File){.cdecl, dynlib: dllName, 
+proc pqtrace*(conn: PPGconn, debug_port: File){.cdecl, dynlib: dllName,
     importc: "PQtrace".}
 proc pquntrace*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQuntrace".}
 proc pqsetNoticeReceiver*(conn: PPGconn, theProc: PQnoticeReceiver, arg: pointer): PQnoticeReceiver{.
     cdecl, dynlib: dllName, importc: "PQsetNoticeReceiver".}
-proc pqsetNoticeProcessor*(conn: PPGconn, theProc: PQnoticeProcessor, 
-                           arg: pointer): PQnoticeProcessor{.cdecl, 
+proc pqsetNoticeProcessor*(conn: PPGconn, theProc: PQnoticeProcessor,
+                           arg: pointer): PQnoticeProcessor{.cdecl,
     dynlib: dllName, importc: "PQsetNoticeProcessor".}
-proc pqexec*(conn: PPGconn, query: cstring): PPGresult{.cdecl, dynlib: dllName, 
+proc pqexec*(conn: PPGconn, query: cstring): PPGresult{.cdecl, dynlib: dllName,
     importc: "PQexec".}
-proc pqexecParams*(conn: PPGconn, command: cstring, nParams: int32, 
-                   paramTypes: POid, paramValues: cstringArray, 
+proc pqexecParams*(conn: PPGconn, command: cstring, nParams: int32,
+                   paramTypes: POid, paramValues: cstringArray,
                    paramLengths, paramFormats: ptr int32, resultFormat: int32): PPGresult{.
     cdecl, dynlib: dllName, importc: "PQexecParams".}
 proc pqprepare*(conn: PPGconn, stmtName, query: cstring, nParams: int32,
@@ -222,87 +231,87 @@ proc pqexecPrepared*(conn: PPGconn, stmtName: cstring, nParams: int32,
                      paramValues: cstringArray,
                      paramLengths, paramFormats: ptr int32, resultFormat: int32): PPGresult{.
     cdecl, dynlib: dllName, importc: "PQexecPrepared".}
-proc pqsendQuery*(conn: PPGconn, query: cstring): int32{.cdecl, dynlib: dllName, 
+proc pqsendQuery*(conn: PPGconn, query: cstring): int32{.cdecl, dynlib: dllName,
     importc: "PQsendQuery".}
-proc pqsendQueryParams*(conn: PPGconn, command: cstring, nParams: int32, 
-                        paramTypes: POid, paramValues: cstringArray, 
-                        paramLengths, paramFormats: ptr int32, 
-                        resultFormat: int32): int32{.cdecl, dynlib: dllName, 
+proc pqsendQueryParams*(conn: PPGconn, command: cstring, nParams: int32,
+                        paramTypes: POid, paramValues: cstringArray,
+                        paramLengths, paramFormats: ptr int32,
+                        resultFormat: int32): int32{.cdecl, dynlib: dllName,
     importc: "PQsendQueryParams".}
-proc pqsendQueryPrepared*(conn: PPGconn, stmtName: cstring, nParams: int32, 
-                          paramValues: cstringArray, 
-                          paramLengths, paramFormats: ptr int32, 
-                          resultFormat: int32): int32{.cdecl, dynlib: dllName, 
+proc pqsendQueryPrepared*(conn: PPGconn, stmtName: cstring, nParams: int32,
+                          paramValues: cstringArray,
+                          paramLengths, paramFormats: ptr int32,
+                          resultFormat: int32): int32{.cdecl, dynlib: dllName,
     importc: "PQsendQueryPrepared".}
-proc pqgetResult*(conn: PPGconn): PPGresult{.cdecl, dynlib: dllName, 
+proc pqgetResult*(conn: PPGconn): PPGresult{.cdecl, dynlib: dllName,
     importc: "PQgetResult".}
-proc pqisBusy*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqisBusy*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
                                       importc: "PQisBusy".}
-proc pqconsumeInput*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqconsumeInput*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQconsumeInput".}
-proc pqnotifies*(conn: PPGconn): PPGnotify{.cdecl, dynlib: dllName, 
+proc pqnotifies*(conn: PPGconn): PPGnotify{.cdecl, dynlib: dllName,
     importc: "PQnotifies".}
 proc pqputCopyData*(conn: PPGconn, buffer: cstring, nbytes: int32): int32{.
     cdecl, dynlib: dllName, importc: "PQputCopyData".}
-proc pqputCopyEnd*(conn: PPGconn, errormsg: cstring): int32{.cdecl, 
+proc pqputCopyEnd*(conn: PPGconn, errormsg: cstring): int32{.cdecl,
     dynlib: dllName, importc: "PQputCopyEnd".}
 proc pqgetCopyData*(conn: PPGconn, buffer: cstringArray, async: int32): int32{.
     cdecl, dynlib: dllName, importc: "PQgetCopyData".}
-proc pqgetline*(conn: PPGconn, str: cstring, len: int32): int32{.cdecl, 
+proc pqgetline*(conn: PPGconn, str: cstring, len: int32): int32{.cdecl,
     dynlib: dllName, importc: "PQgetline".}
-proc pqputline*(conn: PPGconn, str: cstring): int32{.cdecl, dynlib: dllName, 
+proc pqputline*(conn: PPGconn, str: cstring): int32{.cdecl, dynlib: dllName,
     importc: "PQputline".}
 proc pqgetlineAsync*(conn: PPGconn, buffer: cstring, bufsize: int32): int32{.
     cdecl, dynlib: dllName, importc: "PQgetlineAsync".}
-proc pqputnbytes*(conn: PPGconn, buffer: cstring, nbytes: int32): int32{.cdecl, 
+proc pqputnbytes*(conn: PPGconn, buffer: cstring, nbytes: int32): int32{.cdecl,
     dynlib: dllName, importc: "PQputnbytes".}
-proc pqendcopy*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqendcopy*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
                                        importc: "PQendcopy".}
-proc pqsetnonblocking*(conn: PPGconn, arg: int32): int32{.cdecl, 
+proc pqsetnonblocking*(conn: PPGconn, arg: int32): int32{.cdecl,
     dynlib: dllName, importc: "PQsetnonblocking".}
-proc pqisnonblocking*(conn: PPGconn): int32{.cdecl, dynlib: dllName, 
+proc pqisnonblocking*(conn: PPGconn): int32{.cdecl, dynlib: dllName,
     importc: "PQisnonblocking".}
 proc pqflush*(conn: PPGconn): int32{.cdecl, dynlib: dllName, importc: "PQflush".}
-proc pqfn*(conn: PPGconn, fnid: int32, result_buf, result_len: ptr int32, 
+proc pqfn*(conn: PPGconn, fnid: int32, result_buf, result_len: ptr int32,
            result_is_int: int32, args: PPQArgBlock, nargs: int32): PPGresult{.
     cdecl, dynlib: dllName, importc: "PQfn".}
-proc pqresultStatus*(res: PPGresult): ExecStatusType{.cdecl, dynlib: dllName, 
+proc pqresultStatus*(res: PPGresult): ExecStatusType{.cdecl, dynlib: dllName,
     importc: "PQresultStatus".}
-proc pqresStatus*(status: ExecStatusType): cstring{.cdecl, dynlib: dllName, 
+proc pqresStatus*(status: ExecStatusType): cstring{.cdecl, dynlib: dllName,
     importc: "PQresStatus".}
-proc pqresultErrorMessage*(res: PPGresult): cstring{.cdecl, dynlib: dllName, 
+proc pqresultErrorMessage*(res: PPGresult): cstring{.cdecl, dynlib: dllName,
     importc: "PQresultErrorMessage".}
-proc pqresultErrorField*(res: PPGresult, fieldcode: int32): cstring{.cdecl, 
+proc pqresultErrorField*(res: PPGresult, fieldcode: int32): cstring{.cdecl,
     dynlib: dllName, importc: "PQresultErrorField".}
-proc pqntuples*(res: PPGresult): int32{.cdecl, dynlib: dllName, 
+proc pqntuples*(res: PPGresult): int32{.cdecl, dynlib: dllName,
                                         importc: "PQntuples".}
-proc pqnfields*(res: PPGresult): int32{.cdecl, dynlib: dllName, 
+proc pqnfields*(res: PPGresult): int32{.cdecl, dynlib: dllName,
                                         importc: "PQnfields".}
-proc pqbinaryTuples*(res: PPGresult): int32{.cdecl, dynlib: dllName, 
+proc pqbinaryTuples*(res: PPGresult): int32{.cdecl, dynlib: dllName,
     importc: "PQbinaryTuples".}
-proc pqfname*(res: PPGresult, field_num: int32): cstring{.cdecl, 
+proc pqfname*(res: PPGresult, field_num: int32): cstring{.cdecl,
     dynlib: dllName, importc: "PQfname".}
-proc pqfnumber*(res: PPGresult, field_name: cstring): int32{.cdecl, 
+proc pqfnumber*(res: PPGresult, field_name: cstring): int32{.cdecl,
     dynlib: dllName, importc: "PQfnumber".}
-proc pqftable*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName, 
+proc pqftable*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName,
     importc: "PQftable".}
-proc pqftablecol*(res: PPGresult, field_num: int32): int32{.cdecl, 
+proc pqftablecol*(res: PPGresult, field_num: int32): int32{.cdecl,
     dynlib: dllName, importc: "PQftablecol".}
-proc pqfformat*(res: PPGresult, field_num: int32): int32{.cdecl, 
+proc pqfformat*(res: PPGresult, field_num: int32): int32{.cdecl,
     dynlib: dllName, importc: "PQfformat".}
-proc pqftype*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName, 
+proc pqftype*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName,
     importc: "PQftype".}
-proc pqfsize*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName, 
+proc pqfsize*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName,
     importc: "PQfsize".}
-proc pqfmod*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName, 
+proc pqfmod*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName,
     importc: "PQfmod".}
-proc pqcmdStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName, 
+proc pqcmdStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName,
     importc: "PQcmdStatus".}
-proc pqoidStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName, 
+proc pqoidStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName,
     importc: "PQoidStatus".}
-proc pqoidValue*(res: PPGresult): Oid{.cdecl, dynlib: dllName, 
+proc pqoidValue*(res: PPGresult): Oid{.cdecl, dynlib: dllName,
                                        importc: "PQoidValue".}
-proc pqcmdTuples*(res: PPGresult): cstring{.cdecl, dynlib: dllName, 
+proc pqcmdTuples*(res: PPGresult): cstring{.cdecl, dynlib: dllName,
     importc: "PQcmdTuples".}
 proc pqgetvalue*(res: PPGresult, tup_num: int32, field_num: int32): cstring{.
     cdecl, dynlib: dllName, importc: "PQgetvalue".}
@@ -314,23 +323,23 @@ proc pqclear*(res: PPGresult){.cdecl, dynlib: dllName, importc: "PQclear".}
 proc pqfreemem*(p: pointer){.cdecl, dynlib: dllName, importc: "PQfreemem".}
 proc pqmakeEmptyPGresult*(conn: PPGconn, status: ExecStatusType): PPGresult{.
     cdecl, dynlib: dllName, importc: "PQmakeEmptyPGresult".}
-proc pqescapeString*(till, `from`: cstring, len: int): int{.cdecl, 
+proc pqescapeString*(till, `from`: cstring, len: int): int{.cdecl,
     dynlib: dllName, importc: "PQescapeString".}
 proc pqescapeBytea*(bintext: cstring, binlen: int, bytealen: var int): cstring{.
     cdecl, dynlib: dllName, importc: "PQescapeBytea".}
-proc pqunescapeBytea*(strtext: cstring, retbuflen: var int): cstring{.cdecl, 
+proc pqunescapeBytea*(strtext: cstring, retbuflen: var int): cstring{.cdecl,
     dynlib: dllName, importc: "PQunescapeBytea".}
-proc pqprint*(fout: File, res: PPGresult, ps: PPQprintOpt){.cdecl, 
+proc pqprint*(fout: File, res: PPGresult, ps: PPQprintOpt){.cdecl,
     dynlib: dllName, importc: "PQprint".}
-proc pqdisplayTuples*(res: PPGresult, fp: File, fillAlign: int32, 
+proc pqdisplayTuples*(res: PPGresult, fp: File, fillAlign: int32,
                       fieldSep: cstring, printHeader: int32, quiet: int32){.
     cdecl, dynlib: dllName, importc: "PQdisplayTuples".}
-proc pqprintTuples*(res: PPGresult, fout: File, printAttName: int32, 
-                    terseOutput: int32, width: int32){.cdecl, dynlib: dllName, 
+proc pqprintTuples*(res: PPGresult, fout: File, printAttName: int32,
+                    terseOutput: int32, width: int32){.cdecl, dynlib: dllName,
     importc: "PQprintTuples".}
-proc lo_open*(conn: PPGconn, lobjId: Oid, mode: int32): int32{.cdecl, 
+proc lo_open*(conn: PPGconn, lobjId: Oid, mode: int32): int32{.cdecl,
     dynlib: dllName, importc: "lo_open".}
-proc lo_close*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName, 
+proc lo_close*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName,
     importc: "lo_close".}
 proc lo_read*(conn: PPGconn, fd: int32, buf: cstring, length: int): int32{.
     cdecl, dynlib: dllName, importc: "lo_read".}
@@ -338,18 +347,18 @@ proc lo_write*(conn: PPGconn, fd: int32, buf: cstring, length: int): int32{.
     cdecl, dynlib: dllName, importc: "lo_write".}
 proc lo_lseek*(conn: PPGconn, fd: int32, offset: int32, whence: int32): int32{.
     cdecl, dynlib: dllName, importc: "lo_lseek".}
-proc lo_creat*(conn: PPGconn, mode: int32): Oid{.cdecl, dynlib: dllName, 
+proc lo_creat*(conn: PPGconn, mode: int32): Oid{.cdecl, dynlib: dllName,
     importc: "lo_creat".}
-proc lo_tell*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName, 
+proc lo_tell*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName,
     importc: "lo_tell".}
-proc lo_unlink*(conn: PPGconn, lobjId: Oid): int32{.cdecl, dynlib: dllName, 
+proc lo_unlink*(conn: PPGconn, lobjId: Oid): int32{.cdecl, dynlib: dllName,
     importc: "lo_unlink".}
-proc lo_import*(conn: PPGconn, filename: cstring): Oid{.cdecl, dynlib: dllName, 
+proc lo_import*(conn: PPGconn, filename: cstring): Oid{.cdecl, dynlib: dllName,
     importc: "lo_import".}
-proc lo_export*(conn: PPGconn, lobjId: Oid, filename: cstring): int32{.cdecl, 
+proc lo_export*(conn: PPGconn, lobjId: Oid, filename: cstring): int32{.cdecl,
     dynlib: dllName, importc: "lo_export".}
-proc pqmblen*(s: cstring, encoding: int32): int32{.cdecl, dynlib: dllName, 
+proc pqmblen*(s: cstring, encoding: int32): int32{.cdecl, dynlib: dllName,
     importc: "PQmblen".}
 proc pqenv2encoding*(): int32{.cdecl, dynlib: dllName, importc: "PQenv2encoding".}
-proc pqsetdb(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): PPgConn = 
+proc pqsetdb(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): PPgConn =
   result = pqSetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, "", "")
diff --git a/lib/wrappers/readline/history.nim b/lib/wrappers/readline/history.nim
deleted file mode 100644
index 610c76a62..000000000
--- a/lib/wrappers/readline/history.nim
+++ /dev/null
@@ -1,279 +0,0 @@
-# history.h -- the names of functions that you can call in history. 
-# Copyright (C) 1989-2009 Free Software Foundation, Inc.
-#
-#   This file contains the GNU History Library (History), a set of
-#   routines for managing the text of previously typed lines.
-#
-#   History is free software: you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation, either version 3 of the License, or
-#   (at your option) any later version.
-#
-#   History is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with History.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-{.deadCodeElim: on.}
-
-import readline
-
-const 
-  historyDll = readlineDll
-
-import times, rltypedefs
-
-type 
-  Histdata* = pointer
-{.deprecated: [Thistdata: Histdata].}
-
-# The structure used to store a history entry. 
-
-type 
-  HIST_ENTRY*{.pure, final.} = object 
-    line*: cstring
-    timestamp*: cstring       # char * rather than time_t for read/write 
-    data*: Histdata
-{.deprecated: [THIST_ENTRY: HIST_ENTRY].}
-
-# Size of the history-library-managed space in history entry HS. 
-
-template HISTENT_BYTES*(hs: expr): expr = 
-  (strlen(hs.line) + strlen(hs.timestamp))
-
-# A structure used to pass the current state of the history stuff around. 
-
-type 
-  HISTORY_STATE*{.pure, final.} = object 
-    entries*: ptr ptr HIST_ENTRY # Pointer to the entries themselves. 
-    offset*: cint             # The location pointer within this array. 
-    length*: cint             # Number of elements within this array. 
-    size*: cint               # Number of slots allocated to this array. 
-    flags*: cint
-{.deprecated: [THISTORY_STATE: HISTORY_STATE].}
-
-
-# Flag values for the `flags' member of HISTORY_STATE. 
-
-const 
-  HS_STIFLED* = 0x00000001
-
-# Initialization and state management. 
-# Begin a session in which the history functions might be used.  This
-#   just initializes the interactive variables. 
-
-proc using_history*(){.cdecl, importc: "using_history", dynlib: historyDll.}
-# Return the current HISTORY_STATE of the history. 
-
-proc history_get_history_state*(): ptr HISTORY_STATE{.cdecl, 
-    importc: "history_get_history_state", dynlib: historyDll.}
-# Set the state of the current history array to STATE. 
-
-proc history_set_history_state*(a2: ptr HISTORY_STATE){.cdecl, 
-    importc: "history_set_history_state", dynlib: historyDll.}
-# Manage the history list. 
-# Place STRING at the end of the history list.
-#   The associated data field (if any) is set to NULL. 
-
-proc add_history*(a2: cstring){.cdecl, importc: "add_history", 
-                                dynlib: historyDll.}
-# Change the timestamp associated with the most recent history entry to
-#   STRING. 
-
-proc add_history_time*(a2: cstring){.cdecl, importc: "add_history_time", 
-                                     dynlib: historyDll.}
-# A reasonably useless function, only here for completeness.  WHICH
-#   is the magic number that tells us which element to delete.  The
-#   elements are numbered from 0. 
-
-proc remove_history*(a2: cint): ptr HIST_ENTRY{.cdecl, 
-    importc: "remove_history", dynlib: historyDll.}
-# Free the history entry H and return any application-specific data
-#   associated with it. 
-
-proc free_history_entry*(a2: ptr HIST_ENTRY): Histdata{.cdecl, 
-    importc: "free_history_entry", dynlib: historyDll.}
-# Make the history entry at WHICH have LINE and DATA.  This returns
-#   the old entry so you can dispose of the data.  In the case of an
-#   invalid WHICH, a NULL pointer is returned. 
-
-proc replace_history_entry*(a2: cint, a3: cstring, a4: Histdata): ptr HIST_ENTRY{.
-    cdecl, importc: "replace_history_entry", dynlib: historyDll.}
-# Clear the history list and start over. 
-
-proc clear_history*(){.cdecl, importc: "clear_history", dynlib: historyDll.}
-# Stifle the history list, remembering only MAX number of entries. 
-
-proc stifle_history*(a2: cint){.cdecl, importc: "stifle_history", 
-                                dynlib: historyDll.}
-# Stop stifling the history.  This returns the previous amount the
-#   history was stifled by.  The value is positive if the history was
-#   stifled, negative if it wasn't. 
-
-proc unstifle_history*(): cint{.cdecl, importc: "unstifle_history", 
-                                dynlib: historyDll.}
-# Return 1 if the history is stifled, 0 if it is not. 
-
-proc history_is_stifled*(): cint{.cdecl, importc: "history_is_stifled", 
-                                  dynlib: historyDll.}
-# Information about the history list. 
-# Return a NULL terminated array of HIST_ENTRY which is the current input
-#   history.  Element 0 of this list is the beginning of time.  If there
-#   is no history, return NULL. 
-
-proc history_list*(): ptr ptr HIST_ENTRY{.cdecl, importc: "history_list", 
-    dynlib: historyDll.}
-# Returns the number which says what history element we are now
-#   looking at.  
-
-proc where_history*(): cint{.cdecl, importc: "where_history", dynlib: historyDll.}
-# Return the history entry at the current position, as determined by
-#   history_offset.  If there is no entry there, return a NULL pointer. 
-
-proc current_history*(): ptr HIST_ENTRY{.cdecl, importc: "current_history", 
-    dynlib: historyDll.}
-# Return the history entry which is logically at OFFSET in the history
-#   array.  OFFSET is relative to history_base. 
-
-proc history_get*(a2: cint): ptr HIST_ENTRY{.cdecl, importc: "history_get", 
-    dynlib: historyDll.}
-# Return the timestamp associated with the HIST_ENTRY * passed as an
-#   argument 
-
-proc history_get_time*(a2: ptr HIST_ENTRY): Time{.cdecl, 
-    importc: "history_get_time", dynlib: historyDll.}
-# Return the number of bytes that the primary history entries are using.
-#   This just adds up the lengths of the_history->lines. 
-
-proc history_total_bytes*(): cint{.cdecl, importc: "history_total_bytes", 
-                                   dynlib: historyDll.}
-# Moving around the history list. 
-# Set the position in the history list to POS. 
-
-proc history_set_pos*(a2: cint): cint{.cdecl, importc: "history_set_pos", 
-                                       dynlib: historyDll.}
-# Back up history_offset to the previous history entry, and return
-#   a pointer to that entry.  If there is no previous entry, return
-#   a NULL pointer. 
-
-proc previous_history*(): ptr HIST_ENTRY{.cdecl, importc: "previous_history", 
-    dynlib: historyDll.}
-# Move history_offset forward to the next item in the input_history,
-#   and return the a pointer to that entry.  If there is no next entry,
-#   return a NULL pointer. 
-
-proc next_history*(): ptr HIST_ENTRY{.cdecl, importc: "next_history", 
-                                       dynlib: historyDll.}
-# Searching the history list. 
-# Search the history for STRING, starting at history_offset.
-#   If DIRECTION < 0, then the search is through previous entries,
-#   else through subsequent.  If the string is found, then
-#   current_history () is the history entry, and the value of this function
-#   is the offset in the line of that history entry that the string was
-#   found in.  Otherwise, nothing is changed, and a -1 is returned. 
-
-proc history_search*(a2: cstring, a3: cint): cint{.cdecl, 
-    importc: "history_search", dynlib: historyDll.}
-# Search the history for STRING, starting at history_offset.
-#   The search is anchored: matching lines must begin with string.
-#   DIRECTION is as in history_search(). 
-
-proc history_search_prefix*(a2: cstring, a3: cint): cint{.cdecl, 
-    importc: "history_search_prefix", dynlib: historyDll.}
-# Search for STRING in the history list, starting at POS, an
-#   absolute index into the list.  DIR, if negative, says to search
-#   backwards from POS, else forwards.
-#   Returns the absolute index of the history element where STRING
-#   was found, or -1 otherwise. 
-
-proc history_search_pos*(a2: cstring, a3: cint, a4: cint): cint{.cdecl, 
-    importc: "history_search_pos", dynlib: historyDll.}
-# Managing the history file. 
-# Add the contents of FILENAME to the history list, a line at a time.
-#   If FILENAME is NULL, then read from ~/.history.  Returns 0 if
-#   successful, or errno if not. 
-
-proc read_history*(a2: cstring): cint{.cdecl, importc: "read_history", 
-                                       dynlib: historyDll.}
-# Read a range of lines from FILENAME, adding them to the history list.
-#   Start reading at the FROM'th line and end at the TO'th.  If FROM
-#   is zero, start at the beginning.  If TO is less than FROM, read
-#   until the end of the file.  If FILENAME is NULL, then read from
-#   ~/.history.  Returns 0 if successful, or errno if not. 
-
-proc read_history_range*(a2: cstring, a3: cint, a4: cint): cint{.cdecl, 
-    importc: "read_history_range", dynlib: historyDll.}
-# Write the current history to FILENAME.  If FILENAME is NULL,
-#   then write the history list to ~/.history.  Values returned
-#   are as in read_history ().  
-
-proc write_history*(a2: cstring): cint{.cdecl, importc: "write_history", 
-                                        dynlib: historyDll.}
-# Append NELEMENT entries to FILENAME.  The entries appended are from
-#   the end of the list minus NELEMENTs up to the end of the list. 
-
-proc append_history*(a2: cint, a3: cstring): cint{.cdecl, 
-    importc: "append_history", dynlib: historyDll.}
-# Truncate the history file, leaving only the last NLINES lines. 
-
-proc history_truncate_file*(a2: cstring, a3: cint): cint{.cdecl, 
-    importc: "history_truncate_file", dynlib: historyDll.}
-# History expansion. 
-# Expand the string STRING, placing the result into OUTPUT, a pointer
-#   to a string.  Returns:
-#
-#   0) If no expansions took place (or, if the only change in
-#      the text was the de-slashifying of the history expansion
-#      character)
-#   1) If expansions did take place
-#  -1) If there was an error in expansion.
-#   2) If the returned line should just be printed.
-#
-#  If an error occurred in expansion, then OUTPUT contains a descriptive
-#  error message. 
-
-proc history_expand*(a2: cstring, a3: cstringArray): cint{.cdecl, 
-    importc: "history_expand", dynlib: historyDll.}
-# Extract a string segment consisting of the FIRST through LAST
-#   arguments present in STRING.  Arguments are broken up as in
-#   the shell. 
-
-proc history_arg_extract*(a2: cint, a3: cint, a4: cstring): cstring{.cdecl, 
-    importc: "history_arg_extract", dynlib: historyDll.}
-# Return the text of the history event beginning at the current
-#   offset into STRING.  Pass STRING with *INDEX equal to the
-#   history_expansion_char that begins this specification.
-#   DELIMITING_QUOTE is a character that is allowed to end the string
-#   specification for what to search for in addition to the normal
-#   characters `:', ` ', `\t', `\n', and sometimes `?'. 
-
-proc get_history_event*(a2: cstring, a3: ptr cint, a4: cint): cstring{.cdecl, 
-    importc: "get_history_event", dynlib: historyDll.}
-# Return an array of tokens, much as the shell might.  The tokens are
-#   parsed out of STRING. 
-
-proc history_tokenize*(a2: cstring): cstringArray{.cdecl, 
-    importc: "history_tokenize", dynlib: historyDll.}
-when false: 
-  # Exported history variables. 
-  var history_base*{.importc: "history_base", dynlib: historyDll.}: cint
-  var history_length*{.importc: "history_length", dynlib: historyDll.}: cint
-  var history_max_entries*{.importc: "history_max_entries", dynlib: historyDll.}: cint
-  var history_expansion_char*{.importc: "history_expansion_char", 
-                               dynlib: historyDll.}: char
-  var history_subst_char*{.importc: "history_subst_char", dynlib: historyDll.}: char
-  var history_word_delimiters*{.importc: "history_word_delimiters", 
-                                dynlib: historyDll.}: cstring
-  var history_comment_char*{.importc: "history_comment_char", dynlib: historyDll.}: char
-  var history_no_expand_chars*{.importc: "history_no_expand_chars", 
-                                dynlib: historyDll.}: cstring
-  var history_search_delimiter_chars*{.importc: "history_search_delimiter_chars", 
-                                       dynlib: historyDll.}: cstring
-  var history_quotes_inhibit_expansion*{.
-      importc: "history_quotes_inhibit_expansion", dynlib: historyDll.}: cint
-  var history_write_timestamps*{.importc: "history_write_timestamps", 
-                                 dynlib: historyDll.}: cint
diff --git a/lib/wrappers/readline/readline.nim b/lib/wrappers/readline/readline.nim
deleted file mode 100644
index 652808576..000000000
--- a/lib/wrappers/readline/readline.nim
+++ /dev/null
@@ -1,1209 +0,0 @@
-# Readline.h -- the names of functions callable from within readline. 
-# Copyright (C) 1987-2009 Free Software Foundation, Inc.
-#
-#   This file is part of the GNU Readline Library (Readline), a library
-#   for reading lines of text with interactive input and history editing.      
-#
-#   Readline is free software: you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation, either version 3 of the License, or
-#   (at your option) any later version.
-#
-#   Readline is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-{.deadCodeElim: on.}
-when defined(windows): 
-  const 
-    readlineDll* = "readline.dll"
-elif defined(macosx): 
-  # Mac OS X ships with 'libedit'
-  const 
-    readlineDll* = "libedit(.2|.1|).dylib"
-else: 
-  const 
-    readlineDll* = "libreadline.so.6(|.0)"
-#  mangle "'CommandFunc'" CommandFunc
-#  mangle TvcpFunc TvcpFunc
-
-import rltypedefs
-
-# Some character stuff. 
-
-const 
-  control_character_threshold* = 0x00000020 # Smaller than this is control. 
-  control_character_mask* = 0x0000001F # 0x20 - 1 
-  meta_character_threshold* = 0x0000007F # Larger than this is Meta. 
-  control_character_bit* = 0x00000040 # 0x000000, must be off. 
-  meta_character_bit* = 0x00000080 # x0000000, must be on. 
-  largest_char* = 255         # Largest character value. 
-
-template CTRL_CHAR*(c: expr): expr = 
-  (c < control_character_threshold and ((c and 0x00000080) == 0))
-
-template META_CHAR*(c: expr): expr = 
-  (c > meta_character_threshold and c <= largest_char)
-
-template CTRL*(c: expr): expr = 
-  (c and control_character_mask)
-
-template META*(c: expr): expr = 
-  (c or meta_character_bit)
-
-template UNMETA*(c: expr): expr = 
-  (c and not meta_character_bit)
-
-template UNCTRL*(c: expr): expr = 
-  (c or 32 or control_character_bit)
-
-# Beware:  these only work with single-byte ASCII characters. 
-
-const 
-  RETURN_CHAR* = CTRL('M'.ord)
-  RUBOUT_CHAR* = 0x0000007F
-  ABORT_CHAR* = CTRL('G'.ord)
-  PAGE_CHAR* = CTRL('L'.ord)
-  ESC_CHAR* = CTRL('['.ord)
-
-# A keymap contains one entry for each key in the ASCII set.
-#   Each entry consists of a type and a pointer.
-#   FUNCTION is the address of a function to run, or the
-#   address of a keymap to indirect through.
-#   TYPE says which kind of thing FUNCTION is. 
-
-type 
-  KEYMAP_ENTRY*{.pure, final.} = object 
-    typ*: char
-    function*: CommandFunc
-{.deprecated: [TKEYMAP_ENTRY: KEYMAP_ENTRY].}
-
-
-# This must be large enough to hold bindings for all of the characters
-#   in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x,
-#   and so on) plus one for subsequence matching. 
-
-const 
-  KEYMAP_SIZE* = 257
-  ANYOTHERKEY* = KEYMAP_SIZE - 1
-
-# I wanted to make the above structure contain a union of:
-#   union { rl_TCommandFunc_t *function; struct _keymap_entry *keymap; } value;
-#   but this made it impossible for me to create a static array.
-#   Maybe I need C lessons. 
-
-type 
-  KEYMAP_ENTRY_ARRAY* = array[0..KEYMAP_SIZE - 1, KEYMAP_ENTRY]
-  PKeymap* = ptr KEYMAP_ENTRY
-{.deprecated: [TKEYMAP_ENTRY_ARRAY: KEYMAP_ENTRY_ARRAY].}
-
-# The values that TYPE can have in a keymap entry. 
-
-const 
-  ISFUNC* = 0
-  ISKMAP* = 1
-  ISMACR* = 2
-
-when false: 
-  var 
-    emacs_standard_keymap*{.importc: "emacs_standard_keymap", 
-                            dynlib: readlineDll.}: KEYMAP_ENTRY_ARRAY
-    emacs_meta_keymap*{.importc: "emacs_meta_keymap", dynlib: readlineDll.}: KEYMAP_ENTRY_ARRAY
-    emacs_ctlx_keymap*{.importc: "emacs_ctlx_keymap", dynlib: readlineDll.}: KEYMAP_ENTRY_ARRAY
-  var 
-    vi_insertion_keymap*{.importc: "vi_insertion_keymap", dynlib: readlineDll.}: KEYMAP_ENTRY_ARRAY
-    vi_movement_keymap*{.importc: "vi_movement_keymap", dynlib: readlineDll.}: KEYMAP_ENTRY_ARRAY
-# Return a new, empty keymap.
-#   Free it with free() when you are done. 
-
-proc make_bare_keymap*(): PKeymap{.cdecl, importc: "rl_make_bare_keymap", 
-                                   dynlib: readlineDll.}
-# Return a new keymap which is a copy of MAP. 
-
-proc copy_keymap*(a2: PKeymap): PKeymap{.cdecl, importc: "rl_copy_keymap", 
-    dynlib: readlineDll.}
-# Return a new keymap with the printing characters bound to rl_insert,
-#   the lowercase Meta characters bound to run their equivalents, and
-#   the Meta digits bound to produce numeric arguments. 
-
-proc make_keymap*(): PKeymap{.cdecl, importc: "rl_make_keymap", 
-                              dynlib: readlineDll.}
-# Free the storage associated with a keymap. 
-
-proc discard_keymap*(a2: PKeymap){.cdecl, importc: "rl_discard_keymap", 
-                                   dynlib: readlineDll.}
-# These functions actually appear in bind.c 
-# Return the keymap corresponding to a given name.  Names look like
-#   `emacs' or `emacs-meta' or `vi-insert'.  
-
-proc get_keymap_by_name*(a2: cstring): PKeymap{.cdecl, 
-    importc: "rl_get_keymap_by_name", dynlib: readlineDll.}
-# Return the current keymap. 
-
-proc get_keymap*(): PKeymap{.cdecl, importc: "rl_get_keymap", 
-                             dynlib: readlineDll.}
-# Set the current keymap to MAP. 
-
-proc set_keymap*(a2: PKeymap){.cdecl, importc: "rl_set_keymap", 
-                               dynlib: readlineDll.}
-
-const 
-  tildeDll = readlineDll
-
-type 
-  Hook_func* = proc (a2: cstring): cstring{.cdecl.}
-{.deprecated: [Thook_func: Hook_func].}
-
-when not defined(macosx):
-  # If non-null, this contains the address of a function that the application
-  #   wants called before trying the standard tilde expansions.  The function
-  #   is called with the text sans tilde, and returns a malloc()'ed string
-  #   which is the expansion, or a NULL pointer if the expansion fails. 
-
-  var expansion_preexpansion_hook*{.importc: "tilde_expansion_preexpansion_hook", 
-                                    dynlib: tildeDll.}: Hook_func
-
-  # If non-null, this contains the address of a function to call if the
-  #   standard meaning for expanding a tilde fails.  The function is called
-  #   with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
-  #   which is the expansion, or a NULL pointer if there is no expansion. 
-
-  var expansion_failure_hook*{.importc: "tilde_expansion_failure_hook", 
-                               dynlib: tildeDll.}: Hook_func
-
-  # When non-null, this is a NULL terminated array of strings which
-  #   are duplicates for a tilde prefix.  Bash uses this to expand
-  #   `=~' and `:~'. 
-
-  var additional_prefixes*{.importc: "tilde_additional_prefixes", dynlib: tildeDll.}: cstringArray
-
-  # When non-null, this is a NULL terminated array of strings which match
-  #   the end of a username, instead of just "/".  Bash sets this to
-  #   `:' and `=~'. 
-
-  var additional_suffixes*{.importc: "tilde_additional_suffixes", dynlib: tildeDll.}: cstringArray
-
-# Return a new string which is the result of tilde expanding STRING. 
-
-proc expand*(a2: cstring): cstring{.cdecl, importc: "tilde_expand", 
-                                    dynlib: tildeDll.}
-# Do the work of tilde expansion on FILENAME.  FILENAME starts with a
-#   tilde.  If there is no expansion, call tilde_expansion_failure_hook. 
-
-proc expand_word*(a2: cstring): cstring{.cdecl, importc: "tilde_expand_word", 
-    dynlib: tildeDll.}
-# Find the portion of the string beginning with ~ that should be expanded. 
-
-proc find_word*(a2: cstring, a3: cint, a4: ptr cint): cstring{.cdecl, 
-    importc: "tilde_find_word", dynlib: tildeDll.}
-
-# Hex-encoded Readline version number. 
-
-const 
-  READLINE_VERSION* = 0x00000600 # Readline 6.0 
-  VERSION_MAJOR* = 6
-  VERSION_MINOR* = 0
-
-# Readline data structures. 
-# Maintaining the state of undo.  We remember individual deletes and inserts
-#   on a chain of things to do. 
-# The actions that undo knows how to undo.  Notice that UNDO_DELETE means
-#   to insert some text, and UNDO_INSERT means to delete some text.   I.e.,
-#   the code tells undo what to undo, not how to undo it. 
-
-type 
-  Undo_code* = enum 
-    UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END
-{.deprecated: [Tundo_code: Undo_code].}
-
-# What an element of THE_UNDO_LIST looks like. 
-
-type 
-  UNDO_LIST*{.pure, final.} = object 
-    next*: ptr UNDO_LIST
-    start*: cint
-    theEnd*: cint             # Where the change took place. 
-    text*: cstring            # The text to insert, if undoing a delete. 
-    what*: Undo_code          # Delete, Insert, Begin, End. 
-{.deprecated: [TUNDO_LIST: UNDO_LIST].}
-  
-
-# The current undo list for RL_LINE_BUFFER. 
-
-when not defined(macosx):
-  var undo_list*{.importc: "rl_undo_list", dynlib: readlineDll.}: ptr UNDO_LIST
-
-# The data structure for mapping textual names to code addresses. 
-
-type 
-  FUNMAP*{.pure, final.} = object 
-    name*: cstring
-    function*: CommandFunc
-{.deprecated: [TFUNMAP: FUNMAP].}
-
-
-when not defined(macosx):
-  var funmap*{.importc: "funmap", dynlib: readlineDll.}: ptr ptr FUNMAP
-
-# **************************************************************** 
-#								    
-#	     Functions available to bind to key sequences	    
-#								    
-# **************************************************************** 
-# Bindable commands for numeric arguments. 
-
-proc digit_argument*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_digit_argument", dynlib: readlineDll.}
-proc universal_argument*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_universal_argument", dynlib: readlineDll.}
-# Bindable commands for moving the cursor. 
-
-proc forward_byte*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_forward_byte", 
-    dynlib: readlineDll.}
-proc forward_char*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_forward_char", 
-    dynlib: readlineDll.}
-proc forward*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_forward", 
-    dynlib: readlineDll.}
-proc backward_byte*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_byte", dynlib: readlineDll.}
-proc backward_char*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_char", dynlib: readlineDll.}
-proc backward*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_backward", 
-    dynlib: readlineDll.}
-proc beg_of_line*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_beg_of_line", 
-    dynlib: readlineDll.}
-proc end_of_line*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_end_of_line", 
-    dynlib: readlineDll.}
-proc forward_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_forward_word", 
-    dynlib: readlineDll.}
-proc backward_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_word", dynlib: readlineDll.}
-proc refresh_line*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_refresh_line", 
-    dynlib: readlineDll.}
-proc clear_screen*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_clear_screen", 
-    dynlib: readlineDll.}
-proc skip_csi_sequence*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_skip_csi_sequence", dynlib: readlineDll.}
-proc arrow_keys*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_arrow_keys", 
-    dynlib: readlineDll.}
-# Bindable commands for inserting and deleting text. 
-
-proc insert*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_insert", 
-                                        dynlib: readlineDll.}
-proc quoted_insert*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_quoted_insert", dynlib: readlineDll.}
-proc tab_insert*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_tab_insert", 
-    dynlib: readlineDll.}
-proc newline*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_newline", 
-    dynlib: readlineDll.}
-proc do_lowercase_version*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_do_lowercase_version", dynlib: readlineDll.}
-proc rubout*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_rubout", 
-                                        dynlib: readlineDll.}
-proc delete*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_delete", 
-                                        dynlib: readlineDll.}
-proc rubout_or_delete*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_rubout_or_delete", dynlib: readlineDll.}
-proc delete_horizontal_space*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_delete_horizontal_space", dynlib: readlineDll.}
-proc delete_or_show_completions*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_delete_or_show_completions", dynlib: readlineDll.}
-proc insert_comment*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_insert_comment", dynlib: readlineDll.}
-# Bindable commands for changing case. 
-
-proc upcase_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_upcase_word", 
-    dynlib: readlineDll.}
-proc downcase_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_downcase_word", dynlib: readlineDll.}
-proc capitalize_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_capitalize_word", dynlib: readlineDll.}
-# Bindable commands for transposing characters and words. 
-
-proc transpose_words*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_transpose_words", dynlib: readlineDll.}
-proc transpose_chars*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_transpose_chars", dynlib: readlineDll.}
-# Bindable commands for searching within a line. 
-
-proc char_search*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_char_search", 
-    dynlib: readlineDll.}
-proc backward_char_search*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_char_search", dynlib: readlineDll.}
-# Bindable commands for readline's interface to the command history. 
-
-proc beginning_of_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_beginning_of_history", dynlib: readlineDll.}
-proc end_of_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_end_of_history", dynlib: readlineDll.}
-proc get_next_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_get_next_history", dynlib: readlineDll.}
-proc get_previous_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_get_previous_history", dynlib: readlineDll.}
-# Bindable commands for managing the mark and region. 
-
-proc set_mark*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_set_mark", 
-    dynlib: readlineDll.}
-proc exchange_point_and_mark*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_exchange_point_and_mark", dynlib: readlineDll.}
-# Bindable commands to set the editing mode (emacs or vi). 
-
-proc vi_editing_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_editing_mode", dynlib: readlineDll.}
-proc emacs_editing_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_emacs_editing_mode", dynlib: readlineDll.}
-# Bindable commands to change the insert mode (insert or overwrite) 
-
-proc overwrite_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_overwrite_mode", dynlib: readlineDll.}
-# Bindable commands for managing key bindings. 
-
-proc re_read_init_file*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_re_read_init_file", dynlib: readlineDll.}
-proc dump_functions*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_dump_functions", dynlib: readlineDll.}
-proc dump_macros*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_dump_macros", 
-    dynlib: readlineDll.}
-proc dump_variables*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_dump_variables", dynlib: readlineDll.}
-# Bindable commands for word completion. 
-
-proc complete*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_complete", 
-    dynlib: readlineDll.}
-proc possible_completions*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_possible_completions", dynlib: readlineDll.}
-proc insert_completions*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_insert_completions", dynlib: readlineDll.}
-proc old_menu_complete*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_old_menu_complete", dynlib: readlineDll.}
-proc menu_complete*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_menu_complete", dynlib: readlineDll.}
-proc backward_menu_complete*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_menu_complete", dynlib: readlineDll.}
-# Bindable commands for killing and yanking text, and managing the kill ring. 
-
-proc kill_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_kill_word", 
-    dynlib: readlineDll.}
-proc backward_kill_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_kill_word", dynlib: readlineDll.}
-proc kill_line*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_kill_line", 
-    dynlib: readlineDll.}
-proc backward_kill_line*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_backward_kill_line", dynlib: readlineDll.}
-proc kill_full_line*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_kill_full_line", dynlib: readlineDll.}
-proc unix_word_rubout*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_unix_word_rubout", dynlib: readlineDll.}
-proc unix_filename_rubout*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_unix_filename_rubout", dynlib: readlineDll.}
-proc unix_line_discard*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_unix_line_discard", dynlib: readlineDll.}
-proc copy_region_to_kill*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_copy_region_to_kill", dynlib: readlineDll.}
-proc kill_region*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_kill_region", 
-    dynlib: readlineDll.}
-proc copy_forward_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_copy_forward_word", dynlib: readlineDll.}
-proc copy_backward_word*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_copy_backward_word", dynlib: readlineDll.}
-proc yank*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_yank", 
-                                      dynlib: readlineDll.}
-proc yank_pop*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_yank_pop", 
-    dynlib: readlineDll.}
-proc yank_nth_arg*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_yank_nth_arg", 
-    dynlib: readlineDll.}
-proc yank_last_arg*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_yank_last_arg", dynlib: readlineDll.}
-when defined(Windows): 
-  proc paste_from_clipboard*(a2: cint, a3: cint): cint{.cdecl, 
-      importc: "rl_paste_from_clipboard", dynlib: readlineDll.}
-# Bindable commands for incremental searching. 
-
-proc reverse_search_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_reverse_search_history", dynlib: readlineDll.}
-proc forward_search_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_forward_search_history", dynlib: readlineDll.}
-# Bindable keyboard macro commands. 
-
-proc start_kbd_macro*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_start_kbd_macro", dynlib: readlineDll.}
-proc end_kbd_macro*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_end_kbd_macro", dynlib: readlineDll.}
-proc call_last_kbd_macro*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_call_last_kbd_macro", dynlib: readlineDll.}
-# Bindable undo commands. 
-
-proc revert_line*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_revert_line", 
-    dynlib: readlineDll.}
-proc undo_command*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_undo_command", 
-    dynlib: readlineDll.}
-# Bindable tilde expansion commands. 
-
-proc tilde_expand*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_tilde_expand", 
-    dynlib: readlineDll.}
-# Bindable terminal control commands. 
-
-proc restart_output*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_restart_output", dynlib: readlineDll.}
-proc stop_output*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_stop_output", 
-    dynlib: readlineDll.}
-# Miscellaneous bindable commands. 
-
-proc abort*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_abort", 
-                                       dynlib: readlineDll.}
-proc tty_status*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_tty_status", 
-    dynlib: readlineDll.}
-# Bindable commands for incremental and non-incremental history searching. 
-
-proc history_search_forward*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_history_search_forward", dynlib: readlineDll.}
-proc history_search_backward*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_history_search_backward", dynlib: readlineDll.}
-proc noninc_forward_search*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_noninc_forward_search", dynlib: readlineDll.}
-proc noninc_reverse_search*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_noninc_reverse_search", dynlib: readlineDll.}
-proc noninc_forward_search_again*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_noninc_forward_search_again", dynlib: readlineDll.}
-proc noninc_reverse_search_again*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_noninc_reverse_search_again", dynlib: readlineDll.}
-# Bindable command used when inserting a matching close character. 
-
-proc insert_close*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_insert_close", 
-    dynlib: readlineDll.}
-# Not available unless READLINE_CALLBACKS is defined. 
-
-proc callback_handler_install*(a2: cstring, a3: TvcpFunc){.cdecl, 
-    importc: "rl_callback_handler_install", dynlib: readlineDll.}
-proc callback_read_char*(){.cdecl, importc: "rl_callback_read_char", 
-                            dynlib: readlineDll.}
-proc callback_handler_remove*(){.cdecl, importc: "rl_callback_handler_remove", 
-                                 dynlib: readlineDll.}
-# Things for vi mode. Not available unless readline is compiled -DVI_MODE. 
-# VI-mode bindable commands. 
-
-proc vi_redo*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_redo", 
-    dynlib: readlineDll.}
-proc vi_undo*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_undo", 
-    dynlib: readlineDll.}
-proc vi_yank_arg*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_yank_arg", 
-    dynlib: readlineDll.}
-proc vi_fetch_history*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_fetch_history", dynlib: readlineDll.}
-proc vi_search_again*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_search_again", dynlib: readlineDll.}
-proc vi_search*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_search", 
-    dynlib: readlineDll.}
-proc vi_complete*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_complete", 
-    dynlib: readlineDll.}
-proc vi_tilde_expand*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_tilde_expand", dynlib: readlineDll.}
-proc vi_prev_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_prev_word", 
-    dynlib: readlineDll.}
-proc vi_next_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_next_word", 
-    dynlib: readlineDll.}
-proc vi_end_word*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_end_word", 
-    dynlib: readlineDll.}
-proc vi_insert_beg*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_insert_beg", dynlib: readlineDll.}
-proc vi_append_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_append_mode", dynlib: readlineDll.}
-proc vi_append_eol*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_append_eol", dynlib: readlineDll.}
-proc vi_eof_maybe*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_eof_maybe", 
-    dynlib: readlineDll.}
-proc vi_insertion_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_insertion_mode", dynlib: readlineDll.}
-proc vi_insert_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_insert_mode", dynlib: readlineDll.}
-proc vi_movement_mode*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_movement_mode", dynlib: readlineDll.}
-proc vi_arg_digit*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_arg_digit", 
-    dynlib: readlineDll.}
-proc vi_change_case*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_change_case", dynlib: readlineDll.}
-proc vi_put*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_put", 
-                                        dynlib: readlineDll.}
-proc vi_column*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_column", 
-    dynlib: readlineDll.}
-proc vi_delete_to*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_delete_to", 
-    dynlib: readlineDll.}
-proc vi_change_to*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_change_to", 
-    dynlib: readlineDll.}
-proc vi_yank_to*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_yank_to", 
-    dynlib: readlineDll.}
-proc vi_rubout*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_rubout", 
-    dynlib: readlineDll.}
-proc vi_delete*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_delete", 
-    dynlib: readlineDll.}
-proc vi_back_to_indent*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_back_to_indent", dynlib: readlineDll.}
-proc vi_first_print*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_first_print", dynlib: readlineDll.}
-proc vi_char_search*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_char_search", dynlib: readlineDll.}
-proc vi_match*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_match", 
-    dynlib: readlineDll.}
-proc vi_change_char*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_change_char", dynlib: readlineDll.}
-proc vi_subst*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_subst", 
-    dynlib: readlineDll.}
-proc vi_overstrike*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_overstrike", dynlib: readlineDll.}
-proc vi_overstrike_delete*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_vi_overstrike_delete", dynlib: readlineDll.}
-proc vi_replace*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_replace", 
-    dynlib: readlineDll.}
-proc vi_set_mark*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_set_mark", 
-    dynlib: readlineDll.}
-proc vi_goto_mark*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_goto_mark", 
-    dynlib: readlineDll.}
-# VI-mode utility functions. 
-
-proc vi_check*(): cint{.cdecl, importc: "rl_vi_check", dynlib: readlineDll.}
-proc vi_domove*(a2: cint, a3: ptr cint): cint{.cdecl, importc: "rl_vi_domove", 
-    dynlib: readlineDll.}
-proc vi_bracktype*(a2: cint): cint{.cdecl, importc: "rl_vi_bracktype", 
-                                    dynlib: readlineDll.}
-proc vi_start_inserting*(a2: cint, a3: cint, a4: cint){.cdecl, 
-    importc: "rl_vi_start_inserting", dynlib: readlineDll.}
-# VI-mode pseudo-bindable commands, used as utility functions. 
-
-proc vi_fXWord*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_fWord", 
-    dynlib: readlineDll.}
-proc vi_bXWord*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_bWord", 
-    dynlib: readlineDll.}
-proc vi_eXWord*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_eWord", 
-    dynlib: readlineDll.}
-proc vi_fword*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_fword", 
-    dynlib: readlineDll.}
-proc vi_bword*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_bword", 
-    dynlib: readlineDll.}
-proc vi_eword*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_vi_eword", 
-    dynlib: readlineDll.}
-# **************************************************************** 
-#								    
-#			Well Published Functions		    
-#								    
-# **************************************************************** 
-# Readline functions. 
-# Read a line of input.  Prompt with PROMPT.  A NULL PROMPT means none. 
-
-proc readline*(a2: cstring): cstring{.cdecl, importc: "readline", 
-                                      dynlib: readlineDll.}
-proc free*(mem: cstring) {.importc: "free", nodecl.}
-  ## free the buffer that `readline` returned.
-
-proc set_prompt*(a2: cstring): cint{.cdecl, importc: "rl_set_prompt", 
-                                     dynlib: readlineDll.}
-proc expand_prompt*(a2: cstring): cint{.cdecl, importc: "rl_expand_prompt", 
-                                        dynlib: readlineDll.}
-proc initialize*(): cint{.cdecl, importc: "rl_initialize", dynlib: readlineDll.}
-# Undocumented; unused by readline 
-
-proc discard_argument*(): cint{.cdecl, importc: "rl_discard_argument", 
-                                dynlib: readlineDll.}
-# Utility functions to bind keys to readline commands. 
-
-proc add_defun*(a2: cstring, a3: CommandFunc, a4: cint): cint{.cdecl, 
-    importc: "rl_add_defun", dynlib: readlineDll.}
-proc bind_key*(a2: cint, a3: CommandFunc): cint{.cdecl, 
-    importc: "rl_bind_key", dynlib: readlineDll.}
-proc bind_key_in_map*(a2: cint, a3: CommandFunc, a4: PKeymap): cint{.cdecl, 
-    importc: "rl_bind_key_in_map", dynlib: readlineDll.}
-proc unbind_key*(a2: cint): cint{.cdecl, importc: "rl_unbind_key", 
-                                  dynlib: readlineDll.}
-proc unbind_key_in_map*(a2: cint, a3: PKeymap): cint{.cdecl, 
-    importc: "rl_unbind_key_in_map", dynlib: readlineDll.}
-proc bind_key_if_unbound*(a2: cint, a3: CommandFunc): cint{.cdecl, 
-    importc: "rl_bind_key_if_unbound", dynlib: readlineDll.}
-proc bind_key_if_unbound_in_map*(a2: cint, a3: CommandFunc, a4: PKeymap): cint{.
-    cdecl, importc: "rl_bind_key_if_unbound_in_map", dynlib: readlineDll.}
-proc unbind_function_in_map*(a2: CommandFunc, a3: PKeymap): cint{.cdecl, 
-    importc: "rl_unbind_function_in_map", dynlib: readlineDll.}
-proc unbind_command_in_map*(a2: cstring, a3: PKeymap): cint{.cdecl, 
-    importc: "rl_unbind_command_in_map", dynlib: readlineDll.}
-proc bind_keyseq*(a2: cstring, a3: CommandFunc): cint{.cdecl, 
-    importc: "rl_bind_keyseq", dynlib: readlineDll.}
-proc bind_keyseq_in_map*(a2: cstring, a3: CommandFunc, a4: PKeymap): cint{.
-    cdecl, importc: "rl_bind_keyseq_in_map", dynlib: readlineDll.}
-proc bind_keyseq_if_unbound*(a2: cstring, a3: CommandFunc): cint{.cdecl, 
-    importc: "rl_bind_keyseq_if_unbound", dynlib: readlineDll.}
-proc bind_keyseq_if_unbound_in_map*(a2: cstring, a3: CommandFunc, 
-                                    a4: PKeymap): cint{.cdecl, 
-    importc: "rl_bind_keyseq_if_unbound_in_map", dynlib: readlineDll.}
-proc generic_bind*(a2: cint, a3: cstring, a4: cstring, a5: PKeymap): cint{.
-    cdecl, importc: "rl_generic_bind", dynlib: readlineDll.}
-proc variable_value*(a2: cstring): cstring{.cdecl, importc: "rl_variable_value", 
-    dynlib: readlineDll.}
-proc variable_bind*(a2: cstring, a3: cstring): cint{.cdecl, 
-    importc: "rl_variable_bind", dynlib: readlineDll.}
-# Backwards compatibility, use rl_bind_keyseq_in_map instead. 
-
-proc set_key*(a2: cstring, a3: CommandFunc, a4: PKeymap): cint{.cdecl, 
-    importc: "rl_set_key", dynlib: readlineDll.}
-# Backwards compatibility, use rl_generic_bind instead. 
-
-proc macro_bind*(a2: cstring, a3: cstring, a4: PKeymap): cint{.cdecl, 
-    importc: "rl_macro_bind", dynlib: readlineDll.}
-# Undocumented in the texinfo manual; not really useful to programs. 
-
-proc translate_keyseq*(a2: cstring, a3: cstring, a4: ptr cint): cint{.cdecl, 
-    importc: "rl_translate_keyseq", dynlib: readlineDll.}
-proc untranslate_keyseq*(a2: cint): cstring{.cdecl, 
-    importc: "rl_untranslate_keyseq", dynlib: readlineDll.}
-proc named_function*(a2: cstring): CommandFunc{.cdecl, 
-    importc: "rl_named_function", dynlib: readlineDll.}
-proc function_of_keyseq*(a2: cstring, a3: PKeymap, a4: ptr cint): CommandFunc{.
-    cdecl, importc: "rl_function_of_keyseq", dynlib: readlineDll.}
-proc list_funmap_names*(){.cdecl, importc: "rl_list_funmap_names", 
-                           dynlib: readlineDll.}
-proc invoking_keyseqs_in_map*(a2: CommandFunc, a3: PKeymap): cstringArray{.
-    cdecl, importc: "rl_invoking_keyseqs_in_map", dynlib: readlineDll.}
-proc invoking_keyseqs*(a2: CommandFunc): cstringArray{.cdecl, 
-    importc: "rl_invoking_keyseqs", dynlib: readlineDll.}
-proc function_dumper*(a2: cint){.cdecl, importc: "rl_function_dumper", 
-                                 dynlib: readlineDll.}
-proc macro_dumper*(a2: cint){.cdecl, importc: "rl_macro_dumper", 
-                              dynlib: readlineDll.}
-proc variable_dumper*(a2: cint){.cdecl, importc: "rl_variable_dumper", 
-                                 dynlib: readlineDll.}
-proc read_init_file*(a2: cstring): cint{.cdecl, importc: "rl_read_init_file", 
-    dynlib: readlineDll.}
-proc parse_and_bind*(a2: cstring): cint{.cdecl, importc: "rl_parse_and_bind", 
-    dynlib: readlineDll.}
-
-proc get_keymap_name*(a2: PKeymap): cstring{.cdecl, 
-    importc: "rl_get_keymap_name", dynlib: readlineDll.}
-
-proc set_keymap_from_edit_mode*(){.cdecl, 
-                                   importc: "rl_set_keymap_from_edit_mode", 
-                                   dynlib: readlineDll.}
-proc get_keymap_name_from_edit_mode*(): cstring{.cdecl, 
-    importc: "rl_get_keymap_name_from_edit_mode", dynlib: readlineDll.}
-# Functions for manipulating the funmap, which maps command names to functions. 
-
-proc add_funmap_entry*(a2: cstring, a3: CommandFunc): cint{.cdecl, 
-    importc: "rl_add_funmap_entry", dynlib: readlineDll.}
-proc funmap_names*(): cstringArray{.cdecl, importc: "rl_funmap_names", 
-                                    dynlib: readlineDll.}
-# Undocumented, only used internally -- there is only one funmap, and this
-#   function may be called only once. 
-
-proc initialize_funmap*(){.cdecl, importc: "rl_initialize_funmap", 
-                           dynlib: readlineDll.}
-# Utility functions for managing keyboard macros. 
-
-proc push_macro_input*(a2: cstring){.cdecl, importc: "rl_push_macro_input", 
-                                     dynlib: readlineDll.}
-# Functions for undoing, from undo.c 
-
-proc add_undo*(a2: Undo_code, a3: cint, a4: cint, a5: cstring){.cdecl, 
-    importc: "rl_add_undo", dynlib: readlineDll.}
-proc free_undo_list*(){.cdecl, importc: "rl_free_undo_list", dynlib: readlineDll.}
-proc do_undo*(): cint{.cdecl, importc: "rl_do_undo", dynlib: readlineDll.}
-proc begin_undo_group*(): cint{.cdecl, importc: "rl_begin_undo_group", 
-                                dynlib: readlineDll.}
-proc end_undo_group*(): cint{.cdecl, importc: "rl_end_undo_group", 
-                              dynlib: readlineDll.}
-proc modifying*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_modifying", 
-    dynlib: readlineDll.}
-# Functions for redisplay. 
-
-proc redisplay*(){.cdecl, importc: "rl_redisplay", dynlib: readlineDll.}
-proc on_new_line*(): cint{.cdecl, importc: "rl_on_new_line", dynlib: readlineDll.}
-proc on_new_line_with_prompt*(): cint{.cdecl, 
-                                       importc: "rl_on_new_line_with_prompt", 
-                                       dynlib: readlineDll.}
-proc forced_update_display*(): cint{.cdecl, importc: "rl_forced_update_display", 
-                                     dynlib: readlineDll.}
-proc clear_message*(): cint{.cdecl, importc: "rl_clear_message", 
-                             dynlib: readlineDll.}
-proc reset_line_state*(): cint{.cdecl, importc: "rl_reset_line_state", 
-                                dynlib: readlineDll.}
-proc crlf*(): cint{.cdecl, importc: "rl_crlf", dynlib: readlineDll.}
-proc message*(a2: cstring): cint{.varargs, cdecl, importc: "rl_message", 
-                                  dynlib: readlineDll.}
-proc show_char*(a2: cint): cint{.cdecl, importc: "rl_show_char", 
-                                 dynlib: readlineDll.}
-# Undocumented in texinfo manual. 
-
-proc character_len*(a2: cint, a3: cint): cint{.cdecl, 
-    importc: "rl_character_len", dynlib: readlineDll.}
-# Save and restore internal prompt redisplay information. 
-
-proc save_prompt*(){.cdecl, importc: "rl_save_prompt", dynlib: readlineDll.}
-proc restore_prompt*(){.cdecl, importc: "rl_restore_prompt", dynlib: readlineDll.}
-# Modifying text. 
-
-proc replace_line*(a2: cstring, a3: cint){.cdecl, importc: "rl_replace_line", 
-    dynlib: readlineDll.}
-proc insert_text*(a2: cstring): cint{.cdecl, importc: "rl_insert_text", 
-                                      dynlib: readlineDll.}
-proc delete_text*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_delete_text", 
-    dynlib: readlineDll.}
-proc kill_text*(a2: cint, a3: cint): cint{.cdecl, importc: "rl_kill_text", 
-    dynlib: readlineDll.}
-proc copy_text*(a2: cint, a3: cint): cstring{.cdecl, importc: "rl_copy_text", 
-    dynlib: readlineDll.}
-# Terminal and tty mode management. 
-
-proc prep_terminal*(a2: cint){.cdecl, importc: "rl_prep_terminal", 
-                               dynlib: readlineDll.}
-proc deprep_terminal*(){.cdecl, importc: "rl_deprep_terminal", 
-                         dynlib: readlineDll.}
-proc tty_set_default_bindings*(a2: PKeymap){.cdecl, 
-    importc: "rl_tty_set_default_bindings", dynlib: readlineDll.}
-proc tty_unset_default_bindings*(a2: PKeymap){.cdecl, 
-    importc: "rl_tty_unset_default_bindings", dynlib: readlineDll.}
-proc reset_terminal*(a2: cstring): cint{.cdecl, importc: "rl_reset_terminal", 
-    dynlib: readlineDll.}
-proc resize_terminal*(){.cdecl, importc: "rl_resize_terminal", 
-                         dynlib: readlineDll.}
-proc set_screen_size*(a2: cint, a3: cint){.cdecl, importc: "rl_set_screen_size", 
-    dynlib: readlineDll.}
-proc get_screen_size*(a2: ptr cint, a3: ptr cint){.cdecl, 
-    importc: "rl_get_screen_size", dynlib: readlineDll.}
-proc reset_screen_size*(){.cdecl, importc: "rl_reset_screen_size", 
-                           dynlib: readlineDll.}
-proc get_termcap*(a2: cstring): cstring{.cdecl, importc: "rl_get_termcap", 
-    dynlib: readlineDll.}
-# Functions for character input. 
-
-proc stuff_char*(a2: cint): cint{.cdecl, importc: "rl_stuff_char", 
-                                  dynlib: readlineDll.}
-proc execute_next*(a2: cint): cint{.cdecl, importc: "rl_execute_next", 
-                                    dynlib: readlineDll.}
-proc clear_pending_input*(): cint{.cdecl, importc: "rl_clear_pending_input", 
-                                   dynlib: readlineDll.}
-proc read_key*(): cint{.cdecl, importc: "rl_read_key", dynlib: readlineDll.}
-proc getc*(a2: File): cint{.cdecl, importc: "rl_getc", dynlib: readlineDll.}
-proc set_keyboard_input_timeout*(a2: cint): cint{.cdecl, 
-    importc: "rl_set_keyboard_input_timeout", dynlib: readlineDll.}
-# `Public' utility functions . 
-
-proc extend_line_buffer*(a2: cint){.cdecl, importc: "rl_extend_line_buffer", 
-                                    dynlib: readlineDll.}
-proc ding*(): cint{.cdecl, importc: "rl_ding", dynlib: readlineDll.}
-proc alphabetic*(a2: cint): cint{.cdecl, importc: "rl_alphabetic", 
-                                  dynlib: readlineDll.}
-proc free*(a2: pointer){.cdecl, importc: "rl_free", dynlib: readlineDll.}
-# Readline signal handling, from signals.c 
-
-proc set_signals*(): cint{.cdecl, importc: "rl_set_signals", dynlib: readlineDll.}
-proc clear_signals*(): cint{.cdecl, importc: "rl_clear_signals", 
-                             dynlib: readlineDll.}
-proc cleanup_after_signal*(){.cdecl, importc: "rl_cleanup_after_signal", 
-                              dynlib: readlineDll.}
-proc reset_after_signal*(){.cdecl, importc: "rl_reset_after_signal", 
-                            dynlib: readlineDll.}
-proc free_line_state*(){.cdecl, importc: "rl_free_line_state", 
-                         dynlib: readlineDll.}
-proc echo_signal_char*(a2: cint){.cdecl, importc: "rl_echo_signal_char", 
-                                  dynlib: readlineDll.}
-proc set_paren_blink_timeout*(a2: cint): cint{.cdecl, 
-    importc: "rl_set_paren_blink_timeout", dynlib: readlineDll.}
-# Undocumented. 
-
-proc maybe_save_line*(): cint{.cdecl, importc: "rl_maybe_save_line", 
-                               dynlib: readlineDll.}
-proc maybe_unsave_line*(): cint{.cdecl, importc: "rl_maybe_unsave_line", 
-                                 dynlib: readlineDll.}
-proc maybe_replace_line*(): cint{.cdecl, importc: "rl_maybe_replace_line", 
-                                  dynlib: readlineDll.}
-# Completion functions. 
-
-proc complete_internal*(a2: cint): cint{.cdecl, importc: "rl_complete_internal", 
-    dynlib: readlineDll.}
-proc display_match_list*(a2: cstringArray, a3: cint, a4: cint){.cdecl, 
-    importc: "rl_display_match_list", dynlib: readlineDll.}
-proc completion_matches*(a2: cstring, a3: Compentry_func): cstringArray{.
-    cdecl, importc: "rl_completion_matches", dynlib: readlineDll.}
-proc username_completion_function*(a2: cstring, a3: cint): cstring{.cdecl, 
-    importc: "rl_username_completion_function", dynlib: readlineDll.}
-proc filename_completion_function*(a2: cstring, a3: cint): cstring{.cdecl, 
-    importc: "rl_filename_completion_function", dynlib: readlineDll.}
-proc completion_mode*(a2: CommandFunc): cint{.cdecl, 
-    importc: "rl_completion_mode", dynlib: readlineDll.}
-# **************************************************************** 
-#								    
-#			Well Published Variables		    
-#								    
-# **************************************************************** 
-
-when false: 
-  # The version of this incarnation of the readline library. 
-  var library_version*{.importc: "rl_library_version", dynlib: readlineDll.}: cstring
-  # e.g., "4.2" 
-  var readline_version*{.importc: "rl_readline_version", dynlib: readlineDll.}: cint
-  # e.g., 0x0402 
-  # True if this is real GNU readline. 
-  var gnu_readline_p*{.importc: "rl_gnu_readline_p", dynlib: readlineDll.}: cint
-  # Flags word encapsulating the current readline state. 
-  var readline_state*{.importc: "rl_readline_state", dynlib: readlineDll.}: cint
-  # Says which editing mode readline is currently using.  1 means emacs mode;
-  #   0 means vi mode. 
-  var editing_mode*{.importc: "rl_editing_mode", dynlib: readlineDll.}: cint
-  # Insert or overwrite mode for emacs mode.  1 means insert mode; 0 means
-  #   overwrite mode.  Reset to insert mode on each input line. 
-  var insert_mode*{.importc: "rl_insert_mode", dynlib: readlineDll.}: cint
-  # The name of the calling program.  You should initialize this to
-  #   whatever was in argv[0].  It is used when parsing conditionals. 
-  var readline_name*{.importc: "rl_readline_name", dynlib: readlineDll.}: cstring
-  # The prompt readline uses.  This is set from the argument to
-  #   readline (), and should not be assigned to directly. 
-  var prompt*{.importc: "rl_prompt", dynlib: readlineDll.}: cstring
-  # The prompt string that is actually displayed by rl_redisplay.  Public so
-  #   applications can more easily supply their own redisplay functions. 
-  var display_prompt*{.importc: "rl_display_prompt", dynlib: readlineDll.}: cstring
-  # The line buffer that is in use. 
-  var line_buffer*{.importc: "rl_line_buffer", dynlib: readlineDll.}: cstring
-  # The location of point, and end. 
-  var point*{.importc: "rl_point", dynlib: readlineDll.}: cint
-  var theEnd*{.importc: "rl_end", dynlib: readlineDll.}: cint
-  # The mark, or saved cursor position. 
-  var mark*{.importc: "rl_mark", dynlib: readlineDll.}: cint
-  # Flag to indicate that readline has finished with the current input
-  #   line and should return it. 
-  var done*{.importc: "rl_done", dynlib: readlineDll.}: cint
-  # If set to a character value, that will be the next keystroke read. 
-  var pending_input*{.importc: "rl_pending_input", dynlib: readlineDll.}: cint
-  # Non-zero if we called this function from _rl_dispatch().  It's present
-  #   so functions can find out whether they were called from a key binding
-  #   or directly from an application. 
-  var dispatching*{.importc: "rl_dispatching", dynlib: readlineDll.}: cint
-  # Non-zero if the user typed a numeric argument before executing the
-  #   current function. 
-  var explicit_arg*{.importc: "rl_explicit_arg", dynlib: readlineDll.}: cint
-  # The current value of the numeric argument specified by the user. 
-  var numeric_arg*{.importc: "rl_numeric_arg", dynlib: readlineDll.}: cint
-  # The address of the last command function Readline executed. 
-  var last_func*{.importc: "rl_last_func", dynlib: readlineDll.}: CommandFunc
-  # The name of the terminal to use. 
-  var terminal_name*{.importc: "rl_terminal_name", dynlib: readlineDll.}: cstring
-  # The input and output streams. 
-  var instream*{.importc: "rl_instream", dynlib: readlineDll.}: File
-  var outstream*{.importc: "rl_outstream", dynlib: readlineDll.}: File
-  # If non-zero, Readline gives values of LINES and COLUMNS from the environment
-  #   greater precedence than values fetched from the kernel when computing the
-  #   screen dimensions. 
-  var prefer_env_winsize*{.importc: "rl_prefer_env_winsize", dynlib: readlineDll.}: cint
-  # If non-zero, then this is the address of a function to call just
-  #   before readline_internal () prints the first prompt. 
-  var startup_hook*{.importc: "rl_startup_hook", dynlib: readlineDll.}:  hook_func
-  # If non-zero, this is the address of a function to call just before
-  #   readline_internal_setup () returns and readline_internal starts
-  #   reading input characters. 
-  var pre_input_hook*{.importc: "rl_pre_input_hook", dynlib: readlineDll.}: hook_func
-  # The address of a function to call periodically while Readline is
-  #   awaiting character input, or NULL, for no event handling. 
-  var event_hook*{.importc: "rl_event_hook", dynlib: readlineDll.}: hook_func
-  # The address of the function to call to fetch a character from the current
-  #   Readline input stream 
-  var getc_function*{.importc: "rl_getc_function", dynlib: readlineDll.}: getc_func
-  var redisplay_function*{.importc: "rl_redisplay_function", dynlib: readlineDll.}: voidfunc
-  var prep_term_function*{.importc: "rl_prep_term_function", dynlib: readlineDll.}: vintfunc
-  var deprep_term_function*{.importc: "rl_deprep_term_function", 
-                             dynlib: readlineDll.}: voidfunc
-  # Dispatch variables. 
-  var executing_keymap*{.importc: "rl_executing_keymap", dynlib: readlineDll.}: PKeymap
-  var binding_keymap*{.importc: "rl_binding_keymap", dynlib: readlineDll.}: PKeymap
-  # Display variables. 
-  # If non-zero, readline will erase the entire line, including any prompt,
-  #   if the only thing typed on an otherwise-blank line is something bound to
-  #   rl_newline. 
-  var erase_empty_line*{.importc: "rl_erase_empty_line", dynlib: readlineDll.}: cint
-  # If non-zero, the application has already printed the prompt (rl_prompt)
-  #   before calling readline, so readline should not output it the first time
-  #   redisplay is done. 
-  var already_prompted*{.importc: "rl_already_prompted", dynlib: readlineDll.}: cint
-  # A non-zero value means to read only this many characters rather than
-  #   up to a character bound to accept-line. 
-  var num_chars_to_read*{.importc: "rl_num_chars_to_read", dynlib: readlineDll.}: cint
-  # The text of a currently-executing keyboard macro. 
-  var executing_macro*{.importc: "rl_executing_macro", dynlib: readlineDll.}: cstring
-  # Variables to control readline signal handling. 
-  # If non-zero, readline will install its own signal handlers for
-  #   SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. 
-  var catch_signals*{.importc: "rl_catch_signals", dynlib: readlineDll.}: cint
-  # If non-zero, readline will install a signal handler for SIGWINCH
-  #   that also attempts to call any calling application's SIGWINCH signal
-  #   handler.  Note that the terminal is not cleaned up before the
-  #   application's signal handler is called; use rl_cleanup_after_signal()
-  #   to do that. 
-  var catch_sigwinch*{.importc: "rl_catch_sigwinch", dynlib: readlineDll.}: cint
-  # Completion variables. 
-  # Pointer to the generator function for completion_matches ().
-  #   NULL means to use rl_filename_completion_function (), the default
-  #   filename completer. 
-  var completion_entry_function*{.importc: "rl_completion_entry_function", 
-                                  dynlib: readlineDll.}: compentry_func
-  # Optional generator for menu completion.  Default is
-  #   rl_completion_entry_function (rl_filename_completion_function). 
-  var menu_completion_entry_function*{.importc: "rl_menu_completion_entry_function", 
-                                       dynlib: readlineDll.}: compentry_func
-  # If rl_ignore_some_completions_function is non-NULL it is the address
-  #   of a function to call after all of the possible matches have been
-  #   generated, but before the actual completion is done to the input line.
-  #   The function is called with one argument; a NULL terminated array
-  #   of (char *).  If your function removes any of the elements, they
-  #   must be free()'ed. 
-  var ignore_some_completions_function*{.
-      importc: "rl_ignore_some_completions_function", dynlib: readlineDll.}: compignore_func
-  # Pointer to alternative function to create matches.
-  #   Function is called with TEXT, START, and END.
-  #   START and END are indices in RL_LINE_BUFFER saying what the boundaries
-  #   of TEXT are.
-  #   If this function exists and returns NULL then call the value of
-  #   rl_completion_entry_function to try to match, otherwise use the
-  #   array of strings returned. 
-  var attempted_completion_function*{.importc: "rl_attempted_completion_function", 
-                                      dynlib: readlineDll.}: completion_func
-  # The basic list of characters that signal a break between words for the
-  #   completer routine.  The initial contents of this variable is what
-  #   breaks words in the shell, i.e. "n\"\\'`@$>". 
-  var basic_word_break_characters*{.importc: "rl_basic_word_break_characters", 
-                                    dynlib: readlineDll.}: cstring
-  # The list of characters that signal a break between words for
-  #   rl_complete_internal.  The default list is the contents of
-  #   rl_basic_word_break_characters.  
-  var completer_word_break_characters*{.importc: "rl_completer_word_break_characters", 
-                                        dynlib: readlineDll.}: cstring
-  # Hook function to allow an application to set the completion word
-  #   break characters before readline breaks up the line.  Allows
-  #   position-dependent word break characters. 
-  var completion_word_break_hook*{.importc: "rl_completion_word_break_hook", 
-                                   dynlib: readlineDll.}: cpvfunc
-  # List of characters which can be used to quote a substring of the line.
-  #   Completion occurs on the entire substring, and within the substring   
-  #   rl_completer_word_break_characters are treated as any other character,
-  #   unless they also appear within this list. 
-  var completer_quote_characters*{.importc: "rl_completer_quote_characters", 
-                                   dynlib: readlineDll.}: cstring
-  # List of quote characters which cause a word break. 
-  var basic_quote_characters*{.importc: "rl_basic_quote_characters", 
-                               dynlib: readlineDll.}: cstring
-  # List of characters that need to be quoted in filenames by the completer. 
-  var filename_quote_characters*{.importc: "rl_filename_quote_characters", 
-                                  dynlib: readlineDll.}: cstring
-  # List of characters that are word break characters, but should be left
-  #   in TEXT when it is passed to the completion function.  The shell uses
-  #   this to help determine what kind of completing to do. 
-  var special_prefixes*{.importc: "rl_special_prefixes", dynlib: readlineDll.}: cstring
-  # If non-zero, then this is the address of a function to call when
-  #   completing on a directory name.  The function is called with
-  #   the address of a string (the current directory name) as an arg.  It
-  #   changes what is displayed when the possible completions are printed
-  #   or inserted. 
-  var directory_completion_hook*{.importc: "rl_directory_completion_hook", 
-                                  dynlib: readlineDll.}: icppfunc
-  # If non-zero, this is the address of a function to call when completing
-  #   a directory name.  This function takes the address of the directory name
-  #   to be modified as an argument.  Unlike rl_directory_completion_hook, it
-  #   only modifies the directory name used in opendir(2), not what is displayed
-  #   when the possible completions are printed or inserted.  It is called
-  #   before rl_directory_completion_hook.  I'm not happy with how this works
-  #   yet, so it's undocumented. 
-  var directory_rewrite_hook*{.importc: "rl_directory_rewrite_hook", 
-                               dynlib: readlineDll.}: icppfunc
-  # If non-zero, this is the address of a function to call when reading
-  #   directory entries from the filesystem for completion and comparing
-  #   them to the partial word to be completed.  The function should
-  #   either return its first argument (if no conversion takes place) or
-  #   newly-allocated memory.  This can, for instance, convert filenames
-  #   between character sets for comparison against what's typed at the
-  #   keyboard.  The returned value is what is added to the list of
-  #   matches.  The second argument is the length of the filename to be
-  #   converted. 
-  var filename_rewrite_hook*{.importc: "rl_filename_rewrite_hook", 
-                              dynlib: readlineDll.}: dequote_func
-  # If non-zero, then this is the address of a function to call when
-  #   completing a word would normally display the list of possible matches.
-  #   This function is called instead of actually doing the display.
-  #   It takes three arguments: (char **matches, int num_matches, int max_length)
-  #   where MATCHES is the array of strings that matched, NUM_MATCHES is the
-  #   number of strings in that array, and MAX_LENGTH is the length of the
-  #   longest string in that array. 
-  var completion_display_matches_hook*{.importc: "rl_completion_display_matches_hook", 
-                                        dynlib: readlineDll.}: compdisp_func
-  # Non-zero means that the results of the matches are to be treated
-  #   as filenames.  This is ALWAYS zero on entry, and can only be changed
-  #   within a completion entry finder function. 
-  var filename_completion_desired*{.importc: "rl_filename_completion_desired", 
-                                    dynlib: readlineDll.}: cint
-  # Non-zero means that the results of the matches are to be quoted using
-  #   double quotes (or an application-specific quoting mechanism) if the
-  #   filename contains any characters in rl_word_break_chars.  This is
-  #   ALWAYS non-zero on entry, and can only be changed within a completion
-  #   entry finder function. 
-  var filename_quoting_desired*{.importc: "rl_filename_quoting_desired", 
-                                 dynlib: readlineDll.}: cint
-  # Set to a function to quote a filename in an application-specific fashion.
-  #   Called with the text to quote, the type of match found (single or multiple)
-  #   and a pointer to the quoting character to be used, which the function can
-  #   reset if desired. 
-  var filename_quoting_function*{.importc: "rl_filename_quoting_function", 
-                                  dynlib: readlineDll.}: quote_func
-  # Function to call to remove quoting characters from a filename.  Called
-  #   before completion is attempted, so the embedded quotes do not interfere
-  #   with matching names in the file system. 
-  var filename_dequoting_function*{.importc: "rl_filename_dequoting_function", 
-                                    dynlib: readlineDll.}: dequote_func
-  # Function to call to decide whether or not a word break character is
-  #   quoted.  If a character is quoted, it does not break words for the
-  #   completer. 
-  var char_is_quoted_p*{.importc: "rl_char_is_quoted_p", dynlib: readlineDll.}: linebuf_func
-  # Non-zero means to suppress normal filename completion after the
-  #   user-specified completion function has been called. 
-  var attempted_completion_over*{.importc: "rl_attempted_completion_over", 
-                                  dynlib: readlineDll.}: cint
-  # Set to a character describing the type of completion being attempted by
-  #   rl_complete_internal; available for use by application completion
-  #   functions. 
-  var completion_type*{.importc: "rl_completion_type", dynlib: readlineDll.}: cint
-  # Set to the last key used to invoke one of the completion functions 
-  var completion_invoking_key*{.importc: "rl_completion_invoking_key", 
-                                dynlib: readlineDll.}: cint
-  # Up to this many items will be displayed in response to a
-  #   possible-completions call.  After that, we ask the user if she
-  #   is sure she wants to see them all.  The default value is 100. 
-  var completion_query_items*{.importc: "rl_completion_query_items", 
-                               dynlib: readlineDll.}: cint
-  # Character appended to completed words when at the end of the line.  The
-  #   default is a space.  Nothing is added if this is '\0'. 
-  var completion_append_character*{.importc: "rl_completion_append_character", 
-                                    dynlib: readlineDll.}: cint
-  # If set to non-zero by an application completion function,
-  #   rl_completion_append_character will not be appended. 
-  var completion_suppress_append*{.importc: "rl_completion_suppress_append", 
-                                   dynlib: readlineDll.}: cint
-  # Set to any quote character readline thinks it finds before any application
-  #   completion function is called. 
-  var completion_quote_character*{.importc: "rl_completion_quote_character", 
-                                   dynlib: readlineDll.}: cint
-  # Set to a non-zero value if readline found quoting anywhere in the word to
-  #   be completed; set before any application completion function is called. 
-  var completion_found_quote*{.importc: "rl_completion_found_quote", 
-                               dynlib: readlineDll.}: cint
-  # If non-zero, the completion functions don't append any closing quote.
-  #   This is set to 0 by rl_complete_internal and may be changed by an
-  #   application-specific completion function. 
-  var completion_suppress_quote*{.importc: "rl_completion_suppress_quote", 
-                                  dynlib: readlineDll.}: cint
-  # If non-zero, readline will sort the completion matches.  On by default. 
-  var sort_completion_matches*{.importc: "rl_sort_completion_matches", 
-                                dynlib: readlineDll.}: cint
-  # If non-zero, a slash will be appended to completed filenames that are
-  #   symbolic links to directory names, subject to the value of the
-  #   mark-directories variable (which is user-settable).  This exists so
-  #   that application completion functions can override the user's preference
-  #   (set via the mark-symlinked-directories variable) if appropriate.
-  #   It's set to the value of _rl_complete_mark_symlink_dirs in
-  #   rl_complete_internal before any application-specific completion
-  #   function is called, so without that function doing anything, the user's
-  #   preferences are honored. 
-  var completion_mark_symlink_dirs*{.importc: "rl_completion_mark_symlink_dirs", 
-                                     dynlib: readlineDll.}: cint
-  # If non-zero, then disallow duplicates in the matches. 
-  var ignore_completion_duplicates*{.importc: "rl_ignore_completion_duplicates", 
-                                     dynlib: readlineDll.}: cint
-  # If this is non-zero, completion is (temporarily) inhibited, and the
-  #   completion character will be inserted as any other. 
-  var inhibit_completion*{.importc: "rl_inhibit_completion", dynlib: readlineDll.}: cint
-# Input error; can be returned by (*rl_getc_function) if readline is reading
-#   a top-level command (RL_ISSTATE (RL_STATE_READCMD)). 
-
-const 
-  READERR* = (- 2)
-
-# Definitions available for use by readline clients. 
-
-const 
-  PROMPT_START_IGNORE* = '\x01'
-  PROMPT_END_IGNORE* = '\x02'
-
-# Possible values for do_replace argument to rl_filename_quoting_function,
-#   called by rl_complete_internal. 
-
-const 
-  NO_MATCH* = 0
-  SINGLE_MATCH* = 1
-  MULT_MATCH* = 2
-
-# Possible state values for rl_readline_state 
-
-const 
-  STATE_NONE* = 0x00000000    # no state; before first call 
-  STATE_INITIALIZING* = 0x00000001 # initializing 
-  STATE_INITIALIZED* = 0x00000002 # initialization done 
-  STATE_TERMPREPPED* = 0x00000004 # terminal is prepped 
-  STATE_READCMD* = 0x00000008 # reading a command key 
-  STATE_METANEXT* = 0x00000010 # reading input after ESC 
-  STATE_DISPATCHING* = 0x00000020 # dispatching to a command 
-  STATE_MOREINPUT* = 0x00000040 # reading more input in a command function 
-  STATE_ISEARCH* = 0x00000080 # doing incremental search 
-  STATE_NSEARCH* = 0x00000100 # doing non-inc search 
-  STATE_SEARCH* = 0x00000200  # doing a history search 
-  STATE_NUMERICARG* = 0x00000400 # reading numeric argument 
-  STATE_MACROINPUT* = 0x00000800 # getting input from a macro 
-  STATE_MACRODEF* = 0x00001000 # defining keyboard macro 
-  STATE_OVERWRITE* = 0x00002000 # overwrite mode 
-  STATE_COMPLETING* = 0x00004000 # doing completion 
-  STATE_SIGHANDLER* = 0x00008000 # in readline sighandler 
-  STATE_UNDOING* = 0x00010000 # doing an undo 
-  STATE_INPUTPENDING* = 0x00020000 # rl_execute_next called 
-  STATE_TTYCSAVED* = 0x00040000 # tty special chars saved 
-  STATE_CALLBACK* = 0x00080000 # using the callback interface 
-  STATE_VIMOTION* = 0x00100000 # reading vi motion arg 
-  STATE_MULTIKEY* = 0x00200000 # reading multiple-key command 
-  STATE_VICMDONCE* = 0x00400000 # entered vi command mode at least once 
-  STATE_REDISPLAYING* = 0x00800000 # updating terminal display 
-  STATE_DONE* = 0x01000000    # done; accepted line 
-
-template SETSTATE*(x: expr): stmt = 
-  readline_state = readline_state or (x)
-
-template UNSETSTATE*(x: expr): stmt = 
-  readline_state = readline_state and not (x)
-
-template ISSTATE*(x: expr): expr = 
-  (readline_state and x) != 0
-
-type 
-  Readline_state*{.pure, final.} = object 
-    point*: cint              # line state 
-    theEnd*: cint
-    mark*: cint
-    buffer*: cstring
-    buflen*: cint
-    ul*: ptr UNDO_LIST
-    prompt*: cstring          # global state 
-    rlstate*: cint
-    done*: cint
-    kmap*: PKeymap            # input state 
-    lastfunc*: CommandFunc
-    insmode*: cint
-    edmode*: cint
-    kseqlen*: cint
-    inf*: File
-    outf*: File
-    pendingin*: cint
-    theMacro*: cstring        # signal state 
-    catchsigs*: cint
-    catchsigwinch*: cint      # search state 
-                              # completion state 
-                              # options state 
-                              # reserved for future expansion, so the struct size doesn't change 
-    reserved*: array[0..64 - 1, char]
-{.deprecated: [Treadline_state: Readline_state].}
-
-
-proc save_state*(a2: ptr Readline_state): cint{.cdecl, 
-    importc: "rl_save_state", dynlib: readlineDll.}
-proc restore_state*(a2: ptr Readline_state): cint{.cdecl, 
-    importc: "rl_restore_state", dynlib: readlineDll.}
diff --git a/lib/wrappers/readline/rltypedefs.nim b/lib/wrappers/readline/rltypedefs.nim
deleted file mode 100644
index 759b81297..000000000
--- a/lib/wrappers/readline/rltypedefs.nim
+++ /dev/null
@@ -1,79 +0,0 @@
-# rltypedefs.h -- Type declarations for readline functions. 
-# Copyright (C) 2000-2009 Free Software Foundation, Inc.
-#
-#   This file is part of the GNU Readline Library (Readline), a library
-#   for reading lines of text with interactive input and history editing.      
-#
-#   Readline is free software: you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation, either version 3 of the License, or
-#   (at your option) any later version.
-#
-#   Readline is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-type 
-  Function* = proc (): cint{.cdecl.}
-  VFunction* = proc (){.cdecl.}
-  CPFunction* = proc (): cstring{.cdecl.}
-  CPPFunction* = proc (): cstringArray{.cdecl.}
-{.deprecated: [TFunction: Function, TVFunction: VFunction,
-              TCPFunction: CPFunction, TCPPFunction: CPPFunction].}
-
-# Bindable functions 
-
-type 
-  Command_func* = proc (a2: cint, a3: cint): cint{.cdecl.}
-{.deprecated: [Tcommand_func: Command_func].}
-
-# Typedefs for the completion system 
-
-type 
-  Compentry_func* = proc (a2: cstring, a3: cint): cstring{.cdecl.}
-  Completion_func* = proc (a2: cstring, a3: cint, a4: cint): cstringArray{.
-      cdecl.}
-  Quote_func* = proc (a2: cstring, a3: cint, a4: cstring): cstring{.cdecl.}
-  Dequote_func* = proc (a2: cstring, a3: cint): cstring{.cdecl.}
-  Compignore_func* = proc (a2: cstringArray): cint{.cdecl.}
-  Compdisp_func* = proc (a2: cstringArray, a3: cint, a4: cint){.cdecl.}
-{.deprecated: [Tcompentry_func: Compentry_func,Tcompletion_func: Completion_func,
-              Tquote_func: Quote_func, Tdequote_func: Dequote_func,
-              Tcompignore_func: Compignore_func, Tcompdisp_func: Compdisp_func].}
-# Type for input and pre-read hook functions like rl_event_hook 
-
-type 
-  Thook_func* = proc (): cint{.cdecl.}
-
-# Input function type 
-
-type 
-  Tgetc_func* = proc (a2: File): cint{.cdecl.}
-
-# Generic function that takes a character buffer (which could be the readline
-#   line buffer) and an index into it (which could be rl_point) and returns
-#   an int. 
-
-type 
-  Tlinebuf_func* = proc (a2: cstring, a3: cint): cint{.cdecl.}
-
-# `Generic' function pointer typedefs 
-
-type 
-  Tintfunc* = proc (a2: cint): cint{.cdecl.}
-  Tivoidfunc* = proc (): cint{.cdecl.}
-  Ticpfunc* = proc (a2: cstring): cint{.cdecl.}
-  Ticppfunc* = proc (a2: cstringArray): cint{.cdecl.}
-  Tvoidfunc* = proc (){.cdecl.}
-  Tvintfunc* = proc (a2: cint){.cdecl.}
-  Tvcpfunc* = proc (a2: cstring){.cdecl.}
-  Tvcppfunc* = proc (a2: cstringArray){.cdecl.}
-  Tcpvfunc* = proc (): cstring{.cdecl.}
-  Tcpifunc* = proc (a2: cint): cstring{.cdecl.}
-  Tcpcpfunc* = proc (a2: cstring): cstring{.cdecl.}
-  Tcpcppfunc* = proc (a2: cstringArray): cstring{.cdecl.}
diff --git a/lib/wrappers/readline/tweaked/history.h b/lib/wrappers/readline/tweaked/history.h
deleted file mode 100644
index b79123790..000000000
--- a/lib/wrappers/readline/tweaked/history.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/* history.h -- the names of functions that you can call in history. */
-
-/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
-
-   This file contains the GNU History Library (History), a set of
-   routines for managing the text of previously typed lines.
-
-   History is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   History is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with History.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef C2NIM
-#  private historyDll
-#  dynlib historyDll
-#  cdecl
-#  if defined(windows)
-#    define historyDll "history.dll"
-#  elif defined(macosx)
-#    define historyDll "libhistory.dynlib"
-#  else
-#    define historyDll "libhistory.so.6(|.0)"
-#  endif
-#  prefix rl_
-#  prefix RL_
-#  suffix _t
-#  typeprefixes
-#  def PARAMS(x) x
-#  def time_t TTime
-#endif
-
-#  include "times"
-#  include "rltypedefs.h"
-
-typedef void *histdata_t;
-
-/* The structure used to store a history entry. */
-typedef struct _hist_entry {
-  char *line;
-  char *timestamp;		/* char * rather than time_t for read/write */
-  histdata_t data;
-} HIST_ENTRY;
-
-/* Size of the history-library-managed space in history entry HS. */
-#define HISTENT_BYTES(hs)	(strlen(hs.line) + strlen(hs.timestamp))
-
-/* A structure used to pass the current state of the history stuff around. */
-typedef struct _hist_state {
-  HIST_ENTRY **entries;		/* Pointer to the entries themselves. */
-  int offset;			/* The location pointer within this array. */
-  int length;			/* Number of elements within this array. */
-  int size;			/* Number of slots allocated to this array. */
-  int flags;
-} HISTORY_STATE;
-
-/* Flag values for the `flags' member of HISTORY_STATE. */
-#define HS_STIFLED	0x01
-
-/* Initialization and state management. */
-
-/* Begin a session in which the history functions might be used.  This
-   just initializes the interactive variables. */
-extern void using_history PARAMS((void));
-
-/* Return the current HISTORY_STATE of the history. */
-extern HISTORY_STATE *history_get_history_state PARAMS((void));
-
-/* Set the state of the current history array to STATE. */
-extern void history_set_history_state PARAMS((HISTORY_STATE *));
-
-/* Manage the history list. */
-
-/* Place STRING at the end of the history list.
-   The associated data field (if any) is set to NULL. */
-extern void add_history PARAMS((const char *));
-
-/* Change the timestamp associated with the most recent history entry to
-   STRING. */
-extern void add_history_time PARAMS((const char *));
-
-/* A reasonably useless function, only here for completeness.  WHICH
-   is the magic number that tells us which element to delete.  The
-   elements are numbered from 0. */
-extern HIST_ENTRY *remove_history PARAMS((int));
-
-/* Free the history entry H and return any application-specific data
-   associated with it. */
-extern histdata_t free_history_entry PARAMS((HIST_ENTRY *));
-
-/* Make the history entry at WHICH have LINE and DATA.  This returns
-   the old entry so you can dispose of the data.  In the case of an
-   invalid WHICH, a NULL pointer is returned. */
-extern HIST_ENTRY *replace_history_entry PARAMS((int, const char *, histdata_t));
-
-/* Clear the history list and start over. */
-extern void clear_history PARAMS((void));
-
-/* Stifle the history list, remembering only MAX number of entries. */
-extern void stifle_history PARAMS((int));
-
-/* Stop stifling the history.  This returns the previous amount the
-   history was stifled by.  The value is positive if the history was
-   stifled, negative if it wasn't. */
-extern int unstifle_history PARAMS((void));
-
-/* Return 1 if the history is stifled, 0 if it is not. */
-extern int history_is_stifled PARAMS((void));
-
-/* Information about the history list. */
-
-/* Return a NULL terminated array of HIST_ENTRY which is the current input
-   history.  Element 0 of this list is the beginning of time.  If there
-   is no history, return NULL. */
-extern HIST_ENTRY **history_list PARAMS((void));
-
-/* Returns the number which says what history element we are now
-   looking at.  */
-extern int where_history PARAMS((void));
-  
-/* Return the history entry at the current position, as determined by
-   history_offset.  If there is no entry there, return a NULL pointer. */
-extern HIST_ENTRY *current_history PARAMS((void));
-
-/* Return the history entry which is logically at OFFSET in the history
-   array.  OFFSET is relative to history_base. */
-extern HIST_ENTRY *history_get PARAMS((int));
-
-/* Return the timestamp associated with the HIST_ENTRY * passed as an
-   argument */
-extern time_t history_get_time PARAMS((HIST_ENTRY *));
-
-/* Return the number of bytes that the primary history entries are using.
-   This just adds up the lengths of the_history->lines. */
-extern int history_total_bytes PARAMS((void));
-
-/* Moving around the history list. */
-
-/* Set the position in the history list to POS. */
-extern int history_set_pos PARAMS((int));
-
-/* Back up history_offset to the previous history entry, and return
-   a pointer to that entry.  If there is no previous entry, return
-   a NULL pointer. */
-extern HIST_ENTRY *previous_history PARAMS((void));
-
-/* Move history_offset forward to the next item in the input_history,
-   and return the a pointer to that entry.  If there is no next entry,
-   return a NULL pointer. */
-extern HIST_ENTRY *next_history PARAMS((void));
-
-/* Searching the history list. */
-
-/* Search the history for STRING, starting at history_offset.
-   If DIRECTION < 0, then the search is through previous entries,
-   else through subsequent.  If the string is found, then
-   current_history () is the history entry, and the value of this function
-   is the offset in the line of that history entry that the string was
-   found in.  Otherwise, nothing is changed, and a -1 is returned. */
-extern int history_search PARAMS((const char *, int));
-
-/* Search the history for STRING, starting at history_offset.
-   The search is anchored: matching lines must begin with string.
-   DIRECTION is as in history_search(). */
-extern int history_search_prefix PARAMS((const char *, int));
-
-/* Search for STRING in the history list, starting at POS, an
-   absolute index into the list.  DIR, if negative, says to search
-   backwards from POS, else forwards.
-   Returns the absolute index of the history element where STRING
-   was found, or -1 otherwise. */
-extern int history_search_pos PARAMS((const char *, int, int));
-
-/* Managing the history file. */
-
-/* Add the contents of FILENAME to the history list, a line at a time.
-   If FILENAME is NULL, then read from ~/.history.  Returns 0 if
-   successful, or errno if not. */
-extern int read_history PARAMS((const char *));
-
-/* Read a range of lines from FILENAME, adding them to the history list.
-   Start reading at the FROM'th line and end at the TO'th.  If FROM
-   is zero, start at the beginning.  If TO is less than FROM, read
-   until the end of the file.  If FILENAME is NULL, then read from
-   ~/.history.  Returns 0 if successful, or errno if not. */
-extern int read_history_range PARAMS((const char *, int, int));
-
-/* Write the current history to FILENAME.  If FILENAME is NULL,
-   then write the history list to ~/.history.  Values returned
-   are as in read_history ().  */
-extern int write_history PARAMS((const char *));
-
-/* Append NELEMENT entries to FILENAME.  The entries appended are from
-   the end of the list minus NELEMENTs up to the end of the list. */
-extern int append_history PARAMS((int, const char *));
-
-/* Truncate the history file, leaving only the last NLINES lines. */
-extern int history_truncate_file PARAMS((const char *, int));
-
-/* History expansion. */
-
-/* Expand the string STRING, placing the result into OUTPUT, a pointer
-   to a string.  Returns:
-
-   0) If no expansions took place (or, if the only change in
-      the text was the de-slashifying of the history expansion
-      character)
-   1) If expansions did take place
-  -1) If there was an error in expansion.
-   2) If the returned line should just be printed.
-
-  If an error occurred in expansion, then OUTPUT contains a descriptive
-  error message. */
-extern int history_expand PARAMS((char *, char **));
-
-/* Extract a string segment consisting of the FIRST through LAST
-   arguments present in STRING.  Arguments are broken up as in
-   the shell. */
-extern char *history_arg_extract PARAMS((int, int, const char *));
-
-/* Return the text of the history event beginning at the current
-   offset into STRING.  Pass STRING with *INDEX equal to the
-   history_expansion_char that begins this specification.
-   DELIMITING_QUOTE is a character that is allowed to end the string
-   specification for what to search for in addition to the normal
-   characters `:', ` ', `\t', `\n', and sometimes `?'. */
-extern char *get_history_event PARAMS((const char *, int *, int));
-
-/* Return an array of tokens, much as the shell might.  The tokens are
-   parsed out of STRING. */
-extern char **history_tokenize PARAMS((const char *));
-
-#if false
-/* Exported history variables. */
-extern int history_base;
-extern int history_length;
-extern int history_max_entries;
-extern char history_expansion_char;
-extern char history_subst_char;
-extern char *history_word_delimiters;
-extern char history_comment_char;
-extern char *history_no_expand_chars;
-extern char *history_search_delimiter_chars;
-extern int history_quotes_inhibit_expansion;
-
-extern int history_write_timestamps;
-
-#endif
-
diff --git a/lib/wrappers/readline/tweaked/readline.h b/lib/wrappers/readline/tweaked/readline.h
deleted file mode 100644
index b13fbdbbe..000000000
--- a/lib/wrappers/readline/tweaked/readline.h
+++ /dev/null
@@ -1,956 +0,0 @@
-/* Readline.h -- the names of functions callable from within readline. */
-
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
-
-   This file is part of the GNU Readline Library (Readline), a library
-   for reading lines of text with interactive input and history editing.      
-
-   Readline is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   Readline is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef C2NIM
-#  private readlineDll
-#  dynlib readlineDll
-#  cdecl
-#  if defined(windows)
-#    define readlineDll "readline.dll"
-#  elif defined(macosx)
-#    define readlineDll "libreadline.dynlib"
-#  else
-#    define readlineDll "libreadline.so.6(|.0)"
-#  endif
-#  prefix rl_
-#  prefix RL_
-#  suffix _t
-#  typeprefixes
-#  def PARAMS(x) x
-#  mangle end theEnd
-#  mangle type typ
-#  mangle macro theMacro
-/*#  mangle "'command_func'" TCommandFunc
-#  mangle vcpfunc TvcpFunc*/
-#endif
-
-#  include "rltypedefs.h"
-
-
-/* Some character stuff. */
-#define control_character_threshold 0x020   /* Smaller than this is control. */
-#define control_character_mask 0x1f	    /* 0x20 - 1 */
-#define meta_character_threshold 0x07f	    /* Larger than this is Meta. */
-#define control_character_bit 0x40	    /* 0x000000, must be off. */
-#define meta_character_bit 0x080	    /* x0000000, must be on. */
-#define largest_char 255		    /* Largest character value. */
-
-#define CTRL_CHAR(c) (c < control_character_threshold && ((c & 0x80) == 0))
-#define META_CHAR(c) (c > meta_character_threshold && c <= largest_char)
-
-#define CTRL(c) (c & control_character_mask)
-#define META(c) (c | meta_character_bit)
-
-#define UNMETA(c) (c & ~meta_character_bit)
-#define UNCTRL(c) (c|32|control_character_bit)
-
-/* Beware:  these only work with single-byte ASCII characters. */
-
-#define RETURN_CHAR CTRL('M'.ord)
-#define RUBOUT_CHAR 0x7f
-#define ABORT_CHAR CTRL('G'.ord)
-#define PAGE_CHAR CTRL('L'.ord)
-#define ESC_CHAR CTRL('['.ord)
-
-/* A keymap contains one entry for each key in the ASCII set.
-   Each entry consists of a type and a pointer.
-   FUNCTION is the address of a function to run, or the
-   address of a keymap to indirect through.
-   TYPE says which kind of thing FUNCTION is. */
-typedef struct _keymap_entry {
-  char type;
-  rl_command_func_t *function;
-} KEYMAP_ENTRY;
-
-/* This must be large enough to hold bindings for all of the characters
-   in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x,
-   and so on) plus one for subsequence matching. */
-#define KEYMAP_SIZE 257
-#define ANYOTHERKEY KEYMAP_SIZE-1
-
-/* I wanted to make the above structure contain a union of:
-   union { rl_command_func_t *function; struct _keymap_entry *keymap; } value;
-   but this made it impossible for me to create a static array.
-   Maybe I need C lessons. */
-
-typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE];
-typedef KEYMAP_ENTRY *Keymap;
-
-/* The values that TYPE can have in a keymap entry. */
-#define ISFUNC 0
-#define ISKMAP 1
-#define ISMACR 2
-
-#if false
-extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
-extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
-#endif
-
-/* Return a new, empty keymap.
-   Free it with free() when you are done. */
-extern Keymap rl_make_bare_keymap PARAMS((void));
-
-/* Return a new keymap which is a copy of MAP. */
-extern Keymap rl_copy_keymap PARAMS((Keymap));
-
-/* Return a new keymap with the printing characters bound to rl_insert,
-   the lowercase Meta characters bound to run their equivalents, and
-   the Meta digits bound to produce numeric arguments. */
-extern Keymap rl_make_keymap PARAMS((void));
-
-/* Free the storage associated with a keymap. */
-extern void rl_discard_keymap PARAMS((Keymap));
-
-/* These functions actually appear in bind.c */
-
-/* Return the keymap corresponding to a given name.  Names look like
-   `emacs' or `emacs-meta' or `vi-insert'.  */
-extern Keymap rl_get_keymap_by_name PARAMS((const char *));
-
-/* Return the current keymap. */
-extern Keymap rl_get_keymap PARAMS((void));
-
-/* Set the current keymap to MAP. */
-extern void rl_set_keymap PARAMS((Keymap));
-
-#  include "tilde.h"
-
-/* Hex-encoded Readline version number. */
-#define RL_READLINE_VERSION	0x0600		/* Readline 6.0 */
-#define RL_VERSION_MAJOR	6
-#define RL_VERSION_MINOR	0
-
-/* Readline data structures. */
-
-/* Maintaining the state of undo.  We remember individual deletes and inserts
-   on a chain of things to do. */
-
-/* The actions that undo knows how to undo.  Notice that UNDO_DELETE means
-   to insert some text, and UNDO_INSERT means to delete some text.   I.e.,
-   the code tells undo what to undo, not how to undo it. */
-enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END };
-
-/* What an element of THE_UNDO_LIST looks like. */
-typedef struct undo_list {
-  struct undo_list *next;
-  int start, end;		/* Where the change took place. */
-  char *text;			/* The text to insert, if undoing a delete. */
-  enum undo_code what;		/* Delete, Insert, Begin, End. */
-} UNDO_LIST;
-
-/* The current undo list for RL_LINE_BUFFER. */
-extern UNDO_LIST *rl_undo_list;
-
-/* The data structure for mapping textual names to code addresses. */
-typedef struct _funmap {
-  const char *name;
-  rl_command_func_t *function;
-} FUNMAP;
-
-extern FUNMAP **funmap;
-
-/* **************************************************************** */
-/*								    */
-/*	     Functions available to bind to key sequences	    */
-/*								    */
-/* **************************************************************** */
-
-/* Bindable commands for numeric arguments. */
-extern int rl_digit_argument PARAMS((int, int));
-extern int rl_universal_argument PARAMS((int, int));
-
-/* Bindable commands for moving the cursor. */
-extern int rl_forward_byte PARAMS((int, int));
-extern int rl_forward_char PARAMS((int, int));
-extern int rl_forward PARAMS((int, int));
-extern int rl_backward_byte PARAMS((int, int));
-extern int rl_backward_char PARAMS((int, int));
-extern int rl_backward PARAMS((int, int));
-extern int rl_beg_of_line PARAMS((int, int));
-extern int rl_end_of_line PARAMS((int, int));
-extern int rl_forward_word PARAMS((int, int));
-extern int rl_backward_word PARAMS((int, int));
-extern int rl_refresh_line PARAMS((int, int));
-extern int rl_clear_screen PARAMS((int, int));
-extern int rl_skip_csi_sequence PARAMS((int, int));
-extern int rl_arrow_keys PARAMS((int, int));
-
-/* Bindable commands for inserting and deleting text. */
-extern int rl_insert PARAMS((int, int));
-extern int rl_quoted_insert PARAMS((int, int));
-extern int rl_tab_insert PARAMS((int, int));
-extern int rl_newline PARAMS((int, int));
-extern int rl_do_lowercase_version PARAMS((int, int));
-extern int rl_rubout PARAMS((int, int));
-extern int rl_delete PARAMS((int, int));
-extern int rl_rubout_or_delete PARAMS((int, int));
-extern int rl_delete_horizontal_space PARAMS((int, int));
-extern int rl_delete_or_show_completions PARAMS((int, int));
-extern int rl_insert_comment PARAMS((int, int));
-
-/* Bindable commands for changing case. */
-extern int rl_upcase_word PARAMS((int, int));
-extern int rl_downcase_word PARAMS((int, int));
-extern int rl_capitalize_word PARAMS((int, int));
-
-/* Bindable commands for transposing characters and words. */
-extern int rl_transpose_words PARAMS((int, int));
-extern int rl_transpose_chars PARAMS((int, int));
-
-/* Bindable commands for searching within a line. */
-extern int rl_char_search PARAMS((int, int));
-extern int rl_backward_char_search PARAMS((int, int));
-
-/* Bindable commands for readline's interface to the command history. */
-extern int rl_beginning_of_history PARAMS((int, int));
-extern int rl_end_of_history PARAMS((int, int));
-extern int rl_get_next_history PARAMS((int, int));
-extern int rl_get_previous_history PARAMS((int, int));
-
-/* Bindable commands for managing the mark and region. */
-extern int rl_set_mark PARAMS((int, int));
-extern int rl_exchange_point_and_mark PARAMS((int, int));
-
-/* Bindable commands to set the editing mode (emacs or vi). */
-extern int rl_vi_editing_mode PARAMS((int, int));
-extern int rl_emacs_editing_mode PARAMS((int, int));
-
-/* Bindable commands to change the insert mode (insert or overwrite) */
-extern int rl_overwrite_mode PARAMS((int, int));
-
-/* Bindable commands for managing key bindings. */
-extern int rl_re_read_init_file PARAMS((int, int));
-extern int rl_dump_functions PARAMS((int, int));
-extern int rl_dump_macros PARAMS((int, int));
-extern int rl_dump_variables PARAMS((int, int));
-
-/* Bindable commands for word completion. */
-extern int rl_complete PARAMS((int, int));
-extern int rl_possible_completions PARAMS((int, int));
-extern int rl_insert_completions PARAMS((int, int));
-extern int rl_old_menu_complete PARAMS((int, int));
-extern int rl_menu_complete PARAMS((int, int));
-extern int rl_backward_menu_complete PARAMS((int, int));
-
-/* Bindable commands for killing and yanking text, and managing the kill ring. */
-extern int rl_kill_word PARAMS((int, int));
-extern int rl_backward_kill_word PARAMS((int, int));
-extern int rl_kill_line PARAMS((int, int));
-extern int rl_backward_kill_line PARAMS((int, int));
-extern int rl_kill_full_line PARAMS((int, int));
-extern int rl_unix_word_rubout PARAMS((int, int));
-extern int rl_unix_filename_rubout PARAMS((int, int));
-extern int rl_unix_line_discard PARAMS((int, int));
-extern int rl_copy_region_to_kill PARAMS((int, int));
-extern int rl_kill_region PARAMS((int, int));
-extern int rl_copy_forward_word PARAMS((int, int));
-extern int rl_copy_backward_word PARAMS((int, int));
-extern int rl_yank PARAMS((int, int));
-extern int rl_yank_pop PARAMS((int, int));
-extern int rl_yank_nth_arg PARAMS((int, int));
-extern int rl_yank_last_arg PARAMS((int, int));
-
-#ifdef Windows
-extern int rl_paste_from_clipboard PARAMS((int, int));
-#endif
-
-/* Bindable commands for incremental searching. */
-extern int rl_reverse_search_history PARAMS((int, int));
-extern int rl_forward_search_history PARAMS((int, int));
-
-/* Bindable keyboard macro commands. */
-extern int rl_start_kbd_macro PARAMS((int, int));
-extern int rl_end_kbd_macro PARAMS((int, int));
-extern int rl_call_last_kbd_macro PARAMS((int, int));
-
-/* Bindable undo commands. */
-extern int rl_revert_line PARAMS((int, int));
-extern int rl_undo_command PARAMS((int, int));
-
-/* Bindable tilde expansion commands. */
-extern int rl_tilde_expand PARAMS((int, int));
-
-/* Bindable terminal control commands. */
-extern int rl_restart_output PARAMS((int, int));
-extern int rl_stop_output PARAMS((int, int));
-
-/* Miscellaneous bindable commands. */
-extern int rl_abort PARAMS((int, int));
-extern int rl_tty_status PARAMS((int, int));
-
-/* Bindable commands for incremental and non-incremental history searching. */
-extern int rl_history_search_forward PARAMS((int, int));
-extern int rl_history_search_backward PARAMS((int, int));
-extern int rl_noninc_forward_search PARAMS((int, int));
-extern int rl_noninc_reverse_search PARAMS((int, int));
-extern int rl_noninc_forward_search_again PARAMS((int, int));
-extern int rl_noninc_reverse_search_again PARAMS((int, int));
-
-/* Bindable command used when inserting a matching close character. */
-extern int rl_insert_close PARAMS((int, int));
-
-/* Not available unless READLINE_CALLBACKS is defined. */
-extern void rl_callback_handler_install PARAMS((const char *, rl_vcpfunc_t *));
-extern void rl_callback_read_char PARAMS((void));
-extern void rl_callback_handler_remove PARAMS((void));
-
-/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
-/* VI-mode bindable commands. */
-extern int rl_vi_redo PARAMS((int, int));
-extern int rl_vi_undo PARAMS((int, int));
-extern int rl_vi_yank_arg PARAMS((int, int));
-extern int rl_vi_fetch_history PARAMS((int, int));
-extern int rl_vi_search_again PARAMS((int, int));
-extern int rl_vi_search PARAMS((int, int));
-extern int rl_vi_complete PARAMS((int, int));
-extern int rl_vi_tilde_expand PARAMS((int, int));
-extern int rl_vi_prev_word PARAMS((int, int));
-extern int rl_vi_next_word PARAMS((int, int));
-extern int rl_vi_end_word PARAMS((int, int));
-extern int rl_vi_insert_beg PARAMS((int, int));
-extern int rl_vi_append_mode PARAMS((int, int));
-extern int rl_vi_append_eol PARAMS((int, int));
-extern int rl_vi_eof_maybe PARAMS((int, int));
-extern int rl_vi_insertion_mode PARAMS((int, int));
-extern int rl_vi_insert_mode PARAMS((int, int));
-extern int rl_vi_movement_mode PARAMS((int, int));
-extern int rl_vi_arg_digit PARAMS((int, int));
-extern int rl_vi_change_case PARAMS((int, int));
-extern int rl_vi_put PARAMS((int, int));
-extern int rl_vi_column PARAMS((int, int));
-extern int rl_vi_delete_to PARAMS((int, int));
-extern int rl_vi_change_to PARAMS((int, int));
-extern int rl_vi_yank_to PARAMS((int, int));
-extern int rl_vi_rubout PARAMS((int, int));
-extern int rl_vi_delete PARAMS((int, int));
-extern int rl_vi_back_to_indent PARAMS((int, int));
-extern int rl_vi_first_print PARAMS((int, int));
-extern int rl_vi_char_search PARAMS((int, int));
-extern int rl_vi_match PARAMS((int, int));
-extern int rl_vi_change_char PARAMS((int, int));
-extern int rl_vi_subst PARAMS((int, int));
-extern int rl_vi_overstrike PARAMS((int, int));
-extern int rl_vi_overstrike_delete PARAMS((int, int));
-extern int rl_vi_replace PARAMS((int, int));
-extern int rl_vi_set_mark PARAMS((int, int));
-extern int rl_vi_goto_mark PARAMS((int, int));
-
-/* VI-mode utility functions. */
-extern int rl_vi_check PARAMS((void));
-extern int rl_vi_domove PARAMS((int, int *));
-extern int rl_vi_bracktype PARAMS((int));
-
-extern void rl_vi_start_inserting PARAMS((int, int, int));
-
-/* VI-mode pseudo-bindable commands, used as utility functions. */
-extern int rl_vi_fWord PARAMS((int, int));
-extern int rl_vi_bWord PARAMS((int, int));
-extern int rl_vi_eWord PARAMS((int, int));
-extern int rl_vi_fword PARAMS((int, int));
-extern int rl_vi_bword PARAMS((int, int));
-extern int rl_vi_eword PARAMS((int, int));
-
-/* **************************************************************** */
-/*								    */
-/*			Well Published Functions		    */
-/*								    */
-/* **************************************************************** */
-
-/* Readline functions. */
-/* Read a line of input.  Prompt with PROMPT.  A NULL PROMPT means none. */
-extern char *readline PARAMS((const char *));
-
-extern int rl_set_prompt PARAMS((const char *));
-extern int rl_expand_prompt PARAMS((char *));
-
-extern int rl_initialize PARAMS((void));
-
-/* Undocumented; unused by readline */
-extern int rl_discard_argument PARAMS((void));
-
-/* Utility functions to bind keys to readline commands. */
-extern int rl_add_defun PARAMS((const char *, rl_command_func_t *, int));
-extern int rl_bind_key PARAMS((int, rl_command_func_t *));
-extern int rl_bind_key_in_map PARAMS((int, rl_command_func_t *, Keymap));
-extern int rl_unbind_key PARAMS((int));
-extern int rl_unbind_key_in_map PARAMS((int, Keymap));
-extern int rl_bind_key_if_unbound PARAMS((int, rl_command_func_t *));
-extern int rl_bind_key_if_unbound_in_map PARAMS((int, rl_command_func_t *, Keymap));
-extern int rl_unbind_function_in_map PARAMS((rl_command_func_t *, Keymap));
-extern int rl_unbind_command_in_map PARAMS((const char *, Keymap));
-extern int rl_bind_keyseq PARAMS((const char *, rl_command_func_t *));
-extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
-extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));
-extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
-extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
-
-extern char *rl_variable_value PARAMS((const char *));
-extern int rl_variable_bind PARAMS((const char *, const char *));
-
-/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
-extern int rl_set_key PARAMS((const char *, rl_command_func_t *, Keymap));
-
-/* Backwards compatibility, use rl_generic_bind instead. */
-extern int rl_macro_bind PARAMS((const char *, const char *, Keymap));
-
-/* Undocumented in the texinfo manual; not really useful to programs. */
-extern int rl_translate_keyseq PARAMS((const char *, char *, int *));
-extern char *rl_untranslate_keyseq PARAMS((int));
-
-extern rl_command_func_t *rl_named_function PARAMS((const char *));
-extern rl_command_func_t *rl_function_of_keyseq PARAMS((const char *, Keymap, int *));
-
-extern void rl_list_funmap_names PARAMS((void));
-extern char **rl_invoking_keyseqs_in_map PARAMS((rl_command_func_t *, Keymap));
-extern char **rl_invoking_keyseqs PARAMS((rl_command_func_t *));
- 
-extern void rl_function_dumper PARAMS((int));
-extern void rl_macro_dumper PARAMS((int));
-extern void rl_variable_dumper PARAMS((int));
-
-extern int rl_read_init_file PARAMS((const char *));
-extern int rl_parse_and_bind PARAMS((char *));
-
-/* Functions for manipulating keymaps. */
-extern Keymap rl_make_bare_keymap PARAMS((void));
-extern Keymap rl_copy_keymap PARAMS((Keymap));
-extern Keymap rl_make_keymap PARAMS((void));
-extern void rl_discard_keymap PARAMS((Keymap));
-
-extern Keymap rl_get_keymap_by_name PARAMS((const char *));
-extern char *rl_get_keymap_name PARAMS((Keymap));
-extern void rl_set_keymap PARAMS((Keymap));
-extern Keymap rl_get_keymap PARAMS((void));
-/* Undocumented; used internally only. */
-extern void rl_set_keymap_from_edit_mode PARAMS((void));
-extern char *rl_get_keymap_name_from_edit_mode PARAMS((void));
-
-/* Functions for manipulating the funmap, which maps command names to functions. */
-extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *));
-extern const char **rl_funmap_names PARAMS((void));
-/* Undocumented, only used internally -- there is only one funmap, and this
-   function may be called only once. */
-extern void rl_initialize_funmap PARAMS((void));
-
-/* Utility functions for managing keyboard macros. */
-extern void rl_push_macro_input PARAMS((char *));
-
-/* Functions for undoing, from undo.c */
-extern void rl_add_undo PARAMS((enum undo_code, int, int, char *));
-extern void rl_free_undo_list PARAMS((void));
-extern int rl_do_undo PARAMS((void));
-extern int rl_begin_undo_group PARAMS((void));
-extern int rl_end_undo_group PARAMS((void));
-extern int rl_modifying PARAMS((int, int));
-
-/* Functions for redisplay. */
-extern void rl_redisplay PARAMS((void));
-extern int rl_on_new_line PARAMS((void));
-extern int rl_on_new_line_with_prompt PARAMS((void));
-extern int rl_forced_update_display PARAMS((void));
-extern int rl_clear_message PARAMS((void));
-extern int rl_reset_line_state PARAMS((void));
-extern int rl_crlf PARAMS((void));
-
-extern int rl_message (const char *, ...);
-
-extern int rl_show_char PARAMS((int));
-
-/* Undocumented in texinfo manual. */
-extern int rl_character_len PARAMS((int, int));
-
-/* Save and restore internal prompt redisplay information. */
-extern void rl_save_prompt PARAMS((void));
-extern void rl_restore_prompt PARAMS((void));
-
-/* Modifying text. */
-extern void rl_replace_line PARAMS((const char *, int));
-extern int rl_insert_text PARAMS((const char *));
-extern int rl_delete_text PARAMS((int, int));
-extern int rl_kill_text PARAMS((int, int));
-extern char *rl_copy_text PARAMS((int, int));
-
-/* Terminal and tty mode management. */
-extern void rl_prep_terminal PARAMS((int));
-extern void rl_deprep_terminal PARAMS((void));
-extern void rl_tty_set_default_bindings PARAMS((Keymap));
-extern void rl_tty_unset_default_bindings PARAMS((Keymap));
-
-extern int rl_reset_terminal PARAMS((const char *));
-extern void rl_resize_terminal PARAMS((void));
-extern void rl_set_screen_size PARAMS((int, int));
-extern void rl_get_screen_size PARAMS((int *, int *));
-extern void rl_reset_screen_size PARAMS((void));
-
-extern char *rl_get_termcap PARAMS((const char *));
-
-/* Functions for character input. */
-extern int rl_stuff_char PARAMS((int));
-extern int rl_execute_next PARAMS((int));
-extern int rl_clear_pending_input PARAMS((void));
-extern int rl_read_key PARAMS((void));
-extern int rl_getc PARAMS((TFile));
-extern int rl_set_keyboard_input_timeout PARAMS((int));
-
-/* `Public' utility functions . */
-extern void rl_extend_line_buffer PARAMS((int));
-extern int rl_ding PARAMS((void));
-extern int rl_alphabetic PARAMS((int));
-extern void rl_free PARAMS((void *));
-
-/* Readline signal handling, from signals.c */
-extern int rl_set_signals PARAMS((void));
-extern int rl_clear_signals PARAMS((void));
-extern void rl_cleanup_after_signal PARAMS((void));
-extern void rl_reset_after_signal PARAMS((void));
-extern void rl_free_line_state PARAMS((void));
-
-extern void rl_echo_signal_char PARAMS((int)); 
-
-extern int rl_set_paren_blink_timeout PARAMS((int));
-
-/* Undocumented. */
-extern int rl_maybe_save_line PARAMS((void));
-extern int rl_maybe_unsave_line PARAMS((void));
-extern int rl_maybe_replace_line PARAMS((void));
-
-/* Completion functions. */
-extern int rl_complete_internal PARAMS((int));
-extern void rl_display_match_list PARAMS((char **, int, int));
-
-extern char **rl_completion_matches PARAMS((const char *, rl_compentry_func_t *));
-extern char *rl_username_completion_function PARAMS((const char *, int));
-extern char *rl_filename_completion_function PARAMS((const char *, int));
-
-extern int rl_completion_mode PARAMS((rl_command_func_t *));
-
-/* **************************************************************** */
-/*								    */
-/*			Well Published Variables		    */
-/*								    */
-/* **************************************************************** */
-
-#if false
-
-/* The version of this incarnation of the readline library. */
-extern const char *rl_library_version;		/* e.g., "4.2" */
-extern int rl_readline_version;			/* e.g., 0x0402 */
-
-/* True if this is real GNU readline. */
-extern int rl_gnu_readline_p;
-
-/* Flags word encapsulating the current readline state. */
-extern int rl_readline_state;
-
-/* Says which editing mode readline is currently using.  1 means emacs mode;
-   0 means vi mode. */
-extern int rl_editing_mode;
-
-/* Insert or overwrite mode for emacs mode.  1 means insert mode; 0 means
-   overwrite mode.  Reset to insert mode on each input line. */
-extern int rl_insert_mode;
-
-/* The name of the calling program.  You should initialize this to
-   whatever was in argv[0].  It is used when parsing conditionals. */
-extern const char *rl_readline_name;
-
-/* The prompt readline uses.  This is set from the argument to
-   readline (), and should not be assigned to directly. */
-extern char *rl_prompt;
-
-/* The prompt string that is actually displayed by rl_redisplay.  Public so
-   applications can more easily supply their own redisplay functions. */
-extern char *rl_display_prompt;
-
-/* The line buffer that is in use. */
-extern char *rl_line_buffer;
-
-/* The location of point, and end. */
-extern int rl_point;
-extern int rl_end;
-
-/* The mark, or saved cursor position. */
-extern int rl_mark;
-
-/* Flag to indicate that readline has finished with the current input
-   line and should return it. */
-extern int rl_done;
-
-/* If set to a character value, that will be the next keystroke read. */
-extern int rl_pending_input;
-
-/* Non-zero if we called this function from _rl_dispatch().  It's present
-   so functions can find out whether they were called from a key binding
-   or directly from an application. */
-extern int rl_dispatching;
-
-/* Non-zero if the user typed a numeric argument before executing the
-   current function. */
-extern int rl_explicit_arg;
-
-/* The current value of the numeric argument specified by the user. */
-extern int rl_numeric_arg;
-
-/* The address of the last command function Readline executed. */
-extern rl_command_func_t *rl_last_func;
-
-/* The name of the terminal to use. */
-extern const char *rl_terminal_name;
-
-/* The input and output streams. */
-extern FILE *rl_instream;
-extern FILE *rl_outstream;
-
-/* If non-zero, Readline gives values of LINES and COLUMNS from the environment
-   greater precedence than values fetched from the kernel when computing the
-   screen dimensions. */
-extern int rl_prefer_env_winsize;
-
-/* If non-zero, then this is the address of a function to call just
-   before readline_internal () prints the first prompt. */
-extern rl_hook_func_t *rl_startup_hook;
-
-/* If non-zero, this is the address of a function to call just before
-   readline_internal_setup () returns and readline_internal starts
-   reading input characters. */
-extern rl_hook_func_t *rl_pre_input_hook;
-      
-/* The address of a function to call periodically while Readline is
-   awaiting character input, or NULL, for no event handling. */
-extern rl_hook_func_t *rl_event_hook;
-
-/* The address of the function to call to fetch a character from the current
-   Readline input stream */
-extern rl_getc_func_t *rl_getc_function;
-
-extern rl_voidfunc_t *rl_redisplay_function;
-
-extern rl_vintfunc_t *rl_prep_term_function;
-extern rl_voidfunc_t *rl_deprep_term_function;
-
-/* Dispatch variables. */
-extern Keymap rl_executing_keymap;
-extern Keymap rl_binding_keymap;
-
-/* Display variables. */
-/* If non-zero, readline will erase the entire line, including any prompt,
-   if the only thing typed on an otherwise-blank line is something bound to
-   rl_newline. */
-extern int rl_erase_empty_line;
-
-/* If non-zero, the application has already printed the prompt (rl_prompt)
-   before calling readline, so readline should not output it the first time
-   redisplay is done. */
-extern int rl_already_prompted;
-
-/* A non-zero value means to read only this many characters rather than
-   up to a character bound to accept-line. */
-extern int rl_num_chars_to_read;
-
-/* The text of a currently-executing keyboard macro. */
-extern char *rl_executing_macro;
-
-/* Variables to control readline signal handling. */
-/* If non-zero, readline will install its own signal handlers for
-   SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
-extern int rl_catch_signals;
-
-/* If non-zero, readline will install a signal handler for SIGWINCH
-   that also attempts to call any calling application's SIGWINCH signal
-   handler.  Note that the terminal is not cleaned up before the
-   application's signal handler is called; use rl_cleanup_after_signal()
-   to do that. */
-extern int rl_catch_sigwinch;
-
-/* Completion variables. */
-/* Pointer to the generator function for completion_matches ().
-   NULL means to use rl_filename_completion_function (), the default
-   filename completer. */
-extern rl_compentry_func_t *rl_completion_entry_function;
-
-/* Optional generator for menu completion.  Default is
-   rl_completion_entry_function (rl_filename_completion_function). */
- extern rl_compentry_func_t *rl_menu_completion_entry_function;
-
-/* If rl_ignore_some_completions_function is non-NULL it is the address
-   of a function to call after all of the possible matches have been
-   generated, but before the actual completion is done to the input line.
-   The function is called with one argument; a NULL terminated array
-   of (char *).  If your function removes any of the elements, they
-   must be free()'ed. */
-extern rl_compignore_func_t *rl_ignore_some_completions_function;
-
-/* Pointer to alternative function to create matches.
-   Function is called with TEXT, START, and END.
-   START and END are indices in RL_LINE_BUFFER saying what the boundaries
-   of TEXT are.
-   If this function exists and returns NULL then call the value of
-   rl_completion_entry_function to try to match, otherwise use the
-   array of strings returned. */
-extern rl_completion_func_t *rl_attempted_completion_function;
-
-/* The basic list of characters that signal a break between words for the
-   completer routine.  The initial contents of this variable is what
-   breaks words in the shell, i.e. "n\"\\'`@$>". */
-extern const char *rl_basic_word_break_characters;
-
-/* The list of characters that signal a break between words for
-   rl_complete_internal.  The default list is the contents of
-   rl_basic_word_break_characters.  */
-extern /*const*/ char *rl_completer_word_break_characters;
-
-/* Hook function to allow an application to set the completion word
-   break characters before readline breaks up the line.  Allows
-   position-dependent word break characters. */
-extern rl_cpvfunc_t *rl_completion_word_break_hook;
-
-/* List of characters which can be used to quote a substring of the line.
-   Completion occurs on the entire substring, and within the substring   
-   rl_completer_word_break_characters are treated as any other character,
-   unless they also appear within this list. */
-extern const char *rl_completer_quote_characters;
-
-/* List of quote characters which cause a word break. */
-extern const char *rl_basic_quote_characters;
-
-/* List of characters that need to be quoted in filenames by the completer. */
-extern const char *rl_filename_quote_characters;
-
-/* List of characters that are word break characters, but should be left
-   in TEXT when it is passed to the completion function.  The shell uses
-   this to help determine what kind of completing to do. */
-extern const char *rl_special_prefixes;
-
-/* If non-zero, then this is the address of a function to call when
-   completing on a directory name.  The function is called with
-   the address of a string (the current directory name) as an arg.  It
-   changes what is displayed when the possible completions are printed
-   or inserted. */
-extern rl_icppfunc_t *rl_directory_completion_hook;
-
-/* If non-zero, this is the address of a function to call when completing
-   a directory name.  This function takes the address of the directory name
-   to be modified as an argument.  Unlike rl_directory_completion_hook, it
-   only modifies the directory name used in opendir(2), not what is displayed
-   when the possible completions are printed or inserted.  It is called
-   before rl_directory_completion_hook.  I'm not happy with how this works
-   yet, so it's undocumented. */
-extern rl_icppfunc_t *rl_directory_rewrite_hook;
-
-/* If non-zero, this is the address of a function to call when reading
-   directory entries from the filesystem for completion and comparing
-   them to the partial word to be completed.  The function should
-   either return its first argument (if no conversion takes place) or
-   newly-allocated memory.  This can, for instance, convert filenames
-   between character sets for comparison against what's typed at the
-   keyboard.  The returned value is what is added to the list of
-   matches.  The second argument is the length of the filename to be
-   converted. */
-extern rl_dequote_func_t *rl_filename_rewrite_hook;
-
-/* If non-zero, then this is the address of a function to call when
-   completing a word would normally display the list of possible matches.
-   This function is called instead of actually doing the display.
-   It takes three arguments: (char **matches, int num_matches, int max_length)
-   where MATCHES is the array of strings that matched, NUM_MATCHES is the
-   number of strings in that array, and MAX_LENGTH is the length of the
-   longest string in that array. */
-extern rl_compdisp_func_t *rl_completion_display_matches_hook;
-
-/* Non-zero means that the results of the matches are to be treated
-   as filenames.  This is ALWAYS zero on entry, and can only be changed
-   within a completion entry finder function. */
-extern int rl_filename_completion_desired;
-
-/* Non-zero means that the results of the matches are to be quoted using
-   double quotes (or an application-specific quoting mechanism) if the
-   filename contains any characters in rl_word_break_chars.  This is
-   ALWAYS non-zero on entry, and can only be changed within a completion
-   entry finder function. */
-extern int rl_filename_quoting_desired;
-
-/* Set to a function to quote a filename in an application-specific fashion.
-   Called with the text to quote, the type of match found (single or multiple)
-   and a pointer to the quoting character to be used, which the function can
-   reset if desired. */
-extern rl_quote_func_t *rl_filename_quoting_function;
-
-/* Function to call to remove quoting characters from a filename.  Called
-   before completion is attempted, so the embedded quotes do not interfere
-   with matching names in the file system. */
-extern rl_dequote_func_t *rl_filename_dequoting_function;
-
-/* Function to call to decide whether or not a word break character is
-   quoted.  If a character is quoted, it does not break words for the
-   completer. */
-extern rl_linebuf_func_t *rl_char_is_quoted_p;
-
-/* Non-zero means to suppress normal filename completion after the
-   user-specified completion function has been called. */
-extern int rl_attempted_completion_over;
-
-/* Set to a character describing the type of completion being attempted by
-   rl_complete_internal; available for use by application completion
-   functions. */
-extern int rl_completion_type;
-
-/* Set to the last key used to invoke one of the completion functions */
-extern int rl_completion_invoking_key;
-
-/* Up to this many items will be displayed in response to a
-   possible-completions call.  After that, we ask the user if she
-   is sure she wants to see them all.  The default value is 100. */
-extern int rl_completion_query_items;
-
-/* Character appended to completed words when at the end of the line.  The
-   default is a space.  Nothing is added if this is '\0'. */
-extern int rl_completion_append_character;
-
-/* If set to non-zero by an application completion function,
-   rl_completion_append_character will not be appended. */
-extern int rl_completion_suppress_append;
-
-/* Set to any quote character readline thinks it finds before any application
-   completion function is called. */
-extern int rl_completion_quote_character;
-
-/* Set to a non-zero value if readline found quoting anywhere in the word to
-   be completed; set before any application completion function is called. */
-extern int rl_completion_found_quote;
-
-/* If non-zero, the completion functions don't append any closing quote.
-   This is set to 0 by rl_complete_internal and may be changed by an
-   application-specific completion function. */
-extern int rl_completion_suppress_quote;
-
-/* If non-zero, readline will sort the completion matches.  On by default. */
-extern int rl_sort_completion_matches;
-
-/* If non-zero, a slash will be appended to completed filenames that are
-   symbolic links to directory names, subject to the value of the
-   mark-directories variable (which is user-settable).  This exists so
-   that application completion functions can override the user's preference
-   (set via the mark-symlinked-directories variable) if appropriate.
-   It's set to the value of _rl_complete_mark_symlink_dirs in
-   rl_complete_internal before any application-specific completion
-   function is called, so without that function doing anything, the user's
-   preferences are honored. */
-extern int rl_completion_mark_symlink_dirs;
-
-/* If non-zero, then disallow duplicates in the matches. */
-extern int rl_ignore_completion_duplicates;
-
-/* If this is non-zero, completion is (temporarily) inhibited, and the
-   completion character will be inserted as any other. */
-extern int rl_inhibit_completion;
-
-#endif
-
-/* Input error; can be returned by (*rl_getc_function) if readline is reading
-   a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */
-#define READERR			(-2)
-
-/* Definitions available for use by readline clients. */
-#define RL_PROMPT_START_IGNORE	'\001'
-#define RL_PROMPT_END_IGNORE	'\002'
-
-/* Possible values for do_replace argument to rl_filename_quoting_function,
-   called by rl_complete_internal. */
-#define NO_MATCH        0
-#define SINGLE_MATCH    1
-#define MULT_MATCH      2
-
-/* Possible state values for rl_readline_state */
-#define RL_STATE_NONE		0x000000		/* no state; before first call */
-
-#define RL_STATE_INITIALIZING	0x000001	/* initializing */
-#define RL_STATE_INITIALIZED	0x000002	/* initialization done */
-#define RL_STATE_TERMPREPPED	0x000004	/* terminal is prepped */
-#define RL_STATE_READCMD	0x000008	/* reading a command key */
-#define RL_STATE_METANEXT	0x000010	/* reading input after ESC */
-#define RL_STATE_DISPATCHING	0x000020	/* dispatching to a command */
-#define RL_STATE_MOREINPUT	0x000040	/* reading more input in a command function */
-#define RL_STATE_ISEARCH	0x000080	/* doing incremental search */
-#define RL_STATE_NSEARCH	0x000100	/* doing non-inc search */
-#define RL_STATE_SEARCH		0x000200	/* doing a history search */
-#define RL_STATE_NUMERICARG	0x000400	/* reading numeric argument */
-#define RL_STATE_MACROINPUT	0x000800	/* getting input from a macro */
-#define RL_STATE_MACRODEF	0x001000	/* defining keyboard macro */
-#define RL_STATE_OVERWRITE	0x002000	/* overwrite mode */
-#define RL_STATE_COMPLETING	0x004000	/* doing completion */
-#define RL_STATE_SIGHANDLER	0x008000	/* in readline sighandler */
-#define RL_STATE_UNDOING	0x010000	/* doing an undo */
-#define RL_STATE_INPUTPENDING	0x020000	/* rl_execute_next called */
-#define RL_STATE_TTYCSAVED	0x040000	/* tty special chars saved */
-#define RL_STATE_CALLBACK	0x080000	/* using the callback interface */
-#define RL_STATE_VIMOTION	0x100000	/* reading vi motion arg */
-#define RL_STATE_MULTIKEY	0x200000	/* reading multiple-key command */
-#define RL_STATE_VICMDONCE	0x400000	/* entered vi command mode at least once */
-#define RL_STATE_REDISPLAYING	0x800000	/* updating terminal display */
-
-#define RL_STATE_DONE		0x1000000	/* done; accepted line */
-
-#define RL_SETSTATE(x)		(rl_readline_state |= (x))
-#define RL_UNSETSTATE(x)	(rl_readline_state &= ~(x))
-#define RL_ISSTATE(x)		(rl_readline_state & (x))
-
-struct readline_state {
-  /* line state */
-  int point;
-  int end;
-  int mark;
-  char *buffer;
-  int buflen;
-  UNDO_LIST *ul;
-  char *prompt;
-
-  /* global state */
-  int rlstate;
-  int done;
-  Keymap kmap;
-
-  /* input state */
-  rl_command_func_t *lastfunc;
-  int insmode;
-  int edmode;
-  int kseqlen;
-  FILE *inf;
-  FILE *outf;
-  int pendingin;
-  char *macro;
-
-  /* signal state */
-  int catchsigs;
-  int catchsigwinch;
-
-  /* search state */
-
-  /* completion state */
-
-  /* options state */
-
-  /* reserved for future expansion, so the struct size doesn't change */
-  char reserved[64];
-};
-
-extern int rl_save_state PARAMS((struct readline_state *));
-extern int rl_restore_state PARAMS((struct readline_state *));
-
diff --git a/lib/wrappers/readline/tweaked/rltypedefs.h b/lib/wrappers/readline/tweaked/rltypedefs.h
deleted file mode 100644
index 46bb42567..000000000
--- a/lib/wrappers/readline/tweaked/rltypedefs.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* rltypedefs.h -- Type declarations for readline functions. */
-
-/* Copyright (C) 2000-2009 Free Software Foundation, Inc.
-
-   This file is part of the GNU Readline Library (Readline), a library
-   for reading lines of text with interactive input and history editing.      
-
-   Readline is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   Readline is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef C2NIM
-#  cdecl
-#  prefix rl_
-#  prefix RL_
-#  suffix _t
-#  typeprefixes
-#  def PARAMS(x) x
-#endif
-
-typedef int (*Function) ();
-typedef void VFunction ();
-typedef char *CPFunction ();
-typedef char **CPPFunction ();
-
-/* Bindable functions */
-typedef int rl_command_func_t PARAMS((int, int));
-
-/* Typedefs for the completion system */
-typedef char *rl_compentry_func_t PARAMS((const char *, int));
-typedef char **rl_completion_func_t PARAMS((const char *, int, int));
-
-typedef char *rl_quote_func_t PARAMS((char *, int, char *));
-typedef char *rl_dequote_func_t PARAMS((char *, int));
-
-typedef int rl_compignore_func_t PARAMS((char **));
-
-typedef void rl_compdisp_func_t PARAMS((char **, int, int));
-
-/* Type for input and pre-read hook functions like rl_event_hook */
-typedef int rl_hook_func_t PARAMS((void));
-
-/* Input function type */
-typedef int rl_getc_func_t PARAMS((TFile));
-
-/* Generic function that takes a character buffer (which could be the readline
-   line buffer) and an index into it (which could be rl_point) and returns
-   an int. */
-typedef int rl_linebuf_func_t PARAMS((char *, int));
-
-/* `Generic' function pointer typedefs */
-typedef int rl_intfunc_t PARAMS((int));
-typedef int rl_ivoidfunc_t PARAMS((void));
-
-typedef int rl_icpfunc_t PARAMS((char *));
-typedef int rl_icppfunc_t PARAMS((char **));
-
-typedef void rl_voidfunc_t PARAMS((void));
-typedef void rl_vintfunc_t PARAMS((int));
-typedef void rl_vcpfunc_t PARAMS((char *));
-typedef void rl_vcppfunc_t PARAMS((char **));
-
-typedef char *rl_cpvfunc_t PARAMS((void));
-typedef char *rl_cpifunc_t PARAMS((int));
-typedef char *rl_cpcpfunc_t PARAMS((char  *));
-typedef char *rl_cpcppfunc_t PARAMS((char  **));
-
-
diff --git a/lib/wrappers/readline/tweaked/tilde.h b/lib/wrappers/readline/tweaked/tilde.h
deleted file mode 100644
index d91d0418d..000000000
--- a/lib/wrappers/readline/tweaked/tilde.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* tilde.h: Externally available variables and function in libtilde.a. */
-
-/* Copyright (C) 1992-2009 Free Software Foundation, Inc.
-
-   This file contains the Readline Library (Readline), a set of
-   routines for providing Emacs style line input to programs that ask
-   for it.
-
-   Readline is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   Readline is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef C2NIM
-#  private tildeDll
-#  dynlib tildeDll
-#  cdecl
-#  if defined(windows)
-#    define tildeDll "tilde.dll"
-#  elif defined(macosx)
-#    define tildeDll "libtilde.dynlib"
-#  else
-#    define tildeDll "libtilde.so.6(|.0)"
-#  endif
-#  prefix tilde_
-#  suffix _t
-#  typeprefixes
-#  def PARAMS(x) x
-#endif
-
-typedef char *tilde_hook_func_t PARAMS((char *));
-
-#if false
-
-/* If non-null, this contains the address of a function that the application
-   wants called before trying the standard tilde expansions.  The function
-   is called with the text sans tilde, and returns a malloc()'ed string
-   which is the expansion, or a NULL pointer if the expansion fails. */
-extern tilde_hook_func_t *tilde_expansion_preexpansion_hook;
-
-/* If non-null, this contains the address of a function to call if the
-   standard meaning for expanding a tilde fails.  The function is called
-   with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
-   which is the expansion, or a NULL pointer if there is no expansion. */
-extern tilde_hook_func_t *tilde_expansion_failure_hook;
-
-/* When non-null, this is a NULL terminated array of strings which
-   are duplicates for a tilde prefix.  Bash uses this to expand
-   `=~' and `:~'. */
-extern char **tilde_additional_prefixes;
-
-/* When non-null, this is a NULL terminated array of strings which match
-   the end of a username, instead of just "/".  Bash sets this to
-   `:' and `=~'. */
-extern char **tilde_additional_suffixes;
-
-/* Return a new string which is the result of tilde expanding STRING. */
-extern char *tilde_expand PARAMS((const char *));
-
-/* Do the work of tilde expansion on FILENAME.  FILENAME starts with a
-   tilde.  If there is no expansion, call tilde_expansion_failure_hook. */
-extern char *tilde_expand_word PARAMS((const char *));
-
-/* Find the portion of the string beginning with ~ that should be expanded. */
-extern char *tilde_find_word PARAMS((const char *, int, int *));
-
-#endif
-
diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim
deleted file mode 100644
index 376de8e08..000000000
--- a/lib/wrappers/sdl/sdl.nim
+++ /dev/null
@@ -1,2579 +0,0 @@
-#******************************************************************************
-#
-#          JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer
-#             Conversion of the Simple DirectMedia Layer Headers
-#
-# Portions created by Sam Lantinga <slouken@devolution.com> are
-# Copyright (C) 1997-2004  Sam Lantinga
-# 5635-34 Springhouse Dr.
-# Pleasanton, CA 94588 (USA)
-#
-# All Rights Reserved.
-#
-# The original files are : SDL.h
-#                          SDL_main.h
-#                          SDL_types.h
-#                          SDL_rwops.h
-#                          SDL_timer.h
-#                          SDL_audio.h
-#                          SDL_cdrom.h
-#                          SDL_joystick.h
-#                          SDL_mouse.h
-#                          SDL_keyboard.h
-#                          SDL_events.h
-#                          SDL_video.h
-#                          SDL_byteorder.h
-#                          SDL_version.h
-#                          SDL_active.h
-#                          SDL_thread.h
-#                          SDL_mutex .h
-#                          SDL_getenv.h
-#                          SDL_loadso.h
-#
-# The initial developer of this Pascal code was :
-# Dominique Louis <Dominique@SavageSoftware.com.au>
-#
-# Portions created by Dominique Louis are
-# Copyright (C) 2000 - 2004 Dominique Louis.
-#
-#
-# Contributor(s)
-# --------------
-# Tom Jones <tigertomjones@gmx.de>  His Project inspired this conversion
-# Matthias Thoma <ma.thoma@gmx.de>
-#
-# Obtained through:
-# Joint Endeavour of Delphi Innovators ( Project JEDI )
-#
-# You may retrieve the latest version of this file at the Project
-# JEDI home page, located at http://delphi-jedi.org
-#
-# The contents of this file are used with permission, subject to
-# the Mozilla Public License Version 1.1 (the "License"); you may
-# not use this file except in compliance with the License. You may
-# obtain a copy of the License at
-# http://www.mozilla.org/MPL/MPL-1.1.html
-#
-# Software distributed under the License is distributed on an
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# Description
-# -----------
-#
-#
-#
-#
-#
-#
-#
-# Requires
-# --------
-#   The SDL Runtime libraris on Win32  : SDL.dll on Linux : libSDL.so
-#   They are available from...
-#   http://www.libsdl.org .
-#
-# Programming Notes
-# -----------------
-#
-#
-#
-#
-# Revision History
-# ----------------
-#   May      08 2001 - DL : Added Keyboard  State Array ( See demos for how to
-#                           use )
-#                           PKeyStateArr = ^TKeyStateArr;
-#                           TKeyStateArr = array[0..65000] of byte;
-#                           As most games will need it.
-#
-#   April    02 2001 - DL : Added SDL_getenv.h definitions and tested version
-#                           1.2.0 compatibility.
-#
-#   March    13 2001 - MT : Added Linux compatibility.
-#
-#   March    10 2001 - MT : Added externalsyms for DEFINES
-#                           Changed the license header
-#
-#   March    09 2001 - MT : Added Kylix Ifdefs/Deleted the uses mmsystem
-#
-#   March    01 2001 - DL : Update conversion of version 1.1.8
-#
-#   July     22 2001 - DL : Added TUInt8Array and PUIntArray after suggestions
-#                           from Matthias Thoma and Eric Grange.
-#
-#   October  12 2001 - DL : Various changes as suggested by Matthias Thoma and
-#                           David Acklam
-#
-#   October  24 2001 - DL : Added FreePascal support as per suggestions from
-#                           Dean Ellis.
-#
-#   October  27 2001 - DL : Added SDL_BUTTON macro
-#
-#  November  08 2001 - DL : Bug fix as pointed out by Puthoon.
-#
-#  November  29 2001 - DL : Bug fix of SDL_SetGammaRamp as pointed out by Simon
-#                           Rushton.
-#
-#  November  30 2001 - DL : SDL_NOFRAME added as pointed out by Simon Rushton.
-#
-#  December  11 2001 - DL : Added $WEAKPACKAGEUNIT ON to facilitate usage in
-#                           Components
-#
-#  January   05 2002 - DL : Added SDL_Swap32 function as suggested by Matthias
-#                           Thoma and also made sure the _getenv from
-#                           MSVCRT.DLL uses the right calling convention
-#
-#  January   25 2002 - DL : Updated conversion of SDL_AddTimer &
-#                           SDL_RemoveTimer as per suggestions from Matthias
-#                           Thoma.
-#
-#  January   27 2002 - DL : Commented out exported function putenv and getenv
-#                           So that developers get used to using SDL_putenv
-#                           SDL_getenv, as they are more portable
-#
-#  March     05 2002 - DL : Added FreeAnNil procedure for Delphi 4 users.
-#
-#  October   23 2002 - DL : Added Delphi 3 Define of Win32.
-#                           If you intend to you Delphi 3...
-#                           ( which is officially unsupported ) make sure you
-#                           remove references to $EXTERNALSYM in this and other
-#                           SDL files.
-#
-# November  29 2002 - DL : Fixed bug in Declaration of SDL_GetRGBA that was
-#                          pointed out by Todd Lang
-#
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more
-#                          Pascal compilers. Initial support is now included
-#                          for GnuPascal, VirtualPascal, TMT and obviously
-#                          continue support for Delphi Kylix and FreePascal.
-#
-#   April   08 2003 - MK : Aka Mr Kroket - Added Better FPC support
-#
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support
-#
-#   April   30 2003 - DL : under instruction from David Mears AKA
-#                          Jason Siletto, I have added FPC Linux support.
-#                          This was compiled with fpc 1.1, so remember to set
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*
-#
-#
-#
-#  Revision 1.31  2007/05/29 21:30:48  savage
-#  Changes as suggested by Almindor for 64bit compatibility.
-#
-#  Revision 1.30  2007/05/29 19:31:03  savage
-#  Fix to TSDL_Overlay structure - thanks David Pethes (aka imcold)
-#
-#  Revision 1.29  2007/05/20 20:29:11  savage
-#  Initial Changes to Handle 64 Bits
-#
-#  Revision 1.26  2007/02/11 13:38:04  savage
-#  Added Nintendo DS support - Thanks Dean.
-#
-#  Revision 1.25  2006/12/02 00:12:52  savage
-#  Updated to latest version
-#
-#  Revision 1.24  2006/05/18 21:10:04  savage
-#  Added 1.2.10 Changes
-#
-#  Revision 1.23  2005/12/04 23:17:52  drellis
-#  Added declaration of SInt8 and PSInt8
-#
-#  Revision 1.22  2005/05/24 21:59:03  savage
-#  Re-arranged uses clause to work on Win32 and Linux, Thanks again Michalis.
-#
-#  Revision 1.21  2005/05/22 18:42:31  savage
-#  Changes as suggested by Michalis Kamburelis. Thanks again.
-#
-#  Revision 1.20  2005/04/10 11:48:33  savage
-#  Changes as suggested by Michalis, thanks.
-#
-#  Revision 1.19  2005/01/05 01:47:06  savage
-#  Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively.
-#
-#  Revision 1.18  2005/01/04 23:14:41  savage
-#  Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively.
-#
-#  Revision 1.17  2005/01/03 18:40:59  savage
-#  Updated Version number to reflect latest one
-#
-#  Revision 1.16  2005/01/01 02:02:06  savage
-#  Updated to v1.2.8
-#
-#  Revision 1.15  2004/12/24 18:57:11  savage
-#  forgot to apply Michalis Kamburelis' patch to the implementation section. now fixed
-#
-#  Revision 1.14  2004/12/23 23:42:18  savage
-#  Applied Patches supplied by Michalis Kamburelis ( THANKS! ), for greater FreePascal compatibility.
-#
-#  Revision 1.13  2004/09/30 22:31:59  savage
-#  Updated with slightly different header comments
-#
-#  Revision 1.12  2004/09/12 21:52:58  savage
-#  Slight changes to fix some issues with the sdl classes.
-#
-#  Revision 1.11  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.10  2004/07/20 23:57:33  savage
-#  Thanks to Paul Toth for spotting an error in the SDL Audio Conversion structures.
-#  In TSDL_AudioCVT the filters variable should point to and array of pointers and not what I had there previously.
-#
-#  Revision 1.9  2004/07/03 22:07:22  savage
-#  Added Bitwise Manipulation Functions for TSDL_VideoInfo struct.
-#
-#  Revision 1.8  2004/05/10 14:10:03  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.7  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.6  2004/04/01 20:53:23  savage
-#  Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.5  2004/02/22 15:32:10  savage
-#  SDL_GetEnv Fix so it also works on FPC/Linux. Thanks to Rodrigo for pointing this out.
-#
-#  Revision 1.4  2004/02/21 23:24:29  savage
-#  SDL_GetEnv Fix so that it is not define twice for FPC. Thanks to Rene Hugentobler for pointing out this bug,
-#
-#  Revision 1.3  2004/02/18 22:35:51  savage
-#  Brought sdl.pas up to 1.2.7 compatibility
-#  Thus...
-#  Added SDL_GL_STEREO,
-#      SDL_GL_MULTISAMPLEBUFFERS,
-#      SDL_GL_MULTISAMPLESAMPLES
-#
-#  Add DLL/Shared object functions
-#  function SDL_LoadObject( const sofile : PChar ) : pointer;
-#
-#  function SDL_LoadFunction( handle : pointer; const name : PChar ) : pointer;
-#
-#  procedure SDL_UnloadObject( handle : pointer );
-#
-#  Added function to create RWops from const memory: SDL_RWFromConstMem()
-#  function SDL_RWFromConstMem(const mem: pointer; size: Integer) : PSDL_RWops;
-#
-#  Ported SDL_cpuinfo.h so Now you can test for Specific CPU types.
-#
-#  Revision 1.2  2004/02/17 21:37:12  savage
-#  Tidying up of units
-#
-#  Revision 1.1  2004/02/05 00:08:20  savage
-#  Module 1.0 release
-#
-#
-
-{.deadCodeElim: on.}
-import unsigned
-when defined(windows): 
-  const 
-    LibName = "SDL.dll"
-elif defined(macosx): 
-  const 
-    LibName = "libSDL-1.2.0.dylib"
-else: 
-  const 
-    LibName = "libSDL.so(|.1|.0)"
-const 
-  MAJOR_VERSION* = 1
-  MINOR_VERSION* = 2
-  PATCHLEVEL* = 11         # SDL.h constants
-  INIT_TIMER* = 0x00000001
-  INIT_AUDIO* = 0x00000010
-  INIT_VIDEO* = 0x00000020
-  INIT_CDROM* = 0x00000100
-  INIT_JOYSTICK* = 0x00000200
-  INIT_NOPARACHUTE* = 0x00100000 # Don't catch fatal signals
-  INIT_EVENTTHREAD* = 0x01000000 # Not supported on all OS's
-  INIT_EVERYTHING* = 0x0000FFFF # SDL_error.h constants
-  ERR_MAX_STRLEN* = 128
-  ERR_MAX_ARGS* = 5           # SDL_types.h constants
-  PRESSED* = 0x00000001
-  RELEASED* = 0x00000000      # SDL_timer.h constants
-                              # This is the OS scheduler timeslice, in milliseconds
-  TIMESLICE* = 10             # This is the maximum resolution of the SDL timer on all platforms
-  TIMER_RESOLUTION* = 10      # Experimentally determined
-                              # SDL_audio.h constants
-  AUDIO_U8* = 0x00000008      # Unsigned 8-bit samples
-  AUDIO_S8* = 0x00008008      # Signed 8-bit samples
-  AUDIO_U16LSB* = 0x00000010  # Unsigned 16-bit samples
-  AUDIO_S16LSB* = 0x00008010  # Signed 16-bit samples
-  AUDIO_U16MSB* = 0x00001010  # As above, but big-endian byte order
-  AUDIO_S16MSB* = 0x00009010  # As above, but big-endian byte order
-  AUDIO_U16* = AUDIO_U16LSB
-  AUDIO_S16* = AUDIO_S16LSB   # SDL_cdrom.h constants
-                              # The maximum number of CD-ROM tracks on a disk
-  MAX_TRACKS* = 99            # The types of CD-ROM track possible
-  AUDIO_TRACK* = 0x00000000
-  DATA_TRACK* = 0x00000004    # Conversion functions from frames to Minute/Second/Frames and vice versa
-  CD_FPS* = 75                # SDL_byteorder.h constants
-                              # The two types of endianness
-  LIL_ENDIAN* = 1234
-  BIG_ENDIAN* = 4321
-
-when cpuEndian == littleEndian: 
-  const 
-    BYTEORDER* = LIL_ENDIAN   # Native audio byte ordering
-    AUDIO_U16SYS* = AUDIO_U16LSB
-    AUDIO_S16SYS* = AUDIO_S16LSB
-else: 
-  const 
-    BYTEORDER* = BIG_ENDIAN   # Native audio byte ordering
-    AUDIO_U16SYS* = AUDIO_U16MSB
-    AUDIO_S16SYS* = AUDIO_S16MSB
-const 
-  MIX_MAXVOLUME* = 128        # SDL_joystick.h constants
-  MAX_JOYSTICKS* = 2          # only 2 are supported in the multimedia API
-  MAX_AXES* = 6               # each joystick can have up to 6 axes
-  MAX_BUTTONS* = 32           # and 32 buttons
-  AXIS_MIN* = - 32768         # minimum value for axis coordinate
-  AXIS_MAX* = 32767           # maximum value for axis coordinate
-  JOY_AXIS_THRESHOLD* = (toFloat((AXIS_MAX) - (AXIS_MIN)) / 100.000) # 1% motion
-  HAT_CENTERED* = 0x00000000
-  HAT_UP* = 0x00000001
-  HAT_RIGHT* = 0x00000002
-  HAT_DOWN* = 0x00000004
-  HAT_LEFT* = 0x00000008
-  HAT_RIGHTUP* = HAT_RIGHT or HAT_UP
-  HAT_RIGHTDOWN* = HAT_RIGHT or HAT_DOWN
-  HAT_LEFTUP* = HAT_LEFT or HAT_UP
-  HAT_LEFTDOWN* = HAT_LEFT or HAT_DOWN # SDL_events.h constants
-
-type 
-  EventKind* = enum          # kind of an SDL event
-    NOEVENT = 0,              # Unused (do not remove)
-    ACTIVEEVENT = 1,          # Application loses/gains visibility
-    KEYDOWN = 2,              # Keys pressed
-    KEYUP = 3,                # Keys released
-    MOUSEMOTION = 4,          # Mouse moved
-    MOUSEBUTTONDOWN = 5,      # Mouse button pressed
-    MOUSEBUTTONUP = 6,        # Mouse button released
-    JOYAXISMOTION = 7,        # Joystick axis motion
-    JOYBALLMOTION = 8,        # Joystick trackball motion
-    JOYHATMOTION = 9,         # Joystick hat position change
-    JOYBUTTONDOWN = 10,       # Joystick button pressed
-    JOYBUTTONUP = 11,         # Joystick button released
-    QUITEV = 12,              # User-requested quit ( Changed due to procedure conflict )
-    SYSWMEVENT = 13,          # System specific event
-    EVENT_RESERVEDA = 14,     # Reserved for future use..
-    EVENT_RESERVED = 15,      # Reserved for future use..
-    VIDEORESIZE = 16,         # User resized video mode
-    VIDEOEXPOSE = 17,         # Screen needs to be redrawn
-    EVENT_RESERVED2 = 18,     # Reserved for future use..
-    EVENT_RESERVED3 = 19,     # Reserved for future use..
-    EVENT_RESERVED4 = 20,     # Reserved for future use..
-    EVENT_RESERVED5 = 21,     # Reserved for future use..
-    EVENT_RESERVED6 = 22,     # Reserved for future use..
-    EVENT_RESERVED7 = 23,     # Reserved for future use..
-                              # Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use
-    USEREVENT = 24 # This last event is only for bounding internal arrays
-                   # It is the number of bits in the event mask datatype -- int32
-{.deprecated: [TEventKind: EventKind].}
-
-const 
-  NUMEVENTS* = 32
-  ALLEVENTS* = 0xFFFFFFFF
-  ACTIVEEVENTMASK* = 1 shl ord(ACTIVEEVENT)
-  KEYDOWNMASK* = 1 shl ord(KEYDOWN)
-  KEYUPMASK* = 1 shl ord(KEYUP)
-  MOUSEMOTIONMASK* = 1 shl ord(MOUSEMOTION)
-  MOUSEBUTTONDOWNMASK* = 1 shl ord(MOUSEBUTTONDOWN)
-  MOUSEBUTTONUPMASK* = 1 shl ord(MOUSEBUTTONUP)
-  MOUSEEVENTMASK* = 1 shl ord(MOUSEMOTION) or 1 shl ord(MOUSEBUTTONDOWN) or
-      1 shl ord(MOUSEBUTTONUP)
-  JOYAXISMOTIONMASK* = 1 shl ord(JOYAXISMOTION)
-  JOYBALLMOTIONMASK* = 1 shl ord(JOYBALLMOTION)
-  JOYHATMOTIONMASK* = 1 shl ord(JOYHATMOTION)
-  JOYBUTTONDOWNMASK* = 1 shl ord(JOYBUTTONDOWN)
-  JOYBUTTONUPMASK* = 1 shl ord(JOYBUTTONUP)
-  JOYEVENTMASK* = 1 shl ord(JOYAXISMOTION) or 1 shl ord(JOYBALLMOTION) or
-      1 shl ord(JOYHATMOTION) or 1 shl ord(JOYBUTTONDOWN) or
-      1 shl ord(JOYBUTTONUP)
-  VIDEORESIZEMASK* = 1 shl ord(VIDEORESIZE)
-  QUITMASK* = 1 shl ord(QUITEV)
-  SYSWMEVENTMASK* = 1 shl ord(SYSWMEVENT)
-  QUERY* = - 1
-  IGNORE* = 0
-  DISABLE* = 0
-  ENABLE* = 1                 #SDL_keyboard.h constants
-                              # This is the mask which refers to all hotkey bindings
-  ALL_HOTKEYS* = 0xFFFFFFFF # Enable/Disable keyboard repeat.  Keyboard repeat defaults to off.
-                            #  'delay' is the initial delay in ms between the time when a key is
-                            #  pressed, and keyboard repeat begins.
-                            #  'interval' is the time in ms between keyboard repeat events.
-  DEFAULT_REPEAT_DELAY* = 500
-  DEFAULT_REPEAT_INTERVAL* = 30 # The keyboard syms have been cleverly chosen to map to ASCII
-  K_UNKNOWN* = 0
-  K_FIRST* = 0
-  K_BACKSPACE* = 8
-  K_TAB* = 9
-  K_CLEAR* = 12
-  K_RETURN* = 13
-  K_PAUSE* = 19
-  K_ESCAPE* = 27
-  K_SPACE* = 32
-  K_EXCLAIM* = 33
-  K_QUOTEDBL* = 34
-  K_HASH* = 35
-  K_DOLLAR* = 36
-  K_AMPERSAND* = 38
-  K_QUOTE* = 39
-  K_LEFTPAREN* = 40
-  K_RIGHTPAREN* = 41
-  K_ASTERISK* = 42
-  K_PLUS* = 43
-  K_COMMA* = 44
-  K_MINUS* = 45
-  K_PERIOD* = 46
-  K_SLASH* = 47
-  K_0* = 48
-  K_1* = 49
-  K_2* = 50
-  K_3* = 51
-  K_4* = 52
-  K_5* = 53
-  K_6* = 54
-  K_7* = 55
-  K_8* = 56
-  K_9* = 57
-  K_COLON* = 58
-  K_SEMICOLON* = 59
-  K_LESS* = 60
-  K_EQUALS* = 61
-  K_GREATER* = 62
-  K_QUESTION* = 63
-  K_AT* = 64                  # Skip uppercase letters
-  K_LEFTBRACKET* = 91
-  K_BACKSLASH* = 92
-  K_RIGHTBRACKET* = 93
-  K_CARET* = 94
-  K_UNDERSCORE* = 95
-  K_BACKQUOTE* = 96
-  K_a* = 97
-  K_b* = 98
-  K_c* = 99
-  K_d* = 100
-  K_e* = 101
-  K_f* = 102
-  K_g* = 103
-  K_h* = 104
-  K_i* = 105
-  K_j* = 106
-  K_k* = 107
-  K_l* = 108
-  K_m* = 109
-  K_n* = 110
-  K_o* = 111
-  K_p* = 112
-  K_q* = 113
-  K_r* = 114
-  K_s* = 115
-  K_t* = 116
-  K_u* = 117
-  K_v* = 118
-  K_w* = 119
-  K_x* = 120
-  K_y* = 121
-  K_z* = 122
-  K_DELETE* = 127             # End of ASCII mapped keysyms
-                              # International keyboard syms
-  K_WORLD_0* = 160            # 0xA0
-  K_WORLD_1* = 161
-  K_WORLD_2* = 162
-  K_WORLD_3* = 163
-  K_WORLD_4* = 164
-  K_WORLD_5* = 165
-  K_WORLD_6* = 166
-  K_WORLD_7* = 167
-  K_WORLD_8* = 168
-  K_WORLD_9* = 169
-  K_WORLD_10* = 170
-  K_WORLD_11* = 171
-  K_WORLD_12* = 172
-  K_WORLD_13* = 173
-  K_WORLD_14* = 174
-  K_WORLD_15* = 175
-  K_WORLD_16* = 176
-  K_WORLD_17* = 177
-  K_WORLD_18* = 178
-  K_WORLD_19* = 179
-  K_WORLD_20* = 180
-  K_WORLD_21* = 181
-  K_WORLD_22* = 182
-  K_WORLD_23* = 183
-  K_WORLD_24* = 184
-  K_WORLD_25* = 185
-  K_WORLD_26* = 186
-  K_WORLD_27* = 187
-  K_WORLD_28* = 188
-  K_WORLD_29* = 189
-  K_WORLD_30* = 190
-  K_WORLD_31* = 191
-  K_WORLD_32* = 192
-  K_WORLD_33* = 193
-  K_WORLD_34* = 194
-  K_WORLD_35* = 195
-  K_WORLD_36* = 196
-  K_WORLD_37* = 197
-  K_WORLD_38* = 198
-  K_WORLD_39* = 199
-  K_WORLD_40* = 200
-  K_WORLD_41* = 201
-  K_WORLD_42* = 202
-  K_WORLD_43* = 203
-  K_WORLD_44* = 204
-  K_WORLD_45* = 205
-  K_WORLD_46* = 206
-  K_WORLD_47* = 207
-  K_WORLD_48* = 208
-  K_WORLD_49* = 209
-  K_WORLD_50* = 210
-  K_WORLD_51* = 211
-  K_WORLD_52* = 212
-  K_WORLD_53* = 213
-  K_WORLD_54* = 214
-  K_WORLD_55* = 215
-  K_WORLD_56* = 216
-  K_WORLD_57* = 217
-  K_WORLD_58* = 218
-  K_WORLD_59* = 219
-  K_WORLD_60* = 220
-  K_WORLD_61* = 221
-  K_WORLD_62* = 222
-  K_WORLD_63* = 223
-  K_WORLD_64* = 224
-  K_WORLD_65* = 225
-  K_WORLD_66* = 226
-  K_WORLD_67* = 227
-  K_WORLD_68* = 228
-  K_WORLD_69* = 229
-  K_WORLD_70* = 230
-  K_WORLD_71* = 231
-  K_WORLD_72* = 232
-  K_WORLD_73* = 233
-  K_WORLD_74* = 234
-  K_WORLD_75* = 235
-  K_WORLD_76* = 236
-  K_WORLD_77* = 237
-  K_WORLD_78* = 238
-  K_WORLD_79* = 239
-  K_WORLD_80* = 240
-  K_WORLD_81* = 241
-  K_WORLD_82* = 242
-  K_WORLD_83* = 243
-  K_WORLD_84* = 244
-  K_WORLD_85* = 245
-  K_WORLD_86* = 246
-  K_WORLD_87* = 247
-  K_WORLD_88* = 248
-  K_WORLD_89* = 249
-  K_WORLD_90* = 250
-  K_WORLD_91* = 251
-  K_WORLD_92* = 252
-  K_WORLD_93* = 253
-  K_WORLD_94* = 254
-  K_WORLD_95* = 255           # 0xFF
-                              # Numeric keypad
-  K_KP0* = 256
-  K_KP1* = 257
-  K_KP2* = 258
-  K_KP3* = 259
-  K_KP4* = 260
-  K_KP5* = 261
-  K_KP6* = 262
-  K_KP7* = 263
-  K_KP8* = 264
-  K_KP9* = 265
-  K_KP_PERIOD* = 266
-  K_KP_DIVIDE* = 267
-  K_KP_MULTIPLY* = 268
-  K_KP_MINUS* = 269
-  K_KP_PLUS* = 270
-  K_KP_ENTER* = 271
-  K_KP_EQUALS* = 272          # Arrows + Home/End pad
-  K_UP* = 273
-  K_DOWN* = 274
-  K_RIGHT* = 275
-  K_LEFT* = 276
-  K_INSERT* = 277
-  K_HOME* = 278
-  K_END* = 279
-  K_PAGEUP* = 280
-  K_PAGEDOWN* = 281           # Function keys
-  K_F1* = 282
-  K_F2* = 283
-  K_F3* = 284
-  K_F4* = 285
-  K_F5* = 286
-  K_F6* = 287
-  K_F7* = 288
-  K_F8* = 289
-  K_F9* = 290
-  K_F10* = 291
-  K_F11* = 292
-  K_F12* = 293
-  K_F13* = 294
-  K_F14* = 295
-  K_F15* = 296                # Key state modifier keys
-  K_NUMLOCK* = 300
-  K_CAPSLOCK* = 301
-  K_SCROLLOCK* = 302
-  K_RSHIFT* = 303
-  K_LSHIFT* = 304
-  K_RCTRL* = 305
-  K_LCTRL* = 306
-  K_RALT* = 307
-  K_LALT* = 308
-  K_RMETA* = 309
-  K_LMETA* = 310
-  K_LSUPER* = 311             # Left "Windows" key
-  K_RSUPER* = 312             # Right "Windows" key
-  K_MODE* = 313               # "Alt Gr" key
-  K_COMPOSE* = 314            # Multi-key compose key
-                              # Miscellaneous function keys
-  K_HELP* = 315
-  K_PRINT* = 316
-  K_SYSREQ* = 317
-  K_BREAK* = 318
-  K_MENU* = 319
-  K_POWER* = 320              # Power Macintosh power key
-  K_EURO* = 321               # Some european keyboards
-  K_GP2X_UP* = 0
-  K_GP2X_UPLEFT* = 1
-  K_GP2X_LEFT* = 2
-  K_GP2X_DOWNLEFT* = 3
-  K_GP2X_DOWN* = 4
-  K_GP2X_DOWNRIGHT* = 5
-  K_GP2X_RIGHT* = 6
-  K_GP2X_UPRIGHT* = 7
-  K_GP2X_START* = 8
-  K_GP2X_SELECT* = 9
-  K_GP2X_L* = 10
-  K_GP2X_R* = 11
-  K_GP2X_A* = 12
-  K_GP2X_B* = 13
-  K_GP2X_Y* = 14
-  K_GP2X_X* = 15
-  K_GP2X_VOLUP* = 16
-  K_GP2X_VOLDOWN* = 17
-  K_GP2X_CLICK* = 18
-
-const                         # Enumeration of valid key mods (possibly OR'd together)
-  KMOD_NONE* = 0x00000000
-  KMOD_LSHIFT* = 0x00000001
-  KMOD_RSHIFT* = 0x00000002
-  KMOD_LCTRL* = 0x00000040
-  KMOD_RCTRL* = 0x00000080
-  KMOD_LALT* = 0x00000100
-  KMOD_RALT* = 0x00000200
-  KMOD_LMETA* = 0x00000400
-  KMOD_RMETA* = 0x00000800
-  KMOD_NUM* = 0x00001000
-  KMOD_CAPS* = 0x00002000
-  KMOD_MODE* = 44000
-  KMOD_RESERVED* = 0x00008000
-  KMOD_CTRL* = (KMOD_LCTRL or KMOD_RCTRL)
-  KMOD_SHIFT* = (KMOD_LSHIFT or KMOD_RSHIFT)
-  KMOD_ALT* = (KMOD_LALT or KMOD_RALT)
-  KMOD_META* = (KMOD_LMETA or KMOD_RMETA) #SDL_video.h constants
-                                          # Transparency definitions: These define alpha as the opacity of a surface */
-  ALPHA_OPAQUE* = 255
-  ALPHA_TRANSPARENT* = 0 # These are the currently supported flags for the SDL_surface
-                         # Available for SDL_CreateRGBSurface() or SDL_SetVideoMode()
-  SWSURFACE* = 0x00000000     # Surface is in system memory
-  HWSURFACE* = 0x00000001     # Surface is in video memory
-  ASYNCBLIT* = 0x00000004     # Use asynchronous blits if possible
-                              # Available for SDL_SetVideoMode()
-  ANYFORMAT* = 0x10000000     # Allow any video depth/pixel-format
-  HWPALETTE* = 0x20000000     # Surface has exclusive palette
-  DOUBLEBUF* = 0x40000000     # Set up double-buffered video mode
-  FULLSCREEN* = 0x80000000    # Surface is a full screen display
-  OPENGL* = 0x00000002        # Create an OpenGL rendering context
-  OPENGLBLIT* = 0x00000002    # Create an OpenGL rendering context
-  RESIZABLE* = 0x00000010     # This video mode may be resized
-  NOFRAME* = 0x00000020       # No window caption or edge frame
-                              # Used internally (read-only)
-  HWACCEL* = 0x00000100       # Blit uses hardware acceleration
-  SRCCOLORKEY* = 0x00001000   # Blit uses a source color key
-  RLEACCELOK* = 0x00002000    # Private flag
-  RLEACCEL* = 0x00004000      # Colorkey blit is RLE accelerated
-  SRCALPHA* = 0x00010000      # Blit uses source alpha blending
-  SRCCLIPPING* = 0x00100000   # Blit uses source clipping
-  PREALLOC* = 0x01000000 # Surface uses preallocated memory
-                         # The most common video overlay formats.
-                         #    For an explanation of these pixel formats, see:
-                         #    http://www.webartz.com/fourcc/indexyuv.htm
-                         #
-                         #   For information on the relationship between color spaces, see:
-                         #
-                         #   
-                         #   http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
-  YV12_OVERLAY* = 0x32315659  # Planar mode: Y + V + U  (3 planes)
-  IYUV_OVERLAY* = 0x56555949  # Planar mode: Y + U + V  (3 planes)
-  YUY2_OVERLAY* = 0x32595559  # Packed mode: Y0+U0+Y1+V0 (1 plane)
-  UYVY_OVERLAY* = 0x59565955  # Packed mode: U0+Y0+V0+Y1 (1 plane)
-  YVYU_OVERLAY* = 0x55595659  # Packed mode: Y0+V0+Y1+U0 (1 plane)
-                              # flags for SDL_SetPalette()
-  LOGPAL* = 0x00000001
-  PHYSPAL* = 0x00000002 #SDL_mouse.h constants
-                        # Used as a mask when testing buttons in buttonstate
-                        #    Button 1:	Left mouse button
-                        #    Button 2:	Middle mouse button
-                        #    Button 3:	Right mouse button
-                        #    Button 4:	Mouse Wheel Up
-                        #    Button 5:	Mouse Wheel Down
-                        #
-  BUTTON_LEFT* = 1
-  BUTTON_MIDDLE* = 2
-  BUTTON_RIGHT* = 3
-  BUTTON_WHEELUP* = 4
-  BUTTON_WHEELDOWN* = 5
-  BUTTON_LMASK* = PRESSED shl (BUTTON_LEFT - 1)
-  BUTTON_MMASK* = PRESSED shl (BUTTON_MIDDLE - 1)
-  BUTTON_RMask* = PRESSED shl (BUTTON_RIGHT - 1) # SDL_active.h constants
-                                                 # The available application states
-  APPMOUSEFOCUS* = 0x00000001 # The app has mouse coverage
-  APPINPUTFOCUS* = 0x00000002 # The app has input focus
-  APPACTIVE* = 0x00000004 # The application is active
-                          # SDL_mutex.h constants
-                          # Synchronization functions which can time out return this value
-                          #  they time out.
-  MUTEX_TIMEDOUT* = 1         # This is the timeout value which corresponds to never time out
-  MUTEX_MAXWAIT* = not int(0)
-  GRAB_QUERY* = - 1
-  GRAB_OFF* = 0
-  GRAB_ON* = 1                #SDL_GRAB_FULLSCREEN // Used internally
-
-type 
-  Handle* = int               #SDL_types.h types
-                              # Basic data types
-  Bool* = enum
-    sdlFALSE, sdlTRUE
-  PUInt8Array* = ptr UInt8Array
-  UInt8Array* = array[0..high(int) shr 1, byte]
-  PUInt16* = ptr uint16
-  PUInt32* = ptr uint32
-  PUInt64* = ptr UInt64
-  UInt64*{.final.} = object 
-    hi*: int32
-    lo*: int32
-
-  PSInt64* = ptr SInt64
-  SInt64*{.final.} = object 
-    hi*: int32
-    lo*: int32
-
-  GrabMode* = int32         # SDL_error.h types
-  ErrorCode* = enum 
-    ENOMEM, EFREAD, EFWRITE, EFSEEK, LASTERROR
-  Arg*{.final.} = object 
-    buf*: array[0..ERR_MAX_STRLEN - 1, int8]
-
-  Perror* = ptr Error
-  Error*{.final.} = object   # This is a numeric value corresponding to the current error
-                             # SDL_rwops.h types
-                             # This is the read/write operation structure -- very basic
-                             # some helper types to handle the unions
-                             # "packed" is only guessed
-    error*: int # This is a key used to index into a language hashtable containing
-                #       internationalized versions of the SDL error messages.  If the key
-                #       is not in the hashtable, or no hashtable is available, the key is
-                #       used directly as an error message format string.
-    key*: array[0..ERR_MAX_STRLEN - 1, int8] # These are the arguments for the error functions
-    argc*: int
-    args*: array[0..ERR_MAX_ARGS - 1, Arg]
-
-  Stdio*{.final.} = object 
-    autoclose*: int           # FILE * is only defined in Kylix so we use a simple pointer
-    fp*: pointer
-
-  Mem*{.final.} = object 
-    base*: ptr byte
-    here*: ptr byte
-    stop*: ptr byte
-
-  PRWops* = ptr RWops        # now the pointer to function types
-  Seek* = proc (context: PRWops, offset: int, whence: int): int{.cdecl.}
-  Read* = proc (context: PRWops, thePtr: pointer, size: int, maxnum: int): int{.
-      cdecl.}
-  Write* = proc (context: PRWops, thePtr: pointer, size: int, num: int): int{.
-      cdecl.}
-  Close* = proc (context: PRWops): int{.cdecl.} # the variant record itself
-  RWops*{.final.} = object 
-    seek*: Seek
-    read*: Read
-    write*: Write
-    closeFile*: Close         # a keyword as name is not allowed
-                              # be warned! structure alignment may arise at this point
-    theType*: cint
-    mem*: Mem
-  
-                              # SDL_timer.h types
-                              # Function prototype for the timer callback function
-  TimerCallback* = proc (interval: int32): int32{.cdecl.}
-  NewTimerCallback* = proc (interval: int32, param: pointer): int32{.cdecl.}
-
-  PTimerID* = ptr TimerID
-  TimerID*{.final.} = object 
-    interval*: int32
-    callback*: NewTimerCallback
-    param*: pointer
-    lastAlarm*: int32
-    next*: PTimerID
-
-  AudioSpecCallback* = proc (userdata: pointer, stream: ptr byte, length: int){.
-      cdecl.}                 # SDL_audio.h types
-                              # The calculated values in this structure are calculated by SDL_OpenAudio()
-  PAudioSpec* = ptr AudioSpec
-  AudioSpec*{.final.} = object  # A structure to hold a set of audio conversion filters and buffers
-    freq*: int                # DSP frequency -- samples per second
-    format*: uint16           # Audio data format
-    channels*: byte          # Number of channels: 1 mono, 2 stereo
-    silence*: byte           # Audio buffer silence value (calculated)
-    samples*: uint16          # Audio buffer size in samples
-    padding*: uint16          # Necessary for some compile environments
-    size*: int32 # Audio buffer size in bytes (calculated)
-                 # This function is called when the audio device needs more data.
-                 # 'stream' is a pointer to the audio data buffer
-                 # 'len' is the length of that buffer in bytes.
-                 # Once the callback returns, the buffer will no longer be valid.
-                 # Stereo samples are stored in a LRLRLR ordering.
-    callback*: AudioSpecCallback
-    userdata*: pointer
-
-  PAudioCVT* = ptr AudioCVT
-  PAudioCVTFilter* = ptr AudioCVTFilter
-  AudioCVTFilter*{.final.} = object 
-    cvt*: PAudioCVT
-    format*: uint16
-
-  PAudioCVTFilterArray* = ptr AudioCVTFilterArray
-  AudioCVTFilterArray* = array[0..9, PAudioCVTFilter]
-  AudioCVT*{.final.} = object 
-    needed*: int              # Set to 1 if conversion possible
-    srcFormat*: uint16       # Source audio format
-    dstFormat*: uint16       # Target audio format
-    rateIncr*: float64       # Rate conversion increment
-    buf*: ptr byte              # Buffer to hold entire audio data
-    length*: int              # Length of original audio buffer
-    lenCvt*: int             # Length of converted audio buffer
-    lenMult*: int            # buffer must be len*len_mult big
-    lenRatio*: float64       # Given len, final size is len*len_ratio
-    filters*: AudioCVTFilterArray
-    filterIndex*: int        # Current audio conversion function
-  
-  AudioStatus* = enum        # SDL_cdrom.h types
-    AUDIO_STOPPED, AUDIO_PLAYING, AUDIO_PAUSED
-  CDStatus* = enum 
-    CD_ERROR, CD_TRAYEMPTY, CD_STOPPED, CD_PLAYING, CD_PAUSED
-  PCDTrack* = ptr CDTrack
-  CDTrack*{.final.} = object  # This structure is only current as of the last call to SDL_CDStatus()
-    id*: byte                # Track number
-    theType*: byte           # Data or audio track
-    unused*: uint16
-    len*: int32              # Length, in frames, of this track
-    offset*: int32           # Offset, in frames, from start of disk
-  
-  PCD* = ptr CD
-  CD*{.final.} = object      #SDL_joystick.h types
-    id*: int                  # Private drive identifier
-    status*: CDStatus         # Current drive status
-                              # The rest of this structure is only valid if there's a CD in drive
-    numtracks*: int           # Number of tracks on disk
-    curTrack*: int            # Current track position
-    curFrame*: int           # Current frame offset within current track
-    track*: array[0..MAX_TRACKS, CDTrack]
-
-  PTransAxis* = ptr TransAxis
-  TransAxis*{.final.} = object  # The private structure used to keep track of a joystick
-    offset*: int
-    scale*: float32
-
-  PJoystickHwdata* = ptr JoystickHwdata
-  Joystick_hwdata*{.final.} = object  # joystick ID
-    id*: int                  # values used to translate device-specific coordinates into  SDL-standard ranges
-    transaxis*: array[0..5, TransAxis]
-
-  PBallDelta* = ptr BallDelta
-  BallDelta*{.final.} = object  # Current ball motion deltas
-                                 # The SDL joystick structure
-    dx*: int
-    dy*: int
-
-  PJoystick* = ptr Joystick
-  Joystick*{.final.} = object  # SDL_verion.h types
-    index*: byte             # Device index
-    name*: cstring            # Joystick name - system dependent
-    naxes*: int               # Number of axis controls on the joystick
-    axes*: PUInt16            # Current axis states
-    nhats*: int               # Number of hats on the joystick
-    hats*: ptr byte             # Current hat states
-    nballs*: int              # Number of trackballs on the joystick
-    balls*: PBallDelta        # Current ball motion deltas
-    nbuttons*: int            # Number of buttons on the joystick
-    buttons*: ptr byte          # Current button states
-    hwdata*: PJoystickHwdata # Driver dependent information
-    refCount*: int           # Reference count for multiple opens
-  
-  Pversion* = ptr Version
-  Version*{.final.} = object  # SDL_keyboard.h types
-    major*: byte
-    minor*: byte
-    patch*: byte
-
-  Key* = int32
-  Mod* = int32
-  PKeySym* = ptr KeySym
-  KeySym*{.final.} = object  # SDL_events.h types
-                              #Checks the event queue for messages and optionally returns them.
-                              #   If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
-                              #   the back of the event queue.
-                              #   If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
-                              #   of the event queue, matching 'mask', will be returned and will not
-                              #   be removed from the queue.
-                              #   If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
-                              #   of the event queue, matching 'mask', will be returned and will be
-                              #   removed from the queue.
-                              #   This function returns the number of events actually stored, or -1
-                              #   if there was an error.  This function is thread-safe.
-    scancode*: byte           # hardware specific scancode
-    sym*: Key                 # SDL virtual keysym
-    modifier*: Mod            # current key modifiers
-    unicode*: uint16          # translated character
-  
-  EventAction* = enum        # Application visibility event structure
-    ADDEVENT, PEEKEVENT, GETEVENT
-
-  PActiveEvent* = ptr TActiveEvent
-  TActiveEvent*{.final.} = object  # SDL_ACTIVEEVENT
-                                   # Keyboard event structure
-    kind*: EventKind
-    gain*: byte              # Whether given states were gained or lost (1/0)
-    state*: byte             # A mask of the focus states
-  
-  PKeyboardEvent* = ptr KeyboardEvent
-  KeyboardEvent*{.final.} = object  # SDL_KEYDOWN or SDL_KEYUP
-                                     # Mouse motion event structure
-    kind*: EventKind
-    which*: byte             # The keyboard device index
-    state*: byte             # SDL_PRESSED or SDL_RELEASED
-    keysym*: KeySym
-
-  PMouseMotionEvent* = ptr MouseMotionEvent
-  MouseMotionEvent*{.final.} = object  # SDL_MOUSEMOTION
-                                        # Mouse button event structure
-    kind*: EventKind
-    which*: byte             # The mouse device index
-    state*: byte             # The current button state
-    x*, y*: uint16            # The X/Y coordinates of the mouse
-    xrel*: int16             # The relative motion in the X direction
-    yrel*: int16             # The relative motion in the Y direction
-  
-  PMouseButtonEvent* = ptr MouseButtonEvent
-  MouseButtonEvent*{.final.} = object  # SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
-                                        # Joystick axis motion event structure
-    kind*: EventKind
-    which*: byte             # The mouse device index
-    button*: byte            # The mouse button index
-    state*: byte             # SDL_PRESSED or SDL_RELEASED
-    x*: uint16                # The X coordinates of the mouse at press time
-    y*: uint16                # The Y coordinates of the mouse at press time
-  
-  PJoyAxisEvent* = ptr JoyAxisEvent
-  JoyAxisEvent*{.final.} = object  # SDL_JOYAXISMOTION
-                                    # Joystick trackball motion event structure
-    kind*: EventKind
-    which*: byte             # The joystick device index
-    axis*: byte              # The joystick axis index
-    value*: int16            # The axis value (range: -32768 to 32767)
-  
-  PJoyBallEvent* = ptr JoyBallEvent
-  JoyBallEvent*{.final.} = object  # SDL_JOYAVBALLMOTION
-                                    # Joystick hat position change event structure
-    kind*: EventKind
-    which*: byte             # The joystick device index
-    ball*: byte              # The joystick trackball index
-    xrel*: int16             # The relative motion in the X direction
-    yrel*: int16             # The relative motion in the Y direction
-  
-  PJoyHatEvent* = ptr JoyHatEvent
-  JoyHatEvent*{.final.} = object  # SDL_JOYHATMOTION */
-                                   # Joystick button event structure
-    kind*: EventKind
-    which*: byte             # The joystick device index */
-    hat*: byte               # The joystick hat index */
-    value*: byte             # The hat position value:
-                             # 8   1   2
-                             # 7   0   3
-                             # 6   5   4
-                             # Note that zero means the POV is centered.
-  
-  PJoyButtonEvent* = ptr JoyButtonEvent
-  JoyButtonEvent*{.final.} = object  # SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP
-                                      # The "window resized" event
-                                      # When you get this event, you are
-                                      # responsible for setting a new video
-                                      # mode with the new width and height.
-    kind*: EventKind
-    which*: byte             # The joystick device index
-    button*: byte            # The joystick button index
-    state*: byte             # SDL_PRESSED or SDL_RELEASED
-  
-  PResizeEvent* = ptr ResizeEvent
-  ResizeEvent*{.final.} = object   # SDL_VIDEORESIZE
-                                   # A user-defined event type
-    kind*: EventKind
-    w*: cint                   # New width
-    h*: cint                   # New height
-  
-  PUserEvent* = ptr TUserEvent
-  TUserEvent*{.final.} = object  # SDL_USEREVENT through SDL_NUMEVENTS-1
-    kind*: EventKind
-    code*: cint               # User defined event code
-    data1*: pointer           # User defined data pointer
-    data2*: pointer           # User defined data pointer 
-  
-{.deprecated: [THandle: Handle, TEventAction: EventAction, TKey: Key, TArg: Arg,
-              TKeySym: KeySym, TKeyboardEvent: KeyboardEvent, TError: Error,
-              TWrite: Write, TBool: Bool, TUInt8Array: UInt8Array,
-              TGrabMode: GrabMode, Terrorcode: Errorcode, TStdio: Stdio,
-              TMem: Mem, TSeek: Seek, TRead: Read, TClose: Close,
-              TTimerCallback: TimerCallback, TNewTimerCallback: NewTimerCallback,
-              TTimerID: TimerID, TAudioSpecCallback: AudioSpecCallback,
-              TAudioSpec: AudioSpec, TAudioCVTFilter: AudioCVTFilter,
-              TAudioCVTFilterArray: AudioCVTFilterArray, TAudioCVT: AudioCVT,
-              TAudioStatus: AudioStatus, TCDStatus: CDStatus, TCDTrack: CDTrack,
-              TCD: CD, TTransAxis: TransAxis, TJoystick_hwdata: Joystick_hwdata,
-              TJoystick: Joystick, TJoyAxisEvent: JoyAxisEvent, TRWops: RWops,
-              TJoyBallEvent: JoyBallEvent, TJoyHatEvent: JoyHatEvent,
-              TJoyButtonEvent: JoyButtonEvent, TBallDelta: BallDelta,
-              Tversion: Version, TMod: Mod,
-              # TActiveEvent: ActiveEvent, # Naming conflict when we drop the `T`
-              TMouseMotionEvent: MouseMotionEvent, TMouseButtonEvent: MouseButtonEvent,
-              TResizeEvent: ResizeEvent,
-              # TUserEvent: UserEvent # Naming conflict when we drop the `T`
-              ].}
-
-when defined(Unix):
-  type                        #These are the various supported subsystems under UNIX
-    SysWm* = enum 
-      SYSWM_X11
-  {.deprecated: [TSysWm: SysWm].}
-when defined(WINDOWS):
-  type 
-    PSysWMmsg* = ptr SysWMmsg
-    SysWMmsg*{.final.} = object 
-      version*: Version
-      hwnd*: Handle          # The window for the message
-      msg*: int               # The type of message
-      wParam*: int32         # WORD message parameter
-      lParam*: int32          # LONG message parameter
-  {.deprecated: [TSysWMmsg: SysWMmsg].}
-    
-elif defined(Unix): 
-  type                        # The Linux custom event structure
-    PSysWMmsg* = ptr SysWMmsg
-    SysWMmsg*{.final.} = object 
-      version*: Version
-      subsystem*: SysWm
-      when false: 
-          event*: TXEvent
-  {.deprecated: [TSysWMmsg: SysWMmsg].}
-
-    
-else: 
-  type                        # The generic custom event structure
-    PSysWMmsg* = ptr SysWMmsg
-    SysWMmsg*{.final.} = object 
-      version*: Version
-      data*: int
-  {.deprecated: [TSysWMmsg: SysWMmsg].}
-
-# The Windows custom window manager information structure
-
-when defined(WINDOWS): 
-  type 
-    PSysWMinfo* = ptr SysWMinfo
-    SysWMinfo*{.final.} = object 
-      version*: Version
-      window*: Handle        # The display window
-  {.deprecated: [TSysWMinfo: SysWMinfo].}
-    
-elif defined(Unix): 
-  type 
-    X11*{.final.} = object 
-      when false: 
-          display*: PDisplay  # The X11 display
-          window*: Window     # The X11 display window
-                              # These locking functions should be called around
-                              # any X11 functions using the display variable.
-                              # They lock the event thread, so should not be
-                              # called around event functions or from event filters.
-          lock_func*: pointer
-          unlock_func*: pointer # Introduced in SDL 1.0.2
-          fswindow*: Window   # The X11 fullscreen window
-          wmwindow*: Window   # The X11 managed input window
-  {.deprecated: [TX11: X11].}
-        
-    
-  type 
-    PSysWMinfo* = ptr SysWMinfo
-    SysWMinfo*{.final.} = object 
-      version*: Version
-      subsystem*: SysWm
-      X11*: X11
-  {.deprecated: [TSysWMinfo: SysWMinfo].}
-
-else: 
-  type # The generic custom window manager information structure
-    PSysWMinfo* = ptr SysWMinfo
-    SysWMinfo*{.final.} = object 
-      version*: Version
-      data*: int
-  {.deprecated: [TSysWMinfo: SysWMinfo].}
-
-type 
-  PSysWMEvent* = ptr TSysWMEvent
-  TSysWMEvent*{.final.} = object 
-    kind*: EventKind
-    msg*: PSysWMmsg
-
-  PExposeEvent* = ptr ExposeEvent
-  ExposeEvent*{.final.} = object
-    kind*: EventKind
-
-  PQuitEvent* = ptr QuitEvent
-  QuitEvent*{.final.} = object
-    kind*: EventKind
-
-  PEvent* = ptr Event
-  Event*{.final.} = object  
-    kind*: EventKind
-    pad: array[0..19, byte]
-  
-  EventFilter* = proc (event: PEvent): int{.cdecl.} # SDL_video.h types
-                                                     # Useful data types
-  PPSDL_Rect* = ptr PRect
-  PRect* = ptr Rect
-  Rect*{.final.} = object 
-    x*, y*: int16
-    w*, h*: uint16
-
-#  Rect* = TRect
-  PColor* = ptr Color
-  Color*{.final.} = object 
-    r*: byte
-    g*: byte
-    b*: byte
-    unused*: byte
-
-  PColorArray* = ptr ColorArray
-  ColorArray* = array[0..65000, Color]
-  PPalette* = ptr Palette
-  Palette*{.final.} = object  # Everything in the pixel format structure is read-only
-    ncolors*: int
-    colors*: PColorArray
-
-  PPixelFormat* = ptr PixelFormat
-  PixelFormat*{.final.} = object  # The structure passed to the low level blit functions
-    palette*: PPalette
-    bitsPerPixel*: byte
-    bytesPerPixel*: byte
-    rloss*: byte
-    gloss*: byte
-    bloss*: byte
-    aloss*: byte
-    rshift*: byte
-    gshift*: byte
-    bshift*: byte
-    ashift*: byte
-    rMask*: int32
-    gMask*: int32
-    bMask*: int32
-    aMask*: int32
-    colorkey*: int32         # RGB color key information
-    alpha*: byte             # Alpha value information (per-surface alpha)
-  
-  PBlitInfo* = ptr BlitInfo
-  BlitInfo*{.final.} = object  # typedef for private surface blitting functions
-    sPixels*: ptr byte
-    sWidth*: int
-    sHeight*: int
-    sSkip*: int
-    dPixels*: ptr byte
-    dWidth*: int
-    dHeight*: int
-    dSkip*: int
-    auxData*: pointer
-    src*: PPixelFormat
-    table*: ptr byte
-    dst*: PPixelFormat
-
-  PSurface* = ptr Surface
-  Blit* = proc (src: PSurface, srcrect: PRect, 
-                 dst: PSurface, dstrect: PRect): int{.cdecl.}
-  Surface*{.final.} = object  # Useful for determining the video hardware capabilities
-    flags*: int32            # Read-only
-    format*: PPixelFormat     # Read-only
-    w*, h*: cint              # Read-only
-    pitch*: uint16            # Read-only
-    pixels*: pointer          # Read-write
-    offset*: cint             # Private
-    hwdata*: pointer          #TPrivate_hwdata;  Hardware-specific surface info
-                              # clipping information:
-    clipRect*: Rect           # Read-only
-    unused1*: int32           # for binary compatibility
-                              # Allow recursive locks
-    locked*: int32            # Private
-                              # info for fast blit mapping to other surfaces
-    blitmap*: pointer         # PSDL_BlitMap; //   Private
-                              # format version, bumped at every change to invalidate blit maps
-    formatVersion*: cint      # Private
-    refcount*: cint
-
-  PVideoInfo* = ptr VideoInfo
-  VideoInfo*{.final.} = object  # The YUV hardware video overlay
-    hwAvailable*: byte 
-    blitHw*: byte 
-    unusedBits3*: byte       # Unused at this point
-    videoMem*: int32        # The total amount of video memory (in K)
-    vfmt*: PPixelFormat       # Value: The format of the video surface
-    currentW*: int32        # Value: The current video mode width
-    currentH*: int32        # Value: The current video mode height
-  
-  POverlay* = ptr Overlay
-  Overlay*{.final.} = object  # Public enumeration for setting the OpenGL window attributes.
-    format*: int32           # Overlay format
-    w*, h*: int               # Width and height of overlay
-    planes*: int              # Number of planes in the overlay. Usually either 1 or 3
-    pitches*: PUInt16         # An array of pitches, one for each plane. Pitch is the length of a row in bytes.
-    pixels*: ptr ptr byte # An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.
-    hwOverlay*: int32    # This will be set to 1 if the overlay is hardware accelerated.
-  
-  GLAttr* = enum 
-    GL_RED_SIZE, GL_GREEN_SIZE, GL_BLUE_SIZE, GL_ALPHA_SIZE, GL_BUFFER_SIZE,
-    GL_DOUBLEBUFFER, GL_DEPTH_SIZE, GL_STENCIL_SIZE, GL_ACCUM_RED_SIZE,
-    GL_ACCUM_GREEN_SIZE, GL_ACCUM_BLUE_SIZE, GL_ACCUM_ALPHA_SIZE, GL_STEREO,
-    GL_MULTISAMPLEBUFFERS, GL_MULTISAMPLESAMPLES, GL_ACCELERATED_VISUAL,
-    GL_SWAP_CONTROL
-  PCursor* = ptr Cursor
-  Cursor*{.final.} = object  # SDL_mutex.h types
-    area*: Rect               # The area of the mouse cursor
-    hotX*, hot_y*: int16    # The "tip" of the cursor
-    data*: ptr byte             # B/W cursor data
-    mask*: ptr byte             # B/W cursor mask
-    save*: array[1..2, ptr byte] # Place to save cursor area
-    wmCursor*: pointer       # Window-manager cursor
-{.deprecated: [TRect: Rect, TSurface: Surface, TEvent: Event, TColor: Color,
-              TEventFilter: EventFilter, TColorArray: ColorArray,
-              # TSysWMEvent: SysWMEvent, # Naming conflict when we drop the `T`
-              TExposeEvent: ExposeEvent,
-              TQuitEvent: QuitEvent, TPalette: Palette, TPixelFormat: PixelFormat,
-              TBlitInfo: BlitInfo, TBlit: Blit, TVideoInfo: VideoInfo,
-              TOverlay: Overlay, TGLAttr: GLAttr, TCursor: Cursor].}
-
-type 
-  PMutex* = ptr Mutex
-  Mutex*{.final.} = object 
-  Psemaphore* = ptr Semaphore
-  Semaphore*{.final.} = object 
-  PSem* = ptr Sem
-  Sem* = Semaphore
-  PCond* = ptr Cond
-  Cond*{.final.} = object    # SDL_thread.h types
-{.deprecated: [TCond: Cond, TSem: Sem, TMutex: Mutex, Tsemaphore: Semaphore].}
-
-when defined(WINDOWS):
-  type 
-    SYS_ThreadHandle* = Handle
-  {.deprecated: [TSYS_ThreadHandle: SYS_ThreadHandle].}
-when defined(Unix):
-  type 
-    SYS_ThreadHandle* = pointer
-  {.deprecated: [TSYS_ThreadHandle: SYS_ThreadHandle].}
-type                          # This is the system-independent thread info structure
-  PThread* = ptr Thread
-  Thread*{.final.} = object   # Helper Types
-                              # Keyboard  State Array ( See demos for how to use )
-    threadid*: int32
-    handle*: SYS_ThreadHandle
-    status*: int
-    errbuf*: Error
-    data*: pointer
-
-  PKeyStateArr* = ptr KeyStateArr
-  KeyStateArr* = array[0..65000, byte] # Types required so we don't need to use Windows.pas
-  PInteger* = ptr int
-  PByte* = ptr int8
-  PWord* = ptr int16
-  PLongWord* = ptr int32      # General arrays
-  PByteArray* = ptr ByteArray
-  ByteArray* = array[0..32767, int8]
-  PWordArray* = ptr WordArray
-  WordArray* = array[0..16383, int16] # Generic procedure pointer
-{.deprecated: [TKeyStateArr: KeyStateArr, TByteArray: ByteArray, TThread: Thread,
-              TWordArray: WordArray].}
-
-type EventSeq = set[EventKind]
-{.deprecated: [TEventSeq: EventSeq].}
-
-template evconv(procName: expr, ptrName: typedesc, assertions: EventSeq): stmt {.immediate.} =
-  proc `procName`*(event: PEvent): ptrName =
-    assert(contains(assertions, event.kind))
-    result = cast[ptrName](event)
-
-evconv(evActive, PActiveEvent, {ACTIVEEVENT})
-evconv(evKeyboard, PKeyboardEvent, {KEYDOWN, KEYUP})
-evconv(evMouseMotion, PMouseMotionEvent, {MOUSEMOTION})
-evconv(evMouseButton, PMouseButtonEvent, {MOUSEBUTTONDOWN, MOUSEBUTTONUP})
-evconv(evJoyAxis, PJoyAxisEvent,{JOYAXISMOTION})
-evconv(evJoyBall, PJoyBallEvent, {JOYBALLMOTION})
-evconv(evJoyHat, PJoyHatEvent, {JOYHATMOTION})
-evconv(evJoyButton, PJoyButtonEvent, {JOYBUTTONDOWN, JOYBUTTONUP})
-evconv(evResize, PResizeEvent, {VIDEORESIZE})
-evconv(evExpose, PExposeEvent, {VIDEOEXPOSE})
-evconv(evQuit, PQuitEvent, {QUITEV})
-evconv(evUser, PUserEvent, {USEREVENT})
-evconv(evSysWM, PSysWMEvent, {SYSWMEVENT})
-
-#------------------------------------------------------------------------------
-# initialization
-#------------------------------------------------------------------------------
-# This function loads the SDL dynamically linked library and initializes
-#  the subsystems specified by 'flags' (and those satisfying dependencies)
-#  Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
-#  signal handlers for some commonly ignored fatal signals (like SIGSEGV)
-
-proc init*(flags: int32): int{.cdecl, importc: "SDL_Init", dynlib: LibName.}
-  # This function initializes specific SDL subsystems
-proc initSubSystem*(flags: int32): int{.cdecl, importc: "SDL_InitSubSystem", 
-    dynlib: LibName.}
-  # This function cleans up specific SDL subsystems
-proc quitSubSystem*(flags: int32){.cdecl, importc: "SDL_QuitSubSystem", 
-                                    dynlib: LibName.}
-  # This function returns mask of the specified subsystems which have
-  #  been initialized.
-  #  If 'flags' is 0, it returns a mask of all initialized subsystems.
-proc wasInit*(flags: int32): int32{.cdecl, importc: "SDL_WasInit", 
-                                      dynlib: LibName.}
-  # This function cleans up all initialized subsystems and unloads the
-  #  dynamically linked library.  You should call it upon all exit conditions.
-proc quit*(){.cdecl, importc: "SDL_Quit", dynlib: LibName.}
-when defined(WINDOWS): 
-  # This should be called from your WinMain() function, if any
-  proc registerApp*(name: cstring, style: int32, hInst: pointer): int{.cdecl, 
-      importc: "SDL_RegisterApp", dynlib: LibName.}
-proc tableSize*(table: cstring): int
-  #------------------------------------------------------------------------------
-  # error-handling
-  #------------------------------------------------------------------------------
-  # Public functions
-proc getError*(): cstring{.cdecl, importc: "SDL_GetError", dynlib: LibName.}
-proc setError*(fmt: cstring){.cdecl, importc: "SDL_SetError", dynlib: LibName.}
-proc clearError*(){.cdecl, importc: "SDL_ClearError", dynlib: LibName.}
-when not (defined(WINDOWS)):
-  proc error*(Code: ErrorCode){.cdecl, importc: "SDL_Error", dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # io handling
-  #------------------------------------------------------------------------------
-  # Functions to create SDL_RWops structures from various data sources
-proc rwFromFile*(filename, mode: cstring): PRWops{.cdecl, 
-    importc: "SDL_RWFromFile", dynlib: LibName.}
-proc freeRW*(area: PRWops){.cdecl, importc: "SDL_FreeRW", dynlib: LibName.}
-  #fp is FILE *fp ???
-proc rwFromFP*(fp: pointer, autoclose: int): PRWops{.cdecl, 
-    importc: "SDL_RWFromFP", dynlib: LibName.}
-proc rwFromMem*(mem: pointer, size: int): PRWops{.cdecl, 
-    importc: "SDL_RWFromMem", dynlib: LibName.}
-proc rwFromConstMem*(mem: pointer, size: int): PRWops{.cdecl, 
-    importc: "SDL_RWFromConstMem", dynlib: LibName.}
-proc allocRW*(): PRWops{.cdecl, importc: "SDL_AllocRW", dynlib: LibName.}
-proc rwSeek*(context: PRWops, offset: int, whence: int): int
-proc rwTell*(context: PRWops): int
-proc rwRead*(context: PRWops, theptr: pointer, size: int, n: int): int
-proc rwWrite*(context: PRWops, theptr: pointer, size: int, n: int): int
-proc rwClose*(context: PRWops): int
-  #------------------------------------------------------------------------------
-  # time-handling
-  #------------------------------------------------------------------------------
-  # Get the number of milliseconds since the SDL library initialization.
-  # Note that this value wraps if the program runs for more than ~49 days.
-proc getTicks*(): int32{.cdecl, importc: "SDL_GetTicks", dynlib: LibName.}
-  # Wait a specified number of milliseconds before returning
-proc delay*(msec: int32){.cdecl, importc: "SDL_Delay", dynlib: LibName.}
-  # Add a new timer to the pool of timers already running.
-  # Returns a timer ID, or NULL when an error occurs.
-proc addTimer*(interval: int32, callback: NewTimerCallback, param: pointer): PTimerID{.
-    cdecl, importc: "SDL_AddTimer", dynlib: LibName.}
-  # Remove one of the multiple timers knowing its ID.
-  # Returns a boolean value indicating success.
-proc removeTimer*(t: PTimerID): Bool{.cdecl, importc: "SDL_RemoveTimer", 
-                                       dynlib: LibName.}
-proc setTimer*(interval: int32, callback: TimerCallback): int{.cdecl, 
-    importc: "SDL_SetTimer", dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # audio-routines
-  #------------------------------------------------------------------------------
-  # These functions are used internally, and should not be used unless you
-  #  have a specific need to specify the audio driver you want to use.
-  #  You should normally use SDL_Init() or SDL_InitSubSystem().
-proc audioInit*(driverName: cstring): int{.cdecl, importc: "SDL_AudioInit", 
-    dynlib: LibName.}
-proc audioQuit*(){.cdecl, importc: "SDL_AudioQuit", dynlib: LibName.}
-  # This function fills the given character buffer with the name of the
-  #  current audio driver, and returns a pointer to it if the audio driver has
-  #  been initialized.  It returns NULL if no driver has been initialized.
-proc audioDriverName*(namebuf: cstring, maxlen: int): cstring{.cdecl, 
-    importc: "SDL_AudioDriverName", dynlib: LibName.}
-  # This function opens the audio device with the desired parameters, and
-  #  returns 0 if successful, placing the actual hardware parameters in the
-  #  structure pointed to by 'obtained'.  If 'obtained' is NULL, the audio
-  #  data passed to the callback function will be guaranteed to be in the
-  #  requested format, and will be automatically converted to the hardware
-  #  audio format if necessary.  This function returns -1 if it failed
-  #  to open the audio device, or couldn't set up the audio thread.
-  #
-  #  When filling in the desired audio spec structure,
-  #   'desired->freq' should be the desired audio frequency in samples-per-second.
-  #   'desired->format' should be the desired audio format.
-  #   'desired->samples' is the desired size of the audio buffer, in samples.
-  #      This number should be a power of two, and may be adjusted by the audio
-  #      driver to a value more suitable for the hardware.  Good values seem to
-  #      range between 512 and 8096 inclusive, depending on the application and
-  #      CPU speed.  Smaller values yield faster response time, but can lead
-  #      to underflow if the application is doing heavy processing and cannot
-  #      fill the audio buffer in time.  A stereo sample consists of both right
-  #      and left channels in LR ordering.
-  #      Note that the number of samples is directly related to time by the
-  #      following formula:  ms = (samples*1000)/freq
-  #   'desired->size' is the size in bytes of the audio buffer, and is
-  #      calculated by SDL_OpenAudio().
-  #   'desired->silence' is the value used to set the buffer to silence,
-  #      and is calculated by SDL_OpenAudio().
-  #   'desired->callback' should be set to a function that will be called
-  #      when the audio device is ready for more data.  It is passed a pointer
-  #      to the audio buffer, and the length in bytes of the audio buffer.
-  #      This function usually runs in a separate thread, and so you should
-  #      protect data structures that it accesses by calling SDL_LockAudio()
-  #      and SDL_UnlockAudio() in your code.
-  #   'desired->userdata' is passed as the first parameter to your callback
-  #      function.
-  #
-  #  The audio device starts out playing silence when it's opened, and should
-  #  be enabled for playing by calling SDL_PauseAudio(0) when you are ready
-  #  for your audio callback function to be called.  Since the audio driver
-  #  may modify the requested size of the audio buffer, you should allocate
-  #  any local mixing buffers after you open the audio device.
-proc openAudio*(desired, obtained: PAudioSpec): int{.cdecl, 
-    importc: "SDL_OpenAudio", dynlib: LibName.}
-  # Get the current audio state:
-proc getAudioStatus*(): Audiostatus{.cdecl, importc: "SDL_GetAudioStatus", 
-                                      dynlib: LibName.}
-  # This function pauses and unpauses the audio callback processing.
-  #  It should be called with a parameter of 0 after opening the audio
-  #  device to start playing sound.  This is so you can safely initialize
-  #  data for your callback function after opening the audio device.
-  #  Silence will be written to the audio device during the pause.
-proc pauseAudio*(pauseOn: int){.cdecl, importc: "SDL_PauseAudio", 
-                                 dynlib: LibName.}
-  # This function loads a WAVE from the data source, automatically freeing
-  #  that source if 'freesrc' is non-zero.  For example, to load a WAVE file,
-  #  you could do:
-  #  SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
-  #
-  #  If this function succeeds, it returns the given SDL_AudioSpec,
-  #  filled with the audio data format of the wave data, and sets
-  #  'audio_buf' to a malloc()'d buffer containing the audio data,
-  #  and sets 'audio_len' to the length of that audio buffer, in bytes.
-  #  You need to free the audio buffer with SDL_FreeWAV() when you are
-  #  done with it.
-  #
-  #  This function returns NULL and sets the SDL error message if the
-  #  wave file cannot be opened, uses an unknown data format, or is
-  #  corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
-proc loadWAV_RW*(src: PRWops, freesrc: int, spec: PAudioSpec, audioBuf: ptr byte, 
-                 audiolen: PUInt32): PAudioSpec{.cdecl, 
-    importc: "SDL_LoadWAV_RW", dynlib: LibName.}
-  # Compatibility convenience function -- loads a WAV from a file
-proc loadWAV*(filename: cstring, spec: PAudioSpec, audioBuf: ptr byte, 
-              audiolen: PUInt32): PAudioSpec
-  # This function frees data previously allocated with SDL_LoadWAV_RW()
-proc freeWAV*(audioBuf: ptr byte){.cdecl, importc: "SDL_FreeWAV", dynlib: LibName.}
-  # This function takes a source format and rate and a destination format
-  #  and rate, and initializes the 'cvt' structure with information needed
-  #  by SDL_ConvertAudio() to convert a buffer of audio data from one format
-  #  to the other.
-  #  This function returns 0, or -1 if there was an error.
-proc buildAudioCVT*(cvt: PAudioCVT, srcFormat: uint16, srcChannels: byte, 
-                    srcRate: int, dstFormat: uint16, dstChannels: byte, 
-                    dstRate: int): int{.cdecl, importc: "SDL_BuildAudioCVT", 
-    dynlib: LibName.}
-  # Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
-  #  created an audio buffer cvt->buf, and filled it with cvt->len bytes of
-  #  audio data in the source format, this function will convert it in-place
-  #  to the desired format.
-  #  The data conversion may expand the size of the audio data, so the buffer
-  #  cvt->buf should be allocated after the cvt structure is initialized by
-  #  SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
-proc convertAudio*(cvt: PAudioCVT): int{.cdecl, importc: "SDL_ConvertAudio", 
-    dynlib: LibName.}
-  # This takes two audio buffers of the playing audio format and mixes
-  #  them, performing addition, volume adjustment, and overflow clipping.
-  #  The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
-  #  for full audio volume.  Note this does not change hardware volume.
-  #  This is provided for convenience -- you can mix your own audio data.
-proc mixAudio*(dst, src: ptr byte, length: int32, volume: int){.cdecl, 
-    importc: "SDL_MixAudio", dynlib: LibName.}
-  # The lock manipulated by these functions protects the callback function.
-  #  During a LockAudio/UnlockAudio pair, you can be guaranteed that the
-  #  callback function is not running.  Do not call these from the callback
-  #  function or you will cause deadlock.
-proc lockAudio*(){.cdecl, importc: "SDL_LockAudio", dynlib: LibName.}
-proc unlockAudio*(){.cdecl, importc: "SDL_UnlockAudio", dynlib: LibName.}
-  # This function shuts down audio processing and closes the audio device.
-proc closeAudio*(){.cdecl, importc: "SDL_CloseAudio", dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # CD-routines
-  #------------------------------------------------------------------------------
-  # Returns the number of CD-ROM drives on the system, or -1 if
-  #  SDL_Init() has not been called with the SDL_INIT_CDROM flag.
-proc cdNumDrives*(): int{.cdecl, importc: "SDL_CDNumDrives", dynlib: LibName.}
-  # Returns a human-readable, system-dependent identifier for the CD-ROM.
-  #   Example:
-  #   "/dev/cdrom"
-  #   "E:"
-  #   "/dev/disk/ide/1/master"
-proc cdName*(drive: int): cstring{.cdecl, importc: "SDL_CDName", dynlib: LibName.}
-  # Opens a CD-ROM drive for access.  It returns a drive handle on success,
-  #  or NULL if the drive was invalid or busy.  This newly opened CD-ROM
-  #  becomes the default CD used when other CD functions are passed a NULL
-  #  CD-ROM handle.
-  #  Drives are numbered starting with 0.  Drive 0 is the system default CD-ROM.
-proc cdOpen*(drive: int): PCD{.cdecl, importc: "SDL_CDOpen", dynlib: LibName.}
-  # This function returns the current status of the given drive.
-  #  If the drive has a CD in it, the table of contents of the CD and current
-  #  play position of the CD will be stored in the SDL_CD structure.
-proc cdStatus*(cdrom: PCD): CDStatus{.cdecl, importc: "SDL_CDStatus", 
-                                       dynlib: LibName.}
-  #  Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
-  #   tracks and 'nframes' frames.  If both 'ntrack' and 'nframe' are 0, play
-  #   until the end of the CD.  This function will skip data tracks.
-  #   This function should only be called after calling SDL_CDStatus() to
-  #   get track information about the CD.
-  #
-  #   For example:
-  #   // Play entire CD:
-  #  if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then
-  #    SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
-  #   // Play last track:
-  #   if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then
-  #   begin
-  #    SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
-  #   end;
-  #
-  #   // Play first and second track and 10 seconds of third track:
-  #   if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
-  #    SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
-  #
-  #   This function returns 0, or -1 if there was an error.
-proc cdPlayTracks*(cdrom: PCD, startTrack: int, startFrame: int, ntracks: int, 
-                   nframes: int): int{.cdecl, importc: "SDL_CDPlayTracks", 
-                                       dynlib: LibName.}
-  #  Play the given CD starting at 'start' frame for 'length' frames.
-  #   It returns 0, or -1 if there was an error.
-proc cdPlay*(cdrom: PCD, start: int, len: int): int{.cdecl, 
-    importc: "SDL_CDPlay", dynlib: LibName.}
-  # Pause play -- returns 0, or -1 on error
-proc cdPause*(cdrom: PCD): int{.cdecl, importc: "SDL_CDPause", dynlib: LibName.}
-  # Resume play -- returns 0, or -1 on error
-proc cdResume*(cdrom: PCD): int{.cdecl, importc: "SDL_CDResume", dynlib: LibName.}
-  # Stop play -- returns 0, or -1 on error
-proc cdStop*(cdrom: PCD): int{.cdecl, importc: "SDL_CDStop", dynlib: LibName.}
-  # Eject CD-ROM -- returns 0, or -1 on error
-proc cdEject*(cdrom: PCD): int{.cdecl, importc: "SDL_CDEject", dynlib: LibName.}
-  # Closes the handle for the CD-ROM drive
-proc cdClose*(cdrom: PCD){.cdecl, importc: "SDL_CDClose", dynlib: LibName.}
-  # Given a status, returns true if there's a disk in the drive
-proc cdInDrive*(status: CDStatus): bool
-
-proc numJoysticks*(): int{.cdecl, importc: "SDL_NumJoysticks", dynlib: LibName.}
-  # Get the implementation dependent name of a joystick.
-  #  This can be called before any joysticks are opened.
-  #  If no name can be found, this function returns NULL.
-proc joystickName*(index: int): cstring{.cdecl, importc: "SDL_JoystickName", 
-    dynlib: LibName.}
-  # Open a joystick for use - the index passed as an argument refers to
-  #  the N'th joystick on the system.  This index is the value which will
-  #  identify this joystick in future joystick events.
-  #
-  #  This function returns a joystick identifier, or NULL if an error occurred.
-proc joystickOpen*(index: int): PJoystick{.cdecl, importc: "SDL_JoystickOpen", 
-    dynlib: LibName.}
-  # Returns 1 if the joystick has been opened, or 0 if it has not.
-proc joystickOpened*(index: int): int{.cdecl, importc: "SDL_JoystickOpened", 
-                                       dynlib: LibName.}
-  # Get the device index of an opened joystick.
-proc joystickIndex*(joystick: PJoystick): int{.cdecl, 
-    importc: "SDL_JoystickIndex", dynlib: LibName.}
-  # Get the number of general axis controls on a joystick
-proc joystickNumAxes*(joystick: PJoystick): int{.cdecl, 
-    importc: "SDL_JoystickNumAxes", dynlib: LibName.}
-  # Get the number of trackballs on a joystick
-  #  Joystick trackballs have only relative motion events associated
-  #  with them and their state cannot be polled.
-proc joystickNumBalls*(joystick: PJoystick): int{.cdecl, 
-    importc: "SDL_JoystickNumBalls", dynlib: LibName.}
-  # Get the number of POV hats on a joystick
-proc joystickNumHats*(joystick: PJoystick): int{.cdecl, 
-    importc: "SDL_JoystickNumHats", dynlib: LibName.}
-  # Get the number of buttons on a joystick
-proc joystickNumButtons*(joystick: PJoystick): int{.cdecl, 
-    importc: "SDL_JoystickNumButtons", dynlib: LibName.}
-  # Update the current state of the open joysticks.
-  #  This is called automatically by the event loop if any joystick
-  #  events are enabled.
-proc joystickUpdate*(){.cdecl, importc: "SDL_JoystickUpdate", dynlib: LibName.}
-  # Enable/disable joystick event polling.
-  #  If joystick events are disabled, you must call SDL_JoystickUpdate()
-  #  yourself and check the state of the joystick when you want joystick
-  #  information.
-  #  The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
-proc joystickEventState*(state: int): int{.cdecl, 
-    importc: "SDL_JoystickEventState", dynlib: LibName.}
-  # Get the current state of an axis control on a joystick
-  #  The state is a value ranging from -32768 to 32767.
-  #  The axis indices start at index 0.
-proc joystickGetAxis*(joystick: PJoystick, axis: int): int16{.cdecl, 
-    importc: "SDL_JoystickGetAxis", dynlib: LibName.}
-  # The hat indices start at index 0.
-proc joystickGetHat*(joystick: PJoystick, hat: int): byte{.cdecl, 
-    importc: "SDL_JoystickGetHat", dynlib: LibName.}
-  # Get the ball axis change since the last poll
-  #  This returns 0, or -1 if you passed it invalid parameters.
-  #  The ball indices start at index 0.
-proc joystickGetBall*(joystick: PJoystick, ball: int, dx: var int, dy: var int): int{.
-    cdecl, importc: "SDL_JoystickGetBall", dynlib: LibName.}
-  # Get the current state of a button on a joystick
-  #  The button indices start at index 0.
-proc joystickGetButton*(joystick: PJoystick, button: int): byte{.cdecl, 
-    importc: "SDL_JoystickGetButton", dynlib: LibName.}
-  # Close a joystick previously opened with SDL_JoystickOpen()
-proc joystickClose*(joystick: PJoystick){.cdecl, importc: "SDL_JoystickClose", 
-    dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # event-handling
-  #------------------------------------------------------------------------------
-  # Pumps the event loop, gathering events from the input devices.
-  #  This function updates the event queue and internal input device state.
-  #  This should only be run in the thread that sets the video mode.
-proc pumpEvents*(){.cdecl, importc: "SDL_PumpEvents", dynlib: LibName.}
-  # Checks the event queue for messages and optionally returns them.
-  #  If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
-  #  the back of the event queue.
-  #  If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
-  #  of the event queue, matching 'mask', will be returned and will not
-  #  be removed from the queue.
-  #  If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
-  #  of the event queue, matching 'mask', will be returned and will be
-  #  removed from the queue.
-  #  This function returns the number of events actually stored, or -1
-  #  if there was an error.  This function is thread-safe.
-proc peepEvents*(events: PEvent, numevents: int, action: EventAction, 
-                 mask: int32): int{.cdecl, importc: "SDL_PeepEvents", 
-                                     dynlib: LibName.}
-  # Polls for currently pending events, and returns 1 if there are any pending
-  #   events, or 0 if there are none available.  If 'event' is not NULL, the next
-  #   event is removed from the queue and stored in that area.
-proc pollEvent*(event: PEvent): int{.cdecl, importc: "SDL_PollEvent", 
-                                     dynlib: LibName.}
-  #  Waits indefinitely for the next available event, returning 1, or 0 if there
-  #   was an error while waiting for events.  If 'event' is not NULL, the next
-  #   event is removed from the queue and stored in that area.
-proc waitEvent*(event: PEvent): int{.cdecl, importc: "SDL_WaitEvent", 
-                                     dynlib: LibName.}
-proc pushEvent*(event: PEvent): int{.cdecl, importc: "SDL_PushEvent", 
-                                     dynlib: LibName.}
-  # If the filter returns 1, then the event will be added to the internal queue.
-  #  If it returns 0, then the event will be dropped from the queue, but the
-  #  internal state will still be updated.  This allows selective filtering of
-  #  dynamically arriving events.
-  #
-  #  WARNING:  Be very careful of what you do in the event filter function, as
-  #            it may run in a different thread!
-  #
-  #  There is one caveat when dealing with the SDL_QUITEVENT event type.  The
-  #  event filter is only called when the window manager desires to close the
-  #  application window.  If the event filter returns 1, then the window will
-  #  be closed, otherwise the window will remain open if possible.
-  #  If the quit event is generated by an interrupt signal, it will bypass the
-  #  internal queue and be delivered to the application at the next event poll.
-proc setEventFilter*(filter: EventFilter){.cdecl, 
-    importc: "SDL_SetEventFilter", dynlib: LibName.}
-  # Return the current event filter - can be used to "chain" filters.
-  #  If there is no event filter set, this function returns NULL.
-proc getEventFilter*(): EventFilter{.cdecl, importc: "SDL_GetEventFilter", 
-                                      dynlib: LibName.}
-  # This function allows you to set the state of processing certain events.
-  #  If 'state' is set to SDL_IGNORE, that event will be automatically dropped
-  #  from the event queue and will not event be filtered.
-  #  If 'state' is set to SDL_ENABLE, that event will be processed normally.
-  #  If 'state' is set to SDL_QUERY, SDL_EventState() will return the
-  #  current processing state of the specified event.
-proc eventState*(theType: byte, state: int): byte{.cdecl, 
-    importc: "SDL_EventState", dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # Version Routines
-  #------------------------------------------------------------------------------
-  # This macro can be used to fill a version structure with the compile-time
-  #  version of the SDL library.
-proc version*(x: var Version)
-  # This macro turns the version numbers into a numeric value:
-  #   (1,2,3) -> (1203)
-  #   This assumes that there will never be more than 100 patchlevels
-proc versionnum*(x, y, z: int): int
-  # This is the version number macro for the current SDL version
-proc compiledversion*(): int
-  # This macro will evaluate to true if compiled with SDL at least X.Y.Z
-proc versionAtleast*(x, y, z: int): bool
-  # This function gets the version of the dynamically linked SDL library.
-  #  it should NOT be used to fill a version structure, instead you should
-  #  use the SDL_Version() macro.
-proc linkedVersion*(): PVersion{.cdecl, importc: "SDL_Linked_Version", 
-                                  dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # video
-  #------------------------------------------------------------------------------
-  # These functions are used internally, and should not be used unless you
-  #  have a specific need to specify the video driver you want to use.
-  #  You should normally use SDL_Init() or SDL_InitSubSystem().
-  #
-  #  SDL_VideoInit() initializes the video subsystem -- sets up a connection
-  #  to the window manager, etc, and determines the current video mode and
-  #  pixel format, but does not initialize a window or graphics mode.
-  #  Note that event handling is activated by this routine.
-  #
-  #  If you use both sound and video in your application, you need to call
-  #  SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
-  #  you won't be able to set full-screen display modes.
-proc videoInit*(driverName: cstring, flags: int32): int{.cdecl, 
-    importc: "SDL_VideoInit", dynlib: LibName.}
-proc videoQuit*(){.cdecl, importc: "SDL_VideoQuit", dynlib: LibName.}
-  # This function fills the given character buffer with the name of the
-  #  video driver, and returns a pointer to it if the video driver has
-  #  been initialized.  It returns NULL if no driver has been initialized.
-proc videoDriverName*(namebuf: cstring, maxlen: int): cstring{.cdecl, 
-    importc: "SDL_VideoDriverName", dynlib: LibName.}
-  # This function returns a pointer to the current display surface.
-  #  If SDL is doing format conversion on the display surface, this
-  #  function returns the publicly visible surface, not the real video
-  #  surface.
-proc getVideoSurface*(): PSurface{.cdecl, importc: "SDL_GetVideoSurface", 
-                                   dynlib: LibName.}
-  # This function returns a read-only pointer to information about the
-  #  video hardware.  If this is called before SDL_SetVideoMode(), the 'vfmt'
-  #  member of the returned structure will contain the pixel format of the
-  #  "best" video mode.
-proc getVideoInfo*(): PVideoInfo{.cdecl, importc: "SDL_GetVideoInfo", 
-                                  dynlib: LibName.}
-  # Check to see if a particular video mode is supported.
-  #  It returns 0 if the requested mode is not supported under any bit depth,
-  #  or returns the bits-per-pixel of the closest available mode with the
-  #  given width and height.  If this bits-per-pixel is different from the
-  #  one used when setting the video mode, SDL_SetVideoMode() will succeed,
-  #  but will emulate the requested bits-per-pixel with a shadow surface.
-  #
-  #  The arguments to SDL_VideoModeOK() are the same ones you would pass to
-  #  SDL_SetVideoMode()
-proc videoModeOK*(width, height, bpp: int, flags: int32): int{.cdecl, 
-    importc: "SDL_VideoModeOK", importc: "SDL_VideoModeOK", dynlib: LibName.}
-  # Return a pointer to an array of available screen dimensions for the
-  #  given format and video flags, sorted largest to smallest.  Returns
-  #  NULL if there are no dimensions available for a particular format,
-  #  or (SDL_Rect **)-1 if any dimension is okay for the given format.
-  #
-  #  if 'format' is NULL, the mode list will be for the format given
-  #  by SDL_GetVideoInfo( ) - > vfmt
-proc listModes*(format: PPixelFormat, flags: int32): PPSDL_Rect{.cdecl, 
-    importc: "SDL_ListModes", dynlib: LibName.}
-  # Set up a video mode with the specified width, height and bits-per-pixel.
-  #
-  #  If 'bpp' is 0, it is treated as the current display bits per pixel.
-  #
-  #  If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
-  #  requested bits-per-pixel, but will return whatever video pixel format is
-  #  available.  The default is to emulate the requested pixel format if it
-  #  is not natively available.
-  #
-  #  If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
-  #  video memory, if possible, and you may have to call SDL_LockSurface()
-  #  in order to access the raw framebuffer.  Otherwise, the video surface
-  #  will be created in system memory.
-  #
-  #  If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
-  #  updates asynchronously, but you must always lock before accessing pixels.
-  #  SDL will wait for updates to complete before returning from the lock.
-  #
-  #  If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
-  #  that the colors set by SDL_SetColors() will be the colors you get.
-  #  Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
-  #  of the colors exactly the way they are requested, and you should look
-  #  at the video surface structure to determine the actual palette.
-  #  If SDL cannot guarantee that the colors you request can be set,
-  #  i.e. if the colormap is shared, then the video surface may be created
-  #  under emulation in system memory, overriding the SDL_HWSURFACE flag.
-  #
-  #  If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
-  #  a fullscreen video mode.  The default is to create a windowed mode
-  #  if the current graphics system has a window manager.
-  #  If the SDL library is able to set a fullscreen video mode, this flag
-  #  will be set in the surface that is returned.
-  #
-  #  If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
-  #  two surfaces in video memory and swap between them when you call
-  #  SDL_Flip().  This is usually slower than the normal single-buffering
-  #  scheme, but prevents "tearing" artifacts caused by modifying video
-  #  memory while the monitor is refreshing.  It should only be used by
-  #  applications that redraw the entire screen on every update.
-  #
-  #  This function returns the video framebuffer surface, or NULL if it fails.
-proc setVideoMode*(width, height, bpp: int, flags: uint32): PSurface{.cdecl, 
-    importc: "SDL_SetVideoMode", dynlib: LibName.}
-  # Makes sure the given list of rectangles is updated on the given screen.
-  #  If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
-  #  screen.
-  #  These functions should not be called while 'screen' is locked.
-proc updateRects*(screen: PSurface, numrects: int, rects: PRect){.cdecl, 
-    importc: "SDL_UpdateRects", dynlib: LibName.}
-proc updateRect*(screen: PSurface, x, y: int32, w, h: int32){.cdecl, 
-    importc: "SDL_UpdateRect", dynlib: LibName.}
-  # On hardware that supports double-buffering, this function sets up a flip
-  #  and returns.  The hardware will wait for vertical retrace, and then swap
-  #  video buffers before the next video surface blit or lock will return.
-  #  On hardware that doesn not support double-buffering, this is equivalent
-  #  to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
-  #  The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
-  #  setting the video mode for this function to perform hardware flipping.
-  #  This function returns 0 if successful, or -1 if there was an error.
-proc flip*(screen: PSurface): int{.cdecl, importc: "SDL_Flip", dynlib: LibName.}
-  # Set the gamma correction for each of the color channels.
-  #  The gamma values range (approximately) between 0.1 and 10.0
-  #
-  #  If this function isn't supported directly by the hardware, it will
-  #  be emulated using gamma ramps, if available.  If successful, this
-  #  function returns 0, otherwise it returns -1.
-proc setGamma*(redgamma: float32, greengamma: float32, bluegamma: float32): int{.
-    cdecl, importc: "SDL_SetGamma", dynlib: LibName.}
-  # Set the gamma translation table for the red, green, and blue channels
-  #  of the video hardware.  Each table is an array of 256 16-bit quantities,
-  #  representing a mapping between the input and output for that channel.
-  #  The input is the index into the array, and the output is the 16-bit
-  #  gamma value at that index, scaled to the output color precision.
-  #
-  #  You may pass NULL for any of the channels to leave it unchanged.
-  #  If the call succeeds, it will return 0.  If the display driver or
-  #  hardware does not support gamma translation, or otherwise fails,
-  #  this function will return -1.
-proc setGammaRamp*(redtable: PUInt16, greentable: PUInt16, bluetable: PUInt16): int{.
-    cdecl, importc: "SDL_SetGammaRamp", dynlib: LibName.}
-  # Retrieve the current values of the gamma translation tables.
-  #
-  #  You must pass in valid pointers to arrays of 256 16-bit quantities.
-  #  Any of the pointers may be NULL to ignore that channel.
-  #  If the call succeeds, it will return 0.  If the display driver or
-  #  hardware does not support gamma translation, or otherwise fails,
-  #  this function will return -1.
-proc getGammaRamp*(redtable: PUInt16, greentable: PUInt16, bluetable: PUInt16): int{.
-    cdecl, importc: "SDL_GetGammaRamp", dynlib: LibName.}
-  # Sets a portion of the colormap for the given 8-bit surface.  If 'surface'
-  #  is not a palettized surface, this function does nothing, returning 0.
-  #  If all of the colors were set as passed to SDL_SetColors(), it will
-  #  return 1.  If not all the color entries were set exactly as given,
-  #  it will return 0, and you should look at the surface palette to
-  #  determine the actual color palette.
-  #
-  #  When 'surface' is the surface associated with the current display, the
-  #  display colormap will be updated with the requested colors.  If
-  #  SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
-  #  will always return 1, and the palette is guaranteed to be set the way
-  #  you desire, even if the window colormap has to be warped or run under
-  #  emulation.
-proc setColors*(surface: PSurface, colors: PColor, firstcolor: int, ncolors: int): int{.
-    cdecl, importc: "SDL_SetColors", dynlib: LibName.}
-  # Sets a portion of the colormap for a given 8-bit surface.
-  #  'flags' is one or both of:
-  #  SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
-  #                 to/from the surface,
-  #  SDL_PHYSPAL -- set physical palette, which controls how pixels look on
-  #                 the screen
-  #  Only screens have physical palettes. Separate change of physical/logical
-  #  palettes is only possible if the screen has SDL_HWPALETTE set.
-  #
-  #  The return value is 1 if all colours could be set as requested, and 0
-  #  otherwise.
-  #
-  #  SDL_SetColors() is equivalent to calling this function with
-  #  flags = (SDL_LOGPAL or SDL_PHYSPAL).
-proc setPalette*(surface: PSurface, flags: int, colors: PColor, firstcolor: int, 
-                 ncolors: int): int{.cdecl, importc: "SDL_SetPalette", 
-                                     dynlib: LibName.}
-  # Maps an RGB triple to an opaque pixel value for a given pixel format
-proc mapRGB*(format: PPixelFormat, r: byte, g: byte, b: byte): int32{.cdecl, 
-    importc: "SDL_MapRGB", dynlib: LibName.}
-  # Maps an RGBA quadruple to a pixel value for a given pixel format
-proc mapRGBA*(format: PPixelFormat, r: byte, g: byte, b: byte, a: byte): int32{.
-    cdecl, importc: "SDL_MapRGBA", dynlib: LibName.}
-  # Maps a pixel value into the RGB components for a given pixel format
-proc getRGB*(pixel: int32, fmt: PPixelFormat, r: ptr byte, g: ptr byte, b: ptr byte){.
-    cdecl, importc: "SDL_GetRGB", dynlib: LibName.}
-  # Maps a pixel value into the RGBA components for a given pixel format
-proc getRGBA*(pixel: int32, fmt: PPixelFormat, r: ptr byte, g: ptr byte, b: ptr byte, 
-              a: ptr byte){.cdecl, importc: "SDL_GetRGBA", dynlib: LibName.}
-  # Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
-  #  If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
-  #  If the depth is greater than 8 bits, the pixel format is set using the
-  #  flags '[RGB]mask'.
-  #  If the function runs out of memory, it will return NULL.
-  #
-  #  The 'flags' tell what kind of surface to create.
-  #  SDL_SWSURFACE means that the surface should be created in system memory.
-  #  SDL_HWSURFACE means that the surface should be created in video memory,
-  #  with the same format as the display surface.  This is useful for surfaces
-  #  that will not change much, to take advantage of hardware acceleration
-  #  when being blitted to the display surface.
-  #  SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
-  #  this surface, but you must always lock it before accessing the pixels.
-  #  SDL will wait for current blits to finish before returning from the lock.
-  #  SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
-  #  If the hardware supports acceleration of colorkey blits between
-  #  two surfaces in video memory, SDL will try to place the surface in
-  #  video memory. If this isn't possible or if there is no hardware
-  #  acceleration available, the surface will be placed in system memory.
-  #  SDL_SRCALPHA means that the surface will be used for alpha blits and
-  #  if the hardware supports hardware acceleration of alpha blits between
-  #  two surfaces in video memory, to place the surface in video memory
-  #  if possible, otherwise it will be placed in system memory.
-  #  If the surface is created in video memory, blits will be _much_ faster,
-  #  but the surface format must be identical to the video surface format,
-  #  and the only way to access the pixels member of the surface is to use
-  #  the SDL_LockSurface() and SDL_UnlockSurface() calls.
-  #  If the requested surface actually resides in video memory, SDL_HWSURFACE
-  #  will be set in the flags member of the returned surface.  If for some
-  #  reason the surface could not be placed in video memory, it will not have
-  #  the SDL_HWSURFACE flag set, and will be created in system memory instead.
-proc allocSurface*(flags: int32, width, height, depth: int, 
-                   rMask, gMask, bMask, aMask: int32): PSurface
-proc createRGBSurface*(flags: int32, width, height, depth: int, 
-                       rMask, gMask, bMask, aMask: int32): PSurface{.cdecl, 
-    importc: "SDL_CreateRGBSurface", dynlib: LibName.}
-proc createRGBSurfaceFrom*(pixels: pointer, width, height, depth, pitch: int, 
-                           rMask, gMask, bMask, aMask: int32): PSurface{.cdecl, 
-    importc: "SDL_CreateRGBSurfaceFrom", dynlib: LibName.}
-proc freeSurface*(surface: PSurface){.cdecl, importc: "SDL_FreeSurface", 
-                                      dynlib: LibName.}
-proc mustLock*(surface: PSurface): bool
-  # SDL_LockSurface() sets up a surface for directly accessing the pixels.
-  #  Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
-  #  to and read from 'surface->pixels', using the pixel format stored in
-  #  'surface->format'.  Once you are done accessing the surface, you should
-  #  use SDL_UnlockSurface() to release it.
-  #
-  #  Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
-  #  to 0, then you can read and write to the surface at any time, and the
-  #  pixel format of the surface will not change.  In particular, if the
-  #  SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
-  #  will not need to lock the display surface before accessing it.
-  #
-  #  No operating system or library calls should be made between lock/unlock
-  #  pairs, as critical system locks may be held during this time.
-  #
-  #  SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
-proc lockSurface*(surface: PSurface): int{.cdecl, importc: "SDL_LockSurface", 
-    dynlib: LibName.}
-proc unlockSurface*(surface: PSurface){.cdecl, importc: "SDL_UnlockSurface", 
-                                        dynlib: LibName.}
-  # Load a surface from a seekable SDL data source (memory or file.)
-  #  If 'freesrc' is non-zero, the source will be closed after being read.
-  #  Returns the new surface, or NULL if there was an error.
-  #  The new surface should be freed with SDL_FreeSurface().
-proc loadBMP_RW*(src: PRWops, freesrc: int): PSurface{.cdecl, 
-    importc: "SDL_LoadBMP_RW", dynlib: LibName.}
-  # Convenience macro -- load a surface from a file
-proc loadBMP*(filename: cstring): PSurface
-  # Save a surface to a seekable SDL data source (memory or file.)
-  #  If 'freedst' is non-zero, the source will be closed after being written.
-  #  Returns 0 if successful or -1 if there was an error.
-proc saveBMP_RW*(surface: PSurface, dst: PRWops, freedst: int): int{.cdecl, 
-    importc: "SDL_SaveBMP_RW", dynlib: LibName.}
-  # Convenience macro -- save a surface to a file
-proc saveBMP*(surface: PSurface, filename: cstring): int
-  # Sets the color key (transparent pixel) in a blittable surface.
-  #  If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
-  #  'key' will be the transparent pixel in the source image of a blit.
-  #  SDL_RLEACCEL requests RLE acceleration for the surface if present,
-  #  and removes RLE acceleration if absent.
-  #  If 'flag' is 0, this function clears any current color key.
-  #  This function returns 0, or -1 if there was an error.
-proc setColorKey*(surface: PSurface, flag, key: int32): int{.cdecl, 
-    importc: "SDL_SetColorKey", dynlib: LibName.}
-  # This function sets the alpha value for the entire surface, as opposed to
-  #  using the alpha component of each pixel. This value measures the range
-  #  of transparency of the surface, 0 being completely transparent to 255
-  #  being completely opaque. An 'alpha' value of 255 causes blits to be
-  #  opaque, the source pixels copied to the destination (the default). Note
-  #  that per-surface alpha can be combined with colorkey transparency.
-  #
-  #  If 'flag' is 0, alpha blending is disabled for the surface.
-  #  If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
-  #  OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
-  #  surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
-proc setAlpha*(surface: PSurface, flag: int32, alpha: byte): int{.cdecl, 
-    importc: "SDL_SetAlpha", dynlib: LibName.}
-  # Sets the clipping rectangle for the destination surface in a blit.
-  #
-  #  If the clip rectangle is NULL, clipping will be disabled.
-  #  If the clip rectangle doesn't intersect the surface, the function will
-  #  return SDL_FALSE and blits will be completely clipped.  Otherwise the
-  #  function returns SDL_TRUE and blits to the surface will be clipped to
-  #  the intersection of the surface area and the clipping rectangle.
-  #
-  #  Note that blits are automatically clipped to the edges of the source
-  #  and destination surfaces.
-proc setClipRect*(surface: PSurface, rect: PRect){.cdecl, 
-    importc: "SDL_SetClipRect", dynlib: LibName.}
-  # Gets the clipping rectangle for the destination surface in a blit.
-  #  'rect' must be a pointer to a valid rectangle which will be filled
-  #  with the correct values.
-proc getClipRect*(surface: PSurface, rect: PRect){.cdecl, 
-    importc: "SDL_GetClipRect", dynlib: LibName.}
-  # Creates a new surface of the specified format, and then copies and maps
-  #  the given surface to it so the blit of the converted surface will be as
-  #  fast as possible.  If this function fails, it returns NULL.
-  #
-  #  The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
-  #  semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
-  #  SDL will try to RLE accelerate colorkey and alpha blits in the resulting
-  #  surface.
-  #
-  #  This function is used internally by SDL_DisplayFormat().
-proc convertSurface*(src: PSurface, fmt: PPixelFormat, flags: int32): PSurface{.
-    cdecl, importc: "SDL_ConvertSurface", dynlib: LibName.}
-  #
-  #  This performs a fast blit from the source surface to the destination
-  #  surface.  It assumes that the source and destination rectangles are
-  #  the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
-  #  surface (src or dst) is copied.  The final blit rectangles are saved
-  #  in 'srcrect' and 'dstrect' after all clipping is performed.
-  #  If the blit is successful, it returns 0, otherwise it returns -1.
-  #
-  #  The blit function should not be called on a locked surface.
-  #
-  #  The blit semantics for surfaces with and without alpha and colorkey
-  #  are defined as follows:
-  #
-  #  RGBA->RGB:
-  #      SDL_SRCALPHA set:
-  #   alpha-blend (using alpha-channel).
-  #   SDL_SRCCOLORKEY ignored.
-  #      SDL_SRCALPHA not set:
-  #   copy RGB.
-  #   if SDL_SRCCOLORKEY set, only copy the pixels matching the
-  #   RGB values of the source colour key, ignoring alpha in the
-  #   comparison.
-  #
-  #  RGB->RGBA:
-  #      SDL_SRCALPHA set:
-  #   alpha-blend (using the source per-surface alpha value);
-  #   set destination alpha to opaque.
-  #      SDL_SRCALPHA not set:
-  #   copy RGB, set destination alpha to opaque.
-  #      both:
-  #   if SDL_SRCCOLORKEY set, only copy the pixels matching the
-  #   source colour key.
-  #
-  #  RGBA->RGBA:
-  #      SDL_SRCALPHA set:
-  #   alpha-blend (using the source alpha channel) the RGB values;
-  #   leave destination alpha untouched. [Note: is this correct?]
-  #   SDL_SRCCOLORKEY ignored.
-  #      SDL_SRCALPHA not set:
-  #   copy all of RGBA to the destination.
-  #   if SDL_SRCCOLORKEY set, only copy the pixels matching the
-  #   RGB values of the source colour key, ignoring alpha in the
-  #   comparison.
-  #
-  #  RGB->RGB:
-  #      SDL_SRCALPHA set:
-  #   alpha-blend (using the source per-surface alpha value).
-  #      SDL_SRCALPHA not set:
-  #   copy RGB.
-  #      both:
-  #   if SDL_SRCCOLORKEY set, only copy the pixels matching the
-  #   source colour key.
-  #
-  #  If either of the surfaces were in video memory, and the blit returns -2,
-  #  the video memory was lost, so it should be reloaded with artwork and
-  #  re-blitted:
-  #  while ( SDL_BlitSurface(image, imgrect, screen, dstrect) = -2 ) do
-  #  begin
-  #  while ( SDL_LockSurface(image) < 0 ) do
-  #   Sleep(10);
-  #  -- Write image pixels to image->pixels --
-  #  SDL_UnlockSurface(image);
-  # end;
-  #
-  #  This happens under DirectX 5.0 when the system switches away from your
-  #  fullscreen application.  The lock will also fail until you have access
-  #  to the video memory again.
-  # You should call SDL_BlitSurface() unless you know exactly how SDL
-  #   blitting works internally and how to use the other blit functions.
-proc blitSurface*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int
-  #  This is the public blit function, SDL_BlitSurface(), and it performs
-  #   rectangle validation and clipping before passing it to SDL_LowerBlit()
-proc upperBlit*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int{.
-    cdecl, importc: "SDL_UpperBlit", dynlib: LibName.}
-  # This is a semi-private blit function and it performs low-level surface
-  #  blitting only.
-proc lowerBlit*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int{.
-    cdecl, importc: "SDL_LowerBlit", dynlib: LibName.}
-  # This function performs a fast fill of the given rectangle with 'color'
-  #  The given rectangle is clipped to the destination surface clip area
-  #  and the final fill rectangle is saved in the passed in pointer.
-  #  If 'dstrect' is NULL, the whole surface will be filled with 'color'
-  #  The color should be a pixel of the format used by the surface, and
-  #  can be generated by the SDL_MapRGB() function.
-  #  This function returns 0 on success, or -1 on error.
-proc fillRect*(dst: PSurface, dstrect: PRect, color: int32): int{.cdecl, 
-    importc: "SDL_FillRect", dynlib: LibName.}
-  # This function takes a surface and copies it to a new surface of the
-  #  pixel format and colors of the video framebuffer, suitable for fast
-  #  blitting onto the display surface.  It calls SDL_ConvertSurface()
-  #
-  #  If you want to take advantage of hardware colorkey or alpha blit
-  #  acceleration, you should set the colorkey and alpha value before
-  #  calling this function.
-  #
-  #  If the conversion fails or runs out of memory, it returns NULL
-proc displayFormat*(surface: PSurface): PSurface{.cdecl, 
-    importc: "SDL_DisplayFormat", dynlib: LibName.}
-  # This function takes a surface and copies it to a new surface of the
-  #  pixel format and colors of the video framebuffer (if possible),
-  #  suitable for fast alpha blitting onto the display surface.
-  #  The new surface will always have an alpha channel.
-  #
-  #  If you want to take advantage of hardware colorkey or alpha blit
-  #  acceleration, you should set the colorkey and alpha value before
-  #  calling this function.
-  #
-  #  If the conversion fails or runs out of memory, it returns NULL
-proc displayFormatAlpha*(surface: PSurface): PSurface{.cdecl, 
-    importc: "SDL_DisplayFormatAlpha", dynlib: LibName.}
-  #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-  #* YUV video surface overlay functions                                       */
-  #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-  # This function creates a video output overlay
-  #  Calling the returned surface an overlay is something of a misnomer because
-  #  the contents of the display surface underneath the area where the overlay
-  #  is shown is undefined - it may be overwritten with the converted YUV data.
-proc createYUVOverlay*(width: int, height: int, format: int32, 
-                       display: PSurface): POverlay{.cdecl, 
-    importc: "SDL_CreateYUVOverlay", dynlib: LibName.}
-  # Lock an overlay for direct access, and unlock it when you are done
-proc lockYUVOverlay*(overlay: POverlay): int{.cdecl, 
-    importc: "SDL_LockYUVOverlay", dynlib: LibName.}
-proc unlockYUVOverlay*(overlay: POverlay){.cdecl, 
-    importc: "SDL_UnlockYUVOverlay", dynlib: LibName.}
-  # Blit a video overlay to the display surface.
-  #  The contents of the video surface underneath the blit destination are
-  #  not defined.
-  #  The width and height of the destination rectangle may be different from
-  #  that of the overlay, but currently only 2x scaling is supported.
-proc displayYUVOverlay*(overlay: POverlay, dstrect: PRect): int{.cdecl, 
-    importc: "SDL_DisplayYUVOverlay", dynlib: LibName.}
-  # Free a video overlay
-proc freeYUVOverlay*(overlay: POverlay){.cdecl, importc: "SDL_FreeYUVOverlay", 
-    dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # OpenGL Routines
-  #------------------------------------------------------------------------------
-  # Dynamically load a GL driver, if SDL is built with dynamic GL.
-  #
-  #  SDL links normally with the OpenGL library on your system by default,
-  #  but you can compile it to dynamically load the GL driver at runtime.
-  #  If you do this, you need to retrieve all of the GL functions used in
-  #  your program from the dynamic library using SDL_GL_GetProcAddress().
-  #
-  #  This is disabled in default builds of SDL.
-proc glLoadLibrary*(filename: cstring): int{.cdecl, 
-    importc: "SDL_GL_LoadLibrary", dynlib: LibName.}
-  # Get the address of a GL function (for extension functions)
-proc glGetProcAddress*(procname: cstring): pointer{.cdecl, 
-    importc: "SDL_GL_GetProcAddress", dynlib: LibName.}
-  # Set an attribute of the OpenGL subsystem before intialization.
-proc glSetAttribute*(attr: GLAttr, value: int): int{.cdecl, 
-    importc: "SDL_GL_SetAttribute", dynlib: LibName.}
-  # Get an attribute of the OpenGL subsystem from the windowing
-  #  interface, such as glX. This is of course different from getting
-  #  the values from SDL's internal OpenGL subsystem, which only
-  #  stores the values you request before initialization.
-  #
-  #  Developers should track the values they pass into SDL_GL_SetAttribute
-  #  themselves if they want to retrieve these values.
-proc glGetAttribute*(attr: GLAttr, value: var int): int{.cdecl, 
-    importc: "SDL_GL_GetAttribute", dynlib: LibName.}
-  # Swap the OpenGL buffers, if double-buffering is supported.
-proc glSwapBuffers*(){.cdecl, importc: "SDL_GL_SwapBuffers", dynlib: LibName.}
-  # Internal functions that should not be called unless you have read
-  #  and understood the source code for these functions.
-proc glUpdateRects*(numrects: int, rects: PRect){.cdecl, 
-    importc: "SDL_GL_UpdateRects", dynlib: LibName.}
-proc glLock*(){.cdecl, importc: "SDL_GL_Lock", dynlib: LibName.}
-proc glUnlock*(){.cdecl, importc: "SDL_GL_Unlock", dynlib: LibName.}
-  #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  #* These functions allow interaction with the window manager, if any.        *
-  #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Sets/Gets the title and icon text of the display window
-proc wmGetCaption*(title: var cstring, icon: var cstring){.cdecl, 
-    importc: "SDL_WM_GetCaption", dynlib: LibName.}
-proc wmSetCaption*(title: cstring, icon: cstring){.cdecl, 
-    importc: "SDL_WM_SetCaption", dynlib: LibName.}
-  # Sets the icon for the display window.
-  #  This function must be called before the first call to SDL_SetVideoMode().
-  #  It takes an icon surface, and a mask in MSB format.
-  #  If 'mask' is NULL, the entire icon surface will be used as the icon.
-proc wmSetIcon*(icon: PSurface, mask: byte){.cdecl, importc: "SDL_WM_SetIcon", 
-    dynlib: LibName.}
-  # This function iconifies the window, and returns 1 if it succeeded.
-  #  If the function succeeds, it generates an SDL_APPACTIVE loss event.
-  #  This function is a noop and returns 0 in non-windowed environments.
-proc wmIconifyWindow*(): int{.cdecl, importc: "SDL_WM_IconifyWindow", 
-                               dynlib: LibName.}
-  # Toggle fullscreen mode without changing the contents of the screen.
-  #  If the display surface does not require locking before accessing
-  #  the pixel information, then the memory pointers will not change.
-  #
-  #  If this function was able to toggle fullscreen mode (change from
-  #  running in a window to fullscreen, or vice-versa), it will return 1.
-  #  If it is not implemented, or fails, it returns 0.
-  #
-  #  The next call to SDL_SetVideoMode() will set the mode fullscreen
-  #  attribute based on the flags parameter - if SDL_FULLSCREEN is not
-  #  set, then the display will be windowed by default where supported.
-  #
-  #  This is currently only implemented in the X11 video driver.
-proc wmToggleFullScreen*(surface: PSurface): int{.cdecl, 
-    importc: "SDL_WM_ToggleFullScreen", dynlib: LibName.}
-  # Grabbing means that the mouse is confined to the application window,
-  #  and nearly all keyboard input is passed directly to the application,
-  #  and not interpreted by a window manager, if any.
-proc wmGrabInput*(mode: GrabMode): GrabMode{.cdecl, 
-    importc: "SDL_WM_GrabInput", dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # mouse-routines
-  #------------------------------------------------------------------------------
-  # Retrieve the current state of the mouse.
-  #  The current button state is returned as a button bitmask, which can
-  #  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
-  #  current mouse cursor position.  You can pass NULL for either x or y.
-proc getMouseState*(x: var int, y: var int): byte{.cdecl, 
-    importc: "SDL_GetMouseState", dynlib: LibName.}
-  # Retrieve the current state of the mouse.
-  #  The current button state is returned as a button bitmask, which can
-  #  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
-  #  mouse deltas since the last call to SDL_GetRelativeMouseState().
-proc getRelativeMouseState*(x: var int, y: var int): byte{.cdecl, 
-    importc: "SDL_GetRelativeMouseState", dynlib: LibName.}
-  # Set the position of the mouse cursor (generates a mouse motion event)
-proc warpMouse*(x, y: uint16){.cdecl, importc: "SDL_WarpMouse", dynlib: LibName.}
-  # Create a cursor using the specified data and mask (in MSB format).
-  #  The cursor width must be a multiple of 8 bits.
-  #
-  #  The cursor is created in black and white according to the following:
-  #  data  mask    resulting pixel on screen
-  #   0     1       White
-  #   1     1       Black
-  #   0     0       Transparent
-  #   1     0       Inverted color if possible, black if not.
-  #
-  #  Cursors created with this function must be freed with SDL_FreeCursor().
-proc createCursor*(data, mask: ptr byte, w, h, hotX, hotY: int): PCursor{.cdecl, 
-    importc: "SDL_CreateCursor", dynlib: LibName.}
-  # Set the currently active cursor to the specified one.
-  #  If the cursor is currently visible, the change will be immediately
-  #  represented on the display.
-proc setCursor*(cursor: PCursor){.cdecl, importc: "SDL_SetCursor", 
-                                  dynlib: LibName.}
-  # Returns the currently active cursor.
-proc getCursor*(): PCursor{.cdecl, importc: "SDL_GetCursor", dynlib: LibName.}
-  # Deallocates a cursor created with SDL_CreateCursor().
-proc freeCursor*(cursor: PCursor){.cdecl, importc: "SDL_FreeCursor", 
-                                   dynlib: LibName.}
-  # Toggle whether or not the cursor is shown on the screen.
-  #  The cursor start off displayed, but can be turned off.
-  #  SDL_ShowCursor() returns 1 if the cursor was being displayed
-  #  before the call, or 0 if it was not.  You can query the current
-  #  state by passing a 'toggle' value of -1.
-proc showCursor*(toggle: int): int{.cdecl, importc: "SDL_ShowCursor", 
-                                    dynlib: LibName.}
-proc button*(b: int): int
-  #------------------------------------------------------------------------------
-  # Keyboard-routines
-  #------------------------------------------------------------------------------
-  # Enable/Disable UNICODE translation of keyboard input.
-  #  This translation has some overhead, so translation defaults off.
-  #  If 'enable' is 1, translation is enabled.
-  #  If 'enable' is 0, translation is disabled.
-  #  If 'enable' is -1, the translation state is not changed.
-  #  It returns the previous state of keyboard translation.
-proc enableUNICODE*(enable: int): int{.cdecl, importc: "SDL_EnableUNICODE", 
-                                       dynlib: LibName.}
-  # If 'delay' is set to 0, keyboard repeat is disabled.
-proc enableKeyRepeat*(delay: int, interval: int): int{.cdecl, 
-    importc: "SDL_EnableKeyRepeat", dynlib: LibName.}
-proc getKeyRepeat*(delay: PInteger, interval: PInteger){.cdecl, 
-    importc: "SDL_GetKeyRepeat", dynlib: LibName.}
-  # Get a snapshot of the current state of the keyboard.
-  #  Returns an array of keystates, indexed by the SDLK_* syms.
-  #  Used:
-  #
-  #  byte *keystate = SDL_GetKeyState(NULL);
-  #  if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed
-proc getKeyState*(numkeys: pointer): ptr byte{.cdecl, importc: "SDL_GetKeyState", 
-    dynlib: LibName.}
-  # Get the current key modifier state
-proc getModState*(): Mod{.cdecl, importc: "SDL_GetModState", dynlib: LibName.}
-  # Set the current key modifier state
-  #  This does not change the keyboard state, only the key modifier flags.
-proc setModState*(modstate: Mod){.cdecl, importc: "SDL_SetModState", 
-                                   dynlib: LibName.}
-  # Get the name of an SDL virtual keysym
-proc getKeyName*(key: Key): cstring{.cdecl, importc: "SDL_GetKeyName", 
-                                      dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # Active Routines
-  #------------------------------------------------------------------------------
-  # This function returns the current state of the application, which is a
-  #  bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
-  #  SDL_APPACTIVE.  If SDL_APPACTIVE is set, then the user is able to
-  #  see your application, otherwise it has been iconified or disabled.
-proc getAppState*(): byte{.cdecl, importc: "SDL_GetAppState", dynlib: LibName.}
-  # Mutex functions
-  # Create a mutex, initialized unlocked
-proc createMutex*(): PMutex{.cdecl, importc: "SDL_CreateMutex", dynlib: LibName.}
-  # Lock the mutex  (Returns 0, or -1 on error)
-proc mutexP*(mutex: PMutex): int{.cdecl, importc: "SDL_mutexP", dynlib: LibName.}
-proc lockMutex*(mutex: PMutex): int
-  # Unlock the mutex  (Returns 0, or -1 on error)
-proc mutexV*(mutex: PMutex): int{.cdecl, importc: "SDL_mutexV", dynlib: LibName.}
-proc unlockMutex*(mutex: PMutex): int
-  # Destroy a mutex
-proc destroyMutex*(mutex: PMutex){.cdecl, importc: "SDL_DestroyMutex", 
-                                   dynlib: LibName.}
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Semaphore functions
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Create a semaphore, initialized with value, returns NULL on failure.
-proc createSemaphore*(initialValue: int32): PSem{.cdecl, 
-    importc: "SDL_CreateSemaphore", dynlib: LibName.}
-  # Destroy a semaphore
-proc destroySemaphore*(sem: PSem){.cdecl, importc: "SDL_DestroySemaphore", 
-                                   dynlib: LibName.}
-  # This function suspends the calling thread until the semaphore pointed
-  #  to by sem has a positive count. It then atomically decreases the semaphore
-  #  count.
-proc semWait*(sem: PSem): int{.cdecl, importc: "SDL_SemWait", dynlib: LibName.}
-  # Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
-  #   SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
-proc semTryWait*(sem: PSem): int{.cdecl, importc: "SDL_SemTryWait", 
-                                  dynlib: LibName.}
-  # Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
-  #   the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
-  #   the allotted time, and -1 on error.
-  #   On some platforms this function is implemented by looping with a delay
-  #   of 1 ms, and so should be avoided if possible.
-proc semWaitTimeout*(sem: PSem, ms: int32): int{.cdecl, 
-    importc: "SDL_SemWaitTimeout", dynlib: LibName.}
-  # Atomically increases the semaphore's count (not blocking), returns 0,
-  #   or -1 on error.
-proc semPost*(sem: PSem): int{.cdecl, importc: "SDL_SemPost", dynlib: LibName.}
-  # Returns the current count of the semaphore
-proc semValue*(sem: PSem): int32{.cdecl, importc: "SDL_SemValue", 
-                                   dynlib: LibName.}
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Condition variable functions
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Create a condition variable
-proc createCond*(): PCond{.cdecl, importc: "SDL_CreateCond", dynlib: LibName.}
-  # Destroy a condition variable
-proc destroyCond*(cond: PCond){.cdecl, importc: "SDL_DestroyCond", 
-                                dynlib: LibName.}
-  # Restart one of the threads that are waiting on the condition variable,
-  #   returns 0 or -1 on error.
-proc condSignal*(cond: PCond): int{.cdecl, importc: "SDL_CondSignal", 
-                                    dynlib: LibName.}
-  # Restart all threads that are waiting on the condition variable,
-  #  returns 0 or -1 on error.
-proc condBroadcast*(cond: PCond): int{.cdecl, importc: "SDL_CondBroadcast", 
-                                       dynlib: LibName.}
-  # Wait on the condition variable, unlocking the provided mutex.
-  #  The mutex must be locked before entering this function!
-  #  Returns 0 when it is signaled, or -1 on error.
-proc condWait*(cond: PCond, mut: PMutex): int{.cdecl, importc: "SDL_CondWait", 
-    dynlib: LibName.}
-  # Waits for at most 'ms' milliseconds, and returns 0 if the condition
-  #  variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
-  #  signaled in the allotted time, and -1 on error.
-  #  On some platforms this function is implemented by looping with a delay
-  #  of 1 ms, and so should be avoided if possible.
-proc condWaitTimeout*(cond: PCond, mut: PMutex, ms: int32): int{.cdecl, 
-    importc: "SDL_CondWaitTimeout", dynlib: LibName.}
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Condition variable functions
-  # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-  # Create a thread
-proc createThread*(fn, data: pointer): PThread{.cdecl, 
-    importc: "SDL_CreateThread", dynlib: LibName.}
-  # Get the 32-bit thread identifier for the current thread
-proc threadID*(): int32{.cdecl, importc: "SDL_ThreadID", dynlib: LibName.}
-  # Get the 32-bit thread identifier for the specified thread,
-  #  equivalent to SDL_ThreadID() if the specified thread is NULL.
-proc getThreadID*(thread: PThread): int32{.cdecl, importc: "SDL_GetThreadID", 
-    dynlib: LibName.}
-  # Wait for a thread to finish.
-  #  The return code for the thread function is placed in the area
-  #  pointed to by 'status', if 'status' is not NULL.
-proc waitThread*(thread: PThread, status: var int){.cdecl, 
-    importc: "SDL_WaitThread", dynlib: LibName.}
-  # Forcefully kill a thread without worrying about its state
-proc killThread*(thread: PThread){.cdecl, importc: "SDL_KillThread", 
-                                   dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  # Get Environment Routines
-  #------------------------------------------------------------------------------
-  #*
-  # * This function gives you custom hooks into the window manager information.
-  # * It fills the structure pointed to by 'info' with custom information and
-  # * returns 1 if the function is implemented.  If it's not implemented, or
-  # * the version member of the 'info' structure is invalid, it returns 0.
-  # *
-proc getWMInfo*(info: PSysWMinfo): int{.cdecl, importc: "SDL_GetWMInfo", 
-                                        dynlib: LibName.}
-  #------------------------------------------------------------------------------
-  #SDL_loadso.h
-  #* This function dynamically loads a shared object and returns a pointer
-  # * to the object handle (or NULL if there was an error).
-  # * The 'sofile' parameter is a system dependent name of the object file.
-  # *
-proc loadObject*(sofile: cstring): pointer{.cdecl, importc: "SDL_LoadObject", 
-    dynlib: LibName.}
-  #* Given an object handle, this function looks up the address of the
-  # * named function in the shared object and returns it.  This address
-  # * is no longer valid after calling SDL_UnloadObject().
-  # *
-proc loadFunction*(handle: pointer, name: cstring): pointer{.cdecl, 
-    importc: "SDL_LoadFunction", dynlib: LibName.}
-  #* Unload a shared object from memory *
-proc unloadObject*(handle: pointer){.cdecl, importc: "SDL_UnloadObject", 
-                                     dynlib: LibName.}
-  #------------------------------------------------------------------------------
-proc swap32*(d: int32): int32
-  # Bitwise Checking functions
-proc isBitOn*(value: int, bit: int8): bool
-proc turnBitOn*(value: int, bit: int8): int
-proc turnBitOff*(value: int, bit: int8): int
-# implementation
-
-proc tablesize(table: cstring): int = 
-  result = sizeOf(table) div sizeOf(table[0])
-
-proc rwSeek(context: PRWops, offset: int, whence: int): int = 
-  result = context.seek(context, offset, whence)
-
-proc rwTell(context: PRWops): int = 
-  result = context.seek(context, 0, 1)
-
-proc rwRead(context: PRWops, theptr: pointer, size: int, n: int): int = 
-  result = context.read(context, theptr, size, n)
-
-proc rwWrite(context: PRWops, theptr: pointer, size: int, n: int): int = 
-  result = context.write(context, theptr, size, n)
-
-proc rwClose(context: PRWops): int = 
-  result = context.closeFile(context)
-
-proc loadWAV(filename: cstring, spec: PAudioSpec, audioBuf: ptr byte, 
-             audiolen: PUInt32): PAudioSpec = 
-  result = loadWAV_RW(rWFromFile(filename, "rb"), 1, spec, audioBuf, audiolen)
-
-proc cdInDrive(status: CDStatus): bool = 
-  result = ord(status) > ord(CD_ERROR)
-
-proc framesToMsf*(frames: int; m, s, f: var int) =
-  var value = frames
-  f = value mod CD_FPS
-  value = value div CD_FPS
-  s = value mod 60
-  value = value div 60
-  m = value
-
-proc msfToFrames*(m, s, f: int): int = 
-  result = m * 60 * CD_FPS + s * CD_FPS + f
-
-proc version(x: var Version) = 
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-proc versionnum(x, y, z: int): int = 
-  result = x * 1000 + y * 100 + z
-
-proc compiledversion(): int = 
-  result = versionnum(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL)
-
-proc versionAtleast(x, y, z: int): bool = 
-  result = (compiledversion() >= versionnum(x, y, z))
-
-proc loadBMP(filename: cstring): PSurface = 
-  result = loadBMP_RW(rWFromFile(filename, "rb"), 1)
-
-proc saveBMP(surface: PSurface, filename: cstring): int = 
-  result = saveBMP_RW(surface, rWFromFile(filename, "wb"), 1)
-
-proc blitSurface(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int = 
-  result = upperBlit(src, srcrect, dst, dstrect)
-
-proc allocSurface(flags: int32, width, height, depth: int, 
-                  rMask, gMask, bMask, aMask: int32): PSurface = 
-  result = createRGBSurface(flags, width, height, depth, rMask, gMask, bMask, 
-                            aMask)
-
-proc mustLock(surface: PSurface): bool = 
-  result = ((surface.offset != 0) or
-      ((surface.flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0))
-
-proc lockMutex(mutex: PMutex): int = 
-  result = mutexP(mutex)
-
-proc unlockMutex(mutex: PMutex): int = 
-  result = mutexV(mutex)
-
-proc button(b: int): int = 
-  result = PRESSED shl (b - 1)
-
-proc swap32(d: int32): int32 = 
-  result = ((d shl 24) or ((d shl 8) and 0x00FF0000) or
-      ((d shr 8) and 0x0000FF00) or (d shr 24))
-
-proc isBitOn(value: int, bit: int8): bool = 
-  result = ((value and (1 shl ze(bit))) != 0)
-
-proc turnBitOn(value: int, bit: int8): int = 
-  result = (value or (1 shl ze(bit)))
-
-proc turnBitOff(value: int, bit: int8): int = 
-  result = (value and not (1 shl ze(bit)))
diff --git a/lib/wrappers/sdl/sdl_gfx.nim b/lib/wrappers/sdl/sdl_gfx.nim
deleted file mode 100644
index 0f5afaa9b..000000000
--- a/lib/wrappers/sdl/sdl_gfx.nim
+++ /dev/null
@@ -1,452 +0,0 @@
-#
-#  $Id: sdl_gfx.pas,v 1.3 2007/05/29 21:31:04 savage Exp $
-#
-#
-#
-#  $Log: sdl_gfx.pas,v $
-#  Revision 1.3  2007/05/29 21:31:04  savage
-#  Changes as suggested by Almindor for 64bit compatibility.
-#
-#  Revision 1.2  2007/05/20 20:30:18  savage
-#  Initial Changes to Handle 64 Bits
-#
-#  Revision 1.1  2005/01/03 19:08:32  savage
-#  Header for the SDL_Gfx library.
-#
-#
-#
-#
-
-import 
-  sdl
-
-when defined(windows): 
-  const 
-    gfxLibName = "SDL_gfx.dll"
-elif defined(macosx): 
-  const 
-    gfxLibName = "libSDL_gfx.dylib"
-else: 
-  const 
-    gfxLibName = "libSDL_gfx.so"
-const                         # Some rates in Hz
-  FPS_UPPER_LIMIT* = 200
-  FPS_LOWER_LIMIT* = 1
-  FPS_DEFAULT* = 30           # ---- Defines
-  SMOOTHING_OFF* = 0
-  SMOOTHING_ON* = 1
-
-type 
-  PFPSmanager* = ptr FPSmanager
-  FPSmanager*{.final.} = object  # ---- Structures
-    framecount*: uint32
-    rateticks*: float32
-    lastticks*: uint32
-    rate*: uint32
-
-  PColorRGBA* = ptr ColorRGBA
-  ColorRGBA*{.final.} = object 
-    r*: byte
-    g*: byte
-    b*: byte
-    a*: byte
-
-  PColorY* = ptr ColorY
-  ColorY*{.final.} = object   #
-                              #
-                              # SDL_framerate: framerate manager
-                              #
-                              # LGPL (c) A. Schiffler
-                              #
-                              #
-    y*: byte
-{.deprecated: [TFPSmanager: FPSmanager, TColorRGBA: ColorRGBA, TColorY: ColorY].}
-
-proc initFramerate*(manager: PFPSmanager){.cdecl, importc: "SDL_initFramerate", 
-    dynlib: gfxLibName.}
-proc setFramerate*(manager: PFPSmanager, rate: cint): cint{.cdecl, 
-    importc: "SDL_setFramerate", dynlib: gfxLibName.}
-proc getFramerate*(manager: PFPSmanager): cint{.cdecl, 
-    importc: "SDL_getFramerate", dynlib: gfxLibName.}
-proc framerateDelay*(manager: PFPSmanager){.cdecl, 
-    importc: "SDL_framerateDelay", dynlib: gfxLibName.}
-  #
-  #
-  # SDL_gfxPrimitives: graphics primitives for SDL
-  #
-  # LGPL (c) A. Schiffler
-  #
-  #
-  # Note: all ___Color routines expect the color to be in format 0xRRGGBBAA 
-  # Pixel 
-proc pixelColor*(dst: PSurface, x: int16, y: int16, color: uint32): cint{.
-    cdecl, importc: "pixelColor", dynlib: gfxLibName.}
-proc pixelRGBA*(dst: PSurface, x: int16, y: int16, r: byte, g: byte, 
-                b: byte, a: byte): cint{.cdecl, importc: "pixelRGBA", 
-    dynlib: gfxLibName.}
-  # Horizontal line 
-proc hlineColor*(dst: PSurface, x1: int16, x2: int16, y: int16, color: uint32): cint{.
-    cdecl, importc: "hlineColor", dynlib: gfxLibName.}
-proc hlineRGBA*(dst: PSurface, x1: int16, x2: int16, y: int16, r: byte, 
-                g: byte, b: byte, a: byte): cint{.cdecl, importc: "hlineRGBA", 
-    dynlib: gfxLibName.}
-  # Vertical line 
-proc vlineColor*(dst: PSurface, x: int16, y1: int16, y2: int16, color: uint32): cint{.
-    cdecl, importc: "vlineColor", dynlib: gfxLibName.}
-proc vlineRGBA*(dst: PSurface, x: int16, y1: int16, y2: int16, r: byte, 
-                g: byte, b: byte, a: byte): cint{.cdecl, importc: "vlineRGBA", 
-    dynlib: gfxLibName.}
-  # Rectangle 
-proc rectangleColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                     y2: int16, color: uint32): cint{.cdecl, 
-    importc: "rectangleColor", dynlib: gfxLibName.}
-proc rectangleRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                    y2: int16, r: byte, g: byte, b: byte, a: byte): cint{.
-    cdecl, importc: "rectangleRGBA", dynlib: gfxLibName.}
-  # Filled rectangle (Box) 
-proc boxColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-               color: uint32): cint{.cdecl, importc: "boxColor", 
-                                    dynlib: gfxLibName.}
-proc boxRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-              r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "boxRGBA", dynlib: gfxLibName.}
-  # Line 
-proc lineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-                color: uint32): cint{.cdecl, importc: "lineColor", 
-                                     dynlib: gfxLibName.}
-proc lineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-               r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "lineRGBA", dynlib: gfxLibName.}
-  # AA Line 
-proc aalineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-                  color: uint32): cint{.cdecl, importc: "aalineColor", 
-                                       dynlib: gfxLibName.}
-proc aalineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-                 r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "aalineRGBA", dynlib: gfxLibName.}
-  # Circle 
-proc circleColor*(dst: PSurface, x: int16, y: int16, r: int16, color: uint32): cint{.
-    cdecl, importc: "circleColor", dynlib: gfxLibName.}
-proc circleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte, 
-                 g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "circleRGBA", dynlib: gfxLibName.}
-  # AA Circle 
-proc aacircleColor*(dst: PSurface, x: int16, y: int16, r: int16, 
-                    color: uint32): cint{.cdecl, importc: "aacircleColor", 
-    dynlib: gfxLibName.}
-proc aacircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte, 
-                   g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "aacircleRGBA", dynlib: gfxLibName.}
-  # Filled Circle 
-proc filledCircleColor*(dst: PSurface, x: int16, y: int16, r: int16, 
-                        color: uint32): cint{.cdecl, 
-    importc: "filledCircleColor", dynlib: gfxLibName.}
-proc filledCircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, 
-                       r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "filledCircleRGBA", dynlib: gfxLibName.}
-  # Ellipse 
-proc ellipseColor*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16, 
-                   color: uint32): cint{.cdecl, importc: "ellipseColor", 
-                                        dynlib: gfxLibName.}
-proc ellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16, 
-                  r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "ellipseRGBA", dynlib: gfxLibName.}
-  # AA Ellipse 
-proc aaellipseColor*(dst: PSurface, xc: int16, yc: int16, rx: int16, 
-                     ry: int16, color: uint32): cint{.cdecl, 
-    importc: "aaellipseColor", dynlib: gfxLibName.}
-proc aaellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16, 
-                    r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "aaellipseRGBA", dynlib: gfxLibName.}
-  # Filled Ellipse 
-proc filledEllipseColor*(dst: PSurface, x: int16, y: int16, rx: int16, 
-                         ry: int16, color: uint32): cint{.cdecl, 
-    importc: "filledEllipseColor", dynlib: gfxLibName.}
-proc filledEllipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, 
-                        ry: int16, r: byte, g: byte, b: byte, a: byte): cint{.
-    cdecl, importc: "filledEllipseRGBA", dynlib: gfxLibName.}
-  # Pie
-proc pieColor*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16, 
-               finish: int16, color: uint32): cint{.cdecl, importc: "pieColor", 
-    dynlib: gfxLibName.}
-proc pieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16, 
-              finish: int16, r: byte, g: byte, b: byte, a: byte): cint{.
-    cdecl, importc: "pieRGBA", dynlib: gfxLibName.}
-  # Filled Pie
-proc filledPieColor*(dst: PSurface, x: int16, y: int16, rad: int16, 
-                     start: int16, finish: int16, color: uint32): cint{.cdecl, 
-    importc: "filledPieColor", dynlib: gfxLibName.}
-proc filledPieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, 
-                    start: int16, finish: int16, r: byte, g: byte, b: byte, 
-                    a: byte): cint{.cdecl, importc: "filledPieRGBA", 
-                                    dynlib: gfxLibName.}
-  # Trigon
-proc trigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-                  x3: int16, y3: int16, color: uint32): cint{.cdecl, 
-    importc: "trigonColor", dynlib: gfxLibName.}
-proc trigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16, 
-                 x3: int16, y3: int16, r: byte, g: byte, b: byte, a: byte): cint{.
-    cdecl, importc: "trigonRGBA", dynlib: gfxLibName.}
-  # AA-Trigon
-proc aatrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                    y2: int16, x3: int16, y3: int16, color: uint32): cint{.
-    cdecl, importc: "aatrigonColor", dynlib: gfxLibName.}
-proc aatrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                   y2: int16, x3: int16, y3: int16, r: byte, g: byte, 
-                   b: byte, a: byte): cint{.cdecl, importc: "aatrigonRGBA", 
-    dynlib: gfxLibName.}
-  # Filled Trigon
-proc filledTrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                        y2: int16, x3: int16, y3: int16, color: uint32): cint{.
-    cdecl, importc: "filledTrigonColor", dynlib: gfxLibName.}
-proc filledTrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, 
-                       y2: int16, x3: int16, y3: int16, r: byte, g: byte, 
-                       b: byte, a: byte): cint{.cdecl, 
-    importc: "filledTrigonRGBA", dynlib: gfxLibName.}
-  # Polygon
-proc polygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, 
-                   color: uint32): cint{.cdecl, importc: "polygonColor", 
-                                        dynlib: gfxLibName.}
-proc polygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte, 
-                  g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "polygonRGBA", dynlib: gfxLibName.}
-  # AA-Polygon
-proc aapolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, 
-                     color: uint32): cint{.cdecl, importc: "aapolygonColor", 
-    dynlib: gfxLibName.}
-proc aapolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte, 
-                    g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "aapolygonRGBA", dynlib: gfxLibName.}
-  # Filled Polygon
-proc filledPolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, 
-                         color: uint32): cint{.cdecl, 
-    importc: "filledPolygonColor", dynlib: gfxLibName.}
-proc filledPolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, 
-                        r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "filledPolygonRGBA", dynlib: gfxLibName.}
-  # Bezier
-  # s = number of steps
-proc bezierColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint, 
-                  color: uint32): cint{.cdecl, importc: "bezierColor", 
-                                       dynlib: gfxLibName.}
-proc bezierRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint, 
-                 r: byte, g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "bezierRGBA", dynlib: gfxLibName.}
-  # Characters/Strings
-proc characterColor*(dst: PSurface, x: int16, y: int16, c: char, color: uint32): cint{.
-    cdecl, importc: "characterColor", dynlib: gfxLibName.}
-proc characterRGBA*(dst: PSurface, x: int16, y: int16, c: char, r: byte, 
-                    g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "characterRGBA", dynlib: gfxLibName.}
-proc stringColor*(dst: PSurface, x: int16, y: int16, c: cstring, color: uint32): cint{.
-    cdecl, importc: "stringColor", dynlib: gfxLibName.}
-proc stringRGBA*(dst: PSurface, x: int16, y: int16, c: cstring, r: byte, 
-                 g: byte, b: byte, a: byte): cint{.cdecl, 
-    importc: "stringRGBA", dynlib: gfxLibName.}
-proc gfxPrimitivesSetFont*(fontdata: pointer, cw: cint, ch: cint){.cdecl, 
-    importc: "gfxPrimitivesSetFont", dynlib: gfxLibName.}
-  #
-  #
-  # SDL_imageFilter - bytes-image "filter" routines
-  # (uses inline x86 MMX optimizations if available)
-  #
-  # LGPL (c) A. Schiffler
-  #
-  #
-  # Comments:                                                                           
-  #  1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. 
-  #  2.) Data that is not within an 8 byte boundary is processed using the C routine.   
-  #  3.) Convolution routines do not have C routines at this time.                      
-  # Detect MMX capability in CPU
-proc imageFilterMMXdetect*(): cint{.cdecl, importc: "SDL_imageFilterMMXdetect", 
-                                   dynlib: gfxLibName.}
-  # Force use of MMX off (or turn possible use back on)
-proc imageFilterMMXoff*(){.cdecl, importc: "SDL_imageFilterMMXoff", 
-                           dynlib: gfxLibName.}
-proc imageFilterMMXon*(){.cdecl, importc: "SDL_imageFilterMMXon", 
-                          dynlib: gfxLibName.}
-  #
-  # All routines return:
-  #   0   OK
-  #  -1   Error (internal error, parameter error)
-  #
-  #  SDL_imageFilterAdd: D = saturation255(S1 + S2)
-proc imageFilterAdd*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterAdd", dynlib: gfxLibName.}
-  #  SDL_imageFilterMean: D = S1/2 + S2/2
-proc imageFilterMean*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterMean", dynlib: gfxLibName.}
-  #  SDL_imageFilterSub: D = saturation0(S1 - S2)
-proc imageFilterSub*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterSub", dynlib: gfxLibName.}
-  #  SDL_imageFilterAbsDiff: D = | S1 - S2 |
-proc imageFilterAbsDiff*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterAbsDiff", dynlib: gfxLibName.}
-  #  SDL_imageFilterMult: D = saturation(S1 * S2)
-proc imageFilterMult*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterMult", dynlib: gfxLibName.}
-  #  SDL_imageFilterMultNor: D = S1 * S2   (non-MMX)
-proc imageFilterMultNor*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterMultNor", dynlib: gfxLibName.}
-  #  SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
-proc imageFilterMultDivby2*(src1: cstring, src2: cstring, dest: cstring, 
-                            len: cint): cint{.cdecl, 
-    importc: "SDL_imageFilterMultDivby2", dynlib: gfxLibName.}
-  #  SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
-proc imageFilterMultDivby4*(src1: cstring, src2: cstring, dest: cstring, 
-                            len: cint): cint{.cdecl, 
-    importc: "SDL_imageFilterMultDivby4", dynlib: gfxLibName.}
-  #  SDL_imageFilterBitAnd: D = S1 & S2
-proc imageFilterBitAnd*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterBitAnd", dynlib: gfxLibName.}
-  #  SDL_imageFilterBitOr: D = S1 | S2
-proc imageFilterBitOr*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterBitOr", dynlib: gfxLibName.}
-  #  SDL_imageFilterDiv: D = S1 / S2   (non-MMX)
-proc imageFilterDiv*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterDiv", dynlib: gfxLibName.}
-  #  SDL_imageFilterBitNegation: D = !S
-proc imageFilterBitNegation*(src1: cstring, dest: cstring, len: cint): cint{.
-    cdecl, importc: "SDL_imageFilterBitNegation", dynlib: gfxLibName.}
-  #  SDL_imageFilterAddByte: D = saturation255(S + C)
-proc imageFilterAddByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
-    cdecl, importc: "SDL_imageFilterAddByte", dynlib: gfxLibName.}
-  #  SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
-proc imageFilterAddUint*(src1: cstring, dest: cstring, len: cint, c: cint): cint{.
-    cdecl, importc: "SDL_imageFilterAddUint", dynlib: gfxLibName.}
-  #  SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
-proc imageFilterAddByteToHalf*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
-    cdecl, importc: "SDL_imageFilterAddByteToHalf", dynlib: gfxLibName.}
-  #  SDL_imageFilterSubByte: D = saturation0(S - C)
-proc imageFilterSubByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
-    cdecl, importc: "SDL_imageFilterSubByte", dynlib: gfxLibName.}
-  #  SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
-proc imageFilterSubUint*(src1: cstring, dest: cstring, len: cint, c: cint): cint{.
-    cdecl, importc: "SDL_imageFilterSubUint", dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftRight: D = saturation0(S >> N)
-proc imageFilterShiftRight*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
-    cdecl, importc: "SDL_imageFilterShiftRight", dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
-proc imageFilterShiftRightUint*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
-    cdecl, importc: "SDL_imageFilterShiftRightUint", dynlib: gfxLibName.}
-  #  SDL_imageFilterMultByByte: D = saturation255(S * C)
-proc imageFilterMultByByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
-    cdecl, importc: "SDL_imageFilterMultByByte", dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
-proc imageFilterShiftRightAndMultByByte*(src1: cstring, dest: cstring, len: cint, 
-    n: char, c: char): cint{.cdecl, 
-                            importc: "SDL_imageFilterShiftRightAndMultByByte", 
-                            dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftLeftByte: D = (S << N)
-proc imageFilterShiftLeftByte*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
-    cdecl, importc: "SDL_imageFilterShiftLeftByte", dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
-proc imageFilterShiftLeftUint*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
-    cdecl, importc: "SDL_imageFilterShiftLeftUint", dynlib: gfxLibName.}
-  #  SDL_imageFilterShiftLeft: D = saturation255(S << N)
-proc imageFilterShiftLeft*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
-    cdecl, importc: "SDL_imageFilterShiftLeft", dynlib: gfxLibName.}
-  #  SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
-proc imageFilterBinarizeUsingThreshold*(src1: cstring, dest: cstring, len: cint, 
-                                        t: char): cint{.cdecl, 
-    importc: "SDL_imageFilterBinarizeUsingThreshold", dynlib: gfxLibName.}
-  #  SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
-proc imageFilterClipToRange*(src1: cstring, dest: cstring, len: cint, tmin: int8, 
-                             tmax: int8): cint{.cdecl, 
-    importc: "SDL_imageFilterClipToRange", dynlib: gfxLibName.}
-  #  SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
-proc imageFilterNormalizeLinear*(src1: cstring, dest: cstring, len: cint, 
-                                 cmin: cint, cmax: cint, nmin: cint, nmax: cint): cint{.
-    cdecl, importc: "SDL_imageFilterNormalizeLinear", dynlib: gfxLibName.}
-  # !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! 
-  #  SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel3x3Divide*(src: cstring, dest: cstring, rows: cint, 
-    columns: cint, kernel: pointer, divisor: int8): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel3x3Divide", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel5x5Divide*(src: cstring, dest: cstring, rows: cint, 
-    columns: cint, kernel: pointer, divisor: int8): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel5x5Divide", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel7x7Divide*(src: cstring, dest: cstring, rows: cint, 
-    columns: cint, kernel: pointer, divisor: int8): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel7x7Divide", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel9x9Divide*(src: cstring, dest: cstring, rows: cint, 
-    columns: cint, kernel: pointer, divisor: int8): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel9x9Divide", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel3x3ShiftRight*(src: cstring, dest: cstring, 
-    rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel3x3ShiftRight", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel5x5ShiftRight*(src: cstring, dest: cstring, 
-    rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel5x5ShiftRight", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel7x7ShiftRight*(src: cstring, dest: cstring, 
-    rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel7x7ShiftRight", dynlib: gfxLibName.}
-  #  SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
-proc imageFilterConvolveKernel9x9ShiftRight*(src: cstring, dest: cstring, 
-    rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl, 
-    importc: "SDL_imageFilterConvolveKernel9x9ShiftRight", dynlib: gfxLibName.}
-  #  SDL_imageFilterSobelX: Dij = saturation255( ... )
-proc imageFilterSobelX*(src: cstring, dest: cstring, rows: cint, columns: cint): cint{.
-    cdecl, importc: "SDL_imageFilterSobelX", dynlib: gfxLibName.}
-  #  SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
-proc imageFilterSobelXShiftRight*(src: cstring, dest: cstring, rows: cint, 
-                                  columns: cint, nRightShift: char): cint{.cdecl, 
-    importc: "SDL_imageFilterSobelXShiftRight", dynlib: gfxLibName.}
-  # Align/restore stack to 32 byte boundary -- Functionality untested! --
-proc imageFilterAlignStack*(){.cdecl, importc: "SDL_imageFilterAlignStack", 
-                               dynlib: gfxLibName.}
-proc imageFilterRestoreStack*(){.cdecl, importc: "SDL_imageFilterRestoreStack", 
-                                 dynlib: gfxLibName.}
-  #
-  #
-  # SDL_rotozoom - rotozoomer
-  #
-  # LGPL (c) A. Schiffler
-  #
-  #
-  # 
-  # 
-  # rotozoomSurface()
-  #
-  # Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
-  # 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
-  # then the destination 32bit surface is anti-aliased. If the surface is not 8bit
-  # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
-  #
-  #
-proc rotozoomSurface*(src: PSurface, angle: float64, zoom: float64, smooth: cint): PSurface{.
-    cdecl, importc: "rotozoomSurface", dynlib: gfxLibName.}
-proc rotozoomSurfaceXY*(src: PSurface, angle: float64, zoomx: float64, 
-                        zoomy: float64, smooth: cint): PSurface{.cdecl, 
-    importc: "rotozoomSurfaceXY", dynlib: gfxLibName.}
-  # Returns the size of the target surface for a rotozoomSurface() call 
-proc rotozoomSurfaceSize*(width: cint, height: cint, angle: float64, 
-                          zoom: float64, dstwidth: var cint, dstheight: var cint){.
-    cdecl, importc: "rotozoomSurfaceSize", dynlib: gfxLibName.}
-proc rotozoomSurfaceSizeXY*(width: cint, height: cint, angle: float64, 
-                            zoomx: float64, zoomy: float64, dstwidth: var cint, 
-                            dstheight: var cint){.cdecl, 
-    importc: "rotozoomSurfaceSizeXY", dynlib: gfxLibName.}
-  #
-  #
-  # zoomSurface()
-  #
-  # Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
-  # 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
-  # then the destination 32bit surface is anti-aliased. If the surface is not 8bit
-  # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
-  #
-  #
-proc zoomSurface*(src: PSurface, zoomx: float64, zoomy: float64, smooth: cint): PSurface{.
-    cdecl, importc: "zoomSurface", dynlib: gfxLibName.}
-  # Returns the size of the target surface for a zoomSurface() call 
-proc zoomSurfaceSize*(width: cint, height: cint, zoomx: float64, zoomy: float64, 
-                      dstwidth: var cint, dstheight: var cint){.cdecl, 
-    importc: "zoomSurfaceSize", dynlib: gfxLibName.}
-# implementation
diff --git a/lib/wrappers/sdl/sdl_image.nim b/lib/wrappers/sdl/sdl_image.nim
deleted file mode 100644
index 7f99c8069..000000000
--- a/lib/wrappers/sdl/sdl_image.nim
+++ /dev/null
@@ -1,243 +0,0 @@
-#
-#  $Id: sdl_image.pas,v 1.14 2007/05/29 21:31:13 savage Exp $
-#  
-#
-#******************************************************************************
-#                                                                              
-#       Borland Delphi SDL_Image - An example image loading library for use    
-#                                  with SDL                                    
-#       Conversion of the Simple DirectMedia Layer Image Headers               
-#                                                                              
-# Portions created by Sam Lantinga <slouken@devolution.com> are                
-# Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga                     
-# 5635-34 Springhouse Dr.                                                      
-# Pleasanton, CA 94588 (USA)                                                   
-#                                                                              
-# All Rights Reserved.                                                         
-#                                                                              
-# The original files are : SDL_image.h                                         
-#                                                                              
-# The initial developer of this Pascal code was :                              
-# Matthias Thoma <ma.thoma@gmx.de>                                             
-#                                                                              
-# Portions created by Matthias Thoma are                                       
-# Copyright (C) 2000 - 2001 Matthias Thoma.                                    
-#                                                                              
-#                                                                              
-# Contributor(s)                                                               
-# --------------                                                               
-# Dominique Louis <Dominique@SavageSoftware.com.au>                            
-#                                                                              
-# Obtained through:                                                            
-# Joint Endeavour of Delphi Innovators ( Project JEDI )                        
-#                                                                              
-# You may retrieve the latest version of this file at the Project              
-# JEDI home page, located at http://delphi-jedi.org                            
-#                                                                              
-# The contents of this file are used with permission, subject to               
-# the Mozilla Public License Version 1.1 (the "License"); you may              
-# not use this file except in compliance with the License. You may             
-# obtain a copy of the License at                                              
-# http://www.mozilla.org/MPL/MPL-1.1.html                                      
-#                                                                              
-# Software distributed under the License is distributed on an                  
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or               
-# implied. See the License for the specific language governing                 
-# rights and limitations under the License.                                    
-#                                                                              
-# Description                                                                  
-# -----------                                                                  
-#   A simple library to load images of various formats as SDL surfaces         
-#                                                                              
-# Requires                                                                     
-# --------                                                                     
-#   SDL.pas in your search path.                                               
-#                                                                              
-# Programming Notes                                                            
-# -----------------                                                            
-#   See the Aliens Demo on how to make use of this libaray                     
-#                                                                              
-# Revision History                                                             
-# ----------------                                                             
-#   April    02 2001 - MT : Initial Translation                                
-#                                                                              
-#   May      08 2001 - DL : Added ExternalSym derectives and copyright header  
-#                                                                              
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more     
-#                          Pascal compilers. Initial support is now included   
-#                          for GnuPascal, VirtualPascal, TMT and obviously     
-#                          continue support for Delphi Kylix and FreePascal.   
-#                                                                              
-#   April   08 2003 - MK : Aka Mr Kroket - Added Better FPC support            
-#                                                                              
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction     
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support              
-#                                                                              
-#   April   30 2003 - DL : under instruction from David Mears AKA              
-#                          Jason Siletto, I have added FPC Linux support.      
-#                          This was compiled with fpc 1.1, so remember to set  
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*   
-#                                                                              
-#
-#  $Log: sdl_image.pas,v $
-#  Revision 1.14  2007/05/29 21:31:13  savage
-#  Changes as suggested by Almindor for 64bit compatibility.
-#
-#  Revision 1.13  2007/05/20 20:30:54  savage
-#  Initial Changes to Handle 64 Bits
-#
-#  Revision 1.12  2006/12/02 00:14:40  savage
-#  Updated to latest version
-#
-#  Revision 1.11  2005/04/10 18:22:59  savage
-#  Changes as suggested by Michalis, thanks.
-#
-#  Revision 1.10  2005/04/10 11:48:33  savage
-#  Changes as suggested by Michalis, thanks.
-#
-#  Revision 1.9  2005/01/05 01:47:07  savage
-#  Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively.
-#
-#  Revision 1.8  2005/01/04 23:14:44  savage
-#  Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively.
-#
-#  Revision 1.7  2005/01/01 02:03:12  savage
-#  Updated to v1.2.4
-#
-#  Revision 1.6  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.5  2004/05/10 14:10:04  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.4  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.3  2004/04/01 20:53:23  savage
-#  Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.2  2004/03/30 20:23:28  savage
-#  Tidied up use of UNIX compiler directive.
-#
-#  Revision 1.1  2004/02/14 23:35:42  savage
-#  version 1 of sdl_image, sdl_mixer and smpeg.
-#
-#
-#
-#******************************************************************************
-
-import
-  sdl
-
-when defined(windows):
-  const
-    ImageLibName = "SDL_Image.dll"
-elif defined(macosx):
-  const
-    ImageLibName = "libSDL_image-1.2.0.dylib"
-else:
-  const
-    ImageLibName = "libSDL_image(.so|-1.2.so.0)"
-const
-  IMAGE_MAJOR_VERSION* = 1
-  IMAGE_MINOR_VERSION* = 2
-  IMAGE_PATCHLEVEL* = 5
-
-# This macro can be used to fill a version structure with the compile-time
-#  version of the SDL_image library. 
-
-proc imageVersion*(x: var Version)
-  # This function gets the version of the dynamically linked SDL_image library.
-  #   it should NOT be used to fill a version structure, instead you should
-  #   use the SDL_IMAGE_VERSION() macro.
-  # 
-proc imgLinkedVersion*(): Pversion{.importc: "IMG_Linked_Version", 
-                                    dynlib: ImageLibName.}
-  # Load an image from an SDL data source.
-  #   The 'type' may be one of: "BMP", "GIF", "PNG", etc.
-  #
-  #   If the image format supports a transparent pixel, SDL will set the
-  #   colorkey for the surface.  You can enable RLE acceleration on the
-  #   surface afterwards by calling:
-  #        SDL_SetColorKey(image, SDL_RLEACCEL, image.format.colorkey);
-  #
-
-const
-  IMG_INIT_JPG* = 0x00000001
-  IMG_INIT_PNG* = 0x00000002
-  IMG_INIT_TIF* = 0x00000004
-  IMG_INIT_WEBP* = 0x00000008
-
-proc imgInit*(flags: cint): int {.cdecl, importc: "IMG_Init",
-                                  dynlib: ImageLibName.}
-proc imgQuit*() {.cdecl, importc: "IMG_Quit",
-                                  dynlib: ImageLibName.}
-proc imgLoadTypedRW*(src: PRWops, freesrc: cint, theType: cstring): PSurface{.
-    cdecl, importc: "IMG_LoadTyped_RW", dynlib: ImageLibName.}
-  # Convenience functions 
-proc imgLoad*(theFile: cstring): PSurface{.cdecl, importc: "IMG_Load", 
-    dynlib: ImageLibName.}
-proc imgLoadRW*(src: PRWops, freesrc: cint): PSurface{.cdecl, 
-    importc: "IMG_Load_RW", dynlib: ImageLibName.}
-  # Invert the alpha of a surface for use with OpenGL
-  #  This function is now a no-op, and only provided for backwards compatibility. 
-proc imgInvertAlpha*(theOn: cint): cint{.cdecl, importc: "IMG_InvertAlpha", 
-                                        dynlib: ImageLibName.}
-  # Functions to detect a file type, given a seekable source 
-proc imgIsBMP*(src: PRWops): cint{.cdecl, importc: "IMG_isBMP", 
-                                   dynlib: ImageLibName.}
-proc imgIsGIF*(src: PRWops): cint{.cdecl, importc: "IMG_isGIF", 
-                                   dynlib: ImageLibName.}
-proc imgIsJPG*(src: PRWops): cint{.cdecl, importc: "IMG_isJPG", 
-                                   dynlib: ImageLibName.}
-proc imgIsLBM*(src: PRWops): cint{.cdecl, importc: "IMG_isLBM", 
-                                   dynlib: ImageLibName.}
-proc imgIsPCX*(src: PRWops): cint{.cdecl, importc: "IMG_isPCX", 
-                                   dynlib: ImageLibName.}
-proc imgIsPNG*(src: PRWops): cint{.cdecl, importc: "IMG_isPNG", 
-                                   dynlib: ImageLibName.}
-proc imgIsPNM*(src: PRWops): cint{.cdecl, importc: "IMG_isPNM", 
-                                   dynlib: ImageLibName.}
-proc imgIsTIF*(src: PRWops): cint{.cdecl, importc: "IMG_isTIF", 
-                                   dynlib: ImageLibName.}
-proc imgIsXCF*(src: PRWops): cint{.cdecl, importc: "IMG_isXCF", 
-                                   dynlib: ImageLibName.}
-proc imgIsXPM*(src: PRWops): cint{.cdecl, importc: "IMG_isXPM", 
-                                   dynlib: ImageLibName.}
-proc imgIsXV*(src: PRWops): cint{.cdecl, importc: "IMG_isXV", 
-                                  dynlib: ImageLibName.}
-  # Individual loading functions 
-proc imgLoadBMP_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadBMP_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadGIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadGIF_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadJPG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadJPG_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadLBM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadLBM_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadPCX_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPCX_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadPNM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNM_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadPNG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNG_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadTGA_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTGA_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadTIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTIF_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadXCF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXCF_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadXPM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXPM_RW", 
-    dynlib: ImageLibName.}
-proc imgLoadXV_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXV_RW", 
-    dynlib: ImageLibName.}
-proc imgReadXPMFromArray*(xpm: cstringArray): PSurface{.cdecl, 
-    importc: "IMG_ReadXPMFromArray", dynlib: ImageLibName.}
-
-proc imageVersion(x: var Version) = 
-  x.major = IMAGE_MAJOR_VERSION
-  x.minor = IMAGE_MINOR_VERSION
-  x.patch = IMAGE_PATCHLEVEL
-
diff --git a/lib/wrappers/sdl/sdl_mixer.nim b/lib/wrappers/sdl/sdl_mixer.nim
deleted file mode 100644
index b8f013a4a..000000000
--- a/lib/wrappers/sdl/sdl_mixer.nim
+++ /dev/null
@@ -1,489 +0,0 @@
-#******************************************************************************
-#
-#  $Id: sdl_mixer.pas,v 1.18 2007/05/29 21:31:44 savage Exp $
-#
-#
-#
-#       Borland Delphi SDL_Mixer - Simple DirectMedia Layer Mixer Library
-#       Conversion of the Simple DirectMedia Layer Headers
-#
-# Portions created by Sam Lantinga <slouken@devolution.com> are
-# Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
-# 5635-34 Springhouse Dr.
-# Pleasanton, CA 94588 (USA)
-#
-# All Rights Reserved.
-#
-# The original files are : SDL_mixer.h
-#                          music_cmd.h
-#                          wavestream.h
-#                          timidity.h
-#                          playmidi.h
-#                          music_ogg.h
-#                          mikmod.h
-#
-# The initial developer of this Pascal code was :
-# Dominqiue Louis <Dominique@SavageSoftware.com.au>
-#
-# Portions created by Dominqiue Louis are
-# Copyright (C) 2000 - 2001 Dominqiue Louis.
-#
-#
-# Contributor(s)
-# --------------
-# Matthias Thoma <ma.thoma@gmx.de>
-#
-# Obtained through:
-# Joint Endeavour of Delphi Innovators ( Project JEDI )
-#
-# You may retrieve the latest version of this file at the Project
-# JEDI home page, located at http://delphi-jedi.org
-#
-# The contents of this file are used with permission, subject to
-# the Mozilla Public License Version 1.1 (the "License"); you may
-# not use this file except in compliance with the License. You may
-# obtain a copy of the License at
-# http://www.mozilla.org/MPL/MPL-1.1.html
-#
-# Software distributed under the License is distributed on an
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# Description
-# -----------
-#
-#
-#
-#
-#
-#
-#
-# Requires
-# --------
-#   SDL.pas & SMPEG.pas somewhere within your search path.
-#
-# Programming Notes
-# -----------------
-#   See the Aliens Demo to see how this library is used
-#
-# Revision History
-# ----------------
-#   April    02 2001 - DL : Initial Translation
-#
-#  February  02 2002 - DL : Update to version 1.2.1
-#
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more
-#                          Pascal compilers. Initial support is now included
-#                          for GnuPascal, VirtualPascal, TMT and obviously
-#                          continue support for Delphi Kylix and FreePascal.
-#
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support
-#
-#   April   30 2003 - DL : under instruction from David Mears AKA
-#                          Jason Siletto, I have added FPC Linux support.
-#                          This was compiled with fpc 1.1, so remember to set
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*
-#
-#
-#  $Log: sdl_mixer.pas,v $
-#  Revision 1.18  2007/05/29 21:31:44  savage
-#  Changes as suggested by Almindor for 64bit compatibility.
-#
-#  Revision 1.17  2007/05/20 20:31:17  savage
-#  Initial Changes to Handle 64 Bits
-#
-#  Revision 1.16  2006/12/02 00:16:17  savage
-#  Updated to latest version
-#
-#  Revision 1.15  2005/04/10 11:48:33  savage
-#  Changes as suggested by Michalis, thanks.
-#
-#  Revision 1.14  2005/02/24 20:20:07  savage
-#  Changed definition of MusicType and added GetMusicType function
-#
-#  Revision 1.13  2005/01/05 01:47:09  savage
-#  Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively.
-#
-#  Revision 1.12  2005/01/04 23:14:56  savage
-#  Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively.
-#
-#  Revision 1.11  2005/01/01 02:05:19  savage
-#  Updated to v1.2.6
-#
-#  Revision 1.10  2004/09/12 21:45:17  savage
-#  Robert Reed spotted that Mix_SetMusicPosition was missing from the conversion, so this has now been added.
-#
-#  Revision 1.9  2004/08/27 21:48:24  savage
-#  IFDEFed out Smpeg support on MacOS X
-#
-#  Revision 1.8  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.7  2004/05/10 14:10:04  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.6  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.5  2004/04/01 20:53:23  savage
-#  Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.4  2004/03/31 22:20:02  savage
-#  Windows unit not used in this file, so it was removed to keep the code tidy.
-#
-#  Revision 1.3  2004/03/31 10:05:08  savage
-#  Better defines for Endianness under FreePascal and Borland compilers.
-#
-#  Revision 1.2  2004/03/30 20:23:28  savage
-#  Tidied up use of UNIX compiler directive.
-#
-#  Revision 1.1  2004/02/14 23:35:42  savage
-#  version 1 of sdl_image, sdl_mixer and smpeg.
-#
-#
-#
-#******************************************************************************
-
-import 
-  sdl, smpeg
-
-when defined(windows): 
-  const 
-    MixerLibName = "SDL_mixer.dll"
-elif defined(macosx): 
-  const 
-    MixerLibName = "libSDL_mixer-1.2.0.dylib"
-else: 
-  const 
-    MixerLibName = "libSDL_mixer.so"
-const 
-  MAJOR_VERSION* = 1
-  MINOR_VERSION* = 2
-  PATCHLEVEL* = 7    # Backwards compatibility
-  
-  CHANNELS* = 8           # Good default values for a PC soundcard
-  DEFAULT_FREQUENCY* = 22050
-
-when defined(IA32): 
-  const 
-    DEFAULT_FORMAT* = AUDIO_S16LSB
-else: 
-  const 
-    DEFAULT_FORMAT* = AUDIO_S16MSB
-const 
-  DEFAULT_CHANNELS* = 2
-  MAX_VOLUME* = 128       # Volume of a chunk
-  PATH_MAX* = 255             # mikmod.h constants
-                              #*
-                              #  * Library version
-                              #  *
-  LIBMIKMOD_VERSION_MAJOR* = 3
-  LIBMIKMOD_VERSION_MINOR* = 1
-  LIBMIKMOD_REVISION* = 8
-  LIBMIKMOD_VERSION* = ((LIBMIKMOD_VERSION_MAJOR shl 16) or
-      (LIBMIKMOD_VERSION_MINOR shl 8) or (LIBMIKMOD_REVISION))
-
-type                          #music_cmd.h types
-  PMusicCMD* = ptr MusicCMD
-  MusicCMD*{.final.} = object  #wavestream.h types
-    filename*: array[0..PATH_MAX - 1, char]
-    cmd*: array[0..PATH_MAX - 1, char]
-    pid*: TSYS_ThreadHandle
-
-  PWAVStream* = ptr WAVStream
-  WAVStream*{.final.} = object  #playmidi.h types
-    wavefp*: pointer
-    start*: int32
-    stop*: int32
-    cvt*: TAudioCVT
-
-  PMidiEvent* = ptr MidiEvent
-  MidiEvent*{.final.} = object 
-    time*: int32
-    channel*: byte
-    typ*: byte
-    a*: byte
-    b*: byte
-
-  PMidiSong* = ptr MidiSong
-  MidiSong*{.final.} = object  #music_ogg.h types
-    samples*: int32
-    events*: PMidiEvent
-
-  POGG_Music* = ptr OGG_Music
-  OGG_Music*{.final.} = object  # mikmod.h types
-                                 #*
-                                 #  * Error codes
-                                 #  *
-    playing*: int32
-    volume*: int32              #vf: OggVorbis_File;
-    section*: int32
-    cvt*: TAudioCVT
-    lenAvailable*: int32
-    sndAvailable*: pointer
-
-  ErrorEnum* = enum 
-    MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING, 
-    MMERR_SAMPLE_TOO_BIG, MMERR_OUT_OF_HANDLES, MMERR_UNKNOWN_WAVE_TYPE, 
-    MMERR_LOADING_PATTERN, MMERR_LOADING_TRACK, MMERR_LOADING_HEADER, 
-    MMERR_LOADING_SAMPLEINFO, MMERR_NOT_A_MODULE, MMERR_NOT_A_STREAM, 
-    MMERR_MED_SYNTHSAMPLES, MMERR_ITPACK_INVALID_DATA, MMERR_DETECTING_DEVICE, 
-    MMERR_INVALID_DEVICE, MMERR_INITIALIZING_MIXER, MMERR_OPENING_AUDIO, 
-    MMERR_8BIT_ONLY, MMERR_16BIT_ONLY, MMERR_STEREO_ONLY, MMERR_ULAW, 
-    MMERR_NON_BLOCK, MMERR_AF_AUDIO_PORT, MMERR_AIX_CONFIG_INIT, 
-    MMERR_AIX_CONFIG_CONTROL, MMERR_AIX_CONFIG_START, MMERR_GUS_SETTINGS, 
-    MMERR_GUS_RESET, MMERR_GUS_TIMER, MMERR_HP_SETSAMPLESIZE, MMERR_HP_SETSPEED, 
-    MMERR_HP_CHANNELS, MMERR_HP_AUDIO_OUTPUT, MMERR_HP_AUDIO_DESC, 
-    MMERR_HP_BUFFERSIZE, MMERR_OSS_SETFRAGMENT, MMERR_OSS_SETSAMPLESIZE, 
-    MMERR_OSS_SETSTEREO, MMERR_OSS_SETSPEED, MMERR_SGI_SPEED, MMERR_SGI_16BIT, 
-    MMERR_SGI_8BIT, MMERR_SGI_STEREO, MMERR_SGI_MONO, MMERR_SUN_INIT, 
-    MMERR_OS2_MIXSETUP, MMERR_OS2_SEMAPHORE, MMERR_OS2_TIMER, MMERR_OS2_THREAD, 
-    MMERR_DS_PRIORITY, MMERR_DS_BUFFER, MMERR_DS_FORMAT, MMERR_DS_NOTIFY, 
-    MMERR_DS_EVENT, MMERR_DS_THREAD, MMERR_DS_UPDATE, MMERR_WINMM_HANDLE, 
-    MMERR_WINMM_ALLOCATED, MMERR_WINMM_DEVICEID, MMERR_WINMM_FORMAT, 
-    MMERR_WINMM_UNKNOWN, MMERR_MAC_SPEED, MMERR_MAC_START, MMERR_MAX
-  PMODULE* = ptr MODULE
-  MODULE*{.final.} = object 
-  PUNIMOD* = ptr UNIMOD
-  UNIMOD* = MODULE          #SDL_mixer.h types
-                              # The internal format for an audio chunk
-  PChunk* = ptr Chunk
-  Chunk*{.final.} = object 
-    allocated*: cint
-    abuf*: pointer
-    alen*: uint32
-    volume*: byte            # Per-sample volume, 0-128
-  
-  Fading* = enum 
-    MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN
-  MusicType* = enum 
-    MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3
-  PMusic* = ptr Music
-  Music*{.final.} = object  # The internal format for a music chunk interpreted via mikmod
-    mixtype*: MusicType      # other fields are not aviable
-                              #    data : MusicUnion;
-                              #    fading : TMix_Fading;
-                              #    fade_volume : integer;
-                              #    fade_step : integer;
-                              #    fade_steps : integer;
-                              #    error : integer;
-  
-  MixFunction* = proc (udata, stream: pointer, length: cint): pointer{.
-      cdecl.} # This macro can be used to fill a version structure with the compile-time
-              #  version of the SDL_mixer library.
-{.deprecated: [TMusicCMD: MusicCMD, TWAVStream: WAVStream, TMidiEvent: MidiEvent,
-              TMidiSong: MidiSong, TOGG_Music: OGG_Music, TErrorEnum: ErrorEnum,
-              TMODULE: MODULE, TUNIMOD: UNIMOD, TChunk: Chunk, TFading: Fading,
-              TMusicType: MusicType, TMusic: Music, TMixFunction: MixFunction].}
-
-proc version*(x: var sdl.Version)
-  # This function gets the version of the dynamically linked SDL_mixer library.
-  #     It should NOT be used to fill a version structure, instead you should use the
-  #     SDL_MIXER_VERSION() macro.
-proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version", 
-                                      dynlib: MixerLibName.}
-  # Open the mixer with a certain audio format
-proc openAudio*(frequency: cint, format: uint16, channels: cint, 
-                    chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio", 
-    dynlib: MixerLibName.}
-  # Dynamically change the number of channels managed by the mixer.
-  #   If decreasing the number of channels, the upper channels are
-  #   stopped.
-  #   This function returns the new number of allocated channels.
-  #
-proc allocateChannels*(numchannels: cint): cint{.cdecl, 
-    importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
-  # Find out what the actual audio device parameters are.
-  #   This function returns 1 if the audio has been opened, 0 otherwise.
-  #
-proc querySpec*(frequency: var cint, format: var uint16, channels: var cint): cint{.
-    cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
-  # Load a wave file or a music (.mod .s3m .it .xm) file
-proc loadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl, 
-    importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
-proc loadWAV*(filename: cstring): PChunk
-proc loadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS", 
-    dynlib: MixerLibName.}
-  # Load a wave file of the mixer format from a memory buffer
-proc quickLoadWAV*(mem: pointer): PChunk{.cdecl, 
-    importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
-  # Free an audio chunk previously loaded
-proc freeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk", 
-                                        dynlib: MixerLibName.}
-proc freeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic", 
-                                        dynlib: MixerLibName.}
-  # Find out the music format of a mixer music, or the currently playing
-  #   music, if 'music' is NULL.
-proc getMusicType*(music: PMusic): MusicType{.cdecl, 
-    importc: "Mix_GetMusicType", dynlib: MixerLibName.}
-  # Set a function that is called after all mixing is performed.
-  #   This can be used to provide real-time visual display of the audio stream
-  #   or add a custom mixer filter for the stream data.
-  #
-proc setPostMix*(mixFunc: MixFunction, arg: pointer){.cdecl, 
-    importc: "Mix_SetPostMix", dynlib: MixerLibName.}
-  # Add your own music player or additional mixer function.
-  #   If 'mix_func' is NULL, the default music player is re-enabled.
-  #
-proc hookMusic*(mixFunc: MixFunction, arg: pointer){.cdecl, 
-    importc: "Mix_HookMusic", dynlib: MixerLibName.}
-  # Add your own callback when the music has finished playing.
-  #
-proc hookMusicFinished*(musicFinished: pointer){.cdecl, 
-    importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
-  # Get a pointer to the user data for the current music hook
-proc getMusicHookData*(): pointer{.cdecl, importc: "Mix_GetMusicHookData", 
-                                       dynlib: MixerLibName.}
-  #* Add your own callback when a channel has finished playing. NULL
-  # * to disable callback.*
-type 
-  ChannelFinished* = proc (channel: cint){.cdecl.}
-{.deprecated: [TChannelFinished: ChannelFinished].}
-
-proc channelFinished*(channelFinished: ChannelFinished){.cdecl, 
-    importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
-const 
-  CHANNEL_POST* = - 2     
-
-type 
-  TEffectFunc* = proc (chan: cint, stream: pointer, length: cint, 
-                       udata: pointer): pointer{.cdecl.}     
-  TEffectDone* = proc (chan: cint, udata: pointer): pointer{.cdecl.} 
-proc registerEffect*(chan: cint, f: TEffectFunc, d: TEffectDone, 
-                         arg: pointer): cint{.cdecl, 
-    importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
-
-proc unregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl, 
-    importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
-
-proc unregisterAllEffects*(channel: cint): cint{.cdecl, 
-    importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
-const 
-  EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"
-  
-proc setPanning*(channel: cint, left: byte, right: byte): cint{.cdecl, 
-    importc: "Mix_SetPanning", dynlib: MixerLibName.}
-
-proc setPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl, 
-    importc: "Mix_SetPosition", dynlib: MixerLibName.}
-
-proc setDistance*(channel: cint, distance: byte): cint{.cdecl, 
-    importc: "Mix_SetDistance", dynlib: MixerLibName.}
-
-proc setReverseStereo*(channel: cint, flip: cint): cint{.cdecl, 
-    importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
-
-proc reserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels", 
-    dynlib: MixerLibName.}
-
-proc groupChannel*(which: cint, tag: cint): cint{.cdecl, 
-    importc: "Mix_GroupChannel", dynlib: MixerLibName.}
-proc groupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl, 
-    importc: "Mix_GroupChannels", dynlib: MixerLibName.}
-proc groupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable", 
-    dynlib: MixerLibName.}
-proc groupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount", 
-                                     dynlib: MixerLibName.}
-proc groupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest", 
-                                      dynlib: MixerLibName.}
-proc groupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer", 
-                                     dynlib: MixerLibName.}
-proc playChannelTimed*(channel: cint, chunk: PChunk, loops: cint, 
-                           ticks: cint): cint{.cdecl, 
-    importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
-proc playChannel*(channel: cint, chunk: PChunk, loops: cint): cint
-proc playMusic*(music: PMusic, loops: cint): cint{.cdecl, 
-    importc: "Mix_PlayMusic", dynlib: MixerLibName.}
-proc fadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
-proc fadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint, 
-                             ms: cint, ticks: cint): cint{.cdecl, 
-    importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
-proc fadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
-
-proc volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume", 
-    dynlib: MixerLibName.}
-proc volumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl, 
-    importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
-proc volumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic", 
-    dynlib: MixerLibName.}
-
-proc haltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel", 
-    dynlib: MixerLibName.}
-proc haltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup", 
-                                    dynlib: MixerLibName.}
-proc haltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic", 
-                            dynlib: MixerLibName.}
-  # Change the expiration delay for a particular channel.
-  #   The sample will stop playing after the 'ticks' milliseconds have elapsed,
-  #   or remove the expiration if 'ticks' is -1
-  #
-proc expireChannel*(channel: cint, ticks: cint): cint{.cdecl, 
-    importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
-  # Halt a channel, fading it out progressively till it's silent
-  #   The ms parameter indicates the number of milliseconds the fading
-  #   will take.
-  #
-proc fadeOutChannel*(which: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
-proc fadeOutGroup*(tag: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
-proc fadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic", 
-                                      dynlib: MixerLibName.}
-  # Query the fading status of a channel
-proc fadingMusic*(): Fading{.cdecl, importc: "Mix_FadingMusic", 
-                                      dynlib: MixerLibName.}
-proc fadingChannel*(which: cint): Fading{.cdecl, 
-    importc: "Mix_FadingChannel", dynlib: MixerLibName.}
-
-proc pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
-proc resume*(channel: cint){.cdecl, importc: "Mix_Resume", 
-                                dynlib: MixerLibName.}
-proc paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused", 
-                                     dynlib: MixerLibName.}
-
-proc pauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
-proc resumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
-proc rewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
-proc pausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic", 
-                              dynlib: MixerLibName.}
-
-proc setMusicPosition*(position: float64): cint{.cdecl, 
-    importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
-
-proc playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing", 
-                                      dynlib: MixerLibName.}
-proc playingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic", 
-                               dynlib: MixerLibName.}
-
-proc setMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD", 
-    dynlib: MixerLibName.}
-
-proc setSynchroValue*(value: cint): cint{.cdecl, 
-    importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
-proc getSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue", 
-                                  dynlib: MixerLibName.}
-
-proc getChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk", 
-    dynlib: MixerLibName.}
-
-proc closeAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
-
-proc version(x: var sdl.Version) = 
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-proc loadWAV(filename: cstring): PChunk = 
-  result = loadWAV_RW(rWFromFile(filename, "rb"), 1)
-
-proc playChannel(channel: cint, chunk: PChunk, loops: cint): cint = 
-  result = playChannelTimed(channel, chunk, loops, - 1)
-
-proc fadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint = 
-  result = fadeInChannelTimed(channel, chunk, loops, ms, - 1)
-
diff --git a/lib/wrappers/sdl/sdl_mixer_nosmpeg.nim b/lib/wrappers/sdl/sdl_mixer_nosmpeg.nim
deleted file mode 100644
index 670cf1643..000000000
--- a/lib/wrappers/sdl/sdl_mixer_nosmpeg.nim
+++ /dev/null
@@ -1,357 +0,0 @@
-#******************************************************************************
-# Copy of SDL_Mixer without smpeg dependency and mp3 support                    
-#******************************************************************************
-
-import 
-  sdl
-
-when defined(windows): 
-  const 
-    MixerLibName = "SDL_mixer.dll"
-elif defined(macosx): 
-  const 
-    MixerLibName = "libSDL_mixer-1.2.0.dylib"
-else: 
-  const 
-    MixerLibName = "libSDL_mixer.so"
-const 
-  MAJOR_VERSION* = 1
-  MINOR_VERSION* = 2
-  PATCHLEVEL* = 7    # Backwards compatibility
-   
-  CHANNELS* = 8           # Good default values for a PC soundcard 
-  DEFAULT_FREQUENCY* = 22050
-
-when defined(IA32): 
-  const 
-    DEFAULT_FORMAT* = AUDIO_S16LSB
-else: 
-  const 
-    DEFAULT_FORMAT* = AUDIO_S16MSB
-const 
-  DEFAULT_CHANNELS* = 2
-  MAX_VOLUME* = 128       # Volume of a chunk 
-  PATH_MAX* = 255
-  
-  LIBMIKMOD_VERSION_MAJOR* = 3
-  LIBMIKMOD_VERSION_MINOR* = 1
-  LIBMIKMOD_REVISION* = 8
-  LIBMIKMOD_VERSION* = ((LIBMIKMOD_VERSION_MAJOR shl 16) or
-      (LIBMIKMOD_VERSION_MINOR shl 8) or (LIBMIKMOD_REVISION))
-
-type                          #music_cmd.h types
-  PMusicCMD* = ptr MusicCMD
-  MusicCMD*{.final.} = object  #wavestream.h types
-    filename*: array[0..PATH_MAX - 1, char]
-    cmd*: array[0..PATH_MAX - 1, char]
-    pid*: TSYS_ThreadHandle
-
-  PWAVStream* = ptr WAVStream
-  WAVStream*{.final.} = object  #playmidi.h types
-    wavefp*: pointer
-    start*: int32
-    stop*: int32
-    cvt*: TAudioCVT
-
-  PMidiEvent* = ptr MidiEvent
-  MidiEvent*{.final.} = object 
-    time*: int32
-    channel*: byte
-    typ*: byte
-    a*: byte
-    b*: byte
-
-  PMidiSong* = ptr MidiSong
-  MidiSong*{.final.} = object  #music_ogg.h types
-    samples*: int32
-    events*: PMidiEvent
-
-  POGG_Music* = ptr OGG_Music
-  OGG_Music*{.final.} = object  # mikmod.h types
-                                 #*
-                                 #  * Error codes
-                                 #  *
-    playing*: cint
-    volume*: cint              #vf: OggVorbis_File;
-    section*: cint
-    cvt*: TAudioCVT
-    lenAvailable*: cint
-    sndAvailable*: pointer
-
-  ErrorEnum* = enum 
-    MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING, 
-    MMERR_SAMPLE_TOO_BIG, MMERR_OUT_OF_HANDLES, MMERR_UNKNOWN_WAVE_TYPE, 
-    MMERR_LOADING_PATTERN, MMERR_LOADING_TRACK, MMERR_LOADING_HEADER, 
-    MMERR_LOADING_SAMPLEINFO, MMERR_NOT_A_MODULE, MMERR_NOT_A_STREAM, 
-    MMERR_MED_SYNTHSAMPLES, MMERR_ITPACK_INVALID_DATA, MMERR_DETECTING_DEVICE, 
-    MMERR_INVALID_DEVICE, MMERR_INITIALIZING_MIXER, MMERR_OPENING_AUDIO, 
-    MMERR_8BIT_ONLY, MMERR_16BIT_ONLY, MMERR_STEREO_ONLY, MMERR_ULAW, 
-    MMERR_NON_BLOCK, MMERR_AF_AUDIO_PORT, MMERR_AIX_CONFIG_INIT, 
-    MMERR_AIX_CONFIG_CONTROL, MMERR_AIX_CONFIG_START, MMERR_GUS_SETTINGS, 
-    MMERR_GUS_RESET, MMERR_GUS_TIMER, MMERR_HP_SETSAMPLESIZE, MMERR_HP_SETSPEED, 
-    MMERR_HP_CHANNELS, MMERR_HP_AUDIO_OUTPUT, MMERR_HP_AUDIO_DESC, 
-    MMERR_HP_BUFFERSIZE, MMERR_OSS_SETFRAGMENT, MMERR_OSS_SETSAMPLESIZE, 
-    MMERR_OSS_SETSTEREO, MMERR_OSS_SETSPEED, MMERR_SGI_SPEED, MMERR_SGI_16BIT, 
-    MMERR_SGI_8BIT, MMERR_SGI_STEREO, MMERR_SGI_MONO, MMERR_SUN_INIT, 
-    MMERR_OS2_MIXSETUP, MMERR_OS2_SEMAPHORE, MMERR_OS2_TIMER, MMERR_OS2_THREAD, 
-    MMERR_DS_PRIORITY, MMERR_DS_BUFFER, MMERR_DS_FORMAT, MMERR_DS_NOTIFY, 
-    MMERR_DS_EVENT, MMERR_DS_THREAD, MMERR_DS_UPDATE, MMERR_WINMM_HANDLE, 
-    MMERR_WINMM_ALLOCATED, MMERR_WINMM_DEVICEID, MMERR_WINMM_FORMAT, 
-    MMERR_WINMM_UNKNOWN, MMERR_MAC_SPEED, MMERR_MAC_START, MMERR_MAX
-  PMODULE* = ptr MODULE
-  MODULE*{.final.} = object 
-  PUNIMOD* = ptr UNIMOD
-  UNIMOD* = MODULE          #SDL_mixer.h types
-                              # The internal format for an audio chunk 
-  PChunk* = ptr Chunk
-  Chunk*{.final.} = object 
-    allocated*: cint
-    abuf*: pointer
-    alen*: uint32
-    volume*: byte            # Per-sample volume, 0-128 
-  
-  Fading* = enum 
-    MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN
-  MusicType* = enum 
-    MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG
-  PMusic* = ptr Music
-  Music*{.final.} = object 
-    typ*: MusicType
-
-  MixFunction* = proc (udata, stream: pointer, length: cint): pointer{.
-      cdecl.} # This macro can be used to fill a version structure with the compile-time
-              #  version of the SDL_mixer library. 
-{.deprecated: [TMusicCMD: MusicCMD, TWAVStream: WAVStream, TMidiEvent: MidiEvent,
-              TMidiSong: MidiSong, TOGG_Music: OGG_Music, TErrorEnum: ErrorEnum,
-              TMODULE: MODULE, TUNIMOD: UNIMOD, TChunk: Chunk, TFading: Fading, 
-              TMusicType: MusicType, TMusic: Music, TMixFunction: MixFunction].}
-
-
-proc version*(x: var sdl.Version)
-  # This function gets the version of the dynamically linked SDL_mixer library.
-  #     It should NOT be used to fill a version structure, instead you should use the
-  #     SDL_MIXER_VERSION() macro. 
-proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version", 
-                                      dynlib: MixerLibName.}
-  # Open the mixer with a certain audio format 
-proc openAudio*(frequency: cint, format: uint16, channels: cint, 
-                    chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio", 
-    dynlib: MixerLibName.}
-  # Dynamically change the number of channels managed by the mixer.
-  #   If decreasing the number of channels, the upper channels are
-  #   stopped.
-  #   This function returns the new number of allocated channels.
-  # 
-proc allocateChannels*(numchannels: cint): cint{.cdecl, 
-    importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
-  # Find out what the actual audio device parameters are.
-  #   This function returns 1 if the audio has been opened, 0 otherwise.
-  # 
-proc querySpec*(frequency: var cint, format: var uint16, channels: var cint): cint{.
-    cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
-  # Load a wave file or a music (.mod .s3m .it .xm) file 
-proc LoadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl, 
-    importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
-proc loadWAV*(filename: cstring): PChunk
-proc loadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS", 
-    dynlib: MixerLibName.}
-  # Load a wave file of the mixer format from a memory buffer 
-proc quickLoadWAV*(mem: pointer): PChunk{.cdecl, 
-    importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
-  # Free an audio chunk previously loaded 
-proc freeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk", 
-                                        dynlib: MixerLibName.}
-proc freeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic", 
-                                        dynlib: MixerLibName.}
-  # Find out the music format of a mixer music, or the currently playing
-  #   music, if 'music' is NULL.
-proc getMusicType*(music: PMusic): MusicType{.cdecl, 
-    importc: "Mix_GetMusicType", dynlib: MixerLibName.}
-  # Set a function that is called after all mixing is performed.
-  #   This can be used to provide real-time visual display of the audio stream
-  #   or add a custom mixer filter for the stream data.
-  #
-proc setPostMix*(mixfunc: MixFunction, arg: pointer){.cdecl, 
-    importc: "Mix_SetPostMix", dynlib: MixerLibName.}
-  # Add your own music player or additional mixer function.
-  #   If 'mix_func' is NULL, the default music player is re-enabled.
-  # 
-proc hookMusic*(mixFunc: MixFunction, arg: pointer){.cdecl, 
-    importc: "Mix_HookMusic", dynlib: MixerLibName.}
-  # Add your own callback when the music has finished playing.
-  # 
-proc hookMusicFinished*(musicFinished: pointer){.cdecl, 
-    importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
-  # Get a pointer to the user data for the current music hook 
-proc getMusicHookData*(): pointer{.cdecl, importc: "Mix_GetMusicHookData", 
-                                       dynlib: MixerLibName.}
-  #* Add your own callback when a channel has finished playing. NULL
-  # * to disable callback.*
-type 
-  ChannelFinished* = proc (channel: cint){.cdecl.}
-{.deprecated: [TChannelFinished: ChannelFinished].}
-
-proc channelFinished*(channelFinished: ChannelFinished){.cdecl, 
-    importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
-const 
-  CHANNEL_POST* = - 2 
-  
-type 
-  TEffectFunc* = proc (chan: cint, stream: pointer, length: cint, 
-                           udata: pointer): pointer{.cdecl.} 
-  TEffectDone* = proc (chan: cint, udata: pointer): pointer{.cdecl.} 
-
-proc registerEffect*(chan: cint, f: TEffectFunc, d: TEffectDone, 
-                         arg: pointer): cint{.cdecl, 
-    importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
-
-proc unregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl, 
-    importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
-
-proc unregisterAllEffects*(channel: cint): cint{.cdecl, 
-    importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
-
-const 
-  EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"  
-  
-proc setPanning*(channel: cint, left: byte, right: byte): cint{.cdecl, 
-    importc: "Mix_SetPanning", dynlib: MixerLibName.}
-   
-proc setPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl, 
-    importc: "Mix_SetPosition", dynlib: MixerLibName.}
-   
-proc setDistance*(channel: cint, distance: byte): cint{.cdecl, 
-    importc: "Mix_SetDistance", dynlib: MixerLibName.}
-
-proc setReverseStereo*(channel: cint, flip: cint): cint{.cdecl, 
-    importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
-
-proc reserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels", 
-    dynlib: MixerLibName.}
-
-proc groupChannel*(which: cint, tag: cint): cint{.cdecl, 
-    importc: "Mix_GroupChannel", dynlib: MixerLibName.}
-  # Assign several consecutive channels to a group 
-proc groupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl, 
-    importc: "Mix_GroupChannels", dynlib: MixerLibName.}
-  # Finds the first available channel in a group of channels 
-proc groupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable", 
-    dynlib: MixerLibName.}
-  # Returns the number of channels in a group. This is also a subtle
-  #   way to get the total number of channels when 'tag' is -1
-  # 
-proc groupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount", 
-                                     dynlib: MixerLibName.}
-  # Finds the "oldest" sample playing in a group of channels 
-proc groupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest", 
-                                      dynlib: MixerLibName.}
-  # Finds the "most recent" (i.e. last) sample playing in a group of channels 
-proc groupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer", 
-                                     dynlib: MixerLibName.}
-  # The same as above, but the sound is played at most 'ticks' milliseconds 
-proc playChannelTimed*(channel: cint, chunk: PChunk, loops: cint, 
-                           ticks: cint): cint{.cdecl, 
-    importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
-
-proc playChannel*(channel: cint, chunk: PChunk, loops: cint): cint
-proc playMusic*(music: PMusic, loops: cint): cint{.cdecl, 
-    importc: "Mix_PlayMusic", dynlib: MixerLibName.}
-  # Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions 
-proc fadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
-proc fadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint, 
-                             ms: cint, ticks: cint): cint{.cdecl, 
-    importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
-proc fadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
-  # Set the volume in the range of 0-128 of a specific channel or chunk.
-  #   If the specified channel is -1, set volume for all channels.
-  #   Returns the original volume.
-  #   If the specified volume is -1, just return the current volume.
-  #
-proc volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume", 
-    dynlib: MixerLibName.}
-proc volumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl, 
-    importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
-proc volumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic", 
-    dynlib: MixerLibName.}
-  # Halt playing of a particular channel 
-proc haltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel", 
-    dynlib: MixerLibName.}
-proc haltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup", 
-                                    dynlib: MixerLibName.}
-proc haltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic", 
-                            dynlib: MixerLibName.}
-
-proc expireChannel*(channel: cint, ticks: cint): cint{.cdecl, 
-    importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
-
-proc fadeOutChannel*(which: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
-proc fadeOutGroup*(tag: cint, ms: cint): cint{.cdecl, 
-    importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
-proc fadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic", 
-                                      dynlib: MixerLibName.}
-  # Query the fading status of a channel 
-proc fadingMusic*(): Fading{.cdecl, importc: "Mix_FadingMusic", 
-                                      dynlib: MixerLibName.}
-proc fadingChannel*(which: cint): Fading{.cdecl, 
-    importc: "Mix_FadingChannel", dynlib: MixerLibName.}
-  # Pause/Resume a particular channel 
-proc pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
-proc resume*(channel: cint){.cdecl, importc: "Mix_Resume", 
-                                dynlib: MixerLibName.}
-proc paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused", 
-                                     dynlib: MixerLibName.}
-  # Pause/Resume the music stream 
-proc pauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
-proc resumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
-proc rewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
-proc pausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic", 
-                              dynlib: MixerLibName.}
-  # Set the current position in the music stream.
-  #  This returns 0 if successful, or -1 if it failed or isn't implemented.
-  #  This function is only implemented for MOD music formats (set pattern
-  #  order number) and for OGG music (set position in seconds), at the
-  #  moment.
-  #
-proc setMusicPosition*(position: float64): cint{.cdecl, 
-    importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
-  # Check the status of a specific channel.
-  #   If the specified channel is -1, check all channels.
-  #
-proc playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing", 
-                                      dynlib: MixerLibName.}
-proc playingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic", 
-                               dynlib: MixerLibName.}
-  # Stop music and set external music playback command 
-proc setMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD", 
-    dynlib: MixerLibName.}
-  # Synchro value is set by MikMod from modules while playing 
-proc setSynchroValue*(value: cint): cint{.cdecl, 
-    importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
-proc getSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue", 
-                                  dynlib: MixerLibName.}
-  #
-  #  Get the Mix_Chunk currently associated with a mixer channel
-  #    Returns nil if it's an invalid channel, or there's no chunk associated.
-  #
-proc getChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk", 
-    dynlib: MixerLibName.}
-  # Close the mixer, halting all playing audio 
-proc closeAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
-  # We'll use SDL for reporting errors 
-
-proc version(x: var Version) = 
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-proc loadWAV(filename: cstring): PChunk = 
-  result = LoadWAV_RW(rWFromFile(filename, "rb"), 1)
-
-proc playChannel(channel: cint, chunk: PChunk, loops: cint): cint = 
-  result = playChannelTimed(channel, chunk, loops, - 1)
-
-proc fadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint = 
-  result = fadeInChannelTimed(channel, chunk, loops, ms, - 1)
-
diff --git a/lib/wrappers/sdl/sdl_net.nim b/lib/wrappers/sdl/sdl_net.nim
deleted file mode 100644
index 5bde607f7..000000000
--- a/lib/wrappers/sdl/sdl_net.nim
+++ /dev/null
@@ -1,428 +0,0 @@
-#******************************************************************************
-#
-#  $Id: sdl_net.pas,v 1.7 2005/01/01 02:14:21 savage Exp $
-#
-#
-#                                                                              
-#       Borland Delphi SDL_Net - A x-platform network library for use with SDL.
-#       Conversion of the Simple DirectMedia Layer Network Headers             
-#                                                                              
-# Portions created by Sam Lantinga <slouken@devolution.com> are                
-# Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga                     
-# 5635-34 Springhouse Dr.                                                      
-# Pleasanton, CA 94588 (USA)                                                   
-#                                                                              
-# All Rights Reserved.                                                         
-#                                                                              
-# The original files are : SDL_net.h                                           
-#                                                                              
-# The initial developer of this Pascal code was :                              
-# Dominqiue Louis <Dominique@SavageSoftware.com.au>                            
-#                                                                              
-# Portions created by Dominqiue Louis are                                      
-# Copyright (C) 2000 - 2001 Dominqiue Louis.                                   
-#                                                                              
-#                                                                              
-# Contributor(s)                                                               
-# --------------                                                               
-# Matthias Thoma <ma.thoma@gmx.de>                                             
-#                                                                              
-# Obtained through:                                                            
-# Joint Endeavour of Delphi Innovators ( Project JEDI )                        
-#                                                                              
-# You may retrieve the latest version of this file at the Project              
-# JEDI home page, located at http://delphi-jedi.org                            
-#                                                                              
-# The contents of this file are used with permission, subject to               
-# the Mozilla Public License Version 1.1 (the "License"); you may              
-# not use this file except in compliance with the License. You may             
-# obtain a copy of the License at                                              
-# http://www.mozilla.org/MPL/MPL-1.1.html                                      
-#                                                                              
-# Software distributed under the License is distributed on an                  
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or               
-# implied. See the License for the specific language governing                 
-# rights and limitations under the License.                                    
-#                                                                              
-# Description                                                                  
-# -----------                                                                  
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Requires                                                                     
-# --------                                                                     
-#   SDL.pas somehere in your search path                                       
-#                                                                              
-# Programming Notes                                                            
-# -----------------                                                            
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Revision History                                                             
-# ----------------                                                             
-#   April   09 2001 - DL : Initial Translation                                 
-#                                                                              
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more     
-#                          Pascal compilers. Initial support is now included   
-#                          for GnuPascal, VirtualPascal, TMT and obviously     
-#                          continue support for Delphi Kylix and FreePascal.   
-#                                                                              
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction     
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support              
-#                                                                              
-#   April   30 2003 - DL : under instruction from David Mears AKA              
-#                          Jason Siletto, I have added FPC Linux support.      
-#                          This was compiled with fpc 1.1, so remember to set  
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*   
-#                                                                              
-#
-#  $Log: sdl_net.pas,v $
-#  Revision 1.7  2005/01/01 02:14:21  savage
-#  Updated to v1.2.5
-#
-#  Revision 1.6  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.5  2004/05/10 14:10:04  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.4  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.3  2004/04/01 20:53:23  savage
-#  Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.2  2004/03/30 20:23:28  savage
-#  Tidied up use of UNIX compiler directive.
-#
-#  Revision 1.1  2004/02/16 22:16:40  savage
-#  v1.0 changes
-#
-#
-#
-#******************************************************************************
-
-import 
-  sdl
-
-when defined(windows): 
-  const 
-    NetLibName = "SDL_net.dll"
-elif defined(macosx): 
-  const 
-    NetLibName = "libSDL_net.dylib"
-else: 
-  const 
-    NetLibName = "libSDL_net.so"
-const                         #* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL *
-  MAJOR_VERSION* = 1
-  MINOR_VERSION* = 2
-  PATCHLEVEL* = 5        # SDL_Net.h constants
-                         #* Resolve a host name and port to an IP address in network form.
-                         #   If the function succeeds, it will return 0.
-                         #   If the host couldn't be resolved, the host portion of the returned
-                         #   address will be INADDR_NONE, and the function will return -1.
-                         #   If 'host' is NULL, the resolved host will be set to INADDR_ANY.
-                         # *
-  INADDR_ANY* = 0x00000000
-  INADDR_NONE* = 0xFFFFFFFF #***********************************************************************
-                            #* UDP network API                                                     *
-                            #***********************************************************************
-                            #* The maximum channels on a a UDP socket *
-  MAX_UDPCHANNELS* = 32   #* The maximum addresses bound to a single UDP socket channel *
-  MAX_UDPADDRESSES* = 4
-
-type  # SDL_net.h types
-      #***********************************************************************
-      #* IPv4 hostname resolution API                                        *
-      #***********************************************************************
-  PIPAddress* = ptr IPAddress
-  IPAddress*{.final.} = object  #* TCP network API                                                     
-    host*: uint32             # 32-bit IPv4 host address */
-    port*: uint16             # 16-bit protocol port */
-  
-  PTCPSocket* = ptr TCPSocket
-  TCPSocket*{.final.} = object  # UDP network API
-    ready*: int
-    channel*: int
-    remoteAddress*: IPAddress
-    localAddress*: IPAddress
-    sflag*: int
-
-  PUDP_Channel* = ptr UDP_Channel
-  UDP_Channel*{.final.} = object 
-    numbound*: int
-    address*: array[0..MAX_UDPADDRESSES - 1, IPAddress]
-
-  PUDPSocket* = ptr UDPSocket
-  UDPSocket*{.final.} = object 
-    ready*: int
-    channel*: int
-    address*: IPAddress
-    binding*: array[0..MAX_UDPCHANNELS - 1, UDP_Channel]
-
-  PUDPpacket* = ptr UDPpacket
-  PPUDPpacket* = ptr PUDPpacket
-  UDPpacket*{.final.} = object  #***********************************************************************
-                                 #* Hooks for checking sockets for available data                       *
-                                 #***********************************************************************
-    channel*: int             #* The src/dst channel of the packet *
-    data*: pointer            #* The packet data *
-    length*: int              #* The length of the packet data *
-    maxlen*: int              #* The size of the data buffer *
-    status*: int              #* packet status after sending *
-    address*: IPAddress       #* The source/dest address of an incoming/outgoing packet *
-  
-  PSocket* = ptr Socket
-  Socket*{.final.} = object 
-    ready*: int
-    channel*: int
-
-  PSocketSet* = ptr SocketSet
-  SocketSet*{.final.} = object  # Any network socket can be safely cast to this socket type *
-    numsockets*: int
-    maxsockets*: int
-    sockets*: PSocket
-
-  PGenericSocket* = ptr GenericSocket
-  GenericSocket*{.final.} = object 
-    ready*: int
-{.deprecated: [TSocket: Socket, TSocketSet: SocketSet, TIPAddress: IpAddress,
-        TTCPSocket: TCPSocket, TUDP_Channel: UDP_Channel, TUDPSocket: UDPSocket,
-        TUDPpacket: UDPpacket, TGenericSocket: GenericSocket].}
-
-proc version*(x: var Version)
-  #* Initialize/Cleanup the network API
-  #   SDL must be initialized before calls to functions in this library,
-  #   because this library uses utility functions from the SDL library.
-  #*
-proc init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.}
-proc quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.}
-  #* Resolve a host name and port to an IP address in network form.
-  #   If the function succeeds, it will return 0.
-  #   If the host couldn't be resolved, the host portion of the returned
-  #   address will be INADDR_NONE, and the function will return -1.
-  #   If 'host' is NULL, the resolved host will be set to INADDR_ANY.
-  # *
-proc resolveHost*(address: var IPAddress, host: cstring, port: uint16): int{.
-    cdecl, importc: "SDLNet_ResolveHost", dynlib: NetLibName.}
-  #* Resolve an ip address to a host name in canonical form.
-  #   If the ip couldn't be resolved, this function returns NULL,
-  #   otherwise a pointer to a static buffer containing the hostname
-  #   is returned.  Note that this function is not thread-safe.
-  #*
-proc resolveIP*(ip: var IPAddress): cstring{.cdecl, 
-    importc: "SDLNet_ResolveIP", dynlib: NetLibName.}
-  #***********************************************************************
-  #* TCP network API                                                     *
-  #***********************************************************************
-  #* Open a TCP network socket
-  #   If ip.host is INADDR_NONE, this creates a local server socket on the
-  #   given port, otherwise a TCP connection to the remote host and port is
-  #   attempted.  The address passed in should already be swapped to network
-  #   byte order (addresses returned from SDLNet_ResolveHost() are already
-  #   in the correct form).
-  #   The newly created socket is returned, or NULL if there was an error.
-  #*
-proc tcpOpen*(ip: var IPAddress): PTCPSocket{.cdecl, 
-    importc: "SDLNet_TCP_Open", dynlib: NetLibName.}
-  #* Accept an incoming connection on the given server socket.
-  #   The newly created socket is returned, or NULL if there was an error.
-  #*
-proc tcpAccept*(server: PTCPSocket): PTCPSocket{.cdecl, 
-    importc: "SDLNet_TCP_Accept", dynlib: NetLibName.}
-  #* Get the IP address of the remote system associated with the socket.
-  #   If the socket is a server socket, this function returns NULL.
-  #*
-proc tcpGetPeerAddress*(sock: PTCPSocket): PIPAddress{.cdecl, 
-    importc: "SDLNet_TCP_GetPeerAddress", dynlib: NetLibName.}
-  #* Send 'len' bytes of 'data' over the non-server socket 'sock'
-  #   This function returns the actual amount of data sent.  If the return value
-  #   is less than the amount of data sent, then either the remote connection was
-  #   closed, or an unknown socket error occurred.
-  #*
-proc tcpSend*(sock: PTCPSocket, data: pointer, length: int): int{.cdecl, 
-    importc: "SDLNet_TCP_Send", dynlib: NetLibName.}
-  #* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
-  #   and store them in the buffer pointed to by 'data'.
-  #   This function returns the actual amount of data received.  If the return
-  #   value is less than or equal to zero, then either the remote connection was
-  #   closed, or an unknown socket error occurred.
-  #*
-proc tcpRecv*(sock: PTCPSocket, data: pointer, maxlen: int): int{.cdecl, 
-    importc: "SDLNet_TCP_Recv", dynlib: NetLibName.}
-  #* Close a TCP network socket *
-proc tcpClose*(sock: PTCPSocket){.cdecl, importc: "SDLNet_TCP_Close", 
-                                       dynlib: NetLibName.}
-  #***********************************************************************
-  #* UDP network API                                                     *
-  #***********************************************************************
-  #* Allocate/resize/free a single UDP packet 'size' bytes long.
-  #   The new packet is returned, or NULL if the function ran out of memory.
-  # *
-proc allocPacket*(size: int): PUDPpacket{.cdecl, 
-    importc: "SDLNet_AllocPacket", dynlib: NetLibName.}
-proc resizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl, 
-    importc: "SDLNet_ResizePacket", dynlib: NetLibName.}
-proc freePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket", 
-    dynlib: NetLibName.}
-  #* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
-  #   each 'size' bytes long.
-  #   A pointer to the first packet in the array is returned, or NULL if the
-  #   function ran out of memory.
-  # *
-proc allocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl, 
-    importc: "SDLNet_AllocPacketV", dynlib: NetLibName.}
-proc freePacketV*(packetV: PUDPpacket){.cdecl, 
-    importc: "SDLNet_FreePacketV", dynlib: NetLibName.}
-  #* Open a UDP network socket
-  #   If 'port' is non-zero, the UDP socket is bound to a local port.
-  #   This allows other systems to send to this socket via a known port.
-  #*
-proc udpOpen*(port: uint16): PUDPSocket{.cdecl, importc: "SDLNet_UDP_Open", 
-    dynlib: NetLibName.}
-  #* Bind the address 'address' to the requested channel on the UDP socket.
-  #   If the channel is -1, then the first unbound channel will be bound with
-  #   the given address as it's primary address.
-  #   If the channel is already bound, this new address will be added to the
-  #   list of valid source addresses for packets arriving on the channel.
-  #   If the channel is not already bound, then the address becomes the primary
-  #   address, to which all outbound packets on the channel are sent.
-  #   This function returns the channel which was bound, or -1 on error.
-  #*
-proc udpBind*(sock: PUDPSocket, channel: int, address: var IPAddress): int{.
-    cdecl, importc: "SDLNet_UDP_Bind", dynlib: NetLibName.}
-  #* Unbind all addresses from the given channel *
-proc udpUnbind*(sock: PUDPSocket, channel: int){.cdecl, 
-    importc: "SDLNet_UDP_Unbind", dynlib: NetLibName.}
-  #* Get the primary IP address of the remote system associated with the
-  #   socket and channel.  If the channel is -1, then the primary IP port
-  #   of the UDP socket is returned -- this is only meaningful for sockets
-  #   opened with a specific port.
-  #   If the channel is not bound and not -1, this function returns NULL.
-  # *
-proc udpGetPeerAddress*(sock: PUDPSocket, channel: int): PIPAddress{.cdecl, 
-    importc: "SDLNet_UDP_GetPeerAddress", dynlib: NetLibName.}
-  #* Send a vector of packets to the the channels specified within the packet.
-  #   If the channel specified in the packet is -1, the packet will be sent to
-  #   the address in the 'src' member of the packet.
-  #   Each packet will be updated with the status of the packet after it has
-  #   been sent, -1 if the packet send failed.
-  #   This function returns the number of packets sent.
-  #*
-proc udpSendV*(sock: PUDPSocket, packets: PPUDPpacket, npackets: int): int{.
-    cdecl, importc: "SDLNet_UDP_SendV", dynlib: NetLibName.}
-  #* Send a single packet to the specified channel.
-  #   If the channel specified in the packet is -1, the packet will be sent to
-  #   the address in the 'src' member of the packet.
-  #   The packet will be updated with the status of the packet after it has
-  #   been sent.
-  #   This function returns 1 if the packet was sent, or 0 on error.
-  #*
-proc udpSend*(sock: PUDPSocket, channel: int, packet: PUDPpacket): int{.
-    cdecl, importc: "SDLNet_UDP_Send", dynlib: NetLibName.}
-  #* Receive a vector of pending packets from the UDP socket.
-  #   The returned packets contain the source address and the channel they arrived
-  #   on.  If they did not arrive on a bound channel, the the channel will be set
-  #   to -1.
-  #   The channels are checked in highest to lowest order, so if an address is
-  #   bound to multiple channels, the highest channel with the source address
-  #   bound will be returned.
-  #   This function returns the number of packets read from the network, or -1
-  #   on error.  This function does not block, so can return 0 packets pending.
-  #*
-proc udpRecvV*(sock: PUDPSocket, packets: PPUDPpacket): int{.cdecl, 
-    importc: "SDLNet_UDP_RecvV", dynlib: NetLibName.}
-  #* Receive a single packet from the UDP socket.
-  #   The returned packet contains the source address and the channel it arrived
-  #   on.  If it did not arrive on a bound channel, the the channel will be set
-  #   to -1.
-  #   The channels are checked in highest to lowest order, so if an address is
-  #   bound to multiple channels, the highest channel with the source address
-  #   bound will be returned.
-  #   This function returns the number of packets read from the network, or -1
-  #   on error.  This function does not block, so can return 0 packets pending.
-  #*
-proc udpRecv*(sock: PUDPSocket, packet: PUDPpacket): int{.cdecl, 
-    importc: "SDLNet_UDP_Recv", dynlib: NetLibName.}
-  #* Close a UDP network socket *
-proc udpClose*(sock: PUDPSocket){.cdecl, importc: "SDLNet_UDP_Close", 
-                                       dynlib: NetLibName.}
-  #***********************************************************************
-  #* Hooks for checking sockets for available data                       *
-  #***********************************************************************
-  #* Allocate a socket set for use with SDLNet_CheckSockets()
-  #   This returns a socket set for up to 'maxsockets' sockets, or NULL if
-  #   the function ran out of memory.
-  # *
-proc allocSocketSet*(maxsockets: int): PSocketSet{.cdecl, 
-    importc: "SDLNet_AllocSocketSet", dynlib: NetLibName.}
-  #* Add a socket to a set of sockets to be checked for available data *
-proc addSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
-    cdecl, importc: "SDLNet_AddSocket", dynlib: NetLibName.}
-proc tcpAddSocket*(theSet: PSocketSet, sock: PTCPSocket): int
-proc udpAddSocket*(theSet: PSocketSet, sock: PUDPSocket): int
-  #* Remove a socket from a set of sockets to be checked for available data *
-proc delSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
-    cdecl, importc: "SDLNet_DelSocket", dynlib: NetLibName.}
-proc tcpDelSocket*(theSet: PSocketSet, sock: PTCPSocket): int
-  # SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
-proc udpDelSocket*(theSet: PSocketSet, sock: PUDPSocket): int
-  #SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
-  #* This function checks to see if data is available for reading on the
-  #   given set of sockets.  If 'timeout' is 0, it performs a quick poll,
-  #   otherwise the function returns when either data is available for
-  #   reading, or the timeout in milliseconds has elapsed, which ever occurs
-  #   first.  This function returns the number of sockets ready for reading,
-  #   or -1 if there was an error with the select() system call.
-  #*
-proc checkSockets*(theSet: PSocketSet, timeout: int32): int{.cdecl, 
-    importc: "SDLNet_CheckSockets", dynlib: NetLibName.}
-  #* After calling SDLNet_CheckSockets(), you can use this function on a
-  #   socket that was in the socket set, to find out if data is available
-  #   for reading.
-  #*
-proc socketReady*(sock: PGenericSocket): bool
-  #* Free a set of sockets allocated by SDL_NetAllocSocketSet() *
-proc freeSocketSet*(theSet: PSocketSet){.cdecl, 
-    importc: "SDLNet_FreeSocketSet", dynlib: NetLibName.}
-  #***********************************************************************
-  #* Platform-independent data conversion functions                      *
-  #***********************************************************************
-  #* Write a 16/32 bit value to network packet buffer *
-proc write16*(value: uint16, area: pointer){.cdecl, 
-    importc: "SDLNet_Write16", dynlib: NetLibName.}
-proc write32*(value: uint32, area: pointer){.cdecl, 
-    importc: "SDLNet_Write32", dynlib: NetLibName.}
-  #* Read a 16/32 bit value from network packet buffer *
-proc read16*(area: pointer): uint16{.cdecl, importc: "SDLNet_Read16", 
-    dynlib: NetLibName.}
-proc read32*(area: pointer): uint32{.cdecl, importc: "SDLNet_Read32", 
-    dynlib: NetLibName.}
-
-proc version(x: var Version) = 
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-proc tcpAddSocket(theSet: PSocketSet, sock: PTCPSocket): int = 
-  result = addSocket(theSet, cast[PGenericSocket](sock))
-
-proc udpAddSocket(theSet: PSocketSet, sock: PUDPSocket): int = 
-  result = addSocket(theSet, cast[PGenericSocket](sock))
-
-proc tcpDelSocket(theSet: PSocketSet, sock: PTCPSocket): int = 
-  result = delSocket(theSet, cast[PGenericSocket](sock))
-
-proc udpDelSocket(theSet: PSocketSet, sock: PUDPSocket): int = 
-  result = delSocket(theSet, cast[PGenericSocket](sock))
-
-proc socketReady(sock: PGenericSocket): bool = 
-  result = sock != nil and sock.ready == 1
diff --git a/lib/wrappers/sdl/sdl_ttf.nim b/lib/wrappers/sdl/sdl_ttf.nim
deleted file mode 100644
index 06604f96e..000000000
--- a/lib/wrappers/sdl/sdl_ttf.nim
+++ /dev/null
@@ -1,338 +0,0 @@
-#
-#  $Id: sdl_ttf.pas,v 1.18 2007/06/01 11:16:33 savage Exp $
-#
-#
-#******************************************************************************
-#                                                                              
-#          JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer          
-#       Conversion of the Simple DirectMedia Layer Headers                     
-#                                                                              
-# Portions created by Sam Lantinga <slouken@devolution.com> are                
-# Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga                     
-# 5635-34 Springhouse Dr.                                                      
-# Pleasanton, CA 94588 (USA)                                                   
-#                                                                              
-# All Rights Reserved.                                                         
-#                                                                              
-# The original files are : SDL_ttf.h                                           
-#                                                                              
-# The initial developer of this Pascal code was :                              
-# Dominqiue Louis <Dominique@SavageSoftware.com.au>                            
-#                                                                              
-# Portions created by Dominqiue Louis are                                      
-# Copyright (C) 2000 - 2001 Dominqiue Louis.                                   
-#                                                                              
-#                                                                              
-# Contributor(s)                                                               
-# --------------                                                               
-# Tom Jones <tigertomjones@gmx.de>  His Project inspired this conversion       
-#                                                                              
-# Obtained through:                                                            
-# Joint Endeavour of Delphi Innovators ( Project JEDI )                        
-#                                                                              
-# You may retrieve the latest version of this file at the Project              
-# JEDI home page, located at http://delphi-jedi.org                            
-#                                                                              
-# The contents of this file are used with permission, subject to               
-# the Mozilla Public License Version 1.1 (the "License"); you may              
-# not use this file except in compliance with the License. You may             
-# obtain a copy of the License at                                              
-# http://www.mozilla.org/MPL/MPL-1.1.html                                      
-#                                                                              
-# Software distributed under the License is distributed on an                  
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or               
-# implied. See the License for the specific language governing                 
-# rights and limitations under the License.                                    
-#                                                                              
-# Description                                                                  
-# -----------                                                                  
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Requires                                                                     
-# --------                                                                     
-#   The SDL Runtime libraris on Win32  : SDL.dll on Linux : libSDL.so          
-#   They are available from...                                                 
-#   http://www.libsdl.org .                                                    
-#                                                                              
-# Programming Notes                                                            
-# -----------------                                                            
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Revision History                                                             
-# ----------------                                                             
-#   December 08 2002 - DL : Fixed definition of TTF_RenderUnicode_Solid        
-#                                                                              
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more     
-#                          Pascal compilers. Initial support is now included   
-#                          for GnuPascal, VirtualPascal, TMT and obviously     
-#                          continue support for Delphi Kylix and FreePascal.   
-#                                                                              
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction     
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support              
-#                                                                              
-#   April   30 2003 - DL : under instruction from David Mears AKA              
-#                          Jason Siletto, I have added FPC Linux support.      
-#                          This was compiled with fpc 1.1, so remember to set  
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*   
-#                                                                              
-#
-#  $Log: sdl_ttf.pas,v $
-#  Revision 1.18  2007/06/01 11:16:33  savage
-#  Added IFDEF UNIX for Workaround.
-#
-#  Revision 1.17  2007/06/01 08:38:21  savage
-#  Added TTF_RenderText_Solid workaround as suggested by Michalis Kamburelis
-#
-#  Revision 1.16  2007/05/29 21:32:14  savage
-#  Changes as suggested by Almindor for 64bit compatibility.
-#
-#  Revision 1.15  2007/05/20 20:32:45  savage
-#  Initial Changes to Handle 64 Bits
-#
-#  Revision 1.14  2006/12/02 00:19:01  savage
-#  Updated to latest version
-#
-#  Revision 1.13  2005/04/10 11:48:33  savage
-#  Changes as suggested by Michalis, thanks.
-#
-#  Revision 1.12  2005/01/05 01:47:14  savage
-#  Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively.
-#
-#  Revision 1.11  2005/01/04 23:14:57  savage
-#  Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively.
-#
-#  Revision 1.10  2005/01/02 19:07:32  savage
-#  Slight bug fix to use LongInt instead of Long ( Thanks Michalis Kamburelis )
-#
-#  Revision 1.9  2005/01/01 02:15:20  savage
-#  Updated to v2.0.7
-#
-#  Revision 1.8  2004/10/07 21:02:32  savage
-#  Fix for FPC
-#
-#  Revision 1.7  2004/09/30 22:39:50  savage
-#  Added a true type font class which contains a wrap text function.
-#  Changed the sdl_ttf.pas header to reflect the future of jedi-sdl.
-#
-#  Revision 1.6  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.5  2004/05/10 14:10:04  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.4  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.3  2004/04/01 20:53:24  savage
-#  Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.2  2004/03/30 20:23:28  savage
-#  Tidied up use of UNIX compiler directive.
-#
-#  Revision 1.1  2004/02/16 22:16:40  savage
-#  v1.0 changes
-#
-#  
-#
-#******************************************************************************
-#
-#  Define this to workaround a known bug in some freetype versions.
-#  The error manifests as TTF_RenderGlyph_Solid returning nil (error)
-#  and error message (in SDL_Error) is
-#  "Failed loading DPMSDisable: /usr/lib/libX11.so.6: undefined symbol: DPMSDisable"
-#  See [http://lists.libsdl.org/pipermail/sdl-libsdl.org/2007-March/060459.html]
-#
-
-import 
-  sdl
-
-when defined(windows): 
-  const 
-    ttfLibName = "SDL_ttf.dll"
-elif defined(macosx): 
-  const 
-    ttfLibName = "libSDL_ttf-2.0.0.dylib"
-else: 
-  const 
-    ttfLibName = "libSDL_ttf(|-2.0).so(|.1|.0)"
-const 
-  MAJOR_VERSION* = 2
-  MINOR_VERSION* = 0
-  PATCHLEVEL* = 8      # Backwards compatibility
-
-  STYLE_NORMAL* = 0x00000000
-  STYLE_BOLD* = 0x00000001
-  STYLE_ITALIC* = 0x00000002
-  STYLE_UNDERLINE* = 0x00000004 # ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark)
-  UNICODE_BOM_NATIVE* = 0x0000FEFF
-  UNICODE_BOM_SWAPPED* = 0x0000FFFE
-
-type 
-  PFont* = ptr Font
-  Font = object  
-{.deprecated: [TFont: Font].}
-  
-  
-# This macro can be used to fill a version structure with the compile-time
-# version of the SDL_ttf library. 
-
-proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "TTF_Linked_Version", 
-                                      dynlib: ttfLibName.}
-  # This function tells the library whether UNICODE text is generally
-  #   byteswapped.  A UNICODE BOM character in a string will override
-  #   this setting for the remainder of that string.
-  #
-proc byteSwappedUNICODE*(swapped: cint){.cdecl, 
-    importc: "TTF_ByteSwappedUNICODE", dynlib: ttfLibName.}
-  #returns 0 on succes, -1 if error occurs
-proc init*(): cint{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.}
-  #
-  # Open a font file and create a font of the specified point size.
-  # Some .fon fonts will have several sizes embedded in the file, so the
-  # point size becomes the index of choosing which size.  If the value
-  # is too high, the last indexed size will be the default.
-  #
-proc openFont*(filename: cstring, ptsize: cint): PFont{.cdecl, 
-    importc: "TTF_OpenFont", dynlib: ttfLibName.}
-proc openFontIndex*(filename: cstring, ptsize: cint, index: int32): PFont{.
-    cdecl, importc: "TTF_OpenFontIndex", dynlib: ttfLibName.}
-proc openFontRW*(src: PRWops, freesrc: cint, ptsize: cint): PFont{.cdecl, 
-    importc: "TTF_OpenFontRW", dynlib: ttfLibName.}
-proc openFontIndexRW*(src: PRWops, freesrc: cint, ptsize: cint, index: int32): PFont{.
-    cdecl, importc: "TTF_OpenFontIndexRW", dynlib: ttfLibName.}
-proc getFontStyle*(font: PFont): cint{.cdecl, 
-    importc: "TTF_GetFontStyle", dynlib: ttfLibName.}
-proc setFontStyle*(font: PFont, style: cint){.cdecl, 
-    importc: "TTF_SetFontStyle", dynlib: ttfLibName.}
-  # Get the total height of the font - usually equal to point size 
-proc fontHeight*(font: PFont): cint{.cdecl, importc: "TTF_FontHeight", 
-    dynlib: ttfLibName.}
-  # Get the offset from the baseline to the top of the font
-  #   This is a positive value, relative to the baseline.
-  #
-proc fontAscent*(font: PFont): cint{.cdecl, importc: "TTF_FontAscent", 
-    dynlib: ttfLibName.}
-  # Get the offset from the baseline to the bottom of the font
-  #   This is a negative value, relative to the baseline.
-  #
-proc fontDescent*(font: PFont): cint{.cdecl, importc: "TTF_FontDescent", 
-    dynlib: ttfLibName.}
-  # Get the recommended spacing between lines of text for this font 
-proc fontLineSkip*(font: PFont): cint{.cdecl, 
-    importc: "TTF_FontLineSkip", dynlib: ttfLibName.}
-  # Get the number of faces of the font 
-proc fontFaces*(font: PFont): int32{.cdecl, importc: "TTF_FontFaces", 
-    dynlib: ttfLibName.}
-  # Get the font face attributes, if any 
-proc fontFaceIsFixedWidth*(font: PFont): cint{.cdecl, 
-    importc: "TTF_FontFaceIsFixedWidth", dynlib: ttfLibName.}
-proc fontFaceFamilyName*(font: PFont): cstring{.cdecl, 
-    importc: "TTF_FontFaceFamilyName", dynlib: ttfLibName.}
-proc fontFaceStyleName*(font: PFont): cstring{.cdecl, 
-    importc: "TTF_FontFaceStyleName", dynlib: ttfLibName.}
-  # Get the metrics (dimensions) of a glyph 
-proc glyphMetrics*(font: PFont, ch: uint16, minx: var cint, 
-                       maxx: var cint, miny: var cint, maxy: var cint, 
-                       advance: var cint): cint{.cdecl, 
-    importc: "TTF_GlyphMetrics", dynlib: ttfLibName.}
-  # Get the dimensions of a rendered string of text 
-proc sizeText*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
-    cdecl, importc: "TTF_SizeText", dynlib: ttfLibName.}
-proc sizeUTF8*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
-    cdecl, importc: "TTF_SizeUTF8", dynlib: ttfLibName.}
-proc sizeUNICODE*(font: PFont, text: PUInt16, w: var cint, y: var cint): cint{.
-    cdecl, importc: "TTF_SizeUNICODE", dynlib: ttfLibName.}
-  # Create an 8-bit palettized surface and render the given text at
-  #   fast quality with the given font and color.  The 0 pixel is the
-  #   colorkey, giving a transparent background, and the 1 pixel is set
-  #   to the text color.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderUTF8Solid*(font: PFont, text: cstring, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderUTF8_Solid", dynlib: ttfLibName.}
-proc renderUNICODE_Solid*(font: PFont, text: PUInt16, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderUNICODE_Solid", dynlib: ttfLibName.}
-  #
-  #Create an 8-bit palettized surface and render the given glyph at
-  #   fast quality with the given font and color.  The 0 pixel is the
-  #   colorkey, giving a transparent background, and the 1 pixel is set
-  #   to the text color.  The glyph is rendered without any padding or
-  #   centering in the X direction, and aligned normally in the Y direction.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderGlyphSolid*(font: PFont, ch: uint16, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderGlyph_Solid", dynlib: ttfLibName.}
-  # Create an 8-bit palettized surface and render the given text at
-  #   high quality with the given font and colors.  The 0 pixel is background,
-  #   while other pixels have varying degrees of the foreground color.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderTextShaded*(font: PFont, text: cstring, fg: Color, 
-                            bg: Color): PSurface{.cdecl, 
-    importc: "TTF_RenderText_Shaded", dynlib: ttfLibName.}
-proc renderUTF8Shaded*(font: PFont, text: cstring, fg: Color, 
-                            bg: Color): PSurface{.cdecl, 
-    importc: "TTF_RenderUTF8_Shaded", dynlib: ttfLibName.}
-proc renderUNICODE_Shaded*(font: PFont, text: PUInt16, fg: Color, 
-                               bg: Color): PSurface{.cdecl, 
-    importc: "TTF_RenderUNICODE_Shaded", dynlib: ttfLibName.}
-  # Create an 8-bit palettized surface and render the given glyph at
-  #   high quality with the given font and colors.  The 0 pixel is background,
-  #   while other pixels have varying degrees of the foreground color.
-  #   The glyph is rendered without any padding or centering in the X
-  #   direction, and aligned normally in the Y direction.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderGlyphShaded*(font: PFont, ch: uint16, fg: Color, bg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderGlyph_Shaded", dynlib: ttfLibName.}
-  # Create a 32-bit ARGB surface and render the given text at high quality,
-  #   using alpha blending to dither the font with the given color.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderTextBlended*(font: PFont, text: cstring, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderText_Blended", dynlib: ttfLibName.}
-proc renderUTF8Blended*(font: PFont, text: cstring, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderUTF8_Blended", dynlib: ttfLibName.}
-proc RenderUNICODE_Blended*(font: PFont, text: PUInt16, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderUNICODE_Blended", dynlib: ttfLibName.}
-  # Create a 32-bit ARGB surface and render the given glyph at high quality,
-  #   using alpha blending to dither the font with the given color.
-  #   The glyph is rendered without any padding or centering in the X
-  #   direction, and aligned normally in the Y direction.
-  #   This function returns the new surface, or NULL if there was an error.
-  #
-proc renderGlyphBlended*(font: PFont, ch: uint16, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderGlyph_Blended", dynlib: ttfLibName.}
-  # For compatibility with previous versions, here are the old functions 
-  # #define TTF_RenderText(font, text, fg, bg)
-  #	TTF_RenderText_Shaded(font, text, fg, bg)
-  # #define TTF_RenderUTF8(font, text, fg, bg)
-  #	TTF_RenderUTF8_Shaded(font, text, fg, bg)
-  # #define TTF_RenderUNICODE(font, text, fg, bg)
-  #	TTF_RenderUNICODE_Shaded(font, text, fg, bg)
-  # Close an opened font file
-proc closeFont*(font: PFont){.cdecl, importc: "TTF_CloseFont", 
-                                      dynlib: ttfLibName.}
-  # De-initialize TTF engine
-proc quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.}
-  # Check if the TTF engine is initialized
-proc wasInit*(): cint{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.}
-
-
-proc version*(x: var sdl.Version) = 
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-
-proc renderTextSolid*(font: PFont, text: cstring, fg: Color): PSurface{.
-    cdecl, importc: "TTF_RenderText_Solid", dynlib: ttfLibName.}
diff --git a/lib/wrappers/sdl/smpeg.nim b/lib/wrappers/sdl/smpeg.nim
deleted file mode 100644
index 57c16fa47..000000000
--- a/lib/wrappers/sdl/smpeg.nim
+++ /dev/null
@@ -1,335 +0,0 @@
-#******************************************************************************
-#
-#  $Id: smpeg.pas,v 1.7 2004/08/14 22:54:30 savage Exp $
-#  
-#
-#                                                                              
-#       Borland Delphi SMPEG - SDL MPEG Player Library                         
-#       Conversion of the SMPEG - SDL MPEG Player Library                      
-#                                                                              
-# Portions created by Sam Lantinga <slouken@devolution.com> are                
-# Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga                     
-# 5635-34 Springhouse Dr.                                                      
-# Pleasanton, CA 94588 (USA)                                                   
-#                                                                              
-# All Rights Reserved.                                                         
-#                                                                              
-# The original files are : smpeg.h                                             
-#                                                                              
-# The initial developer of this Pascal code was :                              
-# Matthias Thoma <ma.thoma@gmx.de>                                             
-#                                                                              
-# Portions created by Matthias Thoma are                                       
-# Copyright (C) 2000 - 2001 Matthias Thoma.                                    
-#                                                                              
-#                                                                              
-# Contributor(s)                                                               
-# --------------                                                               
-# Tom Jones <tigertomjones@gmx.de>  His Project inspired this conversion       
-# Matthias Thoma <ma.thoma@gmx.de>                                             
-#                                                                              
-# Obtained through:                                                            
-# Joint Endeavour of Delphi Innovators ( Project JEDI )                        
-#                                                                              
-# You may retrieve the latest version of this file at the Project              
-# JEDI home page, located at http://delphi-jedi.org                            
-#                                                                              
-# The contents of this file are used with permission, subject to               
-# the Mozilla Public License Version 1.1 (the "License"); you may              
-# not use this file except in compliance with the License. You may             
-# obtain a copy of the License at                                              
-# http://www.mozilla.org/MPL/MPL-1.1.html                                      
-#                                                                              
-# Software distributed under the License is distributed on an                  
-# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or               
-# implied. See the License for the specific language governing                 
-# rights and limitations under the License.                                    
-#                                                                              
-# Description                                                                  
-# -----------                                                                  
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Requires                                                                     
-# --------                                                                     
-#   The SDL Runtime libraris on Win32  : SDL.dll on Linux : libSDL-1.2.so.0    
-#   They are available from...                                                 
-#   http://www.libsdl.org .                                                    
-#                                                                              
-# Programming Notes                                                            
-# -----------------                                                            
-#                                                                              
-#                                                                              
-#                                                                              
-#                                                                              
-# Revision History                                                             
-# ----------------                                                             
-#   May      08 2001 - MT : Initial conversion                                 
-#                                                                              
-#   October  12 2001 - DA : Various changes as suggested by David Acklam       
-#                                                                              
-#   April   03 2003 - DL : Added jedi-sdl.inc include file to support more     
-#                          Pascal compilers. Initial support is now included   
-#                          for GnuPascal, VirtualPascal, TMT and obviously     
-#                          continue support for Delphi Kylix and FreePascal.   
-#                                                                              
-#   April   08 2003 - MK : Aka Mr Kroket - Added Better FPC support            
-#                          Fixed all invalid calls to DLL.                     
-#                          Changed constant names to:                          
-#                          const                                               
-#                          STATUS_SMPEG_ERROR = -1;                            
-#                          STATUS_SMPEG_STOPPED = 0;                           
-#                          STATUS_SMPEG_PLAYING = 1;                           
-#                          because SMPEG_ERROR is a function (_SMPEG_error     
-#                          isn't correct), and cannot be two elements with the 
-#                          same name                                           
-#                                                                              
-#   April   24 2003 - DL : under instruction from Alexey Barkovoy, I have added
-#                          better TMT Pascal support and under instruction     
-#                          from Prof. Abimbola Olowofoyeku (The African Chief),
-#                          I have added better Gnu Pascal support              
-#                                                                              
-#   April   30 2003 - DL : under instruction from David Mears AKA              
-#                          Jason Siletto, I have added FPC Linux support.      
-#                          This was compiled with fpc 1.1, so remember to set  
-#                          include file path. ie. -Fi/usr/share/fpcsrc/rtl/*   
-#                                                                              
-#
-#  $Log: smpeg.pas,v $
-#  Revision 1.7  2004/08/14 22:54:30  savage
-#  Updated so that Library name defines are correctly defined for MacOS X.
-#
-#  Revision 1.6  2004/05/10 14:10:04  savage
-#  Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
-#
-#  Revision 1.5  2004/04/13 09:32:08  savage
-#  Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
-#
-#  Revision 1.4  2004/04/02 10:40:55  savage
-#  Changed Linux Shared Object name so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
-#
-#  Revision 1.3  2004/03/31 22:20:02  savage
-#  Windows unit not used in this file, so it was removed to keep the code tidy.
-#
-#  Revision 1.2  2004/03/30 20:23:28  savage
-#  Tidied up use of UNIX compiler directive.
-#
-#  Revision 1.1  2004/02/14 23:35:42  savage
-#  version 1 of sdl_image, sdl_mixer and smpeg.
-#
-#  
-#
-#******************************************************************************
-
-import
-  sdl
-
-when defined(windows): 
-  const 
-    SmpegLibName = "smpeg.dll"
-elif defined(macosx): 
-  const 
-    SmpegLibName = "libsmpeg.dylib"
-else: 
-  const 
-    SmpegLibName = "libsmpeg.so"
-const 
-  FILTER_INFO_MB_ERROR* = 1
-  FILTER_INFO_PIXEL_ERROR* = 2 # Filter info from SMPEG 
-
-type 
-  FilterInfo*{.final.} = object 
-    yuvMbSquareError*: PUInt16
-    yuvPixelSquareError*: PUInt16
-
-  PFilterInfo* = ptr FilterInfo # MPEG filter definition 
-  PFilter* = ptr Filter # Callback functions for the filter 
-  FilterCallback* = proc (dest, source: POverlay, region: PRect, 
-                                 filterInfo: PFilterInfo, data: pointer): pointer{.
-      cdecl.}
-  FilterDestroy* = proc (filter: PFilter): pointer{.cdecl.} # The filter definition itself 
-  Filter*{.final.} = object  # The null filter (default). It simply copies the source rectangle to the video overlay. 
-    flags*: uint32
-    data*: pointer
-    callback*: FilterCallback
-    destroy*: FilterDestroy
-{.deprecated: [TFilterInfo: FilterInfo, TFilterCallback: FilterCallback,
-              TFilterDestroy: FilterDestroy, TFilter: Filter].}
-
-proc filterNull*(): PFilter{.cdecl, importc: "SMPEGfilter_null", 
-    dynlib: SmpegLibName.}
-  # The bilinear filter. A basic low-pass filter that will produce a smoother image. 
-proc filterBilinear*(): PFilter{.cdecl, 
-    importc: "SMPEGfilter_bilinear", dynlib: SmpegLibName.}
-  # The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness 
-proc filterDeblocking*(): PFilter{.cdecl, 
-    importc: "SMPEGfilter_deblocking", dynlib: SmpegLibName.}
-  #------------------------------------------------------------------------------
-  # SMPEG.h
-  #------------------------------------------------------------------------------
-const 
-  MAJOR_VERSION* = 0
-  MINOR_VERSION* = 4
-  PATCHLEVEL* = 2
-
-type
-  TVersion* = object
-    major*: byte
-    minor*: byte
-    patch*: byte
-
-  Pversion* = ptr TVersion # This is the actual SMPEG object
-  TSMPEG* = object 
-  PSMPEG* = ptr TSMPEG        # Used to get information about the SMPEG object 
-  Info* = object 
-    hasAudio*: int32
-    hasVideo*: int32
-    width*: int32
-    height*: int32
-    currentFrame*: int32
-    currentFps*: float64
-    audioString*: array[0..79, char]
-    audioCurrentFrame*: int32
-    currentOffset*: uint32
-    totalSize*: uint32
-    currentTime*: float64
-    totalTime*: float64
-
-  PInfo* = ptr Info # Possible MPEG status codes 
-{.deprecated: [TInfo: Info].}
-
-const 
-  STATUS_ERROR* = - 1
-  STATUS_STOPPED* = 0
-  STATUS_PLAYING* = 1
-
-type 
-  Status* = int32
-  Pstatus* = ptr int32     # Matches the declaration of SDL_UpdateRect() 
-  TDisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): pointer{.
-      cdecl.} # Create a new SMPEG object from an MPEG file.
-              #  On return, if 'info' is not NULL, it will be filled with information
-              #  about the MPEG object.
-              #  This function returns a new SMPEG object.  Use error() to find out
-              #  whether or not there was a problem building the MPEG stream.
-              #  The sdl_audio parameter indicates if SMPEG should initialize the SDL audio
-              #  subsystem. If not, you will have to use the playaudio() function below
-              #  to extract the decoded data. 
-{.deprecated: [Tstatus: Status].}
-
-proc new*(theFile: cstring, info: PInfo, audio: int): PSMPEG{.cdecl, 
-    importc: "SMPEG_new", dynlib: SmpegLibName.}
-  # The same as above for a file descriptor 
-proc newDescr*(theFile: int, info: PInfo, audio: int): PSMPEG{.
-    cdecl, importc: "SMPEG_new_descr", dynlib: SmpegLibName.}
-  #  The same as above but for a raw chunk of data.  SMPEG makes a copy of the
-  #   data, so the application is free to delete after a successful call to this
-  #   function. 
-proc newData*(data: pointer, size: int, info: PInfo, audio: int): PSMPEG{.
-    cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.}
-  # Get current information about an SMPEG object 
-proc getinfo*(mpeg: PSMPEG, info: PInfo){.cdecl, 
-    importc: "SMPEG_getinfo", dynlib: SmpegLibName.}
-  #procedure getinfo(mpeg: PSMPEG; info: Pointer);
-  #cdecl; external  SmpegLibName;
-  # Enable or disable audio playback in MPEG stream 
-proc enableaudio*(mpeg: PSMPEG, enable: int){.cdecl, 
-    importc: "SMPEG_enableaudio", dynlib: SmpegLibName.}
-  # Enable or disable video playback in MPEG stream 
-proc enablevideo*(mpeg: PSMPEG, enable: int){.cdecl, 
-    importc: "SMPEG_enablevideo", dynlib: SmpegLibName.}
-  # Delete an SMPEG object 
-proc delete*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_delete", 
-                                  dynlib: SmpegLibName.}
-  # Get the current status of an SMPEG object 
-proc status*(mpeg: PSMPEG): Status{.cdecl, importc: "SMPEG_status", 
-    dynlib: SmpegLibName.}
-  # status
-  # Set the audio volume of an MPEG stream, in the range 0-100 
-proc setVolume*(mpeg: PSMPEG, volume: int){.cdecl, 
-    importc: "SMPEG_setvolume", dynlib: SmpegLibName.}
-  # Set the destination surface for MPEG video playback
-  #  'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL.
-  #  'callback' is a function called when an area of 'dst' needs to be updated.
-  #  If 'callback' is NULL, the default function (SDL_UpdateRect) will be used. 
-proc setDisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: PMutex, 
-                       callback: TDisplayCallback){.cdecl, 
-    importc: "SMPEG_setdisplay", dynlib: SmpegLibName.}
-  # Set or clear looping play on an SMPEG object 
-proc loop*(mpeg: PSMPEG, repeat: int){.cdecl, importc: "SMPEG_loop", 
-    dynlib: SmpegLibName.}
-  # Scale pixel display on an SMPEG object 
-proc scaleXY*(mpeg: PSMPEG, width, height: int){.cdecl, 
-    importc: "SMPEG_scaleXY", dynlib: SmpegLibName.}
-proc scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale", 
-    dynlib: SmpegLibName.}
-proc double*(mpeg: PSMPEG, doubleit: bool)
-  # Move the video display area within the destination surface 
-proc move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move", 
-    dynlib: SmpegLibName.}
-  # Set the region of the video to be shown 
-proc setDisplayRegion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl, 
-    importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.}
-  # Play an SMPEG object 
-proc play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play", 
-                                dynlib: SmpegLibName.}
-  # Pause/Resume playback of an SMPEG object
-proc pause*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_pause", 
-                                 dynlib: SmpegLibName.}
-  # Stop playback of an SMPEG object 
-proc stop*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_stop", 
-                                dynlib: SmpegLibName.}
-  # Rewind the play position of an SMPEG object to the beginning of the MPEG 
-proc rewind*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_rewind", 
-                                  dynlib: SmpegLibName.}
-  # Seek 'bytes' bytes in the MPEG stream 
-proc seek*(mpeg: PSMPEG, bytes: int){.cdecl, importc: "SMPEG_seek", 
-    dynlib: SmpegLibName.}
-  # Skip 'seconds' seconds in the MPEG stream 
-proc skip*(mpeg: PSMPEG, seconds: float32){.cdecl, importc: "SMPEG_skip", 
-    dynlib: SmpegLibName.}
-  # Render a particular frame in the MPEG video
-  #   API CHANGE: This function no longer takes a target surface and position.
-  #               Use setdisplay() and move() to set this information. 
-proc renderFrame*(mpeg: PSMPEG, framenum: int){.cdecl, 
-    importc: "SMPEG_renderFrame", dynlib: SmpegLibName.}
-  # Render the last frame of an MPEG video 
-proc renderFinal*(mpeg: PSMPEG, dst: PSurface, x, y: int){.cdecl, 
-    importc: "SMPEG_renderFinal", dynlib: SmpegLibName.}
-  # Set video filter 
-proc filter*(mpeg: PSMPEG, filter: PFilter): PFilter{.cdecl, 
-    importc: "SMPEG_filter", dynlib: SmpegLibName.}
-  # Return NULL if there is no error in the MPEG stream, or an error message
-  #   if there was a fatal error in the MPEG stream for the SMPEG object. 
-proc error*(mpeg: PSMPEG): cstring{.cdecl, importc: "SMPEG_error", 
-    dynlib: SmpegLibName.}
-  # Exported callback function for audio playback.
-  #   The function takes a buffer and the amount of data to fill, and returns
-  #   the amount of data in bytes that was actually written.  This will be the
-  #   amount requested unless the MPEG audio has finished.
-  #
-proc playAudio*(mpeg: PSMPEG, stream: pointer, length: int): int{.cdecl, 
-    importc: "SMPEG_playAudio", dynlib: SmpegLibName.}
-  # Wrapper for playAudio() that can be passed to SDL and SDL_mixer 
-proc playAudioSDL*(mpeg: pointer, stream: pointer, length: int){.cdecl, 
-    importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.}
-  # Get the best SDL audio spec for the audio stream 
-proc wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl, 
-    importc: "SMPEG_wantedSpec", dynlib: SmpegLibName.}
-  # Inform SMPEG of the actual SDL audio spec used for sound playback 
-proc actualSpec*(mpeg: PSMPEG, spec: PAudioSpec){.cdecl, 
-    importc: "SMPEG_actualSpec", dynlib: SmpegLibName.}
-  # This macro can be used to fill a version structure with the compile-time
-  #  version of the SDL library. 
-proc getversion*(x: var TVersion) =
-  x.major = MAJOR_VERSION
-  x.minor = MINOR_VERSION
-  x.patch = PATCHLEVEL
-
-proc double(mpeg: PSMPEG, doubleit: bool) = 
-  if doubleit: scale(mpeg, 2)
-  else: scale(mpeg, 1)
diff --git a/lib/wrappers/sphinx.nim b/lib/wrappers/sphinx.nim
deleted file mode 100644
index d9e98faa8..000000000
--- a/lib/wrappers/sphinx.nim
+++ /dev/null
@@ -1,263 +0,0 @@
-#
-# $Id: sphinxclient.h 2654 2011-01-31 01:20:58Z kevg $
-#
-#
-# Copyright (c) 2001-2011, Andrew Aksyonoff
-# Copyright (c) 2008-2011, Sphinx Technologies Inc
-# All rights reserved
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License. You should
-# have received a copy of the LGPL license along with this program; if you
-# did not, you can find it at http://www.gnu.org/
-#
-
-## Nim wrapper for ``sphinx``.
-
-{.deadCodeElim: on.}
-when defined(windows):
-  const
-    sphinxDll* = "spinx.dll"
-elif defined(macosx):
-  const
-    sphinxDll* = "libspinx.dylib"
-else:
-  const
-    sphinxDll* = "libspinxclient.so"
-
-#/ known searchd status codes:
-const
-  SEARCHD_OK* = 0
-  SEARCHD_ERROR* = 1
-  SEARCHD_RETRY* = 2
-  SEARCHD_WARNING* = 3
-
-#/ known match modes
-
-const
-  SPH_MATCH_ALL* = 0
-  SPH_MATCH_ANY* = 1
-  SPH_MATCH_PHRASE* = 2
-  SPH_MATCH_BOOLEAN* = 3
-  SPH_MATCH_EXTENDED* = 4
-  SPH_MATCH_FULLSCAN* = 5
-  SPH_MATCH_EXTENDED2* = 6
-
-#/ known ranking modes (ext2 only)
-
-const
-  SPH_RANK_PROXIMITY_BM25* = 0
-  SPH_RANK_BM25* = 1
-  SPH_RANK_NONE* = 2
-  SPH_RANK_WORDCOUNT* = 3
-  SPH_RANK_PROXIMITY* = 4
-  SPH_RANK_MATCHANY* = 5
-  SPH_RANK_FIELDMASK* = 6
-  SPH_RANK_SPH04* = 7
-  SPH_RANK_DEFAULT* = SPH_RANK_PROXIMITY_BM25
-
-#/ known sort modes
-
-const
-  SPH_SORT_RELEVANCE* = 0
-  SPH_SORT_ATTR_DESC* = 1
-  SPH_SORT_ATTR_ASC* = 2
-  SPH_SORT_TIME_SEGMENTS* = 3
-  SPH_SORT_EXTENDED* = 4
-  SPH_SORT_EXPR* = 5
-
-#/ known filter types
-
-const
-  SPH_FILTER_VALUES* = 0
-  SPH_FILTER_RANGE* = 1
-  SPH_FILTER_FLOATRANGE* = 2
-
-#/ known attribute types
-
-const
-  SPH_ATTR_INTEGER* = 1
-  SPH_ATTR_TIMESTAMP* = 2
-  SPH_ATTR_ORDINAL* = 3
-  SPH_ATTR_BOOL* = 4
-  SPH_ATTR_FLOAT* = 5
-  SPH_ATTR_BIGINT* = 6
-  SPH_ATTR_STRING* = 7
-  SPH_ATTR_MULTI* = 0x40000000
-
-#/ known grouping functions
-
-const
-  SPH_GROUPBY_DAY* = 0
-  SPH_GROUPBY_WEEK* = 1
-  SPH_GROUPBY_MONTH* = 2
-  SPH_GROUPBY_YEAR* = 3
-  SPH_GROUPBY_ATTR* = 4
-  SPH_GROUPBY_ATTRPAIR* = 5
-
-type
-  SphinxBool* {.size: sizeof(cint).} = enum
-    SPH_FALSE = 0,
-    SPH_TRUE = 1
-
-  Client {.pure, final.} = object
-  PClient* = ptr Client
-  Wordinfo*{.pure, final.} = object
-    word*: cstring
-    docs*: cint
-    hits*: cint
-
-  Result*{.pure, final.} = object
-    error*: cstring
-    warning*: cstring
-    status*: cint
-    num_fields*: cint
-    fields*: cstringArray
-    num_attrs*: cint
-    attr_names*: cstringArray
-    attr_types*: ptr array [0..100_000, cint]
-    num_matches*: cint
-    values_pool*: pointer
-    total*: cint
-    total_found*: cint
-    time_msec*: cint
-    num_words*: cint
-    words*: ptr array [0..100_000, Wordinfo]
-
-  Excerpt_options*{.pure, final.} = object
-    before_match*: cstring
-    after_match*: cstring
-    chunk_separator*: cstring
-    html_strip_mode*: cstring
-    passage_boundary*: cstring
-    limit*: cint
-    limit_passages*: cint
-    limit_words*: cint
-    around*: cint
-    start_passage_id*: cint
-    exact_phrase*: SphinxBool
-    single_passage*: SphinxBool
-    use_boundaries*: SphinxBool
-    weight_order*: SphinxBool
-    query_mode*: SphinxBool
-    force_all_words*: SphinxBool
-    load_files*: SphinxBool
-    allow_empty*: SphinxBool
-    emit_zones*: SphinxBool
-
-  Keyword_info*{.pure, final.} = object
-    tokenized*: cstring
-    normalized*: cstring
-    num_docs*: cint
-    num_hits*: cint
-{.deprecated: [TSphinxBool: SphinxBool,
-              Tclient: Client, Twordinfo: Wordinfo, Tresult: Result,
-              Texcerpt_options: Excerpt_options, Tkeyword_info: Keyword_info].}
-
-proc create*(copy_args: SphinxBool): PClient{.cdecl, importc: "sphinx_create",
-    dynlib: sphinxDll.}
-proc cleanup*(client: PClient){.cdecl, importc: "sphinx_cleanup",
-                                    dynlib: sphinxDll.}
-proc destroy*(client: PClient){.cdecl, importc: "sphinx_destroy",
-                                    dynlib: sphinxDll.}
-proc error*(client: PClient): cstring{.cdecl, importc: "sphinx_error",
-    dynlib: sphinxDll.}
-proc warning*(client: PClient): cstring{.cdecl, importc: "sphinx_warning",
-    dynlib: sphinxDll.}
-proc set_server*(client: PClient, host: cstring, port: cint): SphinxBool{.cdecl,
-    importc: "sphinx_set_server", dynlib: sphinxDll.}
-proc set_connect_timeout*(client: PClient, seconds: float32): SphinxBool{.cdecl,
-    importc: "sphinx_set_connect_timeout", dynlib: sphinxDll.}
-proc open*(client: PClient): SphinxBool{.cdecl, importc: "sphinx_open",
-                                        dynlib: sphinxDll.}
-proc close*(client: PClient): SphinxBool{.cdecl, importc: "sphinx_close",
-    dynlib: sphinxDll.}
-proc set_limits*(client: PClient, offset: cint, limit: cint,
-                 max_matches: cint, cutoff: cint): SphinxBool{.cdecl,
-    importc: "sphinx_set_limits", dynlib: sphinxDll.}
-proc set_max_query_time*(client: PClient, max_query_time: cint): SphinxBool{.
-    cdecl, importc: "sphinx_set_max_query_time", dynlib: sphinxDll.}
-proc set_match_mode*(client: PClient, mode: cint): SphinxBool{.cdecl,
-    importc: "sphinx_set_match_mode", dynlib: sphinxDll.}
-proc set_ranking_mode*(client: PClient, ranker: cint): SphinxBool{.cdecl,
-    importc: "sphinx_set_ranking_mode", dynlib: sphinxDll.}
-proc set_sort_mode*(client: PClient, mode: cint, sortby: cstring): SphinxBool{.
-    cdecl, importc: "sphinx_set_sort_mode", dynlib: sphinxDll.}
-proc set_field_weights*(client: PClient, num_weights: cint,
-                        field_names: cstringArray, field_weights: ptr cint): SphinxBool{.
-    cdecl, importc: "sphinx_set_field_weights", dynlib: sphinxDll.}
-proc set_index_weights*(client: PClient, num_weights: cint,
-                        index_names: cstringArray, index_weights: ptr cint): SphinxBool{.
-    cdecl, importc: "sphinx_set_index_weights", dynlib: sphinxDll.}
-proc set_id_range*(client: PClient, minid: int64, maxid: int64): SphinxBool{.
-    cdecl, importc: "sphinx_set_id_range", dynlib: sphinxDll.}
-proc add_filter*(client: PClient, attr: cstring, num_values: cint,
-                 values: ptr int64, exclude: SphinxBool): SphinxBool{.cdecl,
-    importc: "sphinx_add_filter", dynlib: sphinxDll.}
-proc add_filter_range*(client: PClient, attr: cstring, umin: int64,
-                       umax: int64, exclude: SphinxBool): SphinxBool{.cdecl,
-    importc: "sphinx_add_filter_range", dynlib: sphinxDll.}
-proc add_filter_float_range*(client: PClient, attr: cstring, fmin: float32,
-                             fmax: float32, exclude: SphinxBool): SphinxBool{.cdecl,
-    importc: "sphinx_add_filter_float_range", dynlib: sphinxDll.}
-proc set_geoanchor*(client: PClient, attr_latitude: cstring,
-                    attr_longitude: cstring, latitude: float32, longitude: float32): SphinxBool{.
-    cdecl, importc: "sphinx_set_geoanchor", dynlib: sphinxDll.}
-proc set_groupby*(client: PClient, attr: cstring, groupby_func: cint,
-                  group_sort: cstring): SphinxBool{.cdecl,
-    importc: "sphinx_set_groupby", dynlib: sphinxDll.}
-proc set_groupby_distinct*(client: PClient, attr: cstring): SphinxBool{.cdecl,
-    importc: "sphinx_set_groupby_distinct", dynlib: sphinxDll.}
-proc set_retries*(client: PClient, count: cint, delay: cint): SphinxBool{.cdecl,
-    importc: "sphinx_set_retries", dynlib: sphinxDll.}
-proc add_override*(client: PClient, attr: cstring, docids: ptr int64,
-                   num_values: cint, values: ptr cint): SphinxBool{.cdecl,
-    importc: "sphinx_add_override", dynlib: sphinxDll.}
-proc set_select*(client: PClient, select_list: cstring): SphinxBool{.cdecl,
-    importc: "sphinx_set_select", dynlib: sphinxDll.}
-proc reset_filters*(client: PClient){.cdecl,
-    importc: "sphinx_reset_filters", dynlib: sphinxDll.}
-proc reset_groupby*(client: PClient){.cdecl,
-    importc: "sphinx_reset_groupby", dynlib: sphinxDll.}
-proc query*(client: PClient, query: cstring, index_list: cstring,
-            comment: cstring): ptr Result{.cdecl, importc: "sphinx_query",
-    dynlib: sphinxDll.}
-proc add_query*(client: PClient, query: cstring, index_list: cstring,
-                comment: cstring): cint{.cdecl, importc: "sphinx_add_query",
-    dynlib: sphinxDll.}
-proc run_queries*(client: PClient): ptr Result{.cdecl,
-    importc: "sphinx_run_queries", dynlib: sphinxDll.}
-proc get_num_results*(client: PClient): cint{.cdecl,
-    importc: "sphinx_get_num_results", dynlib: sphinxDll.}
-proc get_id*(result: ptr Result, match: cint): int64{.cdecl,
-    importc: "sphinx_get_id", dynlib: sphinxDll.}
-proc get_weight*(result: ptr Result, match: cint): cint{.cdecl,
-    importc: "sphinx_get_weight", dynlib: sphinxDll.}
-proc get_int*(result: ptr Result, match: cint, attr: cint): int64{.cdecl,
-    importc: "sphinx_get_int", dynlib: sphinxDll.}
-proc get_float*(result: ptr Result, match: cint, attr: cint): float32{.cdecl,
-    importc: "sphinx_get_float", dynlib: sphinxDll.}
-proc get_mva*(result: ptr Result, match: cint, attr: cint): ptr cint{.
-    cdecl, importc: "sphinx_get_mva", dynlib: sphinxDll.}
-proc get_string*(result: ptr Result, match: cint, attr: cint): cstring{.cdecl,
-    importc: "sphinx_get_string", dynlib: sphinxDll.}
-proc init_excerpt_options*(opts: ptr Excerpt_options){.cdecl,
-    importc: "sphinx_init_excerpt_options", dynlib: sphinxDll.}
-proc build_excerpts*(client: PClient, num_docs: cint, docs: cstringArray,
-                     index: cstring, words: cstring, opts: ptr Excerpt_options): cstringArray{.
-    cdecl, importc: "sphinx_build_excerpts", dynlib: sphinxDll.}
-proc update_attributes*(client: PClient, index: cstring, num_attrs: cint,
-                        attrs: cstringArray, num_docs: cint,
-                        docids: ptr int64, values: ptr int64): cint{.
-    cdecl, importc: "sphinx_update_attributes", dynlib: sphinxDll.}
-proc update_attributes_mva*(client: PClient, index: cstring, attr: cstring,
-                            docid: int64, num_values: cint,
-                            values: ptr cint): cint{.cdecl,
-    importc: "sphinx_update_attributes_mva", dynlib: sphinxDll.}
-proc build_keywords*(client: PClient, query: cstring, index: cstring,
-                     hits: SphinxBool, out_num_keywords: ptr cint): ptr Keyword_info{.
-    cdecl, importc: "sphinx_build_keywords", dynlib: sphinxDll.}
-proc status*(client: PClient, num_rows: ptr cint, num_cols: ptr cint): cstringArray{.
-    cdecl, importc: "sphinx_status", dynlib: sphinxDll.}
-proc status_destroy*(status: cstringArray, num_rows: cint, num_cols: cint){.
-    cdecl, importc: "sphinx_status_destroy", dynlib: sphinxDll.}
diff --git a/lib/wrappers/tre.nim b/lib/wrappers/tre.nim
deleted file mode 100644
index 36bf3cb69..000000000
--- a/lib/wrappers/tre.nim
+++ /dev/null
@@ -1,188 +0,0 @@
-#
-#  tre.h - TRE public API definitions
-#
-#  This software is released under a BSD-style license.
-#  See the file LICENSE for details and copyright.
-#
-#
-
-when not defined(treDll):
-  when hostOS == "windows":
-    const treDll = "tre.dll"
-  elif hostOS == "macosx":
-    const treDll = "libtre.dylib"
-  else:
-    const treDll = "libtre.so(.5|)"
-
-const 
-  APPROX* = 1 ## approximate matching functionality
-  MULTIBYTE* = 1 ## multibyte character set support. 
-  VERSION* = "0.8.0" ## TRE version string. 
-  VERSION_1* = 0 ## TRE version level 1. 
-  VERSION_2* = 8 ## TRE version level 2. 
-  VERSION_3* = 0 ## TRE version level 3. 
-
-
-# If the we're not using system regex.h, we need to define the
-#   structs and enums ourselves. 
-
-type 
-  Regoff* = cint
-  Regex*{.pure, final.} = object 
-    re_nsub*: int          ## Number of parenthesized subexpressions. 
-    value*: pointer        ## For internal use only. 
-  
-  Regmatch*{.pure, final.} = object 
-    rm_so*: Regoff
-    rm_eo*: Regoff
-
-  Reg_errcode*{.size: 4.} = enum  ## POSIX tre_regcomp() return error codes. 
-                                   ## (In the order listed in the standard.)	 
-    REG_OK = 0,               ## No error. 
-    REG_NOMATCH,              ## No match. 
-    REG_BADPAT,               ## Invalid regexp. 
-    REG_ECOLLATE,             ## Unknown collating element. 
-    REG_ECTYPE,               ## Unknown character class name. 
-    REG_EESCAPE,              ## Trailing backslash. 
-    REG_ESUBREG,              ## Invalid back reference. 
-    REG_EBRACK,               ## "[]" imbalance 
-    REG_EPAREN,               ## "\(\)" or "()" imbalance 
-    REG_EBRACE,               ## "\{\}" or "{}" imbalance 
-    REG_BADBR,                ## Invalid content of {} 
-    REG_ERANGE,               ## Invalid use of range operator 
-    REG_ESPACE,               ## Out of memory.  
-    REG_BADRPT                ## Invalid use of repetition operators. 
-{.deprecated: [TRegoff: Regoff, TRegex: Regex, TRegmatch: Regmatch,
-              TReg_errcode: Reg_errcode].}
-
-# POSIX tre_regcomp() flags. 
-
-const 
-  REG_EXTENDED* = 1
-  REG_ICASE* = (REG_EXTENDED shl 1)
-  REG_NEWLINE* = (REG_ICASE shl 1)
-  REG_NOSUB* = (REG_NEWLINE shl 1)
-
-# Extra tre_regcomp() flags. 
-
-const 
-  REG_BASIC* = 0
-  REG_LITERAL* = (REG_NOSUB shl 1)
-  REG_RIGHT_ASSOC* = (REG_LITERAL shl 1)
-  REG_UNGREEDY* = (REG_RIGHT_ASSOC shl 1)
-
-# POSIX tre_regexec() flags. 
-
-const 
-  REG_NOTBOL* = 1
-  REG_NOTEOL* = (REG_NOTBOL shl 1)
-
-# Extra tre_regexec() flags. 
-
-const 
-  REG_APPROX_MATCHER* = (REG_NOTEOL shl 1)
-  REG_BACKTRACKING_MATCHER* = (REG_APPROX_MATCHER shl 1)
-
-# The maximum number of iterations in a bound expression. 
-
-const 
-  RE_DUP_MAX* = 255
-
-# The POSIX.2 regexp functions 
-
-proc regcomp*(preg: var Regex, regex: cstring, cflags: cint): cint{.cdecl, 
-    importc: "tre_regcomp", dynlib: treDll.}
-proc regexec*(preg: var Regex, string: cstring, nmatch: int, 
-              pmatch: ptr Regmatch, eflags: cint): cint{.cdecl, 
-    importc: "tre_regexec", dynlib: treDll.}
-proc regerror*(errcode: cint, preg: var Regex, errbuf: cstring, 
-               errbuf_size: int): int{.cdecl, importc: "tre_regerror", 
-    dynlib: treDll.}
-proc regfree*(preg: var Regex){.cdecl, importc: "tre_regfree", dynlib: treDll.}
-# Versions with a maximum length argument and therefore the capability to
-#   handle null characters in the middle of the strings (not in POSIX.2). 
-
-proc regncomp*(preg: var Regex, regex: cstring, len: int, cflags: cint): cint{.
-    cdecl, importc: "tre_regncomp", dynlib: treDll.}
-proc regnexec*(preg: var Regex, string: cstring, len: int, nmatch: int, 
-               pmatch: ptr Regmatch, eflags: cint): cint{.cdecl, 
-    importc: "tre_regnexec", dynlib: treDll.}
-# Approximate matching parameter struct. 
-
-type 
-  TRegaparams*{.pure, final.} = object 
-    cost_ins*: cint           ## Default cost of an inserted character. 
-    cost_del*: cint           ## Default cost of a deleted character. 
-    cost_subst*: cint         ## Default cost of a substituted character. 
-    max_cost*: cint           ## Maximum allowed cost of a match. 
-    max_ins*: cint            ## Maximum allowed number of inserts. 
-    max_del*: cint            ## Maximum allowed number of deletes. 
-    max_subst*: cint          ## Maximum allowed number of substitutes. 
-    max_err*: cint            ## Maximum allowed number of errors total. 
-  
-
-# Approximate matching result struct. 
-
-type 
-  TRegamatch*{.pure, final.} = object 
-    nmatch*: int              ## Length of pmatch[] array. 
-    pmatch*: ptr Regmatch     ## Submatch data. 
-    cost*: cint               ## Cost of the match. 
-    num_ins*: cint            ## Number of inserts in the match. 
-    num_del*: cint            ## Number of deletes in the match. 
-    num_subst*: cint          ## Number of substitutes in the match. 
-  
-
-# Approximate matching functions. 
-
-proc regaexec*(preg: var Regex, string: cstring, match: ptr TRegamatch, 
-               params: TRegaparams, eflags: cint): cint{.cdecl, 
-    importc: "tre_regaexec", dynlib: treDll.}
-proc reganexec*(preg: var Regex, string: cstring, len: int, 
-                match: ptr TRegamatch, params: TRegaparams, 
-                eflags: cint): cint{.
-    cdecl, importc: "tre_reganexec", dynlib: treDll.}
-# Sets the parameters to default values. 
-
-proc regaparams_default*(params: ptr TRegaparams){.cdecl, 
-    importc: "tre_regaparams_default", dynlib: treDll.}
-
-type 
-  TStrSource*{.pure, final.} = object 
-    get_next_char*: proc (c: cstring, pos_add: ptr cint, 
-                          context: pointer): cint{.cdecl.}
-    rewind*: proc (pos: int, context: pointer){.cdecl.}
-    compare*: proc (pos1: int, pos2: int, len: int, context: pointer): cint{.
-        cdecl.}
-    context*: pointer
-
-
-proc reguexec*(preg: var Regex, string: ptr TStrSource, nmatch: int, 
-               pmatch: ptr Regmatch, eflags: cint): cint{.cdecl, 
-    importc: "tre_reguexec", dynlib: treDll.}
-
-proc runtimeVersion*(): cstring{.cdecl, importc: "tre_version", dynlib: treDll.}
-  # Returns the version string.	The returned string is static. 
-
-proc config*(query: cint, result: pointer): cint{.cdecl, importc: "tre_config", 
-    dynlib: treDll.}
-  # Returns the value for a config parameter.  The type to which `result`
-  # must point to depends of the value of `query`, see documentation for
-  # more details. 
-
-const 
-  CONFIG_APPROX* = 0
-  CONFIG_WCHAR* = 1
-  CONFIG_MULTIBYTE* = 2
-  CONFIG_SYSTEM_ABI* = 3
-  CONFIG_VERSION* = 4
-
-# Returns 1 if the compiled pattern has back references, 0 if not. 
-
-proc have_backrefs*(preg: var Regex): cint{.cdecl, 
-    importc: "tre_have_backrefs", dynlib: treDll.}
-# Returns 1 if the compiled pattern uses approximate matching features,
-#   0 if not. 
-
-proc have_approx*(preg: var Regex): cint{.cdecl, importc: "tre_have_approx", 
-    dynlib: treDll.}
diff --git a/lib/wrappers/zip/libzip.nim b/lib/wrappers/zip/libzip.nim
deleted file mode 100644
index 076965d46..000000000
--- a/lib/wrappers/zip/libzip.nim
+++ /dev/null
@@ -1,251 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2013 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-## Interface to the `libzip <http://www.nih.at/libzip/index.html>`_ library by
-## Dieter Baron and Thomas Klausner. This version links
-## against ``libzip2.so.2`` unless you define the symbol ``useLibzipSrc``; then
-## it is compiled against some old ``libizp_all.c`` file.
-
-#
-#  zip.h -- exported declarations.
-#  Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner
-#
-#  This file is part of libzip, a library to manipulate ZIP archives.
-#  The authors can be contacted at <libzip@nih.at>
-#
-#  Redistribution and use in source and binary forms, with or without
-#  modification, are permitted provided that the following conditions
-#  are met:
-#  1. Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-#  2. Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in
-#     the documentation and/or other materials provided with the
-#     distribution.
-#  3. The names of the authors may not be used to endorse or promote
-#     products derived from this software without specific prior
-#     written permission.
-# 
-#  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
-#  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-#  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-#  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-#  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-import times
-
-when defined(unix) and not defined(useLibzipSrc):
-  when defined(macosx):
-    {.pragma: mydll, dynlib: "libzip2.dylib".}
-  else:
-    {.pragma: mydll, dynlib: "libzip(|2).so(|.2|.1|.0)".}
-else:
-  when defined(unix):
-    {.passl: "-lz".}
-  {.compile: "libzip_all.c".}
-  {.pragma: mydll.}
-
-type 
-  ZipSourceCmd* = int32
-
-  ZipSourceCallback* = proc (state: pointer, data: pointer, length: int, 
-                              cmd: ZipSourceCmd): int {.cdecl.}
-  PZipStat* = ptr ZipStat
-  ZipStat* = object           ## the 'zip_stat' struct
-    name*: cstring            ## name of the file  
-    index*: int32             ## index within archive  
-    crc*: int32               ## crc of file data  
-    mtime*: Time              ## modification time  
-    size*: int                ## size of file (uncompressed)  
-    compSize*: int            ## size of file (compressed)  
-    compMethod*: int16        ## compression method used  
-    encryptionMethod*: int16  ## encryption method used  
-  
-  Zip = object
-  ZipSource = object 
-  ZipFile = object
-
-  PZip* = ptr Zip ## represents a zip archive
-  PZipFile* = ptr ZipFile ## represents a file within an archive
-  PZipSource* = ptr ZipSource ## represents a source for an archive
-{.deprecated: [TZipSourceCmd: ZipSourceCmd, TZipStat: ZipStat, TZip: Zip,
-              TZipSourceCallback: ZipSourceCallback, TZipSource: ZipSource,
-              TZipFile: ZipFile].}
-
-# flags for zip_name_locate, zip_fopen, zip_stat, ...  
-const 
-  ZIP_CREATE* = 1'i32
-  ZIP_EXCL* = 2'i32
-  ZIP_CHECKCONS* = 4'i32 
-  ZIP_FL_NOCASE* = 1'i32        ## ignore case on name lookup  
-  ZIP_FL_NODIR* = 2'i32         ## ignore directory component  
-  ZIP_FL_COMPRESSED* = 4'i32    ## read compressed data  
-  ZIP_FL_UNCHANGED* = 8'i32     ## use original data, ignoring changes  
-  ZIP_FL_RECOMPRESS* = 16'i32   ## force recompression of data  
-
-const  # archive global flags flags  
-  ZIP_AFL_TORRENT* = 1'i32      ##  torrent zipped  
-
-const # libzip error codes  
-  ZIP_ER_OK* = 0'i32            ## N No error  
-  ZIP_ER_MULTIDISK* = 1'i32     ## N Multi-disk zip archives not supported  
-  ZIP_ER_RENAME* = 2'i32        ## S Renaming temporary file failed  
-  ZIP_ER_CLOSE* = 3'i32         ## S Closing zip archive failed  
-  ZIP_ER_SEEK* = 4'i32          ## S Seek error  
-  ZIP_ER_READ* = 5'i32          ## S Read error  
-  ZIP_ER_WRITE* = 6'i32         ## S Write error  
-  ZIP_ER_CRC* = 7'i32           ## N CRC error  
-  ZIP_ER_ZIPCLOSED* = 8'i32     ## N Containing zip archive was closed  
-  ZIP_ER_NOENT* = 9'i32         ## N No such file  
-  ZIP_ER_EXISTS* = 10'i32       ## N File already exists  
-  ZIP_ER_OPEN* = 11'i32         ## S Can't open file  
-  ZIP_ER_TMPOPEN* = 12'i32      ## S Failure to create temporary file  
-  ZIP_ER_ZLIB* = 13'i32         ## Z Zlib error  
-  ZIP_ER_MEMORY* = 14'i32       ## N Malloc failure  
-  ZIP_ER_CHANGED* = 15'i32      ## N Entry has been changed  
-  ZIP_ER_COMPNOTSUPP* = 16'i32  ## N Compression method not supported  
-  ZIP_ER_EOF* = 17'i32          ## N Premature EOF  
-  ZIP_ER_INVAL* = 18'i32        ## N Invalid argument  
-  ZIP_ER_NOZIP* = 19'i32        ## N Not a zip archive  
-  ZIP_ER_INTERNAL* = 20'i32     ## N Internal error  
-  ZIP_ER_INCONS* = 21'i32       ## N Zip archive inconsistent  
-  ZIP_ER_REMOVE* = 22'i32       ## S Can't remove file  
-  ZIP_ER_DELETED* = 23'i32      ## N Entry has been deleted  
-   
-const # type of system error value  
-  ZIP_ET_NONE* = 0'i32          ## sys_err unused  
-  ZIP_ET_SYS* = 1'i32           ## sys_err is errno  
-  ZIP_ET_ZLIB* = 2'i32          ## sys_err is zlib error code  
-
-const # compression methods  
-  ZIP_CM_DEFAULT* = -1'i32      ## better of deflate or store  
-  ZIP_CM_STORE* = 0'i32         ## stored (uncompressed)  
-  ZIP_CM_SHRINK* = 1'i32        ## shrunk  
-  ZIP_CM_REDUCE_1* = 2'i32      ## reduced with factor 1  
-  ZIP_CM_REDUCE_2* = 3'i32      ## reduced with factor 2  
-  ZIP_CM_REDUCE_3* = 4'i32      ## reduced with factor 3  
-  ZIP_CM_REDUCE_4* = 5'i32      ## reduced with factor 4  
-  ZIP_CM_IMPLODE* = 6'i32       ## imploded  
-                                ## 7 - Reserved for Tokenizing compression algorithm  
-  ZIP_CM_DEFLATE* = 8'i32       ## deflated  
-  ZIP_CM_DEFLATE64* = 9'i32     ## deflate64  
-  ZIP_CM_PKWARE_IMPLODE* = 10'i32 ## PKWARE imploding  
-                                  ## 11 - Reserved by PKWARE  
-  ZIP_CM_BZIP2* = 12'i32        ## compressed using BZIP2 algorithm  
-                                ## 13 - Reserved by PKWARE  
-  ZIP_CM_LZMA* = 14'i32         ## LZMA (EFS)  
-                                ## 15-17 - Reserved by PKWARE  
-  ZIP_CM_TERSE* = 18'i32        ## compressed using IBM TERSE (new)  
-  ZIP_CM_LZ77* = 19'i32         ## IBM LZ77 z Architecture (PFS)  
-  ZIP_CM_WAVPACK* = 97'i32      ## WavPack compressed data  
-  ZIP_CM_PPMD* = 98'i32         ## PPMd version I, Rev 1  
-
-const  # encryption methods                              
-  ZIP_EM_NONE* = 0'i32            ## not encrypted  
-  ZIP_EM_TRAD_PKWARE* = 1'i32     ## traditional PKWARE encryption 
-
-const 
-  ZIP_EM_UNKNOWN* = 0x0000FFFF'i32 ## unknown algorithm  
-
-const 
-  ZIP_SOURCE_OPEN* = 0'i32        ## prepare for reading  
-  ZIP_SOURCE_READ* = 1'i32        ## read data  
-  ZIP_SOURCE_CLOSE* = 2'i32       ## reading is done  
-  ZIP_SOURCE_STAT* = 3'i32        ## get meta information  
-  ZIP_SOURCE_ERROR* = 4'i32       ## get error information  
-  constZIP_SOURCE_FREE* = 5'i32   ## cleanup and free resources  
-
-proc zip_add*(para1: PZip, para2: cstring, para3: PZipSource): int32 {.cdecl, 
-    importc: "zip_add", mydll.}
-proc zip_add_dir*(para1: PZip, para2: cstring): int32 {.cdecl,  
-    importc: "zip_add_dir", mydll.}
-proc zip_close*(para1: PZip) {.cdecl, importc: "zip_close", mydll.}
-proc zip_delete*(para1: PZip, para2: int32): int32 {.cdecl, mydll,
-    importc: "zip_delete".}
-proc zip_error_clear*(para1: PZip) {.cdecl, importc: "zip_error_clear", mydll.}
-proc zip_error_get*(para1: PZip, para2: ptr int32, para3: ptr int32) {.cdecl, 
-    importc: "zip_error_get", mydll.}
-proc zip_error_get_sys_type*(para1: int32): int32 {.cdecl, mydll,
-    importc: "zip_error_get_sys_type".}
-proc zip_error_to_str*(para1: cstring, para2: int, para3: int32, 
-                       para4: int32): int32 {.cdecl, mydll,
-    importc: "zip_error_to_str".}
-proc zip_fclose*(para1: PZipFile) {.cdecl, mydll,
-    importc: "zip_fclose".}
-proc zip_file_error_clear*(para1: PZipFile) {.cdecl, mydll,
-    importc: "zip_file_error_clear".}
-proc zip_file_error_get*(para1: PZipFile, para2: ptr int32, para3: ptr int32) {.
-    cdecl, mydll, importc: "zip_file_error_get".}
-proc zip_file_strerror*(para1: PZipFile): cstring {.cdecl, mydll,
-    importc: "zip_file_strerror".}
-proc zip_fopen*(para1: PZip, para2: cstring, para3: int32): PZipFile {.cdecl, 
-    mydll, importc: "zip_fopen".}
-proc zip_fopen_index*(para1: PZip, para2: int32, para3: int32): PZipFile {.
-    cdecl, mydll, importc: "zip_fopen_index".}
-proc zip_fread*(para1: PZipFile, para2: pointer, para3: int): int {.
-    cdecl, mydll, importc: "zip_fread".}
-proc zip_get_archive_comment*(para1: PZip, para2: ptr int32, para3: int32): cstring {.
-    cdecl, mydll, importc: "zip_get_archive_comment".}
-proc zip_get_archive_flag*(para1: PZip, para2: int32, para3: int32): int32 {.
-    cdecl, mydll, importc: "zip_get_archive_flag".}
-proc zip_get_file_comment*(para1: PZip, para2: int32, para3: ptr int32, 
-                           para4: int32): cstring {.cdecl, mydll,
-    importc: "zip_get_file_comment".}
-proc zip_get_name*(para1: PZip, para2: int32, para3: int32): cstring {.cdecl, 
-    mydll, importc: "zip_get_name".}
-proc zip_get_num_files*(para1: PZip): int32 {.cdecl,
-    mydll, importc: "zip_get_num_files".}
-proc zip_name_locate*(para1: PZip, para2: cstring, para3: int32): int32 {.cdecl, 
-    mydll, importc: "zip_name_locate".}
-proc zip_open*(para1: cstring, para2: int32, para3: ptr int32): PZip {.cdecl, 
-    mydll, importc: "zip_open".}
-proc zip_rename*(para1: PZip, para2: int32, para3: cstring): int32 {.cdecl, 
-    mydll, importc: "zip_rename".}
-proc zip_replace*(para1: PZip, para2: int32, para3: PZipSource): int32 {.cdecl, 
-    mydll, importc: "zip_replace".}
-proc zip_set_archive_comment*(para1: PZip, para2: cstring, para3: int32): int32 {.
-    cdecl, mydll, importc: "zip_set_archive_comment".}
-proc zip_set_archive_flag*(para1: PZip, para2: int32, para3: int32): int32 {.
-    cdecl, mydll, importc: "zip_set_archive_flag".}
-proc zip_set_file_comment*(para1: PZip, para2: int32, para3: cstring, 
-                           para4: int32): int32 {.cdecl, mydll,
-    importc: "zip_set_file_comment".}
-proc zip_source_buffer*(para1: PZip, para2: pointer, para3: int, para4: int32): PZipSource {.
-    cdecl, mydll, importc: "zip_source_buffer".}
-proc zip_source_file*(para1: PZip, para2: cstring, para3: int, para4: int): PZipSource {.
-    cdecl, mydll, importc: "zip_source_file".}
-proc zip_source_filep*(para1: PZip, para2: File, para3: int, para4: int): PZipSource {.
-    cdecl, mydll, importc: "zip_source_filep".}
-proc zip_source_free*(para1: PZipSource) {.cdecl, mydll,
-    importc: "zip_source_free".}
-proc zip_source_function*(para1: PZip, para2: ZipSourceCallback, 
-                          para3: pointer): PZipSource {.cdecl, mydll,
-    importc: "zip_source_function".}
-proc zip_source_zip*(para1: PZip, para2: PZip, para3: int32, para4: int32, 
-                     para5: int, para6: int): PZipSource {.cdecl, mydll,
-    importc: "zip_source_zip".}
-proc zip_stat*(para1: PZip, para2: cstring, para3: int32, para4: PZipStat): int32 {.
-    cdecl, mydll, importc: "zip_stat".}
-proc zip_stat_index*(para1: PZip, para2: int32, para3: int32, para4: PZipStat): int32 {.
-    cdecl, mydll, importc: "zip_stat_index".}
-proc zip_stat_init*(para1: PZipStat) {.cdecl, mydll, importc: "zip_stat_init".}
-proc zip_strerror*(para1: PZip): cstring {.cdecl, mydll, importc: "zip_strerror".}
-proc zip_unchange*(para1: PZip, para2: int32): int32 {.cdecl, mydll,
-    importc: "zip_unchange".}
-proc zip_unchange_all*(para1: PZip): int32 {.cdecl, mydll,
-    importc: "zip_unchange_all".}
-proc zip_unchange_archive*(para1: PZip): int32 {.cdecl, mydll,
-    importc: "zip_unchange_archive".}
diff --git a/lib/wrappers/zip/libzip_all.c b/lib/wrappers/zip/libzip_all.c
deleted file mode 100644
index 797374b29..000000000
--- a/lib/wrappers/zip/libzip_all.c
+++ /dev/null
@@ -1,4189 +0,0 @@
-/*
-  zipint.h -- internal declarations.
-  Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner
-
-  This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-  3. The names of the authors may not be used to endorse or promote
-     products derived from this software without specific prior
-     written permission.
- 
-  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
-  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <zlib.h>
-
-/*
-#ifdef _MSC_VER
-#define ZIP_EXTERN __declspec(dllimport)
-#endif
-*/
-
-/*
-  zip.h -- exported declarations.
-  Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner
-
-  This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-  3. The names of the authors may not be used to endorse or promote
-     products derived from this software without specific prior
-     written permission.
- 
-  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
-  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
-  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#ifndef ZIP_EXTERN
-#define ZIP_EXTERN
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <time.h>
-
-/* flags for zip_open */
-
-#define ZIP_CREATE           1
-#define ZIP_EXCL             2
-#define ZIP_CHECKCONS        4
-
-
-/* flags for zip_name_locate, zip_fopen, zip_stat, ... */
-
-#define ZIP_FL_NOCASE                1 /* ignore case on name lookup */
-#define ZIP_FL_NODIR                2 /* ignore directory component */
-#define ZIP_FL_COMPRESSED        4 /* read compressed data */
-#define ZIP_FL_UNCHANGED        8 /* use original data, ignoring changes */
-#define ZIP_FL_RECOMPRESS      16 /* force recompression of data */
-
-/* archive global flags flags */
-
-#define ZIP_AFL_TORRENT                1 /* torrent zipped */
-
-/* libzip error codes */
-
-#define ZIP_ER_OK             0  /* N No error */
-#define ZIP_ER_MULTIDISK      1  /* N Multi-disk zip archives not supported */
-#define ZIP_ER_RENAME         2  /* S Renaming temporary file failed */
-#define ZIP_ER_CLOSE          3  /* S Closing zip archive failed */
-#define ZIP_ER_SEEK           4  /* S Seek error */
-#define ZIP_ER_READ           5  /* S Read error */
-#define ZIP_ER_WRITE          6  /* S Write error */
-#define ZIP_ER_CRC            7  /* N CRC error */
-#define ZIP_ER_ZIPCLOSED      8  /* N Containing zip archive was closed */
-#define ZIP_ER_NOENT          9  /* N No such file */
-#define ZIP_ER_EXISTS        10  /* N File already exists */
-#define ZIP_ER_OPEN          11  /* S Can't open file */
-#define ZIP_ER_TMPOPEN       12  /* S Failure to create temporary file */
-#define ZIP_ER_ZLIB          13  /* Z Zlib error */
-#define ZIP_ER_MEMORY        14  /* N Malloc failure */
-#define ZIP_ER_CHANGED       15  /* N Entry has been changed */
-#define ZIP_ER_COMPNOTSUPP   16  /* N Compression method not supported */
-#define ZIP_ER_EOF           17  /* N Premature EOF */
-#define ZIP_ER_INVAL         18  /* N Invalid argument */
-#define ZIP_ER_NOZIP         19  /* N Not a zip archive */
-#define ZIP_ER_INTERNAL      20  /* N Internal error */
-#define ZIP_ER_INCONS        21  /* N Zip archive inconsistent */
-#define ZIP_ER_REMOVE        22  /* S Can't remove file */
-#define ZIP_ER_DELETED       23  /* N Entry has been deleted */
-
-
-/* type of system error value */
-
-#define ZIP_ET_NONE              0  /* sys_err unused */
-#define ZIP_ET_SYS              1  /* sys_err is errno */
-#define ZIP_ET_ZLIB              2  /* sys_err is zlib error code */
-
-/* compression methods */
-
-#define ZIP_CM_DEFAULT              -1  /* better of deflate or store */
-#define ZIP_CM_STORE               0  /* stored (uncompressed) */
-#define ZIP_CM_SHRINK               1  /* shrunk */
-#define ZIP_CM_REDUCE_1               2  /* reduced with factor 1 */
-#define ZIP_CM_REDUCE_2               3  /* reduced with factor 2 */
-#define ZIP_CM_REDUCE_3               4  /* reduced with factor 3 */
-#define ZIP_CM_REDUCE_4               5  /* reduced with factor 4 */
-#define ZIP_CM_IMPLODE               6  /* imploded */
-/* 7 - Reserved for Tokenizing compression algorithm */
-#define ZIP_CM_DEFLATE               8  /* deflated */
-#define ZIP_CM_DEFLATE64       9  /* deflate64 */
-#define ZIP_CM_PKWARE_IMPLODE 10  /* PKWARE imploding */
-/* 11 - Reserved by PKWARE */
-#define ZIP_CM_BZIP2          12  /* compressed using BZIP2 algorithm */
-/* 13 - Reserved by PKWARE */
-#define ZIP_CM_LZMA              14  /* LZMA (EFS) */
-/* 15-17 - Reserved by PKWARE */
-#define ZIP_CM_TERSE              18  /* compressed using IBM TERSE (new) */
-#define ZIP_CM_LZ77           19  /* IBM LZ77 z Architecture (PFS) */
-#define ZIP_CM_WAVPACK              97  /* WavPack compressed data */
-#define ZIP_CM_PPMD              98  /* PPMd version I, Rev 1 */
-
-/* encryption methods */
-
-#define ZIP_EM_NONE               0  /* not encrypted */
-#define ZIP_EM_TRAD_PKWARE     1  /* traditional PKWARE encryption */
-#if 0 /* Strong Encryption Header not parsed yet */
-#define ZIP_EM_DES        0x6601  /* strong encryption: DES */
-#define ZIP_EM_RC2_OLD    0x6602  /* strong encryption: RC2, version < 5.2 */
-#define ZIP_EM_3DES_168   0x6603
-#define ZIP_EM_3DES_112   0x6609
-#define ZIP_EM_AES_128    0x660e
-#define ZIP_EM_AES_192    0x660f
-#define ZIP_EM_AES_256    0x6610
-#define ZIP_EM_RC2        0x6702  /* strong encryption: RC2, version >= 5.2 */
-#define ZIP_EM_RC4        0x6801
-#endif
-#define ZIP_EM_UNKNOWN    0xffff  /* unknown algorithm */
-
-typedef long myoff_t; /* XXX: 64 bit support */
-
-enum zip_source_cmd {
-    ZIP_SOURCE_OPEN,        /* prepare for reading */
-    ZIP_SOURCE_READ,         /* read data */
-    ZIP_SOURCE_CLOSE,        /* reading is done */
-    ZIP_SOURCE_STAT,        /* get meta information */
-    ZIP_SOURCE_ERROR,        /* get error information */
-    ZIP_SOURCE_FREE        /* cleanup and free resources */
-};
-
-typedef ssize_t (*zip_source_callback)(void *state, void *data,
-                                       size_t len, enum zip_source_cmd cmd);
-
-struct zip_stat {
-    const char *name;                        /* name of the file */
-    int index;                                /* index within archive */
-    unsigned int crc;                        /* crc of file data */
-    time_t mtime;                        /* modification time */
-    myoff_t size;                                /* size of file (uncompressed) */
-    myoff_t comp_size;                        /* size of file (compressed) */
-    unsigned short comp_method;                /* compression method used */
-    unsigned short encryption_method;        /* encryption method used */
-};
-
-struct zip;
-struct zip_file;
-struct zip_source;
-
-
-ZIP_EXTERN int zip_add(struct zip *, const char *, struct zip_source *);
-ZIP_EXTERN int zip_add_dir(struct zip *, const char *);
-ZIP_EXTERN int zip_close(struct zip *);
-ZIP_EXTERN int zip_delete(struct zip *, int);
-ZIP_EXTERN void zip_error_clear(struct zip *);
-ZIP_EXTERN void zip_error_get(struct zip *, int *, int *);
-ZIP_EXTERN int zip_error_get_sys_type(int);
-ZIP_EXTERN int zip_error_to_str(char *, size_t, int, int);
-ZIP_EXTERN int zip_fclose(struct zip_file *);
-ZIP_EXTERN void zip_file_error_clear(struct zip_file *);
-ZIP_EXTERN void zip_file_error_get(struct zip_file *, int *, int *);
-ZIP_EXTERN const char *zip_file_strerror(struct zip_file *);
-ZIP_EXTERN struct zip_file *zip_fopen(struct zip *, const char *, int);
-ZIP_EXTERN struct zip_file *zip_fopen_index(struct zip *, int, int);
-ZIP_EXTERN ssize_t zip_fread(struct zip_file *, void *, size_t);
-ZIP_EXTERN const char *zip_get_archive_comment(struct zip *, int *, int);
-ZIP_EXTERN int zip_get_archive_flag(struct zip *, int, int);
-ZIP_EXTERN const char *zip_get_file_comment(struct zip *, int, int *, int);
-ZIP_EXTERN const char *zip_get_name(struct zip *, int, int);
-ZIP_EXTERN int zip_get_num_files(struct zip *);
-ZIP_EXTERN int zip_name_locate(struct zip *, const char *, int);
-ZIP_EXTERN struct zip *zip_open(const char *, int, int *);
-ZIP_EXTERN int zip_rename(struct zip *, int, const char *);
-ZIP_EXTERN int zip_replace(struct zip *, int, struct zip_source *);
-ZIP_EXTERN int zip_set_archive_comment(struct zip *, const char *, int);
-ZIP_EXTERN int zip_set_archive_flag(struct zip *, int, int);
-ZIP_EXTERN int zip_set_file_comment(struct zip *, int, const char *, int);
-ZIP_EXTERN struct zip_source *zip_source_buffer(struct zip *, const void *,
-                                                myoff_t, int);
-ZIP_EXTERN struct zip_source *zip_source_file(struct zip *, const char *,
-                                              myoff_t, myoff_t);
-ZIP_EXTERN struct zip_source *zip_source_filep(struct zip *, FILE *,
-                                               myoff_t, myoff_t);
-ZIP_EXTERN void zip_source_free(struct zip_source *);
-ZIP_EXTERN struct zip_source *zip_source_function(struct zip *,
-                                                  zip_source_callback, void *);
-ZIP_EXTERN struct zip_source *zip_source_zip(struct zip *, struct zip *,
-                                             int, int, myoff_t, myoff_t);
-ZIP_EXTERN int zip_stat(struct zip *, const char *, int, struct zip_stat *);
-ZIP_EXTERN int zip_stat_index(struct zip *, int, int, struct zip_stat *);
-ZIP_EXTERN void zip_stat_init(struct zip_stat *);
-ZIP_EXTERN const char *zip_strerror(struct zip *);
-ZIP_EXTERN int zip_unchange(struct zip *, int);
-ZIP_EXTERN int zip_unchange_all(struct zip *);
-ZIP_EXTERN int zip_unchange_archive(struct zip *);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
-   */
-/* #undef HAVE_DECL_TZNAME */
-
-#define HAVE_CONFIG_H 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `fseeko' function. */
-#define HAVE_FSEEKO 1
-
-/* Define to 1 if you have the `ftello' function. */
-#define HAVE_FTELLO 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `z' library (-lz). */
-#define HAVE_LIBZ 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `mkstemp' function. */
-#define HAVE_MKSTEMP 1
-
-/* Define to 1 if you have the `MoveFileExA' function. */
-/* #undef HAVE_MOVEFILEEXA */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if `tm_zone' is member of `struct tm'. */
-#define HAVE_STRUCT_TM_TM_ZONE 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
-   `HAVE_STRUCT_TM_TM_ZONE' instead. */
-#define HAVE_TM_ZONE 1
-
-/* Define to 1 if you don't have `tm_zone' but do have the external array
-   `tzname'. */
-/* #undef HAVE_TZNAME */
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
-/* Name of package */
-#define PACKAGE "libzip"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "libzip@nih.at"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libzip"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libzip 0.9"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libzip"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.9"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-/* #undef TM_IN_SYS_TIME */
-
-/* Version number of package */
-#define VERSION "0.9"
-
-
-#ifndef HAVE_MKSTEMP
-int _zip_mkstemp(char *);
-#define mkstemp _zip_mkstemp
-#endif
-
-#ifdef HAVE_MOVEFILEEXA
-#include <windows.h>
-#define _zip_rename(s, t)                                                \
-        (!MoveFileExA((s), (t),                                                \
-                     MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING))
-#else
-#define _zip_rename        rename
-#endif
-
-#ifndef HAVE_FSEEKO
-#define fseeko(s, o, w)        (fseek((s), (long int)(o), (w)))
-#endif
-#ifndef HAVE_FTELLO
-#define ftello(s)        ((long)ftell((s)))
-#endif
-
-
-#define CENTRAL_MAGIC "PK\1\2"
-#define LOCAL_MAGIC   "PK\3\4"
-#define EOCD_MAGIC    "PK\5\6"
-#define DATADES_MAGIC "PK\7\8"
-#define TORRENT_SIG        "TORRENTZIPPED-"
-#define TORRENT_SIG_LEN        14
-#define TORRENT_CRC_LEN 8
-#define TORRENT_MEM_LEVEL        8
-#define CDENTRYSIZE         46u
-#define LENTRYSIZE          30
-#define MAXCOMLEN        65536
-#define EOCDLEN             22
-#define CDBUFSIZE       (MAXCOMLEN+EOCDLEN)
-#define BUFSIZE                8192
-
-
-/* state of change of a file in zip archive */
-
-enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
-                 ZIP_ST_ADDED, ZIP_ST_RENAMED };
-
-/* constants for struct zip_file's member flags */
-
-#define ZIP_ZF_EOF        1 /* EOF reached */
-#define ZIP_ZF_DECOMP        2 /* decompress data */
-#define ZIP_ZF_CRC        4 /* compute and compare CRC */
-
-/* directory entry: general purpose bit flags */
-
-#define ZIP_GPBF_ENCRYPTED                0x0001        /* is encrypted */
-#define ZIP_GPBF_DATA_DESCRIPTOR        0x0008        /* crc/size after file data */
-#define ZIP_GPBF_STRONG_ENCRYPTION        0x0040  /* uses strong encryption */
-
-/* error information */
-
-struct zip_error {
-    int zip_err;        /* libzip error code (ZIP_ER_*) */
-    int sys_err;        /* copy of errno (E*) or zlib error code */
-    char *str;                /* string representation or NULL */
-};
-
-/* zip archive, part of API */
-
-struct zip {
-    char *zn;                        /* file name */
-    FILE *zp;                        /* file */
-    struct zip_error error;        /* error information */
-
-    unsigned int flags;                /* archive global flags */
-    unsigned int ch_flags;        /* changed archive global flags */
-
-    struct zip_cdir *cdir;        /* central directory */
-    char *ch_comment;                /* changed archive comment */
-    int ch_comment_len;                /* length of changed zip archive
-                                 * comment, -1 if unchanged */
-    int nentry;                        /* number of entries */
-    int nentry_alloc;                /* number of entries allocated */
-    struct zip_entry *entry;        /* entries */
-    int nfile;                        /* number of opened files within archive */
-    int nfile_alloc;                /* number of files allocated */
-    struct zip_file **file;        /* opened files within archive */
-};
-
-/* file in zip archive, part of API */
-
-struct zip_file {
-    struct zip *za;                /* zip archive containing this file */
-    struct zip_error error;        /* error information */
-    int flags;                        /* -1: eof, >0: error */
-
-    int method;                        /* compression method */
-    myoff_t fpos;                        /* position within zip file (fread/fwrite) */
-    unsigned long bytes_left;        /* number of bytes left to read */
-    unsigned long cbytes_left;  /* number of bytes of compressed data left */
-    
-    unsigned long crc;                /* CRC so far */
-    unsigned long crc_orig;        /* CRC recorded in archive */
-    
-    char *buffer;
-    z_stream *zstr;
-};
-
-/* zip archive directory entry (central or local) */
-
-struct zip_dirent {
-    unsigned short version_madeby;        /* (c)  version of creator */
-    unsigned short version_needed;        /* (cl) version needed to extract */
-    unsigned short bitflags;                /* (cl) general purpose bit flag */
-    unsigned short comp_method;                /* (cl) compression method used */
-    time_t last_mod;                        /* (cl) time of last modification */
-    unsigned int crc;                        /* (cl) CRC-32 of uncompressed data */
-    unsigned int comp_size;                /* (cl) size of commpressed data */
-    unsigned int uncomp_size;                /* (cl) size of uncommpressed data */
-    char *filename;                        /* (cl) file name (NUL-terminated) */
-    unsigned short filename_len;        /* (cl) length of filename (w/o NUL) */
-    char *extrafield;                        /* (cl) extra field */
-    unsigned short extrafield_len;        /* (cl) length of extra field */
-    char *comment;                        /* (c)  file comment */
-    unsigned short comment_len;                /* (c)  length of file comment */
-    unsigned short disk_number;                /* (c)  disk number start */
-    unsigned short int_attrib;                /* (c)  internal file attributes */
-    unsigned int ext_attrib;                /* (c)  external file attributes */
-    unsigned int offset;                /* (c)  offset of local header  */
-};
-
-/* zip archive central directory */
-
-struct zip_cdir {
-    struct zip_dirent *entry;        /* directory entries */
-    int nentry;                        /* number of entries */
-
-    unsigned int size;                /* size of central direcotry */
-    unsigned int offset;        /* offset of central directory in file */
-    char *comment;                /* zip archive comment */
-    unsigned short comment_len;        /* length of zip archive comment */
-};
-
-
-
-struct zip_source {
-    zip_source_callback f;
-    void *ud;
-};
-
-/* entry in zip archive directory */
-
-struct zip_entry {
-    enum zip_state state;
-    struct zip_source *source;
-    char *ch_filename;
-    char *ch_comment;
-    int ch_comment_len;
-};
-
-
-
-extern const char * const _zip_err_str[];
-extern const int _zip_nerr_str;
-extern const int _zip_err_type[];
-
-
-
-#define ZIP_ENTRY_DATA_CHANGED(x)        \
-                        ((x)->state == ZIP_ST_REPLACED  \
-                         || (x)->state == ZIP_ST_ADDED)
-
-
-
-int _zip_cdir_compute_crc(struct zip *, uLong *);
-void _zip_cdir_free(struct zip_cdir *);
-struct zip_cdir *_zip_cdir_new(int, struct zip_error *);
-int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *);
-
-void _zip_dirent_finalize(struct zip_dirent *);
-void _zip_dirent_init(struct zip_dirent *);
-int _zip_dirent_read(struct zip_dirent *, FILE *,
-                     unsigned char **, unsigned int, int, struct zip_error *);
-void _zip_dirent_torrent_normalize(struct zip_dirent *);
-int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *);
-
-void _zip_entry_free(struct zip_entry *);
-void _zip_entry_init(struct zip *, int);
-struct zip_entry *_zip_entry_new(struct zip *);
-
-void _zip_error_clear(struct zip_error *);
-void _zip_error_copy(struct zip_error *, struct zip_error *);
-void _zip_error_fini(struct zip_error *);
-void _zip_error_get(struct zip_error *, int *, int *);
-void _zip_error_init(struct zip_error *);
-void _zip_error_set(struct zip_error *, int, int);
-const char *_zip_error_strerror(struct zip_error *);
-
-int _zip_file_fillbuf(void *, size_t, struct zip_file *);
-unsigned int _zip_file_get_offset(struct zip *, int);
-
-int _zip_filerange_crc(FILE *, myoff_t, myoff_t, uLong *, struct zip_error *);
-
-struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *,
-                                         myoff_t, myoff_t);
-
-void _zip_free(struct zip *);
-const char *_zip_get_name(struct zip *, int, int, struct zip_error *);
-int _zip_local_header_read(struct zip *, int);
-void *_zip_memdup(const void *, size_t, struct zip_error *);
-int _zip_name_locate(struct zip *, const char *, int, struct zip_error *);
-struct zip *_zip_new(struct zip_error *);
-unsigned short _zip_read2(unsigned char **);
-unsigned int _zip_read4(unsigned char **);
-int _zip_replace(struct zip *, int, const char *, struct zip_source *);
-int _zip_set_name(struct zip *, int, const char *);
-int _zip_unchange(struct zip *, int, int);
-void _zip_unchange_data(struct zip_entry *);
-
-         
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-const char *
-_zip_error_strerror(struct zip_error *err)
-{
-    const char *zs, *ss;
-    char buf[128], *s;
-
-    _zip_error_fini(err);
-
-    if (err->zip_err < 0 || err->zip_err >= _zip_nerr_str) {
-        sprintf(buf, "Unknown error %d", err->zip_err);
-        zs = NULL;
-        ss = buf;
-    }
-    else {
-        zs = _zip_err_str[err->zip_err];
-        
-        switch (_zip_err_type[err->zip_err]) {
-        case ZIP_ET_SYS:
-            ss = strerror(err->sys_err);
-            break;
-
-        case ZIP_ET_ZLIB:
-            ss = zError(err->sys_err);
-            break;
-
-        default:
-            ss = NULL;
-        }
-    }
-
-    if (ss == NULL)
-        return zs;
-    else {
-        if ((s=(char *)malloc(strlen(ss)
-                              + (zs ? strlen(zs)+2 : 0) + 1)) == NULL)
-            return _zip_err_str[ZIP_ER_MEMORY];
-        
-        sprintf(s, "%s%s%s",
-                (zs ? zs : ""),
-                (zs ? ": " : ""),
-                ss);
-        err->str = s;
-
-        return s;
-    }
-}
-
-#include <stdlib.h>
-
-
-
-void
-_zip_error_clear(struct zip_error *err)
-{
-    err->zip_err = ZIP_ER_OK;
-    err->sys_err = 0;
-}
-
-
-
-void
-_zip_error_copy(struct zip_error *dst, struct zip_error *src)
-{
-    dst->zip_err = src->zip_err;
-    dst->sys_err = src->sys_err;
-}
-
-
-
-void
-_zip_error_fini(struct zip_error *err)
-{
-    free(err->str);
-    err->str = NULL;
-}
-
-
-
-void
-_zip_error_get(struct zip_error *err, int *zep, int *sep)
-{
-    if (zep)
-        *zep = err->zip_err;
-    if (sep) {
-        if (zip_error_get_sys_type(err->zip_err) != ZIP_ET_NONE)
-            *sep = err->sys_err;
-        else
-            *sep = 0;
-    }
-}
-
-
-
-void
-_zip_error_init(struct zip_error *err)
-{
-    err->zip_err = ZIP_ER_OK;
-    err->sys_err = 0;
-    err->str = NULL;
-}
-
-
-
-void
-_zip_error_set(struct zip_error *err, int ze, int se)
-{
-    if (err) {
-        err->zip_err = ze;
-        err->sys_err = se;
-    }
-}
-
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-
-
-int
-_zip_mkstemp(char *path)
-{
-        int fd;   
-        char *start, *trv;
-        struct stat sbuf;
-        pid_t pid;
-
-        /* To guarantee multiple calls generate unique names even if
-           the file is not created. 676 different possibilities with 7
-           or more X's, 26 with 6 or less. */
-        static char xtra[2] = "aa";
-        int xcnt = 0;
-
-        pid = getpid();
-
-        /* Move to end of path and count trailing X's. */
-        for (trv = path; *trv; ++trv)
-                if (*trv == 'X')
-                        xcnt++;
-                else
-                        xcnt = 0;        
-
-        /* Use at least one from xtra.  Use 2 if more than 6 X's. */
-        if (*(trv - 1) == 'X')
-                *--trv = xtra[0];
-        if (xcnt > 6 && *(trv - 1) == 'X')
-                *--trv = xtra[1];
-
-        /* Set remaining X's to pid digits with 0's to the left. */
-        while (*--trv == 'X') {
-                *trv = (pid % 10) + '0';
-                pid /= 10;
-        }
-
-        /* update xtra for next call. */
-        if (xtra[0] != 'z')
-                xtra[0]++;
-        else {
-                xtra[0] = 'a';
-                if (xtra[1] != 'z')
-                        xtra[1]++;
-                else
-                        xtra[1] = 'a';
-        }
-
-        /*
-         * check the target directory; if you have six X's and it
-         * doesn't exist this runs for a *very* long time.
-         */
-        for (start = trv + 1;; --trv) {
-                if (trv <= path)
-                        break;
-                if (*trv == '/') {
-                        *trv = '\0';
-                        if (stat(path, &sbuf))
-                                return (0);
-                        if (!S_ISDIR(sbuf.st_mode)) {
-                                errno = ENOTDIR;
-                                return (0);
-                        }
-                        *trv = '/';
-                        break;
-                }
-        }
-
-        for (;;) {
-                if ((fd=open(path, O_CREAT|O_EXCL|O_RDWR|O_BINARY, 0600)) >= 0)
-                        return (fd);
-                if (errno != EEXIST)
-                        return (0);
-
-                /* tricky little algorithm for backward compatibility */
-                for (trv = start;;) {
-                        if (!*trv)
-                                return (0);
-                        if (*trv == 'z')
-                                *trv++ = 'a';
-                        else {
-                                if (isdigit((unsigned char)*trv))
-                                        *trv = 'a';
-                                else
-                                        ++*trv;
-                                break;
-                        }
-                }
-        }
-        /*NOTREACHED*/
-}
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-static time_t _zip_d2u_time(int, int);
-static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *);
-static char *_zip_readstr(unsigned char **, int, int, struct zip_error *);
-static void _zip_u2d_time(time_t, unsigned short *, unsigned short *);
-static void _zip_write2(unsigned short, FILE *);
-static void _zip_write4(unsigned int, FILE *);
-
-
-
-void
-_zip_cdir_free(struct zip_cdir *cd)
-{
-    int i;
-
-    if (!cd)
-        return;
-
-    for (i=0; i<cd->nentry; i++)
-        _zip_dirent_finalize(cd->entry+i);
-    free(cd->comment);
-    free(cd->entry);
-    free(cd);
-}
-
-
-
-struct zip_cdir *
-_zip_cdir_new(int nentry, struct zip_error *error)
-{
-    struct zip_cdir *cd;
-    
-    if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
-        == NULL) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        free(cd);
-        return NULL;
-    }
-
-    /* entries must be initialized by caller */
-
-    cd->nentry = nentry;
-    cd->size = cd->offset = 0;
-    cd->comment = NULL;
-    cd->comment_len = 0;
-
-    return cd;
-}
-
-
-
-int
-_zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
-{
-    int i;
-
-    cd->offset = ftello(fp);
-
-    for (i=0; i<cd->nentry; i++) {
-        if (_zip_dirent_write(cd->entry+i, fp, 0, error) != 0)
-            return -1;
-    }
-
-    cd->size = ftello(fp) - cd->offset;
-    
-    /* clearerr(fp); */
-    fwrite(EOCD_MAGIC, 1, 4, fp);
-    _zip_write4(0, fp);
-    _zip_write2((unsigned short)cd->nentry, fp);
-    _zip_write2((unsigned short)cd->nentry, fp);
-    _zip_write4(cd->size, fp);
-    _zip_write4(cd->offset, fp);
-    _zip_write2(cd->comment_len, fp);
-    fwrite(cd->comment, 1, cd->comment_len, fp);
-
-    if (ferror(fp)) {
-        _zip_error_set(error, ZIP_ER_WRITE, errno);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-
-void
-_zip_dirent_finalize(struct zip_dirent *zde)
-{
-    free(zde->filename);
-    zde->filename = NULL;
-    free(zde->extrafield);
-    zde->extrafield = NULL;
-    free(zde->comment);
-    zde->comment = NULL;
-}
-
-
-
-void
-_zip_dirent_init(struct zip_dirent *de)
-{
-    de->version_madeby = 0;
-    de->version_needed = 20; /* 2.0 */
-    de->bitflags = 0;
-    de->comp_method = 0;
-    de->last_mod = 0;
-    de->crc = 0;
-    de->comp_size = 0;
-    de->uncomp_size = 0;
-    de->filename = NULL;
-    de->filename_len = 0;
-    de->extrafield = NULL;
-    de->extrafield_len = 0;
-    de->comment = NULL;
-    de->comment_len = 0;
-    de->disk_number = 0;
-    de->int_attrib = 0;
-    de->ext_attrib = 0;
-    de->offset = 0;
-}
-
-
-
-/* _zip_dirent_read(zde, fp, bufp, left, localp, error):
-   Fills the zip directory entry zde.
-
-   If bufp is non-NULL, data is taken from there and bufp is advanced
-   by the amount of data used; no more than left bytes are used.
-   Otherwise data is read from fp as needed.
-
-   If localp != 0, it reads a local header instead of a central
-   directory entry.
-
-   Returns 0 if successful. On error, error is filled in and -1 is
-   returned.
-*/
-
-int
-_zip_dirent_read(struct zip_dirent *zde, FILE *fp,
-                 unsigned char **bufp, unsigned int left, int localp,
-                 struct zip_error *error)
-{
-    unsigned char buf[CDENTRYSIZE];
-    unsigned char *cur;
-    unsigned short dostime, dosdate;
-    unsigned int size;
-
-    if (localp)
-        size = LENTRYSIZE;
-    else
-        size = CDENTRYSIZE;
-    
-    if (bufp) {
-        /* use data from buffer */
-        cur = *bufp;
-        if (left < size) {
-            _zip_error_set(error, ZIP_ER_NOZIP, 0);
-            return -1;
-        }
-    }
-    else {
-        /* read entry from disk */
-        if ((fread(buf, 1, size, fp)<size)) {
-            _zip_error_set(error, ZIP_ER_READ, errno);
-            return -1;
-        }
-        left = size;
-        cur = buf;
-    }
-
-    if (memcmp(cur, (localp ? LOCAL_MAGIC : CENTRAL_MAGIC), 4) != 0) {
-        _zip_error_set(error, ZIP_ER_NOZIP, 0);
-        return -1;
-    }
-    cur += 4;
-
-    
-    /* convert buffercontents to zip_dirent */
-    
-    if (!localp)
-        zde->version_madeby = _zip_read2(&cur);
-    else
-        zde->version_madeby = 0;
-    zde->version_needed = _zip_read2(&cur);
-    zde->bitflags = _zip_read2(&cur);
-    zde->comp_method = _zip_read2(&cur);
-    
-    /* convert to time_t */
-    dostime = _zip_read2(&cur);
-    dosdate = _zip_read2(&cur);
-    zde->last_mod = _zip_d2u_time(dostime, dosdate);
-    
-    zde->crc = _zip_read4(&cur);
-    zde->comp_size = _zip_read4(&cur);
-    zde->uncomp_size = _zip_read4(&cur);
-    
-    zde->filename_len = _zip_read2(&cur);
-    zde->extrafield_len = _zip_read2(&cur);
-    
-    if (localp) {
-        zde->comment_len = 0;
-        zde->disk_number = 0;
-        zde->int_attrib = 0;
-        zde->ext_attrib = 0;
-        zde->offset = 0;
-    } else {
-        zde->comment_len = _zip_read2(&cur);
-        zde->disk_number = _zip_read2(&cur);
-        zde->int_attrib = _zip_read2(&cur);
-        zde->ext_attrib = _zip_read4(&cur);
-        zde->offset = _zip_read4(&cur);
-    }
-
-    zde->filename = NULL;
-    zde->extrafield = NULL;
-    zde->comment = NULL;
-
-    if (bufp) {
-        if (left < CDENTRYSIZE + (zde->filename_len+zde->extrafield_len
-                                  +zde->comment_len)) {
-            _zip_error_set(error, ZIP_ER_NOZIP, 0);
-            return -1;
-        }
-
-        if (zde->filename_len) {
-            zde->filename = _zip_readstr(&cur, zde->filename_len, 1, error);
-            if (!zde->filename)
-                    return -1;
-        }
-
-        if (zde->extrafield_len) {
-            zde->extrafield = _zip_readstr(&cur, zde->extrafield_len, 0,
-                                           error);
-            if (!zde->extrafield)
-                return -1;
-        }
-
-        if (zde->comment_len) {
-            zde->comment = _zip_readstr(&cur, zde->comment_len, 0, error);
-            if (!zde->comment)
-                return -1;
-        }
-    }
-    else {
-        if (zde->filename_len) {
-            zde->filename = _zip_readfpstr(fp, zde->filename_len, 1, error);
-            if (!zde->filename)
-                    return -1;
-        }
-
-        if (zde->extrafield_len) {
-            zde->extrafield = _zip_readfpstr(fp, zde->extrafield_len, 0,
-                                             error);
-            if (!zde->extrafield)
-                return -1;
-        }
-
-        if (zde->comment_len) {
-            zde->comment = _zip_readfpstr(fp, zde->comment_len, 0, error);
-            if (!zde->comment)
-                return -1;
-        }
-    }
-
-    if (bufp)
-      *bufp = cur;
-
-    return 0;
-}
-
-
-
-/* _zip_dirent_torrent_normalize(de);
-   Set values suitable for torrentzip.
-*/
-
-void
-_zip_dirent_torrent_normalize(struct zip_dirent *de)
-{
-    static struct tm torrenttime;
-    static time_t last_mod = 0;
-
-    if (last_mod == 0) {
-#ifdef HAVE_STRUCT_TM_TM_ZONE
-        time_t now;
-        struct tm *l;
-#endif
-
-        torrenttime.tm_sec = 0;
-        torrenttime.tm_min = 32;
-        torrenttime.tm_hour = 23;
-        torrenttime.tm_mday = 24;
-        torrenttime.tm_mon = 11;
-        torrenttime.tm_year = 96;
-        torrenttime.tm_wday = 0;
-        torrenttime.tm_yday = 0;
-        torrenttime.tm_isdst = 0;
-
-#ifdef HAVE_STRUCT_TM_TM_ZONE
-        time(&now);
-        l = localtime(&now);
-        torrenttime.tm_gmtoff = l->tm_gmtoff;
-        torrenttime.tm_zone = l->tm_zone;
-#endif
-
-        last_mod = mktime(&torrenttime);
-    }
-    
-    de->version_madeby = 0;
-    de->version_needed = 20; /* 2.0 */
-    de->bitflags = 2; /* maximum compression */
-    de->comp_method = ZIP_CM_DEFLATE;
-    de->last_mod = last_mod;
-
-    de->disk_number = 0;
-    de->int_attrib = 0;
-    de->ext_attrib = 0;
-    de->offset = 0;
-
-    free(de->extrafield);
-    de->extrafield = NULL;
-    de->extrafield_len = 0;
-    free(de->comment);
-    de->comment = NULL;
-    de->comment_len = 0;
-}
-
-
-
-/* _zip_dirent_write(zde, fp, localp, error):
-   Writes zip directory entry zde to file fp.
-
-   If localp != 0, it writes a local header instead of a central
-   directory entry.
-
-   Returns 0 if successful. On error, error is filled in and -1 is
-   returned.
-*/
-
-int
-_zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp,
-                  struct zip_error *error)
-{
-    unsigned short dostime, dosdate;
-
-    fwrite(localp ? LOCAL_MAGIC : CENTRAL_MAGIC, 1, 4, fp);
-
-    if (!localp)
-        _zip_write2(zde->version_madeby, fp);
-    _zip_write2(zde->version_needed, fp);
-    _zip_write2(zde->bitflags, fp);
-    _zip_write2(zde->comp_method, fp);
-
-    _zip_u2d_time(zde->last_mod, &dostime, &dosdate);
-    _zip_write2(dostime, fp);
-    _zip_write2(dosdate, fp);
-    
-    _zip_write4(zde->crc, fp);
-    _zip_write4(zde->comp_size, fp);
-    _zip_write4(zde->uncomp_size, fp);
-    
-    _zip_write2(zde->filename_len, fp);
-    _zip_write2(zde->extrafield_len, fp);
-    
-    if (!localp) {
-        _zip_write2(zde->comment_len, fp);
-        _zip_write2(zde->disk_number, fp);
-        _zip_write2(zde->int_attrib, fp);
-        _zip_write4(zde->ext_attrib, fp);
-        _zip_write4(zde->offset, fp);
-    }
-
-    if (zde->filename_len)
-        fwrite(zde->filename, 1, zde->filename_len, fp);
-
-    if (zde->extrafield_len)
-        fwrite(zde->extrafield, 1, zde->extrafield_len, fp);
-
-    if (!localp) {
-        if (zde->comment_len)
-            fwrite(zde->comment, 1, zde->comment_len, fp);
-    }
-
-    if (ferror(fp)) {
-        _zip_error_set(error, ZIP_ER_WRITE, errno);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-
-static time_t
-_zip_d2u_time(int dtime, int ddate)
-{
-    struct tm *tm;
-    time_t now;
-
-    now = time(NULL);
-    tm = localtime(&now);
-    /* let mktime decide if DST is in effect */
-    tm->tm_isdst = -1;
-    
-    tm->tm_year = ((ddate>>9)&127) + 1980 - 1900;
-    tm->tm_mon = ((ddate>>5)&15) - 1;
-    tm->tm_mday = ddate&31;
-
-    tm->tm_hour = (dtime>>11)&31;
-    tm->tm_min = (dtime>>5)&63;
-    tm->tm_sec = (dtime<<1)&62;
-
-    return mktime(tm);
-}
-
-
-
-unsigned short
-_zip_read2(unsigned char **a)
-{
-    unsigned short ret;
-
-    ret = (*a)[0]+((*a)[1]<<8);
-    *a += 2;
-
-    return ret;
-}
-
-
-
-unsigned int
-_zip_read4(unsigned char **a)
-{
-    unsigned int ret;
-
-    ret = ((((((*a)[3]<<8)+(*a)[2])<<8)+(*a)[1])<<8)+(*a)[0];
-    *a += 4;
-
-    return ret;
-}
-
-
-
-static char *
-_zip_readfpstr(FILE *fp, unsigned int len, int nulp, struct zip_error *error)
-{
-    char *r, *o;
-
-    r = (char *)malloc(nulp ? len+1 : len);
-    if (!r) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    if (fread(r, 1, len, fp)<len) {
-        free(r);
-        _zip_error_set(error, ZIP_ER_READ, errno);
-        return NULL;
-    }
-
-    if (nulp) {
-        /* replace any in-string NUL characters with spaces */
-        r[len] = 0;
-        for (o=r; o<r+len; o++)
-            if (*o == '\0')
-                *o = ' ';
-    }
-    
-    return r;
-}
-
-
-
-static char *
-_zip_readstr(unsigned char **buf, int len, int nulp, struct zip_error *error)
-{
-    char *r, *o;
-
-    r = (char *)malloc(nulp ? len+1 : len);
-    if (!r) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-    
-    memcpy(r, *buf, len);
-    *buf += len;
-
-    if (nulp) {
-        /* replace any in-string NUL characters with spaces */
-        r[len] = 0;
-        for (o=r; o<r+len; o++)
-            if (*o == '\0')
-                *o = ' ';
-    }
-
-    return r;
-}
-
-
-
-static void
-_zip_write2(unsigned short i, FILE *fp)
-{
-    putc(i&0xff, fp);
-    putc((i>>8)&0xff, fp);
-
-    return;
-}
-
-
-
-static void
-_zip_write4(unsigned int i, FILE *fp)
-{
-    putc(i&0xff, fp);
-    putc((i>>8)&0xff, fp);
-    putc((i>>16)&0xff, fp);
-    putc((i>>24)&0xff, fp);
-    
-    return;
-}
-
-
-
-static void
-_zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate)
-{
-    struct tm *tm;
-
-    tm = localtime(&time);
-    *ddate = ((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5)
-        + tm->tm_mday;
-    *dtime = ((tm->tm_hour)<<11) + ((tm->tm_min)<<5)
-        + ((tm->tm_sec)>>1);
-
-    return;
-}
-
-
-
-ZIP_EXTERN int
-zip_delete(struct zip *za, int idx)
-{
-    if (idx < 0 || idx >= za->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    /* allow duplicate file names, because the file will
-     * be removed directly afterwards */
-    if (_zip_unchange(za, idx, 1) != 0)
-        return -1;
-
-    za->entry[idx].state = ZIP_ST_DELETED;
-
-    return 0;
-}
-
-
-
-ZIP_EXTERN void
-zip_error_clear(struct zip *za)
-{
-    _zip_error_clear(&za->error);
-}
-
-
-ZIP_EXTERN int
-zip_add(struct zip *za, const char *name, struct zip_source *source)
-{
-    if (name == NULL || source == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-        
-    return _zip_replace(za, -1, name, source);
-}
-
-
-ZIP_EXTERN int
-zip_error_get_sys_type(int ze)
-{
-    if (ze < 0 || ze >= _zip_nerr_str)
-        return 0;
-
-    return _zip_err_type[ze];
-}
-
-
-ZIP_EXTERN void
-zip_error_get(struct zip *za, int *zep, int *sep)
-{
-    _zip_error_get(&za->error, zep, sep);
-}
-
-
-const char * const _zip_err_str[] = {
-    "No error",
-    "Multi-disk zip archives not supported",
-    "Renaming temporary file failed",
-    "Closing zip archive failed",
-    "Seek error",
-    "Read error",
-    "Write error",
-    "CRC error",
-    "Containing zip archive was closed",
-    "No such file",
-    "File already exists",
-    "Can't open file",
-    "Failure to create temporary file",
-    "Zlib error",
-    "Malloc failure",
-    "Entry has been changed",
-    "Compression method not supported",
-    "Premature EOF",
-    "Invalid argument",
-    "Not a zip archive",
-    "Internal error",
-    "Zip archive inconsistent",
-    "Can't remove file",
-    "Entry has been deleted",
-};
-
-const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]);
-
-#define N ZIP_ET_NONE
-#define S ZIP_ET_SYS
-#define Z ZIP_ET_ZLIB
-
-const int _zip_err_type[] = {
-    N,
-    N,
-    S,
-    S,
-    S,
-    S,
-    S,
-    N,
-    N,
-    N,
-    N,
-    S,
-    S,
-    Z,
-    N,
-    N,
-    N,
-    N,
-    N,
-    N,
-    N,
-    N,
-    S,
-    N,
-};
-
-
-struct zip_entry *
-_zip_entry_new(struct zip *za)
-{
-    struct zip_entry *ze;
-    if (!za) {
-        ze = (struct zip_entry *)malloc(sizeof(struct zip_entry));
-        if (!ze) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            return NULL;
-        }
-    }
-    else {
-        if (za->nentry >= za->nentry_alloc-1) {
-            za->nentry_alloc += 16;
-            za->entry = (struct zip_entry *)realloc(za->entry,
-                                                    sizeof(struct zip_entry)
-                                                    * za->nentry_alloc);
-            if (!za->entry) {
-                _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-                return NULL;
-            }
-        }
-        ze = za->entry+za->nentry;
-    }
-
-    ze->state = ZIP_ST_UNCHANGED;
-
-    ze->ch_filename = NULL;
-    ze->ch_comment = NULL;
-    ze->ch_comment_len = -1;
-    ze->source = NULL;
-
-    if (za)
-        za->nentry++;
-
-    return ze;
-}
-
-
-void
-_zip_entry_free(struct zip_entry *ze)
-{
-    free(ze->ch_filename);
-    ze->ch_filename = NULL;
-    free(ze->ch_comment);
-    ze->ch_comment = NULL;
-    ze->ch_comment_len = -1;
-
-    _zip_unchange_data(ze);
-}
-
-
-static int add_data(struct zip *, struct zip_source *, struct zip_dirent *,
-                    FILE *);
-static int add_data_comp(zip_source_callback, void *, struct zip_stat *,
-                         FILE *, struct zip_error *);
-static int add_data_uncomp(struct zip *, zip_source_callback, void *,
-                           struct zip_stat *, FILE *);
-static void ch_set_error(struct zip_error *, zip_source_callback, void *);
-static int copy_data(FILE *, myoff_t, FILE *, struct zip_error *);
-static int write_cdir(struct zip *, struct zip_cdir *, FILE *);
-static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *);
-static int _zip_changed(struct zip *, int *);
-static char *_zip_create_temp_output(struct zip *, FILE **);
-static int _zip_torrentzip_cmp(const void *, const void *);
-
-
-
-struct filelist {
-    int idx;
-    const char *name;
-};
-
-
-
-ZIP_EXTERN int
-zip_close(struct zip *za)
-{
-    int survivors;
-    int i, j, error;
-    char *temp;
-    FILE *out;
-    mode_t mask;
-    struct zip_cdir *cd;
-    struct zip_dirent de;
-    struct filelist *filelist;
-    int reopen_on_error;
-    int new_torrentzip;
-
-    reopen_on_error = 0;
-
-    if (za == NULL)
-        return -1;
-
-    if (!_zip_changed(za, &survivors)) {
-        _zip_free(za);
-        return 0;
-    }
-
-    /* don't create zip files with no entries */
-    if (survivors == 0) {
-        if (za->zn && za->zp) {
-            if (remove(za->zn) != 0) {
-                _zip_error_set(&za->error, ZIP_ER_REMOVE, errno);
-                return -1;
-            }
-        }
-        _zip_free(za);
-        return 0;
-    }               
-
-    if ((filelist=(struct filelist *)malloc(sizeof(filelist[0])*survivors))
-        == NULL)
-        return -1;
-
-    if ((cd=_zip_cdir_new(survivors, &za->error)) == NULL) {
-        free(filelist);
-        return -1;
-    }
-
-    for (i=0; i<survivors; i++)
-        _zip_dirent_init(&cd->entry[i]);
-
-    /* archive comment is special for torrentzip */
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) {
-        cd->comment = _zip_memdup(TORRENT_SIG "XXXXXXXX",
-                                  TORRENT_SIG_LEN + TORRENT_CRC_LEN,
-                                  &za->error);
-        if (cd->comment == NULL) {
-            _zip_cdir_free(cd);
-            free(filelist);
-            return -1;
-        }
-        cd->comment_len = TORRENT_SIG_LEN + TORRENT_CRC_LEN;
-    }
-    else if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, ZIP_FL_UNCHANGED) == 0) {
-        if (_zip_cdir_set_comment(cd, za) == -1) {
-            _zip_cdir_free(cd);
-            free(filelist);
-            return -1;
-        }
-    }
-
-    if ((temp=_zip_create_temp_output(za, &out)) == NULL) {
-        _zip_cdir_free(cd);
-        return -1;
-    }
-
-
-    /* create list of files with index into original archive  */
-    for (i=j=0; i<za->nentry; i++) {
-        if (za->entry[i].state == ZIP_ST_DELETED)
-            continue;
-
-        filelist[j].idx = i;
-        filelist[j].name = zip_get_name(za, i, 0);
-        j++;
-    }
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
-        qsort(filelist, survivors, sizeof(filelist[0]),
-              _zip_torrentzip_cmp);
-
-    new_torrentzip = (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 1
-                      && zip_get_archive_flag(za, ZIP_AFL_TORRENT,
-                                              ZIP_FL_UNCHANGED) == 0);
-    error = 0;
-    for (j=0; j<survivors; j++) {
-        i = filelist[j].idx;
-
-        /* create new local directory entry */
-        if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) {
-            _zip_dirent_init(&de);
-
-            if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
-                _zip_dirent_torrent_normalize(&de);
-                
-            /* use it as central directory entry */
-            memcpy(cd->entry+j, &de, sizeof(cd->entry[j]));
-
-            /* set/update file name */
-            if (za->entry[i].ch_filename == NULL) {
-                if (za->entry[i].state == ZIP_ST_ADDED) {
-                    de.filename = strdup("-");
-                    de.filename_len = 1;
-                    cd->entry[j].filename = "-";
-                }
-                else {
-                    de.filename = strdup(za->cdir->entry[i].filename);
-                    de.filename_len = strlen(de.filename);
-                    cd->entry[j].filename = za->cdir->entry[i].filename;
-                    cd->entry[j].filename_len = de.filename_len;
-                }
-            }
-        }
-        else {
-            /* copy existing directory entries */
-            if (fseeko(za->zp, za->cdir->entry[i].offset, SEEK_SET) != 0) {
-                _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
-                error = 1;
-                break;
-            }
-            if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0) {
-                error = 1;
-                break;
-            }
-            if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
-                de.crc = za->cdir->entry[i].crc;
-                de.comp_size = za->cdir->entry[i].comp_size;
-                de.uncomp_size = za->cdir->entry[i].uncomp_size;
-                de.bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
-            }
-            memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
-        }
-
-        if (za->entry[i].ch_filename) {
-            free(de.filename);
-            if ((de.filename=strdup(za->entry[i].ch_filename)) == NULL) {
-                error = 1;
-                break;
-            }
-            de.filename_len = strlen(de.filename);
-            cd->entry[j].filename = za->entry[i].ch_filename;
-            cd->entry[j].filename_len = de.filename_len;
-        }
-
-        if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0
-            && za->entry[i].ch_comment_len != -1) {
-            /* as the rest of cd entries, its malloc/free is done by za */
-            cd->entry[j].comment = za->entry[i].ch_comment;
-            cd->entry[j].comment_len = za->entry[i].ch_comment_len;
-        }
-
-        cd->entry[j].offset = ftello(out);
-
-        if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) {
-            struct zip_source *zs;
-
-            zs = NULL;
-            if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) {
-                if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1))
-                    == NULL) {
-                    error = 1;
-                    break;
-                }
-            }
-
-            if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) {
-                error = 1;
-                break;
-            }
-            cd->entry[j].last_mod = de.last_mod;
-            cd->entry[j].comp_method = de.comp_method;
-            cd->entry[j].comp_size = de.comp_size;
-            cd->entry[j].uncomp_size = de.uncomp_size;
-            cd->entry[j].crc = de.crc;
-        }
-        else {
-            if (_zip_dirent_write(&de, out, 1, &za->error) < 0) {
-                error = 1;
-                break;
-            }
-            /* we just read the local dirent, file is at correct position */
-            if (copy_data(za->zp, cd->entry[j].comp_size, out,
-                          &za->error) < 0) {
-                error = 1;
-                break;
-            }
-        }
-
-        _zip_dirent_finalize(&de);
-    }
-
-    if (!error) {
-        if (write_cdir(za, cd, out) < 0)
-            error = 1;
-    }
-   
-    /* pointers in cd entries are owned by za */
-    cd->nentry = 0;
-    _zip_cdir_free(cd);
-
-    if (error) {
-        _zip_dirent_finalize(&de);
-        fclose(out);
-        remove(temp);
-        free(temp);
-        return -1;
-    }
-
-    if (fclose(out) != 0) {
-        _zip_error_set(&za->error, ZIP_ER_CLOSE, errno);
-        remove(temp);
-        free(temp);
-        return -1;
-    }
-    
-    if (za->zp) {
-        fclose(za->zp);
-        za->zp = NULL;
-        reopen_on_error = 1;
-    }
-    if (_zip_rename(temp, za->zn) != 0) {
-        _zip_error_set(&za->error, ZIP_ER_RENAME, errno);
-        remove(temp);
-        free(temp);
-        if (reopen_on_error) {
-            /* ignore errors, since we're already in an error case */
-            za->zp = fopen(za->zn, "rb");
-        }
-        return -1;
-    }
-    mask = umask(0);
-    umask(mask);
-    chmod(za->zn, 0666&~mask);
-
-    _zip_free(za);
-    free(temp);
-    
-    return 0;
-}
-
-
-
-static int
-add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft)
-{
-    myoff_t offstart, offend;
-    zip_source_callback cb;
-    void *ud;
-    struct zip_stat st;
-    
-    cb = zs->f;
-    ud = zs->ud;
-
-    if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) {
-        ch_set_error(&za->error, cb, ud);
-        return -1;
-    }
-
-    if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) {
-        ch_set_error(&za->error, cb, ud);
-        return -1;
-    }
-
-    offstart = ftello(ft);
-
-    if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
-        return -1;
-
-    if (st.comp_method != ZIP_CM_STORE) {
-        if (add_data_comp(cb, ud, &st, ft, &za->error) < 0)
-            return -1;
-    }
-    else {
-        if (add_data_uncomp(za, cb, ud, &st, ft) < 0)
-            return -1;
-    }
-
-    if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) {
-        ch_set_error(&za->error, cb, ud);
-        return -1;
-    }
-
-    offend = ftello(ft);
-
-    if (fseeko(ft, offstart, SEEK_SET) < 0) {
-        _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
-        return -1;
-    }
-
-    
-    de->last_mod = st.mtime;
-    de->comp_method = st.comp_method;
-    de->crc = st.crc;
-    de->uncomp_size = st.size;
-    de->comp_size = st.comp_size;
-
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
-        _zip_dirent_torrent_normalize(de);
-
-    if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
-        return -1;
-    
-    if (fseeko(ft, offend, SEEK_SET) < 0) {
-        _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-
-static int
-add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft,
-              struct zip_error *error)
-{
-    char buf[BUFSIZE];
-    ssize_t n;
-
-    st->comp_size = 0;
-    while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) {
-        if (fwrite(buf, 1, n, ft) != (size_t)n) {
-            _zip_error_set(error, ZIP_ER_WRITE, errno);
-            return -1;
-        }
-        
-        st->comp_size += n;
-    }
-    if (n < 0) {
-        ch_set_error(error, cb, ud);
-        return -1;
-    }        
-
-    return 0;
-}
-
-
-
-static int
-add_data_uncomp(struct zip *za, zip_source_callback cb, void *ud,
-                struct zip_stat *st, FILE *ft)
-{
-    char b1[BUFSIZE], b2[BUFSIZE];
-    int end, flush, ret;
-    ssize_t n;
-    size_t n2;
-    z_stream zstr;
-    int mem_level;
-
-    st->comp_method = ZIP_CM_DEFLATE;
-    st->comp_size = st->size = 0;
-    st->crc = crc32(0, NULL, 0);
-
-    zstr.zalloc = Z_NULL;
-    zstr.zfree = Z_NULL;
-    zstr.opaque = NULL;
-    zstr.avail_in = 0;
-    zstr.avail_out = 0;
-
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
-        mem_level = TORRENT_MEM_LEVEL;
-    else
-        mem_level = MAX_MEM_LEVEL;
-
-    /* -MAX_WBITS: undocumented feature of zlib to _not_ write a zlib header */
-    deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, mem_level,
-                 Z_DEFAULT_STRATEGY);
-
-    zstr.next_out = (Bytef *)b2;
-    zstr.avail_out = sizeof(b2);
-    zstr.avail_in = 0;
-
-    flush = 0;
-    end = 0;
-    while (!end) {
-        if (zstr.avail_in == 0 && !flush) {
-            if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) {
-                ch_set_error(&za->error, cb, ud);
-                deflateEnd(&zstr);
-                return -1;
-            }
-            if (n > 0) {
-                zstr.avail_in = n;
-                zstr.next_in = (Bytef *)b1;
-                st->size += n;
-                st->crc = crc32(st->crc, (Bytef *)b1, n);
-            }
-            else
-                flush = Z_FINISH;
-        }
-
-        ret = deflate(&zstr, flush);
-        if (ret != Z_OK && ret != Z_STREAM_END) {
-            _zip_error_set(&za->error, ZIP_ER_ZLIB, ret);
-            return -1;
-        }
-        
-        if (zstr.avail_out != sizeof(b2)) {
-            n2 = sizeof(b2) - zstr.avail_out;
-            
-            if (fwrite(b2, 1, n2, ft) != n2) {
-                _zip_error_set(&za->error, ZIP_ER_WRITE, errno);
-                return -1;
-            }
-        
-            zstr.next_out = (Bytef *)b2;
-            zstr.avail_out = sizeof(b2);
-            st->comp_size += n2;
-        }
-
-        if (ret == Z_STREAM_END) {
-            deflateEnd(&zstr);
-            end = 1;
-        }
-    }
-
-    return 0;
-}
-
-
-
-static void
-ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud)
-{
-    int e[2];
-
-    if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) {
-        error->zip_err = ZIP_ER_INTERNAL;
-        error->sys_err = 0;
-    }
-    else {
-        error->zip_err = e[0];
-        error->sys_err = e[1];
-    }
-}
-
-
-
-static int
-copy_data(FILE *fs, myoff_t len, FILE *ft, struct zip_error *error)
-{
-    char buf[BUFSIZE];
-    int n, nn;
-
-    if (len == 0)
-        return 0;
-
-    while (len > 0) {
-        nn = len > sizeof(buf) ? sizeof(buf) : len;
-        if ((n=fread(buf, 1, nn, fs)) < 0) {
-            _zip_error_set(error, ZIP_ER_READ, errno);
-            return -1;
-        }
-        else if (n == 0) {
-            _zip_error_set(error, ZIP_ER_EOF, 0);
-            return -1;
-        }
-
-        if (fwrite(buf, 1, n, ft) != (size_t)n) {
-            _zip_error_set(error, ZIP_ER_WRITE, errno);
-            return -1;
-        }
-        
-        len -= n;
-    }
-
-    return 0;
-}
-
-
-
-static int
-write_cdir(struct zip *za, struct zip_cdir *cd, FILE *out)
-{
-    myoff_t offset;
-    uLong crc;
-    char buf[TORRENT_CRC_LEN+1];
-    
-    if (_zip_cdir_write(cd, out, &za->error) < 0)
-        return -1;
-    
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0)
-        return 0;
-
-
-    /* fix up torrentzip comment */
-
-    offset = ftello(out);
-
-    if (_zip_filerange_crc(out, cd->offset, cd->size, &crc, &za->error) < 0)
-        return -1;
-
-    snprintf(buf, sizeof(buf), "%08lX", (long)crc);
-
-    if (fseeko(out, offset-TORRENT_CRC_LEN, SEEK_SET) < 0) {
-        _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
-        return -1;
-    }
-
-    if (fwrite(buf, TORRENT_CRC_LEN, 1, out) != 1) {
-        _zip_error_set(&za->error, ZIP_ER_WRITE, errno);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-
-static int
-_zip_cdir_set_comment(struct zip_cdir *dest, struct zip *src)
-{
-    if (src->ch_comment_len != -1) {
-        dest->comment = _zip_memdup(src->ch_comment,
-                                    src->ch_comment_len, &src->error);
-        if (dest->comment == NULL)
-            return -1;
-        dest->comment_len = src->ch_comment_len;
-    } else {
-        if (src->cdir && src->cdir->comment) {
-            dest->comment = _zip_memdup(src->cdir->comment,
-                                        src->cdir->comment_len, &src->error);
-            if (dest->comment == NULL)
-                return -1;
-            dest->comment_len = src->cdir->comment_len;
-        }
-    }
-
-    return 0;
-}
-
-
-
-static int
-_zip_changed(struct zip *za, int *survivorsp)
-{
-    int changed, i, survivors;
-
-    changed = survivors = 0;
-
-    if (za->ch_comment_len != -1
-        || za->ch_flags != za->flags)
-        changed = 1;
-
-    for (i=0; i<za->nentry; i++) {
-        if ((za->entry[i].state != ZIP_ST_UNCHANGED)
-            || (za->entry[i].ch_comment_len != -1))
-            changed = 1;
-        if (za->entry[i].state != ZIP_ST_DELETED)
-            survivors++;
-    }
-
-    *survivorsp = survivors;
-
-    return changed;
-}
-
-
-
-static char *
-_zip_create_temp_output(struct zip *za, FILE **outp)
-{
-    char *temp;
-    int tfd;
-    FILE *tfp;
-    
-    if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    sprintf(temp, "%s.XXXXXX", za->zn);
-
-    if ((tfd=mkstemp(temp)) == -1) {
-        _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
-        free(temp);
-        return NULL;
-    }
-    
-    if ((tfp=fdopen(tfd, "r+b")) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
-        close(tfd);
-        remove(temp);
-        free(temp);
-        return NULL;
-    }
-
-    *outp = tfp;
-    return temp;
-}
-
-
-
-static int
-_zip_torrentzip_cmp(const void *a, const void *b)
-{
-    return strcasecmp(((const struct filelist *)a)->name,
-                      ((const struct filelist *)b)->name);
-}
-
-
-
-ZIP_EXTERN int
-zip_add_dir(struct zip *za, const char *name)
-{
-    int len, ret;
-    char *s;
-    struct zip_source *source;
-
-    if (name == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    s = NULL;
-    len = strlen(name);
-
-    if (name[len-1] != '/') {
-        if ((s=(char *)malloc(len+2)) == NULL) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            return -1;
-        }
-        strcpy(s, name);
-        s[len] = '/';
-        s[len+1] = '\0';
-    }
-
-    if ((source=zip_source_buffer(za, NULL, 0, 0)) == NULL) {
-        free(s);
-        return -1;
-    }
-        
-    ret = _zip_replace(za, -1, s ? s : name, source);
-
-    free(s);
-    if (ret < 0)
-        zip_source_free(source);
-
-    return ret;
-}
-
-
-ZIP_EXTERN int
-zip_error_to_str(char *buf, size_t len, int ze, int se)
-{
-    const char *zs, *ss;
-
-    if (ze < 0 || ze >= _zip_nerr_str)
-        return snprintf(buf, len, "Unknown error %d", ze);
-
-    zs = _zip_err_str[ze];
-        
-    switch (_zip_err_type[ze]) {
-    case ZIP_ET_SYS:
-        ss = strerror(se);
-        break;
-        
-    case ZIP_ET_ZLIB:
-        ss = zError(se);
-        break;
-        
-    default:
-        ss = NULL;
-    }
-
-    return snprintf(buf, len, "%s%s%s",
-                    zs, (ss ? ": " : ""), (ss ? ss : ""));
-}
-
-
-ZIP_EXTERN void
-zip_file_error_clear(struct zip_file *zf)
-{
-    _zip_error_clear(&zf->error);
-}
-
-
-ZIP_EXTERN int
-zip_fclose(struct zip_file *zf)
-{
-    int i, ret;
-    
-    if (zf->zstr)
-        inflateEnd(zf->zstr);
-    free(zf->buffer);
-    free(zf->zstr);
-
-    for (i=0; i<zf->za->nfile; i++) {
-        if (zf->za->file[i] == zf) {
-            zf->za->file[i] = zf->za->file[zf->za->nfile-1];
-            zf->za->nfile--;
-            break;
-        }
-    }
-
-    ret = 0;
-    if (zf->error.zip_err)
-        ret = zf->error.zip_err;
-    else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) {
-        /* if EOF, compare CRC */
-        if (zf->crc_orig != zf->crc)
-            ret = ZIP_ER_CRC;
-    }
-
-    free(zf);
-    return ret;
-}
-
-
-int
-_zip_filerange_crc(FILE *fp, myoff_t start, myoff_t len, uLong *crcp,
-                   struct zip_error *errp)
-{
-    Bytef buf[BUFSIZE];
-    size_t n;
-
-    *crcp = crc32(0L, Z_NULL, 0);
-
-    if (fseeko(fp, start, SEEK_SET) != 0) {
-        _zip_error_set(errp, ZIP_ER_SEEK, errno);
-        return -1;
-    }
-    
-    while (len > 0) {
-        n = len > BUFSIZE ? BUFSIZE : len;
-        if ((n=fread(buf, 1, n, fp)) <= 0) {
-            _zip_error_set(errp, ZIP_ER_READ, errno);
-            return -1;
-        }
-
-        *crcp = crc32(*crcp, buf, n);
-
-        len-= n;
-    }
-
-    return 0;
-}
-
-
-ZIP_EXTERN const char *
-zip_file_strerror(struct zip_file *zf)
-{
-    return _zip_error_strerror(&zf->error);
-}
-
-
-/* _zip_file_get_offset(za, ze):
-   Returns the offset of the file data for entry ze.
-
-   On error, fills in za->error and returns 0.
-*/
-
-unsigned int
-_zip_file_get_offset(struct zip *za, int idx)
-{
-    struct zip_dirent de;
-    unsigned int offset;
-
-    offset = za->cdir->entry[idx].offset;
-
-    if (fseeko(za->zp, offset, SEEK_SET) != 0) {
-        _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
-        return 0;
-    }
-
-    if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0)
-        return 0;
-
-    offset += LENTRYSIZE + de.filename_len + de.extrafield_len;
-
-    _zip_dirent_finalize(&de);
-
-    return offset;
-}
-
-
-ZIP_EXTERN void
-zip_file_error_get(struct zip_file *zf, int *zep, int *sep)
-{
-    _zip_error_get(&zf->error, zep, sep);
-}
-
-
-static struct zip_file *_zip_file_new(struct zip *za);
-
-
-
-ZIP_EXTERN struct zip_file *
-zip_fopen_index(struct zip *za, int fileno, int flags)
-{
-    int len, ret;
-    int zfflags;
-    struct zip_file *zf;
-
-    if ((fileno < 0) || (fileno >= za->nentry)) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((flags & ZIP_FL_UNCHANGED) == 0
-        && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) {
-        _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
-        return NULL;
-    }
-
-    if (fileno >= za->cdir->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    zfflags = 0;
-    switch (za->cdir->entry[fileno].comp_method) {
-    case ZIP_CM_STORE:
-        zfflags |= ZIP_ZF_CRC;
-        break;
-
-    case ZIP_CM_DEFLATE:
-        if ((flags & ZIP_FL_COMPRESSED) == 0)
-            zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP;
-        break;
-    default:
-        if ((flags & ZIP_FL_COMPRESSED) == 0) {
-            _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
-            return NULL;
-        }
-        break;
-    }
-
-    zf = _zip_file_new(za);
-
-    zf->flags = zfflags;
-    /* zf->name = za->cdir->entry[fileno].filename; */
-    zf->method = za->cdir->entry[fileno].comp_method;
-    zf->bytes_left = za->cdir->entry[fileno].uncomp_size;
-    zf->cbytes_left = za->cdir->entry[fileno].comp_size;
-    zf->crc_orig = za->cdir->entry[fileno].crc;
-
-    if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) {
-        zip_fclose(zf);
-        return NULL;
-    }
-    
-    if ((zf->flags & ZIP_ZF_DECOMP) == 0)
-        zf->bytes_left = zf->cbytes_left;
-    else {
-        if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            zip_fclose(zf);
-            return NULL;
-        }
-
-        len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
-        if (len <= 0) {
-            _zip_error_copy(&za->error, &zf->error);
-            zip_fclose(zf);
-        return NULL;
-        }
-
-        if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            zip_fclose(zf);
-            return NULL;
-        }
-        zf->zstr->zalloc = Z_NULL;
-        zf->zstr->zfree = Z_NULL;
-        zf->zstr->opaque = NULL;
-        zf->zstr->next_in = (Bytef *)zf->buffer;
-        zf->zstr->avail_in = len;
-        
-        /* negative value to tell zlib that there is no header */
-        if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) {
-            _zip_error_set(&za->error, ZIP_ER_ZLIB, ret);
-            zip_fclose(zf);
-            return NULL;
-        }
-    }
-    
-    return zf;
-}
-
-
-
-int
-_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf)
-{
-    int i, j;
-
-    if (zf->error.zip_err != ZIP_ER_OK)
-        return -1;
-
-    if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0)
-        return 0;
-    
-    if (fseeko(zf->za->zp, zf->fpos, SEEK_SET) < 0) {
-        _zip_error_set(&zf->error, ZIP_ER_SEEK, errno);
-        return -1;
-    }
-    if (buflen < zf->cbytes_left)
-        i = buflen;
-    else
-        i = zf->cbytes_left;
-
-    j = fread(buf, 1, i, zf->za->zp);
-    if (j == 0) {
-        _zip_error_set(&zf->error, ZIP_ER_EOF, 0);
-        j = -1;
-    }
-    else if (j < 0)
-        _zip_error_set(&zf->error, ZIP_ER_READ, errno);
-    else {
-        zf->fpos += j;
-        zf->cbytes_left -= j;
-    }
-
-    return j;        
-}
-
-
-
-static struct zip_file *
-_zip_file_new(struct zip *za)
-{
-    struct zip_file *zf, **file;
-    int n;
-
-    if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-    
-    if (za->nfile >= za->nfile_alloc-1) {
-        n = za->nfile_alloc + 10;
-        file = (struct zip_file **)realloc(za->file,
-                                           n*sizeof(struct zip_file *));
-        if (file == NULL) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            free(zf);
-            return NULL;
-        }
-        za->nfile_alloc = n;
-        za->file = file;
-    }
-
-    za->file[za->nfile++] = zf;
-
-    zf->za = za;
-    _zip_error_init(&zf->error);
-    zf->flags = 0;
-    zf->crc = crc32(0L, Z_NULL, 0);
-    zf->crc_orig = 0;
-    zf->method = -1;
-    zf->bytes_left = zf->cbytes_left = 0;
-    zf->fpos = 0;
-    zf->buffer = NULL;
-    zf->zstr = NULL;
-
-    return zf;
-}
-
-
-ZIP_EXTERN struct zip_file *
-zip_fopen(struct zip *za, const char *fname, int flags)
-{
-    int idx;
-
-    if ((idx=zip_name_locate(za, fname, flags)) < 0)
-        return NULL;
-
-    return zip_fopen_index(za, idx, flags);
-}
-
-
-ZIP_EXTERN int
-zip_set_file_comment(struct zip *za, int idx, const char *comment, int len)
-{
-    char *tmpcom;
-
-    if (idx < 0 || idx >= za->nentry
-        || len < 0 || len > MAXCOMLEN
-        || (len > 0 && comment == NULL)) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if (len > 0) {
-        if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
-            return -1;
-    }
-    else
-        tmpcom = NULL;
-
-    free(za->entry[idx].ch_comment);
-    za->entry[idx].ch_comment = tmpcom;
-    za->entry[idx].ch_comment_len = len;
-    
-    return 0;
-}
-
-
-ZIP_EXTERN struct zip_source *
-zip_source_file(struct zip *za, const char *fname, myoff_t start, myoff_t len)
-{
-    if (za == NULL)
-        return NULL;
-
-    if (fname == NULL || start < 0 || len < -1) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    return _zip_source_file_or_p(za, fname, NULL, start, len);
-}
-
-
-struct read_data {
-    const char *buf, *data, *end;
-    time_t mtime;
-    int freep;
-};
-
-static ssize_t read_data(void *state, void *data, size_t len,
-                         enum zip_source_cmd cmd);
-
-
-
-ZIP_EXTERN struct zip_source *
-zip_source_buffer(struct zip *za, const void *data, myoff_t len, int freep)
-{
-    struct read_data *f;
-    struct zip_source *zs;
-
-    if (za == NULL)
-        return NULL;
-
-    if (len < 0 || (data == NULL && len > 0)) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((f=(struct read_data *)malloc(sizeof(*f))) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    f->data = (const char *)data;
-    f->end = ((const char *)data)+len;
-    f->freep = freep;
-    f->mtime = time(NULL);
-    
-    if ((zs=zip_source_function(za, read_data, f)) == NULL) {
-        free(f);
-        return NULL;
-    }
-
-    return zs;
-}
-
-
-
-static ssize_t
-read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
-{
-    struct read_data *z;
-    char *buf;
-    size_t n;
-
-    z = (struct read_data *)state;
-    buf = (char *)data;
-
-    switch (cmd) {
-    case ZIP_SOURCE_OPEN:
-        z->buf = z->data;
-        return 0;
-        
-    case ZIP_SOURCE_READ:
-        n = z->end - z->buf;
-        if (n > len)
-            n = len;
-
-        if (n) {
-            memcpy(buf, z->buf, n);
-            z->buf += n;
-        }
-
-        return n;
-        
-    case ZIP_SOURCE_CLOSE:
-        return 0;
-
-    case ZIP_SOURCE_STAT:
-        {
-            struct zip_stat *st;
-            
-            if (len < sizeof(*st))
-                return -1;
-
-            st = (struct zip_stat *)data;
-
-            zip_stat_init(st);
-            st->mtime = z->mtime;
-            st->size = z->end - z->data;
-            
-            return sizeof(*st);
-        }
-
-    case ZIP_SOURCE_ERROR:
-        {
-            int *e;
-
-            if (len < sizeof(int)*2)
-                return -1;
-
-            e = (int *)data;
-            e[0] = e[1] = 0;
-        }
-        return sizeof(int)*2;
-
-    case ZIP_SOURCE_FREE:
-        if (z->freep) {
-            free((void *)z->data);
-            z->data = NULL;
-        }
-        free(z);
-        return 0;
-
-    default:
-        ;
-    }
-
-    return -1;
-}
-
-
-int
-_zip_set_name(struct zip *za, int idx, const char *name)
-{
-    char *s;
-    int i;
-    
-    if (idx < 0 || idx >= za->nentry || name == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if ((i=_zip_name_locate(za, name, 0, NULL)) != -1 && i != idx) {
-        _zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
-        return -1;
-    }
-
-    /* no effective name change */
-    if (i == idx)
-        return 0;
-    
-    if ((s=strdup(name)) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return -1;
-    }
-    
-    if (za->entry[idx].state == ZIP_ST_UNCHANGED) 
-        za->entry[idx].state = ZIP_ST_RENAMED;
-
-    free(za->entry[idx].ch_filename);
-    za->entry[idx].ch_filename = s;
-
-    return 0;
-}
-
-
-ZIP_EXTERN int
-zip_set_archive_flag(struct zip *za, int flag, int value)
-{
-    if (value)
-        za->ch_flags |= flag;
-    else
-        za->ch_flags &= ~flag;
-
-    return 0;
-}
-
-
-void
-_zip_unchange_data(struct zip_entry *ze)
-{
-    if (ze->source) {
-        (void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE);
-        free(ze->source);
-        ze->source = NULL;
-    }
-    
-    ze->state = ze->ch_filename ? ZIP_ST_RENAMED : ZIP_ST_UNCHANGED;
-}
-
-
-ZIP_EXTERN int
-zip_unchange_archive(struct zip *za)
-{
-    free(za->ch_comment);
-    za->ch_comment = NULL;
-    za->ch_comment_len = -1;
-
-    za->ch_flags = za->flags;
-
-    return 0;
-}
-
-ZIP_EXTERN int
-zip_unchange(struct zip *za, int idx)
-{
-    return _zip_unchange(za, idx, 0);
-}
-
-
-
-int
-_zip_unchange(struct zip *za, int idx, int allow_duplicates)
-{
-    int i;
-    
-    if (idx < 0 || idx >= za->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if (za->entry[idx].ch_filename) {
-        if (!allow_duplicates) {
-            i = _zip_name_locate(za,
-                         _zip_get_name(za, idx, ZIP_FL_UNCHANGED, NULL),
-                                 0, NULL);
-            if (i != -1 && i != idx) {
-                _zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
-                return -1;
-            }
-        }
-
-        free(za->entry[idx].ch_filename);
-        za->entry[idx].ch_filename = NULL;
-    }
-
-    free(za->entry[idx].ch_comment);
-    za->entry[idx].ch_comment = NULL;
-    za->entry[idx].ch_comment_len = -1;
-
-    _zip_unchange_data(za->entry+idx);
-
-    return 0;
-}
-
-ZIP_EXTERN int
-zip_unchange_all(struct zip *za)
-{
-    int ret, i;
-
-    ret = 0;
-    for (i=0; i<za->nentry; i++)
-        ret |= _zip_unchange(za, i, 1);
-
-    ret |= zip_unchange_archive(za);
-
-    return ret;
-}
-
-
-ZIP_EXTERN int
-zip_set_archive_comment(struct zip *za, const char *comment, int len)
-{
-    char *tmpcom;
-
-    if (len < 0 || len > MAXCOMLEN
-        || (len > 0 && comment == NULL)) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if (len > 0) {
-        if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
-            return -1;
-    }
-    else
-        tmpcom = NULL;
-
-    free(za->ch_comment);
-    za->ch_comment = tmpcom;
-    za->ch_comment_len = len;
-    
-    return 0;
-}
-
-
-ZIP_EXTERN int
-zip_replace(struct zip *za, int idx, struct zip_source *source)
-{
-    if (idx < 0 || idx >= za->nentry || source == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if (_zip_replace(za, idx, NULL, source) == -1)
-        return -1;
-
-    return 0;
-}
-
-
-
-
-int
-_zip_replace(struct zip *za, int idx, const char *name,
-             struct zip_source *source)
-{
-    if (idx == -1) {
-        if (_zip_entry_new(za) == NULL)
-            return -1;
-
-        idx = za->nentry - 1;
-    }
-    
-    _zip_unchange_data(za->entry+idx);
-
-    if (name && _zip_set_name(za, idx, name) != 0)
-        return -1;
-    
-    za->entry[idx].state = ((za->cdir == NULL || idx >= za->cdir->nentry)
-                            ? ZIP_ST_ADDED : ZIP_ST_REPLACED);
-    za->entry[idx].source = source;
-
-    return idx;
-}
-
-
-ZIP_EXTERN int
-zip_rename(struct zip *za, int idx, const char *name)
-{
-    const char *old_name;
-    int old_is_dir, new_is_dir;
-    
-    if (idx >= za->nentry || idx < 0 || name[0] == '\0') {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if ((old_name=zip_get_name(za, idx, 0)) == NULL)
-        return -1;
-                                                                    
-    new_is_dir = (name[strlen(name)-1] == '/');
-    old_is_dir = (old_name[strlen(old_name)-1] == '/');
-
-    if (new_is_dir != old_is_dir) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    return _zip_set_name(za, idx, name);
-}
-
-#include <sys/stat.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static void set_error(int *, struct zip_error *, int);
-static struct zip *_zip_allocate_new(const char *, int *);
-static int _zip_checkcons(FILE *, struct zip_cdir *, struct zip_error *);
-static void _zip_check_torrentzip(struct zip *);
-static struct zip_cdir *_zip_find_central_dir(FILE *, int, int *, myoff_t);
-static int _zip_file_exists(const char *, int, int *);
-static int _zip_headercomp(struct zip_dirent *, int,
-                           struct zip_dirent *, int);
-static unsigned char *_zip_memmem(const unsigned char *, int,
-                                  const unsigned char *, int);
-static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *,
-                                 int, int, struct zip_error *);
-
-
-
-ZIP_EXTERN struct zip *
-zip_open(const char *fn, int flags, int *zep)
-{
-    FILE *fp;
-    struct zip *za;
-    struct zip_cdir *cdir;
-    int i;
-    myoff_t len;
-    
-    switch (_zip_file_exists(fn, flags, zep)) {
-    case -1:
-        return NULL;
-    case 0:
-        return _zip_allocate_new(fn, zep);
-    default:
-        break;
-    }
-
-    if ((fp=fopen(fn, "rb")) == NULL) {
-        set_error(zep, NULL, ZIP_ER_OPEN);
-        return NULL;
-    }
-
-    fseeko(fp, 0, SEEK_END);
-    len = ftello(fp);
-
-    /* treat empty files as empty archives */
-    if (len == 0) {
-        if ((za=_zip_allocate_new(fn, zep)) == NULL)
-            fclose(fp);
-        else
-            za->zp = fp;
-        return za;
-    }
-
-    cdir = _zip_find_central_dir(fp, flags, zep, len);
-    if (cdir == NULL) {
-        fclose(fp);
-        return NULL;
-    }
-
-    if ((za=_zip_allocate_new(fn, zep)) == NULL) {
-        _zip_cdir_free(cdir);
-        fclose(fp);
-        return NULL;
-    }
-
-    za->cdir = cdir;
-    za->zp = fp;
-
-    if ((za->entry=(struct zip_entry *)malloc(sizeof(*(za->entry))
-                                              * cdir->nentry)) == NULL) {
-        set_error(zep, NULL, ZIP_ER_MEMORY);
-        _zip_free(za);
-        return NULL;
-    }
-    for (i=0; i<cdir->nentry; i++)
-        _zip_entry_new(za);
-
-    _zip_check_torrentzip(za);
-    za->ch_flags = za->flags;
-
-    return za;
-}
-
-
-
-static void
-set_error(int *zep, struct zip_error *err, int ze)
-{
-    int se;
-
-    if (err) {
-        _zip_error_get(err, &ze, &se);
-        if (zip_error_get_sys_type(ze) == ZIP_ET_SYS)
-            errno = se;
-    }
-
-    if (zep)
-        *zep = ze;
-}
-
-
-
-/* _zip_readcdir:
-   tries to find a valid end-of-central-directory at the beginning of
-   buf, and then the corresponding central directory entries.
-   Returns a struct zip_cdir which contains the central directory 
-   entries, or NULL if unsuccessful. */
-
-static struct zip_cdir *
-_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
-              int flags, struct zip_error *error)
-{
-    struct zip_cdir *cd;
-    unsigned char *cdp, **bufp;
-    int i, comlen, nentry;
-
-    comlen = buf + buflen - eocd - EOCDLEN;
-    if (comlen < 0) {
-        /* not enough bytes left for comment */
-        _zip_error_set(error, ZIP_ER_NOZIP, 0);
-        return NULL;
-    }
-
-    /* check for end-of-central-dir magic */
-    if (memcmp(eocd, EOCD_MAGIC, 4) != 0) {
-        _zip_error_set(error, ZIP_ER_NOZIP, 0);
-        return NULL;
-    }
-
-    if (memcmp(eocd+4, "\0\0\0\0", 4) != 0) {
-        _zip_error_set(error, ZIP_ER_MULTIDISK, 0);
-        return NULL;
-    }
-
-    cdp = eocd + 8;
-    /* number of cdir-entries on this disk */
-    i = _zip_read2(&cdp);
-    /* number of cdir-entries */
-    nentry = _zip_read2(&cdp);
-
-    if ((cd=_zip_cdir_new(nentry, error)) == NULL)
-        return NULL;
-
-    cd->size = _zip_read4(&cdp);
-    cd->offset = _zip_read4(&cdp);
-    cd->comment = NULL;
-    cd->comment_len = _zip_read2(&cdp);
-
-    if ((comlen < cd->comment_len) || (cd->nentry != i)) {
-        _zip_error_set(error, ZIP_ER_NOZIP, 0);
-        free(cd);
-        return NULL;
-    }
-    if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) {
-        _zip_error_set(error, ZIP_ER_INCONS, 0);
-        free(cd);
-        return NULL;
-    }
-
-    if (cd->comment_len) {
-        if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN,
-                                             cd->comment_len, error))
-            == NULL) {
-            free(cd);
-            return NULL;
-        }
-    }
-
-    cdp = eocd;
-    if (cd->size < (unsigned int)(eocd-buf)) {
-        /* if buffer already read in, use it */
-        cdp = eocd - cd->size;
-        bufp = &cdp;
-    }
-    else {
-        /* go to start of cdir and read it entry by entry */
-        bufp = NULL;
-        clearerr(fp);
-        fseeko(fp, cd->offset, SEEK_SET);
-        /* possible consistency check: cd->offset =
-           len-(cd->size+cd->comment_len+EOCDLEN) ? */
-        if (ferror(fp) || ((unsigned long)ftello(fp) != cd->offset)) {
-            /* seek error or offset of cdir wrong */
-            if (ferror(fp))
-                _zip_error_set(error, ZIP_ER_SEEK, errno);
-            else
-                _zip_error_set(error, ZIP_ER_NOZIP, 0);
-            free(cd);
-            return NULL;
-        }
-    }
-
-    for (i=0; i<cd->nentry; i++) {
-        if ((_zip_dirent_read(cd->entry+i, fp, bufp, eocd-cdp, 0,
-                              error)) < 0) {
-            cd->nentry = i;
-            _zip_cdir_free(cd);
-            return NULL;
-        }
-    }
-    
-    return cd;
-}
-
-
-
-/* _zip_checkcons:
-   Checks the consistency of the central directory by comparing central
-   directory entries with local headers and checking for plausible
-   file and header offsets. Returns -1 if not plausible, else the
-   difference between the lowest and the highest fileposition reached */
-
-static int
-_zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error)
-{
-    int i;
-    unsigned int min, max, j;
-    struct zip_dirent temp;
-
-    if (cd->nentry) {
-        max = cd->entry[0].offset;
-        min = cd->entry[0].offset;
-    }
-    else
-        min = max = 0;
-
-    for (i=0; i<cd->nentry; i++) {
-        if (cd->entry[i].offset < min)
-            min = cd->entry[i].offset;
-        if (min > cd->offset) {
-            _zip_error_set(error, ZIP_ER_NOZIP, 0);
-            return -1;
-        }
-        
-        j = cd->entry[i].offset + cd->entry[i].comp_size
-            + cd->entry[i].filename_len + LENTRYSIZE;
-        if (j > max)
-            max = j;
-        if (max > cd->offset) {
-            _zip_error_set(error, ZIP_ER_NOZIP, 0);
-            return -1;
-        }
-        
-        if (fseeko(fp, cd->entry[i].offset, SEEK_SET) != 0) {
-            _zip_error_set(error, ZIP_ER_SEEK, 0);
-            return -1;
-        }
-        
-        if (_zip_dirent_read(&temp, fp, NULL, 0, 1, error) == -1)
-            return -1;
-        
-        if (_zip_headercomp(cd->entry+i, 0, &temp, 1) != 0) {
-            _zip_error_set(error, ZIP_ER_INCONS, 0);
-            _zip_dirent_finalize(&temp);
-            return -1;
-        }
-        _zip_dirent_finalize(&temp);
-    }
-
-    return max - min;
-}
-
-
-
-/* _zip_check_torrentzip:
-   check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */
-
-static void
-_zip_check_torrentzip(struct zip *za)
-{
-    uLong crc_got, crc_should;
-    char buf[8+1];
-    char *end;
-
-    if (za->zp == NULL || za->cdir == NULL)
-        return;
-
-    if (za->cdir->comment_len != TORRENT_SIG_LEN+8
-        || strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0)
-        return;
-
-    memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8);
-    buf[8] = '\0';
-    errno = 0;
-    crc_should = strtoul(buf, &end, 16);
-    if ((crc_should == UINT_MAX && errno != 0) || (end && *end))
-        return;
-
-    if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size,
-                           &crc_got, NULL) < 0)
-        return;
-
-    if (crc_got == crc_should)
-        za->flags |= ZIP_AFL_TORRENT;
-}
-
-
-
-
-/* _zip_headercomp:
-   compares two headers h1 and h2; if they are local headers, set
-   local1p or local2p respectively to 1, else 0. Return 0 if they
-   are identical, -1 if not. */
-
-static int
-_zip_headercomp(struct zip_dirent *h1, int local1p, struct zip_dirent *h2,
-           int local2p)
-{
-    if ((h1->version_needed != h2->version_needed)
-#if 0
-        /* some zip-files have different values in local
-           and global headers for the bitflags */
-        || (h1->bitflags != h2->bitflags)
-#endif
-        || (h1->comp_method != h2->comp_method)
-        || (h1->last_mod != h2->last_mod)
-        || (h1->filename_len != h2->filename_len)
-        || !h1->filename || !h2->filename
-        || strcmp(h1->filename, h2->filename))
-        return -1;
-
-    /* check that CRC and sizes are zero if data descriptor is used */
-    if ((h1->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) && local1p
-        && (h1->crc != 0
-            || h1->comp_size != 0
-            || h1->uncomp_size != 0))
-        return -1;
-    if ((h2->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) && local2p
-        && (h2->crc != 0
-            || h2->comp_size != 0
-            || h2->uncomp_size != 0))
-        return -1;
-    
-    /* check that CRC and sizes are equal if no data descriptor is used */
-    if (((h1->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0 || local1p == 0)
-        && ((h2->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0 || local2p == 0)) {
-        if ((h1->crc != h2->crc)
-            || (h1->comp_size != h2->comp_size)
-            || (h1->uncomp_size != h2->uncomp_size))
-            return -1;
-    }
-    
-    if ((local1p == local2p)
-        && ((h1->extrafield_len != h2->extrafield_len)
-            || (h1->extrafield_len && h2->extrafield
-                && memcmp(h1->extrafield, h2->extrafield,
-                          h1->extrafield_len))))
-        return -1;
-
-    /* if either is local, nothing more to check */
-    if (local1p || local2p)
-        return 0;
-
-    if ((h1->version_madeby != h2->version_madeby)
-        || (h1->disk_number != h2->disk_number)
-        || (h1->int_attrib != h2->int_attrib)
-        || (h1->ext_attrib != h2->ext_attrib)
-        || (h1->offset != h2->offset)
-        || (h1->comment_len != h2->comment_len)
-        || (h1->comment_len && h2->comment
-            && memcmp(h1->comment, h2->comment, h1->comment_len)))
-        return -1;
-
-    return 0;
-}
-
-
-
-static struct zip *
-_zip_allocate_new(const char *fn, int *zep)
-{
-    struct zip *za;
-    struct zip_error error;
-
-    if ((za=_zip_new(&error)) == NULL) {
-        set_error(zep, &error, 0);
-        return NULL;
-    }
-        
-    za->zn = strdup(fn);
-    if (!za->zn) {
-        _zip_free(za);
-        set_error(zep, NULL, ZIP_ER_MEMORY);
-        return NULL;
-    }
-    return za;
-}
-
-
-
-static int
-_zip_file_exists(const char *fn, int flags, int *zep)
-{
-    struct stat st;
-
-    if (fn == NULL) {
-        set_error(zep, NULL, ZIP_ER_INVAL);
-        return -1;
-    }
-    
-    if (stat(fn, &st) != 0) {
-        if (flags & ZIP_CREATE)
-            return 0;
-        else {
-            set_error(zep, NULL, ZIP_ER_OPEN);
-            return -1;
-        }
-    }
-    else if ((flags & ZIP_EXCL)) {
-        set_error(zep, NULL, ZIP_ER_EXISTS);
-        return -1;
-    }
-    /* ZIP_CREATE gets ignored if file exists and not ZIP_EXCL,
-       just like open() */
-
-    return 1;
-}
-
-
-
-static struct zip_cdir *
-_zip_find_central_dir(FILE *fp, int flags, int *zep, myoff_t len)
-{
-    struct zip_cdir *cdir, *cdirnew;
-    unsigned char *buf, *match;
-    int a, best, buflen, i;
-    struct zip_error zerr;
-
-    i = fseeko(fp, -(len < CDBUFSIZE ? len : CDBUFSIZE), SEEK_END);
-    if (i == -1 && errno != EFBIG) {
-        /* seek before start of file on my machine */
-        set_error(zep, NULL, ZIP_ER_SEEK);
-        return NULL;
-    }
-
-    /* 64k is too much for stack */
-    if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) {
-        set_error(zep, NULL, ZIP_ER_MEMORY);
-        return NULL;
-    }
-
-    clearerr(fp);
-    buflen = fread(buf, 1, CDBUFSIZE, fp);
-
-    if (ferror(fp)) {
-        set_error(zep, NULL, ZIP_ER_READ);
-        free(buf);
-        return NULL;
-    }
-    
-    best = -1;
-    cdir = NULL;
-    match = buf;
-    _zip_error_set(&zerr, ZIP_ER_NOZIP, 0);
-
-    while ((match=_zip_memmem(match, buflen-(match-buf)-18,
-                              (const unsigned char *)EOCD_MAGIC, 4))!=NULL) {
-        /* found match -- check, if good */
-        /* to avoid finding the same match all over again */
-        match++;
-        if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags,
-                                   &zerr)) == NULL)
-            continue;
-
-        if (cdir) {
-            if (best <= 0)
-                best = _zip_checkcons(fp, cdir, &zerr);
-            a = _zip_checkcons(fp, cdirnew, &zerr);
-            if (best < a) {
-                _zip_cdir_free(cdir);
-                cdir = cdirnew;
-                best = a;
-            }
-            else
-                _zip_cdir_free(cdirnew);
-        }
-        else {
-            cdir = cdirnew;
-            if (flags & ZIP_CHECKCONS)
-                best = _zip_checkcons(fp, cdir, &zerr);
-            else
-                best = 0;
-        }
-        cdirnew = NULL;
-    }
-
-    free(buf);
-    
-    if (best < 0) {
-        set_error(zep, &zerr, 0);
-        _zip_cdir_free(cdir);
-        return NULL;
-    }
-
-    return cdir;
-}
-
-
-
-static unsigned char *
-_zip_memmem(const unsigned char *big, int biglen, const unsigned char *little, 
-       int littlelen)
-{
-    const unsigned char *p;
-    
-    if ((biglen < littlelen) || (littlelen == 0))
-        return NULL;
-    p = big-1;
-    while ((p=(const unsigned char *)
-                memchr(p+1, little[0], (size_t)(big-(p+1)+biglen-littlelen+1)))
-           != NULL) {
-        if (memcmp(p+1, little+1, littlelen-1)==0)
-            return (unsigned char *)p;
-    }
-
-    return NULL;
-}
-
-
-/* _zip_new:
-   creates a new zipfile struct, and sets the contents to zero; returns
-   the new struct. */
-
-struct zip *
-_zip_new(struct zip_error *error)
-{
-    struct zip *za;
-
-    za = (struct zip *)malloc(sizeof(struct zip));
-    if (!za) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    za->zn = NULL;
-    za->zp = NULL;
-    _zip_error_init(&za->error);
-    za->cdir = NULL;
-    za->ch_comment = NULL;
-    za->ch_comment_len = -1;
-    za->nentry = za->nentry_alloc = 0;
-    za->entry = NULL;
-    za->nfile = za->nfile_alloc = 0;
-    za->file = NULL;
-    za->flags = za->ch_flags = 0;
-    
-    return za;
-}
-
-
-void *
-_zip_memdup(const void *mem, size_t len, struct zip_error *error)
-{
-    void *ret;
-
-    ret = malloc(len);
-    if (!ret) {
-        _zip_error_set(error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    memcpy(ret, mem, len);
-
-    return ret;
-}
-
-
-ZIP_EXTERN int
-zip_get_num_files(struct zip *za)
-{
-    if (za == NULL)
-        return -1;
-
-    return za->nentry;
-}
-
-ZIP_EXTERN const char *
-zip_get_name(struct zip *za, int idx, int flags)
-{
-    return _zip_get_name(za, idx, flags, &za->error);
-}
-
-
-
-const char *
-_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error)
-{
-    if (idx < 0 || idx >= za->nentry) {
-        _zip_error_set(error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((flags & ZIP_FL_UNCHANGED) == 0) {
-        if (za->entry[idx].state == ZIP_ST_DELETED) {
-            _zip_error_set(error, ZIP_ER_DELETED, 0);
-            return NULL;
-        }
-        if (za->entry[idx].ch_filename)
-            return za->entry[idx].ch_filename;
-    }
-
-    if (za->cdir == NULL || idx >= za->cdir->nentry) {
-        _zip_error_set(error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-    
-    return za->cdir->entry[idx].filename;
-}
-
-
-ZIP_EXTERN const char *
-zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags)
-{
-    if (idx < 0 || idx >= za->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((flags & ZIP_FL_UNCHANGED)
-        || (za->entry[idx].ch_comment_len == -1)) {
-        if (lenp != NULL)
-            *lenp = za->cdir->entry[idx].comment_len;
-        return za->cdir->entry[idx].comment;
-    }
-    
-    if (lenp != NULL)
-        *lenp = za->entry[idx].ch_comment_len;
-    return za->entry[idx].ch_comment;
-}
-
-
-ZIP_EXTERN int
-zip_get_archive_flag(struct zip *za, int flag, int flags)
-{
-    int fl;
-
-    fl = (flags & ZIP_FL_UNCHANGED) ? za->flags : za->ch_flags;
-
-    return (fl & flag) ? 1 : 0;
-}
-
-
-ZIP_EXTERN const char *
-zip_get_archive_comment(struct zip *za, int *lenp, int flags)
-{
-    if ((flags & ZIP_FL_UNCHANGED)
-        || (za->ch_comment_len == -1)) {
-        if (za->cdir) {
-            if (lenp != NULL)
-                *lenp = za->cdir->comment_len;
-            return za->cdir->comment;
-        }
-        else {
-            if (lenp != NULL)
-                *lenp = -1;
-            return NULL;
-        }
-    }
-    
-    if (lenp != NULL)
-        *lenp = za->ch_comment_len;
-    return za->ch_comment;
-}
-
-
-/* _zip_free:
-   frees the space allocated to a zipfile struct, and closes the
-   corresponding file. */
-
-void
-_zip_free(struct zip *za)
-{
-    int i;
-
-    if (za == NULL)
-        return;
-
-    if (za->zn)
-        free(za->zn);
-
-    if (za->zp)
-        fclose(za->zp);
-
-    _zip_cdir_free(za->cdir);
-
-    if (za->entry) {
-        for (i=0; i<za->nentry; i++) {
-            _zip_entry_free(za->entry+i);
-        }
-        free(za->entry);
-    }
-
-    for (i=0; i<za->nfile; i++) {
-        if (za->file[i]->error.zip_err == ZIP_ER_OK) {
-            _zip_error_set(&za->file[i]->error, ZIP_ER_ZIPCLOSED, 0);
-            za->file[i]->za = NULL;
-        }
-    }
-
-    free(za->file);
-    
-    free(za);
-
-    return;
-}
-
-
-ZIP_EXTERN ssize_t
-zip_fread(struct zip_file *zf, void *outbuf, size_t toread)
-{
-    int ret;
-    size_t out_before, len;
-    int i;
-
-    if (!zf)
-        return -1;
-
-    if (zf->error.zip_err != 0)
-        return -1;
-
-    if ((zf->flags & ZIP_ZF_EOF) || (toread == 0))
-        return 0;
-
-    if (zf->bytes_left == 0) {
-        zf->flags |= ZIP_ZF_EOF;
-        if (zf->flags & ZIP_ZF_CRC) {
-            if (zf->crc != zf->crc_orig) {
-                _zip_error_set(&zf->error, ZIP_ER_CRC, 0);
-                return -1;
-            }
-        }
-        return 0;
-    }
-    
-    if ((zf->flags & ZIP_ZF_DECOMP) == 0) {
-        ret = _zip_file_fillbuf(outbuf, toread, zf);
-        if (ret > 0) {
-            if (zf->flags & ZIP_ZF_CRC)
-                zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret);
-            zf->bytes_left -= ret;
-        }
-        return ret;
-    }
-    
-    zf->zstr->next_out = (Bytef *)outbuf;
-    zf->zstr->avail_out = toread;
-    out_before = zf->zstr->total_out;
-    
-    /* endless loop until something has been accomplished */
-    for (;;) {
-        ret = inflate(zf->zstr, Z_SYNC_FLUSH);
-
-        switch (ret) {
-        case Z_OK:
-        case Z_STREAM_END:
-            /* all ok */
-            /* Z_STREAM_END probably won't happen, since we didn't
-               have a header */
-            len = zf->zstr->total_out - out_before;
-            if (len >= zf->bytes_left || len >= toread) {
-                if (zf->flags & ZIP_ZF_CRC)
-                    zf->crc = crc32(zf->crc, (Bytef *)outbuf, len);
-                zf->bytes_left -= len;
-                return len;
-            }
-            break;
-
-        case Z_BUF_ERROR:
-            if (zf->zstr->avail_in == 0) {
-                i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
-                if (i == 0) {
-                    _zip_error_set(&zf->error, ZIP_ER_INCONS, 0);
-                    return -1;
-                }
-                else if (i < 0)
-                    return -1;
-                zf->zstr->next_in = (Bytef *)zf->buffer;
-                zf->zstr->avail_in = i;
-                continue;
-            }
-            /* fallthrough */
-        case Z_NEED_DICT:
-        case Z_DATA_ERROR:
-        case Z_STREAM_ERROR:
-        case Z_MEM_ERROR:
-            _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret);
-            return -1;
-        }
-    }
-}
-
-
-ZIP_EXTERN const char *
-zip_strerror(struct zip *za)
-{
-    return _zip_error_strerror(&za->error);
-}
-
-
-ZIP_EXTERN void
-zip_stat_init(struct zip_stat *st)
-{
-    st->name = NULL;
-    st->index = -1;
-    st->crc = 0;
-    st->mtime = (time_t)-1;
-    st->size = -1;
-    st->comp_size = -1;
-    st->comp_method = ZIP_CM_STORE;
-    st->encryption_method = ZIP_EM_NONE;
-}
-
-
-ZIP_EXTERN int
-zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
-{
-    const char *name;
-    
-    if (index < 0 || index >= za->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-
-    if ((name=zip_get_name(za, index, flags)) == NULL)
-        return -1;
-    
-
-    if ((flags & ZIP_FL_UNCHANGED) == 0
-        && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) {
-        if (za->entry[index].source->f(za->entry[index].source->ud,
-                                     st, sizeof(*st), ZIP_SOURCE_STAT) < 0) {
-            _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
-            return -1;
-        }
-    }
-    else {
-        if (za->cdir == NULL || index >= za->cdir->nentry) {
-            _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-            return -1;
-        }
-        
-        st->crc = za->cdir->entry[index].crc;
-        st->size = za->cdir->entry[index].uncomp_size;
-        st->mtime = za->cdir->entry[index].last_mod;
-        st->comp_size = za->cdir->entry[index].comp_size;
-        st->comp_method = za->cdir->entry[index].comp_method;
-        if (za->cdir->entry[index].bitflags & ZIP_GPBF_ENCRYPTED) {
-            if (za->cdir->entry[index].bitflags & ZIP_GPBF_STRONG_ENCRYPTION) {
-                /* XXX */
-                st->encryption_method = ZIP_EM_UNKNOWN;
-            }
-            else
-                st->encryption_method = ZIP_EM_TRAD_PKWARE;
-        }
-        else
-            st->encryption_method = ZIP_EM_NONE;
-        /* st->bitflags = za->cdir->entry[index].bitflags; */
-    }
-
-    st->index = index;
-    st->name = name;
-    
-    return 0;
-}
-
-
-ZIP_EXTERN int
-zip_stat(struct zip *za, const char *fname, int flags, struct zip_stat *st)
-{
-    int idx;
-
-    if ((idx=zip_name_locate(za, fname, flags)) < 0)
-        return -1;
-
-    return zip_stat_index(za, idx, flags, st);
-}
-
-
-struct read_zip {
-    struct zip_file *zf;
-    struct zip_stat st;
-    myoff_t off, len;
-};
-
-static ssize_t read_zip(void *st, void *data, size_t len,
-                        enum zip_source_cmd cmd);
-
-
-
-ZIP_EXTERN struct zip_source *
-zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
-               myoff_t start, myoff_t len)
-{
-    struct zip_error error;
-    struct zip_source *zs;
-    struct read_zip *p;
-
-    /* XXX: ZIP_FL_RECOMPRESS */
-
-    if (za == NULL)
-        return NULL;
-
-    if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((flags & ZIP_FL_UNCHANGED) == 0
-        && ZIP_ENTRY_DATA_CHANGED(srcza->entry+srcidx)) {
-        _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
-        return NULL;
-    }
-
-    if (len == 0)
-        len = -1;
-
-    if (start == 0 && len == -1 && (flags & ZIP_FL_RECOMPRESS) == 0)
-        flags |= ZIP_FL_COMPRESSED;
-    else
-        flags &= ~ZIP_FL_COMPRESSED;
-
-    if ((p=(struct read_zip *)malloc(sizeof(*p))) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-        
-    _zip_error_copy(&error, &srcza->error);
-        
-    if (zip_stat_index(srcza, srcidx, flags, &p->st) < 0
-        || (p->zf=zip_fopen_index(srcza, srcidx, flags)) == NULL) {
-        free(p);
-        _zip_error_copy(&za->error, &srcza->error);
-        _zip_error_copy(&srcza->error, &error);
-        
-        return NULL;
-    }
-    p->off = start;
-    p->len = len;
-
-    if ((flags & ZIP_FL_COMPRESSED) == 0) {
-        p->st.size = p->st.comp_size = len;
-        p->st.comp_method = ZIP_CM_STORE;
-        p->st.crc = 0;
-    }
-    
-    if ((zs=zip_source_function(za, read_zip, p)) == NULL) {
-        free(p);
-        return NULL;
-    }
-
-    return zs;
-}
-
-
-
-static ssize_t
-read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd)
-{
-    struct read_zip *z;
-    char b[8192], *buf;
-    int i, n;
-
-    z = (struct read_zip *)state;
-    buf = (char *)data;
-
-    switch (cmd) {
-    case ZIP_SOURCE_OPEN:
-        for (n=0; n<z->off; n+= i) {
-            i = (z->off-n > sizeof(b) ? sizeof(b) : z->off-n);
-            if ((i=zip_fread(z->zf, b, i)) < 0) {
-                zip_fclose(z->zf);
-                z->zf = NULL;
-                return -1;
-            }
-        }
-        return 0;
-        
-    case ZIP_SOURCE_READ:
-        if (z->len != -1)
-            n = len > z->len ? z->len : len;
-        else
-            n = len;
-        
-
-        if ((i=zip_fread(z->zf, buf, n)) < 0)
-            return -1;
-
-        if (z->len != -1)
-            z->len -= i;
-
-        return i;
-        
-    case ZIP_SOURCE_CLOSE:
-        return 0;
-
-    case ZIP_SOURCE_STAT:
-        if (len < sizeof(z->st))
-            return -1;
-        len = sizeof(z->st);
-
-        memcpy(data, &z->st, len);
-        return len;
-
-    case ZIP_SOURCE_ERROR:
-        {
-            int *e;
-
-            if (len < sizeof(int)*2)
-                return -1;
-
-            e = (int *)data;
-            zip_file_error_get(z->zf, e, e+1);
-        }
-        return sizeof(int)*2;
-
-    case ZIP_SOURCE_FREE:
-        zip_fclose(z->zf);
-        free(z);
-        return 0;
-
-    default:
-        ;
-    }
-
-    return -1;
-}
-
-
-ZIP_EXTERN struct zip_source *
-zip_source_function(struct zip *za, zip_source_callback zcb, void *ud)
-{
-    struct zip_source *zs;
-
-    if (za == NULL)
-        return NULL;
-
-    if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    zs->f = zcb;
-    zs->ud = ud;
-    
-    return zs;
-}
-
-
-ZIP_EXTERN void
-zip_source_free(struct zip_source *source)
-{
-    if (source == NULL)
-        return;
-
-    (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE);
-
-    free(source);
-}
-
-
-struct read_file {
-    char *fname;        /* name of file to copy from */
-    FILE *f;                /* file to copy from */
-    myoff_t off;                /* start offset of */
-    myoff_t len;                /* lengt of data to copy */
-    myoff_t remain;        /* bytes remaining to be copied */
-    int e[2];                /* error codes */
-};
-
-static ssize_t read_file(void *state, void *data, size_t len,
-                     enum zip_source_cmd cmd);
-
-
-
-ZIP_EXTERN struct zip_source *
-zip_source_filep(struct zip *za, FILE *file, myoff_t start, myoff_t len)
-{
-    if (za == NULL)
-        return NULL;
-
-    if (file == NULL || start < 0 || len < -1) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    return _zip_source_file_or_p(za, NULL, file, start, len);
-}
-
-
-
-struct zip_source *
-_zip_source_file_or_p(struct zip *za, const char *fname, FILE *file,
-                      myoff_t start, myoff_t len)
-{
-    struct read_file *f;
-    struct zip_source *zs;
-
-    if (file == NULL && fname == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-        return NULL;
-    }
-
-    if ((f=(struct read_file *)malloc(sizeof(struct read_file))) == NULL) {
-        _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-        return NULL;
-    }
-
-    f->fname = NULL;
-    if (fname) {
-        if ((f->fname=strdup(fname)) == NULL) {
-            _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-            free(f);
-            return NULL;
-        }
-    }
-    f->f = file;
-    f->off = start;
-    f->len = (len ? len : -1);
-    
-    if ((zs=zip_source_function(za, read_file, f)) == NULL) {
-        free(f);
-        return NULL;
-    }
-
-    return zs;
-}
-
-
-
-static ssize_t
-read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
-{
-    struct read_file *z;
-    char *buf;
-    int i, n;
-
-    z = (struct read_file *)state;
-    buf = (char *)data;
-
-    switch (cmd) {
-    case ZIP_SOURCE_OPEN:
-        if (z->fname) {
-            if ((z->f=fopen(z->fname, "rb")) == NULL) {
-                z->e[0] = ZIP_ER_OPEN;
-                z->e[1] = errno;
-                return -1;
-            }
-        }
-
-        if (fseeko(z->f, z->off, SEEK_SET) < 0) {
-            z->e[0] = ZIP_ER_SEEK;
-            z->e[1] = errno;
-            return -1;
-        }
-        z->remain = z->len;
-        return 0;
-        
-    case ZIP_SOURCE_READ:
-        if (z->remain != -1)
-            n = len > z->remain ? z->remain : len;
-        else
-            n = len;
-        
-        if ((i=fread(buf, 1, n, z->f)) < 0) {
-            z->e[0] = ZIP_ER_READ;
-            z->e[1] = errno;
-            return -1;
-        }
-
-        if (z->remain != -1)
-            z->remain -= i;
-
-        return i;
-        
-    case ZIP_SOURCE_CLOSE:
-        if (z->fname) {
-            fclose(z->f);
-            z->f = NULL;
-        }
-        return 0;
-
-    case ZIP_SOURCE_STAT:
-        {
-            struct zip_stat *st;
-            struct stat fst;
-            int err;
-            
-            if (len < sizeof(*st))
-                return -1;
-
-            if (z->f)
-                err = fstat(fileno(z->f), &fst);
-            else
-                err = stat(z->fname, &fst);
-
-            if (err != 0) {
-                z->e[0] = ZIP_ER_READ; /* best match */
-                z->e[1] = errno;
-                return -1;
-            }
-
-            st = (struct zip_stat *)data;
-
-            zip_stat_init(st);
-            st->mtime = fst.st_mtime;
-            if (z->len != -1)
-                st->size = z->len;
-            else if ((fst.st_mode&S_IFMT) == S_IFREG)
-                st->size = fst.st_size;
-
-            return sizeof(*st);
-        }
-
-    case ZIP_SOURCE_ERROR:
-        if (len < sizeof(int)*2)
-            return -1;
-
-        memcpy(data, z->e, sizeof(int)*2);
-        return sizeof(int)*2;
-
-    case ZIP_SOURCE_FREE:
-        free(z->fname);
-        if (z->f)
-            fclose(z->f);
-        free(z);
-        return 0;
-
-    default:
-        ;
-    }
-
-    return -1;
-}
-
-
-ZIP_EXTERN int
-zip_name_locate(struct zip *za, const char *fname, int flags)
-{
-    return _zip_name_locate(za, fname, flags, &za->error);
-}
-
-
-
-int
-_zip_name_locate(struct zip *za, const char *fname, int flags,
-                 struct zip_error *error)
-{
-    int (*cmp)(const char *, const char *);
-    const char *fn, *p;
-    int i, n;
-
-    if (fname == NULL) {
-        _zip_error_set(error, ZIP_ER_INVAL, 0);
-        return -1;
-    }
-    
-    cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
-
-    n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry;
-    for (i=0; i<n; i++) {
-        if (flags & ZIP_FL_UNCHANGED)
-            fn = za->cdir->entry[i].filename;
-        else
-            fn = _zip_get_name(za, i, flags, error);
-
-        /* newly added (partially filled) entry */
-        if (fn == NULL)
-            continue;
-        
-        if (flags & ZIP_FL_NODIR) {
-            p = strrchr(fn, '/');
-            if (p)
-                fn = p+1;
-        }
-
-        if (cmp(fname, fn) == 0)
-            return i;
-    }
-
-    _zip_error_set(error, ZIP_ER_NOENT, 0);
-    return -1;
-}
-
diff --git a/lib/wrappers/zip/zlib.nim b/lib/wrappers/zip/zlib.nim
deleted file mode 100644
index 6bb582b79..000000000
--- a/lib/wrappers/zip/zlib.nim
+++ /dev/null
@@ -1,312 +0,0 @@
-# Converted from Pascal
-
-## Interface to the zlib http://www.zlib.net/ compression library.
-
-when defined(windows):
-  const libz = "zlib1.dll"
-elif defined(macosx):
-  const libz = "libz.dylib"
-else:
-  const libz = "libz.so.1"
-
-type
-  Uint* = int32
-  Ulong* = int
-  Ulongf* = int
-  Pulongf* = ptr Ulongf
-  ZOffT* = int32
-  Pbyte* = cstring
-  Pbytef* = cstring
-  Allocfunc* = proc (p: pointer, items: Uint, size: Uint): pointer{.cdecl.}
-  FreeFunc* = proc (p: pointer, address: pointer){.cdecl.}
-  InternalState*{.final, pure.} = object 
-  PInternalState* = ptr InternalState
-  ZStream*{.final, pure.} = object 
-    nextIn*: Pbytef
-    availIn*: Uint
-    totalIn*: Ulong
-    nextOut*: Pbytef
-    availOut*: Uint
-    totalOut*: Ulong
-    msg*: Pbytef
-    state*: PInternalState
-    zalloc*: Allocfunc
-    zfree*: FreeFunc
-    opaque*: pointer
-    dataType*: int32
-    adler*: Ulong
-    reserved*: Ulong
-
-  ZStreamRec* = ZStream
-  PZstream* = ptr ZStream
-  GzFile* = pointer
-{.deprecated: [TInternalState: InternalState, TAllocfunc: Allocfunc,
-              TFreeFunc: FreeFunc, TZStream: ZStream, TZStreamRec: ZStreamRec].}
-
-const 
-  Z_NO_FLUSH* = 0
-  Z_PARTIAL_FLUSH* = 1
-  Z_SYNC_FLUSH* = 2
-  Z_FULL_FLUSH* = 3
-  Z_FINISH* = 4
-  Z_OK* = 0
-  Z_STREAM_END* = 1
-  Z_NEED_DICT* = 2
-  Z_ERRNO* = -1
-  Z_STREAM_ERROR* = -2
-  Z_DATA_ERROR* = -3
-  Z_MEM_ERROR* = -4
-  Z_BUF_ERROR* = -5
-  Z_VERSION_ERROR* = -6
-  Z_NO_COMPRESSION* = 0
-  Z_BEST_SPEED* = 1
-  Z_BEST_COMPRESSION* = 9
-  Z_DEFAULT_COMPRESSION* = -1
-  Z_FILTERED* = 1
-  Z_HUFFMAN_ONLY* = 2
-  Z_DEFAULT_STRATEGY* = 0
-  Z_BINARY* = 0
-  Z_ASCII* = 1
-  Z_UNKNOWN* = 2
-  Z_DEFLATED* = 8
-  Z_NULL* = 0
-
-proc zlibVersion*(): cstring{.cdecl, dynlib: libz, importc: "zlibVersion".}
-proc deflate*(strm: var ZStream, flush: int32): int32{.cdecl, dynlib: libz, 
-    importc: "deflate".}
-proc deflateEnd*(strm: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "deflateEnd".}
-proc inflate*(strm: var ZStream, flush: int32): int32{.cdecl, dynlib: libz, 
-    importc: "inflate".}
-proc inflateEnd*(strm: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "inflateEnd".}
-proc deflateSetDictionary*(strm: var ZStream, dictionary: Pbytef, 
-                           dictLength: Uint): int32{.cdecl, dynlib: libz, 
-    importc: "deflateSetDictionary".}
-proc deflateCopy*(dest, source: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "deflateCopy".}
-proc deflateReset*(strm: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "deflateReset".}
-proc deflateParams*(strm: var ZStream, level: int32, strategy: int32): int32{.
-    cdecl, dynlib: libz, importc: "deflateParams".}
-proc inflateSetDictionary*(strm: var ZStream, dictionary: Pbytef, 
-                           dictLength: Uint): int32{.cdecl, dynlib: libz, 
-    importc: "inflateSetDictionary".}
-proc inflateSync*(strm: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "inflateSync".}
-proc inflateReset*(strm: var ZStream): int32{.cdecl, dynlib: libz, 
-    importc: "inflateReset".}
-proc compress*(dest: Pbytef, destLen: Pulongf, source: Pbytef, sourceLen: Ulong): cint{.
-    cdecl, dynlib: libz, importc: "compress".}
-proc compress2*(dest: Pbytef, destLen: Pulongf, source: Pbytef, 
-                sourceLen: Ulong, level: cint): cint{.cdecl, dynlib: libz, 
-    importc: "compress2".}
-proc uncompress*(dest: Pbytef, destLen: Pulongf, source: Pbytef, 
-                 sourceLen: Ulong): cint{.cdecl, dynlib: libz, 
-    importc: "uncompress".}
-proc compressBound*(sourceLen: Ulong): Ulong {.cdecl, dynlib: libz, importc.}
-proc gzopen*(path: cstring, mode: cstring): GzFile{.cdecl, dynlib: libz, 
-    importc: "gzopen".}
-proc gzdopen*(fd: int32, mode: cstring): GzFile{.cdecl, dynlib: libz, 
-    importc: "gzdopen".}
-proc gzsetparams*(thefile: GzFile, level: int32, strategy: int32): int32{.cdecl, 
-    dynlib: libz, importc: "gzsetparams".}
-proc gzread*(thefile: GzFile, buf: pointer, length: int): int32{.cdecl, 
-    dynlib: libz, importc: "gzread".}
-proc gzwrite*(thefile: GzFile, buf: pointer, length: int): int32{.cdecl, 
-    dynlib: libz, importc: "gzwrite".}
-proc gzprintf*(thefile: GzFile, format: Pbytef): int32{.varargs, cdecl, 
-    dynlib: libz, importc: "gzprintf".}
-proc gzputs*(thefile: GzFile, s: Pbytef): int32{.cdecl, dynlib: libz, 
-    importc: "gzputs".}
-proc gzgets*(thefile: GzFile, buf: Pbytef, length: int32): Pbytef{.cdecl, 
-    dynlib: libz, importc: "gzgets".}
-proc gzputc*(thefile: GzFile, c: char): char{.cdecl, dynlib: libz, 
-    importc: "gzputc".}
-proc gzgetc*(thefile: GzFile): char{.cdecl, dynlib: libz, importc: "gzgetc".}
-proc gzflush*(thefile: GzFile, flush: int32): int32{.cdecl, dynlib: libz, 
-    importc: "gzflush".}
-proc gzseek*(thefile: GzFile, offset: ZOffT, whence: int32): ZOffT{.cdecl, 
-    dynlib: libz, importc: "gzseek".}
-proc gzrewind*(thefile: GzFile): int32{.cdecl, dynlib: libz, importc: "gzrewind".}
-proc gztell*(thefile: GzFile): ZOffT{.cdecl, dynlib: libz, importc: "gztell".}
-proc gzeof*(thefile: GzFile): int {.cdecl, dynlib: libz, importc: "gzeof".}
-proc gzclose*(thefile: GzFile): int32{.cdecl, dynlib: libz, importc: "gzclose".}
-proc gzerror*(thefile: GzFile, errnum: var int32): Pbytef{.cdecl, dynlib: libz, 
-    importc: "gzerror".}
-proc adler32*(adler: Ulong, buf: Pbytef, length: Uint): Ulong{.cdecl, 
-    dynlib: libz, importc: "adler32".}
-  ## **Warning**: Adler-32 requires at least a few hundred bytes to get rolling.
-proc crc32*(crc: Ulong, buf: Pbytef, length: Uint): Ulong{.cdecl, dynlib: libz, 
-    importc: "crc32".}
-proc deflateInitu*(strm: var ZStream, level: int32, version: cstring, 
-                   streamSize: int32): int32{.cdecl, dynlib: libz, 
-    importc: "deflateInit_".}
-proc inflateInitu*(strm: var ZStream, version: cstring,
-                   streamSize: int32): int32 {.
-    cdecl, dynlib: libz, importc: "inflateInit_".}
-proc deflateInit*(strm: var ZStream, level: int32): int32
-proc inflateInit*(strm: var ZStream): int32
-proc deflateInit2u*(strm: var ZStream, level: int32, `method`: int32, 
-                    windowBits: int32, memLevel: int32, strategy: int32, 
-                    version: cstring, streamSize: int32): int32 {.cdecl, 
-                    dynlib: libz, importc: "deflateInit2_".}
-proc inflateInit2u*(strm: var ZStream, windowBits: int32, version: cstring, 
-                    streamSize: int32): int32{.cdecl, dynlib: libz, 
-    importc: "inflateInit2_".}
-proc deflateInit2*(strm: var ZStream, 
-                   level, `method`, windowBits, memLevel,
-                   strategy: int32): int32
-proc inflateInit2*(strm: var ZStream, windowBits: int32): int32
-proc zError*(err: int32): cstring{.cdecl, dynlib: libz, importc: "zError".}
-proc inflateSyncPoint*(z: PZstream): int32{.cdecl, dynlib: libz, 
-    importc: "inflateSyncPoint".}
-proc getCrcTable*(): pointer{.cdecl, dynlib: libz, importc: "get_crc_table".}
-
-proc deflateInit(strm: var ZStream, level: int32): int32 = 
-  result = deflateInitu(strm, level, zlibVersion(), sizeof(ZStream).cint)
-
-proc inflateInit(strm: var ZStream): int32 = 
-  result = inflateInitu(strm, zlibVersion(), sizeof(ZStream).cint)
-
-proc deflateInit2(strm: var ZStream, 
-                  level, `method`, windowBits, memLevel,
-                  strategy: int32): int32 = 
-  result = deflateInit2u(strm, level, `method`, windowBits, memLevel, 
-                         strategy, zlibVersion(), sizeof(ZStream).cint)
-
-proc inflateInit2(strm: var ZStream, windowBits: int32): int32 = 
-  result = inflateInit2u(strm, windowBits, zlibVersion(), 
-                         sizeof(ZStream).cint)
-
-proc zlibAllocMem*(appData: pointer, items, size: int): pointer {.cdecl.} = 
-  result = alloc(items * size)
-
-proc zlibFreeMem*(appData, `block`: pointer) {.cdecl.} = 
-  dealloc(`block`)
-
-proc uncompress*(sourceBuf: cstring, sourceLen: int): string =
-  ## Given a deflated cstring returns its inflated version.
-  ##
-  ## Passing a nil cstring will crash this proc in release mode and assert in
-  ## debug mode.
-  ##
-  ## Returns nil on problems. Failure is a very loose concept, it could be you
-  ## passing a non deflated string, or it could mean not having enough memory
-  ## for the inflated version.
-  ##
-  ## The uncompression algorithm is based on
-  ## http://stackoverflow.com/questions/17820664 but does ignore some of the
-  ## original signed/unsigned checks, so may fail with big chunks of data
-  ## exceeding the positive size of an int32. The algorithm can deal with
-  ## concatenated deflated values properly.
-  assert (not sourceBuf.isNil)
-
-  var z: ZStream
-  # Initialize input.
-  z.nextIn = sourceBuf
-
-  # Input left to decompress.
-  var left = zlib.Uint(sourceLen)
-  if left < 1:
-    # Incomplete gzip stream, or overflow?
-    return
-
-  # Create starting space for output (guess double the input size, will grow if
-  # needed -- in an extreme case, could end up needing more than 1000 times the
-  # input size)
-  var space = zlib.Uint(left shl 1)
-  if space < left:
-    space = left
-
-  var decompressed = newStringOfCap(space)
-
-  # Initialize output.
-  z.nextOut = addr(decompressed[0])
-  # Output generated so far.
-  var have = 0
-
-  # Set up for gzip decoding.
-  z.availIn = 0;
-  var status = inflateInit2(z, (15+16))
-  if status != Z_OK:
-    # Out of memory.
-    return
-
-  # Make sure memory allocated by inflateInit2() is freed eventually.
-  defer: discard inflateEnd(z)
-
-  # Decompress all of self.
-  while true:
-    # Allow for concatenated gzip streams (per RFC 1952).
-    if status == Z_STREAM_END:
-      discard inflateReset(z)
-
-    # Provide input for inflate.
-    if z.availIn == 0:
-      # This only makes sense in the C version using unsigned values.
-      z.availIn = left
-      left -= z.availIn
-
-    # Decompress the available input.
-    while true:
-      # Allocate more output space if none left.
-      if space == have:
-        # Double space, handle overflow.
-        space = space shl 1
-        if space < have:
-          # Space was likely already maxed out.
-          discard inflateEnd(z)
-          return
-
-        # Increase space.
-        decompressed.setLen(space)
-        # Update output pointer (might have moved).
-        z.nextOut = addr(decompressed[have])
-
-      # Provide output space for inflate.
-      z.availOut = zlib.Uint(space - have)
-      have += z.availOut;
-
-      # Inflate and update the decompressed size.
-      status = inflate(z, Z_SYNC_FLUSH);
-      have -= z.availOut;
-
-      # Bail out if any errors.
-      if status != Z_OK and status != Z_BUF_ERROR and status != Z_STREAM_END:
-        # Invalid gzip stream.
-        discard inflateEnd(z)
-        return
-
-      # Repeat until all output is generated from provided input (note
-      # that even if z.avail_in is zero, there may still be pending
-      # output -- we're not done until the output buffer isn't filled)
-      if z.availOut != 0:
-        break
-    # Continue until all input consumed.
-    if left == 0 and z.availIn == 0:
-      break
-
-  # Verify that the input is a valid gzip stream.
-  if status != Z_STREAM_END:
-    # Incomplete gzip stream.
-    return
-
-  decompressed.setLen(have)
-  swap(result, decompressed)
-
-
-proc inflate*(buffer: var string): bool {.discardable.} =
-  ## Convenience proc which inflates a string containing compressed data.
-  ##
-  ## Passing a nil string will crash this proc in release mode and assert in
-  ## debug mode. It is ok to pass a buffer which doesn't contain deflated data,
-  ## in this case the proc won't modify the buffer.
-  ##
-  ## Returns true if `buffer` was successfully inflated.
-  assert (not buffer.isNil)
-  if buffer.len < 1: return
-  var temp = uncompress(addr(buffer[0]), buffer.len)
-  if not temp.isNil:
-    swap(buffer, temp)
-    result = true
diff --git a/lib/wrappers/zip/zzip.nim b/lib/wrappers/zip/zzip.nim
deleted file mode 100644
index fab7d55b3..000000000
--- a/lib/wrappers/zip/zzip.nim
+++ /dev/null
@@ -1,176 +0,0 @@
-#
-#
-#            Nim's Runtime Library
-#        (c) Copyright 2008 Andreas Rumpf
-#
-#    See the file "copying.txt", included in this
-#    distribution, for details about the copyright.
-#
-
-## This module is an interface to the zzip library. 
-
-#   Author: 
-#   Guido Draheim <guidod@gmx.de>
-#   Tomi Ollila <Tomi.Ollila@iki.fi>
-#   Copyright (c) 1999,2000,2001,2002,2003,2004 Guido Draheim
-#          All rights reserved, 
-#             usage allowed under the restrictions of the
-#         Lesser GNU General Public License 
-#             or alternatively the restrictions 
-#             of the Mozilla Public License 1.1
-
-when defined(windows):
-  const
-    dllname = "zzip.dll"
-else:
-  const 
-    dllname = "libzzip.so"
-
-type 
-  TZZipError* = int32 # Name conflict if we drop the `T`
-
-const
-  ZZIP_ERROR* = -4096'i32
-  ZZIP_NO_ERROR* = 0'i32            # no error, may be used if user sets it.
-  ZZIP_OUTOFMEM* = ZZIP_ERROR - 20'i32  # out of memory  
-  ZZIP_DIR_OPEN* = ZZIP_ERROR - 21'i32  # failed to open zipfile, see errno for details 
-  ZZIP_DIR_STAT* = ZZIP_ERROR - 22'i32  # failed to fstat zipfile, see errno for details
-  ZZIP_DIR_SEEK* = ZZIP_ERROR - 23'i32  # failed to lseek zipfile, see errno for details
-  ZZIP_DIR_READ* = ZZIP_ERROR - 24'i32  # failed to read zipfile, see errno for details  
-  ZZIP_DIR_TOO_SHORT* = ZZIP_ERROR - 25'i32
-  ZZIP_DIR_EDH_MISSING* = ZZIP_ERROR - 26'i32
-  ZZIP_DIRSIZE* = ZZIP_ERROR - 27'i32
-  ZZIP_ENOENT* = ZZIP_ERROR - 28'i32
-  ZZIP_UNSUPP_COMPR* = ZZIP_ERROR - 29'i32
-  ZZIP_CORRUPTED* = ZZIP_ERROR - 31'i32
-  ZZIP_UNDEF* = ZZIP_ERROR - 32'i32
-  ZZIP_DIR_LARGEFILE* = ZZIP_ERROR - 33'i32
-
-  ZZIP_CASELESS* = 1'i32 shl 12'i32
-  ZZIP_NOPATHS* = 1'i32 shl 13'i32
-  ZZIP_PREFERZIP* = 1'i32 shl 14'i32
-  ZZIP_ONLYZIP* = 1'i32 shl 16'i32
-  ZZIP_FACTORY* = 1'i32 shl 17'i32
-  ZZIP_ALLOWREAL* = 1'i32 shl 18'i32
-  ZZIP_THREADED* = 1'i32 shl 19'i32
-  
-type
-  ZZipDir* {.final, pure.} = object
-  ZZipFile* {.final, pure.} = object
-  ZZipPluginIO* {.final, pure.} = object
-
-  ZZipDirent* {.final, pure.} = object  
-    d_compr*: int32  ## compression method
-    d_csize*: int32  ## compressed size  
-    st_size*: int32  ## file size / decompressed size
-    d_name*: cstring ## file name / strdupped name
-
-  ZZipStat* = ZZipDirent
-{.deprecated: [TZZipDir: ZzipDir, TZZipFile: ZzipFile,
-              TZZipPluginIO: ZzipPluginIO, TZZipDirent: ZzipDirent,
-              TZZipStat: ZZipStat].}
-
-proc zzip_strerror*(errcode: int32): cstring  {.cdecl, dynlib: dllname, 
-    importc: "zzip_strerror".}
-proc zzip_strerror_of*(dir: ptr ZZipDir): cstring  {.cdecl, dynlib: dllname, 
-    importc: "zzip_strerror_of".}
-proc zzip_errno*(errcode: int32): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_errno".}
-
-proc zzip_geterror*(dir: ptr ZZipDir): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_error".}
-proc zzip_seterror*(dir: ptr ZZipDir, errcode: int32) {.cdecl, dynlib: dllname, 
-    importc: "zzip_seterror".}
-proc zzip_compr_str*(compr: int32): cstring {.cdecl, dynlib: dllname, 
-    importc: "zzip_compr_str".}
-proc zzip_dirhandle*(fp: ptr ZZipFile): ptr ZZipDir {.cdecl, dynlib: dllname, 
-    importc: "zzip_dirhandle".}
-proc zzip_dirfd*(dir: ptr ZZipDir): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_dirfd".}
-proc zzip_dir_real*(dir: ptr ZZipDir): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_dir_real".}
-proc zzip_file_real*(fp: ptr ZZipFile): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_file_real".}
-proc zzip_realdir*(dir: ptr ZZipDir): pointer {.cdecl, dynlib: dllname, 
-    importc: "zzip_realdir".}
-proc zzip_realfd*(fp: ptr ZZipFile): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_realfd".}
-
-proc zzip_dir_alloc*(fileext: cstringArray): ptr ZZipDir {.cdecl, 
-    dynlib: dllname, importc: "zzip_dir_alloc".}
-proc zzip_dir_free*(para1: ptr ZZipDir): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_dir_free".}
-
-proc zzip_dir_fdopen*(fd: int32, errcode_p: ptr TZZipError): ptr ZZipDir {.cdecl, 
-    dynlib: dllname, importc: "zzip_dir_fdopen".}
-proc zzip_dir_open*(filename: cstring, errcode_p: ptr TZZipError): ptr ZZipDir {.
-    cdecl, dynlib: dllname, importc: "zzip_dir_open".}
-proc zzip_dir_close*(dir: ptr ZZipDir) {.cdecl, dynlib: dllname, 
-    importc: "zzip_dir_close".}
-proc zzip_dir_read*(dir: ptr ZZipDir, dirent: ptr ZZipDirent): int32 {.cdecl, 
-    dynlib: dllname, importc: "zzip_dir_read".}
-
-proc zzip_opendir*(filename: cstring): ptr ZZipDir {.cdecl, dynlib: dllname, 
-    importc: "zzip_opendir".}
-proc zzip_closedir*(dir: ptr ZZipDir) {.cdecl, dynlib: dllname, 
-    importc: "zzip_closedir".}
-proc zzip_readdir*(dir: ptr ZZipDir): ptr ZZipDirent {.cdecl, dynlib: dllname, 
-    importc: "zzip_readdir".}
-proc zzip_rewinddir*(dir: ptr ZZipDir) {.cdecl, dynlib: dllname, 
-                                      importc: "zzip_rewinddir".}
-proc zzip_telldir*(dir: ptr ZZipDir): int {.cdecl, dynlib: dllname, 
-    importc: "zzip_telldir".}
-proc zzip_seekdir*(dir: ptr ZZipDir, offset: int) {.cdecl, dynlib: dllname, 
-    importc: "zzip_seekdir".}
-
-proc zzip_file_open*(dir: ptr ZZipDir, name: cstring, flags: int32): ptr ZZipFile {.
-    cdecl, dynlib: dllname, importc: "zzip_file_open".}
-proc zzip_file_close*(fp: ptr ZZipFile) {.cdecl, dynlib: dllname, 
-    importc: "zzip_file_close".}
-proc zzip_file_read*(fp: ptr ZZipFile, buf: pointer, length: int): int {.
-    cdecl, dynlib: dllname, importc: "zzip_file_read".}
-proc zzip_open*(name: cstring, flags: int32): ptr ZZipFile {.cdecl, 
-    dynlib: dllname, importc: "zzip_open".}
-proc zzip_close*(fp: ptr ZZipFile) {.cdecl, dynlib: dllname, 
-    importc: "zzip_close".}
-proc zzip_read*(fp: ptr ZZipFile, buf: pointer, length: int): int {.
-    cdecl, dynlib: dllname, importc: "zzip_read".}
-
-proc zzip_freopen*(name: cstring, mode: cstring, para3: ptr ZZipFile): ptr ZZipFile {.
-    cdecl, dynlib: dllname, importc: "zzip_freopen".}
-proc zzip_fopen*(name: cstring, mode: cstring): ptr ZZipFile {.cdecl, 
-    dynlib: dllname, importc: "zzip_fopen".}
-proc zzip_fread*(p: pointer, size: int, nmemb: int, 
-                 file: ptr ZZipFile): int {.cdecl, dynlib: dllname, 
-    importc: "zzip_fread".}
-proc zzip_fclose*(fp: ptr ZZipFile) {.cdecl, dynlib: dllname, 
-    importc: "zzip_fclose".}
-
-proc zzip_rewind*(fp: ptr ZZipFile): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_rewind".}
-proc zzip_seek*(fp: ptr ZZipFile, offset: int, whence: int32): int {.
-    cdecl, dynlib: dllname, importc: "zzip_seek".}
-proc zzip_tell*(fp: ptr ZZipFile): int {.cdecl, dynlib: dllname, 
-    importc: "zzip_tell".}
-
-proc zzip_dir_stat*(dir: ptr ZZipDir, name: cstring, zs: ptr ZZipStat, 
-                    flags: int32): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_dir_stat".}
-proc zzip_file_stat*(fp: ptr ZZipFile, zs: ptr ZZipStat): int32 {.cdecl, 
-    dynlib: dllname, importc: "zzip_file_stat".}
-proc zzip_fstat*(fp: ptr ZZipFile, zs: ptr ZZipStat): int32 {.cdecl, dynlib: dllname, 
-    importc: "zzip_fstat".}
-
-proc zzip_open_shared_io*(stream: ptr ZZipFile, name: cstring, 
-                          o_flags: int32, o_modes: int32, ext: cstringArray, 
-                          io: ptr ZZipPluginIO): ptr ZZipFile {.cdecl, 
-    dynlib: dllname, importc: "zzip_open_shared_io".}
-proc zzip_open_ext_io*(name: cstring, o_flags: int32, o_modes: int32, 
-                       ext: cstringArray, io: ptr ZZipPluginIO): ptr ZZipFile {.
-    cdecl, dynlib: dllname, importc: "zzip_open_ext_io".}
-proc zzip_opendir_ext_io*(name: cstring, o_modes: int32, 
-                          ext: cstringArray, io: ptr ZZipPluginIO): ptr ZZipDir {.
-    cdecl, dynlib: dllname, importc: "zzip_opendir_ext_io".}
-proc zzip_dir_open_ext_io*(filename: cstring, errcode_p: ptr TZZipError, 
-                           ext: cstringArray, io: ptr ZZipPluginIO): ptr ZZipDir {.
-    cdecl, dynlib: dllname, importc: "zzip_dir_open_ext_io".}