summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andi>2008-06-22 16:14:11 +0200
committerAndreas Rumpf <andreas@andi>2008-06-22 16:14:11 +0200
commit405b86068e6a3d39970b9129ceec0a9108464b28 (patch)
treec0449946f54baae6ea88baf453157ddd7faa8f86 /lib
downloadNim-405b86068e6a3d39970b9129ceec0a9108464b28.tar.gz
Initial import
Diffstat (limited to 'lib')
-rwxr-xr-xlib/amd64.asm.in39
-rwxr-xr-xlib/ansi_c.nim84
-rwxr-xr-xlib/arithm.nim347
-rwxr-xr-xlib/assign.nim118
-rw-r--r--lib/base/cairo/cairo.nim698
-rw-r--r--lib/base/cairo/cairoft.nim36
-rw-r--r--lib/base/cairo/cairowin32.nim36
-rw-r--r--lib/base/cairo/cairoxlib.nim40
-rwxr-xr-xlib/base/dialogs.nim234
-rwxr-xr-xlib/base/gtk/atk.nim1368
-rwxr-xr-xlib/base/gtk/gdk2.nim3957
-rwxr-xr-xlib/base/gtk/gdk2pixbuf.nim279
-rwxr-xr-xlib/base/gtk/gdkglext.nim562
-rwxr-xr-xlib/base/gtk/glib2.nim4498
-rwxr-xr-xlib/base/gtk/gtk2.nim17226
-rwxr-xr-xlib/base/gtk/gtkglext.nim48
-rwxr-xr-xlib/base/gtk/gtkhtml.nim497
-rwxr-xr-xlib/base/gtk/libglade2.nim117
-rwxr-xr-xlib/base/gtk/pango.nim1209
-rwxr-xr-xlib/base/gtk/pangoutils.nim46
-rwxr-xr-xlib/base/nregex.nim124
-rwxr-xr-xlib/base/pcre.nim296
-rwxr-xr-xlib/base/pcre_all.c30072
-rwxr-xr-xlib/base/regexprs.nim114
-rwxr-xr-xlib/cntbits.nim20
-rwxr-xr-xlib/complex.nim108
-rwxr-xr-xlib/copying.txt29
-rwxr-xr-xlib/debugger.nim499
-rwxr-xr-xlib/dlmalloc.c5071
-rwxr-xr-xlib/dlmalloc.h1143
-rwxr-xr-xlib/dyncalls.nim143
-rwxr-xr-xlib/excpt.nim251
-rwxr-xr-xlib/gc.nim897
-rwxr-xr-xlib/hti.nim51
-rwxr-xr-xlib/i386.asm.in70
-rwxr-xr-xlib/int64s.nim72
-rwxr-xr-xlib/lgpl.txt502
-rwxr-xr-xlib/locks.nim18
-rwxr-xr-xlib/math.nim131
-rwxr-xr-xlib/memman.nim599
-rwxr-xr-xlib/nimbase.h403
-rwxr-xr-xlib/optparse.nim39
-rwxr-xr-xlib/os.nim939
-rwxr-xr-xlib/posix/posix.nim1818
-rwxr-xr-xlib/powerpc.asm.in35
-rwxr-xr-xlib/process.nim1009
-rwxr-xr-xlib/ptrset.nim205
-rwxr-xr-xlib/repr.nim233
-rwxr-xr-xlib/sets.nim88
-rwxr-xr-xlib/strutils.nim627
-rwxr-xr-xlib/sysio.nim163
-rwxr-xr-xlib/sysstr.nim294
-rwxr-xr-xlib/system.nim1184
-rwxr-xr-xlib/times.nim179
-rwxr-xr-xlib/typeinfo.nim221
-rwxr-xr-xlib/unicode.nim103
-rwxr-xr-xlib/windows/mmsystem.nim2656
-rwxr-xr-xlib/windows/nb30.nim230
-rwxr-xr-xlib/windows/ole2.nim208
-rwxr-xr-xlib/windows/shellapi.nim860
-rwxr-xr-xlib/windows/shfolder.nim91
-rwxr-xr-xlib/windows/windows.nim23909
62 files changed, 107143 insertions, 0 deletions
diff --git a/lib/amd64.asm.in b/lib/amd64.asm.in
new file mode 100755
index 000000000..2c14bf241
--- /dev/null
+++ b/lib/amd64.asm.in
@@ -0,0 +1,39 @@
+; This contains the CPU-dependant variants of some routines.

+; (C) 2005 Andreas Rumpf

+; This code was inspired by the Freepascal compiler's sources

+; All routines here have the _cdecl calling convention because

+; that is the only convention any C compiler supports.

+

+\python{

+# as usual I use my own preprocessor :-)

+import os

+

+def c(name): 

+  if os.name == 'posix':

+    return name

+  else:

+    return "_" + name

+    

+def arg:

+  if os.name == 'posix':

+    return 'rdi'

+  else:

+    return 'rcx' # on win64 uses its own calling convention; this sucks!

+}

+

+segment code

+

+global \c{cpu_inc_locked}

+global \c{cpu_dec_locked}

+

+\c{cpu_dec_locked}: 

+     lock

+     dec       [\arg]

+     setz      al

+     ret

+     

+\c{cpu_inc_locked}:

+     lock

+     inc       [\arg]

+     setz      al

+     ret

diff --git a/lib/ansi_c.nim b/lib/ansi_c.nim
new file mode 100755
index 000000000..e667822a9
--- /dev/null
+++ b/lib/ansi_c.nim
@@ -0,0 +1,84 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+# This include file contains headers of Ansi C procs
+# and definitions of Ansi C types in Nimrod syntax
+# All symbols are prefixed with 'c_' to avoid ambiguities
+
+proc c_strcmp(a, b: CString): cint {.nodecl, importc: "strcmp".}
+proc c_memcmp(a, b: CString, size: cint): cint {.nodecl, importc: "memcmp".}
+proc c_memcpy(a, b: CString, size: cint) {.nodecl, importc: "memcpy".}
+proc c_strlen(a: CString): cint {.nodecl, importc: "strlen".}
+
+type
+  C_TextFile {.importc: "FILE", nodecl.} = record   # empty record for
+                                                   # data hiding
+  C_BinaryFile {.importc: "FILE", nodecl.} = record
+  C_TextFileStar = ptr CTextFile
+  C_BinaryFileStar = ptr CBinaryFile
+
+  C_JmpBuf {.importc: "jmp_buf".} = array[0..31, int]
+
+var
+  c_stdin {.importc: "stdin", noDecl.}: C_TextFileStar
+  c_stdout {.importc: "stdout", noDecl.}: C_TextFileStar
+  c_stderr {.importc: "stderr", noDecl.}: C_TextFileStar
+
+var # constants faked as variables:
+  SIGINT {.importc: "SIGINT", nodecl.}: cint
+  SIGSEGV {.importc: "SIGSEGV", nodecl.}: cint
+  SIGABRT {.importc: "SIGABRT", nodecl.}: cint
+  SIGFPE {.importc: "SIGFPE", nodecl.}: cint
+  SIGILL {.importc: "SIGILL", nodecl.}: cint
+
+when defined(macosx):
+  var
+    SIGBUS {.importc: "SIGBUS", nodecl.}: cint
+      # hopefully this does not lead to new bugs
+else:
+  var
+    SIGBUS {.importc: "SIGSEGV", nodecl.}: cint
+      # only Mac OS X has this shit
+
+proc c_longjmp(jmpb: C_JmpBuf, retval: cint) {.nodecl, importc: "longjmp".}
+proc c_setjmp(jmpb: var C_JmpBuf) {.nodecl, importc: "setjmp".}
+
+proc c_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.
+  importc: "signal", header: "<signal.h>".}
+proc c_raise(sig: cint) {.importc: "raise", header: "<signal.h>".}
+
+proc c_fputs(c: cstring, f: C_TextFileStar) {.importc: "fputs", noDecl.}
+proc c_fgets(c: cstring, n: int, f: C_TextFileStar): cstring  {.
+  importc: "fgets", noDecl.}
+proc c_fgetc(stream: C_TextFileStar): int {.importc: "fgetc", nodecl.}
+proc c_ungetc(c: int, f: C_TextFileStar) {.importc: "ungetc", nodecl.}
+proc c_putc(c: Char, stream: C_TextFileStar) {.importc: "putc", nodecl.}
+proc c_fprintf(f: C_TextFileStar, frmt: CString) {.
+  importc: "fprintf", nodecl, varargs.}
+
+proc c_fopen(filename, mode: cstring): C_TextFileStar {.
+  importc: "fopen", nodecl.}
+proc c_fclose(f: C_TextFileStar) {.importc: "fclose", nodecl.}
+
+proc c_sprintf(buf, frmt: CString) {.nodecl, importc: "sprintf", varargs.}
+  # we use it only in a way that cannot lead to security issues
+
+proc c_fread(buf: Pointer, size, n: int, f: C_BinaryFileStar): int {.
+  importc: "fread", noDecl.}
+proc c_fseek(f: C_BinaryFileStar, offset: clong, whence: int): int {.
+  importc: "fseek", noDecl.}
+
+proc c_fwrite(buf: Pointer, size, n: int, f: C_BinaryFileStar): int {.
+  importc: "fwrite", noDecl.}
+
+proc c_exit(errorcode: cint) {.importc: "exit", nodecl.}
+proc c_ferror(stream: C_TextFileStar): bool {.importc: "ferror", nodecl.}
+proc c_fflush(stream: C_TextFileStar) {.importc: "fflush", nodecl.}
+proc c_abort() {.importc: "abort", nodecl.}
+proc c_feof(stream: C_TextFileStar): bool {.importc: "feof", nodecl.}
diff --git a/lib/arithm.nim b/lib/arithm.nim
new file mode 100755
index 000000000..5510d2f30
--- /dev/null
+++ b/lib/arithm.nim
@@ -0,0 +1,347 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+# simple integer arithmetic with overflow checking
+
+proc raiseOverflow {.exportc: "raiseOverflow".} =
+  # a single proc to reduce code size to a minimum
+  raise newException(EOverflow, "over- or underflow")
+
+proc raiseDivByZero {.exportc: "raiseDivByZero".} =
+  raise newException(EDivByZero, "divison by zero")
+
+proc addInt64(a, b: int64): int64 {.compilerProc, inline.} =
+  result = a + b
+  if (result xor a) >= int64(0) or (result xor b) >= int64(0):
+    return result
+  raiseOverflow()
+
+proc subInt64(a, b: int64): int64 {.compilerProc, inline.} =
+  result = a - b
+  if (result xor a) >= int64(0) or (result xor not b) >= int64(0):
+    return result
+  raiseOverflow()
+
+proc negInt64(a: int64): int64 {.compilerProc, inline.} =
+  if a != low(int64): return -a
+  raiseOverflow()
+
+proc absInt64(a: int64): int64 {.compilerProc, inline.} =
+  if a != low(int64):
+    if a >= 0: return a
+    else: return -a
+  raiseOverflow()
+
+proc divInt64(a, b: int64): int64 {.compilerProc, inline.} =
+  if b == int64(0):
+    raiseDivByZero()
+  if a == low(int64) and b == int64(-1):
+    raiseOverflow()
+  return a div b
+
+proc modInt64(a, b: int64): int64 {.compilerProc, inline.} =
+  if b == int64(0):
+    raiseDivByZero()
+  return a mod b
+
+#
+# This code has been inspired by Python's source code.
+# The native int product x*y is either exactly right or *way* off, being
+# just the last n bits of the true product, where n is the number of bits
+# in an int (the delivered product is the true product plus i*2**n for
+# some integer i).
+#
+# The native float64 product x*y is subject to three
+# rounding errors: on a sizeof(int)==8 box, each cast to double can lose
+# info, and even on a sizeof(int)==4 box, the multiplication can lose info.
+# But, unlike the native int product, it's not in *range* trouble:  even
+# if sizeof(int)==32 (256-bit ints), the product easily fits in the
+# dynamic range of a float64. So the leading 50 (or so) bits of the float64
+# product are correct.
+#
+# We check these two ways against each other, and declare victory if they're
+# approximately the same. Else, because the native int product is the only
+# one that can lose catastrophic amounts of information, it's the native int
+# product that must have overflowed.
+#
+proc mulInt64(a, b: int64): int64 {.compilerproc.} =
+  var
+    resAsFloat, floatProd: float64
+  result = a * b
+  floatProd = float64(a) # conversion
+  floatProd = floatProd * float64(b)
+  resAsFloat = float64(result)
+
+  # Fast path for normal case: small multiplicands, and no info
+  # is lost in either method.
+  if resAsFloat == floatProd: return result
+
+  # Somebody somewhere lost info. Close enough, or way off? Note
+  # that a != 0 and b != 0 (else resAsFloat == floatProd == 0).
+  # The difference either is or isn't significant compared to the
+  # true value (of which floatProd is a good approximation).
+
+  # abs(diff)/abs(prod) <= 1/32 iff
+  #   32 * abs(diff) <= abs(prod) -- 5 good bits is "close enough"
+  if 32.0 * abs(resAsFloat - floatProd) <= abs(floatProd):
+    return result
+  raiseOverflow()
+
+
+proc absInt(a: int): int {.compilerProc, inline.} =
+  if a != low(int):
+    if a >= 0: return a
+    else: return -a
+  raiseOverflow()
+
+when defined(I386) and (defined(vcc) or defined(wcc) or defined(dmc)):
+  # or defined(gcc)):
+  {.define: asmVersion.}
+  # my Version of Borland C++Builder does not have
+  # tasm32, which is needed for assembler blocks
+  # this is why Borland is not included in the 'when'
+else:
+  {.define: useInline.}
+
+when defined(asmVersion) and defined(gcc):
+  proc addInt(a, b: int): int {.compilerProc, pure, inline.}
+  proc subInt(a, b: int): int {.compilerProc, pure, inline.}
+  proc mulInt(a, b: int): int {.compilerProc, pure, inline.}
+  proc divInt(a, b: int): int {.compilerProc, pure, inline.}
+  proc modInt(a, b: int): int {.compilerProc, pure, inline.}
+  proc negInt(a: int): int {.compilerProc, pure, inline.}
+
+elif defined(asmVersion):
+  proc addInt(a, b: int): int {.compilerProc, pure.}
+  proc subInt(a, b: int): int {.compilerProc, pure.}
+  proc mulInt(a, b: int): int {.compilerProc, pure.}
+  proc divInt(a, b: int): int {.compilerProc, pure.}
+  proc modInt(a, b: int): int {.compilerProc, pure.}
+  proc negInt(a: int): int {.compilerProc, pure.}
+
+elif defined(useInline):
+  proc addInt(a, b: int): int {.compilerProc, inline.}
+  proc subInt(a, b: int): int {.compilerProc, inline.}
+  proc mulInt(a, b: int): int {.compilerProc.}
+      # mulInt is to large for inlining?
+  proc divInt(a, b: int): int {.compilerProc, inline.}
+  proc modInt(a, b: int): int {.compilerProc, inline.}
+  proc negInt(a: int): int {.compilerProc, inline.}
+
+else:
+  proc addInt(a, b: int): int {.compilerProc.}
+  proc subInt(a, b: int): int {.compilerProc.}
+  proc mulInt(a, b: int): int {.compilerProc.}
+  proc divInt(a, b: int): int {.compilerProc.}
+  proc modInt(a, b: int): int {.compilerProc.}
+  proc negInt(a: int): int {.compilerProc.}
+
+# implementation:
+
+when defined(asmVersion) and not defined(gcc):
+  # assembler optimized versions for compilers that
+  # have an intel syntax assembler:
+  proc addInt(a, b: int): int =
+    # a in eax, and b in edx
+    asm """
+        mov eax, `a`
+        add eax, `b`
+        jno theEnd
+        call raiseOverflow
+      theEnd:
+    """
+
+  proc subInt(a, b: int): int =
+    asm """
+        mov eax, `a`
+        sub eax, `b`
+        jno theEnd
+        call raiseOverflow
+      theEnd:
+    """
+
+  proc negInt(a: int): int =
+    asm """
+        mov eax, `a`
+        neg eax
+        jno theEnd
+        call raiseOverflow
+      theEnd:
+    """
+
+  proc divInt(a, b: int): int =
+    asm """
+        mov eax, `a`
+        mov ecx, `b`
+        xor edx, edx
+        idiv ecx
+        jno  theEnd
+        call raiseOverflow
+      theEnd:
+    """
+
+  proc modInt(a, b: int): int =
+    asm """
+        mov eax, `a`
+        mov ecx, `b`
+        xor edx, edx
+        idiv ecx
+        jno theEnd
+        call raiseOverflow
+      theEnd:
+        mov eax, edx
+    """
+
+  proc mulInt(a, b: int): int =
+    asm """
+        mov eax, `a`
+        mov ecx, `b`
+        xor edx, edx
+        imul ecx
+        jno theEnd
+        call raiseOverflow
+      theEnd:
+    """
+
+elif defined(asmVersion) and defined(gcc):
+  proc addInt(a, b: int): int = 
+    asm """ "addl %1,%%eax\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+            :"=a"(`a`)
+            :"a"(`a`), "r"(`b`)
+    """
+    
+  proc subInt(a, b: int): int =
+    asm """ "subl %1,%%eax\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+            :"=a"(`a`)
+            :"a"(`a`), "r"(`b`)
+    """
+    
+  proc negInt(a: int): int =
+    asm """  "negl %%eax\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+            :"=a"(`a`)
+            :"a"(`a`)
+    """
+  
+  proc divInt(a, b: int): int =
+    asm """  "xorl %%edx, %%edx\n"
+             "idivl %%ecx\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+             :"=a"(`a`)
+             :"a"(`a`), "c"(`b`)
+             :"%edx"
+    """
+
+  proc modInt(a, b: int): int =
+    asm """  "xorl %%edx, %%edx\n"
+             "idivl %%ecx\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+             "movl %%edx, %%eax"
+             :"=a"(`a`)
+             :"a"(`a`), "c"(`b`)
+             :"%edx"
+    """
+
+  proc mulInt(a, b: int): int =
+    asm """  "xorl %%edx, %%edx\n"
+             "imull %%ecx\n"
+             "jno 1\n"
+             "call _raiseOverflow\n"
+             "1: \n"
+             :"=a"(`a`)
+             :"a"(`a`), "c"(`b`)
+             :"%edx"
+    """
+
+else:
+  # Platform independant versions of the above (slower!)
+
+  proc addInt(a, b: int): int =
+    result = a + b
+    if (result xor a) >= 0 or (result xor b) >= 0:
+      return result
+    raiseOverflow()
+
+  proc subInt(a, b: int): int =
+    result = a - b
+    if (result xor a) >= 0 or (result xor not b) >= 0:
+      return result
+    raiseOverflow()
+
+  proc negInt(a: int): int =
+    if a != low(int): return -a
+    raiseOverflow()
+
+  proc divInt(a, b: int): int =
+    if b == 0:
+      raiseDivByZero()
+    if a == low(int) and b == -1:
+      raiseOverflow()
+    return a div b
+
+  proc modInt(a, b: int): int =
+    if b == 0:
+      raiseDivByZero()
+    return a mod b
+
+  #
+  # This code has been inspired by Python's source code.
+  # The native int product x*y is either exactly right or *way* off, being
+  # just the last n bits of the true product, where n is the number of bits
+  # in an int (the delivered product is the true product plus i*2**n for
+  # some integer i).
+  #
+  # The native float64 product x*y is subject to three
+  # rounding errors: on a sizeof(int)==8 box, each cast to double can lose
+  # info, and even on a sizeof(int)==4 box, the multiplication can lose info.
+  # But, unlike the native int product, it's not in *range* trouble:  even
+  # if sizeof(int)==32 (256-bit ints), the product easily fits in the
+  # dynamic range of a float64. So the leading 50 (or so) bits of the float64
+  # product are correct.
+  #
+  # We check these two ways against each other, and declare victory if
+  # they're approximately the same. Else, because the native int product is
+  # the only one that can lose catastrophic amounts of information, it's the
+  # native int product that must have overflowed.
+  #
+  proc mulInt(a, b: int): int =
+    var
+      resAsFloat, floatProd: float
+
+    result = a * b
+    floatProd = toFloat(a) * toFloat(b)
+    resAsFloat = toFloat(result)
+
+    # Fast path for normal case: small multiplicands, and no info
+    # is lost in either method.
+    if resAsFloat == floatProd: return result
+
+    # Somebody somewhere lost info. Close enough, or way off? Note
+    # that a != 0 and b != 0 (else resAsFloat == floatProd == 0).
+    # The difference either is or isn't significant compared to the
+    # true value (of which floatProd is a good approximation).
+
+    # abs(diff)/abs(prod) <= 1/32 iff
+    #   32 * abs(diff) <= abs(prod) -- 5 good bits is "close enough"
+    if 32.0 * abs(resAsFloat - floatProd) <= abs(floatProd):
+      return result
+    raiseOverflow()
diff --git a/lib/assign.nim b/lib/assign.nim
new file mode 100755
index 000000000..c8592b970
--- /dev/null
+++ b/lib/assign.nim
@@ -0,0 +1,118 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+#when defined(debugGC):

+#  {.define: logAssign.}

+proc genericAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.}

+proc genericAssignAux(dest, src: Pointer, n: ptr TNimNode) =

+  var

+    d = cast[TAddress](dest)

+    s = cast[TAddress](src)

+  case n.kind

+  of nkNone: assert(false)

+  of nkSlot:

+    genericAssign(cast[pointer](d +% n.offset), cast[pointer](s +% n.offset),

+                  n.typ)

+  of nkList: 

+    for i in 0..n.len-1: 

+      genericAssignAux(dest, src, n.sons[i])

+  of nkCase: 

+    copyMem(cast[pointer](d +% n.offset), cast[pointer](s +% n.offset),

+            n.typ.size)

+    var m = selectBranch(src, n)

+    if m != nil: genericAssignAux(dest, src, m)

+

+proc genericAssign(dest, src: Pointer, mt: PNimType) =

+  var

+    d = cast[TAddress](dest)

+    s = cast[TAddress](src)

+

+  assert(mt != nil)

+  case mt.Kind

+  of tySequence:

+    var s2 = cast[ppointer](src)^

+    var seq = cast[PGenericSeq](s2)

+    if s2 == nil:  # this can happen! nil sequences are allowed

+      var x = cast[ppointer](dest)

+      x^ = nil

+      return

+    assert(dest != nil)

+    unsureAsgnRef(cast[ppointer](dest), 

+                  newObj(mt, seq.len * mt.base.size + GenericSeqSize))

+    var dst = cast[taddress](cast[ppointer](dest)^)

+    for i in 0..seq.len-1:

+      genericAssign(

+        cast[pointer](dst +% i*% mt.base.size +% GenericSeqSize),

+        cast[pointer](cast[taddress](s2) +% i *% mt.base.size +%

+                     GenericSeqSize),

+        mt.Base)

+    var dstseq = cast[PGenericSeq](dst)

+    dstseq.len = seq.len

+    dstseq.space = seq.len

+  of tyRecord, tyObject, tyTuple:

+    genericAssignAux(dest, src, mt.node)

+  of tyArray, tyArrayConstr:

+    for i in 0..(mt.size div mt.base.size)-1:

+      genericAssign(cast[pointer](d +% i*% mt.base.size),

+                    cast[pointer](s +% i*% mt.base.size), mt.base)

+  of tyString: # a leaf

+    var s2 = cast[ppointer](s)^

+    if s2 != nil: # nil strings are possible!

+      unsureAsgnRef(cast[ppointer](dest), copyString(cast[mstring](s2)))

+    else:

+      var x = cast[ppointer](dest)

+      x^ = nil

+      return

+  of tyRef:  # BUGFIX: a long time this has been forgotten!

+    unsureAsgnRef(cast[ppointer](dest), cast[ppointer](s)^)

+  else:

+    copyMem(dest, src, mt.size) # copy raw bits

+

+proc genericSeqAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.} =

+  genericAssign(dest, addr(src), mt)

+

+proc genericAssignOpenArray(dest, src: pointer, len: int,

+                            mt: PNimType) {.compilerproc.} =

+  var

+    d = cast[TAddress](dest)

+    s = cast[TAddress](src)

+  for i in 0..len-1:

+    genericAssign(cast[pointer](d +% i*% mt.base.size),

+                  cast[pointer](s +% i*% mt.base.size), mt.base)

+

+proc objectInit(dest: Pointer, typ: PNimType) {.compilerProc.}

+proc objectInitAux(dest: Pointer, n: ptr TNimNode) =

+  var d = cast[TAddress](dest)

+  case n.kind

+  of nkNone: assert(false)

+  of nkSLot: objectInit(cast[pointer](d +% n.offset), n.typ)

+  of nkList: 

+    for i in 0..n.len-1:

+      objectInitAux(dest, n.sons[i])

+  of nkCase: 

+    var m = selectBranch(dest, n)

+    if m != nil: objectInitAux(dest, m)   

+

+proc objectInit(dest: Pointer, typ: PNimType) =

+  # the generic init proc that takes care of initialization of complex

+  # objects on the stack or heap

+  var d = cast[TAddress](dest)

+  case typ.kind

+  of tyObject:

+    # iterate over any structural type

+    # here we have to init the type field:

+    var pint = cast[ptr PNimType](dest)

+    pint^ = typ

+    objectInitAux(dest, typ.node)

+  of tyRecord:

+    objectInitAux(dest, typ.node)

+  of tyArray, tyArrayConstr:

+    for i in 0..(typ.size div typ.base.size)-1:

+      objectInit(cast[pointer](d +% i * typ.base.size), typ.base)

+  else: nil # nothing to do

diff --git a/lib/base/cairo/cairo.nim b/lib/base/cairo/cairo.nim
new file mode 100644
index 000000000..c999590a2
--- /dev/null
+++ b/lib/base/cairo/cairo.nim
@@ -0,0 +1,698 @@
+
+#* cairo - a vector graphics library with display and print output
+# *
+# * Copyright © 2002 University of Southern California
+# * Copyright © 2005 Red Hat, Inc.
+# *
+# * This library is free software; you can redistribute it and/or
+# * modify it either under the terms of the GNU Lesser General Public
+# * License version 2.1 as published by the Free Software Foundation
+# * (the "LGPL") or, at your option, under the terms of the Mozilla
+# * Public License Version 1.1 (the "MPL"). If you do not alter this
+# * notice, a recipient may use your version of this file under either
+# * the MPL or the LGPL.
+# *
+# * You should have received a copy of the LGPL along with this library
+# * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# * You should have received a copy of the MPL along with this library
+# * in the file COPYING-MPL-1.1
+# *
+# * 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/
+# *
+# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+# * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+# * the specific language governing rights and limitations.
+# *
+# * The Original Code is the cairo graphics library.
+# *
+# * The Initial Developer of the Original Code is University of Southern
+# * California.
+# *
+# * Contributor(s):
+# *	Carl D. Worth <cworth@cworth.org>
+# #*
+# *  This FreePascal binding generated August 26, 2005
+# *  by Jeffrey Pohlmeyer <yetanothergeek@yahoo.com>
+#
+
+#
+#  - Updated to cairo version 1.4
+#  - Grouped OS specific fuctions in separated units
+#  - Organized the functions by group and ordered exactly as the c header
+#  - Cleared parameter list syntax according to pascal standard
+#
+#  By Luiz Américo Pereira Câmara
+#  October 2007
+#
+
+when defined(windows):
+  const
+    LIB_CAIRO* = "cairo.dll"
+else:
+  const
+    LIB_CAIRO* = "libcairo.so"
+
+type
+  PByte = cstring
+  cairo_status_t* = enum
+    CAIRO_STATUS_SUCCESS = 0, CAIRO_STATUS_NO_MEMORY,
+    CAIRO_STATUS_INVALID_RESTORE, CAIRO_STATUS_INVALID_POP_GROUP,
+    CAIRO_STATUS_NO_CURRENT_POINT, CAIRO_STATUS_INVALID_MATRIX,
+    CAIRO_STATUS_INVALID_STATUS, CAIRO_STATUS_NULL_POINTER,
+    CAIRO_STATUS_INVALID_STRING, CAIRO_STATUS_INVALID_PATH_DATA,
+    CAIRO_STATUS_READ_ERROR, CAIRO_STATUS_WRITE_ERROR,
+    CAIRO_STATUS_SURFACE_FINISHED, CAIRO_STATUS_SURFACE_TYPE_MISMATCH,
+    CAIRO_STATUS_PATTERN_TYPE_MISMATCH, CAIRO_STATUS_INVALID_CONTENT,
+    CAIRO_STATUS_INVALID_FORMAT, CAIRO_STATUS_INVALID_VISUAL,
+    CAIRO_STATUS_FILE_NOT_FOUND, CAIRO_STATUS_INVALID_DASH
+  cairo_operator_t* = enum
+    CAIRO_OPERATOR_CLEAR, CAIRO_OPERATOR_SOURCE, CAIRO_OPERATOR_OVER,
+    CAIRO_OPERATOR_IN, CAIRO_OPERATOR_OUT, CAIRO_OPERATOR_ATOP,
+    CAIRO_OPERATOR_DEST, CAIRO_OPERATOR_DEST_OVER, CAIRO_OPERATOR_DEST_IN,
+    CAIRO_OPERATOR_DEST_OUT, CAIRO_OPERATOR_DEST_ATOP, CAIRO_OPERATOR_XOR,
+    CAIRO_OPERATOR_ADD, CAIRO_OPERATOR_SATURATE
+  cairo_antialias_t* = enum
+    CAIRO_ANTIALIAS_DEFAULT, CAIRO_ANTIALIAS_NONE, CAIRO_ANTIALIAS_GRAY,
+    CAIRO_ANTIALIAS_SUBPIXEL
+  cairo_fill_rule_t* = enum
+    CAIRO_FILL_RULE_WINDING, CAIRO_FILL_RULE_EVEN_ODD
+  cairo_line_cap_t* = enum
+    CAIRO_LINE_CAP_BUTT, CAIRO_LINE_CAP_ROUND, CAIRO_LINE_CAP_SQUARE
+  cairo_line_join_t* = enum
+    CAIRO_LINE_JOIN_MITER, CAIRO_LINE_JOIN_ROUND, CAIRO_LINE_JOIN_BEVEL
+  cairo_font_slant_t* = enum
+    CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_SLANT_OBLIQUE
+  cairo_font_weight_t* = enum
+    CAIRO_FONT_WEIGHT_NORMAL, CAIRO_FONT_WEIGHT_BOLD
+  cairo_subpixel_order_t* = enum
+    CAIRO_SUBPIXEL_ORDER_DEFAULT, CAIRO_SUBPIXEL_ORDER_RGB,
+    CAIRO_SUBPIXEL_ORDER_BGR, CAIRO_SUBPIXEL_ORDER_VRGB,
+    CAIRO_SUBPIXEL_ORDER_VBGR
+  cairo_hint_style_t* = enum
+    CAIRO_HINT_STYLE_DEFAULT, CAIRO_HINT_STYLE_NONE, CAIRO_HINT_STYLE_SLIGHT,
+    CAIRO_HINT_STYLE_MEDIUM, CAIRO_HINT_STYLE_FULL
+  cairo_hint_metrics_t* = enum
+    CAIRO_HINT_METRICS_DEFAULT, CAIRO_HINT_METRICS_OFF, CAIRO_HINT_METRICS_ON
+  cairo_path_data_type_t* = enum
+    CAIRO_PATH_MOVE_TO, CAIRO_PATH_LINE_TO, CAIRO_PATH_CURVE_TO,
+    CAIRO_PATH_CLOSE_PATH
+  cairo_content_t* = enum
+    CAIRO_CONTENT_COLOR = 0x00001000, CAIRO_CONTENT_ALPHA = 0x00002000,
+    CAIRO_CONTENT_COLOR_ALPHA = 0x00003000
+  cairo_format_t* = enum
+    CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24, CAIRO_FORMAT_A8, CAIRO_FORMAT_A1
+  cairo_extend_t* = enum
+    CAIRO_EXTEND_NONE, CAIRO_EXTEND_REPEAT, CAIRO_EXTEND_REFLECT,
+    CAIRO_EXTEND_PAD
+  cairo_filter_t* = enum
+    CAIRO_FILTER_FAST, CAIRO_FILTER_GOOD, CAIRO_FILTER_BEST,
+    CAIRO_FILTER_NEAREST, CAIRO_FILTER_BILINEAR, CAIRO_FILTER_GAUSSIAN
+  cairo_font_type_t* = enum
+    CAIRO_FONT_TYPE_TOY, CAIRO_FONT_TYPE_FT, CAIRO_FONT_TYPE_WIN32,
+    CAIRO_FONT_TYPE_ATSUI
+  cairo_pattern_type_t* = enum
+    CAIRO_PATTERN_TYPE_SOLID, CAIRO_PATTERN_TYPE_SURFACE,
+    CAIRO_PATTERN_TYPE_LINEAR, CAIRO_PATTERN_TYPE_RADIAL
+  cairo_surface_type_t* = enum
+    CAIRO_SURFACE_TYPE_IMAGE, CAIRO_SURFACE_TYPE_PDF, CAIRO_SURFACE_TYPE_PS,
+    CAIRO_SURFACE_TYPE_XLIB, CAIRO_SURFACE_TYPE_XCB, CAIRO_SURFACE_TYPE_GLITZ,
+    CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_SURFACE_TYPE_WIN32,
+    CAIRO_SURFACE_TYPE_BEOS, CAIRO_SURFACE_TYPE_DIRECTFB,
+    CAIRO_SURFACE_TYPE_SVG, CAIRO_SURFACE_TYPE_OS2
+  cairo_svg_version_t* = enum
+    CAIRO_SVG_VERSION_1_1, CAIRO_SVG_VERSION_1_2
+  Pcairo_surface_t* = ref cairo_surface_t
+  PPcairo_surface_t* = ref Pcairo_surface_t
+  Pcairo_t* = ref cairo_t
+  Pcairo_pattern_t* = ref cairo_pattern_t
+  Pcairo_font_options_t* = ref cairo_font_options_t
+  Pcairo_font_face_t* = ref cairo_font_face_t
+  Pcairo_scaled_font_t* = ref cairo_scaled_font_t
+  Pcairo_bool_t* = ref cairo_bool_t
+  cairo_bool_t* = int32
+  Pcairo_matrix_t* = ref cairo_matrix_t
+  Pcairo_user_data_key_t* = ref cairo_user_data_key_t
+  Pcairo_glyph_t* = ref cairo_glyph_t
+  Pcairo_text_extents_t* = ref cairo_text_extents_t
+  Pcairo_font_extents_t* = ref cairo_font_extents_t
+  Pcairo_path_data_type_t* = ref cairo_path_data_type_t
+  Pcairo_path_data_t* = ref cairo_path_data_t
+  Pcairo_path_t* = ref cairo_path_t
+  Pcairo_rectangle_t* = ref cairo_rectangle_t
+  Pcairo_rectangle_list_t* = ref cairo_rectangle_list_t
+  cairo_destroy_func_t* = proc (data: Pointer){.cdecl.}
+  cairo_write_func_t* = proc (closure: Pointer, data: PByte, len: int32): cairo_status_t{.
+      cdecl.}
+  cairo_read_func_t* = proc (closure: Pointer, data: PByte, len: int32): cairo_status_t{.
+      cdecl.}
+  cairo_t* = record           #OPAQUE
+  cairo_surface_t* = record   #OPAQUE
+  cairo_pattern_t* = record   #OPAQUE
+  cairo_scaled_font_t* = record #OPAQUE
+  cairo_font_face_t* = record #OPAQUE
+  cairo_font_options_t* = record #OPAQUE
+  cairo_matrix_t* = record
+    xx: float64
+    yx: float64
+    xy: float64
+    yy: float64
+    x0: float64
+    y0: float64
+
+  cairo_user_data_key_t* = record
+    unused: int32
+
+  cairo_glyph_t* = record
+    index: int32
+    x: float64
+    y: float64
+
+  cairo_text_extents_t* = record
+    x_bearing: float64
+    y_bearing: float64
+    width: float64
+    height: float64
+    x_advance: float64
+    y_advance: float64
+
+  cairo_font_extents_t* = record
+    ascent: float64
+    descent: float64
+    height: float64
+    max_x_advance: float64
+    max_y_advance: float64
+
+  cairo_path_data_t* = record #* _type : cairo_path_data_type_t;
+                              #       length : LongInt;
+                              #    end
+    x: float64
+    y: float64
+
+  cairo_path_t* = record
+    status: cairo_status_t
+    data: Pcairo_path_data_t
+    num_data: int32
+
+  cairo_rectangle_t* = record
+    x, y, width, height: float64
+
+  cairo_rectangle_list_t* = record
+    status: cairo_status_t
+    rectangles: Pcairo_rectangle_t
+    num_rectangles: int32
+
+
+proc cairo_version*(): int32{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_version_string*(): cstring{.cdecl, importc, dynlib: LIB_CAIRO.}
+  #Helper function to retrieve decoded version
+proc cairo_version*(major, minor, micro: var int32)
+  #* Functions for manipulating state objects
+proc cairo_create*(target: Pcairo_surface_t): Pcairo_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_reference*(cr: Pcairo_t): Pcairo_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_destroy*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_reference_count*(cr: Pcairo_t): int32{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_user_data*(cr: Pcairo_t, key: Pcairo_user_data_key_t): pointer{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_user_data*(cr: PCairo_t, key: Pcairo_user_data_key_t,
+                          user_data: Pointer, destroy: cairo_destroy_func_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_save*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_restore*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_push_group*(cr: PCairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_push_group_with_content*(cr: PCairo_t, content: cairo_content_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pop_group*(cr: PCairo_t): Pcairo_pattern_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pop_group_to_source*(cr: PCairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Modify state
+proc cairo_set_operator*(cr: Pcairo_t, op: cairo_operator_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_source*(cr: Pcairo_t, source: Pcairo_pattern_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_source_rgb*(cr: Pcairo_t, red, green, blue: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_source_rgba*(cr: Pcairo_t, red, green, blue, alpha: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_source_surface*(cr: Pcairo_t, surface: Pcairo_surface_t,
+                               x, y: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_tolerance*(cr: Pcairo_t, tolerance: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_antialias*(cr: Pcairo_t, antialias: cairo_antialias_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_fill_rule*(cr: Pcairo_t, fill_rule: cairo_fill_rule_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_line_width*(cr: Pcairo_t, width: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_line_cap*(cr: Pcairo_t, line_cap: cairo_line_cap_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_line_join*(cr: Pcairo_t, line_join: cairo_line_join_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_dash*(cr: Pcairo_t, dashes: openarray[float64],
+                     offset: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_miter_limit*(cr: Pcairo_t, limit: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_translate*(cr: Pcairo_t, tx, ty: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scale*(cr: Pcairo_t, sx, sy: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rotate*(cr: Pcairo_t, angle: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_transform*(cr: Pcairo_t, matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_matrix*(cr: Pcairo_t, matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_identity_matrix*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_user_to_device*(cr: Pcairo_t, x, y: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_user_to_device_distance*(cr: Pcairo_t, dx, dy: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_device_to_user*(cr: Pcairo_t, x, y: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_device_to_user_distance*(cr: Pcairo_t, dx, dy: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Path creation functions
+proc cairo_new_path*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_move_to*(cr: Pcairo_t, x, y: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_new_sub_path*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_line_to*(cr: Pcairo_t, x, y: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_curve_to*(cr: Pcairo_t, x1, y1, x2, y2, x3, y3: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_arc*(cr: Pcairo_t, xc, yc, radius, angle1, angle2: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_arc_negative*(cr: Pcairo_t, xc, yc, radius, angle1, angle2: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rel_move_to*(cr: Pcairo_t, dx, dy: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rel_line_to*(cr: Pcairo_t, dx, dy: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rel_curve_to*(cr: Pcairo_t, dx1, dy1, dx2, dy2, dx3, dy3: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rectangle*(cr: Pcairo_t, x, y, width, height: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_close_path*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Painting functions
+proc cairo_paint*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_paint_with_alpha*(cr: Pcairo_t, alpha: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_mask*(cr: Pcairo_t, pattern: Pcairo_pattern_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_mask_surface*(cr: Pcairo_t, surface: Pcairo_surface_t,
+                         surface_x, surface_y: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_stroke*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_stroke_preserve*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_fill*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_fill_preserve*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_copy_page*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_show_page*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Insideness testing
+proc cairo_in_stroke*(cr: Pcairo_t, x, y: float64): cairo_bool_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_in_fill*(cr: Pcairo_t, x, y: float64): cairo_bool_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Rectangular extents
+proc cairo_stroke_extents*(cr: Pcairo_t, x1, y1, x2, y2: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_fill_extents*(cr: Pcairo_t, x1, y1, x2, y2: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Clipping
+proc cairo_reset_clip*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_clip*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_clip_preserve*(cr: Pcairo_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_clip_extents*(cr: Pcairo_t, x1, y1, x2, y2: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_copy_clip_rectangle_list*(cr: Pcairo_t): Pcairo_rectangle_list_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_rectangle_list_destroy*(rectangle_list: Pcairo_rectangle_list_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Font/Text functions
+proc cairo_font_options_create*(): Pcairo_font_options_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_copy*(original: Pcairo_font_options_t): Pcairo_font_options_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_destroy*(options: Pcairo_font_options_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_status*(options: Pcairo_font_options_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_merge*(options, other: Pcairo_font_options_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_equal*(options, other: Pcairo_font_options_t): cairo_bool_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_hash*(options: Pcairo_font_options_t): int32{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_set_antialias*(options: Pcairo_font_options_t,
+                                       antialias: cairo_antialias_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_get_antialias*(options: Pcairo_font_options_t): cairo_antialias_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_set_subpixel_order*(options: Pcairo_font_options_t,
+    subpixel_order: cairo_subpixel_order_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_get_subpixel_order*(options: Pcairo_font_options_t): cairo_subpixel_order_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_set_hint_style*(options: Pcairo_font_options_t,
+                                        hint_style: cairo_hint_style_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_options_get_hint_style*(options: Pcairo_font_options_t): cairo_hint_style_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_set_hint_metrics*(options: Pcairo_font_options_t,
+    hint_metrics: cairo_hint_metrics_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_options_get_hint_metrics*(options: Pcairo_font_options_t): cairo_hint_metrics_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* This interface is for dealing with text as text, not caring about the
+  #   font object inside the the cairo_t.
+proc cairo_select_font_face*(cr: Pcairo_t, family: cstring,
+                             slant: cairo_font_slant_t,
+                             weight: cairo_font_weight_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_font_size*(cr: Pcairo_t, size: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_font_matrix*(cr: Pcairo_t, matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_font_matrix*(cr: Pcairo_t, matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_font_options*(cr: Pcairo_t, options: Pcairo_font_options_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_font_options*(cr: Pcairo_t, options: Pcairo_font_options_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_set_font_face*(cr: Pcairo_t, font_face: Pcairo_font_face_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_font_face*(cr: Pcairo_t): Pcairo_font_face_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_set_scaled_font*(cr: PCairo_t, scaled_font: Pcairo_scaled_font_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_scaled_font*(cr: Pcairo_t): Pcairo_scaled_font_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_show_text*(cr: Pcairo_t, utf8: cstring){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_show_glyphs*(cr: Pcairo_t, glyphs: Pcairo_glyph_t, num_glyphs: int32){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_text_path*(cr: Pcairo_t, utf8: cstring){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_glyph_path*(cr: Pcairo_t, glyphs: Pcairo_glyph_t, num_glyphs: int32){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_text_extents*(cr: Pcairo_t, utf8: cstring,
+                         extents: Pcairo_text_extents_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_glyph_extents*(cr: Pcairo_t, glyphs: Pcairo_glyph_t,
+                          num_glyphs: int32, extents: Pcairo_text_extents_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_extents*(cr: Pcairo_t, extents: Pcairo_font_extents_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Generic identifier for a font style
+proc cairo_font_face_reference*(font_face: Pcairo_font_face_t): Pcairo_font_face_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_face_destroy*(font_face: Pcairo_font_face_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_font_face_get_reference_count*(font_face: Pcairo_font_face_t): int32{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_face_status*(font_face: Pcairo_font_face_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_face_get_type*(font_face: Pcairo_font_face_t): cairo_font_type_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_face_get_user_data*(font_face: Pcairo_font_face_t,
+                                    key: Pcairo_user_data_key_t): pointer{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_font_face_set_user_data*(font_face: Pcairo_font_face_t,
+                                    key: Pcairo_user_data_key_t,
+                                    user_data: pointer,
+                                    destroy: cairo_destroy_func_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Portable interface to general font features
+proc cairo_scaled_font_create*(font_face: Pcairo_font_face_t,
+                               font_matrix: Pcairo_matrix_t,
+                               ctm: Pcairo_matrix_t,
+                               options: Pcairo_font_options_t): Pcairo_scaled_font_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_reference*(scaled_font: Pcairo_scaled_font_t): Pcairo_scaled_font_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_destroy*(scaled_font: Pcairo_scaled_font_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_reference_count*(scaled_font: Pcairo_scaled_font_t): int32{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_status*(scaled_font: Pcairo_scaled_font_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_type*(scaled_font: Pcairo_scaled_font_t): cairo_font_type_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_user_data*(scaled_font: Pcairo_scaled_font_t,
+                                      key: Pcairo_user_data_key_t): Pointer{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_set_user_data*(scaled_font: Pcairo_scaled_font_t,
+                                      key: Pcairo_user_data_key_t,
+                                      user_data: Pointer,
+                                      destroy: cairo_destroy_func_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_extents*(scaled_font: Pcairo_scaled_font_t,
+                                extents: Pcairo_font_extents_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_text_extents*(scaled_font: Pcairo_scaled_font_t,
+                                     utf8: cstring,
+                                     extents: Pcairo_text_extents_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_glyph_extents*(scaled_font: Pcairo_scaled_font_t,
+                                      glyphs: Pcairo_glyph_t, num_glyphs: int32,
+                                      extents: Pcairo_text_extents_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_font_face*(scaled_font: Pcairo_scaled_font_t): Pcairo_font_face_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_font_matrix*(scaled_font: Pcairo_scaled_font_t,
+                                        font_matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_ctm*(scaled_font: Pcairo_scaled_font_t,
+                                ctm: Pcairo_matrix_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_scaled_font_get_font_options*(scaled_font: Pcairo_scaled_font_t,
+    options: Pcairo_font_options_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Query functions
+proc cairo_get_operator*(cr: Pcairo_t): cairo_operator_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_source*(cr: Pcairo_t): Pcairo_pattern_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_tolerance*(cr: Pcairo_t): float64{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_antialias*(cr: Pcairo_t): cairo_antialias_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_current_point*(cr: Pcairo_t, x, y: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_fill_rule*(cr: Pcairo_t): cairo_fill_rule_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_line_width*(cr: Pcairo_t): float64{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_line_cap*(cr: Pcairo_t): cairo_line_cap_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_line_join*(cr: Pcairo_t): cairo_line_join_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_miter_limit*(cr: Pcairo_t): float64{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_dash_count*(cr: Pcairo_t): int32{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_dash*(cr: Pcairo_t, dashes, offset: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_matrix*(cr: Pcairo_t, matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_get_target*(cr: Pcairo_t): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_get_group_target*(cr: Pcairo_t): Pcairo_surface_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_copy_path*(cr: Pcairo_t): Pcairo_path_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_copy_path_flat*(cr: Pcairo_t): Pcairo_path_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_append_path*(cr: Pcairo_t, path: Pcairo_path_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_path_destroy*(path: Pcairo_path_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Error status queries
+proc cairo_status*(cr: Pcairo_t): cairo_status_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_status_to_string*(status: cairo_status_t): cstring{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Surface manipulation
+proc cairo_surface_create_similar*(other: Pcairo_surface_t,
+                                   content: cairo_content_t,
+                                   width, height: int32): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_reference*(surface: Pcairo_surface_t): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_finish*(surface: Pcairo_surface_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_destroy*(surface: Pcairo_surface_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_get_reference_count*(surface: Pcairo_surface_t): int32{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_status*(surface: Pcairo_surface_t): cairo_status_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_get_type*(surface: Pcairo_surface_t): cairo_surface_type_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_get_content*(surface: Pcairo_surface_t): cairo_content_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_write_to_png*(surface: Pcairo_surface_t, filename: cstring): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_write_to_png_stream*(surface: Pcairo_surface_t,
+                                        write_func: cairo_write_func_t,
+                                        closure: pointer): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_get_user_data*(surface: Pcairo_surface_t,
+                                  key: Pcairo_user_data_key_t): pointer{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_set_user_data*(surface: Pcairo_surface_t,
+                                  key: Pcairo_user_data_key_t,
+                                  user_data: pointer,
+                                  destroy: cairo_destroy_func_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_get_font_options*(surface: Pcairo_surface_t,
+                                     options: Pcairo_font_options_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_flush*(surface: Pcairo_surface_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_mark_dirty*(surface: Pcairo_surface_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_mark_dirty_rectangle*(surface: Pcairo_surface_t,
+    x, y, width, height: int32){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_surface_set_device_offset*(surface: Pcairo_surface_t,
+                                      x_offset, y_offset: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_get_device_offset*(surface: Pcairo_surface_t,
+                                      x_offset, y_offset: var float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_surface_set_fallback_resolution*(surface: Pcairo_surface_t,
+    x_pixels_per_inch, y_pixels_per_inch: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Image-surface functions
+proc cairo_image_surface_create*(format: cairo_format_t, width, height: int32): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_image_surface_create_for_data*(data: Pbyte, format: cairo_format_t,
+    width, height, stride: int32): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_image_surface_get_data*(surface: Pcairo_surface_t): cstring{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_image_surface_get_format*(surface: Pcairo_surface_t): cairo_format_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_image_surface_get_width*(surface: Pcairo_surface_t): int32{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_image_surface_get_height*(surface: Pcairo_surface_t): int32{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_image_surface_get_stride*(surface: Pcairo_surface_t): int32{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_image_surface_create_from_png*(filename: cstring): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_image_surface_create_from_png_stream*(read_func: cairo_read_func_t,
+    closure: pointer): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Pattern creation functions
+proc cairo_pattern_create_rgb*(red, green, blue: float64): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_create_rgba*(red, green, blue, alpha: float64): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_create_for_surface*(surface: Pcairo_surface_t): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_create_linear*(x0, y0, x1, y1: float64): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_create_radial*(cx0, cy0, radius0, cx1, cy1, radius1: float64): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_reference*(pattern: Pcairo_pattern_t): Pcairo_pattern_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_destroy*(pattern: Pcairo_pattern_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_reference_count*(pattern: Pcairo_pattern_t): int32{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_status*(pattern: Pcairo_pattern_t): cairo_status_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_user_data*(pattern: Pcairo_pattern_t,
+                                  key: Pcairo_user_data_key_t): Pointer{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_pattern_set_user_data*(pattern: Pcairo_pattern_t,
+                                  key: Pcairo_user_data_key_t,
+                                  user_data: Pointer,
+                                  destroy: cairo_destroy_func_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_type*(pattern: Pcairo_pattern_t): cairo_pattern_type_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_add_color_stop_rgb*(pattern: Pcairo_pattern_t,
+                                       offset, red, green, blue: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_add_color_stop_rgba*(pattern: Pcairo_pattern_t, offset, red,
+    green, blue, alpha: float64){.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_set_matrix*(pattern: Pcairo_pattern_t,
+                               matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_matrix*(pattern: Pcairo_pattern_t,
+                               matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_pattern_set_extend*(pattern: Pcairo_pattern_t, extend: cairo_extend_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_extend*(pattern: Pcairo_pattern_t): cairo_extend_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_set_filter*(pattern: Pcairo_pattern_t, filter: cairo_filter_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_filter*(pattern: Pcairo_pattern_t): cairo_filter_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_rgba*(pattern: Pcairo_pattern_t,
+                             red, green, blue, alpha: var float64): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_surface*(pattern: Pcairo_pattern_t,
+                                surface: PPcairo_surface_t): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_color_stop_rgba*(pattern: Pcairo_pattern_t, index: int32,
+    offset, red, green, blue, alpha: var float64): cairo_status_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_color_stop_count*(pattern: Pcairo_pattern_t,
+    count: var int32): cairo_status_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_linear_points*(pattern: Pcairo_pattern_t,
+                                      x0, y0, x1, y1: var float64): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pattern_get_radial_circles*(pattern: Pcairo_pattern_t,
+                                       x0, y0, r0, x1, y1, r1: var float64): cairo_status_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* Matrix functions
+proc cairo_matrix_init*(matrix: Pcairo_matrix_t, xx, yx, xy, yy, x0, y0: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_matrix_init_identity*(matrix: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_init_translate*(matrix: Pcairo_matrix_t, tx, ty: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_matrix_init_scale*(matrix: Pcairo_matrix_t, sx, sy: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_init_rotate*(matrix: Pcairo_matrix_t, radians: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_matrix_translate*(matrix: Pcairo_matrix_t, tx, ty: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_scale*(matrix: Pcairo_matrix_t, sx, sy: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_rotate*(matrix: Pcairo_matrix_t, radians: float64){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_invert*(matrix: Pcairo_matrix_t): cairo_status_t{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_multiply*(result, a, b: Pcairo_matrix_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_matrix_transform_distance*(matrix: Pcairo_matrix_t, dx, dy: var float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_matrix_transform_point*(matrix: Pcairo_matrix_t, x, y: var float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* PDF functions
+proc cairo_pdf_surface_create*(filename: cstring,
+                               width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pdf_surface_create_for_stream*(write_func: cairo_write_func_t,
+    closure: Pointer, width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_pdf_surface_set_size*(surface: Pcairo_surface_t,
+                                 width_in_points, height_in_points: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+  #* PS functions
+proc cairo_ps_surface_create*(filename: cstring,
+                              width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ps_surface_create_for_stream*(write_func: cairo_write_func_t,
+    closure: Pointer, width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ps_surface_set_size*(surface: Pcairo_surface_t,
+                                width_in_points, height_in_points: float64){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ps_surface_dsc_comment*(surface: Pcairo_surface_t, comment: cstring){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ps_surface_dsc_begin_setup*(surface: Pcairo_surface_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+proc cairo_ps_surface_dsc_begin_page_setup*(surface: Pcairo_surface_t){.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* SVG functions
+proc cairo_svg_surface_create*(filename: cstring,
+                               width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_svg_surface_create_for_stream*(write_func: cairo_write_func_t,
+    closure: Pointer, width_in_points, height_in_points: float64): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_svg_surface_restrict_to_version*(surface: Pcairo_surface_t,
+    version: cairo_svg_version_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+  #todo: see how translate this
+  #procedure cairo_svg_get_versions(cairo_svg_version_t const	**versions,
+  #                        int                      	 *num_versions);
+proc cairo_svg_version_to_string*(version: cairo_svg_version_t): cstring{.cdecl, importc,
+    dynlib: LIB_CAIRO.}
+  #* Functions to be used while debugging (not intended for use in production code)
+proc cairo_debug_reset_static_data*(){.cdecl, importc, dynlib: LIB_CAIRO.}
+# implementation
+
+proc cairo_version(major, minor, micro: var int32) =
+  var version: int32
+  version = cairo_version()
+  major = version div 10000
+  minor = (version mod (major * 10000)) div 100
+  micro = (version mod ((major * 10000) + (minor * 100)))
diff --git a/lib/base/cairo/cairoft.nim b/lib/base/cairo/cairoft.nim
new file mode 100644
index 000000000..c564d1afa
--- /dev/null
+++ b/lib/base/cairo/cairoft.nim
@@ -0,0 +1,36 @@
+#
+# Translation of cairo-ft.h 
+# by Jeffrey Pohlmeyer 
+# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
+#
+
+import  Cairo, freetypeh
+
+#todo: properly define FcPattern:
+#It will require translate FontConfig header
+
+#*
+#typedef struct _XftPattern {
+#  int		    num;
+#  int		    size;
+#  XftPatternElt   *elts;
+# } XftPattern;
+# typedef FcPattern XftPattern;
+#
+
+type 
+  FcPattern* = Pointer
+  PFcPattern* = ref FcPattern
+
+proc cairo_ft_font_face_create_for_pattern*(pattern: PFcPattern): Pcairo_font_face_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ft_font_options_substitute*(options: Pcairo_font_options_t, 
+                                       pattern: PFcPattern){.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_ft_font_face_create_for_ft_face*(face: TFT_Face, 
+       load_flags: int32): Pcairo_font_face_t {.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ft_scaled_font_lock_face*(
+  scaled_font: Pcairo_scaled_font_t): TFT_Face{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_ft_scaled_font_unlock_face*(
+  scaled_font: Pcairo_scaled_font_t){.cdecl, importc, dynlib: LIB_CAIRO.}
+
diff --git a/lib/base/cairo/cairowin32.nim b/lib/base/cairo/cairowin32.nim
new file mode 100644
index 000000000..cbd1a6d4c
--- /dev/null
+++ b/lib/base/cairo/cairowin32.nim
@@ -0,0 +1,36 @@
+
+#
+# Translation of cairo-win32.h version 1.4
+# by Luiz Américo Pereira Câmara 2007
+#
+
+import 
+  Cairo, windows
+
+proc cairo_win32_surface_create*(hdc: HDC): Pcairo_surface_t{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_win32_surface_create_with_ddb*(hdc: HDC, format: cairo_format_t, 
+    width, height: int32): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_surface_create_with_dib*(format: cairo_format_t, 
+    width, height: int32): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_surface_get_dc*(surface: pcairo_surface_t): HDC{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_win32_surface_get_image*(surface: pcairo_surface_t): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_font_face_create_for_logfontw*(logfont: pLOGFONTW): Pcairo_font_face_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_font_face_create_for_hfont*(font: HFONT): Pcairo_font_face_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_scaled_font_select_font*(scaled_font: pcairo_scaled_font_t, 
+    hdc: HDC): cairo_status_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_scaled_font_done_font*(scaled_font: pcairo_scaled_font_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_scaled_font_get_metrics_factor*(
+    scaled_font: pcairo_scaled_font_t): float64{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_scaled_font_get_logical_to_device*(
+    scaled_font: pcairo_scaled_font_t, logical_to_device: pcairo_matrix_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_win32_scaled_font_get_device_to_logical*(
+    scaled_font: pcairo_scaled_font_t, device_to_logical: pcairo_matrix_t){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+# implementation
diff --git a/lib/base/cairo/cairoxlib.nim b/lib/base/cairo/cairoxlib.nim
new file mode 100644
index 000000000..61a9fb283
--- /dev/null
+++ b/lib/base/cairo/cairoxlib.nim
@@ -0,0 +1,40 @@
+
+#
+# Translation of cairo-xlib.h version 1.4
+# by Jeffrey Pohlmeyer 
+# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
+#
+
+import 
+  Cairo, x, xlib, xrender
+
+proc cairo_xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, 
+                                visual: PVisual, width, height: int32): Pcairo_surface_t{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_create_for_bitmap*(dpy: PDisplay, bitmap: TPixmap, 
+    screen: PScreen, width, height: int32): Pcairo_surface_t{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_create_with_xrender_format*(dpy: PDisplay, 
+    drawable: TDrawable, screen: PScreen, format: PXRenderPictFormat, 
+    width, height: int32): Pcairo_surface_t{.cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_depth*(surface: Pcairo_surface_t): int32{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_display*(surface: Pcairo_surface_t): PDisplay{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_drawable*(surface: Pcairo_surface_t): TDrawable{.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_height*(surface: Pcairo_surface_t): int32{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_screen*(surface: Pcairo_surface_t): PScreen{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_visual*(surface: Pcairo_surface_t): PVisual{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_get_width*(surface: Pcairo_surface_t): int32{.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_set_size*(surface: Pcairo_surface_t, 
+                                  width, height: int32){.cdecl, importc, 
+    dynlib: LIB_CAIRO.}
+proc cairo_xlib_surface_set_drawable*(surface: Pcairo_surface_t, 
+                                      drawable: TDrawable, width, height: int32){.
+    cdecl, importc, dynlib: LIB_CAIRO.}
+# implementation
diff --git a/lib/base/dialogs.nim b/lib/base/dialogs.nim
new file mode 100755
index 000000000..cd9c7c6b8
--- /dev/null
+++ b/lib/base/dialogs.nim
@@ -0,0 +1,234 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2008 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+## This module implements portable dialogs for Nimrod; the implementation
+## builds on the GTK interface. On Windows, native dialogs are shown if
+## appropriate.
+
+import
+  glib2, gtk2
+
+when defined(Windows):
+  import windows, ShellAPI, os
+
+type
+  PWindow* = PGtkWindow ## A shortcut for a GTK window.
+
+proc info*(window: PWindow, msg: string) =
+  ## Shows an information message to the user. The process waits until the
+  ## user presses the OK button.
+  when defined(Windows):
+    discard MessageBoxA(0, msg, "Information", MB_OK or MB_ICONINFORMATION)
+  else:
+    var dialog = GTK_DIALOG(gtk_message_dialog_new(window,
+                GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT,
+                GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", cstring(msg)))
+    gtk_window_set_title(dialog, "Information")
+    discard gtk_dialog_run(dialog)
+    gtk_widget_destroy(dialog)
+
+proc warning*(window: PWindow, msg: string) =
+  ## Shows a warning message to the user. The process waits until the user
+  ## presses the OK button.
+  when defined(Windows):
+    discard MessageBoxA(0, msg, "Warning", MB_OK or MB_ICONWARNING)
+  else:
+    var dialog = GTK_DIALOG(gtk_message_dialog_new(window,
+                GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT,
+                GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "%s", cstring(msg)))
+    gtk_window_set_title(dialog, "Warning")
+    discard gtk_dialog_run(dialog)
+    gtk_widget_destroy(dialog)
+
+proc error*(window: PWindow, msg: string) =
+  ## Shows an error message to the user. The process waits until the user
+  ## presses the OK button.
+  when defined(Windows):
+    discard MessageBoxA(0, msg, "Error", MB_OK or MB_ICONERROR)
+  else:
+    var dialog = GTK_DIALOG(gtk_message_dialog_new(window,
+                GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT,
+                GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", cstring(msg)))
+    gtk_window_set_title(dialog, "Error")
+    discard gtk_dialog_run(dialog)
+    gtk_widget_destroy(dialog)
+
+
+proc ChooseFileToOpen*(window: PWindow, root: string = ""): string =
+  ## Opens a dialog that requests a filename from the user. Returns ""
+  ## if the user closed the dialog without selecting a file. On Windows,
+  ## the native dialog is used, else the GTK dialog is used.
+  when defined(Windows):
+    var
+      opf: TOPENFILENAME
+      buf: array [0..2047, char]
+    opf.lStructSize = sizeof(opf)
+    if root.len > 0:
+      opf.lpstrInitialDir = root
+    opf.lpstrFilter = "All Files\0*.*\0\0"
+    opf.flags = OFN_FILEMUSTEXIST
+    opf.lpstrFile = buf
+    opf.nMaxFile = sizeof(buf)
+    var res = GetOpenFileName(addr(opf))
+    if res != 0:
+      result = $buf
+    else:
+      result = ""
+  else:
+    var
+      chooser: PGtkDialog
+    chooser = GTK_DIALOG(gtk_file_chooser_dialog_new("Open File", window,
+                GTK_FILE_CHOOSER_ACTION_OPEN,
+                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                GTK_STOCK_OPEN, GTK_RESPONSE_OK, nil))
+    if root.len > 0:
+      discard gtk_file_chooser_set_current_folder(chooser, root)
+    if gtk_dialog_run(chooser) == GTK_RESPONSE_OK:
+      var x = gtk_file_chooser_get_filename(chooser)
+      result = $x
+      g_free(x)
+    else:
+      result = ""
+    gtk_widget_destroy(chooser)
+
+proc ChooseFilesToOpen*(window: PWindow, root: string = ""): seq[string] =
+  ## Opens a dialog that requests filenames from the user. Returns []
+  ## if the user closed the dialog without selecting a file. On Windows,
+  ## the native dialog is used, else the GTK dialog is used.
+  when defined(Windows):
+    var
+      opf: TOPENFILENAME
+      buf: array [0..2047*4, char]
+    opf.lStructSize = sizeof(opf)
+    if root.len > 0:
+      opf.lpstrInitialDir = root
+    opf.lpstrFilter = "All Files\0*.*\0\0"
+    opf.flags = OFN_FILEMUSTEXIST or OFN_ALLOWMULTISELECT or OFN_EXPLORER
+    opf.lpstrFile = buf
+    opf.nMaxFile = sizeof(buf)
+    var res = GetOpenFileName(addr(opf))
+    result = []
+    if res != 0:
+      # parsing the result is horrible:
+      var
+        i = 0
+        s: string
+        path = ""
+      while buf[i] != '\0':
+        add(path, buf[i])
+        inc(i)
+      inc(i)
+      if buf[i] != '\0':
+        while true:
+          s = ""
+          while buf[i] != '\0':
+            add(s, buf[i])
+            inc(i)
+          add(result, s)
+          inc(i)
+          if buf[i] == '\0': break
+        for i in 0..result.len-1: result[i] = os.joinPath(path, result[i])
+  else:
+    var
+      chooser: PGtkDialog
+    chooser = GTK_DIALOG(gtk_file_chooser_dialog_new("Open Files", window,
+                GTK_FILE_CHOOSER_ACTION_OPEN,
+                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                GTK_STOCK_OPEN, GTK_RESPONSE_OK, nil))
+    if root.len > 0:
+      discard gtk_file_chooser_set_current_folder(chooser, root)
+    gtk_file_chooser_set_select_multiple(chooser, true)
+    result = []
+    if gtk_dialog_run(chooser) == GTK_RESPONSE_OK:
+      var L = gtk_file_chooser_get_filenames(chooser)
+      var it = L
+      while it != nil:
+        add(result, $cast[cstring](it.data))
+        g_free(it.data)
+        it = it.next
+      g_slist_free(L)
+    gtk_widget_destroy(chooser)
+
+
+proc ChooseFileToSave*(window: PWindow, root: string = ""): string =
+  ## Opens a dialog that requests a filename to save to from the user.
+  ## Returns "" if the user closed the dialog without selecting a file.
+  ## On Windows, the native dialog is used, else the GTK dialog is used.
+  when defined(Windows):
+    var
+      opf: TOPENFILENAME
+      buf: array [0..2047, char]
+    opf.lStructSize = sizeof(opf)
+    if root.len > 0:
+      opf.lpstrInitialDir = root
+    opf.lpstrFilter = "All Files\0*.*\0\0"
+    opf.flags = OFN_OVERWRITEPROMPT
+    opf.lpstrFile = buf
+    opf.nMaxFile = sizeof(buf)
+    var res = GetSaveFileName(addr(opf))
+    if res != 0:
+      result = $buf
+    else:
+      result = ""
+  else:
+    var
+      chooser: PGtkDialog
+    chooser = GTK_DIALOG(gtk_file_chooser_dialog_new("Save File", window,
+                GTK_FILE_CHOOSER_ACTION_SAVE,
+                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                GTK_STOCK_OPEN, GTK_RESPONSE_OK, nil))
+    if root.len > 0:
+      discard gtk_file_chooser_set_current_folder(chooser, root)
+    gtk_file_chooser_set_do_overwrite_confirmation(chooser, true)
+    if gtk_dialog_run(chooser) == GTK_RESPONSE_OK:
+      var x = gtk_file_chooser_get_filename(chooser)
+      result = $x
+      g_free(x)
+    else:
+      result = ""
+    gtk_widget_destroy(chooser)
+
+
+proc ChooseDir*(window: PWindow, root: string = ""): string =
+  ## Opens a dialog that requests a directory from the user.
+  ## Returns "" if the user closed the dialog without selecting a directory.
+  ## On Windows, the native dialog is used, else the GTK dialog is used.
+  when defined(Windows):
+    var
+      lpItemID: PItemIDList
+      BrowseInfo: TBrowseInfo
+      DisplayName: array [0..MAX_PATH, char]
+      TempPath: array [0..MAX_PATH, char]
+    Result = ""
+    #BrowseInfo.hwndOwner = Application.Handle
+    BrowseInfo.pszDisplayName = DisplayName
+    BrowseInfo.ulFlags = 1 #BIF_RETURNONLYFSDIRS
+    lpItemID = SHBrowseForFolder(cast[LPBrowseInfo](addr(BrowseInfo)))
+    if lpItemId != nil:
+      discard SHGetPathFromIDList(lpItemID, TempPath)
+      Result = $TempPath
+      discard GlobalFreePtr(lpItemID)
+  else:
+    var
+      chooser: PGtkDialog
+    chooser = GTK_DIALOG(gtk_file_chooser_dialog_new("Select Directory", window,
+                GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                GTK_STOCK_OPEN, GTK_RESPONSE_OK, nil))
+    if root.len > 0:
+      discard gtk_file_chooser_set_current_folder(chooser, root)
+    if gtk_dialog_run(chooser) == GTK_RESPONSE_OK:
+      var x = gtk_file_chooser_get_filename(chooser)
+      result = $x
+      g_free(x)
+    else:
+      result = ""
+    gtk_widget_destroy(chooser)
+
diff --git a/lib/base/gtk/atk.nim b/lib/base/gtk/atk.nim
new file mode 100755
index 000000000..69eb7c7cc
--- /dev/null
+++ b/lib/base/gtk/atk.nim
@@ -0,0 +1,1368 @@
+import
+  glib2
+
+when defined(windows):
+  {.define: atkwin.}
+  const
+    atklib = "libatk-1.0-0.dll"
+else:
+  const
+    atklib = "libatk-1.0.so"
+type
+  PAtkImplementor* = pointer
+  PAtkAction* = pointer
+  PAtkComponent* = pointer
+  PAtkDocument* = pointer
+  PAtkEditableText* = pointer
+  PAtkHypertext* = pointer
+  PAtkImage* = pointer
+  PAtkSelection* = pointer
+  PAtkStreamableContent* = pointer
+  PAtkTable* = pointer
+  PAtkText* = pointer
+  PAtkValue* = pointer
+  PAtkRelationSet* = ptr TAtkRelationSet
+  PAtkStateSet* = ptr TAtkStateSet
+  PAtkAttributeSet* = ptr TAtkAttributeSet
+  PAtkCoordType* = ptr TAtkCoordType
+  TAtkCoordType* = enum
+    ATK_XY_SCREEN, ATK_XY_WINDOW
+  PAtkRole* = ptr TAtkRole
+  TAtkRole* = enum
+    ATK_ROLE_INVALID, ATK_ROLE_ACCEL_LABEL, ATK_ROLE_ALERT, ATK_ROLE_ANIMATION,
+    ATK_ROLE_ARROW, ATK_ROLE_CALENDAR, ATK_ROLE_CANVAS, ATK_ROLE_CHECK_BOX,
+    ATK_ROLE_CHECK_MENU_ITEM, ATK_ROLE_COLOR_CHOOSER, ATK_ROLE_COLUMN_HEADER,
+    ATK_ROLE_COMBO_BOX, ATK_ROLE_DATE_EDITOR, ATK_ROLE_DESKTOP_ICON,
+    ATK_ROLE_DESKTOP_FRAME, ATK_ROLE_DIAL, ATK_ROLE_DIALOG,
+    ATK_ROLE_DIRECTORY_PANE, ATK_ROLE_DRAWING_AREA, ATK_ROLE_FILE_CHOOSER,
+    ATK_ROLE_FILLER, ATK_ROLE_FONT_CHOOSER, ATK_ROLE_FRAME, ATK_ROLE_GLASS_PANE,
+    ATK_ROLE_HTML_CONTAINER, ATK_ROLE_ICON, ATK_ROLE_IMAGE,
+    ATK_ROLE_INTERNAL_FRAME, ATK_ROLE_LABEL, ATK_ROLE_LAYERED_PANE,
+    ATK_ROLE_LIST, ATK_ROLE_LIST_ITEM, ATK_ROLE_MENU, ATK_ROLE_MENU_BAR,
+    ATK_ROLE_MENU_ITEM, ATK_ROLE_OPTION_PANE, ATK_ROLE_PAGE_TAB,
+    ATK_ROLE_PAGE_TAB_LIST, ATK_ROLE_PANEL, ATK_ROLE_PASSWORD_TEXT,
+    ATK_ROLE_POPUP_MENU, ATK_ROLE_PROGRESS_BAR, ATK_ROLE_PUSH_BUTTON,
+    ATK_ROLE_RADIO_BUTTON, ATK_ROLE_RADIO_MENU_ITEM, ATK_ROLE_ROOT_PANE,
+    ATK_ROLE_ROW_HEADER, ATK_ROLE_SCROLL_BAR, ATK_ROLE_SCROLL_PANE,
+    ATK_ROLE_SEPARATOR, ATK_ROLE_SLIDER, ATK_ROLE_SPLIT_PANE,
+    ATK_ROLE_SPIN_BUTTON, ATK_ROLE_STATUSBAR, ATK_ROLE_TABLE,
+    ATK_ROLE_TABLE_CELL, ATK_ROLE_TABLE_COLUMN_HEADER,
+    ATK_ROLE_TABLE_ROW_HEADER, ATK_ROLE_TEAR_OFF_MENU_ITEM, ATK_ROLE_TERMINAL,
+    ATK_ROLE_TEXT, ATK_ROLE_TOGGLE_BUTTON, ATK_ROLE_TOOL_BAR, ATK_ROLE_TOOL_TIP,
+    ATK_ROLE_TREE, ATK_ROLE_TREE_TABLE, ATK_ROLE_UNKNOWN, ATK_ROLE_VIEWPORT,
+    ATK_ROLE_WINDOW, ATK_ROLE_LAST_DEFINED
+  PAtkLayer* = ptr TAtkLayer
+  TAtkLayer* = enum
+    ATK_LAYER_INVALID, ATK_LAYER_BACKGROUND, ATK_LAYER_CANVAS, ATK_LAYER_WIDGET,
+    ATK_LAYER_MDI, ATK_LAYER_POPUP, ATK_LAYER_OVERLAY
+  PAtkPropertyValues* = ptr TAtkPropertyValues
+  TAtkPropertyValues* = record
+    property_name*: cstring
+    old_value*: TGValue
+    new_value*: TGValue
+
+  TAtkFunction* = proc (data: gpointer): gboolean{.cdecl.}
+  PAtkObject* = ptr TAtkObject
+  PPAtkObject* = ptr PAtkObject
+  TAtkObject* = object of TGObject
+    description*: cstring
+    name*: cstring
+    accessible_parent*: PAtkObject
+    role*: TAtkRole
+    relation_set*: PAtkRelationSet
+    layer*: TAtkLayer
+
+  TAtkPropertyChangeHandler* = proc (para1: PAtkObject,
+                                     para2: PAtkPropertyValues){.cdecl.}
+  PAtkObjectClass* = ptr TAtkObjectClass
+  TAtkObjectClass* = object of TGObjectClass
+    get_name*: proc (accessible: PAtkObject): cstring{.cdecl.}
+    get_description*: proc (accessible: PAtkObject): cstring{.cdecl.}
+    get_parent*: proc (accessible: PAtkObject): PAtkObject{.cdecl.}
+    get_n_children*: proc (accessible: PAtkObject): gint{.cdecl.}
+    ref_child*: proc (accessible: PAtkObject, i: gint): PAtkObject{.cdecl.}
+    get_index_in_parent*: proc (accessible: PAtkObject): gint{.cdecl.}
+    ref_relation_set*: proc (accessible: PAtkObject): PAtkRelationSet{.cdecl.}
+    get_role*: proc (accessible: PAtkObject): TAtkRole{.cdecl.}
+    get_layer*: proc (accessible: PAtkObject): TAtkLayer{.cdecl.}
+    get_mdi_zorder*: proc (accessible: PAtkObject): gint{.cdecl.}
+    ref_state_set*: proc (accessible: PAtkObject): PAtkStateSet{.cdecl.}
+    set_name*: proc (accessible: PAtkObject, name: cstring){.cdecl.}
+    set_description*: proc (accessible: PAtkObject, description: cstring){.cdecl.}
+    set_parent*: proc (accessible: PAtkObject, parent: PAtkObject){.cdecl.}
+    set_role*: proc (accessible: PAtkObject, role: TAtkRole){.cdecl.}
+    connect_property_change_handler*: proc (accessible: PAtkObject,
+        handler: TAtkPropertyChangeHandler): guint{.cdecl.}
+    remove_property_change_handler*: proc (accessible: PAtkObject,
+        handler_id: guint){.cdecl.}
+    initialize*: proc (accessible: PAtkObject, data: gpointer){.cdecl.}
+    children_changed*: proc (accessible: PAtkObject, change_index: guint,
+                             changed_child: gpointer){.cdecl.}
+    focus_event*: proc (accessible: PAtkObject, focus_in: gboolean){.cdecl.}
+    property_change*: proc (accessible: PAtkObject, values: PAtkPropertyValues){.
+        cdecl.}
+    state_change*: proc (accessible: PAtkObject, name: cstring,
+                         state_set: gboolean){.cdecl.}
+    visible_data_changed*: proc (accessible: PAtkObject){.cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+    pad3*: TAtkFunction
+    pad4*: TAtkFunction
+
+  PAtkImplementorIface* = ptr TAtkImplementorIface
+  TAtkImplementorIface* = object of TGTypeInterface
+    ref_accessible*: proc (implementor: PAtkImplementor): PAtkObject{.cdecl.}
+
+  PAtkActionIface* = ptr TAtkActionIface
+  TAtkActionIface* = object of TGTypeInterface
+    do_action*: proc (action: PAtkAction, i: gint): gboolean{.cdecl.}
+    get_n_actions*: proc (action: PAtkAction): gint{.cdecl.}
+    get_description*: proc (action: PAtkAction, i: gint): cstring{.cdecl.}
+    get_name*: proc (action: PAtkAction, i: gint): cstring{.cdecl.}
+    get_keybinding*: proc (action: PAtkAction, i: gint): cstring{.cdecl.}
+    set_description*: proc (action: PAtkAction, i: gint, desc: cstring): gboolean{.
+        cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+
+  TAtkFocusHandler* = proc (para1: PAtkObject, para2: gboolean){.cdecl.}
+  PAtkComponentIface* = ptr TAtkComponentIface
+  TAtkComponentIface* = object of TGTypeInterface
+    add_focus_handler*: proc (component: PAtkComponent,
+                              handler: TAtkFocusHandler): guint{.cdecl.}
+    contains*: proc (component: PAtkComponent, x: gint, y: gint,
+                     coord_type: TAtkCoordType): gboolean{.cdecl.}
+    ref_accessible_at_point*: proc (component: PAtkComponent, x: gint, y: gint,
+                                    coord_type: TAtkCoordType): PAtkObject{.
+        cdecl.}
+    get_extents*: proc (component: PAtkComponent, x: Pgint, y: Pgint,
+                        width: Pgint, height: Pgint, coord_type: TAtkCoordType){.
+        cdecl.}
+    get_position*: proc (component: PAtkComponent, x: Pgint, y: Pgint,
+                         coord_type: TAtkCoordType){.cdecl.}
+    get_size*: proc (component: PAtkComponent, width: Pgint, height: Pgint){.
+        cdecl.}
+    grab_focus*: proc (component: PAtkComponent): gboolean{.cdecl.}
+    remove_focus_handler*: proc (component: PAtkComponent, handler_id: guint){.
+        cdecl.}
+    set_extents*: proc (component: PAtkComponent, x: gint, y: gint, width: gint,
+                        height: gint, coord_type: TAtkCoordType): gboolean{.
+        cdecl.}
+    set_position*: proc (component: PAtkComponent, x: gint, y: gint,
+                         coord_type: TAtkCoordType): gboolean{.cdecl.}
+    set_size*: proc (component: PAtkComponent, width: gint, height: gint): gboolean{.
+        cdecl.}
+    get_layer*: proc (component: PAtkComponent): TAtkLayer{.cdecl.}
+    get_mdi_zorder*: proc (component: PAtkComponent): gint{.cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+
+  PAtkDocumentIface* = ptr TAtkDocumentIface
+  TAtkDocumentIface* = object of TGTypeInterface
+    get_document_type*: proc (document: PAtkDocument): cstring{.cdecl.}
+    get_document*: proc (document: PAtkDocument): gpointer{.cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+    pad3*: TAtkFunction
+    pad4*: TAtkFunction
+    pad5*: TAtkFunction
+    pad6*: TAtkFunction
+    pad7*: TAtkFunction
+    pad8*: TAtkFunction
+
+  PAtkEditableTextIface* = ptr TAtkEditableTextIface
+  TAtkEditableTextIface* = object of TGTypeInterface
+    set_run_attributes*: proc (text: PAtkEditableText,
+                               attrib_set: PAtkAttributeSet, start_offset: gint,
+                               end_offset: gint): gboolean{.cdecl.}
+    set_text_contents*: proc (text: PAtkEditableText, `string`: cstring){.cdecl.}
+    insert_text*: proc (text: PAtkEditableText, `string`: cstring, length: gint,
+                        position: Pgint){.cdecl.}
+    copy_text*: proc (text: PAtkEditableText, start_pos: gint, end_pos: gint){.
+        cdecl.}
+    cut_text*: proc (text: PAtkEditableText, start_pos: gint, end_pos: gint){.
+        cdecl.}
+    delete_text*: proc (text: PAtkEditableText, start_pos: gint, end_pos: gint){.
+        cdecl.}
+    paste_text*: proc (text: PAtkEditableText, position: gint){.cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+
+  PAtkGObjectAccessible* = ptr TAtkGObjectAccessible
+  TAtkGObjectAccessible* = object of TAtkObject
+
+  PAtkGObjectAccessibleClass* = ptr TAtkGObjectAccessibleClass
+  TAtkGObjectAccessibleClass* = object of TAtkObjectClass
+    pad5*: TAtkFunction
+    pad6*: TAtkFunction
+
+  PAtkHyperlink* = ptr TAtkHyperlink
+  TAtkHyperlink* = object of TGObject
+
+  PAtkHyperlinkClass* = ptr TAtkHyperlinkClass
+  TAtkHyperlinkClass* = object of TGObjectClass
+    get_uri*: proc (link: PAtkHyperlink, i: gint): cstring{.cdecl.}
+    get_object*: proc (link: PAtkHyperlink, i: gint): PAtkObject{.cdecl.}
+    get_end_index*: proc (link: PAtkHyperlink): gint{.cdecl.}
+    get_start_index*: proc (link: PAtkHyperlink): gint{.cdecl.}
+    is_valid*: proc (link: PAtkHyperlink): gboolean{.cdecl.}
+    get_n_anchors*: proc (link: PAtkHyperlink): gint{.cdecl.}
+    pad7*: TAtkFunction
+    pad8*: TAtkFunction
+    pad9*: TAtkFunction
+    pad10*: TAtkFunction
+
+  PAtkHypertextIface* = ptr TAtkHypertextIface
+  TAtkHypertextIface* = object of TGTypeInterface
+    get_link*: proc (hypertext: PAtkHypertext, link_index: gint): PAtkHyperlink{.
+        cdecl.}
+    get_n_links*: proc (hypertext: PAtkHypertext): gint{.cdecl.}
+    get_link_index*: proc (hypertext: PAtkHypertext, char_index: gint): gint{.
+        cdecl.}
+    pad11*: TAtkFunction
+    pad12*: TAtkFunction
+    pad13*: TAtkFunction
+    pad14*: TAtkFunction
+
+  PAtkImageIface* = ptr TAtkImageIface
+  TAtkImageIface* = object of TGTypeInterface
+    get_image_position*: proc (image: PAtkImage, x: Pgint, y: Pgint,
+                               coord_type: TAtkCoordType){.cdecl.}
+    get_image_description*: proc (image: PAtkImage): cstring{.cdecl.}
+    get_image_size*: proc (image: PAtkImage, width: Pgint, height: Pgint){.cdecl.}
+    set_image_description*: proc (image: PAtkImage, description: cstring): gboolean{.
+        cdecl.}
+    pad15*: TAtkFunction
+    pad16*: TAtkFunction
+
+  PAtkObjectFactory* = ptr TAtkObjectFactory
+  TAtkObjectFactory* = object of TGObject
+
+  PAtkObjectFactoryClass* = ptr TAtkObjectFactoryClass
+  TAtkObjectFactoryClass* = object of TGObjectClass
+    create_accessible*: proc (obj: PGObject): PAtkObject{.cdecl.}
+    invalidate*: proc (factory: PAtkObjectFactory){.cdecl.}
+    get_accessible_type*: proc (): GType{.cdecl.}
+    pad17*: TAtkFunction
+    pad18*: TAtkFunction
+
+  PAtkRegistry* = ptr TAtkRegistry
+  TAtkRegistry* = object of TGObject
+    factory_type_registry*: PGHashTable
+    factory_singleton_cache*: PGHashTable
+
+  PAtkRegistryClass* = ptr TAtkRegistryClass
+  TAtkRegistryClass* = object of TGObjectClass
+
+  PAtkRelationType* = ptr TAtkRelationType
+  TAtkRelationType* = enum
+    ATK_RELATION_NULL, ATK_RELATION_CONTROLLED_BY, ATK_RELATION_CONTROLLER_FOR,
+    ATK_RELATION_LABEL_FOR, ATK_RELATION_LABELLED_BY, ATK_RELATION_MEMBER_OF,
+    ATK_RELATION_NODE_CHILD_OF, ATK_RELATION_LAST_DEFINED
+  PAtkRelation* = ptr TAtkRelation
+  PGPtrArray = pointer
+  TAtkRelation* = object of TGObject
+    target*: PGPtrArray
+    relationship*: TAtkRelationType
+
+  PAtkRelationClass* = ptr TAtkRelationClass
+  TAtkRelationClass* = object of TGObjectClass
+
+  TAtkRelationSet* = object of TGObject
+    relations*: PGPtrArray
+
+  PAtkRelationSetClass* = ptr TAtkRelationSetClass
+  TAtkRelationSetClass* = object of TGObjectClass
+    pad19*: TAtkFunction
+    pad20*: TAtkFunction
+
+  PAtkSelectionIface* = ptr TAtkSelectionIface
+  TAtkSelectionIface* = object of TGTypeInterface
+    add_selection*: proc (selection: PAtkSelection, i: gint): gboolean{.cdecl.}
+    clear_selection*: proc (selection: PAtkSelection): gboolean{.cdecl.}
+    ref_selection*: proc (selection: PAtkSelection, i: gint): PAtkObject{.cdecl.}
+    get_selection_count*: proc (selection: PAtkSelection): gint{.cdecl.}
+    is_child_selected*: proc (selection: PAtkSelection, i: gint): gboolean{.
+        cdecl.}
+    remove_selection*: proc (selection: PAtkSelection, i: gint): gboolean{.cdecl.}
+    select_all_selection*: proc (selection: PAtkSelection): gboolean{.cdecl.}
+    selection_changed*: proc (selection: PAtkSelection){.cdecl.}
+    pad1*: TAtkFunction
+    pad2*: TAtkFunction
+
+  PAtkStateType* = ptr TAtkStateType
+  TAtkStateType* = enum
+    ATK_STATE_INVALID, ATK_STATE_ACTIVE, ATK_STATE_ARMED, ATK_STATE_BUSY,
+    ATK_STATE_CHECKED, ATK_STATE_DEFUNCT, ATK_STATE_EDITABLE, ATK_STATE_ENABLED,
+    ATK_STATE_EXPANDABLE, ATK_STATE_EXPANDED, ATK_STATE_FOCUSABLE,
+    ATK_STATE_FOCUSED, ATK_STATE_HORIZONTAL, ATK_STATE_ICONIFIED,
+    ATK_STATE_MODAL, ATK_STATE_MULTI_LINE, ATK_STATE_MULTISELECTABLE,
+    ATK_STATE_OPAQUE, ATK_STATE_PRESSED, ATK_STATE_RESIZABLE,
+    ATK_STATE_SELECTABLE, ATK_STATE_SELECTED, ATK_STATE_SENSITIVE,
+    ATK_STATE_SHOWING, ATK_STATE_SINGLE_LINE, ATK_STATE_STALE,
+    ATK_STATE_TRANSIENT, ATK_STATE_VERTICAL, ATK_STATE_VISIBLE,
+    ATK_STATE_LAST_DEFINED
+  PAtkState* = ptr TAtkState
+  TAtkState* = guint64
+  TAtkStateSet* = object of TGObject
+
+  PAtkStateSetClass* = ptr TAtkStateSetClass
+  TAtkStateSetClass* = object of TGObjectClass
+
+  PAtkStreamableContentIface* = ptr TAtkStreamableContentIface
+  TAtkStreamableContentIface* = object of TGTypeInterface
+    get_n_mime_types*: proc (streamable: PAtkStreamableContent): gint{.cdecl.}
+    get_mime_type*: proc (streamable: PAtkStreamableContent, i: gint): cstring{.
+        cdecl.}
+    get_stream*: proc (streamable: PAtkStreamableContent, mime_type: cstring): PGIOChannel{.
+        cdecl.}
+    pad21*: TAtkFunction
+    pad22*: TAtkFunction
+    pad23*: TAtkFunction
+    pad24*: TAtkFunction
+
+  PAtkTableIface* = ptr TAtkTableIface
+  TAtkTableIface* = object of TGTypeInterface
+    ref_at*: proc (table: PAtkTable, row: gint, column: gint): PAtkObject{.cdecl.}
+    get_index_at*: proc (table: PAtkTable, row: gint, column: gint): gint{.cdecl.}
+    get_column_at_index*: proc (table: PAtkTable, index: gint): gint{.cdecl.}
+    get_row_at_index*: proc (table: PAtkTable, index: gint): gint{.cdecl.}
+    get_n_columns*: proc (table: PAtkTable): gint{.cdecl.}
+    get_n_rows*: proc (table: PAtkTable): gint{.cdecl.}
+    get_column_extent_at*: proc (table: PAtkTable, row: gint, column: gint): gint{.
+        cdecl.}
+    get_row_extent_at*: proc (table: PAtkTable, row: gint, column: gint): gint{.
+        cdecl.}
+    get_caption*: proc (table: PAtkTable): PAtkObject{.cdecl.}
+    get_column_description*: proc (table: PAtkTable, column: gint): cstring{.
+        cdecl.}
+    get_column_header*: proc (table: PAtkTable, column: gint): PAtkObject{.cdecl.}
+    get_row_description*: proc (table: PAtkTable, row: gint): cstring{.cdecl.}
+    get_row_header*: proc (table: PAtkTable, row: gint): PAtkObject{.cdecl.}
+    get_summary*: proc (table: PAtkTable): PAtkObject{.cdecl.}
+    set_caption*: proc (table: PAtkTable, caption: PAtkObject){.cdecl.}
+    set_column_description*: proc (table: PAtkTable, column: gint,
+                                   description: cstring){.cdecl.}
+    set_column_header*: proc (table: PAtkTable, column: gint, header: PAtkObject){.
+        cdecl.}
+    set_row_description*: proc (table: PAtkTable, row: gint, description: cstring){.
+        cdecl.}
+    set_row_header*: proc (table: PAtkTable, row: gint, header: PAtkObject){.
+        cdecl.}
+    set_summary*: proc (table: PAtkTable, accessible: PAtkObject){.cdecl.}
+    get_selected_columns*: proc (table: PAtkTable, selected: PPgint): gint{.
+        cdecl.}
+    get_selected_rows*: proc (table: PAtkTable, selected: PPgint): gint{.cdecl.}
+    is_column_selected*: proc (table: PAtkTable, column: gint): gboolean{.cdecl.}
+    is_row_selected*: proc (table: PAtkTable, row: gint): gboolean{.cdecl.}
+    is_selected*: proc (table: PAtkTable, row: gint, column: gint): gboolean{.
+        cdecl.}
+    add_row_selection*: proc (table: PAtkTable, row: gint): gboolean{.cdecl.}
+    remove_row_selection*: proc (table: PAtkTable, row: gint): gboolean{.cdecl.}
+    add_column_selection*: proc (table: PAtkTable, column: gint): gboolean{.
+        cdecl.}
+    remove_column_selection*: proc (table: PAtkTable, column: gint): gboolean{.
+        cdecl.}
+    row_inserted*: proc (table: PAtkTable, row: gint, num_inserted: gint){.cdecl.}
+    column_inserted*: proc (table: PAtkTable, column: gint, num_inserted: gint){.
+        cdecl.}
+    row_deleted*: proc (table: PAtkTable, row: gint, num_deleted: gint){.cdecl.}
+    column_deleted*: proc (table: PAtkTable, column: gint, num_deleted: gint){.
+        cdecl.}
+    row_reordered*: proc (table: PAtkTable){.cdecl.}
+    column_reordered*: proc (table: PAtkTable){.cdecl.}
+    model_changed*: proc (table: PAtkTable){.cdecl.}
+    pad25*: TAtkFunction
+    pad26*: TAtkFunction
+    pad27*: TAtkFunction
+    pad28*: TAtkFunction
+
+  TAtkAttributeSet* = TGSList
+  PAtkAttribute* = ptr TAtkAttribute
+  TAtkAttribute* = record
+    name*: cstring
+    value*: cstring
+
+  PAtkTextAttribute* = ptr TAtkTextAttribute
+  TAtkTextAttribute* = enum
+    ATK_TEXT_ATTR_INVALID, ATK_TEXT_ATTR_LEFT_MARGIN,
+    ATK_TEXT_ATTR_RIGHT_MARGIN, ATK_TEXT_ATTR_INDENT, ATK_TEXT_ATTR_INVISIBLE,
+    ATK_TEXT_ATTR_EDITABLE, ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
+    ATK_TEXT_ATTR_PIXELS_BELOW_LINES, ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
+    ATK_TEXT_ATTR_BG_FULL_HEIGHT, ATK_TEXT_ATTR_RISE, ATK_TEXT_ATTR_UNDERLINE,
+    ATK_TEXT_ATTR_STRIKETHROUGH, ATK_TEXT_ATTR_SIZE, ATK_TEXT_ATTR_SCALE,
+    ATK_TEXT_ATTR_WEIGHT, ATK_TEXT_ATTR_LANGUAGE, ATK_TEXT_ATTR_FAMILY_NAME,
+    ATK_TEXT_ATTR_BG_COLOR, ATK_TEXT_ATTR_FG_COLOR, ATK_TEXT_ATTR_BG_STIPPLE,
+    ATK_TEXT_ATTR_FG_STIPPLE, ATK_TEXT_ATTR_WRAP_MODE, ATK_TEXT_ATTR_DIRECTION,
+    ATK_TEXT_ATTR_JUSTIFICATION, ATK_TEXT_ATTR_STRETCH, ATK_TEXT_ATTR_VARIANT,
+    ATK_TEXT_ATTR_STYLE, ATK_TEXT_ATTR_LAST_DEFINED
+  PAtkTextBoundary* = ptr TAtkTextBoundary
+  TAtkTextBoundary* = enum
+    ATK_TEXT_BOUNDARY_CHAR, ATK_TEXT_BOUNDARY_WORD_START,
+    ATK_TEXT_BOUNDARY_WORD_END, ATK_TEXT_BOUNDARY_SENTENCE_START,
+    ATK_TEXT_BOUNDARY_SENTENCE_END, ATK_TEXT_BOUNDARY_LINE_START,
+    ATK_TEXT_BOUNDARY_LINE_END
+  PAtkTextIface* = ptr TAtkTextIface
+  TAtkTextIface* = object of TGTypeInterface
+    get_text*: proc (text: PAtkText, start_offset: gint, end_offset: gint): cstring{.
+        cdecl.}
+    get_text_after_offset*: proc (text: PAtkText, offset: gint,
+                                  boundary_type: TAtkTextBoundary,
+                                  start_offset: Pgint, end_offset: Pgint): cstring{.
+        cdecl.}
+    get_text_at_offset*: proc (text: PAtkText, offset: gint,
+                               boundary_type: TAtkTextBoundary,
+                               start_offset: Pgint, end_offset: Pgint): cstring{.
+        cdecl.}
+    get_character_at_offset*: proc (text: PAtkText, offset: gint): gunichar{.
+        cdecl.}
+    get_text_before_offset*: proc (text: PAtkText, offset: gint,
+                                   boundary_type: TAtkTextBoundary,
+                                   start_offset: Pgint, end_offset: Pgint): cstring{.
+        cdecl.}
+    get_caret_offset*: proc (text: PAtkText): gint{.cdecl.}
+    get_run_attributes*: proc (text: PAtkText, offset: gint,
+                               start_offset: Pgint, end_offset: Pgint): PAtkAttributeSet{.
+        cdecl.}
+    get_default_attributes*: proc (text: PAtkText): PAtkAttributeSet{.cdecl.}
+    get_character_extents*: proc (text: PAtkText, offset: gint, x: Pgint,
+                                  y: Pgint, width: Pgint, height: Pgint,
+                                  coords: TAtkCoordType){.cdecl.}
+    get_character_count*: proc (text: PAtkText): gint{.cdecl.}
+    get_offset_at_point*: proc (text: PAtkText, x: gint, y: gint,
+                                coords: TAtkCoordType): gint{.cdecl.}
+    get_n_selections*: proc (text: PAtkText): gint{.cdecl.}
+    get_selection*: proc (text: PAtkText, selection_num: gint,
+                          start_offset: Pgint, end_offset: Pgint): cstring{.cdecl.}
+    add_selection*: proc (text: PAtkText, start_offset: gint, end_offset: gint): gboolean{.
+        cdecl.}
+    remove_selection*: proc (text: PAtkText, selection_num: gint): gboolean{.
+        cdecl.}
+    set_selection*: proc (text: PAtkText, selection_num: gint,
+                          start_offset: gint, end_offset: gint): gboolean{.cdecl.}
+    set_caret_offset*: proc (text: PAtkText, offset: gint): gboolean{.cdecl.}
+    text_changed*: proc (text: PAtkText, position: gint, length: gint){.cdecl.}
+    text_caret_moved*: proc (text: PAtkText, location: gint){.cdecl.}
+    text_selection_changed*: proc (text: PAtkText){.cdecl.}
+    pad29*: TAtkFunction
+    pad30*: TAtkFunction
+    pad31*: TAtkFunction
+    pad32*: TAtkFunction
+
+  TAtkEventListener* = proc (para1: PAtkObject){.cdecl.}
+  TAtkEventListenerInitProc* = proc ()
+  TAtkEventListenerInit* = proc (para1: TAtkEventListenerInitProc){.cdecl.}
+  PAtkKeyEventStruct* = ptr TAtkKeyEventStruct
+  TAtkKeyEventStruct* = record
+    `type`*: gint
+    state*: guint
+    keyval*: guint
+    length*: gint
+    string*: cstring
+    keycode*: guint16
+    timestamp*: guint32
+
+  TAtkKeySnoopFunc* = proc (event: PAtkKeyEventStruct, func_data: gpointer): gint{.
+      cdecl.}
+  PAtkKeyEventType* = ptr TAtkKeyEventType
+  TAtkKeyEventType* = enum
+    ATK_KEY_EVENT_PRESS, ATK_KEY_EVENT_RELEASE, ATK_KEY_EVENT_LAST_DEFINED
+  PAtkUtil* = ptr TAtkUtil
+  TAtkUtil* = object of TGObject
+
+  PAtkUtilClass* = ptr TAtkUtilClass
+  TAtkUtilClass* = object of TGObjectClass
+    add_global_event_listener*: proc (listener: TGSignalEmissionHook,
+                                      event_type: cstring): guint{.cdecl.}
+    remove_global_event_listener*: proc (listener_id: guint){.cdecl.}
+    add_key_event_listener*: proc (listener: TAtkKeySnoopFunc, data: gpointer): guint{.
+        cdecl.}
+    remove_key_event_listener*: proc (listener_id: guint){.cdecl.}
+    get_root*: proc (): PAtkObject{.cdecl.}
+    get_toolkit_name*: proc (): cstring{.cdecl.}
+    get_toolkit_version*: proc (): cstring{.cdecl.}
+
+  PAtkValueIface* = ptr TAtkValueIface
+  TAtkValueIface* = object of TGTypeInterface
+    get_current_value*: proc (obj: PAtkValue, value: PGValue){.cdecl.}
+    get_maximum_value*: proc (obj: PAtkValue, value: PGValue){.cdecl.}
+    get_minimum_value*: proc (obj: PAtkValue, value: PGValue){.cdecl.}
+    set_current_value*: proc (obj: PAtkValue, value: PGValue): gboolean{.cdecl.}
+    pad33*: TAtkFunction
+    pad34*: TAtkFunction
+
+
+proc atk_role_register*(name: cstring): TAtkRole{.cdecl, dynlib: atklib,
+    importc: "atk_role_register".}
+proc atk_object_get_type*(): GType{.cdecl, dynlib: atklib,
+                                    importc: "atk_object_get_type".}
+proc ATK_TYPE_OBJECT*(): GType
+proc ATK_OBJECT*(obj: pointer): PAtkObject
+proc ATK_OBJECT_CLASS*(klass: pointer): PAtkObjectClass
+proc ATK_IS_OBJECT*(obj: pointer): bool
+proc ATK_IS_OBJECT_CLASS*(klass: pointer): bool
+proc ATK_OBJECT_GET_CLASS*(obj: pointer): PAtkObjectClass
+proc ATK_TYPE_IMPLEMENTOR*(): GType
+proc ATK_IS_IMPLEMENTOR*(obj: pointer): bool
+proc ATK_IMPLEMENTOR*(obj: pointer): PAtkImplementor
+proc ATK_IMPLEMENTOR_GET_IFACE*(obj: pointer): PAtkImplementorIface
+proc atk_implementor_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_implementor_get_type".}
+proc atk_implementor_ref_accessible*(implementor: PAtkImplementor): PAtkObject{.
+    cdecl, dynlib: atklib, importc: "atk_implementor_ref_accessible".}
+proc atk_object_get_name*(accessible: PAtkObject): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_name".}
+proc atk_object_get_description*(accessible: PAtkObject): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_description".}
+proc atk_object_get_parent*(accessible: PAtkObject): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_parent".}
+proc atk_object_get_n_accessible_children*(accessible: PAtkObject): gint{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_n_accessible_children".}
+proc atk_object_ref_accessible_child*(accessible: PAtkObject, i: gint): PAtkObject{.
+    cdecl, dynlib: atklib, importc: "atk_object_ref_accessible_child".}
+proc atk_object_ref_relation_set*(accessible: PAtkObject): PAtkRelationSet{.
+    cdecl, dynlib: atklib, importc: "atk_object_ref_relation_set".}
+proc atk_object_get_role*(accessible: PAtkObject): TAtkRole{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_role".}
+proc atk_object_get_layer*(accessible: PAtkObject): TAtkLayer{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_layer".}
+proc atk_object_get_mdi_zorder*(accessible: PAtkObject): gint{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_mdi_zorder".}
+proc atk_object_ref_state_set*(accessible: PAtkObject): PAtkStateSet{.cdecl,
+    dynlib: atklib, importc: "atk_object_ref_state_set".}
+proc atk_object_get_index_in_parent*(accessible: PAtkObject): gint{.cdecl,
+    dynlib: atklib, importc: "atk_object_get_index_in_parent".}
+proc atk_object_set_name*(accessible: PAtkObject, name: cstring){.cdecl,
+    dynlib: atklib, importc: "atk_object_set_name".}
+proc atk_object_set_description*(accessible: PAtkObject, description: cstring){.
+    cdecl, dynlib: atklib, importc: "atk_object_set_description".}
+proc atk_object_set_parent*(accessible: PAtkObject, parent: PAtkObject){.cdecl,
+    dynlib: atklib, importc: "atk_object_set_parent".}
+proc atk_object_set_role*(accessible: PAtkObject, role: TAtkRole){.cdecl,
+    dynlib: atklib, importc: "atk_object_set_role".}
+proc atk_object_connect_property_change_handler*(accessible: PAtkObject,
+    handler: TAtkPropertyChangeHandler): guint{.cdecl, dynlib: atklib,
+    importc: "atk_object_connect_property_change_handler".}
+proc atk_object_remove_property_change_handler*(accessible: PAtkObject,
+    handler_id: guint){.cdecl, dynlib: atklib,
+                        importc: "atk_object_remove_property_change_handler".}
+proc atk_object_notify_state_change*(accessible: PAtkObject, state: TAtkState,
+                                     value: gboolean){.cdecl, dynlib: atklib,
+    importc: "atk_object_notify_state_change".}
+proc atk_object_initialize*(accessible: PAtkObject, data: gpointer){.cdecl,
+    dynlib: atklib, importc: "atk_object_initialize".}
+proc atk_role_get_name*(role: TAtkRole): cstring{.cdecl, dynlib: atklib,
+    importc: "atk_role_get_name".}
+proc atk_role_for_name*(name: cstring): TAtkRole{.cdecl, dynlib: atklib,
+    importc: "atk_role_for_name".}
+proc ATK_TYPE_ACTION*(): GType
+proc ATK_IS_ACTION*(obj: pointer): bool
+proc ATK_ACTION*(obj: pointer): PAtkAction
+proc ATK_ACTION_GET_IFACE*(obj: pointer): PAtkActionIface
+proc atk_action_get_type*(): GType{.cdecl, dynlib: atklib,
+                                    importc: "atk_action_get_type".}
+proc atk_action_do_action*(action: PAtkAction, i: gint): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_action_do_action".}
+proc atk_action_get_n_actions*(action: PAtkAction): gint{.cdecl, dynlib: atklib,
+    importc: "atk_action_get_n_actions".}
+proc atk_action_get_description*(action: PAtkAction, i: gint): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_action_get_description".}
+proc atk_action_get_name*(action: PAtkAction, i: gint): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_action_get_name".}
+proc atk_action_get_keybinding*(action: PAtkAction, i: gint): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_action_get_keybinding".}
+proc atk_action_set_description*(action: PAtkAction, i: gint, desc: cstring): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_action_set_description".}
+proc ATK_TYPE_COMPONENT*(): GType
+proc ATK_IS_COMPONENT*(obj: pointer): bool
+proc ATK_COMPONENT*(obj: pointer): PAtkComponent
+proc ATK_COMPONENT_GET_IFACE*(obj: pointer): PAtkComponentIface
+proc atk_component_get_type*(): GType{.cdecl, dynlib: atklib,
+                                       importc: "atk_component_get_type".}
+proc atk_component_add_focus_handler*(component: PAtkComponent,
+                                      handler: TAtkFocusHandler): guint{.cdecl,
+    dynlib: atklib, importc: "atk_component_add_focus_handler".}
+proc atk_component_contains*(component: PAtkComponent, x, y: gint,
+                             coord_type: TAtkCoordType): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_component_contains".}
+proc atk_component_ref_accessible_at_point*(component: PAtkComponent,
+    x, y: gint, coord_type: TAtkCoordType): PAtkObject{.cdecl, dynlib: atklib,
+    importc: "atk_component_ref_accessible_at_point".}
+proc atk_component_get_extents*(component: PAtkComponent,
+                                x, y, width, height: Pgint,
+                                coord_type: TAtkCoordType){.cdecl,
+    dynlib: atklib, importc: "atk_component_get_extents".}
+proc atk_component_get_position*(component: PAtkComponent, x: Pgint, y: Pgint,
+                                 coord_type: TAtkCoordType){.cdecl,
+    dynlib: atklib, importc: "atk_component_get_position".}
+proc atk_component_get_size*(component: PAtkComponent, width: Pgint,
+                             height: Pgint){.cdecl, dynlib: atklib,
+    importc: "atk_component_get_size".}
+proc atk_component_get_layer*(component: PAtkComponent): TAtkLayer{.cdecl,
+    dynlib: atklib, importc: "atk_component_get_layer".}
+proc atk_component_get_mdi_zorder*(component: PAtkComponent): gint{.cdecl,
+    dynlib: atklib, importc: "atk_component_get_mdi_zorder".}
+proc atk_component_grab_focus*(component: PAtkComponent): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_component_grab_focus".}
+proc atk_component_remove_focus_handler*(component: PAtkComponent,
+    handler_id: guint){.cdecl, dynlib: atklib,
+                        importc: "atk_component_remove_focus_handler".}
+proc atk_component_set_extents*(component: PAtkComponent, x: gint, y: gint,
+                                width: gint, height: gint,
+                                coord_type: TAtkCoordType): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_component_set_extents".}
+proc atk_component_set_position*(component: PAtkComponent, x: gint, y: gint,
+                                 coord_type: TAtkCoordType): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_component_set_position".}
+proc atk_component_set_size*(component: PAtkComponent, width: gint, height: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_component_set_size".}
+proc ATK_TYPE_DOCUMENT*(): GType
+proc ATK_IS_DOCUMENT*(obj: pointer): bool
+proc ATK_DOCUMENT*(obj: pointer): PAtkDocument
+proc ATK_DOCUMENT_GET_IFACE*(obj: pointer): PAtkDocumentIface
+proc atk_document_get_type*(): GType{.cdecl, dynlib: atklib,
+                                      importc: "atk_document_get_type".}
+proc atk_document_get_document_type*(document: PAtkDocument): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_document_get_document_type".}
+proc atk_document_get_document*(document: PAtkDocument): gpointer{.cdecl,
+    dynlib: atklib, importc: "atk_document_get_document".}
+proc ATK_TYPE_EDITABLE_TEXT*(): GType
+proc ATK_IS_EDITABLE_TEXT*(obj: pointer): bool
+proc ATK_EDITABLE_TEXT*(obj: pointer): PAtkEditableText
+proc ATK_EDITABLE_TEXT_GET_IFACE*(obj: pointer): PAtkEditableTextIface
+proc atk_editable_text_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_editable_text_get_type".}
+proc atk_editable_text_set_run_attributes*(text: PAtkEditableText,
+    attrib_set: PAtkAttributeSet, start_offset: gint, end_offset: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_editable_text_set_run_attributes".}
+proc atk_editable_text_set_text_contents*(text: PAtkEditableText, string: cstring){.
+    cdecl, dynlib: atklib, importc: "atk_editable_text_set_text_contents".}
+proc atk_editable_text_insert_text*(text: PAtkEditableText, `string`: cstring,
+                                    length: gint, position: Pgint){.cdecl,
+    dynlib: atklib, importc: "atk_editable_text_insert_text".}
+proc atk_editable_text_copy_text*(text: PAtkEditableText, start_pos: gint,
+                                  end_pos: gint){.cdecl, dynlib: atklib,
+    importc: "atk_editable_text_copy_text".}
+proc atk_editable_text_cut_text*(text: PAtkEditableText, start_pos: gint,
+                                 end_pos: gint){.cdecl, dynlib: atklib,
+    importc: "atk_editable_text_cut_text".}
+proc atk_editable_text_delete_text*(text: PAtkEditableText, start_pos: gint,
+                                    end_pos: gint){.cdecl, dynlib: atklib,
+    importc: "atk_editable_text_delete_text".}
+proc atk_editable_text_paste_text*(text: PAtkEditableText, position: gint){.
+    cdecl, dynlib: atklib, importc: "atk_editable_text_paste_text".}
+proc ATK_TYPE_GOBJECT_ACCESSIBLE*(): GType
+proc ATK_GOBJECT_ACCESSIBLE*(obj: pointer): PAtkGObjectAccessible
+proc ATK_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PAtkGObjectAccessibleClass
+proc ATK_IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool
+proc ATK_IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool
+proc ATK_GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PAtkGObjectAccessibleClass
+proc atk_gobject_accessible_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_gobject_accessible_get_type".}
+proc atk_gobject_accessible_for_object*(obj: PGObject): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_gobject_accessible_for_object".}
+proc atk_gobject_accessible_get_object*(obj: PAtkGObjectAccessible): PGObject{.
+    cdecl, dynlib: atklib, importc: "atk_gobject_accessible_get_object".}
+proc ATK_TYPE_HYPERLINK*(): GType
+proc ATK_HYPERLINK*(obj: pointer): PAtkHyperlink
+proc ATK_HYPERLINK_CLASS*(klass: pointer): PAtkHyperlinkClass
+proc ATK_IS_HYPERLINK*(obj: pointer): bool
+proc ATK_IS_HYPERLINK_CLASS*(klass: pointer): bool
+proc ATK_HYPERLINK_GET_CLASS*(obj: pointer): PAtkHyperlinkClass
+proc atk_hyperlink_get_type*(): GType{.cdecl, dynlib: atklib,
+                                       importc: "atk_hyperlink_get_type".}
+proc atk_hyperlink_get_uri*(link: PAtkHyperlink, i: gint): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_get_uri".}
+proc atk_hyperlink_get_object*(link: PAtkHyperlink, i: gint): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_get_object".}
+proc atk_hyperlink_get_end_index*(link: PAtkHyperlink): gint{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_get_end_index".}
+proc atk_hyperlink_get_start_index*(link: PAtkHyperlink): gint{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_get_start_index".}
+proc atk_hyperlink_is_valid*(link: PAtkHyperlink): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_is_valid".}
+proc atk_hyperlink_get_n_anchors*(link: PAtkHyperlink): gint{.cdecl,
+    dynlib: atklib, importc: "atk_hyperlink_get_n_anchors".}
+proc ATK_TYPE_HYPERTEXT*(): GType
+proc ATK_IS_HYPERTEXT*(obj: pointer): bool
+proc ATK_HYPERTEXT*(obj: pointer): PAtkHypertext
+proc ATK_HYPERTEXT_GET_IFACE*(obj: pointer): PAtkHypertextIface
+proc atk_hypertext_get_type*(): GType{.cdecl, dynlib: atklib,
+                                       importc: "atk_hypertext_get_type".}
+proc atk_hypertext_get_link*(hypertext: PAtkHypertext, link_index: gint): PAtkHyperlink{.
+    cdecl, dynlib: atklib, importc: "atk_hypertext_get_link".}
+proc atk_hypertext_get_n_links*(hypertext: PAtkHypertext): gint{.cdecl,
+    dynlib: atklib, importc: "atk_hypertext_get_n_links".}
+proc atk_hypertext_get_link_index*(hypertext: PAtkHypertext, char_index: gint): gint{.
+    cdecl, dynlib: atklib, importc: "atk_hypertext_get_link_index".}
+proc ATK_TYPE_IMAGE*(): GType
+proc ATK_IS_IMAGE*(obj: pointer): bool
+proc ATK_IMAGE*(obj: pointer): PAtkImage
+proc ATK_IMAGE_GET_IFACE*(obj: pointer): PAtkImageIface
+proc atk_image_get_type*(): GType{.cdecl, dynlib: atklib,
+                                   importc: "atk_image_get_type".}
+proc atk_image_get_image_description*(image: PAtkImage): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_image_get_image_description".}
+proc atk_image_get_image_size*(image: PAtkImage, width: Pgint, height: Pgint){.
+    cdecl, dynlib: atklib, importc: "atk_image_get_image_size".}
+proc atk_image_set_image_description*(image: PAtkImage, description: cstring): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_image_set_image_description".}
+proc atk_image_get_image_position*(image: PAtkImage, x: Pgint, y: Pgint,
+                                   coord_type: TAtkCoordType){.cdecl,
+    dynlib: atklib, importc: "atk_image_get_image_position".}
+proc ATK_TYPE_OBJECT_FACTORY*(): GType
+proc ATK_OBJECT_FACTORY*(obj: pointer): PAtkObjectFactory
+proc ATK_OBJECT_FACTORY_CLASS*(klass: pointer): PAtkObjectFactoryClass
+proc ATK_IS_OBJECT_FACTORY*(obj: pointer): bool
+proc ATK_IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool
+proc ATK_OBJECT_FACTORY_GET_CLASS*(obj: pointer): PAtkObjectFactoryClass
+proc atk_object_factory_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_object_factory_get_type".}
+proc atk_object_factory_create_accessible*(factory: PAtkObjectFactory,
+    obj: PGObject): PAtkObject{.cdecl, dynlib: atklib,
+                                importc: "atk_object_factory_create_accessible".}
+proc atk_object_factory_invalidate*(factory: PAtkObjectFactory){.cdecl,
+    dynlib: atklib, importc: "atk_object_factory_invalidate".}
+proc atk_object_factory_get_accessible_type*(factory: PAtkObjectFactory): GType{.
+    cdecl, dynlib: atklib, importc: "atk_object_factory_get_accessible_type".}
+proc ATK_TYPE_REGISTRY*(): GType
+proc ATK_REGISTRY*(obj: pointer): PAtkRegistry
+proc ATK_REGISTRY_CLASS*(klass: pointer): PAtkRegistryClass
+proc ATK_IS_REGISTRY*(obj: pointer): bool
+proc ATK_IS_REGISTRY_CLASS*(klass: pointer): bool
+proc ATK_REGISTRY_GET_CLASS*(obj: pointer): PAtkRegistryClass
+proc atk_registry_get_type*(): GType{.cdecl, dynlib: atklib,
+                                      importc: "atk_registry_get_type".}
+proc atk_registry_set_factory_type*(registry: PAtkRegistry, `type`: GType,
+                                    factory_type: GType){.cdecl, dynlib: atklib,
+    importc: "atk_registry_set_factory_type".}
+proc atk_registry_get_factory_type*(registry: PAtkRegistry, `type`: GType): GType{.
+    cdecl, dynlib: atklib, importc: "atk_registry_get_factory_type".}
+proc atk_registry_get_factory*(registry: PAtkRegistry, `type`: GType): PAtkObjectFactory{.
+    cdecl, dynlib: atklib, importc: "atk_registry_get_factory".}
+proc atk_get_default_registry*(): PAtkRegistry{.cdecl, dynlib: atklib,
+    importc: "atk_get_default_registry".}
+proc ATK_TYPE_RELATION*(): GType
+proc ATK_RELATION*(obj: pointer): PAtkRelation
+proc ATK_RELATION_CLASS*(klass: pointer): PAtkRelationClass
+proc ATK_IS_RELATION*(obj: pointer): bool
+proc ATK_IS_RELATION_CLASS*(klass: pointer): bool
+proc ATK_RELATION_GET_CLASS*(obj: pointer): PAtkRelationClass
+proc atk_relation_get_type*(): GType{.cdecl, dynlib: atklib,
+                                      importc: "atk_relation_get_type".}
+proc atk_relation_type_register*(name: cstring): TAtkRelationType{.cdecl,
+    dynlib: atklib, importc: "atk_relation_type_register".}
+proc atk_relation_type_get_name*(`type`: TAtkRelationType): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_relation_type_get_name".}
+proc atk_relation_type_for_name*(name: cstring): TAtkRelationType{.cdecl,
+    dynlib: atklib, importc: "atk_relation_type_for_name".}
+proc atk_relation_new*(targets: PPAtkObject, n_targets: gint,
+                       relationship: TAtkRelationType): PAtkRelation{.cdecl,
+    dynlib: atklib, importc: "atk_relation_new".}
+proc atk_relation_get_relation_type*(relation: PAtkRelation): TAtkRelationType{.
+    cdecl, dynlib: atklib, importc: "atk_relation_get_relation_type".}
+proc atk_relation_get_target*(relation: PAtkRelation): PGPtrArray{.cdecl,
+    dynlib: atklib, importc: "atk_relation_get_target".}
+proc ATK_TYPE_RELATION_SET*(): GType
+proc ATK_RELATION_SET*(obj: pointer): PAtkRelationSet
+proc ATK_RELATION_SET_CLASS*(klass: pointer): PAtkRelationSetClass
+proc ATK_IS_RELATION_SET*(obj: pointer): bool
+proc ATK_IS_RELATION_SET_CLASS*(klass: pointer): bool
+proc ATK_RELATION_SET_GET_CLASS*(obj: pointer): PAtkRelationSetClass
+proc atk_relation_set_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_relation_set_get_type".}
+proc atk_relation_set_new*(): PAtkRelationSet{.cdecl, dynlib: atklib,
+    importc: "atk_relation_set_new".}
+proc atk_relation_set_contains*(RelationSet: PAtkRelationSet,
+                                relationship: TAtkRelationType): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_relation_set_contains".}
+proc atk_relation_set_remove*(RelationSet: PAtkRelationSet,
+                              relation: PAtkRelation){.cdecl, dynlib: atklib,
+    importc: "atk_relation_set_remove".}
+proc atk_relation_set_add*(RelationSet: PAtkRelationSet, relation: PAtkRelation){.
+    cdecl, dynlib: atklib, importc: "atk_relation_set_add".}
+proc atk_relation_set_get_n_relations*(RelationSet: PAtkRelationSet): gint{.
+    cdecl, dynlib: atklib, importc: "atk_relation_set_get_n_relations".}
+proc atk_relation_set_get_relation*(RelationSet: PAtkRelationSet, i: gint): PAtkRelation{.
+    cdecl, dynlib: atklib, importc: "atk_relation_set_get_relation".}
+proc atk_relation_set_get_relation_by_type*(RelationSet: PAtkRelationSet,
+    relationship: TAtkRelationType): PAtkRelation{.cdecl, dynlib: atklib,
+    importc: "atk_relation_set_get_relation_by_type".}
+proc ATK_TYPE_SELECTION*(): GType
+proc ATK_IS_SELECTION*(obj: pointer): bool
+proc ATK_SELECTION*(obj: pointer): PAtkSelection
+proc ATK_SELECTION_GET_IFACE*(obj: pointer): PAtkSelectionIface
+proc atk_selection_get_type*(): GType{.cdecl, dynlib: atklib,
+                                       importc: "atk_selection_get_type".}
+proc atk_selection_add_selection*(selection: PAtkSelection, i: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_selection_add_selection".}
+proc atk_selection_clear_selection*(selection: PAtkSelection): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_selection_clear_selection".}
+proc atk_selection_ref_selection*(selection: PAtkSelection, i: gint): PAtkObject{.
+    cdecl, dynlib: atklib, importc: "atk_selection_ref_selection".}
+proc atk_selection_get_selection_count*(selection: PAtkSelection): gint{.cdecl,
+    dynlib: atklib, importc: "atk_selection_get_selection_count".}
+proc atk_selection_is_child_selected*(selection: PAtkSelection, i: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_selection_is_child_selected".}
+proc atk_selection_remove_selection*(selection: PAtkSelection, i: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_selection_remove_selection".}
+proc atk_selection_select_all_selection*(selection: PAtkSelection): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_selection_select_all_selection".}
+proc atk_state_type_register*(name: cstring): TAtkStateType{.cdecl,
+    dynlib: atklib, importc: "atk_state_type_register".}
+proc atk_state_type_get_name*(`type`: TAtkStateType): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_state_type_get_name".}
+proc atk_state_type_for_name*(name: cstring): TAtkStateType{.cdecl,
+    dynlib: atklib, importc: "atk_state_type_for_name".}
+proc ATK_TYPE_STATE_SET*(): GType
+proc ATK_STATE_SET*(obj: pointer): PAtkStateSet
+proc ATK_STATE_SET_CLASS*(klass: pointer): PAtkStateSetClass
+proc ATK_IS_STATE_SET*(obj: pointer): bool
+proc ATK_IS_STATE_SET_CLASS*(klass: pointer): bool
+proc ATK_STATE_SET_GET_CLASS*(obj: pointer): PAtkStateSetClass
+proc atk_state_set_get_type*(): GType{.cdecl, dynlib: atklib,
+                                       importc: "atk_state_set_get_type".}
+proc atk_state_set_new*(): PAtkStateSet{.cdecl, dynlib: atklib,
+    importc: "atk_state_set_new".}
+proc atk_state_set_is_empty*(StateSet: PAtkStateSet): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_state_set_is_empty".}
+proc atk_state_set_add_state*(StateSet: PAtkStateSet, `type`: TAtkStateType): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_add_state".}
+proc atk_state_set_add_states*(StateSet: PAtkStateSet, types: PAtkStateType,
+                               n_types: gint){.cdecl, dynlib: atklib,
+    importc: "atk_state_set_add_states".}
+proc atk_state_set_clear_states*(StateSet: PAtkStateSet){.cdecl, dynlib: atklib,
+    importc: "atk_state_set_clear_states".}
+proc atk_state_set_contains_state*(StateSet: PAtkStateSet, `type`: TAtkStateType): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_contains_state".}
+proc atk_state_set_contains_states*(StateSet: PAtkStateSet,
+                                    types: PAtkStateType, n_types: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_contains_states".}
+proc atk_state_set_remove_state*(StateSet: PAtkStateSet, `type`: TAtkStateType): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_remove_state".}
+proc atk_state_set_and_sets*(StateSet: PAtkStateSet, compare_set: PAtkStateSet): PAtkStateSet{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_and_sets".}
+proc atk_state_set_or_sets*(StateSet: PAtkStateSet, compare_set: PAtkStateSet): PAtkStateSet{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_or_sets".}
+proc atk_state_set_xor_sets*(StateSet: PAtkStateSet, compare_set: PAtkStateSet): PAtkStateSet{.
+    cdecl, dynlib: atklib, importc: "atk_state_set_xor_sets".}
+proc ATK_TYPE_STREAMABLE_CONTENT*(): GType
+proc ATK_IS_STREAMABLE_CONTENT*(obj: pointer): bool
+proc ATK_STREAMABLE_CONTENT*(obj: pointer): PAtkStreamableContent
+proc ATK_STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PAtkStreamableContentIface
+proc atk_streamable_content_get_type*(): GType{.cdecl, dynlib: atklib,
+    importc: "atk_streamable_content_get_type".}
+proc atk_streamable_content_get_n_mime_types*(streamable: PAtkStreamableContent): gint{.
+    cdecl, dynlib: atklib, importc: "atk_streamable_content_get_n_mime_types".}
+proc atk_streamable_content_get_mime_type*(streamable: PAtkStreamableContent,
+    i: gint): cstring{.cdecl, dynlib: atklib,
+                      importc: "atk_streamable_content_get_mime_type".}
+proc atk_streamable_content_get_stream*(streamable: PAtkStreamableContent,
+                                        mime_type: cstring): PGIOChannel{.cdecl,
+    dynlib: atklib, importc: "atk_streamable_content_get_stream".}
+proc ATK_TYPE_TABLE*(): GType
+proc ATK_IS_TABLE*(obj: pointer): bool
+proc ATK_TABLE*(obj: pointer): PAtkTable
+proc ATK_TABLE_GET_IFACE*(obj: pointer): PAtkTableIface
+proc atk_table_get_type*(): GType{.cdecl, dynlib: atklib,
+                                   importc: "atk_table_get_type".}
+proc atk_table_ref_at*(table: PAtkTable, row, column: gint): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_table_ref_at".}
+proc atk_table_get_index_at*(table: PAtkTable, row, column: gint): gint{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_index_at".}
+proc atk_table_get_column_at_index*(table: PAtkTable, index: gint): gint{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_column_at_index".}
+proc atk_table_get_row_at_index*(table: PAtkTable, index: gint): gint{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_row_at_index".}
+proc atk_table_get_n_columns*(table: PAtkTable): gint{.cdecl, dynlib: atklib,
+    importc: "atk_table_get_n_columns".}
+proc atk_table_get_n_rows*(table: PAtkTable): gint{.cdecl, dynlib: atklib,
+    importc: "atk_table_get_n_rows".}
+proc atk_table_get_column_extent_at*(table: PAtkTable, row: gint, column: gint): gint{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_column_extent_at".}
+proc atk_table_get_row_extent_at*(table: PAtkTable, row: gint, column: gint): gint{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_row_extent_at".}
+proc atk_table_get_caption*(table: PAtkTable): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_caption".}
+proc atk_table_get_column_description*(table: PAtkTable, column: gint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_column_description".}
+proc atk_table_get_column_header*(table: PAtkTable, column: gint): PAtkObject{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_column_header".}
+proc atk_table_get_row_description*(table: PAtkTable, row: gint): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_row_description".}
+proc atk_table_get_row_header*(table: PAtkTable, row: gint): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_row_header".}
+proc atk_table_get_summary*(table: PAtkTable): PAtkObject{.cdecl,
+    dynlib: atklib, importc: "atk_table_get_summary".}
+proc atk_table_set_caption*(table: PAtkTable, caption: PAtkObject){.cdecl,
+    dynlib: atklib, importc: "atk_table_set_caption".}
+proc atk_table_set_column_description*(table: PAtkTable, column: gint,
+                                       description: cstring){.cdecl,
+    dynlib: atklib, importc: "atk_table_set_column_description".}
+proc atk_table_set_column_header*(table: PAtkTable, column: gint,
+                                  header: PAtkObject){.cdecl, dynlib: atklib,
+    importc: "atk_table_set_column_header".}
+proc atk_table_set_row_description*(table: PAtkTable, row: gint,
+                                    description: cstring){.cdecl, dynlib: atklib,
+    importc: "atk_table_set_row_description".}
+proc atk_table_set_row_header*(table: PAtkTable, row: gint, header: PAtkObject){.
+    cdecl, dynlib: atklib, importc: "atk_table_set_row_header".}
+proc atk_table_set_summary*(table: PAtkTable, accessible: PAtkObject){.cdecl,
+    dynlib: atklib, importc: "atk_table_set_summary".}
+proc atk_table_get_selected_columns*(table: PAtkTable, selected: PPgint): gint{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_selected_columns".}
+proc atk_table_get_selected_rows*(table: PAtkTable, selected: PPgint): gint{.
+    cdecl, dynlib: atklib, importc: "atk_table_get_selected_rows".}
+proc atk_table_is_column_selected*(table: PAtkTable, column: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_table_is_column_selected".}
+proc atk_table_is_row_selected*(table: PAtkTable, row: gint): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_table_is_row_selected".}
+proc atk_table_is_selected*(table: PAtkTable, row: gint, column: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_table_is_selected".}
+proc atk_table_add_row_selection*(table: PAtkTable, row: gint): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_table_add_row_selection".}
+proc atk_table_remove_row_selection*(table: PAtkTable, row: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_table_remove_row_selection".}
+proc atk_table_add_column_selection*(table: PAtkTable, column: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_table_add_column_selection".}
+proc atk_table_remove_column_selection*(table: PAtkTable, column: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_table_remove_column_selection".}
+proc atk_text_attribute_register*(name: cstring): TAtkTextAttribute{.cdecl,
+    dynlib: atklib, importc: "atk_text_attribute_register".}
+proc ATK_TYPE_TEXT*(): GType
+proc ATK_IS_TEXT*(obj: pointer): bool
+proc ATK_TEXT*(obj: pointer): PAtkText
+proc ATK_TEXT_GET_IFACE*(obj: pointer): PAtkTextIface
+proc atk_text_get_type*(): GType{.cdecl, dynlib: atklib,
+                                  importc: "atk_text_get_type".}
+proc atk_text_get_text*(text: PAtkText, start_offset: gint, end_offset: gint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_text".}
+proc atk_text_get_character_at_offset*(text: PAtkText, offset: gint): gunichar{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_character_at_offset".}
+proc atk_text_get_text_after_offset*(text: PAtkText, offset: gint,
+                                     boundary_type: TAtkTextBoundary,
+                                     start_offset: Pgint, end_offset: Pgint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_text_after_offset".}
+proc atk_text_get_text_at_offset*(text: PAtkText, offset: gint,
+                                  boundary_type: TAtkTextBoundary,
+                                  start_offset: Pgint, end_offset: Pgint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_text_at_offset".}
+proc atk_text_get_text_before_offset*(text: PAtkText, offset: gint,
+                                      boundary_type: TAtkTextBoundary,
+                                      start_offset: Pgint, end_offset: Pgint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_text_before_offset".}
+proc atk_text_get_caret_offset*(text: PAtkText): gint{.cdecl, dynlib: atklib,
+    importc: "atk_text_get_caret_offset".}
+proc atk_text_get_character_extents*(text: PAtkText, offset: gint, x: Pgint,
+                                     y: Pgint, width: Pgint, height: Pgint,
+                                     coords: TAtkCoordType){.cdecl,
+    dynlib: atklib, importc: "atk_text_get_character_extents".}
+proc atk_text_get_run_attributes*(text: PAtkText, offset: gint,
+                                  start_offset: Pgint, end_offset: Pgint): PAtkAttributeSet{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_run_attributes".}
+proc atk_text_get_default_attributes*(text: PAtkText): PAtkAttributeSet{.cdecl,
+    dynlib: atklib, importc: "atk_text_get_default_attributes".}
+proc atk_text_get_character_count*(text: PAtkText): gint{.cdecl, dynlib: atklib,
+    importc: "atk_text_get_character_count".}
+proc atk_text_get_offset_at_point*(text: PAtkText, x: gint, y: gint,
+                                   coords: TAtkCoordType): gint{.cdecl,
+    dynlib: atklib, importc: "atk_text_get_offset_at_point".}
+proc atk_text_get_n_selections*(text: PAtkText): gint{.cdecl, dynlib: atklib,
+    importc: "atk_text_get_n_selections".}
+proc atk_text_get_selection*(text: PAtkText, selection_num: gint,
+                             start_offset: Pgint, end_offset: Pgint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_get_selection".}
+proc atk_text_add_selection*(text: PAtkText, start_offset: gint,
+                             end_offset: gint): gboolean{.cdecl, dynlib: atklib,
+    importc: "atk_text_add_selection".}
+proc atk_text_remove_selection*(text: PAtkText, selection_num: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_text_remove_selection".}
+proc atk_text_set_selection*(text: PAtkText, selection_num: gint,
+                             start_offset: gint, end_offset: gint): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_text_set_selection".}
+proc atk_text_set_caret_offset*(text: PAtkText, offset: gint): gboolean{.cdecl,
+    dynlib: atklib, importc: "atk_text_set_caret_offset".}
+proc atk_attribute_set_free*(attrib_set: PAtkAttributeSet){.cdecl,
+    dynlib: atklib, importc: "atk_attribute_set_free".}
+proc atk_text_attribute_get_name*(attr: TAtkTextAttribute): cstring{.cdecl,
+    dynlib: atklib, importc: "atk_text_attribute_get_name".}
+proc atk_text_attribute_for_name*(name: cstring): TAtkTextAttribute{.cdecl,
+    dynlib: atklib, importc: "atk_text_attribute_for_name".}
+proc atk_text_attribute_get_value*(attr: TAtkTextAttribute, index: gint): cstring{.
+    cdecl, dynlib: atklib, importc: "atk_text_attribute_get_value".}
+proc ATK_TYPE_UTIL*(): GType
+proc ATK_IS_UTIL*(obj: pointer): bool
+proc ATK_UTIL*(obj: pointer): PAtkUtil
+proc ATK_UTIL_CLASS*(klass: pointer): PAtkUtilClass
+proc ATK_IS_UTIL_CLASS*(klass: pointer): bool
+proc ATK_UTIL_GET_CLASS*(obj: pointer): PAtkUtilClass
+proc atk_util_get_type*(): GType{.cdecl, dynlib: atklib,
+                                  importc: "atk_util_get_type".}
+proc atk_add_focus_tracker*(focus_tracker: TAtkEventListener): guint{.cdecl,
+    dynlib: atklib, importc: "atk_add_focus_tracker".}
+proc atk_remove_focus_tracker*(tracker_id: guint){.cdecl, dynlib: atklib,
+    importc: "atk_remove_focus_tracker".}
+proc atk_focus_tracker_init*(add_function: TAtkEventListenerInit){.cdecl,
+    dynlib: atklib, importc: "atk_focus_tracker_init".}
+proc atk_focus_tracker_notify*(anObject: PAtkObject){.cdecl, dynlib: atklib,
+    importc: "atk_focus_tracker_notify".}
+proc atk_add_global_event_listener*(listener: TGSignalEmissionHook,
+                                    event_type: cstring): guint{.cdecl,
+    dynlib: atklib, importc: "atk_add_global_event_listener".}
+proc atk_remove_global_event_listener*(listener_id: guint){.cdecl,
+    dynlib: atklib, importc: "atk_remove_global_event_listener".}
+proc atk_add_key_event_listener*(listener: TAtkKeySnoopFunc, data: gpointer): guint{.
+    cdecl, dynlib: atklib, importc: "atk_add_key_event_listener".}
+proc atk_remove_key_event_listener*(listener_id: guint){.cdecl, dynlib: atklib,
+    importc: "atk_remove_key_event_listener".}
+proc atk_get_root*(): PAtkObject{.cdecl, dynlib: atklib, importc: "atk_get_root".}
+proc atk_get_toolkit_name*(): cstring{.cdecl, dynlib: atklib,
+                                      importc: "atk_get_toolkit_name".}
+proc atk_get_toolkit_version*(): cstring{.cdecl, dynlib: atklib,
+    importc: "atk_get_toolkit_version".}
+proc ATK_TYPE_VALUE*(): GType
+proc ATK_IS_VALUE*(obj: pointer): bool
+proc ATK_VALUE*(obj: pointer): PAtkValue
+proc ATK_VALUE_GET_IFACE*(obj: pointer): PAtkValueIface
+proc atk_value_get_type*(): GType{.cdecl, dynlib: atklib,
+                                   importc: "atk_value_get_type".}
+proc atk_value_get_current_value*(obj: PAtkValue, value: PGValue){.cdecl,
+    dynlib: atklib, importc: "atk_value_get_current_value".}
+proc atk_value_get_maximum_value*(obj: PAtkValue, value: PGValue){.cdecl,
+    dynlib: atklib, importc: "atk_value_get_maximum_value".}
+proc atk_value_get_minimum_value*(obj: PAtkValue, value: PGValue){.cdecl,
+    dynlib: atklib, importc: "atk_value_get_minimum_value".}
+proc atk_value_set_current_value*(obj: PAtkValue, value: PGValue): gboolean{.
+    cdecl, dynlib: atklib, importc: "atk_value_set_current_value".}
+proc ATK_TYPE_OBJECT*(): GType =
+  result = atk_object_get_type()
+
+proc ATK_OBJECT*(obj: pointer): PAtkObject =
+  result = cast[PAtkObject](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_OBJECT()))
+
+proc ATK_OBJECT_CLASS*(klass: pointer): PAtkObjectClass =
+  result = cast[PAtkObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, ATK_TYPE_OBJECT()))
+
+proc ATK_IS_OBJECT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_OBJECT())
+
+proc ATK_IS_OBJECT_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_OBJECT())
+
+proc ATK_OBJECT_GET_CLASS*(obj: pointer): PAtkObjectClass =
+  result = cast[PAtkObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, ATK_TYPE_OBJECT()))
+
+proc ATK_TYPE_IMPLEMENTOR*(): GType =
+  result = atk_implementor_get_type()
+
+proc ATK_IS_IMPLEMENTOR*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_IMPLEMENTOR())
+
+proc ATK_IMPLEMENTOR*(obj: pointer): PAtkImplementor =
+  result = PAtkImplementor(G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_IMPLEMENTOR()))
+
+proc ATK_IMPLEMENTOR_GET_IFACE*(obj: pointer): PAtkImplementorIface =
+  result = cast[PAtkImplementorIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_IMPLEMENTOR()))
+
+proc ATK_TYPE_ACTION*(): GType =
+  result = atk_action_get_type()
+
+proc ATK_IS_ACTION*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_ACTION())
+
+proc ATK_ACTION*(obj: pointer): PAtkAction =
+  result = PAtkAction(G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_ACTION()))
+
+proc ATK_ACTION_GET_IFACE*(obj: pointer): PAtkActionIface =
+  result = cast[PAtkActionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+    ATK_TYPE_ACTION()))
+
+proc ATK_TYPE_COMPONENT*(): GType =
+  result = atk_component_get_type()
+
+proc ATK_IS_COMPONENT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_COMPONENT())
+
+proc ATK_COMPONENT*(obj: pointer): PAtkComponent =
+  result = PAtkComponent(G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_COMPONENT()))
+
+proc ATK_COMPONENT_GET_IFACE*(obj: pointer): PAtkComponentIface =
+  result = cast[PAtkComponentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_COMPONENT()))
+
+proc ATK_TYPE_DOCUMENT*(): GType =
+  result = atk_document_get_type()
+
+proc ATK_IS_DOCUMENT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_DOCUMENT())
+
+proc ATK_DOCUMENT*(obj: pointer): PAtkDocument =
+  result = cast[PAtkDocument](G_TYPE_CHECK_INSTANCE_CAST(obj,
+    ATK_TYPE_DOCUMENT()))
+
+proc ATK_DOCUMENT_GET_IFACE*(obj: pointer): PAtkDocumentIface =
+  result = cast[PAtkDocumentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_DOCUMENT()))
+
+proc ATK_TYPE_EDITABLE_TEXT*(): GType =
+  result = atk_editable_text_get_type()
+
+proc ATK_IS_EDITABLE_TEXT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_EDITABLE_TEXT())
+
+proc ATK_EDITABLE_TEXT*(obj: pointer): PAtkEditableText =
+  result = cast[PAtkEditableText](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      ATK_TYPE_EDITABLE_TEXT()))
+
+proc ATK_EDITABLE_TEXT_GET_IFACE*(obj: pointer): PAtkEditableTextIface =
+  result = cast[PAtkEditableTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_EDITABLE_TEXT()))
+
+proc ATK_TYPE_GOBJECT_ACCESSIBLE*(): GType =
+  result = atk_gobject_accessible_get_type()
+
+proc ATK_GOBJECT_ACCESSIBLE*(obj: pointer): PAtkGObjectAccessible =
+  result = cast[PAtkGObjectAccessible](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      ATK_TYPE_GOBJECT_ACCESSIBLE()))
+
+proc ATK_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PAtkGObjectAccessibleClass =
+  result = cast[PAtkGObjectAccessibleClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      ATK_TYPE_GOBJECT_ACCESSIBLE()))
+
+proc ATK_IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_GOBJECT_ACCESSIBLE())
+
+proc ATK_IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_GOBJECT_ACCESSIBLE())
+
+proc ATK_GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PAtkGObjectAccessibleClass =
+  result = cast[PAtkGObjectAccessibleClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      ATK_TYPE_GOBJECT_ACCESSIBLE()))
+
+proc ATK_TYPE_HYPERLINK*(): GType =
+  result = atk_hyperlink_get_type()
+
+proc ATK_HYPERLINK*(obj: pointer): PAtkHyperlink =
+  result = cast[PAtkHyperlink](G_TYPE_CHECK_INSTANCE_CAST(obj,
+                              ATK_TYPE_HYPERLINK()))
+
+proc ATK_HYPERLINK_CLASS*(klass: pointer): PAtkHyperlinkClass =
+  result = cast[PAtkHyperlinkClass](G_TYPE_CHECK_CLASS_CAST(klass,
+                                    ATK_TYPE_HYPERLINK()))
+
+proc ATK_IS_HYPERLINK*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_HYPERLINK())
+
+proc ATK_IS_HYPERLINK_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_HYPERLINK())
+
+proc ATK_HYPERLINK_GET_CLASS*(obj: pointer): PAtkHyperlinkClass =
+  result = cast[PAtkHyperlinkClass](G_TYPE_INSTANCE_GET_CLASS(obj, ATK_TYPE_HYPERLINK()))
+
+proc ATK_TYPE_HYPERTEXT*(): GType =
+  result = atk_hypertext_get_type()
+
+proc ATK_IS_HYPERTEXT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_HYPERTEXT())
+
+proc ATK_HYPERTEXT*(obj: pointer): PAtkHypertext =
+  result = cast[PAtkHypertext](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_HYPERTEXT()))
+
+proc ATK_HYPERTEXT_GET_IFACE*(obj: pointer): PAtkHypertextIface =
+  result = cast[PAtkHypertextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_HYPERTEXT()))
+
+proc ATK_TYPE_IMAGE*(): GType =
+  result = atk_image_get_type()
+
+proc ATK_IS_IMAGE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_IMAGE())
+
+proc ATK_IMAGE*(obj: pointer): PAtkImage =
+  result = cast[PAtkImage](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_IMAGE()))
+
+proc ATK_IMAGE_GET_IFACE*(obj: pointer): PAtkImageIface =
+  result = cast[PAtkImageIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_IMAGE()))
+
+proc ATK_TYPE_OBJECT_FACTORY*(): GType =
+  result = atk_object_factory_get_type()
+
+proc ATK_OBJECT_FACTORY*(obj: pointer): PAtkObjectFactory =
+  result = cast[PAtkObjectFactory](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      ATK_TYPE_OBJECT_FACTORY()))
+
+proc ATK_OBJECT_FACTORY_CLASS*(klass: pointer): PAtkObjectFactoryClass =
+  result = cast[PAtkObjectFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      ATK_TYPE_OBJECT_FACTORY()))
+
+proc ATK_IS_OBJECT_FACTORY*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_OBJECT_FACTORY())
+
+proc ATK_IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_OBJECT_FACTORY())
+
+proc ATK_OBJECT_FACTORY_GET_CLASS*(obj: pointer): PAtkObjectFactoryClass =
+  result = cast[PAtkObjectFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      ATK_TYPE_OBJECT_FACTORY()))
+
+proc ATK_TYPE_REGISTRY*(): GType =
+  result = atk_registry_get_type()
+
+proc ATK_REGISTRY*(obj: pointer): PAtkRegistry =
+  result = cast[PAtkRegistry](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_REGISTRY()))
+
+proc ATK_REGISTRY_CLASS*(klass: pointer): PAtkRegistryClass =
+  result = cast[PAtkRegistryClass](G_TYPE_CHECK_CLASS_CAST(klass,
+                                   ATK_TYPE_REGISTRY()))
+
+proc ATK_IS_REGISTRY*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_REGISTRY())
+
+proc ATK_IS_REGISTRY_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_REGISTRY())
+
+proc ATK_REGISTRY_GET_CLASS*(obj: pointer): PAtkRegistryClass =
+  result = cast[PAtkRegistryClass](G_TYPE_INSTANCE_GET_CLASS(obj, ATK_TYPE_REGISTRY()))
+
+proc ATK_TYPE_RELATION*(): GType =
+  result = atk_relation_get_type()
+
+proc ATK_RELATION*(obj: pointer): PAtkRelation =
+  result = cast[PAtkRelation](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_RELATION()))
+
+proc ATK_RELATION_CLASS*(klass: pointer): PAtkRelationClass =
+  result = cast[PAtkRelationClass](G_TYPE_CHECK_CLASS_CAST(klass, ATK_TYPE_RELATION()))
+
+proc ATK_IS_RELATION*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_RELATION())
+
+proc ATK_IS_RELATION_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_RELATION())
+
+proc ATK_RELATION_GET_CLASS*(obj: pointer): PAtkRelationClass =
+  result = cast[PAtkRelationClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+    ATK_TYPE_RELATION()))
+
+proc ATK_TYPE_RELATION_SET*(): GType =
+  result = atk_relation_set_get_type()
+
+proc ATK_RELATION_SET*(obj: pointer): PAtkRelationSet =
+  result = cast[PAtkRelationSet](G_TYPE_CHECK_INSTANCE_CAST(obj,
+    ATK_TYPE_RELATION_SET()))
+
+proc ATK_RELATION_SET_CLASS*(klass: pointer): PAtkRelationSetClass =
+  result = cast[PAtkRelationSetClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      ATK_TYPE_RELATION_SET()))
+
+proc ATK_IS_RELATION_SET*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_RELATION_SET())
+
+proc ATK_IS_RELATION_SET_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_RELATION_SET())
+
+proc ATK_RELATION_SET_GET_CLASS*(obj: pointer): PAtkRelationSetClass =
+  result = cast[PAtkRelationSetClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      ATK_TYPE_RELATION_SET()))
+
+proc ATK_TYPE_SELECTION*(): GType =
+  result = atk_selection_get_type()
+
+proc ATK_IS_SELECTION*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_SELECTION())
+
+proc ATK_SELECTION*(obj: pointer): PAtkSelection =
+  result = cast[PAtkSelection](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_SELECTION()))
+
+proc ATK_SELECTION_GET_IFACE*(obj: pointer): PAtkSelectionIface =
+  result = cast[PAtkSelectionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_SELECTION()))
+
+proc ATK_TYPE_STATE_SET*(): GType =
+  result = atk_state_set_get_type()
+
+proc ATK_STATE_SET*(obj: pointer): PAtkStateSet =
+  result = cast[PAtkStateSet](G_TYPE_CHECK_INSTANCE_CAST(obj,
+    ATK_TYPE_STATE_SET()))
+
+proc ATK_STATE_SET_CLASS*(klass: pointer): PAtkStateSetClass =
+  result = cast[PAtkStateSetClass](G_TYPE_CHECK_CLASS_CAST(klass,
+    ATK_TYPE_STATE_SET()))
+
+proc ATK_IS_STATE_SET*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_STATE_SET())
+
+proc ATK_IS_STATE_SET_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_STATE_SET())
+
+proc ATK_STATE_SET_GET_CLASS*(obj: pointer): PAtkStateSetClass =
+  result = cast[PAtkStateSetClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+    ATK_TYPE_STATE_SET()))
+
+proc ATK_TYPE_STREAMABLE_CONTENT*(): GType =
+  result = atk_streamable_content_get_type()
+
+proc ATK_IS_STREAMABLE_CONTENT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_STREAMABLE_CONTENT())
+
+proc ATK_STREAMABLE_CONTENT*(obj: pointer): PAtkStreamableContent =
+  result = cast[PAtkStreamableContent](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      ATK_TYPE_STREAMABLE_CONTENT()))
+
+proc ATK_STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PAtkStreamableContentIface =
+  result = cast[PAtkStreamableContentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      ATK_TYPE_STREAMABLE_CONTENT()))
+
+proc ATK_TYPE_TABLE*(): GType =
+  result = atk_table_get_type()
+
+proc ATK_IS_TABLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_TABLE())
+
+proc ATK_TABLE*(obj: pointer): PAtkTable =
+  result = cast[PAtkTable](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_TABLE()))
+
+proc ATK_TABLE_GET_IFACE*(obj: pointer): PAtkTableIface =
+  result = cast[PAtkTableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_TABLE()))
+
+proc ATK_TYPE_TEXT*(): GType =
+  result = atk_text_get_type()
+
+proc ATK_IS_TEXT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_TEXT())
+
+proc ATK_TEXT*(obj: pointer): PAtkText =
+  result = cast[PAtkText](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_TEXT()))
+
+proc ATK_TEXT_GET_IFACE*(obj: pointer): PAtkTextIface =
+  result = cast[PAtkTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_TEXT()))
+
+proc ATK_TYPE_UTIL*(): GType =
+  result = atk_util_get_type()
+
+proc ATK_IS_UTIL*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_UTIL())
+
+proc ATK_UTIL*(obj: pointer): PAtkUtil =
+  result = cast[PAtkUtil](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_UTIL()))
+
+proc ATK_UTIL_CLASS*(klass: pointer): PAtkUtilClass =
+  result = cast[PAtkUtilClass](G_TYPE_CHECK_CLASS_CAST(klass, ATK_TYPE_UTIL()))
+
+proc ATK_IS_UTIL_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, ATK_TYPE_UTIL())
+
+proc ATK_UTIL_GET_CLASS*(obj: pointer): PAtkUtilClass =
+  result = cast[PAtkUtilClass](G_TYPE_INSTANCE_GET_CLASS(obj, ATK_TYPE_UTIL()))
+
+proc ATK_TYPE_VALUE*(): GType =
+  result = atk_value_get_type()
+
+proc ATK_IS_VALUE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, ATK_TYPE_VALUE())
+
+proc ATK_VALUE*(obj: pointer): PAtkValue =
+  result = cast[PAtkValue](G_TYPE_CHECK_INSTANCE_CAST(obj, ATK_TYPE_VALUE()))
+
+proc ATK_VALUE_GET_IFACE*(obj: pointer): PAtkValueIface =
+  result = cast[PAtkValueIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_VALUE()))
diff --git a/lib/base/gtk/gdk2.nim b/lib/base/gtk/gdk2.nim
new file mode 100755
index 000000000..11179525a
--- /dev/null
+++ b/lib/base/gtk/gdk2.nim
@@ -0,0 +1,3957 @@
+import 
+  glib2, gdk2pixbuf, pango
+
+when defined(win32): 
+  {.define: GDK_WINDOWING_WIN32.}
+  const 
+    gdklib = "libgdk-win32-2.0-0.dll"
+    GDK_HAVE_WCHAR_H = 1
+    GDK_HAVE_WCTYPE_H = 1
+elif defined(darwin): 
+  #    linklib gtk-x11-2.0
+  #    linklib gdk-x11-2.0
+  #    linklib pango-1.0.0
+  #    linklib glib-2.0.0
+  #    linklib gobject-2.0.0
+  #    linklib gdk_pixbuf-2.0.0
+  #    linklib atk-1.0.0
+  const 
+    gdklib = "gdk-x11-2.0"
+else: 
+  const 
+    gdklib = "libgdk-x11-2.0.so"
+const 
+  NUMPTSTOBUFFER* = 200
+  GDK_MAX_TIMECOORD_AXES* = 128
+
+type 
+  PGdkDeviceClass* = ptr TGdkDeviceClass
+  TGdkDeviceClass* = object of TGObjectClass
+
+  PGdkVisualClass* = ptr TGdkVisualClass
+  TGdkVisualClass* = object of TGObjectClass
+
+  PGdkColor* = ptr TGdkColor
+  TGdkColor* = record 
+    pixel*: guint32
+    red*: guint16
+    green*: guint16
+    blue*: guint16
+
+  PGdkColormap* = ptr TGdkColormap
+  PGdkDrawable* = ptr TGdkDrawable
+  TGdkDrawable* = object of TGObject
+
+  PGdkWindow* = ptr TGdkWindow
+  TGdkWindow* = TGdkDrawable
+  PGdkPixmap* = ptr TGdkPixmap
+  TGdkPixmap* = TGdkDrawable
+  PGdkBitmap* = ptr TGdkBitmap
+  TGdkBitmap* = TGdkDrawable
+  PGdkFontType* = ptr TGdkFontType
+  TGdkFontType* = enum 
+    GDK_FONT_FONT, GDK_FONT_FONTSET
+  PGdkFont* = ptr TGdkFont
+  TGdkFont* = record 
+    `type`*: TGdkFontType
+    ascent*: gint
+    descent*: gint
+
+  PGdkFunction* = ptr TGdkFunction
+  TGdkFunction* = enum 
+    GDK_COPY, GDK_INVERT, GDK_XOR, GDK_CLEAR, GDK_AND, GDK_AND_REVERSE, 
+    GDK_AND_INVERT, GDK_NOOP, GDK_OR, GDK_EQUIV, GDK_OR_REVERSE, 
+    GDK_COPY_INVERT, GDK_OR_INVERT, GDK_NAND, GDK_NOR, GDK_SET
+  PGdkCapStyle* = ptr TGdkCapStyle
+  TGdkCapStyle* = enum 
+    GDK_CAP_NOT_LAST, GDK_CAP_BUTT, GDK_CAP_ROUND, GDK_CAP_PROJECTING
+  PGdkFill* = ptr TGdkFill
+  TGdkFill* = enum 
+    GDK_SOLID, GDK_TILED, GDK_STIPPLED, GDK_OPAQUE_STIPPLED
+  PGdkJoinStyle* = ptr TGdkJoinStyle
+  TGdkJoinStyle* = enum 
+    GDK_JOIN_MITER, GDK_JOIN_ROUND, GDK_JOIN_BEVEL
+  PGdkLineStyle* = ptr TGdkLineStyle
+  TGdkLineStyle* = enum 
+    GDK_LINE_SOLID, GDK_LINE_ON_OFF_DASH, GDK_LINE_DOUBLE_DASH
+  PGdkSubwindowMode* = ptr TGdkSubwindowMode
+  TGdkSubwindowMode* = int
+  PGdkGCValuesMask* = ptr TGdkGCValuesMask
+  TGdkGCValuesMask* = int32
+  PGdkGCValues* = ptr TGdkGCValues
+  TGdkGCValues* = record 
+    foreground*: TGdkColor
+    background*: TGdkColor
+    font*: PGdkFont
+    `function`*: TGdkFunction
+    fill*: TGdkFill
+    tile*: PGdkPixmap
+    stipple*: PGdkPixmap
+    clip_mask*: PGdkPixmap
+    subwindow_mode*: TGdkSubwindowMode
+    ts_x_origin*: gint
+    ts_y_origin*: gint
+    clip_x_origin*: gint
+    clip_y_origin*: gint
+    graphics_exposures*: gint
+    line_width*: gint
+    line_style*: TGdkLineStyle
+    cap_style*: TGdkCapStyle
+    join_style*: TGdkJoinStyle
+
+  PGdkGC* = ptr TGdkGC
+  TGdkGC* = object of TGObject
+    clip_x_origin*: gint
+    clip_y_origin*: gint
+    ts_x_origin*: gint
+    ts_y_origin*: gint
+    colormap*: PGdkColormap
+
+  PGdkImageType* = ptr TGdkImageType
+  TGdkImageType* = enum 
+    GDK_IMAGE_NORMAL, GDK_IMAGE_SHARED, GDK_IMAGE_FASTEST
+  PGdkImage* = ptr TGdkImage
+  PGdkDevice* = ptr TGdkDevice
+  PGdkTimeCoord* = ptr TGdkTimeCoord
+  PPGdkTimeCoord* = ptr PGdkTimeCoord
+  PGdkRgbDither* = ptr TGdkRgbDither
+  TGdkRgbDither* = enum 
+    GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_NORMAL, GDK_RGB_DITHER_MAX
+  PGdkDisplay* = ptr TGdkDisplay
+  PGdkScreen* = ptr TGdkScreen
+  TGdkScreen* = object of TGObject
+
+  PGdkInputCondition* = ptr TGdkInputCondition
+  TGdkInputCondition* = int32
+  PGdkStatus* = ptr TGdkStatus
+  TGdkStatus* = int32
+  TGdkPoint* = record 
+    x*: gint
+    y*: gint
+
+  PGdkPoint* = ptr TGdkPoint
+  PPGdkPoint* = ptr PGdkPoint
+  PGdkSpan* = ptr TGdkSpan
+  PGdkWChar* = ptr TGdkWChar
+  TGdkWChar* = guint32
+  PGdkSegment* = ptr TGdkSegment
+  TGdkSegment* = record 
+    x1*: gint
+    y1*: gint
+    x2*: gint
+    y2*: gint
+
+  PGdkRectangle* = ptr TGdkRectangle
+  TGdkRectangle* = record 
+    x*: gint
+    y*: gint
+    width*: gint
+    height*: gint
+
+  PGdkAtom* = ptr TGdkAtom
+  TGdkAtom* = gulong
+  PGdkByteOrder* = ptr TGdkByteOrder
+  TGdkByteOrder* = enum 
+    GDK_LSB_FIRST, GDK_MSB_FIRST
+  PGdkModifierType* = ptr TGdkModifierType
+  TGdkModifierType* = gint
+  PGdkVisualType* = ptr TGdkVisualType
+  TGdkVisualType* = enum 
+    GDK_VISUAL_STATIC_GRAY, GDK_VISUAL_GRAYSCALE, GDK_VISUAL_STATIC_COLOR, 
+    GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_DIRECT_COLOR
+  PGdkVisual* = ptr TGdkVisual
+  TGdkVisual* = object of TGObject
+    TheType*: TGdkVisualType
+    depth*: gint
+    byte_order*: TGdkByteOrder
+    colormap_size*: gint
+    bits_per_rgb*: gint
+    red_mask*: guint32
+    red_shift*: gint
+    red_prec*: gint
+    green_mask*: guint32
+    green_shift*: gint
+    green_prec*: gint
+    blue_mask*: guint32
+    blue_shift*: gint
+    blue_prec*: gint
+    screen*: PGdkScreen
+
+  PGdkColormapClass* = ptr TGdkColormapClass
+  TGdkColormapClass* = object of TGObjectClass
+
+  TGdkColormap* = object of TGObject
+    size*: gint
+    colors*: PGdkColor
+    visual*: PGdkVisual
+    windowing_data*: gpointer
+    screen*: PGdkScreen
+
+  PGdkCursorType* = ptr TGdkCursorType
+  TGdkCursorType* = gint
+  PGdkCursor* = ptr TGdkCursor
+  TGdkCursor* = record 
+    `type`*: TGdkCursorType
+    ref_count*: guint
+
+  PGdkDragAction* = ptr TGdkDragAction
+  TGdkDragAction* = int32
+  PGdkDragProtocol* = ptr TGdkDragProtocol
+  TGdkDragProtocol* = enum 
+    GDK_DRAG_PROTO_MOTIF, GDK_DRAG_PROTO_XDND, GDK_DRAG_PROTO_ROOTWIN, 
+    GDK_DRAG_PROTO_NONE, GDK_DRAG_PROTO_WIN32_DROPFILES, GDK_DRAG_PROTO_OLE2, 
+    GDK_DRAG_PROTO_LOCAL
+  PGdkDragContext* = ptr TGdkDragContext
+  TGdkDragContext* = object of TGObject
+    protocol*: TGdkDragProtocol
+    is_source*: gboolean
+    source_window*: PGdkWindow
+    dest_window*: PGdkWindow
+    targets*: PGList
+    actions*: TGdkDragAction
+    suggested_action*: TGdkDragAction
+    action*: TGdkDragAction
+    start_time*: guint32
+    windowing_data*: gpointer
+
+  PGdkDragContextClass* = ptr TGdkDragContextClass
+  TGdkDragContextClass* = object of TGObjectClass
+
+  PGdkRegionBox* = ptr TGdkRegionBox
+  TGdkRegionBox* = TGdkSegment
+  PGdkRegion* = ptr TGdkRegion
+  TGdkRegion* = record 
+    size*: int32
+    numRects*: int32
+    rects*: PGdkRegionBox
+    extents*: TGdkRegionBox
+
+  PPOINTBLOCK* = ptr TPOINTBLOCK
+  TPOINTBLOCK* = record 
+    pts*: array[0..(NUMPTSTOBUFFER) - 1, TGdkPoint]
+    next*: PPOINTBLOCK
+
+  PGdkDrawableClass* = ptr TGdkDrawableClass
+  TGdkDrawableClass* = object of TGObjectClass
+    create_gc*: proc (drawable: PGdkDrawable, values: PGdkGCValues, 
+                      mask: TGdkGCValuesMask): PGdkGC{.cdecl.}
+    draw_rectangle*: proc (drawable: PGdkDrawable, gc: PGdkGC, filled: gint, 
+                           x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_arc*: proc (drawable: PGdkDrawable, gc: PGdkGC, filled: gint, x: gint, 
+                     y: gint, width: gint, height: gint, angle1: gint, 
+                     angle2: gint){.cdecl.}
+    draw_polygon*: proc (drawable: PGdkDrawable, gc: PGdkGC, filled: gint, 
+                         points: PGdkPoint, npoints: gint){.cdecl.}
+    draw_text*: proc (drawable: PGdkDrawable, font: PGdkFont, gc: PGdkGC, 
+                      x: gint, y: gint, text: cstring, text_length: gint){.cdecl.}
+    draw_text_wc*: proc (drawable: PGdkDrawable, font: PGdkFont, gc: PGdkGC, 
+                         x: gint, y: gint, text: PGdkWChar, text_length: gint){.
+        cdecl.}
+    draw_drawable*: proc (drawable: PGdkDrawable, gc: PGdkGC, src: PGdkDrawable, 
+                          xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                          width: gint, height: gint){.cdecl.}
+    draw_points*: proc (drawable: PGdkDrawable, gc: PGdkGC, points: PGdkPoint, 
+                        npoints: gint){.cdecl.}
+    draw_segments*: proc (drawable: PGdkDrawable, gc: PGdkGC, segs: PGdkSegment, 
+                          nsegs: gint){.cdecl.}
+    draw_lines*: proc (drawable: PGdkDrawable, gc: PGdkGC, points: PGdkPoint, 
+                       npoints: gint){.cdecl.}
+    draw_glyphs*: proc (drawable: PGdkDrawable, gc: PGdkGC, font: PPangoFont, 
+                        x: gint, y: gint, glyphs: PPangoGlyphString){.cdecl.}
+    draw_image*: proc (drawable: PGdkDrawable, gc: PGdkGC, image: PGdkImage, 
+                       xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                       width: gint, height: gint){.cdecl.}
+    get_depth*: proc (drawable: PGdkDrawable): gint{.cdecl.}
+    get_size*: proc (drawable: PGdkDrawable, width: Pgint, height: Pgint){.cdecl.}
+    set_colormap*: proc (drawable: PGdkDrawable, cmap: PGdkColormap){.cdecl.}
+    get_colormap*: proc (drawable: PGdkDrawable): PGdkColormap{.cdecl.}
+    get_visual*: proc (drawable: PGdkDrawable): PGdkVisual{.cdecl.}
+    get_screen*: proc (drawable: PGdkDrawable): PGdkScreen{.cdecl.}
+    get_image*: proc (drawable: PGdkDrawable, x: gint, y: gint, width: gint, 
+                      height: gint): PGdkImage{.cdecl.}
+    get_clip_region*: proc (drawable: PGdkDrawable): PGdkRegion{.cdecl.}
+    get_visible_region*: proc (drawable: PGdkDrawable): PGdkRegion{.cdecl.}
+    get_composite_drawable*: proc (drawable: PGdkDrawable, x: gint, y: gint, 
+                                   width: gint, height: gint, 
+                                   composite_x_offset: Pgint, 
+                                   composite_y_offset: Pgint): PGdkDrawable{.
+        cdecl.}
+    `draw_pixbuf`*: proc (drawable: PGdkDrawable, gc: PGdkGC, 
+                          pixbuf: PGdkPixbuf, src_x: gint, src_y: gint, 
+                          dest_x: gint, dest_y: gint, width: gint, height: gint, 
+                          dither: TGdkRgbDither, x_dither: gint, y_dither: gint){.
+        cdecl.}
+    `copy_to_image`*: proc (drawable: PGdkDrawable, image: PGdkImage, 
+                            src_x: gint, src_y: gint, dest_x: gint, 
+                            dest_y: gint, width: gint, height: gint): PGdkImage{.
+        cdecl.}
+    `gdk_reserved1`: proc (){.cdecl.}
+    `gdk_reserved2`: proc (){.cdecl.}
+    `gdk_reserved3`: proc (){.cdecl.}
+    `gdk_reserved4`: proc (){.cdecl.}
+    `gdk_reserved5`: proc (){.cdecl.}
+    `gdk_reserved6`: proc (){.cdecl.}
+    `gdk_reserved7`: proc (){.cdecl.}
+    `gdk_reserved9`: proc (){.cdecl.}
+    `gdk_reserved10`: proc (){.cdecl.}
+    `gdk_reserved11`: proc (){.cdecl.}
+    `gdk_reserved12`: proc (){.cdecl.}
+    `gdk_reserved13`: proc (){.cdecl.}
+    `gdk_reserved14`: proc (){.cdecl.}
+    `gdk_reserved15`: proc (){.cdecl.}
+    `gdk_reserved16`: proc (){.cdecl.}
+
+  PGdkEvent* = ptr TGdkEvent
+  TGdkEventFunc* = proc (event: PGdkEvent, data: gpointer){.cdecl.}
+  PGdkXEvent* = ptr TGdkXEvent
+  TGdkXEvent* = proc ()
+  PGdkFilterReturn* = ptr TGdkFilterReturn
+  TGdkFilterReturn* = enum 
+    GDK_FILTER_CONTINUE, GDK_FILTER_TRANSLATE, GDK_FILTER_REMOVE
+  TGdkFilterFunc* = proc (xevent: PGdkXEvent, event: PGdkEvent, data: gpointer): TGdkFilterReturn{.
+      cdecl.}
+  PGdkEventType* = ptr TGdkEventType
+  TGdkEventType* = gint
+  PGdkEventMask* = ptr TGdkEventMask
+  TGdkEventMask* = gint32
+  PGdkVisibilityState* = ptr TGdkVisibilityState
+  TGdkVisibilityState* = enum 
+    GDK_VISIBILITY_UNOBSCURED, GDK_VISIBILITY_PARTIAL, 
+    GDK_VISIBILITY_FULLY_OBSCURED
+  PGdkScrollDirection* = ptr TGdkScrollDirection
+  TGdkScrollDirection* = enum 
+    GDK_SCROLL_UP, GDK_SCROLL_DOWN, GDK_SCROLL_LEFT, GDK_SCROLL_RIGHT
+  PGdkNotifyType* = ptr TGdkNotifyType
+  TGdkNotifyType* = int
+  PGdkCrossingMode* = ptr TGdkCrossingMode
+  TGdkCrossingMode* = enum 
+    GDK_CROSSING_NORMAL, GDK_CROSSING_GRAB, GDK_CROSSING_UNGRAB
+  PGdkPropertyState* = ptr TGdkPropertyState
+  TGdkPropertyState* = enum 
+    GDK_PROPERTY_NEW_VALUE, GDK_PROPERTY_STATE_DELETE
+  PGdkWindowState* = ptr TGdkWindowState
+  TGdkWindowState* = gint
+  PGdkSettingAction* = ptr TGdkSettingAction
+  TGdkSettingAction* = enum 
+    GDK_SETTING_ACTION_NEW, GDK_SETTING_ACTION_CHANGED, 
+    GDK_SETTING_ACTION_DELETED
+  PGdkEventAny* = ptr TGdkEventAny
+  TGdkEventAny* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+
+  PGdkEventExpose* = ptr TGdkEventExpose
+  TGdkEventExpose* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    area*: TGdkRectangle
+    region*: PGdkRegion
+    count*: gint
+
+  PGdkEventNoExpose* = ptr TGdkEventNoExpose
+  TGdkEventNoExpose* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+
+  PGdkEventVisibility* = ptr TGdkEventVisibility
+  TGdkEventVisibility* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    state*: TGdkVisibilityState
+
+  PGdkEventMotion* = ptr TGdkEventMotion
+  TGdkEventMotion* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    time*: guint32
+    x*: gdouble
+    y*: gdouble
+    axes*: Pgdouble
+    state*: guint
+    is_hint*: gint16
+    device*: PGdkDevice
+    x_root*: gdouble
+    y_root*: gdouble
+
+  PGdkEventButton* = ptr TGdkEventButton
+  TGdkEventButton* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    time*: guint32
+    x*: gdouble
+    y*: gdouble
+    axes*: Pgdouble
+    state*: guint
+    button*: guint
+    device*: PGdkDevice
+    x_root*: gdouble
+    y_root*: gdouble
+
+  PGdkEventScroll* = ptr TGdkEventScroll
+  TGdkEventScroll* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    time*: guint32
+    x*: gdouble
+    y*: gdouble
+    state*: guint
+    direction*: TGdkScrollDirection
+    device*: PGdkDevice
+    x_root*: gdouble
+    y_root*: gdouble
+
+  PGdkEventKey* = ptr TGdkEventKey
+  TGdkEventKey* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    time*: guint32
+    state*: guint
+    keyval*: guint
+    length*: gint
+    `string`*: cstring
+    hardware_keycode*: guint16
+    group*: guint8
+
+  PGdkEventCrossing* = ptr TGdkEventCrossing
+  TGdkEventCrossing* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    subwindow*: PGdkWindow
+    time*: guint32
+    x*: gdouble
+    y*: gdouble
+    x_root*: gdouble
+    y_root*: gdouble
+    mode*: TGdkCrossingMode
+    detail*: TGdkNotifyType
+    focus*: gboolean
+    state*: guint
+
+  PGdkEventFocus* = ptr TGdkEventFocus
+  TGdkEventFocus* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    `in`*: gint16
+
+  PGdkEventConfigure* = ptr TGdkEventConfigure
+  TGdkEventConfigure* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    x*: gint
+    y*: gint
+    width*: gint
+    height*: gint
+
+  PGdkEventProperty* = ptr TGdkEventProperty
+  TGdkEventProperty* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    atom*: TGdkAtom
+    time*: guint32
+    state*: guint
+
+  TGdkNativeWindow* = pointer
+  PGdkEventSelection* = ptr TGdkEventSelection
+  TGdkEventSelection* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    selection*: TGdkAtom
+    target*: TGdkAtom
+    `property`*: TGdkAtom
+    time*: guint32
+    requestor*: TGdkNativeWindow
+
+  PGdkEventProximity* = ptr TGdkEventProximity
+  TGdkEventProximity* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    time*: guint32
+    device*: PGdkDevice
+
+  PmatDUMMY* = ptr TmatDUMMY
+  TmatDUMMY* = record 
+    b*: array[0..19, char]
+
+  PGdkEventClient* = ptr TGdkEventClient
+  TGdkEventClient* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    message_type*: TGdkAtom
+    data_format*: gushort
+    b*: array[0..19, char]
+
+  PGdkEventSetting* = ptr TGdkEventSetting
+  TGdkEventSetting* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    action*: TGdkSettingAction
+    name*: cstring
+
+  PGdkEventWindowState* = ptr TGdkEventWindowState
+  TGdkEventWindowState* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    changed_mask*: TGdkWindowState
+    new_window_state*: TGdkWindowState
+
+  PGdkEventDND* = ptr TGdkEventDND
+  TGdkEventDND* = record 
+    `type`*: TGdkEventType
+    window*: PGdkWindow
+    send_event*: gint8
+    context*: PGdkDragContext
+    time*: guint32
+    x_root*: gshort
+    y_root*: gshort
+
+  TGdkEvent* = record 
+    data*: array[0..255, char] # union of
+                               # `type`: TGdkEventType
+                               #  any: TGdkEventAny
+                               #  expose: TGdkEventExpose 
+                               #  no_expose: TGdkEventNoExpose 
+                               #  visibility: TGdkEventVisibility 
+                               #  motion: TGdkEventMotion
+                               #  button: TGdkEventButton
+                               #  scroll: TGdkEventScroll
+                               #  key: TGdkEventKey
+                               #  crossing: TGdkEventCrossing
+                               #  focus_change: TGdkEventFocus
+                               #  configure: TGdkEventConfigure
+                               #  `property`: TGdkEventProperty
+                               #  selection: TGdkEventSelection
+                               #  proximity: TGdkEventProximity
+                               #  client: TGdkEventClient
+                               #  dnd: TGdkEventDND
+                               #  window_state: TGdkEventWindowState
+                               #  setting: TGdkEventSetting
+  
+  PGdkGCClass* = ptr TGdkGCClass
+  TGdkGCClass* = object of TGObjectClass
+    get_values*: proc (gc: PGdkGC, values: PGdkGCValues){.cdecl.}
+    set_values*: proc (gc: PGdkGC, values: PGdkGCValues, mask: TGdkGCValuesMask){.
+        cdecl.}
+    set_dashes*: proc (gc: PGdkGC, dash_offset: gint, 
+                       dash_list: openarray[gint8]){.cdecl.}
+    `gdk_reserved1`*: proc (){.cdecl.}
+    `gdk_reserved2`*: proc (){.cdecl.}
+    `gdk_reserved3`*: proc (){.cdecl.}
+    `gdk_reserved4`*: proc (){.cdecl.}
+
+  PGdkImageClass* = ptr TGdkImageClass
+  TGdkImageClass* = object of TGObjectClass
+
+  TGdkImage* = object of TGObject
+    `type`*: TGdkImageType
+    visual*: PGdkVisual
+    byte_order*: TGdkByteOrder
+    width*: gint
+    height*: gint
+    depth*: guint16
+    bpp*: guint16
+    bpl*: guint16
+    bits_per_pixel*: guint16
+    mem*: gpointer
+    colormap*: PGdkColormap
+    windowing_data*: gpointer
+
+  PGdkExtensionMode* = ptr TGdkExtensionMode
+  TGdkExtensionMode* = enum 
+    GDK_EXTENSION_EVENTS_NONE, GDK_EXTENSION_EVENTS_ALL, 
+    GDK_EXTENSION_EVENTS_CURSOR
+  PGdkInputSource* = ptr TGdkInputSource
+  TGdkInputSource* = enum 
+    GDK_SOURCE_MOUSE, GDK_SOURCE_PEN, GDK_SOURCE_ERASER, GDK_SOURCE_CURSOR
+  PGdkInputMode* = ptr TGdkInputMode
+  TGdkInputMode* = enum 
+    GDK_MODE_DISABLED, GDK_MODE_SCREEN, GDK_MODE_WINDOW
+  PGdkAxisUse* = ptr TGdkAxisUse
+  TGdkAxisUse* = int32
+  PGdkDeviceKey* = ptr TGdkDeviceKey
+  TGdkDeviceKey* = record 
+    keyval*: guint
+    modifiers*: TGdkModifierType
+
+  PGdkDeviceAxis* = ptr TGdkDeviceAxis
+  TGdkDeviceAxis* = record 
+    use*: TGdkAxisUse
+    min*: gdouble
+    max*: gdouble
+
+  TGdkDevice* = object of TGObject
+    name*: cstring
+    source*: TGdkInputSource
+    mode*: TGdkInputMode
+    has_cursor*: gboolean
+    num_axes*: gint
+    axes*: PGdkDeviceAxis
+    num_keys*: gint
+    keys*: PGdkDeviceKey
+
+  TGdkTimeCoord* = record 
+    time*: guint32
+    axes*: array[0..(GDK_MAX_TIMECOORD_AXES) - 1, gdouble]
+
+  PGdkKeymapKey* = ptr TGdkKeymapKey
+  TGdkKeymapKey* = record 
+    keycode*: guint
+    group*: gint
+    level*: gint
+
+  PGdkKeymap* = ptr TGdkKeymap
+  TGdkKeymap* = object of TGObject
+    display*: PGdkDisplay
+
+  PGdkKeymapClass* = ptr TGdkKeymapClass
+  TGdkKeymapClass* = object of TGObjectClass
+    direction_changed*: proc (keymap: PGdkKeymap){.cdecl.}
+
+  PGdkPangoAttrStipple* = ptr TGdkPangoAttrStipple
+  TGdkPangoAttrStipple* = record 
+    attr*: TPangoAttribute
+    stipple*: PGdkBitmap
+
+  PGdkPangoAttrEmbossed* = ptr TGdkPangoAttrEmbossed
+  TGdkPangoAttrEmbossed* = record 
+    attr*: TPangoAttribute
+    embossed*: gboolean
+
+  PGdkPixmapObject* = ptr TGdkPixmapObject
+  TGdkPixmapObject* = object of TGdkDrawable
+    impl*: PGdkDrawable
+    depth*: gint
+
+  PGdkPixmapObjectClass* = ptr TGdkPixmapObjectClass
+  TGdkPixmapObjectClass* = object of TGdkDrawableClass
+
+  PGdkPropMode* = ptr TGdkPropMode
+  TGdkPropMode* = enum 
+    GDK_PROP_MODE_REPLACE, GDK_PROP_MODE_PREPEND, GDK_PROP_MODE_APPEND
+  PGdkFillRule* = ptr TGdkFillRule
+  TGdkFillRule* = enum 
+    GDK_EVEN_ODD_RULE, GDK_WINDING_RULE
+  PGdkOverlapType* = ptr TGdkOverlapType
+  TGdkOverlapType* = enum 
+    GDK_OVERLAP_RECTANGLE_IN, GDK_OVERLAP_RECTANGLE_OUT, 
+    GDK_OVERLAP_RECTANGLE_PART
+  TGdkSpanFunc* = proc (span: PGdkSpan, data: gpointer){.cdecl.}
+  PGdkRgbCmap* = ptr TGdkRgbCmap
+  TGdkRgbCmap* = record 
+    colors*: array[0..255, guint32]
+    n_colors*: gint
+    info_list*: PGSList
+
+  TGdkDisplay* = object of TGObject
+    queued_events*: PGList
+    queued_tail*: PGList
+    button_click_time*: array[0..1, guint32]
+    button_window*: array[0..1, PGdkWindow]
+    button_number*: array[0..1, guint]
+    double_click_time*: guint
+
+  PGdkDisplayClass* = ptr TGdkDisplayClass
+  TGdkDisplayClass* = object of TGObjectClass
+    get_display_name*: proc (display: PGdkDisplay): cstring{.cdecl.}
+    get_n_screens*: proc (display: PGdkDisplay): gint{.cdecl.}
+    get_screen*: proc (display: PGdkDisplay, screen_num: gint): PGdkScreen{.
+        cdecl.}
+    get_default_screen*: proc (display: PGdkDisplay): PGdkScreen{.cdecl.}
+
+  PGdkScreenClass* = ptr TGdkScreenClass
+  TGdkScreenClass* = object of TGObjectClass
+    get_display*: proc (screen: PGdkScreen): PGdkDisplay{.cdecl.}
+    get_width*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_height*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_width_mm*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_height_mm*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_root_depth*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_screen_num*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_root_window*: proc (screen: PGdkScreen): PGdkWindow{.cdecl.}
+    get_default_colormap*: proc (screen: PGdkScreen): PGdkColormap{.cdecl.}
+    set_default_colormap*: proc (screen: PGdkScreen, colormap: PGdkColormap){.
+        cdecl.}
+    get_window_at_pointer*: proc (screen: PGdkScreen, win_x: Pgint, win_y: Pgint): PGdkWindow{.
+        cdecl.}
+    get_n_monitors*: proc (screen: PGdkScreen): gint{.cdecl.}
+    get_monitor_geometry*: proc (screen: PGdkScreen, monitor_num: gint, 
+                                 dest: PGdkRectangle){.cdecl.}
+
+  PGdkGrabStatus* = ptr TGdkGrabStatus
+  TGdkGrabStatus* = int
+  TGdkInputFunction* = proc (data: gpointer, source: gint, 
+                             condition: TGdkInputCondition){.cdecl.}
+  TGdkDestroyNotify* = proc (data: gpointer){.cdecl.}
+  TGdkSpan* = record 
+    x*: gint
+    y*: gint
+    width*: gint
+
+  PGdkWindowClass* = ptr TGdkWindowClass
+  TGdkWindowClass* = enum 
+    GDK_INPUT_OUTPUT, GDK_INPUT_ONLY
+  PGdkWindowType* = ptr TGdkWindowType
+  TGdkWindowType* = enum 
+    GDK_WINDOW_ROOT, GDK_WINDOW_TOPLEVEL, GDK_WINDOW_CHILD, GDK_WINDOW_DIALOG, 
+    GDK_WINDOW_TEMP, GDK_WINDOW_FOREIGN
+  PGdkWindowAttributesType* = ptr TGdkWindowAttributesType
+  TGdkWindowAttributesType* = int32
+  PGdkWindowHints* = ptr TGdkWindowHints
+  TGdkWindowHints* = int32
+  PGdkWindowTypeHint* = ptr TGdkWindowTypeHint
+  TGdkWindowTypeHint* = enum 
+    GDK_WINDOW_TYPE_HINT_NORMAL, GDK_WINDOW_TYPE_HINT_DIALOG, 
+    GDK_WINDOW_TYPE_HINT_MENU, GDK_WINDOW_TYPE_HINT_TOOLBAR
+  PGdkWMDecoration* = ptr TGdkWMDecoration
+  TGdkWMDecoration* = int32
+  PGdkWMFunction* = ptr TGdkWMFunction
+  TGdkWMFunction* = int32
+  PGdkGravity* = ptr TGdkGravity
+  TGdkGravity* = int
+  PGdkWindowEdge* = ptr TGdkWindowEdge
+  TGdkWindowEdge* = enum 
+    GDK_WINDOW_EDGE_NORTH_WEST, GDK_WINDOW_EDGE_NORTH, 
+    GDK_WINDOW_EDGE_NORTH_EAST, GDK_WINDOW_EDGE_WEST, GDK_WINDOW_EDGE_EAST, 
+    GDK_WINDOW_EDGE_SOUTH_WEST, GDK_WINDOW_EDGE_SOUTH, 
+    GDK_WINDOW_EDGE_SOUTH_EAST
+  PGdkWindowAttr* = ptr TGdkWindowAttr
+  TGdkWindowAttr* = record 
+    title*: cstring
+    event_mask*: gint
+    x*: gint
+    y*: gint
+    width*: gint
+    height*: gint
+    wclass*: TGdkWindowClass
+    visual*: PGdkVisual
+    colormap*: PGdkColormap
+    window_type*: TGdkWindowType
+    cursor*: PGdkCursor
+    wmclass_name*: cstring
+    wmclass_class*: cstring
+    override_redirect*: gboolean
+
+  PGdkGeometry* = ptr TGdkGeometry
+  TGdkGeometry* = record 
+    min_width*: gint
+    min_height*: gint
+    max_width*: gint
+    max_height*: gint
+    base_width*: gint
+    base_height*: gint
+    width_inc*: gint
+    height_inc*: gint
+    min_aspect*: gdouble
+    max_aspect*: gdouble
+    win_gravity*: TGdkGravity
+
+  PGdkPointerHooks* = ptr TGdkPointerHooks
+  TGdkPointerHooks* = record 
+    get_pointer*: proc (window: PGdkWindow, x: Pgint, y: Pgint, 
+                        mask: PGdkModifierType): PGdkWindow{.cdecl.}
+    window_at_pointer*: proc (screen: PGdkScreen, win_x: Pgint, win_y: Pgint): PGdkWindow{.
+        cdecl.}
+
+  PGdkWindowObject* = ptr TGdkWindowObject
+  TGdkWindowObject* = object of TGdkDrawable
+    impl*: PGdkDrawable
+    parent*: PGdkWindowObject
+    user_data*: gpointer
+    x*: gint
+    y*: gint
+    extension_events*: gint
+    filters*: PGList
+    children*: PGList
+    bg_color*: TGdkColor
+    bg_pixmap*: PGdkPixmap
+    paint_stack*: PGSList
+    update_area*: PGdkRegion
+    update_freeze_count*: guint
+    window_type*: guint8
+    depth*: guint8
+    resize_count*: guint8
+    state*: TGdkWindowState
+    flag0*: guint16
+    event_mask*: TGdkEventMask
+
+  PGdkWindowObjectClass* = ptr TGdkWindowObjectClass
+  TGdkWindowObjectClass* = object of TGdkDrawableClass
+
+  gdk_window_invalidate_maybe_recurse_child_func* = proc (para1: PGdkWindow, 
+      para2: gpointer): gboolean
+
+proc GDK_TYPE_COLORMAP*(): GType
+proc GDK_COLORMAP*(anObject: pointer): PGdkColormap
+proc GDK_COLORMAP_CLASS*(klass: pointer): PGdkColormapClass
+proc GDK_IS_COLORMAP*(anObject: pointer): bool
+proc GDK_IS_COLORMAP_CLASS*(klass: pointer): bool
+proc GDK_COLORMAP_GET_CLASS*(obj: pointer): PGdkColormapClass
+proc GDK_TYPE_COLOR*(): GType
+proc gdk_colormap_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_colormap_get_type".}
+proc gdk_colormap_new*(visual: PGdkVisual, allocate: gboolean): PGdkColormap{.
+    cdecl, dynlib: gdklib, importc: "gdk_colormap_new".}
+proc gdk_colormap_alloc_colors*(colormap: PGdkColormap, colors: PGdkColor, 
+                                ncolors: gint, writeable: gboolean, 
+                                best_match: gboolean, success: Pgboolean): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_colormap_alloc_colors".}
+proc gdk_colormap_alloc_color*(colormap: PGdkColormap, color: PGdkColor, 
+                               writeable: gboolean, best_match: gboolean): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_colormap_alloc_color".}
+proc gdk_colormap_free_colors*(colormap: PGdkColormap, colors: PGdkColor, 
+                               ncolors: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_colormap_free_colors".}
+proc gdk_colormap_query_color*(colormap: PGdkColormap, pixel: gulong, 
+                               result: PGdkColor){.cdecl, dynlib: gdklib, 
+    importc: "gdk_colormap_query_color".}
+proc gdk_colormap_get_visual*(colormap: PGdkColormap): PGdkVisual{.cdecl, 
+    dynlib: gdklib, importc: "gdk_colormap_get_visual".}
+proc gdk_color_copy*(color: PGdkColor): PGdkColor{.cdecl, dynlib: gdklib, 
+    importc: "gdk_color_copy".}
+proc gdk_color_free*(color: PGdkColor){.cdecl, dynlib: gdklib, 
+                                        importc: "gdk_color_free".}
+proc gdk_color_parse*(spec: cstring, color: PGdkColor): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_color_parse".}
+proc gdk_color_hash*(colora: PGdkColor): guint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_color_hash".}
+proc gdk_color_equal*(colora: PGdkColor, colorb: PGdkColor): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_color_equal".}
+proc gdk_color_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                   importc: "gdk_color_get_type".}
+const 
+  GDK_CURSOR_IS_PIXMAP* = - (1)
+  GDK_X_CURSOR* = 0
+  GDK_ARROW* = 2
+  GDK_BASED_ARROW_DOWN* = 4
+  GDK_BASED_ARROW_UP* = 6
+  GDK_BOAT* = 8
+  GDK_BOGOSITY* = 10
+  GDK_BOTTOM_LEFT_CORNER* = 12
+  GDK_BOTTOM_RIGHT_CORNER* = 14
+  GDK_BOTTOM_SIDE* = 16
+  GDK_BOTTOM_TEE* = 18
+  GDK_BOX_SPIRAL* = 20
+  GDK_CENTER_PTR* = 22
+  GDK_CIRCLE* = 24
+  GDK_CLOCK* = 26
+  GDK_COFFEE_MUG* = 28
+  GDK_CROSS* = 30
+  GDK_CROSS_REVERSE* = 32
+  GDK_CROSSHAIR* = 34
+  GDK_DIAMOND_CROSS* = 36
+  GDK_DOT* = 38
+  GDK_DOTBOX* = 40
+  GDK_DOUBLE_ARROW* = 42
+  GDK_DRAFT_LARGE* = 44
+  GDK_DRAFT_SMALL* = 46
+  GDK_DRAPED_BOX* = 48
+  GDK_EXCHANGE* = 50
+  GDK_FLEUR* = 52
+  GDK_GOBBLER* = 54
+  GDK_GUMBY* = 56
+  GDK_HAND1* = 58
+  GDK_HAND2* = 60
+  GDK_HEART* = 62
+  GDK_ICON* = 64
+  GDK_IRON_CROSS* = 66
+  GDK_LEFT_PTR* = 68
+  GDK_LEFT_SIDE* = 70
+  GDK_LEFT_TEE* = 72
+  GDK_LEFTBUTTON* = 74
+  GDK_LL_ANGLE* = 76
+  GDK_LR_ANGLE* = 78
+  GDK_MAN* = 80
+  GDK_MIDDLEBUTTON* = 82
+  GDK_MOUSE* = 84
+  GDK_PENCIL* = 86
+  GDK_PIRATE* = 88
+  GDK_PLUS* = 90
+  GDK_QUESTION_ARROW* = 92
+  GDK_RIGHT_PTR* = 94
+  GDK_RIGHT_SIDE* = 96
+  GDK_RIGHT_TEE* = 98
+  GDK_RIGHTBUTTON* = 100
+  GDK_RTL_LOGO* = 102
+  GDK_SAILBOAT* = 104
+  GDK_SB_DOWN_ARROW* = 106
+  GDK_SB_H_DOUBLE_ARROW* = 108
+  GDK_SB_LEFT_ARROW* = 110
+  GDK_SB_RIGHT_ARROW* = 112
+  GDK_SB_UP_ARROW* = 114
+  GDK_SB_V_DOUBLE_ARROW* = 116
+  GDK_SHUTTLE* = 118
+  GDK_SIZING* = 120
+  GDK_SPIDER* = 122
+  GDK_SPRAYCAN* = 124
+  GDK_STAR* = 126
+  GDK_TARGET* = 128
+  GDK_TCROSS* = 130
+  GDK_TOP_LEFT_ARROW* = 132
+  GDK_TOP_LEFT_CORNER* = 134
+  GDK_TOP_RIGHT_CORNER* = 136
+  GDK_TOP_SIDE* = 138
+  GDK_TOP_TEE* = 140
+  GDK_TREK* = 142
+  GDK_UL_ANGLE* = 144
+  GDK_UMBRELLA* = 146
+  GDK_UR_ANGLE* = 148
+  GDK_WATCH* = 150
+  GDK_XTERM* = 152
+  GDK_LAST_CURSOR* = GDK_XTERM + 1
+
+proc GDK_TYPE_CURSOR*(): GType
+proc gdk_cursor_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_cursor_get_type".}
+proc gdk_cursor_new_for_screen*(screen: PGdkScreen, cursor_type: TGdkCursorType): PGdkCursor{.
+    cdecl, dynlib: gdklib, importc: "gdk_cursor_new_for_screen".}
+proc gdk_cursor_new_from_pixmap*(source: PGdkPixmap, mask: PGdkPixmap, 
+                                 fg: PGdkColor, bg: PGdkColor, x: gint, y: gint): PGdkCursor{.
+    cdecl, dynlib: gdklib, importc: "gdk_cursor_new_from_pixmap".}
+proc gdk_cursor_get_screen*(cursor: PGdkCursor): PGdkScreen{.cdecl, 
+    dynlib: gdklib, importc: "gdk_cursor_get_screen".}
+proc gdk_cursor_ref*(cursor: PGdkCursor): PGdkCursor{.cdecl, dynlib: gdklib, 
+    importc: "gdk_cursor_ref".}
+proc gdk_cursor_unref*(cursor: PGdkCursor){.cdecl, dynlib: gdklib, 
+    importc: "gdk_cursor_unref".}
+const 
+  GDK_ACTION_DEFAULT* = 1 shl 0
+  GDK_ACTION_COPY* = 1 shl 1
+  GDK_ACTION_MOVE* = 1 shl 2
+  GDK_ACTION_LINK* = 1 shl 3
+  GDK_ACTION_PRIVATE* = 1 shl 4
+  GDK_ACTION_ASK* = 1 shl 5
+
+proc GDK_TYPE_DRAG_CONTEXT*(): GType
+proc GDK_DRAG_CONTEXT*(anObject: Pointer): PGdkDragContext
+proc GDK_DRAG_CONTEXT_CLASS*(klass: Pointer): PGdkDragContextClass
+proc GDK_IS_DRAG_CONTEXT*(anObject: Pointer): bool
+proc GDK_IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool
+proc GDK_DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PGdkDragContextClass
+proc gdk_drag_context_get_type*(): GType{.cdecl, dynlib: gdklib, 
+    importc: "gdk_drag_context_get_type".}
+proc gdk_drag_context_new*(): PGdkDragContext{.cdecl, dynlib: gdklib, 
+    importc: "gdk_drag_context_new".}
+proc gdk_drag_status*(context: PGdkDragContext, action: TGdkDragAction, 
+                      time: guint32){.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_drag_status".}
+proc gdk_drop_reply*(context: PGdkDragContext, ok: gboolean, time: guint32){.
+    cdecl, dynlib: gdklib, importc: "gdk_drop_reply".}
+proc gdk_drop_finish*(context: PGdkDragContext, success: gboolean, time: guint32){.
+    cdecl, dynlib: gdklib, importc: "gdk_drop_finish".}
+proc gdk_drag_get_selection*(context: PGdkDragContext): TGdkAtom{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drag_get_selection".}
+proc gdk_drag_begin*(window: PGdkWindow, targets: PGList): PGdkDragContext{.
+    cdecl, dynlib: gdklib, importc: "gdk_drag_begin".}
+proc gdk_drag_get_protocol_for_display*(display: PGdkDisplay, xid: guint32, 
+                                        protocol: PGdkDragProtocol): guint32{.
+    cdecl, dynlib: gdklib, importc: "gdk_drag_get_protocol_for_display".}
+proc gdk_drag_find_window*(context: PGdkDragContext, drag_window: PGdkWindow, 
+                           x_root: gint, y_root: gint, w: var PGdkWindow, 
+                           protocol: PGdkDragProtocol){.cdecl, dynlib: gdklib, 
+    importc: "gdk_drag_find_window".}
+proc gdk_drag_motion*(context: PGdkDragContext, dest_window: PGdkWindow, 
+                      protocol: TGdkDragProtocol, x_root: gint, y_root: gint, 
+                      suggested_action: TGdkDragAction, 
+                      possible_actions: TGdkDragAction, time: guint32): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_drag_motion".}
+proc gdk_drag_drop*(context: PGdkDragContext, time: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_drag_drop".}
+proc gdk_drag_abort*(context: PGdkDragContext, time: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_drag_abort".}
+proc gdkregion_EXTENTCHECK*(r1, r2: PGdkRegionBox): bool
+proc gdkregion_EXTENTS*(r: PGdkRegionBox, idRect: PGdkRegion)
+proc gdkregion_MEMCHECK*(reg: PGdkRegion, ARect, firstrect: var PGdkRegionBox): bool
+proc gdkregion_CHECK_PREVIOUS*(Reg: PGdkRegion, R: PGdkRegionBox, 
+                               Rx1, Ry1, Rx2, Ry2: gint): bool
+proc gdkregion_ADDRECT*(reg: PGdkRegion, r: PGdkRegionBox, 
+                        rx1, ry1, rx2, ry2: gint)
+proc gdkregion_ADDRECTNOX*(reg: PGdkRegion, r: PGdkRegionBox, 
+                           rx1, ry1, rx2, ry2: gint)
+proc gdkregion_EMPTY_REGION*(pReg: PGdkRegion): bool
+proc gdkregion_REGION_NOT_EMPTY*(pReg: PGdkRegion): bool
+proc gdkregion_INBOX*(r: TGdkRegionBox, x, y: gint): bool
+proc GDK_TYPE_DRAWABLE*(): GType
+proc GDK_DRAWABLE*(anObject: Pointer): PGdkDrawable
+proc GDK_DRAWABLE_CLASS*(klass: Pointer): PGdkDrawableClass
+proc GDK_IS_DRAWABLE*(anObject: Pointer): bool
+proc GDK_IS_DRAWABLE_CLASS*(klass: Pointer): bool
+proc GDK_DRAWABLE_GET_CLASS*(obj: Pointer): PGdkDrawableClass
+proc gdk_drawable_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_drawable_get_type".}
+proc gdk_drawable_get_size*(drawable: PGdkDrawable, width: Pgint, height: Pgint){.
+    cdecl, dynlib: gdklib, importc: "gdk_drawable_get_size".}
+proc gdk_drawable_set_colormap*(drawable: PGdkDrawable, colormap: PGdkColormap){.
+    cdecl, dynlib: gdklib, importc: "gdk_drawable_set_colormap".}
+proc gdk_drawable_get_colormap*(drawable: PGdkDrawable): PGdkColormap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_colormap".}
+proc gdk_drawable_get_visual*(drawable: PGdkDrawable): PGdkVisual{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_visual".}
+proc gdk_drawable_get_depth*(drawable: PGdkDrawable): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_depth".}
+proc gdk_drawable_get_screen*(drawable: PGdkDrawable): PGdkScreen{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_screen".}
+proc gdk_drawable_get_display*(drawable: PGdkDrawable): PGdkDisplay{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_display".}
+proc gdk_draw_point*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, y: gint){.
+    cdecl, dynlib: gdklib, importc: "gdk_draw_point".}
+proc gdk_draw_line*(drawable: PGdkDrawable, gc: PGdkGC, x1: gint, y1: gint, 
+                    x2: gint, y2: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_line".}
+proc gdk_draw_rectangle*(drawable: PGdkDrawable, gc: PGdkGC, filled: gint, 
+                         x: gint, y: gint, width: gint, height: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_draw_rectangle".}
+proc gdk_draw_arc*(drawable: PGdkDrawable, gc: PGdkGC, filled: gint, x: gint, 
+                   y: gint, width: gint, height: gint, angle1: gint, 
+                   angle2: gint){.cdecl, dynlib: gdklib, importc: "gdk_draw_arc".}
+proc gdk_draw_polygon*(drawable: PGdkDrawable, gc: PGdkGC, filled: gint, 
+                       points: PGdkPoint, npoints: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_polygon".}
+proc gdk_draw_drawable*(drawable: PGdkDrawable, gc: PGdkGC, src: PGdkDrawable, 
+                        xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                        width: gint, height: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_drawable".}
+proc gdk_draw_image*(drawable: PGdkDrawable, gc: PGdkGC, image: PGdkImage, 
+                     xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                     width: gint, height: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_image".}
+proc gdk_draw_points*(drawable: PGdkDrawable, gc: PGdkGC, points: PGdkPoint, 
+                      npoints: gint){.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_draw_points".}
+proc gdk_draw_segments*(drawable: PGdkDrawable, gc: PGdkGC, segs: PGdkSegment, 
+                        nsegs: gint){.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_draw_segments".}
+proc gdk_draw_lines*(drawable: PGdkDrawable, gc: PGdkGC, points: PGdkPoint, 
+                     npoints: gint){.cdecl, dynlib: gdklib, 
+                                     importc: "gdk_draw_lines".}
+proc gdk_draw_glyphs*(drawable: PGdkDrawable, gc: PGdkGC, font: PPangoFont, 
+                      x: gint, y: gint, glyphs: PPangoGlyphString){.cdecl, 
+    dynlib: gdklib, importc: "gdk_draw_glyphs".}
+proc gdk_draw_layout_line*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, y: gint, 
+                           line: PPangoLayoutLine){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_layout_line".}
+proc gdk_draw_layout*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, y: gint, 
+                      layout: PPangoLayout){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_layout".}
+proc gdk_draw_layout_line_with_colors*(drawable: PGdkDrawable, gc: PGdkGC, 
+                                       x: gint, y: gint, line: PPangoLayoutLine, 
+                                       foreground: PGdkColor, 
+                                       background: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_draw_layout_line_with_colors".}
+proc gdk_draw_layout_with_colors*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, 
+                                  y: gint, layout: PPangoLayout, 
+                                  foreground: PGdkColor, background: PGdkColor){.
+    cdecl, dynlib: gdklib, importc: "gdk_draw_layout_with_colors".}
+proc gdk_drawable_get_image*(drawable: PGdkDrawable, x: gint, y: gint, 
+                             width: gint, height: gint): PGdkImage{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_image".}
+proc gdk_drawable_get_clip_region*(drawable: PGdkDrawable): PGdkRegion{.cdecl, 
+    dynlib: gdklib, importc: "gdk_drawable_get_clip_region".}
+proc gdk_drawable_get_visible_region*(drawable: PGdkDrawable): PGdkRegion{.
+    cdecl, dynlib: gdklib, importc: "gdk_drawable_get_visible_region".}
+const 
+  GDK_NOTHING* = - (1)
+  GDK_DELETE* = 0
+  GDK_DESTROY* = 1
+  GDK_EXPOSE* = 2
+  GDK_MOTION_NOTIFY* = 3
+  GDK_BUTTON_PRESS* = 4
+  GDK_2BUTTON_PRESS* = 5
+  GDK_3BUTTON_PRESS* = 6
+  GDK_BUTTON_RELEASE* = 7
+  GDK_KEY_PRESS* = 8
+  GDK_KEY_RELEASE* = 9
+  GDK_ENTER_NOTIFY* = 10
+  GDK_LEAVE_NOTIFY* = 11
+  GDK_FOCUS_CHANGE* = 12
+  GDK_CONFIGURE* = 13
+  GDK_MAP* = 14
+  GDK_UNMAP* = 15
+  GDK_PROPERTY_NOTIFY* = 16
+  GDK_SELECTION_CLEAR* = 17
+  GDK_SELECTION_REQUEST* = 18
+  GDK_SELECTION_NOTIFY* = 19
+  GDK_PROXIMITY_IN* = 20
+  GDK_PROXIMITY_OUT* = 21
+  GDK_DRAG_ENTER* = 22
+  GDK_DRAG_LEAVE* = 23
+  GDK_DRAG_MOTION_EVENT* = 24
+  GDK_DRAG_STATUS_EVENT* = 25
+  GDK_DROP_START* = 26
+  GDK_DROP_FINISHED* = 27
+  GDK_CLIENT_EVENT* = 28
+  GDK_VISIBILITY_NOTIFY* = 29
+  GDK_NO_EXPOSE* = 30
+  GDK_SCROLL* = 31
+  GDK_WINDOW_STATE* = 32
+  GDK_SETTING* = 33
+  GDK_NOTIFY_ANCESTOR* = 0
+  GDK_NOTIFY_VIRTUAL* = 1
+  GDK_NOTIFY_INFERIOR* = 2
+  GDK_NOTIFY_NONLINEAR* = 3
+  GDK_NOTIFY_NONLINEAR_VIRTUAL* = 4
+  GDK_NOTIFY_UNKNOWN* = 5
+
+proc GDK_TYPE_EVENT*(): GType
+const 
+  G_PRIORITY_DEFAULT* = 0
+  GDK_PRIORITY_EVENTS* = G_PRIORITY_DEFAULT
+    #GDK_PRIORITY_REDRAW* = G_PRIORITY_HIGH_IDLE + 20
+  GDK_EXPOSURE_MASK* = 1 shl 1
+  GDK_POINTER_MOTION_MASK* = 1 shl 2
+  GDK_POINTER_MOTION_HINT_MASK* = 1 shl 3
+  GDK_BUTTON_MOTION_MASK* = 1 shl 4
+  GDK_BUTTON1_MOTION_MASK* = 1 shl 5
+  GDK_BUTTON2_MOTION_MASK* = 1 shl 6
+  GDK_BUTTON3_MOTION_MASK* = 1 shl 7
+  GDK_BUTTON_PRESS_MASK* = 1 shl 8
+  GDK_BUTTON_RELEASE_MASK* = 1 shl 9
+  GDK_KEY_PRESS_MASK* = 1 shl 10
+  GDK_KEY_RELEASE_MASK* = 1 shl 11
+  GDK_ENTER_NOTIFY_MASK* = 1 shl 12
+  GDK_LEAVE_NOTIFY_MASK* = 1 shl 13
+  GDK_FOCUS_CHANGE_MASK* = 1 shl 14
+  GDK_STRUCTURE_MASK* = 1 shl 15
+  GDK_PROPERTY_CHANGE_MASK* = 1 shl 16
+  GDK_VISIBILITY_NOTIFY_MASK* = 1 shl 17
+  GDK_PROXIMITY_IN_MASK* = 1 shl 18
+  GDK_PROXIMITY_OUT_MASK* = 1 shl 19
+  GDK_SUBSTRUCTURE_MASK* = 1 shl 20
+  GDK_SCROLL_MASK* = 1 shl 21
+  GDK_ALL_EVENTS_MASK* = 0x003FFFFE
+  GDK_WINDOW_STATE_WITHDRAWN* = 1 shl 0
+  GDK_WINDOW_STATE_ICONIFIED* = 1 shl 1
+  GDK_WINDOW_STATE_MAXIMIZED* = 1 shl 2
+  GDK_WINDOW_STATE_STICKY* = 1 shl 3
+
+proc gdk_event_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                   importc: "gdk_event_get_type".}
+proc gdk_events_pending*(): gboolean{.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_events_pending".}
+proc gdk_event_get*(): PGdkEvent{.cdecl, dynlib: gdklib, 
+                                  importc: "gdk_event_get".}
+proc gdk_event_peek*(): PGdkEvent{.cdecl, dynlib: gdklib, 
+                                   importc: "gdk_event_peek".}
+proc gdk_event_get_graphics_expose*(window: PGdkWindow): PGdkEvent{.cdecl, 
+    dynlib: gdklib, importc: "gdk_event_get_graphics_expose".}
+proc gdk_event_put*(event: PGdkEvent){.cdecl, dynlib: gdklib, 
+                                       importc: "gdk_event_put".}
+proc gdk_event_copy*(event: PGdkEvent): PGdkEvent{.cdecl, dynlib: gdklib, 
+    importc: "gdk_event_copy".}
+proc gdk_event_free*(event: PGdkEvent){.cdecl, dynlib: gdklib, 
+                                        importc: "gdk_event_free".}
+proc gdk_event_get_time*(event: PGdkEvent): guint32{.cdecl, dynlib: gdklib, 
+    importc: "gdk_event_get_time".}
+proc gdk_event_get_state*(event: PGdkEvent, state: PGdkModifierType): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_event_get_state".}
+proc gdk_event_get_coords*(event: PGdkEvent, x_win: Pgdouble, y_win: Pgdouble): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_event_get_coords".}
+proc gdk_event_get_root_coords*(event: PGdkEvent, x_root: Pgdouble, 
+                                y_root: Pgdouble): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_event_get_root_coords".}
+proc gdk_event_get_axis*(event: PGdkEvent, axis_use: TGdkAxisUse, 
+                         value: Pgdouble): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_event_get_axis".}
+proc gdk_event_handler_set*(func: TGdkEventFunc, data: gpointer, 
+                            notify: TGDestroyNotify){.cdecl, dynlib: gdklib, 
+    importc: "gdk_event_handler_set".}
+proc gdk_set_show_events*(show_events: gboolean){.cdecl, dynlib: gdklib, 
+    importc: "gdk_set_show_events".}
+proc gdk_get_show_events*(): gboolean{.cdecl, dynlib: gdklib, 
+                                       importc: "gdk_get_show_events".}
+proc GDK_TYPE_FONT*(): GType
+proc gdk_font_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                  importc: "gdk_font_get_type".}
+proc gdk_font_load_for_display*(display: PGdkDisplay, font_name: cstring): PGdkFont{.
+    cdecl, dynlib: gdklib, importc: "gdk_font_load_for_display".}
+proc gdk_fontset_load_for_display*(display: PGdkDisplay, fontset_name: cstring): PGdkFont{.
+    cdecl, dynlib: gdklib, importc: "gdk_fontset_load_for_display".}
+proc gdk_font_from_description_for_display*(display: PGdkDisplay, 
+    font_desc: PPangoFontDescription): PGdkFont{.cdecl, dynlib: gdklib, 
+    importc: "gdk_font_from_description_for_display".}
+proc gdk_font_ref*(font: PGdkFont): PGdkFont{.cdecl, dynlib: gdklib, 
+    importc: "gdk_font_ref".}
+proc gdk_font_unref*(font: PGdkFont){.cdecl, dynlib: gdklib, 
+                                      importc: "gdk_font_unref".}
+proc gdk_font_id*(font: PGdkFont): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_font_id".}
+proc gdk_font_equal*(fonta: PGdkFont, fontb: PGdkFont): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_font_equal".}
+proc gdk_string_width*(font: PGdkFont, `string`: cstring): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_string_width".}
+proc gdk_text_width*(font: PGdkFont, text: cstring, text_length: gint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_text_width".}
+proc gdk_text_width_wc*(font: PGdkFont, text: PGdkWChar, text_length: gint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_text_width_wc".}
+proc gdk_char_width*(font: PGdkFont, character: gchar): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_char_width".}
+proc gdk_char_width_wc*(font: PGdkFont, character: TGdkWChar): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_char_width_wc".}
+proc gdk_string_measure*(font: PGdkFont, `string`: cstring): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_string_measure".}
+proc gdk_text_measure*(font: PGdkFont, text: cstring, text_length: gint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_text_measure".}
+proc gdk_char_measure*(font: PGdkFont, character: gchar): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_char_measure".}
+proc gdk_string_height*(font: PGdkFont, `string`: cstring): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_string_height".}
+proc gdk_text_height*(font: PGdkFont, text: cstring, text_length: gint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_text_height".}
+proc gdk_char_height*(font: PGdkFont, character: gchar): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_char_height".}
+proc gdk_text_extents*(font: PGdkFont, text: cstring, text_length: gint, 
+                       lbearing: Pgint, rbearing: Pgint, width: Pgint, 
+                       ascent: Pgint, descent: Pgint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_text_extents".}
+proc gdk_text_extents_wc*(font: PGdkFont, text: PGdkWChar, text_length: gint, 
+                          lbearing: Pgint, rbearing: Pgint, width: Pgint, 
+                          ascent: Pgint, descent: Pgint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_text_extents_wc".}
+proc gdk_string_extents*(font: PGdkFont, `string`: cstring, lbearing: Pgint, 
+                         rbearing: Pgint, width: Pgint, ascent: Pgint, 
+                         descent: Pgint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_string_extents".}
+proc gdk_font_get_display*(font: PGdkFont): PGdkDisplay{.cdecl, dynlib: gdklib, 
+    importc: "gdk_font_get_display".}
+const 
+  GDK_GC_FOREGROUND* = 1 shl 0
+  GDK_GC_BACKGROUND* = 1 shl 1
+  GDK_GC_FONT* = 1 shl 2
+  GDK_GC_FUNCTION* = 1 shl 3
+  GDK_GC_FILL* = 1 shl 4
+  GDK_GC_TILE* = 1 shl 5
+  GDK_GC_STIPPLE* = 1 shl 6
+  GDK_GC_CLIP_MASK* = 1 shl 7
+  GDK_GC_SUBWINDOW* = 1 shl 8
+  GDK_GC_TS_X_ORIGIN* = 1 shl 9
+  GDK_GC_TS_Y_ORIGIN* = 1 shl 10
+  GDK_GC_CLIP_X_ORIGIN* = 1 shl 11
+  GDK_GC_CLIP_Y_ORIGIN* = 1 shl 12
+  GDK_GC_EXPOSURES* = 1 shl 13
+  GDK_GC_LINE_WIDTH* = 1 shl 14
+  GDK_GC_LINE_STYLE* = 1 shl 15
+  GDK_GC_CAP_STYLE* = 1 shl 16
+  GDK_GC_JOIN_STYLE* = 1 shl 17
+  GDK_CLIP_BY_CHILDREN* = 0
+  GDK_INCLUDE_INFERIORS* = 1
+
+proc GDK_TYPE_GC*(): GType
+proc GDK_GC*(anObject: Pointer): PGdkGC
+proc GDK_GC_CLASS*(klass: Pointer): PGdkGCClass
+proc GDK_IS_GC*(anObject: Pointer): bool
+proc GDK_IS_GC_CLASS*(klass: Pointer): bool
+proc GDK_GC_GET_CLASS*(obj: Pointer): PGdkGCClass
+proc gdk_gc_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                importc: "gdk_gc_get_type".}
+proc gdk_gc_new*(drawable: PGdkDrawable): PGdkGC{.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_new".}
+proc gdk_gc_new_with_values*(drawable: PGdkDrawable, values: PGdkGCValues, 
+                             values_mask: TGdkGCValuesMask): PGdkGC{.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_new_with_values".}
+proc gdk_gc_get_values*(gc: PGdkGC, values: PGdkGCValues){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_get_values".}
+proc gdk_gc_set_values*(gc: PGdkGC, values: PGdkGCValues, 
+                        values_mask: TGdkGCValuesMask){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_values".}
+proc gdk_gc_set_foreground*(gc: PGdkGC, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_foreground".}
+proc gdk_gc_set_background*(gc: PGdkGC, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_background".}
+proc gdk_gc_set_function*(gc: PGdkGC, `function`: TGdkFunction){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_function".}
+proc gdk_gc_set_fill*(gc: PGdkGC, fill: TGdkFill){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_fill".}
+proc gdk_gc_set_tile*(gc: PGdkGC, tile: PGdkPixmap){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_tile".}
+proc gdk_gc_set_stipple*(gc: PGdkGC, stipple: PGdkPixmap){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_stipple".}
+proc gdk_gc_set_ts_origin*(gc: PGdkGC, x: gint, y: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_ts_origin".}
+proc gdk_gc_set_clip_origin*(gc: PGdkGC, x: gint, y: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_clip_origin".}
+proc gdk_gc_set_clip_mask*(gc: PGdkGC, mask: PGdkBitmap){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_clip_mask".}
+proc gdk_gc_set_clip_rectangle*(gc: PGdkGC, rectangle: PGdkRectangle){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_clip_rectangle".}
+proc gdk_gc_set_clip_region*(gc: PGdkGC, region: PGdkRegion){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_clip_region".}
+proc gdk_gc_set_subwindow*(gc: PGdkGC, mode: TGdkSubwindowMode){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_subwindow".}
+proc gdk_gc_set_exposures*(gc: PGdkGC, exposures: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_exposures".}
+proc gdk_gc_set_line_attributes*(gc: PGdkGC, line_width: gint, 
+                                 line_style: TGdkLineStyle, 
+                                 cap_style: TGdkCapStyle, 
+                                 join_style: TGdkJoinStyle){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_line_attributes".}
+proc gdk_gc_set_dashes*(gc: PGdkGC, dash_offset: gint, 
+                        dash_list: openarray[gint8]){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_set_dashes".}
+proc gdk_gc_offset*(gc: PGdkGC, x_offset: gint, y_offset: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_offset".}
+proc gdk_gc_copy*(dst_gc: PGdkGC, src_gc: PGdkGC){.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_copy".}
+proc gdk_gc_set_colormap*(gc: PGdkGC, colormap: PGdkColormap){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_colormap".}
+proc gdk_gc_get_colormap*(gc: PGdkGC): PGdkColormap{.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_get_colormap".}
+proc gdk_gc_set_rgb_fg_color*(gc: PGdkGC, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_rgb_fg_color".}
+proc gdk_gc_set_rgb_bg_color*(gc: PGdkGC, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_gc_set_rgb_bg_color".}
+proc gdk_gc_get_screen*(gc: PGdkGC): PGdkScreen{.cdecl, dynlib: gdklib, 
+    importc: "gdk_gc_get_screen".}
+proc GDK_TYPE_IMAGE*(): GType
+proc GDK_IMAGE*(anObject: Pointer): PGdkImage
+proc GDK_IMAGE_CLASS*(klass: Pointer): PGdkImageClass
+proc GDK_IS_IMAGE*(anObject: Pointer): bool
+proc GDK_IS_IMAGE_CLASS*(klass: Pointer): bool
+proc GDK_IMAGE_GET_CLASS*(obj: Pointer): PGdkImageClass
+proc gdk_image_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                   importc: "gdk_image_get_type".}
+proc gdk_image_new*(`type`: TGdkImageType, visual: PGdkVisual, width: gint, 
+                    height: gint): PGdkImage{.cdecl, dynlib: gdklib, 
+    importc: "gdk_image_new".}
+proc gdk_image_put_pixel*(image: PGdkImage, x: gint, y: gint, pixel: guint32){.
+    cdecl, dynlib: gdklib, importc: "gdk_image_put_pixel".}
+proc gdk_image_get_pixel*(image: PGdkImage, x: gint, y: gint): guint32{.cdecl, 
+    dynlib: gdklib, importc: "gdk_image_get_pixel".}
+proc gdk_image_set_colormap*(image: PGdkImage, colormap: PGdkColormap){.cdecl, 
+    dynlib: gdklib, importc: "gdk_image_set_colormap".}
+proc gdk_image_get_colormap*(image: PGdkImage): PGdkColormap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_image_get_colormap".}
+const 
+  GDK_AXIS_IGNORE* = 0
+  GDK_AXIS_X* = 1
+  GDK_AXIS_Y* = 2
+  GDK_AXIS_PRESSURE* = 3
+  GDK_AXIS_XTILT* = 4
+  GDK_AXIS_YTILT* = 5
+  GDK_AXIS_WHEEL* = 6
+  GDK_AXIS_LAST* = 7
+
+proc GDK_TYPE_DEVICE*(): GType
+proc GDK_DEVICE*(anObject: Pointer): PGdkDevice
+proc GDK_DEVICE_CLASS*(klass: Pointer): PGdkDeviceClass
+proc GDK_IS_DEVICE*(anObject: Pointer): bool
+proc GDK_IS_DEVICE_CLASS*(klass: Pointer): bool
+proc GDK_DEVICE_GET_CLASS*(obj: Pointer): PGdkDeviceClass
+proc gdk_device_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_device_get_type".}
+proc gdk_device_set_source*(device: PGdkDevice, source: TGdkInputSource){.cdecl, 
+    dynlib: gdklib, importc: "gdk_device_set_source".}
+proc gdk_device_set_mode*(device: PGdkDevice, mode: TGdkInputMode): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_device_set_mode".}
+proc gdk_device_set_key*(device: PGdkDevice, index: guint, keyval: guint, 
+                         modifiers: TGdkModifierType){.cdecl, dynlib: gdklib, 
+    importc: "gdk_device_set_key".}
+proc gdk_device_set_axis_use*(device: PGdkDevice, index: guint, use: TGdkAxisUse){.
+    cdecl, dynlib: gdklib, importc: "gdk_device_set_axis_use".}
+proc gdk_device_get_state*(device: PGdkDevice, window: PGdkWindow, 
+                           axes: Pgdouble, mask: PGdkModifierType){.cdecl, 
+    dynlib: gdklib, importc: "gdk_device_get_state".}
+proc gdk_device_get_history*(device: PGdkDevice, window: PGdkWindow, 
+                             start: guint32, stop: guint32, 
+                             s: var PPGdkTimeCoord, n_events: Pgint): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_device_get_history".}
+proc gdk_device_free_history*(events: PPGdkTimeCoord, n_events: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_device_free_history".}
+proc gdk_device_get_axis*(device: PGdkDevice, axes: Pgdouble, use: TGdkAxisUse, 
+                          value: Pgdouble): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_device_get_axis".}
+proc gdk_input_set_extension_events*(window: PGdkWindow, mask: gint, 
+                                     mode: TGdkExtensionMode){.cdecl, 
+    dynlib: gdklib, importc: "gdk_input_set_extension_events".}
+proc gdk_device_get_core_pointer*(): PGdkDevice{.cdecl, dynlib: gdklib, 
+    importc: "gdk_device_get_core_pointer".}
+proc GDK_TYPE_KEYMAP*(): GType
+proc GDK_KEYMAP*(anObject: Pointer): PGdkKeymap
+proc GDK_KEYMAP_CLASS*(klass: Pointer): PGdkKeymapClass
+proc GDK_IS_KEYMAP*(anObject: Pointer): bool
+proc GDK_IS_KEYMAP_CLASS*(klass: Pointer): bool
+proc GDK_KEYMAP_GET_CLASS*(obj: Pointer): PGdkKeymapClass
+proc gdk_keymap_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_keymap_get_type".}
+proc gdk_keymap_get_for_display*(display: PGdkDisplay): PGdkKeymap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_keymap_get_for_display".}
+proc gdk_keymap_lookup_key*(keymap: PGdkKeymap, key: PGdkKeymapKey): guint{.
+    cdecl, dynlib: gdklib, importc: "gdk_keymap_lookup_key".}
+proc gdk_keymap_translate_keyboard_state*(keymap: PGdkKeymap, 
+    hardware_keycode: guint, state: TGdkModifierType, group: gint, 
+    keyval: Pguint, effective_group: Pgint, level: Pgint, 
+    consumed_modifiers: PGdkModifierType): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keymap_translate_keyboard_state".}
+proc gdk_keymap_get_entries_for_keyval*(keymap: PGdkKeymap, keyval: guint, 
+                                        s: var PGdkKeymapKey, n_keys: Pgint): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_keymap_get_entries_for_keyval".}
+proc gdk_keymap_get_entries_for_keycode*(keymap: PGdkKeymap, 
+    hardware_keycode: guint, s: var PGdkKeymapKey, sasdf: var Pguint, 
+    n_entries: Pgint): gboolean{.cdecl, dynlib: gdklib, 
+                                 importc: "gdk_keymap_get_entries_for_keycode".}
+proc gdk_keymap_get_direction*(keymap: PGdkKeymap): TPangoDirection{.cdecl, 
+    dynlib: gdklib, importc: "gdk_keymap_get_direction".}
+proc gdk_keyval_name*(keyval: guint): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_name".}
+proc gdk_keyval_from_name*(keyval_name: cstring): guint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_from_name".}
+proc gdk_keyval_convert_case*(symbol: guint, lower: Pguint, upper: Pguint){.
+    cdecl, dynlib: gdklib, importc: "gdk_keyval_convert_case".}
+proc gdk_keyval_to_upper*(keyval: guint): guint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_to_upper".}
+proc gdk_keyval_to_lower*(keyval: guint): guint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_to_lower".}
+proc gdk_keyval_is_upper*(keyval: guint): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_is_upper".}
+proc gdk_keyval_is_lower*(keyval: guint): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_is_lower".}
+proc gdk_keyval_to_unicode*(keyval: guint): guint32{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyval_to_unicode".}
+proc gdk_unicode_to_keyval*(wc: guint32): guint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_unicode_to_keyval".}
+const 
+  GDK_KEY_VoidSymbol* = 0x00FFFFFF
+  GDK_KEY_BackSpace* = 0x0000FF08
+  GDK_KEY_Tab* = 0x0000FF09
+  GDK_KEY_Linefeed* = 0x0000FF0A
+  GDK_KEY_Clear* = 0x0000FF0B
+  GDK_KEY_Return* = 0x0000FF0D
+  GDK_KEY_Pause* = 0x0000FF13
+  GDK_KEY_Scroll_Lock* = 0x0000FF14
+  GDK_KEY_Sys_Req* = 0x0000FF15
+  GDK_KEY_Escape* = 0x0000FF1B
+  GDK_KEY_Delete* = 0x0000FFFF
+  GDK_KEY_Multi_key* = 0x0000FF20
+  GDK_KEY_Codeinput* = 0x0000FF37
+  GDK_KEY_SingleCandidate* = 0x0000FF3C
+  GDK_KEY_MultipleCandidate* = 0x0000FF3D
+  GDK_KEY_PreviousCandidate* = 0x0000FF3E
+  GDK_KEY_Kanji* = 0x0000FF21
+  GDK_KEY_Muhenkan* = 0x0000FF22
+  GDK_KEY_Henkan_Mode* = 0x0000FF23
+  GDK_KEY_Henkan* = 0x0000FF23
+  GDK_KEY_Romaji* = 0x0000FF24
+  GDK_KEY_Hiragana* = 0x0000FF25
+  GDK_KEY_Katakana* = 0x0000FF26
+  GDK_KEY_Hiragana_Katakana* = 0x0000FF27
+  GDK_KEY_Zenkaku* = 0x0000FF28
+  GDK_KEY_Hankaku* = 0x0000FF29
+  GDK_KEY_Zenkaku_Hankaku* = 0x0000FF2A
+  GDK_KEY_Touroku* = 0x0000FF2B
+  GDK_KEY_Massyo* = 0x0000FF2C
+  GDK_KEY_Kana_Lock* = 0x0000FF2D
+  GDK_KEY_Kana_Shift* = 0x0000FF2E
+  GDK_KEY_Eisu_Shift* = 0x0000FF2F
+  GDK_KEY_Eisu_toggle* = 0x0000FF30
+  GDK_KEY_Kanji_Bangou* = 0x0000FF37
+  GDK_KEY_Zen_Koho* = 0x0000FF3D
+  GDK_KEY_Mae_Koho* = 0x0000FF3E
+  GDK_KEY_Home* = 0x0000FF50
+  GDK_KEY_Left* = 0x0000FF51
+  GDK_KEY_Up* = 0x0000FF52
+  GDK_KEY_Right* = 0x0000FF53
+  GDK_KEY_Down* = 0x0000FF54
+  GDK_KEY_Prior* = 0x0000FF55
+  GDK_KEY_Page_Up* = 0x0000FF55
+  GDK_KEY_Next* = 0x0000FF56
+  GDK_KEY_Page_Down* = 0x0000FF56
+  GDK_KEY_End* = 0x0000FF57
+  GDK_KEY_Begin* = 0x0000FF58
+  GDK_KEY_Select* = 0x0000FF60
+  GDK_KEY_Print* = 0x0000FF61
+  GDK_KEY_Execute* = 0x0000FF62
+  GDK_KEY_Insert* = 0x0000FF63
+  GDK_KEY_Undo* = 0x0000FF65
+  GDK_KEY_Redo* = 0x0000FF66
+  GDK_KEY_Menu* = 0x0000FF67
+  GDK_KEY_Find* = 0x0000FF68
+  GDK_KEY_Cancel* = 0x0000FF69
+  GDK_KEY_Help* = 0x0000FF6A
+  GDK_KEY_Break* = 0x0000FF6B
+  GDK_KEY_Mode_switch* = 0x0000FF7E
+  GDK_KEY_script_switch* = 0x0000FF7E
+  GDK_KEY_Num_Lock* = 0x0000FF7F
+  GDK_KEY_KP_Space* = 0x0000FF80
+  GDK_KEY_KP_Tab* = 0x0000FF89
+  GDK_KEY_KP_Enter* = 0x0000FF8D
+  GDK_KEY_KP_F1* = 0x0000FF91
+  GDK_KEY_KP_F2* = 0x0000FF92
+  GDK_KEY_KP_F3* = 0x0000FF93
+  GDK_KEY_KP_F4* = 0x0000FF94
+  GDK_KEY_KP_Home* = 0x0000FF95
+  GDK_KEY_KP_Left* = 0x0000FF96
+  GDK_KEY_KP_Up* = 0x0000FF97
+  GDK_KEY_KP_Right* = 0x0000FF98
+  GDK_KEY_KP_Down* = 0x0000FF99
+  GDK_KEY_KP_Prior* = 0x0000FF9A
+  GDK_KEY_KP_Page_Up* = 0x0000FF9A
+  GDK_KEY_KP_Next* = 0x0000FF9B
+  GDK_KEY_KP_Page_Down* = 0x0000FF9B
+  GDK_KEY_KP_End* = 0x0000FF9C
+  GDK_KEY_KP_Begin* = 0x0000FF9D
+  GDK_KEY_KP_Insert* = 0x0000FF9E
+  GDK_KEY_KP_Delete* = 0x0000FF9F
+  GDK_KEY_KP_Equal* = 0x0000FFBD
+  GDK_KEY_KP_Multiply* = 0x0000FFAA
+  GDK_KEY_KP_Add* = 0x0000FFAB
+  GDK_KEY_KP_Separator* = 0x0000FFAC
+  GDK_KEY_KP_Subtract* = 0x0000FFAD
+  GDK_KEY_KP_Decimal* = 0x0000FFAE
+  GDK_KEY_KP_Divide* = 0x0000FFAF
+  GDK_KEY_KP_0* = 0x0000FFB0
+  GDK_KEY_KP_1* = 0x0000FFB1
+  GDK_KEY_KP_2* = 0x0000FFB2
+  GDK_KEY_KP_3* = 0x0000FFB3
+  GDK_KEY_KP_4* = 0x0000FFB4
+  GDK_KEY_KP_5* = 0x0000FFB5
+  GDK_KEY_KP_6* = 0x0000FFB6
+  GDK_KEY_KP_7* = 0x0000FFB7
+  GDK_KEY_KP_8* = 0x0000FFB8
+  GDK_KEY_KP_9* = 0x0000FFB9
+  GDK_KEY_F1* = 0x0000FFBE
+  GDK_KEY_F2* = 0x0000FFBF
+  GDK_KEY_F3* = 0x0000FFC0
+  GDK_KEY_F4* = 0x0000FFC1
+  GDK_KEY_F5* = 0x0000FFC2
+  GDK_KEY_F6* = 0x0000FFC3
+  GDK_KEY_F7* = 0x0000FFC4
+  GDK_KEY_F8* = 0x0000FFC5
+  GDK_KEY_F9* = 0x0000FFC6
+  GDK_KEY_F10* = 0x0000FFC7
+  GDK_KEY_F11* = 0x0000FFC8
+  GDK_KEY_L1* = 0x0000FFC8
+  GDK_KEY_F12* = 0x0000FFC9
+  GDK_KEY_L2* = 0x0000FFC9
+  GDK_KEY_F13* = 0x0000FFCA
+  GDK_KEY_L3* = 0x0000FFCA
+  GDK_KEY_F14* = 0x0000FFCB
+  GDK_KEY_L4* = 0x0000FFCB
+  GDK_KEY_F15* = 0x0000FFCC
+  GDK_KEY_L5* = 0x0000FFCC
+  GDK_KEY_F16* = 0x0000FFCD
+  GDK_KEY_L6* = 0x0000FFCD
+  GDK_KEY_F17* = 0x0000FFCE
+  GDK_KEY_L7* = 0x0000FFCE
+  GDK_KEY_F18* = 0x0000FFCF
+  GDK_KEY_L8* = 0x0000FFCF
+  GDK_KEY_F19* = 0x0000FFD0
+  GDK_KEY_L9* = 0x0000FFD0
+  GDK_KEY_F20* = 0x0000FFD1
+  GDK_KEY_L10* = 0x0000FFD1
+  GDK_KEY_F21* = 0x0000FFD2
+  GDK_KEY_R1* = 0x0000FFD2
+  GDK_KEY_F22* = 0x0000FFD3
+  GDK_KEY_R2* = 0x0000FFD3
+  GDK_KEY_F23* = 0x0000FFD4
+  GDK_KEY_R3* = 0x0000FFD4
+  GDK_KEY_F24* = 0x0000FFD5
+  GDK_KEY_R4* = 0x0000FFD5
+  GDK_KEY_F25* = 0x0000FFD6
+  GDK_KEY_R5* = 0x0000FFD6
+  GDK_KEY_F26* = 0x0000FFD7
+  GDK_KEY_R6* = 0x0000FFD7
+  GDK_KEY_F27* = 0x0000FFD8
+  GDK_KEY_R7* = 0x0000FFD8
+  GDK_KEY_F28* = 0x0000FFD9
+  GDK_KEY_R8* = 0x0000FFD9
+  GDK_KEY_F29* = 0x0000FFDA
+  GDK_KEY_R9* = 0x0000FFDA
+  GDK_KEY_F30* = 0x0000FFDB
+  GDK_KEY_R10* = 0x0000FFDB
+  GDK_KEY_F31* = 0x0000FFDC
+  GDK_KEY_R11* = 0x0000FFDC
+  GDK_KEY_F32* = 0x0000FFDD
+  GDK_KEY_R12* = 0x0000FFDD
+  GDK_KEY_F33* = 0x0000FFDE
+  GDK_KEY_R13* = 0x0000FFDE
+  GDK_KEY_F34* = 0x0000FFDF
+  GDK_KEY_R14* = 0x0000FFDF
+  GDK_KEY_F35* = 0x0000FFE0
+  GDK_KEY_R15* = 0x0000FFE0
+  GDK_KEY_Shift_L* = 0x0000FFE1
+  GDK_KEY_Shift_R* = 0x0000FFE2
+  GDK_KEY_Control_L* = 0x0000FFE3
+  GDK_KEY_Control_R* = 0x0000FFE4
+  GDK_KEY_Caps_Lock* = 0x0000FFE5
+  GDK_KEY_Shift_Lock* = 0x0000FFE6
+  GDK_KEY_Meta_L* = 0x0000FFE7
+  GDK_KEY_Meta_R* = 0x0000FFE8
+  GDK_KEY_Alt_L* = 0x0000FFE9
+  GDK_KEY_Alt_R* = 0x0000FFEA
+  GDK_KEY_Super_L* = 0x0000FFEB
+  GDK_KEY_Super_R* = 0x0000FFEC
+  GDK_KEY_Hyper_L* = 0x0000FFED
+  GDK_KEY_Hyper_R* = 0x0000FFEE
+  GDK_KEY_ISO_Lock* = 0x0000FE01
+  GDK_KEY_ISO_Level2_Latch* = 0x0000FE02
+  GDK_KEY_ISO_Level3_Shift* = 0x0000FE03
+  GDK_KEY_ISO_Level3_Latch* = 0x0000FE04
+  GDK_KEY_ISO_Level3_Lock* = 0x0000FE05
+  GDK_KEY_ISO_Group_Shift* = 0x0000FF7E
+  GDK_KEY_ISO_Group_Latch* = 0x0000FE06
+  GDK_KEY_ISO_Group_Lock* = 0x0000FE07
+  GDK_KEY_ISO_Next_Group* = 0x0000FE08
+  GDK_KEY_ISO_Next_Group_Lock* = 0x0000FE09
+  GDK_KEY_ISO_Prev_Group* = 0x0000FE0A
+  GDK_KEY_ISO_Prev_Group_Lock* = 0x0000FE0B
+  GDK_KEY_ISO_First_Group* = 0x0000FE0C
+  GDK_KEY_ISO_First_Group_Lock* = 0x0000FE0D
+  GDK_KEY_ISO_Last_Group* = 0x0000FE0E
+  GDK_KEY_ISO_Last_Group_Lock* = 0x0000FE0F
+  GDK_KEY_ISO_Left_Tab* = 0x0000FE20
+  GDK_KEY_ISO_Move_Line_Up* = 0x0000FE21
+  GDK_KEY_ISO_Move_Line_Down* = 0x0000FE22
+  GDK_KEY_ISO_Partial_Line_Up* = 0x0000FE23
+  GDK_KEY_ISO_Partial_Line_Down* = 0x0000FE24
+  GDK_KEY_ISO_Partial_Space_Left* = 0x0000FE25
+  GDK_KEY_ISO_Partial_Space_Right* = 0x0000FE26
+  GDK_KEY_ISO_Set_Margin_Left* = 0x0000FE27
+  GDK_KEY_ISO_Set_Margin_Right* = 0x0000FE28
+  GDK_KEY_ISO_Release_Margin_Left* = 0x0000FE29
+  GDK_KEY_ISO_Release_Margin_Right* = 0x0000FE2A
+  GDK_KEY_ISO_Release_Both_Margins* = 0x0000FE2B
+  GDK_KEY_ISO_Fast_Cursor_Left* = 0x0000FE2C
+  GDK_KEY_ISO_Fast_Cursor_Right* = 0x0000FE2D
+  GDK_KEY_ISO_Fast_Cursor_Up* = 0x0000FE2E
+  GDK_KEY_ISO_Fast_Cursor_Down* = 0x0000FE2F
+  GDK_KEY_ISO_Continuous_Underline* = 0x0000FE30
+  GDK_KEY_ISO_Discontinuous_Underline* = 0x0000FE31
+  GDK_KEY_ISO_Emphasize* = 0x0000FE32
+  GDK_KEY_ISO_Center_Object* = 0x0000FE33
+  GDK_KEY_ISO_Enter* = 0x0000FE34
+  GDK_KEY_dead_grave* = 0x0000FE50
+  GDK_KEY_dead_acute* = 0x0000FE51
+  GDK_KEY_dead_circumflex* = 0x0000FE52
+  GDK_KEY_dead_tilde* = 0x0000FE53
+  GDK_KEY_dead_macron* = 0x0000FE54
+  GDK_KEY_dead_breve* = 0x0000FE55
+  GDK_KEY_dead_abovedot* = 0x0000FE56
+  GDK_KEY_dead_diaeresis* = 0x0000FE57
+  GDK_KEY_dead_abovering* = 0x0000FE58
+  GDK_KEY_dead_doubleacute* = 0x0000FE59
+  GDK_KEY_dead_caron* = 0x0000FE5A
+  GDK_KEY_dead_cedilla* = 0x0000FE5B
+  GDK_KEY_dead_ogonek* = 0x0000FE5C
+  GDK_KEY_dead_iota* = 0x0000FE5D
+  GDK_KEY_dead_voiced_sound* = 0x0000FE5E
+  GDK_KEY_dead_semivoiced_sound* = 0x0000FE5F
+  GDK_KEY_dead_belowdot* = 0x0000FE60
+  GDK_KEY_First_Virtual_Screen* = 0x0000FED0
+  GDK_KEY_Prev_Virtual_Screen* = 0x0000FED1
+  GDK_KEY_Next_Virtual_Screen* = 0x0000FED2
+  GDK_KEY_Last_Virtual_Screen* = 0x0000FED4
+  GDK_KEY_Terminate_Server* = 0x0000FED5
+  GDK_KEY_AccessX_Enable* = 0x0000FE70
+  GDK_KEY_AccessX_Feedback_Enable* = 0x0000FE71
+  GDK_KEY_RepeatKeys_Enable* = 0x0000FE72
+  GDK_KEY_SlowKeys_Enable* = 0x0000FE73
+  GDK_KEY_BounceKeys_Enable* = 0x0000FE74
+  GDK_KEY_StickyKeys_Enable* = 0x0000FE75
+  GDK_KEY_MouseKeys_Enable* = 0x0000FE76
+  GDK_KEY_MouseKeys_Accel_Enable* = 0x0000FE77
+  GDK_KEY_Overlay1_Enable* = 0x0000FE78
+  GDK_KEY_Overlay2_Enable* = 0x0000FE79
+  GDK_KEY_AudibleBell_Enable* = 0x0000FE7A
+  GDK_KEY_Pointer_Left* = 0x0000FEE0
+  GDK_KEY_Pointer_Right* = 0x0000FEE1
+  GDK_KEY_Pointer_Up* = 0x0000FEE2
+  GDK_KEY_Pointer_Down* = 0x0000FEE3
+  GDK_KEY_Pointer_UpLeft* = 0x0000FEE4
+  GDK_KEY_Pointer_UpRight* = 0x0000FEE5
+  GDK_KEY_Pointer_DownLeft* = 0x0000FEE6
+  GDK_KEY_Pointer_DownRight* = 0x0000FEE7
+  GDK_KEY_Pointer_Button_Dflt* = 0x0000FEE8
+  GDK_KEY_Pointer_Button1* = 0x0000FEE9
+  GDK_KEY_Pointer_Button2* = 0x0000FEEA
+  GDK_KEY_Pointer_Button3* = 0x0000FEEB
+  GDK_KEY_Pointer_Button4* = 0x0000FEEC
+  GDK_KEY_Pointer_Button5* = 0x0000FEED
+  GDK_KEY_Pointer_DblClick_Dflt* = 0x0000FEEE
+  GDK_KEY_Pointer_DblClick1* = 0x0000FEEF
+  GDK_KEY_Pointer_DblClick2* = 0x0000FEF0
+  GDK_KEY_Pointer_DblClick3* = 0x0000FEF1
+  GDK_KEY_Pointer_DblClick4* = 0x0000FEF2
+  GDK_KEY_Pointer_DblClick5* = 0x0000FEF3
+  GDK_KEY_Pointer_Drag_Dflt* = 0x0000FEF4
+  GDK_KEY_Pointer_Drag1* = 0x0000FEF5
+  GDK_KEY_Pointer_Drag2* = 0x0000FEF6
+  GDK_KEY_Pointer_Drag3* = 0x0000FEF7
+  GDK_KEY_Pointer_Drag4* = 0x0000FEF8
+  GDK_KEY_Pointer_Drag5* = 0x0000FEFD
+  GDK_KEY_Pointer_EnableKeys* = 0x0000FEF9
+  GDK_KEY_Pointer_Accelerate* = 0x0000FEFA
+  GDK_KEY_Pointer_DfltBtnNext* = 0x0000FEFB
+  GDK_KEY_Pointer_DfltBtnPrev* = 0x0000FEFC
+  GDK_KEY_3270_Duplicate* = 0x0000FD01
+  GDK_KEY_3270_FieldMark* = 0x0000FD02
+  GDK_KEY_3270_Right2* = 0x0000FD03
+  GDK_KEY_3270_Left2* = 0x0000FD04
+  GDK_KEY_3270_BackTab* = 0x0000FD05
+  GDK_KEY_3270_EraseEOF* = 0x0000FD06
+  GDK_KEY_3270_EraseInput* = 0x0000FD07
+  GDK_KEY_3270_Reset* = 0x0000FD08
+  GDK_KEY_3270_Quit* = 0x0000FD09
+  GDK_KEY_3270_PA1* = 0x0000FD0A
+  GDK_KEY_3270_PA2* = 0x0000FD0B
+  GDK_KEY_3270_PA3* = 0x0000FD0C
+  GDK_KEY_3270_Test* = 0x0000FD0D
+  GDK_KEY_3270_Attn* = 0x0000FD0E
+  GDK_KEY_3270_CursorBlink* = 0x0000FD0F
+  GDK_KEY_3270_AltCursor* = 0x0000FD10
+  GDK_KEY_3270_KeyClick* = 0x0000FD11
+  GDK_KEY_3270_Jump* = 0x0000FD12
+  GDK_KEY_3270_Ident* = 0x0000FD13
+  GDK_KEY_3270_Rule* = 0x0000FD14
+  GDK_KEY_3270_Copy* = 0x0000FD15
+  GDK_KEY_3270_Play* = 0x0000FD16
+  GDK_KEY_3270_Setup* = 0x0000FD17
+  GDK_KEY_3270_Record* = 0x0000FD18
+  GDK_KEY_3270_ChangeScreen* = 0x0000FD19
+  GDK_KEY_3270_DeleteWord* = 0x0000FD1A
+  GDK_KEY_3270_ExSelect* = 0x0000FD1B
+  GDK_KEY_3270_CursorSelect* = 0x0000FD1C
+  GDK_KEY_3270_PrintScreen* = 0x0000FD1D
+  GDK_KEY_3270_Enter* = 0x0000FD1E
+  GDK_KEY_space* = 0x00000020
+  GDK_KEY_exclam* = 0x00000021
+  GDK_KEY_quotedbl* = 0x00000022
+  GDK_KEY_numbersign* = 0x00000023
+  GDK_KEY_dollar* = 0x00000024
+  GDK_KEY_percent* = 0x00000025
+  GDK_KEY_ampersand* = 0x00000026
+  GDK_KEY_apostrophe* = 0x00000027
+  GDK_KEY_quoteright* = 0x00000027
+  GDK_KEY_parenleft* = 0x00000028
+  GDK_KEY_parenright* = 0x00000029
+  GDK_KEY_asterisk* = 0x0000002A
+  GDK_KEY_plus* = 0x0000002B
+  GDK_KEY_comma* = 0x0000002C
+  GDK_KEY_minus* = 0x0000002D
+  GDK_KEY_period* = 0x0000002E
+  GDK_KEY_slash* = 0x0000002F
+  GDK_KEY_0* = 0x00000030
+  GDK_KEY_1* = 0x00000031
+  GDK_KEY_2* = 0x00000032
+  GDK_KEY_3* = 0x00000033
+  GDK_KEY_4* = 0x00000034
+  GDK_KEY_5* = 0x00000035
+  GDK_KEY_6* = 0x00000036
+  GDK_KEY_7* = 0x00000037
+  GDK_KEY_8* = 0x00000038
+  GDK_KEY_9* = 0x00000039
+  GDK_KEY_colon* = 0x0000003A
+  GDK_KEY_semicolon* = 0x0000003B
+  GDK_KEY_less* = 0x0000003C
+  GDK_KEY_equal* = 0x0000003D
+  GDK_KEY_greater* = 0x0000003E
+  GDK_KEY_question* = 0x0000003F
+  GDK_KEY_at* = 0x00000040
+  GDK_KEY_CAPITAL_A* = 0x00000041
+  GDK_KEY_CAPITAL_B* = 0x00000042
+  GDK_KEY_CAPITAL_C* = 0x00000043
+  GDK_KEY_CAPITAL_D* = 0x00000044
+  GDK_KEY_CAPITAL_E* = 0x00000045
+  GDK_KEY_CAPITAL_F* = 0x00000046
+  GDK_KEY_CAPITAL_G* = 0x00000047
+  GDK_KEY_CAPITAL_H* = 0x00000048
+  GDK_KEY_CAPITAL_I* = 0x00000049
+  GDK_KEY_CAPITAL_J* = 0x0000004A
+  GDK_KEY_CAPITAL_K* = 0x0000004B
+  GDK_KEY_CAPITAL_L* = 0x0000004C
+  GDK_KEY_CAPITAL_M* = 0x0000004D
+  GDK_KEY_CAPITAL_N* = 0x0000004E
+  GDK_KEY_CAPITAL_O* = 0x0000004F
+  GDK_KEY_CAPITAL_P* = 0x00000050
+  GDK_KEY_CAPITAL_Q* = 0x00000051
+  GDK_KEY_CAPITAL_R* = 0x00000052
+  GDK_KEY_CAPITAL_S* = 0x00000053
+  GDK_KEY_CAPITAL_T* = 0x00000054
+  GDK_KEY_CAPITAL_U* = 0x00000055
+  GDK_KEY_CAPITAL_V* = 0x00000056
+  GDK_KEY_CAPITAL_W* = 0x00000057
+  GDK_KEY_CAPITAL_X* = 0x00000058
+  GDK_KEY_CAPITAL_Y* = 0x00000059
+  GDK_KEY_CAPITAL_Z* = 0x0000005A
+  GDK_KEY_bracketleft* = 0x0000005B
+  GDK_KEY_backslash* = 0x0000005C
+  GDK_KEY_bracketright* = 0x0000005D
+  GDK_KEY_asciicircum* = 0x0000005E
+  GDK_KEY_underscore* = 0x0000005F
+  GDK_KEY_grave* = 0x00000060
+  GDK_KEY_quoteleft* = 0x00000060
+  GDK_KEY_a* = 0x00000061
+  GDK_KEY_b* = 0x00000062
+  GDK_KEY_c* = 0x00000063
+  GDK_KEY_d* = 0x00000064
+  GDK_KEY_e* = 0x00000065
+  GDK_KEY_f* = 0x00000066
+  GDK_KEY_g* = 0x00000067
+  GDK_KEY_h* = 0x00000068
+  GDK_KEY_i* = 0x00000069
+  GDK_KEY_j* = 0x0000006A
+  GDK_KEY_k* = 0x0000006B
+  GDK_KEY_l* = 0x0000006C
+  GDK_KEY_m* = 0x0000006D
+  GDK_KEY_n* = 0x0000006E
+  GDK_KEY_o* = 0x0000006F
+  GDK_KEY_p* = 0x00000070
+  GDK_KEY_q* = 0x00000071
+  GDK_KEY_r* = 0x00000072
+  GDK_KEY_s* = 0x00000073
+  GDK_KEY_t* = 0x00000074
+  GDK_KEY_u* = 0x00000075
+  GDK_KEY_v* = 0x00000076
+  GDK_KEY_w* = 0x00000077
+  GDK_KEY_x* = 0x00000078
+  GDK_KEY_y* = 0x00000079
+  GDK_KEY_z* = 0x0000007A
+  GDK_KEY_braceleft* = 0x0000007B
+  GDK_KEY_bar* = 0x0000007C
+  GDK_KEY_braceright* = 0x0000007D
+  GDK_KEY_asciitilde* = 0x0000007E
+  GDK_KEY_nobreakspace* = 0x000000A0
+  GDK_KEY_exclamdown* = 0x000000A1
+  GDK_KEY_cent* = 0x000000A2
+  GDK_KEY_sterling* = 0x000000A3
+  GDK_KEY_currency* = 0x000000A4
+  GDK_KEY_yen* = 0x000000A5
+  GDK_KEY_brokenbar* = 0x000000A6
+  GDK_KEY_section* = 0x000000A7
+  GDK_KEY_diaeresis* = 0x000000A8
+  GDK_KEY_copyright* = 0x000000A9
+  GDK_KEY_ordfeminine* = 0x000000AA
+  GDK_KEY_guillemotleft* = 0x000000AB
+  GDK_KEY_notsign* = 0x000000AC
+  GDK_KEY_hyphen* = 0x000000AD
+  GDK_KEY_registered* = 0x000000AE
+  GDK_KEY_macron* = 0x000000AF
+  GDK_KEY_degree* = 0x000000B0
+  GDK_KEY_plusminus* = 0x000000B1
+  GDK_KEY_twosuperior* = 0x000000B2
+  GDK_KEY_threesuperior* = 0x000000B3
+  GDK_KEY_acute* = 0x000000B4
+  GDK_KEY_mu* = 0x000000B5
+  GDK_KEY_paragraph* = 0x000000B6
+  GDK_KEY_periodcentered* = 0x000000B7
+  GDK_KEY_cedilla* = 0x000000B8
+  GDK_KEY_onesuperior* = 0x000000B9
+  GDK_KEY_masculine* = 0x000000BA
+  GDK_KEY_guillemotright* = 0x000000BB
+  GDK_KEY_onequarter* = 0x000000BC
+  GDK_KEY_onehalf* = 0x000000BD
+  GDK_KEY_threequarters* = 0x000000BE
+  GDK_KEY_questiondown* = 0x000000BF
+  GDK_KEY_CAPITAL_Agrave* = 0x000000C0
+  GDK_KEY_CAPITAL_Aacute* = 0x000000C1
+  GDK_KEY_CAPITAL_Acircumflex* = 0x000000C2
+  GDK_KEY_CAPITAL_Atilde* = 0x000000C3
+  GDK_KEY_CAPITAL_Adiaeresis* = 0x000000C4
+  GDK_KEY_CAPITAL_Aring* = 0x000000C5
+  GDK_KEY_CAPITAL_AE* = 0x000000C6
+  GDK_KEY_CAPITAL_Ccedilla* = 0x000000C7
+  GDK_KEY_CAPITAL_Egrave* = 0x000000C8
+  GDK_KEY_CAPITAL_Eacute* = 0x000000C9
+  GDK_KEY_CAPITAL_Ecircumflex* = 0x000000CA
+  GDK_KEY_CAPITAL_Ediaeresis* = 0x000000CB
+  GDK_KEY_CAPITAL_Igrave* = 0x000000CC
+  GDK_KEY_CAPITAL_Iacute* = 0x000000CD
+  GDK_KEY_CAPITAL_Icircumflex* = 0x000000CE
+  GDK_KEY_CAPITAL_Idiaeresis* = 0x000000CF
+  GDK_KEY_CAPITAL_ETH* = 0x000000D0
+  GDK_KEY_CAPITAL_Ntilde* = 0x000000D1
+  GDK_KEY_CAPITAL_Ograve* = 0x000000D2
+  GDK_KEY_CAPITAL_Oacute* = 0x000000D3
+  GDK_KEY_CAPITAL_Ocircumflex* = 0x000000D4
+  GDK_KEY_CAPITAL_Otilde* = 0x000000D5
+  GDK_KEY_CAPITAL_Odiaeresis* = 0x000000D6
+  GDK_KEY_multiply* = 0x000000D7
+  GDK_KEY_Ooblique* = 0x000000D8
+  GDK_KEY_CAPITAL_Ugrave* = 0x000000D9
+  GDK_KEY_CAPITAL_Uacute* = 0x000000DA
+  GDK_KEY_CAPITAL_Ucircumflex* = 0x000000DB
+  GDK_KEY_CAPITAL_Udiaeresis* = 0x000000DC
+  GDK_KEY_CAPITAL_Yacute* = 0x000000DD
+  GDK_KEY_CAPITAL_THORN* = 0x000000DE
+  GDK_KEY_ssharp* = 0x000000DF
+  GDK_KEY_agrave* = 0x000000E0
+  GDK_KEY_aacute* = 0x000000E1
+  GDK_KEY_acircumflex* = 0x000000E2
+  GDK_KEY_atilde* = 0x000000E3
+  GDK_KEY_adiaeresis* = 0x000000E4
+  GDK_KEY_aring* = 0x000000E5
+  GDK_KEY_ae* = 0x000000E6
+  GDK_KEY_ccedilla* = 0x000000E7
+  GDK_KEY_egrave* = 0x000000E8
+  GDK_KEY_eacute* = 0x000000E9
+  GDK_KEY_ecircumflex* = 0x000000EA
+  GDK_KEY_ediaeresis* = 0x000000EB
+  GDK_KEY_igrave* = 0x000000EC
+  GDK_KEY_iacute* = 0x000000ED
+  GDK_KEY_icircumflex* = 0x000000EE
+  GDK_KEY_idiaeresis* = 0x000000EF
+  GDK_KEY_eth* = 0x000000F0
+  GDK_KEY_ntilde* = 0x000000F1
+  GDK_KEY_ograve* = 0x000000F2
+  GDK_KEY_oacute* = 0x000000F3
+  GDK_KEY_ocircumflex* = 0x000000F4
+  GDK_KEY_otilde* = 0x000000F5
+  GDK_KEY_odiaeresis* = 0x000000F6
+  GDK_KEY_division* = 0x000000F7
+  GDK_KEY_oslash* = 0x000000F8
+  GDK_KEY_ugrave* = 0x000000F9
+  GDK_KEY_uacute* = 0x000000FA
+  GDK_KEY_ucircumflex* = 0x000000FB
+  GDK_KEY_udiaeresis* = 0x000000FC
+  GDK_KEY_yacute* = 0x000000FD
+  GDK_KEY_thorn* = 0x000000FE
+  GDK_KEY_ydiaeresis* = 0x000000FF
+  GDK_KEY_CAPITAL_Aogonek* = 0x000001A1
+  GDK_KEY_breve* = 0x000001A2
+  GDK_KEY_CAPITAL_Lstroke* = 0x000001A3
+  GDK_KEY_CAPITAL_Lcaron* = 0x000001A5
+  GDK_KEY_CAPITAL_Sacute* = 0x000001A6
+  GDK_KEY_CAPITAL_Scaron* = 0x000001A9
+  GDK_KEY_CAPITAL_Scedilla* = 0x000001AA
+  GDK_KEY_CAPITAL_Tcaron* = 0x000001AB
+  GDK_KEY_CAPITAL_Zacute* = 0x000001AC
+  GDK_KEY_CAPITAL_Zcaron* = 0x000001AE
+  GDK_KEY_CAPITAL_Zabovedot* = 0x000001AF
+  GDK_KEY_aogonek* = 0x000001B1
+  GDK_KEY_ogonek* = 0x000001B2
+  GDK_KEY_lstroke* = 0x000001B3
+  GDK_KEY_lcaron* = 0x000001B5
+  GDK_KEY_sacute* = 0x000001B6
+  GDK_KEY_caron* = 0x000001B7
+  GDK_KEY_scaron* = 0x000001B9
+  GDK_KEY_scedilla* = 0x000001BA
+  GDK_KEY_tcaron* = 0x000001BB
+  GDK_KEY_zacute* = 0x000001BC
+  GDK_KEY_doubleacute* = 0x000001BD
+  GDK_KEY_zcaron* = 0x000001BE
+  GDK_KEY_zabovedot* = 0x000001BF
+  GDK_KEY_CAPITAL_Racute* = 0x000001C0
+  GDK_KEY_CAPITAL_Abreve* = 0x000001C3
+  GDK_KEY_CAPITAL_Lacute* = 0x000001C5
+  GDK_KEY_CAPITAL_Cacute* = 0x000001C6
+  GDK_KEY_CAPITAL_Ccaron* = 0x000001C8
+  GDK_KEY_CAPITAL_Eogonek* = 0x000001CA
+  GDK_KEY_CAPITAL_Ecaron* = 0x000001CC
+  GDK_KEY_CAPITAL_Dcaron* = 0x000001CF
+  GDK_KEY_CAPITAL_Dstroke* = 0x000001D0
+  GDK_KEY_CAPITAL_Nacute* = 0x000001D1
+  GDK_KEY_CAPITAL_Ncaron* = 0x000001D2
+  GDK_KEY_CAPITAL_Odoubleacute* = 0x000001D5
+  GDK_KEY_CAPITAL_Rcaron* = 0x000001D8
+  GDK_KEY_CAPITAL_Uring* = 0x000001D9
+  GDK_KEY_CAPITAL_Udoubleacute* = 0x000001DB
+  GDK_KEY_CAPITAL_Tcedilla* = 0x000001DE
+  GDK_KEY_racute* = 0x000001E0
+  GDK_KEY_abreve* = 0x000001E3
+  GDK_KEY_lacute* = 0x000001E5
+  GDK_KEY_cacute* = 0x000001E6
+  GDK_KEY_ccaron* = 0x000001E8
+  GDK_KEY_eogonek* = 0x000001EA
+  GDK_KEY_ecaron* = 0x000001EC
+  GDK_KEY_dcaron* = 0x000001EF
+  GDK_KEY_dstroke* = 0x000001F0
+  GDK_KEY_nacute* = 0x000001F1
+  GDK_KEY_ncaron* = 0x000001F2
+  GDK_KEY_odoubleacute* = 0x000001F5
+  GDK_KEY_udoubleacute* = 0x000001FB
+  GDK_KEY_rcaron* = 0x000001F8
+  GDK_KEY_uring* = 0x000001F9
+  GDK_KEY_tcedilla* = 0x000001FE
+  GDK_KEY_abovedot* = 0x000001FF
+  GDK_KEY_CAPITAL_Hstroke* = 0x000002A1
+  GDK_KEY_CAPITAL_Hcircumflex* = 0x000002A6
+  GDK_KEY_CAPITAL_Iabovedot* = 0x000002A9
+  GDK_KEY_CAPITAL_Gbreve* = 0x000002AB
+  GDK_KEY_CAPITAL_Jcircumflex* = 0x000002AC
+  GDK_KEY_hstroke* = 0x000002B1
+  GDK_KEY_hcircumflex* = 0x000002B6
+  GDK_KEY_idotless* = 0x000002B9
+  GDK_KEY_gbreve* = 0x000002BB
+  GDK_KEY_jcircumflex* = 0x000002BC
+  GDK_KEY_CAPITAL_Cabovedot* = 0x000002C5
+  GDK_KEY_CAPITAL_Ccircumflex* = 0x000002C6
+  GDK_KEY_CAPITAL_Gabovedot* = 0x000002D5
+  GDK_KEY_CAPITAL_Gcircumflex* = 0x000002D8
+  GDK_KEY_CAPITAL_Ubreve* = 0x000002DD
+  GDK_KEY_CAPITAL_Scircumflex* = 0x000002DE
+  GDK_KEY_cabovedot* = 0x000002E5
+  GDK_KEY_ccircumflex* = 0x000002E6
+  GDK_KEY_gabovedot* = 0x000002F5
+  GDK_KEY_gcircumflex* = 0x000002F8
+  GDK_KEY_ubreve* = 0x000002FD
+  GDK_KEY_scircumflex* = 0x000002FE
+  GDK_KEY_kra* = 0x000003A2
+  GDK_KEY_kappa* = 0x000003A2
+  GDK_KEY_CAPITAL_Rcedilla* = 0x000003A3
+  GDK_KEY_CAPITAL_Itilde* = 0x000003A5
+  GDK_KEY_CAPITAL_Lcedilla* = 0x000003A6
+  GDK_KEY_CAPITAL_Emacron* = 0x000003AA
+  GDK_KEY_CAPITAL_Gcedilla* = 0x000003AB
+  GDK_KEY_CAPITAL_Tslash* = 0x000003AC
+  GDK_KEY_rcedilla* = 0x000003B3
+  GDK_KEY_itilde* = 0x000003B5
+  GDK_KEY_lcedilla* = 0x000003B6
+  GDK_KEY_emacron* = 0x000003BA
+  GDK_KEY_gcedilla* = 0x000003BB
+  GDK_KEY_tslash* = 0x000003BC
+  GDK_KEY_CAPITAL_ENG* = 0x000003BD
+  GDK_KEY_eng* = 0x000003BF
+  GDK_KEY_CAPITAL_Amacron* = 0x000003C0
+  GDK_KEY_CAPITAL_Iogonek* = 0x000003C7
+  GDK_KEY_CAPITAL_Eabovedot* = 0x000003CC
+  GDK_KEY_CAPITAL_Imacron* = 0x000003CF
+  GDK_KEY_CAPITAL_Ncedilla* = 0x000003D1
+  GDK_KEY_CAPITAL_Omacron* = 0x000003D2
+  GDK_KEY_CAPITAL_Kcedilla* = 0x000003D3
+  GDK_KEY_CAPITAL_Uogonek* = 0x000003D9
+  GDK_KEY_CAPITAL_Utilde* = 0x000003DD
+  GDK_KEY_CAPITAL_Umacron* = 0x000003DE
+  GDK_KEY_amacron* = 0x000003E0
+  GDK_KEY_iogonek* = 0x000003E7
+  GDK_KEY_eabovedot* = 0x000003EC
+  GDK_KEY_imacron* = 0x000003EF
+  GDK_KEY_ncedilla* = 0x000003F1
+  GDK_KEY_omacron* = 0x000003F2
+  GDK_KEY_kcedilla* = 0x000003F3
+  GDK_KEY_uogonek* = 0x000003F9
+  GDK_KEY_utilde* = 0x000003FD
+  GDK_KEY_umacron* = 0x000003FE
+  GDK_KEY_CAPITAL_OE* = 0x000013BC
+  GDK_KEY_oe* = 0x000013BD
+  GDK_KEY_CAPITAL_Ydiaeresis* = 0x000013BE
+  GDK_KEY_overline* = 0x0000047E
+  GDK_KEY_kana_fullstop* = 0x000004A1
+  GDK_KEY_kana_openingbracket* = 0x000004A2
+  GDK_KEY_kana_closingbracket* = 0x000004A3
+  GDK_KEY_kana_comma* = 0x000004A4
+  GDK_KEY_kana_conjunctive* = 0x000004A5
+  GDK_KEY_kana_middledot* = 0x000004A5
+  GDK_KEY_kana_WO* = 0x000004A6
+  GDK_KEY_kana_a* = 0x000004A7
+  GDK_KEY_kana_i* = 0x000004A8
+  GDK_KEY_kana_u* = 0x000004A9
+  GDK_KEY_kana_e* = 0x000004AA
+  GDK_KEY_kana_o* = 0x000004AB
+  GDK_KEY_kana_ya* = 0x000004AC
+  GDK_KEY_kana_yu* = 0x000004AD
+  GDK_KEY_kana_yo* = 0x000004AE
+  GDK_KEY_kana_tsu* = 0x000004AF
+  GDK_KEY_kana_tu* = 0x000004AF
+  GDK_KEY_prolongedsound* = 0x000004B0
+  GDK_KEY_kana_CAPITAL_A* = 0x000004B1
+  GDK_KEY_kana_CAPITAL_I* = 0x000004B2
+  GDK_KEY_kana_CAPITAL_U* = 0x000004B3
+  GDK_KEY_kana_CAPITAL_E* = 0x000004B4
+  GDK_KEY_kana_CAPITAL_O* = 0x000004B5
+  GDK_KEY_kana_KA* = 0x000004B6
+  GDK_KEY_kana_KI* = 0x000004B7
+  GDK_KEY_kana_KU* = 0x000004B8
+  GDK_KEY_kana_KE* = 0x000004B9
+  GDK_KEY_kana_KO* = 0x000004BA
+  GDK_KEY_kana_SA* = 0x000004BB
+  GDK_KEY_kana_SHI* = 0x000004BC
+  GDK_KEY_kana_SU* = 0x000004BD
+  GDK_KEY_kana_SE* = 0x000004BE
+  GDK_KEY_kana_SO* = 0x000004BF
+  GDK_KEY_kana_TA* = 0x000004C0
+  GDK_KEY_kana_CHI* = 0x000004C1
+  GDK_KEY_kana_TI* = 0x000004C1
+  GDK_KEY_kana_CAPITAL_TSU* = 0x000004C2
+  GDK_KEY_kana_CAPITAL_TU* = 0x000004C2
+  GDK_KEY_kana_TE* = 0x000004C3
+  GDK_KEY_kana_TO* = 0x000004C4
+  GDK_KEY_kana_NA* = 0x000004C5
+  GDK_KEY_kana_NI* = 0x000004C6
+  GDK_KEY_kana_NU* = 0x000004C7
+  GDK_KEY_kana_NE* = 0x000004C8
+  GDK_KEY_kana_NO* = 0x000004C9
+  GDK_KEY_kana_HA* = 0x000004CA
+  GDK_KEY_kana_HI* = 0x000004CB
+  GDK_KEY_kana_FU* = 0x000004CC
+  GDK_KEY_kana_HU* = 0x000004CC
+  GDK_KEY_kana_HE* = 0x000004CD
+  GDK_KEY_kana_HO* = 0x000004CE
+  GDK_KEY_kana_MA* = 0x000004CF
+  GDK_KEY_kana_MI* = 0x000004D0
+  GDK_KEY_kana_MU* = 0x000004D1
+  GDK_KEY_kana_ME* = 0x000004D2
+  GDK_KEY_kana_MO* = 0x000004D3
+  GDK_KEY_kana_CAPITAL_YA* = 0x000004D4
+  GDK_KEY_kana_CAPITAL_YU* = 0x000004D5
+  GDK_KEY_kana_CAPITAL_YO* = 0x000004D6
+  GDK_KEY_kana_RA* = 0x000004D7
+  GDK_KEY_kana_RI* = 0x000004D8
+  GDK_KEY_kana_RU* = 0x000004D9
+  GDK_KEY_kana_RE* = 0x000004DA
+  GDK_KEY_kana_RO* = 0x000004DB
+  GDK_KEY_kana_WA* = 0x000004DC
+  GDK_KEY_kana_N* = 0x000004DD
+  GDK_KEY_voicedsound* = 0x000004DE
+  GDK_KEY_semivoicedsound* = 0x000004DF
+  GDK_KEY_kana_switch* = 0x0000FF7E
+  GDK_KEY_Arabic_comma* = 0x000005AC
+  GDK_KEY_Arabic_semicolon* = 0x000005BB
+  GDK_KEY_Arabic_question_mark* = 0x000005BF
+  GDK_KEY_Arabic_hamza* = 0x000005C1
+  GDK_KEY_Arabic_maddaonalef* = 0x000005C2
+  GDK_KEY_Arabic_hamzaonalef* = 0x000005C3
+  GDK_KEY_Arabic_hamzaonwaw* = 0x000005C4
+  GDK_KEY_Arabic_hamzaunderalef* = 0x000005C5
+  GDK_KEY_Arabic_hamzaonyeh* = 0x000005C6
+  GDK_KEY_Arabic_alef* = 0x000005C7
+  GDK_KEY_Arabic_beh* = 0x000005C8
+  GDK_KEY_Arabic_tehmarbuta* = 0x000005C9
+  GDK_KEY_Arabic_teh* = 0x000005CA
+  GDK_KEY_Arabic_theh* = 0x000005CB
+  GDK_KEY_Arabic_jeem* = 0x000005CC
+  GDK_KEY_Arabic_hah* = 0x000005CD
+  GDK_KEY_Arabic_khah* = 0x000005CE
+  GDK_KEY_Arabic_dal* = 0x000005CF
+  GDK_KEY_Arabic_thal* = 0x000005D0
+  GDK_KEY_Arabic_ra* = 0x000005D1
+  GDK_KEY_Arabic_zain* = 0x000005D2
+  GDK_KEY_Arabic_seen* = 0x000005D3
+  GDK_KEY_Arabic_sheen* = 0x000005D4
+  GDK_KEY_Arabic_sad* = 0x000005D5
+  GDK_KEY_Arabic_dad* = 0x000005D6
+  GDK_KEY_Arabic_tah* = 0x000005D7
+  GDK_KEY_Arabic_zah* = 0x000005D8
+  GDK_KEY_Arabic_ain* = 0x000005D9
+  GDK_KEY_Arabic_ghain* = 0x000005DA
+  GDK_KEY_Arabic_tatweel* = 0x000005E0
+  GDK_KEY_Arabic_feh* = 0x000005E1
+  GDK_KEY_Arabic_qaf* = 0x000005E2
+  GDK_KEY_Arabic_kaf* = 0x000005E3
+  GDK_KEY_Arabic_lam* = 0x000005E4
+  GDK_KEY_Arabic_meem* = 0x000005E5
+  GDK_KEY_Arabic_noon* = 0x000005E6
+  GDK_KEY_Arabic_ha* = 0x000005E7
+  GDK_KEY_Arabic_heh* = 0x000005E7
+  GDK_KEY_Arabic_waw* = 0x000005E8
+  GDK_KEY_Arabic_alefmaksura* = 0x000005E9
+  GDK_KEY_Arabic_yeh* = 0x000005EA
+  GDK_KEY_Arabic_fathatan* = 0x000005EB
+  GDK_KEY_Arabic_dammatan* = 0x000005EC
+  GDK_KEY_Arabic_kasratan* = 0x000005ED
+  GDK_KEY_Arabic_fatha* = 0x000005EE
+  GDK_KEY_Arabic_damma* = 0x000005EF
+  GDK_KEY_Arabic_kasra* = 0x000005F0
+  GDK_KEY_Arabic_shadda* = 0x000005F1
+  GDK_KEY_Arabic_sukun* = 0x000005F2
+  GDK_KEY_Arabic_switch* = 0x0000FF7E
+  GDK_KEY_Serbian_dje* = 0x000006A1
+  GDK_KEY_Macedonia_gje* = 0x000006A2
+  GDK_KEY_Cyrillic_io* = 0x000006A3
+  GDK_KEY_Ukrainian_ie* = 0x000006A4
+  GDK_KEY_Ukranian_je* = 0x000006A4
+  GDK_KEY_Macedonia_dse* = 0x000006A5
+  GDK_KEY_Ukrainian_i* = 0x000006A6
+  GDK_KEY_Ukranian_i* = 0x000006A6
+  GDK_KEY_Ukrainian_yi* = 0x000006A7
+  GDK_KEY_Ukranian_yi* = 0x000006A7
+  GDK_KEY_Cyrillic_je* = 0x000006A8
+  GDK_KEY_Serbian_je* = 0x000006A8
+  GDK_KEY_Cyrillic_lje* = 0x000006A9
+  GDK_KEY_Serbian_lje* = 0x000006A9
+  GDK_KEY_Cyrillic_nje* = 0x000006AA
+  GDK_KEY_Serbian_nje* = 0x000006AA
+  GDK_KEY_Serbian_tshe* = 0x000006AB
+  GDK_KEY_Macedonia_kje* = 0x000006AC
+  GDK_KEY_Byelorussian_shortu* = 0x000006AE
+  GDK_KEY_Cyrillic_dzhe* = 0x000006AF
+  GDK_KEY_Serbian_dze* = 0x000006AF
+  GDK_KEY_numerosign* = 0x000006B0
+  GDK_KEY_Serbian_CAPITAL_DJE* = 0x000006B1
+  GDK_KEY_Macedonia_CAPITAL_GJE* = 0x000006B2
+  GDK_KEY_Cyrillic_CAPITAL_IO* = 0x000006B3
+  GDK_KEY_Ukrainian_CAPITAL_IE* = 0x000006B4
+  GDK_KEY_Ukranian_CAPITAL_JE* = 0x000006B4
+  GDK_KEY_Macedonia_CAPITAL_DSE* = 0x000006B5
+  GDK_KEY_Ukrainian_CAPITAL_I* = 0x000006B6
+  GDK_KEY_Ukranian_CAPITAL_I* = 0x000006B6
+  GDK_KEY_Ukrainian_CAPITAL_YI* = 0x000006B7
+  GDK_KEY_Ukranian_CAPITAL_YI* = 0x000006B7
+  GDK_KEY_Cyrillic_CAPITAL_JE* = 0x000006B8
+  GDK_KEY_Serbian_CAPITAL_JE* = 0x000006B8
+  GDK_KEY_Cyrillic_CAPITAL_LJE* = 0x000006B9
+  GDK_KEY_Serbian_CAPITAL_LJE* = 0x000006B9
+  GDK_KEY_Cyrillic_CAPITAL_NJE* = 0x000006BA
+  GDK_KEY_Serbian_CAPITAL_NJE* = 0x000006BA
+  GDK_KEY_Serbian_CAPITAL_TSHE* = 0x000006BB
+  GDK_KEY_Macedonia_CAPITAL_KJE* = 0x000006BC
+  GDK_KEY_Byelorussian_CAPITAL_SHORTU* = 0x000006BE
+  GDK_KEY_Cyrillic_CAPITAL_DZHE* = 0x000006BF
+  GDK_KEY_Serbian_CAPITAL_DZE* = 0x000006BF
+  GDK_KEY_Cyrillic_yu* = 0x000006C0
+  GDK_KEY_Cyrillic_a* = 0x000006C1
+  GDK_KEY_Cyrillic_be* = 0x000006C2
+  GDK_KEY_Cyrillic_tse* = 0x000006C3
+  GDK_KEY_Cyrillic_de* = 0x000006C4
+  GDK_KEY_Cyrillic_ie* = 0x000006C5
+  GDK_KEY_Cyrillic_ef* = 0x000006C6
+  GDK_KEY_Cyrillic_ghe* = 0x000006C7
+  GDK_KEY_Cyrillic_ha* = 0x000006C8
+  GDK_KEY_Cyrillic_i* = 0x000006C9
+  GDK_KEY_Cyrillic_shorti* = 0x000006CA
+  GDK_KEY_Cyrillic_ka* = 0x000006CB
+  GDK_KEY_Cyrillic_el* = 0x000006CC
+  GDK_KEY_Cyrillic_em* = 0x000006CD
+  GDK_KEY_Cyrillic_en* = 0x000006CE
+  GDK_KEY_Cyrillic_o* = 0x000006CF
+  GDK_KEY_Cyrillic_pe* = 0x000006D0
+  GDK_KEY_Cyrillic_ya* = 0x000006D1
+  GDK_KEY_Cyrillic_er* = 0x000006D2
+  GDK_KEY_Cyrillic_es* = 0x000006D3
+  GDK_KEY_Cyrillic_te* = 0x000006D4
+  GDK_KEY_Cyrillic_u* = 0x000006D5
+  GDK_KEY_Cyrillic_zhe* = 0x000006D6
+  GDK_KEY_Cyrillic_ve* = 0x000006D7
+  GDK_KEY_Cyrillic_softsign* = 0x000006D8
+  GDK_KEY_Cyrillic_yeru* = 0x000006D9
+  GDK_KEY_Cyrillic_ze* = 0x000006DA
+  GDK_KEY_Cyrillic_sha* = 0x000006DB
+  GDK_KEY_Cyrillic_e* = 0x000006DC
+  GDK_KEY_Cyrillic_shcha* = 0x000006DD
+  GDK_KEY_Cyrillic_che* = 0x000006DE
+  GDK_KEY_Cyrillic_hardsign* = 0x000006DF
+  GDK_KEY_Cyrillic_CAPITAL_YU* = 0x000006E0
+  GDK_KEY_Cyrillic_CAPITAL_A* = 0x000006E1
+  GDK_KEY_Cyrillic_CAPITAL_BE* = 0x000006E2
+  GDK_KEY_Cyrillic_CAPITAL_TSE* = 0x000006E3
+  GDK_KEY_Cyrillic_CAPITAL_DE* = 0x000006E4
+  GDK_KEY_Cyrillic_CAPITAL_IE* = 0x000006E5
+  GDK_KEY_Cyrillic_CAPITAL_EF* = 0x000006E6
+  GDK_KEY_Cyrillic_CAPITAL_GHE* = 0x000006E7
+  GDK_KEY_Cyrillic_CAPITAL_HA* = 0x000006E8
+  GDK_KEY_Cyrillic_CAPITAL_I* = 0x000006E9
+  GDK_KEY_Cyrillic_CAPITAL_SHORTI* = 0x000006EA
+  GDK_KEY_Cyrillic_CAPITAL_KA* = 0x000006EB
+  GDK_KEY_Cyrillic_CAPITAL_EL* = 0x000006EC
+  GDK_KEY_Cyrillic_CAPITAL_EM* = 0x000006ED
+  GDK_KEY_Cyrillic_CAPITAL_EN* = 0x000006EE
+  GDK_KEY_Cyrillic_CAPITAL_O* = 0x000006EF
+  GDK_KEY_Cyrillic_CAPITAL_PE* = 0x000006F0
+  GDK_KEY_Cyrillic_CAPITAL_YA* = 0x000006F1
+  GDK_KEY_Cyrillic_CAPITAL_ER* = 0x000006F2
+  GDK_KEY_Cyrillic_CAPITAL_ES* = 0x000006F3
+  GDK_KEY_Cyrillic_CAPITAL_TE* = 0x000006F4
+  GDK_KEY_Cyrillic_CAPITAL_U* = 0x000006F5
+  GDK_KEY_Cyrillic_CAPITAL_ZHE* = 0x000006F6
+  GDK_KEY_Cyrillic_CAPITAL_VE* = 0x000006F7
+  GDK_KEY_Cyrillic_CAPITAL_SOFTSIGN* = 0x000006F8
+  GDK_KEY_Cyrillic_CAPITAL_YERU* = 0x000006F9
+  GDK_KEY_Cyrillic_CAPITAL_ZE* = 0x000006FA
+  GDK_KEY_Cyrillic_CAPITAL_SHA* = 0x000006FB
+  GDK_KEY_Cyrillic_CAPITAL_E* = 0x000006FC
+  GDK_KEY_Cyrillic_CAPITAL_SHCHA* = 0x000006FD
+  GDK_KEY_Cyrillic_CAPITAL_CHE* = 0x000006FE
+  GDK_KEY_Cyrillic_CAPITAL_HARDSIGN* = 0x000006FF
+  GDK_KEY_Greek_CAPITAL_ALPHAaccent* = 0x000007A1
+  GDK_KEY_Greek_CAPITAL_EPSILONaccent* = 0x000007A2
+  GDK_KEY_Greek_CAPITAL_ETAaccent* = 0x000007A3
+  GDK_KEY_Greek_CAPITAL_IOTAaccent* = 0x000007A4
+  GDK_KEY_Greek_CAPITAL_IOTAdiaeresis* = 0x000007A5
+  GDK_KEY_Greek_CAPITAL_OMICRONaccent* = 0x000007A7
+  GDK_KEY_Greek_CAPITAL_UPSILONaccent* = 0x000007A8
+  GDK_KEY_Greek_CAPITAL_UPSILONdieresis* = 0x000007A9
+  GDK_KEY_Greek_CAPITAL_OMEGAaccent* = 0x000007AB
+  GDK_KEY_Greek_accentdieresis* = 0x000007AE
+  GDK_KEY_Greek_horizbar* = 0x000007AF
+  GDK_KEY_Greek_alphaaccent* = 0x000007B1
+  GDK_KEY_Greek_epsilonaccent* = 0x000007B2
+  GDK_KEY_Greek_etaaccent* = 0x000007B3
+  GDK_KEY_Greek_iotaaccent* = 0x000007B4
+  GDK_KEY_Greek_iotadieresis* = 0x000007B5
+  GDK_KEY_Greek_iotaaccentdieresis* = 0x000007B6
+  GDK_KEY_Greek_omicronaccent* = 0x000007B7
+  GDK_KEY_Greek_upsilonaccent* = 0x000007B8
+  GDK_KEY_Greek_upsilondieresis* = 0x000007B9
+  GDK_KEY_Greek_upsilonaccentdieresis* = 0x000007BA
+  GDK_KEY_Greek_omegaaccent* = 0x000007BB
+  GDK_KEY_Greek_CAPITAL_ALPHA* = 0x000007C1
+  GDK_KEY_Greek_CAPITAL_BETA* = 0x000007C2
+  GDK_KEY_Greek_CAPITAL_GAMMA* = 0x000007C3
+  GDK_KEY_Greek_CAPITAL_DELTA* = 0x000007C4
+  GDK_KEY_Greek_CAPITAL_EPSILON* = 0x000007C5
+  GDK_KEY_Greek_CAPITAL_ZETA* = 0x000007C6
+  GDK_KEY_Greek_CAPITAL_ETA* = 0x000007C7
+  GDK_KEY_Greek_CAPITAL_THETA* = 0x000007C8
+  GDK_KEY_Greek_CAPITAL_IOTA* = 0x000007C9
+  GDK_KEY_Greek_CAPITAL_KAPPA* = 0x000007CA
+  GDK_KEY_Greek_CAPITAL_LAMDA* = 0x000007CB
+  GDK_KEY_Greek_CAPITAL_LAMBDA* = 0x000007CB
+  GDK_KEY_Greek_CAPITAL_MU* = 0x000007CC
+  GDK_KEY_Greek_CAPITAL_NU* = 0x000007CD
+  GDK_KEY_Greek_CAPITAL_XI* = 0x000007CE
+  GDK_KEY_Greek_CAPITAL_OMICRON* = 0x000007CF
+  GDK_KEY_Greek_CAPITAL_PI* = 0x000007D0
+  GDK_KEY_Greek_CAPITAL_RHO* = 0x000007D1
+  GDK_KEY_Greek_CAPITAL_SIGMA* = 0x000007D2
+  GDK_KEY_Greek_CAPITAL_TAU* = 0x000007D4
+  GDK_KEY_Greek_CAPITAL_UPSILON* = 0x000007D5
+  GDK_KEY_Greek_CAPITAL_PHI* = 0x000007D6
+  GDK_KEY_Greek_CAPITAL_CHI* = 0x000007D7
+  GDK_KEY_Greek_CAPITAL_PSI* = 0x000007D8
+  GDK_KEY_Greek_CAPITAL_OMEGA* = 0x000007D9
+  GDK_KEY_Greek_alpha* = 0x000007E1
+  GDK_KEY_Greek_beta* = 0x000007E2
+  GDK_KEY_Greek_gamma* = 0x000007E3
+  GDK_KEY_Greek_delta* = 0x000007E4
+  GDK_KEY_Greek_epsilon* = 0x000007E5
+  GDK_KEY_Greek_zeta* = 0x000007E6
+  GDK_KEY_Greek_eta* = 0x000007E7
+  GDK_KEY_Greek_theta* = 0x000007E8
+  GDK_KEY_Greek_iota* = 0x000007E9
+  GDK_KEY_Greek_kappa* = 0x000007EA
+  GDK_KEY_Greek_lamda* = 0x000007EB
+  GDK_KEY_Greek_lambda* = 0x000007EB
+  GDK_KEY_Greek_mu* = 0x000007EC
+  GDK_KEY_Greek_nu* = 0x000007ED
+  GDK_KEY_Greek_xi* = 0x000007EE
+  GDK_KEY_Greek_omicron* = 0x000007EF
+  GDK_KEY_Greek_pi* = 0x000007F0
+  GDK_KEY_Greek_rho* = 0x000007F1
+  GDK_KEY_Greek_sigma* = 0x000007F2
+  GDK_KEY_Greek_finalsmallsigma* = 0x000007F3
+  GDK_KEY_Greek_tau* = 0x000007F4
+  GDK_KEY_Greek_upsilon* = 0x000007F5
+  GDK_KEY_Greek_phi* = 0x000007F6
+  GDK_KEY_Greek_chi* = 0x000007F7
+  GDK_KEY_Greek_psi* = 0x000007F8
+  GDK_KEY_Greek_omega* = 0x000007F9
+  GDK_KEY_Greek_switch* = 0x0000FF7E
+  GDK_KEY_leftradical* = 0x000008A1
+  GDK_KEY_topleftradical* = 0x000008A2
+  GDK_KEY_horizconnector* = 0x000008A3
+  GDK_KEY_topintegral* = 0x000008A4
+  GDK_KEY_botintegral* = 0x000008A5
+  GDK_KEY_vertconnector* = 0x000008A6
+  GDK_KEY_topleftsqbracket* = 0x000008A7
+  GDK_KEY_botleftsqbracket* = 0x000008A8
+  GDK_KEY_toprightsqbracket* = 0x000008A9
+  GDK_KEY_botrightsqbracket* = 0x000008AA
+  GDK_KEY_topleftparens* = 0x000008AB
+  GDK_KEY_botleftparens* = 0x000008AC
+  GDK_KEY_toprightparens* = 0x000008AD
+  GDK_KEY_botrightparens* = 0x000008AE
+  GDK_KEY_leftmiddlecurlybrace* = 0x000008AF
+  GDK_KEY_rightmiddlecurlybrace* = 0x000008B0
+  GDK_KEY_topleftsummation* = 0x000008B1
+  GDK_KEY_botleftsummation* = 0x000008B2
+  GDK_KEY_topvertsummationconnector* = 0x000008B3
+  GDK_KEY_botvertsummationconnector* = 0x000008B4
+  GDK_KEY_toprightsummation* = 0x000008B5
+  GDK_KEY_botrightsummation* = 0x000008B6
+  GDK_KEY_rightmiddlesummation* = 0x000008B7
+  GDK_KEY_lessthanequal* = 0x000008BC
+  GDK_KEY_notequal* = 0x000008BD
+  GDK_KEY_greaterthanequal* = 0x000008BE
+  GDK_KEY_integral* = 0x000008BF
+  GDK_KEY_therefore* = 0x000008C0
+  GDK_KEY_variation* = 0x000008C1
+  GDK_KEY_infinity* = 0x000008C2
+  GDK_KEY_nabla* = 0x000008C5
+  GDK_KEY_approximate* = 0x000008C8
+  GDK_KEY_similarequal* = 0x000008C9
+  GDK_KEY_ifonlyif* = 0x000008CD
+  GDK_KEY_implies* = 0x000008CE
+  GDK_KEY_identical* = 0x000008CF
+  GDK_KEY_radical* = 0x000008D6
+  GDK_KEY_includedin* = 0x000008DA
+  GDK_KEY_includes* = 0x000008DB
+  GDK_KEY_intersection* = 0x000008DC
+  GDK_KEY_union* = 0x000008DD
+  GDK_KEY_logicaland* = 0x000008DE
+  GDK_KEY_logicalor* = 0x000008DF
+  GDK_KEY_partialderivative* = 0x000008EF
+  GDK_KEY_function* = 0x000008F6
+  GDK_KEY_leftarrow* = 0x000008FB
+  GDK_KEY_uparrow* = 0x000008FC
+  GDK_KEY_rightarrow* = 0x000008FD
+  GDK_KEY_downarrow* = 0x000008FE
+  GDK_KEY_blank* = 0x000009DF
+  GDK_KEY_soliddiamond* = 0x000009E0
+  GDK_KEY_checkerboard* = 0x000009E1
+  GDK_KEY_ht* = 0x000009E2
+  GDK_KEY_ff* = 0x000009E3
+  GDK_KEY_cr* = 0x000009E4
+  GDK_KEY_lf* = 0x000009E5
+  GDK_KEY_nl* = 0x000009E8
+  GDK_KEY_vt* = 0x000009E9
+  GDK_KEY_lowrightcorner* = 0x000009EA
+  GDK_KEY_uprightcorner* = 0x000009EB
+  GDK_KEY_upleftcorner* = 0x000009EC
+  GDK_KEY_lowleftcorner* = 0x000009ED
+  GDK_KEY_crossinglines* = 0x000009EE
+  GDK_KEY_horizlinescan1* = 0x000009EF
+  GDK_KEY_horizlinescan3* = 0x000009F0
+  GDK_KEY_horizlinescan5* = 0x000009F1
+  GDK_KEY_horizlinescan7* = 0x000009F2
+  GDK_KEY_horizlinescan9* = 0x000009F3
+  GDK_KEY_leftt* = 0x000009F4
+  GDK_KEY_rightt* = 0x000009F5
+  GDK_KEY_bott* = 0x000009F6
+  GDK_KEY_topt* = 0x000009F7
+  GDK_KEY_vertbar* = 0x000009F8
+  GDK_KEY_emspace* = 0x00000AA1
+  GDK_KEY_enspace* = 0x00000AA2
+  GDK_KEY_em3space* = 0x00000AA3
+  GDK_KEY_em4space* = 0x00000AA4
+  GDK_KEY_digitspace* = 0x00000AA5
+  GDK_KEY_punctspace* = 0x00000AA6
+  GDK_KEY_thinspace* = 0x00000AA7
+  GDK_KEY_hairspace* = 0x00000AA8
+  GDK_KEY_emdash* = 0x00000AA9
+  GDK_KEY_endash* = 0x00000AAA
+  GDK_KEY_signifblank* = 0x00000AAC
+  GDK_KEY_ellipsis* = 0x00000AAE
+  GDK_KEY_doubbaselinedot* = 0x00000AAF
+  GDK_KEY_onethird* = 0x00000AB0
+  GDK_KEY_twothirds* = 0x00000AB1
+  GDK_KEY_onefifth* = 0x00000AB2
+  GDK_KEY_twofifths* = 0x00000AB3
+  GDK_KEY_threefifths* = 0x00000AB4
+  GDK_KEY_fourfifths* = 0x00000AB5
+  GDK_KEY_onesixth* = 0x00000AB6
+  GDK_KEY_fivesixths* = 0x00000AB7
+  GDK_KEY_careof* = 0x00000AB8
+  GDK_KEY_figdash* = 0x00000ABB
+  GDK_KEY_leftanglebracket* = 0x00000ABC
+  GDK_KEY_decimalpoint* = 0x00000ABD
+  GDK_KEY_rightanglebracket* = 0x00000ABE
+  GDK_KEY_marker* = 0x00000ABF
+  GDK_KEY_oneeighth* = 0x00000AC3
+  GDK_KEY_threeeighths* = 0x00000AC4
+  GDK_KEY_fiveeighths* = 0x00000AC5
+  GDK_KEY_seveneighths* = 0x00000AC6
+  GDK_KEY_trademark* = 0x00000AC9
+  GDK_KEY_signaturemark* = 0x00000ACA
+  GDK_KEY_trademarkincircle* = 0x00000ACB
+  GDK_KEY_leftopentriangle* = 0x00000ACC
+  GDK_KEY_rightopentriangle* = 0x00000ACD
+  GDK_KEY_emopencircle* = 0x00000ACE
+  GDK_KEY_emopenrectangle* = 0x00000ACF
+  GDK_KEY_leftsinglequotemark* = 0x00000AD0
+  GDK_KEY_rightsinglequotemark* = 0x00000AD1
+  GDK_KEY_leftdoublequotemark* = 0x00000AD2
+  GDK_KEY_rightdoublequotemark* = 0x00000AD3
+  GDK_KEY_prescription* = 0x00000AD4
+  GDK_KEY_minutes* = 0x00000AD6
+  GDK_KEY_seconds* = 0x00000AD7
+  GDK_KEY_latincross* = 0x00000AD9
+  GDK_KEY_hexagram* = 0x00000ADA
+  GDK_KEY_filledrectbullet* = 0x00000ADB
+  GDK_KEY_filledlefttribullet* = 0x00000ADC
+  GDK_KEY_filledrighttribullet* = 0x00000ADD
+  GDK_KEY_emfilledcircle* = 0x00000ADE
+  GDK_KEY_emfilledrect* = 0x00000ADF
+  GDK_KEY_enopencircbullet* = 0x00000AE0
+  GDK_KEY_enopensquarebullet* = 0x00000AE1
+  GDK_KEY_openrectbullet* = 0x00000AE2
+  GDK_KEY_opentribulletup* = 0x00000AE3
+  GDK_KEY_opentribulletdown* = 0x00000AE4
+  GDK_KEY_openstar* = 0x00000AE5
+  GDK_KEY_enfilledcircbullet* = 0x00000AE6
+  GDK_KEY_enfilledsqbullet* = 0x00000AE7
+  GDK_KEY_filledtribulletup* = 0x00000AE8
+  GDK_KEY_filledtribulletdown* = 0x00000AE9
+  GDK_KEY_leftpointer* = 0x00000AEA
+  GDK_KEY_rightpointer* = 0x00000AEB
+  GDK_KEY_club* = 0x00000AEC
+  GDK_KEY_diamond* = 0x00000AED
+  GDK_KEY_heart* = 0x00000AEE
+  GDK_KEY_maltesecross* = 0x00000AF0
+  GDK_KEY_dagger* = 0x00000AF1
+  GDK_KEY_doubledagger* = 0x00000AF2
+  GDK_KEY_checkmark* = 0x00000AF3
+  GDK_KEY_ballotcross* = 0x00000AF4
+  GDK_KEY_musicalsharp* = 0x00000AF5
+  GDK_KEY_musicalflat* = 0x00000AF6
+  GDK_KEY_malesymbol* = 0x00000AF7
+  GDK_KEY_femalesymbol* = 0x00000AF8
+  GDK_KEY_telephone* = 0x00000AF9
+  GDK_KEY_telephonerecorder* = 0x00000AFA
+  GDK_KEY_phonographcopyright* = 0x00000AFB
+  GDK_KEY_caret* = 0x00000AFC
+  GDK_KEY_singlelowquotemark* = 0x00000AFD
+  GDK_KEY_doublelowquotemark* = 0x00000AFE
+  GDK_KEY_cursor* = 0x00000AFF
+  GDK_KEY_leftcaret* = 0x00000BA3
+  GDK_KEY_rightcaret* = 0x00000BA6
+  GDK_KEY_downcaret* = 0x00000BA8
+  GDK_KEY_upcaret* = 0x00000BA9
+  GDK_KEY_overbar* = 0x00000BC0
+  GDK_KEY_downtack* = 0x00000BC2
+  GDK_KEY_upshoe* = 0x00000BC3
+  GDK_KEY_downstile* = 0x00000BC4
+  GDK_KEY_underbar* = 0x00000BC6
+  GDK_KEY_jot* = 0x00000BCA
+  GDK_KEY_quad* = 0x00000BCC
+  GDK_KEY_uptack* = 0x00000BCE
+  GDK_KEY_circle* = 0x00000BCF
+  GDK_KEY_upstile* = 0x00000BD3
+  GDK_KEY_downshoe* = 0x00000BD6
+  GDK_KEY_rightshoe* = 0x00000BD8
+  GDK_KEY_leftshoe* = 0x00000BDA
+  GDK_KEY_lefttack* = 0x00000BDC
+  GDK_KEY_righttack* = 0x00000BFC
+  GDK_KEY_hebrew_doublelowline* = 0x00000CDF
+  GDK_KEY_hebrew_aleph* = 0x00000CE0
+  GDK_KEY_hebrew_bet* = 0x00000CE1
+  GDK_KEY_hebrew_beth* = 0x00000CE1
+  GDK_KEY_hebrew_gimel* = 0x00000CE2
+  GDK_KEY_hebrew_gimmel* = 0x00000CE2
+  GDK_KEY_hebrew_dalet* = 0x00000CE3
+  GDK_KEY_hebrew_daleth* = 0x00000CE3
+  GDK_KEY_hebrew_he* = 0x00000CE4
+  GDK_KEY_hebrew_waw* = 0x00000CE5
+  GDK_KEY_hebrew_zain* = 0x00000CE6
+  GDK_KEY_hebrew_zayin* = 0x00000CE6
+  GDK_KEY_hebrew_chet* = 0x00000CE7
+  GDK_KEY_hebrew_het* = 0x00000CE7
+  GDK_KEY_hebrew_tet* = 0x00000CE8
+  GDK_KEY_hebrew_teth* = 0x00000CE8
+  GDK_KEY_hebrew_yod* = 0x00000CE9
+  GDK_KEY_hebrew_finalkaph* = 0x00000CEA
+  GDK_KEY_hebrew_kaph* = 0x00000CEB
+  GDK_KEY_hebrew_lamed* = 0x00000CEC
+  GDK_KEY_hebrew_finalmem* = 0x00000CED
+  GDK_KEY_hebrew_mem* = 0x00000CEE
+  GDK_KEY_hebrew_finalnun* = 0x00000CEF
+  GDK_KEY_hebrew_nun* = 0x00000CF0
+  GDK_KEY_hebrew_samech* = 0x00000CF1
+  GDK_KEY_hebrew_samekh* = 0x00000CF1
+  GDK_KEY_hebrew_ayin* = 0x00000CF2
+  GDK_KEY_hebrew_finalpe* = 0x00000CF3
+  GDK_KEY_hebrew_pe* = 0x00000CF4
+  GDK_KEY_hebrew_finalzade* = 0x00000CF5
+  GDK_KEY_hebrew_finalzadi* = 0x00000CF5
+  GDK_KEY_hebrew_zade* = 0x00000CF6
+  GDK_KEY_hebrew_zadi* = 0x00000CF6
+  GDK_KEY_hebrew_qoph* = 0x00000CF7
+  GDK_KEY_hebrew_kuf* = 0x00000CF7
+  GDK_KEY_hebrew_resh* = 0x00000CF8
+  GDK_KEY_hebrew_shin* = 0x00000CF9
+  GDK_KEY_hebrew_taw* = 0x00000CFA
+  GDK_KEY_hebrew_taf* = 0x00000CFA
+  GDK_KEY_Hebrew_switch* = 0x0000FF7E
+  GDK_KEY_Thai_kokai* = 0x00000DA1
+  GDK_KEY_Thai_khokhai* = 0x00000DA2
+  GDK_KEY_Thai_khokhuat* = 0x00000DA3
+  GDK_KEY_Thai_khokhwai* = 0x00000DA4
+  GDK_KEY_Thai_khokhon* = 0x00000DA5
+  GDK_KEY_Thai_khorakhang* = 0x00000DA6
+  GDK_KEY_Thai_ngongu* = 0x00000DA7
+  GDK_KEY_Thai_chochan* = 0x00000DA8
+  GDK_KEY_Thai_choching* = 0x00000DA9
+  GDK_KEY_Thai_chochang* = 0x00000DAA
+  GDK_KEY_Thai_soso* = 0x00000DAB
+  GDK_KEY_Thai_chochoe* = 0x00000DAC
+  GDK_KEY_Thai_yoying* = 0x00000DAD
+  GDK_KEY_Thai_dochada* = 0x00000DAE
+  GDK_KEY_Thai_topatak* = 0x00000DAF
+  GDK_KEY_Thai_thothan* = 0x00000DB0
+  GDK_KEY_Thai_thonangmontho* = 0x00000DB1
+  GDK_KEY_Thai_thophuthao* = 0x00000DB2
+  GDK_KEY_Thai_nonen* = 0x00000DB3
+  GDK_KEY_Thai_dodek* = 0x00000DB4
+  GDK_KEY_Thai_totao* = 0x00000DB5
+  GDK_KEY_Thai_thothung* = 0x00000DB6
+  GDK_KEY_Thai_thothahan* = 0x00000DB7
+  GDK_KEY_Thai_thothong* = 0x00000DB8
+  GDK_KEY_Thai_nonu* = 0x00000DB9
+  GDK_KEY_Thai_bobaimai* = 0x00000DBA
+  GDK_KEY_Thai_popla* = 0x00000DBB
+  GDK_KEY_Thai_phophung* = 0x00000DBC
+  GDK_KEY_Thai_fofa* = 0x00000DBD
+  GDK_KEY_Thai_phophan* = 0x00000DBE
+  GDK_KEY_Thai_fofan* = 0x00000DBF
+  GDK_KEY_Thai_phosamphao* = 0x00000DC0
+  GDK_KEY_Thai_moma* = 0x00000DC1
+  GDK_KEY_Thai_yoyak* = 0x00000DC2
+  GDK_KEY_Thai_rorua* = 0x00000DC3
+  GDK_KEY_Thai_ru* = 0x00000DC4
+  GDK_KEY_Thai_loling* = 0x00000DC5
+  GDK_KEY_Thai_lu* = 0x00000DC6
+  GDK_KEY_Thai_wowaen* = 0x00000DC7
+  GDK_KEY_Thai_sosala* = 0x00000DC8
+  GDK_KEY_Thai_sorusi* = 0x00000DC9
+  GDK_KEY_Thai_sosua* = 0x00000DCA
+  GDK_KEY_Thai_hohip* = 0x00000DCB
+  GDK_KEY_Thai_lochula* = 0x00000DCC
+  GDK_KEY_Thai_oang* = 0x00000DCD
+  GDK_KEY_Thai_honokhuk* = 0x00000DCE
+  GDK_KEY_Thai_paiyannoi* = 0x00000DCF
+  GDK_KEY_Thai_saraa* = 0x00000DD0
+  GDK_KEY_Thai_maihanakat* = 0x00000DD1
+  GDK_KEY_Thai_saraaa* = 0x00000DD2
+  GDK_KEY_Thai_saraam* = 0x00000DD3
+  GDK_KEY_Thai_sarai* = 0x00000DD4
+  GDK_KEY_Thai_saraii* = 0x00000DD5
+  GDK_KEY_Thai_saraue* = 0x00000DD6
+  GDK_KEY_Thai_sarauee* = 0x00000DD7
+  GDK_KEY_Thai_sarau* = 0x00000DD8
+  GDK_KEY_Thai_sarauu* = 0x00000DD9
+  GDK_KEY_Thai_phinthu* = 0x00000DDA
+  GDK_KEY_Thai_maihanakat_maitho* = 0x00000DDE
+  GDK_KEY_Thai_baht* = 0x00000DDF
+  GDK_KEY_Thai_sarae* = 0x00000DE0
+  GDK_KEY_Thai_saraae* = 0x00000DE1
+  GDK_KEY_Thai_sarao* = 0x00000DE2
+  GDK_KEY_Thai_saraaimaimuan* = 0x00000DE3
+  GDK_KEY_Thai_saraaimaimalai* = 0x00000DE4
+  GDK_KEY_Thai_lakkhangyao* = 0x00000DE5
+  GDK_KEY_Thai_maiyamok* = 0x00000DE6
+  GDK_KEY_Thai_maitaikhu* = 0x00000DE7
+  GDK_KEY_Thai_maiek* = 0x00000DE8
+  GDK_KEY_Thai_maitho* = 0x00000DE9
+  GDK_KEY_Thai_maitri* = 0x00000DEA
+  GDK_KEY_Thai_maichattawa* = 0x00000DEB
+  GDK_KEY_Thai_thanthakhat* = 0x00000DEC
+  GDK_KEY_Thai_nikhahit* = 0x00000DED
+  GDK_KEY_Thai_leksun* = 0x00000DF0
+  GDK_KEY_Thai_leknung* = 0x00000DF1
+  GDK_KEY_Thai_leksong* = 0x00000DF2
+  GDK_KEY_Thai_leksam* = 0x00000DF3
+  GDK_KEY_Thai_leksi* = 0x00000DF4
+  GDK_KEY_Thai_lekha* = 0x00000DF5
+  GDK_KEY_Thai_lekhok* = 0x00000DF6
+  GDK_KEY_Thai_lekchet* = 0x00000DF7
+  GDK_KEY_Thai_lekpaet* = 0x00000DF8
+  GDK_KEY_Thai_lekkao* = 0x00000DF9
+  GDK_KEY_Hangul* = 0x0000FF31
+  GDK_KEY_Hangul_Start* = 0x0000FF32
+  GDK_KEY_Hangul_End* = 0x0000FF33
+  GDK_KEY_Hangul_Hanja* = 0x0000FF34
+  GDK_KEY_Hangul_Jamo* = 0x0000FF35
+  GDK_KEY_Hangul_Romaja* = 0x0000FF36
+  GDK_KEY_Hangul_Codeinput* = 0x0000FF37
+  GDK_KEY_Hangul_Jeonja* = 0x0000FF38
+  GDK_KEY_Hangul_Banja* = 0x0000FF39
+  GDK_KEY_Hangul_PreHanja* = 0x0000FF3A
+  GDK_KEY_Hangul_PostHanja* = 0x0000FF3B
+  GDK_KEY_Hangul_SingleCandidate* = 0x0000FF3C
+  GDK_KEY_Hangul_MultipleCandidate* = 0x0000FF3D
+  GDK_KEY_Hangul_PreviousCandidate* = 0x0000FF3E
+  GDK_KEY_Hangul_Special* = 0x0000FF3F
+  GDK_KEY_Hangul_switch* = 0x0000FF7E
+  GDK_KEY_Hangul_Kiyeog* = 0x00000EA1
+  GDK_KEY_Hangul_SsangKiyeog* = 0x00000EA2
+  GDK_KEY_Hangul_KiyeogSios* = 0x00000EA3
+  GDK_KEY_Hangul_Nieun* = 0x00000EA4
+  GDK_KEY_Hangul_NieunJieuj* = 0x00000EA5
+  GDK_KEY_Hangul_NieunHieuh* = 0x00000EA6
+  GDK_KEY_Hangul_Dikeud* = 0x00000EA7
+  GDK_KEY_Hangul_SsangDikeud* = 0x00000EA8
+  GDK_KEY_Hangul_Rieul* = 0x00000EA9
+  GDK_KEY_Hangul_RieulKiyeog* = 0x00000EAA
+  GDK_KEY_Hangul_RieulMieum* = 0x00000EAB
+  GDK_KEY_Hangul_RieulPieub* = 0x00000EAC
+  GDK_KEY_Hangul_RieulSios* = 0x00000EAD
+  GDK_KEY_Hangul_RieulTieut* = 0x00000EAE
+  GDK_KEY_Hangul_RieulPhieuf* = 0x00000EAF
+  GDK_KEY_Hangul_RieulHieuh* = 0x00000EB0
+  GDK_KEY_Hangul_Mieum* = 0x00000EB1
+  GDK_KEY_Hangul_Pieub* = 0x00000EB2
+  GDK_KEY_Hangul_SsangPieub* = 0x00000EB3
+  GDK_KEY_Hangul_PieubSios* = 0x00000EB4
+  GDK_KEY_Hangul_Sios* = 0x00000EB5
+  GDK_KEY_Hangul_SsangSios* = 0x00000EB6
+  GDK_KEY_Hangul_Ieung* = 0x00000EB7
+  GDK_KEY_Hangul_Jieuj* = 0x00000EB8
+  GDK_KEY_Hangul_SsangJieuj* = 0x00000EB9
+  GDK_KEY_Hangul_Cieuc* = 0x00000EBA
+  GDK_KEY_Hangul_Khieuq* = 0x00000EBB
+  GDK_KEY_Hangul_Tieut* = 0x00000EBC
+  GDK_KEY_Hangul_Phieuf* = 0x00000EBD
+  GDK_KEY_Hangul_Hieuh* = 0x00000EBE
+  GDK_KEY_Hangul_A* = 0x00000EBF
+  GDK_KEY_Hangul_AE* = 0x00000EC0
+  GDK_KEY_Hangul_YA* = 0x00000EC1
+  GDK_KEY_Hangul_YAE* = 0x00000EC2
+  GDK_KEY_Hangul_EO* = 0x00000EC3
+  GDK_KEY_Hangul_E* = 0x00000EC4
+  GDK_KEY_Hangul_YEO* = 0x00000EC5
+  GDK_KEY_Hangul_YE* = 0x00000EC6
+  GDK_KEY_Hangul_O* = 0x00000EC7
+  GDK_KEY_Hangul_WA* = 0x00000EC8
+  GDK_KEY_Hangul_WAE* = 0x00000EC9
+  GDK_KEY_Hangul_OE* = 0x00000ECA
+  GDK_KEY_Hangul_YO* = 0x00000ECB
+  GDK_KEY_Hangul_U* = 0x00000ECC
+  GDK_KEY_Hangul_WEO* = 0x00000ECD
+  GDK_KEY_Hangul_WE* = 0x00000ECE
+  GDK_KEY_Hangul_WI* = 0x00000ECF
+  GDK_KEY_Hangul_YU* = 0x00000ED0
+  GDK_KEY_Hangul_EU* = 0x00000ED1
+  GDK_KEY_Hangul_YI* = 0x00000ED2
+  GDK_KEY_Hangul_I* = 0x00000ED3
+  GDK_KEY_Hangul_J_Kiyeog* = 0x00000ED4
+  GDK_KEY_Hangul_J_SsangKiyeog* = 0x00000ED5
+  GDK_KEY_Hangul_J_KiyeogSios* = 0x00000ED6
+  GDK_KEY_Hangul_J_Nieun* = 0x00000ED7
+  GDK_KEY_Hangul_J_NieunJieuj* = 0x00000ED8
+  GDK_KEY_Hangul_J_NieunHieuh* = 0x00000ED9
+  GDK_KEY_Hangul_J_Dikeud* = 0x00000EDA
+  GDK_KEY_Hangul_J_Rieul* = 0x00000EDB
+  GDK_KEY_Hangul_J_RieulKiyeog* = 0x00000EDC
+  GDK_KEY_Hangul_J_RieulMieum* = 0x00000EDD
+  GDK_KEY_Hangul_J_RieulPieub* = 0x00000EDE
+  GDK_KEY_Hangul_J_RieulSios* = 0x00000EDF
+  GDK_KEY_Hangul_J_RieulTieut* = 0x00000EE0
+  GDK_KEY_Hangul_J_RieulPhieuf* = 0x00000EE1
+  GDK_KEY_Hangul_J_RieulHieuh* = 0x00000EE2
+  GDK_KEY_Hangul_J_Mieum* = 0x00000EE3
+  GDK_KEY_Hangul_J_Pieub* = 0x00000EE4
+  GDK_KEY_Hangul_J_PieubSios* = 0x00000EE5
+  GDK_KEY_Hangul_J_Sios* = 0x00000EE6
+  GDK_KEY_Hangul_J_SsangSios* = 0x00000EE7
+  GDK_KEY_Hangul_J_Ieung* = 0x00000EE8
+  GDK_KEY_Hangul_J_Jieuj* = 0x00000EE9
+  GDK_KEY_Hangul_J_Cieuc* = 0x00000EEA
+  GDK_KEY_Hangul_J_Khieuq* = 0x00000EEB
+  GDK_KEY_Hangul_J_Tieut* = 0x00000EEC
+  GDK_KEY_Hangul_J_Phieuf* = 0x00000EED
+  GDK_KEY_Hangul_J_Hieuh* = 0x00000EEE
+  GDK_KEY_Hangul_RieulYeorinHieuh* = 0x00000EEF
+  GDK_KEY_Hangul_SunkyeongeumMieum* = 0x00000EF0
+  GDK_KEY_Hangul_SunkyeongeumPieub* = 0x00000EF1
+  GDK_KEY_Hangul_PanSios* = 0x00000EF2
+  GDK_KEY_Hangul_KkogjiDalrinIeung* = 0x00000EF3
+  GDK_KEY_Hangul_SunkyeongeumPhieuf* = 0x00000EF4
+  GDK_KEY_Hangul_YeorinHieuh* = 0x00000EF5
+  GDK_KEY_Hangul_AraeA* = 0x00000EF6
+  GDK_KEY_Hangul_AraeAE* = 0x00000EF7
+  GDK_KEY_Hangul_J_PanSios* = 0x00000EF8
+  GDK_KEY_Hangul_J_KkogjiDalrinIeung* = 0x00000EF9
+  GDK_KEY_Hangul_J_YeorinHieuh* = 0x00000EFA
+  GDK_KEY_Korean_Won* = 0x00000EFF
+  GDK_KEY_EcuSign* = 0x000020A0
+  GDK_KEY_ColonSign* = 0x000020A1
+  GDK_KEY_CruzeiroSign* = 0x000020A2
+  GDK_KEY_FFrancSign* = 0x000020A3
+  GDK_KEY_LiraSign* = 0x000020A4
+  GDK_KEY_MillSign* = 0x000020A5
+  GDK_KEY_NairaSign* = 0x000020A6
+  GDK_KEY_PesetaSign* = 0x000020A7
+  GDK_KEY_RupeeSign* = 0x000020A8
+  GDK_KEY_WonSign* = 0x000020A9
+  GDK_KEY_NewSheqelSign* = 0x000020AA
+  GDK_KEY_DongSign* = 0x000020AB
+  GDK_KEY_EuroSign* = 0x000020AC
+
+proc gdk_pango_context_get_for_screen*(screen: PGdkScreen): PPangoContext{.
+    cdecl, dynlib: gdklib, importc: "gdk_pango_context_get_for_screen".}
+proc gdk_pango_context_set_colormap*(context: PPangoContext, 
+                                     colormap: PGdkColormap){.cdecl, 
+    dynlib: gdklib, importc: "gdk_pango_context_set_colormap".}
+proc gdk_pango_layout_line_get_clip_region*(line: PPangoLayoutLine, 
+    x_origin: gint, y_origin: gint, index_ranges: Pgint, n_ranges: gint): PGdkRegion{.
+    cdecl, dynlib: gdklib, importc: "gdk_pango_layout_line_get_clip_region".}
+proc gdk_pango_layout_get_clip_region*(layout: PPangoLayout, x_origin: gint, 
+                                       y_origin: gint, index_ranges: Pgint, 
+                                       n_ranges: gint): PGdkRegion{.cdecl, 
+    dynlib: gdklib, importc: "gdk_pango_layout_get_clip_region".}
+proc gdk_pango_attr_stipple_new*(stipple: PGdkBitmap): PPangoAttribute{.cdecl, 
+    dynlib: gdklib, importc: "gdk_pango_attr_stipple_new".}
+proc gdk_pango_attr_embossed_new*(embossed: gboolean): PPangoAttribute{.cdecl, 
+    dynlib: gdklib, importc: "gdk_pango_attr_embossed_new".}
+proc gdk_pixbuf_render_threshold_alpha*(pixbuf: PGdkPixbuf, bitmap: PGdkBitmap, 
+                                        src_x: int32, src_y: int32, 
+                                        dest_x: int32, dest_y: int32, 
+                                        width: int32, height: int32, 
+                                        alpha_threshold: int32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_pixbuf_render_threshold_alpha".}
+proc gdk_pixbuf_render_to_drawable*(pixbuf: PGdkPixbuf, drawable: PGdkDrawable, 
+                                    gc: PGdkGC, src_x: int32, src_y: int32, 
+                                    dest_x: int32, dest_y: int32, width: int32, 
+                                    height: int32, dither: TGdkRgbDither, 
+                                    x_dither: int32, y_dither: int32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_pixbuf_render_to_drawable".}
+proc gdk_pixbuf_render_to_drawable_alpha*(pixbuf: PGdkPixbuf, 
+    drawable: PGdkDrawable, src_x: int32, src_y: int32, dest_x: int32, 
+    dest_y: int32, width: int32, height: int32, alpha_mode: TGdkPixbufAlphaMode, 
+    alpha_threshold: int32, dither: TGdkRgbDither, x_dither: int32, 
+    y_dither: int32){.cdecl, dynlib: gdklib, 
+                      importc: "gdk_pixbuf_render_to_drawable_alpha".}
+proc gdk_pixbuf_render_pixmap_and_mask_for_colormap*(pixbuf: PGdkPixbuf, 
+    colormap: PGdkColormap, n: var PGdkPixmap, nasdfdsafw4e: var PGdkBitmap, 
+    alpha_threshold: int32){.cdecl, dynlib: gdklib, importc: "gdk_pixbuf_render_pixmap_and_mask_for_colormap".}
+proc gdk_pixbuf_get_from_drawable*(dest: PGdkPixbuf, src: PGdkDrawable, 
+                                   cmap: PGdkColormap, src_x: int32, 
+                                   src_y: int32, dest_x: int32, dest_y: int32, 
+                                   width: int32, height: int32): PGdkPixbuf{.
+    cdecl, dynlib: gdklib, importc: "gdk_pixbuf_get_from_drawable".}
+proc gdk_pixbuf_get_from_image*(dest: PGdkPixbuf, src: PGdkImage, 
+                                cmap: PGdkColormap, src_x: int32, src_y: int32, 
+                                dest_x: int32, dest_y: int32, width: int32, 
+                                height: int32): PGdkPixbuf{.cdecl, 
+    dynlib: gdklib, importc: "gdk_pixbuf_get_from_image".}
+proc GDK_TYPE_PIXMAP*(): GType
+proc GDK_PIXMAP*(anObject: Pointer): PGdkPixmap
+proc GDK_PIXMAP_CLASS*(klass: Pointer): PGdkPixmapObjectClass
+proc GDK_IS_PIXMAP*(anObject: Pointer): bool
+proc GDK_IS_PIXMAP_CLASS*(klass: Pointer): bool
+proc GDK_PIXMAP_GET_CLASS*(obj: Pointer): PGdkPixmapObjectClass
+proc GDK_PIXMAP_OBJECT*(anObject: Pointer): PGdkPixmapObject
+proc gdk_pixmap_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_pixmap_get_type".}
+proc gdk_pixmap_new*(window: PGdkWindow, width: gint, height: gint, depth: gint): PGdkPixmap{.
+    cdecl, dynlib: gdklib, importc: "gdk_pixmap_new".}
+proc gdk_bitmap_create_from_data*(window: PGdkWindow, data: cstring, width: gint, 
+                                  height: gint): PGdkBitmap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_bitmap_create_from_data".}
+proc gdk_pixmap_create_from_data*(window: PGdkWindow, data: cstring, width: gint, 
+                                  height: gint, depth: gint, fg: PGdkColor, 
+                                  bg: PGdkColor): PGdkPixmap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_pixmap_create_from_data".}
+proc gdk_pixmap_create_from_xpm*(window: PGdkWindow, k: var PGdkBitmap, 
+                                 transparent_color: PGdkColor, filename: cstring): PGdkPixmap{.
+    cdecl, dynlib: gdklib, importc: "gdk_pixmap_create_from_xpm".}
+proc gdk_pixmap_colormap_create_from_xpm*(window: PGdkWindow, 
+    colormap: PGdkColormap, k: var PGdkBitmap, transparent_color: PGdkColor, 
+    filename: cstring): PGdkPixmap{.cdecl, dynlib: gdklib, importc: "gdk_pixmap_colormap_create_from_xpm".}
+proc gdk_pixmap_create_from_xpm_d*(window: PGdkWindow, k: var PGdkBitmap, 
+                                   transparent_color: PGdkColor, data: PPgchar): PGdkPixmap{.
+    cdecl, dynlib: gdklib, importc: "gdk_pixmap_create_from_xpm_d".}
+proc gdk_pixmap_colormap_create_from_xpm_d*(window: PGdkWindow, 
+    colormap: PGdkColormap, k: var PGdkBitmap, transparent_color: PGdkColor, 
+    data: PPgchar): PGdkPixmap{.cdecl, dynlib: gdklib, importc: "gdk_pixmap_colormap_create_from_xpm_d".}
+proc gdk_pixmap_foreign_new_for_display*(display: PGdkDisplay, 
+    anid: TGdkNativeWindow): PGdkPixmap{.cdecl, dynlib: gdklib, 
+    importc: "gdk_pixmap_foreign_new_for_display".}
+proc gdk_pixmap_lookup_for_display*(display: PGdkDisplay, anid: TGdkNativeWindow): PGdkPixmap{.
+    cdecl, dynlib: gdklib, importc: "gdk_pixmap_lookup_for_display".}
+proc gdk_atom_intern*(atom_name: cstring, only_if_exists: gboolean): TGdkAtom{.
+    cdecl, dynlib: gdklib, importc: "gdk_atom_intern".}
+proc gdk_atom_name*(atom: TGdkAtom): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_atom_name".}
+proc gdk_property_get*(window: PGdkWindow, `property`: TGdkAtom, 
+                       `type`: TGdkAtom, offset: gulong, length: gulong, 
+                       pdelete: gint, actual_property_type: PGdkAtom, 
+                       actual_format: Pgint, actual_length: Pgint, 
+                       data: PPguchar): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_property_get".}
+proc gdk_property_change*(window: PGdkWindow, `property`: TGdkAtom, 
+                          `type`: TGdkAtom, format: gint, mode: TGdkPropMode, 
+                          data: Pguchar, nelements: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_property_change".}
+proc gdk_property_delete*(window: PGdkWindow, `property`: TGdkAtom){.cdecl, 
+    dynlib: gdklib, importc: "gdk_property_delete".}
+proc gdk_text_property_to_text_list_for_display*(display: PGdkDisplay, 
+    encoding: TGdkAtom, format: gint, text: Pguchar, length: gint, 
+    t: var PPgchar): gint{.cdecl, dynlib: gdklib, importc: "gdk_text_property_to_text_list_for_display".}
+proc gdk_text_property_to_utf8_list_for_display*(display: PGdkDisplay, 
+    encoding: TGdkAtom, format: gint, text: Pguchar, length: gint, 
+    t: var PPgchar): gint{.cdecl, dynlib: gdklib, importc: "gdk_text_property_to_utf8_list_for_display".}
+proc gdk_utf8_to_string_target*(str: cstring): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_utf8_to_string_target".}
+proc gdk_string_to_compound_text_for_display*(display: PGdkDisplay, str: cstring, 
+    encoding: PGdkAtom, format: Pgint, ctext: PPguchar, length: Pgint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_string_to_compound_text_for_display".}
+proc gdk_utf8_to_compound_text_for_display*(display: PGdkDisplay, str: cstring, 
+    encoding: PGdkAtom, format: Pgint, ctext: PPguchar, length: Pgint): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_utf8_to_compound_text_for_display".}
+proc gdk_free_text_list*(list: PPgchar){.cdecl, dynlib: gdklib, 
+    importc: "gdk_free_text_list".}
+proc gdk_free_compound_text*(ctext: Pguchar){.cdecl, dynlib: gdklib, 
+    importc: "gdk_free_compound_text".}
+proc gdk_region_new*(): PGdkRegion{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_region_new".}
+proc gdk_region_polygon*(points: PGdkPoint, npoints: gint, 
+                         fill_rule: TGdkFillRule): PGdkRegion{.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_polygon".}
+proc gdk_region_copy*(region: PGdkRegion): PGdkRegion{.cdecl, dynlib: gdklib, 
+    importc: "gdk_region_copy".}
+proc gdk_region_rectangle*(rectangle: PGdkRectangle): PGdkRegion{.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_rectangle".}
+proc gdk_region_destroy*(region: PGdkRegion){.cdecl, dynlib: gdklib, 
+    importc: "gdk_region_destroy".}
+proc gdk_region_get_clipbox*(region: PGdkRegion, rectangle: PGdkRectangle){.
+    cdecl, dynlib: gdklib, importc: "gdk_region_get_clipbox".}
+proc gdk_region_get_rectangles*(region: PGdkRegion, s: var PGdkRectangle, 
+                                n_rectangles: Pgint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_region_get_rectangles".}
+proc gdk_region_empty*(region: PGdkRegion): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_region_empty".}
+proc gdk_region_equal*(region1: PGdkRegion, region2: PGdkRegion): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_region_equal".}
+proc gdk_region_point_in*(region: PGdkRegion, x: int32, y: int32): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_region_point_in".}
+proc gdk_region_rect_in*(region: PGdkRegion, rect: PGdkRectangle): TGdkOverlapType{.
+    cdecl, dynlib: gdklib, importc: "gdk_region_rect_in".}
+proc gdk_region_offset*(region: PGdkRegion, dx: gint, dy: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_offset".}
+proc gdk_region_shrink*(region: PGdkRegion, dx: gint, dy: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_shrink".}
+proc gdk_region_union_with_rect*(region: PGdkRegion, rect: PGdkRectangle){.
+    cdecl, dynlib: gdklib, importc: "gdk_region_union_with_rect".}
+proc gdk_region_intersect*(source1: PGdkRegion, source2: PGdkRegion){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_intersect".}
+proc gdk_region_union*(source1: PGdkRegion, source2: PGdkRegion){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_union".}
+proc gdk_region_subtract*(source1: PGdkRegion, source2: PGdkRegion){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_subtract".}
+proc gdk_region_xor*(source1: PGdkRegion, source2: PGdkRegion){.cdecl, 
+    dynlib: gdklib, importc: "gdk_region_xor".}
+proc gdk_region_spans_intersect_foreach*(region: PGdkRegion, spans: PGdkSpan, 
+    n_spans: int32, sorted: gboolean, `function`: TGdkSpanFunc, data: gpointer){.
+    cdecl, dynlib: gdklib, importc: "gdk_region_spans_intersect_foreach".}
+proc gdk_rgb_find_color*(colormap: PGdkColormap, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_rgb_find_color".}
+proc gdk_draw_rgb_image*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, y: gint, 
+                         width: gint, height: gint, dith: TGdkRgbDither, 
+                         rgb_buf: Pguchar, rowstride: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_draw_rgb_image".}
+proc gdk_draw_rgb_image_dithalign*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, 
+                                   y: gint, width: gint, height: gint, 
+                                   dith: TGdkRgbDither, rgb_buf: Pguchar, 
+                                   rowstride: gint, xdith: gint, ydith: gint){.
+    cdecl, dynlib: gdklib, importc: "gdk_draw_rgb_image_dithalign".}
+proc gdk_draw_rgb_32_image*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, 
+                            y: gint, width: gint, height: gint, 
+                            dith: TGdkRgbDither, buf: Pguchar, rowstride: gint){.
+    cdecl, dynlib: gdklib, importc: "gdk_draw_rgb_32_image".}
+proc gdk_draw_rgb_32_image_dithalign*(drawable: PGdkDrawable, gc: PGdkGC, 
+                                      x: gint, y: gint, width: gint, 
+                                      height: gint, dith: TGdkRgbDither, 
+                                      buf: Pguchar, rowstride: gint, 
+                                      xdith: gint, ydith: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_draw_rgb_32_image_dithalign".}
+proc gdk_draw_gray_image*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, y: gint, 
+                          width: gint, height: gint, dith: TGdkRgbDither, 
+                          buf: Pguchar, rowstride: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_gray_image".}
+proc gdk_draw_indexed_image*(drawable: PGdkDrawable, gc: PGdkGC, x: gint, 
+                             y: gint, width: gint, height: gint, 
+                             dith: TGdkRgbDither, buf: Pguchar, rowstride: gint, 
+                             cmap: PGdkRgbCmap){.cdecl, dynlib: gdklib, 
+    importc: "gdk_draw_indexed_image".}
+proc gdk_rgb_cmap_new*(colors: Pguint32, n_colors: gint): PGdkRgbCmap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_rgb_cmap_new".}
+proc gdk_rgb_cmap_free*(cmap: PGdkRgbCmap){.cdecl, dynlib: gdklib, 
+    importc: "gdk_rgb_cmap_free".}
+proc gdk_rgb_set_verbose*(verbose: gboolean){.cdecl, dynlib: gdklib, 
+    importc: "gdk_rgb_set_verbose".}
+proc gdk_rgb_set_install*(install: gboolean){.cdecl, dynlib: gdklib, 
+    importc: "gdk_rgb_set_install".}
+proc gdk_rgb_set_min_colors*(min_colors: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_rgb_set_min_colors".}
+proc GDK_TYPE_DISPLAY*(): GType
+proc GDK_DISPLAY_OBJECT*(anObject: pointer): PGdkDisplay
+proc GDK_DISPLAY_CLASS*(klass: pointer): PGdkDisplayClass
+proc GDK_IS_DISPLAY*(anObject: pointer): bool
+proc GDK_IS_DISPLAY_CLASS*(klass: pointer): bool
+proc GDK_DISPLAY_GET_CLASS*(obj: pointer): PGdkDisplayClass
+proc gdk_display_open*(display_name: cstring): PGdkDisplay{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_open".}
+proc gdk_display_get_name*(display: PGdkDisplay): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_display_get_name".}
+proc gdk_display_get_n_screens*(display: PGdkDisplay): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_get_n_screens".}
+proc gdk_display_get_screen*(display: PGdkDisplay, screen_num: gint): PGdkScreen{.
+    cdecl, dynlib: gdklib, importc: "gdk_display_get_screen".}
+proc gdk_display_get_default_screen*(display: PGdkDisplay): PGdkScreen{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_get_default_screen".}
+proc gdk_display_pointer_ungrab*(display: PGdkDisplay, time: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_pointer_ungrab".}
+proc gdk_display_keyboard_ungrab*(display: PGdkDisplay, time: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_keyboard_ungrab".}
+proc gdk_display_pointer_is_grabbed*(display: PGdkDisplay): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_pointer_is_grabbed".}
+proc gdk_display_beep*(display: PGdkDisplay){.cdecl, dynlib: gdklib, 
+    importc: "gdk_display_beep".}
+proc gdk_display_sync*(display: PGdkDisplay){.cdecl, dynlib: gdklib, 
+    importc: "gdk_display_sync".}
+proc gdk_display_close*(display: PGdkDisplay){.cdecl, dynlib: gdklib, 
+    importc: "gdk_display_close".}
+proc gdk_display_list_devices*(display: PGdkDisplay): PGList{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_list_devices".}
+proc gdk_display_get_event*(display: PGdkDisplay): PGdkEvent{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_get_event".}
+proc gdk_display_peek_event*(display: PGdkDisplay): PGdkEvent{.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_peek_event".}
+proc gdk_display_put_event*(display: PGdkDisplay, event: PGdkEvent){.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_put_event".}
+proc gdk_display_add_client_message_filter*(display: PGdkDisplay, 
+    message_type: TGdkAtom, func: TGdkFilterFunc, data: gpointer){.cdecl, 
+    dynlib: gdklib, importc: "gdk_display_add_client_message_filter".}
+proc gdk_display_set_double_click_time*(display: PGdkDisplay, msec: guint){.
+    cdecl, dynlib: gdklib, importc: "gdk_display_set_double_click_time".}
+proc gdk_display_set_sm_client_id*(display: PGdkDisplay, sm_client_id: cstring){.
+    cdecl, dynlib: gdklib, importc: "gdk_display_set_sm_client_id".}
+proc gdk_set_default_display*(display: PGdkDisplay){.cdecl, dynlib: gdklib, 
+    importc: "gdk_set_default_display".}
+proc gdk_get_default_display*(): PGdkDisplay{.cdecl, dynlib: gdklib, 
+    importc: "gdk_get_default_display".}
+proc GDK_TYPE_SCREEN*(): GType
+proc GDK_SCREEN*(anObject: Pointer): PGdkScreen
+proc GDK_SCREEN_CLASS*(klass: Pointer): PGdkScreenClass
+proc GDK_IS_SCREEN*(anObject: Pointer): bool
+proc GDK_IS_SCREEN_CLASS*(klass: Pointer): bool
+proc GDK_SCREEN_GET_CLASS*(obj: Pointer): PGdkScreenClass
+proc gdk_screen_get_default_colormap*(screen: PGdkScreen): PGdkColormap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_default_colormap".}
+proc gdk_screen_set_default_colormap*(screen: PGdkScreen, colormap: PGdkColormap){.
+    cdecl, dynlib: gdklib, importc: "gdk_screen_set_default_colormap".}
+proc gdk_screen_get_system_colormap*(screen: PGdkScreen): PGdkColormap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_system_colormap".}
+proc gdk_screen_get_system_visual*(screen: PGdkScreen): PGdkVisual{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_system_visual".}
+proc gdk_screen_get_rgb_colormap*(screen: PGdkScreen): PGdkColormap{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_rgb_colormap".}
+proc gdk_screen_get_rgb_visual*(screen: PGdkScreen): PGdkVisual{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_rgb_visual".}
+proc gdk_screen_get_root_window*(screen: PGdkScreen): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_root_window".}
+proc gdk_screen_get_display*(screen: PGdkScreen): PGdkDisplay{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_display".}
+proc gdk_screen_get_number*(screen: PGdkScreen): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_get_number".}
+proc gdk_screen_get_window_at_pointer*(screen: PGdkScreen, win_x: Pgint, 
+                                       win_y: Pgint): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_window_at_pointer".}
+proc gdk_screen_get_width*(screen: PGdkScreen): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_get_width".}
+proc gdk_screen_get_height*(screen: PGdkScreen): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_get_height".}
+proc gdk_screen_get_width_mm*(screen: PGdkScreen): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_get_width_mm".}
+proc gdk_screen_get_height_mm*(screen: PGdkScreen): gint{.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_get_height_mm".}
+proc gdk_screen_close*(screen: PGdkScreen){.cdecl, dynlib: gdklib, 
+    importc: "gdk_screen_close".}
+proc gdk_screen_list_visuals*(screen: PGdkScreen): PGList{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_list_visuals".}
+proc gdk_screen_get_toplevel_windows*(screen: PGdkScreen): PGList{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_toplevel_windows".}
+proc gdk_screen_get_n_monitors*(screen: PGdkScreen): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_n_monitors".}
+proc gdk_screen_get_monitor_geometry*(screen: PGdkScreen, monitor_num: gint, 
+                                      dest: PGdkRectangle){.cdecl, 
+    dynlib: gdklib, importc: "gdk_screen_get_monitor_geometry".}
+proc gdk_screen_get_monitor_at_point*(screen: PGdkScreen, x: gint, y: gint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_screen_get_monitor_at_point".}
+proc gdk_screen_get_monitor_at_window*(screen: PGdkScreen, window: PGdkWindow): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_screen_get_monitor_at_window".}
+proc gdk_screen_broadcast_client_message*(screen: PGdkScreen, event: PGdkEvent){.
+    cdecl, dynlib: gdklib, importc: "gdk_screen_broadcast_client_message".}
+proc gdk_get_default_screen*(): PGdkScreen{.cdecl, dynlib: gdklib, 
+    importc: "gdk_get_default_screen".}
+proc gdk_screen_get_setting*(screen: PGdkScreen, name: cstring, value: PGValue): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_screen_get_setting".}
+proc GDK_SELECTION_PRIMARY*(): TGdkAtom
+proc GDK_SELECTION_SECONDARY*(): TGdkAtom
+proc GDK_SELECTION_CLIPBOARD*(): TGdkAtom
+proc GDK_TARGET_BITMAP*(): TGdkAtom
+proc GDK_TARGET_COLORMAP*(): TGdkAtom
+proc GDK_TARGET_DRAWABLE*(): TGdkAtom
+proc GDK_TARGET_PIXMAP*(): TGdkAtom
+proc GDK_TARGET_STRING*(): TGdkAtom
+proc GDK_SELECTION_TYPE_ATOM*(): TGdkAtom
+proc GDK_SELECTION_TYPE_BITMAP*(): TGdkAtom
+proc GDK_SELECTION_TYPE_COLORMAP*(): TGdkAtom
+proc GDK_SELECTION_TYPE_DRAWABLE*(): TGdkAtom
+proc GDK_SELECTION_TYPE_INTEGER*(): TGdkAtom
+proc GDK_SELECTION_TYPE_PIXMAP*(): TGdkAtom
+proc GDK_SELECTION_TYPE_WINDOW*(): TGdkAtom
+proc GDK_SELECTION_TYPE_STRING*(): TGdkAtom
+proc gdk_selection_owner_set_for_display*(display: PGdkDisplay, 
+    owner: PGdkWindow, selection: TGdkAtom, time: guint32, send_event: gboolean): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_selection_owner_set_for_display".}
+proc gdk_selection_owner_get_for_display*(display: PGdkDisplay, 
+    selection: TGdkAtom): PGdkWindow{.cdecl, dynlib: gdklib, importc: "gdk_selection_owner_get_for_display".}
+proc gdk_selection_convert*(requestor: PGdkWindow, selection: TGdkAtom, 
+                            target: TGdkAtom, time: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_selection_convert".}
+proc gdk_selection_property_get*(requestor: PGdkWindow, data: PPguchar, 
+                                 prop_type: PGdkAtom, prop_format: Pgint): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_selection_property_get".}
+proc gdk_selection_send_notify_for_display*(display: PGdkDisplay, 
+    requestor: guint32, selection: TGdkAtom, target: TGdkAtom, 
+    `property`: TGdkAtom, time: guint32){.cdecl, dynlib: gdklib, 
+    importc: "gdk_selection_send_notify_for_display".}
+const 
+  GDK_CURRENT_TIME* = 0
+  GDK_PARENT_RELATIVE* = 1
+  GDK_OK* = 0
+  GDK_ERROR* = - (1)
+  GDK_ERROR_PARAM* = - (2)
+  GDK_ERROR_FILE* = - (3)
+  GDK_ERROR_MEM* = - (4)
+  GDK_SHIFT_MASK* = 1 shl 0
+  GDK_LOCK_MASK* = 1 shl 1
+  GDK_CONTROL_MASK* = 1 shl 2
+  GDK_MOD1_MASK* = 1 shl 3
+  GDK_MOD2_MASK* = 1 shl 4
+  GDK_MOD3_MASK* = 1 shl 5
+  GDK_MOD4_MASK* = 1 shl 6
+  GDK_MOD5_MASK* = 1 shl 7
+  GDK_BUTTON1_MASK* = 1 shl 8
+  GDK_BUTTON2_MASK* = 1 shl 9
+  GDK_BUTTON3_MASK* = 1 shl 10
+  GDK_BUTTON4_MASK* = 1 shl 11
+  GDK_BUTTON5_MASK* = 1 shl 12
+  GDK_RELEASE_MASK* = 1 shl 30
+  GDK_MODIFIER_MASK* = ord(GDK_RELEASE_MASK) or 0x00001FFF
+  GDK_INPUT_READ* = 1 shl 0
+  GDK_INPUT_WRITE* = 1 shl 1
+  GDK_INPUT_EXCEPTION* = 1 shl 2
+  GDK_GRAB_SUCCESS* = 0
+  GDK_GRAB_ALREADY_GRABBED* = 1
+  GDK_GRAB_INVALID_TIME* = 2
+  GDK_GRAB_NOT_VIEWABLE* = 3
+  GDK_GRAB_FROZEN* = 4
+
+proc GDK_ATOM_TO_POINTER*(atom: TGdkAtom): Pointer
+proc GDK_POINTER_TO_ATOM*(p: Pointer): TGdkAtom
+proc `GDK_MAKE_ATOM`*(val: guint): TGdkAtom
+proc GDK_NONE*(): TGdkAtom
+proc GDK_TYPE_VISUAL*(): GType
+proc GDK_VISUAL*(anObject: Pointer): PGdkVisual
+proc GDK_VISUAL_CLASS*(klass: Pointer): PGdkVisualClass
+proc GDK_IS_VISUAL*(anObject: Pointer): bool
+proc GDK_IS_VISUAL_CLASS*(klass: Pointer): bool
+proc GDK_VISUAL_GET_CLASS*(obj: Pointer): PGdkVisualClass
+proc gdk_visual_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_visual_get_type".}
+const 
+  GDK_WA_TITLE* = 1 shl 1
+  GDK_WA_X* = 1 shl 2
+  GDK_WA_Y* = 1 shl 3
+  GDK_WA_CURSOR* = 1 shl 4
+  GDK_WA_COLORMAP* = 1 shl 5
+  GDK_WA_VISUAL* = 1 shl 6
+  GDK_WA_WMCLASS* = 1 shl 7
+  GDK_WA_NOREDIR* = 1 shl 8
+  GDK_HINT_POS* = 1 shl 0
+  GDK_HINT_MIN_SIZE* = 1 shl 1
+  GDK_HINT_MAX_SIZE* = 1 shl 2
+  GDK_HINT_BASE_SIZE* = 1 shl 3
+  GDK_HINT_ASPECT* = 1 shl 4
+  GDK_HINT_RESIZE_INC* = 1 shl 5
+  GDK_HINT_WIN_GRAVITY* = 1 shl 6
+  GDK_HINT_USER_POS* = 1 shl 7
+  GDK_HINT_USER_SIZE* = 1 shl 8
+  GDK_DECOR_ALL* = 1 shl 0
+  GDK_DECOR_BORDER* = 1 shl 1
+  GDK_DECOR_RESIZEH* = 1 shl 2
+  GDK_DECOR_TITLE* = 1 shl 3
+  GDK_DECOR_MENU* = 1 shl 4
+  GDK_DECOR_MINIMIZE* = 1 shl 5
+  GDK_DECOR_MAXIMIZE* = 1 shl 6
+  GDK_FUNC_ALL* = 1 shl 0
+  GDK_FUNC_RESIZE* = 1 shl 1
+  GDK_FUNC_MOVE* = 1 shl 2
+  GDK_FUNC_MINIMIZE* = 1 shl 3
+  GDK_FUNC_MAXIMIZE* = 1 shl 4
+  GDK_FUNC_CLOSE* = 1 shl 5
+  GDK_GRAVITY_NORTH_WEST* = 1
+  GDK_GRAVITY_NORTH* = 2
+  GDK_GRAVITY_NORTH_EAST* = 3
+  GDK_GRAVITY_WEST* = 4
+  GDK_GRAVITY_CENTER* = 5
+  GDK_GRAVITY_EAST* = 6
+  GDK_GRAVITY_SOUTH_WEST* = 7
+  GDK_GRAVITY_SOUTH* = 8
+  GDK_GRAVITY_SOUTH_EAST* = 9
+  GDK_GRAVITY_STATIC* = 10
+
+proc GDK_TYPE_WINDOW*(): GType
+proc GDK_WINDOW*(anObject: Pointer): PGdkWindow
+proc GDK_WINDOW_CLASS*(klass: Pointer): PGdkWindowObjectClass
+proc GDK_IS_WINDOW*(anObject: Pointer): bool
+proc GDK_IS_WINDOW_CLASS*(klass: Pointer): bool
+proc GDK_WINDOW_GET_CLASS*(obj: Pointer): PGdkWindowObjectClass
+proc GDK_WINDOW_OBJECT*(anObject: Pointer): PGdkWindowObject
+const 
+  bm_TGdkWindowObject_guffaw_gravity* = 0x00000001
+  bp_TGdkWindowObject_guffaw_gravity* = 0
+  bm_TGdkWindowObject_input_only* = 0x00000002
+  bp_TGdkWindowObject_input_only* = 1
+  bm_TGdkWindowObject_modal_hint* = 0x00000004
+  bp_TGdkWindowObject_modal_hint* = 2
+  bm_TGdkWindowObject_destroyed* = 0x00000018
+  bp_TGdkWindowObject_destroyed* = 3
+
+proc GdkWindowObject_guffaw_gravity*(a: var TGdkWindowObject): guint
+proc GdkWindowObject_set_guffaw_gravity*(a: var TGdkWindowObject, 
+    `guffaw_gravity`: guint)
+proc GdkWindowObject_input_only*(a: var TGdkWindowObject): guint
+proc GdkWindowObject_set_input_only*(a: var TGdkWindowObject, 
+                                     `input_only`: guint)
+proc GdkWindowObject_modal_hint*(a: var TGdkWindowObject): guint
+proc GdkWindowObject_set_modal_hint*(a: var TGdkWindowObject, 
+                                     `modal_hint`: guint)
+proc GdkWindowObject_destroyed*(a: var TGdkWindowObject): guint
+proc GdkWindowObject_set_destroyed*(a: var TGdkWindowObject, `destroyed`: guint)
+proc gdk_window_object_get_type*(): GType{.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_object_get_type".}
+proc gdk_window_new*(parent: PGdkWindow, attributes: PGdkWindowAttr, 
+                     attributes_mask: gint): PGdkWindow{.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_new".}
+proc gdk_window_destroy*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_destroy".}
+proc gdk_window_get_window_type*(window: PGdkWindow): TGdkWindowType{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_window_type".}
+proc gdk_window_at_pointer*(win_x: Pgint, win_y: Pgint): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_at_pointer".}
+proc gdk_window_show*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_show".}
+proc gdk_window_hide*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_hide".}
+proc gdk_window_withdraw*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_withdraw".}
+proc gdk_window_show_unraised*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_show_unraised".}
+proc gdk_window_move*(window: PGdkWindow, x: gint, y: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_move".}
+proc gdk_window_resize*(window: PGdkWindow, width: gint, height: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_resize".}
+proc gdk_window_move_resize*(window: PGdkWindow, x: gint, y: gint, width: gint, 
+                             height: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_move_resize".}
+proc gdk_window_reparent*(window: PGdkWindow, new_parent: PGdkWindow, x: gint, 
+                          y: gint){.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_window_reparent".}
+proc gdk_window_clear*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_clear".}
+proc gdk_window_clear_area*(window: PGdkWindow, x: gint, y: gint, width: gint, 
+                            height: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_clear_area".}
+proc gdk_window_clear_area_e*(window: PGdkWindow, x: gint, y: gint, width: gint, 
+                              height: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_clear_area_e".}
+proc gdk_window_raise*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_raise".}
+proc gdk_window_lower*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_lower".}
+proc gdk_window_focus*(window: PGdkWindow, timestamp: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_focus".}
+proc gdk_window_set_user_data*(window: PGdkWindow, user_data: gpointer){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_user_data".}
+proc gdk_window_set_override_redirect*(window: PGdkWindow, 
+                                       override_redirect: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_override_redirect".}
+proc gdk_window_add_filter*(window: PGdkWindow, `function`: TGdkFilterFunc, 
+                            data: gpointer){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_add_filter".}
+proc gdk_window_remove_filter*(window: PGdkWindow, `function`: TGdkFilterFunc, 
+                               data: gpointer){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_remove_filter".}
+proc gdk_window_scroll*(window: PGdkWindow, dx: gint, dy: gint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_scroll".}
+proc gdk_window_shape_combine_mask*(window: PGdkWindow, mask: PGdkBitmap, 
+                                    x: gint, y: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_shape_combine_mask".}
+proc gdk_window_shape_combine_region*(window: PGdkWindow, 
+                                      shape_region: PGdkRegion, offset_x: gint, 
+                                      offset_y: gint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_shape_combine_region".}
+proc gdk_window_set_child_shapes*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_set_child_shapes".}
+proc gdk_window_merge_child_shapes*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_merge_child_shapes".}
+proc gdk_window_is_visible*(window: PGdkWindow): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_is_visible".}
+proc gdk_window_is_viewable*(window: PGdkWindow): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_is_viewable".}
+proc gdk_window_get_state*(window: PGdkWindow): TGdkWindowState{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_state".}
+proc gdk_window_set_static_gravities*(window: PGdkWindow, use_static: gboolean): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_window_set_static_gravities".}
+proc gdk_window_foreign_new_for_display*(display: PGdkDisplay, 
+    anid: TGdkNativeWindow): PGdkWindow{.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_foreign_new_for_display".}
+proc gdk_window_lookup_for_display*(display: PGdkDisplay, anid: TGdkNativeWindow): PGdkWindow{.
+    cdecl, dynlib: gdklib, importc: "gdk_window_lookup_for_display".}
+proc gdk_window_set_type_hint*(window: PGdkWindow, hint: TGdkWindowTypeHint){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_set_type_hint".}
+proc gdk_window_set_modal_hint*(window: PGdkWindow, modal: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_modal_hint".}
+proc gdk_window_set_geometry_hints*(window: PGdkWindow, geometry: PGdkGeometry, 
+                                    geom_mask: TGdkWindowHints){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_geometry_hints".}
+proc gdk_set_sm_client_id*(sm_client_id: cstring){.cdecl, dynlib: gdklib, 
+    importc: "gdk_set_sm_client_id".}
+proc gdk_window_begin_paint_rect*(window: PGdkWindow, rectangle: PGdkRectangle){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_begin_paint_rect".}
+proc gdk_window_begin_paint_region*(window: PGdkWindow, region: PGdkRegion){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_begin_paint_region".}
+proc gdk_window_end_paint*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_end_paint".}
+proc gdk_window_set_title*(window: PGdkWindow, title: cstring){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_title".}
+proc gdk_window_set_role*(window: PGdkWindow, role: cstring){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_role".}
+proc gdk_window_set_transient_for*(window: PGdkWindow, parent: PGdkWindow){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_set_transient_for".}
+proc gdk_window_set_background*(window: PGdkWindow, color: PGdkColor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_background".}
+proc gdk_window_set_back_pixmap*(window: PGdkWindow, pixmap: PGdkPixmap, 
+                                 parent_relative: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_back_pixmap".}
+proc gdk_window_set_cursor*(window: PGdkWindow, cursor: PGdkCursor){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_cursor".}
+proc gdk_window_get_user_data*(window: PGdkWindow, data: gpointer){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_user_data".}
+proc gdk_window_get_geometry*(window: PGdkWindow, x: Pgint, y: Pgint, 
+                              width: Pgint, height: Pgint, depth: Pgint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_geometry".}
+proc gdk_window_get_position*(window: PGdkWindow, x: Pgint, y: Pgint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_position".}
+proc gdk_window_get_origin*(window: PGdkWindow, x: Pgint, y: Pgint): gint{.
+    cdecl, dynlib: gdklib, importc: "gdk_window_get_origin".}
+proc gdk_window_get_root_origin*(window: PGdkWindow, x: Pgint, y: Pgint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_root_origin".}
+proc gdk_window_get_frame_extents*(window: PGdkWindow, rect: PGdkRectangle){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_get_frame_extents".}
+proc gdk_window_get_pointer*(window: PGdkWindow, x: Pgint, y: Pgint, 
+                             mask: PGdkModifierType): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_pointer".}
+proc gdk_window_get_parent*(window: PGdkWindow): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_parent".}
+proc gdk_window_get_toplevel*(window: PGdkWindow): PGdkWindow{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_toplevel".}
+proc gdk_window_get_children*(window: PGdkWindow): PGList{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_children".}
+proc gdk_window_peek_children*(window: PGdkWindow): PGList{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_peek_children".}
+proc gdk_window_get_events*(window: PGdkWindow): TGdkEventMask{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_events".}
+proc gdk_window_set_events*(window: PGdkWindow, event_mask: TGdkEventMask){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_set_events".}
+proc gdk_window_set_icon_list*(window: PGdkWindow, pixbufs: PGList){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_icon_list".}
+proc gdk_window_set_icon*(window: PGdkWindow, icon_window: PGdkWindow, 
+                          pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_icon".}
+proc gdk_window_set_icon_name*(window: PGdkWindow, name: cstring){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_icon_name".}
+proc gdk_window_set_group*(window: PGdkWindow, leader: PGdkWindow){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_group".}
+proc gdk_window_set_decorations*(window: PGdkWindow, 
+                                 decorations: TGdkWMDecoration){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_set_decorations".}
+proc gdk_window_get_decorations*(window: PGdkWindow, 
+                                 decorations: PGdkWMDecoration): gboolean{.
+    cdecl, dynlib: gdklib, importc: "gdk_window_get_decorations".}
+proc gdk_window_set_functions*(window: PGdkWindow, functions: TGdkWMFunction){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_set_functions".}
+proc gdk_window_iconify*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_iconify".}
+proc gdk_window_deiconify*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_deiconify".}
+proc gdk_window_stick*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_stick".}
+proc gdk_window_unstick*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_unstick".}
+proc gdk_window_maximize*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_maximize".}
+proc gdk_window_unmaximize*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_unmaximize".}
+proc gdk_window_register_dnd*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_register_dnd".}
+proc gdk_window_begin_resize_drag*(window: PGdkWindow, edge: TGdkWindowEdge, 
+                                   button: gint, root_x: gint, root_y: gint, 
+                                   timestamp: guint32){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_begin_resize_drag".}
+proc gdk_window_begin_move_drag*(window: PGdkWindow, button: gint, root_x: gint, 
+                                 root_y: gint, timestamp: guint32){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_begin_move_drag".}
+proc gdk_window_invalidate_rect*(window: PGdkWindow, rect: PGdkRectangle, 
+                                 invalidate_children: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_invalidate_rect".}
+proc gdk_window_invalidate_region*(window: PGdkWindow, region: PGdkRegion, 
+                                   invalidate_children: gboolean){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_invalidate_region".}
+proc gdk_window_invalidate_maybe_recurse*(window: PGdkWindow, 
+    region: PGdkRegion, 
+    child_func: gdk_window_invalidate_maybe_recurse_child_func, 
+    user_data: gpointer){.cdecl, dynlib: gdklib, 
+                          importc: "gdk_window_invalidate_maybe_recurse".}
+proc gdk_window_get_update_area*(window: PGdkWindow): PGdkRegion{.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_update_area".}
+proc gdk_window_freeze_updates*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_freeze_updates".}
+proc gdk_window_thaw_updates*(window: PGdkWindow){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_thaw_updates".}
+proc gdk_window_process_all_updates*(){.cdecl, dynlib: gdklib, importc: "gdk_window_process_all_updates".}
+proc gdk_window_process_updates*(window: PGdkWindow, update_children: gboolean){.
+    cdecl, dynlib: gdklib, importc: "gdk_window_process_updates".}
+proc gdk_window_set_debug_updates*(setting: gboolean){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_set_debug_updates".}
+proc gdk_window_constrain_size*(geometry: PGdkGeometry, flags: guint, 
+                                width: gint, height: gint, new_width: Pgint, 
+                                new_height: Pgint){.cdecl, dynlib: gdklib, 
+    importc: "gdk_window_constrain_size".}
+proc gdk_window_get_internal_paint_info*(window: PGdkWindow, 
+    e: var PGdkDrawable, x_offset: Pgint, y_offset: Pgint){.cdecl, 
+    dynlib: gdklib, importc: "gdk_window_get_internal_paint_info".}
+proc gdk_set_pointer_hooks*(new_hooks: PGdkPointerHooks): PGdkPointerHooks{.
+    cdecl, dynlib: gdklib, importc: "gdk_set_pointer_hooks".}
+proc gdk_get_default_root_window*(): PGdkWindow{.cdecl, dynlib: gdklib, 
+    importc: "gdk_get_default_root_window".}
+proc gdk_parse_args*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: gdklib, 
+    importc: "gdk_parse_args".}
+proc gdk_init*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: gdklib, 
+    importc: "gdk_init".}
+proc gdk_init_check*(argc: Pgint, v: var PPgchar): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_init_check".}
+when not defined(GDK_DISABLE_DEPRECATED): 
+  proc gdk_exit(error_code: gint){.cdecl, dynlib: gdklib, importc: "gdk_exit".}
+proc gdk_set_locale*(): cstring{.cdecl, dynlib: gdklib, importc: "gdk_set_locale".}
+proc gdk_get_program_class*(): cstring{.cdecl, dynlib: gdklib, 
+                                        importc: "gdk_get_program_class".}
+proc gdk_set_program_class*(program_class: cstring){.cdecl, dynlib: gdklib, 
+    importc: "gdk_set_program_class".}
+proc gdk_error_trap_push*(){.cdecl, dynlib: gdklib, 
+                             importc: "gdk_error_trap_push".}
+proc gdk_error_trap_pop*(): gint{.cdecl, dynlib: gdklib, 
+                                  importc: "gdk_error_trap_pop".}
+when not defined(GDK_DISABLE_DEPRECATED): 
+  proc gdk_set_use_xshm(use_xshm: gboolean){.cdecl, dynlib: gdklib, 
+      importc: "gdk_set_use_xshm".}
+  proc gdk_get_use_xshm(): gboolean{.cdecl, dynlib: gdklib, 
+                                     importc: "gdk_get_use_xshm".}
+proc gdk_get_display*(): cstring{.cdecl, dynlib: gdklib, 
+                                 importc: "gdk_get_display".}
+proc gdk_get_display_arg_name*(): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_get_display_arg_name".}
+when not defined(GDK_DISABLE_DEPRECATED): 
+  proc gdk_input_add_full(source: gint, condition: TGdkInputCondition, 
+                          `function`: TGdkInputFunction, data: gpointer, 
+                          destroy: TGdkDestroyNotify): gint{.cdecl, 
+      dynlib: gdklib, importc: "gdk_input_add_full".}
+  proc gdk_input_add(source: gint, condition: TGdkInputCondition, 
+                     `function`: TGdkInputFunction, data: gpointer): gint{.
+      cdecl, dynlib: gdklib, importc: "gdk_input_add".}
+  proc gdk_input_remove(tag: gint){.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_input_remove".}
+proc gdk_pointer_grab*(window: PGdkWindow, owner_events: gboolean, 
+                       event_mask: TGdkEventMask, confine_to: PGdkWindow, 
+                       cursor: PGdkCursor, time: guint32): TGdkGrabStatus{.
+    cdecl, dynlib: gdklib, importc: "gdk_pointer_grab".}
+proc gdk_keyboard_grab*(window: PGdkWindow, owner_events: gboolean, 
+                        time: guint32): TGdkGrabStatus{.cdecl, dynlib: gdklib, 
+    importc: "gdk_keyboard_grab".}
+when not defined(GDK_MULTIHEAD_SAFE): 
+  proc gdk_pointer_ungrab(time: guint32){.cdecl, dynlib: gdklib, 
+      importc: "gdk_pointer_ungrab".}
+  proc gdk_keyboard_ungrab(time: guint32){.cdecl, dynlib: gdklib, 
+      importc: "gdk_keyboard_ungrab".}
+  proc gdk_pointer_is_grabbed(): gboolean{.cdecl, dynlib: gdklib, 
+      importc: "gdk_pointer_is_grabbed".}
+  proc gdk_screen_width(): gint{.cdecl, dynlib: gdklib, 
+                                 importc: "gdk_screen_width".}
+  proc gdk_screen_height(): gint{.cdecl, dynlib: gdklib, 
+                                  importc: "gdk_screen_height".}
+  proc gdk_screen_width_mm(): gint{.cdecl, dynlib: gdklib, 
+                                    importc: "gdk_screen_width_mm".}
+  proc gdk_screen_height_mm(): gint{.cdecl, dynlib: gdklib, 
+                                     importc: "gdk_screen_height_mm".}
+  proc gdk_beep(){.cdecl, dynlib: gdklib, importc: "gdk_beep".}
+proc gdk_flush*(){.cdecl, dynlib: gdklib, importc: "gdk_flush".}
+when not defined(GDK_MULTIHEAD_SAFE): 
+  proc gdk_set_double_click_time(msec: guint){.cdecl, dynlib: gdklib, 
+      importc: "gdk_set_double_click_time".}
+proc gdk_rectangle_intersect*(src1: PGdkRectangle, src2: PGdkRectangle, 
+                              dest: PGdkRectangle): gboolean{.cdecl, 
+    dynlib: gdklib, importc: "gdk_rectangle_intersect".}
+proc gdk_rectangle_union*(src1: PGdkRectangle, src2: PGdkRectangle, 
+                          dest: PGdkRectangle){.cdecl, dynlib: gdklib, 
+    importc: "gdk_rectangle_union".}
+proc gdk_rectangle_get_type*(): GType{.cdecl, dynlib: gdklib, 
+                                       importc: "gdk_rectangle_get_type".}
+proc GDK_TYPE_RECTANGLE*(): GType
+proc gdk_wcstombs*(src: PGdkWChar): cstring{.cdecl, dynlib: gdklib, 
+    importc: "gdk_wcstombs".}
+proc gdk_mbstowcs*(dest: PGdkWChar, src: cstring, dest_max: gint): gint{.cdecl, 
+    dynlib: gdklib, importc: "gdk_mbstowcs".}
+when not defined(GDK_MULTIHEAD_SAFE): 
+  proc gdk_event_send_client_message(event: PGdkEvent, xid: guint32): gboolean{.
+      cdecl, dynlib: gdklib, importc: "gdk_event_send_client_message".}
+  proc gdk_event_send_clientmessage_toall(event: PGdkEvent){.cdecl, 
+      dynlib: gdklib, importc: "gdk_event_send_clientmessage_toall".}
+proc gdk_event_send_client_message_for_display*(display: PGdkDisplay, 
+    event: PGdkEvent, xid: guint32): gboolean{.cdecl, dynlib: gdklib, 
+    importc: "gdk_event_send_client_message_for_display".}
+proc gdk_threads_enter*(){.cdecl, dynlib: gdklib, importc: "gdk_threads_enter".}
+proc gdk_threads_leave*(){.cdecl, dynlib: gdklib, importc: "gdk_threads_leave".}
+proc gdk_threads_init*(){.cdecl, dynlib: gdklib, importc: "gdk_threads_init".}
+
+proc GDK_TYPE_RECTANGLE*(): GType = 
+  result = gdk_rectangle_get_type()
+
+proc GDK_TYPE_COLORMAP*(): GType = 
+  result = gdk_colormap_get_type()
+
+proc GDK_COLORMAP*(anObject: pointer): PGdkColormap = 
+  result = cast[PGdkColormap](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_COLORMAP()))
+
+proc GDK_COLORMAP_CLASS*(klass: pointer): PGdkColormapClass = 
+  result = cast[PGdkColormapClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_COLORMAP()))
+
+proc GDK_IS_COLORMAP*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_COLORMAP())
+
+proc GDK_IS_COLORMAP_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_COLORMAP())
+
+proc GDK_COLORMAP_GET_CLASS*(obj: pointer): PGdkColormapClass = 
+  result = cast[PGdkColormapClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_COLORMAP()))
+
+proc GDK_TYPE_COLOR*(): GType = 
+  result = gdk_color_get_type()
+
+proc gdk_cursor_destroy*(cursor: PGdkCursor) = 
+  gdk_cursor_unref(cursor)
+
+proc GDK_TYPE_CURSOR*(): GType = 
+  result = gdk_cursor_get_type()
+
+proc GDK_TYPE_DRAG_CONTEXT*(): GType = 
+  result = gdk_drag_context_get_type()
+
+proc GDK_DRAG_CONTEXT*(anObject: Pointer): PGdkDragContext = 
+  result = cast[PGdkDragContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      GDK_TYPE_DRAG_CONTEXT()))
+
+proc GDK_DRAG_CONTEXT_CLASS*(klass: Pointer): PGdkDragContextClass = 
+  result = cast[PGdkDragContextClass](G_TYPE_CHECK_CLASS_CAST(klass, 
+      GDK_TYPE_DRAG_CONTEXT()))
+
+proc GDK_IS_DRAG_CONTEXT*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_DRAG_CONTEXT())
+
+proc GDK_IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_DRAG_CONTEXT())
+
+proc GDK_DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PGdkDragContextClass = 
+  result = cast[PGdkDragContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, 
+      GDK_TYPE_DRAG_CONTEXT()))
+
+proc gdkregion_EXTENTCHECK*(r1, r2: PGdkRegionBox): bool = 
+  result = (int(r1.x2) > r2.x1) and (int(r1.x1) < r2.x2) and
+      (int(r1.y2) > r2.y1) and (int(r1.y1) < r2.y2)
+
+proc gdkregion_EXTENTS*(r: PGdkRegionBox, idRect: PGdkRegion) = 
+  if (int(r.x1) < idRect.extents.x1): 
+    idRect.extents.x1 = r.x1
+  if int(r.y1) < idRect.extents.y1: 
+    idRect.extents.y1 = r.y1
+  if int(r.x2) > idRect.extents.x2: 
+    idRect.extents.x2 = r.x2
+
+proc gdkregion_MEMCHECK*(reg: PGdkRegion, ARect, firstrect: var PGdkRegionBox): bool = 
+  nil
+
+proc gdkregion_CHECK_PREVIOUS*(Reg: PGdkRegion, R: PGdkRegionBox, 
+                               Rx1, Ry1, Rx2, Ry2: gint): bool = 
+  nil
+
+proc gdkregion_ADDRECT*(reg: PGdkRegion, r: PGdkRegionBox, 
+                        rx1, ry1, rx2, ry2: gint) = 
+  if ((int(rx1) < rx2) and (int(ry1) < ry2) and
+      gdkregion_CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): 
+    r.x1 = rx1
+    r.y1 = ry1
+    r.x2 = rx2
+    r.y2 = ry2
+
+proc gdkregion_ADDRECTNOX*(reg: PGdkRegion, r: PGdkRegionBox, 
+                           rx1, ry1, rx2, ry2: gint) = 
+  if ((int(rx1) < rx2) and (int(ry1) < ry2) and
+      gdkregion_CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): 
+    r.x1 = rx1
+    r.y1 = ry1
+    r.x2 = rx2
+    r.y2 = ry2
+    inc(reg . numRects)
+
+proc gdkregion_EMPTY_REGION*(pReg: PGdkRegion): bool = 
+  result = pReg.numRects == 0
+
+proc gdkregion_REGION_NOT_EMPTY*(pReg: PGdkRegion): bool = 
+  result = pReg.numRects != 0
+
+proc gdkregion_INBOX*(r: TGdkRegionBox, x, y: gint): bool = 
+  result = (((int(r.x2) > x) and (int(r.x1) <= x)) and 
+            (int(r.y2) > y)) and (int(r.y1) <= y)
+
+proc GDK_TYPE_DRAWABLE*(): GType = 
+  result = gdk_drawable_get_type()
+
+proc GDK_DRAWABLE*(anObject: Pointer): PGdkDrawable = 
+  result = cast[PGdkDrawable](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_DRAWABLE()))
+
+proc GDK_DRAWABLE_CLASS*(klass: Pointer): PGdkDrawableClass = 
+  result = cast[PGdkDrawableClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_DRAWABLE()))
+
+proc GDK_IS_DRAWABLE*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_DRAWABLE())
+
+proc GDK_IS_DRAWABLE_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_DRAWABLE())
+
+proc GDK_DRAWABLE_GET_CLASS*(obj: Pointer): PGdkDrawableClass = 
+  result = cast[PGdkDrawableClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_DRAWABLE()))
+
+proc gdk_draw_pixmap*(drawable: PGdkDrawable, gc: PGdkGC, src: PGdkDrawable, 
+                      xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                      width: gint, height: gint) = 
+  gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height)
+
+proc gdk_draw_bitmap*(drawable: PGdkDrawable, gc: PGdkGC, src: PGdkDrawable, 
+                      xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, 
+                      width: gint, height: gint) = 
+  gdk_draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height)
+
+proc GDK_TYPE_EVENT*(): GType = 
+  result = gdk_event_get_type()
+
+proc GDK_TYPE_FONT*(): GType = 
+  result = gdk_font_get_type()
+
+proc GDK_TYPE_GC*(): GType = 
+  result = gdk_gc_get_type()
+
+proc GDK_GC*(anObject: Pointer): PGdkGC = 
+  result = cast[PGdkGC](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_GC()))
+
+proc GDK_GC_CLASS*(klass: Pointer): PGdkGCClass = 
+  result = cast[PGdkGCClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_GC()))
+
+proc GDK_IS_GC*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_GC())
+
+proc GDK_IS_GC_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_GC())
+
+proc GDK_GC_GET_CLASS*(obj: Pointer): PGdkGCClass = 
+  result = cast[PGdkGCClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_GC()))
+
+proc gdk_gc_destroy*(gc: PGdkGC) = 
+  g_object_unref(G_OBJECT(gc))
+
+proc GDK_TYPE_IMAGE*(): GType = 
+  result = gdk_image_get_type()
+
+proc GDK_IMAGE*(anObject: Pointer): PGdkImage = 
+  result = cast[PGdkImage](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_IMAGE()))
+
+proc GDK_IMAGE_CLASS*(klass: Pointer): PGdkImageClass = 
+  result = cast[PGdkImageClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_IMAGE()))
+
+proc GDK_IS_IMAGE*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_IMAGE())
+
+proc GDK_IS_IMAGE_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_IMAGE())
+
+proc GDK_IMAGE_GET_CLASS*(obj: Pointer): PGdkImageClass = 
+  result = cast[PGdkImageClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_IMAGE()))
+
+proc gdk_image_destroy*(image: PGdkImage) = 
+  g_object_unref(G_OBJECT(image))
+
+proc GDK_TYPE_DEVICE*(): GType = 
+  result = gdk_device_get_type()
+
+proc GDK_DEVICE*(anObject: Pointer): PGdkDevice = 
+  result = cast[PGdkDevice](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_DEVICE()))
+
+proc GDK_DEVICE_CLASS*(klass: Pointer): PGdkDeviceClass = 
+  result = cast[PGdkDeviceClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_DEVICE()))
+
+proc GDK_IS_DEVICE*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_DEVICE())
+
+proc GDK_IS_DEVICE_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_DEVICE())
+
+proc GDK_DEVICE_GET_CLASS*(obj: Pointer): PGdkDeviceClass = 
+  result = cast[PGdkDeviceClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_DEVICE()))
+
+proc GDK_TYPE_KEYMAP*(): GType = 
+  result = gdk_keymap_get_type()
+
+proc GDK_KEYMAP*(anObject: Pointer): PGdkKeymap = 
+  result = cast[PGdkKeymap](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_KEYMAP()))
+
+proc GDK_KEYMAP_CLASS*(klass: Pointer): PGdkKeymapClass = 
+  result = cast[PGdkKeymapClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_KEYMAP()))
+
+proc GDK_IS_KEYMAP*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_KEYMAP())
+
+proc GDK_IS_KEYMAP_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_KEYMAP())
+
+proc GDK_KEYMAP_GET_CLASS*(obj: Pointer): PGdkKeymapClass = 
+  result = cast[PGdkKeymapClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_KEYMAP()))
+
+proc GDK_TYPE_PIXMAP*(): GType = 
+  result = gdk_pixmap_get_type()
+
+proc GDK_PIXMAP*(anObject: Pointer): PGdkPixmap = 
+  result = cast[PGdkPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_PIXMAP()))
+
+proc GDK_PIXMAP_CLASS*(klass: Pointer): PGdkPixmapObjectClass = 
+  result = cast[PGdkPixmapObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_PIXMAP()))
+
+proc GDK_IS_PIXMAP*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_PIXMAP())
+
+proc GDK_IS_PIXMAP_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_PIXMAP())
+
+proc GDK_PIXMAP_GET_CLASS*(obj: Pointer): PGdkPixmapObjectClass = 
+  result = cast[PGdkPixmapObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_PIXMAP()))
+
+proc GDK_PIXMAP_OBJECT*(anObject: Pointer): PGdkPixmapObject = 
+  result = cast[PGdkPixmapObject](GDK_PIXMAP(anObject))
+
+proc gdk_bitmap_ref*(drawable: PGdkDrawable): PGdkDrawable = 
+  result = GDK_DRAWABLE(g_object_ref(G_OBJECT(drawable)))
+
+proc gdk_bitmap_unref*(drawable: PGdkDrawable) = 
+  g_object_unref(G_OBJECT(drawable))
+
+proc gdk_pixmap_ref*(drawable: PGdkDrawable): PGdkDrawable = 
+  result = GDK_DRAWABLE(g_object_ref(G_OBJECT(drawable)))
+
+proc gdk_pixmap_unref*(drawable: PGdkDrawable) = 
+  g_object_unref(G_OBJECT(drawable))
+
+proc gdk_rgb_get_cmap*(): PGdkColormap = 
+  result = nil #gdk_rgb_get_colormap()
+
+proc GDK_TYPE_DISPLAY*(): GType = 
+  nil
+  #result = nil
+
+proc GDK_DISPLAY_OBJECT*(anObject: pointer): PGdkDisplay = 
+  result = cast[PGdkDisplay](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_DISPLAY()))
+
+proc GDK_DISPLAY_CLASS*(klass: pointer): PGdkDisplayClass = 
+  result = cast[PGdkDisplayClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_DISPLAY()))
+
+proc GDK_IS_DISPLAY*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_DISPLAY())
+
+proc GDK_IS_DISPLAY_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_DISPLAY())
+
+proc GDK_DISPLAY_GET_CLASS*(obj: pointer): PGdkDisplayClass = 
+  result = cast[PGdkDisplayClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_DISPLAY()))
+
+proc GDK_TYPE_SCREEN*(): GType = 
+  nil
+
+proc GDK_SCREEN*(anObject: Pointer): PGdkScreen = 
+  result = cast[PGdkScreen](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_SCREEN()))
+
+proc GDK_SCREEN_CLASS*(klass: Pointer): PGdkScreenClass = 
+  result = cast[PGdkScreenClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_SCREEN()))
+
+proc GDK_IS_SCREEN*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_SCREEN())
+
+proc GDK_IS_SCREEN_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_SCREEN())
+
+proc GDK_SCREEN_GET_CLASS*(obj: Pointer): PGdkScreenClass = 
+  result = cast[PGdkScreenClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_SCREEN()))
+
+proc GDK_SELECTION_PRIMARY*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(1)
+
+proc GDK_SELECTION_SECONDARY*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(2)
+
+proc GDK_SELECTION_CLIPBOARD*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(69)
+
+proc GDK_TARGET_BITMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(5)
+
+proc GDK_TARGET_COLORMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(7)
+
+proc GDK_TARGET_DRAWABLE*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(17)
+
+proc GDK_TARGET_PIXMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(20)
+
+proc GDK_TARGET_STRING*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(31)
+
+proc GDK_SELECTION_TYPE_ATOM*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(4)
+
+proc GDK_SELECTION_TYPE_BITMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(5)
+
+proc GDK_SELECTION_TYPE_COLORMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(7)
+
+proc GDK_SELECTION_TYPE_DRAWABLE*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(17)
+
+proc GDK_SELECTION_TYPE_INTEGER*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(19)
+
+proc GDK_SELECTION_TYPE_PIXMAP*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(20)
+
+proc GDK_SELECTION_TYPE_WINDOW*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(33)
+
+proc GDK_SELECTION_TYPE_STRING*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(31)
+
+proc GDK_ATOM_TO_POINTER*(atom: TGdkAtom): pointer = 
+  result = cast[Pointer](atom)
+
+proc GDK_POINTER_TO_ATOM*(p: Pointer): TGdkAtom = 
+  result = cast[TGdkAtom](p)
+
+proc `GDK_MAKE_ATOM`*(val: guint): TGdkAtom = 
+  result = cast[TGdkAtom](val)
+
+proc GDK_NONE*(): TGdkAtom = 
+  result = `GDK_MAKE_ATOM`(0)
+
+proc GDK_TYPE_VISUAL*(): GType = 
+  result = gdk_visual_get_type()
+
+proc GDK_VISUAL*(anObject: Pointer): PGdkVisual = 
+  result = cast[PGdkVisual](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_VISUAL()))
+
+proc GDK_VISUAL_CLASS*(klass: Pointer): PGdkVisualClass = 
+  result = cast[PGdkVisualClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_VISUAL()))
+
+proc GDK_IS_VISUAL*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_VISUAL())
+
+proc GDK_IS_VISUAL_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_VISUAL())
+
+proc GDK_VISUAL_GET_CLASS*(obj: Pointer): PGdkVisualClass = 
+  result = cast[PGdkVisualClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_VISUAL()))
+
+proc gdk_visual_ref*(v: PGdkVisual) = 
+  discard g_object_ref(v)
+
+proc gdk_visual_unref*(v: PGdkVisual) = 
+  g_object_unref(v)
+
+proc GDK_TYPE_WINDOW*(): GType = 
+  result = gdk_window_object_get_type()
+
+proc GDK_WINDOW*(anObject: Pointer): PGdkWindow = 
+  result = cast[PGdkWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_WINDOW()))
+
+proc GDK_WINDOW_CLASS*(klass: Pointer): PGdkWindowObjectClass = 
+  result = cast[PGdkWindowObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_WINDOW()))
+
+proc GDK_IS_WINDOW*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_WINDOW())
+
+proc GDK_IS_WINDOW_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_WINDOW())
+
+proc GDK_WINDOW_GET_CLASS*(obj: Pointer): PGdkWindowObjectClass = 
+  result = cast[PGdkWindowObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_WINDOW()))
+
+proc GDK_WINDOW_OBJECT*(anObject: Pointer): PGdkWindowObject = 
+  result = cast[PGdkWindowObject](GDK_WINDOW(anObject))
+
+proc GdkWindowObject_guffaw_gravity*(a: var TGdkWindowObject): guint = 
+  result = (a.flag0 and bm_TGdkWindowObject_guffaw_gravity) shr
+      bp_TGdkWindowObject_guffaw_gravity
+
+proc GdkWindowObject_set_guffaw_gravity*(a: var TGdkWindowObject, 
+    `guffaw_gravity`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`guffaw_gravity` shl bp_TGdkWindowObject_guffaw_gravity) and
+      bm_TGdkWindowObject_guffaw_gravity)
+
+proc GdkWindowObject_input_only*(a: var TGdkWindowObject): guint = 
+  result = (a.flag0 and bm_TGdkWindowObject_input_only) shr
+      bp_TGdkWindowObject_input_only
+
+proc GdkWindowObject_set_input_only*(a: var TGdkWindowObject, 
+                                     `input_only`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`input_only` shl bp_TGdkWindowObject_input_only) and
+      bm_TGdkWindowObject_input_only)
+
+proc GdkWindowObject_modal_hint*(a: var TGdkWindowObject): guint = 
+  result = (a.flag0 and bm_TGdkWindowObject_modal_hint) shr
+      bp_TGdkWindowObject_modal_hint
+
+proc GdkWindowObject_set_modal_hint*(a: var TGdkWindowObject, 
+                                     `modal_hint`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`modal_hint` shl bp_TGdkWindowObject_modal_hint) and
+      bm_TGdkWindowObject_modal_hint)
+
+proc GdkWindowObject_destroyed*(a: var TGdkWindowObject): guint = 
+  result = (a.flag0 and bm_TGdkWindowObject_destroyed) shr
+      bp_TGdkWindowObject_destroyed
+
+proc GdkWindowObject_set_destroyed*(a: var TGdkWindowObject, `destroyed`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`destroyed` shl bp_TGdkWindowObject_destroyed) and
+      bm_TGdkWindowObject_destroyed)
+
+proc GDK_ROOT_PARENT*(): PGdkWindow = 
+  result = gdk_get_default_root_window()
+
+proc gdk_window_get_size*(drawable: PGdkDrawable, width: Pgint, height: Pgint) = 
+  gdk_drawable_get_size(drawable, width, height)
+
+proc gdk_window_get_type*(window: PGdkWindow): TGdkWindowType = 
+  result = gdk_window_get_window_type(window)
+
+proc gdk_window_get_colormap*(drawable: PGdkDrawable): PGdkColormap = 
+  result = gdk_drawable_get_colormap(drawable)
+
+proc gdk_window_set_colormap*(drawable: PGdkDrawable, colormap: PGdkColormap) = 
+  gdk_drawable_set_colormap(drawable, colormap)
+
+proc gdk_window_get_visual*(drawable: PGdkDrawable): PGdkVisual = 
+  result = gdk_drawable_get_visual(drawable)
+
+proc gdk_window_ref*(drawable: PGdkDrawable): PGdkDrawable = 
+  result = GDK_DRAWABLE(g_object_ref(G_OBJECT(drawable)))
+
+proc gdk_window_unref*(drawable: PGdkDrawable) = 
+  g_object_unref(G_OBJECT(drawable))
+
+proc gdk_window_copy_area*(drawable: PGdkDrawable, gc: PGdkGC, x, y: gint, 
+                           source_drawable: PGdkDrawable, 
+                           source_x, source_y: gint, width, height: gint) = 
+  gdk_draw_pixmap(drawable, gc, source_drawable, source_x, source_y, x, y, 
+                  width, height)
diff --git a/lib/base/gtk/gdk2pixbuf.nim b/lib/base/gtk/gdk2pixbuf.nim
new file mode 100755
index 000000000..1dcc020d1
--- /dev/null
+++ b/lib/base/gtk/gdk2pixbuf.nim
@@ -0,0 +1,279 @@
+import 
+  glib2
+
+when defined(win32): 
+  {.define: gdkpixbufwin.}
+  const 
+    gdkpixbuflib = "libgdk_pixbuf-2.0-0.dll"
+elif defined(darwin): 
+  const 
+    gdkpixbuflib = "gdk_pixbuf-2.0.0"
+  # linklib gtk-x11-2.0
+  # linklib gdk-x11-2.0
+  # linklib pango-1.0.0
+  # linklib glib-2.0.0
+  # linklib gobject-2.0.0
+  # linklib gdk_pixbuf-2.0.0
+  # linklib atk-1.0.0
+else: 
+  const 
+    gdkpixbuflib = "libgdk_pixbuf-2.0.so"
+{.define: HasGTK2_4.}
+{.define: HasGTK2_6.}
+type 
+  PGdkPixbuf* = pointer
+  PGdkPixbufAnimation* = pointer
+  PGdkPixbufAnimationIter* = pointer
+  PGdkPixbufAlphaMode* = ptr TGdkPixbufAlphaMode
+  TGdkPixbufAlphaMode* = enum 
+    GDK_PIXBUF_ALPHA_BILEVEL, GDK_PIXBUF_ALPHA_FULL
+  PGdkColorspace* = ptr TGdkColorspace
+  TGdkColorspace* = enum 
+    GDK_COLORSPACE_RGB
+  TGdkPixbufDestroyNotify* = proc (pixels: Pguchar, data: gpointer){.cdecl.}
+  PGdkPixbufError* = ptr TGdkPixbufError
+  TGdkPixbufError* = enum 
+    GDK_PIXBUF_ERROR_CORRUPT_IMAGE, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, 
+    GDK_PIXBUF_ERROR_BAD_OPTION, GDK_PIXBUF_ERROR_UNKNOWN_TYPE, 
+    GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, GDK_PIXBUF_ERROR_FAILED
+  PGdkInterpType* = ptr TGdkInterpType
+  TGdkInterpType* = enum 
+    GDK_INTERP_NEAREST, GDK_INTERP_TILES, GDK_INTERP_BILINEAR, GDK_INTERP_HYPER
+
+proc GDK_TYPE_PIXBUF*(): GType
+proc GDK_PIXBUF*(anObject: pointer): PGdkPixbuf
+proc GDK_IS_PIXBUF*(anObject: pointer): bool
+proc GDK_TYPE_PIXBUF_ANIMATION*(): GType
+proc GDK_PIXBUF_ANIMATION*(anObject: pointer): PGdkPixbufAnimation
+proc GDK_IS_PIXBUF_ANIMATION*(anObject: pointer): bool
+proc GDK_TYPE_PIXBUF_ANIMATION_ITER*(): GType
+proc GDK_PIXBUF_ANIMATION_ITER*(anObject: pointer): PGdkPixbufAnimationIter
+proc GDK_IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool
+proc GDK_PIXBUF_ERROR*(): TGQuark
+proc gdk_pixbuf_error_quark*(): TGQuark{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_error_quark".}
+proc gdk_pixbuf_get_type*(): GType{.cdecl, dynlib: gdkpixbuflib, 
+                                    importc: "gdk_pixbuf_get_type".}
+when not defined(GDK_PIXBUF_DISABLE_DEPRECATED): 
+  proc gdk_pixbuf_ref(pixbuf: PGdkPixbuf): PGdkPixbuf{.cdecl, 
+      dynlib: gdkpixbuflib, importc: "gdk_pixbuf_ref".}
+  proc gdk_pixbuf_unref(pixbuf: PGdkPixbuf){.cdecl, dynlib: gdkpixbuflib, 
+      importc: "gdk_pixbuf_unref".}
+proc gdk_pixbuf_get_colorspace*(pixbuf: PGdkPixbuf): TGdkColorspace{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_colorspace".}
+proc gdk_pixbuf_get_n_channels*(pixbuf: PGdkPixbuf): int32{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_n_channels".}
+proc gdk_pixbuf_get_has_alpha*(pixbuf: PGdkPixbuf): gboolean{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_has_alpha".}
+proc gdk_pixbuf_get_bits_per_sample*(pixbuf: PGdkPixbuf): int32{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_bits_per_sample".}
+proc gdk_pixbuf_get_pixels*(pixbuf: PGdkPixbuf): Pguchar{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_pixels".}
+proc gdk_pixbuf_get_width*(pixbuf: PGdkPixbuf): int32{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_width".}
+proc gdk_pixbuf_get_height*(pixbuf: PGdkPixbuf): int32{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_height".}
+proc gdk_pixbuf_get_rowstride*(pixbuf: PGdkPixbuf): int32{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_rowstride".}
+proc gdk_pixbuf_new*(colorspace: TGdkColorspace, has_alpha: gboolean, 
+                     bits_per_sample: int32, width: int32, height: int32): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new".}
+proc gdk_pixbuf_copy*(pixbuf: PGdkPixbuf): PGdkPixbuf{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_copy".}
+proc gdk_pixbuf_new_subpixbuf*(src_pixbuf: PGdkPixbuf, src_x: int32, 
+                               src_y: int32, width: int32, height: int32): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_subpixbuf".}
+proc gdk_pixbuf_new_from_file*(filename: cstring, error: pointer): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_file".}
+proc gdk_pixbuf_new_from_data*(data: Pguchar, colorspace: TGdkColorspace, 
+                               has_alpha: gboolean, bits_per_sample: int32, 
+                               width: int32, height: int32, rowstride: int32, 
+                               destroy_fn: TGdkPixbufDestroyNotify, 
+                               destroy_fn_data: gpointer): PGdkPixbuf{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_data".}
+proc gdk_pixbuf_new_from_xpm_data*(data: PPchar): PGdkPixbuf{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_xpm_data".}
+proc gdk_pixbuf_new_from_inline*(data_length: gint, a: var guint8, 
+                                 copy_pixels: gboolean, error: pointer): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_inline".}
+when defined(HasGTK2_4): 
+  proc gdk_pixbuf_new_from_file_at_size(filename: cstring, width, height: gint, 
+                                        error: pointer): PGdkPixbuf{.cdecl, 
+      dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_file_at_size".}
+when defined(HasGTK2_6): 
+  proc gdk_pixbuf_new_from_file_at_scale(filename: cstring, width, height: gint, 
+      preserve_aspect_ratio: gboolean, error: pointer): PGdkPixbuf{.cdecl, 
+      dynlib: gdkpixbuflib, importc: "gdk_pixbuf_new_from_file_at_scale".}
+proc gdk_pixbuf_fill*(pixbuf: PGdkPixbuf, pixel: guint32){.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_fill".}
+proc gdk_pixbuf_save*(pixbuf: PGdkPixbuf, filename: cstring, `type`: cstring, 
+                      error: pointer): gboolean{.cdecl, varargs, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_save".}
+proc gdk_pixbuf_savev*(pixbuf: PGdkPixbuf, filename: cstring, `type`: cstring, 
+                       option_keys: PPchar, option_values: PPchar, 
+                       error: pointer): gboolean{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_savev".}
+proc gdk_pixbuf_add_alpha*(pixbuf: PGdkPixbuf, substitute_color: gboolean, 
+                           r: guchar, g: guchar, b: guchar): PGdkPixbuf{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_add_alpha".}
+proc gdk_pixbuf_copy_area*(src_pixbuf: PGdkPixbuf, src_x: int32, src_y: int32, 
+                           width: int32, height: int32, dest_pixbuf: PGdkPixbuf, 
+                           dest_x: int32, dest_y: int32){.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_copy_area".}
+proc gdk_pixbuf_saturate_and_pixelate*(src: PGdkPixbuf, dest: PGdkPixbuf, 
+                                       saturation: gfloat, pixelate: gboolean){.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_saturate_and_pixelate".}
+proc gdk_pixbuf_scale*(src: PGdkPixbuf, dest: PGdkPixbuf, dest_x: int32, 
+                       dest_y: int32, dest_width: int32, dest_height: int32, 
+                       offset_x: float64, offset_y: float64, scale_x: float64, 
+                       scale_y: float64, interp_type: TGdkInterpType){.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_scale".}
+proc gdk_pixbuf_composite*(src: PGdkPixbuf, dest: PGdkPixbuf, dest_x: int32, 
+                           dest_y: int32, dest_width: int32, dest_height: int32, 
+                           offset_x: float64, offset_y: float64, 
+                           scale_x: float64, scale_y: float64, 
+                           interp_type: TGdkInterpType, overall_alpha: int32){.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_composite".}
+proc gdk_pixbuf_composite_color*(src: PGdkPixbuf, dest: PGdkPixbuf, 
+                                 dest_x: int32, dest_y: int32, 
+                                 dest_width: int32, dest_height: int32, 
+                                 offset_x: float64, offset_y: float64, 
+                                 scale_x: float64, scale_y: float64, 
+                                 interp_type: TGdkInterpType, 
+                                 overall_alpha: int32, check_x: int32, 
+                                 check_y: int32, check_size: int32, 
+                                 color1: guint32, color2: guint32){.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_composite_color".}
+proc gdk_pixbuf_scale_simple*(src: PGdkPixbuf, dest_width: int32, 
+                              dest_height: int32, interp_type: TGdkInterpType): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_scale_simple".}
+proc gdk_pixbuf_composite_color_simple*(src: PGdkPixbuf, dest_width: int32, 
+                                        dest_height: int32, 
+                                        interp_type: TGdkInterpType, 
+                                        overall_alpha: int32, check_size: int32, 
+                                        color1: guint32, color2: guint32): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_composite_color_simple".}
+proc gdk_pixbuf_animation_get_type*(): GType{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_animation_get_type".}
+proc gdk_pixbuf_animation_new_from_file*(filename: cstring, error: pointer): PGdkPixbufAnimation{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_new_from_file".}
+when not defined(GDK_PIXBUF_DISABLE_DEPRECATED): 
+  proc gdk_pixbuf_animation_ref(animation: PGdkPixbufAnimation): PGdkPixbufAnimation{.
+      cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_ref".}
+  proc gdk_pixbuf_animation_unref(animation: PGdkPixbufAnimation){.cdecl, 
+      dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_unref".}
+proc gdk_pixbuf_animation_get_width*(animation: PGdkPixbufAnimation): int32{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_get_width".}
+proc gdk_pixbuf_animation_get_height*(animation: PGdkPixbufAnimation): int32{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_get_height".}
+proc gdk_pixbuf_animation_is_static_image*(animation: PGdkPixbufAnimation): gboolean{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_is_static_image".}
+proc gdk_pixbuf_animation_get_static_image*(animation: PGdkPixbufAnimation): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_animation_get_static_image".}
+proc gdk_pixbuf_animation_get_iter*(animation: PGdkPixbufAnimation, 
+                                    e: var TGTimeVal): PGdkPixbufAnimationIter{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_get_iter".}
+proc gdk_pixbuf_animation_iter_get_type*(): GType{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_animation_iter_get_type".}
+proc gdk_pixbuf_animation_iter_get_delay_time*(iter: PGdkPixbufAnimationIter): int32{.
+    cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_animation_iter_get_delay_time".}
+proc gdk_pixbuf_animation_iter_get_pixbuf*(iter: PGdkPixbufAnimationIter): PGdkPixbuf{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_iter_get_pixbuf".}
+proc gdk_pixbuf_animation_iter_on_currently_loading_frame*(
+    iter: PGdkPixbufAnimationIter): gboolean{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_animation_iter_on_currently_loading_frame".}
+proc gdk_pixbuf_animation_iter_advance*(iter: PGdkPixbufAnimationIter, 
+                                        e: var TGTimeVal): gboolean{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_animation_iter_advance".}
+proc gdk_pixbuf_get_option*(pixbuf: PGdkPixbuf, key: cstring): cstring{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_get_option".}
+type 
+  PGdkPixbufLoader* = ptr TGdkPixbufLoader
+  TGdkPixbufLoader* = record 
+    parent_instance*: TGObject
+    priv*: gpointer
+
+  PGdkPixbufLoaderClass* = ptr TGdkPixbufLoaderClass
+  TGdkPixbufLoaderClass* = record 
+    parent_class*: TGObjectClass
+    area_prepared*: proc (loader: PGdkPixbufLoader){.cdecl.}
+    area_updated*: proc (loader: PGdkPixbufLoader, x: int32, y: int32, 
+                         width: int32, height: int32){.cdecl.}
+    closed*: proc (loader: PGdkPixbufLoader){.cdecl.}
+
+
+proc GDK_TYPE_PIXBUF_LOADER*(): GType
+proc GDK_PIXBUF_LOADER*(obj: pointer): PGdkPixbufLoader
+proc GDK_PIXBUF_LOADER_CLASS*(klass: pointer): PGdkPixbufLoaderClass
+proc GDK_IS_PIXBUF_LOADER*(obj: pointer): bool
+proc GDK_IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool
+proc GDK_PIXBUF_LOADER_GET_CLASS*(obj: pointer): PGdkPixbufLoaderClass
+proc gdk_pixbuf_loader_get_type*(): GType{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_loader_get_type".}
+proc gdk_pixbuf_loader_new*(): PGdkPixbufLoader{.cdecl, dynlib: gdkpixbuflib, 
+    importc: "gdk_pixbuf_loader_new".}
+proc gdk_pixbuf_loader_new_with_type*(image_type: cstring, error: pointer): PGdkPixbufLoader{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_loader_new_with_type".}
+proc gdk_pixbuf_loader_write*(loader: PGdkPixbufLoader, buf: Pguchar, 
+                              count: gsize, error: pointer): gboolean{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_loader_write".}
+proc gdk_pixbuf_loader_get_pixbuf*(loader: PGdkPixbufLoader): PGdkPixbuf{.cdecl, 
+    dynlib: gdkpixbuflib, importc: "gdk_pixbuf_loader_get_pixbuf".}
+proc gdk_pixbuf_loader_get_animation*(loader: PGdkPixbufLoader): PGdkPixbufAnimation{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_loader_get_animation".}
+proc gdk_pixbuf_loader_close*(loader: PGdkPixbufLoader, error: pointer): gboolean{.
+    cdecl, dynlib: gdkpixbuflib, importc: "gdk_pixbuf_loader_close".}
+proc GDK_TYPE_PIXBUF_LOADER*(): GType = 
+  result = gdk_pixbuf_loader_get_type()
+
+proc GDK_PIXBUF_LOADER*(obj: pointer): PGdkPixbufLoader = 
+  result = cast[PGdkPixbufLoader](G_TYPE_CHECK_INSTANCE_CAST(obj, 
+      GDK_TYPE_PIXBUF_LOADER()))
+
+proc GDK_PIXBUF_LOADER_CLASS*(klass: pointer): PGdkPixbufLoaderClass = 
+  result = cast[PGdkPixbufLoaderClass](G_TYPE_CHECK_CLASS_CAST(klass, 
+      GDK_TYPE_PIXBUF_LOADER()))
+
+proc GDK_IS_PIXBUF_LOADER*(obj: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GDK_TYPE_PIXBUF_LOADER())
+
+proc GDK_IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_PIXBUF_LOADER())
+
+proc GDK_PIXBUF_LOADER_GET_CLASS*(obj: pointer): PGdkPixbufLoaderClass = 
+  result = cast[PGdkPixbufLoaderClass](G_TYPE_INSTANCE_GET_CLASS(obj, 
+      GDK_TYPE_PIXBUF_LOADER()))
+
+proc GDK_TYPE_PIXBUF*(): GType = 
+  result = gdk_pixbuf_get_type()
+
+proc GDK_PIXBUF*(anObject: pointer): PGdkPixbuf = 
+  result = cast[PGdkPixbuf](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_PIXBUF()))
+
+proc GDK_IS_PIXBUF*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_PIXBUF())
+
+proc GDK_TYPE_PIXBUF_ANIMATION*(): GType = 
+  result = gdk_pixbuf_animation_get_type()
+
+proc GDK_PIXBUF_ANIMATION*(anObject: pointer): PGdkPixbufAnimation = 
+  result = cast[PGdkPixbufAnimation](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      GDK_TYPE_PIXBUF_ANIMATION()))
+
+proc GDK_IS_PIXBUF_ANIMATION*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_PIXBUF_ANIMATION())
+
+proc GDK_TYPE_PIXBUF_ANIMATION_ITER*(): GType = 
+  result = gdk_pixbuf_animation_iter_get_type()
+
+proc GDK_PIXBUF_ANIMATION_ITER*(anObject: pointer): PGdkPixbufAnimationIter = 
+  result = cast[PGdkPixbufAnimationIter](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+    GDK_TYPE_PIXBUF_ANIMATION_ITER()))
+
+proc GDK_IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_PIXBUF_ANIMATION_ITER())
+
+proc GDK_PIXBUF_ERROR*(): TGQuark = 
+  result = gdk_pixbuf_error_quark()
diff --git a/lib/base/gtk/gdkglext.nim b/lib/base/gtk/gdkglext.nim
new file mode 100755
index 000000000..d5e6b128e
--- /dev/null
+++ b/lib/base/gtk/gdkglext.nim
@@ -0,0 +1,562 @@
+import 
+  Glib2, Gdk2
+
+when defined(WIN32): 
+  const 
+    GdkGLExtLib = "libgdkglext-win32-1.0-0.dll"
+else: 
+  const 
+    GdkGLExtLib = "libgdkglext-x11-1.0.so"
+type 
+  TGdkGLConfigAttrib* = int32
+  TGdkGLConfigCaveat* = int32
+  TGdkGLVisualType* = int32
+  TGdkGLTransparentType* = int32
+  TGdkGLDrawableTypeMask* = int32
+  TGdkGLRenderTypeMask* = int32
+  TGdkGLBufferMask* = int32
+  TGdkGLConfigError* = int32
+  TGdkGLRenderType* = int32
+  TGdkGLDrawableAttrib* = int32
+  TGdkGLPbufferAttrib* = int32
+  TGdkGLEventMask* = int32
+  TGdkGLEventType* = int32
+  TGdkGLDrawableType* = int32
+  TGdkGLProc* = Pointer
+  PGdkGLConfig* = ptr TGdkGLConfig
+  PGdkGLContext* = ptr TGdkGLContext
+  PGdkGLDrawable* = ptr TGdkGLDrawable
+  PGdkGLPixmap* = ptr TGdkGLPixmap
+  PGdkGLWindow* = ptr TGdkGLWindow
+  TGdkGLConfig* = object of TGObject
+    layer_plane*: gint
+    n_aux_buffers*: gint
+    n_sample_buffers*: gint
+    flag0*: int16
+
+  PGdkGLConfigClass* = ptr TGdkGLConfigClass
+  TGdkGLConfigClass* = object of TGObjectClass
+
+  TGdkGLContext* = object of TGObject
+
+  PGdkGLContextClass* = ptr TGdkGLContextClass
+  TGdkGLContextClass* = object of TGObjectClass
+
+  TGdkGLDrawable* = object of TGObject
+
+  PGdkGLDrawableClass* = ptr TGdkGLDrawableClass
+  TGdkGLDrawableClass* = object of TGTypeInterface
+    create_new_context*: proc (gldrawable: PGdkGLDrawable, 
+                               share_list: PGdkGLContext, direct: gboolean, 
+                               render_type: int32): PGdkGLContext{.cdecl.}
+    make_context_current*: proc (draw: PGdkGLDrawable, a_read: PGdkGLDrawable, 
+                                 glcontext: PGdkGLContext): gboolean{.cdecl.}
+    is_double_buffered*: proc (gldrawable: PGdkGLDrawable): gboolean{.cdecl.}
+    swap_buffers*: proc (gldrawable: PGdkGLDrawable){.cdecl.}
+    wait_gl*: proc (gldrawable: PGdkGLDrawable){.cdecl.}
+    wait_gdk*: proc (gldrawable: PGdkGLDrawable){.cdecl.}
+    gl_begin*: proc (draw: PGdkGLDrawable, a_read: PGdkGLDrawable, 
+                     glcontext: PGdkGLContext): gboolean{.cdecl.}
+    gl_end*: proc (gldrawable: PGdkGLDrawable){.cdecl.}
+    get_gl_config*: proc (gldrawable: PGdkGLDrawable): PGdkGLConfig{.cdecl.}
+    get_size*: proc (gldrawable: PGdkGLDrawable, width, height: PGInt){.cdecl.}
+
+  TGdkGLPixmap* = object of TGObject
+    drawable*: PGdkDrawable
+
+  PGdkGLPixmapClass* = ptr TGdkGLPixmapClass
+  TGdkGLPixmapClass* = object of TGObjectClass
+
+  TGdkGLWindow* = object of TGObject
+    drawable*: PGdkDrawable
+
+  PGdkGLWindowClass* = ptr TGdkGLWindowClass
+  TGdkGLWindowClass* = object of TGObjectClass
+
+
+const 
+  HEADER_GDKGLEXT_MAJOR_VERSION* = 1
+  HEADER_GDKGLEXT_MINOR_VERSION* = 0
+  HEADER_GDKGLEXT_MICRO_VERSION* = 6
+  HEADER_GDKGLEXT_INTERFACE_AGE* = 4
+  HEADER_GDKGLEXT_BINARY_AGE* = 6
+
+proc HEADER_GDKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool
+var 
+  gdkglext_major_version*{.importc, dynlib: GdkGLExtLib.}: guint
+  gdkglext_minor_version*{.importc, dynlib: GdkGLExtLib.}: guint
+  gdkglext_micro_version*{.importc, dynlib: GdkGLExtLib.}: guint
+  gdkglext_interface_age*{.importc, dynlib: GdkGLExtLib.}: guint
+  gdkglext_binary_age*{.importc, dynlib: GdkGLExtLib.}: guint
+
+const 
+  GDK_GL_SUCCESS* = 0
+  GDK_GL_ATTRIB_LIST_NONE* = 0
+  GDK_GL_USE_GL* = 1
+  GDK_GL_BUFFER_SIZE* = 2
+  GDK_GL_LEVEL* = 3
+  GDK_GL_RGBA* = 4
+  GDK_GL_DOUBLEBUFFER* = 5
+  GDK_GL_STEREO* = 6
+  GDK_GL_AUX_BUFFERS* = 7
+  GDK_GL_RED_SIZE* = 8
+  GDK_GL_GREEN_SIZE* = 9
+  GDK_GL_BLUE_SIZE* = 10
+  GDK_GL_ALPHA_SIZE* = 11
+  GDK_GL_DEPTH_SIZE* = 12
+  GDK_GL_STENCIL_SIZE* = 13
+  GDK_GL_ACCUM_RED_SIZE* = 14
+  GDK_GL_ACCUM_GREEN_SIZE* = 15
+  GDK_GL_ACCUM_BLUE_SIZE* = 16
+  GDK_GL_ACCUM_ALPHA_SIZE* = 17
+  GDK_GL_CONFIG_CAVEAT* = 0x00000020
+  GDK_GL_X_VISUAL_TYPE* = 0x00000022
+  GDK_GL_TRANSPARENT_TYPE* = 0x00000023
+  GDK_GL_TRANSPARENT_INDEX_VALUE* = 0x00000024
+  GDK_GL_TRANSPARENT_RED_VALUE* = 0x00000025
+  GDK_GL_TRANSPARENT_GREEN_VALUE* = 0x00000026
+  GDK_GL_TRANSPARENT_BLUE_VALUE* = 0x00000027
+  GDK_GL_TRANSPARENT_ALPHA_VALUE* = 0x00000028
+  GDK_GL_DRAWABLE_TYPE* = 0x00008010
+  GDK_GL_RENDER_TYPE* = 0x00008011
+  GDK_GL_X_RENDERABLE* = 0x00008012
+  GDK_GL_FBCONFIG_ID* = 0x00008013
+  GDK_GL_MAX_PBUFFER_WIDTH* = 0x00008016
+  GDK_GL_MAX_PBUFFER_HEIGHT* = 0x00008017
+  GDK_GL_MAX_PBUFFER_PIXELS* = 0x00008018
+  GDK_GL_VISUAL_ID* = 0x0000800B
+  GDK_GL_SCREEN* = 0x0000800C
+  GDK_GL_SAMPLE_BUFFERS* = 100000
+  GDK_GL_SAMPLES* = 100001
+  GDK_GL_DONT_CARE* = 0xFFFFFFFF
+  GDK_GL_NONE* = 0x00008000
+  GDK_GL_CONFIG_CAVEAT_DONT_CARE* = 0xFFFFFFFF
+  GDK_GL_CONFIG_CAVEAT_NONE* = 0x00008000
+  GDK_GL_SLOW_CONFIG* = 0x00008001
+  GDK_GL_NON_CONFORMANT_CONFIG* = 0x0000800D
+  GDK_GL_VISUAL_TYPE_DONT_CARE* = 0xFFFFFFFF
+  GDK_GL_TRUE_COLOR* = 0x00008002
+  GDK_GL_DIRECT_COLOR* = 0x00008003
+  GDK_GL_PSEUDO_COLOR* = 0x00008004
+  GDK_GL_STATIC_COLOR* = 0x00008005
+  GDK_GL_GRAY_SCALE* = 0x00008006
+  GDK_GL_STATIC_GRAY* = 0x00008007
+  GDK_GL_TRANSPARENT_NONE* = 0x00008000
+  GDK_GL_TRANSPARENT_RGB* = 0x00008008
+  GDK_GL_TRANSPARENT_INDEX* = 0x00008009
+  GDK_GL_WINDOW_BIT* = 1 shl 0
+  GDK_GL_PIXMAP_BIT* = 1 shl 1
+  GDK_GL_PBUFFER_BIT* = 1 shl 2
+  GDK_GL_RGBA_BIT* = 1 shl 0
+  GDK_GL_COLOR_INDEX_BIT* = 1 shl 1
+  GDK_GL_FRONT_LEFT_BUFFER_BIT* = 1 shl 0
+  GDK_GL_FRONT_RIGHT_BUFFER_BIT* = 1 shl 1
+  GDK_GL_BACK_LEFT_BUFFER_BIT* = 1 shl 2
+  GDK_GL_BACK_RIGHT_BUFFER_BIT* = 1 shl 3
+  GDK_GL_AUX_BUFFERS_BIT* = 1 shl 4
+  GDK_GL_DEPTH_BUFFER_BIT* = 1 shl 5
+  GDK_GL_STENCIL_BUFFER_BIT* = 1 shl 6
+  GDK_GL_ACCUM_BUFFER_BIT* = 1 shl 7
+  GDK_GL_BAD_SCREEN* = 1
+  GDK_GL_BAD_ATTRIBUTE* = 2
+  GDK_GL_NO_EXTENSION* = 3
+  GDK_GL_BAD_VISUAL* = 4
+  GDK_GL_BAD_CONTEXT* = 5
+  GDK_GL_BAD_VALUE* = 6
+  GDK_GL_BAD_ENUM* = 7
+  GDK_GL_RGBA_TYPE* = 0x00008014
+  GDK_GL_COLOR_INDEX_TYPE* = 0x00008015
+  GDK_GL_PRESERVED_CONTENTS* = 0x0000801B
+  GDK_GL_LARGEST_PBUFFER* = 0x0000801C
+  GDK_GL_WIDTH* = 0x0000801D
+  GDK_GL_HEIGHT* = 0x0000801E
+  GDK_GL_EVENT_MASK* = 0x0000801F
+  GDK_GL_PBUFFER_PRESERVED_CONTENTS* = 0x0000801B
+  GDK_GL_PBUFFER_LARGEST_PBUFFER* = 0x0000801C
+  GDK_GL_PBUFFER_HEIGHT* = 0x00008040
+  GDK_GL_PBUFFER_WIDTH* = 0x00008041
+  GDK_GL_PBUFFER_CLOBBER_MASK* = 1 shl 27
+  GDK_GL_DAMAGED* = 0x00008020
+  GDK_GL_SAVED* = 0x00008021
+  GDK_GL_WINDOW_VALUE* = 0x00008022
+  GDK_GL_PBUFFER* = 0x00008023
+
+proc gdk_gl_config_attrib_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_attrib_get_type".}
+proc GDK_TYPE_GL_CONFIG_ATTRIB*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_attrib_get_type".}
+proc gdk_gl_config_caveat_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_caveat_get_type".}
+proc GDK_TYPE_GL_CONFIG_CAVEAT*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_caveat_get_type".}
+proc gdk_gl_visual_type_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_visual_type_get_type".}
+proc GDK_TYPE_GL_VISUAL_TYPE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                        importc: "gdk_gl_visual_type_get_type".}
+proc gdk_gl_transparent_type_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_transparent_type_get_type".}
+proc GDK_TYPE_GL_TRANSPARENT_TYPE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_transparent_type_get_type".}
+proc gdk_gl_drawable_type_mask_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_type_mask_get_type".}
+proc GDK_TYPE_GL_DRAWABLE_TYPE_MASK*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_type_mask_get_type".}
+proc gdk_gl_render_type_mask_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_render_type_mask_get_type".}
+proc GDK_TYPE_GL_RENDER_TYPE_MASK*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_render_type_mask_get_type".}
+proc gdk_gl_buffer_mask_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_buffer_mask_get_type".}
+proc GDK_TYPE_GL_BUFFER_MASK*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                        importc: "gdk_gl_buffer_mask_get_type".}
+proc gdk_gl_config_error_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_error_get_type".}
+proc GDK_TYPE_GL_CONFIG_ERROR*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_error_get_type".}
+proc gdk_gl_render_type_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_render_type_get_type".}
+proc GDK_TYPE_GL_RENDER_TYPE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                        importc: "gdk_gl_render_type_get_type".}
+proc gdk_gl_drawable_attrib_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_attrib_get_type".}
+proc GDK_TYPE_GL_DRAWABLE_ATTRIB*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_attrib_get_type".}
+proc gdk_gl_pbuffer_attrib_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_pbuffer_attrib_get_type".}
+proc GDK_TYPE_GL_PBUFFER_ATTRIB*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_pbuffer_attrib_get_type".}
+proc gdk_gl_event_mask_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_event_mask_get_type".}
+proc GDK_TYPE_GL_EVENT_MASK*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                       importc: "gdk_gl_event_mask_get_type".}
+proc gdk_gl_event_type_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_event_type_get_type".}
+proc GDK_TYPE_GL_EVENT_TYPE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                       importc: "gdk_gl_event_type_get_type".}
+proc gdk_gl_drawable_type_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_type_get_type".}
+proc GDK_TYPE_GL_DRAWABLE_TYPE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_type_get_type".}
+proc gdk_gl_config_mode_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_config_mode_get_type".}
+proc GDK_TYPE_GL_CONFIG_MODE*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                        importc: "gdk_gl_config_mode_get_type".}
+proc gdk_gl_parse_args*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_parse_args".}
+proc gdk_gl_init_check*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_init_check".}
+proc gdk_gl_init*(argc: var int32, argv: ptr cstringArray){.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_init".}
+proc gdk_gl_query_gl_extension*(extension: cstring): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_query_gl_extension".}
+proc gdk_gl_get_proc_address*(proc_name: cstring): TGdkGLProc{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_get_proc_address".}
+const 
+  bm_TGdkGLConfig_is_rgba* = 1 shl 0
+  bp_TGdkGLConfig_is_rgba* = 0
+  bm_TGdkGLConfig_is_double_buffered* = 1 shl 1
+  bp_TGdkGLConfig_is_double_buffered* = 1
+  bm_TGdkGLConfig_as_single_mode* = 1 shl 2
+  bp_TGdkGLConfig_as_single_mode* = 2
+  bm_TGdkGLConfig_is_stereo* = 1 shl 3
+  bp_TGdkGLConfig_is_stereo* = 3
+  bm_TGdkGLConfig_has_alpha* = 1 shl 4
+  bp_TGdkGLConfig_has_alpha* = 4
+  bm_TGdkGLConfig_has_depth_buffer* = 1 shl 5
+  bp_TGdkGLConfig_has_depth_buffer* = 5
+  bm_TGdkGLConfig_has_stencil_buffer* = 1 shl 6
+  bp_TGdkGLConfig_has_stencil_buffer* = 6
+  bm_TGdkGLConfig_has_accum_buffer* = 1 shl 7
+  bp_TGdkGLConfig_has_accum_buffer* = 7
+
+const 
+  GDK_GL_MODE_RGB* = 0
+  GDK_GL_MODE_RGBA* = 0
+  GDK_GL_MODE_INDEX* = 1 shl 0
+  GDK_GL_MODE_SINGLE* = 0
+  GDK_GL_MODE_DOUBLE* = 1 shl 1
+  GDK_GL_MODE_STEREO* = 1 shl 2
+  GDK_GL_MODE_ALPHA* = 1 shl 3
+  GDK_GL_MODE_DEPTH* = 1 shl 4
+  GDK_GL_MODE_STENCIL* = 1 shl 5
+  GDK_GL_MODE_ACCUM* = 1 shl 6
+  GDK_GL_MODE_MULTISAMPLE* = 1 shl 7
+
+type 
+  TGdkGLConfigMode* = int32
+  PGdkGLConfigMode* = ptr TGdkGLConfigMode
+
+proc GDK_TYPE_GL_CONFIG*(): GType
+proc GDK_GL_CONFIG*(anObject: Pointer): PGdkGLConfig
+proc GDK_GL_CONFIG_CLASS*(klass: Pointer): PGdkGLConfigClass
+proc GDK_IS_GL_CONFIG*(anObject: Pointer): bool
+proc GDK_IS_GL_CONFIG_CLASS*(klass: Pointer): bool
+proc GDK_GL_CONFIG_GET_CLASS*(obj: Pointer): PGdkGLConfigClass
+proc gdk_gl_config_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                       importc: "gdk_gl_config_get_type".}
+proc gdk_gl_config_get_screen*(glconfig: PGdkGLConfig): PGdkScreen{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_screen".}
+proc gdk_gl_config_get_attrib*(glconfig: PGdkGLConfig, attribute: int, 
+                               value: var cint): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_attrib".}
+proc gdk_gl_config_get_colormap*(glconfig: PGdkGLConfig): PGdkColormap{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_colormap".}
+proc gdk_gl_config_get_visual*(glconfig: PGdkGLConfig): PGdkVisual{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_visual".}
+proc gdk_gl_config_get_depth*(glconfig: PGdkGLConfig): gint{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_depth".}
+proc gdk_gl_config_get_layer_plane*(glconfig: PGdkGLConfig): gint{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_layer_plane".}
+proc gdk_gl_config_get_n_aux_buffers*(glconfig: PGdkGLConfig): gint{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_n_aux_buffers".}
+proc gdk_gl_config_get_n_sample_buffers*(glconfig: PGdkGLConfig): gint{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_get_n_sample_buffers".}
+proc gdk_gl_config_is_rgba*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_is_rgba".}
+proc gdk_gl_config_is_double_buffered*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_is_double_buffered".}
+proc gdk_gl_config_is_stereo*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_is_stereo".}
+proc gdk_gl_config_has_alpha*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_has_alpha".}
+proc gdk_gl_config_has_depth_buffer*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_has_depth_buffer".}
+proc gdk_gl_config_has_stencil_buffer*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_has_stencil_buffer".}
+proc gdk_gl_config_has_accum_buffer*(glconfig: PGdkGLConfig): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_config_has_accum_buffer".}
+proc GDK_TYPE_GL_CONTEXT*(): GType
+proc GDK_GL_CONTEXT*(anObject: Pointer): PGdkGLContext
+proc GDK_GL_CONTEXT_CLASS*(klass: Pointer): PGdkGLContextClass
+proc GDK_IS_GL_CONTEXT*(anObject: Pointer): bool
+proc GDK_IS_GL_CONTEXT_CLASS*(klass: Pointer): bool
+proc GDK_GL_CONTEXT_GET_CLASS*(obj: Pointer): PGdkGLContextClass
+proc gdk_gl_context_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                        importc: "gdk_gl_context_get_type".}
+proc gdk_gl_context_new*(gldrawable: PGdkGLDrawable, share_list: PGdkGLContext, 
+                         direct: gboolean, render_type: int32): PGdkGLContext{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_context_new".}
+proc gdk_gl_context_destroy*(glcontext: PGdkGLContext){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_context_destroy".}
+proc gdk_gl_context_copy*(glcontext: PGdkGLContext, src: PGdkGLContext, 
+                          mask: int32): gboolean{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_context_copy".}
+proc gdk_gl_context_get_gl_drawable*(glcontext: PGdkGLContext): PGdkGLDrawable{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_context_get_gl_drawable".}
+proc gdk_gl_context_get_gl_config*(glcontext: PGdkGLContext): PGdkGLConfig{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_context_get_gl_config".}
+proc gdk_gl_context_get_share_list*(glcontext: PGdkGLContext): PGdkGLContext{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_context_get_share_list".}
+proc gdk_gl_context_is_direct*(glcontext: PGdkGLContext): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_context_is_direct".}
+proc gdk_gl_context_get_render_type*(glcontext: PGdkGLContext): int32{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_context_get_render_type".}
+proc gdk_gl_context_get_current*(): PGdkGLContext{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_context_get_current".}
+proc GDK_TYPE_GL_DRAWABLE*(): GType
+proc GDK_GL_DRAWABLE*(inst: Pointer): PGdkGLDrawable
+proc GDK_GL_DRAWABLE_CLASS*(vtable: Pointer): PGdkGLDrawableClass
+proc GDK_IS_GL_DRAWABLE*(inst: Pointer): bool
+proc GDK_IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool
+proc GDK_GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGdkGLDrawableClass
+proc gdk_gl_drawable_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_get_type".}
+proc gdk_gl_drawable_make_current*(gldrawable: PGdkGLDrawable, 
+                                   glcontext: PGdkGLContext): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_make_current".}
+proc gdk_gl_drawable_is_double_buffered*(gldrawable: PGdkGLDrawable): gboolean{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_is_double_buffered".}
+proc gdk_gl_drawable_swap_buffers*(gldrawable: PGdkGLDrawable){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_swap_buffers".}
+proc gdk_gl_drawable_wait_gl*(gldrawable: PGdkGLDrawable){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_wait_gl".}
+proc gdk_gl_drawable_wait_gdk*(gldrawable: PGdkGLDrawable){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_wait_gdk".}
+proc gdk_gl_drawable_gl_begin*(gldrawable: PGdkGLDrawable, 
+                               glcontext: PGdkGLContext): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_gl_begin".}
+proc gdk_gl_drawable_gl_end*(gldrawable: PGdkGLDrawable){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_gl_end".}
+proc gdk_gl_drawable_get_gl_config*(gldrawable: PGdkGLDrawable): PGdkGLConfig{.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_get_gl_config".}
+proc gdk_gl_drawable_get_size*(gldrawable: PGdkGLDrawable, width, height: PGInt){.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_drawable_get_size".}
+proc gdk_gl_drawable_get_current*(): PGdkGLDrawable{.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_drawable_get_current".}
+proc GDK_TYPE_GL_PIXMAP*(): GType
+proc GDK_GL_PIXMAP*(anObject: Pointer): PGdkGLPixmap
+proc GDK_GL_PIXMAP_CLASS*(klass: Pointer): PGdkGLPixmapClass
+proc GDK_IS_GL_PIXMAP*(anObject: Pointer): bool
+proc GDK_IS_GL_PIXMAP_CLASS*(klass: Pointer): bool
+proc GDK_GL_PIXMAP_GET_CLASS*(obj: Pointer): PGdkGLPixmapClass
+proc gdk_gl_pixmap_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                       importc: "gdk_gl_pixmap_get_type".}
+proc gdk_gl_pixmap_new*(glconfig: PGdkGLConfig, pixmap: PGdkPixmap, 
+                        attrib_list: ptr int32): PGdkGLPixmap{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_pixmap_new".}
+proc gdk_gl_pixmap_destroy*(glpixmap: PGdkGLPixmap){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_pixmap_destroy".}
+proc gdk_gl_pixmap_get_pixmap*(glpixmap: PGdkGLPixmap): PGdkPixmap{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_pixmap_get_pixmap".}
+proc gdk_pixmap_set_gl_capability*(pixmap: PGdkPixmap, glconfig: PGdkGLConfig, 
+                                   attrib_list: ptr int32): PGdkGLPixmap{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_pixmap_set_gl_capability".}
+proc gdk_pixmap_unset_gl_capability*(pixmap: PGdkPixmap){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_pixmap_unset_gl_capability".}
+proc gdk_pixmap_is_gl_capable*(pixmap: PGdkPixmap): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_pixmap_is_gl_capable".}
+proc gdk_pixmap_get_gl_pixmap*(pixmap: PGdkPixmap): PGdkGLPixmap{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_pixmap_get_gl_pixmap".}
+proc gdk_pixmap_get_gl_drawable*(pixmap: PGdkPixmap): PGdkGLDrawable
+proc GDK_TYPE_GL_WINDOW*(): GType
+proc GDK_GL_WINDOW*(anObject: Pointer): PGdkGLWindow
+proc GDK_GL_WINDOW_CLASS*(klass: Pointer): PGdkGLWindowClass
+proc GDK_IS_GL_WINDOW*(anObject: Pointer): bool
+proc GDK_IS_GL_WINDOW_CLASS*(klass: Pointer): bool
+proc GDK_GL_WINDOW_GET_CLASS*(obj: Pointer): PGdkGLWindowClass
+proc gdk_gl_window_get_type*(): GType{.cdecl, dynlib: GdkGLExtLib, 
+                                       importc: "gdk_gl_window_get_type".}
+proc gdk_gl_window_new*(glconfig: PGdkGLConfig, window: PGdkWindow, 
+                        attrib_list: ptr int32): PGdkGLWindow{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_window_new".}
+proc gdk_gl_window_destroy*(glwindow: PGdkGLWindow){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_window_destroy".}
+proc gdk_gl_window_get_window*(glwindow: PGdkGLWindow): PGdkWindow{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_window_get_window".}
+proc gdk_window_set_gl_capability*(window: PGdkWindow, glconfig: PGdkGLConfig, 
+                                   attrib_list: ptr int32): PGdkGLWindow{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_window_set_gl_capability".}
+proc gdk_window_unset_gl_capability*(window: PGdkWindow){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_window_unset_gl_capability".}
+proc gdk_window_is_gl_capable*(window: PGdkWindow): gboolean{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_window_is_gl_capable".}
+proc gdk_window_get_gl_window*(window: PGdkWindow): PGdkGLWindow{.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_window_get_gl_window".}
+proc gdk_window_get_gl_drawable*(window: PGdkWindow): PGdkGLDrawable
+proc gdk_gl_draw_cube*(solid: gboolean, size: float64){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_draw_cube".}
+proc gdk_gl_draw_sphere*(solid: gboolean, radius: float64, slices: int32, 
+                         stacks: int32){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_draw_sphere".}
+proc gdk_gl_draw_cone*(solid: gboolean, base: float64, height: float64, 
+                       slices: int32, stacks: int32){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_draw_cone".}
+proc gdk_gl_draw_torus*(solid: gboolean, inner_radius: float64, 
+                        outer_radius: float64, nsides: int32, rings: int32){.
+    cdecl, dynlib: GdkGLExtLib, importc: "gdk_gl_draw_torus".}
+proc gdk_gl_draw_tetrahedron*(solid: gboolean){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_draw_tetrahedron".}
+proc gdk_gl_draw_octahedron*(solid: gboolean){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_draw_octahedron".}
+proc gdk_gl_draw_dodecahedron*(solid: gboolean){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_draw_dodecahedron".}
+proc gdk_gl_draw_icosahedron*(solid: gboolean){.cdecl, dynlib: GdkGLExtLib, 
+    importc: "gdk_gl_draw_icosahedron".}
+proc gdk_gl_draw_teapot*(solid: gboolean, scale: float64){.cdecl, 
+    dynlib: GdkGLExtLib, importc: "gdk_gl_draw_teapot".}
+proc HEADER_GDKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool = 
+  result = (HEADER_GDKGLEXT_MAJOR_VERSION > major) or
+      ((HEADER_GDKGLEXT_MAJOR_VERSION == major) and
+      (HEADER_GDKGLEXT_MINOR_VERSION > minor)) or
+      ((HEADER_GDKGLEXT_MAJOR_VERSION == major) and
+      (HEADER_GDKGLEXT_MINOR_VERSION == minor) and
+      (HEADER_GDKGLEXT_MICRO_VERSION >= micro))
+
+proc GDK_TYPE_GL_CONFIG*(): GType = 
+  result = gdk_gl_config_get_type()
+
+proc GDK_GL_CONFIG*(anObject: Pointer): PGdkGLConfig = 
+  result = cast[PGdkGLConfig](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_GL_CONFIG()))
+
+proc GDK_GL_CONFIG_CLASS*(klass: Pointer): PGdkGLConfigClass = 
+  result = cast[PGdkGLConfigClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_GL_CONFIG()))
+
+proc GDK_IS_GL_CONFIG*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_GL_CONFIG())
+
+proc GDK_IS_GL_CONFIG_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_GL_CONFIG())
+
+proc GDK_GL_CONFIG_GET_CLASS*(obj: Pointer): PGdkGLConfigClass = 
+  result = cast[PGdkGLConfigClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_GL_CONFIG()))
+
+proc GDK_TYPE_GL_CONTEXT*(): GType = 
+  result = gdk_gl_context_get_type()
+
+proc GDK_GL_CONTEXT*(anObject: Pointer): PGdkGLContext = 
+  result = cast[PGdkGLContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      GDK_TYPE_GL_CONTEXT()))
+
+proc GDK_GL_CONTEXT_CLASS*(klass: Pointer): PGdkGLContextClass = 
+  result = cast[PGdkGLContextClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_GL_CONTEXT()))
+
+proc GDK_IS_GL_CONTEXT*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_GL_CONTEXT())
+
+proc GDK_IS_GL_CONTEXT_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_GL_CONTEXT())
+
+proc GDK_GL_CONTEXT_GET_CLASS*(obj: Pointer): PGdkGLContextClass = 
+  result = cast[PGdkGLContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_GL_CONTEXT()))
+
+proc GDK_TYPE_GL_DRAWABLE*(): GType = 
+  result = gdk_gl_drawable_get_type()
+
+proc GDK_GL_DRAWABLE*(inst: Pointer): PGdkGLDrawable = 
+  result = cast[PGdkGLDrawable](G_TYPE_CHECK_INSTANCE_CAST(inst, GDK_TYPE_GL_DRAWABLE()))
+
+proc GDK_GL_DRAWABLE_CLASS*(vtable: Pointer): PGdkGLDrawableClass = 
+  result = cast[PGdkGLDrawableClass](G_TYPE_CHECK_CLASS_CAST(vtable, 
+      GDK_TYPE_GL_DRAWABLE()))
+
+proc GDK_IS_GL_DRAWABLE*(inst: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(inst, GDK_TYPE_GL_DRAWABLE())
+
+proc GDK_IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(vtable, GDK_TYPE_GL_DRAWABLE())
+
+proc GDK_GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGdkGLDrawableClass = 
+  result = cast[PGdkGLDrawableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst, 
+      GDK_TYPE_GL_DRAWABLE()))
+
+proc GDK_TYPE_GL_PIXMAP*(): GType = 
+  result = gdk_gl_pixmap_get_type()
+
+proc GDK_GL_PIXMAP*(anObject: Pointer): PGdkGLPixmap = 
+  result = cast[PGdkGLPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_GL_PIXMAP()))
+
+proc GDK_GL_PIXMAP_CLASS*(klass: Pointer): PGdkGLPixmapClass = 
+  result = cast[PGdkGLPixmapClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_GL_PIXMAP()))
+
+proc GDK_IS_GL_PIXMAP*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_GL_PIXMAP())
+
+proc GDK_IS_GL_PIXMAP_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_GL_PIXMAP())
+
+proc GDK_GL_PIXMAP_GET_CLASS*(obj: Pointer): PGdkGLPixmapClass = 
+  result = cast[PGdkGLPixmapClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_GL_PIXMAP()))
+
+proc gdk_pixmap_get_gl_drawable*(pixmap: PGdkPixmap): PGdkGLDrawable = 
+  result = GDK_GL_DRAWABLE(gdk_pixmap_get_gl_pixmap(pixmap))
+
+proc GDK_TYPE_GL_WINDOW*(): GType = 
+  result = gdk_gl_window_get_type()
+
+proc GDK_GL_WINDOW*(anObject: Pointer): PGdkGLWindow = 
+  result = cast[PGdkGLWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, GDK_TYPE_GL_WINDOW()))
+
+proc GDK_GL_WINDOW_CLASS*(klass: Pointer): PGdkGLWindowClass = 
+  result = cast[PGdkGLWindowClass](G_TYPE_CHECK_CLASS_CAST(klass, GDK_TYPE_GL_WINDOW()))
+
+proc GDK_IS_GL_WINDOW*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GDK_TYPE_GL_WINDOW())
+
+proc GDK_IS_GL_WINDOW_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GDK_TYPE_GL_WINDOW())
+
+proc GDK_GL_WINDOW_GET_CLASS*(obj: Pointer): PGdkGLWindowClass = 
+  result = cast[PGdkGLWindowClass](G_TYPE_INSTANCE_GET_CLASS(obj, GDK_TYPE_GL_WINDOW()))
+
+proc gdk_window_get_gl_drawable*(window: PGdkWindow): PGdkGLDrawable = 
+  result = GDK_GL_DRAWABLE(gdk_window_get_gl_window(window))
diff --git a/lib/base/gtk/glib2.nim b/lib/base/gtk/glib2.nim
new file mode 100755
index 000000000..4b4724c70
--- /dev/null
+++ b/lib/base/gtk/glib2.nim
@@ -0,0 +1,4498 @@
+when defined(windows):
+  {.define: gtkwin.}
+  const
+    gliblib = "libglib-2.0-0.dll"
+    gthreadlib = "libgthread-2.0-0.dll"
+    gmodulelib = "libgmodule-2.0-0.dll"
+    gobjectlib = "libgobject-2.0-0.dll"
+else:
+  const
+    gliblib = "libglib-2.0.so"
+    gthreadlib = "libgthread-2.0.so"
+    gmodulelib = "libgmodule-2.0.so"
+    gobjectlib = "libgobject-2.0.so"
+type
+  PGTypePlugin* = pointer
+  PGParamSpecPool* = pointer
+  PPchar* = ptr cstring
+  PPPchar* = ptr PPchar
+  PPPgchar* = ptr PPgchar
+  PPgchar* = ptr cstring
+  gchar* = char
+  Pgshort* = ptr gshort
+  gshort* = cshort
+  Pglong* = ptr glong
+  glong* = clong
+  Pgint* = ptr gint
+  PPgint* = ptr Pgint
+  gint* = cint
+  Pgboolean* = ptr gboolean
+  gboolean* = bool
+  Pguchar* = ptr guchar
+  PPguchar* = ptr Pguchar
+  guchar* = char
+  Pgushort* = ptr gushort
+  gushort* = int16
+  Pgulong* = ptr gulong
+  gulong* = int
+  guint* = cint
+  Pguint* = ptr guint
+  gfloat* = cfloat
+  Pgfloat* = ptr gfloat
+  gdouble* = cdouble
+  Pgdouble* = ptr gdouble
+  gpointer* = pointer
+  pgpointer* = ptr gpointer
+  gconstpointer* = pointer
+  PGCompareFunc* = ptr TGCompareFunc
+  TGCompareFunc* = proc (a, b: gconstpointer): gint{.cdecl.}
+  PGCompareDataFunc* = ptr TGCompareDataFunc
+  TGCompareDataFunc* = proc (a, b: gconstpointer, user_data: gpointer): gint{.
+      cdecl.}
+  PGEqualFunc* = ptr TGEqualFunc
+  TGEqualFunc* = proc (a, b: gconstpointer): gboolean{.cdecl.}
+  PGDestroyNotify* = ptr TGDestroyNotify
+  TGDestroyNotify* = proc (data: gpointer){.cdecl.}
+  PGFunc* = ptr TGFunc
+  TGFunc* = proc (data, userdata: gpointer, key: gconstpointer){.cdecl.}
+  PGHashFunc* = ptr TGHashFunc
+  TGHashFunc* = proc (key: gconstpointer): guint{.cdecl.}
+  PGHFunc* = ptr TGHFunc
+  TGHFunc* = proc (key, value, user_data: gpointer){.cdecl.}
+  PGFreeFunc* = proc (data: gpointer){.cdecl.}
+  PGTimeVal* = ptr TGTimeVal
+  TGTimeVal* = record
+    tv_sec*: glong
+    tv_usec*: glong
+
+  guint64* = int64
+  gint8* = int8
+  guint8* = int8
+  gint16* = int16
+  guint16* = int16
+  gint32* = int32
+  guint32* = int32
+  gint64* = int64
+  gssize* = int32
+  gsize* = int32
+  Pgint8* = ptr gint8
+  Pguint8* = ptr guint8
+  Pgint16* = ptr gint16
+  Pguint16* = ptr guint16
+  Pgint32* = ptr gint32
+  Pguint32* = ptr guint32
+  Pgint64* = ptr gint64
+  Pguint64* = ptr guint64
+  pgssize* = ptr gssize
+  pgsize* = ptr gsize
+  TGQuark* = guint32
+  PGQuark* = ptr TGQuark
+  PGTypeCValue* = ptr TGTypeCValue
+  TGTypeCValue* = record
+    v_double*: gdouble
+
+  GType* = gulong
+  PGType* = ptr GType
+  PGTypeClass* = ptr TGTypeClass
+  TGTypeClass* = record
+    g_type*: GType
+
+  PGTypeInstance* = ptr TGTypeInstance
+  TGTypeInstance* = record
+    g_class*: PGTypeClass
+
+  PGTypeInterface* = ptr TGTypeInterface
+  TGTypeInterface* {.pure.} = object
+    g_type*: GType
+    g_instance_type*: GType
+
+  PGTypeQuery* = ptr TGTypeQuery
+  TGTypeQuery* = record
+    theType*: GType
+    type_name*: cstring
+    class_size*: guint
+    instance_size*: guint
+
+  PGValue* = ptr TGValue
+  TGValue* = record
+    g_type*: GType
+    data*: array[0..1, gdouble]
+
+  PPGData* = ptr PGData
+  PGData* = pointer
+  PGSList* = ptr TGSList
+  PPGSList* = ptr PGSList
+  TGSList* = record
+    data*: gpointer
+    next*: PGSList
+
+  PGList* = ptr TGList
+  TGList* = record
+    data*: gpointer
+    next*: PGList
+    prev*: PGList
+
+  PGParamFlags* = ptr TGParamFlags
+  TGParamFlags* = int32
+  PGParamSpec* = ptr TGParamSpec
+  PPGParamSpec* = ptr PGParamSpec
+  TGParamSpec* = record
+    g_type_instance*: TGTypeInstance
+    name*: cstring
+    flags*: TGParamFlags
+    value_type*: GType
+    owner_type*: GType
+    nick*: cstring
+    blurb*: cstring
+    qdata*: PGData
+    ref_count*: guint
+    param_id*: guint
+
+  PGParamSpecClass* = ptr TGParamSpecClass
+  TGParamSpecClass* = record
+    g_type_class*: TGTypeClass
+    value_type*: GType
+    finalize*: proc (pspec: PGParamSpec){.cdecl.}
+    value_set_default*: proc (pspec: PGParamSpec, value: PGValue){.cdecl.}
+    value_validate*: proc (pspec: PGParamSpec, value: PGValue): gboolean{.cdecl.}
+    values_cmp*: proc (pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{.
+        cdecl.}
+    dummy*: array[0..3, gpointer]
+
+  PGParameter* = ptr TGParameter
+  TGParameter* = record
+    name*: cstring
+    value*: TGValue
+
+  TGBoxedCopyFunc* = proc (boxed: gpointer): gpointer{.cdecl.}
+  TGBoxedFreeFunc* = proc (boxed: gpointer){.cdecl.}
+
+  PGsource = pointer # I don't know and don't care
+
+const
+  G_TYPE_FUNDAMENTAL_SHIFT* = 2
+  G_TYPE_FUNDAMENTAL_MAX* = 255 shl G_TYPE_FUNDAMENTAL_SHIFT
+  G_TYPE_INVALID* = GType(0 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_NONE* = GType(1 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_INTERFACE* = GType(2 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_CHAR* = GType(3 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_UCHAR* = GType(4 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_BOOLEAN* = GType(5 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_INT* = GType(6 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_UINT* = GType(7 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_LONG* = GType(8 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_ULONG* = GType(9 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_INT64* = GType(10 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_UINT64* = GType(11 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_ENUM* = GType(12 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_FLAGS* = GType(13 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_FLOAT* = GType(14 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_DOUBLE* = GType(15 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_STRING* = GType(16 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_POINTER* = GType(17 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_BOXED* = GType(18 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_PARAM* = GType(19 shl G_TYPE_FUNDAMENTAL_SHIFT)
+  G_TYPE_OBJECT* = GType(20 shl G_TYPE_FUNDAMENTAL_SHIFT)
+
+proc G_TYPE_MAKE_FUNDAMENTAL*(x: int32): GType
+const
+  G_TYPE_RESERVED_GLIB_FIRST* = 21
+  G_TYPE_RESERVED_GLIB_LAST* = 31
+  G_TYPE_RESERVED_BSE_FIRST* = 32
+  G_TYPE_RESERVED_BSE_LAST* = 48
+  G_TYPE_RESERVED_USER_FIRST* = 49
+
+proc G_TYPE_IS_FUNDAMENTAL*(theType: GType): bool
+proc G_TYPE_IS_DERIVED*(theType: GType): bool
+proc G_TYPE_IS_INTERFACE*(theType: GType): bool
+proc G_TYPE_IS_CLASSED*(theType: GType): gboolean
+proc G_TYPE_IS_INSTANTIATABLE*(theType: GType): bool
+proc G_TYPE_IS_DERIVABLE*(theType: GType): bool
+proc G_TYPE_IS_DEEP_DERIVABLE*(theType: GType): bool
+proc G_TYPE_IS_ABSTRACT*(theType: GType): bool
+proc G_TYPE_IS_VALUE_ABSTRACT*(theType: GType): bool
+proc G_TYPE_IS_VALUE_TYPE*(theType: GType): bool
+proc G_TYPE_HAS_VALUE_TABLE*(theType: GType): bool
+proc G_TYPE_CHECK_INSTANCE*(instance: Pointer): gboolean
+proc G_TYPE_CHECK_INSTANCE_CAST*(instance: Pointer, g_type: GType): PGTypeInstance
+proc G_TYPE_CHECK_INSTANCE_TYPE*(instance: Pointer, g_type: GType): bool
+proc G_TYPE_INSTANCE_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass
+proc G_TYPE_INSTANCE_GET_INTERFACE*(instance: Pointer, g_type: GType): Pointer
+proc G_TYPE_CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer
+proc G_TYPE_CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool
+proc G_TYPE_CHECK_VALUE*(value: Pointer): bool
+proc G_TYPE_CHECK_VALUE_TYPE*(value: pointer, g_type: GType): bool
+proc G_TYPE_FROM_INSTANCE*(instance: Pointer): GType
+proc G_TYPE_FROM_CLASS*(g_class: Pointer): GType
+proc G_TYPE_FROM_INTERFACE*(g_iface: Pointer): GType
+type
+  PGTypeDebugFlags* = ptr TGTypeDebugFlags
+  TGTypeDebugFlags* = int32
+
+const
+  G_TYPE_DEBUG_NONE* = 0
+  G_TYPE_DEBUG_OBJECTS* = 1 shl 0
+  G_TYPE_DEBUG_SIGNALS* = 1 shl 1
+  G_TYPE_DEBUG_MASK* = 0x00000003
+
+proc g_type_init*(){.cdecl, dynlib: gobjectlib, importc: "g_type_init".}
+proc g_type_init_with_debug_flags*(debug_flags: TGTypeDebugFlags){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_init_with_debug_flags".}
+proc g_type_name*(theType: GType): cstring{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_name".}
+proc g_type_qname*(theType: GType): TGQuark{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_qname".}
+proc g_type_from_name*(name: cstring): GType{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_from_name".}
+proc g_type_parent*(theType: GType): GType{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_parent".}
+proc g_type_depth*(theType: GType): guint{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_depth".}
+proc g_type_next_base*(leaf_type: GType, root_type: GType): GType{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_next_base".}
+proc g_type_is_a*(theType: GType, is_a_type: GType): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_is_a".}
+proc g_type_class_ref*(theType: GType): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_class_ref".}
+proc g_type_class_peek*(theType: GType): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_class_peek".}
+proc g_type_class_unref*(g_class: gpointer){.cdecl, dynlib: gobjectlib,
+    importc: "g_type_class_unref".}
+proc g_type_class_peek_parent*(g_class: gpointer): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_class_peek_parent".}
+proc g_type_interface_peek*(instance_class: gpointer, iface_type: GType): gpointer{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_interface_peek".}
+proc g_type_interface_peek_parent*(g_iface: gpointer): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_interface_peek_parent".}
+proc g_type_children*(theType: GType, n_children: Pguint): PGType{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_children".}
+proc g_type_interfaces*(theType: GType, n_interfaces: Pguint): PGType{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_interfaces".}
+proc g_type_set_qdata*(theType: GType, quark: TGQuark, data: gpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_set_qdata".}
+proc g_type_get_qdata*(theType: GType, quark: TGQuark): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_get_qdata".}
+proc g_type_query*(theType: GType, query: PGTypeQuery){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_query".}
+type
+  TGBaseInitFunc* = proc (g_class: gpointer){.cdecl.}
+  TGBaseFinalizeFunc* = proc (g_class: gpointer){.cdecl.}
+  TGClassInitFunc* = proc (g_class: gpointer, class_data: gpointer){.cdecl.}
+  TGClassFinalizeFunc* = proc (g_class: gpointer, class_data: gpointer){.cdecl.}
+  TGInstanceInitFunc* = proc (instance: PGTypeInstance, g_class: gpointer){.
+      cdecl.}
+  TGInterfaceInitFunc* = proc (g_iface: gpointer, iface_data: gpointer){.cdecl.}
+  TGInterfaceFinalizeFunc* = proc (g_iface: gpointer, iface_data: gpointer){.
+      cdecl.}
+  TGTypeClassCacheFunc* = proc (cache_data: gpointer, g_class: PGTypeClass): gboolean{.
+      cdecl.}
+  TGTypeFundamentalFlags* = int32
+  PGTypeFundamentalFlags* = ptr TGTypeFundamentalFlags
+
+const
+  G_TYPE_FLAG_CLASSED* = 1 shl 0
+  G_TYPE_FLAG_INSTANTIATABLE* = 1 shl 1
+  G_TYPE_FLAG_DERIVABLE* = 1 shl 2
+  G_TYPE_FLAG_DEEP_DERIVABLE* = 1 shl 3
+
+type
+  PGTypeFlags* = ptr TGTypeFlags
+  TGTypeFlags* = int32
+
+const
+  G_TYPE_FLAG_ABSTRACT* = 1 shl 4
+  G_TYPE_FLAG_VALUE_ABSTRACT* = 1 shl 5
+
+type
+  PGTypeValueTable* = ptr TGTypeValueTable
+  TGTypeValueTable* = record
+    value_init*: proc (value: PGValue){.cdecl.}
+    value_free*: proc (value: PGValue){.cdecl.}
+    value_copy*: proc (src_value: PGValue, dest_value: PGValue){.cdecl.}
+    value_peek_pointer*: proc (value: PGValue): gpointer{.cdecl.}
+    collect_format*: cstring
+    collect_value*: proc (value: PGValue, n_collect_values: guint,
+                          collect_values: PGTypeCValue, collect_flags: guint): cstring{.
+        cdecl.}
+    lcopy_format*: cstring
+    lcopy_value*: proc (value: PGValue, n_collect_values: guint,
+                        collect_values: PGTypeCValue, collect_flags: guint): cstring{.
+        cdecl.}
+
+  PGTypeInfo* = ptr TGTypeInfo
+  TGTypeInfo* = record
+    class_size*: guint16
+    base_init*: TGBaseInitFunc
+    base_finalize*: TGBaseFinalizeFunc
+    class_init*: TGClassInitFunc
+    class_finalize*: TGClassFinalizeFunc
+    class_data*: gconstpointer
+    instance_size*: guint16
+    n_preallocs*: guint16
+    instance_init*: TGInstanceInitFunc
+    value_table*: PGTypeValueTable
+
+  PGTypeFundamentalInfo* = ptr TGTypeFundamentalInfo
+  TGTypeFundamentalInfo* = record
+    type_flags*: TGTypeFundamentalFlags
+
+  PGInterfaceInfo* = ptr TGInterfaceInfo
+  TGInterfaceInfo* = record
+    interface_init*: TGInterfaceInitFunc
+    interface_finalize*: TGInterfaceFinalizeFunc
+    interface_data*: gpointer
+
+
+proc g_type_register_static*(parent_type: GType, type_name: cstring,
+                             info: PGTypeInfo, flags: TGTypeFlags): GType{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_register_static".}
+proc g_type_register_dynamic*(parent_type: GType, type_name: cstring,
+                              plugin: PGTypePlugin, flags: TGTypeFlags): GType{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_register_dynamic".}
+proc g_type_register_fundamental*(type_id: GType, type_name: cstring,
+                                  info: PGTypeInfo,
+                                  finfo: PGTypeFundamentalInfo,
+                                  flags: TGTypeFlags): GType{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_register_fundamental".}
+proc g_type_add_interface_static*(instance_type: GType, interface_type: GType,
+                                  info: PGInterfaceInfo){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_add_interface_static".}
+proc g_type_add_interface_dynamic*(instance_type: GType, interface_type: GType,
+                                   plugin: PGTypePlugin){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_add_interface_dynamic".}
+proc g_type_interface_add_prerequisite*(interface_type: GType,
+                                        prerequisite_type: GType){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_interface_add_prerequisite".}
+proc g_type_get_plugin*(theType: GType): PGTypePlugin{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_get_plugin".}
+proc g_type_interface_get_plugin*(instance_type: GType,
+                                  implementation_type: GType): PGTypePlugin{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_interface_get_plugin".}
+proc g_type_fundamental_next*(): GType{.cdecl, dynlib: gobjectlib,
+                                        importc: "g_type_fundamental_next".}
+proc g_type_fundamental*(type_id: GType): GType{.cdecl, dynlib: gobjectlib,
+    importc: "g_type_fundamental".}
+proc g_type_create_instance*(theType: GType): PGTypeInstance{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_create_instance".}
+proc g_type_free_instance*(instance: PGTypeInstance){.cdecl, dynlib: gobjectlib,
+    importc: "g_type_free_instance".}
+proc g_type_add_class_cache_func*(cache_data: gpointer,
+                                  cache_func: TGTypeClassCacheFunc){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_add_class_cache_func".}
+proc g_type_remove_class_cache_func*(cache_data: gpointer,
+                                     cache_func: TGTypeClassCacheFunc){.cdecl,
+    dynlib: gobjectlib, importc: "g_type_remove_class_cache_func".}
+proc g_type_class_unref_uncached*(g_class: gpointer){.cdecl, dynlib: gobjectlib,
+    importc: "g_type_class_unref_uncached".}
+proc g_type_value_table_peek*(theType: GType): PGTypeValueTable{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_value_table_peek".}
+proc private_g_type_check_instance*(instance: PGTypeInstance): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_check_instance".}
+proc private_g_type_check_instance_cast*(instance: PGTypeInstance,
+    iface_type: GType): PGTypeInstance{.cdecl, dynlib: gobjectlib,
+                                        importc: "g_type_check_instance_cast".}
+proc private_g_type_check_instance_is_a*(instance: PGTypeInstance,
+    iface_type: GType): gboolean{.cdecl, dynlib: gobjectlib,
+                                  importc: "g_type_check_instance_is_a".}
+proc private_g_type_check_class_cast*(g_class: PGTypeClass, is_a_type: GType): PGTypeClass{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_check_class_cast".}
+proc private_g_type_check_class_is_a*(g_class: PGTypeClass, is_a_type: GType): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_check_class_is_a".}
+proc private_g_type_check_is_value_type*(theType: GType): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_check_is_value_type".}
+proc private_g_type_check_value*(value: PGValue): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_check_value".}
+proc private_g_type_check_value_holds*(value: PGValue, theType: GType): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_type_check_value_holds".}
+proc private_g_type_test_flags*(theType: GType, flags: guint): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_test_flags".}
+proc g_type_name_from_instance*(instance: PGTypeInstance): cstring{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_name_from_instance".}
+proc g_type_name_from_class*(g_class: PGTypeClass): cstring{.cdecl,
+    dynlib: gobjectlib, importc: "g_type_name_from_class".}
+const
+  G_TYPE_FLAG_RESERVED_ID_BIT* = GType(1 shl 0)
+
+proc G_TYPE_IS_VALUE*(theType: GType): bool
+proc G_IS_VALUE*(value: pointer): bool
+proc G_VALUE_TYPE*(value: Pointer): GType
+proc G_VALUE_TYPE_NAME*(value: Pointer): cstring
+proc G_VALUE_HOLDS*(value: pointer, g_type: GType): bool
+type
+  TGValueTransform* = proc (src_value: PGValue, dest_value: PGValue){.cdecl.}
+
+proc g_value_init*(value: PGValue, g_type: GType): PGValue{.cdecl,
+    dynlib: gobjectlib, importc: "g_value_init".}
+proc g_value_copy*(src_value: PGValue, dest_value: PGValue){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_copy".}
+proc g_value_reset*(value: PGValue): PGValue{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_reset".}
+proc g_value_unset*(value: PGValue){.cdecl, dynlib: gobjectlib,
+                                     importc: "g_value_unset".}
+proc g_value_set_instance*(value: PGValue, instance: gpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_instance".}
+proc g_value_fits_pointer*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_fits_pointer".}
+proc g_value_peek_pointer*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_peek_pointer".}
+proc g_value_type_compatible*(src_type: GType, dest_type: GType): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_type_compatible".}
+proc g_value_type_transformable*(src_type: GType, dest_type: GType): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_type_transformable".}
+proc g_value_transform*(src_value: PGValue, dest_value: PGValue): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_transform".}
+proc g_value_register_transform_func*(src_type: GType, dest_type: GType,
+                                      transform_func: TGValueTransform){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_register_transform_func".}
+const
+  G_VALUE_NOCOPY_CONTENTS* = 1 shl 27
+
+type
+  PGValueArray* = ptr TGValueArray
+  TGValueArray* = record
+    n_values*: guint
+    values*: PGValue
+    n_prealloced*: guint
+
+
+proc g_value_array_get_nth*(value_array: PGValueArray, index: guint): PGValue{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_array_get_nth".}
+proc g_value_array_new*(n_prealloced: guint): PGValueArray{.cdecl,
+    dynlib: gobjectlib, importc: "g_value_array_new".}
+proc g_value_array_free*(value_array: PGValueArray){.cdecl, dynlib: gobjectlib,
+    importc: "g_value_array_free".}
+proc g_value_array_copy*(value_array: PGValueArray): PGValueArray{.cdecl,
+    dynlib: gobjectlib, importc: "g_value_array_copy".}
+proc g_value_array_prepend*(value_array: PGValueArray, value: PGValue): PGValueArray{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_array_prepend".}
+proc g_value_array_append*(value_array: PGValueArray, value: PGValue): PGValueArray{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_array_append".}
+proc g_value_array_insert*(value_array: PGValueArray, index: guint,
+                           value: PGValue): PGValueArray{.cdecl,
+    dynlib: gobjectlib, importc: "g_value_array_insert".}
+proc g_value_array_remove*(value_array: PGValueArray, index: guint): PGValueArray{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_array_remove".}
+proc g_value_array_sort*(value_array: PGValueArray, compare_func: TGCompareFunc): PGValueArray{.
+    cdecl, dynlib: gobjectlib, importc: "g_value_array_sort".}
+proc g_value_array_sort_with_data*(value_array: PGValueArray,
+                                   compare_func: TGCompareDataFunc,
+                                   user_data: gpointer): PGValueArray{.cdecl,
+    dynlib: gobjectlib, importc: "g_value_array_sort_with_data".}
+const
+  G_VALUE_COLLECT_INT* = 'i'
+  G_VALUE_COLLECT_LONG* = 'l'
+  G_VALUE_COLLECT_INT64* = 'q'
+  G_VALUE_COLLECT_DOUBLE* = 'd'
+  G_VALUE_COLLECT_POINTER* = 'p'
+  G_VALUE_COLLECT_FORMAT_MAX_LENGTH* = 8
+
+proc G_VALUE_HOLDS_CHAR*(value: PGValue): bool
+proc G_VALUE_HOLDS_UCHAR*(value: PGValue): bool
+proc G_VALUE_HOLDS_BOOLEAN*(value: PGValue): bool
+proc G_VALUE_HOLDS_INT*(value: PGValue): bool
+proc G_VALUE_HOLDS_UINT*(value: PGValue): bool
+proc G_VALUE_HOLDS_LONG*(value: PGValue): bool
+proc G_VALUE_HOLDS_ULONG*(value: PGValue): bool
+proc G_VALUE_HOLDS_INT64*(value: PGValue): bool
+proc G_VALUE_HOLDS_UINT64*(value: PGValue): bool
+proc G_VALUE_HOLDS_FLOAT*(value: PGValue): bool
+proc G_VALUE_HOLDS_DOUBLE*(value: PGValue): bool
+proc G_VALUE_HOLDS_STRING*(value: PGValue): bool
+proc G_VALUE_HOLDS_POINTER*(value: PGValue): bool
+proc g_value_set_char*(value: PGValue, v_char: gchar){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_char".}
+proc g_value_get_char*(value: PGValue): gchar{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_char".}
+proc g_value_set_uchar*(value: PGValue, v_uchar: guchar){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_uchar".}
+proc g_value_get_uchar*(value: PGValue): guchar{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_uchar".}
+proc g_value_set_boolean*(value: PGValue, v_boolean: gboolean){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_boolean".}
+proc g_value_get_boolean*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_boolean".}
+proc g_value_set_int*(value: PGValue, v_int: gint){.cdecl, dynlib: gobjectlib,
+    importc: "g_value_set_int".}
+proc g_value_get_int*(value: PGValue): gint{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_int".}
+proc g_value_set_uint*(value: PGValue, v_uint: guint){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_uint".}
+proc g_value_get_uint*(value: PGValue): guint{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_uint".}
+proc g_value_set_long*(value: PGValue, v_long: glong){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_long".}
+proc g_value_get_long*(value: PGValue): glong{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_long".}
+proc g_value_set_ulong*(value: PGValue, v_ulong: gulong){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_ulong".}
+proc g_value_get_ulong*(value: PGValue): gulong{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_ulong".}
+proc g_value_set_int64*(value: PGValue, v_int64: gint64){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_int64".}
+proc g_value_get_int64*(value: PGValue): gint64{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_int64".}
+proc g_value_set_uint64*(value: PGValue, v_uint64: guint64){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_uint64".}
+proc g_value_get_uint64*(value: PGValue): guint64{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_uint64".}
+proc g_value_set_float*(value: PGValue, v_float: gfloat){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_float".}
+proc g_value_get_float*(value: PGValue): gfloat{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_float".}
+proc g_value_set_double*(value: PGValue, v_double: gdouble){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_double".}
+proc g_value_get_double*(value: PGValue): gdouble{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_double".}
+proc g_value_set_string*(value: PGValue, v_string: cstring){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_string".}
+proc g_value_set_static_string*(value: PGValue, v_string: cstring){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_static_string".}
+proc g_value_get_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_string".}
+proc g_value_dup_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_dup_string".}
+proc g_value_set_pointer*(value: PGValue, v_pointer: gpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_pointer".}
+proc g_value_get_pointer*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_pointer".}
+proc g_pointer_type_register_static*(name: cstring): GType{.cdecl,
+    dynlib: gobjectlib, importc: "g_pointer_type_register_static".}
+proc g_strdup_value_contents*(value: PGValue): cstring{.cdecl,
+    dynlib: gobjectlib, importc: "g_strdup_value_contents".}
+proc g_value_set_string_take_ownership*(value: PGValue, v_string: cstring){.
+    cdecl, dynlib: gobjectlib, importc: "g_value_set_string_take_ownership".}
+type
+  Pgchararray* = ptr Tgchararray
+  Tgchararray* = gchar
+
+proc G_TYPE_IS_PARAM*(theType: GType): bool
+proc G_PARAM_SPEC*(pspec: Pointer): PGParamSpec
+proc G_IS_PARAM_SPEC*(pspec: Pointer): bool
+proc G_PARAM_SPEC_CLASS*(pclass: Pointer): PGParamSpecClass
+proc G_IS_PARAM_SPEC_CLASS*(pclass: Pointer): bool
+proc G_PARAM_SPEC_GET_CLASS*(pspec: Pointer): PGParamSpecClass
+proc G_PARAM_SPEC_TYPE*(pspec: Pointer): GType
+proc G_PARAM_SPEC_TYPE_NAME*(pspec: Pointer): cstring
+proc G_PARAM_SPEC_VALUE_TYPE*(pspec: Pointer): GType
+proc G_VALUE_HOLDS_PARAM*(value: Pointer): bool
+const
+  G_PARAM_READABLE* = 1 shl 0
+  G_PARAM_WRITABLE* = 1 shl 1
+  G_PARAM_CONSTRUCT* = 1 shl 2
+  G_PARAM_CONSTRUCT_ONLY* = 1 shl 3
+  G_PARAM_LAX_VALIDATION* = 1 shl 4
+  G_PARAM_PRIVATE* = 1 shl 5
+  G_PARAM_READWRITE* = G_PARAM_READABLE or G_PARAM_WRITABLE
+  G_PARAM_MASK* = 0x000000FF
+  G_PARAM_USER_SHIFT* = 8
+
+proc g_param_spec_ref*(pspec: PGParamSpec): PGParamSpec{.cdecl, dynlib: gliblib,
+    importc: "g_param_spec_ref".}
+proc g_param_spec_unref*(pspec: PGParamSpec){.cdecl, dynlib: gliblib,
+    importc: "g_param_spec_unref".}
+proc g_param_spec_sink*(pspec: PGParamSpec){.cdecl, dynlib: gliblib,
+    importc: "g_param_spec_sink".}
+proc g_param_spec_get_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_get_qdata".}
+proc g_param_spec_set_qdata*(pspec: PGParamSpec, quark: TGQuark, data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata".}
+proc g_param_spec_set_qdata_full*(pspec: PGParamSpec, quark: TGQuark,
+                                  data: gpointer, destroy: TGDestroyNotify){.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata_full".}
+proc g_param_spec_steal_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_steal_qdata".}
+proc g_param_value_set_default*(pspec: PGParamSpec, value: PGValue){.cdecl,
+    dynlib: gliblib, importc: "g_param_value_set_default".}
+proc g_param_value_defaults*(pspec: PGParamSpec, value: PGValue): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_param_value_defaults".}
+proc g_param_value_validate*(pspec: PGParamSpec, value: PGValue): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_param_value_validate".}
+proc g_param_value_convert*(pspec: PGParamSpec, src_value: PGValue,
+                            dest_value: PGValue, strict_validation: gboolean): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_param_value_convert".}
+proc g_param_values_cmp*(pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{.
+    cdecl, dynlib: gliblib, importc: "g_param_values_cmp".}
+proc g_param_spec_get_name*(pspec: PGParamSpec): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_param_spec_get_name".}
+proc g_param_spec_get_nick*(pspec: PGParamSpec): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_param_spec_get_nick".}
+proc g_param_spec_get_blurb*(pspec: PGParamSpec): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_param_spec_get_blurb".}
+proc g_value_set_param*(value: PGValue, param: PGParamSpec){.cdecl,
+    dynlib: gliblib, importc: "g_value_set_param".}
+proc g_value_get_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib,
+    importc: "g_value_get_param".}
+proc g_value_dup_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib,
+    importc: "g_value_dup_param".}
+proc g_value_set_param_take_ownership*(value: PGValue, param: PGParamSpec){.
+    cdecl, dynlib: gliblib, importc: "g_value_set_param_take_ownership".}
+type
+  PGParamSpecTypeInfo* = ptr TGParamSpecTypeInfo
+  TGParamSpecTypeInfo* = record
+    instance_size*: guint16
+    n_preallocs*: guint16
+    instance_init*: proc (pspec: PGParamSpec){.cdecl.}
+    value_type*: GType
+    finalize*: proc (pspec: PGParamSpec){.cdecl.}
+    value_set_default*: proc (pspec: PGParamSpec, value: PGValue){.cdecl.}
+    value_validate*: proc (pspec: PGParamSpec, value: PGValue): gboolean{.cdecl.}
+    values_cmp*: proc (pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{.
+        cdecl.}
+
+
+proc g_param_type_register_static*(name: cstring,
+                                   pspec_info: PGParamSpecTypeInfo): GType{.
+    cdecl, dynlib: gliblib, importc: "g_param_type_register_static".}
+proc g_param_type_register_static_constant*(name: cstring,
+    pspec_info: PGParamSpecTypeInfo, opt_type: GType): GType{.cdecl,
+    dynlib: gliblib, importc: "`g_param_type_register_static_constant`".}
+proc g_param_spec_internal*(param_type: GType, name: cstring, nick: cstring,
+                            blurb: cstring, flags: TGParamFlags): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_internal".}
+proc g_param_spec_pool_new*(type_prefixing: gboolean): PGParamSpecPool{.cdecl,
+    dynlib: gliblib, importc: "g_param_spec_pool_new".}
+proc g_param_spec_pool_insert*(pool: PGParamSpecPool, pspec: PGParamSpec,
+                               owner_type: GType){.cdecl, dynlib: gliblib,
+    importc: "g_param_spec_pool_insert".}
+proc g_param_spec_pool_remove*(pool: PGParamSpecPool, pspec: PGParamSpec){.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_pool_remove".}
+proc g_param_spec_pool_lookup*(pool: PGParamSpecPool, param_name: cstring,
+                               owner_type: GType, walk_ancestors: gboolean): PGParamSpec{.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_pool_lookup".}
+proc g_param_spec_pool_list_owned*(pool: PGParamSpecPool, owner_type: GType): PGList{.
+    cdecl, dynlib: gliblib, importc: "g_param_spec_pool_list_owned".}
+proc g_param_spec_pool_list*(pool: PGParamSpecPool, owner_type: GType,
+                             n_pspecs_p: Pguint): PPGParamSpec{.cdecl,
+    dynlib: gliblib, importc: "g_param_spec_pool_list".}
+type
+  PGClosure* = ptr TGClosure
+  PGClosureNotifyData* = ptr TGClosureNotifyData
+  TGClosureNotify* = proc (data: gpointer, closure: PGClosure){.cdecl.}
+  TGClosure* = record
+    flag0*: int32
+    marshal*: proc (closure: PGClosure, return_value: PGValue,
+                    n_param_values: guint, param_values: PGValue,
+                    invocation_hint, marshal_data: gpointer){.cdecl.}
+    data*: gpointer
+    notifiers*: PGClosureNotifyData
+
+  TGCallBackProcedure* = proc () {.cdecl.}
+  TGCallback* = proc () {.cdecl.}
+  TGClosureMarshal* = proc (closure: PGClosure, return_value: PGValue,
+                            n_param_values: guint, param_values: PGValue,
+                            invocation_hint: gpointer, marshal_data: gpointer){.
+      cdecl.}
+  TGClosureNotifyData* = record
+    data*: gpointer
+    notify*: TGClosureNotify
+
+
+proc G_CLOSURE_NEEDS_MARSHAL*(closure: Pointer): bool
+proc G_CLOSURE_N_NOTIFIERS*(cl: PGClosure): int32
+proc G_CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32
+proc G_CALLBACK*(f: pointer): TGCallback
+const
+  bm_TGClosure_ref_count* = 0x00007FFF
+  bp_TGClosure_ref_count* = 0
+  bm_TGClosure_meta_marshal* = 0x00008000
+  bp_TGClosure_meta_marshal* = 15
+  bm_TGClosure_n_guards* = 0x00010000
+  bp_TGClosure_n_guards* = 16
+  bm_TGClosure_n_fnotifiers* = 0x00060000
+  bp_TGClosure_n_fnotifiers* = 17
+  bm_TGClosure_n_inotifiers* = 0x07F80000
+  bp_TGClosure_n_inotifiers* = 19
+  bm_TGClosure_in_inotify* = 0x08000000
+  bp_TGClosure_in_inotify* = 27
+  bm_TGClosure_floating* = 0x10000000
+  bp_TGClosure_floating* = 28
+  bm_TGClosure_derivative_flag* = 0x20000000
+  bp_TGClosure_derivative_flag* = 29
+  bm_TGClosure_in_marshal* = 0x40000000
+  bp_TGClosure_in_marshal* = 30
+  bm_TGClosure_is_invalid* = 0x80000000
+  bp_TGClosure_is_invalid* = 31
+
+proc ref_count*(a: var TGClosure): guint
+proc set_ref_count*(a: var TGClosure, ref_count: guint)
+proc meta_marshal*(a: PGClosure): guint
+proc set_meta_marshal*(a: var TGClosure, meta_marshal: guint)
+proc n_guards*(a: PGClosure): guint
+proc set_n_guards*(a: var TGClosure, n_guards: guint)
+proc n_fnotifiers*(a: PGClosure): guint
+proc set_n_fnotifiers*(a: var TGClosure, n_fnotifiers: guint)
+proc n_inotifiers*(a: PGClosure): guint
+proc in_inotify*(a: var TGClosure): guint
+proc set_in_inotify*(a: var TGClosure, in_inotify: guint)
+proc floating*(a: var TGClosure): guint
+proc set_floating*(a: var TGClosure, floating: guint)
+proc derivative_flag*(a: PGClosure): guint
+proc set_derivative_flag*(a: var TGClosure, derivative_flag: guint)
+proc in_marshal*(a: var TGClosure): guint
+proc set_in_marshal*(a: var TGClosure, in_marshal: guint)
+proc is_invalid*(a: var TGClosure): guint
+proc set_is_invalid*(a: var TGClosure, is_invalid: guint)
+type
+  PGCClosure* = ptr TGCClosure
+  TGCClosure* = record
+    closure*: TGClosure
+    callback*: gpointer
+
+
+proc g_cclosure_new*(callback_func: TGCallback, user_data: gpointer,
+                     destroy_data: TGClosureNotify): PGClosure{.cdecl,
+    dynlib: gliblib, importc: "g_cclosure_new".}
+proc g_cclosure_new_swap*(callback_func: TGCallback, user_data: gpointer,
+                          destroy_data: TGClosureNotify): PGClosure{.cdecl,
+    dynlib: gliblib, importc: "g_cclosure_new_swap".}
+proc g_signal_type_cclosure_new*(itype: GType, struct_offset: guint): PGClosure{.
+    cdecl, dynlib: gliblib, importc: "g_signal_type_cclosure_new".}
+proc g_closure_ref*(closure: PGClosure): PGClosure{.cdecl, dynlib: gliblib,
+    importc: "g_closure_ref".}
+proc g_closure_sink*(closure: PGClosure){.cdecl, dynlib: gliblib,
+    importc: "g_closure_sink".}
+proc g_closure_unref*(closure: PGClosure){.cdecl, dynlib: gliblib,
+    importc: "g_closure_unref".}
+proc g_closure_new_simple*(sizeof_closure: guint, data: gpointer): PGClosure{.
+    cdecl, dynlib: gliblib, importc: "g_closure_new_simple".}
+proc g_closure_add_finalize_notifier*(closure: PGClosure, notify_data: gpointer,
+                                      notify_func: TGClosureNotify){.cdecl,
+    dynlib: gliblib, importc: "g_closure_add_finalize_notifier".}
+proc g_closure_remove_finalize_notifier*(closure: PGClosure,
+    notify_data: gpointer, notify_func: TGClosureNotify){.cdecl,
+    dynlib: gliblib, importc: "g_closure_remove_finalize_notifier".}
+proc g_closure_add_invalidate_notifier*(closure: PGClosure,
+                                        notify_data: gpointer,
+                                        notify_func: TGClosureNotify){.cdecl,
+    dynlib: gliblib, importc: "g_closure_add_invalidate_notifier".}
+proc g_closure_remove_invalidate_notifier*(closure: PGClosure,
+    notify_data: gpointer, notify_func: TGClosureNotify){.cdecl,
+    dynlib: gliblib, importc: "g_closure_remove_invalidate_notifier".}
+proc g_closure_add_marshal_guards*(closure: PGClosure,
+                                   pre_marshal_data: gpointer,
+                                   pre_marshal_notify: TGClosureNotify,
+                                   post_marshal_data: gpointer,
+                                   post_marshal_notify: TGClosureNotify){.cdecl,
+    dynlib: gliblib, importc: "g_closure_add_marshal_guards".}
+proc g_closure_set_marshal*(closure: PGClosure, marshal: TGClosureMarshal){.
+    cdecl, dynlib: gliblib, importc: "g_closure_set_marshal".}
+proc g_closure_set_meta_marshal*(closure: PGClosure, marshal_data: gpointer,
+                                 meta_marshal: TGClosureMarshal){.cdecl,
+    dynlib: gliblib, importc: "g_closure_set_meta_marshal".}
+proc g_closure_invalidate*(closure: PGClosure){.cdecl, dynlib: gliblib,
+    importc: "g_closure_invalidate".}
+proc g_closure_invoke*(closure: PGClosure, return_value: PGValue,
+                       n_param_values: guint, param_values: PGValue,
+                       invocation_hint: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_closure_invoke".}
+type
+  PGSignalInvocationHint* = ptr TGSignalInvocationHint
+  PGSignalCMarshaller* = ptr TGSignalCMarshaller
+  TGSignalCMarshaller* = TGClosureMarshal
+  TGSignalEmissionHook* = proc (ihint: PGSignalInvocationHint,
+                                n_param_values: guint, param_values: PGValue,
+                                data: gpointer): gboolean{.cdecl.}
+  TGSignalAccumulator* = proc (ihint: PGSignalInvocationHint,
+                               return_accu: PGValue, handler_return: PGValue,
+                               data: gpointer): gboolean{.cdecl.}
+  PGSignalFlags* = ptr TGSignalFlags
+  TGSignalFlags* = int32
+  TGSignalInvocationHint* = record
+    signal_id*: guint
+    detail*: TGQuark
+    run_type*: TGSignalFlags
+
+  PGSignalQuery* = ptr TGSignalQuery
+  TGSignalQuery* = record
+    signal_id*: guint
+    signal_name*: cstring
+    itype*: GType
+    signal_flags*: TGSignalFlags
+    return_type*: GType
+    n_params*: guint
+    param_types*: PGType
+
+
+const
+  G_SIGNAL_RUN_FIRST* = 1 shl 0
+  G_SIGNAL_RUN_LAST* = 1 shl 1
+  G_SIGNAL_RUN_CLEANUP* = 1 shl 2
+  G_SIGNAL_NO_RECURSE* = 1 shl 3
+  G_SIGNAL_DETAILED* = 1 shl 4
+  G_SIGNAL_ACTION* = 1 shl 5
+  G_SIGNAL_NO_HOOKS* = 1 shl 6
+  G_SIGNAL_FLAGS_MASK* = 0x0000007F
+
+type
+  PGConnectFlags* = ptr TGConnectFlags
+  TGConnectFlags* = int32
+
+const
+  G_CONNECT_AFTER* = 1 shl 0
+  G_CONNECT_SWAPPED* = 1 shl 1
+
+type
+  PGSignalMatchType* = ptr TGSignalMatchType
+  TGSignalMatchType* = int32
+
+const
+  G_SIGNAL_MATCH_ID* = 1 shl 0
+  G_SIGNAL_MATCH_DETAIL* = 1 shl 1
+  G_SIGNAL_MATCH_CLOSURE* = 1 shl 2
+  G_SIGNAL_MATCH_FUNC* = 1 shl 3
+  G_SIGNAL_MATCH_DATA* = 1 shl 4
+  G_SIGNAL_MATCH_UNBLOCKED* = 1 shl 5
+  G_SIGNAL_MATCH_MASK* = 0x0000003F
+  G_SIGNAL_TYPE_STATIC_SCOPE* = G_TYPE_FLAG_RESERVED_ID_BIT
+
+proc g_signal_newv*(signal_name: cstring, itype: GType,
+                    signal_flags: TGSignalFlags, class_closure: PGClosure,
+                    accumulator: TGSignalAccumulator, accu_data: gpointer,
+                    c_marshaller: TGSignalCMarshaller, return_type: GType,
+                    n_params: guint, param_types: PGType): guint{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_newv".}
+proc g_signal_emitv*(instance_and_params: PGValue, signal_id: guint,
+                     detail: TGQuark, return_value: PGValue){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_emitv".}
+proc g_signal_lookup*(name: cstring, itype: GType): guint{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_lookup".}
+proc g_signal_name*(signal_id: guint): cstring{.cdecl, dynlib: gobjectlib,
+    importc: "g_signal_name".}
+proc g_signal_query*(signal_id: guint, query: PGSignalQuery){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_query".}
+proc g_signal_list_ids*(itype: GType, n_ids: Pguint): Pguint{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_list_ids".}
+proc g_signal_parse_name*(detailed_signal: cstring, itype: GType,
+                          signal_id_p: Pguint, detail_p: PGQuark,
+                          force_detail_quark: gboolean): gboolean{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_parse_name".}
+proc g_signal_get_invocation_hint*(instance: gpointer): PGSignalInvocationHint{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_get_invocation_hint".}
+proc g_signal_stop_emission*(instance: gpointer, signal_id: guint,
+                             detail: TGQuark){.cdecl, dynlib: gobjectlib,
+    importc: "g_signal_stop_emission".}
+proc g_signal_stop_emission_by_name*(instance: gpointer,
+                                     detailed_signal: cstring){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_stop_emission_by_name".}
+proc g_signal_add_emission_hook*(signal_id: guint, quark: TGQuark,
+                                 hook_func: TGSignalEmissionHook,
+                                 hook_data: gpointer,
+                                 data_destroy: TGDestroyNotify): gulong{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_add_emission_hook".}
+proc g_signal_remove_emission_hook*(signal_id: guint, hook_id: gulong){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_remove_emission_hook".}
+proc g_signal_has_handler_pending*(instance: gpointer, signal_id: guint,
+                                   detail: TGQuark, may_be_blocked: gboolean): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_has_handler_pending".}
+proc g_signal_connect_closure_by_id*(instance: gpointer, signal_id: guint,
+                                     detail: TGQuark, closure: PGClosure,
+                                     after: gboolean): gulong{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_connect_closure_by_id".}
+proc g_signal_connect_closure*(instance: gpointer, detailed_signal: cstring,
+                               closure: PGClosure, after: gboolean): gulong{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_connect_closure".}
+proc g_signal_connect_data*(instance: gpointer, detailed_signal: cstring,
+                            c_handler: TGCallback, data: gpointer,
+                            destroy_data: TGClosureNotify,
+                            connect_flags: TGConnectFlags): gulong{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_connect_data".}
+proc g_signal_handler_block*(instance: gpointer, handler_id: gulong){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_handler_block".}
+proc g_signal_handler_unblock*(instance: gpointer, handler_id: gulong){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_handler_unblock".}
+proc g_signal_handler_disconnect*(instance: gpointer, handler_id: gulong){.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_handler_disconnect".}
+proc g_signal_handler_is_connected*(instance: gpointer, handler_id: gulong): gboolean{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_handler_is_connected".}
+proc g_signal_handler_find*(instance: gpointer, mask: TGSignalMatchType,
+                            signal_id: guint, detail: TGQuark,
+                            closure: PGClosure, func: gpointer, data: gpointer): gulong{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_handler_find".}
+proc g_signal_handlers_block_matched*(instance: gpointer,
+                                      mask: TGSignalMatchType, signal_id: guint,
+                                      detail: TGQuark, closure: PGClosure,
+                                      func: gpointer, data: gpointer): guint{.
+    cdecl, dynlib: gobjectlib, importc: "g_signal_handlers_block_matched".}
+proc g_signal_handlers_unblock_matched*(instance: gpointer,
+                                        mask: TGSignalMatchType,
+                                        signal_id: guint, detail: TGQuark,
+                                        closure: PGClosure, func: gpointer,
+                                        data: gpointer): guint{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_handlers_unblock_matched".}
+proc g_signal_handlers_disconnect_matched*(instance: gpointer,
+    mask: TGSignalMatchType, signal_id: guint, detail: TGQuark,
+    closure: PGClosure, func: gpointer, data: gpointer): guint{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_handlers_disconnect_matched".}
+proc g_signal_override_class_closure*(signal_id: guint, instance_type: GType,
+                                      class_closure: PGClosure){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_override_class_closure".}
+proc g_signal_chain_from_overridden*(instance_and_params: PGValue,
+                                     return_value: PGValue){.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_chain_from_overridden".}
+proc g_signal_connect*(instance: gpointer, detailed_signal: cstring,
+                       c_handler: TGCallback, data: gpointer): gulong
+proc g_signal_connect_after*(instance: gpointer, detailed_signal: cstring,
+                             c_handler: TGCallback, data: gpointer): gulong
+proc g_signal_connect_swapped*(instance: gpointer, detailed_signal: cstring,
+                               c_handler: TGCallback, data: gpointer): gulong
+proc g_signal_handlers_disconnect_by_func*(instance: gpointer,
+    func, data: gpointer): guint
+proc g_signal_handlers_block_by_func*(instance: gpointer, func, data: gpointer)
+proc g_signal_handlers_unblock_by_func*(instance: gpointer, func, data: gpointer)
+proc g_signal_handlers_destroy*(instance: gpointer){.cdecl, dynlib: gobjectlib,
+    importc: "g_signal_handlers_destroy".}
+proc g_signals_destroy*(itype: GType){.cdecl, dynlib: gobjectlib,
+                                       importc: "`g_signals_destroy`".}
+type
+  TGTypePluginUse* = proc (plugin: PGTypePlugin){.cdecl.}
+  TGTypePluginUnuse* = proc (plugin: PGTypePlugin){.cdecl.}
+  TGTypePluginCompleteTypeInfo* = proc (plugin: PGTypePlugin, g_type: GType,
+                                        info: PGTypeInfo,
+                                        value_table: PGTypeValueTable){.cdecl.}
+  TGTypePluginCompleteInterfaceInfo* = proc (plugin: PGTypePlugin,
+      instance_type: GType, interface_type: GType, info: PGInterfaceInfo){.cdecl.}
+  PGTypePluginClass* = ptr TGTypePluginClass
+  TGTypePluginClass* = record
+    base_iface*: TGTypeInterface
+    use_plugin*: TGTypePluginUse
+    unuse_plugin*: TGTypePluginUnuse
+    complete_type_info*: TGTypePluginCompleteTypeInfo
+    complete_interface_info*: TGTypePluginCompleteInterfaceInfo
+
+
+proc G_TYPE_TYPE_PLUGIN*(): GType
+proc G_TYPE_PLUGIN*(inst: Pointer): PGTypePlugin
+proc G_TYPE_PLUGIN_CLASS*(vtable: Pointer): PGTypePluginClass
+proc G_IS_TYPE_PLUGIN*(inst: Pointer): bool
+proc G_IS_TYPE_PLUGIN_CLASS*(vtable: Pointer): bool
+proc G_TYPE_PLUGIN_GET_CLASS*(inst: Pointer): PGTypePluginClass
+proc g_type_plugin_get_type*(): GType{.cdecl, dynlib: gliblib,
+                                       importc: "g_type_plugin_get_type".}
+proc g_type_plugin_use*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib,
+    importc: "g_type_plugin_use".}
+proc g_type_plugin_unuse*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib,
+    importc: "g_type_plugin_unuse".}
+proc g_type_plugin_complete_type_info*(plugin: PGTypePlugin, g_type: GType,
+                                       info: PGTypeInfo,
+                                       value_table: PGTypeValueTable){.cdecl,
+    dynlib: gliblib, importc: "g_type_plugin_complete_type_info".}
+proc g_type_plugin_complete_interface_info*(plugin: PGTypePlugin,
+    instance_type: GType, interface_type: GType, info: PGInterfaceInfo){.cdecl,
+    dynlib: gliblib, importc: "g_type_plugin_complete_interface_info".}
+type
+  PGObject* = ptr TGObject
+  TGObject* {.pure.} = object
+    g_type_instance*: TGTypeInstance
+    ref_count*: guint
+    qdata*: PGData
+
+  TGObjectGetPropertyFunc* = proc (anObject: PGObject, property_id: guint,
+                                   value: PGValue, pspec: PGParamSpec){.cdecl.}
+  TGObjectSetPropertyFunc* = proc (anObject: PGObject, property_id: guint,
+                                   value: PGValue, pspec: PGParamSpec){.cdecl.}
+  TGObjectFinalizeFunc* = proc (anObject: PGObject){.cdecl.}
+  TGWeakNotify* = proc (data: gpointer, where_the_object_was: PGObject){.cdecl.}
+  PGObjectConstructParam* = ptr TGObjectConstructParam
+  PGObjectClass* = ptr TGObjectClass
+  TGObjectClass* {.pure.} = object
+    g_type_class*: TGTypeClass
+    construct_properties*: PGSList
+    constructor*: proc (theType: GType, n_construct_properties: guint,
+                        construct_properties: PGObjectConstructParam): PGObject{.
+        cdecl.}
+    set_property*: proc (anObject: PGObject, property_id: guint, value: PGValue,
+                         pspec: PGParamSpec){.cdecl.}
+    get_property*: proc (anObject: PGObject, property_id: guint, value: PGValue,
+                         pspec: PGParamSpec){.cdecl.}
+    dispose*: proc (anObject: PGObject){.cdecl.}
+    finalize*: proc (anObject: PGObject){.cdecl.}
+    dispatch_properties_changed*: proc (anObject: PGObject, n_pspecs: guint,
+                                        pspecs: PPGParamSpec){.cdecl.}
+    notify*: proc (anObject: PGObject, pspec: PGParamSpec){.cdecl.}
+    pdummy*: array[0..7, gpointer]
+
+  TGObjectConstructParam* = record
+    pspec*: PGParamSpec
+    value*: PGValue
+
+
+proc G_TYPE_IS_OBJECT*(theType: GType): bool
+proc G_OBJECT*(anObject: pointer): PGObject
+proc G_OBJECT_CLASS*(class: Pointer): PGObjectClass
+proc G_IS_OBJECT*(anObject: pointer): bool
+proc G_IS_OBJECT_CLASS*(class: Pointer): bool
+proc G_OBJECT_GET_CLASS*(anObject: pointer): PGObjectClass
+proc G_OBJECT_TYPE*(anObject: pointer): GType
+proc G_OBJECT_TYPE_NAME*(anObject: pointer): cstring
+proc G_OBJECT_CLASS_TYPE*(class: Pointer): GType
+proc G_OBJECT_CLASS_NAME*(class: Pointer): cstring
+proc G_VALUE_HOLDS_OBJECT*(value: Pointer): bool
+proc g_object_class_install_property*(oclass: PGObjectClass, property_id: guint,
+                                      pspec: PGParamSpec){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_class_install_property".}
+proc g_object_class_find_property*(oclass: PGObjectClass, property_name: cstring): PGParamSpec{.
+    cdecl, dynlib: gobjectlib, importc: "g_object_class_find_property".}
+proc g_object_class_list_properties*(oclass: PGObjectClass, n_properties: Pguint): PPGParamSpec{.
+    cdecl, dynlib: gobjectlib, importc: "g_object_class_list_properties".}
+proc g_object_set_property*(anObject: PGObject, property_name: cstring,
+                            value: PGValue){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_set_property".}
+proc g_object_get_property*(anObject: PGObject, property_name: cstring,
+                            value: PGValue){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_get_property".}
+proc g_object_freeze_notify*(anObject: PGObject){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_freeze_notify".}
+proc g_object_notify*(anObject: PGObject, property_name: cstring){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_notify".}
+proc g_object_thaw_notify*(anObject: PGObject){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_thaw_notify".}
+proc g_object_ref*(anObject: gpointer): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_object_ref".}
+proc g_object_unref*(anObject: gpointer){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_unref".}
+proc g_object_weak_ref*(anObject: PGObject, notify: TGWeakNotify, data: gpointer){.
+    cdecl, dynlib: gobjectlib, importc: "g_object_weak_ref".}
+proc g_object_weak_unref*(anObject: PGObject, notify: TGWeakNotify,
+                          data: gpointer){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_weak_unref".}
+proc g_object_add_weak_pointer*(anObject: PGObject,
+                                weak_pointer_location: Pgpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_add_weak_pointer".}
+proc g_object_remove_weak_pointer*(anObject: PGObject,
+                                   weak_pointer_location: Pgpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_remove_weak_pointer".}
+proc g_object_get_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_object_get_qdata".}
+proc g_object_set_qdata*(anObject: PGObject, quark: TGQuark, data: gpointer){.
+    cdecl, dynlib: gobjectlib, importc: "g_object_set_qdata".}
+proc g_object_set_qdata_full*(anObject: PGObject, quark: TGQuark,
+                              data: gpointer, destroy: TGDestroyNotify){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_set_qdata_full".}
+proc g_object_steal_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_object_steal_qdata".}
+proc g_object_get_data*(anObject: PGObject, key: cstring): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_object_get_data".}
+proc g_object_set_data*(anObject: PGObject, key: cstring, data: gpointer){.
+    cdecl, dynlib: gobjectlib, importc: "g_object_set_data".}
+proc g_object_set_data_full*(anObject: PGObject, key: cstring, data: gpointer,
+                             destroy: TGDestroyNotify){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_set_data_full".}
+proc g_object_steal_data*(anObject: PGObject, key: cstring): gpointer{.cdecl,
+    dynlib: gobjectlib, importc: "g_object_steal_data".}
+proc g_object_watch_closure*(anObject: PGObject, closure: PGClosure){.cdecl,
+    dynlib: gobjectlib, importc: "g_object_watch_closure".}
+proc g_cclosure_new_object*(callback_func: TGCallback, anObject: PGObject): PGClosure{.
+    cdecl, dynlib: gobjectlib, importc: "g_cclosure_new_object".}
+proc g_cclosure_new_object_swap*(callback_func: TGCallback, anObject: PGObject): PGClosure{.
+    cdecl, dynlib: gobjectlib, importc: "g_cclosure_new_object_swap".}
+proc g_closure_new_object*(sizeof_closure: guint, anObject: PGObject): PGClosure{.
+    cdecl, dynlib: gobjectlib, importc: "g_closure_new_object".}
+proc g_value_set_object*(value: PGValue, v_object: gpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_object".}
+proc g_value_get_object*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_object".}
+proc g_value_dup_object*(value: PGValue): PGObject{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_dup_object".}
+proc g_signal_connect_object*(instance: gpointer, detailed_signal: cstring,
+                              c_handler: TGCallback, gobject: gpointer,
+                              connect_flags: TGConnectFlags): gulong{.cdecl,
+    dynlib: gobjectlib, importc: "g_signal_connect_object".}
+proc g_object_run_dispose*(anObject: PGObject){.cdecl, dynlib: gobjectlib,
+    importc: "g_object_run_dispose".}
+proc g_value_set_object_take_ownership*(value: PGValue, v_object: gpointer){.
+    cdecl, dynlib: gobjectlib, importc: "g_value_set_object_take_ownership".}
+proc G_OBJECT_WARN_INVALID_PSPEC*(anObject: gpointer, pname: cstring,
+                                  property_id: gint, pspec: gpointer)
+proc G_OBJECT_WARN_INVALID_PROPERTY_ID*(anObject: gpointer, property_id: gint,
+                                        pspec: gpointer)
+type
+  G_FLAGS_TYPE* = GType
+
+const
+  G_E* = 2.7182818284590451
+  G_LN2* = 0.6931471805599452
+  G_LN10* = 2.3025850929940455
+  G_PI* = 3.1415926535897936
+  G_PI_2* = 1.5707963267948968
+  G_PI_4* = 0.7853981633974483
+  G_SQRT2* = 1.4142135623730951
+  G_LITTLE_ENDIAN* = 1234
+  G_BIG_ENDIAN* = 4321
+  G_PDP_ENDIAN* = 3412
+
+proc GUINT16_SWAP_LE_BE_CONSTANT*(val: guint16): guint16
+proc GUINT32_SWAP_LE_BE_CONSTANT*(val: guint32): guint32
+type
+  PGEnumClass* = ptr TGEnumClass
+  PGEnumValue* = ptr TGEnumValue
+  TGEnumClass* = record
+    g_type_class*: TGTypeClass
+    minimum*: gint
+    maximum*: gint
+    n_values*: guint
+    values*: PGEnumValue
+
+  TGEnumValue* = record
+    value*: gint
+    value_name*: cstring
+    value_nick*: cstring
+
+  PGFlagsClass* = ptr TGFlagsClass
+  PGFlagsValue* = ptr TGFlagsValue
+  TGFlagsClass* = record
+    g_type_class*: TGTypeClass
+    mask*: guint
+    n_values*: guint
+    values*: PGFlagsValue
+
+  TGFlagsValue* = record
+    value*: guint
+    value_name*: cstring
+    value_nick*: cstring
+
+
+proc G_TYPE_IS_ENUM*(theType: GType): gboolean
+proc G_ENUM_CLASS*(class: pointer): PGEnumClass
+proc G_IS_ENUM_CLASS*(class: pointer): gboolean
+proc G_ENUM_CLASS_TYPE*(class: pointer): GType
+proc G_ENUM_CLASS_TYPE_NAME*(class: pointer): cstring
+proc G_TYPE_IS_FLAGS*(theType: GType): gboolean
+proc G_FLAGS_CLASS*(class: pointer): PGFlagsClass
+proc G_IS_FLAGS_CLASS*(class: pointer): gboolean
+proc G_FLAGS_CLASS_TYPE*(class: pointer): GType
+proc G_FLAGS_CLASS_TYPE_NAME*(class: pointer): cstring
+proc G_VALUE_HOLDS_ENUM*(value: pointer): gboolean
+proc G_VALUE_HOLDS_FLAGS*(value: pointer): gboolean
+proc g_enum_get_value*(enum_class: PGEnumClass, value: gint): PGEnumValue{.
+    cdecl, dynlib: gliblib, importc: "g_enum_get_value".}
+proc g_enum_get_value_by_name*(enum_class: PGEnumClass, name: cstring): PGEnumValue{.
+    cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_name".}
+proc g_enum_get_value_by_nick*(enum_class: PGEnumClass, nick: cstring): PGEnumValue{.
+    cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_nick".}
+proc g_flags_get_first_value*(flags_class: PGFlagsClass, value: guint): PGFlagsValue{.
+    cdecl, dynlib: gliblib, importc: "g_flags_get_first_value".}
+proc g_flags_get_value_by_name*(flags_class: PGFlagsClass, name: cstring): PGFlagsValue{.
+    cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_name".}
+proc g_flags_get_value_by_nick*(flags_class: PGFlagsClass, nick: cstring): PGFlagsValue{.
+    cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_nick".}
+proc g_value_set_enum*(value: PGValue, v_enum: gint){.cdecl, dynlib: gliblib,
+    importc: "g_value_set_enum".}
+proc g_value_get_enum*(value: PGValue): gint{.cdecl, dynlib: gliblib,
+    importc: "g_value_get_enum".}
+proc g_value_set_flags*(value: PGValue, v_flags: guint){.cdecl, dynlib: gliblib,
+    importc: "g_value_set_flags".}
+proc g_value_get_flags*(value: PGValue): guint{.cdecl, dynlib: gliblib,
+    importc: "g_value_get_flags".}
+proc g_enum_register_static*(name: cstring, const_static_values: PGEnumValue): GType{.
+    cdecl, dynlib: gliblib, importc: "g_enum_register_static".}
+proc g_flags_register_static*(name: cstring, const_static_values: PGFlagsValue): GType{.
+    cdecl, dynlib: gliblib, importc: "g_flags_register_static".}
+proc g_enum_complete_type_info*(g_enum_type: GType, info: PGTypeInfo,
+                                const_values: PGEnumValue){.cdecl,
+    dynlib: gliblib, importc: "g_enum_complete_type_info".}
+proc g_flags_complete_type_info*(g_flags_type: GType, info: PGTypeInfo,
+                                 const_values: PGFlagsValue){.cdecl,
+    dynlib: gliblib, importc: "g_flags_complete_type_info".}
+const
+  G_MINFLOAT* = 0.0
+  G_MAXFLOAT* = 1.6999999999999995E308
+  G_MINDOUBLE* = G_MINFLOAT
+  G_MAXDOUBLE* = G_MAXFLOAT
+  G_MAXSHORT* = 32767
+  G_MINSHORT* = - G_MAXSHORT - 1
+  G_MAXUSHORT* = 2 * G_MAXSHORT + 1
+  G_MAXINT* = 2147483647
+  G_MININT* = - G_MAXINT - 1
+  G_MAXUINT* = 4294967295
+  G_MINLONG* = G_MININT
+  G_MAXLONG* = G_MAXINT
+  G_MAXULONG* = G_MAXUINT
+  G_MAXINT64* = high(int64)
+  G_MININT64* = low(int64)
+
+const
+  G_GINT16_FORMAT* = "hi"
+  G_GUINT16_FORMAT* = "hu"
+  G_GINT32_FORMAT* = 'i'
+  G_GUINT32_FORMAT* = 'u'
+  G_HAVE_GINT64* = 1
+  G_GINT64_FORMAT* = "I64i"
+  G_GUINT64_FORMAT* = "I64u"
+  GLIB_SIZEOF_VOID_P* = SizeOf(Pointer)
+  GLIB_SIZEOF_LONG* = SizeOf(int32)
+  GLIB_SIZEOF_SIZE_T* = SizeOf(int32)
+
+type
+  PGSystemThread* = ptr TGSystemThread
+  TGSystemThread* = record
+    data*: array[0..3, char]
+    dummy_double*: float64
+    dummy_pointer*: pointer
+    dummy_long*: int32
+
+
+const
+  GLIB_SYSDEF_POLLIN* = 1
+  GLIB_SYSDEF_POLLOUT* = 4
+  GLIB_SYSDEF_POLLPRI* = 2
+  GLIB_SYSDEF_POLLERR* = 8
+  GLIB_SYSDEF_POLLHUP* = 16
+  GLIB_SYSDEF_POLLNVAL* = 32
+
+proc GUINT_TO_POINTER*(i: guint): pointer
+type
+  PGAsciiType* = ptr TGAsciiType
+  TGAsciiType* = int32
+
+const
+  G_ASCII_ALNUM* = 1 shl 0
+  G_ASCII_ALPHA* = 1 shl 1
+  G_ASCII_CNTRL* = 1 shl 2
+  G_ASCII_DIGIT* = 1 shl 3
+  G_ASCII_GRAPH* = 1 shl 4
+  G_ASCII_LOWER* = 1 shl 5
+  G_ASCII_PRINT* = 1 shl 6
+  G_ASCII_PUNCT* = 1 shl 7
+  G_ASCII_SPACE* = 1 shl 8
+  G_ASCII_UPPER* = 1 shl 9
+  G_ASCII_XDIGIT* = 1 shl 10
+
+proc g_ascii_tolower*(c: gchar): gchar{.cdecl, dynlib: gliblib,
+                                        importc: "g_ascii_tolower".}
+proc g_ascii_toupper*(c: gchar): gchar{.cdecl, dynlib: gliblib,
+                                        importc: "g_ascii_toupper".}
+proc g_ascii_digit_value*(c: gchar): gint{.cdecl, dynlib: gliblib,
+    importc: "g_ascii_digit_value".}
+proc g_ascii_xdigit_value*(c: gchar): gint{.cdecl, dynlib: gliblib,
+    importc: "g_ascii_xdigit_value".}
+const
+  G_STR_DELIMITERS* = "``-|> <."
+
+proc g_strdelimit*(str: cstring, delimiters: cstring, new_delimiter: gchar): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_strdelimit".}
+proc g_strcanon*(str: cstring, valid_chars: cstring, substitutor: gchar): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_strcanon".}
+proc g_strerror*(errnum: gint): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strerror".}
+proc g_strsignal*(signum: gint): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strsignal".}
+proc g_strreverse*(str: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strreverse".}
+proc g_strlcpy*(dest: cstring, src: cstring, dest_size: gsize): gsize{.cdecl,
+    dynlib: gliblib, importc: "g_strlcpy".}
+proc g_strlcat*(dest: cstring, src: cstring, dest_size: gsize): gsize{.cdecl,
+    dynlib: gliblib, importc: "g_strlcat".}
+proc g_strstr_len*(haystack: cstring, haystack_len: gssize, needle: cstring): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_strstr_len".}
+proc g_strrstr*(haystack: cstring, needle: cstring): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_strrstr".}
+proc g_strrstr_len*(haystack: cstring, haystack_len: gssize, needle: cstring): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_strrstr_len".}
+proc g_str_has_suffix*(str: cstring, suffix: cstring): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_str_has_suffix".}
+proc g_str_has_prefix*(str: cstring, prefix: cstring): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_str_has_prefix".}
+proc g_strtod*(nptr: cstring, endptr: PPgchar): gdouble{.cdecl, dynlib: gliblib,
+    importc: "g_strtod".}
+proc g_ascii_strtod*(nptr: cstring, endptr: PPgchar): gdouble{.cdecl,
+    dynlib: gliblib, importc: "g_ascii_strtod".}
+const
+  G_ASCII_DTOSTR_BUF_SIZE* = 29 + 10
+
+proc g_ascii_dtostr*(buffer: cstring, buf_len: gint, d: gdouble): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_ascii_dtostr".}
+proc g_ascii_formatd*(buffer: cstring, buf_len: gint, format: cstring,
+                      d: gdouble): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_ascii_formatd".}
+proc g_strchug*(str: cstring): cstring{.cdecl, dynlib: gliblib,
+                                        importc: "g_strchug".}
+proc g_strchomp*(str: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strchomp".}
+proc g_ascii_strcasecmp*(s1: cstring, s2: cstring): gint{.cdecl,
+    dynlib: gliblib, importc: "g_ascii_strcasecmp".}
+proc g_ascii_strncasecmp*(s1: cstring, s2: cstring, n: gsize): gint{.cdecl,
+    dynlib: gliblib, importc: "g_ascii_strncasecmp".}
+proc g_ascii_strdown*(str: cstring, len: gssize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_ascii_strdown".}
+proc g_ascii_strup*(str: cstring, len: gssize): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_ascii_strup".}
+proc g_strdup*(str: cstring): cstring{.cdecl, dynlib: gliblib,
+                                       importc: "g_strdup".}
+proc g_strndup*(str: cstring, n: gsize): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strndup".}
+proc g_strnfill*(length: gsize, fill_char: gchar): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_strnfill".}
+proc g_strcompress*(source: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_strcompress".}
+proc g_strescape*(source: cstring, exceptions: cstring): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_strescape".}
+proc g_memdup*(mem: gconstpointer, byte_size: guint): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_memdup".}
+proc g_strsplit*(str: cstring, delimiter: cstring, max_tokens: gint): PPgchar{.
+    cdecl, dynlib: gliblib, importc: "g_strsplit".}
+proc g_strjoinv*(separator: cstring, str_array: PPgchar): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_strjoinv".}
+proc g_strfreev*(str_array: PPgchar){.cdecl, dynlib: gliblib,
+                                      importc: "g_strfreev".}
+proc g_strdupv*(str_array: PPgchar): PPgchar{.cdecl, dynlib: gliblib,
+    importc: "g_strdupv".}
+proc g_stpcpy*(dest: cstring, src: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_stpcpy".}
+proc g_get_user_name*(): cstring{.cdecl, dynlib: gliblib,
+                                  importc: "g_get_user_name".}
+proc g_get_real_name*(): cstring{.cdecl, dynlib: gliblib,
+                                  importc: "g_get_real_name".}
+proc g_get_home_dir*(): cstring{.cdecl, dynlib: gliblib,
+                                 importc: "g_get_home_dir".}
+proc g_get_tmp_dir*(): cstring{.cdecl, dynlib: gliblib, importc: "g_get_tmp_dir".}
+proc g_get_prgname*(): cstring{.cdecl, dynlib: gliblib, importc: "g_get_prgname".}
+proc g_set_prgname*(prgname: cstring){.cdecl, dynlib: gliblib,
+                                       importc: "g_set_prgname".}
+type
+  PGDebugKey* = ptr TGDebugKey
+  TGDebugKey* = record
+    key*: cstring
+    value*: guint
+
+
+proc g_parse_debug_string*(str: cstring, keys: PGDebugKey, nkeys: guint): guint{.
+    cdecl, dynlib: gliblib, importc: "g_parse_debug_string".}
+proc g_path_is_absolute*(file_name: cstring): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_path_is_absolute".}
+proc g_path_skip_root*(file_name: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_path_skip_root".}
+proc g_basename*(file_name: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_basename".}
+proc g_dirname*(file_name: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_path_get_dirname".}
+proc g_get_current_dir*(): cstring{.cdecl, dynlib: gliblib,
+                                    importc: "g_get_current_dir".}
+proc g_path_get_basename*(file_name: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_path_get_basename".}
+proc g_path_get_dirname*(file_name: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_path_get_dirname".}
+proc g_nullify_pointer*(nullify_location: Pgpointer){.cdecl, dynlib: gliblib,
+    importc: "g_nullify_pointer".}
+proc g_getenv*(variable: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_getenv".}
+type
+  TGVoidFunc* = proc (){.cdecl.}
+
+proc g_atexit*(func: TGVoidFunc){.cdecl, dynlib: gliblib, importc: "g_atexit".}
+proc g_find_program_in_path*(program: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_find_program_in_path".}
+proc g_bit_nth_lsf*(mask: gulong, nth_bit: gint): gint{.cdecl, dynlib: gliblib,
+    importc: "g_bit_nth_lsf".}
+proc g_bit_nth_msf*(mask: gulong, nth_bit: gint): gint{.cdecl, dynlib: gliblib,
+    importc: "g_bit_nth_msf".}
+proc g_bit_storage*(number: gulong): guint{.cdecl, dynlib: gliblib,
+    importc: "g_bit_storage".}
+type
+  PPGTrashStack* = ptr PGTrashStack
+  PGTrashStack* = ptr TGTrashStack
+  TGTrashStack* = record
+    next*: PGTrashStack
+
+
+proc g_trash_stack_push*(stack_p: PPGTrashStack, data_p: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_trash_stack_push".}
+proc g_trash_stack_pop*(stack_p: PPGTrashStack): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_trash_stack_pop".}
+proc g_trash_stack_peek*(stack_p: PPGTrashStack): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_trash_stack_peek".}
+proc g_trash_stack_height*(stack_p: PPGTrashStack): guint{.cdecl,
+    dynlib: gliblib, importc: "g_trash_stack_height".}
+type
+  PGHashTable* = pointer
+  TGHRFunc* = proc (key, value, user_data: gpointer): gboolean{.cdecl.}
+
+proc g_hash_table_new*(hash_func: TGHashFunc, key_equal_func: TGEqualFunc): PGHashTable{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_new".}
+proc g_hash_table_new_full*(hash_func: TGHashFunc, key_equal_func: TGEqualFunc,
+                            key_destroy_func: TGDestroyNotify,
+                            value_destroy_func: TGDestroyNotify): PGHashTable{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_new_full".}
+proc g_hash_table_destroy*(hash_table: PGHashTable){.cdecl, dynlib: gliblib,
+    importc: "g_hash_table_destroy".}
+proc g_hash_table_insert*(hash_table: PGHashTable, key: gpointer,
+                          value: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_hash_table_insert".}
+proc g_hash_table_replace*(hash_table: PGHashTable, key: gpointer,
+                           value: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_hash_table_replace".}
+proc g_hash_table_remove*(hash_table: PGHashTable, key: gconstpointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_remove".}
+proc g_hash_table_steal*(hash_table: PGHashTable, key: gconstpointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_steal".}
+proc g_hash_table_lookup*(hash_table: PGHashTable, key: gconstpointer): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_lookup".}
+proc g_hash_table_lookup_extended*(hash_table: PGHashTable,
+                                   lookup_key: gconstpointer,
+                                   orig_key: Pgpointer, value: Pgpointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_hash_table_lookup_extended".}
+proc g_hash_table_foreach*(hash_table: PGHashTable, func: TGHFunc,
+                           user_data: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_hash_table_foreach".}
+proc g_hash_table_foreach_remove*(hash_table: PGHashTable, func: TGHRFunc,
+                                  user_data: gpointer): guint{.cdecl,
+    dynlib: gliblib, importc: "g_hash_table_foreach_remove".}
+proc g_hash_table_foreach_steal*(hash_table: PGHashTable, func: TGHRFunc,
+                                 user_data: gpointer): guint{.cdecl,
+    dynlib: gliblib, importc: "g_hash_table_foreach_steal".}
+proc g_hash_table_size*(hash_table: PGHashTable): guint{.cdecl, dynlib: gliblib,
+    importc: "g_hash_table_size".}
+proc g_str_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_str_equal".}
+proc g_str_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib,
+    importc: "g_str_hash".}
+proc g_int_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_int_equal".}
+proc g_int_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib,
+    importc: "g_int_hash".}
+proc g_direct_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib,
+    importc: "g_direct_hash".}
+proc g_direct_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_direct_equal".}
+proc g_quark_try_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib,
+    importc: "g_quark_try_string".}
+proc g_quark_from_static_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib,
+    importc: "g_quark_from_static_string".}
+proc g_quark_from_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib,
+    importc: "g_quark_from_string".}
+proc g_quark_to_string*(quark: TGQuark): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_quark_to_string".}
+const
+  G_MEM_ALIGN* = GLIB_SIZEOF_VOID_P
+
+type
+  PGMemVTable* = ptr TGMemVTable
+  TGMemVTable* = record
+    malloc*: proc (n_bytes: gsize): gpointer{.cdecl.}
+    realloc*: proc (mem: gpointer, n_bytes: gsize): gpointer{.cdecl.}
+    free*: proc (mem: gpointer){.cdecl.}
+    calloc*: proc (n_blocks: gsize, n_block_bytes: gsize): gpointer{.cdecl.}
+    try_malloc*: proc (n_bytes: gsize): gpointer{.cdecl.}
+    try_realloc*: proc (mem: gpointer, n_bytes: gsize): gpointer{.cdecl.}
+
+  PGMemChunk* = pointer
+  PGAllocator* = pointer
+
+proc g_malloc*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_malloc".}
+proc g_malloc0*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_malloc0".}
+proc g_realloc*(mem: gpointer, n_bytes: gulong): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_realloc".}
+proc g_free*(mem: gpointer){.cdecl, dynlib: gliblib, importc: "g_free".}
+proc g_try_malloc*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_try_malloc".}
+proc g_try_realloc*(mem: gpointer, n_bytes: gulong): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_try_realloc".}
+#proc g_new*(bytes_per_struct, n_structs: gsize): gpointer
+#proc g_new0*(bytes_per_struct, n_structs: gsize): gpointer
+#proc g_renew*(struct_size: gsize, OldMem: gpointer, n_structs: gsize): gpointer
+proc g_mem_set_vtable*(vtable: PGMemVTable){.cdecl, dynlib: gliblib,
+    importc: "g_mem_set_vtable".}
+proc g_mem_is_system_malloc*(): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_mem_is_system_malloc".}
+proc g_mem_profile*(){.cdecl, dynlib: gliblib, importc: "g_mem_profile".}
+proc g_chunk_new*(chunk: Pointer): Pointer
+proc g_chunk_new0*(chunk: Pointer): Pointer
+proc g_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer)
+const
+  G_ALLOC_ONLY* = 1
+  G_ALLOC_AND_FREE* = 2
+
+proc g_mem_chunk_new*(name: cstring, atom_size: gint, area_size: gulong,
+                      theType: gint): PGMemChunk{.cdecl, dynlib: gliblib,
+    importc: "g_mem_chunk_new".}
+proc g_mem_chunk_destroy*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib,
+    importc: "g_mem_chunk_destroy".}
+proc g_mem_chunk_alloc*(mem_chunk: PGMemChunk): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_mem_chunk_alloc".}
+proc g_mem_chunk_alloc0*(mem_chunk: PGMemChunk): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_mem_chunk_alloc0".}
+proc g_mem_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_mem_chunk_free".}
+proc g_mem_chunk_clean*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib,
+    importc: "g_mem_chunk_clean".}
+proc g_mem_chunk_reset*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib,
+    importc: "g_mem_chunk_reset".}
+proc g_mem_chunk_print*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib,
+    importc: "g_mem_chunk_print".}
+proc g_mem_chunk_info*(){.cdecl, dynlib: gliblib, importc: "g_mem_chunk_info".}
+proc g_blow_chunks*(){.cdecl, dynlib: gliblib, importc: "g_blow_chunks".}
+proc g_allocator_new*(name: cstring, n_preallocs: guint): PGAllocator{.cdecl,
+    dynlib: gliblib, importc: "g_allocator_new".}
+proc g_allocator_free*(allocator: PGAllocator){.cdecl, dynlib: gliblib,
+    importc: "g_allocator_free".}
+const
+  G_ALLOCATOR_LIST* = 1
+  G_ALLOCATOR_SLIST* = 2
+  G_ALLOCATOR_NODE* = 3
+
+proc g_slist_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib,
+    importc: "g_slist_push_allocator".}
+proc g_slist_pop_allocator*(){.cdecl, dynlib: gliblib,
+                               importc: "g_slist_pop_allocator".}
+proc g_slist_alloc*(): PGSList{.cdecl, dynlib: gliblib, importc: "g_slist_alloc".}
+proc g_slist_free*(list: PGSList){.cdecl, dynlib: gliblib,
+                                   importc: "g_slist_free".}
+proc g_slist_free_1*(list: PGSList){.cdecl, dynlib: gliblib,
+                                     importc: "g_slist_free_1".}
+proc g_slist_append*(list: PGSList, data: gpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_append".}
+proc g_slist_prepend*(list: PGSList, data: gpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_prepend".}
+proc g_slist_insert*(list: PGSList, data: gpointer, position: gint): PGSList{.
+    cdecl, dynlib: gliblib, importc: "g_slist_insert".}
+proc g_slist_insert_sorted*(list: PGSList, data: gpointer, func: TGCompareFunc): PGSList{.
+    cdecl, dynlib: gliblib, importc: "g_slist_insert_sorted".}
+proc g_slist_insert_before*(slist: PGSList, sibling: PGSList, data: gpointer): PGSList{.
+    cdecl, dynlib: gliblib, importc: "g_slist_insert_before".}
+proc g_slist_concat*(list1: PGSList, list2: PGSList): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_concat".}
+proc g_slist_remove*(list: PGSList, data: gconstpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_remove".}
+proc g_slist_remove_all*(list: PGSList, data: gconstpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_remove_all".}
+proc g_slist_remove_link*(list: PGSList, link: PGSList): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_remove_link".}
+proc g_slist_delete_link*(list: PGSList, link: PGSList): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_delete_link".}
+proc g_slist_reverse*(list: PGSList): PGSList{.cdecl, dynlib: gliblib,
+    importc: "g_slist_reverse".}
+proc g_slist_copy*(list: PGSList): PGSList{.cdecl, dynlib: gliblib,
+    importc: "g_slist_copy".}
+proc g_slist_nth*(list: PGSList, n: guint): PGSList{.cdecl, dynlib: gliblib,
+    importc: "g_slist_nth".}
+proc g_slist_find*(list: PGSList, data: gconstpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_find".}
+proc g_slist_find_custom*(list: PGSList, data: gconstpointer,
+                          func: TGCompareFunc): PGSList{.cdecl, dynlib: gliblib,
+    importc: "g_slist_find_custom".}
+proc g_slist_position*(list: PGSList, llink: PGSList): gint{.cdecl,
+    dynlib: gliblib, importc: "g_slist_position".}
+proc g_slist_index*(list: PGSList, data: gconstpointer): gint{.cdecl,
+    dynlib: gliblib, importc: "g_slist_index".}
+proc g_slist_last*(list: PGSList): PGSList{.cdecl, dynlib: gliblib,
+    importc: "g_slist_last".}
+proc g_slist_length*(list: PGSList): guint{.cdecl, dynlib: gliblib,
+    importc: "g_slist_length".}
+proc g_slist_foreach*(list: PGSList, func: TGFunc, user_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_slist_foreach".}
+proc g_slist_sort*(list: PGSList, compare_func: TGCompareFunc): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_sort".}
+proc g_slist_sort_with_data*(list: PGSList, compare_func: TGCompareDataFunc,
+                             user_data: gpointer): PGSList{.cdecl,
+    dynlib: gliblib, importc: "g_slist_sort_with_data".}
+proc g_slist_nth_data*(list: PGSList, n: guint): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_slist_nth_data".}
+proc g_slist_next*(slist: PGSList): PGSList
+proc g_list_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib,
+    importc: "g_list_push_allocator".}
+proc g_list_pop_allocator*(){.cdecl, dynlib: gliblib,
+                              importc: "g_list_pop_allocator".}
+proc g_list_alloc*(): PGList{.cdecl, dynlib: gliblib, importc: "g_list_alloc".}
+proc g_list_free*(list: PGList){.cdecl, dynlib: gliblib, importc: "g_list_free".}
+proc g_list_free_1*(list: PGList){.cdecl, dynlib: gliblib,
+                                   importc: "g_list_free_1".}
+proc g_list_append*(list: PGList, data: gpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_append".}
+proc g_list_prepend*(list: PGList, data: gpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_prepend".}
+proc g_list_insert*(list: PGList, data: gpointer, position: gint): PGList{.
+    cdecl, dynlib: gliblib, importc: "g_list_insert".}
+proc g_list_insert_sorted*(list: PGList, data: gpointer, func: TGCompareFunc): PGList{.
+    cdecl, dynlib: gliblib, importc: "g_list_insert_sorted".}
+proc g_list_insert_before*(list: PGList, sibling: PGList, data: gpointer): PGList{.
+    cdecl, dynlib: gliblib, importc: "g_list_insert_before".}
+proc g_list_concat*(list1: PGList, list2: PGList): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_concat".}
+proc g_list_remove*(list: PGList, data: gconstpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_remove".}
+proc g_list_remove_all*(list: PGList, data: gconstpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_remove_all".}
+proc g_list_remove_link*(list: PGList, llink: PGList): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_remove_link".}
+proc g_list_delete_link*(list: PGList, link: PGList): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_delete_link".}
+proc g_list_reverse*(list: PGList): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_reverse".}
+proc g_list_copy*(list: PGList): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_copy".}
+proc g_list_nth*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_nth".}
+proc g_list_nth_prev*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_nth_prev".}
+proc g_list_find*(list: PGList, data: gconstpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_find".}
+proc g_list_find_custom*(list: PGList, data: gconstpointer, func: TGCompareFunc): PGList{.
+    cdecl, dynlib: gliblib, importc: "g_list_find_custom".}
+proc g_list_position*(list: PGList, llink: PGList): gint{.cdecl,
+    dynlib: gliblib, importc: "g_list_position".}
+proc g_list_index*(list: PGList, data: gconstpointer): gint{.cdecl,
+    dynlib: gliblib, importc: "g_list_index".}
+proc g_list_last*(list: PGList): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_last".}
+proc g_list_first*(list: PGList): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_list_first".}
+proc g_list_length*(list: PGList): guint{.cdecl, dynlib: gliblib,
+    importc: "g_list_length".}
+proc g_list_foreach*(list: PGList, func: TGFunc, user_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_list_foreach".}
+proc g_list_sort*(list: PGList, compare_func: TGCompareFunc): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_sort".}
+proc g_list_sort_with_data*(list: PGList, compare_func: TGCompareDataFunc,
+                            user_data: gpointer): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_list_sort_with_data".}
+proc g_list_nth_data*(list: PGList, n: guint): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_list_nth_data".}
+proc g_list_previous*(list: PGList): PGList
+proc g_list_next*(list: PGList): PGList
+type
+  PGCache* = pointer
+  TGCacheNewFunc* = proc (key: gpointer): gpointer{.cdecl.}
+  TGCacheDupFunc* = proc (value: gpointer): gpointer{.cdecl.}
+  TGCacheDestroyFunc* = proc (value: gpointer){.cdecl.}
+
+proc g_cache_new*(value_new_func: TGCacheNewFunc,
+                  value_destroy_func: TGCacheDestroyFunc,
+                  key_dup_func: TGCacheDupFunc,
+                  key_destroy_func: TGCacheDestroyFunc,
+                  hash_key_func: TGHashFunc, hash_value_func: TGHashFunc,
+                  key_equal_func: TGEqualFunc): PGCache{.cdecl, dynlib: gliblib,
+    importc: "g_cache_new".}
+proc g_cache_destroy*(cache: PGCache){.cdecl, dynlib: gliblib,
+                                       importc: "g_cache_destroy".}
+proc g_cache_insert*(cache: PGCache, key: gpointer): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_cache_insert".}
+proc g_cache_remove*(cache: PGCache, value: gconstpointer){.cdecl,
+    dynlib: gliblib, importc: "g_cache_remove".}
+proc g_cache_key_foreach*(cache: PGCache, func: TGHFunc, user_data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_cache_key_foreach".}
+proc g_cache_value_foreach*(cache: PGCache, func: TGHFunc, user_data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_cache_value_foreach".}
+type
+  PGCompletionFunc* = ptr TGCompletionFunc
+  TGCompletionFunc* = gchar
+  TGCompletionStrncmpFunc* = proc (s1: cstring, s2: cstring, n: gsize): gint{.
+      cdecl.}
+  PGCompletion* = ptr TGCompletion
+  TGCompletion* = record
+    items*: PGList
+    func*: TGCompletionFunc
+    prefix*: cstring
+    cache*: PGList
+    strncmp_func*: TGCompletionStrncmpFunc
+
+
+proc g_completion_new*(func: TGCompletionFunc): PGCompletion{.cdecl,
+    dynlib: gliblib, importc: "g_completion_new".}
+proc g_completion_add_items*(cmp: PGCompletion, items: PGList){.cdecl,
+    dynlib: gliblib, importc: "g_completion_add_items".}
+proc g_completion_remove_items*(cmp: PGCompletion, items: PGList){.cdecl,
+    dynlib: gliblib, importc: "g_completion_remove_items".}
+proc g_completion_clear_items*(cmp: PGCompletion){.cdecl, dynlib: gliblib,
+    importc: "g_completion_clear_items".}
+proc g_completion_complete*(cmp: PGCompletion, prefix: cstring,
+                            new_prefix: PPgchar): PGList{.cdecl,
+    dynlib: gliblib, importc: "g_completion_complete".}
+proc g_completion_set_compare*(cmp: PGCompletion,
+                               strncmp_func: TGCompletionStrncmpFunc){.cdecl,
+    dynlib: gliblib, importc: "g_completion_set_compare".}
+proc g_completion_free*(cmp: PGCompletion){.cdecl, dynlib: gliblib,
+    importc: "g_completion_free".}
+type
+  PGConvertError* = ptr TGConvertError
+  TGConvertError* = enum
+    G_CONVERT_ERROR_NO_CONVERSION, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+    G_CONVERT_ERROR_FAILED, G_CONVERT_ERROR_PARTIAL_INPUT,
+    G_CONVERT_ERROR_BAD_URI, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
+
+proc G_CONVERT_ERROR*(): TGQuark
+proc g_convert_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+                                        importc: "g_convert_error_quark".}
+type
+  PGIConv* = ptr TGIConv
+  TGIConv* = pointer
+
+proc g_iconv_open*(to_codeset: cstring, from_codeset: cstring): TGIConv{.cdecl,
+    dynlib: gliblib, importc: "g_iconv_open".}
+proc g_iconv*(`converter`: TGIConv, inbuf: PPgchar, inbytes_left: Pgsize,
+              outbuf: PPgchar, outbytes_left: Pgsize): gsize{.cdecl,
+    dynlib: gliblib, importc: "g_iconv".}
+proc g_iconv_close*(`converter`: TGIConv): gint{.cdecl, dynlib: gliblib,
+    importc: "g_iconv_close".}
+proc g_convert*(str: cstring, len: gssize, to_codeset: cstring,
+                from_codeset: cstring, bytes_read: Pgsize,
+                bytes_written: Pgsize, error: pointer): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_convert".}
+proc g_convert_with_iconv*(str: cstring, len: gssize, `converter`: TGIConv,
+                           bytes_read: Pgsize, bytes_written: Pgsize,
+                           error: pointer): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_convert_with_iconv".}
+proc g_convert_with_fallback*(str: cstring, len: gssize, to_codeset: cstring,
+                              from_codeset: cstring, fallback: cstring,
+                              bytes_read: Pgsize, bytes_written: Pgsize,
+                              error: pointer): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_convert_with_fallback".}
+proc g_locale_to_utf8*(opsysstring: cstring, len: gssize, bytes_read: Pgsize,
+                       bytes_written: Pgsize, error: pointer): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_locale_to_utf8".}
+proc g_locale_from_utf8*(utf8string: cstring, len: gssize, bytes_read: Pgsize,
+                         bytes_written: Pgsize, error: pointer): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_locale_from_utf8".}
+proc g_filename_to_utf8*(opsysstring: cstring, len: gssize, bytes_read: Pgsize,
+                         bytes_written: Pgsize, error: pointer): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_filename_to_utf8".}
+proc g_filename_from_utf8*(utf8string: cstring, len: gssize, bytes_read: Pgsize,
+                           bytes_written: Pgsize, error: pointer): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_filename_from_utf8".}
+proc g_filename_from_uri*(uri: cstring, hostname: PPchar, error: pointer): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_filename_from_uri".}
+proc g_filename_to_uri*(filename: cstring, hostname: cstring, error: pointer): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_filename_to_uri".}
+type
+  TGDataForeachFunc* = proc (key_id: TGQuark, data: gpointer,
+                             user_data: gpointer){.cdecl.}
+
+proc g_datalist_init*(datalist: PPGData){.cdecl, dynlib: gliblib,
+    importc: "g_datalist_init".}
+proc g_datalist_clear*(datalist: PPGData){.cdecl, dynlib: gliblib,
+    importc: "g_datalist_clear".}
+proc g_datalist_id_get_data*(datalist: PPGData, key_id: TGQuark): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_datalist_id_get_data".}
+proc g_datalist_id_set_data_full*(datalist: PPGData, key_id: TGQuark,
+                                  data: gpointer, destroy_func: TGDestroyNotify){.
+    cdecl, dynlib: gliblib, importc: "g_datalist_id_set_data_full".}
+proc g_datalist_id_remove_no_notify*(datalist: PPGData, key_id: TGQuark): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_datalist_id_remove_no_notify".}
+proc g_datalist_foreach*(datalist: PPGData, func: TGDataForeachFunc,
+                         user_data: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_datalist_foreach".}
+proc g_datalist_id_set_data*(datalist: PPGData, key_id: TGQuark, data: gpointer)
+proc g_datalist_id_remove_data*(datalist: PPGData, key_id: TGQuark)
+proc g_datalist_get_data*(datalist: PPGData, key_str: cstring): PPGData
+proc g_datalist_set_data_full*(datalist: PPGData, key_str: cstring,
+                               data: gpointer, destroy_func: TGDestroyNotify)
+proc g_datalist_set_data*(datalist: PPGData, key_str: cstring, data: gpointer)
+proc g_datalist_remove_no_notify*(datalist: PPGData, key_str: cstring)
+proc g_datalist_remove_data*(datalist: PPGData, key_str: cstring)
+proc g_dataset_id_get_data*(dataset_location: gconstpointer, key_id: TGQuark): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_dataset_id_get_data".}
+proc g_dataset_id_set_data_full*(dataset_location: gconstpointer,
+                                 key_id: TGQuark, data: gpointer,
+                                 destroy_func: TGDestroyNotify){.cdecl,
+    dynlib: gliblib, importc: "g_dataset_id_set_data_full".}
+proc g_dataset_id_remove_no_notify*(dataset_location: gconstpointer,
+                                    key_id: TGQuark): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_dataset_id_remove_no_notify".}
+proc g_dataset_foreach*(dataset_location: gconstpointer,
+                        func: TGDataForeachFunc, user_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_dataset_foreach".}
+proc g_dataset_id_set_data*(location: gconstpointer, key_id: TGQuark,
+                            data: gpointer)
+proc g_dataset_id_remove_data*(location: gconstpointer, key_id: TGQuark)
+proc g_dataset_get_data*(location: gconstpointer, key_str: cstring): gpointer
+proc g_dataset_set_data_full*(location: gconstpointer, key_str: cstring,
+                              data: gpointer, destroy_func: TGDestroyNotify)
+proc g_dataset_remove_no_notify*(location: gconstpointer, key_str: cstring)
+proc g_dataset_set_data*(location: gconstpointer, key_str: cstring,
+                         data: gpointer)
+proc g_dataset_remove_data*(location: gconstpointer, key_str: cstring)
+type
+  PGTime* = ptr TGTime
+  TGTime* = gint32
+  PGDateYear* = ptr TGDateYear
+  TGDateYear* = guint16
+  PGDateDay* = ptr TGDateDay
+  TGDateDay* = guint8
+  Ptm* = ptr Ttm
+  Ttm* = record
+    tm_sec*: gint
+    tm_min*: gint
+    tm_hour*: gint
+    tm_mday*: gint
+    tm_mon*: gint
+    tm_year*: gint
+    tm_wday*: gint
+    tm_yday*: gint
+    tm_isdst*: gint
+    tm_gmtoff*: glong
+    tm_zone*: cstring
+
+
+type
+  PGDateDMY* = ptr TGDateDMY
+  TGDateDMY* = int
+
+const
+  G_DATE_DAY* = 0
+  G_DATE_MONTH* = 1
+  G_DATE_YEAR* = 2
+
+type
+  PGDateWeekday* = ptr TGDateWeekday
+  TGDateWeekday* = int
+
+const
+  G_DATE_BAD_WEEKDAY* = 0
+  G_DATE_MONDAY* = 1
+  G_DATE_TUESDAY* = 2
+  G_DATE_WEDNESDAY* = 3
+  G_DATE_THURSDAY* = 4
+  G_DATE_FRIDAY* = 5
+  G_DATE_SATURDAY* = 6
+  G_DATE_SUNDAY* = 7
+
+type
+  PGDateMonth* = ptr TGDateMonth
+  TGDateMonth* = int
+
+const
+  G_DATE_BAD_MONTH* = 0
+  G_DATE_JANUARY* = 1
+  G_DATE_FEBRUARY* = 2
+  G_DATE_MARCH* = 3
+  G_DATE_APRIL* = 4
+  G_DATE_MAY* = 5
+  G_DATE_JUNE* = 6
+  G_DATE_JULY* = 7
+  G_DATE_AUGUST* = 8
+  G_DATE_SEPTEMBER* = 9
+  G_DATE_OCTOBER* = 10
+  G_DATE_NOVEMBER* = 11
+  G_DATE_DECEMBER* = 12
+
+const
+  G_DATE_BAD_JULIAN* = 0
+  G_DATE_BAD_DAY* = 0
+  G_DATE_BAD_YEAR* = 0
+
+type
+  PGDate* = ptr TGDate
+  TGDate* = record
+    flag0*: int32
+    flag1*: int32
+
+
+proc g_date_new*(): PGDate{.cdecl, dynlib: gliblib, importc: "g_date_new".}
+proc g_date_new_dmy*(day: TGDateDay, month: TGDateMonth, year: TGDateYear): PGDate{.
+    cdecl, dynlib: gliblib, importc: "g_date_new_dmy".}
+proc g_date_new_julian*(julian_day: guint32): PGDate{.cdecl, dynlib: gliblib,
+    importc: "g_date_new_julian".}
+proc g_date_free*(date: PGDate){.cdecl, dynlib: gliblib, importc: "g_date_free".}
+proc g_date_valid*(date: PGDate): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_valid".}
+proc g_date_valid_month*(month: TGDateMonth): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_valid_month".}
+proc g_date_valid_year*(year: TGDateYear): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_valid_year".}
+proc g_date_valid_weekday*(weekday: TGDateWeekday): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_date_valid_weekday".}
+proc g_date_valid_julian*(julian_date: guint32): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_date_valid_julian".}
+proc g_date_get_weekday*(date: PGDate): TGDateWeekday{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_weekday".}
+proc g_date_get_month*(date: PGDate): TGDateMonth{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_month".}
+proc g_date_get_year*(date: PGDate): TGDateYear{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_year".}
+proc g_date_get_day*(date: PGDate): TGDateDay{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_day".}
+proc g_date_get_julian*(date: PGDate): guint32{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_julian".}
+proc g_date_get_day_of_year*(date: PGDate): guint{.cdecl, dynlib: gliblib,
+    importc: "g_date_get_day_of_year".}
+proc g_date_get_monday_week_of_year*(date: PGDate): guint{.cdecl,
+    dynlib: gliblib, importc: "g_date_get_monday_week_of_year".}
+proc g_date_get_sunday_week_of_year*(date: PGDate): guint{.cdecl,
+    dynlib: gliblib, importc: "g_date_get_sunday_week_of_year".}
+proc g_date_clear*(date: PGDate, n_dates: guint){.cdecl, dynlib: gliblib,
+    importc: "g_date_clear".}
+proc g_date_set_parse*(date: PGDate, str: cstring){.cdecl, dynlib: gliblib,
+    importc: "g_date_set_parse".}
+proc g_date_set_time*(date: PGDate, time: TGTime){.cdecl, dynlib: gliblib,
+    importc: "g_date_set_time".}
+proc g_date_set_month*(date: PGDate, month: TGDateMonth){.cdecl,
+    dynlib: gliblib, importc: "g_date_set_month".}
+proc g_date_set_day*(date: PGDate, day: TGDateDay){.cdecl, dynlib: gliblib,
+    importc: "g_date_set_day".}
+proc g_date_set_year*(date: PGDate, year: TGDateYear){.cdecl, dynlib: gliblib,
+    importc: "g_date_set_year".}
+proc g_date_set_dmy*(date: PGDate, day: TGDateDay, month: TGDateMonth,
+                     y: TGDateYear){.cdecl, dynlib: gliblib,
+                                     importc: "g_date_set_dmy".}
+proc g_date_set_julian*(date: PGDate, julian_date: guint32){.cdecl,
+    dynlib: gliblib, importc: "g_date_set_julian".}
+proc g_date_is_first_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_is_first_of_month".}
+proc g_date_is_last_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_is_last_of_month".}
+proc g_date_add_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib,
+    importc: "g_date_add_days".}
+proc g_date_subtract_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib,
+    importc: "g_date_subtract_days".}
+proc g_date_add_months*(date: PGDate, n_months: guint){.cdecl, dynlib: gliblib,
+    importc: "g_date_add_months".}
+proc g_date_subtract_months*(date: PGDate, n_months: guint){.cdecl,
+    dynlib: gliblib, importc: "g_date_subtract_months".}
+proc g_date_add_years*(date: PGDate, n_years: guint){.cdecl, dynlib: gliblib,
+    importc: "g_date_add_years".}
+proc g_date_subtract_years*(date: PGDate, n_years: guint){.cdecl,
+    dynlib: gliblib, importc: "g_date_subtract_years".}
+proc g_date_is_leap_year*(year: TGDateYear): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_date_is_leap_year".}
+proc g_date_get_days_in_month*(month: TGDateMonth, year: TGDateYear): guint8{.
+    cdecl, dynlib: gliblib, importc: "g_date_get_days_in_month".}
+proc g_date_get_monday_weeks_in_year*(year: TGDateYear): guint8{.cdecl,
+    dynlib: gliblib, importc: "g_date_get_monday_weeks_in_year".}
+proc g_date_get_sunday_weeks_in_year*(year: TGDateYear): guint8{.cdecl,
+    dynlib: gliblib, importc: "g_date_get_sunday_weeks_in_year".}
+proc g_date_days_between*(date1: PGDate, date2: PGDate): gint{.cdecl,
+    dynlib: gliblib, importc: "g_date_days_between".}
+proc g_date_compare*(lhs: PGDate, rhs: PGDate): gint{.cdecl, dynlib: gliblib,
+    importc: "g_date_compare".}
+proc g_date_to_struct_tm*(date: PGDate, tm: Ptm){.cdecl, dynlib: gliblib,
+    importc: "g_date_to_struct_tm".}
+proc g_date_clamp*(date: PGDate, min_date: PGDate, max_date: PGDate){.cdecl,
+    dynlib: gliblib, importc: "g_date_clamp".}
+proc g_date_order*(date1: PGDate, date2: PGDate){.cdecl, dynlib: gliblib,
+    importc: "g_date_order".}
+proc g_date_strftime*(s: cstring, slen: gsize, format: cstring, date: PGDate): gsize{.
+    cdecl, dynlib: gliblib, importc: "g_date_strftime".}
+type
+  PGDir* = pointer
+
+proc g_dir_open*(path: cstring, flags: guint, error: pointer): PGDir{.cdecl,
+    dynlib: gliblib, importc: "g_dir_open".}
+proc g_dir_read_name*(dir: PGDir): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_dir_read_name".}
+proc g_dir_rewind*(dir: PGDir){.cdecl, dynlib: gliblib, importc: "g_dir_rewind".}
+proc g_dir_close*(dir: PGDir){.cdecl, dynlib: gliblib, importc: "g_dir_close".}
+type
+  PGFileError* = ptr TGFileError
+  TGFileError* = gint
+
+type
+  PGFileTest* = ptr TGFileTest
+  TGFileTest* = int
+
+const
+  G_FILE_TEST_IS_REGULAR* = 1 shl 0
+  G_FILE_TEST_IS_SYMLINK* = 1 shl 1
+  G_FILE_TEST_IS_DIR* = 1 shl 2
+  G_FILE_TEST_IS_EXECUTABLE* = 1 shl 3
+  G_FILE_TEST_EXISTS* = 1 shl 4
+
+const
+  G_FILE_ERROR_EXIST* = 0
+  G_FILE_ERROR_ISDIR* = 1
+  G_FILE_ERROR_ACCES* = 2
+  G_FILE_ERROR_NAMETOOLONG* = 3
+  G_FILE_ERROR_NOENT* = 4
+  G_FILE_ERROR_NOTDIR* = 5
+  G_FILE_ERROR_NXIO* = 6
+  G_FILE_ERROR_NODEV* = 7
+  G_FILE_ERROR_ROFS* = 8
+  G_FILE_ERROR_TXTBSY* = 9
+  G_FILE_ERROR_FAULT* = 10
+  G_FILE_ERROR_LOOP* = 11
+  G_FILE_ERROR_NOSPC* = 12
+  G_FILE_ERROR_NOMEM* = 13
+  G_FILE_ERROR_MFILE* = 14
+  G_FILE_ERROR_NFILE* = 15
+  G_FILE_ERROR_BADF* = 16
+  G_FILE_ERROR_INVAL* = 17
+  G_FILE_ERROR_PIPE* = 18
+  G_FILE_ERROR_AGAIN* = 19
+  G_FILE_ERROR_INTR* = 20
+  G_FILE_ERROR_IO* = 21
+  G_FILE_ERROR_PERM* = 22
+  G_FILE_ERROR_FAILED* = 23
+
+proc G_FILE_ERROR*(): TGQuark
+proc g_file_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+                                     importc: "g_file_error_quark".}
+proc g_file_error_from_errno*(err_no: gint): TGFileError{.cdecl,
+    dynlib: gliblib, importc: "g_file_error_from_errno".}
+proc g_file_test*(filename: cstring, test: TGFileTest): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_file_test".}
+proc g_file_get_contents*(filename: cstring, contents: PPgchar, length: Pgsize,
+                          error: pointer): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_file_get_contents".}
+proc g_mkstemp*(tmpl: cstring): int32{.cdecl, dynlib: gliblib,
+                                       importc: "g_mkstemp".}
+proc g_file_open_tmp*(tmpl: cstring, name_used: PPchar, error: pointer): int32{.
+    cdecl, dynlib: gliblib, importc: "g_file_open_tmp".}
+type
+  PGHook* = ptr TGHook
+  TGHook* = record
+    data*: gpointer
+    next*: PGHook
+    prev*: PGHook
+    ref_count*: guint
+    hook_id*: gulong
+    flags*: guint
+    func*: gpointer
+    destroy*: TGDestroyNotify
+
+  PGHookList* = ptr TGHookList
+  TGHookCompareFunc* = proc (new_hook: PGHook, sibling: PGHook): gint{.cdecl.}
+  TGHookFindFunc* = proc (hook: PGHook, data: gpointer): gboolean{.cdecl.}
+  TGHookMarshaller* = proc (hook: PGHook, marshal_data: gpointer){.cdecl.}
+  TGHookCheckMarshaller* = proc (hook: PGHook, marshal_data: gpointer): gboolean{.
+      cdecl.}
+  TGHookFunc* = proc (data: gpointer){.cdecl.}
+  TGHookCheckFunc* = proc (data: gpointer): gboolean{.cdecl.}
+  TGHookFinalizeFunc* = proc (hook_list: PGHookList, hook: PGHook){.cdecl.}
+  TGHookList* = record
+    seq_id*: gulong
+    flag0*: int32
+    hooks*: PGHook
+    hook_memchunk*: PGMemChunk
+    finalize_hook*: TGHookFinalizeFunc
+    dummy*: array[0..1, gpointer]
+
+
+type
+  PGHookFlagMask* = ptr TGHookFlagMask
+  TGHookFlagMask* = int
+
+const
+  G_HOOK_FLAG_ACTIVE* = 1 shl 0
+  G_HOOK_FLAG_IN_CALL* = 1 shl 1
+  G_HOOK_FLAG_MASK* = 0x0000000F
+
+const
+  G_HOOK_FLAG_USER_SHIFT* = 4
+  bm_TGHookList_hook_size* = 0x0000FFFF
+  bp_TGHookList_hook_size* = 0
+  bm_TGHookList_is_setup* = 0x00010000
+  bp_TGHookList_is_setup* = 16
+
+proc TGHookList_hook_size*(a: var TGHookList): guint
+proc TGHookList_set_hook_size*(a: var TGHookList, `hook_size`: guint)
+proc TGHookList_is_setup*(a: var TGHookList): guint
+proc TGHookList_set_is_setup*(a: var TGHookList, `is_setup`: guint)
+proc G_HOOK*(hook: pointer): PGHook
+proc G_HOOK_FLAGS*(hook: PGHook): guint
+proc G_HOOK_ACTIVE*(hook: PGHook): bool
+proc G_HOOK_IN_CALL*(hook: PGHook): bool
+proc G_HOOK_IS_VALID*(hook: PGHook): bool
+proc G_HOOK_IS_UNLINKED*(hook: PGHook): bool
+proc g_hook_list_init*(hook_list: PGHookList, hook_size: guint){.cdecl,
+    dynlib: gliblib, importc: "g_hook_list_init".}
+proc g_hook_list_clear*(hook_list: PGHookList){.cdecl, dynlib: gliblib,
+    importc: "g_hook_list_clear".}
+proc g_hook_alloc*(hook_list: PGHookList): PGHook{.cdecl, dynlib: gliblib,
+    importc: "g_hook_alloc".}
+proc g_hook_free*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib,
+    importc: "g_hook_free".}
+proc g_hook_ref*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib,
+    importc: "g_hook_ref".}
+proc g_hook_unref*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib,
+    importc: "g_hook_unref".}
+proc g_hook_destroy*(hook_list: PGHookList, hook_id: gulong): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_hook_destroy".}
+proc g_hook_destroy_link*(hook_list: PGHookList, hook: PGHook){.cdecl,
+    dynlib: gliblib, importc: "g_hook_destroy_link".}
+proc g_hook_prepend*(hook_list: PGHookList, hook: PGHook){.cdecl,
+    dynlib: gliblib, importc: "g_hook_prepend".}
+proc g_hook_insert_before*(hook_list: PGHookList, sibling: PGHook, hook: PGHook){.
+    cdecl, dynlib: gliblib, importc: "g_hook_insert_before".}
+proc g_hook_insert_sorted*(hook_list: PGHookList, hook: PGHook,
+                           func: TGHookCompareFunc){.cdecl, dynlib: gliblib,
+    importc: "g_hook_insert_sorted".}
+proc g_hook_get*(hook_list: PGHookList, hook_id: gulong): PGHook{.cdecl,
+    dynlib: gliblib, importc: "g_hook_get".}
+proc g_hook_find*(hook_list: PGHookList, need_valids: gboolean,
+                  func: TGHookFindFunc, data: gpointer): PGHook{.cdecl,
+    dynlib: gliblib, importc: "g_hook_find".}
+proc g_hook_find_data*(hook_list: PGHookList, need_valids: gboolean,
+                       data: gpointer): PGHook{.cdecl, dynlib: gliblib,
+    importc: "g_hook_find_data".}
+proc g_hook_find_func*(hook_list: PGHookList, need_valids: gboolean,
+                       func: gpointer): PGHook{.cdecl, dynlib: gliblib,
+    importc: "g_hook_find_func".}
+proc g_hook_find_func_data*(hook_list: PGHookList, need_valids: gboolean,
+                            func: gpointer, data: gpointer): PGHook{.cdecl,
+    dynlib: gliblib, importc: "g_hook_find_func_data".}
+proc g_hook_first_valid*(hook_list: PGHookList, may_be_in_call: gboolean): PGHook{.
+    cdecl, dynlib: gliblib, importc: "g_hook_first_valid".}
+proc g_hook_next_valid*(hook_list: PGHookList, hook: PGHook,
+                        may_be_in_call: gboolean): PGHook{.cdecl,
+    dynlib: gliblib, importc: "g_hook_next_valid".}
+proc g_hook_compare_ids*(new_hook: PGHook, sibling: PGHook): gint{.cdecl,
+    dynlib: gliblib, importc: "g_hook_compare_ids".}
+proc g_hook_append*(hook_list: PGHookList, hook: PGHook)
+proc g_hook_list_invoke_check*(hook_list: PGHookList, may_recurse: gboolean){.
+    cdecl, dynlib: gliblib, importc: "g_hook_list_invoke_check".}
+proc g_hook_list_marshal*(hook_list: PGHookList, may_recurse: gboolean,
+                          marshaller: TGHookMarshaller, marshal_data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_hook_list_marshal".}
+proc g_hook_list_marshal_check*(hook_list: PGHookList, may_recurse: gboolean,
+                                marshaller: TGHookCheckMarshaller,
+                                marshal_data: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_hook_list_marshal_check".}
+type
+  PGThreadPool* = ptr TGThreadPool
+  TGThreadPool* = record
+    func*: TGFunc
+    user_data*: gpointer
+    exclusive*: gboolean
+
+
+proc g_thread_pool_new*(func: TGFunc, user_data: gpointer, max_threads: gint,
+                        exclusive: gboolean, error: pointer): PGThreadPool{.
+    cdecl, dynlib: gliblib, importc: "g_thread_pool_new".}
+proc g_thread_pool_push*(pool: PGThreadPool, data: gpointer, error: pointer){.
+    cdecl, dynlib: gliblib, importc: "g_thread_pool_push".}
+proc g_thread_pool_set_max_threads*(pool: PGThreadPool, max_threads: gint,
+                                    error: pointer){.cdecl, dynlib: gliblib,
+    importc: "g_thread_pool_set_max_threads".}
+proc g_thread_pool_get_max_threads*(pool: PGThreadPool): gint{.cdecl,
+    dynlib: gliblib, importc: "g_thread_pool_get_max_threads".}
+proc g_thread_pool_get_num_threads*(pool: PGThreadPool): guint{.cdecl,
+    dynlib: gliblib, importc: "g_thread_pool_get_num_threads".}
+proc g_thread_pool_unprocessed*(pool: PGThreadPool): guint{.cdecl,
+    dynlib: gliblib, importc: "g_thread_pool_unprocessed".}
+proc g_thread_pool_free*(pool: PGThreadPool, immediate: gboolean, wait: gboolean){.
+    cdecl, dynlib: gliblib, importc: "g_thread_pool_free".}
+proc g_thread_pool_set_max_unused_threads*(max_threads: gint){.cdecl,
+    dynlib: gliblib, importc: "g_thread_pool_set_max_unused_threads".}
+proc g_thread_pool_get_max_unused_threads*(): gint{.cdecl, dynlib: gliblib,
+    importc: "g_thread_pool_get_max_unused_threads".}
+proc g_thread_pool_get_num_unused_threads*(): guint{.cdecl, dynlib: gliblib,
+    importc: "g_thread_pool_get_num_unused_threads".}
+proc g_thread_pool_stop_unused_threads*(){.cdecl, dynlib: gliblib,
+    importc: "g_thread_pool_stop_unused_threads".}
+type
+  PGTimer* = pointer
+
+const
+  G_USEC_PER_SEC* = 1000000
+
+proc g_timer_new*(): PGTimer{.cdecl, dynlib: gliblib, importc: "g_timer_new".}
+proc g_timer_destroy*(timer: PGTimer){.cdecl, dynlib: gliblib,
+                                       importc: "g_timer_destroy".}
+proc g_timer_start*(timer: PGTimer){.cdecl, dynlib: gliblib,
+                                     importc: "g_timer_start".}
+proc g_timer_stop*(timer: PGTimer){.cdecl, dynlib: gliblib,
+                                    importc: "g_timer_stop".}
+proc g_timer_reset*(timer: PGTimer){.cdecl, dynlib: gliblib,
+                                     importc: "g_timer_reset".}
+proc g_timer_elapsed*(timer: PGTimer, microseconds: Pgulong): gdouble{.cdecl,
+    dynlib: gliblib, importc: "g_timer_elapsed".}
+proc g_usleep*(microseconds: gulong){.cdecl, dynlib: gliblib,
+                                      importc: "g_usleep".}
+proc g_time_val_add*(time: PGTimeVal, microseconds: glong){.cdecl,
+    dynlib: gliblib, importc: "g_time_val_add".}
+type
+  Pgunichar* = ptr gunichar
+  gunichar* = guint32
+  Pgunichar2* = ptr gunichar2
+  gunichar2* = guint16
+  PGUnicodeType* = ptr TGUnicodeType
+  TGUnicodeType* = enum
+    G_UNICODE_CONTROL, G_UNICODE_FORMAT, G_UNICODE_UNASSIGNED,
+    G_UNICODE_PRIVATE_USE, G_UNICODE_SURROGATE, G_UNICODE_LOWERCASE_LETTER,
+    G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER,
+    G_UNICODE_TITLECASE_LETTER, G_UNICODE_UPPERCASE_LETTER,
+    G_UNICODE_COMBINING_MARK, G_UNICODE_ENCLOSING_MARK,
+    G_UNICODE_NON_SPACING_MARK, G_UNICODE_DECIMAL_NUMBER,
+    G_UNICODE_LETTER_NUMBER, G_UNICODE_OTHER_NUMBER,
+    G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION,
+    G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION,
+    G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION,
+    G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL,
+    G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL,
+    G_UNICODE_LINE_SEPARATOR, G_UNICODE_PARAGRAPH_SEPARATOR,
+    G_UNICODE_SPACE_SEPARATOR
+  PGUnicodeBreakType* = ptr TGUnicodeBreakType
+  TGUnicodeBreakType* = enum
+    G_UNICODE_BREAK_MANDATORY, G_UNICODE_BREAK_CARRIAGE_RETURN,
+    G_UNICODE_BREAK_LINE_FEED, G_UNICODE_BREAK_COMBINING_MARK,
+    G_UNICODE_BREAK_SURROGATE, G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
+    G_UNICODE_BREAK_INSEPARABLE, G_UNICODE_BREAK_NON_BREAKING_GLUE,
+    G_UNICODE_BREAK_CONTINGENT, G_UNICODE_BREAK_SPACE, G_UNICODE_BREAK_AFTER,
+    G_UNICODE_BREAK_BEFORE, G_UNICODE_BREAK_BEFORE_AND_AFTER,
+    G_UNICODE_BREAK_HYPHEN, G_UNICODE_BREAK_NON_STARTER,
+    G_UNICODE_BREAK_OPEN_PUNCTUATION, G_UNICODE_BREAK_CLOSE_PUNCTUATION,
+    G_UNICODE_BREAK_QUOTATION, G_UNICODE_BREAK_EXCLAMATION,
+    G_UNICODE_BREAK_IDEOGRAPHIC, G_UNICODE_BREAK_NUMERIC,
+    G_UNICODE_BREAK_INFIX_SEPARATOR, G_UNICODE_BREAK_SYMBOL,
+    G_UNICODE_BREAK_ALPHABETIC, G_UNICODE_BREAK_PREFIX, G_UNICODE_BREAK_POSTFIX,
+    G_UNICODE_BREAK_COMPLEX_CONTEXT, G_UNICODE_BREAK_AMBIGUOUS,
+    G_UNICODE_BREAK_UNKNOWN
+
+proc g_get_charset*(charset: PPchar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_get_charset".}
+proc g_unichar_isalnum*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isalnum".}
+proc g_unichar_isalpha*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isalpha".}
+proc g_unichar_iscntrl*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_iscntrl".}
+proc g_unichar_isdigit*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isdigit".}
+proc g_unichar_isgraph*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isgraph".}
+proc g_unichar_islower*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_islower".}
+proc g_unichar_isprint*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isprint".}
+proc g_unichar_ispunct*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_ispunct".}
+proc g_unichar_isspace*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isspace".}
+proc g_unichar_isupper*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isupper".}
+proc g_unichar_isxdigit*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isxdigit".}
+proc g_unichar_istitle*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_istitle".}
+proc g_unichar_isdefined*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_isdefined".}
+proc g_unichar_iswide*(c: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_iswide".}
+proc g_unichar_toupper*(c: gunichar): gunichar{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_toupper".}
+proc g_unichar_tolower*(c: gunichar): gunichar{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_tolower".}
+proc g_unichar_totitle*(c: gunichar): gunichar{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_totitle".}
+proc g_unichar_digit_value*(c: gunichar): gint{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_digit_value".}
+proc g_unichar_xdigit_value*(c: gunichar): gint{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_xdigit_value".}
+proc g_unichar_type*(c: gunichar): TGUnicodeType{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_type".}
+proc g_unichar_break_type*(c: gunichar): TGUnicodeBreakType{.cdecl,
+    dynlib: gliblib, importc: "g_unichar_break_type".}
+proc g_unicode_canonical_ordering*(str: Pgunichar, len: gsize){.cdecl,
+    dynlib: gliblib, importc: "g_unicode_canonical_ordering".}
+proc g_unicode_canonical_decomposition*(ch: gunichar, result_len: Pgsize): Pgunichar{.
+    cdecl, dynlib: gliblib, importc: "g_unicode_canonical_decomposition".}
+proc g_utf8_next_char*(p: pguchar): pguchar
+proc g_utf8_get_char*(p: cstring): gunichar{.cdecl, dynlib: gliblib,
+    importc: "g_utf8_get_char".}
+proc g_utf8_get_char_validated*(p: cstring, max_len: gssize): gunichar{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_get_char_validated".}
+proc g_utf8_offset_to_pointer*(str: cstring, offset: glong): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_offset_to_pointer".}
+proc g_utf8_pointer_to_offset*(str: cstring, pos: cstring): glong{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_pointer_to_offset".}
+proc g_utf8_prev_char*(p: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_utf8_prev_char".}
+proc g_utf8_find_next_char*(p: cstring, `end`: cstring): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_find_next_char".}
+proc g_utf8_find_prev_char*(str: cstring, p: cstring): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_find_prev_char".}
+proc g_utf8_strlen*(p: cstring, max: gssize): glong{.cdecl, dynlib: gliblib,
+    importc: "g_utf8_strlen".}
+proc g_utf8_strncpy*(dest: cstring, src: cstring, n: gsize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_strncpy".}
+proc g_utf8_strchr*(p: cstring, len: gssize, c: gunichar): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_strchr".}
+proc g_utf8_strrchr*(p: cstring, len: gssize, c: gunichar): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_strrchr".}
+proc g_utf8_to_utf16*(str: cstring, len: glong, items_read: Pglong,
+                      items_written: Pglong, error: pointer): Pgunichar2{.
+    cdecl, dynlib: gliblib, importc: "g_utf8_to_utf16".}
+proc g_utf8_to_ucs4*(str: cstring, len: glong, items_read: Pglong,
+                     items_written: Pglong, error: pointer): Pgunichar{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_to_ucs4".}
+proc g_utf8_to_ucs4_fast*(str: cstring, len: glong, items_written: Pglong): Pgunichar{.
+    cdecl, dynlib: gliblib, importc: "g_utf8_to_ucs4_fast".}
+proc g_utf16_to_ucs4*(str: Pgunichar2, len: glong, items_read: Pglong,
+                      items_written: Pglong, error: pointer): Pgunichar{.cdecl,
+    dynlib: gliblib, importc: "g_utf16_to_ucs4".}
+proc g_utf16_to_utf8*(str: Pgunichar2, len: glong, items_read: Pglong,
+                      items_written: Pglong, error: pointer): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf16_to_utf8".}
+proc g_ucs4_to_utf16*(str: Pgunichar, len: glong, items_read: Pglong,
+                      items_written: Pglong, error: pointer): Pgunichar2{.
+    cdecl, dynlib: gliblib, importc: "g_ucs4_to_utf16".}
+proc g_ucs4_to_utf8*(str: Pgunichar, len: glong, items_read: Pglong,
+                     items_written: Pglong, error: pointer): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_ucs4_to_utf8".}
+proc g_unichar_to_utf8*(c: gunichar, outbuf: cstring): gint{.cdecl,
+    dynlib: gliblib, importc: "g_unichar_to_utf8".}
+proc g_utf8_validate*(str: cstring, max_len: gssize, `end`: PPgchar): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_utf8_validate".}
+proc g_unichar_validate*(ch: gunichar): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_unichar_validate".}
+proc g_utf8_strup*(str: cstring, len: gssize): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_utf8_strup".}
+proc g_utf8_strdown*(str: cstring, len: gssize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_strdown".}
+proc g_utf8_casefold*(str: cstring, len: gssize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_casefold".}
+type
+  PGNormalizeMode* = ptr TGNormalizeMode
+  TGNormalizeMode* = gint
+
+const
+  G_NORMALIZE_DEFAULT* = 0
+  G_NORMALIZE_NFD* = G_NORMALIZE_DEFAULT
+  G_NORMALIZE_DEFAULT_COMPOSE* = 1
+  G_NORMALIZE_NFC* = G_NORMALIZE_DEFAULT_COMPOSE
+  G_NORMALIZE_ALL* = 2
+  G_NORMALIZE_NFKD* = G_NORMALIZE_ALL
+  G_NORMALIZE_ALL_COMPOSE* = 3
+  G_NORMALIZE_NFKC* = G_NORMALIZE_ALL_COMPOSE
+
+proc g_utf8_normalize*(str: cstring, len: gssize, mode: TGNormalizeMode): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_utf8_normalize".}
+proc g_utf8_collate*(str1: cstring, str2: cstring): gint{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_collate".}
+proc g_utf8_collate_key*(str: cstring, len: gssize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_utf8_collate_key".}
+type
+  PGString* = ptr TGString
+  TGString* = record
+    str*: cstring
+    len*: gsize
+    allocated_len*: gsize
+
+  PGStringChunk* = pointer
+
+proc g_string_chunk_new*(size: gsize): PGStringChunk{.cdecl, dynlib: gliblib,
+    importc: "g_string_chunk_new".}
+proc g_string_chunk_free*(chunk: PGStringChunk){.cdecl, dynlib: gliblib,
+    importc: "g_string_chunk_free".}
+proc g_string_chunk_insert*(chunk: PGStringChunk, str: cstring): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_string_chunk_insert".}
+proc g_string_chunk_insert_const*(chunk: PGStringChunk, str: cstring): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_string_chunk_insert_const".}
+proc g_string_new*(init: cstring): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_new".}
+proc g_string_new_len*(init: cstring, len: gssize): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_new_len".}
+proc g_string_sized_new*(dfl_size: gsize): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_sized_new".}
+proc g_string_free*(str: PGString, free_segment: gboolean): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_string_free".}
+proc g_string_equal*(v: PGString, v2: PGString): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_string_equal".}
+proc g_string_hash*(str: PGString): guint{.cdecl, dynlib: gliblib,
+    importc: "g_string_hash".}
+proc g_string_assign*(str: PGString, rval: cstring): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_assign".}
+proc g_string_truncate*(str: PGString, len: gsize): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_truncate".}
+proc g_string_set_size*(str: PGString, len: gsize): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_set_size".}
+proc g_string_insert_len*(str: PGString, pos: gssize, val: cstring, len: gssize): PGString{.
+    cdecl, dynlib: gliblib, importc: "g_string_insert_len".}
+proc g_string_append*(str: PGString, val: cstring): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_append".}
+proc g_string_append_len*(str: PGString, val: cstring, len: gssize): PGString{.
+    cdecl, dynlib: gliblib, importc: "g_string_append_len".}
+proc g_string_append_c*(str: PGString, c: gchar): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_append_c".}
+proc g_string_append_unichar*(str: PGString, wc: gunichar): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_append_unichar".}
+proc g_string_prepend*(str: PGString, val: cstring): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_prepend".}
+proc g_string_prepend_c*(str: PGString, c: gchar): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_prepend_c".}
+proc g_string_prepend_unichar*(str: PGString, wc: gunichar): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_prepend_unichar".}
+proc g_string_prepend_len*(str: PGString, val: cstring, len: gssize): PGString{.
+    cdecl, dynlib: gliblib, importc: "g_string_prepend_len".}
+proc g_string_insert*(str: PGString, pos: gssize, val: cstring): PGString{.
+    cdecl, dynlib: gliblib, importc: "g_string_insert".}
+proc g_string_insert_c*(str: PGString, pos: gssize, c: gchar): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_insert_c".}
+proc g_string_insert_unichar*(str: PGString, pos: gssize, wc: gunichar): PGString{.
+    cdecl, dynlib: gliblib, importc: "g_string_insert_unichar".}
+proc g_string_erase*(str: PGString, pos: gssize, len: gssize): PGString{.cdecl,
+    dynlib: gliblib, importc: "g_string_erase".}
+proc g_string_ascii_down*(str: PGString): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_ascii_down".}
+proc g_string_ascii_up*(str: PGString): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_ascii_up".}
+proc g_string_down*(str: PGString): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_down".}
+proc g_string_up*(str: PGString): PGString{.cdecl, dynlib: gliblib,
+    importc: "g_string_up".}
+type
+  PGIOError* = ptr TGIOError
+  TGIOError* = enum
+    G_IO_ERROR_NONE, G_IO_ERROR_AGAIN, G_IO_ERROR_INVAL, G_IO_ERROR_UNKNOWN
+
+proc G_IO_CHANNEL_ERROR*(): TGQuark
+type
+  PGIOChannelError* = ptr TGIOChannelError
+  TGIOChannelError* = enum
+    G_IO_CHANNEL_ERROR_FBIG, G_IO_CHANNEL_ERROR_INVAL, G_IO_CHANNEL_ERROR_IO,
+    G_IO_CHANNEL_ERROR_ISDIR, G_IO_CHANNEL_ERROR_NOSPC, G_IO_CHANNEL_ERROR_NXIO,
+    G_IO_CHANNEL_ERROR_OVERFLOW, G_IO_CHANNEL_ERROR_PIPE,
+    G_IO_CHANNEL_ERROR_FAILED
+  PGIOStatus* = ptr TGIOStatus
+  TGIOStatus* = enum
+    G_IO_STATUS_ERROR, G_IO_STATUS_NORMAL, G_IO_STATUS_EOF, G_IO_STATUS_AGAIN
+  PGSeekType* = ptr TGSeekType
+  TGSeekType* = enum
+    G_SEEK_CUR, G_SEEK_SET, G_SEEK_END
+  PGIOCondition* = ptr TGIOCondition
+  TGIOCondition* = gint
+
+const
+  G_IO_IN* = GLIB_SYSDEF_POLLIN
+  G_IO_OUT* = GLIB_SYSDEF_POLLOUT
+  G_IO_PRI* = GLIB_SYSDEF_POLLPRI
+  G_IO_ERR* = GLIB_SYSDEF_POLLERR
+  G_IO_HUP* = GLIB_SYSDEF_POLLHUP
+  G_IO_NVAL* = GLIB_SYSDEF_POLLNVAL
+
+type
+  PGIOFlags* = ptr TGIOFlags
+  TGIOFlags* = gint
+
+const
+  G_IO_FLAG_APPEND* = 1 shl 0
+  G_IO_FLAG_NONBLOCK* = 1 shl 1
+  G_IO_FLAG_IS_READABLE* = 1 shl 2
+  G_IO_FLAG_IS_WRITEABLE* = 1 shl 3
+  G_IO_FLAG_IS_SEEKABLE* = 1 shl 4
+  G_IO_FLAG_MASK* = (1 shl 5) - 1
+  G_IO_FLAG_GET_MASK* = G_IO_FLAG_MASK
+  G_IO_FLAG_SET_MASK* = G_IO_FLAG_APPEND or G_IO_FLAG_NONBLOCK
+
+type
+  PGIOChannel* = ptr TGIOChannel
+  TGIOFunc* = proc (source: PGIOChannel, condition: TGIOCondition,
+                    data: gpointer): gboolean{.cdecl.}
+  PGIOFuncs* = ptr TGIOFuncs
+  TGIOFuncs* = record
+    io_read*: proc (channel: PGIOChannel, buf: cstring, count: gsize,
+                    bytes_read: Pgsize, err: pointer): TGIOStatus{.cdecl.}
+    io_write*: proc (channel: PGIOChannel, buf: cstring, count: gsize,
+                     bytes_written: Pgsize, err: pointer): TGIOStatus{.cdecl.}
+    io_seek*: proc (channel: PGIOChannel, offset: gint64, theType: TGSeekType,
+                    err: pointer): TGIOStatus{.cdecl.}
+    io_close*: proc (channel: PGIOChannel, err: pointer): TGIOStatus{.cdecl.}
+    io_create_watch*: proc (channel: PGIOChannel, condition: TGIOCondition): PGSource{.
+        cdecl.}
+    io_free*: proc (channel: PGIOChannel){.cdecl.}
+    io_set_flags*: proc (channel: PGIOChannel, flags: TGIOFlags, err: pointer): TGIOStatus{.
+        cdecl.}
+    io_get_flags*: proc (channel: PGIOChannel): TGIOFlags{.cdecl.}
+
+  TGIOChannel* = record
+    ref_count*: guint
+    funcs*: PGIOFuncs
+    encoding*: cstring
+    read_cd*: TGIConv
+    write_cd*: TGIConv
+    line_term*: cstring
+    line_term_len*: guint
+    buf_size*: gsize
+    read_buf*: PGString
+    encoded_read_buf*: PGString
+    write_buf*: PGString
+    partial_write_buf*: array[0..5, gchar]
+    flag0*: guint16
+    reserved1*: gpointer
+    reserved2*: gpointer
+
+
+const
+  bm_TGIOChannel_use_buffer* = 0x00000001
+  bp_TGIOChannel_use_buffer* = 0
+  bm_TGIOChannel_do_encode* = 0x00000002
+  bp_TGIOChannel_do_encode* = 1
+  bm_TGIOChannel_close_on_unref* = 0x00000004
+  bp_TGIOChannel_close_on_unref* = 2
+  bm_TGIOChannel_is_readable* = 0x00000008
+  bp_TGIOChannel_is_readable* = 3
+  bm_TGIOChannel_is_writeable* = 0x00000010
+  bp_TGIOChannel_is_writeable* = 4
+  bm_TGIOChannel_is_seekable* = 0x00000020
+  bp_TGIOChannel_is_seekable* = 5
+
+proc TGIOChannel_use_buffer*(a: var TGIOChannel): guint
+proc TGIOChannel_set_use_buffer*(a: var TGIOChannel, `use_buffer`: guint)
+proc TGIOChannel_do_encode*(a: var TGIOChannel): guint
+proc TGIOChannel_set_do_encode*(a: var TGIOChannel, `do_encode`: guint)
+proc TGIOChannel_close_on_unref*(a: var TGIOChannel): guint
+proc TGIOChannel_set_close_on_unref*(a: var TGIOChannel, `close_on_unref`: guint)
+proc TGIOChannel_is_readable*(a: var TGIOChannel): guint
+proc TGIOChannel_set_is_readable*(a: var TGIOChannel, `is_readable`: guint)
+proc TGIOChannel_is_writeable*(a: var TGIOChannel): guint
+proc TGIOChannel_set_is_writeable*(a: var TGIOChannel, `is_writeable`: guint)
+proc TGIOChannel_is_seekable*(a: var TGIOChannel): guint
+proc TGIOChannel_set_is_seekable*(a: var TGIOChannel, `is_seekable`: guint)
+proc g_io_channel_init*(channel: PGIOChannel){.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_init".}
+proc g_io_channel_ref*(channel: PGIOChannel){.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_ref".}
+proc g_io_channel_unref*(channel: PGIOChannel){.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_unref".}
+proc g_io_channel_read*(channel: PGIOChannel, buf: cstring, count: gsize,
+                        bytes_read: Pgsize): TGIOError{.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_read".}
+proc g_io_channel_write*(channel: PGIOChannel, buf: cstring, count: gsize,
+                         bytes_written: Pgsize): TGIOError{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_write".}
+proc g_io_channel_seek*(channel: PGIOChannel, offset: gint64,
+                        theType: TGSeekType): TGIOError{.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_seek".}
+proc g_io_channel_close*(channel: PGIOChannel){.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_close".}
+proc g_io_channel_shutdown*(channel: PGIOChannel, flush: gboolean, err: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_shutdown".}
+proc g_io_add_watch_full*(channel: PGIOChannel, priority: gint,
+                          condition: TGIOCondition, func: TGIOFunc,
+                          user_data: gpointer, notify: TGDestroyNotify): guint{.
+    cdecl, dynlib: gliblib, importc: "g_io_add_watch_full".}
+proc g_io_create_watch*(channel: PGIOChannel, condition: TGIOCondition): PGSource{.
+    cdecl, dynlib: gliblib, importc: "g_io_create_watch".}
+proc g_io_add_watch*(channel: PGIOChannel, condition: TGIOCondition,
+                     func: TGIOFunc, user_data: gpointer): guint{.cdecl,
+    dynlib: gliblib, importc: "g_io_add_watch".}
+proc g_io_channel_set_buffer_size*(channel: PGIOChannel, size: gsize){.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_set_buffer_size".}
+proc g_io_channel_get_buffer_size*(channel: PGIOChannel): gsize{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_get_buffer_size".}
+proc g_io_channel_get_buffer_condition*(channel: PGIOChannel): TGIOCondition{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_get_buffer_condition".}
+proc g_io_channel_set_flags*(channel: PGIOChannel, flags: TGIOFlags,
+                             error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_set_flags".}
+proc g_io_channel_get_flags*(channel: PGIOChannel): TGIOFlags{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_get_flags".}
+proc g_io_channel_set_line_term*(channel: PGIOChannel, line_term: cstring,
+                                 length: gint){.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_set_line_term".}
+proc g_io_channel_get_line_term*(channel: PGIOChannel, length: Pgint): cstring{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_get_line_term".}
+proc g_io_channel_set_buffered*(channel: PGIOChannel, buffered: gboolean){.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_set_buffered".}
+proc g_io_channel_get_buffered*(channel: PGIOChannel): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_get_buffered".}
+proc g_io_channel_set_encoding*(channel: PGIOChannel, encoding: cstring,
+                                error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_set_encoding".}
+proc g_io_channel_get_encoding*(channel: PGIOChannel): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_get_encoding".}
+proc g_io_channel_set_close_on_unref*(channel: PGIOChannel, do_close: gboolean){.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_set_close_on_unref".}
+proc g_io_channel_get_close_on_unref*(channel: PGIOChannel): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_get_close_on_unref".}
+proc g_io_channel_flush*(channel: PGIOChannel, error: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_flush".}
+proc g_io_channel_read_line*(channel: PGIOChannel, str_return: PPgchar,
+                             length: Pgsize, terminator_pos: Pgsize,
+                             error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_read_line".}
+proc g_io_channel_read_line_string*(channel: PGIOChannel, buffer: PGString,
+                                    terminator_pos: Pgsize, error: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_read_line_string".}
+proc g_io_channel_read_to_end*(channel: PGIOChannel, str_return: PPgchar,
+                               length: Pgsize, error: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_read_to_end".}
+proc g_io_channel_read_chars*(channel: PGIOChannel, buf: cstring, count: gsize,
+                              bytes_read: Pgsize, error: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_read_chars".}
+proc g_io_channel_read_unichar*(channel: PGIOChannel, thechar: Pgunichar,
+                                error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_read_unichar".}
+proc g_io_channel_write_chars*(channel: PGIOChannel, buf: cstring,
+                               count: gssize, bytes_written: Pgsize,
+                               error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_write_chars".}
+proc g_io_channel_write_unichar*(channel: PGIOChannel, thechar: gunichar,
+                                 error: pointer): TGIOStatus{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_write_unichar".}
+proc g_io_channel_seek_position*(channel: PGIOChannel, offset: gint64,
+                                 theType: TGSeekType, error: pointer): TGIOStatus{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_seek_position".}
+proc g_io_channel_new_file*(filename: cstring, mode: cstring, error: pointer): PGIOChannel{.
+    cdecl, dynlib: gliblib, importc: "g_io_channel_new_file".}
+proc g_io_channel_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_error_quark".}
+proc g_io_channel_error_from_errno*(en: gint): TGIOChannelError{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_error_from_errno".}
+proc g_io_channel_unix_new*(fd: int32): PGIOChannel{.cdecl, dynlib: gliblib,
+    importc: "g_io_channel_unix_new".}
+proc g_io_channel_unix_get_fd*(channel: PGIOChannel): gint{.cdecl,
+    dynlib: gliblib, importc: "g_io_channel_unix_get_fd".}
+const
+  G_LOG_LEVEL_USER_SHIFT* = 8
+
+type
+  PGLogLevelFlags* = ptr TGLogLevelFlags
+  TGLogLevelFlags* = int32
+
+const
+  G_LOG_FLAG_RECURSION* = 1 shl 0
+  G_LOG_FLAG_FATAL* = 1 shl 1
+  G_LOG_LEVEL_ERROR* = 1 shl 2
+  G_LOG_LEVEL_CRITICAL* = 1 shl 3
+  G_LOG_LEVEL_WARNING* = 1 shl 4
+  G_LOG_LEVEL_MESSAGE* = 1 shl 5
+  G_LOG_LEVEL_INFO* = 1 shl 6
+  G_LOG_LEVEL_DEBUG* = 1 shl 7
+  G_LOG_LEVEL_MASK* = not 3
+
+const
+  G_LOG_FATAL_MASK* = 5
+
+type
+  TGLogFunc* = proc (log_domain: cstring, log_level: TGLogLevelFlags,
+                     TheMessage: cstring, user_data: gpointer){.cdecl.}
+
+proc g_log_set_handler*(log_domain: cstring, log_levels: TGLogLevelFlags,
+                        log_func: TGLogFunc, user_data: gpointer): guint{.cdecl,
+    dynlib: gliblib, importc: "g_log_set_handler".}
+proc g_log_remove_handler*(log_domain: cstring, handler_id: guint){.cdecl,
+    dynlib: gliblib, importc: "g_log_remove_handler".}
+proc g_log_default_handler*(log_domain: cstring, log_level: TGLogLevelFlags,
+                            TheMessage: cstring, unused_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_log_default_handler".}
+proc g_log_set_fatal_mask*(log_domain: cstring, fatal_mask: TGLogLevelFlags): TGLogLevelFlags{.
+    cdecl, dynlib: gliblib, importc: "g_log_set_fatal_mask".}
+proc g_log_set_always_fatal*(fatal_mask: TGLogLevelFlags): TGLogLevelFlags{.
+    cdecl, dynlib: gliblib, importc: "g_log_set_always_fatal".}
+proc `g_log_fallback_handler`*(log_domain: cstring, log_level: TGLogLevelFlags,
+                               message: cstring, unused_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_log_fallback_handler".}
+const
+  G_LOG_DOMAIN* = nil
+
+when false:
+  proc g_error*(format: cstring){.varargs.}
+  proc g_message*(format: cstring){.varargs.}
+  proc g_critical*(format: cstring){.varargs.}
+  proc g_warning*(format: cstring){.varargs.}
+
+type
+  TGPrintFunc* = proc (str: cstring)
+
+proc g_set_print_handler*(func: TGPrintFunc): TGPrintFunc{.cdecl,
+    dynlib: gliblib, importc: "g_set_print_handler".}
+proc g_set_printerr_handler*(func: TGPrintFunc): TGPrintFunc{.cdecl,
+    dynlib: gliblib, importc: "g_set_printerr_handler".}
+type
+  PGMarkupError* = ptr TGMarkupError
+  TGMarkupError* = enum
+    G_MARKUP_ERROR_BAD_UTF8, G_MARKUP_ERROR_EMPTY, G_MARKUP_ERROR_PARSE,
+    G_MARKUP_ERROR_UNKNOWN_ELEMENT, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
+    G_MARKUP_ERROR_INVALID_CONTENT
+
+proc G_MARKUP_ERROR*(): TGQuark
+proc g_markup_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+                                       importc: "g_markup_error_quark".}
+type
+  PGMarkupParseFlags* = ptr TGMarkupParseFlags
+  TGMarkupParseFlags* = int
+
+const
+  G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG* = 1 shl 0
+
+type
+  PGMarkupParseContext* = ptr TGMarkupParseContext
+  TGMarkupParseContext* = pointer
+  PGMarkupParser* = ptr TGMarkupParser
+  TGMarkupParser* = record
+    start_element*: proc (context: PGMarkupParseContext, element_name: cstring,
+                          attribute_names: PPgchar, attribute_values: PPgchar,
+                          user_data: gpointer, error: pointer){.cdecl.}
+    end_element*: proc (context: PGMarkupParseContext, element_name: cstring,
+                        user_data: gpointer, error: pointer){.cdecl.}
+    text*: proc (context: PGMarkupParseContext, text: cstring, text_len: gsize,
+                 user_data: gpointer, error: pointer){.cdecl.}
+    passthrough*: proc (context: PGMarkupParseContext,
+                        passthrough_text: cstring, text_len: gsize,
+                        user_data: gpointer, error: pointer){.cdecl.}
+    error*: proc (context: PGMarkupParseContext, error: pointer,
+                  user_data: gpointer){.cdecl.}
+
+
+proc g_markup_parse_context_new*(parser: PGMarkupParser,
+                                 flags: TGMarkupParseFlags, user_data: gpointer,
+                                 user_data_dnotify: TGDestroyNotify): PGMarkupParseContext{.
+    cdecl, dynlib: gliblib, importc: "g_markup_parse_context_new".}
+proc g_markup_parse_context_free*(context: PGMarkupParseContext){.cdecl,
+    dynlib: gliblib, importc: "g_markup_parse_context_free".}
+proc g_markup_parse_context_parse*(context: PGMarkupParseContext, text: cstring,
+                                   text_len: gssize, error: pointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_markup_parse_context_parse".}
+proc g_markup_parse_context_end_parse*(context: PGMarkupParseContext,
+                                       error: pointer): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_markup_parse_context_end_parse".}
+proc g_markup_parse_context_get_position*(context: PGMarkupParseContext,
+    line_number: Pgint, char_number: Pgint){.cdecl, dynlib: gliblib,
+    importc: "g_markup_parse_context_get_position".}
+proc g_markup_escape_text*(text: cstring, length: gssize): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_markup_escape_text".}
+type
+  PGNode* = ptr TGNode
+  TGNode* = record
+    data*: gpointer
+    next*: PGNode
+    prev*: PGNode
+    parent*: PGNode
+    children*: PGNode
+
+  PGTraverseFlags* = ptr TGTraverseFlags
+  TGTraverseFlags* = gint
+
+const
+  G_TRAVERSE_LEAFS* = 1 shl 0
+  G_TRAVERSE_NON_LEAFS* = 1 shl 1
+  G_TRAVERSE_ALL* = G_TRAVERSE_LEAFS or G_TRAVERSE_NON_LEAFS
+  G_TRAVERSE_MASK* = 0x00000003
+
+type
+  PGTraverseType* = ptr TGTraverseType
+  TGTraverseType* = enum
+    G_IN_ORDER, G_PRE_ORDER, G_POST_ORDER, G_LEVEL_ORDER
+  TGNodeTraverseFunc* = proc (node: PGNode, data: gpointer): gboolean{.cdecl.}
+  TGNodeForeachFunc* = proc (node: PGNode, data: gpointer){.cdecl.}
+
+proc G_NODE_IS_ROOT*(node: PGNode): bool
+proc G_NODE_IS_LEAF*(node: PGNode): bool
+proc g_node_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib,
+    importc: "g_node_push_allocator".}
+proc g_node_pop_allocator*(){.cdecl, dynlib: gliblib,
+                              importc: "g_node_pop_allocator".}
+proc g_node_new*(data: gpointer): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_new".}
+proc g_node_destroy*(root: PGNode){.cdecl, dynlib: gliblib,
+                                    importc: "g_node_destroy".}
+proc g_node_unlink*(node: PGNode){.cdecl, dynlib: gliblib,
+                                   importc: "g_node_unlink".}
+proc g_node_copy*(node: PGNode): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_copy".}
+proc g_node_insert*(parent: PGNode, position: gint, node: PGNode): PGNode{.
+    cdecl, dynlib: gliblib, importc: "g_node_insert".}
+proc g_node_insert_before*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{.
+    cdecl, dynlib: gliblib, importc: "g_node_insert_before".}
+proc g_node_insert_after*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{.
+    cdecl, dynlib: gliblib, importc: "g_node_insert_after".}
+proc g_node_prepend*(parent: PGNode, node: PGNode): PGNode{.cdecl,
+    dynlib: gliblib, importc: "g_node_prepend".}
+proc g_node_n_nodes*(root: PGNode, flags: TGTraverseFlags): guint{.cdecl,
+    dynlib: gliblib, importc: "g_node_n_nodes".}
+proc g_node_get_root*(node: PGNode): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_get_root".}
+proc g_node_is_ancestor*(node: PGNode, descendant: PGNode): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_node_is_ancestor".}
+proc g_node_depth*(node: PGNode): guint{.cdecl, dynlib: gliblib,
+    importc: "g_node_depth".}
+proc g_node_find*(root: PGNode, order: TGTraverseType, flags: TGTraverseFlags,
+                  data: gpointer): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_find".}
+proc g_node_append*(parent: PGNode, node: PGNode): PGNode
+proc g_node_insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode
+proc g_node_insert_data_before*(parent: PGNode, sibling: PGNode, data: gpointer): PGNode
+proc g_node_prepend_data*(parent: PGNode, data: gpointer): PGNode
+proc g_node_append_data*(parent: PGNode, data: gpointer): PGNode
+proc g_node_traverse*(root: PGNode, order: TGTraverseType,
+                      flags: TGTraverseFlags, max_depth: gint,
+                      func: TGNodeTraverseFunc, data: gpointer): guint{.cdecl,
+    dynlib: gliblib, importc: "g_node_traverse".}
+proc g_node_max_height*(root: PGNode): guint{.cdecl, dynlib: gliblib,
+    importc: "g_node_max_height".}
+proc g_node_children_foreach*(node: PGNode, flags: TGTraverseFlags,
+                              func: TGNodeForeachFunc, data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_node_children_foreach".}
+proc g_node_reverse_children*(node: PGNode){.cdecl, dynlib: gliblib,
+    importc: "g_node_reverse_children".}
+proc g_node_n_children*(node: PGNode): guint{.cdecl, dynlib: gliblib,
+    importc: "g_node_n_children".}
+proc g_node_nth_child*(node: PGNode, n: guint): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_nth_child".}
+proc g_node_last_child*(node: PGNode): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_last_child".}
+proc g_node_find_child*(node: PGNode, flags: TGTraverseFlags, data: gpointer): PGNode{.
+    cdecl, dynlib: gliblib, importc: "g_node_find_child".}
+proc g_node_child_position*(node: PGNode, child: PGNode): gint{.cdecl,
+    dynlib: gliblib, importc: "g_node_child_position".}
+proc g_node_child_index*(node: PGNode, data: gpointer): gint{.cdecl,
+    dynlib: gliblib, importc: "g_node_child_index".}
+proc g_node_first_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_first_sibling".}
+proc g_node_last_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib,
+    importc: "g_node_last_sibling".}
+proc g_node_prev_sibling*(node: PGNode): PGNode
+proc g_node_next_sibling*(node: PGNode): PGNode
+proc g_node_first_child*(node: PGNode): PGNode
+type
+  PGTree* = pointer
+  TGTraverseFunc* = proc (key: gpointer, value: gpointer, data: gpointer): gboolean{.
+      cdecl.}
+
+proc g_tree_new*(key_compare_func: TGCompareFunc): PGTree{.cdecl,
+    dynlib: gliblib, importc: "g_tree_new".}
+proc g_tree_new_with_data*(key_compare_func: TGCompareDataFunc,
+                           key_compare_data: gpointer): PGTree{.cdecl,
+    dynlib: gliblib, importc: "g_tree_new_with_data".}
+proc g_tree_new_full*(key_compare_func: TGCompareDataFunc,
+                      key_compare_data: gpointer,
+                      key_destroy_func: TGDestroyNotify,
+                      value_destroy_func: TGDestroyNotify): PGTree{.cdecl,
+    dynlib: gliblib, importc: "g_tree_new_full".}
+proc g_tree_destroy*(tree: PGTree){.cdecl, dynlib: gliblib,
+                                    importc: "g_tree_destroy".}
+proc g_tree_insert*(tree: PGTree, key: gpointer, value: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_tree_insert".}
+proc g_tree_replace*(tree: PGTree, key: gpointer, value: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_tree_replace".}
+proc g_tree_remove*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib,
+    importc: "g_tree_remove".}
+proc g_tree_steal*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib,
+    importc: "g_tree_steal".}
+proc g_tree_lookup*(tree: PGTree, key: gconstpointer): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_tree_lookup".}
+proc g_tree_lookup_extended*(tree: PGTree, lookup_key: gconstpointer,
+                             orig_key: Pgpointer, value: Pgpointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_tree_lookup_extended".}
+proc g_tree_foreach*(tree: PGTree, func: TGTraverseFunc, user_data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_tree_foreach".}
+proc g_tree_search*(tree: PGTree, search_func: TGCompareFunc,
+                    user_data: gconstpointer): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_tree_search".}
+proc g_tree_height*(tree: PGTree): gint{.cdecl, dynlib: gliblib,
+    importc: "g_tree_height".}
+proc g_tree_nnodes*(tree: PGTree): gint{.cdecl, dynlib: gliblib,
+    importc: "g_tree_nnodes".}
+type
+  PGPatternSpec* = pointer
+
+proc g_pattern_spec_new*(pattern: cstring): PGPatternSpec{.cdecl,
+    dynlib: gliblib, importc: "g_pattern_spec_new".}
+proc g_pattern_spec_free*(pspec: PGPatternSpec){.cdecl, dynlib: gliblib,
+    importc: "g_pattern_spec_free".}
+proc g_pattern_spec_equal*(pspec1: PGPatternSpec, pspec2: PGPatternSpec): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_pattern_spec_equal".}
+proc g_pattern_match*(pspec: PGPatternSpec, string_length: guint, str: cstring,
+                      string_reversed: cstring): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_pattern_match".}
+proc g_pattern_match_string*(pspec: PGPatternSpec, str: cstring): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_pattern_match_string".}
+proc g_pattern_match_simple*(pattern: cstring, str: cstring): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_pattern_match_simple".}
+proc g_spaced_primes_closest*(num: guint): guint{.cdecl, dynlib: gliblib,
+    importc: "g_spaced_primes_closest".}
+proc g_qsort_with_data*(pbase: gconstpointer, total_elems: gint, size: gsize,
+                        compare_func: TGCompareDataFunc, user_data: gpointer){.
+    cdecl, dynlib: gliblib, importc: "g_qsort_with_data".}
+type
+  PGQueue* = ptr TGQueue
+  TGQueue* = record
+    head*: PGList
+    tail*: PGList
+    length*: guint
+
+
+proc g_queue_new*(): PGQueue{.cdecl, dynlib: gliblib, importc: "g_queue_new".}
+proc g_queue_free*(queue: PGQueue){.cdecl, dynlib: gliblib,
+                                    importc: "g_queue_free".}
+proc g_queue_push_head*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_queue_push_head".}
+proc g_queue_push_tail*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib,
+    importc: "g_queue_push_tail".}
+proc g_queue_pop_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_queue_pop_head".}
+proc g_queue_pop_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_queue_pop_tail".}
+proc g_queue_is_empty*(queue: PGQueue): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_queue_is_empty".}
+proc g_queue_peek_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_queue_peek_head".}
+proc g_queue_peek_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib,
+    importc: "g_queue_peek_tail".}
+proc g_queue_push_head_link*(queue: PGQueue, link: PGList){.cdecl,
+    dynlib: gliblib, importc: "g_queue_push_head_link".}
+proc g_queue_push_tail_link*(queue: PGQueue, link: PGList){.cdecl,
+    dynlib: gliblib, importc: "g_queue_push_tail_link".}
+proc g_queue_pop_head_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_queue_pop_head_link".}
+proc g_queue_pop_tail_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib,
+    importc: "g_queue_pop_tail_link".}
+type
+  PGRand* = pointer
+
+proc g_rand_new_with_seed*(seed: guint32): PGRand{.cdecl, dynlib: gliblib,
+    importc: "g_rand_new_with_seed".}
+proc g_rand_new*(): PGRand{.cdecl, dynlib: gliblib, importc: "g_rand_new".}
+proc g_rand_free*(rand: PGRand){.cdecl, dynlib: gliblib, importc: "g_rand_free".}
+proc g_rand_set_seed*(rand: PGRand, seed: guint32){.cdecl, dynlib: gliblib,
+    importc: "g_rand_set_seed".}
+proc g_rand_boolean*(rand: PGRand): gboolean
+proc g_rand_int*(rand: PGRand): guint32{.cdecl, dynlib: gliblib,
+    importc: "g_rand_int".}
+proc g_rand_int_range*(rand: PGRand, `begin`: gint32, `end`: gint32): gint32{.
+    cdecl, dynlib: gliblib, importc: "g_rand_int_range".}
+proc g_rand_double*(rand: PGRand): gdouble{.cdecl, dynlib: gliblib,
+    importc: "g_rand_double".}
+proc g_rand_double_range*(rand: PGRand, `begin`: gdouble, `end`: gdouble): gdouble{.
+    cdecl, dynlib: gliblib, importc: "g_rand_double_range".}
+proc g_random_set_seed*(seed: guint32){.cdecl, dynlib: gliblib,
+                                        importc: "g_random_set_seed".}
+proc g_random_boolean*(): gboolean
+proc g_random_int*(): guint32{.cdecl, dynlib: gliblib, importc: "g_random_int".}
+proc g_random_int_range*(`begin`: gint32, `end`: gint32): gint32{.cdecl,
+    dynlib: gliblib, importc: "g_random_int_range".}
+proc g_random_double*(): gdouble{.cdecl, dynlib: gliblib,
+                                  importc: "g_random_double".}
+proc g_random_double_range*(`begin`: gdouble, `end`: gdouble): gdouble{.cdecl,
+    dynlib: gliblib, importc: "g_random_double_range".}
+type
+  PGTuples* = ptr TGTuples
+  TGTuples* = record
+    len*: guint
+
+  PGRelation* = pointer
+
+proc g_relation_new*(fields: gint): PGRelation{.cdecl, dynlib: gliblib,
+    importc: "g_relation_new".}
+proc g_relation_destroy*(relation: PGRelation){.cdecl, dynlib: gliblib,
+    importc: "g_relation_destroy".}
+proc g_relation_index*(relation: PGRelation, field: gint, hash_func: TGHashFunc,
+                       key_equal_func: TGEqualFunc){.cdecl, dynlib: gliblib,
+    importc: "g_relation_index".}
+proc g_relation_delete*(relation: PGRelation, key: gconstpointer, field: gint): gint{.
+    cdecl, dynlib: gliblib, importc: "g_relation_delete".}
+proc g_relation_select*(relation: PGRelation, key: gconstpointer, field: gint): PGTuples{.
+    cdecl, dynlib: gliblib, importc: "g_relation_select".}
+proc g_relation_count*(relation: PGRelation, key: gconstpointer, field: gint): gint{.
+    cdecl, dynlib: gliblib, importc: "g_relation_count".}
+proc g_relation_print*(relation: PGRelation){.cdecl, dynlib: gliblib,
+    importc: "g_relation_print".}
+proc g_tuples_destroy*(tuples: PGTuples){.cdecl, dynlib: gliblib,
+    importc: "g_tuples_destroy".}
+proc g_tuples_index*(tuples: PGTuples, index: gint, field: gint): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_tuples_index".}
+type
+  PGTokenType* = ptr TGTokenType
+  TGTokenType* = gint
+
+const
+  G_TOKEN_LEFT_PAREN* = 40
+  G_TOKEN_RIGHT_PAREN* = 41
+  G_TOKEN_LEFT_CURLY* = 123
+  G_TOKEN_RIGHT_CURLY* = 125
+  G_TOKEN_LEFT_BRACE* = 91
+  G_TOKEN_RIGHT_BRACE* = 93
+  G_TOKEN_EQUAL_SIGN* = 61
+  G_TOKEN_COMMA* = 44
+  G_TOKEN_NONE* = 256
+  G_TOKEN_ERROR* = 257
+  G_TOKEN_CHAR* = 258
+  G_TOKEN_OCTAL* = 260
+  G_TOKEN_INT* = 261
+  G_TOKEN_HEX* = 262
+  G_TOKEN_FLOAT* = 263
+  G_TOKEN_STRING* = 264
+  G_TOKEN_SYMBOL* = 265
+  G_TOKEN_IDENTIFIER* = 266
+  G_TOKEN_IDENTIFIER_NULL* = 267
+  G_TOKEN_COMMENT_SINGLE* = 268
+  G_TOKEN_COMMENT_MULTI* = 269
+  G_TOKEN_LAST* = 270
+
+type
+  PGScanner* = ptr TGScanner
+  PGScannerConfig* = ptr TGScannerConfig
+  PGTokenValue* = ptr TGTokenValue
+  TGTokenValue* = record
+    v_float*: gdouble
+
+  TGScannerMsgFunc* = proc (scanner: PGScanner, message: cstring,
+                            error: gboolean){.cdecl.}
+  TGScanner* = record
+    user_data*: gpointer
+    max_parse_errors*: guint
+    parse_errors*: guint
+    input_name*: cstring
+    qdata*: PGData
+    config*: PGScannerConfig
+    token*: TGTokenType
+    value*: TGTokenValue
+    line*: guint
+    position*: guint
+    next_token*: TGTokenType
+    next_value*: TGTokenValue
+    next_line*: guint
+    next_position*: guint
+    symbol_table*: PGHashTable
+    input_fd*: gint
+    text*: cstring
+    text_end*: cstring
+    buffer*: cstring
+    scope_id*: guint
+    msg_handler*: TGScannerMsgFunc
+
+  TGScannerConfig* = record
+    cset_skip_characters*: cstring
+    cset_identifier_first*: cstring
+    cset_identifier_nth*: cstring
+    cpair_comment_single*: cstring
+    flag0*: int32
+    padding_dummy*: guint
+
+
+const
+  G_CSET_A_2_Z_UCASE* = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+  G_CSET_a_2_z_lcase* = "abcdefghijklmnopqrstuvwxyz"
+  G_CSET_DIGITS* = "0123456789"
+
+const
+  bm_TGScannerConfig_case_sensitive* = 0x00000001
+  bp_TGScannerConfig_case_sensitive* = 0
+  bm_TGScannerConfig_skip_comment_multi* = 0x00000002
+  bp_TGScannerConfig_skip_comment_multi* = 1
+  bm_TGScannerConfig_skip_comment_single* = 0x00000004
+  bp_TGScannerConfig_skip_comment_single* = 2
+  bm_TGScannerConfig_scan_comment_multi* = 0x00000008
+  bp_TGScannerConfig_scan_comment_multi* = 3
+  bm_TGScannerConfig_scan_identifier* = 0x00000010
+  bp_TGScannerConfig_scan_identifier* = 4
+  bm_TGScannerConfig_scan_identifier_1char* = 0x00000020
+  bp_TGScannerConfig_scan_identifier_1char* = 5
+  bm_TGScannerConfig_scan_identifier_NULL* = 0x00000040
+  bp_TGScannerConfig_scan_identifier_NULL* = 6
+  bm_TGScannerConfig_scan_symbols* = 0x00000080
+  bp_TGScannerConfig_scan_symbols* = 7
+  bm_TGScannerConfig_scan_binary* = 0x00000100
+  bp_TGScannerConfig_scan_binary* = 8
+  bm_TGScannerConfig_scan_octal* = 0x00000200
+  bp_TGScannerConfig_scan_octal* = 9
+  bm_TGScannerConfig_scan_float* = 0x00000400
+  bp_TGScannerConfig_scan_float* = 10
+  bm_TGScannerConfig_scan_hex* = 0x00000800
+  bp_TGScannerConfig_scan_hex* = 11
+  bm_TGScannerConfig_scan_hex_dollar* = 0x00001000
+  bp_TGScannerConfig_scan_hex_dollar* = 12
+  bm_TGScannerConfig_scan_string_sq* = 0x00002000
+  bp_TGScannerConfig_scan_string_sq* = 13
+  bm_TGScannerConfig_scan_string_dq* = 0x00004000
+  bp_TGScannerConfig_scan_string_dq* = 14
+  bm_TGScannerConfig_numbers_2_int* = 0x00008000
+  bp_TGScannerConfig_numbers_2_int* = 15
+  bm_TGScannerConfig_int_2_float* = 0x00010000
+  bp_TGScannerConfig_int_2_float* = 16
+  bm_TGScannerConfig_identifier_2_string* = 0x00020000
+  bp_TGScannerConfig_identifier_2_string* = 17
+  bm_TGScannerConfig_char_2_token* = 0x00040000
+  bp_TGScannerConfig_char_2_token* = 18
+  bm_TGScannerConfig_symbol_2_token* = 0x00080000
+  bp_TGScannerConfig_symbol_2_token* = 19
+  bm_TGScannerConfig_scope_0_fallback* = 0x00100000
+  bp_TGScannerConfig_scope_0_fallback* = 20
+
+proc TGScannerConfig_case_sensitive*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_case_sensitive*(a: var TGScannerConfig,
+    `case_sensitive`: guint)
+proc TGScannerConfig_skip_comment_multi*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_skip_comment_multi*(a: var TGScannerConfig,
+    `skip_comment_multi`: guint)
+proc TGScannerConfig_skip_comment_single*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_skip_comment_single*(a: var TGScannerConfig,
+    `skip_comment_single`: guint)
+proc TGScannerConfig_scan_comment_multi*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_comment_multi*(a: var TGScannerConfig,
+    `scan_comment_multi`: guint)
+proc TGScannerConfig_scan_identifier*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_identifier*(a: var TGScannerConfig,
+    `scan_identifier`: guint)
+proc TGScannerConfig_scan_identifier_1char*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_identifier_1char*(a: var TGScannerConfig,
+    `scan_identifier_1char`: guint)
+proc TGScannerConfig_scan_identifier_NULL*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_identifier_NULL*(a: var TGScannerConfig,
+    `scan_identifier_NULL`: guint)
+proc TGScannerConfig_scan_symbols*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_symbols*(a: var TGScannerConfig,
+                                       `scan_symbols`: guint)
+proc TGScannerConfig_scan_binary*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_binary*(a: var TGScannerConfig,
+                                      `scan_binary`: guint)
+proc TGScannerConfig_scan_octal*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_octal*(a: var TGScannerConfig, `scan_octal`: guint)
+proc TGScannerConfig_scan_float*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_float*(a: var TGScannerConfig, `scan_float`: guint)
+proc TGScannerConfig_scan_hex*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_hex*(a: var TGScannerConfig, `scan_hex`: guint)
+proc TGScannerConfig_scan_hex_dollar*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_hex_dollar*(a: var TGScannerConfig,
+    `scan_hex_dollar`: guint)
+proc TGScannerConfig_scan_string_sq*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_string_sq*(a: var TGScannerConfig,
+    `scan_string_sq`: guint)
+proc TGScannerConfig_scan_string_dq*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scan_string_dq*(a: var TGScannerConfig,
+    `scan_string_dq`: guint)
+proc TGScannerConfig_numbers_2_int*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_numbers_2_int*(a: var TGScannerConfig,
+                                        `numbers_2_int`: guint)
+proc TGScannerConfig_int_2_float*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_int_2_float*(a: var TGScannerConfig,
+                                      `int_2_float`: guint)
+proc TGScannerConfig_identifier_2_string*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_identifier_2_string*(a: var TGScannerConfig,
+    `identifier_2_string`: guint)
+proc TGScannerConfig_char_2_token*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_char_2_token*(a: var TGScannerConfig,
+                                       `char_2_token`: guint)
+proc TGScannerConfig_symbol_2_token*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_symbol_2_token*(a: var TGScannerConfig,
+    `symbol_2_token`: guint)
+proc TGScannerConfig_scope_0_fallback*(a: var TGScannerConfig): guint
+proc TGScannerConfig_set_scope_0_fallback*(a: var TGScannerConfig,
+    `scope_0_fallback`: guint)
+proc g_scanner_new*(config_templ: PGScannerConfig): PGScanner{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_new".}
+proc g_scanner_destroy*(scanner: PGScanner){.cdecl, dynlib: gliblib,
+    importc: "g_scanner_destroy".}
+proc g_scanner_input_file*(scanner: PGScanner, input_fd: gint){.cdecl,
+    dynlib: gliblib, importc: "g_scanner_input_file".}
+proc g_scanner_sync_file_offset*(scanner: PGScanner){.cdecl, dynlib: gliblib,
+    importc: "g_scanner_sync_file_offset".}
+proc g_scanner_input_text*(scanner: PGScanner, text: cstring, text_len: guint){.
+    cdecl, dynlib: gliblib, importc: "g_scanner_input_text".}
+proc g_scanner_get_next_token*(scanner: PGScanner): TGTokenType{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_get_next_token".}
+proc g_scanner_peek_next_token*(scanner: PGScanner): TGTokenType{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_peek_next_token".}
+proc g_scanner_cur_token*(scanner: PGScanner): TGTokenType{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_cur_token".}
+proc g_scanner_cur_value*(scanner: PGScanner): TGTokenValue{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_cur_value".}
+proc g_scanner_cur_line*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib,
+    importc: "g_scanner_cur_line".}
+proc g_scanner_cur_position*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib,
+    importc: "g_scanner_cur_position".}
+proc g_scanner_eof*(scanner: PGScanner): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_scanner_eof".}
+proc g_scanner_set_scope*(scanner: PGScanner, scope_id: guint): guint{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_set_scope".}
+proc g_scanner_scope_add_symbol*(scanner: PGScanner, scope_id: guint,
+                                 symbol: cstring, value: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_scanner_scope_add_symbol".}
+proc g_scanner_scope_remove_symbol*(scanner: PGScanner, scope_id: guint,
+                                    symbol: cstring){.cdecl, dynlib: gliblib,
+    importc: "g_scanner_scope_remove_symbol".}
+proc g_scanner_scope_lookup_symbol*(scanner: PGScanner, scope_id: guint,
+                                    symbol: cstring): gpointer{.cdecl,
+    dynlib: gliblib, importc: "g_scanner_scope_lookup_symbol".}
+proc g_scanner_scope_foreach_symbol*(scanner: PGScanner, scope_id: guint,
+                                     func: TGHFunc, user_data: gpointer){.cdecl,
+    dynlib: gliblib, importc: "g_scanner_scope_foreach_symbol".}
+proc g_scanner_lookup_symbol*(scanner: PGScanner, symbol: cstring): gpointer{.
+    cdecl, dynlib: gliblib, importc: "g_scanner_lookup_symbol".}
+proc g_scanner_unexp_token*(scanner: PGScanner, expected_token: TGTokenType,
+                            identifier_spec: cstring, symbol_spec: cstring,
+                            symbol_name: cstring, `message`: cstring,
+                            is_error: gint){.cdecl, dynlib: gliblib,
+    importc: "g_scanner_unexp_token".}
+proc G_SHELL_ERROR*(): TGQuark
+type
+  PGShellError* = ptr TGShellError
+  TGShellError* = enum
+    G_SHELL_ERROR_BAD_QUOTING, G_SHELL_ERROR_EMPTY_STRING, G_SHELL_ERROR_FAILED
+
+proc g_shell_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+                                      importc: "g_shell_error_quark".}
+proc g_shell_quote*(unquoted_string: cstring): cstring{.cdecl, dynlib: gliblib,
+    importc: "g_shell_quote".}
+proc g_shell_unquote*(quoted_string: cstring, error: pointer): cstring{.cdecl,
+    dynlib: gliblib, importc: "g_shell_unquote".}
+proc g_shell_parse_argv*(command_line: cstring, argcp: Pgint, argvp: PPPgchar,
+                         error: pointer): gboolean{.cdecl, dynlib: gliblib,
+    importc: "g_shell_parse_argv".}
+proc G_SPAWN_ERROR*(): TGQuark
+type
+  PGSpawnError* = ptr TGSpawnError
+  TGSpawnError* = enum
+    G_SPAWN_ERROR_FORK, G_SPAWN_ERROR_READ, G_SPAWN_ERROR_CHDIR,
+    G_SPAWN_ERROR_ACCES, G_SPAWN_ERROR_PERM, G_SPAWN_ERROR_2BIG,
+    G_SPAWN_ERROR_NOEXEC, G_SPAWN_ERROR_NAMETOOLONG, G_SPAWN_ERROR_NOENT,
+    G_SPAWN_ERROR_NOMEM, G_SPAWN_ERROR_NOTDIR, G_SPAWN_ERROR_LOOP,
+    G_SPAWN_ERROR_TXTBUSY, G_SPAWN_ERROR_IO, G_SPAWN_ERROR_NFILE,
+    G_SPAWN_ERROR_MFILE, G_SPAWN_ERROR_INVAL, G_SPAWN_ERROR_ISDIR,
+    G_SPAWN_ERROR_LIBBAD, G_SPAWN_ERROR_FAILED
+  TGSpawnChildSetupFunc* = proc (user_data: gpointer){.cdecl.}
+  PGSpawnFlags* = ptr TGSpawnFlags
+  TGSpawnFlags* = int
+
+const
+  G_SPAWN_LEAVE_DESCRIPTORS_OPEN* = 1 shl 0
+  G_SPAWN_DO_NOT_REAP_CHILD* = 1 shl 1
+  G_SPAWN_SEARCH_PATH* = 1 shl 2
+  G_SPAWN_STDOUT_TO_DEV_NULL* = 1 shl 3
+  G_SPAWN_STDERR_TO_DEV_NULL* = 1 shl 4
+  G_SPAWN_CHILD_INHERITS_STDIN* = 1 shl 5
+  G_SPAWN_FILE_AND_ARGV_ZERO* = 1 shl 6
+
+proc g_spawn_error_quark*(): TGQuark{.cdecl, dynlib: gliblib,
+                                      importc: "g_spawn_error_quark".}
+proc g_spawn_async*(working_directory: cstring, argv: PPgchar, envp: PPgchar,
+                    flags: TGSpawnFlags, child_setup: TGSpawnChildSetupFunc,
+                    user_data: gpointer, child_pid: Pgint, error: pointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_spawn_async".}
+proc g_spawn_async_with_pipes*(working_directory: cstring, argv: PPgchar,
+                               envp: PPgchar, flags: TGSpawnFlags,
+                               child_setup: TGSpawnChildSetupFunc,
+                               user_data: gpointer, child_pid: Pgint,
+                               standard_input: Pgint, standard_output: Pgint,
+                               standard_error: Pgint, error: pointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_spawn_async_with_pipes".}
+proc g_spawn_sync*(working_directory: cstring, argv: PPgchar, envp: PPgchar,
+                   flags: TGSpawnFlags, child_setup: TGSpawnChildSetupFunc,
+                   user_data: gpointer, standard_output: PPgchar,
+                   standard_error: PPgchar, exit_status: Pgint, error: pointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_spawn_sync".}
+proc g_spawn_command_line_sync*(command_line: cstring, standard_output: PPgchar,
+                                standard_error: PPgchar, exit_status: Pgint,
+                                error: pointer): gboolean{.cdecl,
+    dynlib: gliblib, importc: "g_spawn_command_line_sync".}
+proc g_spawn_command_line_async*(command_line: cstring, error: pointer): gboolean{.
+    cdecl, dynlib: gliblib, importc: "g_spawn_command_line_async".}
+proc G_TYPE_IS_BOXED*(theType: GType): gboolean
+proc G_VALUE_HOLDS_BOXED*(value: PGValue): gboolean
+proc G_TYPE_CLOSURE*(): GType
+proc G_TYPE_VALUE*(): GType
+proc G_TYPE_VALUE_ARRAY*(): GType
+proc G_TYPE_GSTRING*(): GType
+proc g_boxed_copy*(boxed_type: GType, src_boxed: gconstpointer): gpointer{.
+    cdecl, dynlib: gobjectlib, importc: "g_boxed_copy".}
+proc g_boxed_free*(boxed_type: GType, boxed: gpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_boxed_free".}
+proc g_value_set_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_boxed".}
+proc g_value_set_static_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_value_set_static_boxed".}
+proc g_value_get_boxed*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_get_boxed".}
+proc g_value_dup_boxed*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib,
+    importc: "g_value_dup_boxed".}
+proc g_boxed_type_register_static*(name: cstring, boxed_copy: TGBoxedCopyFunc,
+                                   boxed_free: TGBoxedFreeFunc): GType{.cdecl,
+    dynlib: gobjectlib, importc: "g_boxed_type_register_static".}
+proc g_value_set_boxed_take_ownership*(value: PGValue, v_boxed: gconstpointer){.
+    cdecl, dynlib: gobjectlib, importc: "g_value_set_boxed_take_ownership".}
+proc g_closure_get_type*(): GType{.cdecl, dynlib: gobjectlib,
+                                   importc: "g_closure_get_type".}
+proc g_value_get_type*(): GType{.cdecl, dynlib: gobjectlib,
+                                 importc: "g_value_get_type".}
+proc g_value_array_get_type*(): GType{.cdecl, dynlib: gobjectlib,
+                                       importc: "g_value_array_get_type".}
+proc g_gstring_get_type*(): GType{.cdecl, dynlib: gobjectlib,
+                                   importc: "g_gstring_get_type".}
+type
+  PGModule* = pointer
+  TGModuleFlags* = int32
+  TGModuleCheckInit* = proc (module: PGModule): cstring{.cdecl.}
+  TGModuleUnload* = proc (module: PGModule){.cdecl.}
+
+const
+  G_MODULE_BIND_LAZY* = 1 shl 0
+  G_MODULE_BIND_MASK* = 1
+
+proc g_module_supported*(): gboolean{.cdecl, dynlib: gmodulelib,
+                                      importc: "g_module_supported".}
+proc g_module_open*(file_name: cstring, flags: TGModuleFlags): PGModule{.cdecl,
+    dynlib: gmodulelib, importc: "g_module_open".}
+proc g_module_close*(module: PGModule): gboolean{.cdecl, dynlib: gmodulelib,
+    importc: "g_module_close".}
+proc g_module_make_resident*(module: PGModule){.cdecl, dynlib: gmodulelib,
+    importc: "g_module_make_resident".}
+proc g_module_error*(): cstring{.cdecl, dynlib: gmodulelib,
+                                 importc: "g_module_error".}
+proc g_module_symbol*(module: PGModule, symbol_name: cstring, symbol: Pgpointer): gboolean{.
+    cdecl, dynlib: gmodulelib, importc: "g_module_symbol".}
+proc g_module_name*(module: PGModule): cstring{.cdecl, dynlib: gmodulelib,
+    importc: "g_module_name".}
+proc g_module_build_path*(directory: cstring, module_name: cstring): cstring{.
+    cdecl, dynlib: gmodulelib, importc: "g_module_build_path".}
+proc g_cclosure_marshal_VOID__VOID*(closure: PGClosure, return_value: PGValue,
+                                    n_param_values: GUInt,
+                                    param_values: PGValue,
+                                    invocation_hint: GPointer,
+                                    marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__VOID".}
+proc g_cclosure_marshal_VOID__BOOLEAN*(closure: PGClosure,
+                                       return_value: PGValue,
+                                       n_param_values: GUInt,
+                                       param_values: PGValue,
+                                       invocation_hint: GPointer,
+                                       marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__BOOLEAN".}
+proc g_cclosure_marshal_VOID__CHAR*(closure: PGClosure, return_value: PGValue,
+                                    n_param_values: GUInt,
+                                    param_values: PGValue,
+                                    invocation_hint: GPointer,
+                                    marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__CHAR".}
+proc g_cclosure_marshal_VOID__UCHAR*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UCHAR".}
+proc g_cclosure_marshal_VOID__INT*(closure: PGClosure, return_value: PGValue,
+                                   n_param_values: GUInt, param_values: PGValue,
+                                   invocation_hint: GPointer,
+                                   marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__INT".}
+proc g_cclosure_marshal_VOID__UINT*(closure: PGClosure, return_value: PGValue,
+                                    n_param_values: GUInt,
+                                    param_values: PGValue,
+                                    invocation_hint: GPointer,
+                                    marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UINT".}
+proc g_cclosure_marshal_VOID__LONG*(closure: PGClosure, return_value: PGValue,
+                                    n_param_values: GUInt,
+                                    param_values: PGValue,
+                                    invocation_hint: GPointer,
+                                    marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__LONG".}
+proc g_cclosure_marshal_VOID__ULONG*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__ULONG".}
+proc g_cclosure_marshal_VOID__ENUM*(closure: PGClosure, return_value: PGValue,
+                                    n_param_values: GUInt,
+                                    param_values: PGValue,
+                                    invocation_hint: GPointer,
+                                    marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__ENUM".}
+proc g_cclosure_marshal_VOID__FLAGS*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__FLAGS".}
+proc g_cclosure_marshal_VOID__FLOAT*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__FLOAT".}
+proc g_cclosure_marshal_VOID__DOUBLE*(closure: PGClosure, return_value: PGValue,
+                                      n_param_values: GUInt,
+                                      param_values: PGValue,
+                                      invocation_hint: GPointer,
+                                      marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__DOUBLE".}
+proc g_cclosure_marshal_VOID__STRING*(closure: PGClosure, return_value: PGValue,
+                                      n_param_values: GUInt,
+                                      param_values: PGValue,
+                                      invocation_hint: GPointer,
+                                      marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__STRING".}
+proc g_cclosure_marshal_VOID__PARAM*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__PARAM".}
+proc g_cclosure_marshal_VOID__BOXED*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__BOXED".}
+proc g_cclosure_marshal_VOID__POINTER*(closure: PGClosure,
+                                       return_value: PGValue,
+                                       n_param_values: GUInt,
+                                       param_values: PGValue,
+                                       invocation_hint: GPointer,
+                                       marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__POINTER".}
+proc g_cclosure_marshal_VOID__OBJECT*(closure: PGClosure, return_value: PGValue,
+                                      n_param_values: GUInt,
+                                      param_values: PGValue,
+                                      invocation_hint: GPointer,
+                                      marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__OBJECT".}
+proc g_cclosure_marshal_STRING__OBJECT_POINTER*(closure: PGClosure,
+    return_value: PGValue, n_param_values: GUInt, param_values: PGValue,
+    invocation_hint: GPointer, marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_STRING__OBJECT_POINTER".}
+proc g_cclosure_marshal_VOID__UINT_POINTER*(closure: PGClosure,
+    return_value: PGValue, n_param_values: GUInt, param_values: PGValue,
+    invocation_hint: GPointer, marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UINT_POINTER".}
+proc g_cclosure_marshal_BOOLEAN__FLAGS*(closure: PGClosure,
+                                        return_value: PGValue,
+                                        n_param_values: GUInt,
+                                        param_values: PGValue,
+                                        invocation_hint: GPointer,
+                                        marshal_data: GPointer){.cdecl,
+    dynlib: gobjectlib, importc: "g_cclosure_marshal_BOOLEAN__FLAGS".}
+proc g_cclosure_marshal_BOOL__FLAGS*(closure: PGClosure, return_value: PGValue,
+                                     n_param_values: GUInt,
+                                     param_values: PGValue,
+                                     invocation_hint: GPointer,
+                                     marshal_data: GPointer){.cdecl,
+    dynlib: gliblib, importc: "g_cclosure_marshal_BOOLEAN__FLAGS".}
+proc GUINT16_SWAP_LE_BE_CONSTANT*(val: guint16): guint16 =
+  Result = ((val and 0x000000FF) shl 8) or ((val and 0x0000FF00) shr 8)
+
+proc GUINT32_SWAP_LE_BE_CONSTANT*(val: guint32): guint32 =
+  Result = ((val and 0x000000FF) shl 24) or ((val and 0x0000FF00) shl 8) or
+      ((val and 0x00FF0000) shr 8) or ((val and 0xFF000000) shr 24)
+
+proc GUINT_TO_POINTER*(i: guint): pointer =
+  Result = cast[Pointer](TAddress(i))
+
+type
+  PGArray = pointer
+
+when false:
+  proc g_array_append_val*(a: PGArray, v: gpointer): PGArray =
+    result = g_array_append_vals(a, addr(v), 1)
+
+  proc g_array_prepend_val*(a: PGArray, v: gpointer): PGArray =
+    result = g_array_prepend_vals(a, addr(v), 1)
+
+  proc g_array_insert_val*(a: PGArray, i: guint, v: gpointer): PGArray =
+    result = g_array_insert_vals(a, i, addr(v), 1)
+
+  proc g_ptr_array_index*(parray: PGPtrArray, index: guint): gpointer =
+    result = cast[PGPointer](cast[int](parray ^. pdata) +
+        index * SizeOf(GPointer))^
+
+  proc G_THREAD_ERROR*(): TGQuark =
+    result = g_thread_error_quark()
+
+  proc g_mutex_lock*(mutex: PGMutex) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.mutex_lock(mutex)
+
+  proc g_mutex_trylock*(mutex: PGMutex): gboolean =
+    if g_threads_got_initialized:
+      result = g_thread_functions_for_glib_use.mutex_trylock(mutex)
+    else:
+      result = true
+
+  proc g_mutex_unlock*(mutex: PGMutex) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.mutex_unlock(mutex)
+
+  proc g_mutex_free*(mutex: PGMutex) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.mutex_free(mutex)
+
+  proc g_cond_wait*(cond: PGCond, mutex: PGMutex) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.cond_wait(cond, mutex)
+
+  proc g_cond_timed_wait*(cond: PGCond, mutex: PGMutex, end_time: PGTimeVal): gboolean =
+    if g_threads_got_initialized:
+      result = g_thread_functions_for_glib_use.cond_timed_wait(cond, mutex,
+          end_time)
+    else:
+      result = true
+
+  proc g_thread_supported*(): gboolean =
+    result = g_threads_got_initialized
+
+  proc g_mutex_new*(): PGMutex =
+    result = g_thread_functions_for_glib_use.mutex_new()
+
+  proc g_cond_new*(): PGCond =
+    result = g_thread_functions_for_glib_use.cond_new()
+
+  proc g_cond_signal*(cond: PGCond) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.cond_signal(cond)
+
+  proc g_cond_broadcast*(cond: PGCond) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.cond_broadcast(cond)
+
+  proc g_cond_free*(cond: PGCond) =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.cond_free(cond)
+
+  proc g_private_new*(dest: TGDestroyNotify): PGPrivate =
+    result = g_thread_functions_for_glib_use.private_new(dest)
+
+  proc g_private_get*(private_key: PGPrivate): gpointer =
+    if g_threads_got_initialized:
+      result = g_thread_functions_for_glib_use.private_get(private_key)
+    else:
+      result = private_key
+
+  proc g_private_set*(private_key: var PGPrivate, data: gpointer) =
+    if g_threads_got_initialized:
+      nil
+    else:
+      private_key = data
+
+  proc g_thread_yield*() =
+    if g_threads_got_initialized:
+      g_thread_functions_for_glib_use.thread_yield
+
+  proc g_thread_create*(func: TGThreadFunc, data: gpointer, joinable: gboolean,
+                        error: pointer): PGThread =
+    result = g_thread_create_full(func, data, 0, joinable, false,
+                                  G_THREAD_PRIORITY_NORMAL, error)
+
+  proc g_static_mutex_get_mutex*(mutex: PPGMutex): PGMutex =
+    result = g_static_mutex_get_mutex_impl(mutex)
+
+  proc g_static_mutex_lock*(mutex: PGStaticMutex) =
+    g_mutex_lock(g_static_mutex_get_mutex_impl(PPGMutex(mutex)))
+
+  proc g_static_mutex_trylock*(mutex: PGStaticMutex): gboolean =
+    result = g_mutex_trylock(g_static_mutex_get_mutex(PPGMutex(mutex)))
+
+  proc g_static_mutex_unlock*(mutex: PGStaticMutex) =
+    g_mutex_unlock(g_static_mutex_get_mutex_impl(PPGMutex(mutex)))
+
+  proc g_main_new*(is_running: gboolean): PGMainLoop =
+    result = g_main_loop_new(nil, is_running)
+
+  proc g_main_iteration*(may_block: gboolean): gboolean =
+    result = g_main_context_iteration(nil, may_block)
+
+  proc g_main_pending*(): gboolean =
+    result = g_main_context_pending(nil)
+
+  proc g_main_set_poll_func*(func: TGPollFunc) =
+    g_main_context_set_poll_func(nil, func)
+
+proc g_slist_next*(slist: PGSList): PGSList =
+  if slist != nil:
+    result = slist.next
+  else:
+    result = nil
+
+proc g_new*(bytes_per_struct, n_structs: int): gpointer =
+  result = g_malloc(n_structs * bytes_per_struct)
+
+proc g_new0*(bytes_per_struct, n_structs: int): gpointer =
+  result = g_malloc0(n_structs * bytes_per_struct)
+
+proc g_renew*(struct_size: int, OldMem: gpointer, n_structs: int): gpointer =
+  result = g_realloc(OldMem, struct_size * n_structs)
+
+proc g_chunk_new*(chunk: Pointer): Pointer =
+  result = g_mem_chunk_alloc(chunk)
+
+proc g_chunk_new0*(chunk: Pointer): Pointer =
+  result = g_mem_chunk_alloc0(chunk)
+
+proc g_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer) =
+  g_mem_chunk_free(mem_chunk, mem)
+
+proc g_list_previous*(list: PGList): PGList =
+  if list != nil:
+    result = list.prev
+  else:
+    result = nil
+
+proc g_list_next*(list: PGList): PGList =
+  if list != nil:
+    result = list.next
+  else:
+    result = nil
+
+proc G_CONVERT_ERROR*(): TGQuark =
+  result = g_convert_error_quark()
+
+proc g_datalist_id_set_data*(datalist: PPGData, key_id: TGQuark, data: gpointer) =
+  g_datalist_id_set_data_full(datalist, key_id, data, TGDestroyNotify(nil))
+
+proc g_datalist_id_remove_data*(datalist: PPGData, key_id: TGQuark) =
+  g_datalist_id_set_data(datalist, key_id, nil)
+
+proc g_datalist_get_data*(datalist: PPGData, key_str: cstring): PPGData =
+  result = cast[PPGData](g_datalist_id_get_data(datalist,
+                                                g_quark_try_string(key_str)))
+
+proc g_datalist_set_data_full*(datalist: PPGData, key_str: cstring,
+                               data: gpointer, destroy_func: TGDestroyNotify) =
+  g_datalist_id_set_data_full(datalist, g_quark_from_string(key_str), data,
+                              destroy_func)
+
+proc g_datalist_set_data*(datalist: PPGData, key_str: cstring, data: gpointer) =
+  g_datalist_set_data_full(datalist, key_str, data, nil)
+
+proc g_datalist_remove_no_notify*(datalist: PPGData, key_str: cstring) =
+  discard g_datalist_id_remove_no_notify(datalist, g_quark_try_string(key_str))
+
+proc g_datalist_remove_data*(datalist: PPGData, key_str: cstring) =
+  g_datalist_id_set_data(datalist, g_quark_try_string(key_str), nil)
+
+proc g_dataset_id_set_data*(location: gconstpointer, key_id: TGQuark,
+                            data: gpointer) =
+  g_dataset_id_set_data_full(location, key_id, data, nil)
+
+proc g_dataset_id_remove_data*(location: gconstpointer, key_id: TGQuark) =
+  g_dataset_id_set_data(location, key_id, nil)
+
+proc g_dataset_get_data*(location: gconstpointer, key_str: cstring): gpointer =
+  result = g_dataset_id_get_data(location, g_quark_try_string(key_str))
+
+proc g_dataset_set_data_full*(location: gconstpointer, key_str: cstring,
+                              data: gpointer, destroy_func: TGDestroyNotify) =
+  g_dataset_id_set_data_full(location, g_quark_from_string(key_str), data,
+                             destroy_func)
+
+proc g_dataset_remove_no_notify*(location: gconstpointer, key_str: cstring) =
+  discard g_dataset_id_remove_no_notify(location, g_quark_try_string(key_str))
+
+proc g_dataset_set_data*(location: gconstpointer, key_str: cstring,
+                         data: gpointer) =
+  g_dataset_set_data_full(location, key_str, data, nil)
+
+proc g_dataset_remove_data*(location: gconstpointer, key_str: cstring) =
+  g_dataset_id_set_data(location, g_quark_try_string(key_str), nil)
+
+proc G_FILE_ERROR*(): TGQuark =
+  result = g_file_error_quark()
+
+proc TGHookList_hook_size*(a: var TGHookList): guint =
+  result = (a.flag0 and bm_TGHookList_hook_size) shr bp_TGHookList_hook_size
+
+proc TGHookList_set_hook_size*(a: var TGHookList, `hook_size`: guint) =
+  a.flag0 = a.flag0 or
+      ((`hook_size` shl bp_TGHookList_hook_size) and bm_TGHookList_hook_size)
+
+proc TGHookList_is_setup*(a: var TGHookList): guint =
+  result = (a.flag0 and bm_TGHookList_is_setup) shr bp_TGHookList_is_setup
+
+proc TGHookList_set_is_setup*(a: var TGHookList, `is_setup`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_setup` shl bp_TGHookList_is_setup) and bm_TGHookList_is_setup)
+
+proc G_HOOK*(hook: pointer): PGHook =
+  result = cast[PGHook](hook)
+
+proc G_HOOK_FLAGS*(hook: PGHook): guint =
+  result = hook.flags
+
+proc G_HOOK_ACTIVE*(hook: PGHook): bool =
+  result = (hook.flags and G_HOOK_FLAG_ACTIVE) != 0
+
+proc G_HOOK_IN_CALL*(hook: PGHook): bool =
+  result = (hook.flags and G_HOOK_FLAG_IN_CALL) != 0
+
+proc G_HOOK_IS_VALID*(hook: PGHook): bool =
+  result = (hook.hook_id != 0) and G_HOOK_ACTIVE(hook)
+
+proc G_HOOK_IS_UNLINKED*(hook: PGHook): bool =
+  result = (hook.next == nil) and (hook.prev == nil) and
+      (hook.hook_id == 0) and (hook.ref_count == 0)
+
+proc g_hook_append*(hook_list: PGHookList, hook: PGHook) =
+  g_hook_insert_before(hook_list, nil, hook)
+
+proc G_IO_CHANNEL_ERROR*(): TGQuark =
+  result = g_io_channel_error_quark()
+
+proc TGIOChannel_use_buffer*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_use_buffer) shr
+      bp_TGIOChannel_use_buffer
+
+proc TGIOChannel_set_use_buffer*(a: var TGIOChannel, `use_buffer`: guint) =
+  a.flag0 = a.flag0 or
+      ((`use_buffer` shl bp_TGIOChannel_use_buffer) and
+      bm_TGIOChannel_use_buffer)
+
+proc TGIOChannel_do_encode*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_do_encode) shr
+      bp_TGIOChannel_do_encode
+
+proc TGIOChannel_set_do_encode*(a: var TGIOChannel, `do_encode`: guint) =
+  a.flag0 = a.flag0 or
+      ((`do_encode` shl bp_TGIOChannel_do_encode) and
+      bm_TGIOChannel_do_encode)
+
+proc TGIOChannel_close_on_unref*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_close_on_unref) shr
+      bp_TGIOChannel_close_on_unref
+
+proc TGIOChannel_set_close_on_unref*(a: var TGIOChannel, `close_on_unref`: guint) =
+  a.flag0 = a.flag0 or
+      ((`close_on_unref` shl bp_TGIOChannel_close_on_unref) and
+      bm_TGIOChannel_close_on_unref)
+
+proc TGIOChannel_is_readable*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_is_readable) shr
+      bp_TGIOChannel_is_readable
+
+proc TGIOChannel_set_is_readable*(a: var TGIOChannel, `is_readable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_readable` shl bp_TGIOChannel_is_readable) and
+      bm_TGIOChannel_is_readable)
+
+proc TGIOChannel_is_writeable*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_is_writeable) shr
+      bp_TGIOChannel_is_writeable
+
+proc TGIOChannel_set_is_writeable*(a: var TGIOChannel, `is_writeable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_writeable` shl bp_TGIOChannel_is_writeable) and
+      bm_TGIOChannel_is_writeable)
+
+proc TGIOChannel_is_seekable*(a: var TGIOChannel): guint =
+  result = (a.flag0 and bm_TGIOChannel_is_seekable) shr
+      bp_TGIOChannel_is_seekable
+
+proc TGIOChannel_set_is_seekable*(a: var TGIOChannel, `is_seekable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_seekable` shl bp_TGIOChannel_is_seekable) and
+      bm_TGIOChannel_is_seekable)
+
+proc g_utf8_next_char*(p: pguchar): pguchar =
+  result = cast[pguchar](cast[TAddress](p)+1) # p + ord((g_utf8_skip + p^ )^ )
+
+when false:
+  proc GLIB_CHECK_VERSION*(major, minor, micro: guint): bool =
+    result = ((GLIB_MAJOR_VERSION > major) or
+        ((GLIB_MAJOR_VERSION == major) and (GLIB_MINOR_VERSION > minor)) or
+        ((GLIB_MAJOR_VERSION == major) and (GLIB_MINOR_VERSION == minor) and
+        (GLIB_MICRO_VERSION >= micro)))
+
+  proc g_error*(format: cstring) =
+    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format)
+
+  proc g_message*(format: cstring) =
+    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format)
+
+  proc g_critical*(format: cstring) =
+    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format)
+
+  proc g_warning*(format: cstring) =
+    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format)
+
+proc G_MARKUP_ERROR*(): TGQuark =
+  result = g_markup_error_quark()
+
+proc G_NODE_IS_ROOT*(node: PGNode): bool =
+  result = (node . parent == nil) and (node . next == nil) and
+      (node . prev == nil)
+
+proc G_NODE_IS_LEAF*(node: PGNode): bool =
+  result = node . children == nil
+
+proc g_node_append*(parent: PGNode, node: PGNode): PGNode =
+  result = g_node_insert_before(parent, nil, node)
+
+proc g_node_insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode =
+  result = g_node_insert(parent, position, g_node_new(data))
+
+proc g_node_insert_data_before*(parent: PGNode, sibling: PGNode, data: gpointer): PGNode =
+  result = g_node_insert_before(parent, sibling, g_node_new(data))
+
+proc g_node_prepend_data*(parent: PGNode, data: gpointer): PGNode =
+  result = g_node_prepend(parent, g_node_new(data))
+
+proc g_node_append_data*(parent: PGNode, data: gpointer): PGNode =
+  result = g_node_insert_before(parent, nil, g_node_new(data))
+
+proc g_node_prev_sibling*(node: PGNode): PGNode =
+  if node != nil:
+    result = node.prev
+  else:
+    result = nil
+
+proc g_node_next_sibling*(node: PGNode): PGNode =
+  if node != nil:
+    result = node.next
+  else:
+    result = nil
+
+proc g_node_first_child*(node: PGNode): PGNode =
+  if node != nil:
+    result = node.children
+  else:
+    result = nil
+
+proc g_rand_boolean*(rand: PGRand): gboolean =
+  result = ((g_rand_int(rand)) and (1 shl 15)) != 0
+
+proc g_random_boolean*(): gboolean =
+  result = (g_random_int() and (1 shl 15)) != 0
+
+proc TGScannerConfig_case_sensitive*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_case_sensitive) shr
+      bp_TGScannerConfig_case_sensitive
+
+proc TGScannerConfig_set_case_sensitive*(a: var TGScannerConfig,
+    `case_sensitive`: guint) =
+  a.flag0 = a.flag0 or
+      ((`case_sensitive` shl bp_TGScannerConfig_case_sensitive) and
+      bm_TGScannerConfig_case_sensitive)
+
+proc TGScannerConfig_skip_comment_multi*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_skip_comment_multi) shr
+      bp_TGScannerConfig_skip_comment_multi
+
+proc TGScannerConfig_set_skip_comment_multi*(a: var TGScannerConfig,
+    `skip_comment_multi`: guint) =
+  a.flag0 = a.flag0 or
+      ((`skip_comment_multi` shl bp_TGScannerConfig_skip_comment_multi) and
+      bm_TGScannerConfig_skip_comment_multi)
+
+proc TGScannerConfig_skip_comment_single*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_skip_comment_single) shr
+      bp_TGScannerConfig_skip_comment_single
+
+proc TGScannerConfig_set_skip_comment_single*(a: var TGScannerConfig,
+    `skip_comment_single`: guint) =
+  a.flag0 = a.flag0 or
+      ((`skip_comment_single` shl bp_TGScannerConfig_skip_comment_single) and
+      bm_TGScannerConfig_skip_comment_single)
+
+proc TGScannerConfig_scan_comment_multi*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_comment_multi) shr
+      bp_TGScannerConfig_scan_comment_multi
+
+proc TGScannerConfig_set_scan_comment_multi*(a: var TGScannerConfig,
+    `scan_comment_multi`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_comment_multi` shl bp_TGScannerConfig_scan_comment_multi) and
+      bm_TGScannerConfig_scan_comment_multi)
+
+proc TGScannerConfig_scan_identifier*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_identifier) shr
+      bp_TGScannerConfig_scan_identifier
+
+proc TGScannerConfig_set_scan_identifier*(a: var TGScannerConfig,
+    `scan_identifier`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_identifier` shl bp_TGScannerConfig_scan_identifier) and
+      bm_TGScannerConfig_scan_identifier)
+
+proc TGScannerConfig_scan_identifier_1char*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_identifier_1char) shr
+      bp_TGScannerConfig_scan_identifier_1char
+
+proc TGScannerConfig_set_scan_identifier_1char*(a: var TGScannerConfig,
+    `scan_identifier_1char`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_identifier_1char` shl bp_TGScannerConfig_scan_identifier_1char) and
+      bm_TGScannerConfig_scan_identifier_1char)
+
+proc TGScannerConfig_scan_identifier_NULL*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_identifier_NULL) shr
+      bp_TGScannerConfig_scan_identifier_NULL
+
+proc TGScannerConfig_set_scan_identifier_NULL*(a: var TGScannerConfig,
+    `scan_identifier_NULL`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_identifier_NULL` shl bp_TGScannerConfig_scan_identifier_NULL) and
+      bm_TGScannerConfig_scan_identifier_NULL)
+
+proc TGScannerConfig_scan_symbols*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_symbols) shr
+      bp_TGScannerConfig_scan_symbols
+
+proc TGScannerConfig_set_scan_symbols*(a: var TGScannerConfig,
+                                       `scan_symbols`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_symbols` shl bp_TGScannerConfig_scan_symbols) and
+      bm_TGScannerConfig_scan_symbols)
+
+proc TGScannerConfig_scan_binary*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_binary) shr
+      bp_TGScannerConfig_scan_binary
+
+proc TGScannerConfig_set_scan_binary*(a: var TGScannerConfig,
+                                      `scan_binary`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_binary` shl bp_TGScannerConfig_scan_binary) and
+      bm_TGScannerConfig_scan_binary)
+
+proc TGScannerConfig_scan_octal*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_octal) shr
+      bp_TGScannerConfig_scan_octal
+
+proc TGScannerConfig_set_scan_octal*(a: var TGScannerConfig, `scan_octal`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_octal` shl bp_TGScannerConfig_scan_octal) and
+      bm_TGScannerConfig_scan_octal)
+
+proc TGScannerConfig_scan_float*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_float) shr
+      bp_TGScannerConfig_scan_float
+
+proc TGScannerConfig_set_scan_float*(a: var TGScannerConfig, `scan_float`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_float` shl bp_TGScannerConfig_scan_float) and
+      bm_TGScannerConfig_scan_float)
+
+proc TGScannerConfig_scan_hex*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_hex) shr
+      bp_TGScannerConfig_scan_hex
+
+proc TGScannerConfig_set_scan_hex*(a: var TGScannerConfig, `scan_hex`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_hex` shl bp_TGScannerConfig_scan_hex) and
+      bm_TGScannerConfig_scan_hex)
+
+proc TGScannerConfig_scan_hex_dollar*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_hex_dollar) shr
+      bp_TGScannerConfig_scan_hex_dollar
+
+proc TGScannerConfig_set_scan_hex_dollar*(a: var TGScannerConfig,
+    `scan_hex_dollar`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_hex_dollar` shl bp_TGScannerConfig_scan_hex_dollar) and
+      bm_TGScannerConfig_scan_hex_dollar)
+
+proc TGScannerConfig_scan_string_sq*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_string_sq) shr
+      bp_TGScannerConfig_scan_string_sq
+
+proc TGScannerConfig_set_scan_string_sq*(a: var TGScannerConfig,
+    `scan_string_sq`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_string_sq` shl bp_TGScannerConfig_scan_string_sq) and
+      bm_TGScannerConfig_scan_string_sq)
+
+proc TGScannerConfig_scan_string_dq*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scan_string_dq) shr
+      bp_TGScannerConfig_scan_string_dq
+
+proc TGScannerConfig_set_scan_string_dq*(a: var TGScannerConfig,
+    `scan_string_dq`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scan_string_dq` shl bp_TGScannerConfig_scan_string_dq) and
+      bm_TGScannerConfig_scan_string_dq)
+
+proc TGScannerConfig_numbers_2_int*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_numbers_2_int) shr
+      bp_TGScannerConfig_numbers_2_int
+
+proc TGScannerConfig_set_numbers_2_int*(a: var TGScannerConfig,
+                                        `numbers_2_int`: guint) =
+  a.flag0 = a.flag0 or
+      ((`numbers_2_int` shl bp_TGScannerConfig_numbers_2_int) and
+      bm_TGScannerConfig_numbers_2_int)
+
+proc TGScannerConfig_int_2_float*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_int_2_float) shr
+      bp_TGScannerConfig_int_2_float
+
+proc TGScannerConfig_set_int_2_float*(a: var TGScannerConfig,
+                                      `int_2_float`: guint) =
+  a.flag0 = a.flag0 or
+      ((`int_2_float` shl bp_TGScannerConfig_int_2_float) and
+      bm_TGScannerConfig_int_2_float)
+
+proc TGScannerConfig_identifier_2_string*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_identifier_2_string) shr
+      bp_TGScannerConfig_identifier_2_string
+
+proc TGScannerConfig_set_identifier_2_string*(a: var TGScannerConfig,
+    `identifier_2_string`: guint) =
+  a.flag0 = a.flag0 or
+      ((`identifier_2_string` shl bp_TGScannerConfig_identifier_2_string) and
+      bm_TGScannerConfig_identifier_2_string)
+
+proc TGScannerConfig_char_2_token*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_char_2_token) shr
+      bp_TGScannerConfig_char_2_token
+
+proc TGScannerConfig_set_char_2_token*(a: var TGScannerConfig,
+                                       `char_2_token`: guint) =
+  a.flag0 = a.flag0 or
+      ((`char_2_token` shl bp_TGScannerConfig_char_2_token) and
+      bm_TGScannerConfig_char_2_token)
+
+proc TGScannerConfig_symbol_2_token*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_symbol_2_token) shr
+      bp_TGScannerConfig_symbol_2_token
+
+proc TGScannerConfig_set_symbol_2_token*(a: var TGScannerConfig,
+    `symbol_2_token`: guint) =
+  a.flag0 = a.flag0 or
+      ((`symbol_2_token` shl bp_TGScannerConfig_symbol_2_token) and
+      bm_TGScannerConfig_symbol_2_token)
+
+proc TGScannerConfig_scope_0_fallback*(a: var TGScannerConfig): guint =
+  result = (a.flag0 and bm_TGScannerConfig_scope_0_fallback) shr
+      bp_TGScannerConfig_scope_0_fallback
+
+proc TGScannerConfig_set_scope_0_fallback*(a: var TGScannerConfig,
+    `scope_0_fallback`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scope_0_fallback` shl bp_TGScannerConfig_scope_0_fallback) and
+      bm_TGScannerConfig_scope_0_fallback)
+
+proc g_scanner_freeze_symbol_table*(scanner: PGScanner) =
+  if Scanner == nil: nil
+
+proc g_scanner_thaw_symbol_table*(scanner: PGScanner) =
+  if Scanner == nil: nil
+
+proc G_SHELL_ERROR*(): TGQuark =
+  result = g_shell_error_quark()
+
+proc G_SPAWN_ERROR*(): TGQuark =
+  result = g_spawn_error_quark()
+
+when false:
+  proc g_ascii_isalnum*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_ALNUM) != 0
+
+  proc g_ascii_isalpha*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_ALPHA) != 0
+
+  proc g_ascii_iscntrl*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_CNTRL) != 0
+
+  proc g_ascii_isdigit*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_DIGIT) != 0
+
+  proc g_ascii_isgraph*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_GRAPH) != 0
+
+  proc g_ascii_islower*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_LOWER) != 0
+
+  proc g_ascii_isprint*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_PRINT) != 0
+
+  proc g_ascii_ispunct*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_PUNCT) != 0
+
+  proc g_ascii_isspace*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_SPACE) != 0
+
+  proc g_ascii_isupper*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_UPPER) != 0
+
+  proc g_ascii_isxdigit*(c: gchar): bool =
+    result = ((g_ascii_table[guchar(c)]) and G_ASCII_XDIGIT) != 0
+
+  proc g_strstrip*(str: cstring): cstring =
+    result = g_strchomp(g_strchug(str))
+
+proc G_TYPE_MAKE_FUNDAMENTAL*(x: int32): GType =
+  result = GType(x shl G_TYPE_FUNDAMENTAL_SHIFT)
+
+proc G_TYPE_IS_FUNDAMENTAL*(theType: GType): bool =
+  result = theType <= G_TYPE_FUNDAMENTAL_MAX
+
+proc G_TYPE_IS_DERIVED*(theType: GType): bool =
+  result = theType > G_TYPE_FUNDAMENTAL_MAX
+
+proc G_TYPE_IS_INTERFACE*(theType: GType): bool =
+  result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_INTERFACE
+
+proc G_TYPE_IS_CLASSED*(theType: GType): gboolean =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_CLASSED)
+
+proc G_TYPE_IS_INSTANTIATABLE*(theType: GType): bool =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_INSTANTIATABLE)
+
+proc G_TYPE_IS_DERIVABLE*(theType: GType): bool =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_DERIVABLE)
+
+proc G_TYPE_IS_DEEP_DERIVABLE*(theType: GType): bool =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_DEEP_DERIVABLE)
+
+proc G_TYPE_IS_ABSTRACT*(theType: GType): bool =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_ABSTRACT)
+
+proc G_TYPE_IS_VALUE_ABSTRACT*(theType: GType): bool =
+  result = private_g_type_test_flags(theType, G_TYPE_FLAG_VALUE_ABSTRACT)
+
+proc G_TYPE_IS_VALUE_TYPE*(theType: GType): bool =
+  result = private_g_type_check_is_value_type(theType)
+
+proc G_TYPE_HAS_VALUE_TABLE*(theType: GType): bool =
+  result = (g_type_value_table_peek(theType)) != nil
+
+proc G_TYPE_CHECK_INSTANCE*(instance: Pointer): gboolean =
+  result = private_g_type_check_instance(cast[PGTypeInstance](instance))
+
+proc G_TYPE_CHECK_INSTANCE_CAST*(instance: Pointer, g_type: GType): PGTypeInstance =
+  result = cast[PGTypeInstance](private_g_type_check_instance_cast(
+                                  cast[PGTypeInstance](instance), g_type))
+
+proc G_TYPE_CHECK_INSTANCE_TYPE*(instance: Pointer, g_type: GType): bool =
+  result = private_g_type_check_instance_is_a(
+             cast[PGTypeInstance](instance), g_type)
+
+proc G_TYPE_INSTANCE_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass =
+  result = cast[PGTypeInstance](Instance).g_class
+  result = private_g_type_check_class_cast(result, g_type)
+
+proc G_TYPE_INSTANCE_GET_INTERFACE*(instance: Pointer, g_type: GType): Pointer =
+  result = g_type_interface_peek((cast[PGTypeInstance](instance)).g_class, g_type)
+
+proc G_TYPE_CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer =
+  result = private_g_type_check_class_cast(cast[PGTypeClass](g_class), g_type)
+
+proc G_TYPE_CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool =
+  result = private_g_type_check_class_is_a(cast[PGTypeClass](g_class), g_type)
+
+proc G_TYPE_CHECK_VALUE*(value: Pointer): bool =
+  result = private_g_type_check_value(cast[PGValue](Value))
+
+proc G_TYPE_CHECK_VALUE_TYPE*(value: pointer, g_type: GType): bool =
+  result = private_g_type_check_value_holds(cast[PGValue](value), g_type)
+
+proc G_TYPE_FROM_INSTANCE*(instance: Pointer): GType =
+  result = G_TYPE_FROM_CLASS((cast[PGTypeInstance](instance)) . g_class)
+
+proc G_TYPE_FROM_CLASS*(g_class: Pointer): GType =
+  result = (cast[PGTypeClass](g_class)) . g_type
+
+proc G_TYPE_FROM_INTERFACE*(g_iface: Pointer): GType =
+  result = (cast[PGTypeInterface](g_iface)) . g_type
+
+proc G_TYPE_IS_VALUE*(theType: GType): bool =
+  result = private_g_type_check_is_value_type(theType)
+
+proc G_IS_VALUE*(value: Pointer): bool =
+  result = G_TYPE_CHECK_VALUE(value)
+
+proc G_VALUE_TYPE*(value: Pointer): GType =
+  result = (cast[PGValue](value)) . g_type
+
+proc G_VALUE_TYPE_NAME*(value: Pointer): cstring =
+  result = g_type_name(G_VALUE_TYPE(value))
+
+proc G_VALUE_HOLDS*(value: pointer, g_type: GType): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, g_type)
+
+proc G_TYPE_IS_PARAM*(theType: GType): bool =
+  result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_PARAM
+
+proc G_PARAM_SPEC*(pspec: Pointer): PGParamSpec =
+  result = cast[PGParamSpec](G_TYPE_CHECK_INSTANCE_CAST(pspec, G_TYPE_PARAM))
+
+proc G_IS_PARAM_SPEC*(pspec: Pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(pspec, G_TYPE_PARAM)
+
+proc G_PARAM_SPEC_CLASS*(pclass: Pointer): PGParamSpecClass =
+  result = cast[PGParamSpecClass](
+             G_TYPE_CHECK_CLASS_CAST(pclass, G_TYPE_PARAM))
+
+proc G_IS_PARAM_SPEC_CLASS*(pclass: Pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(pclass, G_TYPE_PARAM)
+
+proc G_PARAM_SPEC_GET_CLASS*(pspec: Pointer): PGParamSpecClass =
+  result = cast[PGParamSpecClass](G_TYPE_INSTANCE_GET_CLASS(pspec, G_TYPE_PARAM))
+
+proc G_PARAM_SPEC_TYPE*(pspec: Pointer): GType =
+  result = G_TYPE_FROM_INSTANCE(pspec)
+
+proc G_PARAM_SPEC_TYPE_NAME*(pspec: Pointer): cstring =
+  result = g_type_name(G_PARAM_SPEC_TYPE(pspec))
+
+proc G_PARAM_SPEC_VALUE_TYPE*(pspec: Pointer): GType =
+  result = (G_PARAM_SPEC(pspec)) . value_type
+
+proc G_VALUE_HOLDS_PARAM*(value: Pointer): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_PARAM)
+
+proc G_CLOSURE_NEEDS_MARSHAL*(closure: Pointer): bool =
+  result = cast[PGClosure](closure).marshal == nil
+
+proc G_CLOSURE_N_NOTIFIERS*(cl: PGClosure): int32 =
+  result = ((meta_marshal(cl) + ((n_guards(cl)) shl 1)) + (n_fnotifiers(cl))) +
+      (n_inotifiers(cl))
+
+proc G_CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32 =
+  result = derivative_flag(cclosure)
+
+proc G_CALLBACK*(f: pointer): TGCallback =
+  result = cast[TGCallback](f)
+
+proc ref_count*(a: var TGClosure): guint =
+  result = (a.flag0 and bm_TGClosure_ref_count) shr bp_TGClosure_ref_count
+
+proc set_ref_count*(a: var TGClosure, `ref_count`: guint) =
+  a.flag0 = a.flag0 or
+      ((`ref_count` shl bp_TGClosure_ref_count) and bm_TGClosure_ref_count)
+
+proc meta_marshal*(a: PGClosure): guint =
+  result = (a . flag0 and bm_TGClosure_meta_marshal) shr
+      bp_TGClosure_meta_marshal
+
+proc set_meta_marshal*(a: var TGClosure, `meta_marshal`: guint) =
+  a.flag0 = a.flag0 or
+      ((`meta_marshal` shl bp_TGClosure_meta_marshal) and
+      bm_TGClosure_meta_marshal)
+
+proc n_guards*(a: PGClosure): guint =
+  result = (a . flag0 and bm_TGClosure_n_guards) shr bp_TGClosure_n_guards
+
+proc set_n_guards*(a: var TGClosure, `n_guards`: guint) =
+  a.flag0 = a.flag0 or
+      ((`n_guards` shl bp_TGClosure_n_guards) and bm_TGClosure_n_guards)
+
+proc n_fnotifiers*(a: PGClosure): guint =
+  result = (a . flag0 and bm_TGClosure_n_fnotifiers) shr
+      bp_TGClosure_n_fnotifiers
+
+proc set_n_fnotifiers*(a: var TGClosure, `n_fnotifiers`: guint) =
+  a.flag0 = a.flag0 or
+      ((`n_fnotifiers` shl bp_TGClosure_n_fnotifiers) and
+      bm_TGClosure_n_fnotifiers)
+
+proc n_inotifiers*(a: PGClosure): guint =
+  result = (a . flag0 and bm_TGClosure_n_inotifiers) shr
+      bp_TGClosure_n_inotifiers
+
+proc set_n_inotifiers*(a: var TGClosure, `n_inotifiers`: guint) =
+  a.flag0 = a.flag0 or
+      ((`n_inotifiers` shl bp_TGClosure_n_inotifiers) and
+      bm_TGClosure_n_inotifiers)
+
+proc in_inotify*(a: var TGClosure): guint =
+  result = (a.flag0 and bm_TGClosure_in_inotify) shr bp_TGClosure_in_inotify
+
+proc set_in_inotify*(a: var TGClosure, `in_inotify`: guint) =
+  a.flag0 = a.flag0 or
+      ((`in_inotify` shl bp_TGClosure_in_inotify) and bm_TGClosure_in_inotify)
+
+proc floating*(a: var TGClosure): guint =
+  result = (a.flag0 and bm_TGClosure_floating) shr bp_TGClosure_floating
+
+proc set_floating*(a: var TGClosure, `floating`: guint) =
+  a.flag0 = a.flag0 or
+      ((`floating` shl bp_TGClosure_floating) and bm_TGClosure_floating)
+
+proc derivative_flag*(a: PGClosure): guint =
+  result = (a . flag0 and bm_TGClosure_derivative_flag) shr
+      bp_TGClosure_derivative_flag
+
+proc set_derivative_flag*(a: var TGClosure, `derivative_flag`: guint) =
+  a.flag0 = a.flag0 or
+      ((`derivative_flag` shl bp_TGClosure_derivative_flag) and
+      bm_TGClosure_derivative_flag)
+
+proc in_marshal*(a: var TGClosure): guint =
+  result = (a.flag0 and bm_TGClosure_in_marshal) shr bp_TGClosure_in_marshal
+
+proc set_in_marshal*(a: var TGClosure, in_marshal: guint) =
+  a.flag0 = a.flag0 or
+      ((in_marshal shl bp_TGClosure_in_marshal) and bm_TGClosure_in_marshal)
+
+proc is_invalid*(a: var TGClosure): guint =
+  result = (a.flag0 and bm_TGClosure_is_invalid) shr bp_TGClosure_is_invalid
+
+proc set_is_invalid*(a: var TGClosure, is_invalid: guint) =
+  a.flag0 = a.flag0 or
+      ((is_invalid shl bp_TGClosure_is_invalid) and bm_TGClosure_is_invalid)
+
+proc g_signal_connect*(instance: gpointer, detailed_signal: cstring,
+                       c_handler: TGCallback, data: gpointer): gulong =
+  result = g_signal_connect_data(instance, detailed_signal, c_handler, data,
+                                 nil, TGConnectFlags(0))
+
+proc g_signal_connect_after*(instance: gpointer, detailed_signal: cstring,
+                             c_handler: TGCallback, data: gpointer): gulong =
+  result = g_signal_connect_data(instance, detailed_signal, c_handler, data,
+                                 nil, G_CONNECT_AFTER)
+
+proc g_signal_connect_swapped*(instance: gpointer, detailed_signal: cstring,
+                               c_handler: TGCallback, data: gpointer): gulong =
+  result = g_signal_connect_data(instance, detailed_signal, c_handler, data,
+                                 nil, G_CONNECT_SWAPPED)
+
+proc g_signal_handlers_disconnect_by_func*(instance: gpointer,
+    func, data: gpointer): guint =
+  result = g_signal_handlers_disconnect_matched(instance,
+      TGSignalMatchType(G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil,
+      func, data)
+
+proc g_signal_handlers_block_by_func*(instance: gpointer, func, data: gpointer) =
+  discard g_signal_handlers_block_matched(instance, TGSignalMatchType(
+      G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil, func, data)
+
+proc g_signal_handlers_unblock_by_func*(instance: gpointer, func, data: gpointer) =
+  discard g_signal_handlers_unblock_matched(instance, TGSignalMatchType(
+      G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil, func, data)
+
+proc G_TYPE_IS_OBJECT*(theType: GType): bool =
+  result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_OBJECT
+
+proc G_OBJECT*(anObject: pointer): PGObject =
+  result = cast[PGObject](G_TYPE_CHECK_INSTANCE_CAST(anObject, G_TYPE_OBJECT))
+
+proc G_OBJECT_CLASS*(class: Pointer): PGObjectClass =
+  result = cast[PGObjectClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_OBJECT))
+
+proc G_IS_OBJECT*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, G_TYPE_OBJECT)
+
+proc G_IS_OBJECT_CLASS*(class: Pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_OBJECT)
+
+proc G_OBJECT_GET_CLASS*(anObject: pointer): PGObjectClass =
+  result = cast[PGObjectClass](G_TYPE_INSTANCE_GET_CLASS(anObject, G_TYPE_OBJECT))
+
+proc G_OBJECT_TYPE*(anObject: pointer): GType =
+  result = G_TYPE_FROM_INSTANCE(anObject)
+
+proc G_OBJECT_TYPE_NAME*(anObject: pointer): cstring =
+  result = g_type_name(G_OBJECT_TYPE(anObject))
+
+proc G_OBJECT_CLASS_TYPE*(class: Pointer): GType =
+  result = G_TYPE_FROM_CLASS(class)
+
+proc G_OBJECT_CLASS_NAME*(class: Pointer): cstring =
+  result = g_type_name(G_OBJECT_CLASS_TYPE(class))
+
+proc G_VALUE_HOLDS_OBJECT*(value: Pointer): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_OBJECT)
+
+proc G_OBJECT_WARN_INVALID_PROPERTY_ID*(anObject: gpointer, property_id: gint,
+                                        pspec: gpointer) =
+  G_OBJECT_WARN_INVALID_PSPEC(anObject, "property", property_id, pspec)
+
+proc G_OBJECT_WARN_INVALID_PSPEC*(anObject: gpointer, pname: cstring,
+                                  property_id: gint, pspec: gpointer) =
+  var
+    theObject: PGObject
+    pspec2: PGParamSpec
+    property_id: guint
+  theObject = cast[PGObject](anObject)
+  pspec2 = cast[PGParamSpec](pspec)
+  property_id = (property_id)
+  write(stdout, "invalid thingy\n")
+  #g_warning("%s: invalid %s id %u for \"%s\" of type `%s\' in `%s\'", "", pname,
+  #          `property_id`, `pspec` . name,
+  #          g_type_name(G_PARAM_SPEC_TYPE(`pspec`)),
+  #          G_OBJECT_TYPE_NAME(theobject))
+
+proc G_TYPE_TYPE_PLUGIN*(): GType =
+  result = g_type_plugin_get_type()
+
+proc G_TYPE_PLUGIN*(inst: Pointer): PGTypePlugin =
+  result = PGTypePlugin(G_TYPE_CHECK_INSTANCE_CAST(inst, G_TYPE_TYPE_PLUGIN()))
+
+proc G_TYPE_PLUGIN_CLASS*(vtable: Pointer): PGTypePluginClass =
+  result = cast[PGTypePluginClass](G_TYPE_CHECK_CLASS_CAST(vtable,
+    G_TYPE_TYPE_PLUGIN()))
+
+proc G_IS_TYPE_PLUGIN*(inst: Pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(inst, G_TYPE_TYPE_PLUGIN())
+
+proc G_IS_TYPE_PLUGIN_CLASS*(vtable: Pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(vtable, G_TYPE_TYPE_PLUGIN())
+
+proc G_TYPE_PLUGIN_GET_CLASS*(inst: Pointer): PGTypePluginClass =
+  result = cast[PGTypePluginClass](G_TYPE_INSTANCE_GET_INTERFACE(inst,
+      G_TYPE_TYPE_PLUGIN()))
+
+proc G_TYPE_IS_ENUM*(theType: GType): gboolean =
+  result = (G_TYPE_FUNDAMENTAL(theType) == G_TYPE_ENUM)
+
+proc G_ENUM_CLASS*(class: pointer): PGEnumClass =
+  result = cast[PGEnumClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_ENUM))
+
+proc G_IS_ENUM_CLASS*(class: pointer): gboolean =
+  result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_ENUM)
+
+proc G_ENUM_CLASS_TYPE*(class: pointer): GType =
+  result = G_TYPE_FROM_CLASS(class)
+
+proc G_ENUM_CLASS_TYPE_NAME*(class: pointer): cstring =
+  result = g_type_name(G_ENUM_CLASS_TYPE(class))
+
+proc G_TYPE_IS_FLAGS*(theType: GType): gboolean =
+  result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_FLAGS
+
+proc G_FLAGS_CLASS*(class: pointer): PGFlagsClass =
+  result = cast[PGFlagsClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_FLAGS))
+
+proc G_IS_FLAGS_CLASS*(class: pointer): gboolean =
+  result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_FLAGS)
+
+proc G_FLAGS_CLASS_TYPE*(class: pointer): GType =
+  result = G_TYPE_FROM_CLASS(class)
+
+proc G_FLAGS_CLASS_TYPE_NAME*(class: pointer): cstring =
+  result = g_type_name(G_FLAGS_TYPE(cast[TAddress](class)))
+
+proc G_VALUE_HOLDS_ENUM*(value: pointer): gboolean =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_ENUM)
+
+proc G_VALUE_HOLDS_FLAGS*(value: pointer): gboolean =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_FLAGS)
+
+proc CLAMP*(x, MinX, MaxX: int): int =
+  if x < MinX:
+    result = MinX
+  elif x > MaxX:
+    result = MaxX
+  else:
+    result = x
+
+proc GPOINTER_TO_SIZE*(p: GPointer): GSize =
+  result = GSize(cast[TAddress](p))
+
+proc GSIZE_TO_POINTER*(s: GSize): GPointer =
+  result = cast[GPointer](s)
+
+proc G_VALUE_HOLDS_CHAR*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_CHAR)
+
+proc G_VALUE_HOLDS_UCHAR*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UCHAR)
+
+proc G_VALUE_HOLDS_BOOLEAN*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_BOOLEAN)
+
+proc G_VALUE_HOLDS_INT*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT)
+
+proc G_VALUE_HOLDS_UINT*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT)
+
+proc G_VALUE_HOLDS_LONG*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_LONG)
+
+proc G_VALUE_HOLDS_ULONG*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_ULONG)
+
+proc G_VALUE_HOLDS_INT64*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT64)
+
+proc G_VALUE_HOLDS_UINT64*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT64)
+
+proc G_VALUE_HOLDS_FLOAT*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_FLOAT)
+
+proc G_VALUE_HOLDS_DOUBLE*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_DOUBLE)
+
+proc G_VALUE_HOLDS_STRING*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_STRING)
+
+proc G_VALUE_HOLDS_POINTER*(value: PGValue): bool =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_POINTER)
+
+proc G_TYPE_IS_BOXED*(theType: GType): gboolean =
+  result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_BOXED
+
+proc G_VALUE_HOLDS_BOXED*(value: PGValue): gboolean =
+  result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_BOXED)
+
+proc G_TYPE_CLOSURE*(): GType =
+  result = g_closure_get_type()
+
+proc G_TYPE_VALUE*(): GType =
+  result = g_value_get_type()
+
+proc G_TYPE_VALUE_ARRAY*(): GType =
+  result = g_value_array_get_type()
+
+proc G_TYPE_GSTRING*(): GType =
+  result = g_gstring_get_type()
diff --git a/lib/base/gtk/gtk2.nim b/lib/base/gtk/gtk2.nim
new file mode 100755
index 000000000..6c7a2ce9f
--- /dev/null
+++ b/lib/base/gtk/gtk2.nim
@@ -0,0 +1,17226 @@
+import
+  glib2, atk, pango, gdk2pixbuf, gdk2
+
+when defined(win32):
+  const
+    gtklib = "libgtk-win32-2.0-0.dll"
+elif defined(darwin):
+  const
+    gtklib = "gtk-x11-2.0"
+  # linklib gtk-x11-2.0
+  # linklib gdk-x11-2.0
+  # linklib pango-1.0.0
+  # linklib glib-2.0.0
+  # linklib gobject-2.0.0
+  # linklib gdk_pixbuf-2.0.0
+  # linklib atk-1.0.0
+else:
+  const
+    gtklib = "libgtk-x11-2.0.so"
+type
+  PPPchar* = PPPgchar
+
+const
+  GTK_MAX_COMPOSE_LEN* = 7
+
+type
+  PGtkObject* = ptr TGtkObject
+  PPGtkObject* = ptr PGtkObject
+  PGtkArg* = ptr TGtkArg
+  PGtkType* = ptr TGtkType
+  TGtkType* = GType
+  PGtkWidget* = ptr TGtkWidget
+  PGtkMisc* = ptr TGtkMisc
+  PGtkLabel* = ptr TGtkLabel
+  PGtkMenu* = ptr TGtkMenu
+  PGtkAnchorType* = ptr TGtkAnchorType
+  TGtkAnchorType* = int32
+  PGtkArrowType* = ptr TGtkArrowType
+  TGtkArrowType* = int32
+  PGtkAttachOptions* = ptr TGtkAttachOptions
+  TGtkAttachOptions* = int32
+  PGtkButtonBoxStyle* = ptr TGtkButtonBoxStyle
+  TGtkButtonBoxStyle* = int32
+  PGtkCurveType* = ptr TGtkCurveType
+  TGtkCurveType* = int32
+  PGtkDeleteType* = ptr TGtkDeleteType
+  TGtkDeleteType* = int32
+  PGtkDirectionType* = ptr TGtkDirectionType
+  TGtkDirectionType* = int32
+  PGtkExpanderStyle* = ptr TGtkExpanderStyle
+  TGtkExpanderStyle* = int32
+  PPGtkIconSize* = ptr PGtkIconSize
+  PGtkIconSize* = ptr TGtkIconSize
+  TGtkIconSize* = int32
+  PGtkTextDirection* = ptr TGtkTextDirection
+  TGtkTextDirection* = int32
+  PGtkJustification* = ptr TGtkJustification
+  TGtkJustification* = int32
+  PGtkMenuDirectionType* = ptr TGtkMenuDirectionType
+  TGtkMenuDirectionType* = int32
+  PGtkMetricType* = ptr TGtkMetricType
+  TGtkMetricType* = int32
+  PGtkMovementStep* = ptr TGtkMovementStep
+  TGtkMovementStep* = int32
+  PGtkOrientation* = ptr TGtkOrientation
+  TGtkOrientation* = int32
+  PGtkCornerType* = ptr TGtkCornerType
+  TGtkCornerType* = int32
+  PGtkPackType* = ptr TGtkPackType
+  TGtkPackType* = int32
+  PGtkPathPriorityType* = ptr TGtkPathPriorityType
+  TGtkPathPriorityType* = int32
+  PGtkPathType* = ptr TGtkPathType
+  TGtkPathType* = int32
+  PGtkPolicyType* = ptr TGtkPolicyType
+  TGtkPolicyType* = int32
+  PGtkPositionType* = ptr TGtkPositionType
+  TGtkPositionType* = int32
+  PGtkReliefStyle* = ptr TGtkReliefStyle
+  TGtkReliefStyle* = int32
+  PGtkResizeMode* = ptr TGtkResizeMode
+  TGtkResizeMode* = int32
+  PGtkScrollType* = ptr TGtkScrollType
+  TGtkScrollType* = int32
+  PGtkSelectionMode* = ptr TGtkSelectionMode
+  TGtkSelectionMode* = int32
+  PGtkShadowType* = ptr TGtkShadowType
+  TGtkShadowType* = int32
+  PGtkStateType* = ptr TGtkStateType
+  TGtkStateType* = int32
+  PGtkSubmenuDirection* = ptr TGtkSubmenuDirection
+  TGtkSubmenuDirection* = int32
+  PGtkSubmenuPlacement* = ptr TGtkSubmenuPlacement
+  TGtkSubmenuPlacement* = int32
+  PGtkToolbarStyle* = ptr TGtkToolbarStyle
+  TGtkToolbarStyle* = int32
+  PGtkUpdateType* = ptr TGtkUpdateType
+  TGtkUpdateType* = int32
+  PGtkVisibility* = ptr TGtkVisibility
+  TGtkVisibility* = int32
+  PGtkWindowPosition* = ptr TGtkWindowPosition
+  TGtkWindowPosition* = int32
+  PGtkWindowType* = ptr TGtkWindowType
+  TGtkWindowType* = int32
+  PGtkWrapMode* = ptr TGtkWrapMode
+  TGtkWrapMode* = int32
+  PGtkSortType* = ptr TGtkSortType
+  TGtkSortType* = int32
+  PGtkStyle* = ptr TGtkStyle
+  PPGtkTreeModel* = ptr PGtkTreeModel
+  PGtkTreeModel* = pointer
+  PGtkTreePath* = pointer
+  PGtkTreeIter* = ptr TGtkTreeIter
+  PGtkSelectionData* = ptr TGtkSelectionData
+  PGtkTextTagTable* = ptr TGtkTextTagTable
+  PGtkTextBTreeNode* = pointer
+  PGtkTextBTree* = pointer
+  PGtkTextLine* = ptr TGtkTextLine
+  PGtkTreeViewColumn* = ptr TGtkTreeViewColumn
+  PGtkTreeView* = ptr TGtkTreeView
+  TGtkTreeViewColumnDropFunc* = proc (tree_view: PGtkTreeView,
+                                      column: PGtkTreeViewColumn,
+                                      prev_column: PGtkTreeViewColumn,
+                                      next_column: PGtkTreeViewColumn,
+                                      data: gpointer): gboolean{.cdecl.}
+  TGtkTreeViewMappingFunc* = proc (tree_view: PGtkTreeView, path: PGtkTreePath,
+                                   user_data: gpointer){.cdecl.}
+  TGtkTreeViewSearchEqualFunc* = proc (model: PGtkTreeModel, column: gint,
+                                       key: cstring, iter: PGtkTreeIter,
+                                       search_data: gpointer): gboolean{.cdecl.}
+  TGtkTreeDestroyCountFunc* = proc (tree_view: PGtkTreeView, path: PGtkTreePath,
+                                    children: gint, user_data: gpointer){.cdecl.}
+  PGtkTreeViewDropPosition* = ptr TGtkTreeViewDropPosition
+  TGtkTreeViewDropPosition* = enum
+    GTK_TREE_VIEW_DROP_BEFORE, GTK_TREE_VIEW_DROP_AFTER,
+    GTK_TREE_VIEW_DROP_INTO_OR_BEFORE, GTK_TREE_VIEW_DROP_INTO_OR_AFTER
+  PGtkObjectFlags* = ptr TGtkObjectFlags
+  TGtkObjectFlags* = int32
+  TGtkObject* = object of TGObject
+    flags*: guint32
+
+  PGtkObjectClass* = ptr TGtkObjectClass
+  TGtkObjectClass* = object of TGObjectClass
+    set_arg*: proc (anObject: PGtkObject, arg: PGtkArg, arg_id: guint){.cdecl.}
+    get_arg*: proc (anObject: PGtkObject, arg: PGtkArg, arg_id: guint){.cdecl.}
+    destroy*: proc (anObject: PGtkObject){.cdecl.}
+
+  PGtkFundamentalType* = ptr TGtkFundamentalType
+  TGtkFundamentalType* = GType
+  TGtkFunction* = proc (data: gpointer): gboolean{.cdecl.}
+  TGtkDestroyNotify* = proc (data: gpointer){.cdecl.}
+  TGtkCallbackMarshal* = proc (anObject: PGtkObject, data: gpointer,
+                               n_args: guint, args: PGtkArg){.cdecl.}
+  TGtkSignalFuncProc* = proc ()
+  TGtkSignalFunc* = proc (para1: TGtkSignalFuncProc){.cdecl.}
+  PGtkSignalMarshaller* = ptr TGtkSignalMarshaller
+  TGtkSignalMarshaller* = TGSignalCMarshaller
+  TGtkArgSignalData* = record
+    f*: TGtkSignalFunc
+    d*: gpointer
+
+  TGtkArg* = record
+    `type`*: TGtkType
+    name*: cstring
+    d*: gdouble               # was a union type
+
+  PGtkTypeInfo* = ptr TGtkTypeInfo
+  TGtkTypeInfo* = record
+    type_name*: cstring
+    object_size*: guint
+    class_size*: guint
+    class_init_func*: pointer #TGtkClassInitFunc
+    object_init_func*: pointer #TGtkObjectInitFunc
+    reserved_1*: gpointer
+    reserved_2*: gpointer
+    base_class_init_func*: pointer #TGtkClassInitFunc
+
+  PGtkEnumValue* = ptr TGtkEnumValue
+  TGtkEnumValue* = TGEnumValue
+  PGtkFlagValue* = ptr TGtkFlagValue
+  TGtkFlagValue* = TGFlagsValue
+  PGtkWidgetFlags* = ptr TGtkWidgetFlags
+  TGtkWidgetFlags* = int32
+  PGtkWidgetHelpType* = ptr TGtkWidgetHelpType
+  TGtkWidgetHelpType* = enum
+    GTK_WIDGET_HELP_TOOLTIP, GTK_WIDGET_HELP_WHATS_THIS
+  PGtkAllocation* = ptr TGtkAllocation
+  TGtkAllocation* = TGdkRectangle
+  TGtkCallback* = proc (widget: PGtkWidget, data: gpointer){.cdecl.}
+  PGtkRequisition* = ptr TGtkRequisition
+  TGtkRequisition* = record
+    width*: gint
+    height*: gint
+
+  TGtkWidget* = object of TGtkObject
+    private_flags*: guint16
+    state*: guint8
+    saved_state*: guint8
+    name*: cstring
+    style*: PGtkStyle
+    requisition*: TGtkRequisition
+    allocation*: TGtkAllocation
+    window*: PGdkWindow
+    parent*: PGtkWidget
+
+  PGtkWidgetClass* = ptr TGtkWidgetClass
+  TGtkWidgetClass* = object of TGtkObjectClass
+    activate_signal*: guint
+    set_scroll_adjustments_signal*: guint
+    dispatch_child_properties_changed*: proc (widget: PGtkWidget,
+        n_pspecs: guint, pspecs: PPGParamSpec){.cdecl.}
+    show*: proc (widget: PGtkWidget){.cdecl.}
+    show_all*: proc (widget: PGtkWidget){.cdecl.}
+    hide*: proc (widget: PGtkWidget){.cdecl.}
+    hide_all*: proc (widget: PGtkWidget){.cdecl.}
+    map*: proc (widget: PGtkWidget){.cdecl.}
+    unmap*: proc (widget: PGtkWidget){.cdecl.}
+    realize*: proc (widget: PGtkWidget){.cdecl.}
+    unrealize*: proc (widget: PGtkWidget){.cdecl.}
+    size_request*: proc (widget: PGtkWidget, requisition: PGtkRequisition){.
+        cdecl.}
+    size_allocate*: proc (widget: PGtkWidget, allocation: PGtkAllocation){.cdecl.}
+    state_changed*: proc (widget: PGtkWidget, previous_state: TGtkStateType){.
+        cdecl.}
+    parent_set*: proc (widget: PGtkWidget, previous_parent: PGtkWidget){.cdecl.}
+    hierarchy_changed*: proc (widget: PGtkWidget, previous_toplevel: PGtkWidget){.
+        cdecl.}
+    style_set*: proc (widget: PGtkWidget, previous_style: PGtkStyle){.cdecl.}
+    direction_changed*: proc (widget: PGtkWidget,
+                              previous_direction: TGtkTextDirection){.cdecl.}
+    grab_notify*: proc (widget: PGtkWidget, was_grabbed: gboolean){.cdecl.}
+    child_notify*: proc (widget: PGtkWidget, pspec: PGParamSpec){.cdecl.}
+    mnemonic_activate*: proc (widget: PGtkWidget, group_cycling: gboolean): gboolean{.
+        cdecl.}
+    grab_focus*: proc (widget: PGtkWidget){.cdecl.}
+    focus*: proc (widget: PGtkWidget, direction: TGtkDirectionType): gboolean{.
+        cdecl.}
+    event*: proc (widget: PGtkWidget, event: PGdkEvent): gboolean{.cdecl.}
+    button_press_event*: proc (widget: PGtkWidget, event: PGdkEventButton): gboolean{.
+        cdecl.}
+    button_release_event*: proc (widget: PGtkWidget, event: PGdkEventButton): gboolean{.
+        cdecl.}
+    scroll_event*: proc (widget: PGtkWidget, event: PGdkEventScroll): gboolean{.
+        cdecl.}
+    motion_notify_event*: proc (widget: PGtkWidget, event: PGdkEventMotion): gboolean{.
+        cdecl.}
+    delete_event*: proc (widget: PGtkWidget, event: PGdkEventAny): gboolean{.
+        cdecl.}
+    destroy_event*: proc (widget: PGtkWidget, event: PGdkEventAny): gboolean{.
+        cdecl.}
+    expose_event*: proc (widget: PGtkWidget, event: PGdkEventExpose): gboolean{.
+        cdecl.}
+    key_press_event*: proc (widget: PGtkWidget, event: PGdkEventKey): gboolean{.
+        cdecl.}
+    key_release_event*: proc (widget: PGtkWidget, event: PGdkEventKey): gboolean{.
+        cdecl.}
+    enter_notify_event*: proc (widget: PGtkWidget, event: PGdkEventCrossing): gboolean{.
+        cdecl.}
+    leave_notify_event*: proc (widget: PGtkWidget, event: PGdkEventCrossing): gboolean{.
+        cdecl.}
+    configure_event*: proc (widget: PGtkWidget, event: PGdkEventConfigure): gboolean{.
+        cdecl.}
+    focus_in_event*: proc (widget: PGtkWidget, event: PGdkEventFocus): gboolean{.
+        cdecl.}
+    focus_out_event*: proc (widget: PGtkWidget, event: PGdkEventFocus): gboolean{.
+        cdecl.}
+    map_event*: proc (widget: PGtkWidget, event: PGdkEventAny): gboolean{.cdecl.}
+    unmap_event*: proc (widget: PGtkWidget, event: PGdkEventAny): gboolean{.
+        cdecl.}
+    property_notify_event*: proc (widget: PGtkWidget, event: PGdkEventProperty): gboolean{.
+        cdecl.}
+    selection_clear_event*: proc (widget: PGtkWidget, event: PGdkEventSelection): gboolean{.
+        cdecl.}
+    selection_request_event*: proc (widget: PGtkWidget,
+                                    event: PGdkEventSelection): gboolean{.cdecl.}
+    selection_notify_event*: proc (widget: PGtkWidget, event: PGdkEventSelection): gboolean{.
+        cdecl.}
+    proximity_in_event*: proc (widget: PGtkWidget, event: PGdkEventProximity): gboolean{.
+        cdecl.}
+    proximity_out_event*: proc (widget: PGtkWidget, event: PGdkEventProximity): gboolean{.
+        cdecl.}
+    visibility_notify_event*: proc (widget: PGtkWidget,
+                                    event: PGdkEventVisibility): gboolean{.cdecl.}
+    client_event*: proc (widget: PGtkWidget, event: PGdkEventClient): gboolean{.
+        cdecl.}
+    no_expose_event*: proc (widget: PGtkWidget, event: PGdkEventAny): gboolean{.
+        cdecl.}
+    window_state_event*: proc (widget: PGtkWidget, event: PGdkEventWindowState): gboolean{.
+        cdecl.}
+    selection_get*: proc (widget: PGtkWidget, selection_data: PGtkSelectionData,
+                          info: guint, time: guint){.cdecl.}
+    selection_received*: proc (widget: PGtkWidget,
+                               selection_data: PGtkSelectionData, time: guint){.
+        cdecl.}
+    drag_begin*: proc (widget: PGtkWidget, context: PGdkDragContext){.cdecl.}
+    drag_end*: proc (widget: PGtkWidget, context: PGdkDragContext){.cdecl.}
+    drag_data_get*: proc (widget: PGtkWidget, context: PGdkDragContext,
+                          selection_data: PGtkSelectionData, info: guint,
+                          time: guint){.cdecl.}
+    drag_data_delete*: proc (widget: PGtkWidget, context: PGdkDragContext){.
+        cdecl.}
+    drag_leave*: proc (widget: PGtkWidget, context: PGdkDragContext, time: guint){.
+        cdecl.}
+    drag_motion*: proc (widget: PGtkWidget, context: PGdkDragContext, x: gint,
+                        y: gint, time: guint): gboolean{.cdecl.}
+    drag_drop*: proc (widget: PGtkWidget, context: PGdkDragContext, x: gint,
+                      y: gint, time: guint): gboolean{.cdecl.}
+    drag_data_received*: proc (widget: PGtkWidget, context: PGdkDragContext,
+                               x: gint, y: gint,
+                               selection_data: PGtkSelectionData, info: guint,
+                               time: guint){.cdecl.}
+    popup_menu*: proc (widget: PGtkWidget): gboolean{.cdecl.}
+    show_help*: proc (widget: PGtkWidget, help_type: TGtkWidgetHelpType): gboolean{.
+        cdecl.}
+    get_accessible*: proc (widget: PGtkWidget): PAtkObject{.cdecl.}
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+    gtk_reserved5*: proc (){.cdecl.}
+    gtk_reserved6*: proc (){.cdecl.}
+    gtk_reserved7*: proc (){.cdecl.}
+    gtk_reserved8*: proc (){.cdecl.}
+
+  PGtkWidgetAuxInfo* = ptr TGtkWidgetAuxInfo
+  TGtkWidgetAuxInfo* = record
+    x*: gint
+    y*: gint
+    width*: gint
+    height*: gint
+    flag0*: guint16
+
+  PGtkWidgetShapeInfo* = ptr TGtkWidgetShapeInfo
+  TGtkWidgetShapeInfo* = record
+    offset_x*: gint16
+    offset_y*: gint16
+    shape_mask*: PGdkBitmap
+
+  TGtkMisc* = object of TGtkWidget
+    xalign*: gfloat
+    yalign*: gfloat
+    xpad*: guint16
+    ypad*: guint16
+
+  PGtkMiscClass* = ptr TGtkMiscClass
+  TGtkMiscClass* = object of TGtkWidgetClass
+
+  PGtkAccelFlags* = ptr TGtkAccelFlags
+  TGtkAccelFlags* = int32
+  PGtkAccelGroup* = ptr TGtkAccelGroup
+  PGtkAccelGroupEntry* = ptr TGtkAccelGroupEntry
+  TGtkAccelGroupActivate* = proc (accel_group: PGtkAccelGroup,
+                                  acceleratable: PGObject, keyval: guint,
+                                  modifier: TGdkModifierType): gboolean{.cdecl.}
+  TGtkAccelGroup* = object of TGObject
+    lock_count*: guint
+    modifier_mask*: TGdkModifierType
+    acceleratables*: PGSList
+    n_accels*: guint
+    priv_accels*: PGtkAccelGroupEntry
+
+  PGtkAccelGroupClass* = ptr TGtkAccelGroupClass
+  TGtkAccelGroupClass* = object of TGObjectClass
+    accel_changed*: proc (accel_group: PGtkAccelGroup, keyval: guint,
+                          modifier: TGdkModifierType, accel_closure: PGClosure){.
+        cdecl.}
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkAccelKey* = ptr TGtkAccelKey
+  TGtkAccelKey* = record
+    accel_key*: guint
+    accel_mods*: TGdkModifierType
+    flag0*: guint16
+
+  TGtkAccelGroupEntry* = record
+    key*: TGtkAccelKey
+    closure*: PGClosure
+    accel_path_quark*: TGQuark
+
+  Tgtk_accel_group_find_func* = proc (key: PGtkAccelKey, closure: PGClosure,
+                                      data: gpointer): gboolean{.cdecl.}
+  PGtkContainer* = ptr TGtkContainer
+  TGtkContainer* = object of TGtkWidget
+    focus_child*: PGtkWidget
+    GtkContainer_flag0*: int32
+
+  PGtkContainerClass* = ptr TGtkContainerClass
+  TGtkContainerClass* = object of TGtkWidgetClass
+    add*: proc (container: PGtkContainer, widget: PGtkWidget){.cdecl.}
+    remove*: proc (container: PGtkContainer, widget: PGtkWidget){.cdecl.}
+    check_resize*: proc (container: PGtkContainer){.cdecl.}
+    forall*: proc (container: PGtkContainer, include_internals: gboolean,
+                   callback: TGtkCallback, callback_data: gpointer){.cdecl.}
+    set_focus_child*: proc (container: PGtkContainer, widget: PGtkWidget){.cdecl.}
+    child_type*: proc (container: PGtkContainer): TGtkType{.cdecl.}
+    composite_name*: proc (container: PGtkContainer, child: PGtkWidget): cstring{.
+        cdecl.}
+    set_child_property*: proc (container: PGtkContainer, child: PGtkWidget,
+                               property_id: guint, value: PGValue,
+                               pspec: PGParamSpec){.cdecl.}
+    get_child_property*: proc (container: PGtkContainer, child: PGtkWidget,
+                               property_id: guint, value: PGValue,
+                               pspec: PGParamSpec){.cdecl.}
+    gtk_reserved20: proc (){.cdecl.}
+    gtk_reserved21: proc (){.cdecl.}
+    gtk_reserved23: proc (){.cdecl.}
+    gtk_reserved24: proc (){.cdecl.}
+
+  PGtkBin* = ptr TGtkBin
+  TGtkBin* = object of TGtkContainer
+    child*: PGtkWidget
+
+  PGtkBinClass* = ptr TGtkBinClass
+  TGtkBinClass* = object of TGtkContainerClass
+
+  PGtkWindowGeometryInfo* = pointer
+  PGtkWindowGroup* = ptr TGtkWindowGroup
+  PGtkWindow* = ptr TGtkWindow
+  TGtkWindow* = object of TGtkBin
+    title*: cstring
+    wmclass_name*: cstring
+    wmclass_class*: cstring
+    wm_role*: cstring
+    focus_widget*: PGtkWidget
+    default_widget*: PGtkWidget
+    transient_parent*: PGtkWindow
+    geometry_info*: PGtkWindowGeometryInfo
+    frame*: PGdkWindow
+    group*: PGtkWindowGroup
+    configure_request_count*: guint16
+    gtkwindow_flag0*: int32
+    frame_left*: guint
+    frame_top*: guint
+    frame_right*: guint
+    frame_bottom*: guint
+    keys_changed_handler*: guint
+    mnemonic_modifier*: TGdkModifierType
+    screen*: PGdkScreen
+
+  PGtkWindowClass* = ptr TGtkWindowClass
+  TGtkWindowClass* = object of TGtkBinClass
+    set_focus*: proc (window: PGtkWindow, focus: PGtkWidget){.cdecl.}
+    frame_event*: proc (window: PGtkWindow, event: PGdkEvent): gboolean{.cdecl.}
+    activate_focus*: proc (window: PGtkWindow){.cdecl.}
+    activate_default*: proc (window: PGtkWindow){.cdecl.}
+    move_focus*: proc (window: PGtkWindow, direction: TGtkDirectionType){.cdecl.}
+    keys_changed*: proc (window: PGtkWindow){.cdecl.}
+    gtk_reserved30: proc (){.cdecl.}
+    gtk_reserved31: proc (){.cdecl.}
+    gtk_reserved32: proc (){.cdecl.}
+    gtk_reserved33: proc (){.cdecl.}
+
+  TGtkWindowGroup* = object of TGObject
+    grabs*: PGSList
+
+  PGtkWindowGroupClass* = ptr TGtkWindowGroupClass
+  TGtkWindowGroupClass* = object of TGObjectClass
+    gtk_reserved40: proc (){.cdecl.}
+    gtk_reserved41: proc (){.cdecl.}
+    gtk_reserved42: proc (){.cdecl.}
+    gtk_reserved43: proc (){.cdecl.}
+
+  TGtkWindowKeysForeachFunc* = proc (window: PGtkWindow, keyval: guint,
+                                     modifiers: TGdkModifierType,
+                                     is_mnemonic: gboolean, data: gpointer){.
+      cdecl.}
+  PGtkLabelSelectionInfo* = pointer
+  TGtkLabel* = object of TGtkMisc
+    `label`*: cstring
+    GtkLabel_flag0*: guint16
+    mnemonic_keyval*: guint
+    text*: cstring
+    attrs*: PPangoAttrList
+    effective_attrs*: PPangoAttrList
+    layout*: PPangoLayout
+    mnemonic_widget*: PGtkWidget
+    mnemonic_window*: PGtkWindow
+    select_info*: PGtkLabelSelectionInfo
+
+  PGtkLabelClass* = ptr TGtkLabelClass
+  TGtkLabelClass* = object of TGtkMiscClass
+    move_cursor*: proc (`label`: PGtkLabel, step: TGtkMovementStep, count: gint,
+                        extend_selection: gboolean){.cdecl.}
+    copy_clipboard*: proc (`label`: PGtkLabel){.cdecl.}
+    populate_popup*: proc (`label`: PGtkLabel, menu: PGtkMenu){.cdecl.}
+    gtk_reserved50: proc (){.cdecl.}
+    gtk_reserved51: proc (){.cdecl.}
+    gtk_reserved52: proc (){.cdecl.}
+    gtk_reserved53: proc (){.cdecl.}
+
+  PGtkAccelLabel* = ptr TGtkAccelLabel
+  TGtkAccelLabel* = object of TGtkLabel
+    queue_id*: guint
+    accel_padding*: guint
+    accel_widget*: PGtkWidget
+    accel_closure*: PGClosure
+    accel_group*: PGtkAccelGroup
+    accel_string*: cstring
+    accel_string_width*: guint16
+
+  PGtkAccelLabelClass* = ptr TGtkAccelLabelClass
+  TGtkAccelLabelClass* = object of TGtkLabelClass
+    signal_quote1*: cstring
+    signal_quote2*: cstring
+    mod_name_shift*: cstring
+    mod_name_control*: cstring
+    mod_name_alt*: cstring
+    mod_separator*: cstring
+    accel_seperator*: cstring
+    GtkAccelLabelClass_flag0*: guint16
+    gtk_reserved61: proc (){.cdecl.}
+    gtk_reserved62: proc (){.cdecl.}
+    gtk_reserved63: proc (){.cdecl.}
+    gtk_reserved64: proc (){.cdecl.}
+
+  TGtkAccelMapForeach* = proc (data: gpointer, accel_path: cstring,
+                               accel_key: guint, accel_mods: TGdkModifierType,
+                               changed: gboolean){.cdecl.}
+  PGtkAccessible* = ptr TGtkAccessible
+  TGtkAccessible* = object of TAtkObject
+    widget*: PGtkWidget
+
+  PGtkAccessibleClass* = ptr TGtkAccessibleClass
+  TGtkAccessibleClass* = object of TAtkObjectClass
+    connect_widget_destroyed*: proc (accessible: PGtkAccessible){.cdecl.}
+    gtk_reserved71: proc (){.cdecl.}
+    gtk_reserved72: proc (){.cdecl.}
+    gtk_reserved73: proc (){.cdecl.}
+    gtk_reserved74: proc (){.cdecl.}
+
+  PGtkAdjustment* = ptr TGtkAdjustment
+  TGtkAdjustment* = object of TGtkObject
+    lower*: gdouble
+    upper*: gdouble
+    value*: gdouble
+    step_increment*: gdouble
+    page_increment*: gdouble
+    page_size*: gdouble
+
+  PGtkAdjustmentClass* = ptr TGtkAdjustmentClass
+  TGtkAdjustmentClass* = object of TGtkObjectClass
+    changed*: proc (adjustment: PGtkAdjustment){.cdecl.}
+    value_changed*: proc (adjustment: PGtkAdjustment){.cdecl.}
+    gtk_reserved81: proc (){.cdecl.}
+    gtk_reserved82: proc (){.cdecl.}
+    gtk_reserved83: proc (){.cdecl.}
+    gtk_reserved84: proc (){.cdecl.}
+
+  PGtkAlignment* = ptr TGtkAlignment
+  TGtkAlignment* = object of TGtkBin
+    xalign*: gfloat
+    yalign*: gfloat
+    xscale*: gfloat
+    yscale*: gfloat
+
+  PGtkAlignmentClass* = ptr TGtkAlignmentClass
+  TGtkAlignmentClass* = object of TGtkBinClass
+
+  PGtkFrame* = ptr TGtkFrame
+  TGtkFrame* = object of TGtkBin
+    label_widget*: PGtkWidget
+    shadow_type*: gint16
+    label_xalign*: gfloat
+    label_yalign*: gfloat
+    child_allocation*: TGtkAllocation
+
+  PGtkFrameClass* = ptr TGtkFrameClass
+  TGtkFrameClass* = object of TGtkBinClass
+    compute_child_allocation*: proc (frame: PGtkFrame,
+                                     allocation: PGtkAllocation){.cdecl.}
+
+  PGtkAspectFrame* = ptr TGtkAspectFrame
+  TGtkAspectFrame* = object of TGtkFrame
+    xalign*: gfloat
+    yalign*: gfloat
+    ratio*: gfloat
+    obey_child*: gboolean
+    center_allocation*: TGtkAllocation
+
+  PGtkAspectFrameClass* = ptr TGtkAspectFrameClass
+  TGtkAspectFrameClass* = object of TGtkFrameClass
+
+  PGtkArrow* = ptr TGtkArrow
+  TGtkArrow* = object of TGtkMisc
+    arrow_type*: gint16
+    shadow_type*: gint16
+
+  PGtkArrowClass* = ptr TGtkArrowClass
+  TGtkArrowClass* = object of TGtkMiscClass
+
+  PGtkBindingEntry* = ptr TGtkBindingEntry
+  PGtkBindingSignal* = ptr TGtkBindingSignal
+  PGtkBindingArg* = ptr TGtkBindingArg
+  PGtkBindingSet* = ptr TGtkBindingSet
+  TGtkBindingSet* = record
+    set_name*: cstring
+    priority*: gint
+    widget_path_pspecs*: PGSList
+    widget_class_pspecs*: PGSList
+    class_branch_pspecs*: PGSList
+    entries*: PGtkBindingEntry
+    current*: PGtkBindingEntry
+    flag0*: guint16
+
+  TGtkBindingEntry* = record
+    keyval*: guint
+    modifiers*: TGdkModifierType
+    binding_set*: PGtkBindingSet
+    flag0*: guint16
+    set_next*: PGtkBindingEntry
+    hash_next*: PGtkBindingEntry
+    signals*: PGtkBindingSignal
+
+  TGtkBindingSignal* = record
+    next*: PGtkBindingSignal
+    signal_name*: cstring
+    n_args*: guint
+    args*: PGtkBindingArg
+
+  TGtkBindingArg* = record
+    arg_type*: TGtkType
+    d*: gdouble
+
+  PGtkBox* = ptr TGtkBox
+  TGtkBox* = object of TGtkContainer
+    children*: PGList
+    spacing*: gint16
+    gtkbox_flag0*: guint16
+
+  PGtkBoxClass* = ptr TGtkBoxClass
+  TGtkBoxClass* = object of TGtkContainerClass
+
+  PGtkBoxChild* = ptr TGtkBoxChild
+  TGtkBoxChild* = record
+    widget*: PGtkWidget
+    padding*: guint16
+    flag0*: guint16
+
+  PGtkButtonBox* = ptr TGtkButtonBox
+  TGtkButtonBox* = object of TGtkBox
+    child_min_width*: gint
+    child_min_height*: gint
+    child_ipad_x*: gint
+    child_ipad_y*: gint
+    layout_style*: TGtkButtonBoxStyle
+
+  PGtkButtonBoxClass* = ptr TGtkButtonBoxClass
+  TGtkButtonBoxClass* = object of TGtkBoxClass
+
+  PGtkButton* = ptr TGtkButton
+  TGtkButton* = object of TGtkBin
+    event_window*: PGdkWindow
+    label_text*: cstring
+    activate_timeout*: guint
+    gtkbutton_flag0*: guint16
+
+  PGtkButtonClass* = ptr TGtkButtonClass
+  TGtkButtonClass* = object of TGtkBinClass
+    pressed*: proc (button: PGtkButton){.cdecl.}
+    released*: proc (button: PGtkButton){.cdecl.}
+    clicked*: proc (button: PGtkButton){.cdecl.}
+    enter*: proc (button: PGtkButton){.cdecl.}
+    leave*: proc (button: PGtkButton){.cdecl.}
+    activate*: proc (button: PGtkButton){.cdecl.}
+    gtk_reserved101: proc (){.cdecl.}
+    gtk_reserved102: proc (){.cdecl.}
+    gtk_reserved103: proc (){.cdecl.}
+    gtk_reserved104: proc (){.cdecl.}
+
+  PGtkCalendarDisplayOptions* = ptr TGtkCalendarDisplayOptions
+  TGtkCalendarDisplayOptions* = int32
+  PGtkCalendar* = ptr TGtkCalendar
+  TGtkCalendar* = object of TGtkWidget
+    header_style*: PGtkStyle
+    label_style*: PGtkStyle
+    month*: gint
+    year*: gint
+    selected_day*: gint
+    day_month*: array[0..5, array[0..6, gint]]
+    day*: array[0..5, array[0..6, gint]]
+    num_marked_dates*: gint
+    marked_date*: array[0..30, gint]
+    display_flags*: TGtkCalendarDisplayOptions
+    marked_date_color*: array[0..30, TGdkColor]
+    gc*: PGdkGC
+    xor_gc*: PGdkGC
+    focus_row*: gint
+    focus_col*: gint
+    highlight_row*: gint
+    highlight_col*: gint
+    private_data*: gpointer
+    grow_space*: array[0..31, gchar]
+    gtk_reserved111: proc (){.cdecl.}
+    gtk_reserved112: proc (){.cdecl.}
+    gtk_reserved113: proc (){.cdecl.}
+    gtk_reserved114: proc (){.cdecl.}
+
+  PGtkCalendarClass* = ptr TGtkCalendarClass
+  TGtkCalendarClass* = object of TGtkWidgetClass
+    month_changed*: proc (calendar: PGtkCalendar){.cdecl.}
+    day_selected*: proc (calendar: PGtkCalendar){.cdecl.}
+    day_selected_double_click*: proc (calendar: PGtkCalendar){.cdecl.}
+    prev_month*: proc (calendar: PGtkCalendar){.cdecl.}
+    next_month*: proc (calendar: PGtkCalendar){.cdecl.}
+    prev_year*: proc (calendar: PGtkCalendar){.cdecl.}
+    next_year*: proc (calendar: PGtkCalendar){.cdecl.}
+
+  PGtkCellEditable* = pointer
+  PGtkCellEditableIface* = ptr TGtkCellEditableIface
+  TGtkCellEditableIface* = object of TGTypeInterface
+    editing_done*: proc (cell_editable: PGtkCellEditable){.cdecl.}
+    remove_widget*: proc (cell_editable: PGtkCellEditable){.cdecl.}
+    start_editing*: proc (cell_editable: PGtkCellEditable, event: PGdkEvent){.
+        cdecl.}
+
+  PGtkCellRendererState* = ptr TGtkCellRendererState
+  TGtkCellRendererState* = int32
+  PGtkCellRendererMode* = ptr TGtkCellRendererMode
+  TGtkCellRendererMode* = enum
+    GTK_CELL_RENDERER_MODE_INERT, GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+    GTK_CELL_RENDERER_MODE_EDITABLE
+  PGtkCellRenderer* = ptr TGtkCellRenderer
+  TGtkCellRenderer* = object of  TGtkObject
+    xalign*: gfloat
+    yalign*: gfloat
+    width*: gint
+    height*: gint
+    xpad*: guint16
+    ypad*: guint16
+    GtkCellRenderer_flag0*: guint16
+
+  PGtkCellRendererClass* = ptr TGtkCellRendererClass
+  TGtkCellRendererClass* = object of TGtkObjectClass
+    get_size*: proc (cell: PGtkCellRenderer, widget: PGtkWidget,
+                     cell_area: PGdkRectangle, x_offset: Pgint, y_offset: Pgint,
+                     width: Pgint, height: Pgint){.cdecl.}
+    render*: proc (cell: PGtkCellRenderer, window: PGdkWindow,
+                   widget: PGtkWidget, background_area: PGdkRectangle,
+                   cell_area: PGdkRectangle, expose_area: PGdkRectangle,
+                   flags: TGtkCellRendererState){.cdecl.}
+    activate*: proc (cell: PGtkCellRenderer, event: PGdkEvent,
+                     widget: PGtkWidget, path: cstring,
+                     background_area: PGdkRectangle, cell_area: PGdkRectangle,
+                     flags: TGtkCellRendererState): gboolean{.cdecl.}
+    start_editing*: proc (cell: PGtkCellRenderer, event: PGdkEvent,
+                          widget: PGtkWidget, path: cstring,
+                          background_area: PGdkRectangle,
+                          cell_area: PGdkRectangle, flags: TGtkCellRendererState): PGtkCellEditable{.
+        cdecl.}
+    gtk_reserved121: proc (){.cdecl.}
+    gtk_reserved122: proc (){.cdecl.}
+    gtk_reserved123: proc (){.cdecl.}
+    gtk_reserved124: proc (){.cdecl.}
+
+  PGtkCellRendererText* = ptr TGtkCellRendererText
+  TGtkCellRendererText* = object of TGtkCellRenderer
+    text*: cstring
+    font*: PPangoFontDescription
+    font_scale*: gdouble
+    foreground*: TPangoColor
+    background*: TPangoColor
+    extra_attrs*: PPangoAttrList
+    underline_style*: TPangoUnderline
+    rise*: gint
+    fixed_height_rows*: gint
+    GtkCellRendererText_flag0*: guint16
+
+  PGtkCellRendererTextClass* = ptr TGtkCellRendererTextClass
+  TGtkCellRendererTextClass* = object of TGtkCellRendererClass
+    edited*: proc (cell_renderer_text: PGtkCellRendererText, path: cstring,
+                   new_text: cstring){.cdecl.}
+    gtk_reserved131: proc (){.cdecl.}
+    gtk_reserved132: proc (){.cdecl.}
+    gtk_reserved133: proc (){.cdecl.}
+    gtk_reserved134: proc (){.cdecl.}
+
+  PGtkCellRendererToggle* = ptr TGtkCellRendererToggle
+  TGtkCellRendererToggle* = object of TGtkCellRenderer
+    GtkCellRendererToggle_flag0*: guint16
+
+  PGtkCellRendererToggleClass* = ptr TGtkCellRendererToggleClass
+  TGtkCellRendererToggleClass* = object of TGtkCellRendererClass
+    toggled*: proc (cell_renderer_toggle: PGtkCellRendererToggle, path: cstring){.
+        cdecl.}
+    gtk_reserved141: proc (){.cdecl.}
+    gtk_reserved142: proc (){.cdecl.}
+    gtk_reserved143: proc (){.cdecl.}
+    gtk_reserved144: proc (){.cdecl.}
+
+  PGtkCellRendererPixbuf* = ptr TGtkCellRendererPixbuf
+  TGtkCellRendererPixbuf* = object of TGtkCellRenderer
+    pixbuf*: PGdkPixbuf
+    pixbuf_expander_open*: PGdkPixbuf
+    pixbuf_expander_closed*: PGdkPixbuf
+
+  PGtkCellRendererPixbufClass* = ptr TGtkCellRendererPixbufClass
+  TGtkCellRendererPixbufClass* = object of TGtkCellRendererClass
+    gtk_reserved151: proc (){.cdecl.}
+    gtk_reserved152: proc (){.cdecl.}
+    gtk_reserved153: proc (){.cdecl.}
+    gtk_reserved154: proc (){.cdecl.}
+
+  PGtkItem* = ptr TGtkItem
+  TGtkItem* = object of TGtkBin
+
+  PGtkItemClass* = ptr TGtkItemClass
+  TGtkItemClass* = object of TGtkBinClass
+    select*: proc (item: PGtkItem){.cdecl.}
+    deselect*: proc (item: PGtkItem){.cdecl.}
+    toggle*: proc (item: PGtkItem){.cdecl.}
+    gtk_reserved161: proc (){.cdecl.}
+    gtk_reserved162: proc (){.cdecl.}
+    gtk_reserved163: proc (){.cdecl.}
+    gtk_reserved164: proc (){.cdecl.}
+
+  PGtkMenuItem* = ptr TGtkMenuItem
+  TGtkMenuItem* = object of TGtkItem
+    submenu*: PGtkWidget
+    event_window*: PGdkWindow
+    toggle_size*: guint16
+    accelerator_width*: guint16
+    accel_path*: cstring
+    GtkMenuItem_flag0*: guint16
+    timer*: guint
+
+  PGtkMenuItemClass* = ptr TGtkMenuItemClass
+  TGtkMenuItemClass* = object of TGtkItemClass
+    GtkMenuItemClass_flag0*: guint16
+    activate*: proc (menu_item: PGtkMenuItem){.cdecl.}
+    activate_item*: proc (menu_item: PGtkMenuItem){.cdecl.}
+    toggle_size_request*: proc (menu_item: PGtkMenuItem, requisition: Pgint){.
+        cdecl.}
+    toggle_size_allocate*: proc (menu_item: PGtkMenuItem, allocation: gint){.
+        cdecl.}
+    gtk_reserved171: proc (){.cdecl.}
+    gtk_reserved172: proc (){.cdecl.}
+    gtk_reserved173: proc (){.cdecl.}
+    gtk_reserved174: proc (){.cdecl.}
+
+  PGtkToggleButton* = ptr TGtkToggleButton
+  TGtkToggleButton* = object of TGtkButton
+    GtkToggleButton_flag0*: guint16
+
+  PGtkToggleButtonClass* = ptr TGtkToggleButtonClass
+  TGtkToggleButtonClass* = object of TGtkButtonClass
+    toggled*: proc (toggle_button: PGtkToggleButton){.cdecl.}
+    gtk_reserved171: proc (){.cdecl.}
+    gtk_reserved172: proc (){.cdecl.}
+    gtk_reserved173: proc (){.cdecl.}
+    gtk_reserved174: proc (){.cdecl.}
+
+  PGtkCheckButton* = ptr TGtkCheckButton
+  TGtkCheckButton* = object of TGtkToggleButton
+
+  PGtkCheckButtonClass* = ptr TGtkCheckButtonClass
+  TGtkCheckButtonClass* = object of TGtkToggleButtonClass
+    draw_indicator*: proc (check_button: PGtkCheckButton, area: PGdkRectangle){.
+        cdecl.}
+    gtk_reserved181: proc (){.cdecl.}
+    gtk_reserved182: proc (){.cdecl.}
+    gtk_reserved183: proc (){.cdecl.}
+    gtk_reserved184: proc (){.cdecl.}
+
+  PGtkCheckMenuItem* = ptr TGtkCheckMenuItem
+  TGtkCheckMenuItem* = object of TGtkMenuItem
+    GtkCheckMenuItem_flag0*: guint16
+
+  PGtkCheckMenuItemClass* = ptr TGtkCheckMenuItemClass
+  TGtkCheckMenuItemClass* = object of TGtkMenuItemClass
+    toggled*: proc (check_menu_item: PGtkCheckMenuItem){.cdecl.}
+    draw_indicator*: proc (check_menu_item: PGtkCheckMenuItem,
+                           area: PGdkRectangle){.cdecl.}
+    gtk_reserved191: proc (){.cdecl.}
+    gtk_reserved192: proc (){.cdecl.}
+    gtk_reserved193: proc (){.cdecl.}
+    gtk_reserved194: proc (){.cdecl.}
+
+  PGtkClipboard* = pointer
+  TGtkClipboardReceivedFunc* = proc (clipboard: PGtkClipboard,
+                                     selection_data: PGtkSelectionData,
+                                     data: gpointer){.cdecl.}
+  TGtkClipboardTextReceivedFunc* = proc (clipboard: PGtkClipboard, text: cstring,
+      data: gpointer){.cdecl.}
+  TGtkClipboardGetFunc* = proc (clipboard: PGtkClipboard,
+                                selection_data: PGtkSelectionData, info: guint,
+                                user_data_or_owner: gpointer){.cdecl.}
+  TGtkClipboardClearFunc* = proc (clipboard: PGtkClipboard,
+                                  user_data_or_owner: gpointer){.cdecl.}
+  PGtkCList* = ptr TGtkCList
+  PGtkCListColumn* = ptr TGtkCListColumn
+  PGtkCListRow* = ptr TGtkCListRow
+  PGtkCell* = ptr TGtkCell
+  PGtkCellType* = ptr TGtkCellType
+  TGtkCellType* = enum
+    GTK_CELL_EMPTY, GTK_CELL_TEXT, GTK_CELL_PIXMAP, GTK_CELL_PIXTEXT,
+    GTK_CELL_WIDGET
+  PGtkCListDragPos* = ptr TGtkCListDragPos
+  TGtkCListDragPos* = enum
+    GTK_CLIST_DRAG_NONE, GTK_CLIST_DRAG_BEFORE, GTK_CLIST_DRAG_INTO,
+    GTK_CLIST_DRAG_AFTER
+  PGtkButtonAction* = ptr TGtkButtonAction
+  TGtkButtonAction* = int32
+  TGtkCListCompareFunc* = proc (clist: PGtkCList, ptr1: gconstpointer,
+                                ptr2: gconstpointer): gint{.cdecl.}
+  PGtkCListCellInfo* = ptr TGtkCListCellInfo
+  TGtkCListCellInfo* = record
+    row*: gint
+    column*: gint
+
+  PGtkCListDestInfo* = ptr TGtkCListDestInfo
+  TGtkCListDestInfo* = record
+    cell*: TGtkCListCellInfo
+    insert_pos*: TGtkCListDragPos
+
+  TGtkCList* = object of TGtkContainer
+    GtkCList_flags*: guint16
+    row_mem_chunk*: PGMemChunk
+    cell_mem_chunk*: PGMemChunk
+    freeze_count*: guint
+    internal_allocation*: TGdkRectangle
+    rows*: gint
+    row_height*: gint
+    row_list*: PGList
+    row_list_end*: PGList
+    columns*: gint
+    column_title_area*: TGdkRectangle
+    title_window*: PGdkWindow
+    column*: PGtkCListColumn
+    clist_window*: PGdkWindow
+    clist_window_width*: gint
+    clist_window_height*: gint
+    hoffset*: gint
+    voffset*: gint
+    shadow_type*: TGtkShadowType
+    selection_mode*: TGtkSelectionMode
+    selection*: PGList
+    selection_end*: PGList
+    undo_selection*: PGList
+    undo_unselection*: PGList
+    undo_anchor*: gint
+    button_actions*: array[0..4, guint8]
+    drag_button*: guint8
+    click_cell*: TGtkCListCellInfo
+    hadjustment*: PGtkAdjustment
+    vadjustment*: PGtkAdjustment
+    xor_gc*: PGdkGC
+    fg_gc*: PGdkGC
+    bg_gc*: PGdkGC
+    cursor_drag*: PGdkCursor
+    x_drag*: gint
+    focus_row*: gint
+    focus_header_column*: gint
+    anchor*: gint
+    anchor_state*: TGtkStateType
+    drag_pos*: gint
+    htimer*: gint
+    vtimer*: gint
+    sort_type*: TGtkSortType
+    compare*: TGtkCListCompareFunc
+    sort_column*: gint
+    drag_highlight_row*: gint
+    drag_highlight_pos*: TGtkCListDragPos
+
+  PGtkCListClass* = ptr TGtkCListClass
+  TGtkCListClass* = object of TGtkContainerClass
+    set_scroll_adjustments*: proc (clist: PGtkCList,
+                                   hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+    refresh*: proc (clist: PGtkCList){.cdecl.}
+    select_row*: proc (clist: PGtkCList, row: gint, column: gint,
+                       event: PGdkEvent){.cdecl.}
+    unselect_row*: proc (clist: PGtkCList, row: gint, column: gint,
+                         event: PGdkEvent){.cdecl.}
+    row_move*: proc (clist: PGtkCList, source_row: gint, dest_row: gint){.cdecl.}
+    click_column*: proc (clist: PGtkCList, column: gint){.cdecl.}
+    resize_column*: proc (clist: PGtkCList, column: gint, width: gint){.cdecl.}
+    toggle_focus_row*: proc (clist: PGtkCList){.cdecl.}
+    select_all*: proc (clist: PGtkCList){.cdecl.}
+    unselect_all*: proc (clist: PGtkCList){.cdecl.}
+    undo_selection*: proc (clist: PGtkCList){.cdecl.}
+    start_selection*: proc (clist: PGtkCList){.cdecl.}
+    end_selection*: proc (clist: PGtkCList){.cdecl.}
+    extend_selection*: proc (clist: PGtkCList, scroll_type: TGtkScrollType,
+                             position: gfloat, auto_start_selection: gboolean){.
+        cdecl.}
+    scroll_horizontal*: proc (clist: PGtkCList, scroll_type: TGtkScrollType,
+                              position: gfloat){.cdecl.}
+    scroll_vertical*: proc (clist: PGtkCList, scroll_type: TGtkScrollType,
+                            position: gfloat){.cdecl.}
+    toggle_add_mode*: proc (clist: PGtkCList){.cdecl.}
+    abort_column_resize*: proc (clist: PGtkCList){.cdecl.}
+    resync_selection*: proc (clist: PGtkCList, event: PGdkEvent){.cdecl.}
+    selection_find*: proc (clist: PGtkCList, row_number: gint,
+                           row_list_element: PGList): PGList{.cdecl.}
+    draw_row*: proc (clist: PGtkCList, area: PGdkRectangle, row: gint,
+                     clist_row: PGtkCListRow){.cdecl.}
+    draw_drag_highlight*: proc (clist: PGtkCList, target_row: PGtkCListRow,
+                                target_row_number: gint,
+                                drag_pos: TGtkCListDragPos){.cdecl.}
+    clear*: proc (clist: PGtkCList){.cdecl.}
+    fake_unselect_all*: proc (clist: PGtkCList, row: gint){.cdecl.}
+    sort_list*: proc (clist: PGtkCList){.cdecl.}
+    insert_row*: proc (clist: PGtkCList, row: gint): gint{.cdecl, varargs.}
+    remove_row*: proc (clist: PGtkCList, row: gint){.cdecl.}
+    set_cell_contents*: proc (clist: PGtkCList, clist_row: PGtkCListRow,
+                              column: gint, thetype: TGtkCellType, text: cstring,
+                              spacing: guint8, pixmap: PGdkPixmap,
+                              mask: PGdkBitmap){.cdecl.}
+    cell_size_request*: proc (clist: PGtkCList, clist_row: PGtkCListRow,
+                              column: gint, requisition: PGtkRequisition){.cdecl.}
+
+  PGPtrArray = pointer
+  PGArray = pointer
+  TGtkCListColumn* = record
+    title*: cstring
+    area*: TGdkRectangle
+    button*: PGtkWidget
+    window*: PGdkWindow
+    width*: gint
+    min_width*: gint
+    max_width*: gint
+    justification*: TGtkJustification
+    flag0*: guint16
+
+  TGtkCListRow* = record
+    cell*: PGtkCell
+    state*: TGtkStateType
+    foreground*: TGdkColor
+    background*: TGdkColor
+    style*: PGtkStyle
+    data*: gpointer
+    destroy*: TGtkDestroyNotify
+    flag0*: guint16
+
+  PGtkCellText* = ptr TGtkCellText
+  TGtkCellText* = record
+    `type`*: TGtkCellType
+    vertical*: gint16
+    horizontal*: gint16
+    style*: PGtkStyle
+    text*: cstring
+
+  PGtkCellPixmap* = ptr TGtkCellPixmap
+  TGtkCellPixmap* = record
+    `type`*: TGtkCellType
+    vertical*: gint16
+    horizontal*: gint16
+    style*: PGtkStyle
+    pixmap*: PGdkPixmap
+    mask*: PGdkBitmap
+
+  PGtkCellPixText* = ptr TGtkCellPixText
+  TGtkCellPixText* = record
+    `type`*: TGtkCellType
+    vertical*: gint16
+    horizontal*: gint16
+    style*: PGtkStyle
+    text*: cstring
+    spacing*: guint8
+    pixmap*: PGdkPixmap
+    mask*: PGdkBitmap
+
+  PGtkCellWidget* = ptr TGtkCellWidget
+  TGtkCellWidget* = record
+    `type`*: TGtkCellType
+    vertical*: gint16
+    horizontal*: gint16
+    style*: PGtkStyle
+    widget*: PGtkWidget
+
+  TGtkCell* = record
+    `type`*: TGtkCellType
+    vertical*: gint16
+    horizontal*: gint16
+    style*: PGtkStyle
+    text*: cstring
+    spacing*: guint8
+    pixmap*: PGdkPixmap
+    mask*: PGdkBitmap
+
+  PGtkDialogFlags* = ptr TGtkDialogFlags
+  TGtkDialogFlags* = int32
+  PGtkResponseType* = ptr TGtkResponseType
+  TGtkResponseType* = int32
+  PGtkDialog* = ptr TGtkDialog
+  TGtkDialog* = object of TGtkWindow
+    vbox*: PGtkWidget
+    action_area*: PGtkWidget
+    separator*: PGtkWidget
+
+  PGtkDialogClass* = ptr TGtkDialogClass
+  TGtkDialogClass* = object of TGtkWindowClass
+    response*: proc (dialog: PGtkDialog, response_id: gint){.cdecl.}
+    closeFile*: proc (dialog: PGtkDialog){.cdecl.}
+    gtk_reserved201: proc (){.cdecl.}
+    gtk_reserved202: proc (){.cdecl.}
+    gtk_reserved203: proc (){.cdecl.}
+    gtk_reserved204: proc (){.cdecl.}
+
+  PGtkVBox* = ptr TGtkVBox
+  TGtkVBox* = object of TGtkBox
+
+  PGtkVBoxClass* = ptr TGtkVBoxClass
+  TGtkVBoxClass* = object of TGtkBoxClass
+
+  TGtkColorSelectionChangePaletteFunc* = proc (colors: PGdkColor, n_colors: gint){.
+      cdecl.}
+  TGtkColorSelectionChangePaletteWithScreenFunc* = proc (screen: PGdkScreen,
+      colors: PGdkColor, n_colors: gint){.cdecl.}
+  PGtkColorSelection* = ptr TGtkColorSelection
+  TGtkColorSelection* = object of TGtkVBox
+    private_data*: gpointer
+
+  PGtkColorSelectionClass* = ptr TGtkColorSelectionClass
+  TGtkColorSelectionClass* = object of TGtkVBoxClass
+    color_changed*: proc (color_selection: PGtkColorSelection){.cdecl.}
+    gtk_reserved211: proc (){.cdecl.}
+    gtk_reserved212: proc (){.cdecl.}
+    gtk_reserved213: proc (){.cdecl.}
+    gtk_reserved214: proc (){.cdecl.}
+
+  PGtkColorSelectionDialog* = ptr TGtkColorSelectionDialog
+  TGtkColorSelectionDialog* = object of TGtkDialog
+    colorsel*: PGtkWidget
+    ok_button*: PGtkWidget
+    cancel_button*: PGtkWidget
+    help_button*: PGtkWidget
+
+  PGtkColorSelectionDialogClass* = ptr TGtkColorSelectionDialogClass
+  TGtkColorSelectionDialogClass* = object of TGtkDialogClass
+    gtk_reserved221: proc (){.cdecl.}
+    gtk_reserved222: proc (){.cdecl.}
+    gtk_reserved223: proc (){.cdecl.}
+    gtk_reserved224: proc (){.cdecl.}
+
+  PGtkHBox* = ptr TGtkHBox
+  TGtkHBox* = object of TGtkBox
+
+  PGtkHBoxClass* = ptr TGtkHBoxClass
+  TGtkHBoxClass* = object of TGtkBoxClass
+
+  PGtkCombo* = ptr TGtkCombo
+  TGtkCombo* = object of TGtkHBox
+    entry*: PGtkWidget
+    button*: PGtkWidget
+    popup*: PGtkWidget
+    popwin*: PGtkWidget
+    list*: PGtkWidget
+    entry_change_id*: guint
+    list_change_id*: guint
+    GtkCombo_flag0*: guint16
+    current_button*: guint16
+    activate_id*: guint
+
+  PGtkComboClass* = ptr TGtkComboClass
+  TGtkComboClass* = object of TGtkHBoxClass
+    gtk_reserved231: proc (){.cdecl.}
+    gtk_reserved232: proc (){.cdecl.}
+    gtk_reserved233: proc (){.cdecl.}
+    gtk_reserved234: proc (){.cdecl.}
+
+  PGtkCTreePos* = ptr TGtkCTreePos
+  TGtkCTreePos* = enum
+    GTK_CTREE_POS_BEFORE, GTK_CTREE_POS_AS_CHILD, GTK_CTREE_POS_AFTER
+  PGtkCTreeLineStyle* = ptr TGtkCTreeLineStyle
+  TGtkCTreeLineStyle* = enum
+    GTK_CTREE_LINES_NONE, GTK_CTREE_LINES_SOLID, GTK_CTREE_LINES_DOTTED,
+    GTK_CTREE_LINES_TABBED
+  PGtkCTreeExpanderStyle* = ptr TGtkCTreeExpanderStyle
+  TGtkCTreeExpanderStyle* = enum
+    GTK_CTREE_EXPANDER_NONE, GTK_CTREE_EXPANDER_SQUARE,
+    GTK_CTREE_EXPANDER_TRIANGLE, GTK_CTREE_EXPANDER_CIRCULAR
+  PGtkCTreeExpansionType* = ptr TGtkCTreeExpansionType
+  TGtkCTreeExpansionType* = enum
+    GTK_CTREE_EXPANSION_EXPAND, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE,
+    GTK_CTREE_EXPANSION_COLLAPSE, GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE,
+    GTK_CTREE_EXPANSION_TOGGLE, GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE
+  PGtkCTree* = ptr TGtkCTree
+  PGtkCTreeNode* = ptr TGtkCTreeNode
+  TGtkCTreeFunc* = proc (ctree: PGtkCTree, node: PGtkCTreeNode, data: gpointer){.
+      cdecl.}
+  TGtkCTreeGNodeFunc* = proc (ctree: PGtkCTree, depth: guint, gnode: PGNode,
+                              cnode: PGtkCTreeNode, data: gpointer): gboolean{.
+      cdecl.}
+  TGtkCTreeCompareDragFunc* = proc (ctree: PGtkCTree,
+                                    source_node: PGtkCTreeNode,
+                                    new_parent: PGtkCTreeNode,
+                                    new_sibling: PGtkCTreeNode): gboolean{.cdecl.}
+  TGtkCTree* = object of TGtkCList
+    lines_gc*: PGdkGC
+    tree_indent*: gint
+    tree_spacing*: gint
+    tree_column*: gint
+    GtkCTree_flag0*: guint16
+    drag_compare*: TGtkCTreeCompareDragFunc
+
+  PGtkCTreeClass* = ptr TGtkCTreeClass
+  TGtkCTreeClass* = object of TGtkCListClass
+    tree_select_row*: proc (ctree: PGtkCTree, row: PGtkCTreeNode, column: gint){.
+        cdecl.}
+    tree_unselect_row*: proc (ctree: PGtkCTree, row: PGtkCTreeNode, column: gint){.
+        cdecl.}
+    tree_expand*: proc (ctree: PGtkCTree, node: PGtkCTreeNode){.cdecl.}
+    tree_collapse*: proc (ctree: PGtkCTree, node: PGtkCTreeNode){.cdecl.}
+    tree_move*: proc (ctree: PGtkCTree, node: PGtkCTreeNode,
+                      new_parent: PGtkCTreeNode, new_sibling: PGtkCTreeNode){.
+        cdecl.}
+    change_focus_row_expansion*: proc (ctree: PGtkCTree,
+                                       action: TGtkCTreeExpansionType){.cdecl.}
+
+  PGtkCTreeRow* = ptr TGtkCTreeRow
+  TGtkCTreeRow* = record
+    row*: TGtkCListRow
+    parent*: PGtkCTreeNode
+    sibling*: PGtkCTreeNode
+    children*: PGtkCTreeNode
+    pixmap_closed*: PGdkPixmap
+    mask_closed*: PGdkBitmap
+    pixmap_opened*: PGdkPixmap
+    mask_opened*: PGdkBitmap
+    level*: guint16
+    GtkCTreeRow_flag0*: guint16
+
+  TGtkCTreeNode* = record
+    list*: TGList
+
+  PGtkDrawingArea* = ptr TGtkDrawingArea
+  TGtkDrawingArea* = object of TGtkWidget
+    draw_data*: gpointer
+
+  PGtkDrawingAreaClass* = ptr TGtkDrawingAreaClass
+  TGtkDrawingAreaClass* = object of TGtkWidgetClass
+    gtk_reserved241: proc (){.cdecl.}
+    gtk_reserved242: proc (){.cdecl.}
+    gtk_reserved243: proc (){.cdecl.}
+    gtk_reserved244: proc (){.cdecl.}
+
+  Tctlpoint* = array[0..1, gfloat]
+  Pctlpoint* = ptr Tctlpoint
+  PGtkCurve* = ptr TGtkCurve
+  TGtkCurve* = object of TGtkDrawingArea
+    cursor_type*: gint
+    min_x*: gfloat
+    max_x*: gfloat
+    min_y*: gfloat
+    max_y*: gfloat
+    pixmap*: PGdkPixmap
+    curve_type*: TGtkCurveType
+    height*: gint
+    grab_point*: gint
+    last*: gint
+    num_points*: gint
+    point*: PGdkPoint
+    num_ctlpoints*: gint
+    ctlpoint*: Pctlpoint
+
+  PGtkCurveClass* = ptr TGtkCurveClass
+  TGtkCurveClass* = object of TGtkDrawingAreaClass
+    curve_type_changed*: proc (curve: PGtkCurve){.cdecl.}
+    gtk_reserved251: proc (){.cdecl.}
+    gtk_reserved252: proc (){.cdecl.}
+    gtk_reserved253: proc (){.cdecl.}
+    gtk_reserved254: proc (){.cdecl.}
+
+  PGtkDestDefaults* = ptr TGtkDestDefaults
+  TGtkDestDefaults* = int32
+  PGtkTargetFlags* = ptr TGtkTargetFlags
+  TGtkTargetFlags* = int32
+  PGtkEditable* = pointer
+  PGtkEditableClass* = ptr TGtkEditableClass
+  TGtkEditableClass* = object of TGTypeInterface
+    insert_text*: proc (editable: PGtkEditable, text: cstring, length: gint,
+                        position: Pgint){.cdecl.}
+    delete_text*: proc (editable: PGtkEditable, start_pos: gint, end_pos: gint){.
+        cdecl.}
+    changed*: proc (editable: PGtkEditable){.cdecl.}
+    do_insert_text*: proc (editable: PGtkEditable, text: cstring, length: gint,
+                           position: Pgint){.cdecl.}
+    do_delete_text*: proc (editable: PGtkEditable, start_pos: gint,
+                           end_pos: gint){.cdecl.}
+    get_chars*: proc (editable: PGtkEditable, start_pos: gint, end_pos: gint): cstring{.
+        cdecl.}
+    set_selection_bounds*: proc (editable: PGtkEditable, start_pos: gint,
+                                 end_pos: gint){.cdecl.}
+    get_selection_bounds*: proc (editable: PGtkEditable, start_pos: Pgint,
+                                 end_pos: Pgint): gboolean{.cdecl.}
+    set_position*: proc (editable: PGtkEditable, position: gint){.cdecl.}
+    get_position*: proc (editable: PGtkEditable): gint{.cdecl.}
+
+  PGtkIMContext* = ptr TGtkIMContext
+  TGtkIMContext* = object of TGObject
+
+  PGtkIMContextClass* = ptr TGtkIMContextClass
+  TGtkIMContextClass* = object of TGtkObjectClass
+    preedit_start*: proc (context: PGtkIMContext){.cdecl.}
+    preedit_end*: proc (context: PGtkIMContext){.cdecl.}
+    preedit_changed*: proc (context: PGtkIMContext){.cdecl.}
+    commit*: proc (context: PGtkIMContext, str: cstring){.cdecl.}
+    retrieve_surrounding*: proc (context: PGtkIMContext): gboolean{.cdecl.}
+    delete_surrounding*: proc (context: PGtkIMContext, offset: gint,
+                               n_chars: gint): gboolean{.cdecl.}
+    set_client_window*: proc (context: PGtkIMContext, window: PGdkWindow){.cdecl.}
+    get_preedit_string*: proc (context: PGtkIMContext, str: PPgchar,
+                               attrs: var PPangoAttrList, cursor_pos: Pgint){.
+        cdecl.}
+    filter_keypress*: proc (context: PGtkIMContext, event: PGdkEventKey): gboolean{.
+        cdecl.}
+    focus_in*: proc (context: PGtkIMContext){.cdecl.}
+    focus_out*: proc (context: PGtkIMContext){.cdecl.}
+    reset*: proc (context: PGtkIMContext){.cdecl.}
+    set_cursor_location*: proc (context: PGtkIMContext, area: PGdkRectangle){.
+        cdecl.}
+    set_use_preedit*: proc (context: PGtkIMContext, use_preedit: gboolean){.
+        cdecl.}
+    set_surrounding*: proc (context: PGtkIMContext, text: cstring, len: gint,
+                            cursor_index: gint){.cdecl.}
+    get_surrounding*: proc (context: PGtkIMContext, text: PPgchar,
+                            cursor_index: Pgint): gboolean{.cdecl.}
+    gtk_reserved261: proc (){.cdecl.}
+    gtk_reserved262: proc (){.cdecl.}
+    gtk_reserved263: proc (){.cdecl.}
+    gtk_reserved264: proc (){.cdecl.}
+    gtk_reserved265: proc (){.cdecl.}
+    gtk_reserved266: proc (){.cdecl.}
+
+  PGtkMenuShell* = ptr TGtkMenuShell
+  TGtkMenuShell* = object of TGtkContainer
+    children*: PGList
+    active_menu_item*: PGtkWidget
+    parent_menu_shell*: PGtkWidget
+    button*: guint
+    activate_time*: guint32
+    GtkMenuShell_flag0*: guint16
+
+  PGtkMenuShellClass* = ptr TGtkMenuShellClass
+  TGtkMenuShellClass* = object of TGtkContainerClass
+    GtkMenuShellClass_flag0*: guint16
+    deactivate*: proc (menu_shell: PGtkMenuShell){.cdecl.}
+    selection_done*: proc (menu_shell: PGtkMenuShell){.cdecl.}
+    move_current*: proc (menu_shell: PGtkMenuShell,
+                         direction: TGtkMenuDirectionType){.cdecl.}
+    activate_current*: proc (menu_shell: PGtkMenuShell, force_hide: gboolean){.
+        cdecl.}
+    cancel*: proc (menu_shell: PGtkMenuShell){.cdecl.}
+    select_item*: proc (menu_shell: PGtkMenuShell, menu_item: PGtkWidget){.cdecl.}
+    insert*: proc (menu_shell: PGtkMenuShell, child: PGtkWidget, position: gint){.
+        cdecl.}
+    gtk_reserved271: proc (){.cdecl.}
+    gtk_reserved272: proc (){.cdecl.}
+    gtk_reserved273: proc (){.cdecl.}
+    gtk_reserved274: proc (){.cdecl.}
+
+  TGtkMenuPositionFunc* = proc (menu: PGtkMenu, x: Pgint, y: Pgint,
+                                push_in: Pgboolean, user_data: gpointer){.cdecl.}
+  TGtkMenuDetachFunc* = proc (attach_widget: PGtkWidget, menu: PGtkMenu){.cdecl.}
+  TGtkMenu* = object of TGtkMenuShell
+    parent_menu_item*: PGtkWidget
+    old_active_menu_item*: PGtkWidget
+    accel_group*: PGtkAccelGroup
+    accel_path*: cstring
+    position_func*: TGtkMenuPositionFunc
+    position_func_data*: gpointer
+    toggle_size*: guint
+    toplevel*: PGtkWidget
+    tearoff_window*: PGtkWidget
+    tearoff_hbox*: PGtkWidget
+    tearoff_scrollbar*: PGtkWidget
+    tearoff_adjustment*: PGtkAdjustment
+    view_window*: PGdkWindow
+    bin_window*: PGdkWindow
+    scroll_offset*: gint
+    saved_scroll_offset*: gint
+    scroll_step*: gint
+    timeout_id*: guint
+    navigation_region*: PGdkRegion
+    navigation_timeout*: guint
+    GtkMenu_flag0*: guint16
+
+  PGtkMenuClass* = ptr TGtkMenuClass
+  TGtkMenuClass* = object of TGtkMenuShellClass
+    gtk_reserved281: proc (){.cdecl.}
+    gtk_reserved282: proc (){.cdecl.}
+    gtk_reserved283: proc (){.cdecl.}
+    gtk_reserved284: proc (){.cdecl.}
+
+  PGtkEntry* = ptr TGtkEntry
+  TGtkEntry* = object of TGtkWidget
+    text*: cstring
+    GtkEntry_flag0*: guint16
+    text_length*: guint16
+    text_max_length*: guint16
+    text_area*: PGdkWindow
+    im_context*: PGtkIMContext
+    popup_menu*: PGtkWidget
+    current_pos*: gint
+    selection_bound*: gint
+    cached_layout*: PPangoLayout
+    flag1*: guint16
+    button*: guint
+    blink_timeout*: guint
+    recompute_idle*: guint
+    scroll_offset*: gint
+    ascent*: gint
+    descent*: gint
+    text_size*: guint16
+    n_bytes*: guint16
+    preedit_length*: guint16
+    preedit_cursor*: guint16
+    dnd_position*: gint
+    drag_start_x*: gint
+    drag_start_y*: gint
+    invisible_char*: gunichar
+    width_chars*: gint
+
+  PGtkEntryClass* = ptr TGtkEntryClass
+  TGtkEntryClass* = object of TGtkWidgetClass
+    populate_popup*: proc (entry: PGtkEntry, menu: PGtkMenu){.cdecl.}
+    activate*: proc (entry: PGtkEntry){.cdecl.}
+    move_cursor*: proc (entry: PGtkEntry, step: TGtkMovementStep, count: gint,
+                        extend_selection: gboolean){.cdecl.}
+    insert_at_cursor*: proc (entry: PGtkEntry, str: cstring){.cdecl.}
+    delete_from_cursor*: proc (entry: PGtkEntry, thetype: TGtkDeleteType,
+                               count: gint){.cdecl.}
+    cut_clipboard*: proc (entry: PGtkEntry){.cdecl.}
+    copy_clipboard*: proc (entry: PGtkEntry){.cdecl.}
+    paste_clipboard*: proc (entry: PGtkEntry){.cdecl.}
+    toggle_overwrite*: proc (entry: PGtkEntry){.cdecl.}
+    gtk_reserved291: proc (){.cdecl.}
+    gtk_reserved292: proc (){.cdecl.}
+    gtk_reserved293: proc (){.cdecl.}
+    gtk_reserved294: proc (){.cdecl.}
+
+  PGtkEventBox* = ptr TGtkEventBox
+  TGtkEventBox* = object of TGtkBin
+
+  PGtkEventBoxClass* = ptr TGtkEventBoxClass
+  TGtkEventBoxClass* = object of TGtkBinClass
+
+  PGtkFileSelection* = ptr TGtkFileSelection
+  TGtkFileSelection* = object of TGtkDialog
+    dir_list*: PGtkWidget
+    file_list*: PGtkWidget
+    selection_entry*: PGtkWidget
+    selection_text*: PGtkWidget
+    main_vbox*: PGtkWidget
+    ok_button*: PGtkWidget
+    cancel_button*: PGtkWidget
+    help_button*: PGtkWidget
+    history_pulldown*: PGtkWidget
+    history_menu*: PGtkWidget
+    history_list*: PGList
+    fileop_dialog*: PGtkWidget
+    fileop_entry*: PGtkWidget
+    fileop_file*: cstring
+    cmpl_state*: gpointer
+    fileop_c_dir*: PGtkWidget
+    fileop_del_file*: PGtkWidget
+    fileop_ren_file*: PGtkWidget
+    button_area*: PGtkWidget
+    gtkFileSelection_action_area*: PGtkWidget
+    selected_names*: PGPtrArray
+    last_selected*: cstring
+
+  PGtkFileSelectionClass* = ptr TGtkFileSelectionClass
+  TGtkFileSelectionClass* = object of TGtkDialogClass
+    gtk_reserved301: proc (){.cdecl.}
+    gtk_reserved302: proc (){.cdecl.}
+    gtk_reserved303: proc (){.cdecl.}
+    gtk_reserved304: proc (){.cdecl.}
+
+  PGtkFixed* = ptr TGtkFixed
+  TGtkFixed* = object of TGtkContainer
+    children*: PGList
+
+  PGtkFixedClass* = ptr TGtkFixedClass
+  TGtkFixedClass* = object of TGtkContainerClass
+
+  PGtkFixedChild* = ptr TGtkFixedChild
+  TGtkFixedChild* = record
+    widget*: PGtkWidget
+    x*: gint
+    y*: gint
+
+  PGtkFontSelection* = ptr TGtkFontSelection
+  TGtkFontSelection* = object of TGtkVBox
+    font_entry*: PGtkWidget
+    family_list*: PGtkWidget
+    font_style_entry*: PGtkWidget
+    face_list*: PGtkWidget
+    size_entry*: PGtkWidget
+    size_list*: PGtkWidget
+    pixels_button*: PGtkWidget
+    points_button*: PGtkWidget
+    filter_button*: PGtkWidget
+    preview_entry*: PGtkWidget
+    family*: PPangoFontFamily
+    face*: PPangoFontFace
+    size*: gint
+    font*: PGdkFont
+
+  PGtkFontSelectionClass* = ptr TGtkFontSelectionClass
+  TGtkFontSelectionClass* = object of TGtkVBoxClass
+    gtk_reserved311: proc (){.cdecl.}
+    gtk_reserved312: proc (){.cdecl.}
+    gtk_reserved313: proc (){.cdecl.}
+    gtk_reserved314: proc (){.cdecl.}
+
+  PGtkFontSelectionDialog* = ptr TGtkFontSelectionDialog
+  TGtkFontSelectionDialog* = object of TGtkDialog
+    fontsel*: PGtkWidget
+    main_vbox*: PGtkWidget
+    GtkFontSelectionDialog_action_area*: PGtkWidget
+    ok_button*: PGtkWidget
+    apply_button*: PGtkWidget
+    cancel_button*: PGtkWidget
+    dialog_width*: gint
+    auto_resize*: gboolean
+
+  PGtkFontSelectionDialogClass* = ptr TGtkFontSelectionDialogClass
+  TGtkFontSelectionDialogClass* = object of TGtkDialogClass
+    gtk_reserved321: proc (){.cdecl.}
+    gtk_reserved322: proc (){.cdecl.}
+    gtk_reserved323: proc (){.cdecl.}
+    gtk_reserved324: proc (){.cdecl.}
+
+  PGtkGammaCurve* = ptr TGtkGammaCurve
+  TGtkGammaCurve* = object of TGtkVBox
+    table*: PGtkWidget
+    curve*: PGtkWidget
+    button*: array[0..4, PGtkWidget]
+    gamma*: gfloat
+    gamma_dialog*: PGtkWidget
+    gamma_text*: PGtkWidget
+
+  PGtkGammaCurveClass* = ptr TGtkGammaCurveClass
+  TGtkGammaCurveClass* = object of TGtkVBoxClass
+    gtk_reserved331: proc (){.cdecl.}
+    gtk_reserved332: proc (){.cdecl.}
+    gtk_reserved333: proc (){.cdecl.}
+    gtk_reserved334: proc (){.cdecl.}
+
+  PGtkHandleBox* = ptr TGtkHandleBox
+  TGtkHandleBox* = object of TGtkBin
+    bin_window*: PGdkWindow
+    float_window*: PGdkWindow
+    shadow_type*: TGtkShadowType
+    GtkHandleBox_flag0*: guint16
+    deskoff_x*: gint
+    deskoff_y*: gint
+    attach_allocation*: TGtkAllocation
+    float_allocation*: TGtkAllocation
+
+  PGtkHandleBoxClass* = ptr TGtkHandleBoxClass
+  TGtkHandleBoxClass* = object of TGtkBinClass
+    child_attached*: proc (handle_box: PGtkHandleBox, child: PGtkWidget){.cdecl.}
+    child_detached*: proc (handle_box: PGtkHandleBox, child: PGtkWidget){.cdecl.}
+    gtk_reserved341: proc (){.cdecl.}
+    gtk_reserved342: proc (){.cdecl.}
+    gtk_reserved343: proc (){.cdecl.}
+    gtk_reserved344: proc (){.cdecl.}
+
+  PGtkPaned* = ptr TGtkPaned
+  TGtkPaned* = object of TGtkContainer
+    child1*: PGtkWidget
+    child2*: PGtkWidget
+    handle*: PGdkWindow
+    xor_gc*: PGdkGC
+    cursor_type*: TGdkCursorType
+    handle_pos*: TGdkRectangle
+    child1_size*: gint
+    last_allocation*: gint
+    min_position*: gint
+    max_position*: gint
+    GtkPaned_flag0*: guint16
+    last_child1_focus*: PGtkWidget
+    last_child2_focus*: PGtkWidget
+    saved_focus*: PGtkWidget
+    drag_pos*: gint
+    original_position*: gint
+
+  PGtkPanedClass* = ptr TGtkPanedClass
+  TGtkPanedClass* = object of TGtkContainerClass
+    cycle_child_focus*: proc (paned: PGtkPaned, reverse: gboolean): gboolean{.
+        cdecl.}
+    toggle_handle_focus*: proc (paned: PGtkPaned): gboolean{.cdecl.}
+    move_handle*: proc (paned: PGtkPaned, scroll: TGtkScrollType): gboolean{.
+        cdecl.}
+    cycle_handle_focus*: proc (paned: PGtkPaned, reverse: gboolean): gboolean{.
+        cdecl.}
+    accept_position*: proc (paned: PGtkPaned): gboolean{.cdecl.}
+    cancel_position*: proc (paned: PGtkPaned): gboolean{.cdecl.}
+    gtk_reserved351: proc (){.cdecl.}
+    gtk_reserved352: proc (){.cdecl.}
+    gtk_reserved353: proc (){.cdecl.}
+    gtk_reserved354: proc (){.cdecl.}
+
+  PGtkHButtonBox* = ptr TGtkHButtonBox
+  TGtkHButtonBox* = object of TGtkButtonBox
+
+  PGtkHButtonBoxClass* = ptr TGtkHButtonBoxClass
+  TGtkHButtonBoxClass* = object of TGtkButtonBoxClass
+
+  PGtkHPaned* = ptr TGtkHPaned
+  TGtkHPaned* = object of TGtkPaned
+
+  PGtkHPanedClass* = ptr TGtkHPanedClass
+  TGtkHPanedClass* = object of TGtkPanedClass
+
+  PGtkRulerMetric* = ptr TGtkRulerMetric
+  PGtkRuler* = ptr TGtkRuler
+  TGtkRuler* = object of TGtkWidget
+    backing_store*: PGdkPixmap
+    non_gr_exp_gc*: PGdkGC
+    metric*: PGtkRulerMetric
+    xsrc*: gint
+    ysrc*: gint
+    slider_size*: gint
+    lower*: gdouble
+    upper*: gdouble
+    position*: gdouble
+    max_size*: gdouble
+
+  PGtkRulerClass* = ptr TGtkRulerClass
+  TGtkRulerClass* = object of TGtkWidgetClass
+    draw_ticks*: proc (ruler: PGtkRuler){.cdecl.}
+    draw_pos*: proc (ruler: PGtkRuler){.cdecl.}
+    gtk_reserved361: proc (){.cdecl.}
+    gtk_reserved362: proc (){.cdecl.}
+    gtk_reserved363: proc (){.cdecl.}
+    gtk_reserved364: proc (){.cdecl.}
+
+  TGtkRulerMetric* = record
+    metric_name*: cstring
+    abbrev*: cstring
+    pixels_per_unit*: gdouble
+    ruler_scale*: array[0..9, gdouble]
+    subdivide*: array[0..4, gint]
+
+  PGtkHRuler* = ptr TGtkHRuler
+  TGtkHRuler* = object of TGtkRuler
+
+  PGtkHRulerClass* = ptr TGtkHRulerClass
+  TGtkHRulerClass* = object of TGtkRulerClass
+
+  PGtkRcContext* = pointer
+  PGtkSettings* = ptr TGtkSettings
+  TGtkSettings* = object of TGObject
+    queued_settings*: PGData
+    property_values*: PGValue
+    rc_context*: PGtkRcContext
+    screen*: PGdkScreen
+
+  PGtkSettingsClass* = ptr TGtkSettingsClass
+  TGtkSettingsClass* = object of TGObjectClass
+
+  PGtkSettingsValue* = ptr TGtkSettingsValue
+  TGtkSettingsValue* = record
+    origin*: cstring
+    value*: TGValue
+
+  PGtkRcFlags* = ptr TGtkRcFlags
+  TGtkRcFlags* = int32
+  PGtkRcStyle* = ptr TGtkRcStyle
+  TGtkRcStyle* = object of TGObject
+    name*: cstring
+    bg_pixmap_name*: array[0..4, cstring]
+    font_desc*: PPangoFontDescription
+    color_flags*: array[0..4, TGtkRcFlags]
+    fg*: array[0..4, TGdkColor]
+    bg*: array[0..4, TGdkColor]
+    text*: array[0..4, TGdkColor]
+    base*: array[0..4, TGdkColor]
+    xthickness*: gint
+    ythickness*: gint
+    rc_properties*: PGArray
+    rc_style_lists*: PGSList
+    icon_factories*: PGSList
+    GtkRcStyle_flag0*: guint16
+
+  PGtkRcStyleClass* = ptr TGtkRcStyleClass
+  TGtkRcStyleClass* = object of TGObjectClass
+    create_rc_style*: proc (rc_style: PGtkRcStyle): PGtkRcStyle{.cdecl.}
+    parse*: proc (rc_style: PGtkRcStyle, settings: PGtkSettings,
+                  scanner: PGScanner): guint{.cdecl.}
+    merge*: proc (dest: PGtkRcStyle, src: PGtkRcStyle){.cdecl.}
+    create_style*: proc (rc_style: PGtkRcStyle): PGtkStyle{.cdecl.}
+    gtk_reserved371: proc (){.cdecl.}
+    gtk_reserved372: proc (){.cdecl.}
+    gtk_reserved373: proc (){.cdecl.}
+    gtk_reserved374: proc (){.cdecl.}
+
+  PGtkRcTokenType* = ptr TGtkRcTokenType
+  TGtkRcTokenType* = enum
+    GTK_RC_TOKEN_INVALID, GTK_RC_TOKEN_INCLUDE, GTK_RC_TOKEN_NORMAL,
+    GTK_RC_TOKEN_ACTIVE, GTK_RC_TOKEN_PRELIGHT, GTK_RC_TOKEN_SELECTED,
+    GTK_RC_TOKEN_INSENSITIVE, GTK_RC_TOKEN_FG, GTK_RC_TOKEN_BG,
+    GTK_RC_TOKEN_TEXT, GTK_RC_TOKEN_BASE, GTK_RC_TOKEN_XTHICKNESS,
+    GTK_RC_TOKEN_YTHICKNESS, GTK_RC_TOKEN_FONT, GTK_RC_TOKEN_FONTSET,
+    GTK_RC_TOKEN_FONT_NAME, GTK_RC_TOKEN_BG_PIXMAP, GTK_RC_TOKEN_PIXMAP_PATH,
+    GTK_RC_TOKEN_STYLE, GTK_RC_TOKEN_BINDING, GTK_RC_TOKEN_BIND,
+    GTK_RC_TOKEN_WIDGET, GTK_RC_TOKEN_WIDGET_CLASS, GTK_RC_TOKEN_CLASS,
+    GTK_RC_TOKEN_LOWEST, GTK_RC_TOKEN_GTK, GTK_RC_TOKEN_APPLICATION,
+    GTK_RC_TOKEN_THEME, GTK_RC_TOKEN_RC, GTK_RC_TOKEN_HIGHEST,
+    GTK_RC_TOKEN_ENGINE, GTK_RC_TOKEN_MODULE_PATH, GTK_RC_TOKEN_IM_MODULE_PATH,
+    GTK_RC_TOKEN_IM_MODULE_FILE, GTK_RC_TOKEN_STOCK, GTK_RC_TOKEN_LTR,
+    GTK_RC_TOKEN_RTL, GTK_RC_TOKEN_LAST
+  PGtkRcProperty* = ptr TGtkRcProperty
+  TGtkRcProperty* = record
+    type_name*: TGQuark
+    property_name*: TGQuark
+    origin*: cstring
+    value*: TGValue
+
+  PGtkIconSource* = pointer
+  TGtkRcPropertyParser* = proc (pspec: PGParamSpec, rc_string: PGString,
+                                property_value: PGValue): gboolean{.cdecl.}
+  TGtkStyle* = object of TGObject
+    fg*: array[0..4, TGdkColor]
+    bg*: array[0..4, TGdkColor]
+    light*: array[0..4, TGdkColor]
+    dark*: array[0..4, TGdkColor]
+    mid*: array[0..4, TGdkColor]
+    text*: array[0..4, TGdkColor]
+    base*: array[0..4, TGdkColor]
+    text_aa*: array[0..4, TGdkColor]
+    black*: TGdkColor
+    white*: TGdkColor
+    font_desc*: PPangoFontDescription
+    xthickness*: gint
+    ythickness*: gint
+    fg_gc*: array[0..4, PGdkGC]
+    bg_gc*: array[0..4, PGdkGC]
+    light_gc*: array[0..4, PGdkGC]
+    dark_gc*: array[0..4, PGdkGC]
+    mid_gc*: array[0..4, PGdkGC]
+    text_gc*: array[0..4, PGdkGC]
+    base_gc*: array[0..4, PGdkGC]
+    text_aa_gc*: array[0..4, PGdkGC]
+    black_gc*: PGdkGC
+    white_gc*: PGdkGC
+    bg_pixmap*: array[0..4, PGdkPixmap]
+    attach_count*: gint
+    depth*: gint
+    colormap*: PGdkColormap
+    private_font*: PGdkFont
+    private_font_desc*: PPangoFontDescription
+    rc_style*: PGtkRcStyle
+    styles*: PGSList
+    property_cache*: PGArray
+    icon_factories*: PGSList
+
+  PGtkStyleClass* = ptr TGtkStyleClass
+  TGtkStyleClass* = object of TGObjectClass
+    realize*: proc (style: PGtkStyle){.cdecl.}
+    unrealize*: proc (style: PGtkStyle){.cdecl.}
+    copy*: proc (style: PGtkStyle, src: PGtkStyle){.cdecl.}
+    clone*: proc (style: PGtkStyle): PGtkStyle{.cdecl.}
+    init_from_rc*: proc (style: PGtkStyle, rc_style: PGtkRcStyle){.cdecl.}
+    set_background*: proc (style: PGtkStyle, window: PGdkWindow,
+                           state_type: TGtkStateType){.cdecl.}
+    render_icon*: proc (style: PGtkStyle, source: PGtkIconSource,
+                        direction: TGtkTextDirection, state: TGtkStateType,
+                        size: TGtkIconSize, widget: PGtkWidget, detail: cstring): PGdkPixbuf{.
+        cdecl.}
+    draw_hline*: proc (style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, area: PGdkRectangle,
+                       widget: PGtkWidget, detail: cstring, x1: gint, x2: gint,
+                       y: gint){.cdecl.}
+    draw_vline*: proc (style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, area: PGdkRectangle,
+                       widget: PGtkWidget, detail: cstring, y1: gint, y2: gint,
+                       x: gint){.cdecl.}
+    draw_shadow*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_polygon*: proc (style: PGtkStyle, window: PGdkWindow,
+                         state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                         area: PGdkRectangle, widget: PGtkWidget,
+                         detail: cstring, point: PGdkPoint, npoints: gint,
+                         fill: gboolean){.cdecl.}
+    draw_arrow*: proc (style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       arrow_type: TGtkArrowType, fill: gboolean, x: gint,
+                       y: gint, width: gint, height: gint){.cdecl.}
+    draw_diamond*: proc (style: PGtkStyle, window: PGdkWindow,
+                         state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                         area: PGdkRectangle, widget: PGtkWidget,
+                         detail: cstring, x: gint, y: gint, width: gint,
+                         height: gint){.cdecl.}
+    draw_string*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, area: PGdkRectangle,
+                        widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                        `string`: cstring){.cdecl.}
+    draw_box*: proc (style: PGtkStyle, window: PGdkWindow,
+                     state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                     area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                     x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_flat_box*: proc (style: PGtkStyle, window: PGdkWindow,
+                          state_type: TGtkStateType,
+                          shadow_type: TGtkShadowType, area: PGdkRectangle,
+                          widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                          width: gint, height: gint){.cdecl.}
+    draw_check*: proc (style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_option*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_tab*: proc (style: PGtkStyle, window: PGdkWindow,
+                     state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                     area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                     x: gint, y: gint, width: gint, height: gint){.cdecl.}
+    draw_shadow_gap*: proc (style: PGtkStyle, window: PGdkWindow,
+                            state_type: TGtkStateType,
+                            shadow_type: TGtkShadowType, area: PGdkRectangle,
+                            widget: PGtkWidget, detail: cstring, x: gint,
+                            y: gint, width: gint, height: gint,
+                            gap_side: TGtkPositionType, gap_x: gint,
+                            gap_width: gint){.cdecl.}
+    draw_box_gap*: proc (style: PGtkStyle, window: PGdkWindow,
+                         state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                         area: PGdkRectangle, widget: PGtkWidget,
+                         detail: cstring, x: gint, y: gint, width: gint,
+                         height: gint, gap_side: TGtkPositionType, gap_x: gint,
+                         gap_width: gint){.cdecl.}
+    draw_extension*: proc (style: PGtkStyle, window: PGdkWindow,
+                           state_type: TGtkStateType,
+                           shadow_type: TGtkShadowType, area: PGdkRectangle,
+                           widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                           width: gint, height: gint, gap_side: TGtkPositionType){.
+        cdecl.}
+    draw_focus*: proc (style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, area: PGdkRectangle,
+                       widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                       width: gint, height: gint){.cdecl.}
+    draw_slider*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint,
+                        orientation: TGtkOrientation){.cdecl.}
+    draw_handle*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint,
+                        orientation: TGtkOrientation){.cdecl.}
+    draw_expander*: proc (style: PGtkStyle, window: PGdkWindow,
+                          state_type: TGtkStateType, area: PGdkRectangle,
+                          widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                          expander_style: TGtkExpanderStyle){.cdecl.}
+    draw_layout*: proc (style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, use_text: gboolean,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, layout: PPangoLayout){.cdecl.}
+    draw_resize_grip*: proc (style: PGtkStyle, window: PGdkWindow,
+                             state_type: TGtkStateType, area: PGdkRectangle,
+                             widget: PGtkWidget, detail: cstring,
+                             edge: TGdkWindowEdge, x: gint, y: gint,
+                             width: gint, height: gint){.cdecl.}
+    gtk_reserved381: proc (){.cdecl.}
+    gtk_reserved382: proc (){.cdecl.}
+    gtk_reserved383: proc (){.cdecl.}
+    gtk_reserved384: proc (){.cdecl.}
+    gtk_reserved385: proc (){.cdecl.}
+    gtk_reserved386: proc (){.cdecl.}
+    gtk_reserved387: proc (){.cdecl.}
+    gtk_reserved388: proc (){.cdecl.}
+    gtk_reserved389: proc (){.cdecl.}
+    gtk_reserved3810: proc (){.cdecl.}
+    gtk_reserved3811: proc (){.cdecl.}
+    gtk_reserved3812: proc (){.cdecl.}
+
+  PGtkBorder* = ptr TGtkBorder
+  TGtkBorder* = record
+    left*: gint
+    right*: gint
+    top*: gint
+    bottom*: gint
+
+  PGtkRangeLayout* = pointer
+  PGtkRangeStepTimer* = pointer
+  PGtkRange* = ptr TGtkRange
+  TGtkRange* = object of TGtkWidget
+    adjustment*: PGtkAdjustment
+    update_policy*: TGtkUpdateType
+    GtkRange_flag0*: guint16
+    min_slider_size*: gint
+    orientation*: TGtkOrientation
+    range_rect*: TGdkRectangle
+    slider_start*: gint
+    slider_end*: gint
+    round_digits*: gint
+    flag1*: guint16
+    layout*: PGtkRangeLayout
+    timer*: PGtkRangeStepTimer
+    slide_initial_slider_position*: gint
+    slide_initial_coordinate*: gint
+    update_timeout_id*: guint
+    event_window*: PGdkWindow
+
+  PGtkRangeClass* = ptr TGtkRangeClass
+  TGtkRangeClass* = object of TGtkWidgetClass
+    slider_detail*: cstring
+    stepper_detail*: cstring
+    value_changed*: proc (range: PGtkRange){.cdecl.}
+    adjust_bounds*: proc (range: PGtkRange, new_value: gdouble){.cdecl.}
+    move_slider*: proc (range: PGtkRange, scroll: TGtkScrollType){.cdecl.}
+    get_range_border*: proc (range: PGtkRange, border: PGtkBorder){.cdecl.}
+    gtk_reserved401: proc (){.cdecl.}
+    gtk_reserved402: proc (){.cdecl.}
+    gtk_reserved403: proc (){.cdecl.}
+    gtk_reserved404: proc (){.cdecl.}
+
+  PGtkScale* = ptr TGtkScale
+  TGtkScale* = object of TGtkRange
+    digits*: gint
+    GtkScale_flag0*: guint16
+
+  PGtkScaleClass* = ptr TGtkScaleClass
+  TGtkScaleClass* = object of TGtkRangeClass
+    format_value*: proc (scale: PGtkScale, value: gdouble): cstring{.cdecl.}
+    draw_value*: proc (scale: PGtkScale){.cdecl.}
+    gtk_reserved411: proc (){.cdecl.}
+    gtk_reserved412: proc (){.cdecl.}
+    gtk_reserved413: proc (){.cdecl.}
+    gtk_reserved414: proc (){.cdecl.}
+
+  PGtkHScale* = ptr TGtkHScale
+  TGtkHScale* = object of TGtkScale
+
+  PGtkHScaleClass* = ptr TGtkHScaleClass
+  TGtkHScaleClass* = object of TGtkScaleClass
+
+  PGtkScrollbar* = ptr TGtkScrollbar
+  TGtkScrollbar* = object of TGtkRange
+
+  PGtkScrollbarClass* = ptr TGtkScrollbarClass
+  TGtkScrollbarClass* = object of TGtkRangeClass
+    gtk_reserved421: proc (){.cdecl.}
+    gtk_reserved422: proc (){.cdecl.}
+    gtk_reserved423: proc (){.cdecl.}
+    gtk_reserved424: proc (){.cdecl.}
+
+  PGtkHScrollbar* = ptr TGtkHScrollbar
+  TGtkHScrollbar* = object of TGtkScrollbar
+
+  PGtkHScrollbarClass* = ptr TGtkHScrollbarClass
+  TGtkHScrollbarClass* = object of TGtkScrollbarClass
+
+  PGtkSeparator* = ptr TGtkSeparator
+  TGtkSeparator* = object of TGtkWidget
+
+  PGtkSeparatorClass* = ptr TGtkSeparatorClass
+  TGtkSeparatorClass* = object of TGtkWidgetClass
+
+  PGtkHSeparator* = ptr TGtkHSeparator
+  TGtkHSeparator* = object of TGtkSeparator
+
+  PGtkHSeparatorClass* = ptr TGtkHSeparatorClass
+  TGtkHSeparatorClass* = object of TGtkSeparatorClass
+
+  PGtkIconFactory* = ptr TGtkIconFactory
+  TGtkIconFactory* = object of TGObject
+    icons*: PGHashTable
+
+  PGtkIconFactoryClass* = ptr TGtkIconFactoryClass
+  TGtkIconFactoryClass* = object of TGObjectClass
+    gtk_reserved431: proc (){.cdecl.}
+    gtk_reserved432: proc (){.cdecl.}
+    gtk_reserved433: proc (){.cdecl.}
+    gtk_reserved434: proc (){.cdecl.}
+
+  PGtkIconSet* = pointer
+  PGtkImagePixmapData* = ptr TGtkImagePixmapData
+  TGtkImagePixmapData* = record
+    pixmap*: PGdkPixmap
+
+  PGtkImageImageData* = ptr TGtkImageImageData
+  TGtkImageImageData* = record
+    image*: PGdkImage
+
+  PGtkImagePixbufData* = ptr TGtkImagePixbufData
+  TGtkImagePixbufData* = record
+    pixbuf*: PGdkPixbuf
+
+  PGtkImageStockData* = ptr TGtkImageStockData
+  TGtkImageStockData* = record
+    stock_id*: cstring
+
+  PGtkImageIconSetData* = ptr TGtkImageIconSetData
+  TGtkImageIconSetData* = record
+    icon_set*: PGtkIconSet
+
+  PGtkImageAnimationData* = ptr TGtkImageAnimationData
+  TGtkImageAnimationData* = record
+    anim*: PGdkPixbufAnimation
+    iter*: PGdkPixbufAnimationIter
+    frame_timeout*: guint
+
+  PGtkImageType* = ptr TGtkImageType
+  TGtkImageType* = enum
+    GTK_IMAGE_EMPTY, GTK_IMAGE_PIXMAP, GTK_IMAGE_IMAGE, GTK_IMAGE_PIXBUF,
+    GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET, GTK_IMAGE_ANIMATION
+  PGtkImage* = ptr TGtkImage
+  TGtkImage* = object of TGtkMisc
+    storage_type*: TGtkImageType
+    pixmap*: TGtkImagePixmapData
+    mask*: PGdkBitmap
+    icon_size*: TGtkIconSize
+
+  PGtkImageClass* = ptr TGtkImageClass
+  TGtkImageClass* = object of TGtkMiscClass
+    gtk_reserved441: proc (){.cdecl.}
+    gtk_reserved442: proc (){.cdecl.}
+    gtk_reserved443: proc (){.cdecl.}
+    gtk_reserved444: proc (){.cdecl.}
+
+  PGtkImageMenuItem* = ptr TGtkImageMenuItem
+  TGtkImageMenuItem* = object of TGtkMenuItem
+    image*: PGtkWidget
+
+  PGtkImageMenuItemClass* = ptr TGtkImageMenuItemClass
+  TGtkImageMenuItemClass* = object of TGtkMenuItemClass
+
+  PGtkIMContextSimple* = ptr TGtkIMContextSimple
+  TGtkIMContextSimple* = object of TGtkIMContext
+    tables*: PGSList
+    compose_buffer*: array[0..(GTK_MAX_COMPOSE_LEN + 1) - 1, guint]
+    tentative_match*: gunichar
+    tentative_match_len*: gint
+    GtkIMContextSimple_flag0*: guint16
+
+  PGtkIMContextSimpleClass* = ptr TGtkIMContextSimpleClass
+  TGtkIMContextSimpleClass* = object of TGtkIMContextClass
+
+  PGtkIMMulticontext* = ptr TGtkIMMulticontext
+  TGtkIMMulticontext* = object of TGtkIMContext
+    slave*: PGtkIMContext
+    client_window*: PGdkWindow
+    context_id*: cstring
+
+  PGtkIMMulticontextClass* = ptr TGtkIMMulticontextClass
+  TGtkIMMulticontextClass* = object of TGtkIMContextClass
+    gtk_reserved451: proc (){.cdecl.}
+    gtk_reserved452: proc (){.cdecl.}
+    gtk_reserved453: proc (){.cdecl.}
+    gtk_reserved454: proc (){.cdecl.}
+
+  PGtkInputDialog* = ptr TGtkInputDialog
+  TGtkInputDialog* = object of TGtkDialog
+    axis_list*: PGtkWidget
+    axis_listbox*: PGtkWidget
+    mode_optionmenu*: PGtkWidget
+    close_button*: PGtkWidget
+    save_button*: PGtkWidget
+    axis_items*: array[0..(GDK_AXIS_LAST) - 1, PGtkWidget]
+    current_device*: PGdkDevice
+    keys_list*: PGtkWidget
+    keys_listbox*: PGtkWidget
+
+  PGtkInputDialogClass* = ptr TGtkInputDialogClass
+  TGtkInputDialogClass* = object of TGtkDialogClass
+    enable_device*: proc (inputd: PGtkInputDialog, device: PGdkDevice){.cdecl.}
+    disable_device*: proc (inputd: PGtkInputDialog, device: PGdkDevice){.cdecl.}
+    gtk_reserved461: proc (){.cdecl.}
+    gtk_reserved462: proc (){.cdecl.}
+    gtk_reserved463: proc (){.cdecl.}
+    gtk_reserved464: proc (){.cdecl.}
+
+  PGtkInvisible* = ptr TGtkInvisible
+  TGtkInvisible* = object of TGtkWidget
+    has_user_ref_count*: gboolean
+    screen*: PGdkScreen
+
+  PGtkInvisibleClass* = ptr TGtkInvisibleClass
+  TGtkInvisibleClass* = object of TGtkWidgetClass
+    gtk_reserved701: proc (){.cdecl.}
+    gtk_reserved702: proc (){.cdecl.}
+    gtk_reserved703: proc (){.cdecl.}
+    gtk_reserved704: proc (){.cdecl.}
+
+  TGtkPrintFunc* = proc (func_data: gpointer, str: cstring){.cdecl.}
+  PGtkTranslateFunc* = ptr TGtkTranslateFunc
+  TGtkTranslateFunc* = gchar
+  TGtkItemFactoryCallback* = proc (){.cdecl.}
+  TGtkItemFactoryCallback1* = proc (callback_data: gpointer,
+                                    callback_action: guint, widget: PGtkWidget){.
+      cdecl.}
+  PGtkItemFactory* = ptr TGtkItemFactory
+  TGtkItemFactory* = object of TGtkObject
+    path*: cstring
+    accel_group*: PGtkAccelGroup
+    widget*: PGtkWidget
+    items*: PGSList
+    translate_func*: TGtkTranslateFunc
+    translate_data*: gpointer
+    translate_notify*: TGtkDestroyNotify
+
+  PGtkItemFactoryClass* = ptr TGtkItemFactoryClass
+  TGtkItemFactoryClass* = object of TGtkObjectClass
+    item_ht*: PGHashTable
+    gtk_reserved471: proc (){.cdecl.}
+    gtk_reserved472: proc (){.cdecl.}
+    gtk_reserved473: proc (){.cdecl.}
+    gtk_reserved474: proc (){.cdecl.}
+
+  PGtkItemFactoryEntry* = ptr TGtkItemFactoryEntry
+  TGtkItemFactoryEntry* = record
+    path*: cstring
+    accelerator*: cstring
+    callback*: TGtkItemFactoryCallback
+    callback_action*: guint
+    item_type*: cstring
+    extra_data*: gconstpointer
+
+  PGtkItemFactoryItem* = ptr TGtkItemFactoryItem
+  TGtkItemFactoryItem* = record
+    path*: cstring
+    widgets*: PGSList
+
+  PGtkLayout* = ptr TGtkLayout
+  TGtkLayout* = object of TGtkContainer
+    children*: PGList
+    width*: guint
+    height*: guint
+    hadjustment*: PGtkAdjustment
+    vadjustment*: PGtkAdjustment
+    bin_window*: PGdkWindow
+    visibility*: TGdkVisibilityState
+    scroll_x*: gint
+    scroll_y*: gint
+    freeze_count*: guint
+
+  PGtkLayoutClass* = ptr TGtkLayoutClass
+  TGtkLayoutClass* = object of TGtkContainerClass
+    set_scroll_adjustments*: proc (layout: PGtkLayout,
+                                   hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+    gtk_reserved481: proc (){.cdecl.}
+    gtk_reserved482: proc (){.cdecl.}
+    gtk_reserved483: proc (){.cdecl.}
+    gtk_reserved484: proc (){.cdecl.}
+
+  PGtkList* = ptr TGtkList
+  TGtkList* = object of TGtkContainer
+    children*: PGList
+    selection*: PGList
+    undo_selection*: PGList
+    undo_unselection*: PGList
+    last_focus_child*: PGtkWidget
+    undo_focus_child*: PGtkWidget
+    htimer*: guint
+    vtimer*: guint
+    anchor*: gint
+    drag_pos*: gint
+    anchor_state*: TGtkStateType
+    GtkList_flag0*: guint16
+
+  PGtkListClass* = ptr TGtkListClass
+  TGtkListClass* = object of TGtkContainerClass
+    selection_changed*: proc (list: PGtkList){.cdecl.}
+    select_child*: proc (list: PGtkList, child: PGtkWidget){.cdecl.}
+    unselect_child*: proc (list: PGtkList, child: PGtkWidget){.cdecl.}
+
+  TGtkTreeModelForeachFunc* = proc (model: PGtkTreeModel, path: PGtkTreePath,
+                                    iter: PGtkTreeIter, data: gpointer): gboolean{.
+      cdecl.}
+  PGtkTreeModelFlags* = ptr TGtkTreeModelFlags
+  TGtkTreeModelFlags* = int32
+  TGtkTreeIter* = record
+    stamp*: gint
+    user_data*: gpointer
+    user_data2*: gpointer
+    user_data3*: gpointer
+
+  PGtkTreeModelIface* = ptr TGtkTreeModelIface
+  TGtkTreeModelIface* = object of TGTypeInterface
+    row_changed*: proc (tree_model: PGtkTreeModel, path: PGtkTreePath,
+                        iter: PGtkTreeIter){.cdecl.}
+    row_inserted*: proc (tree_model: PGtkTreeModel, path: PGtkTreePath,
+                         iter: PGtkTreeIter){.cdecl.}
+    row_has_child_toggled*: proc (tree_model: PGtkTreeModel, path: PGtkTreePath,
+                                  iter: PGtkTreeIter){.cdecl.}
+    row_deleted*: proc (tree_model: PGtkTreeModel, path: PGtkTreePath){.cdecl.}
+    rows_reordered*: proc (tree_model: PGtkTreeModel, path: PGtkTreePath,
+                           iter: PGtkTreeIter, new_order: Pgint){.cdecl.}
+    get_flags*: proc (tree_model: PGtkTreeModel): TGtkTreeModelFlags{.cdecl.}
+    get_n_columns*: proc (tree_model: PGtkTreeModel): gint{.cdecl.}
+    get_column_type*: proc (tree_model: PGtkTreeModel, index: gint): GType{.
+        cdecl.}
+    get_iter*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                     path: PGtkTreePath): gboolean{.cdecl.}
+    get_path*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter): PGtkTreePath{.
+        cdecl.}
+    get_value*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                      column: gint, value: PGValue){.cdecl.}
+    iter_next*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter): gboolean{.
+        cdecl.}
+    iter_children*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                          parent: PGtkTreeIter): gboolean{.cdecl.}
+    iter_has_child*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter): gboolean{.
+        cdecl.}
+    iter_n_children*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter): gint{.
+        cdecl.}
+    iter_nth_child*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                           parent: PGtkTreeIter, n: gint): gboolean{.cdecl.}
+    iter_parent*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                        child: PGtkTreeIter): gboolean{.cdecl.}
+    ref_node*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter){.cdecl.}
+    unref_node*: proc (tree_model: PGtkTreeModel, iter: PGtkTreeIter){.cdecl.}
+
+  PGtkTreeSortable* = pointer
+  TGtkTreeIterCompareFunc* = proc (model: PGtkTreeModel, a: PGtkTreeIter,
+                                   b: PGtkTreeIter, user_data: gpointer): gint{.
+      cdecl.}
+  PGtkTreeSortableIface* = ptr TGtkTreeSortableIface
+  TGtkTreeSortableIface* = object of TGTypeInterface
+    sort_column_changed*: proc (sortable: PGtkTreeSortable){.cdecl.}
+    get_sort_column_id*: proc (sortable: PGtkTreeSortable,
+                               sort_column_id: Pgint, order: PGtkSortType): gboolean{.
+        cdecl.}
+    set_sort_column_id*: proc (sortable: PGtkTreeSortable, sort_column_id: gint,
+                               order: TGtkSortType){.cdecl.}
+    set_sort_func*: proc (sortable: PGtkTreeSortable, sort_column_id: gint,
+                          func: TGtkTreeIterCompareFunc, data: gpointer,
+                          destroy: TGtkDestroyNotify){.cdecl.}
+    set_default_sort_func*: proc (sortable: PGtkTreeSortable,
+                                  func: TGtkTreeIterCompareFunc, data: gpointer,
+                                  destroy: TGtkDestroyNotify){.cdecl.}
+    has_default_sort_func*: proc (sortable: PGtkTreeSortable): gboolean{.cdecl.}
+
+  PGtkTreeModelSort* = ptr TGtkTreeModelSort
+  TGtkTreeModelSort* = object of TGObject
+    root*: gpointer
+    stamp*: gint
+    child_flags*: guint
+    child_model*: PGtkTreeModel
+    zero_ref_count*: gint
+    sort_list*: PGList
+    sort_column_id*: gint
+    order*: TGtkSortType
+    default_sort_func*: TGtkTreeIterCompareFunc
+    default_sort_data*: gpointer
+    default_sort_destroy*: TGtkDestroyNotify
+    changed_id*: guint
+    inserted_id*: guint
+    has_child_toggled_id*: guint
+    deleted_id*: guint
+    reordered_id*: guint
+
+  PGtkTreeModelSortClass* = ptr TGtkTreeModelSortClass
+  TGtkTreeModelSortClass* = object of TGObjectClass
+    gtk_reserved491: proc (){.cdecl.}
+    gtk_reserved492: proc (){.cdecl.}
+    gtk_reserved493: proc (){.cdecl.}
+    gtk_reserved494: proc (){.cdecl.}
+
+  PGtkListStore* = ptr TGtkListStore
+  TGtkListStore* = object of TGObject
+    stamp*: gint
+    root*: gpointer
+    tail*: gpointer
+    sort_list*: PGList
+    n_columns*: gint
+    sort_column_id*: gint
+    order*: TGtkSortType
+    column_headers*: PGType
+    length*: gint
+    default_sort_func*: TGtkTreeIterCompareFunc
+    default_sort_data*: gpointer
+    default_sort_destroy*: TGtkDestroyNotify
+    GtkListStore_flag0*: guint16
+
+  PGtkListStoreClass* = ptr TGtkListStoreClass
+  TGtkListStoreClass* = object of TGObjectClass
+    gtk_reserved501: proc (){.cdecl.}
+    gtk_reserved502: proc (){.cdecl.}
+    gtk_reserved503: proc (){.cdecl.}
+    gtk_reserved504: proc (){.cdecl.}
+
+  TGtkModuleInitFunc* = proc (argc: Pgint, argv: PPPgchar){.cdecl.}
+  TGtkKeySnoopFunc* = proc (grab_widget: PGtkWidget, event: PGdkEventKey,
+                            func_data: gpointer): gint{.cdecl.}
+  PGtkMenuBar* = ptr TGtkMenuBar
+  TGtkMenuBar* = object of TGtkMenuShell
+
+  PGtkMenuBarClass* = ptr TGtkMenuBarClass
+  TGtkMenuBarClass* = object of TGtkMenuShellClass
+    gtk_reserved511: proc (){.cdecl.}
+    gtk_reserved512: proc (){.cdecl.}
+    gtk_reserved513: proc (){.cdecl.}
+    gtk_reserved514: proc (){.cdecl.}
+
+  PGtkMessageType* = ptr TGtkMessageType
+  TGtkMessageType* = enum
+    GTK_MESSAGE_INFO, GTK_MESSAGE_WARNING, GTK_MESSAGE_QUESTION,
+    GTK_MESSAGE_ERROR
+  PGtkButtonsType* = ptr TGtkButtonsType
+  TGtkButtonsType* = enum
+    GTK_BUTTONS_NONE, GTK_BUTTONS_OK, GTK_BUTTONS_CLOSE, GTK_BUTTONS_CANCEL,
+    GTK_BUTTONS_YES_NO, GTK_BUTTONS_OK_CANCEL
+  PGtkMessageDialog* = ptr TGtkMessageDialog
+  TGtkMessageDialog* = object of TGtkDialog
+    image*: PGtkWidget
+    label*: PGtkWidget
+
+  PGtkMessageDialogClass* = ptr TGtkMessageDialogClass
+  TGtkMessageDialogClass* = object of TGtkDialogClass
+    gtk_reserved521: proc (){.cdecl.}
+    gtk_reserved522: proc (){.cdecl.}
+    gtk_reserved523: proc (){.cdecl.}
+    gtk_reserved524: proc (){.cdecl.}
+
+  PGtkNotebookPage* = pointer
+  PGtkNotebookTab* = ptr TGtkNotebookTab
+  TGtkNotebookTab* = enum
+    GTK_NOTEBOOK_TAB_FIRST, GTK_NOTEBOOK_TAB_LAST
+  PGtkNotebook* = ptr TGtkNotebook
+  TGtkNotebook* = object of TGtkContainer
+    cur_page*: PGtkNotebookPage
+    children*: PGList
+    first_tab*: PGList
+    focus_tab*: PGList
+    menu*: PGtkWidget
+    event_window*: PGdkWindow
+    timer*: guint32
+    tab_hborder*: guint16
+    tab_vborder*: guint16
+    GtkNotebook_flag0*: guint16
+
+  PGtkNotebookClass* = ptr TGtkNotebookClass
+  TGtkNotebookClass* = object of TGtkContainerClass
+    switch_page*: proc (notebook: PGtkNotebook, page: PGtkNotebookPage,
+                        page_num: guint){.cdecl.}
+    select_page*: proc (notebook: PGtkNotebook, move_focus: gboolean): gboolean{.
+        cdecl.}
+    focus_tab*: proc (notebook: PGtkNotebook, thetype: TGtkNotebookTab): gboolean{.
+        cdecl.}
+    change_current_page*: proc (notebook: PGtkNotebook, offset: gint){.cdecl.}
+    move_focus_out*: proc (notebook: PGtkNotebook, direction: TGtkDirectionType){.
+        cdecl.}
+    gtk_reserved531: proc (){.cdecl.}
+    gtk_reserved532: proc (){.cdecl.}
+    gtk_reserved533: proc (){.cdecl.}
+    gtk_reserved534: proc (){.cdecl.}
+
+  PGtkOldEditable* = ptr TGtkOldEditable
+  TGtkOldEditable* = object of TGtkWidget
+    current_pos*: guint
+    selection_start_pos*: guint
+    selection_end_pos*: guint
+    GtkOldEditable_flag0*: guint16
+    clipboard_text*: cstring
+
+  TGtkTextFunction* = proc (editable: PGtkOldEditable, time: guint32){.cdecl.}
+  PGtkOldEditableClass* = ptr TGtkOldEditableClass
+  TGtkOldEditableClass* = object of TGtkWidgetClass
+    activate*: proc (editable: PGtkOldEditable){.cdecl.}
+    set_editable*: proc (editable: PGtkOldEditable, is_editable: gboolean){.
+        cdecl.}
+    move_cursor*: proc (editable: PGtkOldEditable, x: gint, y: gint){.cdecl.}
+    move_word*: proc (editable: PGtkOldEditable, n: gint){.cdecl.}
+    move_page*: proc (editable: PGtkOldEditable, x: gint, y: gint){.cdecl.}
+    move_to_row*: proc (editable: PGtkOldEditable, row: gint){.cdecl.}
+    move_to_column*: proc (editable: PGtkOldEditable, row: gint){.cdecl.}
+    kill_char*: proc (editable: PGtkOldEditable, direction: gint){.cdecl.}
+    kill_word*: proc (editable: PGtkOldEditable, direction: gint){.cdecl.}
+    kill_line*: proc (editable: PGtkOldEditable, direction: gint){.cdecl.}
+    cut_clipboard*: proc (editable: PGtkOldEditable){.cdecl.}
+    copy_clipboard*: proc (editable: PGtkOldEditable){.cdecl.}
+    paste_clipboard*: proc (editable: PGtkOldEditable){.cdecl.}
+    update_text*: proc (editable: PGtkOldEditable, start_pos: gint,
+                        end_pos: gint){.cdecl.}
+    get_chars*: proc (editable: PGtkOldEditable, start_pos: gint, end_pos: gint): cstring{.
+        cdecl.}
+    set_selection*: proc (editable: PGtkOldEditable, start_pos: gint,
+                          end_pos: gint){.cdecl.}
+    set_position*: proc (editable: PGtkOldEditable, position: gint){.cdecl.}
+
+  PGtkOptionMenu* = ptr TGtkOptionMenu
+  TGtkOptionMenu* = object of TGtkButton
+    menu*: PGtkWidget
+    menu_item*: PGtkWidget
+    width*: guint16
+    height*: guint16
+
+  PGtkOptionMenuClass* = ptr TGtkOptionMenuClass
+  TGtkOptionMenuClass* = object of TGtkButtonClass
+    changed*: proc (option_menu: PGtkOptionMenu){.cdecl.}
+    gtk_reserved541: proc (){.cdecl.}
+    gtk_reserved542: proc (){.cdecl.}
+    gtk_reserved543: proc (){.cdecl.}
+    gtk_reserved544: proc (){.cdecl.}
+
+  PGtkPixmap* = ptr TGtkPixmap
+  TGtkPixmap* = object of TGtkMisc
+    pixmap*: PGdkPixmap
+    mask*: PGdkBitmap
+    pixmap_insensitive*: PGdkPixmap
+    GtkPixmap_flag0*: guint16
+
+  PGtkPixmapClass* = ptr TGtkPixmapClass
+  TGtkPixmapClass* = object of TGtkMiscClass
+
+  PGtkPlug* = ptr TGtkPlug
+  TGtkPlug* = object of TGtkWindow
+    socket_window*: PGdkWindow
+    modality_window*: PGtkWidget
+    modality_group*: PGtkWindowGroup
+    grabbed_keys*: PGHashTable
+    GtkPlug_flag0*: guint16
+
+  PGtkPlugClass* = ptr TGtkPlugClass
+  TGtkPlugClass* = object of TGtkWindowClass
+    embedded*: proc (plug: PGtkPlug){.cdecl.}
+    gtk_reserved551: proc (){.cdecl.}
+    gtk_reserved552: proc (){.cdecl.}
+    gtk_reserved553: proc (){.cdecl.}
+    gtk_reserved554: proc (){.cdecl.}
+
+  PGtkPreview* = ptr TGtkPreview
+  TGtkPreview* = object of TGtkWidget
+    buffer*: Pguchar
+    buffer_width*: guint16
+    buffer_height*: guint16
+    bpp*: guint16
+    rowstride*: guint16
+    dither*: TGdkRgbDither
+    GtkPreview_flag0*: guint16
+
+  PGtkPreviewInfo* = ptr TGtkPreviewInfo
+  TGtkPreviewInfo* = record
+    lookup*: Pguchar
+    gamma*: gdouble
+
+  PGtkDitherInfo* = ptr TGtkDitherInfo
+  TGtkDitherInfo* = record
+    c*: array[0..3, guchar]
+
+  PGtkPreviewClass* = ptr TGtkPreviewClass
+  TGtkPreviewClass* = object of TGtkWidgetClass
+    info*: TGtkPreviewInfo
+
+  PGtkProgress* = ptr TGtkProgress
+  TGtkProgress* = object of TGtkWidget
+    adjustment*: PGtkAdjustment
+    offscreen_pixmap*: PGdkPixmap
+    format*: cstring
+    x_align*: gfloat
+    y_align*: gfloat
+    GtkProgress_flag0*: guint16
+
+  PGtkProgressClass* = ptr TGtkProgressClass
+  TGtkProgressClass* = object of TGtkWidgetClass
+    paint*: proc (progress: PGtkProgress){.cdecl.}
+    update*: proc (progress: PGtkProgress){.cdecl.}
+    act_mode_enter*: proc (progress: PGtkProgress){.cdecl.}
+    gtk_reserved561: proc (){.cdecl.}
+    gtk_reserved562: proc (){.cdecl.}
+    gtk_reserved563: proc (){.cdecl.}
+    gtk_reserved564: proc (){.cdecl.}
+
+  PGtkProgressBarStyle* = ptr TGtkProgressBarStyle
+  TGtkProgressBarStyle* = enum
+    GTK_PROGRESS_CONTINUOUS, GTK_PROGRESS_DISCRETE
+  PGtkProgressBarOrientation* = ptr TGtkProgressBarOrientation
+  TGtkProgressBarOrientation* = enum
+    GTK_PROGRESS_LEFT_TO_RIGHT, GTK_PROGRESS_RIGHT_TO_LEFT,
+    GTK_PROGRESS_BOTTOM_TO_TOP, GTK_PROGRESS_TOP_TO_BOTTOM
+  PGtkProgressBar* = ptr TGtkProgressBar
+  TGtkProgressBar* = object of TGtkProgress
+    bar_style*: TGtkProgressBarStyle
+    orientation*: TGtkProgressBarOrientation
+    blocks*: guint
+    in_block*: gint
+    activity_pos*: gint
+    activity_step*: guint
+    activity_blocks*: guint
+    pulse_fraction*: gdouble
+    GtkProgressBar_flag0*: guint16
+
+  PGtkProgressBarClass* = ptr TGtkProgressBarClass
+  TGtkProgressBarClass* = object of TGtkProgressClass
+    gtk_reserved571: proc (){.cdecl.}
+    gtk_reserved572: proc (){.cdecl.}
+    gtk_reserved573: proc (){.cdecl.}
+    gtk_reserved574: proc (){.cdecl.}
+
+  PGtkRadioButton* = ptr TGtkRadioButton
+  TGtkRadioButton* = object of TGtkCheckButton
+    group*: PGSList
+
+  PGtkRadioButtonClass* = ptr TGtkRadioButtonClass
+  TGtkRadioButtonClass* = object of TGtkCheckButtonClass
+    gtk_reserved581: proc (){.cdecl.}
+    gtk_reserved582: proc (){.cdecl.}
+    gtk_reserved583: proc (){.cdecl.}
+    gtk_reserved584: proc (){.cdecl.}
+
+  PGtkRadioMenuItem* = ptr TGtkRadioMenuItem
+  TGtkRadioMenuItem* = object of TGtkCheckMenuItem
+    group*: PGSList
+
+  PGtkRadioMenuItemClass* = ptr TGtkRadioMenuItemClass
+  TGtkRadioMenuItemClass* = object of TGtkCheckMenuItemClass
+    gtk_reserved591: proc (){.cdecl.}
+    gtk_reserved592: proc (){.cdecl.}
+    gtk_reserved593: proc (){.cdecl.}
+    gtk_reserved594: proc (){.cdecl.}
+
+  PGtkScrolledWindow* = ptr TGtkScrolledWindow
+  TGtkScrolledWindow* = object of TGtkBin
+    hscrollbar*: PGtkWidget
+    vscrollbar*: PGtkWidget
+    GtkScrolledWindow_flag0*: guint16
+    shadow_type*: guint16
+
+  PGtkScrolledWindowClass* = ptr TGtkScrolledWindowClass
+  TGtkScrolledWindowClass* = object of TGtkBinClass
+    scrollbar_spacing*: gint
+    scroll_child*: proc (scrolled_window: PGtkScrolledWindow,
+                         scroll: TGtkScrollType, horizontal: gboolean){.cdecl.}
+    move_focus_out*: proc (scrolled_window: PGtkScrolledWindow,
+                           direction: TGtkDirectionType){.cdecl.}
+    gtk_reserved601: proc (){.cdecl.}
+    gtk_reserved602: proc (){.cdecl.}
+    gtk_reserved603: proc (){.cdecl.}
+    gtk_reserved604: proc (){.cdecl.}
+
+  TGtkSelectionData* = record
+    selection*: TGdkAtom
+    target*: TGdkAtom
+    thetype*: TGdkAtom
+    format*: gint
+    data*: Pguchar
+    length*: gint
+    display*: PGdkDisplay
+
+  PGtkTargetEntry* = ptr TGtkTargetEntry
+  TGtkTargetEntry* = record
+    target*: cstring
+    flags*: guint
+    info*: guint
+
+  PGtkTargetList* = ptr TGtkTargetList
+  TGtkTargetList* = record
+    list*: PGList
+    ref_count*: guint
+
+  PGtkTargetPair* = ptr TGtkTargetPair
+  TGtkTargetPair* = record
+    target*: TGdkAtom
+    flags*: guint
+    info*: guint
+
+  PGtkSeparatorMenuItem* = ptr TGtkSeparatorMenuItem
+  TGtkSeparatorMenuItem* = object of TGtkMenuItem
+
+  PGtkSeparatorMenuItemClass* = ptr TGtkSeparatorMenuItemClass
+  TGtkSeparatorMenuItemClass* = object of TGtkMenuItemClass
+
+  PGtkSizeGroup* = ptr TGtkSizeGroup
+  TGtkSizeGroup* = object of TGObject
+    widgets*: PGSList
+    mode*: guint8
+    GtkSizeGroup_flag0*: guint16
+    requisition*: TGtkRequisition
+
+  PGtkSizeGroupClass* = ptr TGtkSizeGroupClass
+  TGtkSizeGroupClass* = object of TGObjectClass
+    gtk_reserved611: proc (){.cdecl.}
+    gtk_reserved612: proc (){.cdecl.}
+    gtk_reserved613: proc (){.cdecl.}
+    gtk_reserved614: proc (){.cdecl.}
+
+  PGtkSizeGroupMode* = ptr TGtkSizeGroupMode
+  TGtkSizeGroupMode* = enum
+    GTK_SIZE_GROUP_NONE, GTK_SIZE_GROUP_HORIZONTAL, GTK_SIZE_GROUP_VERTICAL,
+    GTK_SIZE_GROUP_BOTH
+  PGtkSocket* = ptr TGtkSocket
+  TGtkSocket* = object of TGtkContainer
+    request_width*: guint16
+    request_height*: guint16
+    current_width*: guint16
+    current_height*: guint16
+    plug_window*: PGdkWindow
+    plug_widget*: PGtkWidget
+    xembed_version*: gshort
+    GtkSocket_flag0*: guint16
+    accel_group*: PGtkAccelGroup
+    toplevel*: PGtkWidget
+
+  PGtkSocketClass* = ptr TGtkSocketClass
+  TGtkSocketClass* = object of TGtkContainerClass
+    plug_added*: proc (socket: PGtkSocket){.cdecl.}
+    plug_removed*: proc (socket: PGtkSocket): gboolean{.cdecl.}
+    gtk_reserved621: proc (){.cdecl.}
+    gtk_reserved622: proc (){.cdecl.}
+    gtk_reserved623: proc (){.cdecl.}
+    gtk_reserved624: proc (){.cdecl.}
+
+  PGtkSpinButtonUpdatePolicy* = ptr TGtkSpinButtonUpdatePolicy
+  TGtkSpinButtonUpdatePolicy* = enum
+    GTK_UPDATE_ALWAYS, GTK_UPDATE_IF_VALID
+  PGtkSpinType* = ptr TGtkSpinType
+  TGtkSpinType* = enum
+    GTK_SPIN_STEP_FORWARD, GTK_SPIN_STEP_BACKWARD, GTK_SPIN_PAGE_FORWARD,
+    GTK_SPIN_PAGE_BACKWARD, GTK_SPIN_HOME, GTK_SPIN_END, GTK_SPIN_USER_DEFINED
+  PGtkSpinButton* = ptr TGtkSpinButton
+  TGtkSpinButton* = object of TGtkEntry
+    adjustment*: PGtkAdjustment
+    panel*: PGdkWindow
+    timer*: guint32
+    climb_rate*: gdouble
+    timer_step*: gdouble
+    update_policy*: TGtkSpinButtonUpdatePolicy
+    GtkSpinButton_flag0*: int32
+
+  PGtkSpinButtonClass* = ptr TGtkSpinButtonClass
+  TGtkSpinButtonClass* = object of TGtkEntryClass
+    input*: proc (spin_button: PGtkSpinButton, new_value: Pgdouble): gint{.cdecl.}
+    output*: proc (spin_button: PGtkSpinButton): gint{.cdecl.}
+    value_changed*: proc (spin_button: PGtkSpinButton){.cdecl.}
+    change_value*: proc (spin_button: PGtkSpinButton, scroll: TGtkScrollType){.
+        cdecl.}
+    gtk_reserved631: proc (){.cdecl.}
+    gtk_reserved632: proc (){.cdecl.}
+    gtk_reserved633: proc (){.cdecl.}
+    gtk_reserved634: proc (){.cdecl.}
+
+  PGtkStockItem* = ptr TGtkStockItem
+  TGtkStockItem* = record
+    stock_id*: cstring
+    label*: cstring
+    modifier*: TGdkModifierType
+    keyval*: guint
+    translation_domain*: cstring
+
+  PGtkStatusbar* = ptr TGtkStatusbar
+  TGtkStatusbar* = object of TGtkHBox
+    frame*: PGtkWidget
+    `label`*: PGtkWidget
+    messages*: PGSList
+    keys*: PGSList
+    seq_context_id*: guint
+    seq_message_id*: guint
+    grip_window*: PGdkWindow
+    GtkStatusbar_flag0*: guint16
+
+  PGtkStatusbarClass* = ptr TGtkStatusbarClass
+  TGtkStatusbarClass* = object of TGtkHBoxClass
+    messages_mem_chunk*: PGMemChunk
+    text_pushed*: proc (statusbar: PGtkStatusbar, context_id: guint,
+                        text: cstring){.cdecl.}
+    text_popped*: proc (statusbar: PGtkStatusbar, context_id: guint,
+                        text: cstring){.cdecl.}
+    gtk_reserved641: proc (){.cdecl.}
+    gtk_reserved642: proc (){.cdecl.}
+    gtk_reserved643: proc (){.cdecl.}
+    gtk_reserved644: proc (){.cdecl.}
+
+  PGtkTableRowCol* = ptr TGtkTableRowCol
+  PGtkTable* = ptr TGtkTable
+  TGtkTable* = object of TGtkContainer
+    children*: PGList
+    rows*: PGtkTableRowCol
+    cols*: PGtkTableRowCol
+    nrows*: guint16
+    ncols*: guint16
+    column_spacing*: guint16
+    row_spacing*: guint16
+    GtkTable_flag0*: guint16
+
+  PGtkTableClass* = ptr TGtkTableClass
+  TGtkTableClass* = object of TGtkContainerClass
+
+  PGtkTableChild* = ptr TGtkTableChild
+  TGtkTableChild* = record
+    widget*: PGtkWidget
+    left_attach*: guint16
+    right_attach*: guint16
+    top_attach*: guint16
+    bottom_attach*: guint16
+    xpadding*: guint16
+    ypadding*: guint16
+    GtkTableChild_flag0*: guint16
+
+  TGtkTableRowCol* = record
+    requisition*: guint16
+    allocation*: guint16
+    spacing*: guint16
+    flag0*: guint16
+
+  PGtkTearoffMenuItem* = ptr TGtkTearoffMenuItem
+  TGtkTearoffMenuItem* = object of TGtkMenuItem
+    GtkTearoffMenuItem_flag0*: guint16
+
+  PGtkTearoffMenuItemClass* = ptr TGtkTearoffMenuItemClass
+  TGtkTearoffMenuItemClass* = object of TGtkMenuItemClass
+    gtk_reserved651: proc (){.cdecl.}
+    gtk_reserved652: proc (){.cdecl.}
+    gtk_reserved653: proc (){.cdecl.}
+    gtk_reserved654: proc (){.cdecl.}
+
+  PGtkTextFont* = pointer
+  PGtkPropertyMark* = ptr TGtkPropertyMark
+  TGtkPropertyMark* = record
+    `property`*: PGList
+    offset*: guint
+    index*: guint
+
+  PGtkText* = ptr TGtkText
+  TGtkText* = object of TGtkOldEditable
+    text_area*: PGdkWindow
+    hadj*: PGtkAdjustment
+    vadj*: PGtkAdjustment
+    gc*: PGdkGC
+    line_wrap_bitmap*: PGdkPixmap
+    line_arrow_bitmap*: PGdkPixmap
+    text*: Pguchar
+    text_len*: guint
+    gap_position*: guint
+    gap_size*: guint
+    text_end*: guint
+    line_start_cache*: PGList
+    first_line_start_index*: guint
+    first_cut_pixels*: guint
+    first_onscreen_hor_pixel*: guint
+    first_onscreen_ver_pixel*: guint
+    GtkText_flag0*: guint16
+    freeze_count*: guint
+    text_properties*: PGList
+    text_properties_end*: PGList
+    point*: TGtkPropertyMark
+    scratch_buffer*: Pguchar
+    scratch_buffer_len*: guint
+    last_ver_value*: gint
+    cursor_pos_x*: gint
+    cursor_pos_y*: gint
+    cursor_mark*: TGtkPropertyMark
+    cursor_char*: TGdkWChar
+    cursor_char_offset*: gchar
+    cursor_virtual_x*: gint
+    cursor_drawn_level*: gint
+    current_line*: PGList
+    tab_stops*: PGList
+    default_tab_width*: gint
+    current_font*: PGtkTextFont
+    timer*: gint
+    button*: guint
+    bg_gc*: PGdkGC
+
+  PGtkTextClass* = ptr TGtkTextClass
+  TGtkTextClass* = object of TGtkOldEditableClass
+    set_scroll_adjustments*: proc (text: PGtkText, hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+
+  PGtkTextSearchFlags* = ptr TGtkTextSearchFlags
+  TGtkTextSearchFlags* = int32
+  PGtkTextIter* = ptr TGtkTextIter
+  TGtkTextIter* = record
+    dummy1*: gpointer
+    dummy2*: gpointer
+    dummy3*: gint
+    dummy4*: gint
+    dummy5*: gint
+    dummy6*: gint
+    dummy7*: gint
+    dummy8*: gint
+    dummy9*: gpointer
+    dummy10*: gpointer
+    dummy11*: gint
+    dummy12*: gint
+    dummy13*: gint
+    dummy14*: gpointer
+
+  TGtkTextCharPredicate* = proc (ch: gunichar, user_data: gpointer): gboolean{.
+      cdecl.}
+  PGtkTextTagClass* = ptr TGtkTextTagClass
+  PGtkTextAttributes* = ptr TGtkTextAttributes
+  PGtkTextTag* = ptr TGtkTextTag
+  PPGtkTextTag* = ptr PGtkTextTag
+  TGtkTextTag* = object of TGObject
+    table*: PGtkTextTagTable
+    name*: cstring
+    priority*: int32
+    values*: PGtkTextAttributes
+    GtkTextTag_flag0*: int32
+
+  TGtkTextTagClass* = object of TGObjectClass
+    event*: proc (tag: PGtkTextTag, event_object: PGObject, event: PGdkEvent,
+                  iter: PGtkTextIter): gboolean{.cdecl.}
+    gtk_reserved661: proc (){.cdecl.}
+    gtk_reserved662: proc (){.cdecl.}
+    gtk_reserved663: proc (){.cdecl.}
+    gtk_reserved664: proc (){.cdecl.}
+
+  PGtkTextAppearance* = ptr TGtkTextAppearance
+  TGtkTextAppearance* = record
+    bg_color*: TGdkColor
+    fg_color*: TGdkColor
+    bg_stipple*: PGdkBitmap
+    fg_stipple*: PGdkBitmap
+    rise*: gint
+    padding1*: gpointer
+    flag0*: guint16
+
+  TGtkTextAttributes* = record
+    refcount*: guint
+    appearance*: TGtkTextAppearance
+    justification*: TGtkJustification
+    direction*: TGtkTextDirection
+    font*: PPangoFontDescription
+    font_scale*: gdouble
+    left_margin*: gint
+    indent*: gint
+    right_margin*: gint
+    pixels_above_lines*: gint
+    pixels_below_lines*: gint
+    pixels_inside_wrap*: gint
+    tabs*: PPangoTabArray
+    wrap_mode*: TGtkWrapMode
+    language*: PPangoLanguage
+    padding1*: gpointer
+    flag0*: guint16
+
+  TGtkTextTagTableForeach* = proc (tag: PGtkTextTag, data: gpointer){.cdecl.}
+  TGtkTextTagTable* = object of TGObject
+    hash*: PGHashTable
+    anonymous*: PGSList
+    anon_count*: gint
+    buffers*: PGSList
+
+  PGtkTextTagTableClass* = ptr TGtkTextTagTableClass
+  TGtkTextTagTableClass* = object of TGObjectClass
+    tag_changed*: proc (table: PGtkTextTagTable, tag: PGtkTextTag,
+                        size_changed: gboolean){.cdecl.}
+    tag_added*: proc (table: PGtkTextTagTable, tag: PGtkTextTag){.cdecl.}
+    tag_removed*: proc (table: PGtkTextTagTable, tag: PGtkTextTag){.cdecl.}
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkTextMark* = ptr TGtkTextMark
+  TGtkTextMark* = object of TGObject
+    segment*: gpointer
+
+  PGtkTextMarkClass* = ptr TGtkTextMarkClass
+  TGtkTextMarkClass* = object of TGObjectClass
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkTextMarkBody* = ptr TGtkTextMarkBody
+  TGtkTextMarkBody* = record
+    obj*: PGtkTextMark
+    name*: cstring
+    tree*: PGtkTextBTree
+    line*: PGtkTextLine
+    flag0*: guint16
+
+  PGtkTextChildAnchor* = ptr TGtkTextChildAnchor
+  TGtkTextChildAnchor* = object of TGObject
+    segment*: gpointer
+
+  PGtkTextChildAnchorClass* = ptr TGtkTextChildAnchorClass
+  TGtkTextChildAnchorClass* = object of TGObjectClass
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkTextPixbuf* = ptr TGtkTextPixbuf
+  TGtkTextPixbuf* = record
+    pixbuf*: PGdkPixbuf
+
+  PGtkTextChildBody* = ptr TGtkTextChildBody
+  TGtkTextChildBody* = record
+    obj*: PGtkTextChildAnchor
+    widgets*: PGSList
+    tree*: PGtkTextBTree
+    line*: PGtkTextLine
+
+  PGtkTextLineSegment* = ptr TGtkTextLineSegment
+  PGtkTextLineSegmentClass* = ptr TGtkTextLineSegmentClass
+  PGtkTextTagInfo* = ptr TGtkTextTagInfo
+  TGtkTextTagInfo* = record
+    tag*: PGtkTextTag
+    tag_root*: PGtkTextBTreeNode
+    toggle_count*: gint
+
+  PGtkTextToggleBody* = ptr TGtkTextToggleBody
+  TGtkTextToggleBody* = record
+    info*: PGtkTextTagInfo
+    inNodeCounts*: gboolean
+
+  TGtkTextLineSegment* = record
+    `type`*: PGtkTextLineSegmentClass
+    next*: PGtkTextLineSegment
+    char_count*: int32
+    byte_count*: int32
+    body*: TGtkTextChildBody
+
+  PGtkTextSegSplitFunc* = ptr TGtkTextSegSplitFunc
+  TGtkTextSegSplitFunc* = TGtkTextLineSegment
+  TGtkTextSegDeleteFunc* = proc (seg: PGtkTextLineSegment, line: PGtkTextLine,
+                                 tree_gone: gboolean): gboolean{.cdecl.}
+  PGtkTextSegCleanupFunc* = ptr TGtkTextSegCleanupFunc
+  TGtkTextSegCleanupFunc* = TGtkTextLineSegment
+  TGtkTextSegLineChangeFunc* = proc (seg: PGtkTextLineSegment,
+                                     line: PGtkTextLine){.cdecl.}
+  TGtkTextSegCheckFunc* = proc (seg: PGtkTextLineSegment, line: PGtkTextLine){.
+      cdecl.}
+  TGtkTextLineSegmentClass* = record
+    name*: cstring
+    leftGravity*: gboolean
+    splitFunc*: TGtkTextSegSplitFunc
+    deleteFunc*: TGtkTextSegDeleteFunc
+    cleanupFunc*: TGtkTextSegCleanupFunc
+    lineChangeFunc*: TGtkTextSegLineChangeFunc
+    checkFunc*: TGtkTextSegCheckFunc
+
+  PGtkTextLineData* = ptr TGtkTextLineData
+  TGtkTextLineData* = record
+    view_id*: gpointer
+    next*: PGtkTextLineData
+    height*: gint
+    flag0*: int32
+
+  TGtkTextLine* = record
+    parent*: PGtkTextBTreeNode
+    next*: PGtkTextLine
+    segments*: PGtkTextLineSegment
+    views*: PGtkTextLineData
+
+  PGtkTextLogAttrCache* = pointer
+  PGtkTextBuffer* = ptr TGtkTextBuffer
+  TGtkTextBuffer* = object of TGObject
+    tag_table*: PGtkTextTagTable
+    btree*: PGtkTextBTree
+    clipboard_contents_buffers*: PGSList
+    selection_clipboards*: PGSList
+    log_attr_cache*: PGtkTextLogAttrCache
+    user_action_count*: guint
+    GtkTextBuffer_flag0*: guint16
+
+  PGtkTextBufferClass* = ptr TGtkTextBufferClass
+  TGtkTextBufferClass* = object of TGObjectClass
+    insert_text*: proc (buffer: PGtkTextBuffer, pos: PGtkTextIter, text: cstring,
+                        length: gint){.cdecl.}
+    insert_pixbuf*: proc (buffer: PGtkTextBuffer, pos: PGtkTextIter,
+                          pixbuf: PGdkPixbuf){.cdecl.}
+    insert_child_anchor*: proc (buffer: PGtkTextBuffer, pos: PGtkTextIter,
+                                anchor: PGtkTextChildAnchor){.cdecl.}
+    delete_range*: proc (buffer: PGtkTextBuffer, start: PGtkTextIter,
+                         theEnd: PGtkTextIter){.cdecl.}
+    changed*: proc (buffer: PGtkTextBuffer){.cdecl.}
+    modified_changed*: proc (buffer: PGtkTextBuffer){.cdecl.}
+    mark_set*: proc (buffer: PGtkTextBuffer, location: PGtkTextIter,
+                     mark: PGtkTextMark){.cdecl.}
+    mark_deleted*: proc (buffer: PGtkTextBuffer, mark: PGtkTextMark){.cdecl.}
+    apply_tag*: proc (buffer: PGtkTextBuffer, tag: PGtkTextTag,
+                      start_char: PGtkTextIter, end_char: PGtkTextIter){.cdecl.}
+    remove_tag*: proc (buffer: PGtkTextBuffer, tag: PGtkTextTag,
+                       start_char: PGtkTextIter, end_char: PGtkTextIter){.cdecl.}
+    begin_user_action*: proc (buffer: PGtkTextBuffer){.cdecl.}
+    end_user_action*: proc (buffer: PGtkTextBuffer){.cdecl.}
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+    gtk_reserved5: proc (){.cdecl.}
+    gtk_reserved6: proc (){.cdecl.}
+
+  PGtkTextLineDisplay* = ptr TGtkTextLineDisplay
+  PGtkTextLayout* = ptr TGtkTextLayout
+  TGtkTextLayout* = object of TGObject
+    screen_width*: gint
+    width*: gint
+    height*: gint
+    buffer*: PGtkTextBuffer
+    default_style*: PGtkTextAttributes
+    ltr_context*: PPangoContext
+    rtl_context*: PPangoContext
+    one_style_cache*: PGtkTextAttributes
+    one_display_cache*: PGtkTextLineDisplay
+    wrap_loop_count*: gint
+    GtkTextLayout_flag0*: guint16
+    preedit_string*: cstring
+    preedit_attrs*: PPangoAttrList
+    preedit_len*: gint
+    preedit_cursor*: gint
+
+  PGtkTextLayoutClass* = ptr TGtkTextLayoutClass
+  TGtkTextLayoutClass* = object of TGObjectClass
+    invalidated*: proc (layout: PGtkTextLayout){.cdecl.}
+    changed*: proc (layout: PGtkTextLayout, y: gint, old_height: gint,
+                    new_height: gint){.cdecl.}
+    wrap*: proc (layout: PGtkTextLayout, line: PGtkTextLine,
+                 line_data: PGtkTextLineData): PGtkTextLineData{.cdecl.}
+    get_log_attrs*: proc (layout: PGtkTextLayout, line: PGtkTextLine,
+                          attrs: var PPangoLogAttr, n_attrs: Pgint){.cdecl.}
+    invalidate*: proc (layout: PGtkTextLayout, start: PGtkTextIter,
+                       theEnd: PGtkTextIter){.cdecl.}
+    free_line_data*: proc (layout: PGtkTextLayout, line: PGtkTextLine,
+                           line_data: PGtkTextLineData){.cdecl.}
+    allocate_child*: proc (layout: PGtkTextLayout, child: PGtkWidget, x: gint,
+                           y: gint){.cdecl.}
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkTextAttrAppearance* = ptr TGtkTextAttrAppearance
+  TGtkTextAttrAppearance* = record
+    attr*: TPangoAttribute
+    appearance*: TGtkTextAppearance
+
+  PGtkTextCursorDisplay* = ptr TGtkTextCursorDisplay
+  TGtkTextCursorDisplay* = record
+    x*: gint
+    y*: gint
+    height*: gint
+    flag0*: guint16
+
+  TGtkTextLineDisplay* = record
+    layout*: PPangoLayout
+    cursors*: PGSList
+    shaped_objects*: PGSList
+    direction*: TGtkTextDirection
+    width*: gint
+    total_width*: gint
+    height*: gint
+    x_offset*: gint
+    left_margin*: gint
+    right_margin*: gint
+    top_margin*: gint
+    bottom_margin*: gint
+    insert_index*: gint
+    size_only*: gboolean
+    line*: PGtkTextLine
+
+  PGtkTextWindow* = pointer
+  PGtkTextPendingScroll* = pointer
+  PGtkTextWindowType* = ptr TGtkTextWindowType
+  TGtkTextWindowType* = enum
+    GTK_TEXT_WINDOW_PRIVATE, GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT,
+    GTK_TEXT_WINDOW_LEFT, GTK_TEXT_WINDOW_RIGHT, GTK_TEXT_WINDOW_TOP,
+    GTK_TEXT_WINDOW_BOTTOM
+  PGtkTextView* = ptr TGtkTextView
+  TGtkTextView* = object of TGtkContainer
+    layout*: PGtkTextLayout
+    buffer*: PGtkTextBuffer
+    selection_drag_handler*: guint
+    scroll_timeout*: guint
+    pixels_above_lines*: gint
+    pixels_below_lines*: gint
+    pixels_inside_wrap*: gint
+    wrap_mode*: TGtkWrapMode
+    justify*: TGtkJustification
+    left_margin*: gint
+    right_margin*: gint
+    indent*: gint
+    tabs*: PPangoTabArray
+    GtkTextView_flag0*: guint16
+    text_window*: PGtkTextWindow
+    left_window*: PGtkTextWindow
+    right_window*: PGtkTextWindow
+    top_window*: PGtkTextWindow
+    bottom_window*: PGtkTextWindow
+    hadjustment*: PGtkAdjustment
+    vadjustment*: PGtkAdjustment
+    xoffset*: gint
+    yoffset*: gint
+    width*: gint
+    height*: gint
+    virtual_cursor_x*: gint
+    virtual_cursor_y*: gint
+    first_para_mark*: PGtkTextMark
+    first_para_pixels*: gint
+    dnd_mark*: PGtkTextMark
+    blink_timeout*: guint
+    first_validate_idle*: guint
+    incremental_validate_idle*: guint
+    im_context*: PGtkIMContext
+    popup_menu*: PGtkWidget
+    drag_start_x*: gint
+    drag_start_y*: gint
+    children*: PGSList
+    pending_scroll*: PGtkTextPendingScroll
+    pending_place_cursor_button*: gint
+
+  PGtkTextViewClass* = ptr TGtkTextViewClass
+  TGtkTextViewClass* = object of TGtkContainerClass
+    set_scroll_adjustments*: proc (text_view: PGtkTextView,
+                                   hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+    populate_popup*: proc (text_view: PGtkTextView, menu: PGtkMenu){.cdecl.}
+    move_cursor*: proc (text_view: PGtkTextView, step: TGtkMovementStep,
+                        count: gint, extend_selection: gboolean){.cdecl.}
+    page_horizontally*: proc (text_view: PGtkTextView, count: gint,
+                              extend_selection: gboolean){.cdecl.}
+    set_anchor*: proc (text_view: PGtkTextView){.cdecl.}
+    insert_at_cursor*: proc (text_view: PGtkTextView, str: cstring){.cdecl.}
+    delete_from_cursor*: proc (text_view: PGtkTextView, thetype: TGtkDeleteType,
+                               count: gint){.cdecl.}
+    cut_clipboard*: proc (text_view: PGtkTextView){.cdecl.}
+    copy_clipboard*: proc (text_view: PGtkTextView){.cdecl.}
+    paste_clipboard*: proc (text_view: PGtkTextView){.cdecl.}
+    toggle_overwrite*: proc (text_view: PGtkTextView){.cdecl.}
+    move_focus*: proc (text_view: PGtkTextView, direction: TGtkDirectionType){.
+        cdecl.}
+    gtk_reserved711: proc (){.cdecl.}
+    gtk_reserved712: proc (){.cdecl.}
+    gtk_reserved713: proc (){.cdecl.}
+    gtk_reserved714: proc (){.cdecl.}
+    gtk_reserved715: proc (){.cdecl.}
+    gtk_reserved716: proc (){.cdecl.}
+    gtk_reserved717: proc (){.cdecl.}
+    gtk_reserved718: proc (){.cdecl.}
+
+  PGtkTipsQuery* = ptr TGtkTipsQuery
+  TGtkTipsQuery* = object of TGtkLabel
+    GtkTipsQuery_flag0*: guint16
+    label_inactive*: cstring
+    label_no_tip*: cstring
+    caller*: PGtkWidget
+    last_crossed*: PGtkWidget
+    query_cursor*: PGdkCursor
+
+  PGtkTipsQueryClass* = ptr TGtkTipsQueryClass
+  TGtkTipsQueryClass* = object of TGtkLabelClass
+    start_query*: proc (tips_query: PGtkTipsQuery){.cdecl.}
+    stop_query*: proc (tips_query: PGtkTipsQuery){.cdecl.}
+    widget_entered*: proc (tips_query: PGtkTipsQuery, widget: PGtkWidget,
+                           tip_text: cstring, tip_private: cstring){.cdecl.}
+    widget_selected*: proc (tips_query: PGtkTipsQuery, widget: PGtkWidget,
+                            tip_text: cstring, tip_private: cstring,
+                            event: PGdkEventButton): gint{.cdecl.}
+    gtk_reserved721: proc (){.cdecl.}
+    gtk_reserved722: proc (){.cdecl.}
+    gtk_reserved723: proc (){.cdecl.}
+    gtk_reserved724: proc (){.cdecl.}
+
+  PGtkTooltips* = ptr TGtkTooltips
+  PGtkTooltipsData* = ptr TGtkTooltipsData
+  TGtkTooltipsData* = record
+    tooltips*: PGtkTooltips
+    widget*: PGtkWidget
+    tip_text*: cstring
+    tip_private*: cstring
+
+  TGtkTooltips* = object of TGtkObject
+    tip_window*: PGtkWidget
+    tip_label*: PGtkWidget
+    active_tips_data*: PGtkTooltipsData
+    tips_data_list*: PGList
+    GtkTooltips_flag0*: int32
+    flag1*: guint16
+    timer_tag*: gint
+    last_popdown*: TGTimeVal
+
+  PGtkTooltipsClass* = ptr TGtkTooltipsClass
+  TGtkTooltipsClass* = object of TGtkObjectClass
+    gtk_reserved1: proc (){.cdecl.}
+    gtk_reserved2: proc (){.cdecl.}
+    gtk_reserved3: proc (){.cdecl.}
+    gtk_reserved4: proc (){.cdecl.}
+
+  PGtkToolbarChildType* = ptr TGtkToolbarChildType
+  TGtkToolbarChildType* = enum
+    GTK_TOOLBAR_CHILD_SPACE, GTK_TOOLBAR_CHILD_BUTTON,
+    GTK_TOOLBAR_CHILD_TOGGLEBUTTON, GTK_TOOLBAR_CHILD_RADIOBUTTON,
+    GTK_TOOLBAR_CHILD_WIDGET
+  PGtkToolbarSpaceStyle* = ptr TGtkToolbarSpaceStyle
+  TGtkToolbarSpaceStyle* = enum
+    GTK_TOOLBAR_SPACE_EMPTY, GTK_TOOLBAR_SPACE_LINE
+  PGtkToolbarChild* = ptr TGtkToolbarChild
+  TGtkToolbarChild* = record
+    `type`*: TGtkToolbarChildType
+    widget*: PGtkWidget
+    icon*: PGtkWidget
+    label*: PGtkWidget
+
+  PGtkToolbar* = ptr TGtkToolbar
+  TGtkToolbar* = object of TGtkContainer
+    num_children*: gint
+    children*: PGList
+    orientation*: TGtkOrientation
+    GtkToolbar_style*: TGtkToolbarStyle
+    icon_size*: TGtkIconSize
+    tooltips*: PGtkTooltips
+    button_maxw*: gint
+    button_maxh*: gint
+    style_set_connection*: guint
+    icon_size_connection*: guint
+    GtkToolbar_flag0*: guint16
+
+  PGtkToolbarClass* = ptr TGtkToolbarClass
+  TGtkToolbarClass* = object of TGtkContainerClass
+    orientation_changed*: proc (toolbar: PGtkToolbar,
+                                orientation: TGtkOrientation){.cdecl.}
+    style_changed*: proc (toolbar: PGtkToolbar, style: TGtkToolbarStyle){.cdecl.}
+    gtk_reserved731: proc (){.cdecl.}
+    gtk_reserved732: proc (){.cdecl.}
+    gtk_reserved733: proc (){.cdecl.}
+    gtk_reserved734: proc (){.cdecl.}
+
+  PGtkTreeViewMode* = ptr TGtkTreeViewMode
+  TGtkTreeViewMode* = enum
+    GTK_TREE_VIEW_LINE, GTK_TREE_VIEW_ITEM
+  PGtkTree* = ptr TGtkTree
+  TGtkTree* = object of TGtkContainer
+    children*: PGList
+    root_tree*: PGtkTree
+    tree_owner*: PGtkWidget
+    selection*: PGList
+    level*: guint
+    indent_value*: guint
+    current_indent*: guint
+    GtkTree_flag0*: guint16
+
+  PGtkTreeClass* = ptr TGtkTreeClass
+  TGtkTreeClass* = object of TGtkContainerClass
+    selection_changed*: proc (tree: PGtkTree){.cdecl.}
+    select_child*: proc (tree: PGtkTree, child: PGtkWidget){.cdecl.}
+    unselect_child*: proc (tree: PGtkTree, child: PGtkWidget){.cdecl.}
+
+  PGtkTreeDragSource* = pointer
+  PGtkTreeDragDest* = pointer
+  PGtkTreeDragSourceIface* = ptr TGtkTreeDragSourceIface
+  TGtkTreeDragSourceIface* = object of TGTypeInterface
+    row_draggable*: proc (drag_source: PGtkTreeDragSource, path: PGtkTreePath): gboolean{.
+        cdecl.}
+    drag_data_get*: proc (drag_source: PGtkTreeDragSource, path: PGtkTreePath,
+                          selection_data: PGtkSelectionData): gboolean{.cdecl.}
+    drag_data_delete*: proc (drag_source: PGtkTreeDragSource, path: PGtkTreePath): gboolean{.
+        cdecl.}
+
+  PGtkTreeDragDestIface* = ptr TGtkTreeDragDestIface
+  TGtkTreeDragDestIface* = object of TGTypeInterface
+    drag_data_received*: proc (drag_dest: PGtkTreeDragDest, dest: PGtkTreePath,
+                               selection_data: PGtkSelectionData): gboolean{.
+        cdecl.}
+    row_drop_possible*: proc (drag_dest: PGtkTreeDragDest,
+                              dest_path: PGtkTreePath,
+                              selection_data: PGtkSelectionData): gboolean{.
+        cdecl.}
+
+  PGtkTreeItem* = ptr TGtkTreeItem
+  TGtkTreeItem* = object of TGtkItem
+    subtree*: PGtkWidget
+    pixmaps_box*: PGtkWidget
+    plus_pix_widget*: PGtkWidget
+    minus_pix_widget*: PGtkWidget
+    pixmaps*: PGList
+    GtkTreeItem_flag0*: guint16
+
+  PGtkTreeItemClass* = ptr TGtkTreeItemClass
+  TGtkTreeItemClass* = object of TGtkItemClass
+    expand*: proc (tree_item: PGtkTreeItem){.cdecl.}
+    collapse*: proc (tree_item: PGtkTreeItem){.cdecl.}
+
+  PGtkTreeSelection* = ptr TGtkTreeSelection
+  TGtkTreeSelectionFunc* = proc (selection: PGtkTreeSelection,
+                                 model: PGtkTreeModel, path: PGtkTreePath,
+                                 path_currently_selected: gboolean,
+                                 data: gpointer): gboolean{.cdecl.}
+  TGtkTreeSelectionForeachFunc* = proc (model: PGtkTreeModel,
+                                        path: PGtkTreePath, iter: PGtkTreeIter,
+                                        data: gpointer){.cdecl.}
+  TGtkTreeSelection* = object of TGObject
+    tree_view*: PGtkTreeView
+    thetype*: TGtkSelectionMode
+    user_func*: TGtkTreeSelectionFunc
+    user_data*: gpointer
+    destroy*: TGtkDestroyNotify
+
+  PGtkTreeSelectionClass* = ptr TGtkTreeSelectionClass
+  TGtkTreeSelectionClass* = object of TGObjectClass
+    changed*: proc (selection: PGtkTreeSelection){.cdecl.}
+    gtk_reserved741: proc (){.cdecl.}
+    gtk_reserved742: proc (){.cdecl.}
+    gtk_reserved743: proc (){.cdecl.}
+    gtk_reserved744: proc (){.cdecl.}
+
+  PGtkTreeStore* = ptr TGtkTreeStore
+  TGtkTreeStore* = object of TGObject
+    stamp*: gint
+    root*: gpointer
+    last*: gpointer
+    n_columns*: gint
+    sort_column_id*: gint
+    sort_list*: PGList
+    order*: TGtkSortType
+    column_headers*: PGType
+    default_sort_func*: TGtkTreeIterCompareFunc
+    default_sort_data*: gpointer
+    default_sort_destroy*: TGtkDestroyNotify
+    GtkTreeStore_flag0*: guint16
+
+  PGtkTreeStoreClass* = ptr TGtkTreeStoreClass
+  TGtkTreeStoreClass* = object of TGObjectClass
+    gtk_reserved751: proc (){.cdecl.}
+    gtk_reserved752: proc (){.cdecl.}
+    gtk_reserved753: proc (){.cdecl.}
+    gtk_reserved754: proc (){.cdecl.}
+
+  PGtkTreeViewColumnSizing* = ptr TGtkTreeViewColumnSizing
+  TGtkTreeViewColumnSizing* = enum
+    GTK_TREE_VIEW_COLUMN_GROW_ONLY, GTK_TREE_VIEW_COLUMN_AUTOSIZE,
+    GTK_TREE_VIEW_COLUMN_FIXED
+  TGtkTreeCellDataFunc* = proc (tree_column: PGtkTreeViewColumn,
+                                cell: PGtkCellRenderer,
+                                tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                                data: gpointer){.cdecl.}
+  TGtkTreeViewColumn* = object of TGtkObject
+    tree_view*: PGtkWidget
+    button*: PGtkWidget
+    child*: PGtkWidget
+    arrow*: PGtkWidget
+    alignment*: PGtkWidget
+    window*: PGdkWindow
+    editable_widget*: PGtkCellEditable
+    xalign*: gfloat
+    property_changed_signal*: guint
+    spacing*: gint
+    column_type*: TGtkTreeViewColumnSizing
+    requested_width*: gint
+    button_request*: gint
+    resized_width*: gint
+    width*: gint
+    fixed_width*: gint
+    min_width*: gint
+    max_width*: gint
+    drag_x*: gint
+    drag_y*: gint
+    title*: cstring
+    cell_list*: PGList
+    sort_clicked_signal*: guint
+    sort_column_changed_signal*: guint
+    sort_column_id*: gint
+    sort_order*: TGtkSortType
+    GtkTreeViewColumn_flag0*: guint16
+
+  PGtkTreeViewColumnClass* = ptr TGtkTreeViewColumnClass
+  TGtkTreeViewColumnClass* = object of TGtkObjectClass
+    clicked*: proc (tree_column: PGtkTreeViewColumn){.cdecl.}
+    gtk_reserved751: proc (){.cdecl.}
+    gtk_reserved752: proc (){.cdecl.}
+    gtk_reserved753: proc (){.cdecl.}
+    gtk_reserved754: proc (){.cdecl.}
+
+  PGtkRBNodeColor* = ptr TGtkRBNodeColor
+  TGtkRBNodeColor* = int32
+  PGtkRBTree* = ptr TGtkRBTree
+  PGtkRBNode* = ptr TGtkRBNode
+  TGtkRBTreeTraverseFunc* = proc (tree: PGtkRBTree, node: PGtkRBNode,
+                                  data: gpointer){.cdecl.}
+  TGtkRBTree* = record
+    root*: PGtkRBNode
+    `nil`*: PGtkRBNode
+    parent_tree*: PGtkRBTree
+    parent_node*: PGtkRBNode
+
+  TGtkRBNode* = record
+    flag0*: guint16
+    left*: PGtkRBNode
+    right*: PGtkRBNode
+    parent*: PGtkRBNode
+    count*: gint
+    offset*: gint
+    children*: PGtkRBTree
+
+  PGtkTreeRowReference* = pointer
+  PGtkTreeViewFlags* = ptr TGtkTreeViewFlags
+  TGtkTreeViewFlags* = int32
+  TGtkTreeViewSearchDialogPositionFunc* = proc (tree_view: PGtkTreeView,
+      search_dialog: PGtkWidget){.cdecl.}
+  PGtkTreeViewColumnReorder* = ptr TGtkTreeViewColumnReorder
+  TGtkTreeViewColumnReorder* = record
+    left_align*: gint
+    right_align*: gint
+    left_column*: PGtkTreeViewColumn
+    right_column*: PGtkTreeViewColumn
+
+  PGtkTreeViewPrivate* = ptr TGtkTreeViewPrivate
+  TGtkTreeViewPrivate* = record
+    model*: PGtkTreeModel
+    flags*: guint
+    tree*: PGtkRBTree
+    button_pressed_node*: PGtkRBNode
+    button_pressed_tree*: PGtkRBTree
+    children*: PGList
+    width*: gint
+    height*: gint
+    expander_size*: gint
+    hadjustment*: PGtkAdjustment
+    vadjustment*: PGtkAdjustment
+    bin_window*: PGdkWindow
+    header_window*: PGdkWindow
+    drag_window*: PGdkWindow
+    drag_highlight_window*: PGdkWindow
+    drag_column*: PGtkTreeViewColumn
+    last_button_press*: PGtkTreeRowReference
+    last_button_press_2*: PGtkTreeRowReference
+    top_row*: PGtkTreeRowReference
+    top_row_dy*: gint
+    dy*: gint
+    drag_column_x*: gint
+    expander_column*: PGtkTreeViewColumn
+    edited_column*: PGtkTreeViewColumn
+    presize_handler_timer*: guint
+    validate_rows_timer*: guint
+    scroll_sync_timer*: guint
+    focus_column*: PGtkTreeViewColumn
+    anchor*: PGtkTreeRowReference
+    cursor*: PGtkTreeRowReference
+    drag_pos*: gint
+    x_drag*: gint
+    prelight_node*: PGtkRBNode
+    prelight_tree*: PGtkRBTree
+    expanded_collapsed_node*: PGtkRBNode
+    expanded_collapsed_tree*: PGtkRBTree
+    expand_collapse_timeout*: guint
+    selection*: PGtkTreeSelection
+    n_columns*: gint
+    columns*: PGList
+    header_height*: gint
+    column_drop_func*: TGtkTreeViewColumnDropFunc
+    column_drop_func_data*: gpointer
+    column_drop_func_data_destroy*: TGtkDestroyNotify
+    column_drag_info*: PGList
+    cur_reorder*: PGtkTreeViewColumnReorder
+    destroy_count_func*: TGtkTreeDestroyCountFunc
+    destroy_count_data*: gpointer
+    destroy_count_destroy*: TGtkDestroyNotify
+    scroll_timeout*: guint
+    drag_dest_row*: PGtkTreeRowReference
+    drag_dest_pos*: TGtkTreeViewDropPosition
+    open_dest_timeout*: guint
+    pressed_button*: gint
+    press_start_x*: gint
+    press_start_y*: gint
+    scroll_to_path*: PGtkTreeRowReference
+    scroll_to_column*: PGtkTreeViewColumn
+    scroll_to_row_align*: gfloat
+    scroll_to_col_align*: gfloat
+    flag0*: guint16
+    search_column*: gint
+    search_dialog_position_func*: TGtkTreeViewSearchDialogPositionFunc
+    search_equal_func*: TGtkTreeViewSearchEqualFunc
+    search_user_data*: gpointer
+    search_destroy*: TGtkDestroyNotify
+
+  TGtkTreeView* = object of TGtkContainer
+    priv*: PGtkTreeViewPrivate
+
+  PGtkTreeViewClass* = ptr TGtkTreeViewClass
+  TGtkTreeViewClass* = object of TGtkContainerClass
+    set_scroll_adjustments*: proc (tree_view: PGtkTreeView,
+                                   hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+    row_activated*: proc (tree_view: PGtkTreeView, path: PGtkTreePath,
+                          column: PGtkTreeViewColumn){.cdecl.}
+    test_expand_row*: proc (tree_view: PGtkTreeView, iter: PGtkTreeIter,
+                            path: PGtkTreePath): gboolean{.cdecl.}
+    test_collapse_row*: proc (tree_view: PGtkTreeView, iter: PGtkTreeIter,
+                              path: PGtkTreePath): gboolean{.cdecl.}
+    row_expanded*: proc (tree_view: PGtkTreeView, iter: PGtkTreeIter,
+                         path: PGtkTreePath){.cdecl.}
+    row_collapsed*: proc (tree_view: PGtkTreeView, iter: PGtkTreeIter,
+                          path: PGtkTreePath){.cdecl.}
+    columns_changed*: proc (tree_view: PGtkTreeView){.cdecl.}
+    cursor_changed*: proc (tree_view: PGtkTreeView){.cdecl.}
+    move_cursor*: proc (tree_view: PGtkTreeView, step: TGtkMovementStep,
+                        count: gint): gboolean{.cdecl.}
+    select_all*: proc (tree_view: PGtkTreeView){.cdecl.}
+    unselect_all*: proc (tree_view: PGtkTreeView){.cdecl.}
+    select_cursor_row*: proc (tree_view: PGtkTreeView, start_editing: gboolean){.
+        cdecl.}
+    toggle_cursor_row*: proc (tree_view: PGtkTreeView){.cdecl.}
+    expand_collapse_cursor_row*: proc (tree_view: PGtkTreeView,
+                                       logical: gboolean, expand: gboolean,
+                                       open_all: gboolean){.cdecl.}
+    select_cursor_parent*: proc (tree_view: PGtkTreeView){.cdecl.}
+    start_interactive_search*: proc (tree_view: PGtkTreeView){.cdecl.}
+    gtk_reserved760: proc (){.cdecl.}
+    gtk_reserved761: proc (){.cdecl.}
+    gtk_reserved762: proc (){.cdecl.}
+    gtk_reserved763: proc (){.cdecl.}
+    gtk_reserved764: proc (){.cdecl.}
+
+  PGtkVButtonBox* = ptr TGtkVButtonBox
+  TGtkVButtonBox* = object of TGtkButtonBox
+
+  PGtkVButtonBoxClass* = ptr TGtkVButtonBoxClass
+  TGtkVButtonBoxClass* = object of TGtkButtonBoxClass
+
+  PGtkViewport* = ptr TGtkViewport
+  TGtkViewport* = object of TGtkBin
+    shadow_type*: TGtkShadowType
+    view_window*: PGdkWindow
+    bin_window*: PGdkWindow
+    hadjustment*: PGtkAdjustment
+    vadjustment*: PGtkAdjustment
+
+  PGtkViewportClass* = ptr TGtkViewportClass
+  TGtkViewportClass* = object of TGtkBinClass
+    set_scroll_adjustments*: proc (viewport: PGtkViewport,
+                                   hadjustment: PGtkAdjustment,
+                                   vadjustment: PGtkAdjustment){.cdecl.}
+
+  PGtkVPaned* = ptr TGtkVPaned
+  TGtkVPaned* = object of TGtkPaned
+
+  PGtkVPanedClass* = ptr TGtkVPanedClass
+  TGtkVPanedClass* = object of TGtkPanedClass
+
+  PGtkVRuler* = ptr TGtkVRuler
+  TGtkVRuler* = object of TGtkRuler
+
+  PGtkVRulerClass* = ptr TGtkVRulerClass
+  TGtkVRulerClass* = object of TGtkRulerClass
+
+  PGtkVScale* = ptr TGtkVScale
+  TGtkVScale* = object of TGtkScale
+
+  PGtkVScaleClass* = ptr TGtkVScaleClass
+  TGtkVScaleClass* = object of TGtkScaleClass
+
+  PGtkVScrollbar* = ptr TGtkVScrollbar
+  TGtkVScrollbar* = object of TGtkScrollbar
+
+  PGtkVScrollbarClass* = ptr TGtkVScrollbarClass
+  TGtkVScrollbarClass* = object of TGtkScrollbarClass
+
+  PGtkVSeparator* = ptr TGtkVSeparator
+  TGtkVSeparator* = object of TGtkSeparator
+
+  PGtkVSeparatorClass* = ptr TGtkVSeparatorClass
+  TGtkVSeparatorClass* = object of TGtkSeparatorClass
+
+
+const
+  GTK_IN_DESTRUCTION* = 1 shl 0
+  GTK_FLOATING* = 1 shl 1
+  GTK_RESERVED_1* = 1 shl 2
+  GTK_RESERVED_2* = 1 shl 3
+  GTK_ARG_READABLE* = G_PARAM_READABLE
+  GTK_ARG_WRITABLE* = G_PARAM_WRITABLE
+  GTK_ARG_CONSTRUCT* = G_PARAM_CONSTRUCT
+  GTK_ARG_CONSTRUCT_ONLY* = G_PARAM_CONSTRUCT_ONLY
+  GTK_ARG_CHILD_ARG* = 1 shl 4
+
+proc GTK_TYPE_OBJECT*(): GType
+proc GTK_OBJECT*(anObject: pointer): PGtkObject
+proc GTK_OBJECT_CLASS*(klass: pointer): PGtkObjectClass
+proc GTK_IS_OBJECT*(anObject: pointer): bool
+proc GTK_IS_OBJECT_CLASS*(klass: pointer): bool
+proc GTK_OBJECT_GET_CLASS*(anObject: pointer): PGtkObjectClass
+proc GTK_OBJECT_TYPE*(anObject: pointer): GType
+proc GTK_OBJECT_TYPE_NAME*(anObject: pointer): cstring
+proc GTK_OBJECT_FLAGS*(obj: pointer): guint32
+proc GTK_OBJECT_FLOATING*(obj: pointer): gboolean
+proc GTK_OBJECT_SET_FLAGS*(obj: pointer, flag: guint32)
+proc GTK_OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32)
+proc gtk_object_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_object_get_type".}
+proc gtk_object_new*(thetype: TGtkType, first_property_name: cstring): PGtkObject{.
+    cdecl, varargs, dynlib: gtklib, importc: "gtk_object_new".}
+proc gtk_object_sink*(anObject: PGtkObject){.cdecl, dynlib: gtklib,
+    importc: "gtk_object_sink".}
+proc gtk_object_destroy*(anObject: PGtkObject){.cdecl, dynlib: gtklib,
+    importc: "gtk_object_destroy".}
+const
+  GTK_TYPE_INVALID* = G_TYPE_INVALID
+  GTK_TYPE_NONE* = G_TYPE_NONE
+  GTK_TYPE_ENUM* = G_TYPE_ENUM
+  GTK_TYPE_FLAGS* = G_TYPE_FLAGS
+  GTK_TYPE_CHAR* = G_TYPE_CHAR
+  GTK_TYPE_UCHAR* = G_TYPE_UCHAR
+  GTK_TYPE_BOOL* = G_TYPE_BOOLEAN
+  GTK_TYPE_INT* = G_TYPE_INT
+  GTK_TYPE_UINT* = G_TYPE_UINT
+  GTK_TYPE_LONG* = G_TYPE_LONG
+  GTK_TYPE_ULONG* = G_TYPE_ULONG
+  GTK_TYPE_FLOAT* = G_TYPE_FLOAT
+  GTK_TYPE_DOUBLE* = G_TYPE_DOUBLE
+  GTK_TYPE_STRING* = G_TYPE_STRING
+  GTK_TYPE_BOXED* = G_TYPE_BOXED
+  GTK_TYPE_POINTER* = G_TYPE_POINTER
+
+proc GTK_TYPE_IDENTIFIER*(): GType
+proc gtk_identifier_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_identifier_get_type".}
+proc GTK_SIGNAL_FUNC*(f: pointer): TGtkSignalFunc
+proc gtk_type_class*(thetype: TGtkType): gpointer{.cdecl, dynlib: gtklib,
+    importc: "gtk_type_class".}
+const
+  GTK_TOPLEVEL* = 1 shl 4
+  GTK_NO_WINDOW* = 1 shl 5
+  GTK_REALIZED* = 1 shl 6
+  GTK_MAPPED* = 1 shl 7
+  GTK_VISIBLE* = 1 shl 8
+  GTK_SENSITIVE* = 1 shl 9
+  GTK_PARENT_SENSITIVE* = 1 shl 10
+  GTK_CAN_FOCUS* = 1 shl 11
+  GTK_HAS_FOCUS* = 1 shl 12
+  GTK_CAN_DEFAULT* = 1 shl 13
+  GTK_HAS_DEFAULT* = 1 shl 14
+  GTK_HAS_GRAB* = 1 shl 15
+  GTK_RC_STYLE* = 1 shl 16
+  GTK_COMPOSITE_CHILD* = 1 shl 17
+  GTK_NO_REPARENT* = 1 shl 18
+  GTK_APP_PAINTABLE* = 1 shl 19
+  GTK_RECEIVES_DEFAULT* = 1 shl 20
+  GTK_DOUBLE_BUFFERED* = 1 shl 21
+
+const
+  bm_TGtkWidgetAuxInfo_x_set* = 0x00000001
+  bp_TGtkWidgetAuxInfo_x_set* = 0
+  bm_TGtkWidgetAuxInfo_y_set* = 0x00000002
+  bp_TGtkWidgetAuxInfo_y_set* = 1
+
+proc GTK_TYPE_WIDGET*(): GType
+proc GTK_WIDGET*(widget: pointer): PGtkWidget
+proc GTK_WIDGET_CLASS*(klass: pointer): PGtkWidgetClass
+proc GTK_IS_WIDGET*(widget: pointer): bool
+proc GTK_IS_WIDGET_CLASS*(klass: pointer): bool
+proc GTK_WIDGET_GET_CLASS*(obj: pointer): PGtkWidgetClass
+proc GTK_WIDGET_TYPE*(wid: pointer): GType
+proc GTK_WIDGET_STATE*(wid: pointer): int32
+proc GTK_WIDGET_SAVED_STATE*(wid: pointer): int32
+proc GTK_WIDGET_FLAGS*(wid: pointer): guint32
+proc GTK_WIDGET_TOPLEVEL*(wid: pointer): gboolean
+proc GTK_WIDGET_NO_WINDOW*(wid: pointer): gboolean
+proc GTK_WIDGET_REALIZED*(wid: pointer): gboolean
+proc GTK_WIDGET_MAPPED*(wid: pointer): gboolean
+proc GTK_WIDGET_VISIBLE*(wid: pointer): gboolean
+proc GTK_WIDGET_DRAWABLE*(wid: pointer): gboolean
+proc GTK_WIDGET_SENSITIVE*(wid: pointer): gboolean
+proc GTK_WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean
+proc GTK_WIDGET_IS_SENSITIVE*(wid: pointer): gboolean
+proc GTK_WIDGET_CAN_FOCUS*(wid: pointer): gboolean
+proc GTK_WIDGET_HAS_FOCUS*(wid: pointer): gboolean
+proc GTK_WIDGET_CAN_DEFAULT*(wid: pointer): gboolean
+proc GTK_WIDGET_HAS_DEFAULT*(wid: pointer): gboolean
+proc GTK_WIDGET_HAS_GRAB*(wid: pointer): gboolean
+proc GTK_WIDGET_RC_STYLE*(wid: pointer): gboolean
+proc GTK_WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean
+proc GTK_WIDGET_APP_PAINTABLE*(wid: pointer): gboolean
+proc GTK_WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean
+proc GTK_WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean
+proc GTK_WIDGET_SET_FLAGS*(wid: PGtkWidget, flags: TGtkWidgetFlags): TGtkWidgetFlags
+proc GTK_WIDGET_UNSET_FLAGS*(wid: PGtkWidget, flags: TGtkWidgetFlags): TGtkWidgetFlags
+proc GTK_TYPE_REQUISITION*(): GType
+proc x_set*(a: var TGtkWidgetAuxInfo): guint
+proc set_x_set*(a: var TGtkWidgetAuxInfo, x_set: guint)
+proc y_set*(a: var TGtkWidgetAuxInfo): guint
+proc set_y_set*(a: var TGtkWidgetAuxInfo, y_set: guint)
+proc gtk_widget_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_widget_get_type".}
+proc gtk_widget_ref*(widget: PGtkWidget): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_ref".}
+proc gtk_widget_unref*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_unref".}
+proc gtk_widget_destroy*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_destroy".}
+proc gtk_widget_destroyed*(widget: PGtkWidget, r: var PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_destroyed".}
+proc gtk_widget_unparent*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_unparent".}
+proc gtk_widget_show*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_show".}
+proc gtk_widget_show_now*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_show_now".}
+proc gtk_widget_hide*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_hide".}
+proc gtk_widget_show_all*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_show_all".}
+proc gtk_widget_hide_all*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_hide_all".}
+proc gtk_widget_map*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_map".}
+proc gtk_widget_unmap*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_unmap".}
+proc gtk_widget_realize*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_realize".}
+proc gtk_widget_unrealize*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_unrealize".}
+proc gtk_widget_queue_draw*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_queue_draw".}
+proc gtk_widget_queue_draw_area*(widget: PGtkWidget, x: gint, y: gint,
+                                 width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_queue_draw_area".}
+proc gtk_widget_queue_resize*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_queue_resize".}
+proc gtk_widget_size_request*(widget: PGtkWidget, requisition: PGtkRequisition){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_size_request".}
+proc gtk_widget_size_allocate*(widget: PGtkWidget, allocation: PGtkAllocation){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_size_allocate".}
+proc gtk_widget_get_child_requisition*(widget: PGtkWidget,
+                                       requisition: PGtkRequisition){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_child_requisition".}
+proc gtk_widget_add_accelerator*(widget: PGtkWidget, accel_signal: cstring,
+                                 accel_group: PGtkAccelGroup, accel_key: guint,
+                                 accel_mods: TGdkModifierType,
+                                 accel_flags: TGtkAccelFlags){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_add_accelerator".}
+proc gtk_widget_remove_accelerator*(widget: PGtkWidget,
+                                    accel_group: PGtkAccelGroup,
+                                    accel_key: guint,
+                                    accel_mods: TGdkModifierType): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_remove_accelerator".}
+proc gtk_widget_set_accel_path*(widget: PGtkWidget, accel_path: cstring,
+                                accel_group: PGtkAccelGroup){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_accel_path".}
+proc gtk_widget_get_accel_path*(widget: PGtkWidget, locked: Pgboolean): cstring{.
+    cdecl, dynlib: gtklib, importc: "_gtk_widget_get_accel_path".}
+proc gtk_widget_list_accel_closures*(widget: PGtkWidget): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_list_accel_closures".}
+proc gtk_widget_mnemonic_activate*(widget: PGtkWidget, group_cycling: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_mnemonic_activate".}
+proc gtk_widget_event*(widget: PGtkWidget, event: PGdkEvent): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_event".}
+proc gtk_widget_send_expose*(widget: PGtkWidget, event: PGdkEvent): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_send_expose".}
+proc gtk_widget_activate*(widget: PGtkWidget): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_activate".}
+proc gtk_widget_set_scroll_adjustments*(widget: PGtkWidget,
+                                        hadjustment: PGtkAdjustment,
+                                        vadjustment: PGtkAdjustment): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_scroll_adjustments".}
+proc gtk_widget_reparent*(widget: PGtkWidget, new_parent: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_reparent".}
+proc gtk_widget_intersect*(widget: PGtkWidget, area: PGdkRectangle,
+                           intersection: PGdkRectangle): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_intersect".}
+proc gtk_widget_region_intersect*(widget: PGtkWidget, region: PGdkRegion): PGdkRegion{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_region_intersect".}
+proc gtk_widget_freeze_child_notify*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_freeze_child_notify".}
+proc gtk_widget_child_notify*(widget: PGtkWidget, child_property: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_child_notify".}
+proc gtk_widget_thaw_child_notify*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_thaw_child_notify".}
+proc gtk_widget_is_focus*(widget: PGtkWidget): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_is_focus".}
+proc gtk_widget_grab_focus*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_grab_focus".}
+proc gtk_widget_grab_default*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_grab_default".}
+proc gtk_widget_set_name*(widget: PGtkWidget, name: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_name".}
+proc gtk_widget_get_name*(widget: PGtkWidget): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_get_name".}
+proc gtk_widget_set_state*(widget: PGtkWidget, state: TGtkStateType){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_state".}
+proc gtk_widget_set_sensitive*(widget: PGtkWidget, sensitive: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_sensitive".}
+proc gtk_widget_set_app_paintable*(widget: PGtkWidget, app_paintable: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_app_paintable".}
+proc gtk_widget_set_double_buffered*(widget: PGtkWidget,
+                                     double_buffered: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_double_buffered".}
+proc gtk_widget_set_redraw_on_allocate*(widget: PGtkWidget,
+                                        redraw_on_allocate: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_redraw_on_allocate".}
+proc gtk_widget_set_parent*(widget: PGtkWidget, parent: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_parent".}
+proc gtk_widget_set_parent_window*(widget: PGtkWidget, parent_window: PGdkWindow){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_parent_window".}
+proc gtk_widget_set_child_visible*(widget: PGtkWidget, is_visible: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_child_visible".}
+proc gtk_widget_get_child_visible*(widget: PGtkWidget): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_child_visible".}
+proc gtk_widget_get_parent*(widget: PGtkWidget): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_parent".}
+proc gtk_widget_get_parent_window*(widget: PGtkWidget): PGdkWindow{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_parent_window".}
+proc gtk_widget_child_focus*(widget: PGtkWidget, direction: TGtkDirectionType): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_child_focus".}
+proc gtk_widget_set_size_request*(widget: PGtkWidget, width: gint, height: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_size_request".}
+proc gtk_widget_get_size_request*(widget: PGtkWidget, width: Pgint,
+                                  height: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_get_size_request".}
+proc gtk_widget_set_events*(widget: PGtkWidget, events: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_events".}
+proc gtk_widget_add_events*(widget: PGtkWidget, events: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_add_events".}
+proc gtk_widget_set_extension_events*(widget: PGtkWidget,
+                                      mode: TGdkExtensionMode){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_extension_events".}
+proc gtk_widget_get_extension_events*(widget: PGtkWidget): TGdkExtensionMode{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_get_extension_events".}
+proc gtk_widget_get_toplevel*(widget: PGtkWidget): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_toplevel".}
+proc gtk_widget_get_ancestor*(widget: PGtkWidget, widget_type: TGtkType): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_get_ancestor".}
+proc gtk_widget_get_colormap*(widget: PGtkWidget): PGdkColormap{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_colormap".}
+proc gtk_widget_get_visual*(widget: PGtkWidget): PGdkVisual{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_visual".}
+proc gtk_widget_get_screen*(widget: PGtkWidget): PGdkScreen{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_screen".}
+proc gtk_widget_has_screen*(widget: PGtkWidget): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_has_screen".}
+proc gtk_widget_get_display*(widget: PGtkWidget): PGdkDisplay{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_display".}
+proc gtk_widget_get_root_window*(widget: PGtkWidget): PGdkWindow{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_root_window".}
+proc gtk_widget_get_settings*(widget: PGtkWidget): PGtkSettings{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_settings".}
+proc gtk_widget_get_clipboard*(widget: PGtkWidget, selection: TGdkAtom): PGtkClipboard{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_get_clipboard".}
+proc gtk_widget_get_accessible*(widget: PGtkWidget): PAtkObject{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_accessible".}
+proc gtk_widget_set_colormap*(widget: PGtkWidget, colormap: PGdkColormap){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_colormap".}
+proc gtk_widget_get_events*(widget: PGtkWidget): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_get_events".}
+proc gtk_widget_get_pointer*(widget: PGtkWidget, x: Pgint, y: Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_pointer".}
+proc gtk_widget_is_ancestor*(widget: PGtkWidget, ancestor: PGtkWidget): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_is_ancestor".}
+proc gtk_widget_translate_coordinates*(src_widget: PGtkWidget,
+                                       dest_widget: PGtkWidget, src_x: gint,
+                                       src_y: gint, dest_x: Pgint, dest_y: Pgint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_translate_coordinates".}
+proc gtk_widget_hide_on_delete*(widget: PGtkWidget): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_hide_on_delete".}
+proc gtk_widget_set_style*(widget: PGtkWidget, style: PGtkStyle){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_style".}
+proc gtk_widget_ensure_style*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_ensure_style".}
+proc gtk_widget_get_style*(widget: PGtkWidget): PGtkStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_style".}
+proc gtk_widget_modify_style*(widget: PGtkWidget, style: PGtkRcStyle){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_modify_style".}
+proc gtk_widget_get_modifier_style*(widget: PGtkWidget): PGtkRcStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_modifier_style".}
+proc gtk_widget_modify_fg*(widget: PGtkWidget, state: TGtkStateType,
+                           color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_modify_fg".}
+proc gtk_widget_modify_bg*(widget: PGtkWidget, state: TGtkStateType,
+                           color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_modify_bg".}
+proc gtk_widget_modify_text*(widget: PGtkWidget, state: TGtkStateType,
+                             color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_modify_text".}
+proc gtk_widget_modify_base*(widget: PGtkWidget, state: TGtkStateType,
+                             color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_modify_base".}
+proc gtk_widget_modify_font*(widget: PGtkWidget,
+                             font_desc: PPangoFontDescription){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_modify_font".}
+proc gtk_widget_create_pango_context*(widget: PGtkWidget): PPangoContext{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_create_pango_context".}
+proc gtk_widget_get_pango_context*(widget: PGtkWidget): PPangoContext{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_pango_context".}
+proc gtk_widget_create_pango_layout*(widget: PGtkWidget, text: cstring): PPangoLayout{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_create_pango_layout".}
+proc gtk_widget_render_icon*(widget: PGtkWidget, stock_id: cstring,
+                             size: TGtkIconSize, detail: cstring): PGdkPixbuf{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_render_icon".}
+proc gtk_widget_set_composite_name*(widget: PGtkWidget, name: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_composite_name".}
+proc gtk_widget_get_composite_name*(widget: PGtkWidget): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_composite_name".}
+proc gtk_widget_reset_rc_styles*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_reset_rc_styles".}
+proc gtk_widget_push_colormap*(cmap: PGdkColormap){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_push_colormap".}
+proc gtk_widget_push_composite_child*(){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_push_composite_child".}
+proc gtk_widget_pop_composite_child*(){.cdecl, dynlib: gtklib, importc: "gtk_widget_pop_composite_child".}
+proc gtk_widget_pop_colormap*(){.cdecl, dynlib: gtklib,
+                                 importc: "gtk_widget_pop_colormap".}
+proc gtk_widget_class_install_style_property*(klass: PGtkWidgetClass,
+    pspec: PGParamSpec){.cdecl, dynlib: gtklib,
+                         importc: "gtk_widget_class_install_style_property".}
+proc gtk_widget_class_install_style_property_parser*(klass: PGtkWidgetClass,
+    pspec: PGParamSpec, parser: TGtkRcPropertyParser){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_class_install_style_property_parser".}
+proc gtk_widget_class_find_style_property*(klass: PGtkWidgetClass,
+    property_name: cstring): PGParamSpec{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_class_find_style_property".}
+proc gtk_widget_class_list_style_properties*(klass: PGtkWidgetClass,
+    n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_class_list_style_properties".}
+proc gtk_widget_style_get_property*(widget: PGtkWidget, property_name: cstring,
+                                    value: PGValue){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_style_get_property".}
+proc gtk_widget_set_default_colormap*(colormap: PGdkColormap){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_default_colormap".}
+proc gtk_widget_get_default_style*(): PGtkStyle{.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_get_default_style".}
+proc gtk_widget_set_direction*(widget: PGtkWidget, dir: TGtkTextDirection){.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_set_direction".}
+proc gtk_widget_get_direction*(widget: PGtkWidget): TGtkTextDirection{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_direction".}
+proc gtk_widget_set_default_direction*(dir: TGtkTextDirection){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_set_default_direction".}
+proc gtk_widget_get_default_direction*(): TGtkTextDirection{.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_get_default_direction".}
+proc gtk_widget_shape_combine_mask*(widget: PGtkWidget, shape_mask: PGdkBitmap,
+                                    offset_x: gint, offset_y: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_shape_combine_mask".}
+proc gtk_widget_reset_shapes*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_reset_shapes".}
+proc gtk_widget_path*(widget: PGtkWidget, path_length: Pguint, path: PPgchar,
+                      path_reversed: PPgchar){.cdecl, dynlib: gtklib,
+    importc: "gtk_widget_path".}
+proc gtk_widget_class_path*(widget: PGtkWidget, path_length: Pguint,
+                            path: PPgchar, path_reversed: PPgchar){.cdecl,
+    dynlib: gtklib, importc: "gtk_widget_class_path".}
+proc gtk_requisition_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_requisition_get_type".}
+proc gtk_requisition_copy*(requisition: PGtkRequisition): PGtkRequisition{.
+    cdecl, dynlib: gtklib, importc: "gtk_requisition_copy".}
+proc gtk_requisition_free*(requisition: PGtkRequisition){.cdecl, dynlib: gtklib,
+    importc: "gtk_requisition_free".}
+proc gtk_widget_get_aux_info*(widget: PGtkWidget, create: gboolean): PGtkWidgetAuxInfo{.
+    cdecl, dynlib: gtklib, importc: "gtk_widget_get_aux_info".}
+proc gtk_widget_propagate_hierarchy_changed*(widget: PGtkWidget,
+    previous_toplevel: PGtkWidget){.cdecl, dynlib: gtklib, importc: "_gtk_widget_propagate_hierarchy_changed".}
+proc gtk_widget_peek_colormap*(): PGdkColormap{.cdecl, dynlib: gtklib,
+    importc: "_gtk_widget_peek_colormap".}
+proc GTK_TYPE_MISC*(): GType
+proc GTK_MISC*(obj: pointer): PGtkMisc
+proc GTK_MISC_CLASS*(klass: pointer): PGtkMiscClass
+proc GTK_IS_MISC*(obj: pointer): bool
+proc GTK_IS_MISC_CLASS*(klass: pointer): bool
+proc GTK_MISC_GET_CLASS*(obj: pointer): PGtkMiscClass
+proc gtk_misc_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_misc_get_type".}
+proc gtk_misc_set_alignment*(misc: PGtkMisc, xalign: gfloat, yalign: gfloat){.
+    cdecl, dynlib: gtklib, importc: "gtk_misc_set_alignment".}
+proc gtk_misc_get_alignment*(misc: PGtkMisc, xalign, yalign: var Pgfloat){.
+    cdecl, dynlib: gtklib, importc: "gtk_misc_get_alignment".}
+proc gtk_misc_set_padding*(misc: PGtkMisc, xpad: gint, ypad: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_misc_set_padding".}
+proc gtk_misc_get_padding*(misc: PGtkMisc, xpad, ypad: var Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_misc_get_padding".}
+const
+  GTK_ACCEL_VISIBLE* = 1 shl 0
+  GTK_ACCEL_LOCKED* = 1 shl 1
+  GTK_ACCEL_MASK* = 0x00000007
+  bm_TGtkAccelKey_accel_flags* = 0x0000FFFF
+  bp_TGtkAccelKey_accel_flags* = 0
+
+proc GTK_TYPE_ACCEL_GROUP*(): GType
+proc GTK_ACCEL_GROUP*(anObject: pointer): PGtkAccelGroup
+proc GTK_ACCEL_GROUP_CLASS*(klass: pointer): PGtkAccelGroupClass
+proc GTK_IS_ACCEL_GROUP*(anObject: pointer): bool
+proc GTK_IS_ACCEL_GROUP_CLASS*(klass: pointer): bool
+proc GTK_ACCEL_GROUP_GET_CLASS*(obj: pointer): PGtkAccelGroupClass
+proc accel_flags*(a: var TGtkAccelKey): guint
+proc set_accel_flags*(a: var TGtkAccelKey, `accel_flags`: guint)
+proc gtk_accel_group_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_group_get_type".}
+proc gtk_accel_group_new*(): PGtkAccelGroup{.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_group_new".}
+proc gtk_accel_group_lock*(accel_group: PGtkAccelGroup){.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_group_lock".}
+proc gtk_accel_group_unlock*(accel_group: PGtkAccelGroup){.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_group_unlock".}
+proc gtk_accel_group_connect*(accel_group: PGtkAccelGroup, accel_key: guint,
+                              accel_mods: TGdkModifierType,
+                              accel_flags: TGtkAccelFlags, closure: PGClosure){.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_connect".}
+proc gtk_accel_group_connect_by_path*(accel_group: PGtkAccelGroup,
+                                      accel_path: cstring, closure: PGClosure){.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_connect_by_path".}
+proc gtk_accel_group_disconnect*(accel_group: PGtkAccelGroup, closure: PGClosure): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_disconnect".}
+proc gtk_accel_group_disconnect_key*(accel_group: PGtkAccelGroup,
+                                     accel_key: guint,
+                                     accel_mods: TGdkModifierType): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_disconnect_key".}
+proc gtk_accel_group_attach*(accel_group: PGtkAccelGroup, anObject: PGObject){.
+    cdecl, dynlib: gtklib, importc: "_gtk_accel_group_attach".}
+proc gtk_accel_group_detach*(accel_group: PGtkAccelGroup, anObject: PGObject){.
+    cdecl, dynlib: gtklib, importc: "_gtk_accel_group_detach".}
+proc gtk_accel_groups_activate*(anObject: PGObject, accel_key: guint,
+                                accel_mods: TGdkModifierType): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_groups_activate".}
+proc gtk_accel_groups_from_object*(anObject: PGObject): PGSList{.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_groups_from_object".}
+proc gtk_accel_group_find*(accel_group: PGtkAccelGroup,
+                           find_func: Tgtk_accel_group_find_func, data: gpointer): PGtkAccelKey{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_find".}
+proc gtk_accel_group_from_accel_closure*(closure: PGClosure): PGtkAccelGroup{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_from_accel_closure".}
+proc gtk_accelerator_valid*(keyval: guint, modifiers: TGdkModifierType): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_accelerator_valid".}
+proc gtk_accelerator_parse*(accelerator: cstring, accelerator_key: Pguint,
+                            accelerator_mods: PGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_accelerator_parse".}
+proc gtk_accelerator_name*(accelerator_key: guint,
+                           accelerator_mods: TGdkModifierType): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_accelerator_name".}
+proc gtk_accelerator_set_default_mod_mask*(default_mod_mask: TGdkModifierType){.
+    cdecl, dynlib: gtklib, importc: "gtk_accelerator_set_default_mod_mask".}
+proc gtk_accelerator_get_default_mod_mask*(): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_accelerator_get_default_mod_mask".}
+proc gtk_accel_group_query*(accel_group: PGtkAccelGroup, accel_key: guint,
+                            accel_mods: TGdkModifierType, n_entries: Pguint): PGtkAccelGroupEntry{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_group_query".}
+proc gtk_accel_group_reconnect*(accel_group: PGtkAccelGroup,
+                                accel_path_quark: TGQuark){.cdecl,
+    dynlib: gtklib, importc: "_gtk_accel_group_reconnect".}
+const
+  bm_TGtkContainer_border_width* = 0x0000FFFF
+  bp_TGtkContainer_border_width* = 0
+  bm_TGtkContainer_need_resize* = 0x00010000
+  bp_TGtkContainer_need_resize* = 16
+  bm_TGtkContainer_resize_mode* = 0x00060000
+  bp_TGtkContainer_resize_mode* = 17
+  bm_TGtkContainer_reallocate_redraws* = 0x00080000
+  bp_TGtkContainer_reallocate_redraws* = 19
+  bm_TGtkContainer_has_focus_chain* = 0x00100000
+  bp_TGtkContainer_has_focus_chain* = 20
+
+proc GTK_TYPE_CONTAINER*(): GType
+proc GTK_CONTAINER*(obj: pointer): PGtkContainer
+proc GTK_CONTAINER_CLASS*(klass: pointer): PGtkContainerClass
+proc GTK_IS_CONTAINER*(obj: pointer): bool
+proc GTK_IS_CONTAINER_CLASS*(klass: pointer): bool
+proc GTK_CONTAINER_GET_CLASS*(obj: pointer): PGtkContainerClass
+proc GTK_IS_RESIZE_CONTAINER*(widget: pointer): bool
+proc border_width*(a: var TGtkContainer): guint
+proc set_border_width*(a: var TGtkContainer, `border_width`: guint)
+proc need_resize*(a: var TGtkContainer): guint
+proc set_need_resize*(a: var TGtkContainer, `need_resize`: guint)
+proc resize_mode*(a: PGtkContainer): guint
+proc set_resize_mode*(a: var TGtkContainer, `resize_mode`: guint)
+proc reallocate_redraws*(a: var TGtkContainer): guint
+proc set_reallocate_redraws*(a: var TGtkContainer, `reallocate_redraws`: guint)
+proc has_focus_chain*(a: var TGtkContainer): guint
+proc set_has_focus_chain*(a: var TGtkContainer, `has_focus_chain`: guint)
+proc gtk_container_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_container_get_type".}
+proc gtk_container_set_border_width*(container: PGtkContainer,
+                                     border_width: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_set_border_width".}
+proc gtk_container_get_border_width*(container: PGtkContainer): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_container_get_border_width".}
+proc gtk_container_add*(container: PGtkContainer, widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_add".}
+proc gtk_container_remove*(container: PGtkContainer, widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_remove".}
+proc gtk_container_set_resize_mode*(container: PGtkContainer,
+                                    resize_mode: TGtkResizeMode){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_set_resize_mode".}
+proc gtk_container_get_resize_mode*(container: PGtkContainer): TGtkResizeMode{.
+    cdecl, dynlib: gtklib, importc: "gtk_container_get_resize_mode".}
+proc gtk_container_check_resize*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_check_resize".}
+proc gtk_container_foreach*(container: PGtkContainer, callback: TGtkCallback,
+                            callback_data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_container_foreach".}
+proc gtk_container_get_children*(container: PGtkContainer): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_container_get_children".}
+proc gtk_container_propagate_expose*(container: PGtkContainer,
+                                     child: PGtkWidget, event: PGdkEventExpose){.
+    cdecl, dynlib: gtklib, importc: "gtk_container_propagate_expose".}
+proc gtk_container_set_focus_chain*(container: PGtkContainer,
+                                    focusable_widgets: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_set_focus_chain".}
+proc gtk_container_get_focus_chain*(container: PGtkContainer, s: var PGList): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_container_get_focus_chain".}
+proc gtk_container_unset_focus_chain*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_unset_focus_chain".}
+proc gtk_container_set_reallocate_redraws*(container: PGtkContainer,
+    needs_redraws: gboolean){.cdecl, dynlib: gtklib,
+                              importc: "gtk_container_set_reallocate_redraws".}
+proc gtk_container_set_focus_child*(container: PGtkContainer, child: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_container_set_focus_child".}
+proc gtk_container_set_focus_vadjustment*(container: PGtkContainer,
+    adjustment: PGtkAdjustment){.cdecl, dynlib: gtklib,
+                                 importc: "gtk_container_set_focus_vadjustment".}
+proc gtk_container_get_focus_vadjustment*(container: PGtkContainer): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_container_get_focus_vadjustment".}
+proc gtk_container_set_focus_hadjustment*(container: PGtkContainer,
+    adjustment: PGtkAdjustment){.cdecl, dynlib: gtklib,
+                                 importc: "gtk_container_set_focus_hadjustment".}
+proc gtk_container_get_focus_hadjustment*(container: PGtkContainer): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_container_get_focus_hadjustment".}
+proc gtk_container_resize_children*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "gtk_container_resize_children".}
+proc gtk_container_child_type*(container: PGtkContainer): TGtkType{.cdecl,
+    dynlib: gtklib, importc: "gtk_container_child_type".}
+proc gtk_container_class_install_child_property*(cclass: PGtkContainerClass,
+    property_id: guint, pspec: PGParamSpec){.cdecl, dynlib: gtklib,
+    importc: "gtk_container_class_install_child_property".}
+proc gtk_container_class_find_child_property*(cclass: PGObjectClass,
+    property_name: cstring): PGParamSpec{.cdecl, dynlib: gtklib,
+    importc: "gtk_container_class_find_child_property".}
+proc gtk_container_class_list_child_properties*(cclass: PGObjectClass,
+    n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: gtklib,
+    importc: "gtk_container_class_list_child_properties".}
+proc gtk_container_child_set_property*(container: PGtkContainer,
+                                       child: PGtkWidget, property_name: cstring,
+                                       value: PGValue){.cdecl, dynlib: gtklib,
+    importc: "gtk_container_child_set_property".}
+proc gtk_container_child_get_property*(container: PGtkContainer,
+                                       child: PGtkWidget, property_name: cstring,
+                                       value: PGValue){.cdecl, dynlib: gtklib,
+    importc: "gtk_container_child_get_property".}
+proc GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer,
+    property_id: guint, pspec: pointer)
+proc gtk_container_forall*(container: PGtkContainer, callback: TGtkCallback,
+                           callback_data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_container_forall".}
+proc gtk_container_queue_resize*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "_gtk_container_queue_resize".}
+proc gtk_container_clear_resize_widgets*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "_gtk_container_clear_resize_widgets".}
+proc gtk_container_child_composite_name*(container: PGtkContainer,
+    child: PGtkWidget): cstring{.cdecl, dynlib: gtklib,
+                                importc: "_gtk_container_child_composite_name".}
+proc gtk_container_dequeue_resize_handler*(container: PGtkContainer){.cdecl,
+    dynlib: gtklib, importc: "_gtk_container_dequeue_resize_handler".}
+proc gtk_container_focus_sort*(container: PGtkContainer, children: PGList,
+                                 direction: TGtkDirectionType,
+                                 old_focus: PGtkWidget): PGList{.cdecl,
+    dynlib: gtklib, importc: "_gtk_container_focus_sort".}
+proc GTK_TYPE_BIN*(): GType
+proc GTK_BIN*(obj: pointer): PGtkBin
+proc GTK_BIN_CLASS*(klass: pointer): PGtkBinClass
+proc GTK_IS_BIN*(obj: pointer): bool
+proc GTK_IS_BIN_CLASS*(klass: pointer): bool
+proc GTK_BIN_GET_CLASS*(obj: pointer): PGtkBinClass
+proc gtk_bin_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_bin_get_type".}
+proc gtk_bin_get_child*(bin: PGtkBin): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_bin_get_child".}
+const
+  bm_TGtkWindow_allow_shrink* = 0x00000001
+  bp_TGtkWindow_allow_shrink* = 0
+  bm_TGtkWindow_allow_grow* = 0x00000002
+  bp_TGtkWindow_allow_grow* = 1
+  bm_TGtkWindow_configure_notify_received* = 0x00000004
+  bp_TGtkWindow_configure_notify_received* = 2
+  bm_TGtkWindow_need_default_position* = 0x00000008
+  bp_TGtkWindow_need_default_position* = 3
+  bm_TGtkWindow_need_default_size* = 0x00000010
+  bp_TGtkWindow_need_default_size* = 4
+  bm_TGtkWindow_position* = 0x000000E0
+  bp_TGtkWindow_position* = 5
+  bm_TGtkWindow_type* = 0x00000F00
+  bp_TGtkWindow_type* = 8
+  bm_TGtkWindow_has_user_ref_count* = 0x00001000
+  bp_TGtkWindow_has_user_ref_count* = 12
+  bm_TGtkWindow_has_focus* = 0x00002000
+  bp_TGtkWindow_has_focus* = 13
+  bm_TGtkWindow_modal* = 0x00004000
+  bp_TGtkWindow_modal* = 14
+  bm_TGtkWindow_destroy_with_parent* = 0x00008000
+  bp_TGtkWindow_destroy_with_parent* = 15
+  bm_TGtkWindow_has_frame* = 0x00010000
+  bp_TGtkWindow_has_frame* = 16
+  bm_TGtkWindow_iconify_initially* = 0x00020000
+  bp_TGtkWindow_iconify_initially* = 17
+  bm_TGtkWindow_stick_initially* = 0x00040000
+  bp_TGtkWindow_stick_initially* = 18
+  bm_TGtkWindow_maximize_initially* = 0x00080000
+  bp_TGtkWindow_maximize_initially* = 19
+  bm_TGtkWindow_decorated* = 0x00100000
+  bp_TGtkWindow_decorated* = 20
+  bm_TGtkWindow_type_hint* = 0x00E00000
+  bp_TGtkWindow_type_hint* = 21
+  bm_TGtkWindow_gravity* = 0x1F000000
+  bp_TGtkWindow_gravity* = 24
+
+proc GTK_TYPE_WINDOW*(): GType
+proc GTK_WINDOW*(obj: pointer): PGtkWindow
+proc GTK_WINDOW_CLASS*(klass: pointer): PGtkWindowClass
+proc GTK_IS_WINDOW*(obj: pointer): bool
+proc GTK_IS_WINDOW_CLASS*(klass: pointer): bool
+proc GTK_WINDOW_GET_CLASS*(obj: pointer): PGtkWindowClass
+proc allow_shrink*(a: var TGtkWindow): guint
+proc set_allow_shrink*(a: var TGtkWindow, `allow_shrink`: guint)
+proc allow_grow*(a: var TGtkWindow): guint
+proc set_allow_grow*(a: var TGtkWindow, `allow_grow`: guint)
+proc configure_notify_received*(a: var TGtkWindow): guint
+proc set_configure_notify_received*(a: var TGtkWindow,
+                                    `configure_notify_received`: guint)
+proc need_default_position*(a: var TGtkWindow): guint
+proc set_need_default_position*(a: var TGtkWindow,
+                                `need_default_position`: guint)
+proc need_default_size*(a: var TGtkWindow): guint
+proc set_need_default_size*(a: var TGtkWindow, `need_default_size`: guint)
+proc position*(a: var TGtkWindow): guint
+proc set_position*(a: var TGtkWindow, `position`: guint)
+proc get_type*(a: var TGtkWindow): guint
+proc set_type*(a: var TGtkWindow, `type`: guint)
+proc has_user_ref_count*(a: var TGtkWindow): guint
+proc set_has_user_ref_count*(a: var TGtkWindow, `has_user_ref_count`: guint)
+proc has_focus*(a: var TGtkWindow): guint
+proc set_has_focus*(a: var TGtkWindow, `has_focus`: guint)
+proc modal*(a: var TGtkWindow): guint
+proc set_modal*(a: var TGtkWindow, `modal`: guint)
+proc destroy_with_parent*(a: var TGtkWindow): guint
+proc set_destroy_with_parent*(a: var TGtkWindow, `destroy_with_parent`: guint)
+proc has_frame*(a: var TGtkWindow): guint
+proc set_has_frame*(a: var TGtkWindow, `has_frame`: guint)
+proc iconify_initially*(a: var TGtkWindow): guint
+proc set_iconify_initially*(a: var TGtkWindow, `iconify_initially`: guint)
+proc stick_initially*(a: var TGtkWindow): guint
+proc set_stick_initially*(a: var TGtkWindow, `stick_initially`: guint)
+proc maximize_initially*(a: var TGtkWindow): guint
+proc set_maximize_initially*(a: var TGtkWindow, `maximize_initially`: guint)
+proc decorated*(a: var TGtkWindow): guint
+proc set_decorated*(a: var TGtkWindow, `decorated`: guint)
+proc type_hint*(a: var TGtkWindow): guint
+proc set_type_hint*(a: var TGtkWindow, `type_hint`: guint)
+proc gravity*(a: var TGtkWindow): guint
+proc set_gravity*(a: var TGtkWindow, `gravity`: guint)
+proc GTK_TYPE_WINDOW_GROUP*(): GType
+proc GTK_WINDOW_GROUP*(anObject: pointer): PGtkWindowGroup
+proc GTK_WINDOW_GROUP_CLASS*(klass: pointer): PGtkWindowGroupClass
+proc GTK_IS_WINDOW_GROUP*(anObject: pointer): bool
+proc GTK_IS_WINDOW_GROUP_CLASS*(klass: pointer): bool
+proc GTK_WINDOW_GROUP_GET_CLASS*(obj: pointer): PGtkWindowGroupClass
+proc gtk_window_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_window_get_type".}
+proc gtk_window_new*(thetype: TGtkWindowType): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_new".}
+proc gtk_window_set_title*(window: PGtkWindow, title: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_title".}
+proc gtk_window_get_title*(window: PGtkWindow): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_get_title".}
+proc gtk_window_set_wmclass*(window: PGtkWindow, wmclass_name: cstring,
+                             wmclass_class: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_set_wmclass".}
+proc gtk_window_set_role*(window: PGtkWindow, role: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_role".}
+proc gtk_window_get_role*(window: PGtkWindow): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_get_role".}
+proc gtk_window_add_accel_group*(window: PGtkWindow, accel_group: PGtkAccelGroup){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_add_accel_group".}
+proc gtk_window_remove_accel_group*(window: PGtkWindow,
+                                    accel_group: PGtkAccelGroup){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_remove_accel_group".}
+proc gtk_window_set_position*(window: PGtkWindow, position: TGtkWindowPosition){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_position".}
+proc gtk_window_activate_focus*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_activate_focus".}
+proc gtk_window_set_focus*(window: PGtkWindow, focus: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_focus".}
+proc gtk_window_get_focus*(window: PGtkWindow): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_focus".}
+proc gtk_window_set_default*(window: PGtkWindow, default_widget: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_default".}
+proc gtk_window_activate_default*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_activate_default".}
+proc gtk_window_set_transient_for*(window: PGtkWindow, parent: PGtkWindow){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_transient_for".}
+proc gtk_window_get_transient_for*(window: PGtkWindow): PGtkWindow{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_transient_for".}
+proc gtk_window_set_type_hint*(window: PGtkWindow, hint: TGdkWindowTypeHint){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_type_hint".}
+proc gtk_window_get_type_hint*(window: PGtkWindow): TGdkWindowTypeHint{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_type_hint".}
+proc gtk_window_set_destroy_with_parent*(window: PGtkWindow, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_destroy_with_parent".}
+proc gtk_window_get_destroy_with_parent*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_destroy_with_parent".}
+proc gtk_window_set_resizable*(window: PGtkWindow, resizable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_resizable".}
+proc gtk_window_get_resizable*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_resizable".}
+proc gtk_window_set_gravity*(window: PGtkWindow, gravity: TGdkGravity){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_gravity".}
+proc gtk_window_get_gravity*(window: PGtkWindow): TGdkGravity{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_gravity".}
+proc gtk_window_set_geometry_hints*(window: PGtkWindow,
+                                    geometry_widget: PGtkWidget,
+                                    geometry: PGdkGeometry,
+                                    geom_mask: TGdkWindowHints){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_geometry_hints".}
+proc gtk_window_set_screen*(window: PGtkWindow, screen: PGdkScreen){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_screen".}
+proc gtk_window_get_screen*(window: PGtkWindow): PGdkScreen{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_screen".}
+proc gtk_window_set_has_frame*(window: PGtkWindow, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_has_frame".}
+proc gtk_window_get_has_frame*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_has_frame".}
+proc gtk_window_set_frame_dimensions*(window: PGtkWindow, left: gint, top: gint,
+                                      right: gint, bottom: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_frame_dimensions".}
+proc gtk_window_get_frame_dimensions*(window: PGtkWindow, left: Pgint,
+                                      top: Pgint, right: Pgint, bottom: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_get_frame_dimensions".}
+proc gtk_window_set_decorated*(window: PGtkWindow, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_decorated".}
+proc gtk_window_get_decorated*(window: PGtkWindow): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_decorated".}
+proc gtk_window_set_icon_list*(window: PGtkWindow, list: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_icon_list".}
+proc gtk_window_get_icon_list*(window: PGtkWindow): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_icon_list".}
+proc gtk_window_set_icon*(window: PGtkWindow, icon: PGdkPixbuf){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_icon".}
+proc gtk_window_get_icon*(window: PGtkWindow): PGdkPixbuf{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_get_icon".}
+proc gtk_window_set_default_icon_list*(list: PGList){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_set_default_icon_list".}
+proc gtk_window_get_default_icon_list*(): PGList{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_get_default_icon_list".}
+proc gtk_window_set_modal*(window: PGtkWindow, modal: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_modal".}
+proc gtk_window_get_modal*(window: PGtkWindow): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_get_modal".}
+proc gtk_window_list_toplevels*(): PGList{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_list_toplevels".}
+proc gtk_window_add_mnemonic*(window: PGtkWindow, keyval: guint,
+                              target: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_add_mnemonic".}
+proc gtk_window_remove_mnemonic*(window: PGtkWindow, keyval: guint,
+                                 target: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_remove_mnemonic".}
+proc gtk_window_mnemonic_activate*(window: PGtkWindow, keyval: guint,
+                                   modifier: TGdkModifierType): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_window_mnemonic_activate".}
+proc gtk_window_set_mnemonic_modifier*(window: PGtkWindow,
+                                       modifier: TGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_set_mnemonic_modifier".}
+proc gtk_window_get_mnemonic_modifier*(window: PGtkWindow): TGdkModifierType{.
+    cdecl, dynlib: gtklib, importc: "gtk_window_get_mnemonic_modifier".}
+proc gtk_window_present*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_present".}
+proc gtk_window_iconify*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_iconify".}
+proc gtk_window_deiconify*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_deiconify".}
+proc gtk_window_stick*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_stick".}
+proc gtk_window_unstick*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_unstick".}
+proc gtk_window_maximize*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_maximize".}
+proc gtk_window_unmaximize*(window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_unmaximize".}
+proc gtk_window_begin_resize_drag*(window: PGtkWindow, edge: TGdkWindowEdge,
+                                   button: gint, root_x: gint, root_y: gint,
+                                   timestamp: guint32){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_begin_resize_drag".}
+proc gtk_window_begin_move_drag*(window: PGtkWindow, button: gint, root_x: gint,
+                                 root_y: gint, timestamp: guint32){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_begin_move_drag".}
+proc gtk_window_set_default_size*(window: PGtkWindow, width: gint, height: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_set_default_size".}
+proc gtk_window_get_default_size*(window: PGtkWindow, width: Pgint,
+                                  height: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_get_default_size".}
+proc gtk_window_resize*(window: PGtkWindow, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_resize".}
+proc gtk_window_get_size*(window: PGtkWindow, width: Pgint, height: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_get_size".}
+proc gtk_window_move*(window: PGtkWindow, x: gint, y: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_move".}
+proc gtk_window_get_position*(window: PGtkWindow, root_x: Pgint, root_y: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_window_get_position".}
+proc gtk_window_parse_geometry*(window: PGtkWindow, geometry: cstring): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_window_parse_geometry".}
+proc gtk_window_reshow_with_initial_size*(window: PGtkWindow){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_reshow_with_initial_size".}
+proc gtk_window_group_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_group_get_type".}
+proc gtk_window_group_new*(): PGtkWindowGroup{.cdecl, dynlib: gtklib,
+    importc: "gtk_window_group_new".}
+proc gtk_window_group_add_window*(window_group: PGtkWindowGroup,
+                                  window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_group_add_window".}
+proc gtk_window_group_remove_window*(window_group: PGtkWindowGroup,
+                                     window: PGtkWindow){.cdecl, dynlib: gtklib,
+    importc: "gtk_window_group_remove_window".}
+proc gtk_window_internal_set_focus*(window: PGtkWindow, focus: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "_gtk_window_internal_set_focus".}
+proc gtk_window_remove_embedded_xid*(window: PGtkWindow, xid: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_remove_embedded_xid".}
+proc gtk_window_add_embedded_xid*(window: PGtkWindow, xid: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_window_add_embedded_xid".}
+proc gtk_window_reposition*(window: PGtkWindow, x: gint, y: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_window_reposition".}
+proc gtk_window_constrain_size*(window: PGtkWindow, width: gint, height: gint,
+                                  new_width: Pgint, new_height: Pgint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_window_constrain_size".}
+proc gtk_window_get_group*(window: PGtkWindow): PGtkWindowGroup{.cdecl,
+    dynlib: gtklib, importc: "_gtk_window_get_group".}
+proc gtk_window_activate_key*(window: PGtkWindow, event: PGdkEventKey): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_window_activate_key".}
+proc gtk_window_keys_foreach*(window: PGtkWindow,
+                                func: TGtkWindowKeysForeachFunc,
+                                func_data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "_gtk_window_keys_foreach".}
+proc gtk_window_query_nonaccels*(window: PGtkWindow, accel_key: guint,
+                                   accel_mods: TGdkModifierType): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_window_query_nonaccels".}
+const
+  bm_TGtkLabel_jtype* = 0x00000003
+  bp_TGtkLabel_jtype* = 0
+  bm_TGtkLabel_wrap* = 0x00000004
+  bp_TGtkLabel_wrap* = 2
+  bm_TGtkLabel_use_underline* = 0x00000008
+  bp_TGtkLabel_use_underline* = 3
+  bm_TGtkLabel_use_markup* = 0x00000010
+  bp_TGtkLabel_use_markup* = 4
+
+proc GTK_TYPE_LABEL*(): GType
+proc GTK_LABEL*(obj: pointer): PGtkLabel
+proc GTK_LABEL_CLASS*(klass: pointer): PGtkLabelClass
+proc GTK_IS_LABEL*(obj: pointer): bool
+proc GTK_IS_LABEL_CLASS*(klass: pointer): bool
+proc GTK_LABEL_GET_CLASS*(obj: pointer): PGtkLabelClass
+proc jtype*(a: var TGtkLabel): guint
+proc set_jtype*(a: var TGtkLabel, `jtype`: guint)
+proc wrap*(a: var TGtkLabel): guint
+proc set_wrap*(a: var TGtkLabel, `wrap`: guint)
+proc use_underline*(a: var TGtkLabel): guint
+proc set_use_underline*(a: var TGtkLabel, `use_underline`: guint)
+proc use_markup*(a: var TGtkLabel): guint
+proc set_use_markup*(a: var TGtkLabel, `use_markup`: guint)
+proc gtk_label_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_label_get_type".}
+proc gtk_label_new*(str: cstring): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_label_new".}
+proc gtk_label_new_with_mnemonic*(str: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_new_with_mnemonic".}
+proc gtk_label_set_text*(`label`: PGtkLabel, str: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_text".}
+proc gtk_label_get_text*(`label`: PGtkLabel): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_label_get_text".}
+proc gtk_label_set_attributes*(`label`: PGtkLabel, attrs: PPangoAttrList){.
+    cdecl, dynlib: gtklib, importc: "gtk_label_set_attributes".}
+proc gtk_label_get_attributes*(`label`: PGtkLabel): PPangoAttrList{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_attributes".}
+proc gtk_label_set_label*(`label`: PGtkLabel, str: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_label".}
+proc gtk_label_get_label*(`label`: PGtkLabel): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_label_get_label".}
+proc gtk_label_set_markup*(`label`: PGtkLabel, str: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_markup".}
+proc gtk_label_set_use_markup*(`label`: PGtkLabel, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_use_markup".}
+proc gtk_label_get_use_markup*(`label`: PGtkLabel): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_use_markup".}
+proc gtk_label_set_use_underline*(`label`: PGtkLabel, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_use_underline".}
+proc gtk_label_get_use_underline*(`label`: PGtkLabel): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_use_underline".}
+proc gtk_label_set_markup_with_mnemonic*(`label`: PGtkLabel, str: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_label_set_markup_with_mnemonic".}
+proc gtk_label_get_mnemonic_keyval*(`label`: PGtkLabel): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_mnemonic_keyval".}
+proc gtk_label_set_mnemonic_widget*(`label`: PGtkLabel, widget: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_label_set_mnemonic_widget".}
+proc gtk_label_get_mnemonic_widget*(`label`: PGtkLabel): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_mnemonic_widget".}
+proc gtk_label_set_text_with_mnemonic*(`label`: PGtkLabel, str: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_text_with_mnemonic".}
+proc gtk_label_set_justify*(`label`: PGtkLabel, jtype: TGtkJustification){.
+    cdecl, dynlib: gtklib, importc: "gtk_label_set_justify".}
+proc gtk_label_get_justify*(`label`: PGtkLabel): TGtkJustification{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_justify".}
+proc gtk_label_set_pattern*(`label`: PGtkLabel, pattern: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_pattern".}
+proc gtk_label_set_line_wrap*(`label`: PGtkLabel, wrap: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_line_wrap".}
+proc gtk_label_get_line_wrap*(`label`: PGtkLabel): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_line_wrap".}
+proc gtk_label_set_selectable*(`label`: PGtkLabel, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_label_set_selectable".}
+proc gtk_label_get_selectable*(`label`: PGtkLabel): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_selectable".}
+proc gtk_label_select_region*(`label`: PGtkLabel, start_offset: gint,
+                              end_offset: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_label_select_region".}
+proc gtk_label_get_selection_bounds*(`label`: PGtkLabel, start: Pgint,
+                                     theEnd: Pgint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_selection_bounds".}
+proc gtk_label_get_layout*(`label`: PGtkLabel): PPangoLayout{.cdecl,
+    dynlib: gtklib, importc: "gtk_label_get_layout".}
+proc gtk_label_get_layout_offsets*(`label`: PGtkLabel, x: Pgint, y: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_label_get_layout_offsets".}
+const
+  bm_TGtkAccelLabelClass_latin1_to_char* = 0x00000001
+  bp_TGtkAccelLabelClass_latin1_to_char* = 0
+
+proc GTK_TYPE_ACCEL_LABEL*(): GType
+proc GTK_ACCEL_LABEL*(obj: pointer): PGtkAccelLabel
+proc GTK_ACCEL_LABEL_CLASS*(klass: pointer): PGtkAccelLabelClass
+proc GTK_IS_ACCEL_LABEL*(obj: pointer): bool
+proc GTK_IS_ACCEL_LABEL_CLASS*(klass: pointer): bool
+proc GTK_ACCEL_LABEL_GET_CLASS*(obj: pointer): PGtkAccelLabelClass
+proc latin1_to_char*(a: var TGtkAccelLabelClass): guint
+proc set_latin1_to_char*(a: var TGtkAccelLabelClass, `latin1_to_char`: guint)
+proc gtk_accel_label_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_label_get_type".}
+proc gtk_accel_label_new*(`string`: cstring): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_label_new".}
+proc gtk_accel_label_get_accel_widget*(accel_label: PGtkAccelLabel): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_label_get_accel_widget".}
+proc gtk_accel_label_get_accel_width*(accel_label: PGtkAccelLabel): guint{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_label_get_accel_width".}
+proc gtk_accel_label_set_accel_widget*(accel_label: PGtkAccelLabel,
+                                       accel_widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_label_set_accel_widget".}
+proc gtk_accel_label_set_accel_closure*(accel_label: PGtkAccelLabel,
+                                        accel_closure: PGClosure){.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_label_set_accel_closure".}
+proc gtk_accel_label_refetch*(accel_label: PGtkAccelLabel): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_label_refetch".}
+proc gtk_accel_map_add_entry*(accel_path: cstring, accel_key: guint,
+                              accel_mods: TGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_accel_map_add_entry".}
+proc gtk_accel_map_lookup_entry*(accel_path: cstring, key: PGtkAccelKey): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_map_lookup_entry".}
+proc gtk_accel_map_change_entry*(accel_path: cstring, accel_key: guint,
+                                 accel_mods: TGdkModifierType, replace: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_map_change_entry".}
+proc gtk_accel_map_load*(file_name: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_map_load".}
+proc gtk_accel_map_save*(file_name: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_map_save".}
+proc gtk_accel_map_foreach*(data: gpointer, foreach_func: TGtkAccelMapForeach){.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_map_foreach".}
+proc gtk_accel_map_load_fd*(fd: gint){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_accel_map_load_fd".}
+proc gtk_accel_map_load_scanner*(scanner: PGScanner){.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_map_load_scanner".}
+proc gtk_accel_map_save_fd*(fd: gint){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_accel_map_save_fd".}
+proc gtk_accel_map_add_filter*(filter_pattern: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_accel_map_add_filter".}
+proc gtk_accel_map_foreach_unfiltered*(data: gpointer,
+                                       foreach_func: TGtkAccelMapForeach){.
+    cdecl, dynlib: gtklib, importc: "gtk_accel_map_foreach_unfiltered".}
+proc gtk_accel_map_init*(){.cdecl, dynlib: gtklib,
+                              importc: "_gtk_accel_map_init".}
+proc gtk_accel_map_add_group*(accel_path: cstring, accel_group: PGtkAccelGroup){.
+    cdecl, dynlib: gtklib, importc: "_gtk_accel_map_add_group".}
+proc gtk_accel_map_remove_group*(accel_path: cstring,
+                                   accel_group: PGtkAccelGroup){.cdecl,
+    dynlib: gtklib, importc: "_gtk_accel_map_remove_group".}
+proc gtk_accel_path_is_valid*(accel_path: cstring): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_accel_path_is_valid".}
+proc GTK_TYPE_ACCESSIBLE*(): GType
+proc GTK_ACCESSIBLE*(obj: pointer): PGtkAccessible
+proc GTK_ACCESSIBLE_CLASS*(klass: pointer): PGtkAccessibleClass
+proc GTK_IS_ACCESSIBLE*(obj: pointer): bool
+proc GTK_IS_ACCESSIBLE_CLASS*(klass: pointer): bool
+proc GTK_ACCESSIBLE_GET_CLASS*(obj: pointer): PGtkAccessibleClass
+proc gtk_accessible_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_accessible_get_type".}
+proc gtk_accessible_connect_widget_destroyed*(accessible: PGtkAccessible){.
+    cdecl, dynlib: gtklib, importc: "gtk_accessible_connect_widget_destroyed".}
+proc GTK_TYPE_ADJUSTMENT*(): GType
+proc GTK_ADJUSTMENT*(obj: pointer): PGtkAdjustment
+proc GTK_ADJUSTMENT_CLASS*(klass: pointer): PGtkAdjustmentClass
+proc GTK_IS_ADJUSTMENT*(obj: pointer): bool
+proc GTK_IS_ADJUSTMENT_CLASS*(klass: pointer): bool
+proc GTK_ADJUSTMENT_GET_CLASS*(obj: pointer): PGtkAdjustmentClass
+proc gtk_adjustment_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_adjustment_get_type".}
+proc gtk_adjustment_new*(value: gdouble, lower: gdouble, upper: gdouble,
+                         step_increment: gdouble, page_increment: gdouble,
+                         page_size: gdouble): PGtkObject{.cdecl, dynlib: gtklib,
+    importc: "gtk_adjustment_new".}
+proc gtk_adjustment_changed*(adjustment: PGtkAdjustment){.cdecl, dynlib: gtklib,
+    importc: "gtk_adjustment_changed".}
+proc gtk_adjustment_value_changed*(adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_adjustment_value_changed".}
+proc gtk_adjustment_clamp_page*(adjustment: PGtkAdjustment, lower: gdouble,
+                                upper: gdouble){.cdecl, dynlib: gtklib,
+    importc: "gtk_adjustment_clamp_page".}
+proc gtk_adjustment_get_value*(adjustment: PGtkAdjustment): gdouble{.cdecl,
+    dynlib: gtklib, importc: "gtk_adjustment_get_value".}
+proc gtk_adjustment_set_value*(adjustment: PGtkAdjustment, value: gdouble){.
+    cdecl, dynlib: gtklib, importc: "gtk_adjustment_set_value".}
+proc GTK_TYPE_ALIGNMENT*(): GType
+proc GTK_ALIGNMENT*(obj: pointer): PGtkAlignment
+proc GTK_ALIGNMENT_CLASS*(klass: pointer): PGtkAlignmentClass
+proc GTK_IS_ALIGNMENT*(obj: pointer): bool
+proc GTK_IS_ALIGNMENT_CLASS*(klass: pointer): bool
+proc GTK_ALIGNMENT_GET_CLASS*(obj: pointer): PGtkAlignmentClass
+proc gtk_alignment_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_alignment_get_type".}
+proc gtk_alignment_new*(xalign: gfloat, yalign: gfloat, xscale: gfloat,
+                        yscale: gfloat): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_alignment_new".}
+proc gtk_alignment_set*(alignment: PGtkAlignment, xalign: gfloat,
+                        yalign: gfloat, xscale: gfloat, yscale: gfloat){.cdecl,
+    dynlib: gtklib, importc: "gtk_alignment_set".}
+proc GTK_TYPE_FRAME*(): GType
+proc GTK_FRAME*(obj: pointer): PGtkFrame
+proc GTK_FRAME_CLASS*(klass: pointer): PGtkFrameClass
+proc GTK_IS_FRAME*(obj: pointer): bool
+proc GTK_IS_FRAME_CLASS*(klass: pointer): bool
+proc GTK_FRAME_GET_CLASS*(obj: pointer): PGtkFrameClass
+proc gtk_frame_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_frame_get_type".}
+proc gtk_frame_new*(`label`: cstring): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_frame_new".}
+proc gtk_frame_set_label*(frame: PGtkFrame, `label`: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_frame_set_label".}
+proc gtk_frame_get_label*(frame: PGtkFrame): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_frame_get_label".}
+proc gtk_frame_set_label_widget*(frame: PGtkFrame, label_widget: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_frame_set_label_widget".}
+proc gtk_frame_get_label_widget*(frame: PGtkFrame): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_frame_get_label_widget".}
+proc gtk_frame_set_label_align*(frame: PGtkFrame, xalign: gfloat, yalign: gfloat){.
+    cdecl, dynlib: gtklib, importc: "gtk_frame_set_label_align".}
+proc gtk_frame_get_label_align*(frame: PGtkFrame, xalign: Pgfloat,
+                                yalign: Pgfloat){.cdecl, dynlib: gtklib,
+    importc: "gtk_frame_get_label_align".}
+proc gtk_frame_set_shadow_type*(frame: PGtkFrame, thetype: TGtkShadowType){.
+    cdecl, dynlib: gtklib, importc: "gtk_frame_set_shadow_type".}
+proc gtk_frame_get_shadow_type*(frame: PGtkFrame): TGtkShadowType{.cdecl,
+    dynlib: gtklib, importc: "gtk_frame_get_shadow_type".}
+proc GTK_TYPE_ASPECT_FRAME*(): GType
+proc GTK_ASPECT_FRAME*(obj: pointer): PGtkAspectFrame
+proc GTK_ASPECT_FRAME_CLASS*(klass: pointer): PGtkAspectFrameClass
+proc GTK_IS_ASPECT_FRAME*(obj: pointer): bool
+proc GTK_IS_ASPECT_FRAME_CLASS*(klass: pointer): bool
+proc GTK_ASPECT_FRAME_GET_CLASS*(obj: pointer): PGtkAspectFrameClass
+proc gtk_aspect_frame_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_aspect_frame_get_type".}
+proc gtk_aspect_frame_new*(`label`: cstring, xalign: gfloat, yalign: gfloat,
+                           ratio: gfloat, obey_child: gboolean): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_aspect_frame_new".}
+proc gtk_aspect_frame_set*(aspect_frame: PGtkAspectFrame, xalign: gfloat,
+                           yalign: gfloat, ratio: gfloat, obey_child: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_aspect_frame_set".}
+proc GTK_TYPE_ARROW*(): GType
+proc GTK_ARROW*(obj: pointer): PGtkArrow
+proc GTK_ARROW_CLASS*(klass: pointer): PGtkArrowClass
+proc GTK_IS_ARROW*(obj: pointer): bool
+proc GTK_IS_ARROW_CLASS*(klass: pointer): bool
+proc GTK_ARROW_GET_CLASS*(obj: pointer): PGtkArrowClass
+proc gtk_arrow_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_arrow_get_type".}
+proc gtk_arrow_new*(arrow_type: TGtkArrowType, shadow_type: TGtkShadowType): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_arrow_new".}
+proc gtk_arrow_set*(arrow: PGtkArrow, arrow_type: TGtkArrowType,
+                    shadow_type: TGtkShadowType){.cdecl, dynlib: gtklib,
+    importc: "gtk_arrow_set".}
+const
+  bm_TGtkBindingSet_parsed* = 0x00000001
+  bp_TGtkBindingSet_parsed* = 0
+  bm_TGtkBindingEntry_destroyed* = 0x00000001
+  bp_TGtkBindingEntry_destroyed* = 0
+  bm_TGtkBindingEntry_in_emission* = 0x00000002
+  bp_TGtkBindingEntry_in_emission* = 1
+
+proc gtk_binding_entry_add*(binding_set: PGtkBindingSet, keyval: guint,
+                            modifiers: TGdkModifierType)
+proc parsed*(a: var TGtkBindingSet): guint
+proc set_parsed*(a: var TGtkBindingSet, `parsed`: guint)
+proc destroyed*(a: var TGtkBindingEntry): guint
+proc set_destroyed*(a: var TGtkBindingEntry, `destroyed`: guint)
+proc in_emission*(a: var TGtkBindingEntry): guint
+proc set_in_emission*(a: var TGtkBindingEntry, `in_emission`: guint)
+proc gtk_binding_set_new*(set_name: cstring): PGtkBindingSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_set_new".}
+proc gtk_binding_set_by_class*(object_class: gpointer): PGtkBindingSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_set_by_class".}
+proc gtk_binding_set_find*(set_name: cstring): PGtkBindingSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_set_find".}
+proc gtk_bindings_activate*(anObject: PGtkObject, keyval: guint,
+                            modifiers: TGdkModifierType): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_bindings_activate".}
+proc gtk_binding_set_activate*(binding_set: PGtkBindingSet, keyval: guint,
+                               modifiers: TGdkModifierType, anObject: PGtkObject): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_binding_set_activate".}
+proc gtk_binding_entry_clear*(binding_set: PGtkBindingSet, keyval: guint,
+                              modifiers: TGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_entry_clear".}
+proc gtk_binding_set_add_path*(binding_set: PGtkBindingSet,
+                               path_type: TGtkPathType, path_pattern: cstring,
+                               priority: TGtkPathPriorityType){.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_set_add_path".}
+proc gtk_binding_entry_remove*(binding_set: PGtkBindingSet, keyval: guint,
+                               modifiers: TGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_entry_remove".}
+proc gtk_binding_entry_add_signall*(binding_set: PGtkBindingSet, keyval: guint,
+                                    modifiers: TGdkModifierType,
+                                    signal_name: cstring, binding_args: PGSList){.
+    cdecl, dynlib: gtklib, importc: "gtk_binding_entry_add_signall".}
+proc gtk_binding_parse_binding*(scanner: PGScanner): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_binding_parse_binding".}
+proc gtk_bindings_activate_event*(anObject: PGtkObject, event: PGdkEventKey): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_bindings_activate_event".}
+proc gtk_binding_reset_parsed*(){.cdecl, dynlib: gtklib,
+                                  importc: "_gtk_binding_reset_parsed".}
+const
+  bm_TGtkBox_homogeneous* = 0x00000001
+  bp_TGtkBox_homogeneous* = 0
+  bm_TGtkBoxChild_expand* = 0x00000001
+  bp_TGtkBoxChild_expand* = 0
+  bm_TGtkBoxChild_fill* = 0x00000002
+  bp_TGtkBoxChild_fill* = 1
+  bm_TGtkBoxChild_pack* = 0x00000004
+  bp_TGtkBoxChild_pack* = 2
+  bm_TGtkBoxChild_is_secondary* = 0x00000008
+  bp_TGtkBoxChild_is_secondary* = 3
+
+proc GTK_TYPE_BOX*(): GType
+proc GTK_BOX*(obj: pointer): PGtkBox
+proc GTK_BOX_CLASS*(klass: pointer): PGtkBoxClass
+proc GTK_IS_BOX*(obj: pointer): bool
+proc GTK_IS_BOX_CLASS*(klass: pointer): bool
+proc GTK_BOX_GET_CLASS*(obj: pointer): PGtkBoxClass
+proc homogeneous*(a: var TGtkBox): guint
+proc set_homogeneous*(a: var TGtkBox, `homogeneous`: guint)
+proc expand*(a: var TGtkBoxChild): guint
+proc set_expand*(a: var TGtkBoxChild, `expand`: guint)
+proc fill*(a: var TGtkBoxChild): guint
+proc set_fill*(a: var TGtkBoxChild, `fill`: guint)
+proc pack*(a: var TGtkBoxChild): guint
+proc set_pack*(a: var TGtkBoxChild, `pack`: guint)
+proc is_secondary*(a: var TGtkBoxChild): guint
+proc set_is_secondary*(a: var TGtkBoxChild, `is_secondary`: guint)
+proc gtk_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_box_get_type".}
+proc gtk_box_pack_start*(box: PGtkBox, child: PGtkWidget, expand: gboolean,
+                         fill: gboolean, padding: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_box_pack_start".}
+proc gtk_box_pack_end*(box: PGtkBox, child: PGtkWidget, expand: gboolean,
+                       fill: gboolean, padding: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_box_pack_end".}
+proc gtk_box_pack_start_defaults*(box: PGtkBox, widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_box_pack_start_defaults".}
+proc gtk_box_pack_end_defaults*(box: PGtkBox, widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_box_pack_end_defaults".}
+proc gtk_box_set_homogeneous*(box: PGtkBox, homogeneous: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_box_set_homogeneous".}
+proc gtk_box_get_homogeneous*(box: PGtkBox): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_box_get_homogeneous".}
+proc gtk_box_set_spacing*(box: PGtkBox, spacing: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_box_set_spacing".}
+proc gtk_box_get_spacing*(box: PGtkBox): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_box_get_spacing".}
+proc gtk_box_reorder_child*(box: PGtkBox, child: PGtkWidget, position: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_box_reorder_child".}
+proc gtk_box_query_child_packing*(box: PGtkBox, child: PGtkWidget,
+                                  expand: Pgboolean, fill: Pgboolean,
+                                  padding: Pguint, pack_type: PGtkPackType){.
+    cdecl, dynlib: gtklib, importc: "gtk_box_query_child_packing".}
+proc gtk_box_set_child_packing*(box: PGtkBox, child: PGtkWidget,
+                                expand: gboolean, fill: gboolean,
+                                padding: guint, pack_type: TGtkPackType){.cdecl,
+    dynlib: gtklib, importc: "gtk_box_set_child_packing".}
+const
+  GTK_BUTTONBOX_DEFAULT* = - (1)
+
+proc GTK_TYPE_BUTTON_BOX*(): GType
+proc GTK_BUTTON_BOX*(obj: pointer): PGtkButtonBox
+proc GTK_BUTTON_BOX_CLASS*(klass: pointer): PGtkButtonBoxClass
+proc GTK_IS_BUTTON_BOX*(obj: pointer): bool
+proc GTK_IS_BUTTON_BOX_CLASS*(klass: pointer): bool
+proc GTK_BUTTON_BOX_GET_CLASS*(obj: pointer): PGtkButtonBoxClass
+proc gtk_button_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_button_box_get_type".}
+proc gtk_button_box_get_layout*(widget: PGtkButtonBox): TGtkButtonBoxStyle{.
+    cdecl, dynlib: gtklib, importc: "gtk_button_box_get_layout".}
+proc gtk_button_box_set_layout*(widget: PGtkButtonBox,
+                                layout_style: TGtkButtonBoxStyle){.cdecl,
+    dynlib: gtklib, importc: "gtk_button_box_set_layout".}
+proc gtk_button_box_set_child_secondary*(widget: PGtkButtonBox,
+    child: PGtkWidget, is_secondary: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_box_set_child_secondary".}
+proc gtk_button_box_child_requisition*(widget: PGtkWidget,
+    nvis_children: var int32, nvis_secondaries: var int32, width: var int32,
+    height: var int32){.cdecl, dynlib: gtklib,
+                       importc: "_gtk_button_box_child_requisition".}
+const
+  bm_TGtkButton_constructed* = 0x00000001
+  bp_TGtkButton_constructed* = 0
+  bm_TGtkButton_in_button* = 0x00000002
+  bp_TGtkButton_in_button* = 1
+  bm_TGtkButton_button_down* = 0x00000004
+  bp_TGtkButton_button_down* = 2
+  bm_TGtkButton_relief* = 0x00000018
+  bp_TGtkButton_relief* = 3
+  bm_TGtkButton_use_underline* = 0x00000020
+  bp_TGtkButton_use_underline* = 5
+  bm_TGtkButton_use_stock* = 0x00000040
+  bp_TGtkButton_use_stock* = 6
+  bm_TGtkButton_depressed* = 0x00000080
+  bp_TGtkButton_depressed* = 7
+  bm_TGtkButton_depress_on_activate* = 0x00000100
+  bp_TGtkButton_depress_on_activate* = 8
+
+proc GTK_TYPE_BUTTON*(): GType
+proc GTK_BUTTON*(obj: pointer): PGtkButton
+proc GTK_BUTTON_CLASS*(klass: pointer): PGtkButtonClass
+proc GTK_IS_BUTTON*(obj: pointer): bool
+proc GTK_IS_BUTTON_CLASS*(klass: pointer): bool
+proc GTK_BUTTON_GET_CLASS*(obj: pointer): PGtkButtonClass
+proc constructed*(a: var TGtkButton): guint
+proc set_constructed*(a: var TGtkButton, `constructed`: guint)
+proc in_button*(a: var TGtkButton): guint
+proc set_in_button*(a: var TGtkButton, `in_button`: guint)
+proc button_down*(a: var TGtkButton): guint
+proc set_button_down*(a: var TGtkButton, `button_down`: guint)
+proc relief*(a: var TGtkButton): guint
+proc set_relief*(a: var TGtkButton, `relief`: guint)
+proc use_underline*(a: var TGtkButton): guint
+proc set_use_underline*(a: var TGtkButton, `use_underline`: guint)
+proc use_stock*(a: var TGtkButton): guint
+proc set_use_stock*(a: var TGtkButton, `use_stock`: guint)
+proc depressed*(a: var TGtkButton): guint
+proc set_depressed*(a: var TGtkButton, `depressed`: guint)
+proc depress_on_activate*(a: var TGtkButton): guint
+proc set_depress_on_activate*(a: var TGtkButton, `depress_on_activate`: guint)
+proc gtk_button_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_button_get_type".}
+proc gtk_button_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_button_new".}
+proc gtk_button_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_new_with_label".}
+proc gtk_button_new_from_stock*(stock_id: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_new_from_stock".}
+proc gtk_button_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_new_with_mnemonic".}
+proc gtk_button_pressed*(button: PGtkButton){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_pressed".}
+proc gtk_button_released*(button: PGtkButton){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_released".}
+proc gtk_button_clicked*(button: PGtkButton){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_clicked".}
+proc gtk_button_enter*(button: PGtkButton){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_enter".}
+proc gtk_button_leave*(button: PGtkButton){.cdecl, dynlib: gtklib,
+    importc: "gtk_button_leave".}
+proc gtk_button_set_relief*(button: PGtkButton, newstyle: TGtkReliefStyle){.
+    cdecl, dynlib: gtklib, importc: "gtk_button_set_relief".}
+proc gtk_button_get_relief*(button: PGtkButton): TGtkReliefStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_get_relief".}
+proc gtk_button_set_label*(button: PGtkButton, `label`: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_button_set_label".}
+proc gtk_button_get_label*(button: PGtkButton): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_button_get_label".}
+proc gtk_button_set_use_underline*(button: PGtkButton, use_underline: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_button_set_use_underline".}
+proc gtk_button_get_use_underline*(button: PGtkButton): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_get_use_underline".}
+proc gtk_button_set_use_stock*(button: PGtkButton, use_stock: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_button_set_use_stock".}
+proc gtk_button_get_use_stock*(button: PGtkButton): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_button_get_use_stock".}
+proc gtk_button_set_depressed*(button: PGtkButton, depressed: gboolean){.
+    cdecl, dynlib: gtklib, importc: "_gtk_button_set_depressed".}
+proc gtk_button_paint*(button: PGtkButton, area: PGdkRectangle,
+                         state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                         main_detail: cstring, default_detail: cstring){.cdecl,
+    dynlib: gtklib, importc: "_gtk_button_paint".}
+const
+  GTK_CALENDAR_SHOW_HEADING* = 1 shl 0
+  GTK_CALENDAR_SHOW_DAY_NAMES* = 1 shl 1
+  GTK_CALENDAR_NO_MONTH_CHANGE* = 1 shl 2
+  GTK_CALENDAR_SHOW_WEEK_NUMBERS* = 1 shl 3
+  GTK_CALENDAR_WEEK_START_MONDAY* = 1 shl 4
+
+proc GTK_TYPE_CALENDAR*(): GType
+proc GTK_CALENDAR*(obj: pointer): PGtkCalendar
+proc GTK_CALENDAR_CLASS*(klass: pointer): PGtkCalendarClass
+proc GTK_IS_CALENDAR*(obj: pointer): bool
+proc GTK_IS_CALENDAR_CLASS*(klass: pointer): bool
+proc GTK_CALENDAR_GET_CLASS*(obj: pointer): PGtkCalendarClass
+proc gtk_calendar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_get_type".}
+proc gtk_calendar_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_calendar_new".}
+proc gtk_calendar_select_month*(calendar: PGtkCalendar, month: guint,
+                                year: guint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_select_month".}
+proc gtk_calendar_select_day*(calendar: PGtkCalendar, day: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_calendar_select_day".}
+proc gtk_calendar_mark_day*(calendar: PGtkCalendar, day: guint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_calendar_mark_day".}
+proc gtk_calendar_unmark_day*(calendar: PGtkCalendar, day: guint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_calendar_unmark_day".}
+proc gtk_calendar_clear_marks*(calendar: PGtkCalendar){.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_clear_marks".}
+proc gtk_calendar_display_options*(calendar: PGtkCalendar,
+                                   flags: TGtkCalendarDisplayOptions){.cdecl,
+    dynlib: gtklib, importc: "gtk_calendar_display_options".}
+proc gtk_calendar_get_date*(calendar: PGtkCalendar, year: Pguint, month: Pguint,
+                            day: Pguint){.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_get_date".}
+proc gtk_calendar_freeze*(calendar: PGtkCalendar){.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_freeze".}
+proc gtk_calendar_thaw*(calendar: PGtkCalendar){.cdecl, dynlib: gtklib,
+    importc: "gtk_calendar_thaw".}
+proc GTK_TYPE_CELL_EDITABLE*(): GType
+proc GTK_CELL_EDITABLE*(obj: pointer): PGtkCellEditable
+proc GTK_CELL_EDITABLE_CLASS*(obj: pointer): PGtkCellEditableIface
+proc GTK_IS_CELL_EDITABLE*(obj: pointer): bool
+proc GTK_CELL_EDITABLE_GET_IFACE*(obj: pointer): PGtkCellEditableIface
+proc gtk_cell_editable_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_editable_get_type".}
+proc gtk_cell_editable_start_editing*(cell_editable: PGtkCellEditable,
+                                      event: PGdkEvent){.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_editable_start_editing".}
+proc gtk_cell_editable_editing_done*(cell_editable: PGtkCellEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_cell_editable_editing_done".}
+proc gtk_cell_editable_remove_widget*(cell_editable: PGtkCellEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_cell_editable_remove_widget".}
+const
+  GTK_CELL_RENDERER_SELECTED* = 1 shl 0
+  GTK_CELL_RENDERER_PRELIT* = 1 shl 1
+  GTK_CELL_RENDERER_INSENSITIVE* = 1 shl 2
+  GTK_CELL_RENDERER_SORTED* = 1 shl 3
+
+const
+  bm_TGtkCellRenderer_mode* = 0x00000003
+  bp_TGtkCellRenderer_mode* = 0
+  bm_TGtkCellRenderer_visible* = 0x00000004
+  bp_TGtkCellRenderer_visible* = 2
+  bm_TGtkCellRenderer_is_expander* = 0x00000008
+  bp_TGtkCellRenderer_is_expander* = 3
+  bm_TGtkCellRenderer_is_expanded* = 0x00000010
+  bp_TGtkCellRenderer_is_expanded* = 4
+  bm_TGtkCellRenderer_cell_background_set* = 0x00000020
+  bp_TGtkCellRenderer_cell_background_set* = 5
+
+proc GTK_TYPE_CELL_RENDERER*(): GType
+proc GTK_CELL_RENDERER*(obj: pointer): PGtkCellRenderer
+proc GTK_CELL_RENDERER_CLASS*(klass: pointer): PGtkCellRendererClass
+proc GTK_IS_CELL_RENDERER*(obj: pointer): bool
+proc GTK_IS_CELL_RENDERER_CLASS*(klass: pointer): bool
+proc GTK_CELL_RENDERER_GET_CLASS*(obj: pointer): PGtkCellRendererClass
+proc mode*(a: var TGtkCellRenderer): guint
+proc set_mode*(a: var TGtkCellRenderer, `mode`: guint)
+proc visible*(a: var TGtkCellRenderer): guint
+proc set_visible*(a: var TGtkCellRenderer, `visible`: guint)
+proc is_expander*(a: var TGtkCellRenderer): guint
+proc set_is_expander*(a: var TGtkCellRenderer, `is_expander`: guint)
+proc is_expanded*(a: var TGtkCellRenderer): guint
+proc set_is_expanded*(a: var TGtkCellRenderer, `is_expanded`: guint)
+proc cell_background_set*(a: var TGtkCellRenderer): guint
+proc set_cell_background_set*(a: var TGtkCellRenderer,
+                              `cell_background_set`: guint)
+proc gtk_cell_renderer_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_get_type".}
+proc gtk_cell_renderer_get_size*(cell: PGtkCellRenderer, widget: PGtkWidget,
+                                 cell_area: PGdkRectangle, x_offset: Pgint,
+                                 y_offset: Pgint, width: Pgint, height: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_cell_renderer_get_size".}
+proc gtk_cell_renderer_render*(cell: PGtkCellRenderer, window: PGdkWindow,
+                               widget: PGtkWidget,
+                               background_area: PGdkRectangle,
+                               cell_area: PGdkRectangle,
+                               expose_area: PGdkRectangle,
+                               flags: TGtkCellRendererState){.cdecl,
+    dynlib: gtklib, importc: "gtk_cell_renderer_render".}
+proc gtk_cell_renderer_activate*(cell: PGtkCellRenderer, event: PGdkEvent,
+                                 widget: PGtkWidget, path: cstring,
+                                 background_area: PGdkRectangle,
+                                 cell_area: PGdkRectangle,
+                                 flags: TGtkCellRendererState): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_cell_renderer_activate".}
+proc gtk_cell_renderer_start_editing*(cell: PGtkCellRenderer, event: PGdkEvent,
+                                      widget: PGtkWidget, path: cstring,
+                                      background_area: PGdkRectangle,
+                                      cell_area: PGdkRectangle,
+                                      flags: TGtkCellRendererState): PGtkCellEditable{.
+    cdecl, dynlib: gtklib, importc: "gtk_cell_renderer_start_editing".}
+proc gtk_cell_renderer_set_fixed_size*(cell: PGtkCellRenderer, width: gint,
+                                       height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_set_fixed_size".}
+proc gtk_cell_renderer_get_fixed_size*(cell: PGtkCellRenderer, width: Pgint,
+                                       height: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_get_fixed_size".}
+const
+  bm_TGtkCellRendererText_strikethrough* = 0x00000001
+  bp_TGtkCellRendererText_strikethrough* = 0
+  bm_TGtkCellRendererText_editable* = 0x00000002
+  bp_TGtkCellRendererText_editable* = 1
+  bm_TGtkCellRendererText_scale_set* = 0x00000004
+  bp_TGtkCellRendererText_scale_set* = 2
+  bm_TGtkCellRendererText_foreground_set* = 0x00000008
+  bp_TGtkCellRendererText_foreground_set* = 3
+  bm_TGtkCellRendererText_background_set* = 0x00000010
+  bp_TGtkCellRendererText_background_set* = 4
+  bm_TGtkCellRendererText_underline_set* = 0x00000020
+  bp_TGtkCellRendererText_underline_set* = 5
+  bm_TGtkCellRendererText_rise_set* = 0x00000040
+  bp_TGtkCellRendererText_rise_set* = 6
+  bm_TGtkCellRendererText_strikethrough_set* = 0x00000080
+  bp_TGtkCellRendererText_strikethrough_set* = 7
+  bm_TGtkCellRendererText_editable_set* = 0x00000100
+  bp_TGtkCellRendererText_editable_set* = 8
+  bm_TGtkCellRendererText_calc_fixed_height* = 0x00000200
+  bp_TGtkCellRendererText_calc_fixed_height* = 9
+
+proc GTK_TYPE_CELL_RENDERER_TEXT*(): GType
+proc GTK_CELL_RENDERER_TEXT*(obj: pointer): PGtkCellRendererText
+proc GTK_CELL_RENDERER_TEXT_CLASS*(klass: pointer): PGtkCellRendererTextClass
+proc GTK_IS_CELL_RENDERER_TEXT*(obj: pointer): bool
+proc GTK_IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool
+proc GTK_CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PGtkCellRendererTextClass
+proc strikethrough*(a: var TGtkCellRendererText): guint
+proc set_strikethrough*(a: var TGtkCellRendererText, `strikethrough`: guint)
+proc editable*(a: var TGtkCellRendererText): guint
+proc set_editable*(a: var TGtkCellRendererText, `editable`: guint)
+proc scale_set*(a: var TGtkCellRendererText): guint
+proc set_scale_set*(a: var TGtkCellRendererText, `scale_set`: guint)
+proc foreground_set*(a: var TGtkCellRendererText): guint
+proc set_foreground_set*(a: var TGtkCellRendererText, `foreground_set`: guint)
+proc background_set*(a: var TGtkCellRendererText): guint
+proc set_background_set*(a: var TGtkCellRendererText, `background_set`: guint)
+proc underline_set*(a: var TGtkCellRendererText): guint
+proc set_underline_set*(a: var TGtkCellRendererText, `underline_set`: guint)
+proc rise_set*(a: var TGtkCellRendererText): guint
+proc set_rise_set*(a: var TGtkCellRendererText, `rise_set`: guint)
+proc strikethrough_set*(a: var TGtkCellRendererText): guint
+proc set_strikethrough_set*(a: var TGtkCellRendererText,
+                            `strikethrough_set`: guint)
+proc editable_set*(a: var TGtkCellRendererText): guint
+proc set_editable_set*(a: var TGtkCellRendererText, `editable_set`: guint)
+proc calc_fixed_height*(a: var TGtkCellRendererText): guint
+proc set_calc_fixed_height*(a: var TGtkCellRendererText,
+                            `calc_fixed_height`: guint)
+proc gtk_cell_renderer_text_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_text_get_type".}
+proc gtk_cell_renderer_text_new*(): PGtkCellRenderer{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_text_new".}
+proc gtk_cell_renderer_text_set_fixed_height_from_font*(
+    renderer: PGtkCellRendererText, number_of_rows: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_cell_renderer_text_set_fixed_height_from_font".}
+const
+  bm_TGtkCellRendererToggle_active* = 0x00000001
+  bp_TGtkCellRendererToggle_active* = 0
+  bm_TGtkCellRendererToggle_activatable* = 0x00000002
+  bp_TGtkCellRendererToggle_activatable* = 1
+  bm_TGtkCellRendererToggle_radio* = 0x00000004
+  bp_TGtkCellRendererToggle_radio* = 2
+
+proc GTK_TYPE_CELL_RENDERER_TOGGLE*(): GType
+proc GTK_CELL_RENDERER_TOGGLE*(obj: pointer): PGtkCellRendererToggle
+proc GTK_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PGtkCellRendererToggleClass
+proc GTK_IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool
+proc GTK_IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool
+proc GTK_CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PGtkCellRendererToggleClass
+proc active*(a: var TGtkCellRendererToggle): guint
+proc set_active*(a: var TGtkCellRendererToggle, `active`: guint)
+proc activatable*(a: var TGtkCellRendererToggle): guint
+proc set_activatable*(a: var TGtkCellRendererToggle, `activatable`: guint)
+proc radio*(a: var TGtkCellRendererToggle): guint
+proc set_radio*(a: var TGtkCellRendererToggle, `radio`: guint)
+proc gtk_cell_renderer_toggle_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_toggle_get_type".}
+proc gtk_cell_renderer_toggle_new*(): PGtkCellRenderer{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_toggle_new".}
+proc gtk_cell_renderer_toggle_get_radio*(toggle: PGtkCellRendererToggle): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_cell_renderer_toggle_get_radio".}
+proc gtk_cell_renderer_toggle_set_radio*(toggle: PGtkCellRendererToggle,
+    radio: gboolean){.cdecl, dynlib: gtklib,
+                      importc: "gtk_cell_renderer_toggle_set_radio".}
+proc gtk_cell_renderer_toggle_get_active*(toggle: PGtkCellRendererToggle): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_cell_renderer_toggle_get_active".}
+proc gtk_cell_renderer_toggle_set_active*(toggle: PGtkCellRendererToggle,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_cell_renderer_toggle_set_active".}
+proc GTK_TYPE_CELL_RENDERER_PIXBUF*(): GType
+proc GTK_CELL_RENDERER_PIXBUF*(obj: pointer): PGtkCellRendererPixbuf
+proc GTK_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PGtkCellRendererPixbufClass
+proc GTK_IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool
+proc GTK_IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool
+proc GTK_CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PGtkCellRendererPixbufClass
+proc gtk_cell_renderer_pixbuf_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_pixbuf_get_type".}
+proc gtk_cell_renderer_pixbuf_new*(): PGtkCellRenderer{.cdecl, dynlib: gtklib,
+    importc: "gtk_cell_renderer_pixbuf_new".}
+proc GTK_TYPE_ITEM*(): GType
+proc GTK_ITEM*(obj: pointer): PGtkItem
+proc GTK_ITEM_CLASS*(klass: pointer): PGtkItemClass
+proc GTK_IS_ITEM*(obj: pointer): bool
+proc GTK_IS_ITEM_CLASS*(klass: pointer): bool
+proc GTK_ITEM_GET_CLASS*(obj: pointer): PGtkItemClass
+proc gtk_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_item_get_type".}
+proc gtk_item_select*(item: PGtkItem){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_item_select".}
+proc gtk_item_deselect*(item: PGtkItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_item_deselect".}
+proc gtk_item_toggle*(item: PGtkItem){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_item_toggle".}
+const
+  bm_TGtkMenuItem_show_submenu_indicator* = 0x00000001
+  bp_TGtkMenuItem_show_submenu_indicator* = 0
+  bm_TGtkMenuItem_submenu_placement* = 0x00000002
+  bp_TGtkMenuItem_submenu_placement* = 1
+  bm_TGtkMenuItem_submenu_direction* = 0x00000004
+  bp_TGtkMenuItem_submenu_direction* = 2
+  bm_TGtkMenuItem_right_justify* = 0x00000008
+  bp_TGtkMenuItem_right_justify* = 3
+  bm_TGtkMenuItem_timer_from_keypress* = 0x00000010
+  bp_TGtkMenuItem_timer_from_keypress* = 4
+  bm_TGtkMenuItemClass_hide_on_activate* = 0x00000001
+  bp_TGtkMenuItemClass_hide_on_activate* = 0
+
+proc GTK_TYPE_MENU_ITEM*(): GType
+proc GTK_MENU_ITEM*(obj: pointer): PGtkMenuItem
+proc GTK_MENU_ITEM_CLASS*(klass: pointer): PGtkMenuItemClass
+proc GTK_IS_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkMenuItemClass
+proc show_submenu_indicator*(a: var TGtkMenuItem): guint
+proc set_show_submenu_indicator*(a: var TGtkMenuItem,
+                                 `show_submenu_indicator`: guint)
+proc submenu_placement*(a: var TGtkMenuItem): guint
+proc set_submenu_placement*(a: var TGtkMenuItem, `submenu_placement`: guint)
+proc submenu_direction*(a: var TGtkMenuItem): guint
+proc set_submenu_direction*(a: var TGtkMenuItem, `submenu_direction`: guint)
+proc right_justify*(a: var TGtkMenuItem): guint
+proc set_right_justify*(a: var TGtkMenuItem, `right_justify`: guint)
+proc timer_from_keypress*(a: var TGtkMenuItem): guint
+proc set_timer_from_keypress*(a: var TGtkMenuItem, `timer_from_keypress`: guint)
+proc hide_on_activate*(a: var TGtkMenuItemClass): guint
+proc set_hide_on_activate*(a: var TGtkMenuItemClass, `hide_on_activate`: guint)
+proc gtk_menu_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_item_get_type".}
+proc gtk_menu_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_menu_item_new".}
+proc gtk_menu_item_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_new_with_label".}
+proc gtk_menu_item_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_new_with_mnemonic".}
+proc gtk_menu_item_set_submenu*(menu_item: PGtkMenuItem, submenu: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_item_set_submenu".}
+proc gtk_menu_item_get_submenu*(menu_item: PGtkMenuItem): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_get_submenu".}
+proc gtk_menu_item_remove_submenu*(menu_item: PGtkMenuItem){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_remove_submenu".}
+proc gtk_menu_item_select*(menu_item: PGtkMenuItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_item_select".}
+proc gtk_menu_item_deselect*(menu_item: PGtkMenuItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_item_deselect".}
+proc gtk_menu_item_activate*(menu_item: PGtkMenuItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_item_activate".}
+proc gtk_menu_item_toggle_size_request*(menu_item: PGtkMenuItem,
+                                        requisition: Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_toggle_size_request".}
+proc gtk_menu_item_toggle_size_allocate*(menu_item: PGtkMenuItem,
+    allocation: gint){.cdecl, dynlib: gtklib,
+                       importc: "gtk_menu_item_toggle_size_allocate".}
+proc gtk_menu_item_set_right_justified*(menu_item: PGtkMenuItem,
+                                        right_justified: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_item_set_right_justified".}
+proc gtk_menu_item_get_right_justified*(menu_item: PGtkMenuItem): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_item_get_right_justified".}
+proc gtk_menu_item_set_accel_path*(menu_item: PGtkMenuItem, accel_path: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_item_set_accel_path".}
+proc gtk_menu_item_refresh_accel_path*(menu_item: PGtkMenuItem,
+    prefix: cstring, accel_group: PGtkAccelGroup, group_changed: gboolean){.
+    cdecl, dynlib: gtklib, importc: "_gtk_menu_item_refresh_accel_path".}
+proc gtk_menu_item_is_selectable*(menu_item: PGtkWidget): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_menu_item_is_selectable".}
+const
+  bm_TGtkToggleButton_active* = 0x00000001
+  bp_TGtkToggleButton_active* = 0
+  bm_TGtkToggleButton_draw_indicator* = 0x00000002
+  bp_TGtkToggleButton_draw_indicator* = 1
+  bm_TGtkToggleButton_inconsistent* = 0x00000004
+  bp_TGtkToggleButton_inconsistent* = 2
+
+proc GTK_TYPE_TOGGLE_BUTTON*(): GType
+proc GTK_TOGGLE_BUTTON*(obj: pointer): PGtkToggleButton
+proc GTK_TOGGLE_BUTTON_CLASS*(klass: pointer): PGtkToggleButtonClass
+proc GTK_IS_TOGGLE_BUTTON*(obj: pointer): bool
+proc GTK_IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool
+proc GTK_TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PGtkToggleButtonClass
+proc active*(a: var TGtkToggleButton): guint
+proc set_active*(a: var TGtkToggleButton, `active`: guint)
+proc draw_indicator*(a: var TGtkToggleButton): guint
+proc set_draw_indicator*(a: var TGtkToggleButton, `draw_indicator`: guint)
+proc inconsistent*(a: var TGtkToggleButton): guint
+proc set_inconsistent*(a: var TGtkToggleButton, `inconsistent`: guint)
+proc gtk_toggle_button_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_toggle_button_get_type".}
+proc gtk_toggle_button_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_toggle_button_new".}
+proc gtk_toggle_button_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toggle_button_new_with_label".}
+proc gtk_toggle_button_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toggle_button_new_with_mnemonic".}
+proc gtk_toggle_button_set_mode*(toggle_button: PGtkToggleButton,
+                                 draw_indicator: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_toggle_button_set_mode".}
+proc gtk_toggle_button_get_mode*(toggle_button: PGtkToggleButton): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_toggle_button_get_mode".}
+proc gtk_toggle_button_set_active*(toggle_button: PGtkToggleButton,
+                                   is_active: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_toggle_button_set_active".}
+proc gtk_toggle_button_get_active*(toggle_button: PGtkToggleButton): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_toggle_button_get_active".}
+proc gtk_toggle_button_toggled*(toggle_button: PGtkToggleButton){.cdecl,
+    dynlib: gtklib, importc: "gtk_toggle_button_toggled".}
+proc gtk_toggle_button_set_inconsistent*(toggle_button: PGtkToggleButton,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_toggle_button_set_inconsistent".}
+proc gtk_toggle_button_get_inconsistent*(toggle_button: PGtkToggleButton): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_toggle_button_get_inconsistent".}
+proc GTK_TYPE_CHECK_BUTTON*(): GType
+proc GTK_CHECK_BUTTON*(obj: pointer): PGtkCheckButton
+proc GTK_CHECK_BUTTON_CLASS*(klass: pointer): PGtkCheckButtonClass
+proc GTK_IS_CHECK_BUTTON*(obj: pointer): bool
+proc GTK_IS_CHECK_BUTTON_CLASS*(klass: pointer): bool
+proc GTK_CHECK_BUTTON_GET_CLASS*(obj: pointer): PGtkCheckButtonClass
+proc gtk_check_button_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_check_button_get_type".}
+proc gtk_check_button_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_check_button_new".}
+proc gtk_check_button_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_check_button_new_with_label".}
+proc gtk_check_button_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_check_button_new_with_mnemonic".}
+proc gtk_check_button_get_props*(check_button: PGtkCheckButton,
+                                   indicator_size: Pgint,
+                                   indicator_spacing: Pgint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_check_button_get_props".}
+const
+  bm_TGtkCheckMenuItem_active* = 0x00000001
+  bp_TGtkCheckMenuItem_active* = 0
+  bm_TGtkCheckMenuItem_always_show_toggle* = 0x00000002
+  bp_TGtkCheckMenuItem_always_show_toggle* = 1
+  bm_TGtkCheckMenuItem_inconsistent* = 0x00000004
+  bp_TGtkCheckMenuItem_inconsistent* = 2
+
+proc GTK_TYPE_CHECK_MENU_ITEM*(): GType
+proc GTK_CHECK_MENU_ITEM*(obj: pointer): PGtkCheckMenuItem
+proc GTK_CHECK_MENU_ITEM_CLASS*(klass: pointer): PGtkCheckMenuItemClass
+proc GTK_IS_CHECK_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkCheckMenuItemClass
+proc active*(a: var TGtkCheckMenuItem): guint
+proc set_active*(a: var TGtkCheckMenuItem, `active`: guint)
+proc always_show_toggle*(a: var TGtkCheckMenuItem): guint
+proc set_always_show_toggle*(a: var TGtkCheckMenuItem,
+                             `always_show_toggle`: guint)
+proc inconsistent*(a: var TGtkCheckMenuItem): guint
+proc set_inconsistent*(a: var TGtkCheckMenuItem, `inconsistent`: guint)
+proc gtk_check_menu_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_check_menu_item_get_type".}
+proc gtk_check_menu_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_check_menu_item_new".}
+proc gtk_check_menu_item_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_check_menu_item_new_with_label".}
+proc gtk_check_menu_item_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_check_menu_item_new_with_mnemonic".}
+proc gtk_check_menu_item_set_active*(check_menu_item: PGtkCheckMenuItem,
+                                     is_active: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_check_menu_item_set_active".}
+proc gtk_check_menu_item_get_active*(check_menu_item: PGtkCheckMenuItem): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_check_menu_item_get_active".}
+proc gtk_check_menu_item_toggled*(check_menu_item: PGtkCheckMenuItem){.cdecl,
+    dynlib: gtklib, importc: "gtk_check_menu_item_toggled".}
+proc gtk_check_menu_item_set_inconsistent*(check_menu_item: PGtkCheckMenuItem,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_check_menu_item_set_inconsistent".}
+proc gtk_check_menu_item_get_inconsistent*(check_menu_item: PGtkCheckMenuItem): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_check_menu_item_get_inconsistent".}
+proc gtk_clipboard_get_for_display*(display: PGdkDisplay, selection: TGdkAtom): PGtkClipboard{.
+    cdecl, dynlib: gtklib, importc: "gtk_clipboard_get_for_display".}
+proc gtk_clipboard_get_display*(clipboard: PGtkClipboard): PGdkDisplay{.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_get_display".}
+proc gtk_clipboard_set_with_data*(clipboard: PGtkClipboard,
+                                  targets: PGtkTargetEntry, n_targets: guint,
+                                  get_func: TGtkClipboardGetFunc,
+                                  clear_func: TGtkClipboardClearFunc,
+                                  user_data: gpointer): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_set_with_data".}
+proc gtk_clipboard_set_with_owner*(clipboard: PGtkClipboard,
+                                   targets: PGtkTargetEntry, n_targets: guint,
+                                   get_func: TGtkClipboardGetFunc,
+                                   clear_func: TGtkClipboardClearFunc,
+                                   owner: PGObject): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_set_with_owner".}
+proc gtk_clipboard_get_owner*(clipboard: PGtkClipboard): PGObject{.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_get_owner".}
+proc gtk_clipboard_clear*(clipboard: PGtkClipboard){.cdecl, dynlib: gtklib,
+    importc: "gtk_clipboard_clear".}
+proc gtk_clipboard_set_text*(clipboard: PGtkClipboard, text: cstring, len: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_clipboard_set_text".}
+proc gtk_clipboard_request_contents*(clipboard: PGtkClipboard, target: TGdkAtom,
+                                     callback: TGtkClipboardReceivedFunc,
+                                     user_data: gpointer){.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_request_contents".}
+proc gtk_clipboard_request_text*(clipboard: PGtkClipboard,
+                                 callback: TGtkClipboardTextReceivedFunc,
+                                 user_data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_clipboard_request_text".}
+proc gtk_clipboard_wait_for_contents*(clipboard: PGtkClipboard, target: TGdkAtom): PGtkSelectionData{.
+    cdecl, dynlib: gtklib, importc: "gtk_clipboard_wait_for_contents".}
+proc gtk_clipboard_wait_for_text*(clipboard: PGtkClipboard): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_clipboard_wait_for_text".}
+proc gtk_clipboard_wait_is_text_available*(clipboard: PGtkClipboard): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_clipboard_wait_is_text_available".}
+const
+  GTK_CLIST_IN_DRAG* = 1 shl 0
+  GTK_CLIST_ROW_HEIGHT_SET* = 1 shl 1
+  GTK_CLIST_SHOW_TITLES* = 1 shl 2
+  GTK_CLIST_ADD_MODE* = 1 shl 4
+  GTK_CLIST_AUTO_SORT* = 1 shl 5
+  GTK_CLIST_AUTO_RESIZE_BLOCKED* = 1 shl 6
+  GTK_CLIST_REORDERABLE* = 1 shl 7
+  GTK_CLIST_USE_DRAG_ICONS* = 1 shl 8
+  GTK_CLIST_DRAW_DRAG_LINE* = 1 shl 9
+  GTK_CLIST_DRAW_DRAG_RECT* = 1 shl 10
+  GTK_BUTTON_IGNORED* = 0
+  GTK_BUTTON_SELECTS* = 1 shl 0
+  GTK_BUTTON_DRAGS* = 1 shl 1
+  GTK_BUTTON_EXPANDS* = 1 shl 2
+
+const
+  bm_TGtkCListColumn_visible* = 0x00000001
+  bp_TGtkCListColumn_visible* = 0
+  bm_TGtkCListColumn_width_set* = 0x00000002
+  bp_TGtkCListColumn_width_set* = 1
+  bm_TGtkCListColumn_resizeable* = 0x00000004
+  bp_TGtkCListColumn_resizeable* = 2
+  bm_TGtkCListColumn_auto_resize* = 0x00000008
+  bp_TGtkCListColumn_auto_resize* = 3
+  bm_TGtkCListColumn_button_passive* = 0x00000010
+  bp_TGtkCListColumn_button_passive* = 4
+  bm_TGtkCListRow_fg_set* = 0x00000001
+  bp_TGtkCListRow_fg_set* = 0
+  bm_TGtkCListRow_bg_set* = 0x00000002
+  bp_TGtkCListRow_bg_set* = 1
+  bm_TGtkCListRow_selectable* = 0x00000004
+  bp_TGtkCListRow_selectable* = 2
+
+proc GTK_TYPE_CLIST*(): GType
+proc GTK_CLIST*(obj: pointer): PGtkCList
+proc GTK_CLIST_CLASS*(klass: pointer): PGtkCListClass
+proc GTK_IS_CLIST*(obj: pointer): bool
+proc GTK_IS_CLIST_CLASS*(klass: pointer): bool
+proc GTK_CLIST_GET_CLASS*(obj: pointer): PGtkCListClass
+proc GTK_CLIST_FLAGS*(clist: pointer): guint16
+proc GTK_CLIST_SET_FLAG*(clist: PGtkCList, flag: guint16)
+proc GTK_CLIST_UNSET_FLAG*(clist: PGtkCList, flag: guint16)
+#proc GTK_CLIST_IN_DRAG_get*(clist: pointer): bool
+#proc GTK_CLIST_ROW_HEIGHT_SET_get*(clist: pointer): bool
+#proc GTK_CLIST_SHOW_TITLES_get*(clist: pointer): bool
+#proc GTK_CLIST_ADD_MODE_get*(clist: pointer): bool
+#proc GTK_CLIST_AUTO_SORT_get*(clist: pointer): bool
+#proc GTK_CLIST_AUTO_RESIZE_BLOCKED_get*(clist: pointer): bool
+#proc GTK_CLIST_REORDERABLE_get*(clist: pointer): bool
+#proc GTK_CLIST_USE_DRAG_ICONS_get*(clist: pointer): bool
+#proc GTK_CLIST_DRAW_DRAG_LINE_get*(clist: pointer): bool
+#proc GTK_CLIST_DRAW_DRAG_RECT_get*(clist: pointer): bool
+#proc GTK_CLIST_ROW_get*(`glist_`: PGList): PGtkCListRow
+#proc GTK_CELL_TEXT_get*(cell: pointer): PGtkCellText
+#proc GTK_CELL_PIXMAP_get*(cell: pointer): PGtkCellPixmap
+#proc GTK_CELL_PIXTEXT_get*(cell: pointer): PGtkCellPixText
+#proc GTK_CELL_WIDGET_get*(cell: pointer): PGtkCellWidget
+proc visible*(a: var TGtkCListColumn): guint
+proc set_visible*(a: var TGtkCListColumn, `visible`: guint)
+proc width_set*(a: var TGtkCListColumn): guint
+proc set_width_set*(a: var TGtkCListColumn, `width_set`: guint)
+proc resizeable*(a: var TGtkCListColumn): guint
+proc set_resizeable*(a: var TGtkCListColumn, `resizeable`: guint)
+proc auto_resize*(a: var TGtkCListColumn): guint
+proc set_auto_resize*(a: var TGtkCListColumn, `auto_resize`: guint)
+proc button_passive*(a: var TGtkCListColumn): guint
+proc set_button_passive*(a: var TGtkCListColumn, `button_passive`: guint)
+proc fg_set*(a: var TGtkCListRow): guint
+proc set_fg_set*(a: var TGtkCListRow, `fg_set`: guint)
+proc bg_set*(a: var TGtkCListRow): guint
+proc set_bg_set*(a: var TGtkCListRow, `bg_set`: guint)
+proc selectable*(a: var TGtkCListRow): guint
+proc set_selectable*(a: var TGtkCListRow, `selectable`: guint)
+proc gtk_clist_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_clist_get_type".}
+proc gtk_clist_new*(columns: gint): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_new".}
+proc gtk_clist_set_hadjustment*(clist: PGtkCList, adjustment: PGtkAdjustment){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_hadjustment".}
+proc gtk_clist_set_vadjustment*(clist: PGtkCList, adjustment: PGtkAdjustment){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_vadjustment".}
+proc gtk_clist_get_hadjustment*(clist: PGtkCList): PGtkAdjustment{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_hadjustment".}
+proc gtk_clist_get_vadjustment*(clist: PGtkCList): PGtkAdjustment{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_vadjustment".}
+proc gtk_clist_set_shadow_type*(clist: PGtkCList, thetype: TGtkShadowType){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_shadow_type".}
+proc gtk_clist_set_selection_mode*(clist: PGtkCList, mode: TGtkSelectionMode){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_selection_mode".}
+proc gtk_clist_set_reorderable*(clist: PGtkCList, reorderable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_reorderable".}
+proc gtk_clist_set_use_drag_icons*(clist: PGtkCList, use_icons: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_use_drag_icons".}
+proc gtk_clist_set_button_actions*(clist: PGtkCList, button: guint,
+                                   button_actions: guint8){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_button_actions".}
+proc gtk_clist_freeze*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_freeze".}
+proc gtk_clist_thaw*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_clist_thaw".}
+proc gtk_clist_column_titles_show*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_column_titles_show".}
+proc gtk_clist_column_titles_hide*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_column_titles_hide".}
+proc gtk_clist_column_title_active*(clist: PGtkCList, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_column_title_active".}
+proc gtk_clist_column_title_passive*(clist: PGtkCList, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_column_title_passive".}
+proc gtk_clist_column_titles_active*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_column_titles_active".}
+proc gtk_clist_column_titles_passive*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_column_titles_passive".}
+proc gtk_clist_set_column_title*(clist: PGtkCList, column: gint, title: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_column_title".}
+proc gtk_clist_get_column_title*(clist: PGtkCList, column: gint): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_column_title".}
+proc gtk_clist_set_column_widget*(clist: PGtkCList, column: gint,
+                                  widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_column_widget".}
+proc gtk_clist_get_column_widget*(clist: PGtkCList, column: gint): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_get_column_widget".}
+proc gtk_clist_set_column_justification*(clist: PGtkCList, column: gint,
+    justification: TGtkJustification){.cdecl, dynlib: gtklib, importc: "gtk_clist_set_column_justification".}
+proc gtk_clist_set_column_visibility*(clist: PGtkCList, column: gint,
+                                      visible: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_column_visibility".}
+proc gtk_clist_set_column_resizeable*(clist: PGtkCList, column: gint,
+                                      resizeable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_column_resizeable".}
+proc gtk_clist_set_column_auto_resize*(clist: PGtkCList, column: gint,
+                                       auto_resize: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_column_auto_resize".}
+proc gtk_clist_columns_autosize*(clist: PGtkCList): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_columns_autosize".}
+proc gtk_clist_optimal_column_width*(clist: PGtkCList, column: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_optimal_column_width".}
+proc gtk_clist_set_column_width*(clist: PGtkCList, column: gint, width: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_column_width".}
+proc gtk_clist_set_column_min_width*(clist: PGtkCList, column: gint,
+                                     min_width: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_column_min_width".}
+proc gtk_clist_set_column_max_width*(clist: PGtkCList, column: gint,
+                                     max_width: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_column_max_width".}
+proc gtk_clist_set_row_height*(clist: PGtkCList, height: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_row_height".}
+proc gtk_clist_moveto*(clist: PGtkCList, row: gint, column: gint,
+                       row_align: gfloat, col_align: gfloat){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_moveto".}
+proc gtk_clist_row_is_visible*(clist: PGtkCList, row: gint): TGtkVisibility{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_row_is_visible".}
+proc gtk_clist_get_cell_type*(clist: PGtkCList, row: gint, column: gint): TGtkCellType{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_get_cell_type".}
+proc gtk_clist_set_text*(clist: PGtkCList, row: gint, column: gint, text: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_text".}
+proc gtk_clist_get_text*(clist: PGtkCList, row: gint, column: gint,
+                         text: PPgchar): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_get_text".}
+proc gtk_clist_set_pixmap*(clist: PGtkCList, row: gint, column: gint,
+                           pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_pixmap".}
+proc gtk_clist_get_pixmap*(clist: PGtkCList, row: gint, column: gint,
+                           pixmap: var PGdkPixmap, mask: var PGdkBitmap): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_get_pixmap".}
+proc gtk_clist_set_pixtext*(clist: PGtkCList, row: gint, column: gint,
+                            text: cstring, spacing: guint8, pixmap: PGdkPixmap,
+                            mask: PGdkBitmap){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_pixtext".}
+proc gtk_clist_set_foreground*(clist: PGtkCList, row: gint, color: PGdkColor){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_foreground".}
+proc gtk_clist_set_background*(clist: PGtkCList, row: gint, color: PGdkColor){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_background".}
+proc gtk_clist_set_cell_style*(clist: PGtkCList, row: gint, column: gint,
+                               style: PGtkStyle){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_set_cell_style".}
+proc gtk_clist_get_cell_style*(clist: PGtkCList, row: gint, column: gint): PGtkStyle{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_get_cell_style".}
+proc gtk_clist_set_row_style*(clist: PGtkCList, row: gint, style: PGtkStyle){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_row_style".}
+proc gtk_clist_get_row_style*(clist: PGtkCList, row: gint): PGtkStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_row_style".}
+proc gtk_clist_set_shift*(clist: PGtkCList, row: gint, column: gint,
+                          vertical: gint, horizontal: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_shift".}
+proc gtk_clist_set_selectable*(clist: PGtkCList, row: gint, selectable: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_selectable".}
+proc gtk_clist_get_selectable*(clist: PGtkCList, row: gint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_selectable".}
+proc gtk_clist_remove*(clist: PGtkCList, row: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_remove".}
+proc gtk_clist_set_row_data*(clist: PGtkCList, row: gint, data: gpointer){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_set_row_data".}
+proc gtk_clist_set_row_data_full*(clist: PGtkCList, row: gint, data: gpointer,
+                                  destroy: TGtkDestroyNotify){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_row_data_full".}
+proc gtk_clist_get_row_data*(clist: PGtkCList, row: gint): gpointer{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_row_data".}
+proc gtk_clist_find_row_from_data*(clist: PGtkCList, data: gpointer): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_find_row_from_data".}
+proc gtk_clist_select_row*(clist: PGtkCList, row: gint, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_select_row".}
+proc gtk_clist_unselect_row*(clist: PGtkCList, row: gint, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_unselect_row".}
+proc gtk_clist_undo_selection*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_undo_selection".}
+proc gtk_clist_clear*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_clear".}
+proc gtk_clist_get_selection_info*(clist: PGtkCList, x: gint, y: gint,
+                                   row: Pgint, column: Pgint): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_get_selection_info".}
+proc gtk_clist_select_all*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_select_all".}
+proc gtk_clist_unselect_all*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+    importc: "gtk_clist_unselect_all".}
+proc gtk_clist_swap_rows*(clist: PGtkCList, row1: gint, row2: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_swap_rows".}
+proc gtk_clist_row_move*(clist: PGtkCList, source_row: gint, dest_row: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_clist_row_move".}
+proc gtk_clist_set_compare_func*(clist: PGtkCList,
+                                 cmp_func: TGtkCListCompareFunc){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_compare_func".}
+proc gtk_clist_set_sort_column*(clist: PGtkCList, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_sort_column".}
+proc gtk_clist_set_sort_type*(clist: PGtkCList, sort_type: TGtkSortType){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_sort_type".}
+proc gtk_clist_sort*(clist: PGtkCList){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_clist_sort".}
+proc gtk_clist_set_auto_sort*(clist: PGtkCList, auto_sort: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_clist_set_auto_sort".}
+proc gtk_clist_create_cell_layout*(clist: PGtkCList, clist_row: PGtkCListRow,
+                                     column: gint): PPangoLayout{.cdecl,
+    dynlib: gtklib, importc: "_gtk_clist_create_cell_layout".}
+const
+  GTK_DIALOG_MODAL* = 1 shl 0
+  GTK_DIALOG_DESTROY_WITH_PARENT* = 1 shl 1
+  GTK_DIALOG_NO_SEPARATOR* = 1 shl 2
+  GTK_RESPONSE_NONE* = - (1)
+  GTK_RESPONSE_REJECT* = - (2)
+  GTK_RESPONSE_ACCEPT* = - (3)
+  GTK_RESPONSE_DELETE_EVENT* = - (4)
+  GTK_RESPONSE_OK* = - (5)
+  GTK_RESPONSE_CANCEL* = - (6)
+  GTK_RESPONSE_CLOSE* = - (7)
+  GTK_RESPONSE_YES* = - (8)
+  GTK_RESPONSE_NO* = - (9)
+  GTK_RESPONSE_APPLY* = - (10)
+  GTK_RESPONSE_HELP* = - (11)
+
+proc GTK_TYPE_DIALOG*(): GType
+proc GTK_DIALOG*(obj: pointer): PGtkDialog
+proc GTK_DIALOG_CLASS*(klass: pointer): PGtkDialogClass
+proc GTK_IS_DIALOG*(obj: pointer): bool
+proc GTK_IS_DIALOG_CLASS*(klass: pointer): bool
+proc GTK_DIALOG_GET_CLASS*(obj: pointer): PGtkDialogClass
+proc gtk_dialog_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_dialog_get_type".}
+proc gtk_dialog_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_dialog_new".}
+proc gtk_dialog_add_action_widget*(dialog: PGtkDialog, child: PGtkWidget,
+                                   response_id: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_dialog_add_action_widget".}
+proc gtk_dialog_add_button*(dialog: PGtkDialog, button_text: cstring,
+                            response_id: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_dialog_add_button".}
+proc gtk_dialog_set_response_sensitive*(dialog: PGtkDialog, response_id: gint,
+                                        setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_dialog_set_response_sensitive".}
+proc gtk_dialog_set_default_response*(dialog: PGtkDialog, response_id: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_dialog_set_default_response".}
+proc gtk_dialog_set_has_separator*(dialog: PGtkDialog, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_dialog_set_has_separator".}
+proc gtk_dialog_get_has_separator*(dialog: PGtkDialog): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_dialog_get_has_separator".}
+proc gtk_dialog_response*(dialog: PGtkDialog, response_id: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_dialog_response".}
+proc gtk_dialog_run*(dialog: PGtkDialog): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_dialog_run".}
+proc GTK_TYPE_VBOX*(): GType
+proc GTK_VBOX*(obj: pointer): PGtkVBox
+proc GTK_VBOX_CLASS*(klass: pointer): PGtkVBoxClass
+proc GTK_IS_VBOX*(obj: pointer): bool
+proc GTK_IS_VBOX_CLASS*(klass: pointer): bool
+proc GTK_VBOX_GET_CLASS*(obj: pointer): PGtkVBoxClass
+proc gtk_vbox_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_vbox_get_type".}
+proc gtk_vbox_new*(homogeneous: gboolean, spacing: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_vbox_new".}
+proc GTK_TYPE_COLOR_SELECTION*(): GType
+proc GTK_COLOR_SELECTION*(obj: pointer): PGtkColorSelection
+proc GTK_COLOR_SELECTION_CLASS*(klass: pointer): PGtkColorSelectionClass
+proc GTK_IS_COLOR_SELECTION*(obj: pointer): bool
+proc GTK_IS_COLOR_SELECTION_CLASS*(klass: pointer): bool
+proc GTK_COLOR_SELECTION_GET_CLASS*(obj: pointer): PGtkColorSelectionClass
+proc gtk_color_selection_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_get_type".}
+proc gtk_color_selection_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_new".}
+proc gtk_color_selection_get_has_opacity_control*(colorsel: PGtkColorSelection): gboolean{.
+    cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_get_has_opacity_control".}
+proc gtk_color_selection_set_has_opacity_control*(colorsel: PGtkColorSelection,
+    has_opacity: gboolean){.cdecl, dynlib: gtklib, importc: "gtk_color_selection_set_has_opacity_control".}
+proc gtk_color_selection_get_has_palette*(colorsel: PGtkColorSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_color_selection_get_has_palette".}
+proc gtk_color_selection_set_has_palette*(colorsel: PGtkColorSelection,
+    has_palette: gboolean){.cdecl, dynlib: gtklib,
+                            importc: "gtk_color_selection_set_has_palette".}
+proc gtk_color_selection_set_current_color*(colorsel: PGtkColorSelection,
+    color: PGdkColor){.cdecl, dynlib: gtklib,
+                       importc: "gtk_color_selection_set_current_color".}
+proc gtk_color_selection_set_current_alpha*(colorsel: PGtkColorSelection,
+    alpha: guint16){.cdecl, dynlib: gtklib,
+                     importc: "gtk_color_selection_set_current_alpha".}
+proc gtk_color_selection_get_current_color*(colorsel: PGtkColorSelection,
+    color: PGdkColor){.cdecl, dynlib: gtklib,
+                       importc: "gtk_color_selection_get_current_color".}
+proc gtk_color_selection_get_current_alpha*(colorsel: PGtkColorSelection): guint16{.
+    cdecl, dynlib: gtklib, importc: "gtk_color_selection_get_current_alpha".}
+proc gtk_color_selection_set_previous_color*(colorsel: PGtkColorSelection,
+    color: PGdkColor){.cdecl, dynlib: gtklib,
+                       importc: "gtk_color_selection_set_previous_color".}
+proc gtk_color_selection_set_previous_alpha*(colorsel: PGtkColorSelection,
+    alpha: guint16){.cdecl, dynlib: gtklib,
+                     importc: "gtk_color_selection_set_previous_alpha".}
+proc gtk_color_selection_get_previous_color*(colorsel: PGtkColorSelection,
+    color: PGdkColor){.cdecl, dynlib: gtklib,
+                       importc: "gtk_color_selection_get_previous_color".}
+proc gtk_color_selection_get_previous_alpha*(colorsel: PGtkColorSelection): guint16{.
+    cdecl, dynlib: gtklib, importc: "gtk_color_selection_get_previous_alpha".}
+proc gtk_color_selection_is_adjusting*(colorsel: PGtkColorSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_color_selection_is_adjusting".}
+proc gtk_color_selection_palette_from_string*(str: cstring,
+    colors: var PGdkColor, n_colors: Pgint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_palette_from_string".}
+proc gtk_color_selection_palette_to_string*(colors: PGdkColor, n_colors: gint): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_color_selection_palette_to_string".}
+proc gtk_color_selection_set_change_palette_with_screen_hook*(
+    func: TGtkColorSelectionChangePaletteWithScreenFunc): TGtkColorSelectionChangePaletteWithScreenFunc{.
+    cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_set_change_palette_with_screen_hook".}
+proc GTK_TYPE_COLOR_SELECTION_DIALOG*(): GType
+proc GTK_COLOR_SELECTION_DIALOG*(obj: pointer): PGtkColorSelectionDialog
+proc GTK_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PGtkColorSelectionDialogClass
+proc GTK_IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool
+proc GTK_IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool
+proc GTK_COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PGtkColorSelectionDialogClass
+proc gtk_color_selection_dialog_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_color_selection_dialog_get_type".}
+proc gtk_color_selection_dialog_new*(title: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_color_selection_dialog_new".}
+proc GTK_TYPE_HBOX*(): GType
+proc GTK_HBOX*(obj: pointer): PGtkHBox
+proc GTK_HBOX_CLASS*(klass: pointer): PGtkHBoxClass
+proc GTK_IS_HBOX*(obj: pointer): bool
+proc GTK_IS_HBOX_CLASS*(klass: pointer): bool
+proc GTK_HBOX_GET_CLASS*(obj: pointer): PGtkHBoxClass
+proc gtk_hbox_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_hbox_get_type".}
+proc gtk_hbox_new*(homogeneous: gboolean, spacing: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_hbox_new".}
+const
+  bm_TGtkCombo_value_in_list* = 0x00000001
+  bp_TGtkCombo_value_in_list* = 0
+  bm_TGtkCombo_ok_if_empty* = 0x00000002
+  bp_TGtkCombo_ok_if_empty* = 1
+  bm_TGtkCombo_case_sensitive* = 0x00000004
+  bp_TGtkCombo_case_sensitive* = 2
+  bm_TGtkCombo_use_arrows* = 0x00000008
+  bp_TGtkCombo_use_arrows* = 3
+  bm_TGtkCombo_use_arrows_always* = 0x00000010
+  bp_TGtkCombo_use_arrows_always* = 4
+
+proc GTK_TYPE_COMBO*(): GType
+proc GTK_COMBO*(obj: pointer): PGtkCombo
+proc GTK_COMBO_CLASS*(klass: pointer): PGtkComboClass
+proc GTK_IS_COMBO*(obj: pointer): bool
+proc GTK_IS_COMBO_CLASS*(klass: pointer): bool
+proc GTK_COMBO_GET_CLASS*(obj: pointer): PGtkComboClass
+proc value_in_list*(a: var TGtkCombo): guint
+proc set_value_in_list*(a: var TGtkCombo, `value_in_list`: guint)
+proc ok_if_empty*(a: var TGtkCombo): guint
+proc set_ok_if_empty*(a: var TGtkCombo, `ok_if_empty`: guint)
+proc case_sensitive*(a: var TGtkCombo): guint
+proc set_case_sensitive*(a: var TGtkCombo, `case_sensitive`: guint)
+proc use_arrows*(a: var TGtkCombo): guint
+proc set_use_arrows*(a: var TGtkCombo, `use_arrows`: guint)
+proc use_arrows_always*(a: var TGtkCombo): guint
+proc set_use_arrows_always*(a: var TGtkCombo, `use_arrows_always`: guint)
+proc gtk_combo_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_combo_get_type".}
+proc gtk_combo_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_combo_new".}
+proc gtk_combo_set_value_in_list*(combo: PGtkCombo, val: gboolean,
+                                  ok_if_empty: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_combo_set_value_in_list".}
+proc gtk_combo_set_use_arrows*(combo: PGtkCombo, val: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_combo_set_use_arrows".}
+proc gtk_combo_set_use_arrows_always*(combo: PGtkCombo, val: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_combo_set_use_arrows_always".}
+proc gtk_combo_set_case_sensitive*(combo: PGtkCombo, val: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_combo_set_case_sensitive".}
+proc gtk_combo_set_item_string*(combo: PGtkCombo, item: PGtkItem,
+                                item_value: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_combo_set_item_string".}
+proc gtk_combo_set_popdown_strings*(combo: PGtkCombo, strings: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_combo_set_popdown_strings".}
+proc gtk_combo_disable_activate*(combo: PGtkCombo){.cdecl, dynlib: gtklib,
+    importc: "gtk_combo_disable_activate".}
+const
+  bm_TGtkCTree_line_style* = 0x00000003
+  bp_TGtkCTree_line_style* = 0
+  bm_TGtkCTree_expander_style* = 0x0000000C
+  bp_TGtkCTree_expander_style* = 2
+  bm_TGtkCTree_show_stub* = 0x00000010
+  bp_TGtkCTree_show_stub* = 4
+  bm_TGtkCTreeRow_is_leaf* = 0x00000001
+  bp_TGtkCTreeRow_is_leaf* = 0
+  bm_TGtkCTreeRow_expanded* = 0x00000002
+  bp_TGtkCTreeRow_expanded* = 1
+
+proc GTK_TYPE_CTREE*(): GType
+proc GTK_CTREE*(obj: pointer): PGtkCTree
+proc GTK_CTREE_CLASS*(klass: pointer): PGtkCTreeClass
+proc GTK_IS_CTREE*(obj: pointer): bool
+proc GTK_IS_CTREE_CLASS*(klass: pointer): bool
+proc GTK_CTREE_GET_CLASS*(obj: pointer): PGtkCTreeClass
+proc GTK_CTREE_ROW*(`node_`: TAddress): PGtkCTreeRow
+proc GTK_CTREE_NODE*(`node_`: TAddress): PGtkCTreeNode
+proc GTK_CTREE_NODE_NEXT*(`nnode_`: TAddress): PGtkCTreeNode
+proc GTK_CTREE_NODE_PREV*(`pnode_`: TAddress): PGtkCTreeNode
+proc GTK_CTREE_FUNC*(`func_`: TAddress): TGtkCTreeFunc
+proc GTK_TYPE_CTREE_NODE*(): GType
+proc line_style*(a: var TGtkCTree): guint
+proc set_line_style*(a: var TGtkCTree, `line_style`: guint)
+proc expander_style*(a: var TGtkCTree): guint
+proc set_expander_style*(a: var TGtkCTree, `expander_style`: guint)
+proc show_stub*(a: var TGtkCTree): guint
+proc set_show_stub*(a: var TGtkCTree, `show_stub`: guint)
+proc is_leaf*(a: var TGtkCTreeRow): guint
+proc set_is_leaf*(a: var TGtkCTreeRow, `is_leaf`: guint)
+proc expanded*(a: var TGtkCTreeRow): guint
+proc set_expanded*(a: var TGtkCTreeRow, `expanded`: guint)
+proc gtk_ctree_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_ctree_get_type".}
+proc gtk_ctree_new*(columns: gint, tree_column: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_new".}
+proc gtk_ctree_insert_node*(ctree: PGtkCTree, parent: PGtkCTreeNode,
+                            sibling: PGtkCTreeNode, text: openarray[cstring],
+                            spacing: guint8, pixmap_closed: PGdkPixmap,
+                            mask_closed: PGdkBitmap, pixmap_opened: PGdkPixmap,
+                            mask_opened: PGdkBitmap, is_leaf: gboolean,
+                            expanded: gboolean): PGtkCTreeNode{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_insert_node".}
+proc gtk_ctree_remove_node*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_remove_node".}
+proc gtk_ctree_insert_gnode*(ctree: PGtkCTree, parent: PGtkCTreeNode,
+                             sibling: PGtkCTreeNode, gnode: PGNode,
+                             func_: TGtkCTreeGNodeFunc, data: gpointer): PGtkCTreeNode{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_insert_gnode".}
+proc gtk_ctree_export_to_gnode*(ctree: PGtkCTree, parent: PGNode,
+                                sibling: PGNode, node_: PGtkCTreeNode,
+                                func_: TGtkCTreeGNodeFunc, data: gpointer): PGNode{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_export_to_gnode".}
+proc gtk_ctree_post_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                               func_: TGtkCTreeFunc, data: gpointer){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_post_recursive".}
+proc gtk_ctree_post_recursive_to_depth*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                        depth: gint, func_: TGtkCTreeFunc,
+                                        data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_post_recursive_to_depth".}
+proc gtk_ctree_pre_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                              func_: TGtkCTreeFunc, data: gpointer){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_pre_recursive".}
+proc gtk_ctree_pre_recursive_to_depth*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                       depth: gint, func_: TGtkCTreeFunc,
+                                       data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_pre_recursive_to_depth".}
+proc gtk_ctree_is_viewable*(ctree: PGtkCTree, node_: PGtkCTreeNode): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_is_viewable".}
+proc gtk_ctree_last*(ctree: PGtkCTree, node_: PGtkCTreeNode): PGtkCTreeNode{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_last".}
+proc gtk_ctree_find_node_ptr*(ctree: PGtkCTree, ctree_row: PGtkCTreeRow): PGtkCTreeNode{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_find_node_ptr".}
+proc gtk_ctree_node_nth*(ctree: PGtkCTree, row: guint): PGtkCTreeNode{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_nth".}
+proc gtk_ctree_find*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                     child: PGtkCTreeNode): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_find".}
+proc gtk_ctree_is_ancestor*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                            child: PGtkCTreeNode): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_is_ancestor".}
+proc gtk_ctree_find_by_row_data*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                 data: gpointer): PGtkCTreeNode{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_find_by_row_data".}
+proc gtk_ctree_find_all_by_row_data*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                     data: gpointer): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_find_all_by_row_data".}
+proc gtk_ctree_find_by_row_data_custom*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                        data: gpointer, func_: TGCompareFunc): PGtkCTreeNode{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_find_by_row_data_custom".}
+proc gtk_ctree_find_all_by_row_data_custom*(ctree: PGtkCTree,
+    node_: PGtkCTreeNode, data: gpointer, func_: TGCompareFunc): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_find_all_by_row_data_custom".}
+proc gtk_ctree_is_hot_spot*(ctree: PGtkCTree, x: gint, y: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_is_hot_spot".}
+proc gtk_ctree_move*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                     new_parent: PGtkCTreeNode, new_sibling: PGtkCTreeNode){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_move".}
+proc gtk_ctree_expand*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_expand".}
+proc gtk_ctree_expand_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_expand_recursive".}
+proc gtk_ctree_expand_to_depth*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                depth: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_expand_to_depth".}
+proc gtk_ctree_collapse*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_collapse".}
+proc gtk_ctree_collapse_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_collapse_recursive".}
+proc gtk_ctree_collapse_to_depth*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                  depth: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_collapse_to_depth".}
+proc gtk_ctree_toggle_expansion*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_toggle_expansion".}
+proc gtk_ctree_toggle_expansion_recursive*(ctree: PGtkCTree,
+    node_: PGtkCTreeNode){.cdecl, dynlib: gtklib,
+                           importc: "gtk_ctree_toggle_expansion_recursive".}
+proc gtk_ctree_select*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_select".}
+proc gtk_ctree_select_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_select_recursive".}
+proc gtk_ctree_unselect*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_unselect".}
+proc gtk_ctree_unselect_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_unselect_recursive".}
+proc gtk_ctree_real_select_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                      state: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_real_select_recursive".}
+proc gtk_ctree_node_set_text*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                              column: gint, text: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_set_text".}
+proc gtk_ctree_node_set_pixmap*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                column: gint, pixmap: PGdkPixmap,
+                                mask: PGdkBitmap){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_node_set_pixmap".}
+proc gtk_ctree_node_set_pixtext*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                 column: gint, text: cstring, spacing: guint8,
+                                 pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_set_pixtext".}
+proc gtk_ctree_set_node_info*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                              text: cstring, spacing: guint8,
+                              pixmap_closed: PGdkPixmap,
+                              mask_closed: PGdkBitmap,
+                              pixmap_opened: PGdkPixmap,
+                              mask_opened: PGdkBitmap, is_leaf: gboolean,
+                              expanded: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_set_node_info".}
+proc gtk_ctree_node_set_shift*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                               column: gint, vertical: gint, horizontal: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_set_shift".}
+proc gtk_ctree_node_set_selectable*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                    selectable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_set_selectable".}
+proc gtk_ctree_node_get_selectable*(ctree: PGtkCTree, node_: PGtkCTreeNode): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_get_selectable".}
+proc gtk_ctree_node_get_cell_type*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                   column: gint): TGtkCellType{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_get_cell_type".}
+proc gtk_ctree_node_get_text*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                              column: gint, text: PPgchar): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_get_text".}
+proc gtk_ctree_node_set_row_style*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                   style: PGtkStyle){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_node_set_row_style".}
+proc gtk_ctree_node_get_row_style*(ctree: PGtkCTree, node_: PGtkCTreeNode): PGtkStyle{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_get_row_style".}
+proc gtk_ctree_node_set_cell_style*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                    column: gint, style: PGtkStyle){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_set_cell_style".}
+proc gtk_ctree_node_get_cell_style*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                    column: gint): PGtkStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_get_cell_style".}
+proc gtk_ctree_node_set_foreground*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                    color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_node_set_foreground".}
+proc gtk_ctree_node_set_background*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                    color: PGdkColor){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_node_set_background".}
+proc gtk_ctree_node_set_row_data*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                  data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_ctree_node_set_row_data".}
+proc gtk_ctree_node_set_row_data_full*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                                       data: gpointer,
+                                       destroy: TGtkDestroyNotify){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_node_set_row_data_full".}
+proc gtk_ctree_node_get_row_data*(ctree: PGtkCTree, node_: PGtkCTreeNode): gpointer{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_get_row_data".}
+proc gtk_ctree_node_moveto*(ctree: PGtkCTree, node_: PGtkCTreeNode,
+                            column: gint, row_align: gfloat, col_align: gfloat){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_moveto".}
+proc gtk_ctree_node_is_visible*(ctree: PGtkCTree, node_: PGtkCTreeNode): TGtkVisibility{.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_node_is_visible".}
+proc gtk_ctree_set_indent*(ctree: PGtkCTree, indent: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_set_indent".}
+proc gtk_ctree_set_spacing*(ctree: PGtkCTree, spacing: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_set_spacing".}
+proc gtk_ctree_set_show_stub*(ctree: PGtkCTree, show_stub: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_set_show_stub".}
+proc gtk_ctree_set_line_style*(ctree: PGtkCTree, line_style: TGtkCTreeLineStyle){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_set_line_style".}
+proc gtk_ctree_set_expander_style*(ctree: PGtkCTree,
+                                   expander_style: TGtkCTreeExpanderStyle){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_set_expander_style".}
+proc gtk_ctree_set_drag_compare_func*(ctree: PGtkCTree,
+                                      cmp_func: TGtkCTreeCompareDragFunc){.
+    cdecl, dynlib: gtklib, importc: "gtk_ctree_set_drag_compare_func".}
+proc gtk_ctree_sort_node*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_sort_node".}
+proc gtk_ctree_sort_recursive*(ctree: PGtkCTree, node_: PGtkCTreeNode){.cdecl,
+    dynlib: gtklib, importc: "gtk_ctree_sort_recursive".}
+proc gtk_ctree_set_reorderable*(t: pointer, r: bool)
+proc gtk_ctree_node_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_ctree_node_get_type".}
+proc GTK_TYPE_DRAWING_AREA*(): GType
+proc GTK_DRAWING_AREA*(obj: pointer): PGtkDrawingArea
+proc GTK_DRAWING_AREA_CLASS*(klass: pointer): PGtkDrawingAreaClass
+proc GTK_IS_DRAWING_AREA*(obj: pointer): bool
+proc GTK_IS_DRAWING_AREA_CLASS*(klass: pointer): bool
+proc GTK_DRAWING_AREA_GET_CLASS*(obj: pointer): PGtkDrawingAreaClass
+proc gtk_drawing_area_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_drawing_area_get_type".}
+proc gtk_drawing_area_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_drawing_area_new".}
+proc GTK_TYPE_CURVE*(): GType
+proc GTK_CURVE*(obj: pointer): PGtkCurve
+proc GTK_CURVE_CLASS*(klass: pointer): PGtkCurveClass
+proc GTK_IS_CURVE*(obj: pointer): bool
+proc GTK_IS_CURVE_CLASS*(klass: pointer): bool
+proc GTK_CURVE_GET_CLASS*(obj: pointer): PGtkCurveClass
+proc gtk_curve_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_curve_get_type".}
+proc gtk_curve_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_curve_new".}
+proc gtk_curve_reset*(curve: PGtkCurve){.cdecl, dynlib: gtklib,
+    importc: "gtk_curve_reset".}
+proc gtk_curve_set_gamma*(curve: PGtkCurve, gamma: gfloat){.cdecl,
+    dynlib: gtklib, importc: "gtk_curve_set_gamma".}
+proc gtk_curve_set_range*(curve: PGtkCurve, min_x: gfloat, max_x: gfloat,
+                          min_y: gfloat, max_y: gfloat){.cdecl, dynlib: gtklib,
+    importc: "gtk_curve_set_range".}
+proc gtk_curve_set_curve_type*(curve: PGtkCurve, thetype: TGtkCurveType){.cdecl,
+    dynlib: gtklib, importc: "gtk_curve_set_curve_type".}
+const
+  GTK_DEST_DEFAULT_MOTION* = 1 shl 0
+  GTK_DEST_DEFAULT_HIGHLIGHT* = 1 shl 1
+  GTK_DEST_DEFAULT_DROP* = 1 shl 2
+  GTK_DEST_DEFAULT_ALL* = 0x00000007
+  GTK_TARGET_SAME_APP* = 1 shl 0
+  GTK_TARGET_SAME_WIDGET* = 1 shl 1
+
+proc gtk_drag_get_data*(widget: PGtkWidget, context: PGdkDragContext,
+                        target: TGdkAtom, time: guint32){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_get_data".}
+proc gtk_drag_finish*(context: PGdkDragContext, success: gboolean,
+                      del: gboolean, time: guint32){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_finish".}
+proc gtk_drag_get_source_widget*(context: PGdkDragContext): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_get_source_widget".}
+proc gtk_drag_highlight*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_highlight".}
+proc gtk_drag_unhighlight*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_unhighlight".}
+proc gtk_drag_dest_set*(widget: PGtkWidget, flags: TGtkDestDefaults,
+                        targets: PGtkTargetEntry, n_targets: gint,
+                        actions: TGdkDragAction){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_dest_set".}
+proc gtk_drag_dest_set_proxy*(widget: PGtkWidget, proxy_window: PGdkWindow,
+                              protocol: TGdkDragProtocol,
+                              use_coordinates: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_dest_set_proxy".}
+proc gtk_drag_dest_unset*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_dest_unset".}
+proc gtk_drag_dest_find_target*(widget: PGtkWidget, context: PGdkDragContext,
+                                target_list: PGtkTargetList): TGdkAtom{.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_dest_find_target".}
+proc gtk_drag_dest_get_target_list*(widget: PGtkWidget): PGtkTargetList{.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_dest_get_target_list".}
+proc gtk_drag_dest_set_target_list*(widget: PGtkWidget,
+                                    target_list: PGtkTargetList){.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_dest_set_target_list".}
+proc gtk_drag_source_set*(widget: PGtkWidget,
+                          start_button_mask: TGdkModifierType,
+                          targets: PGtkTargetEntry, n_targets: gint,
+                          actions: TGdkDragAction){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_source_set".}
+proc gtk_drag_source_unset*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_source_unset".}
+proc gtk_drag_source_set_icon*(widget: PGtkWidget, colormap: PGdkColormap,
+                               pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_source_set_icon".}
+proc gtk_drag_source_set_icon_pixbuf*(widget: PGtkWidget, pixbuf: PGdkPixbuf){.
+    cdecl, dynlib: gtklib, importc: "gtk_drag_source_set_icon_pixbuf".}
+proc gtk_drag_source_set_icon_stock*(widget: PGtkWidget, stock_id: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_drag_source_set_icon_stock".}
+proc gtk_drag_begin*(widget: PGtkWidget, targets: PGtkTargetList,
+                     actions: TGdkDragAction, button: gint, event: PGdkEvent): PGdkDragContext{.
+    cdecl, dynlib: gtklib, importc: "gtk_drag_begin".}
+proc gtk_drag_set_icon_widget*(context: PGdkDragContext, widget: PGtkWidget,
+                               hot_x: gint, hot_y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_set_icon_widget".}
+proc gtk_drag_set_icon_pixmap*(context: PGdkDragContext, colormap: PGdkColormap,
+                               pixmap: PGdkPixmap, mask: PGdkBitmap,
+                               hot_x: gint, hot_y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_set_icon_pixmap".}
+proc gtk_drag_set_icon_pixbuf*(context: PGdkDragContext, pixbuf: PGdkPixbuf,
+                               hot_x: gint, hot_y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_set_icon_pixbuf".}
+proc gtk_drag_set_icon_stock*(context: PGdkDragContext, stock_id: cstring,
+                              hot_x: gint, hot_y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_drag_set_icon_stock".}
+proc gtk_drag_set_icon_default*(context: PGdkDragContext){.cdecl,
+    dynlib: gtklib, importc: "gtk_drag_set_icon_default".}
+proc gtk_drag_check_threshold*(widget: PGtkWidget, start_x: gint, start_y: gint,
+                               current_x: gint, current_y: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_drag_check_threshold".}
+proc gtk_drag_source_handle_event*(widget: PGtkWidget, event: PGdkEvent){.
+    cdecl, dynlib: gtklib, importc: "_gtk_drag_source_handle_event".}
+proc gtk_drag_dest_handle_event*(toplevel: PGtkWidget, event: PGdkEvent){.
+    cdecl, dynlib: gtklib, importc: "_gtk_drag_dest_handle_event".}
+proc GTK_TYPE_EDITABLE*(): GType
+proc GTK_EDITABLE*(obj: pointer): PGtkEditable
+proc GTK_EDITABLE_CLASS*(vtable: pointer): PGtkEditableClass
+proc GTK_IS_EDITABLE*(obj: pointer): bool
+proc GTK_IS_EDITABLE_CLASS*(vtable: pointer): bool
+proc GTK_EDITABLE_GET_CLASS*(inst: pointer): PGtkEditableClass
+proc gtk_editable_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_editable_get_type".}
+proc gtk_editable_select_region*(editable: PGtkEditable, start: gint,
+                                 theEnd: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_editable_select_region".}
+proc gtk_editable_get_selection_bounds*(editable: PGtkEditable, start: Pgint,
+                                        theEnd: Pgint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_get_selection_bounds".}
+proc gtk_editable_insert_text*(editable: PGtkEditable, new_text: cstring,
+                               new_text_length: gint, position: Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_insert_text".}
+proc gtk_editable_delete_text*(editable: PGtkEditable, start_pos: gint,
+                               end_pos: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_editable_delete_text".}
+proc gtk_editable_get_chars*(editable: PGtkEditable, start_pos: gint,
+                             end_pos: gint): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_editable_get_chars".}
+proc gtk_editable_cut_clipboard*(editable: PGtkEditable){.cdecl, dynlib: gtklib,
+    importc: "gtk_editable_cut_clipboard".}
+proc gtk_editable_copy_clipboard*(editable: PGtkEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_copy_clipboard".}
+proc gtk_editable_paste_clipboard*(editable: PGtkEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_paste_clipboard".}
+proc gtk_editable_delete_selection*(editable: PGtkEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_delete_selection".}
+proc gtk_editable_set_position*(editable: PGtkEditable, position: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_set_position".}
+proc gtk_editable_get_position*(editable: PGtkEditable): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_get_position".}
+proc gtk_editable_set_editable*(editable: PGtkEditable, is_editable: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_editable_set_editable".}
+proc gtk_editable_get_editable*(editable: PGtkEditable): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_editable_get_editable".}
+proc GTK_TYPE_IM_CONTEXT*(): GType
+proc GTK_IM_CONTEXT*(obj: pointer): PGtkIMContext
+proc GTK_IM_CONTEXT_CLASS*(klass: pointer): PGtkIMContextClass
+proc GTK_IS_IM_CONTEXT*(obj: pointer): bool
+proc GTK_IS_IM_CONTEXT_CLASS*(klass: pointer): bool
+proc GTK_IM_CONTEXT_GET_CLASS*(obj: pointer): PGtkIMContextClass
+proc gtk_im_context_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_get_type".}
+proc gtk_im_context_set_client_window*(context: PGtkIMContext,
+                                       window: PGdkWindow){.cdecl,
+    dynlib: gtklib, importc: "gtk_im_context_set_client_window".}
+proc gtk_im_context_filter_keypress*(context: PGtkIMContext, event: PGdkEventKey): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_im_context_filter_keypress".}
+proc gtk_im_context_focus_in*(context: PGtkIMContext){.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_focus_in".}
+proc gtk_im_context_focus_out*(context: PGtkIMContext){.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_focus_out".}
+proc gtk_im_context_reset*(context: PGtkIMContext){.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_reset".}
+proc gtk_im_context_set_cursor_location*(context: PGtkIMContext,
+    area: PGdkRectangle){.cdecl, dynlib: gtklib,
+                          importc: "gtk_im_context_set_cursor_location".}
+proc gtk_im_context_set_use_preedit*(context: PGtkIMContext,
+                                     use_preedit: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_im_context_set_use_preedit".}
+proc gtk_im_context_set_surrounding*(context: PGtkIMContext, text: cstring,
+                                     len: gint, cursor_index: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_im_context_set_surrounding".}
+proc gtk_im_context_get_surrounding*(context: PGtkIMContext, text: PPgchar,
+                                     cursor_index: Pgint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_im_context_get_surrounding".}
+proc gtk_im_context_delete_surrounding*(context: PGtkIMContext, offset: gint,
+                                        n_chars: gint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_im_context_delete_surrounding".}
+const
+  bm_TGtkMenuShell_active* = 0x00000001
+  bp_TGtkMenuShell_active* = 0
+  bm_TGtkMenuShell_have_grab* = 0x00000002
+  bp_TGtkMenuShell_have_grab* = 1
+  bm_TGtkMenuShell_have_xgrab* = 0x00000004
+  bp_TGtkMenuShell_have_xgrab* = 2
+  bm_TGtkMenuShell_ignore_leave* = 0x00000008
+  bp_TGtkMenuShell_ignore_leave* = 3
+  bm_TGtkMenuShell_menu_flag* = 0x00000010
+  bp_TGtkMenuShell_menu_flag* = 4
+  bm_TGtkMenuShell_ignore_enter* = 0x00000020
+  bp_TGtkMenuShell_ignore_enter* = 5
+  bm_TGtkMenuShellClass_submenu_placement* = 0x00000001
+  bp_TGtkMenuShellClass_submenu_placement* = 0
+
+proc GTK_TYPE_MENU_SHELL*(): GType
+proc GTK_MENU_SHELL*(obj: pointer): PGtkMenuShell
+proc GTK_MENU_SHELL_CLASS*(klass: pointer): PGtkMenuShellClass
+proc GTK_IS_MENU_SHELL*(obj: pointer): bool
+proc GTK_IS_MENU_SHELL_CLASS*(klass: pointer): bool
+proc GTK_MENU_SHELL_GET_CLASS*(obj: pointer): PGtkMenuShellClass
+proc active*(a: var TGtkMenuShell): guint
+proc set_active*(a: var TGtkMenuShell, `active`: guint)
+proc have_grab*(a: var TGtkMenuShell): guint
+proc set_have_grab*(a: var TGtkMenuShell, `have_grab`: guint)
+proc have_xgrab*(a: var TGtkMenuShell): guint
+proc set_have_xgrab*(a: var TGtkMenuShell, `have_xgrab`: guint)
+proc ignore_leave*(a: var TGtkMenuShell): guint
+proc set_ignore_leave*(a: var TGtkMenuShell, `ignore_leave`: guint)
+proc menu_flag*(a: var TGtkMenuShell): guint
+proc set_menu_flag*(a: var TGtkMenuShell, `menu_flag`: guint)
+proc ignore_enter*(a: var TGtkMenuShell): guint
+proc set_ignore_enter*(a: var TGtkMenuShell, `ignore_enter`: guint)
+proc submenu_placement*(a: var TGtkMenuShellClass): guint
+proc set_submenu_placement*(a: var TGtkMenuShellClass,
+                            `submenu_placement`: guint)
+proc gtk_menu_shell_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_shell_get_type".}
+proc gtk_menu_shell_append*(menu_shell: PGtkMenuShell, child: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_shell_append".}
+proc gtk_menu_shell_prepend*(menu_shell: PGtkMenuShell, child: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_shell_prepend".}
+proc gtk_menu_shell_insert*(menu_shell: PGtkMenuShell, child: PGtkWidget,
+                            position: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_shell_insert".}
+proc gtk_menu_shell_deactivate*(menu_shell: PGtkMenuShell){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_shell_deactivate".}
+proc gtk_menu_shell_select_item*(menu_shell: PGtkMenuShell,
+                                 menu_item: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_shell_select_item".}
+proc gtk_menu_shell_deselect*(menu_shell: PGtkMenuShell){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_shell_deselect".}
+proc gtk_menu_shell_activate_item*(menu_shell: PGtkMenuShell,
+                                   menu_item: PGtkWidget,
+                                   force_deactivate: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_shell_activate_item".}
+proc gtk_menu_shell_select_first*(menu_shell: PGtkMenuShell){.cdecl,
+    dynlib: gtklib, importc: "_gtk_menu_shell_select_first".}
+proc gtk_menu_shell_activate*(menu_shell: PGtkMenuShell){.cdecl,
+    dynlib: gtklib, importc: "_gtk_menu_shell_activate".}
+const
+  bm_TGtkMenu_needs_destruction_ref_count* = 0x00000001
+  bp_TGtkMenu_needs_destruction_ref_count* = 0
+  bm_TGtkMenu_torn_off* = 0x00000002
+  bp_TGtkMenu_torn_off* = 1
+  bm_TGtkMenu_tearoff_active* = 0x00000004
+  bp_TGtkMenu_tearoff_active* = 2
+  bm_TGtkMenu_scroll_fast* = 0x00000008
+  bp_TGtkMenu_scroll_fast* = 3
+  bm_TGtkMenu_upper_arrow_visible* = 0x00000010
+  bp_TGtkMenu_upper_arrow_visible* = 4
+  bm_TGtkMenu_lower_arrow_visible* = 0x00000020
+  bp_TGtkMenu_lower_arrow_visible* = 5
+  bm_TGtkMenu_upper_arrow_prelight* = 0x00000040
+  bp_TGtkMenu_upper_arrow_prelight* = 6
+  bm_TGtkMenu_lower_arrow_prelight* = 0x00000080
+  bp_TGtkMenu_lower_arrow_prelight* = 7
+
+proc GTK_TYPE_MENU*(): GType
+proc GTK_MENU*(obj: pointer): PGtkMenu
+proc GTK_MENU_CLASS*(klass: pointer): PGtkMenuClass
+proc GTK_IS_MENU*(obj: pointer): bool
+proc GTK_IS_MENU_CLASS*(klass: pointer): bool
+proc GTK_MENU_GET_CLASS*(obj: pointer): PGtkMenuClass
+proc needs_destruction_ref_count*(a: var TGtkMenu): guint
+proc set_needs_destruction_ref_count*(a: var TGtkMenu,
+                                      `needs_destruction_ref_count`: guint)
+proc torn_off*(a: var TGtkMenu): guint
+proc set_torn_off*(a: var TGtkMenu, `torn_off`: guint)
+proc tearoff_active*(a: var TGtkMenu): guint
+proc set_tearoff_active*(a: var TGtkMenu, `tearoff_active`: guint)
+proc scroll_fast*(a: var TGtkMenu): guint
+proc set_scroll_fast*(a: var TGtkMenu, `scroll_fast`: guint)
+proc upper_arrow_visible*(a: var TGtkMenu): guint
+proc set_upper_arrow_visible*(a: var TGtkMenu, `upper_arrow_visible`: guint)
+proc lower_arrow_visible*(a: var TGtkMenu): guint
+proc set_lower_arrow_visible*(a: var TGtkMenu, `lower_arrow_visible`: guint)
+proc upper_arrow_prelight*(a: var TGtkMenu): guint
+proc set_upper_arrow_prelight*(a: var TGtkMenu, `upper_arrow_prelight`: guint)
+proc lower_arrow_prelight*(a: var TGtkMenu): guint
+proc set_lower_arrow_prelight*(a: var TGtkMenu, `lower_arrow_prelight`: guint)
+proc gtk_menu_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_menu_get_type".}
+proc gtk_menu_new*(): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_menu_new".}
+proc gtk_menu_popup*(menu: PGtkMenu, parent_menu_shell: PGtkWidget,
+                     parent_menu_item: PGtkWidget, func_: TGtkMenuPositionFunc,
+                     data: gpointer, button: guint, activate_time: guint32){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_popup".}
+proc gtk_menu_reposition*(menu: PGtkMenu){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_reposition".}
+proc gtk_menu_popdown*(menu: PGtkMenu){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_menu_popdown".}
+proc gtk_menu_get_active*(menu: PGtkMenu): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_get_active".}
+proc gtk_menu_set_active*(menu: PGtkMenu, index: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_set_active".}
+proc gtk_menu_set_accel_group*(menu: PGtkMenu, accel_group: PGtkAccelGroup){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_set_accel_group".}
+proc gtk_menu_get_accel_group*(menu: PGtkMenu): PGtkAccelGroup{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_get_accel_group".}
+proc gtk_menu_set_accel_path*(menu: PGtkMenu, accel_path: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_set_accel_path".}
+proc gtk_menu_attach_to_widget*(menu: PGtkMenu, attach_widget: PGtkWidget,
+                                detacher: TGtkMenuDetachFunc){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_attach_to_widget".}
+proc gtk_menu_detach*(menu: PGtkMenu){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_menu_detach".}
+proc gtk_menu_get_attach_widget*(menu: PGtkMenu): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_get_attach_widget".}
+proc gtk_menu_set_tearoff_state*(menu: PGtkMenu, torn_off: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_set_tearoff_state".}
+proc gtk_menu_get_tearoff_state*(menu: PGtkMenu): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_get_tearoff_state".}
+proc gtk_menu_set_title*(menu: PGtkMenu, title: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_set_title".}
+proc gtk_menu_get_title*(menu: PGtkMenu): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_get_title".}
+proc gtk_menu_reorder_child*(menu: PGtkMenu, child: PGtkWidget, position: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_menu_reorder_child".}
+proc gtk_menu_set_screen*(menu: PGtkMenu, screen: PGdkScreen){.cdecl,
+    dynlib: gtklib, importc: "gtk_menu_set_screen".}
+const
+  bm_TGtkEntry_editable* = 0x00000001
+  bp_TGtkEntry_editable* = 0
+  bm_TGtkEntry_visible* = 0x00000002
+  bp_TGtkEntry_visible* = 1
+  bm_TGtkEntry_overwrite_mode* = 0x00000004
+  bp_TGtkEntry_overwrite_mode* = 2
+  bm_TGtkEntry_in_drag* = 0x00000008
+  bp_TGtkEntry_in_drag* = 3
+  bm_TGtkEntry_cache_includes_preedit* = 0x00000001
+  bp_TGtkEntry_cache_includes_preedit* = 0
+  bm_TGtkEntry_need_im_reset* = 0x00000002
+  bp_TGtkEntry_need_im_reset* = 1
+  bm_TGtkEntry_has_frame* = 0x00000004
+  bp_TGtkEntry_has_frame* = 2
+  bm_TGtkEntry_activates_default* = 0x00000008
+  bp_TGtkEntry_activates_default* = 3
+  bm_TGtkEntry_cursor_visible* = 0x00000010
+  bp_TGtkEntry_cursor_visible* = 4
+  bm_TGtkEntry_in_click* = 0x00000020
+  bp_TGtkEntry_in_click* = 5
+  bm_TGtkEntry_is_cell_renderer* = 0x00000040
+  bp_TGtkEntry_is_cell_renderer* = 6
+  bm_TGtkEntry_editing_canceled* = 0x00000080
+  bp_TGtkEntry_editing_canceled* = 7
+  bm_TGtkEntry_mouse_cursor_obscured* = 0x00000100
+  bp_TGtkEntry_mouse_cursor_obscured* = 8
+
+proc GTK_TYPE_ENTRY*(): GType
+proc GTK_ENTRY*(obj: pointer): PGtkEntry
+proc GTK_ENTRY_CLASS*(klass: pointer): PGtkEntryClass
+proc GTK_IS_ENTRY*(obj: pointer): bool
+proc GTK_IS_ENTRY_CLASS*(klass: pointer): bool
+proc GTK_ENTRY_GET_CLASS*(obj: pointer): PGtkEntryClass
+proc editable*(a: var TGtkEntry): guint
+proc set_editable*(a: var TGtkEntry, `editable`: guint)
+proc visible*(a: var TGtkEntry): guint
+proc set_visible*(a: var TGtkEntry, `visible`: guint)
+proc overwrite_mode*(a: var TGtkEntry): guint
+proc set_overwrite_mode*(a: var TGtkEntry, `overwrite_mode`: guint)
+proc in_drag*(a: var TGtkEntry): guint
+proc set_in_drag*(a: var TGtkEntry, `in_drag`: guint)
+proc cache_includes_preedit*(a: var TGtkEntry): guint
+proc set_cache_includes_preedit*(a: var TGtkEntry,
+                                 `cache_includes_preedit`: guint)
+proc need_im_reset*(a: var TGtkEntry): guint
+proc set_need_im_reset*(a: var TGtkEntry, `need_im_reset`: guint)
+proc has_frame*(a: var TGtkEntry): guint
+proc set_has_frame*(a: var TGtkEntry, `has_frame`: guint)
+proc activates_default*(a: var TGtkEntry): guint
+proc set_activates_default*(a: var TGtkEntry, `activates_default`: guint)
+proc cursor_visible*(a: var TGtkEntry): guint
+proc set_cursor_visible*(a: var TGtkEntry, `cursor_visible`: guint)
+proc in_click*(a: var TGtkEntry): guint
+proc set_in_click*(a: var TGtkEntry, `in_click`: guint)
+proc is_cell_renderer*(a: var TGtkEntry): guint
+proc set_is_cell_renderer*(a: var TGtkEntry, `is_cell_renderer`: guint)
+proc editing_canceled*(a: var TGtkEntry): guint
+proc set_editing_canceled*(a: var TGtkEntry, `editing_canceled`: guint)
+proc mouse_cursor_obscured*(a: var TGtkEntry): guint
+proc set_mouse_cursor_obscured*(a: var TGtkEntry, `mouse_cursor_obscured`: guint)
+proc gtk_entry_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_entry_get_type".}
+proc gtk_entry_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_entry_new".}
+proc gtk_entry_set_visibility*(entry: PGtkEntry, visible: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_set_visibility".}
+proc gtk_entry_get_visibility*(entry: PGtkEntry): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_visibility".}
+proc gtk_entry_set_invisible_char*(entry: PGtkEntry, ch: gunichar){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_set_invisible_char".}
+proc gtk_entry_get_invisible_char*(entry: PGtkEntry): gunichar{.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_invisible_char".}
+proc gtk_entry_set_has_frame*(entry: PGtkEntry, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_set_has_frame".}
+proc gtk_entry_get_has_frame*(entry: PGtkEntry): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_has_frame".}
+proc gtk_entry_set_max_length*(entry: PGtkEntry, max: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_set_max_length".}
+proc gtk_entry_get_max_length*(entry: PGtkEntry): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_entry_get_max_length".}
+proc gtk_entry_set_activates_default*(entry: PGtkEntry, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_entry_set_activates_default".}
+proc gtk_entry_get_activates_default*(entry: PGtkEntry): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_activates_default".}
+proc gtk_entry_set_width_chars*(entry: PGtkEntry, n_chars: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_set_width_chars".}
+proc gtk_entry_get_width_chars*(entry: PGtkEntry): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_entry_get_width_chars".}
+proc gtk_entry_set_text*(entry: PGtkEntry, text: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_entry_set_text".}
+proc gtk_entry_get_text*(entry: PGtkEntry): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_entry_get_text".}
+proc gtk_entry_get_layout*(entry: PGtkEntry): PPangoLayout{.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_layout".}
+proc gtk_entry_get_layout_offsets*(entry: PGtkEntry, x: Pgint, y: Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_entry_get_layout_offsets".}
+const
+  GTK_ANCHOR_CENTER* = 0
+  GTK_ANCHOR_NORTH* = 1
+  GTK_ANCHOR_NORTH_WEST* = 2
+  GTK_ANCHOR_NORTH_EAST* = 3
+  GTK_ANCHOR_SOUTH* = 4
+  GTK_ANCHOR_SOUTH_WEST* = 5
+  GTK_ANCHOR_SOUTH_EAST* = 6
+  GTK_ANCHOR_WEST* = 7
+  GTK_ANCHOR_EAST* = 8
+  GTK_ANCHOR_N* = GTK_ANCHOR_NORTH
+  GTK_ANCHOR_NW* = GTK_ANCHOR_NORTH_WEST
+  GTK_ANCHOR_NE* = GTK_ANCHOR_NORTH_EAST
+  GTK_ANCHOR_S* = GTK_ANCHOR_SOUTH
+  GTK_ANCHOR_SW* = GTK_ANCHOR_SOUTH_WEST
+  GTK_ANCHOR_SE* = GTK_ANCHOR_SOUTH_EAST
+  GTK_ANCHOR_W* = GTK_ANCHOR_WEST
+  GTK_ANCHOR_E* = GTK_ANCHOR_EAST
+  GTK_ARROW_UP* = 0
+  GTK_ARROW_DOWN* = 1
+  GTK_ARROW_LEFT* = 2
+  GTK_ARROW_RIGHT* = 3
+  GTK_EXPAND* = 1 shl 0
+  GTK_SHRINK* = 1 shl 1
+  GTK_FILL* = 1 shl 2
+  GTK_BUTTONBOX_DEFAULT_STYLE* = 0
+  GTK_BUTTONBOX_SPREAD* = 1
+  GTK_BUTTONBOX_EDGE* = 2
+  GTK_BUTTONBOX_START* = 3
+  GTK_BUTTONBOX_END* = 4
+  GTK_CURVE_TYPE_LINEAR* = 0
+  GTK_CURVE_TYPE_SPLINE* = 1
+  GTK_CURVE_TYPE_FREE* = 2
+  GTK_DELETE_CHARS* = 0
+  GTK_DELETE_WORD_ENDS* = 1
+  GTK_DELETE_WORDS* = 2
+  GTK_DELETE_DISPLAY_LINES* = 3
+  GTK_DELETE_DISPLAY_LINE_ENDS* = 4
+  GTK_DELETE_PARAGRAPH_ENDS* = 5
+  GTK_DELETE_PARAGRAPHS* = 6
+  GTK_DELETE_WHITESPACE* = 7
+  GTK_DIR_TAB_FORWARD* = 0
+  GTK_DIR_TAB_BACKWARD* = 1
+  GTK_DIR_UP* = 2
+  GTK_DIR_DOWN* = 3
+  GTK_DIR_LEFT* = 4
+  GTK_DIR_RIGHT* = 5
+  GTK_EXPANDER_COLLAPSED* = 0
+  GTK_EXPANDER_SEMI_COLLAPSED* = 1
+  GTK_EXPANDER_SEMI_EXPANDED* = 2
+  GTK_EXPANDER_EXPANDED* = 3
+  GTK_ICON_SIZE_INVALID* = 0
+  GTK_ICON_SIZE_MENU* = 1
+  GTK_ICON_SIZE_SMALL_TOOLBAR* = 2
+  GTK_ICON_SIZE_LARGE_TOOLBAR* = 3
+  GTK_ICON_SIZE_BUTTON* = 4
+  GTK_ICON_SIZE_DND* = 5
+  GTK_ICON_SIZE_DIALOG* = 6
+  GTK_TEXT_DIR_NONE* = 0
+  GTK_TEXT_DIR_LTR* = 1
+  GTK_TEXT_DIR_RTL* = 2
+  GTK_JUSTIFY_LEFT* = 0
+  GTK_JUSTIFY_RIGHT* = 1
+  GTK_JUSTIFY_CENTER* = 2
+  GTK_JUSTIFY_FILL* = 3
+  GTK_MENU_DIR_PARENT* = 0
+  GTK_MENU_DIR_CHILD* = 1
+  GTK_MENU_DIR_NEXT* = 2
+  GTK_MENU_DIR_PREV* = 3
+  GTK_PIXELS* = 0
+  GTK_INCHES* = 1
+  GTK_CENTIMETERS* = 2
+  GTK_MOVEMENT_LOGICAL_POSITIONS* = 0
+  GTK_MOVEMENT_VISUAL_POSITIONS* = 1
+  GTK_MOVEMENT_WORDS* = 2
+  GTK_MOVEMENT_DISPLAY_LINES* = 3
+  GTK_MOVEMENT_DISPLAY_LINE_ENDS* = 4
+  GTK_MOVEMENT_PARAGRAPHS* = 5
+  GTK_MOVEMENT_PARAGRAPH_ENDS* = 6
+  GTK_MOVEMENT_PAGES* = 7
+  GTK_MOVEMENT_BUFFER_ENDS* = 8
+  GTK_ORIENTATION_HORIZONTAL* = 0
+  GTK_ORIENTATION_VERTICAL* = 1
+  GTK_CORNER_TOP_LEFT* = 0
+  GTK_CORNER_BOTTOM_LEFT* = 1
+  GTK_CORNER_TOP_RIGHT* = 2
+  GTK_CORNER_BOTTOM_RIGHT* = 3
+  GTK_PACK_START* = 0
+  GTK_PACK_END* = 1
+  GTK_PATH_PRIO_LOWEST* = 0
+  GTK_PATH_PRIO_GTK* = 4
+  GTK_PATH_PRIO_APPLICATION* = 8
+  GTK_PATH_PRIO_THEME* = 10
+  GTK_PATH_PRIO_RC* = 12
+  GTK_PATH_PRIO_HIGHEST* = 15
+  GTK_PATH_WIDGET* = 0
+  GTK_PATH_WIDGET_CLASS* = 1
+  GTK_PATH_CLASS* = 2
+  GTK_POLICY_ALWAYS* = 0
+  GTK_POLICY_AUTOMATIC* = 1
+  GTK_POLICY_NEVER* = 2
+  GTK_POS_LEFT* = 0
+  GTK_POS_RIGHT* = 1
+  GTK_POS_TOP* = 2
+  GTK_POS_BOTTOM* = 3
+  GTK_PREVIEW_COLOR* = 0
+  GTK_PREVIEW_GRAYSCALE* = 1
+  GTK_RELIEF_NORMAL* = 0
+  GTK_RELIEF_HALF* = 1
+  GTK_RELIEF_NONE* = 2
+  GTK_RESIZE_PARENT* = 0
+  GTK_RESIZE_QUEUE* = 1
+  GTK_RESIZE_IMMEDIATE* = 2
+  GTK_SCROLL_NONE* = 0
+  GTK_SCROLL_JUMP* = 1
+  GTK_SCROLL_STEP_BACKWARD* = 2
+  GTK_SCROLL_STEP_FORWARD* = 3
+  GTK_SCROLL_PAGE_BACKWARD* = 4
+  GTK_SCROLL_PAGE_FORWARD* = 5
+  GTK_SCROLL_STEP_UP* = 6
+  GTK_SCROLL_STEP_DOWN* = 7
+  GTK_SCROLL_PAGE_UP* = 8
+  GTK_SCROLL_PAGE_DOWN* = 9
+  GTK_SCROLL_STEP_LEFT* = 10
+  GTK_SCROLL_STEP_RIGHT* = 11
+  GTK_SCROLL_PAGE_LEFT* = 12
+  GTK_SCROLL_PAGE_RIGHT* = 13
+  GTK_SCROLL_START* = 14
+  GTK_SCROLL_END* = 15
+  GTK_SELECTION_NONE* = 0
+  GTK_SELECTION_SINGLE* = 1
+  GTK_SELECTION_BROWSE* = 2
+  GTK_SELECTION_MULTIPLE* = 3
+  GTK_SELECTION_EXTENDED* = GTK_SELECTION_MULTIPLE
+  GTK_SHADOW_NONE* = 0
+  GTK_SHADOW_IN* = 1
+  GTK_SHADOW_OUT* = 2
+  GTK_SHADOW_ETCHED_IN* = 3
+  GTK_SHADOW_ETCHED_OUT* = 4
+  GTK_STATE_NORMAL* = 0
+  GTK_STATE_ACTIVE* = 1
+  GTK_STATE_PRELIGHT* = 2
+  GTK_STATE_SELECTED* = 3
+  GTK_STATE_INSENSITIVE* = 4
+  GTK_DIRECTION_LEFT* = 0
+  GTK_DIRECTION_RIGHT* = 1
+  GTK_TOP_BOTTOM* = 0
+  GTK_LEFT_RIGHT* = 1
+  GTK_TOOLBAR_ICONS* = 0
+  GTK_TOOLBAR_TEXT* = 1
+  GTK_TOOLBAR_BOTH* = 2
+  GTK_TOOLBAR_BOTH_HORIZ* = 3
+  GTK_UPDATE_CONTINUOUS* = 0
+  GTK_UPDATE_DISCONTINUOUS* = 1
+  GTK_UPDATE_DELAYED* = 2
+  GTK_VISIBILITY_NONE* = 0
+  GTK_VISIBILITY_PARTIAL* = 1
+  GTK_VISIBILITY_FULL* = 2
+  GTK_WIN_POS_NONE* = 0
+  GTK_WIN_POS_CENTER* = 1
+  GTK_WIN_POS_MOUSE* = 2
+  GTK_WIN_POS_CENTER_ALWAYS* = 3
+  GTK_WIN_POS_CENTER_ON_PARENT* = 4
+  GTK_WINDOW_TOPLEVEL* = 0
+  GTK_WINDOW_POPUP* = 1
+  GTK_WRAP_NONE* = 0
+  GTK_WRAP_CHAR* = 1
+  GTK_WRAP_WORD* = 2
+  GTK_SORT_ASCENDING* = 0
+  GTK_SORT_DESCENDING* = 1
+
+proc GTK_TYPE_EVENT_BOX*(): GType
+proc GTK_EVENT_BOX*(obj: pointer): PGtkEventBox
+proc GTK_EVENT_BOX_CLASS*(klass: pointer): PGtkEventBoxClass
+proc GTK_IS_EVENT_BOX*(obj: pointer): bool
+proc GTK_IS_EVENT_BOX_CLASS*(klass: pointer): bool
+proc GTK_EVENT_BOX_GET_CLASS*(obj: pointer): PGtkEventBoxClass
+proc gtk_event_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_event_box_get_type".}
+proc gtk_event_box_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_event_box_new".}
+const
+  FNM_PATHNAME* = 1 shl 0
+  FNM_NOESCAPE* = 1 shl 1
+  FNM_PERIOD* = 1 shl 2
+
+const
+  FNM_FILE_NAME* = FNM_PATHNAME
+  FNM_LEADING_DIR* = 1 shl 3
+  FNM_CASEFOLD* = 1 shl 4
+
+const
+  FNM_NOMATCH* = 1
+
+proc fnmatch*(`pattern`: char, `string`: char, `flags`: gint): gint{.cdecl,
+    dynlib: gtklib, importc: "fnmatch".}
+proc GTK_TYPE_FILE_SELECTION*(): GType
+proc GTK_FILE_SELECTION*(obj: pointer): PGtkFileSelection
+proc GTK_FILE_SELECTION_CLASS*(klass: pointer): PGtkFileSelectionClass
+proc GTK_IS_FILE_SELECTION*(obj: pointer): bool
+proc GTK_IS_FILE_SELECTION_CLASS*(klass: pointer): bool
+proc GTK_FILE_SELECTION_GET_CLASS*(obj: pointer): PGtkFileSelectionClass
+proc gtk_file_selection_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_file_selection_get_type".}
+proc gtk_file_selection_new*(title: cstring): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_file_selection_new".}
+proc gtk_file_selection_set_filename*(filesel: PGtkFileSelection,
+                                      filename: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_file_selection_set_filename".}
+proc gtk_file_selection_get_filename*(filesel: PGtkFileSelection): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_selection_get_filename".}
+proc gtk_file_selection_complete*(filesel: PGtkFileSelection, pattern: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_file_selection_complete".}
+proc gtk_file_selection_show_fileop_buttons*(filesel: PGtkFileSelection){.cdecl,
+    dynlib: gtklib, importc: "gtk_file_selection_show_fileop_buttons".}
+proc gtk_file_selection_hide_fileop_buttons*(filesel: PGtkFileSelection){.cdecl,
+    dynlib: gtklib, importc: "gtk_file_selection_hide_fileop_buttons".}
+proc gtk_file_selection_get_selections*(filesel: PGtkFileSelection): PPgchar{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_selection_get_selections".}
+proc gtk_file_selection_set_select_multiple*(filesel: PGtkFileSelection,
+    select_multiple: gboolean){.cdecl, dynlib: gtklib, importc: "gtk_file_selection_set_select_multiple".}
+proc gtk_file_selection_get_select_multiple*(filesel: PGtkFileSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_selection_get_select_multiple".}
+proc GTK_TYPE_FIXED*(): GType
+proc GTK_FIXED*(obj: pointer): PGtkFixed
+proc GTK_FIXED_CLASS*(klass: pointer): PGtkFixedClass
+proc GTK_IS_FIXED*(obj: pointer): bool
+proc GTK_IS_FIXED_CLASS*(klass: pointer): bool
+proc GTK_FIXED_GET_CLASS*(obj: pointer): PGtkFixedClass
+proc gtk_fixed_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_fixed_get_type".}
+proc gtk_fixed_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_fixed_new".}
+proc gtk_fixed_put*(fixed: PGtkFixed, widget: PGtkWidget, x: gint, y: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_fixed_put".}
+proc gtk_fixed_move*(fixed: PGtkFixed, widget: PGtkWidget, x: gint, y: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_fixed_move".}
+proc gtk_fixed_set_has_window*(fixed: PGtkFixed, has_window: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_fixed_set_has_window".}
+proc gtk_fixed_get_has_window*(fixed: PGtkFixed): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_fixed_get_has_window".}
+proc GTK_TYPE_FONT_SELECTION*(): GType
+proc GTK_FONT_SELECTION*(obj: pointer): PGtkFontSelection
+proc GTK_FONT_SELECTION_CLASS*(klass: pointer): PGtkFontSelectionClass
+proc GTK_IS_FONT_SELECTION*(obj: pointer): bool
+proc GTK_IS_FONT_SELECTION_CLASS*(klass: pointer): bool
+proc GTK_FONT_SELECTION_GET_CLASS*(obj: pointer): PGtkFontSelectionClass
+proc GTK_TYPE_FONT_SELECTION_DIALOG*(): GType
+proc GTK_FONT_SELECTION_DIALOG*(obj: pointer): PGtkFontSelectionDialog
+proc GTK_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PGtkFontSelectionDialogClass
+proc GTK_IS_FONT_SELECTION_DIALOG*(obj: pointer): bool
+proc GTK_IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool
+proc GTK_FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PGtkFontSelectionDialogClass
+proc gtk_font_selection_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_font_selection_get_type".}
+proc gtk_font_selection_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_font_selection_new".}
+proc gtk_font_selection_get_font_name*(fontsel: PGtkFontSelection): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_font_selection_get_font_name".}
+proc gtk_font_selection_set_font_name*(fontsel: PGtkFontSelection,
+                                       fontname: cstring): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_font_selection_set_font_name".}
+proc gtk_font_selection_get_preview_text*(fontsel: PGtkFontSelection): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_font_selection_get_preview_text".}
+proc gtk_font_selection_set_preview_text*(fontsel: PGtkFontSelection,
+    text: cstring){.cdecl, dynlib: gtklib,
+                   importc: "gtk_font_selection_set_preview_text".}
+proc gtk_font_selection_dialog_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_font_selection_dialog_get_type".}
+proc gtk_font_selection_dialog_new*(title: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_font_selection_dialog_new".}
+proc gtk_font_selection_dialog_get_font_name*(fsd: PGtkFontSelectionDialog): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_font_selection_dialog_get_font_name".}
+proc gtk_font_selection_dialog_set_font_name*(fsd: PGtkFontSelectionDialog,
+    fontname: cstring): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_font_selection_dialog_set_font_name".}
+proc gtk_font_selection_dialog_get_preview_text*(fsd: PGtkFontSelectionDialog): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_font_selection_dialog_get_preview_text".}
+proc gtk_font_selection_dialog_set_preview_text*(fsd: PGtkFontSelectionDialog,
+    text: cstring){.cdecl, dynlib: gtklib,
+                   importc: "gtk_font_selection_dialog_set_preview_text".}
+proc GTK_TYPE_GAMMA_CURVE*(): GType
+proc GTK_GAMMA_CURVE*(obj: pointer): PGtkGammaCurve
+proc GTK_GAMMA_CURVE_CLASS*(klass: pointer): PGtkGammaCurveClass
+proc GTK_IS_GAMMA_CURVE*(obj: pointer): bool
+proc GTK_IS_GAMMA_CURVE_CLASS*(klass: pointer): bool
+proc GTK_GAMMA_CURVE_GET_CLASS*(obj: pointer): PGtkGammaCurveClass
+proc gtk_gamma_curve_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_gamma_curve_get_type".}
+proc gtk_gamma_curve_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_gamma_curve_new".}
+proc gtk_gc_get*(depth: gint, colormap: PGdkColormap, values: PGdkGCValues,
+                 values_mask: TGdkGCValuesMask): PGdkGC{.cdecl, dynlib: gtklib,
+    importc: "gtk_gc_get".}
+proc gtk_gc_release*(gc: PGdkGC){.cdecl, dynlib: gtklib,
+                                  importc: "gtk_gc_release".}
+const
+  bm_TGtkHandleBox_handle_position* = 0x00000003
+  bp_TGtkHandleBox_handle_position* = 0
+  bm_TGtkHandleBox_float_window_mapped* = 0x00000004
+  bp_TGtkHandleBox_float_window_mapped* = 2
+  bm_TGtkHandleBox_child_detached* = 0x00000008
+  bp_TGtkHandleBox_child_detached* = 3
+  bm_TGtkHandleBox_in_drag* = 0x00000010
+  bp_TGtkHandleBox_in_drag* = 4
+  bm_TGtkHandleBox_shrink_on_detach* = 0x00000020
+  bp_TGtkHandleBox_shrink_on_detach* = 5
+  bm_TGtkHandleBox_snap_edge* = 0x000001C0
+  bp_TGtkHandleBox_snap_edge* = 6
+
+proc GTK_TYPE_HANDLE_BOX*(): GType
+proc GTK_HANDLE_BOX*(obj: pointer): PGtkHandleBox
+proc GTK_HANDLE_BOX_CLASS*(klass: pointer): PGtkHandleBoxClass
+proc GTK_IS_HANDLE_BOX*(obj: pointer): bool
+proc GTK_IS_HANDLE_BOX_CLASS*(klass: pointer): bool
+proc GTK_HANDLE_BOX_GET_CLASS*(obj: pointer): PGtkHandleBoxClass
+proc handle_position*(a: var TGtkHandleBox): guint
+proc set_handle_position*(a: var TGtkHandleBox, `handle_position`: guint)
+proc float_window_mapped*(a: var TGtkHandleBox): guint
+proc set_float_window_mapped*(a: var TGtkHandleBox, `float_window_mapped`: guint)
+proc child_detached*(a: var TGtkHandleBox): guint
+proc set_child_detached*(a: var TGtkHandleBox, `child_detached`: guint)
+proc in_drag*(a: var TGtkHandleBox): guint
+proc set_in_drag*(a: var TGtkHandleBox, `in_drag`: guint)
+proc shrink_on_detach*(a: var TGtkHandleBox): guint
+proc set_shrink_on_detach*(a: var TGtkHandleBox, `shrink_on_detach`: guint)
+proc snap_edge*(a: var TGtkHandleBox): gint
+proc set_snap_edge*(a: var TGtkHandleBox, `snap_edge`: gint)
+proc gtk_handle_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_handle_box_get_type".}
+proc gtk_handle_box_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_handle_box_new".}
+proc gtk_handle_box_set_shadow_type*(handle_box: PGtkHandleBox,
+                                     thetype: TGtkShadowType){.cdecl,
+    dynlib: gtklib, importc: "gtk_handle_box_set_shadow_type".}
+proc gtk_handle_box_get_shadow_type*(handle_box: PGtkHandleBox): TGtkShadowType{.
+    cdecl, dynlib: gtklib, importc: "gtk_handle_box_get_shadow_type".}
+proc gtk_handle_box_set_handle_position*(handle_box: PGtkHandleBox,
+    position: TGtkPositionType){.cdecl, dynlib: gtklib,
+                                 importc: "gtk_handle_box_set_handle_position".}
+proc gtk_handle_box_get_handle_position*(handle_box: PGtkHandleBox): TGtkPositionType{.
+    cdecl, dynlib: gtklib, importc: "gtk_handle_box_get_handle_position".}
+proc gtk_handle_box_set_snap_edge*(handle_box: PGtkHandleBox,
+                                   edge: TGtkPositionType){.cdecl,
+    dynlib: gtklib, importc: "gtk_handle_box_set_snap_edge".}
+proc gtk_handle_box_get_snap_edge*(handle_box: PGtkHandleBox): TGtkPositionType{.
+    cdecl, dynlib: gtklib, importc: "gtk_handle_box_get_snap_edge".}
+const
+  bm_TGtkPaned_position_set* = 0x00000001
+  bp_TGtkPaned_position_set* = 0
+  bm_TGtkPaned_in_drag* = 0x00000002
+  bp_TGtkPaned_in_drag* = 1
+  bm_TGtkPaned_child1_shrink* = 0x00000004
+  bp_TGtkPaned_child1_shrink* = 2
+  bm_TGtkPaned_child1_resize* = 0x00000008
+  bp_TGtkPaned_child1_resize* = 3
+  bm_TGtkPaned_child2_shrink* = 0x00000010
+  bp_TGtkPaned_child2_shrink* = 4
+  bm_TGtkPaned_child2_resize* = 0x00000020
+  bp_TGtkPaned_child2_resize* = 5
+  bm_TGtkPaned_orientation* = 0x00000040
+  bp_TGtkPaned_orientation* = 6
+  bm_TGtkPaned_in_recursion* = 0x00000080
+  bp_TGtkPaned_in_recursion* = 7
+  bm_TGtkPaned_handle_prelit* = 0x00000100
+  bp_TGtkPaned_handle_prelit* = 8
+
+proc GTK_TYPE_PANED*(): GType
+proc GTK_PANED*(obj: pointer): PGtkPaned
+proc GTK_PANED_CLASS*(klass: pointer): PGtkPanedClass
+proc GTK_IS_PANED*(obj: pointer): bool
+proc GTK_IS_PANED_CLASS*(klass: pointer): bool
+proc GTK_PANED_GET_CLASS*(obj: pointer): PGtkPanedClass
+proc position_set*(a: var TGtkPaned): guint
+proc set_position_set*(a: var TGtkPaned, `position_set`: guint)
+proc in_drag*(a: var TGtkPaned): guint
+proc set_in_drag*(a: var TGtkPaned, `in_drag`: guint)
+proc child1_shrink*(a: var TGtkPaned): guint
+proc set_child1_shrink*(a: var TGtkPaned, `child1_shrink`: guint)
+proc child1_resize*(a: var TGtkPaned): guint
+proc set_child1_resize*(a: var TGtkPaned, `child1_resize`: guint)
+proc child2_shrink*(a: var TGtkPaned): guint
+proc set_child2_shrink*(a: var TGtkPaned, `child2_shrink`: guint)
+proc child2_resize*(a: var TGtkPaned): guint
+proc set_child2_resize*(a: var TGtkPaned, `child2_resize`: guint)
+proc orientation*(a: var TGtkPaned): guint
+proc set_orientation*(a: var TGtkPaned, `orientation`: guint)
+proc in_recursion*(a: var TGtkPaned): guint
+proc set_in_recursion*(a: var TGtkPaned, `in_recursion`: guint)
+proc handle_prelit*(a: var TGtkPaned): guint
+proc set_handle_prelit*(a: var TGtkPaned, `handle_prelit`: guint)
+proc gtk_paned_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_paned_get_type".}
+proc gtk_paned_add1*(paned: PGtkPaned, child: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_paned_add1".}
+proc gtk_paned_add2*(paned: PGtkPaned, child: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_paned_add2".}
+proc gtk_paned_pack1*(paned: PGtkPaned, child: PGtkWidget, resize: gboolean,
+                      shrink: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_paned_pack1".}
+proc gtk_paned_pack2*(paned: PGtkPaned, child: PGtkWidget, resize: gboolean,
+                      shrink: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_paned_pack2".}
+proc gtk_paned_get_position*(paned: PGtkPaned): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_paned_get_position".}
+proc gtk_paned_set_position*(paned: PGtkPaned, position: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paned_set_position".}
+proc gtk_paned_compute_position*(paned: PGtkPaned, allocation: gint,
+                                 child1_req: gint, child2_req: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paned_compute_position".}
+proc GTK_TYPE_HBUTTON_BOX*(): GType
+proc GTK_HBUTTON_BOX*(obj: pointer): PGtkHButtonBox
+proc GTK_HBUTTON_BOX_CLASS*(klass: pointer): PGtkHButtonBoxClass
+proc GTK_IS_HBUTTON_BOX*(obj: pointer): bool
+proc GTK_IS_HBUTTON_BOX_CLASS*(klass: pointer): bool
+proc GTK_HBUTTON_BOX_GET_CLASS*(obj: pointer): PGtkHButtonBoxClass
+proc gtk_hbutton_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_hbutton_box_get_type".}
+proc gtk_hbutton_box_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_hbutton_box_new".}
+proc GTK_TYPE_HPANED*(): GType
+proc GTK_HPANED*(obj: pointer): PGtkHPaned
+proc GTK_HPANED_CLASS*(klass: pointer): PGtkHPanedClass
+proc GTK_IS_HPANED*(obj: pointer): bool
+proc GTK_IS_HPANED_CLASS*(klass: pointer): bool
+proc GTK_HPANED_GET_CLASS*(obj: pointer): PGtkHPanedClass
+proc gtk_hpaned_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_hpaned_get_type".}
+proc gtk_hpaned_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_hpaned_new".}
+proc GTK_TYPE_RULER*(): GType
+proc GTK_RULER*(obj: pointer): PGtkRuler
+proc GTK_RULER_CLASS*(klass: pointer): PGtkRulerClass
+proc GTK_IS_RULER*(obj: pointer): bool
+proc GTK_IS_RULER_CLASS*(klass: pointer): bool
+proc GTK_RULER_GET_CLASS*(obj: pointer): PGtkRulerClass
+proc gtk_ruler_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_ruler_get_type".}
+proc gtk_ruler_set_metric*(ruler: PGtkRuler, metric: TGtkMetricType){.cdecl,
+    dynlib: gtklib, importc: "gtk_ruler_set_metric".}
+proc gtk_ruler_set_range*(ruler: PGtkRuler, lower: gdouble, upper: gdouble,
+                          position: gdouble, max_size: gdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_ruler_set_range".}
+proc gtk_ruler_draw_ticks*(ruler: PGtkRuler){.cdecl, dynlib: gtklib,
+    importc: "gtk_ruler_draw_ticks".}
+proc gtk_ruler_draw_pos*(ruler: PGtkRuler){.cdecl, dynlib: gtklib,
+    importc: "gtk_ruler_draw_pos".}
+proc gtk_ruler_get_metric*(ruler: PGtkRuler): TGtkMetricType{.cdecl,
+    dynlib: gtklib, importc: "gtk_ruler_get_metric".}
+proc gtk_ruler_get_range*(ruler: PGtkRuler, lower: Pgdouble, upper: Pgdouble,
+                          position: Pgdouble, max_size: Pgdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_ruler_get_range".}
+proc GTK_TYPE_HRULER*(): GType
+proc GTK_HRULER*(obj: pointer): PGtkHRuler
+proc GTK_HRULER_CLASS*(klass: pointer): PGtkHRulerClass
+proc GTK_IS_HRULER*(obj: pointer): bool
+proc GTK_IS_HRULER_CLASS*(klass: pointer): bool
+proc GTK_HRULER_GET_CLASS*(obj: pointer): PGtkHRulerClass
+proc gtk_hruler_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_hruler_get_type".}
+proc gtk_hruler_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_hruler_new".}
+proc GTK_TYPE_SETTINGS*(): GType
+proc GTK_SETTINGS*(obj: pointer): PGtkSettings
+proc GTK_SETTINGS_CLASS*(klass: pointer): PGtkSettingsClass
+proc GTK_IS_SETTINGS*(obj: pointer): bool
+proc GTK_IS_SETTINGS_CLASS*(klass: pointer): bool
+proc GTK_SETTINGS_GET_CLASS*(obj: pointer): PGtkSettingsClass
+proc gtk_settings_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_settings_get_type".}
+proc gtk_settings_get_for_screen*(screen: PGdkScreen): PGtkSettings{.cdecl,
+    dynlib: gtklib, importc: "gtk_settings_get_for_screen".}
+proc gtk_settings_install_property*(pspec: PGParamSpec){.cdecl, dynlib: gtklib,
+    importc: "gtk_settings_install_property".}
+proc gtk_settings_install_property_parser*(pspec: PGParamSpec,
+    parser: TGtkRcPropertyParser){.cdecl, dynlib: gtklib, importc: "gtk_settings_install_property_parser".}
+proc gtk_rc_property_parse_color*(pspec: PGParamSpec, gstring: PGString,
+                                  property_value: PGValue): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_property_parse_color".}
+proc gtk_rc_property_parse_enum*(pspec: PGParamSpec, gstring: PGString,
+                                 property_value: PGValue): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_property_parse_enum".}
+proc gtk_rc_property_parse_flags*(pspec: PGParamSpec, gstring: PGString,
+                                  property_value: PGValue): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_property_parse_flags".}
+proc gtk_rc_property_parse_requisition*(pspec: PGParamSpec, gstring: PGString,
+                                        property_value: PGValue): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_rc_property_parse_requisition".}
+proc gtk_rc_property_parse_border*(pspec: PGParamSpec, gstring: PGString,
+                                   property_value: PGValue): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_property_parse_border".}
+proc gtk_settings_set_property_value*(settings: PGtkSettings, name: cstring,
+                                      svalue: PGtkSettingsValue){.cdecl,
+    dynlib: gtklib, importc: "gtk_settings_set_property_value".}
+proc gtk_settings_set_string_property*(settings: PGtkSettings, name: cstring,
+                                       v_string: cstring, origin: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_settings_set_string_property".}
+proc gtk_settings_set_long_property*(settings: PGtkSettings, name: cstring,
+                                     v_long: glong, origin: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_settings_set_long_property".}
+proc gtk_settings_set_double_property*(settings: PGtkSettings, name: cstring,
+                                       v_double: gdouble, origin: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_settings_set_double_property".}
+proc gtk_settings_handle_event*(event: PGdkEventSetting){.cdecl,
+    dynlib: gtklib, importc: "_gtk_settings_handle_event".}
+proc gtk_rc_property_parser_from_type*(thetype: GType): TGtkRcPropertyParser{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rc_property_parser_from_type".}
+proc gtk_settings_parse_convert*(parser: TGtkRcPropertyParser,
+                                   src_value: PGValue, pspec: PGParamSpec,
+                                   dest_value: PGValue): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_settings_parse_convert".}
+const
+  GTK_RC_FG* = 1 shl 0
+  GTK_RC_BG* = 1 shl 1
+  GTK_RC_TEXT* = 1 shl 2
+  GTK_RC_BASE* = 1 shl 3
+  bm_TGtkRcStyle_engine_specified* = 0x00000001
+  bp_TGtkRcStyle_engine_specified* = 0
+
+proc GTK_TYPE_RC_STYLE*(): GType
+proc GTK_RC_STYLE_get*(anObject: pointer): PGtkRcStyle
+proc GTK_RC_STYLE_CLASS*(klass: pointer): PGtkRcStyleClass
+proc GTK_IS_RC_STYLE*(anObject: pointer): bool
+proc GTK_IS_RC_STYLE_CLASS*(klass: pointer): bool
+proc GTK_RC_STYLE_GET_CLASS*(obj: pointer): PGtkRcStyleClass
+proc engine_specified*(a: var TGtkRcStyle): guint
+proc set_engine_specified*(a: var TGtkRcStyle, `engine_specified`: guint)
+proc gtk_rc_init*(){.cdecl, dynlib: gtklib, importc: "_gtk_rc_init".}
+proc gtk_rc_add_default_file*(filename: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_add_default_file".}
+proc gtk_rc_set_default_files*(filenames: PPgchar){.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_set_default_files".}
+proc gtk_rc_get_default_files*(): PPgchar{.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_get_default_files".}
+proc gtk_rc_get_style*(widget: PGtkWidget): PGtkStyle{.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_get_style".}
+proc gtk_rc_get_style_by_paths*(settings: PGtkSettings, widget_path: cstring,
+                                class_path: cstring, thetype: GType): PGtkStyle{.
+    cdecl, dynlib: gtklib, importc: "gtk_rc_get_style_by_paths".}
+proc gtk_rc_reparse_all_for_settings*(settings: PGtkSettings,
+                                      force_load: gboolean): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_reparse_all_for_settings".}
+proc gtk_rc_find_pixmap_in_path*(settings: PGtkSettings, scanner: PGScanner,
+                                 pixmap_file: cstring): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_find_pixmap_in_path".}
+proc gtk_rc_parse*(filename: cstring){.cdecl, dynlib: gtklib,
+                                      importc: "gtk_rc_parse".}
+proc gtk_rc_parse_string*(rc_string: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_parse_string".}
+proc gtk_rc_reparse_all*(): gboolean{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_rc_reparse_all".}
+proc gtk_rc_style_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_rc_style_get_type".}
+proc gtk_rc_style_new*(): PGtkRcStyle{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_rc_style_new".}
+proc gtk_rc_style_copy*(orig: PGtkRcStyle): PGtkRcStyle{.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_style_copy".}
+proc gtk_rc_style_ref*(rc_style: PGtkRcStyle){.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_style_ref".}
+proc gtk_rc_style_unref*(rc_style: PGtkRcStyle){.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_style_unref".}
+proc gtk_rc_find_module_in_path*(module_file: cstring): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_find_module_in_path".}
+proc gtk_rc_get_theme_dir*(): cstring{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_rc_get_theme_dir".}
+proc gtk_rc_get_module_dir*(): cstring{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_rc_get_module_dir".}
+proc gtk_rc_get_im_module_path*(): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_get_im_module_path".}
+proc gtk_rc_get_im_module_file*(): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_rc_get_im_module_file".}
+proc gtk_rc_scanner_new*(): PGScanner{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_rc_scanner_new".}
+proc gtk_rc_parse_color*(scanner: PGScanner, color: PGdkColor): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_rc_parse_color".}
+proc gtk_rc_parse_state*(scanner: PGScanner, state: PGtkStateType): guint{.
+    cdecl, dynlib: gtklib, importc: "gtk_rc_parse_state".}
+proc gtk_rc_parse_priority*(scanner: PGScanner, priority: PGtkPathPriorityType): guint{.
+    cdecl, dynlib: gtklib, importc: "gtk_rc_parse_priority".}
+proc gtk_rc_style_lookup_rc_property*(rc_style: PGtkRcStyle,
+                                        type_name: TGQuark,
+                                        property_name: TGQuark): PGtkRcProperty{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rc_style_lookup_rc_property".}
+proc gtk_rc_context_get_default_font_name*(settings: PGtkSettings): cstring{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rc_context_get_default_font_name".}
+proc GTK_TYPE_STYLE*(): GType
+proc GTK_STYLE*(anObject: pointer): PGtkStyle
+proc GTK_STYLE_CLASS*(klass: pointer): PGtkStyleClass
+proc GTK_IS_STYLE*(anObject: pointer): bool
+proc GTK_IS_STYLE_CLASS*(klass: pointer): bool
+proc GTK_STYLE_GET_CLASS*(obj: pointer): PGtkStyleClass
+proc GTK_TYPE_BORDER*(): GType
+proc GTK_STYLE_ATTACHED*(style: pointer): bool
+proc gtk_style_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_style_get_type".}
+proc gtk_style_new*(): PGtkStyle{.cdecl, dynlib: gtklib,
+                                  importc: "gtk_style_new".}
+proc gtk_style_copy*(style: PGtkStyle): PGtkStyle{.cdecl, dynlib: gtklib,
+    importc: "gtk_style_copy".}
+proc gtk_style_attach*(style: PGtkStyle, window: PGdkWindow): PGtkStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_style_attach".}
+proc gtk_style_detach*(style: PGtkStyle){.cdecl, dynlib: gtklib,
+    importc: "gtk_style_detach".}
+proc gtk_style_set_background*(style: PGtkStyle, window: PGdkWindow,
+                               state_type: TGtkStateType){.cdecl,
+    dynlib: gtklib, importc: "gtk_style_set_background".}
+proc gtk_style_apply_default_background*(style: PGtkStyle, window: PGdkWindow,
+    set_bg: gboolean, state_type: TGtkStateType, area: PGdkRectangle, x: gint,
+    y: gint, width: gint, height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_style_apply_default_background".}
+proc gtk_style_lookup_icon_set*(style: PGtkStyle, stock_id: cstring): PGtkIconSet{.
+    cdecl, dynlib: gtklib, importc: "gtk_style_lookup_icon_set".}
+proc gtk_style_render_icon*(style: PGtkStyle, source: PGtkIconSource,
+                            direction: TGtkTextDirection, state: TGtkStateType,
+                            size: TGtkIconSize, widget: PGtkWidget,
+                            detail: cstring): PGdkPixbuf{.cdecl, dynlib: gtklib,
+    importc: "gtk_style_render_icon".}
+proc gtk_paint_hline*(style: PGtkStyle, window: PGdkWindow,
+                      state_type: TGtkStateType, area: PGdkRectangle,
+                      widget: PGtkWidget, detail: cstring, x1: gint, x2: gint,
+                      y: gint){.cdecl, dynlib: gtklib,
+                                importc: "gtk_paint_hline".}
+proc gtk_paint_vline*(style: PGtkStyle, window: PGdkWindow,
+                      state_type: TGtkStateType, area: PGdkRectangle,
+                      widget: PGtkWidget, detail: cstring, y1: gint, y2: gint,
+                      x: gint){.cdecl, dynlib: gtklib,
+                                importc: "gtk_paint_vline".}
+proc gtk_paint_shadow*(style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_shadow".}
+proc gtk_paint_polygon*(style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        points: PGdkPoint, npoints: gint, fill: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_paint_polygon".}
+proc gtk_paint_arrow*(style: PGtkStyle, window: PGdkWindow,
+                      state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                      area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                      arrow_type: TGtkArrowType, fill: gboolean, x: gint,
+                      y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_arrow".}
+proc gtk_paint_diamond*(style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_diamond".}
+proc gtk_paint_box*(style: PGtkStyle, window: PGdkWindow,
+                    state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                    area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                    x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_box".}
+proc gtk_paint_flat_box*(style: PGtkStyle, window: PGdkWindow,
+                         state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                         area: PGdkRectangle, widget: PGtkWidget,
+                         detail: cstring, x: gint, y: gint, width: gint,
+                         height: gint){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_paint_flat_box".}
+proc gtk_paint_check*(style: PGtkStyle, window: PGdkWindow,
+                      state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                      area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                      x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_check".}
+proc gtk_paint_option*(style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_option".}
+proc gtk_paint_tab*(style: PGtkStyle, window: PGdkWindow,
+                    state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                    area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                    x: gint, y: gint, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_tab".}
+proc gtk_paint_shadow_gap*(style: PGtkStyle, window: PGdkWindow,
+                           state_type: TGtkStateType,
+                           shadow_type: TGtkShadowType, area: PGdkRectangle,
+                           widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                           width: gint, height: gint,
+                           gap_side: TGtkPositionType, gap_x: gint,
+                           gap_width: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_paint_shadow_gap".}
+proc gtk_paint_box_gap*(style: PGtkStyle, window: PGdkWindow,
+                        state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                        area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                        x: gint, y: gint, width: gint, height: gint,
+                        gap_side: TGtkPositionType, gap_x: gint, gap_width: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_paint_box_gap".}
+proc gtk_paint_extension*(style: PGtkStyle, window: PGdkWindow,
+                          state_type: TGtkStateType,
+                          shadow_type: TGtkShadowType, area: PGdkRectangle,
+                          widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                          width: gint, height: gint, gap_side: TGtkPositionType){.
+    cdecl, dynlib: gtklib, importc: "gtk_paint_extension".}
+proc gtk_paint_focus*(style: PGtkStyle, window: PGdkWindow,
+                      state_type: TGtkStateType, area: PGdkRectangle,
+                      widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                      width: gint, height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_paint_focus".}
+proc gtk_paint_slider*(style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, width: gint, height: gint,
+                       orientation: TGtkOrientation){.cdecl, dynlib: gtklib,
+    importc: "gtk_paint_slider".}
+proc gtk_paint_handle*(style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, shadow_type: TGtkShadowType,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, width: gint, height: gint,
+                       orientation: TGtkOrientation){.cdecl, dynlib: gtklib,
+    importc: "gtk_paint_handle".}
+proc gtk_paint_expander*(style: PGtkStyle, window: PGdkWindow,
+                         state_type: TGtkStateType, area: PGdkRectangle,
+                         widget: PGtkWidget, detail: cstring, x: gint, y: gint,
+                         expander_style: TGtkExpanderStyle){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_expander".}
+proc gtk_paint_layout*(style: PGtkStyle, window: PGdkWindow,
+                       state_type: TGtkStateType, use_text: gboolean,
+                       area: PGdkRectangle, widget: PGtkWidget, detail: cstring,
+                       x: gint, y: gint, layout: PPangoLayout){.cdecl,
+    dynlib: gtklib, importc: "gtk_paint_layout".}
+proc gtk_paint_resize_grip*(style: PGtkStyle, window: PGdkWindow,
+                            state_type: TGtkStateType, area: PGdkRectangle,
+                            widget: PGtkWidget, detail: cstring,
+                            edge: TGdkWindowEdge, x: gint, y: gint, width: gint,
+                            height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_paint_resize_grip".}
+proc gtk_border_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_border_get_type".}
+proc gtk_border_copy*(border: PGtkBorder): PGtkBorder{.cdecl, dynlib: gtklib,
+    importc: "gtk_border_copy".}
+proc gtk_border_free*(border: PGtkBorder){.cdecl, dynlib: gtklib,
+    importc: "gtk_border_free".}
+proc gtk_style_peek_property_value*(style: PGtkStyle, widget_type: GType,
+                                      pspec: PGParamSpec,
+                                      parser: TGtkRcPropertyParser): PGValue{.
+    cdecl, dynlib: gtklib, importc: "_gtk_style_peek_property_value".}
+proc gtk_get_insertion_cursor_gc*(widget: PGtkWidget, is_primary: gboolean): PGdkGC{.
+    cdecl, dynlib: gtklib, importc: "_gtk_get_insertion_cursor_gc".}
+proc gtk_draw_insertion_cursor*(widget: PGtkWidget, drawable: PGdkDrawable,
+                                  gc: PGdkGC, location: PGdkRectangle,
+                                  direction: TGtkTextDirection,
+                                  draw_arrow: gboolean){.cdecl, dynlib: gtklib,
+    importc: "_gtk_draw_insertion_cursor".}
+const
+  bm_TGtkRange_inverted* = 0x00000001
+  bp_TGtkRange_inverted* = 0
+  bm_TGtkRange_flippable* = 0x00000002
+  bp_TGtkRange_flippable* = 1
+  bm_TGtkRange_has_stepper_a* = 0x00000004
+  bp_TGtkRange_has_stepper_a* = 2
+  bm_TGtkRange_has_stepper_b* = 0x00000008
+  bp_TGtkRange_has_stepper_b* = 3
+  bm_TGtkRange_has_stepper_c* = 0x00000010
+  bp_TGtkRange_has_stepper_c* = 4
+  bm_TGtkRange_has_stepper_d* = 0x00000020
+  bp_TGtkRange_has_stepper_d* = 5
+  bm_TGtkRange_need_recalc* = 0x00000040
+  bp_TGtkRange_need_recalc* = 6
+  bm_TGtkRange_slider_size_fixed* = 0x00000080
+  bp_TGtkRange_slider_size_fixed* = 7
+  bm_TGtkRange_trough_click_forward* = 0x00000001
+  bp_TGtkRange_trough_click_forward* = 0
+  bm_TGtkRange_update_pending* = 0x00000002
+  bp_TGtkRange_update_pending* = 1
+
+proc GTK_TYPE_RANGE*(): GType
+proc GTK_RANGE*(obj: pointer): PGtkRange
+proc GTK_RANGE_CLASS*(klass: pointer): PGtkRangeClass
+proc GTK_IS_RANGE*(obj: pointer): bool
+proc GTK_IS_RANGE_CLASS*(klass: pointer): bool
+proc GTK_RANGE_GET_CLASS*(obj: pointer): PGtkRangeClass
+proc inverted*(a: var TGtkRange): guint
+proc set_inverted*(a: var TGtkRange, `inverted`: guint)
+proc flippable*(a: var TGtkRange): guint
+proc set_flippable*(a: var TGtkRange, `flippable`: guint)
+proc has_stepper_a*(a: var TGtkRange): guint
+proc set_has_stepper_a*(a: var TGtkRange, `has_stepper_a`: guint)
+proc has_stepper_b*(a: var TGtkRange): guint
+proc set_has_stepper_b*(a: var TGtkRange, `has_stepper_b`: guint)
+proc has_stepper_c*(a: var TGtkRange): guint
+proc set_has_stepper_c*(a: var TGtkRange, `has_stepper_c`: guint)
+proc has_stepper_d*(a: var TGtkRange): guint
+proc set_has_stepper_d*(a: var TGtkRange, `has_stepper_d`: guint)
+proc need_recalc*(a: var TGtkRange): guint
+proc set_need_recalc*(a: var TGtkRange, `need_recalc`: guint)
+proc slider_size_fixed*(a: var TGtkRange): guint
+proc set_slider_size_fixed*(a: var TGtkRange, `slider_size_fixed`: guint)
+proc trough_click_forward*(a: var TGtkRange): guint
+proc set_trough_click_forward*(a: var TGtkRange, `trough_click_forward`: guint)
+proc update_pending*(a: var TGtkRange): guint
+proc set_update_pending*(a: var TGtkRange, `update_pending`: guint)
+proc gtk_range_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_range_get_type".}
+proc gtk_range_set_update_policy*(range: PGtkRange, policy: TGtkUpdateType){.
+    cdecl, dynlib: gtklib, importc: "gtk_range_set_update_policy".}
+proc gtk_range_get_update_policy*(range: PGtkRange): TGtkUpdateType{.cdecl,
+    dynlib: gtklib, importc: "gtk_range_get_update_policy".}
+proc gtk_range_set_adjustment*(range: PGtkRange, adjustment: PGtkAdjustment){.
+    cdecl, dynlib: gtklib, importc: "gtk_range_set_adjustment".}
+proc gtk_range_get_adjustment*(range: PGtkRange): PGtkAdjustment{.cdecl,
+    dynlib: gtklib, importc: "gtk_range_get_adjustment".}
+proc gtk_range_set_inverted*(range: PGtkRange, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_range_set_inverted".}
+proc gtk_range_get_inverted*(range: PGtkRange): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_range_get_inverted".}
+proc gtk_range_set_increments*(range: PGtkRange, step: gdouble, page: gdouble){.
+    cdecl, dynlib: gtklib, importc: "gtk_range_set_increments".}
+proc gtk_range_set_range*(range: PGtkRange, min: gdouble, max: gdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_range_set_range".}
+proc gtk_range_set_value*(range: PGtkRange, value: gdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_range_set_value".}
+proc gtk_range_get_value*(range: PGtkRange): gdouble{.cdecl, dynlib: gtklib,
+    importc: "gtk_range_get_value".}
+const
+  bm_TGtkScale_draw_value* = 0x00000001
+  bp_TGtkScale_draw_value* = 0
+  bm_TGtkScale_value_pos* = 0x00000006
+  bp_TGtkScale_value_pos* = 1
+
+proc GTK_TYPE_SCALE*(): GType
+proc GTK_SCALE*(obj: pointer): PGtkScale
+proc GTK_SCALE_CLASS*(klass: pointer): PGtkScaleClass
+proc GTK_IS_SCALE*(obj: pointer): bool
+proc GTK_IS_SCALE_CLASS*(klass: pointer): bool
+proc GTK_SCALE_GET_CLASS*(obj: pointer): PGtkScaleClass
+proc draw_value*(a: var TGtkScale): guint
+proc set_draw_value*(a: var TGtkScale, `draw_value`: guint)
+proc value_pos*(a: var TGtkScale): guint
+proc set_value_pos*(a: var TGtkScale, `value_pos`: guint)
+proc gtk_scale_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_scale_get_type".}
+proc gtk_scale_set_digits*(scale: PGtkScale, digits: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_scale_set_digits".}
+proc gtk_scale_get_digits*(scale: PGtkScale): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_scale_get_digits".}
+proc gtk_scale_set_draw_value*(scale: PGtkScale, draw_value: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_scale_set_draw_value".}
+proc gtk_scale_get_draw_value*(scale: PGtkScale): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_scale_get_draw_value".}
+proc gtk_scale_set_value_pos*(scale: PGtkScale, pos: TGtkPositionType){.cdecl,
+    dynlib: gtklib, importc: "gtk_scale_set_value_pos".}
+proc gtk_scale_get_value_pos*(scale: PGtkScale): TGtkPositionType{.cdecl,
+    dynlib: gtklib, importc: "gtk_scale_get_value_pos".}
+proc gtk_scale_get_value_size*(scale: PGtkScale, width: Pgint, height: Pgint){.
+    cdecl, dynlib: gtklib, importc: "_gtk_scale_get_value_size".}
+proc gtk_scale_format_value*(scale: PGtkScale, value: gdouble): cstring{.cdecl,
+    dynlib: gtklib, importc: "_gtk_scale_format_value".}
+proc GTK_TYPE_HSCALE*(): GType
+proc GTK_HSCALE*(obj: pointer): PGtkHScale
+proc GTK_HSCALE_CLASS*(klass: pointer): PGtkHScaleClass
+proc GTK_IS_HSCALE*(obj: pointer): bool
+proc GTK_IS_HSCALE_CLASS*(klass: pointer): bool
+proc GTK_HSCALE_GET_CLASS*(obj: pointer): PGtkHScaleClass
+proc gtk_hscale_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_hscale_get_type".}
+proc gtk_hscale_new*(adjustment: PGtkAdjustment): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_hscale_new".}
+proc gtk_hscale_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_hscale_new_with_range".}
+proc GTK_TYPE_SCROLLBAR*(): GType
+proc GTK_SCROLLBAR*(obj: pointer): PGtkScrollbar
+proc GTK_SCROLLBAR_CLASS*(klass: pointer): PGtkScrollbarClass
+proc GTK_IS_SCROLLBAR*(obj: pointer): bool
+proc GTK_IS_SCROLLBAR_CLASS*(klass: pointer): bool
+proc GTK_SCROLLBAR_GET_CLASS*(obj: pointer): PGtkScrollbarClass
+proc gtk_scrollbar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_scrollbar_get_type".}
+proc GTK_TYPE_HSCROLLBAR*(): GType
+proc GTK_HSCROLLBAR*(obj: pointer): PGtkHScrollbar
+proc GTK_HSCROLLBAR_CLASS*(klass: pointer): PGtkHScrollbarClass
+proc GTK_IS_HSCROLLBAR*(obj: pointer): bool
+proc GTK_IS_HSCROLLBAR_CLASS*(klass: pointer): bool
+proc GTK_HSCROLLBAR_GET_CLASS*(obj: pointer): PGtkHScrollbarClass
+proc gtk_hscrollbar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_hscrollbar_get_type".}
+proc gtk_hscrollbar_new*(adjustment: PGtkAdjustment): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_hscrollbar_new".}
+proc GTK_TYPE_SEPARATOR*(): GType
+proc GTK_SEPARATOR*(obj: pointer): PGtkSeparator
+proc GTK_SEPARATOR_CLASS*(klass: pointer): PGtkSeparatorClass
+proc GTK_IS_SEPARATOR*(obj: pointer): bool
+proc GTK_IS_SEPARATOR_CLASS*(klass: pointer): bool
+proc GTK_SEPARATOR_GET_CLASS*(obj: pointer): PGtkSeparatorClass
+proc gtk_separator_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_separator_get_type".}
+proc GTK_TYPE_HSEPARATOR*(): GType
+proc GTK_HSEPARATOR*(obj: pointer): PGtkHSeparator
+proc GTK_HSEPARATOR_CLASS*(klass: pointer): PGtkHSeparatorClass
+proc GTK_IS_HSEPARATOR*(obj: pointer): bool
+proc GTK_IS_HSEPARATOR_CLASS*(klass: pointer): bool
+proc GTK_HSEPARATOR_GET_CLASS*(obj: pointer): PGtkHSeparatorClass
+proc gtk_hseparator_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_hseparator_get_type".}
+proc gtk_hseparator_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_hseparator_new".}
+proc GTK_TYPE_ICON_FACTORY*(): GType
+proc GTK_ICON_FACTORY*(anObject: pointer): PGtkIconFactory
+proc GTK_ICON_FACTORY_CLASS*(klass: pointer): PGtkIconFactoryClass
+proc GTK_IS_ICON_FACTORY*(anObject: pointer): bool
+proc GTK_IS_ICON_FACTORY_CLASS*(klass: pointer): bool
+proc GTK_ICON_FACTORY_GET_CLASS*(obj: pointer): PGtkIconFactoryClass
+proc GTK_TYPE_ICON_SET*(): GType
+proc GTK_TYPE_ICON_SOURCE*(): GType
+proc gtk_icon_factory_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_factory_get_type".}
+proc gtk_icon_factory_new*(): PGtkIconFactory{.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_factory_new".}
+proc gtk_icon_factory_add*(factory: PGtkIconFactory, stock_id: cstring,
+                           icon_set: PGtkIconSet){.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_factory_add".}
+proc gtk_icon_factory_lookup*(factory: PGtkIconFactory, stock_id: cstring): PGtkIconSet{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_factory_lookup".}
+proc gtk_icon_factory_add_default*(factory: PGtkIconFactory){.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_factory_add_default".}
+proc gtk_icon_factory_remove_default*(factory: PGtkIconFactory){.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_factory_remove_default".}
+proc gtk_icon_factory_lookup_default*(stock_id: cstring): PGtkIconSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_factory_lookup_default".}
+proc gtk_icon_size_lookup*(size: TGtkIconSize, width: Pgint, height: Pgint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_size_lookup".}
+proc gtk_icon_size_register*(name: cstring, width: gint, height: gint): TGtkIconSize{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_size_register".}
+proc gtk_icon_size_register_alias*(alias: cstring, target: TGtkIconSize){.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_size_register_alias".}
+proc gtk_icon_size_from_name*(name: cstring): TGtkIconSize{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_size_from_name".}
+proc gtk_icon_size_get_name*(size: TGtkIconSize): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_size_get_name".}
+proc gtk_icon_set_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_icon_set_get_type".}
+proc gtk_icon_set_new*(): PGtkIconSet{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_icon_set_new".}
+proc gtk_icon_set_new_from_pixbuf*(pixbuf: PGdkPixbuf): PGtkIconSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_set_new_from_pixbuf".}
+proc gtk_icon_set_ref*(icon_set: PGtkIconSet): PGtkIconSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_set_ref".}
+proc gtk_icon_set_unref*(icon_set: PGtkIconSet){.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_set_unref".}
+proc gtk_icon_set_copy*(icon_set: PGtkIconSet): PGtkIconSet{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_set_copy".}
+proc gtk_icon_set_render_icon*(icon_set: PGtkIconSet, style: PGtkStyle,
+                               direction: TGtkTextDirection,
+                               state: TGtkStateType, size: TGtkIconSize,
+                               widget: PGtkWidget, detail: cstring): PGdkPixbuf{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_set_render_icon".}
+proc gtk_icon_set_add_source*(icon_set: PGtkIconSet, source: PGtkIconSource){.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_set_add_source".}
+proc gtk_icon_set_get_sizes*(icon_set: PGtkIconSet, sizes: PPGtkIconSize,
+                             n_sizes: pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_set_get_sizes".}
+proc gtk_icon_source_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_source_get_type".}
+proc gtk_icon_source_new*(): PGtkIconSource{.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_source_new".}
+proc gtk_icon_source_copy*(source: PGtkIconSource): PGtkIconSource{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_copy".}
+proc gtk_icon_source_free*(source: PGtkIconSource){.cdecl, dynlib: gtklib,
+    importc: "gtk_icon_source_free".}
+proc gtk_icon_source_set_filename*(source: PGtkIconSource, filename: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_set_filename".}
+proc gtk_icon_source_set_pixbuf*(source: PGtkIconSource, pixbuf: PGdkPixbuf){.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_set_pixbuf".}
+proc gtk_icon_source_get_filename*(source: PGtkIconSource): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_get_filename".}
+proc gtk_icon_source_get_pixbuf*(source: PGtkIconSource): PGdkPixbuf{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_get_pixbuf".}
+proc gtk_icon_source_set_direction_wildcarded*(source: PGtkIconSource,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_icon_source_set_direction_wildcarded".}
+proc gtk_icon_source_set_state_wildcarded*(source: PGtkIconSource,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_icon_source_set_state_wildcarded".}
+proc gtk_icon_source_set_size_wildcarded*(source: PGtkIconSource,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_icon_source_set_size_wildcarded".}
+proc gtk_icon_source_get_size_wildcarded*(source: PGtkIconSource): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_get_size_wildcarded".}
+proc gtk_icon_source_get_state_wildcarded*(source: PGtkIconSource): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_get_state_wildcarded".}
+proc gtk_icon_source_get_direction_wildcarded*(source: PGtkIconSource): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_get_direction_wildcarded".}
+proc gtk_icon_source_set_direction*(source: PGtkIconSource,
+                                    direction: TGtkTextDirection){.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_set_direction".}
+proc gtk_icon_source_set_state*(source: PGtkIconSource, state: TGtkStateType){.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_set_state".}
+proc gtk_icon_source_set_size*(source: PGtkIconSource, size: TGtkIconSize){.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_set_size".}
+proc gtk_icon_source_get_direction*(source: PGtkIconSource): TGtkTextDirection{.
+    cdecl, dynlib: gtklib, importc: "gtk_icon_source_get_direction".}
+proc gtk_icon_source_get_state*(source: PGtkIconSource): TGtkStateType{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_get_state".}
+proc gtk_icon_source_get_size*(source: PGtkIconSource): TGtkIconSize{.cdecl,
+    dynlib: gtklib, importc: "gtk_icon_source_get_size".}
+proc gtk_icon_set_invalidate_caches*(){.cdecl, dynlib: gtklib,
+    importc: "_gtk_icon_set_invalidate_caches".}
+proc gtk_icon_factory_list_ids*(): PGSList{.cdecl, dynlib: gtklib,
+    importc: "_gtk_icon_factory_list_ids".}
+proc GTK_TYPE_IMAGE*(): GType
+proc GTK_IMAGE*(obj: pointer): PGtkImage
+proc GTK_IMAGE_CLASS*(klass: pointer): PGtkImageClass
+proc GTK_IS_IMAGE*(obj: pointer): bool
+proc GTK_IS_IMAGE_CLASS*(klass: pointer): bool
+proc GTK_IMAGE_GET_CLASS*(obj: pointer): PGtkImageClass
+proc gtk_image_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_image_get_type".}
+proc gtk_image_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                   importc: "gtk_image_new".}
+proc gtk_image_new_from_pixmap*(pixmap: PGdkPixmap, mask: PGdkBitmap): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_new_from_pixmap".}
+proc gtk_image_new_from_image*(image: PGdkImage, mask: PGdkBitmap): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_new_from_image".}
+proc gtk_image_new_from_file*(filename: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_new_from_file".}
+proc gtk_image_new_from_pixbuf*(pixbuf: PGdkPixbuf): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_new_from_pixbuf".}
+proc gtk_image_new_from_stock*(stock_id: cstring, size: TGtkIconSize): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_new_from_stock".}
+proc gtk_image_new_from_icon_set*(icon_set: PGtkIconSet, size: TGtkIconSize): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_new_from_icon_set".}
+proc gtk_image_new_from_animation*(animation: PGdkPixbufAnimation): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_new_from_animation".}
+proc gtk_image_set_from_pixmap*(image: PGtkImage, pixmap: PGdkPixmap,
+                                mask: PGdkBitmap){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_set_from_pixmap".}
+proc gtk_image_set_from_image*(image: PGtkImage, gdk_image: PGdkImage,
+                               mask: PGdkBitmap){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_set_from_image".}
+proc gtk_image_set_from_file*(image: PGtkImage, filename: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_image_set_from_file".}
+proc gtk_image_set_from_pixbuf*(image: PGtkImage, pixbuf: PGdkPixbuf){.cdecl,
+    dynlib: gtklib, importc: "gtk_image_set_from_pixbuf".}
+proc gtk_image_set_from_stock*(image: PGtkImage, stock_id: cstring,
+                               size: TGtkIconSize){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_set_from_stock".}
+proc gtk_image_set_from_icon_set*(image: PGtkImage, icon_set: PGtkIconSet,
+                                  size: TGtkIconSize){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_set_from_icon_set".}
+proc gtk_image_set_from_animation*(image: PGtkImage,
+                                   animation: PGdkPixbufAnimation){.cdecl,
+    dynlib: gtklib, importc: "gtk_image_set_from_animation".}
+proc gtk_image_get_storage_type*(image: PGtkImage): TGtkImageType{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_get_storage_type".}
+proc gtk_image_get_pixbuf*(image: PGtkImage): PGdkPixbuf{.cdecl, dynlib: gtklib,
+    importc: "gtk_image_get_pixbuf".}
+proc gtk_image_get_stock*(image: PGtkImage, stock_id: PPgchar,
+                          size: PGtkIconSize){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_get_stock".}
+proc gtk_image_get_animation*(image: PGtkImage): PGdkPixbufAnimation{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_get_animation".}
+proc GTK_TYPE_IMAGE_MENU_ITEM*(): GType
+proc GTK_IMAGE_MENU_ITEM*(obj: pointer): PGtkImageMenuItem
+proc GTK_IMAGE_MENU_ITEM_CLASS*(klass: pointer): PGtkImageMenuItemClass
+proc GTK_IS_IMAGE_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkImageMenuItemClass
+proc gtk_image_menu_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_image_menu_item_get_type".}
+proc gtk_image_menu_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_image_menu_item_new".}
+proc gtk_image_menu_item_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_menu_item_new_with_label".}
+proc gtk_image_menu_item_new_with_mnemonic*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_image_menu_item_new_with_mnemonic".}
+proc gtk_image_menu_item_new_from_stock*(stock_id: cstring,
+    accel_group: PGtkAccelGroup): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_image_menu_item_new_from_stock".}
+proc gtk_image_menu_item_set_image*(image_menu_item: PGtkImageMenuItem,
+                                    image: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_image_menu_item_set_image".}
+proc gtk_image_menu_item_get_image*(image_menu_item: PGtkImageMenuItem): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_image_menu_item_get_image".}
+const
+  bm_TGtkIMContextSimple_in_hex_sequence* = 0x00000001
+  bp_TGtkIMContextSimple_in_hex_sequence* = 0
+
+proc GTK_TYPE_IM_CONTEXT_SIMPLE*(): GType
+proc GTK_IM_CONTEXT_SIMPLE*(obj: pointer): PGtkIMContextSimple
+proc GTK_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PGtkIMContextSimpleClass
+proc GTK_IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool
+proc GTK_IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool
+proc GTK_IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PGtkIMContextSimpleClass
+proc in_hex_sequence*(a: var TGtkIMContextSimple): guint
+proc set_in_hex_sequence*(a: var TGtkIMContextSimple, `in_hex_sequence`: guint)
+proc gtk_im_context_simple_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_simple_get_type".}
+proc gtk_im_context_simple_new*(): PGtkIMContext{.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_simple_new".}
+proc gtk_im_context_simple_add_table*(context_simple: PGtkIMContextSimple,
+                                      data: Pguint16, max_seq_len: gint,
+                                      n_seqs: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_im_context_simple_add_table".}
+proc GTK_TYPE_IM_MULTICONTEXT*(): GType
+proc GTK_IM_MULTICONTEXT*(obj: pointer): PGtkIMMulticontext
+proc GTK_IM_MULTICONTEXT_CLASS*(klass: pointer): PGtkIMMulticontextClass
+proc GTK_IS_IM_MULTICONTEXT*(obj: pointer): bool
+proc GTK_IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool
+proc GTK_IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PGtkIMMulticontextClass
+proc gtk_im_multicontext_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_im_multicontext_get_type".}
+proc gtk_im_multicontext_new*(): PGtkIMContext{.cdecl, dynlib: gtklib,
+    importc: "gtk_im_multicontext_new".}
+proc gtk_im_multicontext_append_menuitems*(context: PGtkIMMulticontext,
+    menushell: PGtkMenuShell){.cdecl, dynlib: gtklib,
+                               importc: "gtk_im_multicontext_append_menuitems".}
+proc GTK_TYPE_INPUT_DIALOG*(): GType
+proc GTK_INPUT_DIALOG*(obj: pointer): PGtkInputDialog
+proc GTK_INPUT_DIALOG_CLASS*(klass: pointer): PGtkInputDialogClass
+proc GTK_IS_INPUT_DIALOG*(obj: pointer): bool
+proc GTK_IS_INPUT_DIALOG_CLASS*(klass: pointer): bool
+proc GTK_INPUT_DIALOG_GET_CLASS*(obj: pointer): PGtkInputDialogClass
+proc gtk_input_dialog_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_input_dialog_get_type".}
+proc gtk_input_dialog_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_input_dialog_new".}
+proc GTK_TYPE_INVISIBLE*(): GType
+proc GTK_INVISIBLE*(obj: pointer): PGtkInvisible
+proc GTK_INVISIBLE_CLASS*(klass: pointer): PGtkInvisibleClass
+proc GTK_IS_INVISIBLE*(obj: pointer): bool
+proc GTK_IS_INVISIBLE_CLASS*(klass: pointer): bool
+proc GTK_INVISIBLE_GET_CLASS*(obj: pointer): PGtkInvisibleClass
+proc gtk_invisible_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_invisible_get_type".}
+proc gtk_invisible_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_invisible_new".}
+proc gtk_invisible_new_for_screen*(screen: PGdkScreen): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_invisible_new_for_screen".}
+proc gtk_invisible_set_screen*(invisible: PGtkInvisible, screen: PGdkScreen){.
+    cdecl, dynlib: gtklib, importc: "gtk_invisible_set_screen".}
+proc gtk_invisible_get_screen*(invisible: PGtkInvisible): PGdkScreen{.cdecl,
+    dynlib: gtklib, importc: "gtk_invisible_get_screen".}
+proc GTK_TYPE_ITEM_FACTORY*(): GType
+proc GTK_ITEM_FACTORY*(anObject: pointer): PGtkItemFactory
+proc GTK_ITEM_FACTORY_CLASS*(klass: pointer): PGtkItemFactoryClass
+proc GTK_IS_ITEM_FACTORY*(anObject: pointer): bool
+proc GTK_IS_ITEM_FACTORY_CLASS*(klass: pointer): bool
+proc GTK_ITEM_FACTORY_GET_CLASS*(obj: pointer): PGtkItemFactoryClass
+proc gtk_item_factory_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_item_factory_get_type".}
+proc gtk_item_factory_new*(container_type: TGtkType, path: cstring,
+                           accel_group: PGtkAccelGroup): PGtkItemFactory{.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_new".}
+proc gtk_item_factory_construct*(ifactory: PGtkItemFactory,
+                                 container_type: TGtkType, path: cstring,
+                                 accel_group: PGtkAccelGroup){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_construct".}
+proc gtk_item_factory_add_foreign*(accel_widget: PGtkWidget, full_path: cstring,
+                                   accel_group: PGtkAccelGroup, keyval: guint,
+                                   modifiers: TGdkModifierType){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_add_foreign".}
+proc gtk_item_factory_from_widget*(widget: PGtkWidget): PGtkItemFactory{.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_from_widget".}
+proc gtk_item_factory_path_from_widget*(widget: PGtkWidget): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_path_from_widget".}
+proc gtk_item_factory_get_item*(ifactory: PGtkItemFactory, path: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_item_factory_get_item".}
+proc gtk_item_factory_get_widget*(ifactory: PGtkItemFactory, path: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_item_factory_get_widget".}
+proc gtk_item_factory_get_widget_by_action*(ifactory: PGtkItemFactory,
+    action: guint): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_item_factory_get_widget_by_action".}
+proc gtk_item_factory_get_item_by_action*(ifactory: PGtkItemFactory,
+    action: guint): PGtkWidget{.cdecl, dynlib: gtklib,
+                                importc: "gtk_item_factory_get_item_by_action".}
+proc gtk_item_factory_create_item*(ifactory: PGtkItemFactory,
+                                   entry: PGtkItemFactoryEntry,
+                                   callback_data: gpointer, callback_type: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_item_factory_create_item".}
+proc gtk_item_factory_create_items*(ifactory: PGtkItemFactory, n_entries: guint,
+                                    entries: PGtkItemFactoryEntry,
+                                    callback_data: gpointer){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_create_items".}
+proc gtk_item_factory_delete_item*(ifactory: PGtkItemFactory, path: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_item_factory_delete_item".}
+proc gtk_item_factory_delete_entry*(ifactory: PGtkItemFactory,
+                                    entry: PGtkItemFactoryEntry){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_delete_entry".}
+proc gtk_item_factory_delete_entries*(ifactory: PGtkItemFactory,
+                                      n_entries: guint,
+                                      entries: PGtkItemFactoryEntry){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_delete_entries".}
+proc gtk_item_factory_popup*(ifactory: PGtkItemFactory, x: guint, y: guint,
+                             mouse_button: guint, time: guint32){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_popup".}
+proc gtk_item_factory_popup_with_data*(ifactory: PGtkItemFactory,
+                                       popup_data: gpointer,
+                                       destroy: TGtkDestroyNotify, x: guint,
+                                       y: guint, mouse_button: guint,
+                                       time: guint32){.cdecl, dynlib: gtklib,
+    importc: "gtk_item_factory_popup_with_data".}
+proc gtk_item_factory_popup_data*(ifactory: PGtkItemFactory): gpointer{.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_popup_data".}
+proc gtk_item_factory_popup_data_from_widget*(widget: PGtkWidget): gpointer{.
+    cdecl, dynlib: gtklib, importc: "gtk_item_factory_popup_data_from_widget".}
+proc gtk_item_factory_set_translate_func*(ifactory: PGtkItemFactory,
+    func_: TGtkTranslateFunc, data: gpointer, notify: TGtkDestroyNotify){.cdecl,
+    dynlib: gtklib, importc: "gtk_item_factory_set_translate_func".}
+proc GTK_TYPE_LAYOUT*(): GType
+proc GTK_LAYOUT*(obj: pointer): PGtkLayout
+proc GTK_LAYOUT_CLASS*(klass: pointer): PGtkLayoutClass
+proc GTK_IS_LAYOUT*(obj: pointer): bool
+proc GTK_IS_LAYOUT_CLASS*(klass: pointer): bool
+proc GTK_LAYOUT_GET_CLASS*(obj: pointer): PGtkLayoutClass
+proc gtk_layout_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_layout_get_type".}
+proc gtk_layout_new*(hadjustment: PGtkAdjustment, vadjustment: PGtkAdjustment): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_layout_new".}
+proc gtk_layout_put*(layout: PGtkLayout, child_widget: PGtkWidget, x: gint,
+                     y: gint){.cdecl, dynlib: gtklib, importc: "gtk_layout_put".}
+proc gtk_layout_move*(layout: PGtkLayout, child_widget: PGtkWidget, x: gint,
+                      y: gint){.cdecl, dynlib: gtklib,
+                                importc: "gtk_layout_move".}
+proc gtk_layout_set_size*(layout: PGtkLayout, width: guint, height: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_layout_set_size".}
+proc gtk_layout_get_size*(layout: PGtkLayout, width: Pguint, height: Pguint){.
+    cdecl, dynlib: gtklib, importc: "gtk_layout_get_size".}
+proc gtk_layout_get_hadjustment*(layout: PGtkLayout): PGtkAdjustment{.cdecl,
+    dynlib: gtklib, importc: "gtk_layout_get_hadjustment".}
+proc gtk_layout_get_vadjustment*(layout: PGtkLayout): PGtkAdjustment{.cdecl,
+    dynlib: gtklib, importc: "gtk_layout_get_vadjustment".}
+proc gtk_layout_set_hadjustment*(layout: PGtkLayout, adjustment: PGtkAdjustment){.
+    cdecl, dynlib: gtklib, importc: "gtk_layout_set_hadjustment".}
+proc gtk_layout_set_vadjustment*(layout: PGtkLayout, adjustment: PGtkAdjustment){.
+    cdecl, dynlib: gtklib, importc: "gtk_layout_set_vadjustment".}
+const
+  bm_TGtkList_selection_mode* = 0x00000003
+  bp_TGtkList_selection_mode* = 0
+  bm_TGtkList_drag_selection* = 0x00000004
+  bp_TGtkList_drag_selection* = 2
+  bm_TGtkList_add_mode* = 0x00000008
+  bp_TGtkList_add_mode* = 3
+
+proc GTK_TYPE_LIST*(): GType
+proc GTK_LIST*(obj: pointer): PGtkList
+proc GTK_LIST_CLASS*(klass: pointer): PGtkListClass
+proc GTK_IS_LIST*(obj: pointer): bool
+proc GTK_IS_LIST_CLASS*(klass: pointer): bool
+proc GTK_LIST_GET_CLASS*(obj: pointer): PGtkListClass
+proc selection_mode*(a: var TGtkList): guint
+proc set_selection_mode*(a: var TGtkList, `selection_mode`: guint)
+proc drag_selection*(a: var TGtkList): guint
+proc set_drag_selection*(a: var TGtkList, `drag_selection`: guint)
+proc add_mode*(a: var TGtkList): guint
+proc set_add_mode*(a: var TGtkList, `add_mode`: guint)
+proc gtk_list_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_list_get_type".}
+proc gtk_list_new*(): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_list_new".}
+proc gtk_list_insert_items*(list: PGtkList, items: PGList, position: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_insert_items".}
+proc gtk_list_append_items*(list: PGtkList, items: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_append_items".}
+proc gtk_list_prepend_items*(list: PGtkList, items: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_prepend_items".}
+proc gtk_list_remove_items*(list: PGtkList, items: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_remove_items".}
+proc gtk_list_remove_items_no_unref*(list: PGtkList, items: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_remove_items_no_unref".}
+proc gtk_list_clear_items*(list: PGtkList, start: gint, theEnd: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_clear_items".}
+proc gtk_list_select_item*(list: PGtkList, item: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_select_item".}
+proc gtk_list_unselect_item*(list: PGtkList, item: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_unselect_item".}
+proc gtk_list_select_child*(list: PGtkList, child: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_select_child".}
+proc gtk_list_unselect_child*(list: PGtkList, child: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_unselect_child".}
+proc gtk_list_child_position*(list: PGtkList, child: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_list_child_position".}
+proc gtk_list_set_selection_mode*(list: PGtkList, mode: TGtkSelectionMode){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_set_selection_mode".}
+proc gtk_list_extend_selection*(list: PGtkList, scroll_type: TGtkScrollType,
+                                position: gfloat, auto_start_selection: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_extend_selection".}
+proc gtk_list_start_selection*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_start_selection".}
+proc gtk_list_end_selection*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_end_selection".}
+proc gtk_list_select_all*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_select_all".}
+proc gtk_list_unselect_all*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_unselect_all".}
+proc gtk_list_scroll_horizontal*(list: PGtkList, scroll_type: TGtkScrollType,
+                                 position: gfloat){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_scroll_horizontal".}
+proc gtk_list_scroll_vertical*(list: PGtkList, scroll_type: TGtkScrollType,
+                               position: gfloat){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_scroll_vertical".}
+proc gtk_list_toggle_add_mode*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_toggle_add_mode".}
+proc gtk_list_toggle_focus_row*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_toggle_focus_row".}
+proc gtk_list_toggle_row*(list: PGtkList, item: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_toggle_row".}
+proc gtk_list_undo_selection*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_undo_selection".}
+proc gtk_list_end_drag_selection*(list: PGtkList){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_end_drag_selection".}
+const
+  GTK_TREE_MODEL_ITERS_PERSIST* = 1 shl 0
+  GTK_TREE_MODEL_LIST_ONLY* = 1 shl 1
+
+proc GTK_TYPE_TREE_MODEL*(): GType
+proc GTK_TREE_MODEL*(obj: pointer): PGtkTreeModel
+proc GTK_IS_TREE_MODEL*(obj: pointer): bool
+proc GTK_TREE_MODEL_GET_IFACE*(obj: pointer): PGtkTreeModelIface
+proc GTK_TYPE_TREE_ITER*(): GType
+proc GTK_TYPE_TREE_PATH*(): GType
+proc gtk_tree_path_new*(): PGtkTreePath{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_new".}
+proc gtk_tree_path_new_from_string*(path: cstring): PGtkTreePath{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_new_from_string".}
+proc gtk_tree_path_to_string*(path: PGtkTreePath): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_to_string".}
+proc gtk_tree_path_new_root*(): PGtkTreePath
+proc gtk_tree_path_new_first*(): PGtkTreePath{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_new_first".}
+proc gtk_tree_path_append_index*(path: PGtkTreePath, index: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_append_index".}
+proc gtk_tree_path_prepend_index*(path: PGtkTreePath, index: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_prepend_index".}
+proc gtk_tree_path_get_depth*(path: PGtkTreePath): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_get_depth".}
+proc gtk_tree_path_get_indices*(path: PGtkTreePath): Pgint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_get_indices".}
+proc gtk_tree_path_free*(path: PGtkTreePath){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_free".}
+proc gtk_tree_path_copy*(path: PGtkTreePath): PGtkTreePath{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_copy".}
+proc gtk_tree_path_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_tree_path_get_type".}
+proc gtk_tree_path_compare*(a: PGtkTreePath, b: PGtkTreePath): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_path_compare".}
+proc gtk_tree_path_next*(path: PGtkTreePath){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_next".}
+proc gtk_tree_path_prev*(path: PGtkTreePath): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_prev".}
+proc gtk_tree_path_up*(path: PGtkTreePath): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_up".}
+proc gtk_tree_path_down*(path: PGtkTreePath){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_path_down".}
+proc gtk_tree_path_is_ancestor*(path: PGtkTreePath, descendant: PGtkTreePath): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_path_is_ancestor".}
+proc gtk_tree_path_is_descendant*(path: PGtkTreePath, ancestor: PGtkTreePath): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_path_is_descendant".}
+proc gtk_tree_row_reference_new*(model: PGtkTreeModel, path: PGtkTreePath): PGtkTreeRowReference{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_new".}
+proc gtk_tree_row_reference_new_proxy*(proxy: PGObject, model: PGtkTreeModel,
+                                       path: PGtkTreePath): PGtkTreeRowReference{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_new_proxy".}
+proc gtk_tree_row_reference_get_path*(reference: PGtkTreeRowReference): PGtkTreePath{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_get_path".}
+proc gtk_tree_row_reference_valid*(reference: PGtkTreeRowReference): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_valid".}
+proc gtk_tree_row_reference_free*(reference: PGtkTreeRowReference){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_row_reference_free".}
+proc gtk_tree_row_reference_inserted*(proxy: PGObject, path: PGtkTreePath){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_inserted".}
+proc gtk_tree_row_reference_deleted*(proxy: PGObject, path: PGtkTreePath){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_deleted".}
+proc gtk_tree_row_reference_reordered*(proxy: PGObject, path: PGtkTreePath,
+                                       iter: PGtkTreeIter, new_order: Pgint){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_row_reference_reordered".}
+proc gtk_tree_iter_copy*(iter: PGtkTreeIter): PGtkTreeIter{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_iter_copy".}
+proc gtk_tree_iter_free*(iter: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_iter_free".}
+proc gtk_tree_iter_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_tree_iter_get_type".}
+proc gtk_tree_model_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_get_type".}
+proc gtk_tree_model_get_flags*(tree_model: PGtkTreeModel): TGtkTreeModelFlags{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_get_flags".}
+proc gtk_tree_model_get_n_columns*(tree_model: PGtkTreeModel): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_get_n_columns".}
+proc gtk_tree_model_get_column_type*(tree_model: PGtkTreeModel, index: gint): GType{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_get_column_type".}
+proc gtk_tree_model_get_iter*(tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                              path: PGtkTreePath): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_get_iter".}
+proc gtk_tree_model_get_iter_from_string*(tree_model: PGtkTreeModel,
+    iter: PGtkTreeIter, path_string: cstring): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_get_iter_from_string".}
+proc gtk_tree_model_get_iter_root*(tree_model: PGtkTreeModel, iter: PGtkTreeIter): gboolean
+proc gtk_tree_model_get_iter_first*(tree_model: PGtkTreeModel,
+                                    iter: PGtkTreeIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_get_iter_first".}
+proc gtk_tree_model_get_path*(tree_model: PGtkTreeModel, iter: PGtkTreeIter): PGtkTreePath{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_get_path".}
+proc gtk_tree_model_get_value*(tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                               column: gint, value: PGValue){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_get_value".}
+proc gtk_tree_model_iter_next*(tree_model: PGtkTreeModel, iter: PGtkTreeIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_iter_next".}
+proc gtk_tree_model_iter_children*(tree_model: PGtkTreeModel,
+                                   iter: PGtkTreeIter, parent: PGtkTreeIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_iter_children".}
+proc gtk_tree_model_iter_has_child*(tree_model: PGtkTreeModel,
+                                    iter: PGtkTreeIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_iter_has_child".}
+proc gtk_tree_model_iter_n_children*(tree_model: PGtkTreeModel,
+                                     iter: PGtkTreeIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_iter_n_children".}
+proc gtk_tree_model_iter_nth_child*(tree_model: PGtkTreeModel,
+                                    iter: PGtkTreeIter, parent: PGtkTreeIter,
+                                    n: gint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_iter_nth_child".}
+proc gtk_tree_model_iter_parent*(tree_model: PGtkTreeModel, iter: PGtkTreeIter,
+                                 child: PGtkTreeIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_model_iter_parent".}
+proc gtk_tree_model_ref_node*(tree_model: PGtkTreeModel, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_ref_node".}
+proc gtk_tree_model_unref_node*(tree_model: PGtkTreeModel, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_unref_node".}
+proc gtk_tree_model_foreach*(model: PGtkTreeModel,
+                             func_: TGtkTreeModelForeachFunc,
+                             user_data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_foreach".}
+proc gtk_tree_model_row_changed*(tree_model: PGtkTreeModel, path: PGtkTreePath,
+                                 iter: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_row_changed".}
+proc gtk_tree_model_row_inserted*(tree_model: PGtkTreeModel, path: PGtkTreePath,
+                                  iter: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_row_inserted".}
+proc gtk_tree_model_row_has_child_toggled*(tree_model: PGtkTreeModel,
+    path: PGtkTreePath, iter: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_row_has_child_toggled".}
+proc gtk_tree_model_row_deleted*(tree_model: PGtkTreeModel, path: PGtkTreePath){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_row_deleted".}
+proc gtk_tree_model_rows_reordered*(tree_model: PGtkTreeModel,
+                                    path: PGtkTreePath, iter: PGtkTreeIter,
+                                    new_order: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_rows_reordered".}
+const
+  GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID* = - (1)
+
+proc GTK_TYPE_TREE_SORTABLE*(): GType
+proc GTK_TREE_SORTABLE*(obj: pointer): PGtkTreeSortable
+proc GTK_TREE_SORTABLE_CLASS*(obj: pointer): PGtkTreeSortableIface
+proc GTK_IS_TREE_SORTABLE*(obj: pointer): bool
+proc GTK_TREE_SORTABLE_GET_IFACE*(obj: pointer): PGtkTreeSortableIface
+proc gtk_tree_sortable_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_sortable_get_type".}
+proc gtk_tree_sortable_sort_column_changed*(sortable: PGtkTreeSortable){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_sortable_sort_column_changed".}
+proc gtk_tree_sortable_get_sort_column_id*(sortable: PGtkTreeSortable,
+    sort_column_id: Pgint, order: PGtkSortType): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_sortable_get_sort_column_id".}
+proc gtk_tree_sortable_set_sort_column_id*(sortable: PGtkTreeSortable,
+    sort_column_id: gint, order: TGtkSortType){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_sortable_set_sort_column_id".}
+proc gtk_tree_sortable_set_sort_func*(sortable: PGtkTreeSortable,
+                                      sort_column_id: gint,
+                                      sort_func: TGtkTreeIterCompareFunc,
+                                      user_data: gpointer,
+                                      destroy: TGtkDestroyNotify){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_sortable_set_sort_func".}
+proc gtk_tree_sortable_set_default_sort_func*(sortable: PGtkTreeSortable,
+    sort_func: TGtkTreeIterCompareFunc, user_data: gpointer,
+    destroy: TGtkDestroyNotify){.cdecl, dynlib: gtklib, importc: "gtk_tree_sortable_set_default_sort_func".}
+proc gtk_tree_sortable_has_default_sort_func*(sortable: PGtkTreeSortable): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_sortable_has_default_sort_func".}
+proc GTK_TYPE_TREE_MODEL_SORT*(): GType
+proc GTK_TREE_MODEL_SORT*(obj: pointer): PGtkTreeModelSort
+proc GTK_TREE_MODEL_SORT_CLASS*(klass: pointer): PGtkTreeModelSortClass
+proc GTK_IS_TREE_MODEL_SORT*(obj: pointer): bool
+proc GTK_IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool
+proc GTK_TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PGtkTreeModelSortClass
+proc gtk_tree_model_sort_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_sort_get_type".}
+proc gtk_tree_model_sort_new_with_model*(child_model: PGtkTreeModel): PGtkTreeModel{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_sort_new_with_model".}
+proc gtk_tree_model_sort_get_model*(tree_model: PGtkTreeModelSort): PGtkTreeModel{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_sort_get_model".}
+proc gtk_tree_model_sort_convert_child_path_to_path*(
+    tree_model_sort: PGtkTreeModelSort, child_path: PGtkTreePath): PGtkTreePath{.
+    cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_sort_convert_child_path_to_path".}
+proc gtk_tree_model_sort_convert_child_iter_to_iter*(
+    tree_model_sort: PGtkTreeModelSort, sort_iter: PGtkTreeIter,
+    child_iter: PGtkTreeIter){.cdecl, dynlib: gtklib, importc: "gtk_tree_model_sort_convert_child_iter_to_iter".}
+proc gtk_tree_model_sort_convert_path_to_child_path*(
+    tree_model_sort: PGtkTreeModelSort, sorted_path: PGtkTreePath): PGtkTreePath{.
+    cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_sort_convert_path_to_child_path".}
+proc gtk_tree_model_sort_convert_iter_to_child_iter*(
+    tree_model_sort: PGtkTreeModelSort, child_iter: PGtkTreeIter,
+    sorted_iter: PGtkTreeIter){.cdecl, dynlib: gtklib, importc: "gtk_tree_model_sort_convert_iter_to_child_iter".}
+proc gtk_tree_model_sort_reset_default_sort_func*(
+    tree_model_sort: PGtkTreeModelSort){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_model_sort_reset_default_sort_func".}
+proc gtk_tree_model_sort_clear_cache*(tree_model_sort: PGtkTreeModelSort){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_model_sort_clear_cache".}
+const
+  bm_TGtkListStore_columns_dirty* = 0x00000001
+  bp_TGtkListStore_columns_dirty* = 0
+
+proc GTK_TYPE_LIST_STORE*(): GType
+proc GTK_LIST_STORE*(obj: pointer): PGtkListStore
+proc GTK_LIST_STORE_CLASS*(klass: pointer): PGtkListStoreClass
+proc GTK_IS_LIST_STORE*(obj: pointer): bool
+proc GTK_IS_LIST_STORE_CLASS*(klass: pointer): bool
+proc GTK_LIST_STORE_GET_CLASS*(obj: pointer): PGtkListStoreClass
+proc columns_dirty*(a: var TGtkListStore): guint
+proc set_columns_dirty*(a: var TGtkListStore, `columns_dirty`: guint)
+proc gtk_list_store_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_list_store_get_type".}
+proc gtk_list_store_newv*(n_columns: gint, types: PGType): PGtkListStore{.cdecl,
+    dynlib: gtklib, importc: "gtk_list_store_newv".}
+proc gtk_list_store_set_column_types*(list_store: PGtkListStore,
+                                      n_columns: gint, types: PGType){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_store_set_column_types".}
+proc gtk_list_store_set_value*(list_store: PGtkListStore, iter: PGtkTreeIter,
+                               column: gint, value: PGValue){.cdecl,
+    dynlib: gtklib, importc: "gtk_list_store_set_value".}
+proc gtk_list_store_remove*(list_store: PGtkListStore, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_store_remove".}
+proc gtk_list_store_insert*(list_store: PGtkListStore, iter: PGtkTreeIter,
+                            position: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_store_insert".}
+proc gtk_list_store_insert_before*(list_store: PGtkListStore,
+                                   iter: PGtkTreeIter, sibling: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_store_insert_before".}
+proc gtk_list_store_insert_after*(list_store: PGtkListStore, iter: PGtkTreeIter,
+                                  sibling: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_store_insert_after".}
+proc gtk_list_store_prepend*(list_store: PGtkListStore, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_store_prepend".}
+proc gtk_list_store_append*(list_store: PGtkListStore, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_list_store_append".}
+proc gtk_list_store_clear*(list_store: PGtkListStore){.cdecl, dynlib: gtklib,
+    importc: "gtk_list_store_clear".}
+
+when false:
+  const
+    GTK_PRIORITY_RESIZE* = G_PRIORITY_HIGH_IDLE + 10
+
+proc gtk_check_version*(required_major: guint, required_minor: guint,
+                        required_micro: guint): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_check_version".}
+proc gtk_disable_setlocale*(){.cdecl, dynlib: gtklib,
+                               importc: "gtk_disable_setlocale".}
+proc gtk_set_locale*(): cstring{.cdecl, dynlib: gtklib, importc: "gtk_set_locale".}
+proc gtk_get_default_language*(): PPangoLanguage{.cdecl, dynlib: gtklib,
+    importc: "gtk_get_default_language".}
+proc gtk_events_pending*(): gint{.cdecl, dynlib: gtklib,
+                                  importc: "gtk_events_pending".}
+proc gtk_main_do_event*(event: PGdkEvent){.cdecl, dynlib: gtklib,
+    importc: "gtk_main_do_event".}
+proc gtk_main*(){.cdecl, dynlib: gtklib, importc: "gtk_main".}
+proc gtk_init*(argc, argv: pointer){.cdecl, dynlib: gtklib, importc: "gtk_init".}
+proc gtk_main_level*(): guint{.cdecl, dynlib: gtklib, importc: "gtk_main_level".}
+proc gtk_main_quit*(){.cdecl, dynlib: gtklib, importc: "gtk_main_quit".}
+proc gtk_main_iteration*(): gboolean{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_main_iteration".}
+proc gtk_main_iteration_do*(blocking: gboolean): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_main_iteration_do".}
+proc gtk_true*(): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_true".}
+proc gtk_false*(): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_false".}
+proc gtk_grab_add*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_grab_add".}
+proc gtk_grab_get_current*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_grab_get_current".}
+proc gtk_grab_remove*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_grab_remove".}
+proc gtk_init_add*(`function`: TGtkFunction, data: gpointer){.cdecl,
+    dynlib: gtklib, importc: "gtk_init_add".}
+proc gtk_quit_add_destroy*(main_level: guint, anObject: PGtkObject){.cdecl,
+    dynlib: gtklib, importc: "gtk_quit_add_destroy".}
+proc gtk_quit_add*(main_level: guint, `function`: TGtkFunction, data: gpointer): guint{.
+    cdecl, dynlib: gtklib, importc: "gtk_quit_add".}
+proc gtk_quit_add_full*(main_level: guint, `function`: TGtkFunction,
+                        marshal: TGtkCallbackMarshal, data: gpointer,
+                        destroy: TGtkDestroyNotify): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_quit_add_full".}
+proc gtk_quit_remove*(quit_handler_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_quit_remove".}
+proc gtk_quit_remove_by_data*(data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_quit_remove_by_data".}
+proc gtk_timeout_add*(interval: guint32, `function`: TGtkFunction,
+                      data: gpointer): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_timeout_add".}
+proc gtk_timeout_add_full*(interval: guint32, `function`: TGtkFunction,
+                           marshal: TGtkCallbackMarshal, data: gpointer,
+                           destroy: TGtkDestroyNotify): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_timeout_add_full".}
+proc gtk_timeout_remove*(timeout_handler_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_timeout_remove".}
+proc gtk_idle_add*(`function`: TGtkFunction, data: gpointer): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_idle_add".}
+proc gtk_idle_add_priority*(priority: gint, `function`: TGtkFunction,
+                            data: gpointer): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_idle_add_priority".}
+proc gtk_idle_add_full*(priority: gint, `function`: TGtkFunction,
+                        marshal: TGtkCallbackMarshal, data: gpointer,
+                        destroy: TGtkDestroyNotify): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_idle_add_full".}
+proc gtk_idle_remove*(idle_handler_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_idle_remove".}
+proc gtk_idle_remove_by_data*(data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_idle_remove_by_data".}
+proc gtk_input_add_full*(source: gint, condition: TGdkInputCondition,
+                         `function`: TGdkInputFunction,
+                         marshal: TGtkCallbackMarshal, data: gpointer,
+                         destroy: TGtkDestroyNotify): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_input_add_full".}
+proc gtk_input_remove*(input_handler_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_input_remove".}
+proc gtk_key_snooper_install*(snooper: TGtkKeySnoopFunc, func_data: gpointer): guint{.
+    cdecl, dynlib: gtklib, importc: "gtk_key_snooper_install".}
+proc gtk_key_snooper_remove*(snooper_handler_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_key_snooper_remove".}
+proc gtk_get_current_event*(): PGdkEvent{.cdecl, dynlib: gtklib,
+    importc: "gtk_get_current_event".}
+proc gtk_get_current_event_time*(): guint32{.cdecl, dynlib: gtklib,
+    importc: "gtk_get_current_event_time".}
+proc gtk_get_current_event_state*(state: PGdkModifierType): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_get_current_event_state".}
+proc gtk_get_event_widget*(event: PGdkEvent): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_get_event_widget".}
+proc gtk_propagate_event*(widget: PGtkWidget, event: PGdkEvent){.cdecl,
+    dynlib: gtklib, importc: "gtk_propagate_event".}
+proc gtk_boolean_handled_accumulator*(ihint: PGSignalInvocationHint,
+                                        return_accu: PGValue,
+                                        handler_return: PGValue, dummy: gpointer): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_boolean_handled_accumulator".}
+proc gtk_find_module*(name: cstring, thetype: cstring): cstring{.cdecl,
+    dynlib: gtklib, importc: "_gtk_find_module".}
+proc gtk_get_module_path*(thetype: cstring): PPgchar{.cdecl, dynlib: gtklib,
+    importc: "_gtk_get_module_path".}
+proc GTK_TYPE_MENU_BAR*(): GType
+proc GTK_MENU_BAR*(obj: pointer): PGtkMenuBar
+proc GTK_MENU_BAR_CLASS*(klass: pointer): PGtkMenuBarClass
+proc GTK_IS_MENU_BAR*(obj: pointer): bool
+proc GTK_IS_MENU_BAR_CLASS*(klass: pointer): bool
+proc GTK_MENU_BAR_GET_CLASS*(obj: pointer): PGtkMenuBarClass
+proc gtk_menu_bar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_menu_bar_get_type".}
+proc gtk_menu_bar_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_menu_bar_new".}
+proc gtk_menu_bar_cycle_focus*(menubar: PGtkMenuBar, dir: TGtkDirectionType){.
+    cdecl, dynlib: gtklib, importc: "_gtk_menu_bar_cycle_focus".}
+proc GTK_TYPE_MESSAGE_DIALOG*(): GType
+proc GTK_MESSAGE_DIALOG*(obj: pointer): PGtkMessageDialog
+proc GTK_MESSAGE_DIALOG_CLASS*(klass: pointer): PGtkMessageDialogClass
+proc GTK_IS_MESSAGE_DIALOG*(obj: pointer): bool
+proc GTK_IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool
+proc GTK_MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PGtkMessageDialogClass
+proc gtk_message_dialog_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_message_dialog_get_type".}
+const
+  bm_TGtkNotebook_show_tabs* = 0x00000001
+  bp_TGtkNotebook_show_tabs* = 0
+  bm_TGtkNotebook_homogeneous* = 0x00000002
+  bp_TGtkNotebook_homogeneous* = 1
+  bm_TGtkNotebook_show_border* = 0x00000004
+  bp_TGtkNotebook_show_border* = 2
+  bm_TGtkNotebook_tab_pos* = 0x00000018
+  bp_TGtkNotebook_tab_pos* = 3
+  bm_TGtkNotebook_scrollable* = 0x00000020
+  bp_TGtkNotebook_scrollable* = 5
+  bm_TGtkNotebook_in_child* = 0x000000C0
+  bp_TGtkNotebook_in_child* = 6
+  bm_TGtkNotebook_click_child* = 0x00000300
+  bp_TGtkNotebook_click_child* = 8
+  bm_TGtkNotebook_button* = 0x00000C00
+  bp_TGtkNotebook_button* = 10
+  bm_TGtkNotebook_need_timer* = 0x00001000
+  bp_TGtkNotebook_need_timer* = 12
+  bm_TGtkNotebook_child_has_focus* = 0x00002000
+  bp_TGtkNotebook_child_has_focus* = 13
+  bm_TGtkNotebook_have_visible_child* = 0x00004000
+  bp_TGtkNotebook_have_visible_child* = 14
+  bm_TGtkNotebook_focus_out* = 0x00008000
+  bp_TGtkNotebook_focus_out* = 15
+
+proc GTK_TYPE_NOTEBOOK*(): GType
+proc GTK_NOTEBOOK*(obj: pointer): PGtkNotebook
+proc GTK_NOTEBOOK_CLASS*(klass: pointer): PGtkNotebookClass
+proc GTK_IS_NOTEBOOK*(obj: pointer): bool
+proc GTK_IS_NOTEBOOK_CLASS*(klass: pointer): bool
+proc GTK_NOTEBOOK_GET_CLASS*(obj: pointer): PGtkNotebookClass
+proc show_tabs*(a: var TGtkNotebook): guint
+proc set_show_tabs*(a: var TGtkNotebook, `show_tabs`: guint)
+proc homogeneous*(a: var TGtkNotebook): guint
+proc set_homogeneous*(a: var TGtkNotebook, `homogeneous`: guint)
+proc show_border*(a: var TGtkNotebook): guint
+proc set_show_border*(a: var TGtkNotebook, `show_border`: guint)
+proc tab_pos*(a: var TGtkNotebook): guint
+proc set_tab_pos*(a: var TGtkNotebook, `tab_pos`: guint)
+proc scrollable*(a: var TGtkNotebook): guint
+proc set_scrollable*(a: var TGtkNotebook, `scrollable`: guint)
+proc in_child*(a: var TGtkNotebook): guint
+proc set_in_child*(a: var TGtkNotebook, `in_child`: guint)
+proc click_child*(a: var TGtkNotebook): guint
+proc set_click_child*(a: var TGtkNotebook, `click_child`: guint)
+proc button*(a: var TGtkNotebook): guint
+proc set_button*(a: var TGtkNotebook, `button`: guint)
+proc need_timer*(a: var TGtkNotebook): guint
+proc set_need_timer*(a: var TGtkNotebook, `need_timer`: guint)
+proc child_has_focus*(a: var TGtkNotebook): guint
+proc set_child_has_focus*(a: var TGtkNotebook, `child_has_focus`: guint)
+proc have_visible_child*(a: var TGtkNotebook): guint
+proc set_have_visible_child*(a: var TGtkNotebook, `have_visible_child`: guint)
+proc focus_out*(a: var TGtkNotebook): guint
+proc set_focus_out*(a: var TGtkNotebook, `focus_out`: guint)
+proc gtk_notebook_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_get_type".}
+proc gtk_notebook_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_notebook_new".}
+proc gtk_notebook_append_page*(notebook: PGtkNotebook, child: PGtkWidget,
+                               tab_label: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_append_page".}
+proc gtk_notebook_append_page_menu*(notebook: PGtkNotebook, child: PGtkWidget,
+                                    tab_label: PGtkWidget,
+                                    menu_label: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_append_page_menu".}
+proc gtk_notebook_prepend_page*(notebook: PGtkNotebook, child: PGtkWidget,
+                                tab_label: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_prepend_page".}
+proc gtk_notebook_prepend_page_menu*(notebook: PGtkNotebook, child: PGtkWidget,
+                                     tab_label: PGtkWidget,
+                                     menu_label: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_prepend_page_menu".}
+proc gtk_notebook_insert_page*(notebook: PGtkNotebook, child: PGtkWidget,
+                               tab_label: PGtkWidget, position: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_insert_page".}
+proc gtk_notebook_insert_page_menu*(notebook: PGtkNotebook, child: PGtkWidget,
+                                    tab_label: PGtkWidget,
+                                    menu_label: PGtkWidget, position: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_insert_page_menu".}
+proc gtk_notebook_remove_page*(notebook: PGtkNotebook, page_num: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_remove_page".}
+proc gtk_notebook_get_current_page*(notebook: PGtkNotebook): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_get_current_page".}
+proc gtk_notebook_get_nth_page*(notebook: PGtkNotebook, page_num: gint): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_get_nth_page".}
+proc gtk_notebook_page_num*(notebook: PGtkNotebook, child: PGtkWidget): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_page_num".}
+proc gtk_notebook_set_current_page*(notebook: PGtkNotebook, page_num: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_current_page".}
+proc gtk_notebook_next_page*(notebook: PGtkNotebook){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_next_page".}
+proc gtk_notebook_prev_page*(notebook: PGtkNotebook){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_prev_page".}
+proc gtk_notebook_set_show_border*(notebook: PGtkNotebook, show_border: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_show_border".}
+proc gtk_notebook_get_show_border*(notebook: PGtkNotebook): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_get_show_border".}
+proc gtk_notebook_set_show_tabs*(notebook: PGtkNotebook, show_tabs: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_show_tabs".}
+proc gtk_notebook_get_show_tabs*(notebook: PGtkNotebook): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_get_show_tabs".}
+proc gtk_notebook_set_tab_pos*(notebook: PGtkNotebook, pos: TGtkPositionType){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_tab_pos".}
+proc gtk_notebook_get_tab_pos*(notebook: PGtkNotebook): TGtkPositionType{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_get_tab_pos".}
+proc gtk_notebook_set_scrollable*(notebook: PGtkNotebook, scrollable: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_scrollable".}
+proc gtk_notebook_get_scrollable*(notebook: PGtkNotebook): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_get_scrollable".}
+proc gtk_notebook_popup_enable*(notebook: PGtkNotebook){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_popup_enable".}
+proc gtk_notebook_popup_disable*(notebook: PGtkNotebook){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_popup_disable".}
+proc gtk_notebook_get_tab_label*(notebook: PGtkNotebook, child: PGtkWidget): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_get_tab_label".}
+proc gtk_notebook_set_tab_label*(notebook: PGtkNotebook, child: PGtkWidget,
+                                 tab_label: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_set_tab_label".}
+proc gtk_notebook_set_tab_label_text*(notebook: PGtkNotebook, child: PGtkWidget,
+                                      tab_text: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_set_tab_label_text".}
+proc gtk_notebook_get_tab_label_text*(notebook: PGtkNotebook, child: PGtkWidget): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_get_tab_label_text".}
+proc gtk_notebook_get_menu_label*(notebook: PGtkNotebook, child: PGtkWidget): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_get_menu_label".}
+proc gtk_notebook_set_menu_label*(notebook: PGtkNotebook, child: PGtkWidget,
+                                  menu_label: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_notebook_set_menu_label".}
+proc gtk_notebook_set_menu_label_text*(notebook: PGtkNotebook,
+                                       child: PGtkWidget, menu_text: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_menu_label_text".}
+proc gtk_notebook_get_menu_label_text*(notebook: PGtkNotebook, child: PGtkWidget): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_get_menu_label_text".}
+proc gtk_notebook_query_tab_label_packing*(notebook: PGtkNotebook,
+    child: PGtkWidget, expand: Pgboolean, fill: Pgboolean,
+    pack_type: PGtkPackType){.cdecl, dynlib: gtklib,
+                              importc: "gtk_notebook_query_tab_label_packing".}
+proc gtk_notebook_set_tab_label_packing*(notebook: PGtkNotebook,
+    child: PGtkWidget, expand: gboolean, fill: gboolean, pack_type: TGtkPackType){.
+    cdecl, dynlib: gtklib, importc: "gtk_notebook_set_tab_label_packing".}
+proc gtk_notebook_reorder_child*(notebook: PGtkNotebook, child: PGtkWidget,
+                                 position: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_notebook_reorder_child".}
+const
+  bm_TGtkOldEditable_has_selection* = 0x00000001
+  bp_TGtkOldEditable_has_selection* = 0
+  bm_TGtkOldEditable_editable* = 0x00000002
+  bp_TGtkOldEditable_editable* = 1
+  bm_TGtkOldEditable_visible* = 0x00000004
+  bp_TGtkOldEditable_visible* = 2
+
+proc GTK_TYPE_OLD_EDITABLE*(): GType
+proc GTK_OLD_EDITABLE*(obj: pointer): PGtkOldEditable
+proc GTK_OLD_EDITABLE_CLASS*(klass: pointer): PGtkOldEditableClass
+proc GTK_IS_OLD_EDITABLE*(obj: pointer): bool
+proc GTK_IS_OLD_EDITABLE_CLASS*(klass: pointer): bool
+proc GTK_OLD_EDITABLE_GET_CLASS*(obj: pointer): PGtkOldEditableClass
+proc has_selection*(a: var TGtkOldEditable): guint
+proc set_has_selection*(a: var TGtkOldEditable, `has_selection`: guint)
+proc editable*(a: var TGtkOldEditable): guint
+proc set_editable*(a: var TGtkOldEditable, `editable`: guint)
+proc visible*(a: var TGtkOldEditable): guint
+proc set_visible*(a: var TGtkOldEditable, `visible`: guint)
+proc gtk_old_editable_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_old_editable_get_type".}
+proc gtk_old_editable_claim_selection*(old_editable: PGtkOldEditable,
+                                       claim: gboolean, time: guint32){.cdecl,
+    dynlib: gtklib, importc: "gtk_old_editable_claim_selection".}
+proc gtk_old_editable_changed*(old_editable: PGtkOldEditable){.cdecl,
+    dynlib: gtklib, importc: "gtk_old_editable_changed".}
+proc GTK_TYPE_OPTION_MENU*(): GType
+proc GTK_OPTION_MENU*(obj: pointer): PGtkOptionMenu
+proc GTK_OPTION_MENU_CLASS*(klass: pointer): PGtkOptionMenuClass
+proc GTK_IS_OPTION_MENU*(obj: pointer): bool
+proc GTK_IS_OPTION_MENU_CLASS*(klass: pointer): bool
+proc GTK_OPTION_MENU_GET_CLASS*(obj: pointer): PGtkOptionMenuClass
+proc gtk_option_menu_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_option_menu_get_type".}
+proc gtk_option_menu_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_option_menu_new".}
+proc gtk_option_menu_get_menu*(option_menu: PGtkOptionMenu): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_option_menu_get_menu".}
+proc gtk_option_menu_set_menu*(option_menu: PGtkOptionMenu, menu: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_option_menu_set_menu".}
+proc gtk_option_menu_remove_menu*(option_menu: PGtkOptionMenu){.cdecl,
+    dynlib: gtklib, importc: "gtk_option_menu_remove_menu".}
+proc gtk_option_menu_get_history*(option_menu: PGtkOptionMenu): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_option_menu_get_history".}
+proc gtk_option_menu_set_history*(option_menu: PGtkOptionMenu, index: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_option_menu_set_history".}
+const
+  bm_TGtkPixmap_build_insensitive* = 0x00000001
+  bp_TGtkPixmap_build_insensitive* = 0
+
+proc GTK_TYPE_PIXMAP*(): GType
+proc GTK_PIXMAP*(obj: pointer): PGtkPixmap
+proc GTK_PIXMAP_CLASS*(klass: pointer): PGtkPixmapClass
+proc GTK_IS_PIXMAP*(obj: pointer): bool
+proc GTK_IS_PIXMAP_CLASS*(klass: pointer): bool
+proc GTK_PIXMAP_GET_CLASS*(obj: pointer): PGtkPixmapClass
+proc build_insensitive*(a: var TGtkPixmap): guint
+proc set_build_insensitive*(a: var TGtkPixmap, `build_insensitive`: guint)
+proc gtk_pixmap_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_pixmap_get_type".}
+proc gtk_pixmap_new*(pixmap: PGdkPixmap, mask: PGdkBitmap): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_pixmap_new".}
+proc gtk_pixmap_set*(pixmap: PGtkPixmap, val: PGdkPixmap, mask: PGdkBitmap){.
+    cdecl, dynlib: gtklib, importc: "gtk_pixmap_set".}
+proc gtk_pixmap_get*(pixmap: PGtkPixmap, val: var PGdkPixmap,
+                     mask: var PGdkBitmap){.cdecl, dynlib: gtklib,
+    importc: "gtk_pixmap_get".}
+proc gtk_pixmap_set_build_insensitive*(pixmap: PGtkPixmap, build: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_pixmap_set_build_insensitive".}
+const
+  bm_TGtkPlug_same_app* = 0x00000001
+  bp_TGtkPlug_same_app* = 0
+
+proc GTK_TYPE_PLUG*(): GType
+proc GTK_PLUG*(obj: pointer): PGtkPlug
+proc GTK_PLUG_CLASS*(klass: pointer): PGtkPlugClass
+proc GTK_IS_PLUG*(obj: pointer): bool
+proc GTK_IS_PLUG_CLASS*(klass: pointer): bool
+proc GTK_PLUG_GET_CLASS*(obj: pointer): PGtkPlugClass
+proc same_app*(a: var TGtkPlug): guint
+proc set_same_app*(a: var TGtkPlug, `same_app`: guint)
+proc gtk_plug_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_plug_get_type".}
+proc gtk_plug_construct_for_display*(plug: PGtkPlug, display: PGdkDisplay,
+                                     socket_id: TGdkNativeWindow){.cdecl,
+    dynlib: gtklib, importc: "gtk_plug_construct_for_display".}
+proc gtk_plug_new_for_display*(display: PGdkDisplay, socket_id: TGdkNativeWindow): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_plug_new_for_display".}
+proc gtk_plug_get_id*(plug: PGtkPlug): TGdkNativeWindow{.cdecl, dynlib: gtklib,
+    importc: "gtk_plug_get_id".}
+proc gtk_plug_add_to_socket*(plug: PGtkPlug, socket: PGtkSocket){.cdecl,
+    dynlib: gtklib, importc: "_gtk_plug_add_to_socket".}
+proc gtk_plug_remove_from_socket*(plug: PGtkPlug, socket: PGtkSocket){.cdecl,
+    dynlib: gtklib, importc: "_gtk_plug_remove_from_socket".}
+const
+  bm_TGtkPreview_type* = 0x00000001
+  bp_TGtkPreview_type* = 0
+  bm_TGtkPreview_expand* = 0x00000002
+  bp_TGtkPreview_expand* = 1
+
+proc GTK_TYPE_PREVIEW*(): GType
+proc GTK_PREVIEW*(obj: pointer): PGtkPreview
+proc GTK_PREVIEW_CLASS*(klass: pointer): PGtkPreviewClass
+proc GTK_IS_PREVIEW*(obj: pointer): bool
+proc GTK_IS_PREVIEW_CLASS*(klass: pointer): bool
+proc GTK_PREVIEW_GET_CLASS*(obj: pointer): PGtkPreviewClass
+proc get_type*(a: var TGtkPreview): guint
+proc set_type*(a: var TGtkPreview, `type`: guint)
+proc get_expand*(a: var TGtkPreview): guint
+proc set_expand*(a: var TGtkPreview, `expand`: guint)
+proc gtk_preview_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_preview_get_type".}
+proc gtk_preview_uninit*(){.cdecl, dynlib: gtklib, importc: "gtk_preview_uninit".}
+proc gtk_preview_new*(thetype: TGtkPreviewClass): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_preview_new".}
+proc gtk_preview_size*(preview: PGtkPreview, width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_preview_size".}
+proc gtk_preview_put*(preview: PGtkPreview, window: PGdkWindow, gc: PGdkGC,
+                      srcx: gint, srcy: gint, destx: gint, desty: gint,
+                      width: gint, height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_put".}
+proc gtk_preview_draw_row*(preview: PGtkPreview, data: Pguchar, x: gint,
+                           y: gint, w: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_draw_row".}
+proc gtk_preview_set_expand*(preview: PGtkPreview, expand: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_preview_set_expand".}
+proc gtk_preview_set_gamma*(gamma: float64){.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_set_gamma".}
+proc gtk_preview_set_color_cube*(nred_shades: guint, ngreen_shades: guint,
+                                 nblue_shades: guint, ngray_shades: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_preview_set_color_cube".}
+proc gtk_preview_set_install_cmap*(install_cmap: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_set_install_cmap".}
+proc gtk_preview_set_reserved*(nreserved: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_set_reserved".}
+proc gtk_preview_set_dither*(preview: PGtkPreview, dither: TGdkRgbDither){.
+    cdecl, dynlib: gtklib, importc: "gtk_preview_set_dither".}
+proc gtk_preview_get_info*(): PGtkPreviewInfo{.cdecl, dynlib: gtklib,
+    importc: "gtk_preview_get_info".}
+proc gtk_preview_reset*(){.cdecl, dynlib: gtklib, importc: "gtk_preview_reset".}
+const
+  bm_TGtkProgress_show_text* = 0x00000001
+  bp_TGtkProgress_show_text* = 0
+  bm_TGtkProgress_activity_mode* = 0x00000002
+  bp_TGtkProgress_activity_mode* = 1
+  bm_TGtkProgress_use_text_format* = 0x00000004
+  bp_TGtkProgress_use_text_format* = 2
+
+proc show_text*(a: var TGtkProgress): guint
+proc set_show_text*(a: var TGtkProgress, `show_text`: guint)
+proc activity_mode*(a: var TGtkProgress): guint
+proc set_activity_mode*(a: var TGtkProgress, `activity_mode`: guint)
+proc use_text_format*(a: var TGtkProgress): guint
+proc set_use_text_format*(a: var TGtkProgress, `use_text_format`: guint)
+const
+  bm_TGtkProgressBar_activity_dir* = 0x00000001
+  bp_TGtkProgressBar_activity_dir* = 0
+
+proc GTK_TYPE_PROGRESS_BAR*(): GType
+proc GTK_PROGRESS_BAR*(obj: pointer): PGtkProgressBar
+proc GTK_PROGRESS_BAR_CLASS*(klass: pointer): PGtkProgressBarClass
+proc GTK_IS_PROGRESS_BAR*(obj: pointer): bool
+proc GTK_IS_PROGRESS_BAR_CLASS*(klass: pointer): bool
+proc GTK_PROGRESS_BAR_GET_CLASS*(obj: pointer): PGtkProgressBarClass
+proc activity_dir*(a: var TGtkProgressBar): guint
+proc set_activity_dir*(a: var TGtkProgressBar, `activity_dir`: guint)
+proc gtk_progress_bar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_progress_bar_get_type".}
+proc gtk_progress_bar_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_progress_bar_new".}
+proc gtk_progress_bar_pulse*(pbar: PGtkProgressBar){.cdecl, dynlib: gtklib,
+    importc: "gtk_progress_bar_pulse".}
+proc gtk_progress_bar_set_text*(pbar: PGtkProgressBar, text: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_progress_bar_set_text".}
+proc gtk_progress_bar_set_fraction*(pbar: PGtkProgressBar, fraction: gdouble){.
+    cdecl, dynlib: gtklib, importc: "gtk_progress_bar_set_fraction".}
+proc gtk_progress_bar_set_pulse_step*(pbar: PGtkProgressBar, fraction: gdouble){.
+    cdecl, dynlib: gtklib, importc: "gtk_progress_bar_set_pulse_step".}
+proc gtk_progress_bar_set_orientation*(pbar: PGtkProgressBar,
+                                       orientation: TGtkProgressBarOrientation){.
+    cdecl, dynlib: gtklib, importc: "gtk_progress_bar_set_orientation".}
+proc gtk_progress_bar_get_text*(pbar: PGtkProgressBar): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_progress_bar_get_text".}
+proc gtk_progress_bar_get_fraction*(pbar: PGtkProgressBar): gdouble{.cdecl,
+    dynlib: gtklib, importc: "gtk_progress_bar_get_fraction".}
+proc gtk_progress_bar_get_pulse_step*(pbar: PGtkProgressBar): gdouble{.cdecl,
+    dynlib: gtklib, importc: "gtk_progress_bar_get_pulse_step".}
+proc gtk_progress_bar_get_orientation*(pbar: PGtkProgressBar): TGtkProgressBarOrientation{.
+    cdecl, dynlib: gtklib, importc: "gtk_progress_bar_get_orientation".}
+proc GTK_TYPE_RADIO_BUTTON*(): GType
+proc GTK_RADIO_BUTTON*(obj: pointer): PGtkRadioButton
+proc GTK_RADIO_BUTTON_CLASS*(klass: pointer): PGtkRadioButtonClass
+proc GTK_IS_RADIO_BUTTON*(obj: pointer): bool
+proc GTK_IS_RADIO_BUTTON_CLASS*(klass: pointer): bool
+proc GTK_RADIO_BUTTON_GET_CLASS*(obj: pointer): PGtkRadioButtonClass
+proc gtk_radio_button_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_radio_button_get_type".}
+proc gtk_radio_button_new*(group: PGSList): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_radio_button_new".}
+proc gtk_radio_button_new_from_widget*(group: PGtkRadioButton): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_button_new_from_widget".}
+proc gtk_radio_button_new_with_label*(group: PGSList, `label`: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_button_new_with_label".}
+proc gtk_radio_button_new_with_label_from_widget*(group: PGtkRadioButton,
+    `label`: cstring): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_radio_button_new_with_label_from_widget".}
+proc gtk_radio_button_new_with_mnemonic*(group: PGSList, `label`: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_button_new_with_mnemonic".}
+proc gtk_radio_button_new_with_mnemonic_from_widget*(group: PGtkRadioButton,
+    `label`: cstring): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_radio_button_new_with_mnemonic_from_widget".}
+proc gtk_radio_button_get_group*(radio_button: PGtkRadioButton): PGSList{.cdecl,
+    dynlib: gtklib, importc: "gtk_radio_button_get_group".}
+proc gtk_radio_button_set_group*(radio_button: PGtkRadioButton, group: PGSList){.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_button_set_group".}
+proc GTK_TYPE_RADIO_MENU_ITEM*(): GType
+proc GTK_RADIO_MENU_ITEM*(obj: pointer): PGtkRadioMenuItem
+proc GTK_RADIO_MENU_ITEM_CLASS*(klass: pointer): PGtkRadioMenuItemClass
+proc GTK_IS_RADIO_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkRadioMenuItemClass
+proc gtk_radio_menu_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_radio_menu_item_get_type".}
+proc gtk_radio_menu_item_new*(group: PGSList): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_radio_menu_item_new".}
+proc gtk_radio_menu_item_new_with_label*(group: PGSList, `label`: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_menu_item_new_with_label".}
+proc gtk_radio_menu_item_new_with_mnemonic*(group: PGSList, `label`: cstring): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_menu_item_new_with_mnemonic".}
+proc gtk_radio_menu_item_get_group*(radio_menu_item: PGtkRadioMenuItem): PGSList{.
+    cdecl, dynlib: gtklib, importc: "gtk_radio_menu_item_get_group".}
+proc gtk_radio_menu_item_set_group*(radio_menu_item: PGtkRadioMenuItem,
+                                    group: PGSList){.cdecl, dynlib: gtklib,
+    importc: "gtk_radio_menu_item_set_group".}
+const
+  bm_TGtkScrolledWindow_hscrollbar_policy* = 0x00000003
+  bp_TGtkScrolledWindow_hscrollbar_policy* = 0
+  bm_TGtkScrolledWindow_vscrollbar_policy* = 0x0000000C
+  bp_TGtkScrolledWindow_vscrollbar_policy* = 2
+  bm_TGtkScrolledWindow_hscrollbar_visible* = 0x00000010
+  bp_TGtkScrolledWindow_hscrollbar_visible* = 4
+  bm_TGtkScrolledWindow_vscrollbar_visible* = 0x00000020
+  bp_TGtkScrolledWindow_vscrollbar_visible* = 5
+  bm_TGtkScrolledWindow_window_placement* = 0x000000C0
+  bp_TGtkScrolledWindow_window_placement* = 6
+  bm_TGtkScrolledWindow_focus_out* = 0x00000100
+  bp_TGtkScrolledWindow_focus_out* = 8
+
+proc GTK_TYPE_SCROLLED_WINDOW*(): GType
+proc GTK_SCROLLED_WINDOW*(obj: pointer): PGtkScrolledWindow
+proc GTK_SCROLLED_WINDOW_CLASS*(klass: pointer): PGtkScrolledWindowClass
+proc GTK_IS_SCROLLED_WINDOW*(obj: pointer): bool
+proc GTK_IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool
+proc GTK_SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PGtkScrolledWindowClass
+proc hscrollbar_policy*(a: var TGtkScrolledWindow): guint
+proc set_hscrollbar_policy*(a: var TGtkScrolledWindow,
+                            `hscrollbar_policy`: guint)
+proc vscrollbar_policy*(a: var TGtkScrolledWindow): guint
+proc set_vscrollbar_policy*(a: var TGtkScrolledWindow,
+                            `vscrollbar_policy`: guint)
+proc hscrollbar_visible*(a: var TGtkScrolledWindow): guint
+proc set_hscrollbar_visible*(a: var TGtkScrolledWindow,
+                             `hscrollbar_visible`: guint)
+proc vscrollbar_visible*(a: var TGtkScrolledWindow): guint
+proc set_vscrollbar_visible*(a: var TGtkScrolledWindow,
+                             `vscrollbar_visible`: guint)
+proc window_placement*(a: var TGtkScrolledWindow): guint
+proc set_window_placement*(a: var TGtkScrolledWindow, `window_placement`: guint)
+proc focus_out*(a: var TGtkScrolledWindow): guint
+proc set_focus_out*(a: var TGtkScrolledWindow, `focus_out`: guint)
+proc gtk_scrolled_window_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_scrolled_window_get_type".}
+proc gtk_scrolled_window_new*(hadjustment: PGtkAdjustment,
+                              vadjustment: PGtkAdjustment): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_scrolled_window_new".}
+proc gtk_scrolled_window_set_hadjustment*(scrolled_window: PGtkScrolledWindow,
+    hadjustment: PGtkAdjustment){.cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_set_hadjustment".}
+proc gtk_scrolled_window_set_vadjustment*(scrolled_window: PGtkScrolledWindow,
+    hadjustment: PGtkAdjustment){.cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_set_vadjustment".}
+proc gtk_scrolled_window_get_hadjustment*(scrolled_window: PGtkScrolledWindow): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_get_hadjustment".}
+proc gtk_scrolled_window_get_vadjustment*(scrolled_window: PGtkScrolledWindow): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_get_vadjustment".}
+proc gtk_scrolled_window_set_policy*(scrolled_window: PGtkScrolledWindow,
+                                     hscrollbar_policy: TGtkPolicyType,
+                                     vscrollbar_policy: TGtkPolicyType){.cdecl,
+    dynlib: gtklib, importc: "gtk_scrolled_window_set_policy".}
+proc gtk_scrolled_window_get_policy*(scrolled_window: PGtkScrolledWindow,
+                                     hscrollbar_policy: PGtkPolicyType,
+                                     vscrollbar_policy: PGtkPolicyType){.cdecl,
+    dynlib: gtklib, importc: "gtk_scrolled_window_get_policy".}
+proc gtk_scrolled_window_set_placement*(scrolled_window: PGtkScrolledWindow,
+                                        window_placement: TGtkCornerType){.
+    cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_set_placement".}
+proc gtk_scrolled_window_get_placement*(scrolled_window: PGtkScrolledWindow): TGtkCornerType{.
+    cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_get_placement".}
+proc gtk_scrolled_window_set_shadow_type*(scrolled_window: PGtkScrolledWindow,
+    thetype: TGtkShadowType){.cdecl, dynlib: gtklib,
+                              importc: "gtk_scrolled_window_set_shadow_type".}
+proc gtk_scrolled_window_get_shadow_type*(scrolled_window: PGtkScrolledWindow): TGtkShadowType{.
+    cdecl, dynlib: gtklib, importc: "gtk_scrolled_window_get_shadow_type".}
+proc gtk_scrolled_window_add_with_viewport*(scrolled_window: PGtkScrolledWindow,
+    child: PGtkWidget){.cdecl, dynlib: gtklib,
+                        importc: "gtk_scrolled_window_add_with_viewport".}
+proc GTK_TYPE_SELECTION_DATA*(): GType
+proc gtk_target_list_new*(targets: PGtkTargetEntry, ntargets: guint): PGtkTargetList{.
+    cdecl, dynlib: gtklib, importc: "gtk_target_list_new".}
+proc gtk_target_list_ref*(list: PGtkTargetList){.cdecl, dynlib: gtklib,
+    importc: "gtk_target_list_ref".}
+proc gtk_target_list_unref*(list: PGtkTargetList){.cdecl, dynlib: gtklib,
+    importc: "gtk_target_list_unref".}
+proc gtk_target_list_add*(list: PGtkTargetList, target: TGdkAtom, flags: guint,
+                          info: guint){.cdecl, dynlib: gtklib,
+                                        importc: "gtk_target_list_add".}
+proc gtk_target_list_add_table*(list: PGtkTargetList, targets: PGtkTargetEntry,
+                                ntargets: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_target_list_add_table".}
+proc gtk_target_list_remove*(list: PGtkTargetList, target: TGdkAtom){.cdecl,
+    dynlib: gtklib, importc: "gtk_target_list_remove".}
+proc gtk_target_list_find*(list: PGtkTargetList, target: TGdkAtom, info: Pguint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_target_list_find".}
+proc gtk_selection_owner_set*(widget: PGtkWidget, selection: TGdkAtom,
+                              time: guint32): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_selection_owner_set".}
+proc gtk_selection_owner_set_for_display*(display: PGdkDisplay,
+    widget: PGtkWidget, selection: TGdkAtom, time: guint32): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_selection_owner_set_for_display".}
+proc gtk_selection_add_target*(widget: PGtkWidget, selection: TGdkAtom,
+                               target: TGdkAtom, info: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_selection_add_target".}
+proc gtk_selection_add_targets*(widget: PGtkWidget, selection: TGdkAtom,
+                                targets: PGtkTargetEntry, ntargets: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_add_targets".}
+proc gtk_selection_clear_targets*(widget: PGtkWidget, selection: TGdkAtom){.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_clear_targets".}
+proc gtk_selection_convert*(widget: PGtkWidget, selection: TGdkAtom,
+                            target: TGdkAtom, time: guint32): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_selection_convert".}
+proc gtk_selection_data_set*(selection_data: PGtkSelectionData,
+                             thetype: TGdkAtom, format: gint, data: Pguchar,
+                             length: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_selection_data_set".}
+proc gtk_selection_data_set_text*(selection_data: PGtkSelectionData,
+                                  str: cstring, len: gint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_selection_data_set_text".}
+proc gtk_selection_data_get_text*(selection_data: PGtkSelectionData): Pguchar{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_data_get_text".}
+proc gtk_selection_data_targets_include_text*(selection_data: PGtkSelectionData): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_data_targets_include_text".}
+proc gtk_selection_remove_all*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "gtk_selection_remove_all".}
+proc gtk_selection_clear*(widget: PGtkWidget, event: PGdkEventSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_clear".}
+proc gtk_selection_request*(widget: PGtkWidget, event: PGdkEventSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_request".}
+proc gtk_selection_incr_event*(window: PGdkWindow, event: PGdkEventProperty): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_incr_event".}
+proc gtk_selection_notify*(widget: PGtkWidget, event: PGdkEventSelection): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_notify".}
+proc gtk_selection_property_notify*(widget: PGtkWidget, event: PGdkEventProperty): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_property_notify".}
+proc gtk_selection_data_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_selection_data_get_type".}
+proc gtk_selection_data_copy*(data: PGtkSelectionData): PGtkSelectionData{.
+    cdecl, dynlib: gtklib, importc: "gtk_selection_data_copy".}
+proc gtk_selection_data_free*(data: PGtkSelectionData){.cdecl, dynlib: gtklib,
+    importc: "gtk_selection_data_free".}
+proc GTK_TYPE_SEPARATOR_MENU_ITEM*(): GType
+proc GTK_SEPARATOR_MENU_ITEM*(obj: pointer): PGtkSeparatorMenuItem
+proc GTK_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PGtkSeparatorMenuItemClass
+proc GTK_IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkSeparatorMenuItemClass
+proc gtk_separator_menu_item_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_separator_menu_item_get_type".}
+proc gtk_separator_menu_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_separator_menu_item_new".}
+const
+  bm_TGtkSizeGroup_have_width* = 0x00000001
+  bp_TGtkSizeGroup_have_width* = 0
+  bm_TGtkSizeGroup_have_height* = 0x00000002
+  bp_TGtkSizeGroup_have_height* = 1
+
+proc GTK_TYPE_SIZE_GROUP*(): GType
+proc GTK_SIZE_GROUP*(obj: pointer): PGtkSizeGroup
+proc GTK_SIZE_GROUP_CLASS*(klass: pointer): PGtkSizeGroupClass
+proc GTK_IS_SIZE_GROUP*(obj: pointer): bool
+proc GTK_IS_SIZE_GROUP_CLASS*(klass: pointer): bool
+proc GTK_SIZE_GROUP_GET_CLASS*(obj: pointer): PGtkSizeGroupClass
+proc have_width*(a: var TGtkSizeGroup): guint
+proc set_have_width*(a: var TGtkSizeGroup, `have_width`: guint)
+proc have_height*(a: var TGtkSizeGroup): guint
+proc set_have_height*(a: var TGtkSizeGroup, `have_height`: guint)
+proc gtk_size_group_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_size_group_get_type".}
+proc gtk_size_group_new*(mode: TGtkSizeGroupMode): PGtkSizeGroup{.cdecl,
+    dynlib: gtklib, importc: "gtk_size_group_new".}
+proc gtk_size_group_set_mode*(size_group: PGtkSizeGroup, mode: TGtkSizeGroupMode){.
+    cdecl, dynlib: gtklib, importc: "gtk_size_group_set_mode".}
+proc gtk_size_group_get_mode*(size_group: PGtkSizeGroup): TGtkSizeGroupMode{.
+    cdecl, dynlib: gtklib, importc: "gtk_size_group_get_mode".}
+proc gtk_size_group_add_widget*(size_group: PGtkSizeGroup, widget: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_size_group_add_widget".}
+proc gtk_size_group_remove_widget*(size_group: PGtkSizeGroup, widget: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_size_group_remove_widget".}
+proc gtk_size_group_get_child_requisition*(widget: PGtkWidget,
+    requisition: PGtkRequisition){.cdecl, dynlib: gtklib, importc: "_gtk_size_group_get_child_requisition".}
+proc gtk_size_group_compute_requisition*(widget: PGtkWidget,
+    requisition: PGtkRequisition){.cdecl, dynlib: gtklib, importc: "_gtk_size_group_compute_requisition".}
+proc gtk_size_group_queue_resize*(widget: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "_gtk_size_group_queue_resize".}
+const
+  bm_TGtkSocket_same_app* = 0x00000001
+  bp_TGtkSocket_same_app* = 0
+  bm_TGtkSocket_focus_in* = 0x00000002
+  bp_TGtkSocket_focus_in* = 1
+  bm_TGtkSocket_have_size* = 0x00000004
+  bp_TGtkSocket_have_size* = 2
+  bm_TGtkSocket_need_map* = 0x00000008
+  bp_TGtkSocket_need_map* = 3
+  bm_TGtkSocket_is_mapped* = 0x00000010
+  bp_TGtkSocket_is_mapped* = 4
+
+proc GTK_TYPE_SOCKET*(): GType
+proc GTK_SOCKET*(obj: pointer): PGtkSocket
+proc GTK_SOCKET_CLASS*(klass: pointer): PGtkSocketClass
+proc GTK_IS_SOCKET*(obj: pointer): bool
+proc GTK_IS_SOCKET_CLASS*(klass: pointer): bool
+proc GTK_SOCKET_GET_CLASS*(obj: pointer): PGtkSocketClass
+proc same_app*(a: var TGtkSocket): guint
+proc set_same_app*(a: var TGtkSocket, `same_app`: guint)
+proc focus_in*(a: var TGtkSocket): guint
+proc set_focus_in*(a: var TGtkSocket, `focus_in`: guint)
+proc have_size*(a: var TGtkSocket): guint
+proc set_have_size*(a: var TGtkSocket, `have_size`: guint)
+proc need_map*(a: var TGtkSocket): guint
+proc set_need_map*(a: var TGtkSocket, `need_map`: guint)
+proc is_mapped*(a: var TGtkSocket): guint
+proc set_is_mapped*(a: var TGtkSocket, `is_mapped`: guint)
+proc gtk_socket_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_socket_new".}
+proc gtk_socket_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_socket_get_type".}
+proc gtk_socket_add_id*(socket: PGtkSocket, window_id: TGdkNativeWindow){.cdecl,
+    dynlib: gtklib, importc: "gtk_socket_add_id".}
+proc gtk_socket_get_id*(socket: PGtkSocket): TGdkNativeWindow{.cdecl,
+    dynlib: gtklib, importc: "gtk_socket_get_id".}
+const
+  GTK_INPUT_ERROR* = - (1)
+  bm_TGtkSpinButton_in_child* = 0x00000003
+  bp_TGtkSpinButton_in_child* = 0
+  bm_TGtkSpinButton_click_child* = 0x0000000C
+  bp_TGtkSpinButton_click_child* = 2
+  bm_TGtkSpinButton_button* = 0x00000030
+  bp_TGtkSpinButton_button* = 4
+  bm_TGtkSpinButton_need_timer* = 0x00000040
+  bp_TGtkSpinButton_need_timer* = 6
+  bm_TGtkSpinButton_timer_calls* = 0x00000380
+  bp_TGtkSpinButton_timer_calls* = 7
+  bm_TGtkSpinButton_digits* = 0x000FFC00
+  bp_TGtkSpinButton_digits* = 10
+  bm_TGtkSpinButton_numeric* = 0x00100000
+  bp_TGtkSpinButton_numeric* = 20
+  bm_TGtkSpinButton_wrap* = 0x00200000
+  bp_TGtkSpinButton_wrap* = 21
+  bm_TGtkSpinButton_snap_to_ticks* = 0x00400000
+  bp_TGtkSpinButton_snap_to_ticks* = 22
+
+proc GTK_TYPE_SPIN_BUTTON*(): GType
+proc GTK_SPIN_BUTTON*(obj: pointer): PGtkSpinButton
+proc GTK_SPIN_BUTTON_CLASS*(klass: pointer): PGtkSpinButtonClass
+proc GTK_IS_SPIN_BUTTON*(obj: pointer): bool
+proc GTK_IS_SPIN_BUTTON_CLASS*(klass: pointer): bool
+proc GTK_SPIN_BUTTON_GET_CLASS*(obj: pointer): PGtkSpinButtonClass
+proc in_child*(a: var TGtkSpinButton): guint
+proc set_in_child*(a: var TGtkSpinButton, `in_child`: guint)
+proc click_child*(a: var TGtkSpinButton): guint
+proc set_click_child*(a: var TGtkSpinButton, `click_child`: guint)
+proc button*(a: var TGtkSpinButton): guint
+proc set_button*(a: var TGtkSpinButton, `button`: guint)
+proc need_timer*(a: var TGtkSpinButton): guint
+proc set_need_timer*(a: var TGtkSpinButton, `need_timer`: guint)
+proc timer_calls*(a: var TGtkSpinButton): guint
+proc set_timer_calls*(a: var TGtkSpinButton, `timer_calls`: guint)
+proc digits*(a: var TGtkSpinButton): guint
+proc set_digits*(a: var TGtkSpinButton, `digits`: guint)
+proc numeric*(a: var TGtkSpinButton): guint
+proc set_numeric*(a: var TGtkSpinButton, `numeric`: guint)
+proc wrap*(a: var TGtkSpinButton): guint
+proc set_wrap*(a: var TGtkSpinButton, `wrap`: guint)
+proc snap_to_ticks*(a: var TGtkSpinButton): guint
+proc set_snap_to_ticks*(a: var TGtkSpinButton, `snap_to_ticks`: guint)
+proc gtk_spin_button_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_get_type".}
+proc gtk_spin_button_configure*(spin_button: PGtkSpinButton,
+                                adjustment: PGtkAdjustment, climb_rate: gdouble,
+                                digits: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_configure".}
+proc gtk_spin_button_new*(adjustment: PGtkAdjustment, climb_rate: gdouble,
+                          digits: guint): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_new".}
+proc gtk_spin_button_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_new_with_range".}
+proc gtk_spin_button_set_adjustment*(spin_button: PGtkSpinButton,
+                                     adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_set_adjustment".}
+proc gtk_spin_button_get_adjustment*(spin_button: PGtkSpinButton): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_get_adjustment".}
+proc gtk_spin_button_set_digits*(spin_button: PGtkSpinButton, digits: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_set_digits".}
+proc gtk_spin_button_get_digits*(spin_button: PGtkSpinButton): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_get_digits".}
+proc gtk_spin_button_set_increments*(spin_button: PGtkSpinButton, step: gdouble,
+                                     page: gdouble){.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_set_increments".}
+proc gtk_spin_button_get_increments*(spin_button: PGtkSpinButton,
+                                     step: Pgdouble, page: Pgdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_get_increments".}
+proc gtk_spin_button_set_range*(spin_button: PGtkSpinButton, min: gdouble,
+                                max: gdouble){.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_set_range".}
+proc gtk_spin_button_get_range*(spin_button: PGtkSpinButton, min: Pgdouble,
+                                max: Pgdouble){.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_get_range".}
+proc gtk_spin_button_get_value*(spin_button: PGtkSpinButton): gdouble{.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_get_value".}
+proc gtk_spin_button_get_value_as_int*(spin_button: PGtkSpinButton): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_get_value_as_int".}
+proc gtk_spin_button_set_value*(spin_button: PGtkSpinButton, value: gdouble){.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_set_value".}
+proc gtk_spin_button_set_update_policy*(spin_button: PGtkSpinButton,
+                                        policy: TGtkSpinButtonUpdatePolicy){.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_set_update_policy".}
+proc gtk_spin_button_get_update_policy*(spin_button: PGtkSpinButton): TGtkSpinButtonUpdatePolicy{.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_get_update_policy".}
+proc gtk_spin_button_set_numeric*(spin_button: PGtkSpinButton, numeric: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_set_numeric".}
+proc gtk_spin_button_get_numeric*(spin_button: PGtkSpinButton): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_get_numeric".}
+proc gtk_spin_button_spin*(spin_button: PGtkSpinButton, direction: TGtkSpinType,
+                           increment: gdouble){.cdecl, dynlib: gtklib,
+    importc: "gtk_spin_button_spin".}
+proc gtk_spin_button_set_wrap*(spin_button: PGtkSpinButton, wrap: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_set_wrap".}
+proc gtk_spin_button_get_wrap*(spin_button: PGtkSpinButton): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_get_wrap".}
+proc gtk_spin_button_set_snap_to_ticks*(spin_button: PGtkSpinButton,
+                                        snap_to_ticks: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_set_snap_to_ticks".}
+proc gtk_spin_button_get_snap_to_ticks*(spin_button: PGtkSpinButton): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_spin_button_get_snap_to_ticks".}
+proc gtk_spin_button_update*(spin_button: PGtkSpinButton){.cdecl,
+    dynlib: gtklib, importc: "gtk_spin_button_update".}
+const
+  GTK_STOCK_DIALOG_INFO* = "gtk-dialog-info"
+  GTK_STOCK_DIALOG_WARNING* = "gtk-dialog-warning"
+  GTK_STOCK_DIALOG_ERROR* = "gtk-dialog-error"
+  GTK_STOCK_DIALOG_QUESTION* = "gtk-dialog-question"
+  GTK_STOCK_DND* = "gtk-dnd"
+  GTK_STOCK_DND_MULTIPLE* = "gtk-dnd-multiple"
+  GTK_STOCK_ABOUT* = "gtk-about"
+  GTK_STOCK_ADD_name* = "gtk-add"
+  GTK_STOCK_APPLY* = "gtk-apply"
+  GTK_STOCK_BOLD* = "gtk-bold"
+  GTK_STOCK_CANCEL* = "gtk-cancel"
+  GTK_STOCK_CDROM* = "gtk-cdrom"
+  GTK_STOCK_CLEAR* = "gtk-clear"
+  GTK_STOCK_CLOSE* = "gtk-close"
+  GTK_STOCK_COLOR_PICKER* = "gtk-color-picker"
+  GTK_STOCK_CONVERT* = "gtk-convert"
+  GTK_STOCK_CONNECT* = "gtk-connect"
+  GTK_STOCK_COPY* = "gtk-copy"
+  GTK_STOCK_CUT* = "gtk-cut"
+  GTK_STOCK_DELETE* = "gtk-delete"
+  GTK_STOCK_EXECUTE* = "gtk-execute"
+  GTK_STOCK_FIND* = "gtk-find"
+  GTK_STOCK_FIND_AND_REPLACE* = "gtk-find-and-replace"
+  GTK_STOCK_FLOPPY* = "gtk-floppy"
+  GTK_STOCK_GOTO_BOTTOM* = "gtk-goto-bottom"
+  GTK_STOCK_GOTO_FIRST* = "gtk-goto-first"
+  GTK_STOCK_GOTO_LAST* = "gtk-goto-last"
+  GTK_STOCK_GOTO_TOP* = "gtk-goto-top"
+  GTK_STOCK_GO_BACK* = "gtk-go-back"
+  GTK_STOCK_GO_DOWN* = "gtk-go-down"
+  GTK_STOCK_GO_FORWARD* = "gtk-go-forward"
+  GTK_STOCK_GO_UP* = "gtk-go-up"
+  GTK_STOCK_HELP* = "gtk-help"
+  GTK_STOCK_HOME* = "gtk-home"
+  GTK_STOCK_INDEX* = "gtk-index"
+  GTK_STOCK_ITALIC* = "gtk-italic"
+  GTK_STOCK_JUMP_TO* = "gtk-jump-to"
+  GTK_STOCK_JUSTIFY_CENTER* = "gtk-justify-center"
+  GTK_STOCK_JUSTIFY_FILL* = "gtk-justify-fill"
+  GTK_STOCK_JUSTIFY_LEFT* = "gtk-justify-left"
+  GTK_STOCK_JUSTIFY_RIGHT* = "gtk-justify-right"
+  GTK_STOCK_MEDIA_FORWARD* = "gtk-media-forward"
+  GTK_STOCK_MEDIA_NEXT* = "gtk-media-next"
+  GTK_STOCK_MEDIA_PAUSE* = "gtk-media-pause"
+  GTK_STOCK_MEDIA_PLAY* = "gtk-media-play"
+  GTK_STOCK_MEDIA_PREVIOUS* = "gtk-media-previous"
+  GTK_STOCK_MEDIA_RECORD* = "gtk-media-record"
+  GTK_STOCK_MEDIA_REWIND* = "gtk-media-rewind"
+  GTK_STOCK_MEDIA_STOP* = "gtk-media-stop"
+  GTK_STOCK_MISSING_IMAGE* = "gtk-missing-image"
+  GTK_STOCK_NEW* = "gtk-new"
+  GTK_STOCK_NO* = "gtk-no"
+  GTK_STOCK_OK* = "gtk-ok"
+  GTK_STOCK_OPEN* = "gtk-open"
+  GTK_STOCK_PASTE* = "gtk-paste"
+  GTK_STOCK_PREFERENCES* = "gtk-preferences"
+  GTK_STOCK_PRINT* = "gtk-print"
+  GTK_STOCK_PRINT_PREVIEW* = "gtk-print-preview"
+  GTK_STOCK_PROPERTIES* = "gtk-properties"
+  GTK_STOCK_QUIT* = "gtk-quit"
+  GTK_STOCK_REDO* = "gtk-redo"
+  GTK_STOCK_REFRESH* = "gtk-refresh"
+  GTK_STOCK_REMOVE* = "gtk-remove"
+  GTK_STOCK_REVERT_TO_SAVED* = "gtk-revert-to-saved"
+  GTK_STOCK_SAVE* = "gtk-save"
+  GTK_STOCK_SAVE_AS* = "gtk-save-as"
+  GTK_STOCK_SELECT_COLOR* = "gtk-select-color"
+  GTK_STOCK_SELECT_FONT* = "gtk-select-font"
+  GTK_STOCK_SORT_ASCENDING* = "gtk-sort-ascending"
+  GTK_STOCK_SORT_DESCENDING* = "gtk-sort-descending"
+  GTK_STOCK_SPELL_CHECK* = "gtk-spell-check"
+  GTK_STOCK_STOP* = "gtk-stop"
+  GTK_STOCK_STRIKETHROUGH* = "gtk-strikethrough"
+  GTK_STOCK_UNDELETE* = "gtk-undelete"
+  GTK_STOCK_UNDERLINE* = "gtk-underline"
+  GTK_STOCK_UNDO* = "gtk-undo"
+  GTK_STOCK_YES* = "gtk-yes"
+  GTK_STOCK_ZOOM_100* = "gtk-zoom-100"
+  GTK_STOCK_ZOOM_FIT* = "gtk-zoom-fit"
+  GTK_STOCK_ZOOM_IN* = "gtk-zoom-in"
+  GTK_STOCK_ZOOM_OUT* = "gtk-zoom-out"
+
+proc gtk_stock_add*(items: PGtkStockItem, n_items: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_stock_add".}
+proc gtk_stock_add_static*(items: PGtkStockItem, n_items: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_stock_add_static".}
+proc gtk_stock_lookup*(stock_id: cstring, item: PGtkStockItem): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_stock_lookup".}
+proc gtk_stock_list_ids*(): PGSList{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_stock_list_ids".}
+proc gtk_stock_item_copy*(item: PGtkStockItem): PGtkStockItem{.cdecl,
+    dynlib: gtklib, importc: "gtk_stock_item_copy".}
+proc gtk_stock_item_free*(item: PGtkStockItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_stock_item_free".}
+proc GTK_TYPE_STATUSBAR*(): GType
+proc GTK_STATUSBAR*(obj: pointer): PGtkStatusbar
+proc GTK_STATUSBAR_CLASS*(klass: pointer): PGtkStatusbarClass
+proc GTK_IS_STATUSBAR*(obj: pointer): bool
+proc GTK_IS_STATUSBAR_CLASS*(klass: pointer): bool
+proc GTK_STATUSBAR_GET_CLASS*(obj: pointer): PGtkStatusbarClass
+const
+  bm_TGtkStatusbar_has_resize_grip* = 0x00000001
+  bp_TGtkStatusbar_has_resize_grip* = 0
+
+proc has_resize_grip*(a: var TGtkStatusbar): guint
+proc set_has_resize_grip*(a: var TGtkStatusbar, `has_resize_grip`: guint)
+proc gtk_statusbar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_statusbar_get_type".}
+proc gtk_statusbar_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_statusbar_new".}
+proc gtk_statusbar_get_context_id*(statusbar: PGtkStatusbar,
+                                   context_description: cstring): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_statusbar_get_context_id".}
+proc gtk_statusbar_push*(statusbar: PGtkStatusbar, context_id: guint,
+                         text: cstring): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_statusbar_push".}
+proc gtk_statusbar_pop*(statusbar: PGtkStatusbar, context_id: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_statusbar_pop".}
+proc gtk_statusbar_remove*(statusbar: PGtkStatusbar, context_id: guint,
+                           message_id: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_statusbar_remove".}
+proc gtk_statusbar_set_has_resize_grip*(statusbar: PGtkStatusbar,
+                                        setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_statusbar_set_has_resize_grip".}
+proc gtk_statusbar_get_has_resize_grip*(statusbar: PGtkStatusbar): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_statusbar_get_has_resize_grip".}
+const
+  bm_TGtkTable_homogeneous* = 0x00000001
+  bp_TGtkTable_homogeneous* = 0
+  bm_TGtkTableChild_xexpand* = 0x00000001
+  bp_TGtkTableChild_xexpand* = 0
+  bm_TGtkTableChild_yexpand* = 0x00000002
+  bp_TGtkTableChild_yexpand* = 1
+  bm_TGtkTableChild_xshrink* = 0x00000004
+  bp_TGtkTableChild_xshrink* = 2
+  bm_TGtkTableChild_yshrink* = 0x00000008
+  bp_TGtkTableChild_yshrink* = 3
+  bm_TGtkTableChild_xfill* = 0x00000010
+  bp_TGtkTableChild_xfill* = 4
+  bm_TGtkTableChild_yfill* = 0x00000020
+  bp_TGtkTableChild_yfill* = 5
+  bm_TGtkTableRowCol_need_expand* = 0x00000001
+  bp_TGtkTableRowCol_need_expand* = 0
+  bm_TGtkTableRowCol_need_shrink* = 0x00000002
+  bp_TGtkTableRowCol_need_shrink* = 1
+  bm_TGtkTableRowCol_expand* = 0x00000004
+  bp_TGtkTableRowCol_expand* = 2
+  bm_TGtkTableRowCol_shrink* = 0x00000008
+  bp_TGtkTableRowCol_shrink* = 3
+  bm_TGtkTableRowCol_empty* = 0x00000010
+  bp_TGtkTableRowCol_empty* = 4
+
+proc GTK_TYPE_TABLE*(): GType
+proc GTK_TABLE*(obj: pointer): PGtkTable
+proc GTK_TABLE_CLASS*(klass: pointer): PGtkTableClass
+proc GTK_IS_TABLE*(obj: pointer): bool
+proc GTK_IS_TABLE_CLASS*(klass: pointer): bool
+proc GTK_TABLE_GET_CLASS*(obj: pointer): PGtkTableClass
+proc homogeneous*(a: var TGtkTable): guint
+proc set_homogeneous*(a: var TGtkTable, `homogeneous`: guint)
+proc xexpand*(a: var TGtkTableChild): guint
+proc set_xexpand*(a: var TGtkTableChild, `xexpand`: guint)
+proc yexpand*(a: var TGtkTableChild): guint
+proc set_yexpand*(a: var TGtkTableChild, `yexpand`: guint)
+proc xshrink*(a: var TGtkTableChild): guint
+proc set_xshrink*(a: var TGtkTableChild, `xshrink`: guint)
+proc yshrink*(a: var TGtkTableChild): guint
+proc set_yshrink*(a: var TGtkTableChild, `yshrink`: guint)
+proc xfill*(a: var TGtkTableChild): guint
+proc set_xfill*(a: var TGtkTableChild, `xfill`: guint)
+proc yfill*(a: var TGtkTableChild): guint
+proc set_yfill*(a: var TGtkTableChild, `yfill`: guint)
+proc need_expand*(a: var TGtkTableRowCol): guint
+proc set_need_expand*(a: var TGtkTableRowCol, `need_expand`: guint)
+proc need_shrink*(a: var TGtkTableRowCol): guint
+proc set_need_shrink*(a: var TGtkTableRowCol, `need_shrink`: guint)
+proc expand*(a: var TGtkTableRowCol): guint
+proc set_expand*(a: var TGtkTableRowCol, `expand`: guint)
+proc shrink*(a: var TGtkTableRowCol): guint
+proc set_shrink*(a: var TGtkTableRowCol, `shrink`: guint)
+proc empty*(a: var TGtkTableRowCol): guint
+proc set_empty*(a: var TGtkTableRowCol, `empty`: guint)
+proc gtk_table_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_table_get_type".}
+proc gtk_table_new*(rows: guint, columns: guint, homogeneous: gboolean): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_table_new".}
+proc gtk_table_resize*(table: PGtkTable, rows: guint, columns: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_table_resize".}
+proc gtk_table_attach*(table: PGtkTable, child: PGtkWidget, left_attach: guint,
+                       right_attach: guint, top_attach: guint,
+                       bottom_attach: guint, xoptions: TGtkAttachOptions,
+                       yoptions: TGtkAttachOptions, xpadding: guint,
+                       ypadding: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_table_attach".}
+proc gtk_table_attach_defaults*(table: PGtkTable, widget: PGtkWidget,
+                                left_attach: guint, right_attach: guint,
+                                top_attach: guint, bottom_attach: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_table_attach_defaults".}
+proc gtk_table_set_row_spacing*(table: PGtkTable, row: guint, spacing: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_table_set_row_spacing".}
+proc gtk_table_get_row_spacing*(table: PGtkTable, row: guint): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_table_get_row_spacing".}
+proc gtk_table_set_col_spacing*(table: PGtkTable, column: guint, spacing: guint){.
+    cdecl, dynlib: gtklib, importc: "gtk_table_set_col_spacing".}
+proc gtk_table_get_col_spacing*(table: PGtkTable, column: guint): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_table_get_col_spacing".}
+proc gtk_table_set_row_spacings*(table: PGtkTable, spacing: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_table_set_row_spacings".}
+proc gtk_table_get_default_row_spacing*(table: PGtkTable): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_table_get_default_row_spacing".}
+proc gtk_table_set_col_spacings*(table: PGtkTable, spacing: guint){.cdecl,
+    dynlib: gtklib, importc: "gtk_table_set_col_spacings".}
+proc gtk_table_get_default_col_spacing*(table: PGtkTable): guint{.cdecl,
+    dynlib: gtklib, importc: "gtk_table_get_default_col_spacing".}
+proc gtk_table_set_homogeneous*(table: PGtkTable, homogeneous: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_table_set_homogeneous".}
+proc gtk_table_get_homogeneous*(table: PGtkTable): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_table_get_homogeneous".}
+const
+  bm_TGtkTearoffMenuItem_torn_off* = 0x00000001
+  bp_TGtkTearoffMenuItem_torn_off* = 0
+
+proc GTK_TYPE_TEAROFF_MENU_ITEM*(): GType
+proc GTK_TEAROFF_MENU_ITEM*(obj: pointer): PGtkTearoffMenuItem
+proc GTK_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PGtkTearoffMenuItemClass
+proc GTK_IS_TEAROFF_MENU_ITEM*(obj: pointer): bool
+proc GTK_IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool
+proc GTK_TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkTearoffMenuItemClass
+proc torn_off*(a: var TGtkTearoffMenuItem): guint
+proc set_torn_off*(a: var TGtkTearoffMenuItem, `torn_off`: guint)
+proc gtk_tearoff_menu_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tearoff_menu_item_get_type".}
+proc gtk_tearoff_menu_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_tearoff_menu_item_new".}
+const
+  bm_TGtkText_line_wrap* = 0x00000001
+  bp_TGtkText_line_wrap* = 0
+  bm_TGtkText_word_wrap* = 0x00000002
+  bp_TGtkText_word_wrap* = 1
+  bm_TGtkText_use_wchar* = 0x00000004
+  bp_TGtkText_use_wchar* = 2
+
+proc GTK_TYPE_TEXT*(): GType
+proc GTK_TEXT*(obj: pointer): PGtkText
+proc GTK_TEXT_CLASS*(klass: pointer): PGtkTextClass
+proc GTK_IS_TEXT*(obj: pointer): bool
+proc GTK_IS_TEXT_CLASS*(klass: pointer): bool
+proc GTK_TEXT_GET_CLASS*(obj: pointer): PGtkTextClass
+proc line_wrap*(a: PGtkText): guint
+proc set_line_wrap*(a: PGtkText, `line_wrap`: guint)
+proc word_wrap*(a: PGtkText): guint
+proc set_word_wrap*(a: PGtkText, `word_wrap`: guint)
+proc use_wchar*(a: PGtkText): gboolean
+proc set_use_wchar*(a: PGtkText, `use_wchar`: gboolean)
+proc gtk_text_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_text_get_type".}
+proc gtk_text_new*(hadj: PGtkAdjustment, vadj: PGtkAdjustment): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_new".}
+proc gtk_text_set_editable*(text: PGtkText, editable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_set_editable".}
+proc gtk_text_set_word_wrap*(text: PGtkText, word_wrap: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_set_word_wrap".}
+proc gtk_text_set_line_wrap*(text: PGtkText, line_wrap: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_set_line_wrap".}
+proc gtk_text_set_adjustments*(text: PGtkText, hadj: PGtkAdjustment,
+                               vadj: PGtkAdjustment){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_set_adjustments".}
+proc gtk_text_set_point*(text: PGtkText, index: guint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_set_point".}
+proc gtk_text_get_point*(text: PGtkText): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_get_point".}
+proc gtk_text_get_length*(text: PGtkText): guint{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_get_length".}
+proc gtk_text_freeze*(text: PGtkText){.cdecl, dynlib: gtklib,
+                                       importc: "gtk_text_freeze".}
+proc gtk_text_thaw*(text: PGtkText){.cdecl, dynlib: gtklib,
+                                     importc: "gtk_text_thaw".}
+proc gtk_text_insert*(text: PGtkText, font: PGdkFont, fore: PGdkColor,
+                      back: PGdkColor, chars: cstring, length: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_insert".}
+proc gtk_text_backward_delete*(text: PGtkText, nchars: guint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_backward_delete".}
+proc gtk_text_forward_delete*(text: PGtkText, nchars: guint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_forward_delete".}
+proc GTK_TEXT_INDEX_WCHAR*(t: PGtkText, index: guint): guint32
+proc GTK_TEXT_INDEX_UCHAR*(t: PGtkText, index: guint): GUChar
+const
+  GTK_TEXT_SEARCH_VISIBLE_ONLY* = 0
+  GTK_TEXT_SEARCH_TEXT_ONLY* = 1
+
+proc GTK_TYPE_TEXT_ITER*(): GType
+proc gtk_text_iter_get_buffer*(iter: PGtkTextIter): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_buffer".}
+proc gtk_text_iter_copy*(iter: PGtkTextIter): PGtkTextIter{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_copy".}
+proc gtk_text_iter_free*(iter: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_iter_free".}
+proc gtk_text_iter_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_text_iter_get_type".}
+proc gtk_text_iter_get_offset*(iter: PGtkTextIter): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_iter_get_offset".}
+proc gtk_text_iter_get_line*(iter: PGtkTextIter): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_iter_get_line".}
+proc gtk_text_iter_get_line_offset*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_line_offset".}
+proc gtk_text_iter_get_line_index*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_line_index".}
+proc gtk_text_iter_get_visible_line_offset*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_visible_line_offset".}
+proc gtk_text_iter_get_visible_line_index*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_visible_line_index".}
+proc gtk_text_iter_get_char*(iter: PGtkTextIter): gunichar{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_char".}
+proc gtk_text_iter_get_slice*(start: PGtkTextIter, theEnd: PGtkTextIter): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_slice".}
+proc gtk_text_iter_get_text*(start: PGtkTextIter, theEnd: PGtkTextIter): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_text".}
+proc gtk_text_iter_get_visible_slice*(start: PGtkTextIter, theEnd: PGtkTextIter): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_visible_slice".}
+proc gtk_text_iter_get_visible_text*(start: PGtkTextIter, theEnd: PGtkTextIter): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_visible_text".}
+proc gtk_text_iter_get_pixbuf*(iter: PGtkTextIter): PGdkPixbuf{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_pixbuf".}
+proc gtk_text_iter_get_marks*(iter: PGtkTextIter): PGSList{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_marks".}
+proc gtk_text_iter_get_child_anchor*(iter: PGtkTextIter): PGtkTextChildAnchor{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_child_anchor".}
+proc gtk_text_iter_get_toggled_tags*(iter: PGtkTextIter, toggled_on: gboolean): PGSList{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_get_toggled_tags".}
+proc gtk_text_iter_begins_tag*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_begins_tag".}
+proc gtk_text_iter_ends_tag*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_ends_tag".}
+proc gtk_text_iter_toggles_tag*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_toggles_tag".}
+proc gtk_text_iter_has_tag*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_has_tag".}
+proc gtk_text_iter_get_tags*(iter: PGtkTextIter): PGSList{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_tags".}
+proc gtk_text_iter_editable*(iter: PGtkTextIter, default_setting: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_editable".}
+proc gtk_text_iter_can_insert*(iter: PGtkTextIter, default_editability: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_can_insert".}
+proc gtk_text_iter_starts_word*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_starts_word".}
+proc gtk_text_iter_ends_word*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_ends_word".}
+proc gtk_text_iter_inside_word*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_inside_word".}
+proc gtk_text_iter_starts_sentence*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_starts_sentence".}
+proc gtk_text_iter_ends_sentence*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_ends_sentence".}
+proc gtk_text_iter_inside_sentence*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_inside_sentence".}
+proc gtk_text_iter_starts_line*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_starts_line".}
+proc gtk_text_iter_ends_line*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_ends_line".}
+proc gtk_text_iter_is_cursor_position*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_is_cursor_position".}
+proc gtk_text_iter_get_chars_in_line*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_chars_in_line".}
+proc gtk_text_iter_get_bytes_in_line*(iter: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_bytes_in_line".}
+proc gtk_text_iter_get_attributes*(iter: PGtkTextIter,
+                                   values: PGtkTextAttributes): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_attributes".}
+proc gtk_text_iter_get_language*(iter: PGtkTextIter): PPangoLanguage{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_get_language".}
+proc gtk_text_iter_is_end*(iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_iter_is_end".}
+proc gtk_text_iter_is_start*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_is_start".}
+proc gtk_text_iter_forward_char*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_forward_char".}
+proc gtk_text_iter_backward_char*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_backward_char".}
+proc gtk_text_iter_forward_chars*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_chars".}
+proc gtk_text_iter_backward_chars*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_chars".}
+proc gtk_text_iter_forward_line*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_forward_line".}
+proc gtk_text_iter_backward_line*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_backward_line".}
+proc gtk_text_iter_forward_lines*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_lines".}
+proc gtk_text_iter_backward_lines*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_lines".}
+proc gtk_text_iter_forward_word_end*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_forward_word_end".}
+proc gtk_text_iter_backward_word_start*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_backward_word_start".}
+proc gtk_text_iter_forward_word_ends*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_word_ends".}
+proc gtk_text_iter_backward_word_starts*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_word_starts".}
+proc gtk_text_iter_forward_sentence_end*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_forward_sentence_end".}
+proc gtk_text_iter_backward_sentence_start*(iter: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_sentence_start".}
+proc gtk_text_iter_forward_sentence_ends*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_sentence_ends".}
+proc gtk_text_iter_backward_sentence_starts*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_sentence_starts".}
+proc gtk_text_iter_forward_cursor_position*(iter: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_cursor_position".}
+proc gtk_text_iter_backward_cursor_position*(iter: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_cursor_position".}
+proc gtk_text_iter_forward_cursor_positions*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_cursor_positions".}
+proc gtk_text_iter_backward_cursor_positions*(iter: PGtkTextIter, count: gint): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_cursor_positions".}
+proc gtk_text_iter_set_offset*(iter: PGtkTextIter, char_offset: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_set_offset".}
+proc gtk_text_iter_set_line*(iter: PGtkTextIter, line_number: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_set_line".}
+proc gtk_text_iter_set_line_offset*(iter: PGtkTextIter, char_on_line: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_set_line_offset".}
+proc gtk_text_iter_set_line_index*(iter: PGtkTextIter, byte_on_line: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_set_line_index".}
+proc gtk_text_iter_forward_to_end*(iter: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_iter_forward_to_end".}
+proc gtk_text_iter_forward_to_line_end*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_forward_to_line_end".}
+proc gtk_text_iter_set_visible_line_offset*(iter: PGtkTextIter,
+    char_on_line: gint){.cdecl, dynlib: gtklib,
+                         importc: "gtk_text_iter_set_visible_line_offset".}
+proc gtk_text_iter_set_visible_line_index*(iter: PGtkTextIter,
+    byte_on_line: gint){.cdecl, dynlib: gtklib,
+                         importc: "gtk_text_iter_set_visible_line_index".}
+proc gtk_text_iter_forward_to_tag_toggle*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_to_tag_toggle".}
+proc gtk_text_iter_backward_to_tag_toggle*(iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_to_tag_toggle".}
+proc gtk_text_iter_forward_find_char*(iter: PGtkTextIter,
+                                      pred: TGtkTextCharPredicate,
+                                      user_data: gpointer, limit: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_find_char".}
+proc gtk_text_iter_backward_find_char*(iter: PGtkTextIter,
+                                       pred: TGtkTextCharPredicate,
+                                       user_data: gpointer, limit: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_find_char".}
+proc gtk_text_iter_forward_search*(iter: PGtkTextIter, str: cstring,
+                                   flags: TGtkTextSearchFlags,
+                                   match_start: PGtkTextIter,
+                                   match_end: PGtkTextIter, limit: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_forward_search".}
+proc gtk_text_iter_backward_search*(iter: PGtkTextIter, str: cstring,
+                                    flags: TGtkTextSearchFlags,
+                                    match_start: PGtkTextIter,
+                                    match_end: PGtkTextIter, limit: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_backward_search".}
+proc gtk_text_iter_equal*(lhs: PGtkTextIter, rhs: PGtkTextIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_iter_equal".}
+proc gtk_text_iter_compare*(lhs: PGtkTextIter, rhs: PGtkTextIter): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_compare".}
+proc gtk_text_iter_in_range*(iter: PGtkTextIter, start: PGtkTextIter,
+                             theEnd: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_in_range".}
+proc gtk_text_iter_order*(first: PGtkTextIter, second: PGtkTextIter){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_iter_order".}
+proc GTK_TYPE_TEXT_TAG*(): GType
+proc GTK_TEXT_TAG*(obj: pointer): PGtkTextTag
+proc GTK_TEXT_TAG_CLASS*(klass: pointer): PGtkTextTagClass
+proc GTK_IS_TEXT_TAG*(obj: pointer): bool
+proc GTK_IS_TEXT_TAG_CLASS*(klass: pointer): bool
+proc GTK_TEXT_TAG_GET_CLASS*(obj: pointer): PGtkTextTagClass
+proc GTK_TYPE_TEXT_ATTRIBUTES*(): GType
+proc gtk_text_tag_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                      importc: "gtk_text_tag_get_type".}
+proc gtk_text_tag_new*(name: cstring): PGtkTextTag{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_tag_new".}
+proc gtk_text_tag_get_priority*(tag: PGtkTextTag): gint{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_tag_get_priority".}
+proc gtk_text_tag_set_priority*(tag: PGtkTextTag, priority: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_tag_set_priority".}
+proc gtk_text_tag_event*(tag: PGtkTextTag, event_object: PGObject,
+                         event: PGdkEvent, iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_tag_event".}
+proc gtk_text_attributes_new*(): PGtkTextAttributes{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_attributes_new".}
+proc gtk_text_attributes_copy*(src: PGtkTextAttributes): PGtkTextAttributes{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_attributes_copy".}
+proc gtk_text_attributes_copy_values*(src: PGtkTextAttributes,
+                                      dest: PGtkTextAttributes){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_attributes_copy_values".}
+proc gtk_text_attributes_unref*(values: PGtkTextAttributes){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_attributes_unref".}
+proc gtk_text_attributes_ref*(values: PGtkTextAttributes){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_attributes_ref".}
+proc gtk_text_attributes_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_attributes_get_type".}
+const
+  bm_TGtkTextTag_bg_color_set* = 0x00000001
+  bp_TGtkTextTag_bg_color_set* = 0
+  bm_TGtkTextTag_bg_stipple_set* = 0x00000002
+  bp_TGtkTextTag_bg_stipple_set* = 1
+  bm_TGtkTextTag_fg_color_set* = 0x00000004
+  bp_TGtkTextTag_fg_color_set* = 2
+  bm_TGtkTextTag_scale_set* = 0x00000008
+  bp_TGtkTextTag_scale_set* = 3
+  bm_TGtkTextTag_fg_stipple_set* = 0x00000010
+  bp_TGtkTextTag_fg_stipple_set* = 4
+  bm_TGtkTextTag_justification_set* = 0x00000020
+  bp_TGtkTextTag_justification_set* = 5
+  bm_TGtkTextTag_left_margin_set* = 0x00000040
+  bp_TGtkTextTag_left_margin_set* = 6
+  bm_TGtkTextTag_indent_set* = 0x00000080
+  bp_TGtkTextTag_indent_set* = 7
+  bm_TGtkTextTag_rise_set* = 0x00000100
+  bp_TGtkTextTag_rise_set* = 8
+  bm_TGtkTextTag_strikethrough_set* = 0x00000200
+  bp_TGtkTextTag_strikethrough_set* = 9
+  bm_TGtkTextTag_right_margin_set* = 0x00000400
+  bp_TGtkTextTag_right_margin_set* = 10
+  bm_TGtkTextTag_pixels_above_lines_set* = 0x00000800
+  bp_TGtkTextTag_pixels_above_lines_set* = 11
+  bm_TGtkTextTag_pixels_below_lines_set* = 0x00001000
+  bp_TGtkTextTag_pixels_below_lines_set* = 12
+  bm_TGtkTextTag_pixels_inside_wrap_set* = 0x00002000
+  bp_TGtkTextTag_pixels_inside_wrap_set* = 13
+  bm_TGtkTextTag_tabs_set* = 0x00004000
+  bp_TGtkTextTag_tabs_set* = 14
+  bm_TGtkTextTag_underline_set* = 0x00008000
+  bp_TGtkTextTag_underline_set* = 15
+  bm_TGtkTextTag_wrap_mode_set* = 0x00010000
+  bp_TGtkTextTag_wrap_mode_set* = 16
+  bm_TGtkTextTag_bg_full_height_set* = 0x00020000
+  bp_TGtkTextTag_bg_full_height_set* = 17
+  bm_TGtkTextTag_invisible_set* = 0x00040000
+  bp_TGtkTextTag_invisible_set* = 18
+  bm_TGtkTextTag_editable_set* = 0x00080000
+  bp_TGtkTextTag_editable_set* = 19
+  bm_TGtkTextTag_language_set* = 0x00100000
+  bp_TGtkTextTag_language_set* = 20
+  bm_TGtkTextTag_pad1* = 0x00200000
+  bp_TGtkTextTag_pad1* = 21
+  bm_TGtkTextTag_pad2* = 0x00400000
+  bp_TGtkTextTag_pad2* = 22
+  bm_TGtkTextTag_pad3* = 0x00800000
+  bp_TGtkTextTag_pad3* = 23
+
+proc bg_color_set*(a: var TGtkTextTag): guint
+proc set_bg_color_set*(a: var TGtkTextTag, `bg_color_set`: guint)
+proc bg_stipple_set*(a: var TGtkTextTag): guint
+proc set_bg_stipple_set*(a: var TGtkTextTag, `bg_stipple_set`: guint)
+proc fg_color_set*(a: var TGtkTextTag): guint
+proc set_fg_color_set*(a: var TGtkTextTag, `fg_color_set`: guint)
+proc scale_set*(a: var TGtkTextTag): guint
+proc set_scale_set*(a: var TGtkTextTag, `scale_set`: guint)
+proc fg_stipple_set*(a: var TGtkTextTag): guint
+proc set_fg_stipple_set*(a: var TGtkTextTag, `fg_stipple_set`: guint)
+proc justification_set*(a: var TGtkTextTag): guint
+proc set_justification_set*(a: var TGtkTextTag, `justification_set`: guint)
+proc left_margin_set*(a: var TGtkTextTag): guint
+proc set_left_margin_set*(a: var TGtkTextTag, `left_margin_set`: guint)
+proc indent_set*(a: var TGtkTextTag): guint
+proc set_indent_set*(a: var TGtkTextTag, `indent_set`: guint)
+proc rise_set*(a: var TGtkTextTag): guint
+proc set_rise_set*(a: var TGtkTextTag, `rise_set`: guint)
+proc strikethrough_set*(a: var TGtkTextTag): guint
+proc set_strikethrough_set*(a: var TGtkTextTag, `strikethrough_set`: guint)
+proc right_margin_set*(a: var TGtkTextTag): guint
+proc set_right_margin_set*(a: var TGtkTextTag, `right_margin_set`: guint)
+proc pixels_above_lines_set*(a: var TGtkTextTag): guint
+proc set_pixels_above_lines_set*(a: var TGtkTextTag,
+                                 `pixels_above_lines_set`: guint)
+proc pixels_below_lines_set*(a: var TGtkTextTag): guint
+proc set_pixels_below_lines_set*(a: var TGtkTextTag,
+                                 `pixels_below_lines_set`: guint)
+proc pixels_inside_wrap_set*(a: var TGtkTextTag): guint
+proc set_pixels_inside_wrap_set*(a: var TGtkTextTag,
+                                 `pixels_inside_wrap_set`: guint)
+proc tabs_set*(a: var TGtkTextTag): guint
+proc set_tabs_set*(a: var TGtkTextTag, `tabs_set`: guint)
+proc underline_set*(a: var TGtkTextTag): guint
+proc set_underline_set*(a: var TGtkTextTag, `underline_set`: guint)
+proc wrap_mode_set*(a: var TGtkTextTag): guint
+proc set_wrap_mode_set*(a: var TGtkTextTag, `wrap_mode_set`: guint)
+proc bg_full_height_set*(a: var TGtkTextTag): guint
+proc set_bg_full_height_set*(a: var TGtkTextTag, `bg_full_height_set`: guint)
+proc invisible_set*(a: var TGtkTextTag): guint
+proc set_invisible_set*(a: var TGtkTextTag, `invisible_set`: guint)
+proc editable_set*(a: var TGtkTextTag): guint
+proc set_editable_set*(a: var TGtkTextTag, `editable_set`: guint)
+proc language_set*(a: var TGtkTextTag): guint
+proc set_language_set*(a: var TGtkTextTag, `language_set`: guint)
+proc pad1*(a: var TGtkTextTag): guint
+proc set_pad1*(a: var TGtkTextTag, `pad1`: guint)
+proc pad2*(a: var TGtkTextTag): guint
+proc set_pad2*(a: var TGtkTextTag, `pad2`: guint)
+proc pad3*(a: var TGtkTextTag): guint
+proc set_pad3*(a: var TGtkTextTag, `pad3`: guint)
+const
+  bm_TGtkTextAppearance_underline* = 0x0000000F
+  bp_TGtkTextAppearance_underline* = 0
+  bm_TGtkTextAppearance_strikethrough* = 0x00000010
+  bp_TGtkTextAppearance_strikethrough* = 4
+  bm_TGtkTextAppearance_draw_bg* = 0x00000020
+  bp_TGtkTextAppearance_draw_bg* = 5
+  bm_TGtkTextAppearance_inside_selection* = 0x00000040
+  bp_TGtkTextAppearance_inside_selection* = 6
+  bm_TGtkTextAppearance_is_text* = 0x00000080
+  bp_TGtkTextAppearance_is_text* = 7
+  bm_TGtkTextAppearance_pad1* = 0x00000100
+  bp_TGtkTextAppearance_pad1* = 8
+  bm_TGtkTextAppearance_pad2* = 0x00000200
+  bp_TGtkTextAppearance_pad2* = 9
+  bm_TGtkTextAppearance_pad3* = 0x00000400
+  bp_TGtkTextAppearance_pad3* = 10
+  bm_TGtkTextAppearance_pad4* = 0x00000800
+  bp_TGtkTextAppearance_pad4* = 11
+
+proc underline*(a: var TGtkTextAppearance): guint
+proc set_underline*(a: var TGtkTextAppearance, `underline`: guint)
+proc strikethrough*(a: var TGtkTextAppearance): guint
+proc set_strikethrough*(a: var TGtkTextAppearance, `strikethrough`: guint)
+proc draw_bg*(a: var TGtkTextAppearance): guint
+proc set_draw_bg*(a: var TGtkTextAppearance, `draw_bg`: guint)
+proc inside_selection*(a: var TGtkTextAppearance): guint
+proc set_inside_selection*(a: var TGtkTextAppearance, `inside_selection`: guint)
+proc is_text*(a: var TGtkTextAppearance): guint
+proc set_is_text*(a: var TGtkTextAppearance, `is_text`: guint)
+proc pad1*(a: var TGtkTextAppearance): guint
+proc set_pad1*(a: var TGtkTextAppearance, `pad1`: guint)
+proc pad2*(a: var TGtkTextAppearance): guint
+proc set_pad2*(a: var TGtkTextAppearance, `pad2`: guint)
+proc pad3*(a: var TGtkTextAppearance): guint
+proc set_pad3*(a: var TGtkTextAppearance, `pad3`: guint)
+proc pad4*(a: var TGtkTextAppearance): guint
+proc set_pad4*(a: var TGtkTextAppearance, `pad4`: guint)
+const
+  bm_TGtkTextAttributes_invisible* = 0x00000001
+  bp_TGtkTextAttributes_invisible* = 0
+  bm_TGtkTextAttributes_bg_full_height* = 0x00000002
+  bp_TGtkTextAttributes_bg_full_height* = 1
+  bm_TGtkTextAttributes_editable* = 0x00000004
+  bp_TGtkTextAttributes_editable* = 2
+  bm_TGtkTextAttributes_realized* = 0x00000008
+  bp_TGtkTextAttributes_realized* = 3
+  bm_TGtkTextAttributes_pad1* = 0x00000010
+  bp_TGtkTextAttributes_pad1* = 4
+  bm_TGtkTextAttributes_pad2* = 0x00000020
+  bp_TGtkTextAttributes_pad2* = 5
+  bm_TGtkTextAttributes_pad3* = 0x00000040
+  bp_TGtkTextAttributes_pad3* = 6
+  bm_TGtkTextAttributes_pad4* = 0x00000080
+  bp_TGtkTextAttributes_pad4* = 7
+
+proc invisible*(a: var TGtkTextAttributes): guint
+proc set_invisible*(a: var TGtkTextAttributes, `invisible`: guint)
+proc bg_full_height*(a: var TGtkTextAttributes): guint
+proc set_bg_full_height*(a: var TGtkTextAttributes, `bg_full_height`: guint)
+proc editable*(a: var TGtkTextAttributes): guint
+proc set_editable*(a: var TGtkTextAttributes, `editable`: guint)
+proc realized*(a: var TGtkTextAttributes): guint
+proc set_realized*(a: var TGtkTextAttributes, `realized`: guint)
+proc pad1*(a: var TGtkTextAttributes): guint
+proc set_pad1*(a: var TGtkTextAttributes, `pad1`: guint)
+proc pad2*(a: var TGtkTextAttributes): guint
+proc set_pad2*(a: var TGtkTextAttributes, `pad2`: guint)
+proc pad3*(a: var TGtkTextAttributes): guint
+proc set_pad3*(a: var TGtkTextAttributes, `pad3`: guint)
+proc pad4*(a: var TGtkTextAttributes): guint
+proc set_pad4*(a: var TGtkTextAttributes, `pad4`: guint)
+proc GTK_TYPE_TEXT_TAG_TABLE*(): GType
+proc GTK_TEXT_TAG_TABLE*(obj: pointer): PGtkTextTagTable
+proc GTK_TEXT_TAG_TABLE_CLASS*(klass: pointer): PGtkTextTagTableClass
+proc GTK_IS_TEXT_TAG_TABLE*(obj: pointer): bool
+proc GTK_IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool
+proc GTK_TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PGtkTextTagTableClass
+proc gtk_text_tag_table_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_tag_table_get_type".}
+proc gtk_text_tag_table_new*(): PGtkTextTagTable{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_tag_table_new".}
+proc gtk_text_tag_table_add*(table: PGtkTextTagTable, tag: PGtkTextTag){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_tag_table_add".}
+proc gtk_text_tag_table_remove*(table: PGtkTextTagTable, tag: PGtkTextTag){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_tag_table_remove".}
+proc gtk_text_tag_table_lookup*(table: PGtkTextTagTable, name: cstring): PGtkTextTag{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_tag_table_lookup".}
+proc gtk_text_tag_table_foreach*(table: PGtkTextTagTable,
+                                 func_: TGtkTextTagTableForeach, data: gpointer){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_tag_table_foreach".}
+proc gtk_text_tag_table_get_size*(table: PGtkTextTagTable): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_tag_table_get_size".}
+proc gtk_text_tag_table_add_buffer*(table: PGtkTextTagTable, buffer: gpointer){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_tag_table_add_buffer".}
+proc gtk_text_tag_table_remove_buffer*(table: PGtkTextTagTable,
+    buffer: gpointer){.cdecl, dynlib: gtklib,
+                       importc: "_gtk_text_tag_table_remove_buffer".}
+proc GTK_TYPE_TEXT_MARK*(): GType
+proc GTK_TEXT_MARK*(anObject: pointer): PGtkTextMark
+proc GTK_TEXT_MARK_CLASS*(klass: pointer): PGtkTextMarkClass
+proc GTK_IS_TEXT_MARK*(anObject: pointer): bool
+proc GTK_IS_TEXT_MARK_CLASS*(klass: pointer): bool
+proc GTK_TEXT_MARK_GET_CLASS*(obj: pointer): PGtkTextMarkClass
+proc gtk_text_mark_get_type*(): GType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_text_mark_get_type".}
+proc gtk_text_mark_set_visible*(mark: PGtkTextMark, setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_mark_set_visible".}
+proc gtk_text_mark_get_visible*(mark: PGtkTextMark): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_mark_get_visible".}
+proc gtk_text_mark_get_name*(mark: PGtkTextMark): cstring{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_mark_get_name".}
+proc gtk_text_mark_get_deleted*(mark: PGtkTextMark): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_mark_get_deleted".}
+proc gtk_text_mark_get_buffer*(mark: PGtkTextMark): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_mark_get_buffer".}
+proc gtk_text_mark_get_left_gravity*(mark: PGtkTextMark): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_mark_get_left_gravity".}
+const
+  bm_TGtkTextMarkBody_visible* = 0x00000001
+  bp_TGtkTextMarkBody_visible* = 0
+  bm_TGtkTextMarkBody_not_deleteable* = 0x00000002
+  bp_TGtkTextMarkBody_not_deleteable* = 1
+
+proc visible*(a: var TGtkTextMarkBody): guint
+proc set_visible*(a: var TGtkTextMarkBody, `visible`: guint)
+proc not_deleteable*(a: var TGtkTextMarkBody): guint
+proc set_not_deleteable*(a: var TGtkTextMarkBody, `not_deleteable`: guint)
+proc gtk_mark_segment_new*(tree: PGtkTextBTree, left_gravity: gboolean,
+                             name: cstring): PGtkTextLineSegment{.cdecl,
+    dynlib: gtklib, importc: "_gtk_mark_segment_new".}
+proc GTK_TYPE_TEXT_CHILD_ANCHOR*(): GType
+proc GTK_TEXT_CHILD_ANCHOR*(anObject: pointer): PGtkTextChildAnchor
+proc GTK_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PGtkTextChildAnchorClass
+proc GTK_IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool
+proc GTK_IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool
+proc GTK_TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PGtkTextChildAnchorClass
+proc gtk_text_child_anchor_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_child_anchor_get_type".}
+proc gtk_text_child_anchor_new*(): PGtkTextChildAnchor{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_child_anchor_new".}
+proc gtk_text_child_anchor_get_widgets*(anchor: PGtkTextChildAnchor): PGList{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_child_anchor_get_widgets".}
+proc gtk_text_child_anchor_get_deleted*(anchor: PGtkTextChildAnchor): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_child_anchor_get_deleted".}
+proc gtk_pixbuf_segment_new*(pixbuf: PGdkPixbuf): PGtkTextLineSegment{.cdecl,
+    dynlib: gtklib, importc: "_gtk_pixbuf_segment_new".}
+proc gtk_widget_segment_new*(anchor: PGtkTextChildAnchor): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "_gtk_widget_segment_new".}
+proc gtk_widget_segment_add*(widget_segment: PGtkTextLineSegment,
+                               child: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "_gtk_widget_segment_add".}
+proc gtk_widget_segment_remove*(widget_segment: PGtkTextLineSegment,
+                                  child: PGtkWidget){.cdecl, dynlib: gtklib,
+    importc: "_gtk_widget_segment_remove".}
+proc gtk_widget_segment_ref*(widget_segment: PGtkTextLineSegment){.cdecl,
+    dynlib: gtklib, importc: "_gtk_widget_segment_ref".}
+proc gtk_widget_segment_unref*(widget_segment: PGtkTextLineSegment){.cdecl,
+    dynlib: gtklib, importc: "_gtk_widget_segment_unref".}
+proc gtk_anchored_child_get_layout*(child: PGtkWidget): PGtkTextLayout{.cdecl,
+    dynlib: gtklib, importc: "_gtk_anchored_child_get_layout".}
+proc gtk_text_line_segment_split*(iter: PGtkTextIter): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_line_segment_split".}
+proc gtk_char_segment_new*(text: cstring, len: guint): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "_gtk_char_segment_new".}
+proc gtk_char_segment_new_from_two_strings*(text1: cstring, len1: guint,
+    text2: cstring, len2: guint): PGtkTextLineSegment{.cdecl, dynlib: gtklib,
+    importc: "_gtk_char_segment_new_from_two_strings".}
+proc gtk_toggle_segment_new*(info: PGtkTextTagInfo, StateOn: gboolean): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "_gtk_toggle_segment_new".}
+proc gtk_text_btree_new*(table: PGtkTextTagTable, buffer: PGtkTextBuffer): PGtkTextBTree{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_new".}
+proc gtk_text_btree_ref*(tree: PGtkTextBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_ref".}
+proc gtk_text_btree_unref*(tree: PGtkTextBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_unref".}
+proc gtk_text_btree_get_buffer*(tree: PGtkTextBTree): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_buffer".}
+proc gtk_text_btree_get_chars_changed_stamp*(tree: PGtkTextBTree): guint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_chars_changed_stamp".}
+proc gtk_text_btree_get_segments_changed_stamp*(tree: PGtkTextBTree): guint{.
+    cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_segments_changed_stamp".}
+proc gtk_text_btree_segments_changed*(tree: PGtkTextBTree){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_segments_changed".}
+proc gtk_text_btree_is_end*(tree: PGtkTextBTree, line: PGtkTextLine,
+                              seg: PGtkTextLineSegment, byte_index: int32,
+                              char_offset: int32): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_is_end".}
+proc gtk_text_btree_delete*(start: PGtkTextIter, theEnd: PGtkTextIter){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_delete".}
+proc gtk_text_btree_insert*(iter: PGtkTextIter, text: cstring, len: gint){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_insert".}
+proc gtk_text_btree_insert_pixbuf*(iter: PGtkTextIter, pixbuf: PGdkPixbuf){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_insert_pixbuf".}
+proc gtk_text_btree_insert_child_anchor*(iter: PGtkTextIter,
+    anchor: PGtkTextChildAnchor){.cdecl, dynlib: gtklib, importc: "_gtk_text_btree_insert_child_anchor".}
+proc gtk_text_btree_unregister_child_anchor*(anchor: PGtkTextChildAnchor){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_unregister_child_anchor".}
+proc gtk_text_btree_find_line_by_y*(tree: PGtkTextBTree, view_id: gpointer,
+                                      ypixel: gint, line_top_y: Pgint): PGtkTextLine{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_find_line_by_y".}
+proc gtk_text_btree_find_line_top*(tree: PGtkTextBTree, line: PGtkTextLine,
+                                     view_id: gpointer): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_find_line_top".}
+proc gtk_text_btree_add_view*(tree: PGtkTextBTree, layout: PGtkTextLayout){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_add_view".}
+proc gtk_text_btree_remove_view*(tree: PGtkTextBTree, view_id: gpointer){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_remove_view".}
+proc gtk_text_btree_invalidate_region*(tree: PGtkTextBTree,
+    start: PGtkTextIter, theEnd: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_invalidate_region".}
+proc gtk_text_btree_get_view_size*(tree: PGtkTextBTree, view_id: gpointer,
+                                     width: Pgint, height: Pgint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_view_size".}
+proc gtk_text_btree_is_valid*(tree: PGtkTextBTree, view_id: gpointer): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_is_valid".}
+proc gtk_text_btree_validate*(tree: PGtkTextBTree, view_id: gpointer,
+                                max_pixels: gint, y: Pgint, old_height: Pgint,
+                                new_height: Pgint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_validate".}
+proc gtk_text_btree_validate_line*(tree: PGtkTextBTree, line: PGtkTextLine,
+                                     view_id: gpointer){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_validate_line".}
+proc gtk_text_btree_tag*(start: PGtkTextIter, theEnd: PGtkTextIter,
+                           tag: PGtkTextTag, apply: gboolean){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_tag".}
+proc gtk_text_btree_get_line*(tree: PGtkTextBTree, line_number: gint,
+                                real_line_number: Pgint): PGtkTextLine{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_line".}
+proc gtk_text_btree_get_line_no_last*(tree: PGtkTextBTree, line_number: gint,
+                                        real_line_number: Pgint): PGtkTextLine{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_line_no_last".}
+proc gtk_text_btree_get_end_iter_line*(tree: PGtkTextBTree): PGtkTextLine{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_end_iter_line".}
+proc gtk_text_btree_get_line_at_char*(tree: PGtkTextBTree, char_index: gint,
+                                        line_start_index: Pgint,
+                                        real_char_index: Pgint): PGtkTextLine{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_line_at_char".}
+proc gtk_text_btree_get_tags*(iter: PGtkTextIter, num_tags: Pgint): PPGtkTextTag{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_tags".}
+proc gtk_text_btree_get_text*(start: PGtkTextIter, theEnd: PGtkTextIter,
+                                include_hidden: gboolean,
+                                include_nonchars: gboolean): cstring{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_text".}
+proc gtk_text_btree_line_count*(tree: PGtkTextBTree): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_line_count".}
+proc gtk_text_btree_char_count*(tree: PGtkTextBTree): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_char_count".}
+proc gtk_text_btree_char_is_invisible*(iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_char_is_invisible".}
+proc gtk_text_btree_get_iter_at_char*(tree: PGtkTextBTree, iter: PGtkTextIter,
+                                        char_index: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_iter_at_char".}
+proc gtk_text_btree_get_iter_at_line_char*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, line_number: gint, char_index: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_iter_at_line_char".}
+proc gtk_text_btree_get_iter_at_line_byte*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, line_number: gint, byte_index: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_iter_at_line_byte".}
+proc gtk_text_btree_get_iter_from_string*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, `string`: cstring): gboolean{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_iter_from_string".}
+proc gtk_text_btree_get_iter_at_mark_name*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, mark_name: cstring): gboolean{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_iter_at_mark_name".}
+proc gtk_text_btree_get_iter_at_mark*(tree: PGtkTextBTree, iter: PGtkTextIter,
+                                        mark: PGtkTextMark){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_get_iter_at_mark".}
+proc gtk_text_btree_get_end_iter*(tree: PGtkTextBTree, iter: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_end_iter".}
+proc gtk_text_btree_get_iter_at_line*(tree: PGtkTextBTree, iter: PGtkTextIter,
+                                        line: PGtkTextLine, byte_offset: gint){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_iter_at_line".}
+proc gtk_text_btree_get_iter_at_first_toggle*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_iter_at_first_toggle".}
+proc gtk_text_btree_get_iter_at_last_toggle*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, tag: PGtkTextTag): gboolean{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_iter_at_last_toggle".}
+proc gtk_text_btree_get_iter_at_child_anchor*(tree: PGtkTextBTree,
+    iter: PGtkTextIter, anchor: PGtkTextChildAnchor){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_iter_at_child_anchor".}
+proc gtk_text_btree_set_mark*(tree: PGtkTextBTree,
+                                existing_mark: PGtkTextMark, name: cstring,
+                                left_gravity: gboolean, index: PGtkTextIter,
+                                should_exist: gboolean): PGtkTextMark{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_btree_set_mark".}
+proc gtk_text_btree_remove_mark_by_name*(tree: PGtkTextBTree, name: cstring){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_remove_mark_by_name".}
+proc gtk_text_btree_remove_mark*(tree: PGtkTextBTree, segment: PGtkTextMark){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_remove_mark".}
+proc gtk_text_btree_get_selection_bounds*(tree: PGtkTextBTree,
+    start: PGtkTextIter, theEnd: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_get_selection_bounds".}
+proc gtk_text_btree_place_cursor*(tree: PGtkTextBTree, `where`: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_place_cursor".}
+proc gtk_text_btree_mark_is_insert*(tree: PGtkTextBTree, segment: PGtkTextMark): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_mark_is_insert".}
+proc gtk_text_btree_mark_is_selection_bound*(tree: PGtkTextBTree,
+    segment: PGtkTextMark): gboolean{.cdecl, dynlib: gtklib, importc: "_gtk_text_btree_mark_is_selection_bound".}
+proc gtk_text_btree_get_mark_by_name*(tree: PGtkTextBTree, name: cstring): PGtkTextMark{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_btree_get_mark_by_name".}
+proc gtk_text_btree_first_could_contain_tag*(tree: PGtkTextBTree,
+    tag: PGtkTextTag): PGtkTextLine{.cdecl, dynlib: gtklib, importc: "_gtk_text_btree_first_could_contain_tag".}
+proc gtk_text_btree_last_could_contain_tag*(tree: PGtkTextBTree,
+    tag: PGtkTextTag): PGtkTextLine{.cdecl, dynlib: gtklib, importc: "_gtk_text_btree_last_could_contain_tag".}
+const
+  bm_TGtkTextLineData_width* = 0x00FFFFFF
+  bp_TGtkTextLineData_width* = 0
+  bm_TGtkTextLineData_valid* = 0xFF000000
+  bp_TGtkTextLineData_valid* = 24
+
+proc width*(a: PGtkTextLineData): gint
+proc set_width*(a: PGtkTextLineData, NewWidth: gint)
+proc valid*(a: PGtkTextLineData): gint
+proc set_valid*(a: PGtkTextLineData, `valid`: gint)
+proc gtk_text_line_get_number*(line: PGtkTextLine): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_get_number".}
+proc gtk_text_line_char_has_tag*(line: PGtkTextLine, tree: PGtkTextBTree,
+                                   char_in_line: gint, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_char_has_tag".}
+proc gtk_text_line_byte_has_tag*(line: PGtkTextLine, tree: PGtkTextBTree,
+                                   byte_in_line: gint, tag: PGtkTextTag): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_byte_has_tag".}
+proc gtk_text_line_is_last*(line: PGtkTextLine, tree: PGtkTextBTree): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_is_last".}
+proc gtk_text_line_contains_end_iter*(line: PGtkTextLine, tree: PGtkTextBTree): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_contains_end_iter".}
+proc gtk_text_line_next*(line: PGtkTextLine): PGtkTextLine{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_next".}
+proc gtk_text_line_next_excluding_last*(line: PGtkTextLine): PGtkTextLine{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_next_excluding_last".}
+proc gtk_text_line_previous*(line: PGtkTextLine): PGtkTextLine{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_previous".}
+proc gtk_text_line_add_data*(line: PGtkTextLine, data: PGtkTextLineData){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_add_data".}
+proc gtk_text_line_remove_data*(line: PGtkTextLine, view_id: gpointer): gpointer{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_remove_data".}
+proc gtk_text_line_get_data*(line: PGtkTextLine, view_id: gpointer): gpointer{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_get_data".}
+proc gtk_text_line_invalidate_wrap*(line: PGtkTextLine, ld: PGtkTextLineData){.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_invalidate_wrap".}
+proc gtk_text_line_char_count*(line: PGtkTextLine): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_char_count".}
+proc gtk_text_line_byte_count*(line: PGtkTextLine): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_byte_count".}
+proc gtk_text_line_char_index*(line: PGtkTextLine): gint{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_char_index".}
+proc gtk_text_line_byte_to_segment*(line: PGtkTextLine, byte_offset: gint,
+                                      seg_offset: Pgint): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_byte_to_segment".}
+proc gtk_text_line_char_to_segment*(line: PGtkTextLine, char_offset: gint,
+                                      seg_offset: Pgint): PGtkTextLineSegment{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_char_to_segment".}
+proc gtk_text_line_byte_to_char_offsets*(line: PGtkTextLine,
+    byte_offset: gint, line_char_offset: Pgint, seg_char_offset: Pgint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_byte_to_char_offsets".}
+proc gtk_text_line_char_to_byte_offsets*(line: PGtkTextLine,
+    char_offset: gint, line_byte_offset: Pgint, seg_byte_offset: Pgint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_line_char_to_byte_offsets".}
+proc gtk_text_line_byte_to_any_segment*(line: PGtkTextLine, byte_offset: gint,
+    seg_offset: Pgint): PGtkTextLineSegment{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_line_byte_to_any_segment".}
+proc gtk_text_line_char_to_any_segment*(line: PGtkTextLine, char_offset: gint,
+    seg_offset: Pgint): PGtkTextLineSegment{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_line_char_to_any_segment".}
+proc gtk_text_line_byte_to_char*(line: PGtkTextLine, byte_offset: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_byte_to_char".}
+proc gtk_text_line_char_to_byte*(line: PGtkTextLine, char_offset: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_char_to_byte".}
+proc gtk_text_line_next_could_contain_tag*(line: PGtkTextLine,
+    tree: PGtkTextBTree, tag: PGtkTextTag): PGtkTextLine{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_line_next_could_contain_tag".}
+proc gtk_text_line_previous_could_contain_tag*(line: PGtkTextLine,
+    tree: PGtkTextBTree, tag: PGtkTextTag): PGtkTextLine{.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_line_previous_could_contain_tag".}
+proc gtk_text_line_data_new*(layout: PGtkTextLayout, line: PGtkTextLine): PGtkTextLineData{.
+    cdecl, dynlib: gtklib, importc: "_gtk_text_line_data_new".}
+proc gtk_text_btree_check*(tree: PGtkTextBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_check".}
+proc gtk_text_btree_spew*(tree: PGtkTextBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_btree_spew".}
+proc gtk_toggle_segment_check_func*(segPtr: PGtkTextLineSegment,
+                                      line: PGtkTextLine){.cdecl,
+    dynlib: gtklib, importc: "_gtk_toggle_segment_check_func".}
+proc gtk_change_node_toggle_count*(node_: PGtkTextBTreeNode,
+                                     info: PGtkTextTagInfo, delta: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_change_node_toggle_count".}
+proc gtk_text_btree_release_mark_segment*(tree: PGtkTextBTree,
+    segment: PGtkTextLineSegment){.cdecl, dynlib: gtklib, importc: "_gtk_text_btree_release_mark_segment".}
+proc gtk_text_btree_notify_will_remove_tag*(tree: PGtkTextBTree,
+    tag: PGtkTextTag){.cdecl, dynlib: gtklib,
+                       importc: "_gtk_text_btree_notify_will_remove_tag".}
+const
+  bm_TGtkTextBuffer_modified* = 0x00000001
+  bp_TGtkTextBuffer_modified* = 0
+
+proc GTK_TYPE_TEXT_BUFFER*(): GType
+proc GTK_TEXT_BUFFER*(obj: pointer): PGtkTextBuffer
+proc GTK_TEXT_BUFFER_CLASS*(klass: pointer): PGtkTextBufferClass
+proc GTK_IS_TEXT_BUFFER*(obj: pointer): bool
+proc GTK_IS_TEXT_BUFFER_CLASS*(klass: pointer): bool
+proc GTK_TEXT_BUFFER_GET_CLASS*(obj: pointer): PGtkTextBufferClass
+proc modified*(a: var TGtkTextBuffer): guint
+proc set_modified*(a: var TGtkTextBuffer, `modified`: guint)
+proc gtk_text_buffer_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_get_type".}
+proc gtk_text_buffer_new*(table: PGtkTextTagTable): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_new".}
+proc gtk_text_buffer_get_line_count*(buffer: PGtkTextBuffer): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_line_count".}
+proc gtk_text_buffer_get_char_count*(buffer: PGtkTextBuffer): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_char_count".}
+proc gtk_text_buffer_get_tag_table*(buffer: PGtkTextBuffer): PGtkTextTagTable{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_tag_table".}
+proc gtk_text_buffer_set_text*(buffer: PGtkTextBuffer, text: cstring, len: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_set_text".}
+proc gtk_text_buffer_insert*(buffer: PGtkTextBuffer, iter: PGtkTextIter,
+                             text: cstring, len: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_insert".}
+proc gtk_text_buffer_insert_at_cursor*(buffer: PGtkTextBuffer, text: cstring,
+                                       len: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_insert_at_cursor".}
+proc gtk_text_buffer_insert_interactive*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, text: cstring, len: gint, default_editable: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_insert_interactive".}
+proc gtk_text_buffer_insert_interactive_at_cursor*(buffer: PGtkTextBuffer,
+    text: cstring, len: gint, default_editable: gboolean): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_insert_interactive_at_cursor".}
+proc gtk_text_buffer_insert_range*(buffer: PGtkTextBuffer, iter: PGtkTextIter,
+                                   start: PGtkTextIter, theEnd: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_insert_range".}
+proc gtk_text_buffer_insert_range_interactive*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, start: PGtkTextIter, theEnd: PGtkTextIter,
+    default_editable: gboolean): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_insert_range_interactive".}
+proc gtk_text_buffer_delete*(buffer: PGtkTextBuffer, start: PGtkTextIter,
+                             theEnd: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_delete".}
+proc gtk_text_buffer_delete_interactive*(buffer: PGtkTextBuffer,
+    start_iter: PGtkTextIter, end_iter: PGtkTextIter, default_editable: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_delete_interactive".}
+proc gtk_text_buffer_get_text*(buffer: PGtkTextBuffer, start: PGtkTextIter,
+                               theEnd: PGtkTextIter,
+                               include_hidden_chars: gboolean): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_text".}
+proc gtk_text_buffer_get_slice*(buffer: PGtkTextBuffer, start: PGtkTextIter,
+                                theEnd: PGtkTextIter,
+                                include_hidden_chars: gboolean): cstring{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_slice".}
+proc gtk_text_buffer_insert_pixbuf*(buffer: PGtkTextBuffer, iter: PGtkTextIter,
+                                    pixbuf: PGdkPixbuf){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_insert_pixbuf".}
+proc gtk_text_buffer_insert_child_anchor*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, anchor: PGtkTextChildAnchor){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_insert_child_anchor".}
+proc gtk_text_buffer_create_child_anchor*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter): PGtkTextChildAnchor{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_create_child_anchor".}
+proc gtk_text_buffer_create_mark*(buffer: PGtkTextBuffer, mark_name: cstring,
+                                  `where`: PGtkTextIter, left_gravity: gboolean): PGtkTextMark{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_create_mark".}
+proc gtk_text_buffer_move_mark*(buffer: PGtkTextBuffer, mark: PGtkTextMark,
+                                `where`: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_move_mark".}
+proc gtk_text_buffer_delete_mark*(buffer: PGtkTextBuffer, mark: PGtkTextMark){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_delete_mark".}
+proc gtk_text_buffer_get_mark*(buffer: PGtkTextBuffer, name: cstring): PGtkTextMark{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_mark".}
+proc gtk_text_buffer_move_mark_by_name*(buffer: PGtkTextBuffer, name: cstring,
+                                        `where`: PGtkTextIter){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_move_mark_by_name".}
+proc gtk_text_buffer_delete_mark_by_name*(buffer: PGtkTextBuffer, name: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_delete_mark_by_name".}
+proc gtk_text_buffer_get_insert*(buffer: PGtkTextBuffer): PGtkTextMark{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_insert".}
+proc gtk_text_buffer_get_selection_bound*(buffer: PGtkTextBuffer): PGtkTextMark{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_selection_bound".}
+proc gtk_text_buffer_place_cursor*(buffer: PGtkTextBuffer, `where`: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_place_cursor".}
+proc gtk_text_buffer_apply_tag*(buffer: PGtkTextBuffer, tag: PGtkTextTag,
+                                start: PGtkTextIter, theEnd: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_apply_tag".}
+proc gtk_text_buffer_remove_tag*(buffer: PGtkTextBuffer, tag: PGtkTextTag,
+                                 start: PGtkTextIter, theEnd: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_remove_tag".}
+proc gtk_text_buffer_apply_tag_by_name*(buffer: PGtkTextBuffer, name: cstring,
+                                        start: PGtkTextIter,
+                                        theEnd: PGtkTextIter){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_apply_tag_by_name".}
+proc gtk_text_buffer_remove_tag_by_name*(buffer: PGtkTextBuffer, name: cstring,
+    start: PGtkTextIter, theEnd: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_remove_tag_by_name".}
+proc gtk_text_buffer_remove_all_tags*(buffer: PGtkTextBuffer,
+                                      start: PGtkTextIter, theEnd: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_remove_all_tags".}
+proc gtk_text_buffer_get_iter_at_line_offset*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, line_number: gint, char_offset: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_iter_at_line_offset".}
+proc gtk_text_buffer_get_iter_at_line_index*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, line_number: gint, byte_index: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_iter_at_line_index".}
+proc gtk_text_buffer_get_iter_at_offset*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, char_offset: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_get_iter_at_offset".}
+proc gtk_text_buffer_get_iter_at_line*(buffer: PGtkTextBuffer,
+                                       iter: PGtkTextIter, line_number: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_iter_at_line".}
+proc gtk_text_buffer_get_start_iter*(buffer: PGtkTextBuffer, iter: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_start_iter".}
+proc gtk_text_buffer_get_end_iter*(buffer: PGtkTextBuffer, iter: PGtkTextIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_end_iter".}
+proc gtk_text_buffer_get_bounds*(buffer: PGtkTextBuffer, start: PGtkTextIter,
+                                 theEnd: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_get_bounds".}
+proc gtk_text_buffer_get_iter_at_mark*(buffer: PGtkTextBuffer,
+                                       iter: PGtkTextIter, mark: PGtkTextMark){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_get_iter_at_mark".}
+proc gtk_text_buffer_get_iter_at_child_anchor*(buffer: PGtkTextBuffer,
+    iter: PGtkTextIter, anchor: PGtkTextChildAnchor){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_get_iter_at_child_anchor".}
+proc gtk_text_buffer_get_modified*(buffer: PGtkTextBuffer): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_get_modified".}
+proc gtk_text_buffer_set_modified*(buffer: PGtkTextBuffer, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_set_modified".}
+proc gtk_text_buffer_add_selection_clipboard*(buffer: PGtkTextBuffer,
+    clipboard: PGtkClipboard){.cdecl, dynlib: gtklib, importc: "gtk_text_buffer_add_selection_clipboard".}
+proc gtk_text_buffer_remove_selection_clipboard*(buffer: PGtkTextBuffer,
+    clipboard: PGtkClipboard){.cdecl, dynlib: gtklib, importc: "gtk_text_buffer_remove_selection_clipboard".}
+proc gtk_text_buffer_cut_clipboard*(buffer: PGtkTextBuffer,
+                                    clipboard: PGtkClipboard,
+                                    default_editable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_cut_clipboard".}
+proc gtk_text_buffer_copy_clipboard*(buffer: PGtkTextBuffer,
+                                     clipboard: PGtkClipboard){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_copy_clipboard".}
+proc gtk_text_buffer_paste_clipboard*(buffer: PGtkTextBuffer,
+                                      clipboard: PGtkClipboard,
+                                      override_location: PGtkTextIter,
+                                      default_editable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_paste_clipboard".}
+proc gtk_text_buffer_get_selection_bounds*(buffer: PGtkTextBuffer,
+    start: PGtkTextIter, theEnd: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_buffer_get_selection_bounds".}
+proc gtk_text_buffer_delete_selection*(buffer: PGtkTextBuffer,
+                                       interactive: gboolean,
+                                       default_editable: gboolean): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_buffer_delete_selection".}
+proc gtk_text_buffer_begin_user_action*(buffer: PGtkTextBuffer){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_begin_user_action".}
+proc gtk_text_buffer_end_user_action*(buffer: PGtkTextBuffer){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_buffer_end_user_action".}
+proc gtk_text_buffer_spew*(buffer: PGtkTextBuffer){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_buffer_spew".}
+proc gtk_text_buffer_get_btree*(buffer: PGtkTextBuffer): PGtkTextBTree{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_buffer_get_btree".}
+proc gtk_text_buffer_get_line_log_attrs*(buffer: PGtkTextBuffer,
+    anywhere_in_line: PGtkTextIter, char_len: Pgint): PPangoLogAttr{.cdecl,
+    dynlib: gtklib, importc: "_gtk_text_buffer_get_line_log_attrs".}
+proc gtk_text_buffer_notify_will_remove_tag*(buffer: PGtkTextBuffer,
+    tag: PGtkTextTag){.cdecl, dynlib: gtklib,
+                       importc: "_gtk_text_buffer_notify_will_remove_tag".}
+proc GTK_TYPE_TEXT_LAYOUT*(): GType
+proc GTK_TEXT_LAYOUT*(obj: pointer): PGtkTextLayout
+proc GTK_TEXT_LAYOUT_CLASS*(klass: pointer): PGtkTextLayoutClass
+proc GTK_IS_TEXT_LAYOUT*(obj: pointer): bool
+proc GTK_IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool
+proc GTK_TEXT_LAYOUT_GET_CLASS*(obj: pointer): PGtkTextLayoutClass
+const
+  bm_TGtkTextLayout_cursor_visible* = 0x00000001
+  bp_TGtkTextLayout_cursor_visible* = 0
+  bm_TGtkTextLayout_cursor_direction* = 0x00000006
+  bp_TGtkTextLayout_cursor_direction* = 1
+
+proc cursor_visible*(a: var TGtkTextLayout): guint
+proc set_cursor_visible*(a: var TGtkTextLayout, `cursor_visible`: guint)
+proc cursor_direction*(a: var TGtkTextLayout): gint
+proc set_cursor_direction*(a: var TGtkTextLayout, `cursor_direction`: gint)
+const
+  bm_TGtkTextCursorDisplay_is_strong* = 0x00000001
+  bp_TGtkTextCursorDisplay_is_strong* = 0
+  bm_TGtkTextCursorDisplay_is_weak* = 0x00000002
+  bp_TGtkTextCursorDisplay_is_weak* = 1
+
+proc is_strong*(a: var TGtkTextCursorDisplay): guint
+proc set_is_strong*(a: var TGtkTextCursorDisplay, `is_strong`: guint)
+proc is_weak*(a: var TGtkTextCursorDisplay): guint
+proc set_is_weak*(a: var TGtkTextCursorDisplay, `is_weak`: guint)
+proc gtk_text_layout_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_get_type".}
+proc gtk_text_layout_new*(): PGtkTextLayout{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_new".}
+proc gtk_text_layout_set_buffer*(layout: PGtkTextLayout, buffer: PGtkTextBuffer){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_set_buffer".}
+proc gtk_text_layout_get_buffer*(layout: PGtkTextLayout): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_get_buffer".}
+proc gtk_text_layout_set_default_style*(layout: PGtkTextLayout,
+                                        values: PGtkTextAttributes){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_set_default_style".}
+proc gtk_text_layout_set_contexts*(layout: PGtkTextLayout,
+                                   ltr_context: PPangoContext,
+                                   rtl_context: PPangoContext){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_set_contexts".}
+proc gtk_text_layout_set_cursor_direction*(layout: PGtkTextLayout,
+    direction: TGtkTextDirection){.cdecl, dynlib: gtklib, importc: "gtk_text_layout_set_cursor_direction".}
+proc gtk_text_layout_default_style_changed*(layout: PGtkTextLayout){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_default_style_changed".}
+proc gtk_text_layout_set_screen_width*(layout: PGtkTextLayout, width: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_set_screen_width".}
+proc gtk_text_layout_set_preedit_string*(layout: PGtkTextLayout,
+    preedit_string: cstring, preedit_attrs: PPangoAttrList, cursor_pos: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_set_preedit_string".}
+proc gtk_text_layout_set_cursor_visible*(layout: PGtkTextLayout,
+    cursor_visible: gboolean){.cdecl, dynlib: gtklib,
+                               importc: "gtk_text_layout_set_cursor_visible".}
+proc gtk_text_layout_get_cursor_visible*(layout: PGtkTextLayout): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_cursor_visible".}
+proc gtk_text_layout_get_size*(layout: PGtkTextLayout, width: Pgint,
+                               height: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_get_size".}
+proc gtk_text_layout_get_lines*(layout: PGtkTextLayout, top_y: gint,
+                                bottom_y: gint, first_line_y: Pgint): PGSList{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_lines".}
+proc gtk_text_layout_wrap_loop_start*(layout: PGtkTextLayout){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_wrap_loop_start".}
+proc gtk_text_layout_wrap_loop_end*(layout: PGtkTextLayout){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_wrap_loop_end".}
+proc gtk_text_layout_get_line_display*(layout: PGtkTextLayout,
+                                       line: PGtkTextLine, size_only: gboolean): PGtkTextLineDisplay{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_line_display".}
+proc gtk_text_layout_free_line_display*(layout: PGtkTextLayout,
+                                        display: PGtkTextLineDisplay){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_free_line_display".}
+proc gtk_text_layout_get_line_at_y*(layout: PGtkTextLayout,
+                                    target_iter: PGtkTextIter, y: gint,
+                                    line_top: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_get_line_at_y".}
+proc gtk_text_layout_get_iter_at_pixel*(layout: PGtkTextLayout,
+                                        iter: PGtkTextIter, x: gint, y: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_iter_at_pixel".}
+proc gtk_text_layout_invalidate*(layout: PGtkTextLayout, start: PGtkTextIter,
+                                 theEnd: PGtkTextIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_invalidate".}
+proc gtk_text_layout_free_line_data*(layout: PGtkTextLayout, line: PGtkTextLine,
+                                     line_data: PGtkTextLineData){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_free_line_data".}
+proc gtk_text_layout_is_valid*(layout: PGtkTextLayout): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_is_valid".}
+proc gtk_text_layout_validate_yrange*(layout: PGtkTextLayout,
+                                      anchor_line: PGtkTextIter, y0: gint,
+                                      y1: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_validate_yrange".}
+proc gtk_text_layout_validate*(layout: PGtkTextLayout, max_pixels: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_validate".}
+proc gtk_text_layout_wrap*(layout: PGtkTextLayout, line: PGtkTextLine,
+                           line_data: PGtkTextLineData): PGtkTextLineData{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_wrap".}
+proc gtk_text_layout_changed*(layout: PGtkTextLayout, y: gint, old_height: gint,
+                              new_height: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_changed".}
+proc gtk_text_layout_get_iter_location*(layout: PGtkTextLayout,
+                                        iter: PGtkTextIter, rect: PGdkRectangle){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_iter_location".}
+proc gtk_text_layout_get_line_yrange*(layout: PGtkTextLayout,
+                                      iter: PGtkTextIter, y: Pgint,
+                                      height: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_get_line_yrange".}
+proc gtk_text_layout_get_line_xrange*(layout: PGtkTextLayout,
+                                        iter: PGtkTextIter, x: Pgint,
+                                        width: Pgint){.cdecl, dynlib: gtklib,
+    importc: "_gtk_text_layout_get_line_xrange".}
+proc gtk_text_layout_get_cursor_locations*(layout: PGtkTextLayout,
+    iter: PGtkTextIter, strong_pos: PGdkRectangle, weak_pos: PGdkRectangle){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_layout_get_cursor_locations".}
+proc gtk_text_layout_clamp_iter_to_vrange*(layout: PGtkTextLayout,
+    iter: PGtkTextIter, top: gint, bottom: gint): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_clamp_iter_to_vrange".}
+proc gtk_text_layout_move_iter_to_line_end*(layout: PGtkTextLayout,
+    iter: PGtkTextIter, direction: gint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_move_iter_to_line_end".}
+proc gtk_text_layout_move_iter_to_previous_line*(layout: PGtkTextLayout,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_layout_move_iter_to_previous_line".}
+proc gtk_text_layout_move_iter_to_next_line*(layout: PGtkTextLayout,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_layout_move_iter_to_next_line".}
+proc gtk_text_layout_move_iter_to_x*(layout: PGtkTextLayout, iter: PGtkTextIter,
+                                     x: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_move_iter_to_x".}
+proc gtk_text_layout_move_iter_visually*(layout: PGtkTextLayout,
+    iter: PGtkTextIter, count: gint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_move_iter_visually".}
+proc gtk_text_layout_iter_starts_line*(layout: PGtkTextLayout,
+                                       iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_iter_starts_line".}
+proc gtk_text_layout_get_iter_at_line*(layout: PGtkTextLayout,
+                                       iter: PGtkTextIter, line: PGtkTextLine,
+                                       byte_offset: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_layout_get_iter_at_line".}
+proc gtk_text_child_anchor_register_child*(anchor: PGtkTextChildAnchor,
+    child: PGtkWidget, layout: PGtkTextLayout){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_child_anchor_register_child".}
+proc gtk_text_child_anchor_unregister_child*(anchor: PGtkTextChildAnchor,
+    child: PGtkWidget){.cdecl, dynlib: gtklib,
+                        importc: "gtk_text_child_anchor_unregister_child".}
+proc gtk_text_child_anchor_queue_resize*(anchor: PGtkTextChildAnchor,
+    layout: PGtkTextLayout){.cdecl, dynlib: gtklib,
+                             importc: "gtk_text_child_anchor_queue_resize".}
+proc gtk_text_anchored_child_set_layout*(child: PGtkWidget,
+    layout: PGtkTextLayout){.cdecl, dynlib: gtklib,
+                             importc: "gtk_text_anchored_child_set_layout".}
+proc gtk_text_layout_spew*(layout: PGtkTextLayout){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_layout_spew".}
+const # GTK_TEXT_VIEW_PRIORITY_VALIDATE* = GDK_PRIORITY_REDRAW + 5
+  bm_TGtkTextView_editable* = 0x00000001
+  bp_TGtkTextView_editable* = 0
+  bm_TGtkTextView_overwrite_mode* = 0x00000002
+  bp_TGtkTextView_overwrite_mode* = 1
+  bm_TGtkTextView_cursor_visible* = 0x00000004
+  bp_TGtkTextView_cursor_visible* = 2
+  bm_TGtkTextView_need_im_reset* = 0x00000008
+  bp_TGtkTextView_need_im_reset* = 3
+  bm_TGtkTextView_just_selected_element* = 0x00000010
+  bp_TGtkTextView_just_selected_element* = 4
+  bm_TGtkTextView_disable_scroll_on_focus* = 0x00000020
+  bp_TGtkTextView_disable_scroll_on_focus* = 5
+  bm_TGtkTextView_onscreen_validated* = 0x00000040
+  bp_TGtkTextView_onscreen_validated* = 6
+  bm_TGtkTextView_mouse_cursor_obscured* = 0x00000080
+  bp_TGtkTextView_mouse_cursor_obscured* = 7
+
+proc GTK_TYPE_TEXT_VIEW*(): GType
+proc GTK_TEXT_VIEW*(obj: pointer): PGtkTextView
+proc GTK_TEXT_VIEW_CLASS*(klass: pointer): PGtkTextViewClass
+proc GTK_IS_TEXT_VIEW*(obj: pointer): bool
+proc GTK_IS_TEXT_VIEW_CLASS*(klass: pointer): bool
+proc GTK_TEXT_VIEW_GET_CLASS*(obj: pointer): PGtkTextViewClass
+proc editable*(a: var TGtkTextView): guint
+proc set_editable*(a: var TGtkTextView, `editable`: guint)
+proc overwrite_mode*(a: var TGtkTextView): guint
+proc set_overwrite_mode*(a: var TGtkTextView, `overwrite_mode`: guint)
+proc cursor_visible*(a: var TGtkTextView): guint
+proc set_cursor_visible*(a: var TGtkTextView, `cursor_visible`: guint)
+proc need_im_reset*(a: var TGtkTextView): guint
+proc set_need_im_reset*(a: var TGtkTextView, `need_im_reset`: guint)
+proc just_selected_element*(a: var TGtkTextView): guint
+proc set_just_selected_element*(a: var TGtkTextView,
+                                `just_selected_element`: guint)
+proc disable_scroll_on_focus*(a: var TGtkTextView): guint
+proc set_disable_scroll_on_focus*(a: var TGtkTextView,
+                                  `disable_scroll_on_focus`: guint)
+proc onscreen_validated*(a: var TGtkTextView): guint
+proc set_onscreen_validated*(a: var TGtkTextView, `onscreen_validated`: guint)
+proc mouse_cursor_obscured*(a: var TGtkTextView): guint
+proc set_mouse_cursor_obscured*(a: var TGtkTextView,
+                                `mouse_cursor_obscured`: guint)
+proc gtk_text_view_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_get_type".}
+proc gtk_text_view_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_text_view_new".}
+proc gtk_text_view_new_with_buffer*(buffer: PGtkTextBuffer): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_new_with_buffer".}
+proc gtk_text_view_set_buffer*(text_view: PGtkTextView, buffer: PGtkTextBuffer){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_set_buffer".}
+proc gtk_text_view_get_buffer*(text_view: PGtkTextView): PGtkTextBuffer{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_buffer".}
+proc gtk_text_view_scroll_to_iter*(text_view: PGtkTextView, iter: PGtkTextIter,
+                                   within_margin: gdouble, use_align: gboolean,
+                                   xalign: gdouble, yalign: gdouble): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_scroll_to_iter".}
+proc gtk_text_view_scroll_to_mark*(text_view: PGtkTextView, mark: PGtkTextMark,
+                                   within_margin: gdouble, use_align: gboolean,
+                                   xalign: gdouble, yalign: gdouble){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_scroll_to_mark".}
+proc gtk_text_view_scroll_mark_onscreen*(text_view: PGtkTextView,
+    mark: PGtkTextMark){.cdecl, dynlib: gtklib,
+                         importc: "gtk_text_view_scroll_mark_onscreen".}
+proc gtk_text_view_move_mark_onscreen*(text_view: PGtkTextView,
+                                       mark: PGtkTextMark): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_move_mark_onscreen".}
+proc gtk_text_view_place_cursor_onscreen*(text_view: PGtkTextView): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_place_cursor_onscreen".}
+proc gtk_text_view_get_visible_rect*(text_view: PGtkTextView,
+                                     visible_rect: PGdkRectangle){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_visible_rect".}
+proc gtk_text_view_set_cursor_visible*(text_view: PGtkTextView,
+                                       setting: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_set_cursor_visible".}
+proc gtk_text_view_get_cursor_visible*(text_view: PGtkTextView): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_cursor_visible".}
+proc gtk_text_view_get_iter_location*(text_view: PGtkTextView,
+                                      iter: PGtkTextIter,
+                                      location: PGdkRectangle){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_iter_location".}
+proc gtk_text_view_get_iter_at_location*(text_view: PGtkTextView,
+    iter: PGtkTextIter, x: gint, y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_get_iter_at_location".}
+proc gtk_text_view_get_line_yrange*(text_view: PGtkTextView, iter: PGtkTextIter,
+                                    y: Pgint, height: Pgint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_line_yrange".}
+proc gtk_text_view_get_line_at_y*(text_view: PGtkTextView,
+                                  target_iter: PGtkTextIter, y: gint,
+                                  line_top: Pgint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_get_line_at_y".}
+proc gtk_text_view_buffer_to_window_coords*(text_view: PGtkTextView,
+    win: TGtkTextWindowType, buffer_x: gint, buffer_y: gint, window_x: Pgint,
+    window_y: Pgint){.cdecl, dynlib: gtklib,
+                      importc: "gtk_text_view_buffer_to_window_coords".}
+proc gtk_text_view_window_to_buffer_coords*(text_view: PGtkTextView,
+    win: TGtkTextWindowType, window_x: gint, window_y: gint, buffer_x: Pgint,
+    buffer_y: Pgint){.cdecl, dynlib: gtklib,
+                      importc: "gtk_text_view_window_to_buffer_coords".}
+proc gtk_text_view_get_window*(text_view: PGtkTextView, win: TGtkTextWindowType): PGdkWindow{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_window".}
+proc gtk_text_view_get_window_type*(text_view: PGtkTextView, window: PGdkWindow): TGtkTextWindowType{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_window_type".}
+proc gtk_text_view_set_border_window_size*(text_view: PGtkTextView,
+    thetype: TGtkTextWindowType, size: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_set_border_window_size".}
+proc gtk_text_view_get_border_window_size*(text_view: PGtkTextView,
+    thetype: TGtkTextWindowType): gint{.cdecl, dynlib: gtklib, importc: "gtk_text_view_get_border_window_size".}
+proc gtk_text_view_forward_display_line*(text_view: PGtkTextView,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_view_forward_display_line".}
+proc gtk_text_view_backward_display_line*(text_view: PGtkTextView,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_view_backward_display_line".}
+proc gtk_text_view_forward_display_line_end*(text_view: PGtkTextView,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_view_forward_display_line_end".}
+proc gtk_text_view_backward_display_line_start*(text_view: PGtkTextView,
+    iter: PGtkTextIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_text_view_backward_display_line_start".}
+proc gtk_text_view_starts_display_line*(text_view: PGtkTextView,
+                                        iter: PGtkTextIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_starts_display_line".}
+proc gtk_text_view_move_visually*(text_view: PGtkTextView, iter: PGtkTextIter,
+                                  count: gint): gboolean{.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_move_visually".}
+proc gtk_text_view_add_child_at_anchor*(text_view: PGtkTextView,
+                                        child: PGtkWidget,
+                                        anchor: PGtkTextChildAnchor){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_add_child_at_anchor".}
+proc gtk_text_view_add_child_in_window*(text_view: PGtkTextView,
+                                        child: PGtkWidget,
+                                        which_window: TGtkTextWindowType,
+                                        xpos: gint, ypos: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_add_child_in_window".}
+proc gtk_text_view_move_child*(text_view: PGtkTextView, child: PGtkWidget,
+                               xpos: gint, ypos: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_text_view_move_child".}
+proc gtk_text_view_set_wrap_mode*(text_view: PGtkTextView,
+                                  wrap_mode: TGtkWrapMode){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_set_wrap_mode".}
+proc gtk_text_view_get_wrap_mode*(text_view: PGtkTextView): TGtkWrapMode{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_wrap_mode".}
+proc gtk_text_view_set_editable*(text_view: PGtkTextView, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_set_editable".}
+proc gtk_text_view_get_editable*(text_view: PGtkTextView): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_editable".}
+proc gtk_text_view_set_pixels_above_lines*(text_view: PGtkTextView,
+    pixels_above_lines: gint){.cdecl, dynlib: gtklib,
+                               importc: "gtk_text_view_set_pixels_above_lines".}
+proc gtk_text_view_get_pixels_above_lines*(text_view: PGtkTextView): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_pixels_above_lines".}
+proc gtk_text_view_set_pixels_below_lines*(text_view: PGtkTextView,
+    pixels_below_lines: gint){.cdecl, dynlib: gtklib,
+                               importc: "gtk_text_view_set_pixels_below_lines".}
+proc gtk_text_view_get_pixels_below_lines*(text_view: PGtkTextView): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_pixels_below_lines".}
+proc gtk_text_view_set_pixels_inside_wrap*(text_view: PGtkTextView,
+    pixels_inside_wrap: gint){.cdecl, dynlib: gtklib,
+                               importc: "gtk_text_view_set_pixels_inside_wrap".}
+proc gtk_text_view_get_pixels_inside_wrap*(text_view: PGtkTextView): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_pixels_inside_wrap".}
+proc gtk_text_view_set_justification*(text_view: PGtkTextView,
+                                      justification: TGtkJustification){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_set_justification".}
+proc gtk_text_view_get_justification*(text_view: PGtkTextView): TGtkJustification{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_justification".}
+proc gtk_text_view_set_left_margin*(text_view: PGtkTextView, left_margin: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_set_left_margin".}
+proc gtk_text_view_get_left_margin*(text_view: PGtkTextView): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_left_margin".}
+proc gtk_text_view_set_right_margin*(text_view: PGtkTextView, right_margin: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_set_right_margin".}
+proc gtk_text_view_get_right_margin*(text_view: PGtkTextView): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_right_margin".}
+proc gtk_text_view_set_indent*(text_view: PGtkTextView, indent: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_set_indent".}
+proc gtk_text_view_get_indent*(text_view: PGtkTextView): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_indent".}
+proc gtk_text_view_set_tabs*(text_view: PGtkTextView, tabs: PPangoTabArray){.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_set_tabs".}
+proc gtk_text_view_get_tabs*(text_view: PGtkTextView): PPangoTabArray{.cdecl,
+    dynlib: gtklib, importc: "gtk_text_view_get_tabs".}
+proc gtk_text_view_get_default_attributes*(text_view: PGtkTextView): PGtkTextAttributes{.
+    cdecl, dynlib: gtklib, importc: "gtk_text_view_get_default_attributes".}
+const
+  bm_TGtkTipsQuery_emit_always* = 0x00000001
+  bp_TGtkTipsQuery_emit_always* = 0
+  bm_TGtkTipsQuery_in_query* = 0x00000002
+  bp_TGtkTipsQuery_in_query* = 1
+
+proc GTK_TYPE_TIPS_QUERY*(): GType
+proc GTK_TIPS_QUERY*(obj: pointer): PGtkTipsQuery
+proc GTK_TIPS_QUERY_CLASS*(klass: pointer): PGtkTipsQueryClass
+proc GTK_IS_TIPS_QUERY*(obj: pointer): bool
+proc GTK_IS_TIPS_QUERY_CLASS*(klass: pointer): bool
+proc GTK_TIPS_QUERY_GET_CLASS*(obj: pointer): PGtkTipsQueryClass
+proc emit_always*(a: var TGtkTipsQuery): guint
+proc set_emit_always*(a: var TGtkTipsQuery, `emit_always`: guint)
+proc in_query*(a: var TGtkTipsQuery): guint
+proc set_in_query*(a: var TGtkTipsQuery, `in_query`: guint)
+proc gtk_tips_query_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tips_query_get_type".}
+proc gtk_tips_query_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_tips_query_new".}
+proc gtk_tips_query_start_query*(tips_query: PGtkTipsQuery){.cdecl,
+    dynlib: gtklib, importc: "gtk_tips_query_start_query".}
+proc gtk_tips_query_stop_query*(tips_query: PGtkTipsQuery){.cdecl,
+    dynlib: gtklib, importc: "gtk_tips_query_stop_query".}
+proc gtk_tips_query_set_caller*(tips_query: PGtkTipsQuery, caller: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_tips_query_set_caller".}
+proc gtk_tips_query_set_labels*(tips_query: PGtkTipsQuery,
+                                label_inactive: cstring, label_no_tip: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_tips_query_set_labels".}
+const
+  bm_TGtkTooltips_delay* = 0x3FFFFFFF
+  bp_TGtkTooltips_delay* = 0
+  bm_TGtkTooltips_enabled* = 0x40000000
+  bp_TGtkTooltips_enabled* = 30
+  bm_TGtkTooltips_have_grab* = 0x80000000
+  bp_TGtkTooltips_have_grab* = 31
+  bm_TGtkTooltips_use_sticky_delay* = 0x00000001
+  bp_TGtkTooltips_use_sticky_delay* = 0
+
+proc GTK_TYPE_TOOLTIPS*(): GType
+proc GTK_TOOLTIPS*(obj: pointer): PGtkTooltips
+proc GTK_TOOLTIPS_CLASS*(klass: pointer): PGtkTooltipsClass
+proc GTK_IS_TOOLTIPS*(obj: pointer): bool
+proc GTK_IS_TOOLTIPS_CLASS*(klass: pointer): bool
+proc GTK_TOOLTIPS_GET_CLASS*(obj: pointer): PGtkTooltipsClass
+proc delay*(a: var TGtkTooltips): guint
+proc set_delay*(a: var TGtkTooltips, `delay`: guint)
+proc enabled*(a: var TGtkTooltips): guint
+proc set_enabled*(a: var TGtkTooltips, `enabled`: guint)
+proc have_grab*(a: var TGtkTooltips): guint
+proc set_have_grab*(a: var TGtkTooltips, `have_grab`: guint)
+proc use_sticky_delay*(a: var TGtkTooltips): guint
+proc set_use_sticky_delay*(a: var TGtkTooltips, `use_sticky_delay`: guint)
+proc gtk_tooltips_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tooltips_get_type".}
+proc gtk_tooltips_new*(): PGtkTooltips{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_tooltips_new".}
+proc gtk_tooltips_enable*(tooltips: PGtkTooltips){.cdecl, dynlib: gtklib,
+    importc: "gtk_tooltips_enable".}
+proc gtk_tooltips_disable*(tooltips: PGtkTooltips){.cdecl, dynlib: gtklib,
+    importc: "gtk_tooltips_disable".}
+proc gtk_tooltips_set_tip*(tooltips: PGtkTooltips, widget: PGtkWidget,
+                           tip_text: cstring, tip_private: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_tooltips_set_tip".}
+proc gtk_tooltips_data_get*(widget: PGtkWidget): PGtkTooltipsData{.cdecl,
+    dynlib: gtklib, importc: "gtk_tooltips_data_get".}
+proc gtk_tooltips_force_window*(tooltips: PGtkTooltips){.cdecl, dynlib: gtklib,
+    importc: "gtk_tooltips_force_window".}
+proc gtk_tooltips_toggle_keyboard_mode*(widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tooltips_toggle_keyboard_mode".}
+const
+  bm_TGtkToolbar_style_set* = 0x00000001
+  bp_TGtkToolbar_style_set* = 0
+  bm_TGtkToolbar_icon_size_set* = 0x00000002
+  bp_TGtkToolbar_icon_size_set* = 1
+
+proc GTK_TYPE_TOOLBAR*(): GType
+proc GTK_TOOLBAR*(obj: pointer): PGtkToolbar
+proc GTK_TOOLBAR_CLASS*(klass: pointer): PGtkToolbarClass
+proc GTK_IS_TOOLBAR*(obj: pointer): bool
+proc GTK_IS_TOOLBAR_CLASS*(klass: pointer): bool
+proc GTK_TOOLBAR_GET_CLASS*(obj: pointer): PGtkToolbarClass
+proc style_set*(a: var TGtkToolbar): guint
+proc set_style_set*(a: var TGtkToolbar, `style_set`: guint)
+proc icon_size_set*(a: var TGtkToolbar): guint
+proc set_icon_size_set*(a: var TGtkToolbar, `icon_size_set`: guint)
+proc gtk_toolbar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_toolbar_get_type".}
+proc gtk_toolbar_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_toolbar_new".}
+proc gtk_toolbar_append_item*(toolbar: PGtkToolbar, text: cstring,
+                              tooltip_text: cstring,
+                              tooltip_private_text: cstring, icon: PGtkWidget,
+                              callback: TGtkSignalFunc, user_data: gpointer): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_append_item".}
+proc gtk_toolbar_prepend_item*(toolbar: PGtkToolbar, text: cstring,
+                               tooltip_text: cstring,
+                               tooltip_private_text: cstring, icon: PGtkWidget,
+                               callback: TGtkSignalFunc, user_data: gpointer): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_prepend_item".}
+proc gtk_toolbar_insert_item*(toolbar: PGtkToolbar, text: cstring,
+                              tooltip_text: cstring,
+                              tooltip_private_text: cstring, icon: PGtkWidget,
+                              callback: TGtkSignalFunc, user_data: gpointer,
+                              position: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_insert_item".}
+proc gtk_toolbar_insert_stock*(toolbar: PGtkToolbar, stock_id: cstring,
+                               tooltip_text: cstring,
+                               tooltip_private_text: cstring,
+                               callback: TGtkSignalFunc, user_data: gpointer,
+                               position: gint): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_insert_stock".}
+proc gtk_toolbar_append_space*(toolbar: PGtkToolbar){.cdecl, dynlib: gtklib,
+    importc: "gtk_toolbar_append_space".}
+proc gtk_toolbar_prepend_space*(toolbar: PGtkToolbar){.cdecl, dynlib: gtklib,
+    importc: "gtk_toolbar_prepend_space".}
+proc gtk_toolbar_insert_space*(toolbar: PGtkToolbar, position: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_insert_space".}
+proc gtk_toolbar_remove_space*(toolbar: PGtkToolbar, position: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_remove_space".}
+proc gtk_toolbar_append_element*(toolbar: PGtkToolbar,
+                                 thetype: TGtkToolbarChildType,
+                                 widget: PGtkWidget, text: cstring,
+                                 tooltip_text: cstring,
+                                 tooltip_private_text: cstring,
+                                 icon: PGtkWidget, callback: TGtkSignalFunc,
+                                 user_data: gpointer): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_append_element".}
+proc gtk_toolbar_prepend_element*(toolbar: PGtkToolbar,
+                                  thetype: TGtkToolbarChildType,
+                                  widget: PGtkWidget, text: cstring,
+                                  tooltip_text: cstring,
+                                  tooltip_private_text: cstring,
+                                  icon: PGtkWidget, callback: TGtkSignalFunc,
+                                  user_data: gpointer): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_prepend_element".}
+proc gtk_toolbar_insert_element*(toolbar: PGtkToolbar,
+                                 thetype: TGtkToolbarChildType,
+                                 widget: PGtkWidget, text: cstring,
+                                 tooltip_text: cstring,
+                                 tooltip_private_text: cstring,
+                                 icon: PGtkWidget, callback: TGtkSignalFunc,
+                                 user_data: gpointer, position: gint): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_insert_element".}
+proc gtk_toolbar_append_widget*(toolbar: PGtkToolbar, widget: PGtkWidget,
+                                tooltip_text: cstring,
+                                tooltip_private_text: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_append_widget".}
+proc gtk_toolbar_prepend_widget*(toolbar: PGtkToolbar, widget: PGtkWidget,
+                                 tooltip_text: cstring,
+                                 tooltip_private_text: cstring){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_prepend_widget".}
+proc gtk_toolbar_insert_widget*(toolbar: PGtkToolbar, widget: PGtkWidget,
+                                tooltip_text: cstring,
+                                tooltip_private_text: cstring, position: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_insert_widget".}
+proc gtk_toolbar_set_orientation*(toolbar: PGtkToolbar,
+                                  orientation: TGtkOrientation){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_set_orientation".}
+proc gtk_toolbar_set_style*(toolbar: PGtkToolbar, style: TGtkToolbarStyle){.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_set_style".}
+proc gtk_toolbar_set_icon_size*(toolbar: PGtkToolbar, icon_size: TGtkIconSize){.
+    cdecl, dynlib: gtklib, importc: "gtk_toolbar_set_icon_size".}
+proc gtk_toolbar_set_tooltips*(toolbar: PGtkToolbar, enable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_set_tooltips".}
+proc gtk_toolbar_unset_style*(toolbar: PGtkToolbar){.cdecl, dynlib: gtklib,
+    importc: "gtk_toolbar_unset_style".}
+proc gtk_toolbar_unset_icon_size*(toolbar: PGtkToolbar){.cdecl, dynlib: gtklib,
+    importc: "gtk_toolbar_unset_icon_size".}
+proc gtk_toolbar_get_orientation*(toolbar: PGtkToolbar): TGtkOrientation{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_get_orientation".}
+proc gtk_toolbar_get_style*(toolbar: PGtkToolbar): TGtkToolbarStyle{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_get_style".}
+proc gtk_toolbar_get_icon_size*(toolbar: PGtkToolbar): TGtkIconSize{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_get_icon_size".}
+proc gtk_toolbar_get_tooltips*(toolbar: PGtkToolbar): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_toolbar_get_tooltips".}
+const
+  bm_TGtkTree_selection_mode* = 0x00000003
+  bp_TGtkTree_selection_mode* = 0
+  bm_TGtkTree_view_mode* = 0x00000004
+  bp_TGtkTree_view_mode* = 2
+  bm_TGtkTree_view_line* = 0x00000008
+  bp_TGtkTree_view_line* = 3
+
+proc GTK_TYPE_TREE*(): GType
+proc GTK_TREE*(obj: pointer): PGtkTree
+proc GTK_TREE_CLASS*(klass: pointer): PGtkTreeClass
+proc GTK_IS_TREE*(obj: pointer): bool
+proc GTK_IS_TREE_CLASS*(klass: pointer): bool
+proc GTK_TREE_GET_CLASS*(obj: pointer): PGtkTreeClass
+proc GTK_IS_ROOT_TREE*(obj: pointer): bool
+proc GTK_TREE_ROOT_TREE*(obj: pointer): PGtkTree
+proc GTK_TREE_SELECTION_OLD*(obj: pointer): PGList
+proc selection_mode*(a: var TGtkTree): guint
+proc set_selection_mode*(a: var TGtkTree, `selection_mode`: guint)
+proc view_mode*(a: var TGtkTree): guint
+proc set_view_mode*(a: var TGtkTree, `view_mode`: guint)
+proc view_line*(a: var TGtkTree): guint
+proc set_view_line*(a: var TGtkTree, `view_line`: guint)
+proc gtk_tree_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                     importc: "gtk_tree_get_type".}
+proc gtk_tree_new*(): PGtkWidget{.cdecl, dynlib: gtklib, importc: "gtk_tree_new".}
+proc gtk_tree_append*(tree: PGtkTree, tree_item: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_append".}
+proc gtk_tree_prepend*(tree: PGtkTree, tree_item: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_prepend".}
+proc gtk_tree_insert*(tree: PGtkTree, tree_item: PGtkWidget, position: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_insert".}
+proc gtk_tree_remove_items*(tree: PGtkTree, items: PGList){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_remove_items".}
+proc gtk_tree_clear_items*(tree: PGtkTree, start: gint, theEnd: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_clear_items".}
+proc gtk_tree_select_item*(tree: PGtkTree, item: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_select_item".}
+proc gtk_tree_unselect_item*(tree: PGtkTree, item: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_unselect_item".}
+proc gtk_tree_select_child*(tree: PGtkTree, tree_item: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_select_child".}
+proc gtk_tree_unselect_child*(tree: PGtkTree, tree_item: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_unselect_child".}
+proc gtk_tree_child_position*(tree: PGtkTree, child: PGtkWidget): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_child_position".}
+proc gtk_tree_set_selection_mode*(tree: PGtkTree, mode: TGtkSelectionMode){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_set_selection_mode".}
+proc gtk_tree_set_view_mode*(tree: PGtkTree, mode: TGtkTreeViewMode){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_set_view_mode".}
+proc gtk_tree_set_view_lines*(tree: PGtkTree, flag: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_set_view_lines".}
+proc gtk_tree_remove_item*(tree: PGtkTree, child: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_remove_item".}
+proc GTK_TYPE_TREE_DRAG_SOURCE*(): GType
+proc GTK_TREE_DRAG_SOURCE*(obj: pointer): PGtkTreeDragSource
+proc GTK_IS_TREE_DRAG_SOURCE*(obj: pointer): bool
+proc GTK_TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PGtkTreeDragSourceIface
+proc gtk_tree_drag_source_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_drag_source_get_type".}
+proc gtk_tree_drag_source_row_draggable*(drag_source: PGtkTreeDragSource,
+    path: PGtkTreePath): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_tree_drag_source_row_draggable".}
+proc gtk_tree_drag_source_drag_data_delete*(drag_source: PGtkTreeDragSource,
+    path: PGtkTreePath): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_tree_drag_source_drag_data_delete".}
+proc gtk_tree_drag_source_drag_data_get*(drag_source: PGtkTreeDragSource,
+    path: PGtkTreePath, selection_data: PGtkSelectionData): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_drag_source_drag_data_get".}
+proc GTK_TYPE_TREE_DRAG_DEST*(): GType
+proc GTK_TREE_DRAG_DEST*(obj: pointer): PGtkTreeDragDest
+proc GTK_IS_TREE_DRAG_DEST*(obj: pointer): bool
+proc GTK_TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PGtkTreeDragDestIface
+proc gtk_tree_drag_dest_get_type*(): GType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_drag_dest_get_type".}
+proc gtk_tree_drag_dest_drag_data_received*(drag_dest: PGtkTreeDragDest,
+    dest: PGtkTreePath, selection_data: PGtkSelectionData): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_drag_dest_drag_data_received".}
+proc gtk_tree_drag_dest_row_drop_possible*(drag_dest: PGtkTreeDragDest,
+    dest_path: PGtkTreePath, selection_data: PGtkSelectionData): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_drag_dest_row_drop_possible".}
+proc gtk_tree_set_row_drag_data*(selection_data: PGtkSelectionData,
+                                 tree_model: PGtkTreeModel, path: PGtkTreePath): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_set_row_drag_data".}
+const
+  bm_TGtkTreeItem_expanded* = 0x00000001
+  bp_TGtkTreeItem_expanded* = 0
+
+proc GTK_TYPE_TREE_ITEM*(): GType
+proc GTK_TREE_ITEM*(obj: pointer): PGtkTreeItem
+proc GTK_TREE_ITEM_CLASS*(klass: pointer): PGtkTreeItemClass
+proc GTK_IS_TREE_ITEM*(obj: pointer): bool
+proc GTK_IS_TREE_ITEM_CLASS*(klass: pointer): bool
+proc GTK_TREE_ITEM_GET_CLASS*(obj: pointer): PGtkTreeItemClass
+proc GTK_TREE_ITEM_SUBTREE*(obj: pointer): PGtkWidget
+proc expanded*(a: var TGtkTreeItem): guint
+proc set_expanded*(a: var TGtkTreeItem, `expanded`: guint)
+proc gtk_tree_item_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_item_get_type".}
+proc gtk_tree_item_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_tree_item_new".}
+proc gtk_tree_item_new_with_label*(`label`: cstring): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_item_new_with_label".}
+proc gtk_tree_item_set_subtree*(tree_item: PGtkTreeItem, subtree: PGtkWidget){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_item_set_subtree".}
+proc gtk_tree_item_remove_subtree*(tree_item: PGtkTreeItem){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_item_remove_subtree".}
+proc gtk_tree_item_select*(tree_item: PGtkTreeItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_item_select".}
+proc gtk_tree_item_deselect*(tree_item: PGtkTreeItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_item_deselect".}
+proc gtk_tree_item_expand*(tree_item: PGtkTreeItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_item_expand".}
+proc gtk_tree_item_collapse*(tree_item: PGtkTreeItem){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_item_collapse".}
+proc GTK_TYPE_TREE_SELECTION*(): GType
+proc GTK_TREE_SELECTION*(obj: pointer): PGtkTreeSelection
+proc GTK_TREE_SELECTION_CLASS*(klass: pointer): PGtkTreeSelectionClass
+proc GTK_IS_TREE_SELECTION*(obj: pointer): bool
+proc GTK_IS_TREE_SELECTION_CLASS*(klass: pointer): bool
+proc GTK_TREE_SELECTION_GET_CLASS*(obj: pointer): PGtkTreeSelectionClass
+proc gtk_tree_selection_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_selection_get_type".}
+proc gtk_tree_selection_set_mode*(selection: PGtkTreeSelection,
+                                  thetype: TGtkSelectionMode){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_set_mode".}
+proc gtk_tree_selection_get_mode*(selection: PGtkTreeSelection): TGtkSelectionMode{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_selection_get_mode".}
+proc gtk_tree_selection_set_select_function*(selection: PGtkTreeSelection,
+    func_: TGtkTreeSelectionFunc, data: gpointer, destroy: TGtkDestroyNotify){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_selection_set_select_function".}
+proc gtk_tree_selection_get_user_data*(selection: PGtkTreeSelection): gpointer{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_selection_get_user_data".}
+proc gtk_tree_selection_get_tree_view*(selection: PGtkTreeSelection): PGtkTreeView{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_selection_get_tree_view".}
+proc gtk_tree_selection_get_selected*(selection: PGtkTreeSelection,
+                                      model: PPGtkTreeModel, iter: PGtkTreeIter): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_selection_get_selected".}
+proc gtk_tree_selection_get_selected_rows*(selection: PGtkTreeSelection,
+    model: PPGtkTreeModel): PGList{.cdecl, dynlib: gtklib, importc: "gtk_tree_selection_get_selected_rows".}
+proc gtk_tree_selection_selected_foreach*(selection: PGtkTreeSelection,
+    func_: TGtkTreeSelectionForeachFunc, data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_selection_selected_foreach".}
+proc gtk_tree_selection_select_path*(selection: PGtkTreeSelection,
+                                     path: PGtkTreePath){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_selection_select_path".}
+proc gtk_tree_selection_unselect_path*(selection: PGtkTreeSelection,
+                                       path: PGtkTreePath){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_unselect_path".}
+proc gtk_tree_selection_select_iter*(selection: PGtkTreeSelection,
+                                     iter: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_selection_select_iter".}
+proc gtk_tree_selection_unselect_iter*(selection: PGtkTreeSelection,
+                                       iter: PGtkTreeIter){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_unselect_iter".}
+proc gtk_tree_selection_path_is_selected*(selection: PGtkTreeSelection,
+    path: PGtkTreePath): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_tree_selection_path_is_selected".}
+proc gtk_tree_selection_iter_is_selected*(selection: PGtkTreeSelection,
+    iter: PGtkTreeIter): gboolean{.cdecl, dynlib: gtklib, importc: "gtk_tree_selection_iter_is_selected".}
+proc gtk_tree_selection_select_all*(selection: PGtkTreeSelection){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_select_all".}
+proc gtk_tree_selection_unselect_all*(selection: PGtkTreeSelection){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_unselect_all".}
+proc gtk_tree_selection_select_range*(selection: PGtkTreeSelection,
+                                      start_path: PGtkTreePath,
+                                      end_path: PGtkTreePath){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_selection_select_range".}
+const
+  bm_TGtkTreeStore_columns_dirty* = 0x00000001
+  bp_TGtkTreeStore_columns_dirty* = 0
+
+proc GTK_TYPE_TREE_STORE*(): GType
+proc GTK_TREE_STORE*(obj: pointer): PGtkTreeStore
+proc GTK_TREE_STORE_CLASS*(klass: pointer): PGtkTreeStoreClass
+proc GTK_IS_TREE_STORE*(obj: pointer): bool
+proc GTK_IS_TREE_STORE_CLASS*(klass: pointer): bool
+proc GTK_TREE_STORE_GET_CLASS*(obj: pointer): PGtkTreeStoreClass
+proc columns_dirty*(a: var TGtkTreeStore): guint
+proc set_columns_dirty*(a: var TGtkTreeStore, `columns_dirty`: guint)
+proc gtk_tree_store_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_store_get_type".}
+proc gtk_tree_store_newv*(n_columns: gint, types: PGType): PGtkTreeStore{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_newv".}
+proc gtk_tree_store_set_column_types*(tree_store: PGtkTreeStore,
+                                      n_columns: gint, types: PGType){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_set_column_types".}
+proc gtk_tree_store_set_value*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                               column: gint, value: PGValue){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_set_value".}
+proc gtk_tree_store_remove*(tree_store: PGtkTreeStore, iter: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_store_remove".}
+proc gtk_tree_store_insert*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                            parent: PGtkTreeIter, position: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_insert".}
+proc gtk_tree_store_insert_before*(tree_store: PGtkTreeStore,
+                                   iter: PGtkTreeIter, parent: PGtkTreeIter,
+                                   sibling: PGtkTreeIter){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_insert_before".}
+proc gtk_tree_store_insert_after*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                                  parent: PGtkTreeIter, sibling: PGtkTreeIter){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_store_insert_after".}
+proc gtk_tree_store_prepend*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                             parent: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_store_prepend".}
+proc gtk_tree_store_append*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                            parent: PGtkTreeIter){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_store_append".}
+proc gtk_tree_store_is_ancestor*(tree_store: PGtkTreeStore, iter: PGtkTreeIter,
+                                 descendant: PGtkTreeIter): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_store_is_ancestor".}
+proc gtk_tree_store_iter_depth*(tree_store: PGtkTreeStore, iter: PGtkTreeIter): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_store_iter_depth".}
+proc gtk_tree_store_clear*(tree_store: PGtkTreeStore){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_store_clear".}
+const
+  bm_TGtkTreeViewColumn_visible* = 0x00000001
+  bp_TGtkTreeViewColumn_visible* = 0
+  bm_TGtkTreeViewColumn_resizable* = 0x00000002
+  bp_TGtkTreeViewColumn_resizable* = 1
+  bm_TGtkTreeViewColumn_clickable* = 0x00000004
+  bp_TGtkTreeViewColumn_clickable* = 2
+  bm_TGtkTreeViewColumn_dirty* = 0x00000008
+  bp_TGtkTreeViewColumn_dirty* = 3
+  bm_TGtkTreeViewColumn_show_sort_indicator* = 0x00000010
+  bp_TGtkTreeViewColumn_show_sort_indicator* = 4
+  bm_TGtkTreeViewColumn_maybe_reordered* = 0x00000020
+  bp_TGtkTreeViewColumn_maybe_reordered* = 5
+  bm_TGtkTreeViewColumn_reorderable* = 0x00000040
+  bp_TGtkTreeViewColumn_reorderable* = 6
+  bm_TGtkTreeViewColumn_use_resized_width* = 0x00000080
+  bp_TGtkTreeViewColumn_use_resized_width* = 7
+
+proc GTK_TYPE_TREE_VIEW_COLUMN*(): GType
+proc GTK_TREE_VIEW_COLUMN*(obj: pointer): PGtkTreeViewColumn
+proc GTK_TREE_VIEW_COLUMN_CLASS*(klass: pointer): PGtkTreeViewColumnClass
+proc GTK_IS_TREE_VIEW_COLUMN*(obj: pointer): bool
+proc GTK_IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool
+proc GTK_TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PGtkTreeViewColumnClass
+proc visible*(a: var TGtkTreeViewColumn): guint
+proc set_visible*(a: var TGtkTreeViewColumn, `visible`: guint)
+proc resizable*(a: var TGtkTreeViewColumn): guint
+proc set_resizable*(a: var TGtkTreeViewColumn, `resizable`: guint)
+proc clickable*(a: var TGtkTreeViewColumn): guint
+proc set_clickable*(a: var TGtkTreeViewColumn, `clickable`: guint)
+proc dirty*(a: var TGtkTreeViewColumn): guint
+proc set_dirty*(a: var TGtkTreeViewColumn, `dirty`: guint)
+proc show_sort_indicator*(a: var TGtkTreeViewColumn): guint
+proc set_show_sort_indicator*(a: var TGtkTreeViewColumn,
+                              `show_sort_indicator`: guint)
+proc maybe_reordered*(a: var TGtkTreeViewColumn): guint
+proc set_maybe_reordered*(a: var TGtkTreeViewColumn, `maybe_reordered`: guint)
+proc reorderable*(a: var TGtkTreeViewColumn): guint
+proc set_reorderable*(a: var TGtkTreeViewColumn, `reorderable`: guint)
+proc use_resized_width*(a: var TGtkTreeViewColumn): guint
+proc set_use_resized_width*(a: var TGtkTreeViewColumn,
+                            `use_resized_width`: guint)
+proc gtk_tree_view_column_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_get_type".}
+proc gtk_tree_view_column_new*(): PGtkTreeViewColumn{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_new".}
+proc gtk_tree_view_column_pack_start*(tree_column: PGtkTreeViewColumn,
+                                      cell: PGtkCellRenderer, expand: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_pack_start".}
+proc gtk_tree_view_column_pack_end*(tree_column: PGtkTreeViewColumn,
+                                    cell: PGtkCellRenderer, expand: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_pack_end".}
+proc gtk_tree_view_column_clear*(tree_column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_clear".}
+proc gtk_tree_view_column_get_cell_renderers*(tree_column: PGtkTreeViewColumn): PGList{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_cell_renderers".}
+proc gtk_tree_view_column_add_attribute*(tree_column: PGtkTreeViewColumn,
+    cell_renderer: PGtkCellRenderer, attribute: cstring, column: gint){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_add_attribute".}
+proc gtk_tree_view_column_set_cell_data_func*(tree_column: PGtkTreeViewColumn,
+    cell_renderer: PGtkCellRenderer, func_: TGtkTreeCellDataFunc,
+    func_data: gpointer, destroy: TGtkDestroyNotify){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_set_cell_data_func".}
+proc gtk_tree_view_column_clear_attributes*(tree_column: PGtkTreeViewColumn,
+    cell_renderer: PGtkCellRenderer){.cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_clear_attributes".}
+proc gtk_tree_view_column_set_spacing*(tree_column: PGtkTreeViewColumn,
+                                       spacing: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_set_spacing".}
+proc gtk_tree_view_column_get_spacing*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_spacing".}
+proc gtk_tree_view_column_set_visible*(tree_column: PGtkTreeViewColumn,
+                                       visible: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_set_visible".}
+proc gtk_tree_view_column_get_visible*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_visible".}
+proc gtk_tree_view_column_set_resizable*(tree_column: PGtkTreeViewColumn,
+    resizable: gboolean){.cdecl, dynlib: gtklib,
+                          importc: "gtk_tree_view_column_set_resizable".}
+proc gtk_tree_view_column_get_resizable*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_resizable".}
+proc gtk_tree_view_column_set_sizing*(tree_column: PGtkTreeViewColumn,
+                                      thetype: TGtkTreeViewColumnSizing){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_set_sizing".}
+proc gtk_tree_view_column_get_sizing*(tree_column: PGtkTreeViewColumn): TGtkTreeViewColumnSizing{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_sizing".}
+proc gtk_tree_view_column_get_width*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_width".}
+proc gtk_tree_view_column_get_fixed_width*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_fixed_width".}
+proc gtk_tree_view_column_set_fixed_width*(tree_column: PGtkTreeViewColumn,
+    fixed_width: gint){.cdecl, dynlib: gtklib,
+                        importc: "gtk_tree_view_column_set_fixed_width".}
+proc gtk_tree_view_column_set_min_width*(tree_column: PGtkTreeViewColumn,
+    min_width: gint){.cdecl, dynlib: gtklib,
+                      importc: "gtk_tree_view_column_set_min_width".}
+proc gtk_tree_view_column_get_min_width*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_min_width".}
+proc gtk_tree_view_column_set_max_width*(tree_column: PGtkTreeViewColumn,
+    max_width: gint){.cdecl, dynlib: gtklib,
+                      importc: "gtk_tree_view_column_set_max_width".}
+proc gtk_tree_view_column_get_max_width*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_max_width".}
+proc gtk_tree_view_column_clicked*(tree_column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_clicked".}
+proc gtk_tree_view_column_set_title*(tree_column: PGtkTreeViewColumn,
+                                     title: cstring){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_set_title".}
+proc gtk_tree_view_column_get_title*(tree_column: PGtkTreeViewColumn): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_title".}
+proc gtk_tree_view_column_set_clickable*(tree_column: PGtkTreeViewColumn,
+    clickable: gboolean){.cdecl, dynlib: gtklib,
+                          importc: "gtk_tree_view_column_set_clickable".}
+proc gtk_tree_view_column_get_clickable*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_clickable".}
+proc gtk_tree_view_column_set_widget*(tree_column: PGtkTreeViewColumn,
+                                      widget: PGtkWidget){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_set_widget".}
+proc gtk_tree_view_column_get_widget*(tree_column: PGtkTreeViewColumn): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_widget".}
+proc gtk_tree_view_column_set_alignment*(tree_column: PGtkTreeViewColumn,
+    xalign: gfloat){.cdecl, dynlib: gtklib,
+                     importc: "gtk_tree_view_column_set_alignment".}
+proc gtk_tree_view_column_get_alignment*(tree_column: PGtkTreeViewColumn): gfloat{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_alignment".}
+proc gtk_tree_view_column_set_reorderable*(tree_column: PGtkTreeViewColumn,
+    reorderable: gboolean){.cdecl, dynlib: gtklib,
+                            importc: "gtk_tree_view_column_set_reorderable".}
+proc gtk_tree_view_column_get_reorderable*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_reorderable".}
+proc gtk_tree_view_column_set_sort_column_id*(tree_column: PGtkTreeViewColumn,
+    sort_column_id: gint){.cdecl, dynlib: gtklib,
+                           importc: "gtk_tree_view_column_set_sort_column_id".}
+proc gtk_tree_view_column_get_sort_column_id*(tree_column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_sort_column_id".}
+proc gtk_tree_view_column_set_sort_indicator*(tree_column: PGtkTreeViewColumn,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_tree_view_column_set_sort_indicator".}
+proc gtk_tree_view_column_get_sort_indicator*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_sort_indicator".}
+proc gtk_tree_view_column_set_sort_order*(tree_column: PGtkTreeViewColumn,
+    order: TGtkSortType){.cdecl, dynlib: gtklib,
+                          importc: "gtk_tree_view_column_set_sort_order".}
+proc gtk_tree_view_column_get_sort_order*(tree_column: PGtkTreeViewColumn): TGtkSortType{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_sort_order".}
+proc gtk_tree_view_column_cell_set_cell_data*(tree_column: PGtkTreeViewColumn,
+    tree_model: PGtkTreeModel, iter: PGtkTreeIter, is_expander: gboolean,
+    is_expanded: gboolean){.cdecl, dynlib: gtklib,
+                            importc: "gtk_tree_view_column_cell_set_cell_data".}
+proc gtk_tree_view_column_cell_get_size*(tree_column: PGtkTreeViewColumn,
+    cell_area: PGdkRectangle, x_offset: Pgint, y_offset: Pgint, width: Pgint,
+    height: Pgint){.cdecl, dynlib: gtklib,
+                    importc: "gtk_tree_view_column_cell_get_size".}
+proc gtk_tree_view_column_cell_is_visible*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_cell_is_visible".}
+proc gtk_tree_view_column_focus_cell*(tree_column: PGtkTreeViewColumn,
+                                      cell: PGtkCellRenderer){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_column_focus_cell".}
+proc gtk_tree_view_column_set_expand*(tree_column: PGtkTreeViewColumn,
+                                      Expand: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_column_set_expand".}
+proc gtk_tree_view_column_get_expand*(tree_column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_column_get_expand".}
+const
+  GTK_RBNODE_BLACK* = 1 shl 0
+  GTK_RBNODE_RED* = 1 shl 1
+  GTK_RBNODE_IS_PARENT* = 1 shl 2
+  GTK_RBNODE_IS_SELECTED* = 1 shl 3
+  GTK_RBNODE_IS_PRELIT* = 1 shl 4
+  GTK_RBNODE_IS_SEMI_COLLAPSED* = 1 shl 5
+  GTK_RBNODE_IS_SEMI_EXPANDED* = 1 shl 6
+  GTK_RBNODE_INVALID* = 1 shl 7
+  GTK_RBNODE_COLUMN_INVALID* = 1 shl 8
+  GTK_RBNODE_DESCENDANTS_INVALID* = 1 shl 9
+  GTK_RBNODE_NON_COLORS* = GTK_RBNODE_IS_PARENT or GTK_RBNODE_IS_SELECTED or
+      GTK_RBNODE_IS_PRELIT or GTK_RBNODE_IS_SEMI_COLLAPSED or
+      GTK_RBNODE_IS_SEMI_EXPANDED or GTK_RBNODE_INVALID or
+      GTK_RBNODE_COLUMN_INVALID or GTK_RBNODE_DESCENDANTS_INVALID
+
+const
+  bm_TGtkRBNode_flags* = 0x00003FFF
+  bp_TGtkRBNode_flags* = 0
+  bm_TGtkRBNode_parity* = 0x00004000
+  bp_TGtkRBNode_parity* = 14
+
+proc flags*(a: PGtkRBNode): guint
+proc set_flags*(a: PGtkRBNode, `flags`: guint)
+proc parity*(a: PGtkRBNode): guint
+proc set_parity*(a: PGtkRBNode, `parity`: guint)
+proc GTK_RBNODE_GET_COLOR*(node_: PGtkRBNode): guint
+proc GTK_RBNODE_SET_COLOR*(node_: PGtkRBNode, color: guint)
+proc GTK_RBNODE_GET_HEIGHT*(node_: PGtkRBNode): gint
+proc GTK_RBNODE_SET_FLAG*(node_: PGtkRBNode, flag: guint16)
+proc GTK_RBNODE_UNSET_FLAG*(node_: PGtkRBNode, flag: guint16)
+proc GTK_RBNODE_FLAG_SET*(node_: PGtkRBNode, flag: guint): bool
+proc gtk_rbtree_push_allocator*(allocator: PGAllocator){.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_push_allocator".}
+proc gtk_rbtree_pop_allocator*(){.cdecl, dynlib: gtklib,
+                                    importc: "_gtk_rbtree_pop_allocator".}
+proc gtk_rbtree_new*(): PGtkRBTree{.cdecl, dynlib: gtklib,
+                                      importc: "_gtk_rbtree_new".}
+proc gtk_rbtree_free*(tree: PGtkRBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_free".}
+proc gtk_rbtree_remove*(tree: PGtkRBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_remove".}
+proc gtk_rbtree_destroy*(tree: PGtkRBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_destroy".}
+proc gtk_rbtree_insert_before*(tree: PGtkRBTree, node_: PGtkRBNode,
+                                 height: gint, valid: gboolean): PGtkRBNode{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_insert_before".}
+proc gtk_rbtree_insert_after*(tree: PGtkRBTree, node_: PGtkRBNode,
+                                height: gint, valid: gboolean): PGtkRBNode{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_insert_after".}
+proc gtk_rbtree_remove_node*(tree: PGtkRBTree, node_: PGtkRBNode){.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_remove_node".}
+proc gtk_rbtree_reorder*(tree: PGtkRBTree, new_order: Pgint, length: gint){.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_reorder".}
+proc gtk_rbtree_find_count*(tree: PGtkRBTree, count: gint): PGtkRBNode{.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_find_count".}
+proc gtk_rbtree_node_set_height*(tree: PGtkRBTree, node_: PGtkRBNode,
+                                   height: gint){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_node_set_height".}
+proc gtk_rbtree_node_mark_invalid*(tree: PGtkRBTree, node_: PGtkRBNode){.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_node_mark_invalid".}
+proc gtk_rbtree_node_mark_valid*(tree: PGtkRBTree, node_: PGtkRBNode){.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_node_mark_valid".}
+proc gtk_rbtree_column_invalid*(tree: PGtkRBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_column_invalid".}
+proc gtk_rbtree_mark_invalid*(tree: PGtkRBTree){.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_mark_invalid".}
+proc gtk_rbtree_set_fixed_height*(tree: PGtkRBTree, height: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_set_fixed_height".}
+proc gtk_rbtree_node_find_offset*(tree: PGtkRBTree, node_: PGtkRBNode): gint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_node_find_offset".}
+proc gtk_rbtree_node_find_parity*(tree: PGtkRBTree, node_: PGtkRBNode): gint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_node_find_parity".}
+proc gtk_rbtree_traverse*(tree: PGtkRBTree, node_: PGtkRBNode,
+                            order: TGTraverseType,
+                            func_: TGtkRBTreeTraverseFunc, data: gpointer){.
+    cdecl, dynlib: gtklib, importc: "_gtk_rbtree_traverse".}
+proc gtk_rbtree_next*(tree: PGtkRBTree, node_: PGtkRBNode): PGtkRBNode{.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_next".}
+proc gtk_rbtree_prev*(tree: PGtkRBTree, node_: PGtkRBNode): PGtkRBNode{.cdecl,
+    dynlib: gtklib, importc: "_gtk_rbtree_prev".}
+proc gtk_rbtree_get_depth*(tree: PGtkRBTree): gint{.cdecl, dynlib: gtklib,
+    importc: "_gtk_rbtree_get_depth".}
+const
+  TREE_VIEW_DRAG_WIDTH* = 6
+  GTK_TREE_VIEW_IS_LIST* = 1 shl 0
+  GTK_TREE_VIEW_SHOW_EXPANDERS* = 1 shl 1
+  GTK_TREE_VIEW_IN_COLUMN_RESIZE* = 1 shl 2
+  GTK_TREE_VIEW_ARROW_PRELIT* = 1 shl 3
+  GTK_TREE_VIEW_HEADERS_VISIBLE* = 1 shl 4
+  GTK_TREE_VIEW_DRAW_KEYFOCUS* = 1 shl 5
+  GTK_TREE_VIEW_MODEL_SETUP* = 1 shl 6
+  GTK_TREE_VIEW_IN_COLUMN_DRAG* = 1 shl 7
+  DRAG_COLUMN_WINDOW_STATE_UNSET* = 0
+  DRAG_COLUMN_WINDOW_STATE_ORIGINAL* = 1
+  DRAG_COLUMN_WINDOW_STATE_ARROW* = 2
+  DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT* = 3
+  DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT* = 4
+
+proc GTK_TREE_VIEW_SET_FLAG*(tree_view: PGtkTreeView, flag: guint)
+proc GTK_TREE_VIEW_UNSET_FLAG*(tree_view: PGtkTreeView, flag: guint)
+proc GTK_TREE_VIEW_FLAG_SET*(tree_view: PGtkTreeView, flag: guint): bool
+proc TREE_VIEW_HEADER_HEIGHT*(tree_view: PGtkTreeView): int32
+proc TREE_VIEW_COLUMN_REQUESTED_WIDTH*(column: PGtkTreeViewColumn): int32
+proc TREE_VIEW_DRAW_EXPANDERS*(tree_view: PGtkTreeView): bool
+proc TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PGtkTreeView): int32
+const
+  bm_TGtkTreeViewPrivate_scroll_to_use_align* = 0x00000001
+  bp_TGtkTreeViewPrivate_scroll_to_use_align* = 0
+  bm_TGtkTreeViewPrivate_fixed_height_check* = 0x00000002
+  bp_TGtkTreeViewPrivate_fixed_height_check* = 1
+  bm_TGtkTreeViewPrivate_reorderable* = 0x00000004
+  bp_TGtkTreeViewPrivate_reorderable* = 2
+  bm_TGtkTreeViewPrivate_header_has_focus* = 0x00000008
+  bp_TGtkTreeViewPrivate_header_has_focus* = 3
+  bm_TGtkTreeViewPrivate_drag_column_window_state* = 0x00000070
+  bp_TGtkTreeViewPrivate_drag_column_window_state* = 4
+  bm_TGtkTreeViewPrivate_has_rules* = 0x00000080
+  bp_TGtkTreeViewPrivate_has_rules* = 7
+  bm_TGtkTreeViewPrivate_mark_rows_col_dirty* = 0x00000100
+  bp_TGtkTreeViewPrivate_mark_rows_col_dirty* = 8
+  bm_TGtkTreeViewPrivate_enable_search* = 0x00000200
+  bp_TGtkTreeViewPrivate_enable_search* = 9
+  bm_TGtkTreeViewPrivate_disable_popdown* = 0x00000400
+  bp_TGtkTreeViewPrivate_disable_popdown* = 10
+
+proc scroll_to_use_align*(a: var TGtkTreeViewPrivate): guint
+proc set_scroll_to_use_align*(a: var TGtkTreeViewPrivate,
+                              `scroll_to_use_align`: guint)
+proc fixed_height_check*(a: var TGtkTreeViewPrivate): guint
+proc set_fixed_height_check*(a: var TGtkTreeViewPrivate,
+                             `fixed_height_check`: guint)
+proc reorderable*(a: var TGtkTreeViewPrivate): guint
+proc set_reorderable*(a: var TGtkTreeViewPrivate, `reorderable`: guint)
+proc header_has_focus*(a: var TGtkTreeViewPrivate): guint
+proc set_header_has_focus*(a: var TGtkTreeViewPrivate, `header_has_focus`: guint)
+proc drag_column_window_state*(a: var TGtkTreeViewPrivate): guint
+proc set_drag_column_window_state*(a: var TGtkTreeViewPrivate,
+                                   `drag_column_window_state`: guint)
+proc has_rules*(a: var TGtkTreeViewPrivate): guint
+proc set_has_rules*(a: var TGtkTreeViewPrivate, `has_rules`: guint)
+proc mark_rows_col_dirty*(a: var TGtkTreeViewPrivate): guint
+proc set_mark_rows_col_dirty*(a: var TGtkTreeViewPrivate,
+                              `mark_rows_col_dirty`: guint)
+proc enable_search*(a: var TGtkTreeViewPrivate): guint
+proc set_enable_search*(a: var TGtkTreeViewPrivate, `enable_search`: guint)
+proc disable_popdown*(a: var TGtkTreeViewPrivate): guint
+proc set_disable_popdown*(a: var TGtkTreeViewPrivate, `disable_popdown`: guint)
+proc gtk_tree_selection_internal_select_node*(selection: PGtkTreeSelection,
+    node_: PGtkRBNode, tree: PGtkRBTree, path: PGtkTreePath,
+    state: TGdkModifierType, override_browse_mode: gboolean){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_selection_internal_select_node".}
+proc gtk_tree_view_find_node*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                                tree: var PGtkRBTree, node_: var PGtkRBNode): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_find_node".}
+proc gtk_tree_view_find_path*(tree_view: PGtkTreeView, tree: PGtkRBTree,
+                                node_: PGtkRBNode): PGtkTreePath{.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_find_path".}
+proc gtk_tree_view_child_move_resize*(tree_view: PGtkTreeView,
+                                        widget: PGtkWidget, x: gint, y: gint,
+                                        width: gint, height: gint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_child_move_resize".}
+proc gtk_tree_view_queue_draw_node*(tree_view: PGtkTreeView, tree: PGtkRBTree,
+                                      node_: PGtkRBNode,
+                                      clip_rect: PGdkRectangle){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_queue_draw_node".}
+proc gtk_tree_view_column_realize_button*(column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_realize_button".}
+proc gtk_tree_view_column_unrealize_button*(column: PGtkTreeViewColumn){.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_unrealize_button".}
+proc gtk_tree_view_column_set_tree_view*(column: PGtkTreeViewColumn,
+    tree_view: PGtkTreeView){.cdecl, dynlib: gtklib,
+                              importc: "_gtk_tree_view_column_set_tree_view".}
+proc gtk_tree_view_column_unset_tree_view*(column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_unset_tree_view".}
+proc gtk_tree_view_column_set_width*(column: PGtkTreeViewColumn, width: gint){.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_set_width".}
+proc gtk_tree_view_column_start_drag*(tree_view: PGtkTreeView,
+                                        column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_start_drag".}
+proc gtk_tree_view_column_start_editing*(tree_column: PGtkTreeViewColumn,
+    editable_widget: PGtkCellEditable){.cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_start_editing".}
+proc gtk_tree_view_column_stop_editing*(tree_column: PGtkTreeViewColumn){.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_stop_editing".}
+proc gtk_tree_view_install_mark_rows_col_dirty*(tree_view: PGtkTreeView){.
+    cdecl, dynlib: gtklib,
+    importc: "_gtk_tree_view_install_mark_rows_col_dirty".}
+proc DOgtk_tree_view_column_autosize*(tree_view: PGtkTreeView,
+                                      column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_autosize".}
+proc gtk_tree_view_column_has_editable_cell*(column: PGtkTreeViewColumn): gboolean{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_has_editable_cell".}
+proc gtk_tree_view_column_get_edited_cell*(column: PGtkTreeViewColumn): PGtkCellRenderer{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_get_edited_cell".}
+proc gtk_tree_view_column_count_special_cells*(column: PGtkTreeViewColumn): gint{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_count_special_cells".}
+proc gtk_tree_view_column_get_cell_at_pos*(column: PGtkTreeViewColumn, x: gint): PGtkCellRenderer{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_get_cell_at_pos".}
+proc gtk_tree_selection_new*(): PGtkTreeSelection{.cdecl, dynlib: gtklib,
+    importc: "_gtk_tree_selection_new".}
+proc gtk_tree_selection_new_with_tree_view*(tree_view: PGtkTreeView): PGtkTreeSelection{.
+    cdecl, dynlib: gtklib, importc: "_gtk_tree_selection_new_with_tree_view".}
+proc gtk_tree_selection_set_tree_view*(selection: PGtkTreeSelection,
+    tree_view: PGtkTreeView){.cdecl, dynlib: gtklib,
+                              importc: "_gtk_tree_selection_set_tree_view".}
+proc gtk_tree_view_column_cell_render*(tree_column: PGtkTreeViewColumn,
+    window: PGdkWindow, background_area: PGdkRectangle,
+    cell_area: PGdkRectangle, expose_area: PGdkRectangle, flags: guint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_cell_render".}
+proc gtk_tree_view_column_cell_focus*(tree_column: PGtkTreeViewColumn,
+                                        direction: gint, left: gboolean,
+                                        right: gboolean): gboolean{.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_cell_focus".}
+proc gtk_tree_view_column_cell_draw_focus*(tree_column: PGtkTreeViewColumn,
+    window: PGdkWindow, background_area: PGdkRectangle,
+    cell_area: PGdkRectangle, expose_area: PGdkRectangle, flags: guint){.cdecl,
+    dynlib: gtklib, importc: "_gtk_tree_view_column_cell_draw_focus".}
+proc gtk_tree_view_column_cell_set_dirty*(tree_column: PGtkTreeViewColumn,
+    install_handler: gboolean){.cdecl, dynlib: gtklib, importc: "_gtk_tree_view_column_cell_set_dirty".}
+proc gtk_tree_view_column_get_neighbor_sizes*(column: PGtkTreeViewColumn,
+    cell: PGtkCellRenderer, left: Pgint, right: Pgint){.cdecl, dynlib: gtklib,
+    importc: "_gtk_tree_view_column_get_neighbor_sizes".}
+proc GTK_TYPE_TREE_VIEW*(): GType
+proc GTK_TREE_VIEW*(obj: pointer): PGtkTreeView
+proc GTK_TREE_VIEW_CLASS*(klass: pointer): PGtkTreeViewClass
+proc GTK_IS_TREE_VIEW*(obj: pointer): bool
+proc GTK_IS_TREE_VIEW_CLASS*(klass: pointer): bool
+proc GTK_TREE_VIEW_GET_CLASS*(obj: pointer): PGtkTreeViewClass
+proc gtk_tree_view_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_get_type".}
+proc gtk_tree_view_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_tree_view_new".}
+proc gtk_tree_view_new_with_model*(model: PGtkTreeModel): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_new_with_model".}
+proc gtk_tree_view_get_model*(tree_view: PGtkTreeView): PGtkTreeModel{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_model".}
+proc gtk_tree_view_set_model*(tree_view: PGtkTreeView, model: PGtkTreeModel){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_model".}
+proc gtk_tree_view_get_selection*(tree_view: PGtkTreeView): PGtkTreeSelection{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_selection".}
+proc gtk_tree_view_get_hadjustment*(tree_view: PGtkTreeView): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_hadjustment".}
+proc gtk_tree_view_set_hadjustment*(tree_view: PGtkTreeView,
+                                    adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_hadjustment".}
+proc gtk_tree_view_get_vadjustment*(tree_view: PGtkTreeView): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_vadjustment".}
+proc gtk_tree_view_set_vadjustment*(tree_view: PGtkTreeView,
+                                    adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_vadjustment".}
+proc gtk_tree_view_get_headers_visible*(tree_view: PGtkTreeView): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_headers_visible".}
+proc gtk_tree_view_set_headers_visible*(tree_view: PGtkTreeView,
+                                        headers_visible: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_headers_visible".}
+proc gtk_tree_view_columns_autosize*(tree_view: PGtkTreeView){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_columns_autosize".}
+proc gtk_tree_view_set_headers_clickable*(tree_view: PGtkTreeView,
+    setting: gboolean){.cdecl, dynlib: gtklib,
+                        importc: "gtk_tree_view_set_headers_clickable".}
+proc gtk_tree_view_set_rules_hint*(tree_view: PGtkTreeView, setting: gboolean){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_rules_hint".}
+proc gtk_tree_view_get_rules_hint*(tree_view: PGtkTreeView): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_rules_hint".}
+proc gtk_tree_view_append_column*(tree_view: PGtkTreeView,
+                                  column: PGtkTreeViewColumn): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_append_column".}
+proc gtk_tree_view_remove_column*(tree_view: PGtkTreeView,
+                                  column: PGtkTreeViewColumn): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_remove_column".}
+proc gtk_tree_view_insert_column*(tree_view: PGtkTreeView,
+                                  column: PGtkTreeViewColumn, position: gint): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_insert_column".}
+proc gtk_tree_view_insert_column_with_data_func*(tree_view: PGtkTreeView,
+    position: gint, title: cstring, cell: PGtkCellRenderer,
+    func_: TGtkTreeCellDataFunc, data: gpointer, dnotify: TGDestroyNotify): gint{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_insert_column_with_data_func".}
+proc gtk_tree_view_get_column*(tree_view: PGtkTreeView, n: gint): PGtkTreeViewColumn{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_column".}
+proc gtk_tree_view_get_columns*(tree_view: PGtkTreeView): PGList{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_columns".}
+proc gtk_tree_view_move_column_after*(tree_view: PGtkTreeView,
+                                      column: PGtkTreeViewColumn,
+                                      base_column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_move_column_after".}
+proc gtk_tree_view_set_expander_column*(tree_view: PGtkTreeView,
+                                        column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_expander_column".}
+proc gtk_tree_view_get_expander_column*(tree_view: PGtkTreeView): PGtkTreeViewColumn{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_expander_column".}
+proc gtk_tree_view_set_column_drag_function*(tree_view: PGtkTreeView,
+    func_: TGtkTreeViewColumnDropFunc, user_data: gpointer,
+    destroy: TGtkDestroyNotify){.cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_column_drag_function".}
+proc gtk_tree_view_scroll_to_point*(tree_view: PGtkTreeView, tree_x: gint,
+                                    tree_y: gint){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_scroll_to_point".}
+proc gtk_tree_view_scroll_to_cell*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                                   column: PGtkTreeViewColumn,
+                                   use_align: gboolean, row_align: gfloat,
+                                   col_align: gfloat){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_scroll_to_cell".}
+proc gtk_tree_view_row_activated*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                                  column: PGtkTreeViewColumn){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_row_activated".}
+proc gtk_tree_view_expand_all*(tree_view: PGtkTreeView){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_expand_all".}
+proc gtk_tree_view_collapse_all*(tree_view: PGtkTreeView){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_collapse_all".}
+proc gtk_tree_view_expand_row*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                               open_all: gboolean): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_expand_row".}
+proc gtk_tree_view_collapse_row*(tree_view: PGtkTreeView, path: PGtkTreePath): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_collapse_row".}
+proc gtk_tree_view_map_expanded_rows*(tree_view: PGtkTreeView,
+                                      func_: TGtkTreeViewMappingFunc,
+                                      data: gpointer){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_map_expanded_rows".}
+proc gtk_tree_view_row_expanded*(tree_view: PGtkTreeView, path: PGtkTreePath): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_row_expanded".}
+proc gtk_tree_view_set_reorderable*(tree_view: PGtkTreeView,
+                                    reorderable: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_reorderable".}
+proc gtk_tree_view_get_reorderable*(tree_view: PGtkTreeView): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_reorderable".}
+proc gtk_tree_view_set_cursor*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                               focus_column: PGtkTreeViewColumn,
+                               start_editing: gboolean){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_set_cursor".}
+proc gtk_tree_view_set_cursor_on_cell*(tree_view: PGtkTreeView,
+                                       path: PGtkTreePath,
+                                       focus_column: PGtkTreeViewColumn,
+                                       focus_cell: PGtkCellRenderer,
+                                       start_editing: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_cursor_on_cell".}
+proc gtk_tree_view_get_bin_window*(tree_view: PGtkTreeView): PGdkWindow{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_bin_window".}
+proc gtk_tree_view_get_cell_area*(tree_view: PGtkTreeView, path: PGtkTreePath,
+                                  column: PGtkTreeViewColumn,
+                                  rect: PGdkRectangle){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_get_cell_area".}
+proc gtk_tree_view_get_background_area*(tree_view: PGtkTreeView,
+                                        path: PGtkTreePath,
+                                        column: PGtkTreeViewColumn,
+                                        rect: PGdkRectangle){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_background_area".}
+proc gtk_tree_view_get_visible_rect*(tree_view: PGtkTreeView,
+                                     visible_rect: PGdkRectangle){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_visible_rect".}
+proc gtk_tree_view_widget_to_tree_coords*(tree_view: PGtkTreeView, wx: gint,
+    wy: gint, tx: Pgint, ty: Pgint){.cdecl, dynlib: gtklib, importc: "gtk_tree_view_widget_to_tree_coords".}
+proc gtk_tree_view_tree_to_widget_coords*(tree_view: PGtkTreeView, tx: gint,
+    ty: gint, wx: Pgint, wy: Pgint){.cdecl, dynlib: gtklib, importc: "gtk_tree_view_tree_to_widget_coords".}
+proc gtk_tree_view_enable_model_drag_source*(tree_view: PGtkTreeView,
+    start_button_mask: TGdkModifierType, targets: PGtkTargetEntry,
+    n_targets: gint, actions: TGdkDragAction){.cdecl, dynlib: gtklib,
+    importc: "gtk_tree_view_enable_model_drag_source".}
+proc gtk_tree_view_enable_model_drag_dest*(tree_view: PGtkTreeView,
+    targets: PGtkTargetEntry, n_targets: gint, actions: TGdkDragAction){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_enable_model_drag_dest".}
+proc gtk_tree_view_unset_rows_drag_source*(tree_view: PGtkTreeView){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_unset_rows_drag_source".}
+proc gtk_tree_view_unset_rows_drag_dest*(tree_view: PGtkTreeView){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_unset_rows_drag_dest".}
+proc gtk_tree_view_set_drag_dest_row*(tree_view: PGtkTreeView,
+                                      path: PGtkTreePath,
+                                      pos: TGtkTreeViewDropPosition){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_drag_dest_row".}
+proc gtk_tree_view_create_row_drag_icon*(tree_view: PGtkTreeView,
+    path: PGtkTreePath): PGdkPixmap{.cdecl, dynlib: gtklib, importc: "gtk_tree_view_create_row_drag_icon".}
+proc gtk_tree_view_set_enable_search*(tree_view: PGtkTreeView,
+                                      enable_search: gboolean){.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_set_enable_search".}
+proc gtk_tree_view_get_enable_search*(tree_view: PGtkTreeView): gboolean{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_enable_search".}
+proc gtk_tree_view_get_search_column*(tree_view: PGtkTreeView): gint{.cdecl,
+    dynlib: gtklib, importc: "gtk_tree_view_get_search_column".}
+proc gtk_tree_view_set_search_column*(tree_view: PGtkTreeView, column: gint){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_search_column".}
+proc gtk_tree_view_get_search_equal_func*(tree_view: PGtkTreeView): TGtkTreeViewSearchEqualFunc{.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_get_search_equal_func".}
+proc gtk_tree_view_set_search_equal_func*(tree_view: PGtkTreeView,
+    search_equal_func: TGtkTreeViewSearchEqualFunc, search_user_data: gpointer,
+    search_destroy: TGtkDestroyNotify){.cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_search_equal_func".}
+proc gtk_tree_view_set_destroy_count_func*(tree_view: PGtkTreeView,
+    func_: TGtkTreeDestroyCountFunc, data: gpointer, destroy: TGtkDestroyNotify){.
+    cdecl, dynlib: gtklib, importc: "gtk_tree_view_set_destroy_count_func".}
+proc GTK_TYPE_VBUTTON_BOX*(): GType
+proc GTK_VBUTTON_BOX*(obj: pointer): PGtkVButtonBox
+proc GTK_VBUTTON_BOX_CLASS*(klass: pointer): PGtkVButtonBoxClass
+proc GTK_IS_VBUTTON_BOX*(obj: pointer): bool
+proc GTK_IS_VBUTTON_BOX_CLASS*(klass: pointer): bool
+proc GTK_VBUTTON_BOX_GET_CLASS*(obj: pointer): PGtkVButtonBoxClass
+proc gtk_vbutton_box_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_vbutton_box_get_type".}
+proc gtk_vbutton_box_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+    importc: "gtk_vbutton_box_new".}
+proc GTK_TYPE_VIEWPORT*(): GType
+proc GTK_VIEWPORT*(obj: pointer): PGtkViewport
+proc GTK_VIEWPORT_CLASS*(klass: pointer): PGtkViewportClass
+proc GTK_IS_VIEWPORT*(obj: pointer): bool
+proc GTK_IS_VIEWPORT_CLASS*(klass: pointer): bool
+proc GTK_VIEWPORT_GET_CLASS*(obj: pointer): PGtkViewportClass
+proc gtk_viewport_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_viewport_get_type".}
+proc gtk_viewport_new*(hadjustment: PGtkAdjustment, vadjustment: PGtkAdjustment): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_viewport_new".}
+proc gtk_viewport_get_hadjustment*(viewport: PGtkViewport): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_viewport_get_hadjustment".}
+proc gtk_viewport_get_vadjustment*(viewport: PGtkViewport): PGtkAdjustment{.
+    cdecl, dynlib: gtklib, importc: "gtk_viewport_get_vadjustment".}
+proc gtk_viewport_set_hadjustment*(viewport: PGtkViewport,
+                                   adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_viewport_set_hadjustment".}
+proc gtk_viewport_set_vadjustment*(viewport: PGtkViewport,
+                                   adjustment: PGtkAdjustment){.cdecl,
+    dynlib: gtklib, importc: "gtk_viewport_set_vadjustment".}
+proc gtk_viewport_set_shadow_type*(viewport: PGtkViewport,
+                                   thetype: TGtkShadowType){.cdecl,
+    dynlib: gtklib, importc: "gtk_viewport_set_shadow_type".}
+proc gtk_viewport_get_shadow_type*(viewport: PGtkViewport): TGtkShadowType{.
+    cdecl, dynlib: gtklib, importc: "gtk_viewport_get_shadow_type".}
+proc GTK_TYPE_VPANED*(): GType
+proc GTK_VPANED*(obj: pointer): PGtkVPaned
+proc GTK_VPANED_CLASS*(klass: pointer): PGtkVPanedClass
+proc GTK_IS_VPANED*(obj: pointer): bool
+proc GTK_IS_VPANED_CLASS*(klass: pointer): bool
+proc GTK_VPANED_GET_CLASS*(obj: pointer): PGtkVPanedClass
+proc gtk_vpaned_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_vpaned_get_type".}
+proc gtk_vpaned_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_vpaned_new".}
+proc GTK_TYPE_VRULER*(): GType
+proc GTK_VRULER*(obj: pointer): PGtkVRuler
+proc GTK_VRULER_CLASS*(klass: pointer): PGtkVRulerClass
+proc GTK_IS_VRULER*(obj: pointer): bool
+proc GTK_IS_VRULER_CLASS*(klass: pointer): bool
+proc GTK_VRULER_GET_CLASS*(obj: pointer): PGtkVRulerClass
+proc gtk_vruler_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_vruler_get_type".}
+proc gtk_vruler_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                    importc: "gtk_vruler_new".}
+proc GTK_TYPE_VSCALE*(): GType
+proc GTK_VSCALE*(obj: pointer): PGtkVScale
+proc GTK_VSCALE_CLASS*(klass: pointer): PGtkVScaleClass
+proc GTK_IS_VSCALE*(obj: pointer): bool
+proc GTK_IS_VSCALE_CLASS*(klass: pointer): bool
+proc GTK_VSCALE_GET_CLASS*(obj: pointer): PGtkVScaleClass
+proc gtk_vscale_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+                                       importc: "gtk_vscale_get_type".}
+proc gtk_vscale_new*(adjustment: PGtkAdjustment): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_vscale_new".}
+proc gtk_vscale_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_vscale_new_with_range".}
+proc GTK_TYPE_VSCROLLBAR*(): GType
+proc GTK_VSCROLLBAR*(obj: pointer): PGtkVScrollbar
+proc GTK_VSCROLLBAR_CLASS*(klass: pointer): PGtkVScrollbarClass
+proc GTK_IS_VSCROLLBAR*(obj: pointer): bool
+proc GTK_IS_VSCROLLBAR_CLASS*(klass: pointer): bool
+proc GTK_VSCROLLBAR_GET_CLASS*(obj: pointer): PGtkVScrollbarClass
+proc gtk_vscrollbar_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_vscrollbar_get_type".}
+proc gtk_vscrollbar_new*(adjustment: PGtkAdjustment): PGtkWidget{.cdecl,
+    dynlib: gtklib, importc: "gtk_vscrollbar_new".}
+proc GTK_TYPE_VSEPARATOR*(): GType
+proc GTK_VSEPARATOR*(obj: pointer): PGtkVSeparator
+proc GTK_VSEPARATOR_CLASS*(klass: pointer): PGtkVSeparatorClass
+proc GTK_IS_VSEPARATOR*(obj: pointer): bool
+proc GTK_IS_VSEPARATOR_CLASS*(klass: pointer): bool
+proc GTK_VSEPARATOR_GET_CLASS*(obj: pointer): PGtkVSeparatorClass
+proc gtk_vseparator_get_type*(): TGtkType{.cdecl, dynlib: gtklib,
+    importc: "gtk_vseparator_get_type".}
+proc gtk_vseparator_new*(): PGtkWidget{.cdecl, dynlib: gtklib,
+                                        importc: "gtk_vseparator_new".}
+proc GTK_TYPE_OBJECT*(): GType =
+  result = gtk_object_get_type()
+
+proc GTK_CHECK_CAST*(instance: Pointer, g_type: GType): PGTypeInstance =
+  result = G_TYPE_CHECK_INSTANCE_CAST(instance, g_type)
+
+proc GTK_CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer =
+  result = G_TYPE_CHECK_CLASS_CAST(g_class, g_type)
+
+proc GTK_CHECK_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass =
+  result = G_TYPE_INSTANCE_GET_CLASS(instance, g_type)
+
+proc GTK_CHECK_TYPE*(instance: Pointer, g_type: GType): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type)
+
+proc GTK_CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(g_class, g_type)
+
+proc GTK_OBJECT*(anObject: pointer): PGtkObject =
+  result = cast[PGtkObject](GTK_CHECK_CAST(anObject, GTK_TYPE_OBJECT()))
+
+proc GTK_OBJECT_CLASS*(klass: pointer): PGtkObjectClass =
+  result = cast[PGtkObjectClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_OBJECT()))
+
+proc GTK_IS_OBJECT*(anObject: pointer): bool =
+  result = GTK_CHECK_TYPE(anObject, GTK_TYPE_OBJECT())
+
+proc GTK_IS_OBJECT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_OBJECT())
+
+proc GTK_OBJECT_GET_CLASS*(anObject: pointer): PGtkObjectClass =
+  result = cast[PGtkObjectClass](GTK_CHECK_GET_CLASS(anObject, GTK_TYPE_OBJECT()))
+
+proc GTK_OBJECT_TYPE*(anObject: pointer): GType =
+  result = G_TYPE_FROM_INSTANCE(anObject)
+
+proc GTK_OBJECT_TYPE_NAME*(anObject: pointer): cstring =
+  result = g_type_name(GTK_OBJECT_TYPE(anObject))
+
+proc GTK_OBJECT_FLAGS*(obj: pointer): guint32 =
+  result = (GTK_OBJECT(obj)).flags
+
+proc GTK_OBJECT_FLOATING*(obj: pointer): gboolean =
+  result = ((GTK_OBJECT_FLAGS(obj)) and GTK_FLOATING) != 0
+
+proc GTK_OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) =
+  GTK_OBJECT(obj).flags = GTK_OBJECT(obj).flags or int(flag)
+
+proc GTK_OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) =
+  GTK_OBJECT(obj) . flags = GTK_OBJECT(obj). flags and not int(flag)
+
+proc gtk_object_data_try_key*(`string`: cstring): TGQuark =
+  result = g_quark_try_string(`string`)
+
+proc gtk_object_data_force_id*(`string`: cstring): TGQuark =
+  result = g_quark_from_string(`string`)
+
+proc GTK_CLASS_NAME*(`class`: pointer): cstring =
+  result = g_type_name(G_TYPE_FROM_CLASS(`class`))
+
+proc GTK_CLASS_TYPE*(`class`: pointer): GType =
+  result = G_TYPE_FROM_CLASS(`class`)
+
+proc GTK_TYPE_IS_OBJECT*(thetype: GType): gboolean =
+  result = g_type_is_a(thetype, GTK_TYPE_OBJECT())
+
+proc GTK_TYPE_IDENTIFIER*(): GType =
+  result = gtk_identifier_get_type()
+
+proc GTK_SIGNAL_FUNC*(f: pointer): TGtkSignalFunc =
+  result = cast[TGtkSignalFunc](f)
+
+proc gtk_type_name*(thetype: GType): cstring =
+  result = g_type_name(thetype)
+
+proc gtk_type_from_name*(name: cstring): GType =
+  result = g_type_from_name(name)
+
+proc gtk_type_parent*(thetype: GType): GType =
+  result = g_type_parent(thetype)
+
+proc gtk_type_is_a*(thetype, is_a_type: GType): gboolean =
+  result = g_type_is_a(thetype, is_a_type)
+
+proc GTK_FUNDAMENTAL_TYPE*(thetype: GType): GType =
+  result = G_TYPE_FUNDAMENTAL(thetype)
+
+proc GTK_VALUE_CHAR*(a: TGtkArg): gchar =
+  Result = cast[ptr gchar](addr(a.d))^
+
+proc GTK_VALUE_UCHAR*(a: TGtkArg): guchar =
+  Result = cast[ptr guchar](addr(a.d))^
+
+proc GTK_VALUE_BOOL*(a: TGtkArg): gboolean =
+  Result = cast[ptr gboolean](addr(a.d))^
+
+proc GTK_VALUE_INT*(a: TGtkArg): gint =
+  Result = cast[ptr gint](addr(a.d))^
+
+proc GTK_VALUE_UINT*(a: TGtkArg): guint =
+  Result = cast[ptr guint](addr(a.d))^
+
+proc GTK_VALUE_LONG*(a: TGtkArg): glong =
+  Result = cast[ptr glong](addr(a.d))^
+
+proc GTK_VALUE_ULONG*(a: TGtkArg): gulong =
+  Result = cast[ptr gulong](addr(a.d))^
+
+proc GTK_VALUE_FLOAT*(a: TGtkArg): gfloat =
+  Result = cast[ptr gfloat](addr(a.d))^
+
+proc GTK_VALUE_DOUBLE*(a: TGtkArg): gdouble =
+  Result = cast[ptr gdouble](addr(a.d))^
+
+proc GTK_VALUE_STRING*(a: TGtkArg): cstring =
+  Result = cast[ptr cstring](addr(a.d))^
+
+proc GTK_VALUE_ENUM*(a: TGtkArg): gint =
+  Result = cast[ptr gint](addr(a.d))^
+
+proc GTK_VALUE_FLAGS*(a: TGtkArg): guint =
+  Result = cast[ptr guint](addr(a.d))^
+
+proc GTK_VALUE_BOXED*(a: TGtkArg): gpointer =
+  Result = cast[ptr gpointer](addr(a.d))^
+
+proc GTK_VALUE_OBJECT*(a: TGtkArg): PGtkObject =
+  Result = cast[ptr PGtkObject](addr(a.d))^
+
+proc GTK_VALUE_POINTER*(a: TGtkArg): GPointer =
+  Result = cast[ptr gpointer](addr(a.d))^
+
+proc GTK_VALUE_SIGNAL*(a: TGtkArg): TGtkArgSignalData =
+  Result = cast[ptr TGtkArgSignalData](addr(a.d))^
+
+proc GTK_RETLOC_CHAR*(a: TGtkArg): cstring =
+  Result = cast[ptr cstring](addr(a.d))^
+
+proc GTK_RETLOC_UCHAR*(a: TGtkArg): Pguchar =
+  Result = cast[ptr pguchar](addr(a.d))^
+
+proc GTK_RETLOC_BOOL*(a: TGtkArg): Pgboolean =
+  Result = cast[ptr pgboolean](addr(a.d))^
+
+proc GTK_RETLOC_INT*(a: TGtkArg): Pgint =
+  Result = cast[ptr pgint](addr(a.d))^
+
+proc GTK_RETLOC_UINT*(a: TGtkArg): Pguint =
+  Result = cast[ptr pguint](addr(a.d))^
+
+proc GTK_RETLOC_LONG*(a: TGtkArg): Pglong =
+  Result = cast[ptr pglong](addr(a.d))^
+
+proc GTK_RETLOC_ULONG*(a: TGtkArg): Pgulong =
+  Result = cast[ptr pgulong](addr(a.d))^
+
+proc GTK_RETLOC_FLOAT*(a: TGtkArg): Pgfloat =
+  Result = cast[ptr pgfloat](addr(a.d))^
+
+proc GTK_RETLOC_DOUBLE*(a: TGtkArg): Pgdouble =
+  Result = cast[ptr pgdouble](addr(a.d))^
+
+proc GTK_RETLOC_STRING*(a: TGtkArg): Ppgchar =
+  Result = cast[ptr Ppgchar](addr(a.d))^
+
+proc GTK_RETLOC_ENUM*(a: TGtkArg): Pgint =
+  Result = cast[ptr Pgint](addr(a.d))^
+
+proc GTK_RETLOC_FLAGS*(a: TGtkArg): Pguint =
+  Result = cast[ptr pguint](addr(a.d))^
+
+proc GTK_RETLOC_BOXED*(a: TGtkArg): Pgpointer =
+  Result = cast[ptr pgpointer](addr(a.d))^
+
+proc GTK_RETLOC_OBJECT*(a: TGtkArg): PPGtkObject =
+  Result = cast[ptr ppgtkobject](addr(a.d))^
+
+proc GTK_RETLOC_POINTER*(a: TGtkArg): Pgpointer =
+  Result = cast[ptr pgpointer](addr(a.d))^
+
+proc GTK_TYPE_WIDGET*(): GType =
+  result = gtk_widget_get_type()
+
+proc GTK_WIDGET*(widget: pointer): PGtkWidget =
+  result = cast[PGtkWidget](GTK_CHECK_CAST(widget, GTK_TYPE_WIDGET()))
+
+proc GTK_WIDGET_CLASS*(klass: pointer): PGtkWidgetClass =
+  result = cast[PGtkWidgetClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_WIDGET()))
+
+proc GTK_IS_WIDGET*(widget: pointer): bool =
+  result = GTK_CHECK_TYPE(widget, GTK_TYPE_WIDGET())
+
+proc GTK_IS_WIDGET_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_WIDGET())
+
+proc GTK_WIDGET_GET_CLASS*(obj: pointer): PGtkWidgetClass =
+  result = cast[PGtkWidgetClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_WIDGET()))
+
+proc GTK_WIDGET_TYPE*(wid: pointer): GType =
+  result = GTK_OBJECT_TYPE(wid)
+
+proc GTK_WIDGET_STATE*(wid: pointer): int32 =
+  result = (GTK_WIDGET(wid)) . state
+
+proc GTK_WIDGET_SAVED_STATE*(wid: pointer): int32 =
+  result = (GTK_WIDGET(wid)) . saved_state
+
+proc GTK_WIDGET_FLAGS*(wid: pointer): guint32 =
+  result = GTK_OBJECT_FLAGS(wid)
+
+proc GTK_WIDGET_TOPLEVEL*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_TOPLEVEL) != 0
+
+proc GTK_WIDGET_NO_WINDOW*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_NO_WINDOW) != 0
+
+proc GTK_WIDGET_REALIZED*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_REALIZED) != 0
+
+proc GTK_WIDGET_MAPPED*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_MAPPED) != 0
+
+proc GTK_WIDGET_VISIBLE*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_VISIBLE) != 0
+
+proc GTK_WIDGET_DRAWABLE*(wid: pointer): gboolean =
+  result = (GTK_WIDGET_VISIBLE(wid)) and (GTK_WIDGET_MAPPED(wid))
+
+proc GTK_WIDGET_SENSITIVE*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_SENSITIVE) != 0
+
+proc GTK_WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_PARENT_SENSITIVE) != 0
+
+proc GTK_WIDGET_IS_SENSITIVE*(wid: pointer): gboolean =
+  result = (GTK_WIDGET_SENSITIVE(wid)) and (GTK_WIDGET_PARENT_SENSITIVE(wid))
+
+proc GTK_WIDGET_CAN_FOCUS*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_CAN_FOCUS) != 0
+
+proc GTK_WIDGET_HAS_FOCUS*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_HAS_FOCUS) != 0
+
+proc GTK_WIDGET_CAN_DEFAULT*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_CAN_DEFAULT) != 0
+
+proc GTK_WIDGET_HAS_DEFAULT*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_HAS_DEFAULT) != 0
+
+proc GTK_WIDGET_HAS_GRAB*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_HAS_GRAB) != 0
+
+proc GTK_WIDGET_RC_STYLE*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_RC_STYLE) != 0
+
+proc GTK_WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_COMPOSITE_CHILD) != 0
+
+proc GTK_WIDGET_APP_PAINTABLE*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_APP_PAINTABLE) != 0
+
+proc GTK_WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_RECEIVES_DEFAULT) != 0
+
+proc GTK_WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean =
+  result = ((GTK_WIDGET_FLAGS(wid)) and GTK_DOUBLE_BUFFERED) != 0
+
+proc GTK_TYPE_REQUISITION*(): GType =
+  result = gtk_requisition_get_type()
+
+proc x_set*(a: var TGtkWidgetAuxInfo): guint =
+  result = (a.flag0 and bm_TGtkWidgetAuxInfo_x_set) shr
+      bp_TGtkWidgetAuxInfo_x_set
+
+proc set_x_set*(a: var TGtkWidgetAuxInfo, `x_set`: guint) =
+  a.flag0 = a.flag0 or
+      ((`x_set` shl bp_TGtkWidgetAuxInfo_x_set) and
+      bm_TGtkWidgetAuxInfo_x_set)
+
+proc y_set*(a: var TGtkWidgetAuxInfo): guint =
+  result = (a.flag0 and bm_TGtkWidgetAuxInfo_y_set) shr
+      bp_TGtkWidgetAuxInfo_y_set
+
+proc set_y_set*(a: var TGtkWidgetAuxInfo, `y_set`: guint) =
+  a.flag0 = a.flag0 or
+      ((`y_set` shl bp_TGtkWidgetAuxInfo_y_set) and
+      bm_TGtkWidgetAuxInfo_y_set)
+
+proc gtk_widget_set_visual*(widget, visual: pointer) =
+  if (Widget != nil) and (visual != nil): nil
+
+proc gtk_widget_push_visual*(visual: pointer) =
+  if (visual != nil): nil
+
+proc gtk_widget_pop_visual*() =
+  nil
+
+proc gtk_widget_set_default_visual*(visual: pointer) =
+  if (visual != nil): nil
+
+proc gtk_widget_set_rc_style*(widget: pointer) =
+  gtk_widget_set_style(cast[PGtkWidget](widget), nil)
+
+proc gtk_widget_restore_default_style*(widget: pointer) =
+  gtk_widget_set_style(cast[PGtkWidget](widget), nil)
+
+proc GTK_WIDGET_SET_FLAGS*(wid: PGtkWidget, flags: TGtkWidgetFlags): TGtkWidgetFlags =
+  cast[pGtkObject](wid).flags = cast[pGtkObject](wid).flags or int(flags)
+  result = cast[pGtkObject](wid).flags
+
+proc GTK_WIDGET_UNSET_FLAGS*(wid: PGtkWidget, flags: TGtkWidgetFlags): TGtkWidgetFlags =
+  cast[pGtkObject](wid).flags = cast[pGtkObject](wid).flags and (not int(flags))
+  result = cast[pGtkObject](wid).flags
+
+proc GTK_TYPE_MISC*(): GType =
+  result = gtk_misc_get_type()
+
+proc GTK_MISC*(obj: pointer): PGtkMisc =
+  result = cast[PGtkMisc](GTK_CHECK_CAST(obj, GTK_TYPE_MISC()))
+
+proc GTK_MISC_CLASS*(klass: pointer): PGtkMiscClass =
+  result = cast[PGtkMiscClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_MISC()))
+
+proc GTK_IS_MISC*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MISC())
+
+proc GTK_IS_MISC_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MISC())
+
+proc GTK_MISC_GET_CLASS*(obj: pointer): PGtkMiscClass =
+  result = cast[PGtkMiscClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_MISC()))
+
+proc GTK_TYPE_ACCEL_GROUP*(): GType =
+  result = gtk_accel_group_get_type()
+
+proc GTK_ACCEL_GROUP*(anObject: pointer): PGtkAccelGroup =
+  result = cast[PGtkAccelGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject,
+      GTK_TYPE_ACCEL_GROUP()))
+
+proc GTK_ACCEL_GROUP_CLASS*(klass: pointer): PGtkAccelGroupClass =
+  result = cast[PGtkAccelGroupClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_ACCEL_GROUP()))
+
+proc GTK_IS_ACCEL_GROUP*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_ACCEL_GROUP())
+
+proc GTK_IS_ACCEL_GROUP_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_ACCEL_GROUP())
+
+proc GTK_ACCEL_GROUP_GET_CLASS*(obj: pointer): PGtkAccelGroupClass =
+  result = cast[PGtkAccelGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_ACCEL_GROUP()))
+
+proc accel_flags*(a: var TGtkAccelKey): guint =
+  result = (a.flag0 and bm_TGtkAccelKey_accel_flags) shr
+      bp_TGtkAccelKey_accel_flags
+
+proc set_accel_flags*(a: var TGtkAccelKey, `accel_flags`: guint) =
+  a.flag0 = a.flag0 or
+      ((`accel_flags` shl bp_TGtkAccelKey_accel_flags) and
+      bm_TGtkAccelKey_accel_flags)
+
+proc gtk_accel_group_ref*(AccelGroup: PGtkAccelGroup) =
+  discard g_object_ref(AccelGroup)
+
+proc gtk_accel_group_unref*(AccelGroup: PGtkAccelGroup) =
+  g_object_unref(AccelGroup)
+
+proc GTK_TYPE_CONTAINER*(): GType =
+  result = gtk_container_get_type()
+
+proc GTK_CONTAINER*(obj: pointer): PGtkContainer =
+  result = cast[PGtkContainer](GTK_CHECK_CAST(obj, GTK_TYPE_CONTAINER()))
+
+proc GTK_CONTAINER_CLASS*(klass: pointer): PGtkContainerClass =
+  result = cast[PGtkContainerClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CONTAINER()))
+
+proc GTK_IS_CONTAINER*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CONTAINER())
+
+proc GTK_IS_CONTAINER_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CONTAINER())
+
+proc GTK_CONTAINER_GET_CLASS*(obj: pointer): PGtkContainerClass =
+  result = cast[PGtkContainerClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CONTAINER()))
+
+proc GTK_IS_RESIZE_CONTAINER*(widget: pointer): bool =
+  result = (GTK_IS_CONTAINER(widget)) and
+      ((resize_mode(cast[PGtkContainer](widget))) != ord(GTK_RESIZE_PARENT))
+
+proc border_width*(a: var TGtkContainer): guint =
+  result = (a.GtkContainer_flag0 and bm_TGtkContainer_border_width) shr
+      bp_TGtkContainer_border_width
+
+proc set_border_width*(a: var TGtkContainer, `border_width`: guint) =
+  a.GtkContainer_flag0 = a.GtkContainer_flag0 or
+      ((`border_width` shl bp_TGtkContainer_border_width) and
+      bm_TGtkContainer_border_width)
+
+proc need_resize*(a: var TGtkContainer): guint =
+  result = (a.GtkContainer_flag0 and bm_TGtkContainer_need_resize) shr
+      bp_TGtkContainer_need_resize
+
+proc set_need_resize*(a: var TGtkContainer, `need_resize`: guint) =
+  a.GtkContainer_flag0 = a.GtkContainer_flag0 or
+      ((`need_resize` shl bp_TGtkContainer_need_resize) and
+      bm_TGtkContainer_need_resize)
+
+proc resize_mode*(a: PGtkContainer): guint =
+  result = (a.GtkContainer_flag0 and bm_TGtkContainer_resize_mode) shr
+      bp_TGtkContainer_resize_mode
+
+proc set_resize_mode*(a: var TGtkContainer, `resize_mode`: guint) =
+  a.GtkContainerflag0 = a.GtkContainerflag0 or
+      ((`resize_mode` shl bp_TGtkContainer_resize_mode) and
+      bm_TGtkContainer_resize_mode)
+
+proc reallocate_redraws*(a: var TGtkContainer): guint =
+  result = (a.GtkContainerflag0 and bm_TGtkContainer_reallocate_redraws) shr
+      bp_TGtkContainer_reallocate_redraws
+
+proc set_reallocate_redraws*(a: var TGtkContainer, `reallocate_redraws`: guint) =
+  a.GtkContainerflag0 = a.GtkContainerflag0 or
+      ((`reallocate_redraws` shl bp_TGtkContainer_reallocate_redraws) and
+      bm_TGtkContainer_reallocate_redraws)
+
+proc has_focus_chain*(a: var TGtkContainer): guint =
+  result = (a.GtkContainerflag0 and bm_TGtkContainer_has_focus_chain) shr
+      bp_TGtkContainer_has_focus_chain
+
+proc set_has_focus_chain*(a: var TGtkContainer, `has_focus_chain`: guint) =
+  a.GtkContainerflag0 = a.GtkContainerflag0 or
+      ((`has_focus_chain` shl bp_TGtkContainer_has_focus_chain) and
+      bm_TGtkContainer_has_focus_chain)
+
+proc GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer,
+    property_id: guint, pspec: pointer) =
+  write(stdout, "WARNING: invalid child property id\n")
+
+proc GTK_TYPE_BIN*(): GType =
+  result = gtk_bin_get_type()
+
+proc GTK_BIN*(obj: pointer): PGtkBin =
+  result = cast[PGtkBin](GTK_CHECK_CAST(obj, GTK_TYPE_BIN()))
+
+proc GTK_BIN_CLASS*(klass: pointer): PGtkBinClass =
+  result = cast[PGtkBinClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_BIN()))
+
+proc GTK_IS_BIN*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_BIN())
+
+proc GTK_IS_BIN_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_BIN())
+
+proc GTK_BIN_GET_CLASS*(obj: pointer): PGtkBinClass =
+  result = cast[PGtkBinClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_BIN()))
+
+proc GTK_TYPE_WINDOW*(): GType =
+  result = gtk_window_get_type()
+
+proc GTK_WINDOW*(obj: pointer): PGtkWindow =
+  result = cast[PGtkWindow](GTK_CHECK_CAST(obj, GTK_TYPE_WINDOW()))
+
+proc GTK_WINDOW_CLASS*(klass: pointer): PGtkWindowClass =
+  result = cast[PGtkWindowClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_WINDOW()))
+
+proc GTK_IS_WINDOW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_WINDOW())
+
+proc GTK_IS_WINDOW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_WINDOW())
+
+proc GTK_WINDOW_GET_CLASS*(obj: pointer): PGtkWindowClass =
+  result = cast[PGtkWindowClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_WINDOW()))
+
+proc allow_shrink*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_allow_shrink) shr
+      bp_TGtkWindow_allow_shrink
+
+proc set_allow_shrink*(a: var TGtkWindow, `allow_shrink`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`allow_shrink` shl bp_TGtkWindow_allow_shrink) and
+      bm_TGtkWindow_allow_shrink)
+
+proc allow_grow*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_allow_grow) shr
+      bp_TGtkWindow_allow_grow
+
+proc set_allow_grow*(a: var TGtkWindow, `allow_grow`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`allow_grow` shl bp_TGtkWindow_allow_grow) and
+      bm_TGtkWindow_allow_grow)
+
+proc configure_notify_received*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_configure_notify_received) shr
+      bp_TGtkWindow_configure_notify_received
+
+proc set_configure_notify_received*(a: var TGtkWindow,
+                                    `configure_notify_received`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`configure_notify_received` shl
+      bp_TGtkWindow_configure_notify_received) and
+      bm_TGtkWindow_configure_notify_received)
+
+proc need_default_position*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_need_default_position) shr
+      bp_TGtkWindow_need_default_position
+
+proc set_need_default_position*(a: var TGtkWindow,
+                                `need_default_position`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`need_default_position` shl bp_TGtkWindow_need_default_position) and
+      bm_TGtkWindow_need_default_position)
+
+proc need_default_size*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_need_default_size) shr
+      bp_TGtkWindow_need_default_size
+
+proc set_need_default_size*(a: var TGtkWindow, `need_default_size`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`need_default_size` shl bp_TGtkWindow_need_default_size) and
+      bm_TGtkWindow_need_default_size)
+
+proc position*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_position) shr bp_TGtkWindow_position
+
+proc set_position*(a: var TGtkWindow, `position`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`position` shl bp_TGtkWindow_position) and bm_TGtkWindow_position)
+
+proc get_type*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_type) shr bp_TGtkWindow_type
+
+proc set_type*(a: var TGtkWindow, `type`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`type` shl bp_TGtkWindow_type) and bm_TGtkWindow_type)
+
+proc has_user_ref_count*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_has_user_ref_count) shr
+      bp_TGtkWindow_has_user_ref_count
+
+proc set_has_user_ref_count*(a: var TGtkWindow, `has_user_ref_count`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`has_user_ref_count` shl bp_TGtkWindow_has_user_ref_count) and
+      bm_TGtkWindow_has_user_ref_count)
+
+proc has_focus*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_has_focus) shr bp_TGtkWindow_has_focus
+
+proc set_has_focus*(a: var TGtkWindow, `has_focus`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`has_focus` shl bp_TGtkWindow_has_focus) and bm_TGtkWindow_has_focus)
+
+proc modal*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_modal) shr bp_TGtkWindow_modal
+
+proc set_modal*(a: var TGtkWindow, `modal`: guint) =
+  a.GtkWindow_flag0 = a.GtkWindow_flag0 or
+      ((`modal` shl bp_TGtkWindow_modal) and bm_TGtkWindow_modal)
+
+proc destroy_with_parent*(a: var TGtkWindow): guint =
+  result = (a.GtkWindow_flag0 and bm_TGtkWindow_destroy_with_parent) shr
+      bp_TGtkWindow_destroy_with_parent
+
+proc set_destroy_with_parent*(a: var TGtkWindow, `destroy_with_parent`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`destroy_with_parent` shl bp_TGtkWindow_destroy_with_parent) and
+      bm_TGtkWindow_destroy_with_parent)
+
+proc has_frame*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_has_frame) shr bp_TGtkWindow_has_frame
+
+proc set_has_frame*(a: var TGtkWindow, `has_frame`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`has_frame` shl bp_TGtkWindow_has_frame) and bm_TGtkWindow_has_frame)
+
+proc iconify_initially*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_iconify_initially) shr
+      bp_TGtkWindow_iconify_initially
+
+proc set_iconify_initially*(a: var TGtkWindow, `iconify_initially`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`iconify_initially` shl bp_TGtkWindow_iconify_initially) and
+      bm_TGtkWindow_iconify_initially)
+
+proc stick_initially*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_stick_initially) shr
+      bp_TGtkWindow_stick_initially
+
+proc set_stick_initially*(a: var TGtkWindow, `stick_initially`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`stick_initially` shl bp_TGtkWindow_stick_initially) and
+      bm_TGtkWindow_stick_initially)
+
+proc maximize_initially*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_maximize_initially) shr
+      bp_TGtkWindow_maximize_initially
+
+proc set_maximize_initially*(a: var TGtkWindow, `maximize_initially`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`maximize_initially` shl bp_TGtkWindow_maximize_initially) and
+      bm_TGtkWindow_maximize_initially)
+
+proc decorated*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_decorated) shr bp_TGtkWindow_decorated
+
+proc set_decorated*(a: var TGtkWindow, `decorated`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`decorated` shl bp_TGtkWindow_decorated) and bm_TGtkWindow_decorated)
+
+proc type_hint*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_type_hint) shr bp_TGtkWindow_type_hint
+
+proc set_type_hint*(a: var TGtkWindow, `type_hint`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`type_hint` shl bp_TGtkWindow_type_hint) and bm_TGtkWindow_type_hint)
+
+proc gravity*(a: var TGtkWindow): guint =
+  result = (a.GtkWindowflag0 and bm_TGtkWindow_gravity) shr bp_TGtkWindow_gravity
+
+proc set_gravity*(a: var TGtkWindow, `gravity`: guint) =
+  a.GtkWindowflag0 = a.GtkWindowflag0 or
+      ((`gravity` shl bp_TGtkWindow_gravity) and bm_TGtkWindow_gravity)
+
+proc GTK_TYPE_WINDOW_GROUP*(): GType =
+  result = gtk_window_group_get_type()
+
+proc GTK_WINDOW_GROUP*(anObject: pointer): PGtkWindowGroup =
+  result = cast[PGtkWindowGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject,
+      GTK_TYPE_WINDOW_GROUP()))
+
+proc GTK_WINDOW_GROUP_CLASS*(klass: pointer): PGtkWindowGroupClass =
+  result = cast[PGtkWindowGroupClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_WINDOW_GROUP()))
+
+proc GTK_IS_WINDOW_GROUP*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_WINDOW_GROUP())
+
+proc GTK_IS_WINDOW_GROUP_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_WINDOW_GROUP())
+
+proc GTK_WINDOW_GROUP_GET_CLASS*(obj: pointer): PGtkWindowGroupClass =
+  result = cast[PGtkWindowGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_WINDOW_GROUP()))
+
+proc gtk_window_position*(window: PGtkWindow, position: TGtkWindowPosition) =
+  gtk_window_set_position(window, position)
+
+proc GTK_TYPE_LABEL*(): GType =
+  result = gtk_label_get_type()
+
+proc GTK_LABEL*(obj: pointer): PGtkLabel =
+  result = cast[PGtkLabel](GTK_CHECK_CAST(obj, GTK_TYPE_LABEL()))
+
+proc GTK_LABEL_CLASS*(klass: pointer): PGtkLabelClass =
+  result = cast[PGtkLabelClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_LABEL()))
+
+proc GTK_IS_LABEL*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_LABEL())
+
+proc GTK_IS_LABEL_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_LABEL())
+
+proc GTK_LABEL_GET_CLASS*(obj: pointer): PGtkLabelClass =
+  result = cast[PGtkLabelClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_LABEL()))
+
+proc jtype*(a: var TGtkLabel): guint =
+  result = (a.GtkLabelflag0 and bm_TGtkLabel_jtype) shr bp_TGtkLabel_jtype
+
+proc set_jtype*(a: var TGtkLabel, `jtype`: guint) =
+  a.GtkLabelflag0 = a.GtkLabelflag0 or
+      ((`jtype` shl bp_TGtkLabel_jtype) and bm_TGtkLabel_jtype)
+
+proc wrap*(a: var TGtkLabel): guint =
+  result = (a.GtkLabelflag0 and bm_TGtkLabel_wrap) shr bp_TGtkLabel_wrap
+
+proc set_wrap*(a: var TGtkLabel, `wrap`: guint) =
+  a.GtkLabelflag0 = a.GtkLabelflag0 or ((`wrap` shl bp_TGtkLabel_wrap) and bm_TGtkLabel_wrap)
+
+proc use_underline*(a: var TGtkLabel): guint =
+  result = (a.GtkLabelflag0 and bm_TGtkLabel_use_underline) shr
+      bp_TGtkLabel_use_underline
+
+proc set_use_underline*(a: var TGtkLabel, `use_underline`: guint) =
+  a.GtkLabelflag0 = a.GtkLabelflag0 or
+      ((`use_underline` shl bp_TGtkLabel_use_underline) and
+      bm_TGtkLabel_use_underline)
+
+proc use_markup*(a: var TGtkLabel): guint =
+  result = (a.GtkLabelflag0 and bm_TGtkLabel_use_markup) shr bp_TGtkLabel_use_markup
+
+proc set_use_markup*(a: var TGtkLabel, `use_markup`: guint) =
+  a.GtkLabelflag0 = a.GtkLabelflag0 or
+      ((`use_markup` shl bp_TGtkLabel_use_markup) and bm_TGtkLabel_use_markup)
+
+proc GTK_TYPE_ACCEL_LABEL*(): GType =
+  result = gtk_accel_label_get_type()
+
+proc GTK_ACCEL_LABEL*(obj: pointer): PGtkAccelLabel =
+  result = cast[PGtkAccelLabel](GTK_CHECK_CAST(obj, GTK_TYPE_ACCEL_LABEL()))
+
+proc GTK_ACCEL_LABEL_CLASS*(klass: pointer): PGtkAccelLabelClass =
+  result = cast[PGtkAccelLabelClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ACCEL_LABEL()))
+
+proc GTK_IS_ACCEL_LABEL*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ACCEL_LABEL())
+
+proc GTK_IS_ACCEL_LABEL_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ACCEL_LABEL())
+
+proc GTK_ACCEL_LABEL_GET_CLASS*(obj: pointer): PGtkAccelLabelClass =
+  result = cast[PGtkAccelLabelClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ACCEL_LABEL()))
+
+proc latin1_to_char*(a: var TGtkAccelLabelClass): guint =
+  result = (a.GtkAccelLabelClassflag0 and bm_TGtkAccelLabelClass_latin1_to_char) shr
+      bp_TGtkAccelLabelClass_latin1_to_char
+
+proc set_latin1_to_char*(a: var TGtkAccelLabelClass, `latin1_to_char`: guint) =
+  a.GtkAccelLabelClassflag0 = a.GtkAccelLabelClassflag0 or
+      ((`latin1_to_char` shl bp_TGtkAccelLabelClass_latin1_to_char) and
+      bm_TGtkAccelLabelClass_latin1_to_char)
+
+proc gtk_accel_label_accelerator_width*(accel_label: PGtkAccelLabel): guint =
+  result = gtk_accel_label_get_accel_width(accel_label)
+
+proc GTK_TYPE_ACCESSIBLE*(): GType =
+  result = gtk_accessible_get_type()
+
+proc GTK_ACCESSIBLE*(obj: pointer): PGtkAccessible =
+  result = cast[PGtkAccessible](GTK_CHECK_CAST(obj, GTK_TYPE_ACCESSIBLE()))
+
+proc GTK_ACCESSIBLE_CLASS*(klass: pointer): PGtkAccessibleClass =
+  result = cast[PGtkAccessibleClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ACCESSIBLE()))
+
+proc GTK_IS_ACCESSIBLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ACCESSIBLE())
+
+proc GTK_IS_ACCESSIBLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ACCESSIBLE())
+
+proc GTK_ACCESSIBLE_GET_CLASS*(obj: pointer): PGtkAccessibleClass =
+  result = cast[PGtkAccessibleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ACCESSIBLE()))
+
+proc GTK_TYPE_ADJUSTMENT*(): GType =
+  result = gtk_adjustment_get_type()
+
+proc GTK_ADJUSTMENT*(obj: pointer): PGtkAdjustment =
+  result = cast[PGtkAdjustment](GTK_CHECK_CAST(obj, GTK_TYPE_ADJUSTMENT()))
+
+proc GTK_ADJUSTMENT_CLASS*(klass: pointer): PGtkAdjustmentClass =
+  result = cast[PGtkAdjustmentClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ADJUSTMENT()))
+
+proc GTK_IS_ADJUSTMENT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ADJUSTMENT())
+
+proc GTK_IS_ADJUSTMENT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ADJUSTMENT())
+
+proc GTK_ADJUSTMENT_GET_CLASS*(obj: pointer): PGtkAdjustmentClass =
+  result = cast[PGtkAdjustmentClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ADJUSTMENT()))
+
+proc GTK_TYPE_ALIGNMENT*(): GType =
+  result = gtk_alignment_get_type()
+
+proc GTK_ALIGNMENT*(obj: pointer): PGtkAlignment =
+  result = cast[PGtkAlignment](GTK_CHECK_CAST(obj, GTK_TYPE_ALIGNMENT()))
+
+proc GTK_ALIGNMENT_CLASS*(klass: pointer): PGtkAlignmentClass =
+  result = cast[PGtkAlignmentClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ALIGNMENT()))
+
+proc GTK_IS_ALIGNMENT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ALIGNMENT())
+
+proc GTK_IS_ALIGNMENT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ALIGNMENT())
+
+proc GTK_ALIGNMENT_GET_CLASS*(obj: pointer): PGtkAlignmentClass =
+  result = cast[PGtkAlignmentClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ALIGNMENT()))
+
+proc GTK_TYPE_FRAME*(): GType =
+  result = gtk_frame_get_type()
+
+proc GTK_FRAME*(obj: pointer): PGtkFrame =
+  result = cast[PGtkFrame](GTK_CHECK_CAST(obj, GTK_TYPE_FRAME()))
+
+proc GTK_FRAME_CLASS*(klass: pointer): PGtkFrameClass =
+  result = cast[PGtkFrameClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_FRAME()))
+
+proc GTK_IS_FRAME*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_FRAME())
+
+proc GTK_IS_FRAME_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_FRAME())
+
+proc GTK_FRAME_GET_CLASS*(obj: pointer): PGtkFrameClass =
+  result = cast[PGtkFrameClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_FRAME()))
+
+proc GTK_TYPE_ASPECT_FRAME*(): GType =
+  result = gtk_aspect_frame_get_type()
+
+proc GTK_ASPECT_FRAME*(obj: pointer): PGtkAspectFrame =
+  result = cast[PGtkAspectFrame](GTK_CHECK_CAST(obj, GTK_TYPE_ASPECT_FRAME()))
+
+proc GTK_ASPECT_FRAME_CLASS*(klass: pointer): PGtkAspectFrameClass =
+  result = cast[PGtkAspectFrameClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_ASPECT_FRAME()))
+
+proc GTK_IS_ASPECT_FRAME*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ASPECT_FRAME())
+
+proc GTK_IS_ASPECT_FRAME_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ASPECT_FRAME())
+
+proc GTK_ASPECT_FRAME_GET_CLASS*(obj: pointer): PGtkAspectFrameClass =
+  result = cast[PGtkAspectFrameClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ASPECT_FRAME()))
+
+proc GTK_TYPE_ARROW*(): GType =
+  result = gtk_arrow_get_type()
+
+proc GTK_ARROW*(obj: pointer): PGtkArrow =
+  result = cast[PGtkArrow](GTK_CHECK_CAST(obj, GTK_TYPE_ARROW()))
+
+proc GTK_ARROW_CLASS*(klass: pointer): PGtkArrowClass =
+  result = cast[PGtkArrowClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ARROW()))
+
+proc GTK_IS_ARROW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ARROW())
+
+proc GTK_IS_ARROW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ARROW())
+
+proc GTK_ARROW_GET_CLASS*(obj: pointer): PGtkArrowClass =
+  result = cast[PGtkArrowClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ARROW()))
+
+proc parsed*(a: var TGtkBindingSet): guint =
+  result = (a.flag0 and bm_TGtkBindingSet_parsed) shr
+      bp_TGtkBindingSet_parsed
+
+proc set_parsed*(a: var TGtkBindingSet, `parsed`: guint) =
+  a.flag0 = a.flag0 or
+      ((`parsed` shl bp_TGtkBindingSet_parsed) and bm_TGtkBindingSet_parsed)
+
+proc destroyed*(a: var TGtkBindingEntry): guint =
+  result = (a.flag0 and bm_TGtkBindingEntry_destroyed) shr
+      bp_TGtkBindingEntry_destroyed
+
+proc set_destroyed*(a: var TGtkBindingEntry, `destroyed`: guint) =
+  a.flag0 = a.flag0 or
+      ((`destroyed` shl bp_TGtkBindingEntry_destroyed) and
+      bm_TGtkBindingEntry_destroyed)
+
+proc in_emission*(a: var TGtkBindingEntry): guint =
+  result = (a.flag0 and bm_TGtkBindingEntry_in_emission) shr
+      bp_TGtkBindingEntry_in_emission
+
+proc set_in_emission*(a: var TGtkBindingEntry, `in_emission`: guint) =
+  a.flag0 = a.flag0 or
+      ((`in_emission` shl bp_TGtkBindingEntry_in_emission) and
+      bm_TGtkBindingEntry_in_emission)
+
+proc gtk_binding_entry_add*(binding_set: PGtkBindingSet, keyval: guint,
+                            modifiers: TGdkModifierType) =
+  gtk_binding_entry_clear(binding_set, keyval, modifiers)
+
+proc GTK_TYPE_BOX*(): GType =
+  result = gtk_box_get_type()
+
+proc GTK_BOX*(obj: pointer): PGtkBox =
+  result = cast[PGtkBox](GTK_CHECK_CAST(obj, GTK_TYPE_BOX()))
+
+proc GTK_BOX_CLASS*(klass: pointer): PGtkBoxClass =
+  result = cast[PGtkBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_BOX()))
+
+proc GTK_IS_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_BOX())
+
+proc GTK_IS_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_BOX())
+
+proc GTK_BOX_GET_CLASS*(obj: pointer): PGtkBoxClass =
+  result = cast[PGtkBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_BOX()))
+
+proc homogeneous*(a: var TGtkBox): guint =
+  result = (a.GtkBoxflag0 and bm_TGtkBox_homogeneous) shr bp_TGtkBox_homogeneous
+
+proc set_homogeneous*(a: var TGtkBox, `homogeneous`: guint) =
+  a.GtkBoxflag0 = a.GtkBoxflag0 or
+      ((`homogeneous` shl bp_TGtkBox_homogeneous) and bm_TGtkBox_homogeneous)
+
+proc expand*(a: var TGtkBoxChild): guint =
+  result = (a.flag0 and bm_TGtkBoxChild_expand) shr bp_TGtkBoxChild_expand
+
+proc set_expand*(a: var TGtkBoxChild, `expand`: guint) =
+  a.flag0 = a.flag0 or
+      ((`expand` shl bp_TGtkBoxChild_expand) and bm_TGtkBoxChild_expand)
+
+proc fill*(a: var TGtkBoxChild): guint =
+  result = (a.flag0 and bm_TGtkBoxChild_fill) shr bp_TGtkBoxChild_fill
+
+proc set_fill*(a: var TGtkBoxChild, `fill`: guint) =
+  a.flag0 = a.flag0 or
+      ((`fill` shl bp_TGtkBoxChild_fill) and bm_TGtkBoxChild_fill)
+
+proc pack*(a: var TGtkBoxChild): guint =
+  result = (a.flag0 and bm_TGtkBoxChild_pack) shr bp_TGtkBoxChild_pack
+
+proc set_pack*(a: var TGtkBoxChild, `pack`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pack` shl bp_TGtkBoxChild_pack) and bm_TGtkBoxChild_pack)
+
+proc is_secondary*(a: var TGtkBoxChild): guint =
+  result = (a.flag0 and bm_TGtkBoxChild_is_secondary) shr
+      bp_TGtkBoxChild_is_secondary
+
+proc set_is_secondary*(a: var TGtkBoxChild, `is_secondary`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_secondary` shl bp_TGtkBoxChild_is_secondary) and
+      bm_TGtkBoxChild_is_secondary)
+
+proc GTK_TYPE_BUTTON_BOX*(): GType =
+  result = gtk_button_box_get_type()
+
+proc GTK_BUTTON_BOX*(obj: pointer): PGtkButtonBox =
+  result = cast[PGtkButtonBox](GTK_CHECK_CAST(obj, GTK_TYPE_BUTTON_BOX()))
+
+proc GTK_BUTTON_BOX_CLASS*(klass: pointer): PGtkButtonBoxClass =
+  result = cast[PGtkButtonBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_BUTTON_BOX()))
+
+proc GTK_IS_BUTTON_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_BUTTON_BOX())
+
+proc GTK_IS_BUTTON_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_BUTTON_BOX())
+
+proc GTK_BUTTON_BOX_GET_CLASS*(obj: pointer): PGtkButtonBoxClass =
+  result = cast[PGtkButtonBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_BUTTON_BOX()))
+
+proc gtk_button_box_set_spacing*(b: pointer, s: gint) =
+  gtk_box_set_spacing(GTK_BOX(b), s)
+
+proc gtk_button_box_get_spacing*(b: pointer): gint =
+  result = gtk_box_get_spacing(GTK_BOX(b))
+
+proc GTK_TYPE_BUTTON*(): GType =
+  result = gtk_button_get_type()
+
+proc GTK_BUTTON*(obj: pointer): PGtkButton =
+  result = cast[PGtkButton](GTK_CHECK_CAST(obj, GTK_TYPE_BUTTON()))
+
+proc GTK_BUTTON_CLASS*(klass: pointer): PGtkButtonClass =
+  result = cast[PGtkButtonClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_BUTTON()))
+
+proc GTK_IS_BUTTON*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_BUTTON())
+
+proc GTK_IS_BUTTON_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_BUTTON())
+
+proc GTK_BUTTON_GET_CLASS*(obj: pointer): PGtkButtonClass =
+  result = cast[PGtkButtonClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_BUTTON()))
+
+proc constructed*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_constructed) shr
+      bp_TGtkButton_constructed
+
+proc set_constructed*(a: var TGtkButton, `constructed`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`constructed` shl bp_TGtkButton_constructed) and
+      bm_TGtkButton_constructed)
+
+proc in_button*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_in_button) shr bp_TGtkButton_in_button
+
+proc set_in_button*(a: var TGtkButton, `in_button`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`in_button` shl bp_TGtkButton_in_button) and bm_TGtkButton_in_button)
+
+proc button_down*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_button_down) shr
+      bp_TGtkButton_button_down
+
+proc set_button_down*(a: var TGtkButton, `button_down`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`button_down` shl bp_TGtkButton_button_down) and
+      bm_TGtkButton_button_down)
+
+proc relief*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_relief) shr bp_TGtkButton_relief
+
+proc set_relief*(a: var TGtkButton, `relief`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`relief` shl bp_TGtkButton_relief) and bm_TGtkButton_relief)
+
+proc use_underline*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_use_underline) shr
+      bp_TGtkButton_use_underline
+
+proc set_use_underline*(a: var TGtkButton, `use_underline`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`use_underline` shl bp_TGtkButton_use_underline) and
+      bm_TGtkButton_use_underline)
+
+proc use_stock*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_use_stock) shr bp_TGtkButton_use_stock
+
+proc set_use_stock*(a: var TGtkButton, `use_stock`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`use_stock` shl bp_TGtkButton_use_stock) and bm_TGtkButton_use_stock)
+
+proc depressed*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_depressed) shr bp_TGtkButton_depressed
+
+proc set_depressed*(a: var TGtkButton, `depressed`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`depressed` shl bp_TGtkButton_depressed) and bm_TGtkButton_depressed)
+
+proc depress_on_activate*(a: var TGtkButton): guint =
+  result = (a.GtkButtonflag0 and bm_TGtkButton_depress_on_activate) shr
+      bp_TGtkButton_depress_on_activate
+
+proc set_depress_on_activate*(a: var TGtkButton, `depress_on_activate`: guint) =
+  a.GtkButtonflag0 = a.GtkButtonflag0 or
+      ((`depress_on_activate` shl bp_TGtkButton_depress_on_activate) and
+      bm_TGtkButton_depress_on_activate)
+
+proc GTK_TYPE_CALENDAR*(): GType =
+  result = gtk_calendar_get_type()
+
+proc GTK_CALENDAR*(obj: pointer): PGtkCalendar =
+  result = cast[PGtkCalendar](GTK_CHECK_CAST(obj, GTK_TYPE_CALENDAR()))
+
+proc GTK_CALENDAR_CLASS*(klass: pointer): PGtkCalendarClass =
+  result = cast[PGtkCalendarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CALENDAR()))
+
+proc GTK_IS_CALENDAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CALENDAR())
+
+proc GTK_IS_CALENDAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CALENDAR())
+
+proc GTK_CALENDAR_GET_CLASS*(obj: pointer): PGtkCalendarClass =
+  result = cast[PGtkCalendarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CALENDAR()))
+
+proc GTK_TYPE_CELL_EDITABLE*(): GType =
+  result = gtk_cell_editable_get_type()
+
+proc GTK_CELL_EDITABLE*(obj: pointer): PGtkCellEditable =
+  result = cast[PGtkCellEditable](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      GTK_TYPE_CELL_EDITABLE()))
+
+proc GTK_CELL_EDITABLE_CLASS*(obj: pointer): PGtkCellEditableIface =
+  result = cast[PGtkCellEditableIface](G_TYPE_CHECK_CLASS_CAST(obj,
+      GTK_TYPE_CELL_EDITABLE()))
+
+proc GTK_IS_CELL_EDITABLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_CELL_EDITABLE())
+
+proc GTK_CELL_EDITABLE_GET_IFACE*(obj: pointer): PGtkCellEditableIface =
+  result = cast[PGtkCellEditableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      GTK_TYPE_CELL_EDITABLE()))
+
+proc GTK_TYPE_CELL_RENDERER*(): GType =
+  result = gtk_cell_renderer_get_type()
+
+proc GTK_CELL_RENDERER*(obj: pointer): PGtkCellRenderer =
+  result = cast[PGtkCellRenderer](GTK_CHECK_CAST(obj, GTK_TYPE_CELL_RENDERER()))
+
+proc GTK_CELL_RENDERER_CLASS*(klass: pointer): PGtkCellRendererClass =
+  result = cast[PGtkCellRendererClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CELL_RENDERER()))
+
+proc GTK_IS_CELL_RENDERER*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CELL_RENDERER())
+
+proc GTK_IS_CELL_RENDERER_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CELL_RENDERER())
+
+proc GTK_CELL_RENDERER_GET_CLASS*(obj: pointer): PGtkCellRendererClass =
+  result = cast[PGtkCellRendererClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CELL_RENDERER()))
+
+proc mode*(a: var TGtkCellRenderer): guint =
+  result = (a.GtkCellRendererflag0 and bm_TGtkCellRenderer_mode) shr
+      bp_TGtkCellRenderer_mode
+
+proc set_mode*(a: var TGtkCellRenderer, `mode`: guint) =
+  a.GtkCellRendererflag0 = a.GtkCellRendererflag0 or
+      ((`mode` shl bp_TGtkCellRenderer_mode) and bm_TGtkCellRenderer_mode)
+
+proc visible*(a: var TGtkCellRenderer): guint =
+  result = (a.GtkCellRendererflag0 and bm_TGtkCellRenderer_visible) shr
+      bp_TGtkCellRenderer_visible
+
+proc set_visible*(a: var TGtkCellRenderer, `visible`: guint) =
+  a.GtkCellRendererflag0 = a.GtkCellRendererflag0 or
+      ((`visible` shl bp_TGtkCellRenderer_visible) and
+      bm_TGtkCellRenderer_visible)
+
+proc is_expander*(a: var TGtkCellRenderer): guint =
+  result = (a.GtkCellRendererflag0 and bm_TGtkCellRenderer_is_expander) shr
+      bp_TGtkCellRenderer_is_expander
+
+proc set_is_expander*(a: var TGtkCellRenderer, `is_expander`: guint) =
+  a.GtkCellRendererflag0 = a.GtkCellRendererflag0 or
+      ((`is_expander` shl bp_TGtkCellRenderer_is_expander) and
+      bm_TGtkCellRenderer_is_expander)
+
+proc is_expanded*(a: var TGtkCellRenderer): guint =
+  result = (a.GtkCellRendererflag0 and bm_TGtkCellRenderer_is_expanded) shr
+      bp_TGtkCellRenderer_is_expanded
+
+proc set_is_expanded*(a: var TGtkCellRenderer, `is_expanded`: guint) =
+  a.GtkCellRendererflag0 = a.GtkCellRendererflag0 or
+      ((`is_expanded` shl bp_TGtkCellRenderer_is_expanded) and
+      bm_TGtkCellRenderer_is_expanded)
+
+proc cell_background_set*(a: var TGtkCellRenderer): guint =
+  result = (a.GtkCellRendererflag0 and bm_TGtkCellRenderer_cell_background_set) shr
+      bp_TGtkCellRenderer_cell_background_set
+
+proc set_cell_background_set*(a: var TGtkCellRenderer,
+                              `cell_background_set`: guint) =
+  a.GtkCellRendererflag0 = a.GtkCellRendererflag0 or
+      ((`cell_background_set` shl bp_TGtkCellRenderer_cell_background_set) and
+      bm_TGtkCellRenderer_cell_background_set)
+
+proc GTK_TYPE_CELL_RENDERER_TEXT*(): GType =
+  result = gtk_cell_renderer_text_get_type()
+
+proc GTK_CELL_RENDERER_TEXT*(obj: pointer): PGtkCellRendererText =
+  result = cast[PGtkCellRendererText](GTK_CHECK_CAST(obj, GTK_TYPE_CELL_RENDERER_TEXT()))
+
+proc GTK_CELL_RENDERER_TEXT_CLASS*(klass: pointer): PGtkCellRendererTextClass =
+  result = cast[PGtkCellRendererTextClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CELL_RENDERER_TEXT()))
+
+proc GTK_IS_CELL_RENDERER_TEXT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CELL_RENDERER_TEXT())
+
+proc GTK_IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CELL_RENDERER_TEXT())
+
+proc GTK_CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PGtkCellRendererTextClass =
+  result = cast[PGtkCellRendererTextClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_CELL_RENDERER_TEXT()))
+
+proc strikethrough*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_strikethrough) shr
+      bp_TGtkCellRendererText_strikethrough
+
+proc set_strikethrough*(a: var TGtkCellRendererText, `strikethrough`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`strikethrough` shl bp_TGtkCellRendererText_strikethrough) and
+      bm_TGtkCellRendererText_strikethrough)
+
+proc editable*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_editable) shr
+      bp_TGtkCellRendererText_editable
+
+proc set_editable*(a: var TGtkCellRendererText, `editable`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`editable` shl bp_TGtkCellRendererText_editable) and
+      bm_TGtkCellRendererText_editable)
+
+proc scale_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_scale_set) shr
+      bp_TGtkCellRendererText_scale_set
+
+proc set_scale_set*(a: var TGtkCellRendererText, `scale_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`scale_set` shl bp_TGtkCellRendererText_scale_set) and
+      bm_TGtkCellRendererText_scale_set)
+
+proc foreground_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_foreground_set) shr
+      bp_TGtkCellRendererText_foreground_set
+
+proc set_foreground_set*(a: var TGtkCellRendererText, `foreground_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`foreground_set` shl bp_TGtkCellRendererText_foreground_set) and
+      bm_TGtkCellRendererText_foreground_set)
+
+proc background_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_background_set) shr
+      bp_TGtkCellRendererText_background_set
+
+proc set_background_set*(a: var TGtkCellRendererText, `background_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`background_set` shl bp_TGtkCellRendererText_background_set) and
+      bm_TGtkCellRendererText_background_set)
+
+proc underline_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_underline_set) shr
+      bp_TGtkCellRendererText_underline_set
+
+proc set_underline_set*(a: var TGtkCellRendererText, `underline_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`underline_set` shl bp_TGtkCellRendererText_underline_set) and
+      bm_TGtkCellRendererText_underline_set)
+
+proc rise_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_rise_set) shr
+      bp_TGtkCellRendererText_rise_set
+
+proc set_rise_set*(a: var TGtkCellRendererText, `rise_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`rise_set` shl bp_TGtkCellRendererText_rise_set) and
+      bm_TGtkCellRendererText_rise_set)
+
+proc strikethrough_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_strikethrough_set) shr
+      bp_TGtkCellRendererText_strikethrough_set
+
+proc set_strikethrough_set*(a: var TGtkCellRendererText,
+                            `strikethrough_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`strikethrough_set` shl bp_TGtkCellRendererText_strikethrough_set) and
+      bm_TGtkCellRendererText_strikethrough_set)
+
+proc editable_set*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_editable_set) shr
+      bp_TGtkCellRendererText_editable_set
+
+proc set_editable_set*(a: var TGtkCellRendererText, `editable_set`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`editable_set` shl bp_TGtkCellRendererText_editable_set) and
+      bm_TGtkCellRendererText_editable_set)
+
+proc calc_fixed_height*(a: var TGtkCellRendererText): guint =
+  result = (a.GtkCellRendererTextflag0 and bm_TGtkCellRendererText_calc_fixed_height) shr
+      bp_TGtkCellRendererText_calc_fixed_height
+
+proc set_calc_fixed_height*(a: var TGtkCellRendererText,
+                            `calc_fixed_height`: guint) =
+  a.GtkCellRendererTextflag0 = a.GtkCellRendererTextflag0 or
+      ((`calc_fixed_height` shl bp_TGtkCellRendererText_calc_fixed_height) and
+      bm_TGtkCellRendererText_calc_fixed_height)
+
+proc GTK_TYPE_CELL_RENDERER_TOGGLE*(): GType =
+  result = gtk_cell_renderer_toggle_get_type()
+
+proc GTK_CELL_RENDERER_TOGGLE*(obj: pointer): PGtkCellRendererToggle =
+  result = cast[PGtkCellRendererToggle](GTK_CHECK_CAST(obj,
+      GTK_TYPE_CELL_RENDERER_TOGGLE()))
+
+proc GTK_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PGtkCellRendererToggleClass =
+  result = cast[PGtkCellRendererToggleClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CELL_RENDERER_TOGGLE()))
+
+proc GTK_IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CELL_RENDERER_TOGGLE())
+
+proc GTK_IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CELL_RENDERER_TOGGLE())
+
+proc GTK_CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PGtkCellRendererToggleClass =
+  result = cast[PGtkCellRendererToggleClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_CELL_RENDERER_TOGGLE()))
+
+proc active*(a: var TGtkCellRendererToggle): guint =
+  result = (a.GtkCellRendererToggleflag0 and bm_TGtkCellRendererToggle_active) shr
+      bp_TGtkCellRendererToggle_active
+
+proc set_active*(a: var TGtkCellRendererToggle, `active`: guint) =
+  a.GtkCellRendererToggleflag0 = a.GtkCellRendererToggleflag0 or
+      ((`active` shl bp_TGtkCellRendererToggle_active) and
+      bm_TGtkCellRendererToggle_active)
+
+proc activatable*(a: var TGtkCellRendererToggle): guint =
+  result = (a.GtkCellRendererToggleflag0 and bm_TGtkCellRendererToggle_activatable) shr
+      bp_TGtkCellRendererToggle_activatable
+
+proc set_activatable*(a: var TGtkCellRendererToggle, `activatable`: guint) =
+  a.GtkCellRendererToggleflag0 = a.GtkCellRendererToggleflag0 or
+      ((`activatable` shl bp_TGtkCellRendererToggle_activatable) and
+      bm_TGtkCellRendererToggle_activatable)
+
+proc radio*(a: var TGtkCellRendererToggle): guint =
+  result = (a.GtkCellRendererToggleflag0 and bm_TGtkCellRendererToggle_radio) shr
+      bp_TGtkCellRendererToggle_radio
+
+proc set_radio*(a: var TGtkCellRendererToggle, `radio`: guint) =
+  a.GtkCellRendererToggleflag0 = a.GtkCellRendererToggleflag0 or
+      ((`radio` shl bp_TGtkCellRendererToggle_radio) and
+      bm_TGtkCellRendererToggle_radio)
+
+proc GTK_TYPE_CELL_RENDERER_PIXBUF*(): GType =
+  result = gtk_cell_renderer_pixbuf_get_type()
+
+proc GTK_CELL_RENDERER_PIXBUF*(obj: pointer): PGtkCellRendererPixbuf =
+  result = cast[PGtkCellRendererPixbuf](GTK_CHECK_CAST(obj,
+      GTK_TYPE_CELL_RENDERER_PIXBUF()))
+
+proc GTK_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PGtkCellRendererPixbufClass =
+  result = cast[PGtkCellRendererPixbufClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CELL_RENDERER_PIXBUF()))
+
+proc GTK_IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CELL_RENDERER_PIXBUF())
+
+proc GTK_IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CELL_RENDERER_PIXBUF())
+
+proc GTK_CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PGtkCellRendererPixbufClass =
+  result = cast[PGtkCellRendererPixbufClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_CELL_RENDERER_PIXBUF()))
+
+proc GTK_TYPE_ITEM*(): GType =
+  result = gtk_item_get_type()
+
+proc GTK_ITEM*(obj: pointer): PGtkItem =
+  result = cast[PGtkItem](GTK_CHECK_CAST(obj, GTK_TYPE_ITEM()))
+
+proc GTK_ITEM_CLASS*(klass: pointer): PGtkItemClass =
+  result = cast[PGtkItemClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ITEM()))
+
+proc GTK_IS_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ITEM())
+
+proc GTK_IS_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ITEM())
+
+proc GTK_ITEM_GET_CLASS*(obj: pointer): PGtkItemClass =
+  result = cast[PGtkItemClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ITEM()))
+
+proc GTK_TYPE_MENU_ITEM*(): GType =
+  result = gtk_menu_item_get_type()
+
+proc GTK_MENU_ITEM*(obj: pointer): PGtkMenuItem =
+  result = cast[PGtkMenuItem](GTK_CHECK_CAST(obj, GTK_TYPE_MENU_ITEM()))
+
+proc GTK_MENU_ITEM_CLASS*(klass: pointer): PGtkMenuItemClass =
+  result = cast[PGtkMenuItemClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_MENU_ITEM()))
+
+proc GTK_IS_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MENU_ITEM())
+
+proc GTK_IS_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MENU_ITEM())
+
+proc GTK_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkMenuItemClass =
+  result = cast[PGtkMenuItemClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_MENU_ITEM()))
+
+proc show_submenu_indicator*(a: var TGtkMenuItem): guint =
+  result = (a.GtkMenuItemflag0 and bm_TGtkMenuItem_show_submenu_indicator) shr
+      bp_TGtkMenuItem_show_submenu_indicator
+
+proc set_show_submenu_indicator*(a: var TGtkMenuItem,
+                                 `show_submenu_indicator`: guint) =
+  a.GtkMenuItemflag0 = a.GtkMenuItemflag0 or
+      ((`show_submenu_indicator` shl bp_TGtkMenuItem_show_submenu_indicator) and
+      bm_TGtkMenuItem_show_submenu_indicator)
+
+proc submenu_placement*(a: var TGtkMenuItem): guint =
+  result = (a.GtkMenuItemflag0 and bm_TGtkMenuItem_submenu_placement) shr
+      bp_TGtkMenuItem_submenu_placement
+
+proc set_submenu_placement*(a: var TGtkMenuItem, `submenu_placement`: guint) =
+  a.GtkMenuItemflag0 = a.GtkMenuItemflag0 or
+      ((`submenu_placement` shl bp_TGtkMenuItem_submenu_placement) and
+      bm_TGtkMenuItem_submenu_placement)
+
+proc submenu_direction*(a: var TGtkMenuItem): guint =
+  result = (a.GtkMenuItemflag0 and bm_TGtkMenuItem_submenu_direction) shr
+      bp_TGtkMenuItem_submenu_direction
+
+proc set_submenu_direction*(a: var TGtkMenuItem, `submenu_direction`: guint) =
+  a.GtkMenuItemflag0 = a.GtkMenuItemflag0 or
+      ((`submenu_direction` shl bp_TGtkMenuItem_submenu_direction) and
+      bm_TGtkMenuItem_submenu_direction)
+
+proc right_justify*(a: var TGtkMenuItem): guint =
+  result = (a.GtkMenuItemflag0 and bm_TGtkMenuItem_right_justify) shr
+      bp_TGtkMenuItem_right_justify
+
+proc set_right_justify*(a: var TGtkMenuItem, `right_justify`: guint) =
+  a.GtkMenuItemflag0 = a.GtkMenuItemflag0 or
+      ((`right_justify` shl bp_TGtkMenuItem_right_justify) and
+      bm_TGtkMenuItem_right_justify)
+
+proc timer_from_keypress*(a: var TGtkMenuItem): guint =
+  result = (a.GtkMenuItemflag0 and bm_TGtkMenuItem_timer_from_keypress) shr
+      bp_TGtkMenuItem_timer_from_keypress
+
+proc set_timer_from_keypress*(a: var TGtkMenuItem, `timer_from_keypress`: guint) =
+  a.GtkMenuItemflag0 = a.GtkMenuItemflag0 or
+      ((`timer_from_keypress` shl bp_TGtkMenuItem_timer_from_keypress) and
+      bm_TGtkMenuItem_timer_from_keypress)
+
+proc hide_on_activate*(a: var TGtkMenuItemClass): guint =
+  result = (a.GtkMenuItemClassflag0 and bm_TGtkMenuItemClass_hide_on_activate) shr
+      bp_TGtkMenuItemClass_hide_on_activate
+
+proc set_hide_on_activate*(a: var TGtkMenuItemClass, `hide_on_activate`: guint) =
+  a.GtkMenuItemClassflag0 = a.GtkMenuItemClassflag0 or
+      ((`hide_on_activate` shl bp_TGtkMenuItemClass_hide_on_activate) and
+      bm_TGtkMenuItemClass_hide_on_activate)
+
+proc gtk_menu_item_right_justify*(menu_item: PGtkMenuItem) =
+  gtk_menu_item_set_right_justified(menu_item, true)
+
+proc GTK_TYPE_TOGGLE_BUTTON*(): GType =
+  result = gtk_toggle_button_get_type()
+
+proc GTK_TOGGLE_BUTTON*(obj: pointer): PGtkToggleButton =
+  result = cast[PGtkToggleButton](GTK_CHECK_CAST(obj, GTK_TYPE_TOGGLE_BUTTON()))
+
+proc GTK_TOGGLE_BUTTON_CLASS*(klass: pointer): PGtkToggleButtonClass =
+  result = cast[PGtkToggleButtonClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TOGGLE_BUTTON()))
+
+proc GTK_IS_TOGGLE_BUTTON*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TOGGLE_BUTTON())
+
+proc GTK_IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TOGGLE_BUTTON())
+
+proc GTK_TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PGtkToggleButtonClass =
+  result = cast[PGtkToggleButtonClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TOGGLE_BUTTON()))
+
+proc active*(a: var TGtkToggleButton): guint =
+  result = (a.GtkToggleButtonflag0 and bm_TGtkToggleButton_active) shr
+      bp_TGtkToggleButton_active
+
+proc set_active*(a: var TGtkToggleButton, `active`: guint) =
+  a.GtkToggleButtonflag0 = a.GtkToggleButtonflag0 or
+      ((`active` shl bp_TGtkToggleButton_active) and
+      bm_TGtkToggleButton_active)
+
+proc draw_indicator*(a: var TGtkToggleButton): guint =
+  result = (a.GtkToggleButtonflag0 and bm_TGtkToggleButton_draw_indicator) shr
+      bp_TGtkToggleButton_draw_indicator
+
+proc set_draw_indicator*(a: var TGtkToggleButton, `draw_indicator`: guint) =
+  a.GtkToggleButtonflag0 = a.GtkToggleButtonflag0 or
+      ((`draw_indicator` shl bp_TGtkToggleButton_draw_indicator) and
+      bm_TGtkToggleButton_draw_indicator)
+
+proc inconsistent*(a: var TGtkToggleButton): guint =
+  result = (a.GtkToggleButtonflag0 and bm_TGtkToggleButton_inconsistent) shr
+      bp_TGtkToggleButton_inconsistent
+
+proc set_inconsistent*(a: var TGtkToggleButton, `inconsistent`: guint) =
+  a.GtkToggleButtonflag0 = a.GtkToggleButtonflag0 or
+      ((`inconsistent` shl bp_TGtkToggleButton_inconsistent) and
+      bm_TGtkToggleButton_inconsistent)
+
+proc GTK_TYPE_CHECK_BUTTON*(): GType =
+  result = gtk_check_button_get_type()
+
+proc GTK_CHECK_BUTTON*(obj: pointer): PGtkCheckButton =
+  result = cast[PGtkCheckButton](GTK_CHECK_CAST(obj, GTK_TYPE_CHECK_BUTTON()))
+
+proc GTK_CHECK_BUTTON_CLASS*(klass: pointer): PGtkCheckButtonClass =
+  result = cast[PGtkCheckButtonClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CHECK_BUTTON()))
+
+proc GTK_IS_CHECK_BUTTON*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CHECK_BUTTON())
+
+proc GTK_IS_CHECK_BUTTON_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CHECK_BUTTON())
+
+proc GTK_CHECK_BUTTON_GET_CLASS*(obj: pointer): PGtkCheckButtonClass =
+  result = cast[PGtkCheckButtonClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CHECK_BUTTON()))
+
+proc GTK_TYPE_CHECK_MENU_ITEM*(): GType =
+  result = gtk_check_menu_item_get_type()
+
+proc GTK_CHECK_MENU_ITEM*(obj: pointer): PGtkCheckMenuItem =
+  result = cast[PGtkCheckMenuItem](GTK_CHECK_CAST(obj, GTK_TYPE_CHECK_MENU_ITEM()))
+
+proc GTK_CHECK_MENU_ITEM_CLASS*(klass: pointer): PGtkCheckMenuItemClass =
+  result = cast[PGtkCheckMenuItemClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_CHECK_MENU_ITEM()))
+
+proc GTK_IS_CHECK_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CHECK_MENU_ITEM())
+
+proc GTK_IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CHECK_MENU_ITEM())
+
+proc GTK_CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkCheckMenuItemClass =
+  result = cast[PGtkCheckMenuItemClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_CHECK_MENU_ITEM()))
+
+proc active*(a: var TGtkCheckMenuItem): guint =
+  result = (a.GtkCheckMenuItemflag0 and bm_TGtkCheckMenuItem_active) shr
+      bp_TGtkCheckMenuItem_active
+
+proc set_active*(a: var TGtkCheckMenuItem, `active`: guint) =
+  a.GtkCheckMenuItemflag0 = a.GtkCheckMenuItemflag0 or
+      ((`active` shl bp_TGtkCheckMenuItem_active) and
+      bm_TGtkCheckMenuItem_active)
+
+proc always_show_toggle*(a: var TGtkCheckMenuItem): guint =
+  result = (a.GtkCheckMenuItemflag0 and bm_TGtkCheckMenuItem_always_show_toggle) shr
+      bp_TGtkCheckMenuItem_always_show_toggle
+
+proc set_always_show_toggle*(a: var TGtkCheckMenuItem,
+                             `always_show_toggle`: guint) =
+  a.GtkCheckMenuItemflag0 = a.GtkCheckMenuItemflag0 or
+      ((`always_show_toggle` shl bp_TGtkCheckMenuItem_always_show_toggle) and
+      bm_TGtkCheckMenuItem_always_show_toggle)
+
+proc inconsistent*(a: var TGtkCheckMenuItem): guint =
+  result = (a.GtkCheckMenuItemflag0 and bm_TGtkCheckMenuItem_inconsistent) shr
+      bp_TGtkCheckMenuItem_inconsistent
+
+proc set_inconsistent*(a: var TGtkCheckMenuItem, `inconsistent`: guint) =
+  a.GtkCheckMenuItemflag0 = a.GtkCheckMenuItemflag0 or
+      ((`inconsistent` shl bp_TGtkCheckMenuItem_inconsistent) and
+      bm_TGtkCheckMenuItem_inconsistent)
+
+proc GTK_TYPE_CLIST*(): GType =
+  result = gtk_clist_get_type()
+
+proc GTK_CLIST*(obj: pointer): PGtkCList =
+  result = cast[PGtkCList](GTK_CHECK_CAST(obj, GTK_TYPE_CLIST()))
+
+proc GTK_CLIST_CLASS*(klass: pointer): PGtkCListClass =
+  result = cast[PGtkCListClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CLIST()))
+
+proc GTK_IS_CLIST*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CLIST())
+
+proc GTK_IS_CLIST_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CLIST())
+
+proc GTK_CLIST_GET_CLASS*(obj: pointer): PGtkCListClass =
+  result = cast[PGtkCListClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CLIST()))
+
+proc GTK_CLIST_FLAGS*(clist: pointer): guint16 =
+  result = GTK_CLIST(clist).flags
+
+proc GTK_CLIST_SET_FLAG*(clist: PGtkCList, flag: guint16) =
+  clist . flags = GTK_CLIST(clist) . flags or int(flag)
+
+proc GTK_CLIST_UNSET_FLAG*(clist: PGtkCList, flag: guint16) =
+  clist . flags = GTK_CLIST(clist) . flags and not int(flag)
+
+proc GTK_CLIST_IN_DRAG_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_IN_DRAG) != 0
+
+proc GTK_CLIST_ROW_HEIGHT_SET_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_ROW_HEIGHT_SET) != 0
+
+proc GTK_CLIST_SHOW_TITLES_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_SHOW_TITLES) != 0
+
+proc GTK_CLIST_ADD_MODE_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_ADD_MODE) != 0
+
+proc GTK_CLIST_AUTO_SORT_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_AUTO_SORT) != 0
+
+proc GTK_CLIST_AUTO_RESIZE_BLOCKED_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_AUTO_RESIZE_BLOCKED) != 0
+
+proc GTK_CLIST_REORDERABLE_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_REORDERABLE) != 0
+
+proc GTK_CLIST_USE_DRAG_ICONS_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_USE_DRAG_ICONS) != 0
+
+proc GTK_CLIST_DRAW_DRAG_LINE_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_DRAW_DRAG_LINE) != 0
+
+proc GTK_CLIST_DRAW_DRAG_RECT_get*(clist: pointer): bool =
+  result = ((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_DRAW_DRAG_RECT) != 0
+
+proc GTK_CLIST_ROW_get*(`glist_`: PGList): PGtkCListRow =
+  result = cast[PGtkCListRow](`glist_` . data)
+
+when false:
+  proc GTK_CELL_TEXT_get*(cell: pointer): PGtkCellText =
+    result = cast[PGtkCellText](addr((cell)))
+
+  proc GTK_CELL_PIXMAP_get*(cell: pointer): PGtkCellPixmap =
+    result = cast[PGtkCellPixmap](addr((cell)))
+
+  proc GTK_CELL_PIXTEXT_get*(cell: pointer): PGtkCellPixText =
+    result = cast[PGtkCellPixText](addr((cell)))
+
+  proc GTK_CELL_WIDGET_get*(cell: pointer): PGtkCellWidget =
+    result = cast[PGtkCellWidget](addr((cell)))
+
+proc visible*(a: var TGtkCListColumn): guint =
+  result = (a.flag0 and bm_TGtkCListColumn_visible) shr
+      bp_TGtkCListColumn_visible
+
+proc set_visible*(a: var TGtkCListColumn, `visible`: guint) =
+  a.flag0 = a.flag0 or
+      ((`visible` shl bp_TGtkCListColumn_visible) and
+      bm_TGtkCListColumn_visible)
+
+proc width_set*(a: var TGtkCListColumn): guint =
+  result = (a.flag0 and bm_TGtkCListColumn_width_set) shr
+      bp_TGtkCListColumn_width_set
+
+proc set_width_set*(a: var TGtkCListColumn, `width_set`: guint) =
+  a.flag0 = a.flag0 or
+      ((`width_set` shl bp_TGtkCListColumn_width_set) and
+      bm_TGtkCListColumn_width_set)
+
+proc resizeable*(a: var TGtkCListColumn): guint =
+  result = (a.flag0 and bm_TGtkCListColumn_resizeable) shr
+      bp_TGtkCListColumn_resizeable
+
+proc set_resizeable*(a: var TGtkCListColumn, `resizeable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`resizeable` shl bp_TGtkCListColumn_resizeable) and
+      bm_TGtkCListColumn_resizeable)
+
+proc auto_resize*(a: var TGtkCListColumn): guint =
+  result = (a.flag0 and bm_TGtkCListColumn_auto_resize) shr
+      bp_TGtkCListColumn_auto_resize
+
+proc set_auto_resize*(a: var TGtkCListColumn, `auto_resize`: guint) =
+  a.flag0 = a.flag0 or
+      ((`auto_resize` shl bp_TGtkCListColumn_auto_resize) and
+      bm_TGtkCListColumn_auto_resize)
+
+proc button_passive*(a: var TGtkCListColumn): guint =
+  result = (a.flag0 and bm_TGtkCListColumn_button_passive) shr
+      bp_TGtkCListColumn_button_passive
+
+proc set_button_passive*(a: var TGtkCListColumn, `button_passive`: guint) =
+  a.flag0 = a.flag0 or
+      ((`button_passive` shl bp_TGtkCListColumn_button_passive) and
+      bm_TGtkCListColumn_button_passive)
+
+proc fg_set*(a: var TGtkCListRow): guint =
+  result = (a.flag0 and bm_TGtkCListRow_fg_set) shr bp_TGtkCListRow_fg_set
+
+proc set_fg_set*(a: var TGtkCListRow, `fg_set`: guint) =
+  a.flag0 = a.flag0 or
+      ((`fg_set` shl bp_TGtkCListRow_fg_set) and bm_TGtkCListRow_fg_set)
+
+proc bg_set*(a: var TGtkCListRow): guint =
+  result = (a.flag0 and bm_TGtkCListRow_bg_set) shr bp_TGtkCListRow_bg_set
+
+proc set_bg_set*(a: var TGtkCListRow, `bg_set`: guint) =
+  a.flag0 = a.flag0 or
+      ((`bg_set` shl bp_TGtkCListRow_bg_set) and bm_TGtkCListRow_bg_set)
+
+proc selectable*(a: var TGtkCListRow): guint =
+  result = (a.flag0 and bm_TGtkCListRow_selectable) shr
+      bp_TGtkCListRow_selectable
+
+proc set_selectable*(a: var TGtkCListRow, `selectable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`selectable` shl bp_TGtkCListRow_selectable) and
+      bm_TGtkCListRow_selectable)
+
+proc GTK_TYPE_DIALOG*(): GType =
+  result = gtk_dialog_get_type()
+
+proc GTK_DIALOG*(obj: pointer): PGtkDialog =
+  result = cast[PGtkDialog](GTK_CHECK_CAST(obj, GTK_TYPE_DIALOG()))
+
+proc GTK_DIALOG_CLASS*(klass: pointer): PGtkDialogClass =
+  result = cast[PGtkDialogClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_DIALOG()))
+
+proc GTK_IS_DIALOG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_DIALOG())
+
+proc GTK_IS_DIALOG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_DIALOG())
+
+proc GTK_DIALOG_GET_CLASS*(obj: pointer): PGtkDialogClass =
+  result = cast[PGtkDialogClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_DIALOG()))
+
+proc GTK_TYPE_VBOX*(): GType =
+  result = gtk_vbox_get_type()
+
+proc GTK_VBOX*(obj: pointer): PGtkVBox =
+  result = cast[PGtkVBox](GTK_CHECK_CAST(obj, GTK_TYPE_VBOX()))
+
+proc GTK_VBOX_CLASS*(klass: pointer): PGtkVBoxClass =
+  result = cast[PGtkVBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VBOX()))
+
+proc GTK_IS_VBOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VBOX())
+
+proc GTK_IS_VBOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VBOX())
+
+proc GTK_VBOX_GET_CLASS*(obj: pointer): PGtkVBoxClass =
+  result = cast[PGtkVBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VBOX()))
+
+proc GTK_TYPE_COLOR_SELECTION*(): GType =
+  result = gtk_color_selection_get_type()
+
+proc GTK_COLOR_SELECTION*(obj: pointer): PGtkColorSelection =
+  result = cast[PGtkColorSelection](GTK_CHECK_CAST(obj, GTK_TYPE_COLOR_SELECTION()))
+
+proc GTK_COLOR_SELECTION_CLASS*(klass: pointer): PGtkColorSelectionClass =
+  result = cast[PGtkColorSelectionClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_COLOR_SELECTION()))
+
+proc GTK_IS_COLOR_SELECTION*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_COLOR_SELECTION())
+
+proc GTK_IS_COLOR_SELECTION_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_COLOR_SELECTION())
+
+proc GTK_COLOR_SELECTION_GET_CLASS*(obj: pointer): PGtkColorSelectionClass =
+  result = cast[PGtkColorSelectionClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_COLOR_SELECTION()))
+
+proc GTK_TYPE_COLOR_SELECTION_DIALOG*(): GType =
+  result = gtk_color_selection_dialog_get_type()
+
+proc GTK_COLOR_SELECTION_DIALOG*(obj: pointer): PGtkColorSelectionDialog =
+  result = cast[PGtkColorSelectionDialog](GTK_CHECK_CAST(obj,
+      GTK_TYPE_COLOR_SELECTION_DIALOG()))
+
+proc GTK_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PGtkColorSelectionDialogClass =
+  result = cast[PGtkColorSelectionDialogClass](
+      GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_COLOR_SELECTION_DIALOG()))
+
+proc GTK_IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_COLOR_SELECTION_DIALOG())
+
+proc GTK_IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_COLOR_SELECTION_DIALOG())
+
+proc GTK_COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PGtkColorSelectionDialogClass =
+  result = cast[PGtkColorSelectionDialogClass](
+      GTK_CHECK_GET_CLASS(obj, GTK_TYPE_COLOR_SELECTION_DIALOG()))
+
+proc GTK_TYPE_HBOX*(): GType =
+  result = gtk_hbox_get_type()
+
+proc GTK_HBOX*(obj: pointer): PGtkHBox =
+  result = cast[PGtkHBox](GTK_CHECK_CAST(obj, GTK_TYPE_HBOX()))
+
+proc GTK_HBOX_CLASS*(klass: pointer): PGtkHBoxClass =
+  result = cast[PGtkHBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HBOX()))
+
+proc GTK_IS_HBOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HBOX())
+
+proc GTK_IS_HBOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HBOX())
+
+proc GTK_HBOX_GET_CLASS*(obj: pointer): PGtkHBoxClass =
+  result = cast[PGtkHBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HBOX()))
+
+proc GTK_TYPE_COMBO*(): GType =
+  result = gtk_combo_get_type()
+
+proc GTK_COMBO*(obj: pointer): PGtkCombo =
+  result = cast[PGtkCombo](GTK_CHECK_CAST(obj, GTK_TYPE_COMBO()))
+
+proc GTK_COMBO_CLASS*(klass: pointer): PGtkComboClass =
+  result = cast[PGtkComboClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_COMBO()))
+
+proc GTK_IS_COMBO*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_COMBO())
+
+proc GTK_IS_COMBO_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_COMBO())
+
+proc GTK_COMBO_GET_CLASS*(obj: pointer): PGtkComboClass =
+  result = cast[PGtkComboClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_COMBO()))
+
+proc value_in_list*(a: var TGtkCombo): guint =
+  result = (a.GtkComboflag0 and bm_TGtkCombo_value_in_list) shr
+      bp_TGtkCombo_value_in_list
+
+proc set_value_in_list*(a: var TGtkCombo, `value_in_list`: guint) =
+  a.GtkComboflag0 = a.GtkComboflag0 or
+      ((`value_in_list` shl bp_TGtkCombo_value_in_list) and
+      bm_TGtkCombo_value_in_list)
+
+proc ok_if_empty*(a: var TGtkCombo): guint =
+  result = (a.GtkComboflag0 and bm_TGtkCombo_ok_if_empty) shr
+      bp_TGtkCombo_ok_if_empty
+
+proc set_ok_if_empty*(a: var TGtkCombo, `ok_if_empty`: guint) =
+  a.GtkComboflag0 = a.GtkComboflag0 or
+      ((`ok_if_empty` shl bp_TGtkCombo_ok_if_empty) and
+      bm_TGtkCombo_ok_if_empty)
+
+proc case_sensitive*(a: var TGtkCombo): guint =
+  result = (a.GtkComboflag0 and bm_TGtkCombo_case_sensitive) shr
+      bp_TGtkCombo_case_sensitive
+
+proc set_case_sensitive*(a: var TGtkCombo, `case_sensitive`: guint) =
+  a.GtkComboflag0 = a.GtkComboflag0 or
+      ((`case_sensitive` shl bp_TGtkCombo_case_sensitive) and
+      bm_TGtkCombo_case_sensitive)
+
+proc use_arrows*(a: var TGtkCombo): guint =
+  result = (a.GtkComboflag0 and bm_TGtkCombo_use_arrows) shr bp_TGtkCombo_use_arrows
+
+proc set_use_arrows*(a: var TGtkCombo, `use_arrows`: guint) =
+  a.GtkComboflag0 = a.GtkComboflag0 or
+      ((`use_arrows` shl bp_TGtkCombo_use_arrows) and bm_TGtkCombo_use_arrows)
+
+proc use_arrows_always*(a: var TGtkCombo): guint =
+  result = (a.GtkComboflag0 and bm_TGtkCombo_use_arrows_always) shr
+      bp_TGtkCombo_use_arrows_always
+
+proc set_use_arrows_always*(a: var TGtkCombo, `use_arrows_always`: guint) =
+  a.GtkComboflag0 = a.GtkComboflag0 or
+      ((`use_arrows_always` shl bp_TGtkCombo_use_arrows_always) and
+      bm_TGtkCombo_use_arrows_always)
+
+proc GTK_TYPE_CTREE*(): GType =
+  result = gtk_ctree_get_type()
+
+proc GTK_CTREE*(obj: pointer): PGtkCTree =
+  result = cast[PGtkCTree](GTK_CHECK_CAST(obj, GTK_TYPE_CTREE()))
+
+proc GTK_CTREE_CLASS*(klass: pointer): PGtkCTreeClass =
+  result = cast[PGtkCTreeClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CTREE()))
+
+proc GTK_IS_CTREE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CTREE())
+
+proc GTK_IS_CTREE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CTREE())
+
+proc GTK_CTREE_GET_CLASS*(obj: pointer): PGtkCTreeClass =
+  result = cast[PGtkCTreeClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CTREE()))
+
+proc GTK_CTREE_ROW*(`node_`: TAddress): PGtkCTreeRow =
+  result = cast[PGtkCTreeRow]((cast[PGList](`node_`)) . data)
+
+proc GTK_CTREE_NODE*(`node_`: TAddress): PGtkCTreeNode =
+  result = cast[PGtkCTreeNode](`node_`)
+
+proc GTK_CTREE_NODE_NEXT*(`nnode_`: TAddress): PGtkCTreeNode =
+  result = cast[PGtkCTreeNode]((cast[PGList](`nnode_`)) . next)
+
+proc GTK_CTREE_NODE_PREV*(`pnode_`: TAddress): PGtkCTreeNode =
+  result = cast[PGtkCTreeNode]((cast[PGList](`pnode_`)) . prev)
+
+proc GTK_CTREE_FUNC*(`func_`: TAddress): TGtkCTreeFunc =
+  result = cast[TGtkCTreeFunc](`func_`)
+
+proc GTK_TYPE_CTREE_NODE*(): GType =
+  result = gtk_ctree_node_get_type()
+
+proc line_style*(a: var TGtkCTree): guint =
+  result = (a.GtkCTreeflag0 and bm_TGtkCTree_line_style) shr bp_TGtkCTree_line_style
+
+proc set_line_style*(a: var TGtkCTree, `line_style`: guint) =
+  a.GtkCTreeflag0 = a.GtkCTreeflag0 or
+      ((`line_style` shl bp_TGtkCTree_line_style) and bm_TGtkCTree_line_style)
+
+proc expander_style*(a: var TGtkCTree): guint =
+  result = (a.GtkCTreeflag0 and bm_TGtkCTree_expander_style) shr
+      bp_TGtkCTree_expander_style
+
+proc set_expander_style*(a: var TGtkCTree, `expander_style`: guint) =
+  a.GtkCTreeflag0 = a.GtkCTreeflag0 or
+      ((`expander_style` shl bp_TGtkCTree_expander_style) and
+      bm_TGtkCTree_expander_style)
+
+proc show_stub*(a: var TGtkCTree): guint =
+  result = (a.GtkCTreeflag0 and bm_TGtkCTree_show_stub) shr bp_TGtkCTree_show_stub
+
+proc set_show_stub*(a: var TGtkCTree, `show_stub`: guint) =
+  a.GtkCTreeflag0 = a.GtkCTreeflag0 or
+      ((`show_stub` shl bp_TGtkCTree_show_stub) and bm_TGtkCTree_show_stub)
+
+proc is_leaf*(a: var TGtkCTreeRow): guint =
+  result = (a.GtkCTreeRow_flag0 and bm_TGtkCTreeRow_is_leaf) shr bp_TGtkCTreeRow_is_leaf
+
+proc set_is_leaf*(a: var TGtkCTreeRow, `is_leaf`: guint) =
+  a.GtkCTreeRow_flag0 = a.GtkCTreeRow_flag0 or
+      ((`is_leaf` shl bp_TGtkCTreeRow_is_leaf) and bm_TGtkCTreeRow_is_leaf)
+
+proc expanded*(a: var TGtkCTreeRow): guint =
+  result = (a.GtkCTreeRow_flag0 and bm_TGtkCTreeRow_expanded) shr
+      bp_TGtkCTreeRow_expanded
+
+proc set_expanded*(a: var TGtkCTreeRow, `expanded`: guint) =
+  a.GtkCTreeRow_flag0 = a.GtkCTreeRowflag0 or
+      ((`expanded` shl bp_TGtkCTreeRow_expanded) and bm_TGtkCTreeRow_expanded)
+
+proc gtk_ctree_set_reorderable*(t: pointer, r: bool) =
+  gtk_clist_set_reorderable(cast[PGtkCList](t), r)
+
+proc GTK_TYPE_DRAWING_AREA*(): GType =
+  result = gtk_drawing_area_get_type()
+
+proc GTK_DRAWING_AREA*(obj: pointer): PGtkDrawingArea =
+  result = cast[PGtkDrawingArea](GTK_CHECK_CAST(obj, GTK_TYPE_DRAWING_AREA()))
+
+proc GTK_DRAWING_AREA_CLASS*(klass: pointer): PGtkDrawingAreaClass =
+  result = cast[PGtkDrawingAreaClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_DRAWING_AREA()))
+
+proc GTK_IS_DRAWING_AREA*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_DRAWING_AREA())
+
+proc GTK_IS_DRAWING_AREA_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_DRAWING_AREA())
+
+proc GTK_DRAWING_AREA_GET_CLASS*(obj: pointer): PGtkDrawingAreaClass =
+  result = cast[PGtkDrawingAreaClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_DRAWING_AREA()))
+
+proc GTK_TYPE_CURVE*(): GType =
+  result = gtk_curve_get_type()
+
+proc GTK_CURVE*(obj: pointer): PGtkCurve =
+  result = cast[PGtkCurve](GTK_CHECK_CAST(obj, GTK_TYPE_CURVE()))
+
+proc GTK_CURVE_CLASS*(klass: pointer): PGtkCurveClass =
+  result = cast[PGtkCurveClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CURVE()))
+
+proc GTK_IS_CURVE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_CURVE())
+
+proc GTK_IS_CURVE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CURVE())
+
+proc GTK_CURVE_GET_CLASS*(obj: pointer): PGtkCurveClass =
+  result = cast[PGtkCurveClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CURVE()))
+
+proc GTK_TYPE_EDITABLE*(): GType =
+  result = gtk_editable_get_type()
+
+proc GTK_EDITABLE*(obj: pointer): PGtkEditable =
+  result = cast[PGtkEditable](G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_EDITABLE()))
+
+proc GTK_EDITABLE_CLASS*(vtable: pointer): PGtkEditableClass =
+  result = cast[PGtkEditableClass](G_TYPE_CHECK_CLASS_CAST(vtable, GTK_TYPE_EDITABLE()))
+
+proc GTK_IS_EDITABLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_EDITABLE())
+
+proc GTK_IS_EDITABLE_CLASS*(vtable: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(vtable, GTK_TYPE_EDITABLE())
+
+proc GTK_EDITABLE_GET_CLASS*(inst: pointer): PGtkEditableClass =
+  result = cast[PGtkEditableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst,
+      GTK_TYPE_EDITABLE()))
+
+proc GTK_TYPE_IM_CONTEXT*(): GType =
+  result = gtk_im_context_get_type()
+
+proc GTK_IM_CONTEXT*(obj: pointer): PGtkIMContext =
+  result = cast[PGtkIMContext](GTK_CHECK_CAST(obj, GTK_TYPE_IM_CONTEXT()))
+
+proc GTK_IM_CONTEXT_CLASS*(klass: pointer): PGtkIMContextClass =
+  result = cast[PGtkIMContextClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_IM_CONTEXT()))
+
+proc GTK_IS_IM_CONTEXT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_IM_CONTEXT())
+
+proc GTK_IS_IM_CONTEXT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_IM_CONTEXT())
+
+proc GTK_IM_CONTEXT_GET_CLASS*(obj: pointer): PGtkIMContextClass =
+  result = cast[PGtkIMContextClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_IM_CONTEXT()))
+
+proc GTK_TYPE_MENU_SHELL*(): GType =
+  result = gtk_menu_shell_get_type()
+
+proc GTK_MENU_SHELL*(obj: pointer): PGtkMenuShell =
+  result = cast[PGtkMenuShell](GTK_CHECK_CAST(obj, GTK_TYPE_MENU_SHELL()))
+
+proc GTK_MENU_SHELL_CLASS*(klass: pointer): PGtkMenuShellClass =
+  result = cast[PGtkMenuShellClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_MENU_SHELL()))
+
+proc GTK_IS_MENU_SHELL*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MENU_SHELL())
+
+proc GTK_IS_MENU_SHELL_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MENU_SHELL())
+
+proc GTK_MENU_SHELL_GET_CLASS*(obj: pointer): PGtkMenuShellClass =
+  result = cast[PGtkMenuShellClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_MENU_SHELL()))
+
+proc active*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_active) shr bp_TGtkMenuShell_active
+
+proc set_active*(a: var TGtkMenuShell, `active`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`active` shl bp_TGtkMenuShell_active) and bm_TGtkMenuShell_active)
+
+proc have_grab*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_have_grab) shr
+      bp_TGtkMenuShell_have_grab
+
+proc set_have_grab*(a: var TGtkMenuShell, `have_grab`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`have_grab` shl bp_TGtkMenuShell_have_grab) and
+      bm_TGtkMenuShell_have_grab)
+
+proc have_xgrab*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_have_xgrab) shr
+      bp_TGtkMenuShell_have_xgrab
+
+proc set_have_xgrab*(a: var TGtkMenuShell, `have_xgrab`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`have_xgrab` shl bp_TGtkMenuShell_have_xgrab) and
+      bm_TGtkMenuShell_have_xgrab)
+
+proc ignore_leave*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_ignore_leave) shr
+      bp_TGtkMenuShell_ignore_leave
+
+proc set_ignore_leave*(a: var TGtkMenuShell, `ignore_leave`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`ignore_leave` shl bp_TGtkMenuShell_ignore_leave) and
+      bm_TGtkMenuShell_ignore_leave)
+
+proc menu_flag*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_menu_flag) shr
+      bp_TGtkMenuShell_menu_flag
+
+proc set_menu_flag*(a: var TGtkMenuShell, `menu_flag`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`menu_flag` shl bp_TGtkMenuShell_menu_flag) and
+      bm_TGtkMenuShell_menu_flag)
+
+proc ignore_enter*(a: var TGtkMenuShell): guint =
+  result = (a.GtkMenuShellflag0 and bm_TGtkMenuShell_ignore_enter) shr
+      bp_TGtkMenuShell_ignore_enter
+
+proc set_ignore_enter*(a: var TGtkMenuShell, `ignore_enter`: guint) =
+  a.GtkMenuShellflag0 = a.GtkMenuShellflag0 or
+      ((`ignore_enter` shl bp_TGtkMenuShell_ignore_enter) and
+      bm_TGtkMenuShell_ignore_enter)
+
+proc submenu_placement*(a: var TGtkMenuShellClass): guint =
+  result = (a.GtkMenuShellClassflag0 and bm_TGtkMenuShellClass_submenu_placement) shr
+      bp_TGtkMenuShellClass_submenu_placement
+
+proc set_submenu_placement*(a: var TGtkMenuShellClass,
+                            `submenu_placement`: guint) =
+  a.GtkMenuShellClassflag0 = a.GtkMenuShellClassflag0 or
+      ((`submenu_placement` shl bp_TGtkMenuShellClass_submenu_placement) and
+      bm_TGtkMenuShellClass_submenu_placement)
+
+proc GTK_TYPE_MENU*(): GType =
+  result = gtk_menu_get_type()
+
+proc GTK_MENU*(obj: pointer): PGtkMenu =
+  result = cast[PGtkMenu](GTK_CHECK_CAST(obj, GTK_TYPE_MENU()))
+
+proc GTK_MENU_CLASS*(klass: pointer): PGtkMenuClass =
+  result = cast[PGtkMenuClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_MENU()))
+
+proc GTK_IS_MENU*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MENU())
+
+proc GTK_IS_MENU_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MENU())
+
+proc GTK_MENU_GET_CLASS*(obj: pointer): PGtkMenuClass =
+  result = cast[PGtkMenuClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_MENU()))
+
+proc needs_destruction_ref_count*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_needs_destruction_ref_count) shr
+      bp_TGtkMenu_needs_destruction_ref_count
+
+proc set_needs_destruction_ref_count*(a: var TGtkMenu,
+                                      `needs_destruction_ref_count`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`needs_destruction_ref_count` shl
+      bp_TGtkMenu_needs_destruction_ref_count) and
+      bm_TGtkMenu_needs_destruction_ref_count)
+
+proc torn_off*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_torn_off) shr bp_TGtkMenu_torn_off
+
+proc set_torn_off*(a: var TGtkMenu, `torn_off`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`torn_off` shl bp_TGtkMenu_torn_off) and bm_TGtkMenu_torn_off)
+
+proc tearoff_active*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_tearoff_active) shr
+      bp_TGtkMenu_tearoff_active
+
+proc set_tearoff_active*(a: var TGtkMenu, `tearoff_active`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`tearoff_active` shl bp_TGtkMenu_tearoff_active) and
+      bm_TGtkMenu_tearoff_active)
+
+proc scroll_fast*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_scroll_fast) shr bp_TGtkMenu_scroll_fast
+
+proc set_scroll_fast*(a: var TGtkMenu, `scroll_fast`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`scroll_fast` shl bp_TGtkMenu_scroll_fast) and
+      bm_TGtkMenu_scroll_fast)
+
+proc upper_arrow_visible*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_upper_arrow_visible) shr
+      bp_TGtkMenu_upper_arrow_visible
+
+proc set_upper_arrow_visible*(a: var TGtkMenu, `upper_arrow_visible`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`upper_arrow_visible` shl bp_TGtkMenu_upper_arrow_visible) and
+      bm_TGtkMenu_upper_arrow_visible)
+
+proc lower_arrow_visible*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_lower_arrow_visible) shr
+      bp_TGtkMenu_lower_arrow_visible
+
+proc set_lower_arrow_visible*(a: var TGtkMenu, `lower_arrow_visible`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`lower_arrow_visible` shl bp_TGtkMenu_lower_arrow_visible) and
+      bm_TGtkMenu_lower_arrow_visible)
+
+proc upper_arrow_prelight*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_upper_arrow_prelight) shr
+      bp_TGtkMenu_upper_arrow_prelight
+
+proc set_upper_arrow_prelight*(a: var TGtkMenu, `upper_arrow_prelight`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`upper_arrow_prelight` shl bp_TGtkMenu_upper_arrow_prelight) and
+      bm_TGtkMenu_upper_arrow_prelight)
+
+proc lower_arrow_prelight*(a: var TGtkMenu): guint =
+  result = (a.GtkMenuflag0 and bm_TGtkMenu_lower_arrow_prelight) shr
+      bp_TGtkMenu_lower_arrow_prelight
+
+proc set_lower_arrow_prelight*(a: var TGtkMenu, `lower_arrow_prelight`: guint) =
+  a.GtkMenuflag0 = a.GtkMenuflag0 or
+      ((`lower_arrow_prelight` shl bp_TGtkMenu_lower_arrow_prelight) and
+      bm_TGtkMenu_lower_arrow_prelight)
+
+proc gtk_menu_append*(menu, child: PGtkWidget) =
+  gtk_menu_shell_append(cast[PGtkMenuShell](menu), child)
+
+proc gtk_menu_prepend*(menu, child: PGtkWidget) =
+  gtk_menu_shell_prepend(cast[PGtkMenuShell](menu), child)
+
+proc gtk_menu_insert*(menu, child: PGtkWidget, pos: gint) =
+  gtk_menu_shell_insert(cast[PGtkMenuShell](menu), child, pos)
+
+proc GTK_TYPE_ENTRY*(): GType =
+  result = gtk_entry_get_type()
+
+proc GTK_ENTRY*(obj: pointer): PGtkEntry =
+  result = cast[PGtkEntry](GTK_CHECK_CAST(obj, GTK_TYPE_ENTRY()))
+
+proc GTK_ENTRY_CLASS*(klass: pointer): PGtkEntryClass =
+  result = cast[PGtkEntryClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_ENTRY()))
+
+proc GTK_IS_ENTRY*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_ENTRY())
+
+proc GTK_IS_ENTRY_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ENTRY())
+
+proc GTK_ENTRY_GET_CLASS*(obj: pointer): PGtkEntryClass =
+  result = cast[PGtkEntryClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ENTRY()))
+
+proc editable*(a: var TGtkEntry): guint =
+  result = (a.GtkEntryflag0 and bm_TGtkEntry_editable) shr bp_TGtkEntry_editable
+
+proc set_editable*(a: var TGtkEntry, `editable`: guint) =
+  a.GtkEntryflag0 = a.GtkEntryflag0 or
+      ((`editable` shl bp_TGtkEntry_editable) and bm_TGtkEntry_editable)
+
+proc visible*(a: var TGtkEntry): guint =
+  result = (a.GtkEntryflag0 and bm_TGtkEntry_visible) shr bp_TGtkEntry_visible
+
+proc set_visible*(a: var TGtkEntry, `visible`: guint) =
+  a.GtkEntryflag0 = a.GtkEntryflag0 or
+      ((`visible` shl bp_TGtkEntry_visible) and bm_TGtkEntry_visible)
+
+proc overwrite_mode*(a: var TGtkEntry): guint =
+  result = (a.GtkEntryflag0 and bm_TGtkEntry_overwrite_mode) shr
+      bp_TGtkEntry_overwrite_mode
+
+proc set_overwrite_mode*(a: var TGtkEntry, `overwrite_mode`: guint) =
+  a.GtkEntryflag0 = a.GtkEntryflag0 or
+      ((`overwrite_mode` shl bp_TGtkEntry_overwrite_mode) and
+      bm_TGtkEntry_overwrite_mode)
+
+proc in_drag*(a: var TGtkEntry): guint =
+  result = (a.GtkEntryflag0 and bm_TGtkEntry_in_drag) shr bp_TGtkEntry_in_drag
+
+proc set_in_drag*(a: var TGtkEntry, `in_drag`: guint) =
+  a.GtkEntryflag0 = a.GtkEntryflag0 or
+      ((`in_drag` shl bp_TGtkEntry_in_drag) and bm_TGtkEntry_in_drag)
+
+proc cache_includes_preedit*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_cache_includes_preedit) shr
+      bp_TGtkEntry_cache_includes_preedit
+
+proc set_cache_includes_preedit*(a: var TGtkEntry,
+                                 `cache_includes_preedit`: guint) =
+  a.flag1 = a.flag1 or
+      ((`cache_includes_preedit` shl bp_TGtkEntry_cache_includes_preedit) and
+      bm_TGtkEntry_cache_includes_preedit)
+
+proc need_im_reset*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_need_im_reset) shr
+      bp_TGtkEntry_need_im_reset
+
+proc set_need_im_reset*(a: var TGtkEntry, `need_im_reset`: guint) =
+  a.flag1 = a.flag1 or
+      ((`need_im_reset` shl bp_TGtkEntry_need_im_reset) and
+      bm_TGtkEntry_need_im_reset)
+
+proc has_frame*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_has_frame) shr bp_TGtkEntry_has_frame
+
+proc set_has_frame*(a: var TGtkEntry, `has_frame`: guint) =
+  a.flag1 = a.flag1 or
+      ((`has_frame` shl bp_TGtkEntry_has_frame) and bm_TGtkEntry_has_frame)
+
+proc activates_default*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_activates_default) shr
+      bp_TGtkEntry_activates_default
+
+proc set_activates_default*(a: var TGtkEntry, `activates_default`: guint) =
+  a.flag1 = a.flag1 or
+      ((`activates_default` shl bp_TGtkEntry_activates_default) and
+      bm_TGtkEntry_activates_default)
+
+proc cursor_visible*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_cursor_visible) shr
+      bp_TGtkEntry_cursor_visible
+
+proc set_cursor_visible*(a: var TGtkEntry, `cursor_visible`: guint) =
+  a.flag1 = a.flag1 or
+      ((`cursor_visible` shl bp_TGtkEntry_cursor_visible) and
+      bm_TGtkEntry_cursor_visible)
+
+proc in_click*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_in_click) shr bp_TGtkEntry_in_click
+
+proc set_in_click*(a: var TGtkEntry, `in_click`: guint) =
+  a.flag1 = a.flag1 or
+      ((`in_click` shl bp_TGtkEntry_in_click) and bm_TGtkEntry_in_click)
+
+proc is_cell_renderer*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_is_cell_renderer) shr
+      bp_TGtkEntry_is_cell_renderer
+
+proc set_is_cell_renderer*(a: var TGtkEntry, `is_cell_renderer`: guint) =
+  a.flag1 = a.flag1 or
+      ((`is_cell_renderer` shl bp_TGtkEntry_is_cell_renderer) and
+      bm_TGtkEntry_is_cell_renderer)
+
+proc editing_canceled*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_editing_canceled) shr
+      bp_TGtkEntry_editing_canceled
+
+proc set_editing_canceled*(a: var TGtkEntry, `editing_canceled`: guint) =
+  a.flag1 = a.flag1 or
+      ((`editing_canceled` shl bp_TGtkEntry_editing_canceled) and
+      bm_TGtkEntry_editing_canceled)
+
+proc mouse_cursor_obscured*(a: var TGtkEntry): guint =
+  result = (a.flag1 and bm_TGtkEntry_mouse_cursor_obscured) shr
+      bp_TGtkEntry_mouse_cursor_obscured
+
+proc set_mouse_cursor_obscured*(a: var TGtkEntry, `mouse_cursor_obscured`: guint) =
+  a.flag1 = a.flag1 or
+      ((`mouse_cursor_obscured` shl bp_TGtkEntry_mouse_cursor_obscured) and
+      bm_TGtkEntry_mouse_cursor_obscured)
+
+proc GTK_TYPE_EVENT_BOX*(): GType =
+  result = gtk_event_box_get_type()
+
+proc GTK_EVENT_BOX*(obj: pointer): PGtkEventBox =
+  result = cast[PGtkEventBox](GTK_CHECK_CAST(obj, GTK_TYPE_EVENT_BOX()))
+
+proc GTK_EVENT_BOX_CLASS*(klass: pointer): PGtkEventBoxClass =
+  result = cast[PGtkEventBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_EVENT_BOX()))
+
+proc GTK_IS_EVENT_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_EVENT_BOX())
+
+proc GTK_IS_EVENT_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_EVENT_BOX())
+
+proc GTK_EVENT_BOX_GET_CLASS*(obj: pointer): PGtkEventBoxClass =
+  result = cast[PGtkEventBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_EVENT_BOX()))
+
+proc GTK_TYPE_FILE_SELECTION*(): GType =
+  result = gtk_file_selection_get_type()
+
+proc GTK_FILE_SELECTION*(obj: pointer): PGtkFileSelection =
+  result = cast[PGtkFileSelection](GTK_CHECK_CAST(obj, GTK_TYPE_FILE_SELECTION()))
+
+proc GTK_FILE_SELECTION_CLASS*(klass: pointer): PGtkFileSelectionClass =
+  result = cast[PGtkFileSelectionClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_FILE_SELECTION()))
+
+proc GTK_IS_FILE_SELECTION*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_FILE_SELECTION())
+
+proc GTK_IS_FILE_SELECTION_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_FILE_SELECTION())
+
+proc GTK_FILE_SELECTION_GET_CLASS*(obj: pointer): PGtkFileSelectionClass =
+  result = cast[PGtkFileSelectionClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_FILE_SELECTION()))
+
+proc GTK_TYPE_FIXED*(): GType =
+  result = gtk_fixed_get_type()
+
+proc GTK_FIXED*(obj: pointer): PGtkFixed =
+  result = cast[PGtkFixed](GTK_CHECK_CAST(obj, GTK_TYPE_FIXED()))
+
+proc GTK_FIXED_CLASS*(klass: pointer): PGtkFixedClass =
+  result = cast[PGtkFixedClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_FIXED()))
+
+proc GTK_IS_FIXED*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_FIXED())
+
+proc GTK_IS_FIXED_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_FIXED())
+
+proc GTK_FIXED_GET_CLASS*(obj: pointer): PGtkFixedClass =
+  result = cast[PGtkFixedClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_FIXED()))
+
+proc GTK_TYPE_FONT_SELECTION*(): GType =
+  result = gtk_font_selection_get_type()
+
+proc GTK_FONT_SELECTION*(obj: pointer): PGtkFontSelection =
+  result = cast[PGtkFontSelection](GTK_CHECK_CAST(obj, GTK_TYPE_FONT_SELECTION()))
+
+proc GTK_FONT_SELECTION_CLASS*(klass: pointer): PGtkFontSelectionClass =
+  result = cast[PGtkFontSelectionClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_FONT_SELECTION()))
+
+proc GTK_IS_FONT_SELECTION*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_FONT_SELECTION())
+
+proc GTK_IS_FONT_SELECTION_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_FONT_SELECTION())
+
+proc GTK_FONT_SELECTION_GET_CLASS*(obj: pointer): PGtkFontSelectionClass =
+  result = cast[PGtkFontSelectionClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_FONT_SELECTION()))
+
+proc GTK_TYPE_FONT_SELECTION_DIALOG*(): GType =
+  result = gtk_font_selection_dialog_get_type()
+
+proc GTK_FONT_SELECTION_DIALOG*(obj: pointer): PGtkFontSelectionDialog =
+  result = cast[PGtkFontSelectionDialog](GTK_CHECK_CAST(obj,
+      GTK_TYPE_FONT_SELECTION_DIALOG()))
+
+proc GTK_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PGtkFontSelectionDialogClass =
+  result = cast[PGtkFontSelectionDialogClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_FONT_SELECTION_DIALOG()))
+
+proc GTK_IS_FONT_SELECTION_DIALOG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_FONT_SELECTION_DIALOG())
+
+proc GTK_IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_FONT_SELECTION_DIALOG())
+
+proc GTK_FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PGtkFontSelectionDialogClass =
+  result = cast[PGtkFontSelectionDialogClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_FONT_SELECTION_DIALOG()))
+
+proc GTK_TYPE_GAMMA_CURVE*(): GType =
+  result = gtk_gamma_curve_get_type()
+
+proc GTK_GAMMA_CURVE*(obj: pointer): PGtkGammaCurve =
+  result = cast[PGtkGammaCurve](GTK_CHECK_CAST(obj, GTK_TYPE_GAMMA_CURVE()))
+
+proc GTK_GAMMA_CURVE_CLASS*(klass: pointer): PGtkGammaCurveClass =
+  result = cast[PGtkGammaCurveClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_GAMMA_CURVE()))
+
+proc GTK_IS_GAMMA_CURVE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_GAMMA_CURVE())
+
+proc GTK_IS_GAMMA_CURVE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_GAMMA_CURVE())
+
+proc GTK_GAMMA_CURVE_GET_CLASS*(obj: pointer): PGtkGammaCurveClass =
+  result = cast[PGtkGammaCurveClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_GAMMA_CURVE()))
+
+proc GTK_TYPE_HANDLE_BOX*(): GType =
+  result = gtk_handle_box_get_type()
+
+proc GTK_HANDLE_BOX*(obj: pointer): PGtkHandleBox =
+  result = cast[PGtkHandleBox](GTK_CHECK_CAST(obj, GTK_TYPE_HANDLE_BOX()))
+
+proc GTK_HANDLE_BOX_CLASS*(klass: pointer): PGtkHandleBoxClass =
+  result = cast[PGtkHandleBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HANDLE_BOX()))
+
+proc GTK_IS_HANDLE_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HANDLE_BOX())
+
+proc GTK_IS_HANDLE_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HANDLE_BOX())
+
+proc GTK_HANDLE_BOX_GET_CLASS*(obj: pointer): PGtkHandleBoxClass =
+  result = cast[PGtkHandleBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HANDLE_BOX()))
+
+proc handle_position*(a: var TGtkHandleBox): guint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_handle_position) shr
+      bp_TGtkHandleBox_handle_position
+
+proc set_handle_position*(a: var TGtkHandleBox, `handle_position`: guint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`handle_position` shl bp_TGtkHandleBox_handle_position) and
+      bm_TGtkHandleBox_handle_position)
+
+proc float_window_mapped*(a: var TGtkHandleBox): guint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_float_window_mapped) shr
+      bp_TGtkHandleBox_float_window_mapped
+
+proc set_float_window_mapped*(a: var TGtkHandleBox, `float_window_mapped`: guint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`float_window_mapped` shl bp_TGtkHandleBox_float_window_mapped) and
+      bm_TGtkHandleBox_float_window_mapped)
+
+proc child_detached*(a: var TGtkHandleBox): guint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_child_detached) shr
+      bp_TGtkHandleBox_child_detached
+
+proc set_child_detached*(a: var TGtkHandleBox, `child_detached`: guint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`child_detached` shl bp_TGtkHandleBox_child_detached) and
+      bm_TGtkHandleBox_child_detached)
+
+proc in_drag*(a: var TGtkHandleBox): guint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_in_drag) shr
+      bp_TGtkHandleBox_in_drag
+
+proc set_in_drag*(a: var TGtkHandleBox, `in_drag`: guint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`in_drag` shl bp_TGtkHandleBox_in_drag) and bm_TGtkHandleBox_in_drag)
+
+proc shrink_on_detach*(a: var TGtkHandleBox): guint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_shrink_on_detach) shr
+      bp_TGtkHandleBox_shrink_on_detach
+
+proc set_shrink_on_detach*(a: var TGtkHandleBox, `shrink_on_detach`: guint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`shrink_on_detach` shl bp_TGtkHandleBox_shrink_on_detach) and
+      bm_TGtkHandleBox_shrink_on_detach)
+
+proc snap_edge*(a: var TGtkHandleBox): gint =
+  result = (a.GtkHandleBoxflag0 and bm_TGtkHandleBox_snap_edge) shr
+      bp_TGtkHandleBox_snap_edge
+
+proc set_snap_edge*(a: var TGtkHandleBox, `snap_edge`: gint) =
+  a.GtkHandleBoxflag0 = a.GtkHandleBoxflag0 or
+      ((`snap_edge` shl bp_TGtkHandleBox_snap_edge) and
+      bm_TGtkHandleBox_snap_edge)
+
+proc GTK_TYPE_PANED*(): GType =
+  result = gtk_paned_get_type()
+
+proc GTK_PANED*(obj: pointer): PGtkPaned =
+  result = cast[PGtkPaned](GTK_CHECK_CAST(obj, GTK_TYPE_PANED()))
+
+proc GTK_PANED_CLASS*(klass: pointer): PGtkPanedClass =
+  result = cast[PGtkPanedClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_PANED()))
+
+proc GTK_IS_PANED*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PANED())
+
+proc GTK_IS_PANED_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PANED())
+
+proc GTK_PANED_GET_CLASS*(obj: pointer): PGtkPanedClass =
+  result = cast[PGtkPanedClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PANED()))
+
+proc position_set*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_position_set) shr
+      bp_TGtkPaned_position_set
+
+proc set_position_set*(a: var TGtkPaned, `position_set`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`position_set` shl bp_TGtkPaned_position_set) and
+      bm_TGtkPaned_position_set)
+
+proc in_drag*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_in_drag) shr bp_TGtkPaned_in_drag
+
+proc set_in_drag*(a: var TGtkPaned, `in_drag`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`in_drag` shl bp_TGtkPaned_in_drag) and bm_TGtkPaned_in_drag)
+
+proc child1_shrink*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_child1_shrink) shr
+      bp_TGtkPaned_child1_shrink
+
+proc set_child1_shrink*(a: var TGtkPaned, `child1_shrink`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`child1_shrink` shl bp_TGtkPaned_child1_shrink) and
+      bm_TGtkPaned_child1_shrink)
+
+proc child1_resize*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_child1_resize) shr
+      bp_TGtkPaned_child1_resize
+
+proc set_child1_resize*(a: var TGtkPaned, `child1_resize`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`child1_resize` shl bp_TGtkPaned_child1_resize) and
+      bm_TGtkPaned_child1_resize)
+
+proc child2_shrink*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_child2_shrink) shr
+      bp_TGtkPaned_child2_shrink
+
+proc set_child2_shrink*(a: var TGtkPaned, `child2_shrink`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`child2_shrink` shl bp_TGtkPaned_child2_shrink) and
+      bm_TGtkPaned_child2_shrink)
+
+proc child2_resize*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_child2_resize) shr
+      bp_TGtkPaned_child2_resize
+
+proc set_child2_resize*(a: var TGtkPaned, `child2_resize`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`child2_resize` shl bp_TGtkPaned_child2_resize) and
+      bm_TGtkPaned_child2_resize)
+
+proc orientation*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_orientation) shr
+      bp_TGtkPaned_orientation
+
+proc set_orientation*(a: var TGtkPaned, `orientation`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`orientation` shl bp_TGtkPaned_orientation) and
+      bm_TGtkPaned_orientation)
+
+proc in_recursion*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_in_recursion) shr
+      bp_TGtkPaned_in_recursion
+
+proc set_in_recursion*(a: var TGtkPaned, `in_recursion`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`in_recursion` shl bp_TGtkPaned_in_recursion) and
+      bm_TGtkPaned_in_recursion)
+
+proc handle_prelit*(a: var TGtkPaned): guint =
+  result = (a.GtkPanedflag0 and bm_TGtkPaned_handle_prelit) shr
+      bp_TGtkPaned_handle_prelit
+
+proc set_handle_prelit*(a: var TGtkPaned, `handle_prelit`: guint) =
+  a.GtkPanedflag0 = a.GtkPanedflag0 or
+      ((`handle_prelit` shl bp_TGtkPaned_handle_prelit) and
+      bm_TGtkPaned_handle_prelit)
+
+proc gtk_paned_gutter_size*(p: pointer, s: gint) =
+  if (p != nil) and (s != 0): nil
+
+proc gtk_paned_set_gutter_size*(p: pointer, s: gint) =
+  if (p != nil) and (s != 0): nil
+
+proc GTK_TYPE_HBUTTON_BOX*(): GType =
+  result = gtk_hbutton_box_get_type()
+
+proc GTK_HBUTTON_BOX*(obj: pointer): PGtkHButtonBox =
+  result = cast[PGtkHButtonBox](GTK_CHECK_CAST(obj, GTK_TYPE_HBUTTON_BOX()))
+
+proc GTK_HBUTTON_BOX_CLASS*(klass: pointer): PGtkHButtonBoxClass =
+  result = cast[PGtkHButtonBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HBUTTON_BOX()))
+
+proc GTK_IS_HBUTTON_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HBUTTON_BOX())
+
+proc GTK_IS_HBUTTON_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HBUTTON_BOX())
+
+proc GTK_HBUTTON_BOX_GET_CLASS*(obj: pointer): PGtkHButtonBoxClass =
+  result = cast[PGtkHButtonBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HBUTTON_BOX()))
+
+proc GTK_TYPE_HPANED*(): GType =
+  result = gtk_hpaned_get_type()
+
+proc GTK_HPANED*(obj: pointer): PGtkHPaned =
+  result = cast[PGtkHPaned](GTK_CHECK_CAST(obj, GTK_TYPE_HPANED()))
+
+proc GTK_HPANED_CLASS*(klass: pointer): PGtkHPanedClass =
+  result = cast[PGtkHPanedClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HPANED()))
+
+proc GTK_IS_HPANED*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HPANED())
+
+proc GTK_IS_HPANED_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HPANED())
+
+proc GTK_HPANED_GET_CLASS*(obj: pointer): PGtkHPanedClass =
+  result = cast[PGtkHPanedClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HPANED()))
+
+proc GTK_TYPE_RULER*(): GType =
+  result = gtk_ruler_get_type()
+
+proc GTK_RULER*(obj: pointer): PGtkRuler =
+  result = cast[PGtkRuler](GTK_CHECK_CAST(obj, GTK_TYPE_RULER()))
+
+proc GTK_RULER_CLASS*(klass: pointer): PGtkRulerClass =
+  result = cast[PGtkRulerClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_RULER()))
+
+proc GTK_IS_RULER*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_RULER())
+
+proc GTK_IS_RULER_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_RULER())
+
+proc GTK_RULER_GET_CLASS*(obj: pointer): PGtkRulerClass =
+  result = cast[PGtkRulerClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_RULER()))
+
+proc GTK_TYPE_HRULER*(): GType =
+  result = gtk_hruler_get_type()
+
+proc GTK_HRULER*(obj: pointer): PGtkHRuler =
+  result = cast[PGtkHRuler](GTK_CHECK_CAST(obj, GTK_TYPE_HRULER()))
+
+proc GTK_HRULER_CLASS*(klass: pointer): PGtkHRulerClass =
+  result = cast[PGtkHRulerClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HRULER()))
+
+proc GTK_IS_HRULER*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HRULER())
+
+proc GTK_IS_HRULER_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HRULER())
+
+proc GTK_HRULER_GET_CLASS*(obj: pointer): PGtkHRulerClass =
+  result = cast[PGtkHRulerClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HRULER()))
+
+proc GTK_TYPE_SETTINGS*(): GType =
+  result = gtk_settings_get_type()
+
+proc GTK_SETTINGS*(obj: pointer): PGtkSettings =
+  result = cast[PGtkSettings](GTK_CHECK_CAST(obj, GTK_TYPE_SETTINGS()))
+
+proc GTK_SETTINGS_CLASS*(klass: pointer): PGtkSettingsClass =
+  result = cast[PGtkSettingsClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SETTINGS()))
+
+proc GTK_IS_SETTINGS*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SETTINGS())
+
+proc GTK_IS_SETTINGS_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SETTINGS())
+
+proc GTK_SETTINGS_GET_CLASS*(obj: pointer): PGtkSettingsClass =
+  result = cast[PGtkSettingsClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SETTINGS()))
+
+proc GTK_TYPE_RC_STYLE*(): GType =
+  result = gtk_rc_style_get_type()
+
+proc GTK_RC_STYLE_get*(anObject: pointer): PGtkRcStyle =
+  result = cast[PGtkRcStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, GTK_TYPE_RC_STYLE()))
+
+proc GTK_RC_STYLE_CLASS*(klass: pointer): PGtkRcStyleClass =
+  result = cast[PGtkRcStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, GTK_TYPE_RC_STYLE()))
+
+proc GTK_IS_RC_STYLE*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_RC_STYLE())
+
+proc GTK_IS_RC_STYLE_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_RC_STYLE())
+
+proc GTK_RC_STYLE_GET_CLASS*(obj: pointer): PGtkRcStyleClass =
+  result = cast[PGtkRcStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, GTK_TYPE_RC_STYLE()))
+
+proc engine_specified*(a: var TGtkRcStyle): guint =
+  result = (a.GtkRcStyleflag0 and bm_TGtkRcStyle_engine_specified) shr
+      bp_TGtkRcStyle_engine_specified
+
+proc set_engine_specified*(a: var TGtkRcStyle, `engine_specified`: guint) =
+  a.GtkRcStyleflag0 = a.GtkRcStyleflag0 or
+      ((`engine_specified` shl bp_TGtkRcStyle_engine_specified) and
+      bm_TGtkRcStyle_engine_specified)
+
+proc GTK_TYPE_STYLE*(): GType =
+  result = gtk_style_get_type()
+
+proc GTK_STYLE*(anObject: pointer): PGtkStyle =
+  result = cast[PGtkStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, GTK_TYPE_STYLE()))
+
+proc GTK_STYLE_CLASS*(klass: pointer): PGtkStyleClass =
+  result = cast[PGtkStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, GTK_TYPE_STYLE()))
+
+proc GTK_IS_STYLE*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_STYLE())
+
+proc GTK_IS_STYLE_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_STYLE())
+
+proc GTK_STYLE_GET_CLASS*(obj: pointer): PGtkStyleClass =
+  result = cast[PGtkStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, GTK_TYPE_STYLE()))
+
+proc GTK_TYPE_BORDER*(): GType =
+  result = gtk_border_get_type()
+
+proc GTK_STYLE_ATTACHED*(style: pointer): bool =
+  result = ((GTK_STYLE(style)).attach_count) > 0
+
+proc gtk_style_apply_default_pixmap*(style: PGtkStyle, window: PGdkWindow,
+                                     state_type: TGtkStateType,
+                                     area: PGdkRectangle, x: gint, y: gint,
+                                     width: gint, height: gint) =
+  gtk_style_apply_default_background(style, window, true, state_type, area, x,
+                                     y, width, height)
+
+proc GTK_TYPE_RANGE*(): GType =
+  result = gtk_range_get_type()
+
+proc GTK_RANGE*(obj: pointer): PGtkRange =
+  result = cast[PGtkRange](GTK_CHECK_CAST(obj, GTK_TYPE_RANGE()))
+
+proc GTK_RANGE_CLASS*(klass: pointer): PGtkRangeClass =
+  result = cast[PGtkRangeClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_RANGE()))
+
+proc GTK_IS_RANGE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_RANGE())
+
+proc GTK_IS_RANGE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_RANGE())
+
+proc GTK_RANGE_GET_CLASS*(obj: pointer): PGtkRangeClass =
+  result = cast[PGtkRangeClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_RANGE()))
+
+proc inverted*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_inverted) shr bp_TGtkRange_inverted
+
+proc set_inverted*(a: var TGtkRange, `inverted`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`inverted` shl bp_TGtkRange_inverted) and bm_TGtkRange_inverted)
+
+proc flippable*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_flippable) shr bp_TGtkRange_flippable
+
+proc set_flippable*(a: var TGtkRange, `flippable`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`flippable` shl bp_TGtkRange_flippable) and bm_TGtkRange_flippable)
+
+proc has_stepper_a*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_has_stepper_a) shr
+      bp_TGtkRange_has_stepper_a
+
+proc set_has_stepper_a*(a: var TGtkRange, `has_stepper_a`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`has_stepper_a` shl bp_TGtkRange_has_stepper_a) and
+      bm_TGtkRange_has_stepper_a)
+
+proc has_stepper_b*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_has_stepper_b) shr
+      bp_TGtkRange_has_stepper_b
+
+proc set_has_stepper_b*(a: var TGtkRange, `has_stepper_b`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`has_stepper_b` shl bp_TGtkRange_has_stepper_b) and
+      bm_TGtkRange_has_stepper_b)
+
+proc has_stepper_c*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_has_stepper_c) shr
+      bp_TGtkRange_has_stepper_c
+
+proc set_has_stepper_c*(a: var TGtkRange, `has_stepper_c`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`has_stepper_c` shl bp_TGtkRange_has_stepper_c) and
+      bm_TGtkRange_has_stepper_c)
+
+proc has_stepper_d*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_has_stepper_d) shr
+      bp_TGtkRange_has_stepper_d
+
+proc set_has_stepper_d*(a: var TGtkRange, `has_stepper_d`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`has_stepper_d` shl bp_TGtkRange_has_stepper_d) and
+      bm_TGtkRange_has_stepper_d)
+
+proc need_recalc*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_need_recalc) shr
+      bp_TGtkRange_need_recalc
+
+proc set_need_recalc*(a: var TGtkRange, `need_recalc`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`need_recalc` shl bp_TGtkRange_need_recalc) and
+      bm_TGtkRange_need_recalc)
+
+proc slider_size_fixed*(a: var TGtkRange): guint =
+  result = (a.GtkRangeflag0 and bm_TGtkRange_slider_size_fixed) shr
+      bp_TGtkRange_slider_size_fixed
+
+proc set_slider_size_fixed*(a: var TGtkRange, `slider_size_fixed`: guint) =
+  a.GtkRangeflag0 = a.GtkRangeflag0 or
+      ((`slider_size_fixed` shl bp_TGtkRange_slider_size_fixed) and
+      bm_TGtkRange_slider_size_fixed)
+
+proc trough_click_forward*(a: var TGtkRange): guint =
+  result = (a.flag1 and bm_TGtkRange_trough_click_forward) shr
+      bp_TGtkRange_trough_click_forward
+
+proc set_trough_click_forward*(a: var TGtkRange, `trough_click_forward`: guint) =
+  a.flag1 = a.flag1 or
+      ((`trough_click_forward` shl bp_TGtkRange_trough_click_forward) and
+      bm_TGtkRange_trough_click_forward)
+
+proc update_pending*(a: var TGtkRange): guint =
+  result = (a.flag1 and bm_TGtkRange_update_pending) shr
+      bp_TGtkRange_update_pending
+
+proc set_update_pending*(a: var TGtkRange, `update_pending`: guint) =
+  a.flag1 = a.flag1 or
+      ((`update_pending` shl bp_TGtkRange_update_pending) and
+      bm_TGtkRange_update_pending)
+
+proc GTK_TYPE_SCALE*(): GType =
+  result = gtk_scale_get_type()
+
+proc GTK_SCALE*(obj: pointer): PGtkScale =
+  result = cast[PGtkScale](GTK_CHECK_CAST(obj, GTK_TYPE_SCALE()))
+
+proc GTK_SCALE_CLASS*(klass: pointer): PGtkScaleClass =
+  result = cast[PGtkScaleClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SCALE()))
+
+proc GTK_IS_SCALE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SCALE())
+
+proc GTK_IS_SCALE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SCALE())
+
+proc GTK_SCALE_GET_CLASS*(obj: pointer): PGtkScaleClass =
+  result = cast[PGtkScaleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SCALE()))
+
+proc draw_value*(a: var TGtkScale): guint =
+  result = (a.GtkScaleflag0 and bm_TGtkScale_draw_value) shr bp_TGtkScale_draw_value
+
+proc set_draw_value*(a: var TGtkScale, `draw_value`: guint) =
+  a.GtkScaleflag0 = a.GtkScaleflag0 or
+      ((`draw_value` shl bp_TGtkScale_draw_value) and bm_TGtkScale_draw_value)
+
+proc value_pos*(a: var TGtkScale): guint =
+  result = (a.GtkScaleflag0 and bm_TGtkScale_value_pos) shr bp_TGtkScale_value_pos
+
+proc set_value_pos*(a: var TGtkScale, `value_pos`: guint) =
+  a.GtkScaleflag0 = a.GtkScaleflag0 or
+      ((`value_pos` shl bp_TGtkScale_value_pos) and bm_TGtkScale_value_pos)
+
+proc GTK_TYPE_HSCALE*(): GType =
+  result = gtk_hscale_get_type()
+
+proc GTK_HSCALE*(obj: pointer): PGtkHScale =
+  result = cast[PGtkHScale](GTK_CHECK_CAST(obj, GTK_TYPE_HSCALE()))
+
+proc GTK_HSCALE_CLASS*(klass: pointer): PGtkHScaleClass =
+  result = cast[PGtkHScaleClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HSCALE()))
+
+proc GTK_IS_HSCALE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HSCALE())
+
+proc GTK_IS_HSCALE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HSCALE())
+
+proc GTK_HSCALE_GET_CLASS*(obj: pointer): PGtkHScaleClass =
+  result = cast[PGtkHScaleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HSCALE()))
+
+proc GTK_TYPE_SCROLLBAR*(): GType =
+  result = gtk_scrollbar_get_type()
+
+proc GTK_SCROLLBAR*(obj: pointer): PGtkScrollbar =
+  result = cast[PGtkScrollbar](GTK_CHECK_CAST(obj, GTK_TYPE_SCROLLBAR()))
+
+proc GTK_SCROLLBAR_CLASS*(klass: pointer): PGtkScrollbarClass =
+  result = cast[PGtkScrollbarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SCROLLBAR()))
+
+proc GTK_IS_SCROLLBAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SCROLLBAR())
+
+proc GTK_IS_SCROLLBAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SCROLLBAR())
+
+proc GTK_SCROLLBAR_GET_CLASS*(obj: pointer): PGtkScrollbarClass =
+  result = cast[PGtkScrollbarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SCROLLBAR()))
+
+proc GTK_TYPE_HSCROLLBAR*(): GType =
+  result = gtk_hscrollbar_get_type()
+
+proc GTK_HSCROLLBAR*(obj: pointer): PGtkHScrollbar =
+  result = cast[PGtkHScrollbar](GTK_CHECK_CAST(obj, GTK_TYPE_HSCROLLBAR()))
+
+proc GTK_HSCROLLBAR_CLASS*(klass: pointer): PGtkHScrollbarClass =
+  result = cast[PGtkHScrollbarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HSCROLLBAR()))
+
+proc GTK_IS_HSCROLLBAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HSCROLLBAR())
+
+proc GTK_IS_HSCROLLBAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HSCROLLBAR())
+
+proc GTK_HSCROLLBAR_GET_CLASS*(obj: pointer): PGtkHScrollbarClass =
+  result = cast[PGtkHScrollbarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HSCROLLBAR()))
+
+proc GTK_TYPE_SEPARATOR*(): GType =
+  result = gtk_separator_get_type()
+
+proc GTK_SEPARATOR*(obj: pointer): PGtkSeparator =
+  result = cast[PGtkSeparator](GTK_CHECK_CAST(obj, GTK_TYPE_SEPARATOR()))
+
+proc GTK_SEPARATOR_CLASS*(klass: pointer): PGtkSeparatorClass =
+  result = cast[PGtkSeparatorClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SEPARATOR()))
+
+proc GTK_IS_SEPARATOR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SEPARATOR())
+
+proc GTK_IS_SEPARATOR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SEPARATOR())
+
+proc GTK_SEPARATOR_GET_CLASS*(obj: pointer): PGtkSeparatorClass =
+  result = cast[PGtkSeparatorClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SEPARATOR()))
+
+proc GTK_TYPE_HSEPARATOR*(): GType =
+  result = gtk_hseparator_get_type()
+
+proc GTK_HSEPARATOR*(obj: pointer): PGtkHSeparator =
+  result = cast[PGtkHSeparator](GTK_CHECK_CAST(obj, GTK_TYPE_HSEPARATOR()))
+
+proc GTK_HSEPARATOR_CLASS*(klass: pointer): PGtkHSeparatorClass =
+  result = cast[PGtkHSeparatorClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_HSEPARATOR()))
+
+proc GTK_IS_HSEPARATOR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_HSEPARATOR())
+
+proc GTK_IS_HSEPARATOR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_HSEPARATOR())
+
+proc GTK_HSEPARATOR_GET_CLASS*(obj: pointer): PGtkHSeparatorClass =
+  result = cast[PGtkHSeparatorClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_HSEPARATOR()))
+
+proc GTK_TYPE_ICON_FACTORY*(): GType =
+  result = gtk_icon_factory_get_type()
+
+proc GTK_ICON_FACTORY*(anObject: pointer): PGtkIconFactory =
+  result = cast[PGtkIconFactory](G_TYPE_CHECK_INSTANCE_CAST(anObject,
+      GTK_TYPE_ICON_FACTORY()))
+
+proc GTK_ICON_FACTORY_CLASS*(klass: pointer): PGtkIconFactoryClass =
+  result = cast[PGtkIconFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_ICON_FACTORY()))
+
+proc GTK_IS_ICON_FACTORY*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_ICON_FACTORY())
+
+proc GTK_IS_ICON_FACTORY_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_ICON_FACTORY())
+
+proc GTK_ICON_FACTORY_GET_CLASS*(obj: pointer): PGtkIconFactoryClass =
+  result = cast[PGtkIconFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_ICON_FACTORY()))
+
+proc GTK_TYPE_ICON_SET*(): GType =
+  result = gtk_icon_set_get_type()
+
+proc GTK_TYPE_ICON_SOURCE*(): GType =
+  result = gtk_icon_source_get_type()
+
+proc GTK_TYPE_IMAGE*(): GType =
+  result = gtk_image_get_type()
+
+proc GTK_IMAGE*(obj: pointer): PGtkImage =
+  result = cast[PGtkImage](GTK_CHECK_CAST(obj, GTK_TYPE_IMAGE()))
+
+proc GTK_IMAGE_CLASS*(klass: pointer): PGtkImageClass =
+  result = cast[PGtkImageClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_IMAGE()))
+
+proc GTK_IS_IMAGE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_IMAGE())
+
+proc GTK_IS_IMAGE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_IMAGE())
+
+proc GTK_IMAGE_GET_CLASS*(obj: pointer): PGtkImageClass =
+  result = cast[PGtkImageClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_IMAGE()))
+
+proc GTK_TYPE_IMAGE_MENU_ITEM*(): GType =
+  result = gtk_image_menu_item_get_type()
+
+proc GTK_IMAGE_MENU_ITEM*(obj: pointer): PGtkImageMenuItem =
+  result = cast[PGtkImageMenuItem](GTK_CHECK_CAST(obj, GTK_TYPE_IMAGE_MENU_ITEM()))
+
+proc GTK_IMAGE_MENU_ITEM_CLASS*(klass: pointer): PGtkImageMenuItemClass =
+  result = cast[PGtkImageMenuItemClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_IMAGE_MENU_ITEM()))
+
+proc GTK_IS_IMAGE_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_IMAGE_MENU_ITEM())
+
+proc GTK_IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_IMAGE_MENU_ITEM())
+
+proc GTK_IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkImageMenuItemClass =
+  result = cast[PGtkImageMenuItemClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_IMAGE_MENU_ITEM()))
+
+proc GTK_TYPE_IM_CONTEXT_SIMPLE*(): GType =
+  result = gtk_im_context_simple_get_type()
+
+proc GTK_IM_CONTEXT_SIMPLE*(obj: pointer): PGtkIMContextSimple =
+  result = cast[PGtkIMContextSimple](GTK_CHECK_CAST(obj, GTK_TYPE_IM_CONTEXT_SIMPLE()))
+
+proc GTK_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PGtkIMContextSimpleClass =
+  result = cast[PGtkIMContextSimpleClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_IM_CONTEXT_SIMPLE()))
+
+proc GTK_IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_IM_CONTEXT_SIMPLE())
+
+proc GTK_IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_IM_CONTEXT_SIMPLE())
+
+proc GTK_IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PGtkIMContextSimpleClass =
+  result = cast[PGtkIMContextSimpleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_IM_CONTEXT_SIMPLE()))
+
+proc in_hex_sequence*(a: var TGtkIMContextSimple): guint =
+  result = (a.GtkIMContextSimpleflag0 and bm_TGtkIMContextSimple_in_hex_sequence) shr
+      bp_TGtkIMContextSimple_in_hex_sequence
+
+proc set_in_hex_sequence*(a: var TGtkIMContextSimple, `in_hex_sequence`: guint) =
+  a.GtkIMContextSimpleflag0 = a.GtkIMContextSimpleflag0 or
+      ((`in_hex_sequence` shl bp_TGtkIMContextSimple_in_hex_sequence) and
+      bm_TGtkIMContextSimple_in_hex_sequence)
+
+proc GTK_TYPE_IM_MULTICONTEXT*(): GType =
+  result = gtk_im_multicontext_get_type()
+
+proc GTK_IM_MULTICONTEXT*(obj: pointer): PGtkIMMulticontext =
+  result = cast[PGtkIMMulticontext](GTK_CHECK_CAST(obj, GTK_TYPE_IM_MULTICONTEXT()))
+
+proc GTK_IM_MULTICONTEXT_CLASS*(klass: pointer): PGtkIMMulticontextClass =
+  result = cast[PGtkIMMulticontextClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_IM_MULTICONTEXT()))
+
+proc GTK_IS_IM_MULTICONTEXT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_IM_MULTICONTEXT())
+
+proc GTK_IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_IM_MULTICONTEXT())
+
+proc GTK_IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PGtkIMMulticontextClass =
+  result = cast[PGtkIMMulticontextClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_IM_MULTICONTEXT()))
+
+proc GTK_TYPE_INPUT_DIALOG*(): GType =
+  result = gtk_input_dialog_get_type()
+
+proc GTK_INPUT_DIALOG*(obj: pointer): PGtkInputDialog =
+  result = cast[PGtkInputDialog](GTK_CHECK_CAST(obj, GTK_TYPE_INPUT_DIALOG()))
+
+proc GTK_INPUT_DIALOG_CLASS*(klass: pointer): PGtkInputDialogClass =
+  result = cast[PGtkInputDialogClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_INPUT_DIALOG()))
+
+proc GTK_IS_INPUT_DIALOG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_INPUT_DIALOG())
+
+proc GTK_IS_INPUT_DIALOG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_INPUT_DIALOG())
+
+proc GTK_INPUT_DIALOG_GET_CLASS*(obj: pointer): PGtkInputDialogClass =
+  result = cast[PGtkInputDialogClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_INPUT_DIALOG()))
+
+proc GTK_TYPE_INVISIBLE*(): GType =
+  result = gtk_invisible_get_type()
+
+proc GTK_INVISIBLE*(obj: pointer): PGtkInvisible =
+  result = cast[PGtkInvisible](GTK_CHECK_CAST(obj, GTK_TYPE_INVISIBLE()))
+
+proc GTK_INVISIBLE_CLASS*(klass: pointer): PGtkInvisibleClass =
+  result = cast[PGtkInvisibleClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_INVISIBLE()))
+
+proc GTK_IS_INVISIBLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_INVISIBLE())
+
+proc GTK_IS_INVISIBLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_INVISIBLE())
+
+proc GTK_INVISIBLE_GET_CLASS*(obj: pointer): PGtkInvisibleClass =
+  result = cast[PGtkInvisibleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_INVISIBLE()))
+
+proc GTK_TYPE_ITEM_FACTORY*(): GType =
+  result = gtk_item_factory_get_type()
+
+proc GTK_ITEM_FACTORY*(anObject: pointer): PGtkItemFactory =
+  result = cast[PGtkItemFactory](GTK_CHECK_CAST(anObject, GTK_TYPE_ITEM_FACTORY()))
+
+proc GTK_ITEM_FACTORY_CLASS*(klass: pointer): PGtkItemFactoryClass =
+  result = cast[PGtkItemFactoryClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_ITEM_FACTORY()))
+
+proc GTK_IS_ITEM_FACTORY*(anObject: pointer): bool =
+  result = GTK_CHECK_TYPE(anObject, GTK_TYPE_ITEM_FACTORY())
+
+proc GTK_IS_ITEM_FACTORY_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_ITEM_FACTORY())
+
+proc GTK_ITEM_FACTORY_GET_CLASS*(obj: pointer): PGtkItemFactoryClass =
+  result = cast[PGtkItemFactoryClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_ITEM_FACTORY()))
+
+proc GTK_TYPE_LAYOUT*(): GType =
+  result = gtk_layout_get_type()
+
+proc GTK_LAYOUT*(obj: pointer): PGtkLayout =
+  result = cast[PGtkLayout](GTK_CHECK_CAST(obj, GTK_TYPE_LAYOUT()))
+
+proc GTK_LAYOUT_CLASS*(klass: pointer): PGtkLayoutClass =
+  result = cast[PGtkLayoutClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_LAYOUT()))
+
+proc GTK_IS_LAYOUT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_LAYOUT())
+
+proc GTK_IS_LAYOUT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_LAYOUT())
+
+proc GTK_LAYOUT_GET_CLASS*(obj: pointer): PGtkLayoutClass =
+  result = cast[PGtkLayoutClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_LAYOUT()))
+
+proc GTK_TYPE_LIST*(): GType =
+  result = gtk_list_get_type()
+
+proc GTK_LIST*(obj: pointer): PGtkList =
+  result = cast[PGtkList](GTK_CHECK_CAST(obj, GTK_TYPE_LIST()))
+
+proc GTK_LIST_CLASS*(klass: pointer): PGtkListClass =
+  result = cast[PGtkListClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_LIST()))
+
+proc GTK_IS_LIST*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_LIST())
+
+proc GTK_IS_LIST_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_LIST())
+
+proc GTK_LIST_GET_CLASS*(obj: pointer): PGtkListClass =
+  result = cast[PGtkListClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_LIST()))
+
+proc selection_mode*(a: var TGtkList): guint =
+  result = (a.GtkListflag0 and bm_TGtkList_selection_mode) shr
+      bp_TGtkList_selection_mode
+
+proc set_selection_mode*(a: var TGtkList, `selection_mode`: guint) =
+  a.GtkListflag0 = a.GtkListflag0 or
+      ((`selection_mode` shl bp_TGtkList_selection_mode) and
+      bm_TGtkList_selection_mode)
+
+proc drag_selection*(a: var TGtkList): guint =
+  result = (a.GtkListflag0 and bm_TGtkList_drag_selection) shr
+      bp_TGtkList_drag_selection
+
+proc set_drag_selection*(a: var TGtkList, `drag_selection`: guint) =
+  a.GtkListflag0 = a.GtkListflag0 or
+      ((`drag_selection` shl bp_TGtkList_drag_selection) and
+      bm_TGtkList_drag_selection)
+
+proc add_mode*(a: var TGtkList): guint =
+  result = (a.GtkListflag0 and bm_TGtkList_add_mode) shr bp_TGtkList_add_mode
+
+proc set_add_mode*(a: var TGtkList, `add_mode`: guint) =
+  a.GtkListflag0 = a.GtkListflag0 or
+      ((`add_mode` shl bp_TGtkList_add_mode) and bm_TGtkList_add_mode)
+
+proc gtk_list_item_get_type(): GType {.importc, cdecl, dynlib: gtklib.}
+
+proc GTK_TYPE_LIST_ITEM*(): GType =
+  result = gtk_list_item_get_type()
+
+type
+  TGtkListItem = object of TGtkItem
+  TGtkListItemClass = object of TGtkItemClass
+  PGtkListItem = ptr TGtkListItem
+  PGtkListItemClass = ptr TGtkListItemClass
+
+proc GTK_LIST_ITEM*(obj: pointer): PGtkListItem =
+  result = cast[PGtkListItem](GTK_CHECK_CAST(obj, GTK_TYPE_LIST_ITEM()))
+
+proc GTK_LIST_ITEM_CLASS*(klass: pointer): PGtkListItemClass =
+  result = cast[PGtkListItemClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_LIST_ITEM()))
+
+proc GTK_IS_LIST_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_LIST_ITEM())
+
+proc GTK_IS_LIST_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_LIST_ITEM())
+
+proc GTK_LIST_ITEM_GET_CLASS*(obj: pointer): PGtkListItemClass =
+  result = cast[PGtkListItemClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_LIST_ITEM()))
+
+#proc gtk_tree_model_get_type(): GType {.importc, cdecl, dynlib: gtklib.}
+
+proc GTK_TYPE_TREE_MODEL*(): GType =
+  result = gtk_tree_model_get_type()
+
+proc GTK_TREE_MODEL*(obj: pointer): PGtkTreeModel =
+  result = cast[PGtkTreeModel](G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TREE_MODEL()))
+
+proc GTK_IS_TREE_MODEL*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TREE_MODEL())
+
+proc GTK_TREE_MODEL_GET_IFACE*(obj: pointer): PGtkTreeModelIface =
+  result = cast[PGtkTreeModelIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      GTK_TYPE_TREE_MODEL()))
+
+proc GTK_TYPE_TREE_ITER*(): GType =
+  result = gtk_tree_iter_get_type()
+
+proc GTK_TYPE_TREE_PATH*(): GType =
+  result = gtk_tree_path_get_type()
+
+proc gtk_tree_path_new_root*(): PGtkTreePath =
+  result = gtk_tree_path_new_first()
+
+proc gtk_tree_model_get_iter_root*(tree_model: PGtkTreeModel, iter: PGtkTreeIter): gboolean =
+  result = gtk_tree_model_get_iter_first(tree_model, iter)
+
+proc GTK_TYPE_TREE_SORTABLE*(): GType =
+  result = gtk_tree_sortable_get_type()
+
+proc GTK_TREE_SORTABLE*(obj: pointer): PGtkTreeSortable =
+  result = cast[PGtkTreeSortable](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      GTK_TYPE_TREE_SORTABLE()))
+
+proc GTK_TREE_SORTABLE_CLASS*(obj: pointer): PGtkTreeSortableIface =
+  result = cast[PGtkTreeSortableIface](G_TYPE_CHECK_CLASS_CAST(obj,
+      GTK_TYPE_TREE_SORTABLE()))
+
+proc GTK_IS_TREE_SORTABLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TREE_SORTABLE())
+
+proc GTK_TREE_SORTABLE_GET_IFACE*(obj: pointer): PGtkTreeSortableIface =
+  result = cast[PGtkTreeSortableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      GTK_TYPE_TREE_SORTABLE()))
+
+proc GTK_TYPE_TREE_MODEL_SORT*(): GType =
+  result = gtk_tree_model_sort_get_type()
+
+proc GTK_TREE_MODEL_SORT*(obj: pointer): PGtkTreeModelSort =
+  result = cast[PGtkTreeModelSort](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_MODEL_SORT()))
+
+proc GTK_TREE_MODEL_SORT_CLASS*(klass: pointer): PGtkTreeModelSortClass =
+  result = cast[PGtkTreeModelSortClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TREE_MODEL_SORT()))
+
+proc GTK_IS_TREE_MODEL_SORT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_MODEL_SORT())
+
+proc GTK_IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_MODEL_SORT())
+
+proc GTK_TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PGtkTreeModelSortClass =
+  result = cast[PGtkTreeModelSortClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_TREE_MODEL_SORT()))
+
+proc GTK_TYPE_LIST_STORE*(): GType =
+  result = gtk_list_store_get_type()
+
+proc GTK_LIST_STORE*(obj: pointer): PGtkListStore =
+  result = cast[PGtkListStore](GTK_CHECK_CAST(obj, GTK_TYPE_LIST_STORE()))
+
+proc GTK_LIST_STORE_CLASS*(klass: pointer): PGtkListStoreClass =
+  result = cast[PGtkListStoreClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_LIST_STORE()))
+
+proc GTK_IS_LIST_STORE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_LIST_STORE())
+
+proc GTK_IS_LIST_STORE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_LIST_STORE())
+
+proc GTK_LIST_STORE_GET_CLASS*(obj: pointer): PGtkListStoreClass =
+  result = cast[PGtkListStoreClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_LIST_STORE()))
+
+proc columns_dirty*(a: var TGtkListStore): guint =
+  result = (a.GtkListStoreflag0 and bm_TGtkListStore_columns_dirty) shr
+      bp_TGtkListStore_columns_dirty
+
+proc set_columns_dirty*(a: var TGtkListStore, `columns_dirty`: guint) =
+  a.GtkListStoreflag0 = a.GtkListStoreflag0 or
+      ((`columns_dirty` shl bp_TGtkListStore_columns_dirty) and
+      bm_TGtkListStore_columns_dirty)
+
+proc GTK_TYPE_MENU_BAR*(): GType =
+  result = gtk_menu_bar_get_type()
+
+proc GTK_MENU_BAR*(obj: pointer): PGtkMenuBar =
+  result = cast[PGtkMenuBar](GTK_CHECK_CAST(obj, GTK_TYPE_MENU_BAR()))
+
+proc GTK_MENU_BAR_CLASS*(klass: pointer): PGtkMenuBarClass =
+  result = cast[PGtkMenuBarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_MENU_BAR()))
+
+proc GTK_IS_MENU_BAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MENU_BAR())
+
+proc GTK_IS_MENU_BAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MENU_BAR())
+
+proc GTK_MENU_BAR_GET_CLASS*(obj: pointer): PGtkMenuBarClass =
+  result = cast[PGtkMenuBarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_MENU_BAR()))
+
+proc gtk_menu_bar_append*(menu, child: PGtkWidget) =
+  gtk_menu_shell_append(cast[PGtkMenuShell](menu), child)
+
+proc gtk_menu_bar_prepend*(menu, child: PGtkWidget) =
+  gtk_menu_shell_prepend(cast[PGtkMenuShell](menu), child)
+
+proc gtk_menu_bar_insert*(menu, child: PGtkWidget, pos: gint) =
+  gtk_menu_shell_insert(cast[PGtkMenuShell](menu), child, pos)
+
+proc GTK_TYPE_MESSAGE_DIALOG*(): GType =
+  result = gtk_message_dialog_get_type()
+
+proc GTK_MESSAGE_DIALOG*(obj: pointer): PGtkMessageDialog =
+  result = cast[PGtkMessageDialog](GTK_CHECK_CAST(obj, GTK_TYPE_MESSAGE_DIALOG()))
+
+proc GTK_MESSAGE_DIALOG_CLASS*(klass: pointer): PGtkMessageDialogClass =
+  result = cast[PGtkMessageDialogClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_MESSAGE_DIALOG()))
+
+proc GTK_IS_MESSAGE_DIALOG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_MESSAGE_DIALOG())
+
+proc GTK_IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_MESSAGE_DIALOG())
+
+proc GTK_MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PGtkMessageDialogClass =
+  result = cast[PGtkMessageDialogClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_MESSAGE_DIALOG()))
+
+proc GTK_TYPE_NOTEBOOK*(): GType =
+  result = gtk_notebook_get_type()
+
+proc GTK_NOTEBOOK*(obj: pointer): PGtkNotebook =
+  result = cast[PGtkNotebook](GTK_CHECK_CAST(obj, GTK_TYPE_NOTEBOOK()))
+
+proc GTK_NOTEBOOK_CLASS*(klass: pointer): PGtkNotebookClass =
+  result = cast[PGtkNotebookClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_NOTEBOOK()))
+
+proc GTK_IS_NOTEBOOK*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_NOTEBOOK())
+
+proc GTK_IS_NOTEBOOK_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_NOTEBOOK())
+
+proc GTK_NOTEBOOK_GET_CLASS*(obj: pointer): PGtkNotebookClass =
+  result = cast[PGtkNotebookClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_NOTEBOOK()))
+
+proc show_tabs*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_show_tabs) shr
+      bp_TGtkNotebook_show_tabs
+
+proc set_show_tabs*(a: var TGtkNotebook, `show_tabs`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`show_tabs` shl bp_TGtkNotebook_show_tabs) and
+      bm_TGtkNotebook_show_tabs)
+
+proc homogeneous*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_homogeneous) shr
+      bp_TGtkNotebook_homogeneous
+
+proc set_homogeneous*(a: var TGtkNotebook, `homogeneous`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`homogeneous` shl bp_TGtkNotebook_homogeneous) and
+      bm_TGtkNotebook_homogeneous)
+
+proc show_border*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_show_border) shr
+      bp_TGtkNotebook_show_border
+
+proc set_show_border*(a: var TGtkNotebook, `show_border`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`show_border` shl bp_TGtkNotebook_show_border) and
+      bm_TGtkNotebook_show_border)
+
+proc tab_pos*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_tab_pos) shr bp_TGtkNotebook_tab_pos
+
+proc set_tab_pos*(a: var TGtkNotebook, `tab_pos`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`tab_pos` shl bp_TGtkNotebook_tab_pos) and bm_TGtkNotebook_tab_pos)
+
+proc scrollable*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_scrollable) shr
+      bp_TGtkNotebook_scrollable
+
+proc set_scrollable*(a: var TGtkNotebook, `scrollable`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`scrollable` shl bp_TGtkNotebook_scrollable) and
+      bm_TGtkNotebook_scrollable)
+
+proc in_child*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_in_child) shr
+      bp_TGtkNotebook_in_child
+
+proc set_in_child*(a: var TGtkNotebook, `in_child`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`in_child` shl bp_TGtkNotebook_in_child) and bm_TGtkNotebook_in_child)
+
+proc click_child*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_click_child) shr
+      bp_TGtkNotebook_click_child
+
+proc set_click_child*(a: var TGtkNotebook, `click_child`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`click_child` shl bp_TGtkNotebook_click_child) and
+      bm_TGtkNotebook_click_child)
+
+proc button*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_button) shr bp_TGtkNotebook_button
+
+proc set_button*(a: var TGtkNotebook, `button`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`button` shl bp_TGtkNotebook_button) and bm_TGtkNotebook_button)
+
+proc need_timer*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_need_timer) shr
+      bp_TGtkNotebook_need_timer
+
+proc set_need_timer*(a: var TGtkNotebook, `need_timer`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`need_timer` shl bp_TGtkNotebook_need_timer) and
+      bm_TGtkNotebook_need_timer)
+
+proc child_has_focus*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_child_has_focus) shr
+      bp_TGtkNotebook_child_has_focus
+
+proc set_child_has_focus*(a: var TGtkNotebook, `child_has_focus`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`child_has_focus` shl bp_TGtkNotebook_child_has_focus) and
+      bm_TGtkNotebook_child_has_focus)
+
+proc have_visible_child*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_have_visible_child) shr
+      bp_TGtkNotebook_have_visible_child
+
+proc set_have_visible_child*(a: var TGtkNotebook, `have_visible_child`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`have_visible_child` shl bp_TGtkNotebook_have_visible_child) and
+      bm_TGtkNotebook_have_visible_child)
+
+proc focus_out*(a: var TGtkNotebook): guint =
+  result = (a.GtkNotebookflag0 and bm_TGtkNotebook_focus_out) shr
+      bp_TGtkNotebook_focus_out
+
+proc set_focus_out*(a: var TGtkNotebook, `focus_out`: guint) =
+  a.GtkNotebookflag0 = a.GtkNotebookflag0 or
+      ((`focus_out` shl bp_TGtkNotebook_focus_out) and
+      bm_TGtkNotebook_focus_out)
+
+proc GTK_TYPE_OLD_EDITABLE*(): GType =
+  result = gtk_old_editable_get_type()
+
+proc GTK_OLD_EDITABLE*(obj: pointer): PGtkOldEditable =
+  result = cast[PGtkOldEditable](GTK_CHECK_CAST(obj, GTK_TYPE_OLD_EDITABLE()))
+
+proc GTK_OLD_EDITABLE_CLASS*(klass: pointer): PGtkOldEditableClass =
+  result = cast[PGtkOldEditableClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_OLD_EDITABLE()))
+
+proc GTK_IS_OLD_EDITABLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_OLD_EDITABLE())
+
+proc GTK_IS_OLD_EDITABLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_OLD_EDITABLE())
+
+proc GTK_OLD_EDITABLE_GET_CLASS*(obj: pointer): PGtkOldEditableClass =
+  result = cast[PGtkOldEditableClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_OLD_EDITABLE()))
+
+proc has_selection*(a: var TGtkOldEditable): guint =
+  result = (a.GtkOldEditableflag0 and bm_TGtkOldEditable_has_selection) shr
+      bp_TGtkOldEditable_has_selection
+
+proc set_has_selection*(a: var TGtkOldEditable, `has_selection`: guint) =
+  a.GtkOldEditableflag0 = a.GtkOldEditableflag0 or
+      ((`has_selection` shl bp_TGtkOldEditable_has_selection) and
+      bm_TGtkOldEditable_has_selection)
+
+proc editable*(a: var TGtkOldEditable): guint =
+  result = (a.GtkOldEditableflag0 and bm_TGtkOldEditable_editable) shr
+      bp_TGtkOldEditable_editable
+
+proc set_editable*(a: var TGtkOldEditable, `editable`: guint) =
+  a.GtkOldEditableflag0 = a.GtkOldEditableflag0 or
+      ((`editable` shl bp_TGtkOldEditable_editable) and
+      bm_TGtkOldEditable_editable)
+
+proc visible*(a: var TGtkOldEditable): guint =
+  result = (a.GtkOldEditableflag0 and bm_TGtkOldEditable_visible) shr
+      bp_TGtkOldEditable_visible
+
+proc set_visible*(a: var TGtkOldEditable, `visible`: guint) =
+  a.GtkOldEditableflag0 = a.GtkOldEditableflag0 or
+      ((`visible` shl bp_TGtkOldEditable_visible) and
+      bm_TGtkOldEditable_visible)
+
+proc GTK_TYPE_OPTION_MENU*(): GType =
+  result = gtk_option_menu_get_type()
+
+proc GTK_OPTION_MENU*(obj: pointer): PGtkOptionMenu =
+  result = cast[PGtkOptionMenu](GTK_CHECK_CAST(obj, GTK_TYPE_OPTION_MENU()))
+
+proc GTK_OPTION_MENU_CLASS*(klass: pointer): PGtkOptionMenuClass =
+  result = cast[PGtkOptionMenuClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_OPTION_MENU()))
+
+proc GTK_IS_OPTION_MENU*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_OPTION_MENU())
+
+proc GTK_IS_OPTION_MENU_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_OPTION_MENU())
+
+proc GTK_OPTION_MENU_GET_CLASS*(obj: pointer): PGtkOptionMenuClass =
+  result = cast[PGtkOptionMenuClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_OPTION_MENU()))
+
+proc GTK_TYPE_PIXMAP*(): GType =
+  result = gtk_pixmap_get_type()
+
+proc GTK_PIXMAP*(obj: pointer): PGtkPixmap =
+  result = cast[PGtkPixmap](GTK_CHECK_CAST(obj, GTK_TYPE_PIXMAP()))
+
+proc GTK_PIXMAP_CLASS*(klass: pointer): PGtkPixmapClass =
+  result = cast[PGtkPixmapClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_PIXMAP()))
+
+proc GTK_IS_PIXMAP*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PIXMAP())
+
+proc GTK_IS_PIXMAP_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PIXMAP())
+
+proc GTK_PIXMAP_GET_CLASS*(obj: pointer): PGtkPixmapClass =
+  result = cast[PGtkPixmapClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PIXMAP()))
+
+proc build_insensitive*(a: var TGtkPixmap): guint =
+  result = (a.GtkPixmapflag0 and bm_TGtkPixmap_build_insensitive) shr
+      bp_TGtkPixmap_build_insensitive
+
+proc set_build_insensitive*(a: var TGtkPixmap, `build_insensitive`: guint) =
+  a.GtkPixmapflag0 = a.GtkPixmapflag0 or
+      ((`build_insensitive` shl bp_TGtkPixmap_build_insensitive) and
+      bm_TGtkPixmap_build_insensitive)
+
+proc GTK_TYPE_PLUG*(): GType =
+  result = gtk_plug_get_type()
+
+proc GTK_PLUG*(obj: pointer): PGtkPlug =
+  result = cast[PGtkPlug](GTK_CHECK_CAST(obj, GTK_TYPE_PLUG()))
+
+proc GTK_PLUG_CLASS*(klass: pointer): PGtkPlugClass =
+  result = cast[PGtkPlugClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_PLUG()))
+
+proc GTK_IS_PLUG*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PLUG())
+
+proc GTK_IS_PLUG_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PLUG())
+
+proc GTK_PLUG_GET_CLASS*(obj: pointer): PGtkPlugClass =
+  result = cast[PGtkPlugClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PLUG()))
+
+proc same_app*(a: var TGtkPlug): guint =
+  result = (a.GtkPlugflag0 and bm_TGtkPlug_same_app) shr bp_TGtkPlug_same_app
+
+proc set_same_app*(a: var TGtkPlug, `same_app`: guint) =
+  a.GtkPlugflag0 = a.GtkPlugflag0 or
+      ((`same_app` shl bp_TGtkPlug_same_app) and bm_TGtkPlug_same_app)
+
+proc GTK_TYPE_PREVIEW*(): GType =
+  result = gtk_preview_get_type()
+
+proc GTK_PREVIEW*(obj: pointer): PGtkPreview =
+  result = cast[PGtkPreview](GTK_CHECK_CAST(obj, GTK_TYPE_PREVIEW()))
+
+proc GTK_PREVIEW_CLASS*(klass: pointer): PGtkPreviewClass =
+  result = cast[PGtkPreviewClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_PREVIEW()))
+
+proc GTK_IS_PREVIEW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PREVIEW())
+
+proc GTK_IS_PREVIEW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PREVIEW())
+
+proc GTK_PREVIEW_GET_CLASS*(obj: pointer): PGtkPreviewClass =
+  result = cast[PGtkPreviewClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PREVIEW()))
+
+proc get_type*(a: var TGtkPreview): guint =
+  result = (a.GtkPreviewflag0 and bm_TGtkPreview_type) shr bp_TGtkPreview_type
+
+proc set_type*(a: var TGtkPreview, `type`: guint) =
+  a.GtkPreviewflag0 = a.GtkPreviewflag0 or
+      ((`type` shl bp_TGtkPreview_type) and bm_TGtkPreview_type)
+
+proc get_expand*(a: var TGtkPreview): guint =
+  result = (a.GtkPreviewflag0 and bm_TGtkPreview_expand) shr bp_TGtkPreview_expand
+
+proc set_expand*(a: var TGtkPreview, `expand`: guint) =
+  a.GtkPreviewflag0 = a.GtkPreviewflag0 or
+      ((`expand` shl bp_TGtkPreview_expand) and bm_TGtkPreview_expand)
+
+proc gtk_progress_get_type(): GType {.importc, cdecl, dynlib: gtklib.}
+
+proc GTK_TYPE_PROGRESS*(): GType =
+  result = gtk_progress_get_type()
+
+proc GTK_PROGRESS*(obj: pointer): PGtkProgress =
+  result = cast[PGtkProgress](GTK_CHECK_CAST(obj, GTK_TYPE_PROGRESS()))
+
+proc GTK_PROGRESS_CLASS*(klass: pointer): PGtkProgressClass =
+  result = cast[PGtkProgressClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_PROGRESS()))
+
+proc GTK_IS_PROGRESS*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PROGRESS())
+
+proc GTK_IS_PROGRESS_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PROGRESS())
+
+proc GTK_PROGRESS_GET_CLASS*(obj: pointer): PGtkProgressClass =
+  result = cast[PGtkProgressClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PROGRESS()))
+
+proc show_text*(a: var TGtkProgress): guint =
+  result = (a.GtkProgressflag0 and bm_TGtkProgress_show_text) shr
+      bp_TGtkProgress_show_text
+
+proc set_show_text*(a: var TGtkProgress, `show_text`: guint) =
+  a.GtkProgressflag0 = a.GtkProgressflag0 or
+      ((`show_text` shl bp_TGtkProgress_show_text) and
+      bm_TGtkProgress_show_text)
+
+proc activity_mode*(a: var TGtkProgress): guint =
+  result = (a.GtkProgressflag0 and bm_TGtkProgress_activity_mode) shr
+      bp_TGtkProgress_activity_mode
+
+proc set_activity_mode*(a: var TGtkProgress, `activity_mode`: guint) =
+  a.GtkProgressflag0 = a.GtkProgressflag0 or
+      ((`activity_mode` shl bp_TGtkProgress_activity_mode) and
+      bm_TGtkProgress_activity_mode)
+
+proc use_text_format*(a: var TGtkProgress): guint =
+  result = (a.GtkProgressflag0 and bm_TGtkProgress_use_text_format) shr
+      bp_TGtkProgress_use_text_format
+
+proc set_use_text_format*(a: var TGtkProgress, `use_text_format`: guint) =
+  a.GtkProgressflag0 = a.GtkProgressflag0 or
+      ((`use_text_format` shl bp_TGtkProgress_use_text_format) and
+      bm_TGtkProgress_use_text_format)
+
+proc GTK_TYPE_PROGRESS_BAR*(): GType =
+  result = gtk_progress_bar_get_type()
+
+proc GTK_PROGRESS_BAR*(obj: pointer): PGtkProgressBar =
+  result = cast[PGtkProgressBar](GTK_CHECK_CAST(obj, GTK_TYPE_PROGRESS_BAR()))
+
+proc GTK_PROGRESS_BAR_CLASS*(klass: pointer): PGtkProgressBarClass =
+  result = cast[PGtkProgressBarClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_PROGRESS_BAR()))
+
+proc GTK_IS_PROGRESS_BAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_PROGRESS_BAR())
+
+proc GTK_IS_PROGRESS_BAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_PROGRESS_BAR())
+
+proc GTK_PROGRESS_BAR_GET_CLASS*(obj: pointer): PGtkProgressBarClass =
+  result = cast[PGtkProgressBarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_PROGRESS_BAR()))
+
+proc activity_dir*(a: var TGtkProgressBar): guint =
+  result = (a.GtkProgressBarflag0 and bm_TGtkProgressBar_activity_dir) shr
+      bp_TGtkProgressBar_activity_dir
+
+proc set_activity_dir*(a: var TGtkProgressBar, `activity_dir`: guint) =
+  a.GtkProgressBarflag0 = a.GtkProgressBarflag0 or
+      ((`activity_dir` shl bp_TGtkProgressBar_activity_dir) and
+      bm_TGtkProgressBar_activity_dir)
+
+proc GTK_TYPE_RADIO_BUTTON*(): GType =
+  result = gtk_radio_button_get_type()
+
+proc GTK_RADIO_BUTTON*(obj: pointer): PGtkRadioButton =
+  result = cast[PGtkRadioButton](GTK_CHECK_CAST(obj, GTK_TYPE_RADIO_BUTTON()))
+
+proc GTK_RADIO_BUTTON_CLASS*(klass: pointer): PGtkRadioButtonClass =
+  result = cast[PGtkRadioButtonClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_RADIO_BUTTON()))
+
+proc GTK_IS_RADIO_BUTTON*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_RADIO_BUTTON())
+
+proc GTK_IS_RADIO_BUTTON_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_RADIO_BUTTON())
+
+proc GTK_RADIO_BUTTON_GET_CLASS*(obj: pointer): PGtkRadioButtonClass =
+  result = cast[PGtkRadioButtonClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_RADIO_BUTTON()))
+
+proc GTK_TYPE_RADIO_MENU_ITEM*(): GType =
+  result = gtk_radio_menu_item_get_type()
+
+proc GTK_RADIO_MENU_ITEM*(obj: pointer): PGtkRadioMenuItem =
+  result = cast[PGtkRadioMenuItem](GTK_CHECK_CAST(obj, GTK_TYPE_RADIO_MENU_ITEM()))
+
+proc GTK_RADIO_MENU_ITEM_CLASS*(klass: pointer): PGtkRadioMenuItemClass =
+  result = cast[PGtkRadioMenuItemClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_RADIO_MENU_ITEM()))
+
+proc GTK_IS_RADIO_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_RADIO_MENU_ITEM())
+
+proc GTK_IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_RADIO_MENU_ITEM())
+
+proc GTK_RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkRadioMenuItemClass =
+  result = cast[PGtkRadioMenuItemClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_RADIO_MENU_ITEM()))
+
+proc GTK_TYPE_SCROLLED_WINDOW*(): GType =
+  result = gtk_scrolled_window_get_type()
+
+proc GTK_SCROLLED_WINDOW*(obj: pointer): PGtkScrolledWindow =
+  result = cast[PGtkScrolledWindow](GTK_CHECK_CAST(obj, GTK_TYPE_SCROLLED_WINDOW()))
+
+proc GTK_SCROLLED_WINDOW_CLASS*(klass: pointer): PGtkScrolledWindowClass =
+  result = cast[PGtkScrolledWindowClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_SCROLLED_WINDOW()))
+
+proc GTK_IS_SCROLLED_WINDOW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SCROLLED_WINDOW())
+
+proc GTK_IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SCROLLED_WINDOW())
+
+proc GTK_SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PGtkScrolledWindowClass =
+  result = cast[PGtkScrolledWindowClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_SCROLLED_WINDOW()))
+
+proc hscrollbar_policy*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_hscrollbar_policy) shr
+      bp_TGtkScrolledWindow_hscrollbar_policy
+
+proc set_hscrollbar_policy*(a: var TGtkScrolledWindow,
+                            `hscrollbar_policy`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`hscrollbar_policy` shl bp_TGtkScrolledWindow_hscrollbar_policy) and
+      bm_TGtkScrolledWindow_hscrollbar_policy)
+
+proc vscrollbar_policy*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_vscrollbar_policy) shr
+      bp_TGtkScrolledWindow_vscrollbar_policy
+
+proc set_vscrollbar_policy*(a: var TGtkScrolledWindow,
+                            `vscrollbar_policy`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`vscrollbar_policy` shl bp_TGtkScrolledWindow_vscrollbar_policy) and
+      bm_TGtkScrolledWindow_vscrollbar_policy)
+
+proc hscrollbar_visible*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_hscrollbar_visible) shr
+      bp_TGtkScrolledWindow_hscrollbar_visible
+
+proc set_hscrollbar_visible*(a: var TGtkScrolledWindow,
+                             `hscrollbar_visible`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`hscrollbar_visible` shl bp_TGtkScrolledWindow_hscrollbar_visible) and
+      bm_TGtkScrolledWindow_hscrollbar_visible)
+
+proc vscrollbar_visible*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_vscrollbar_visible) shr
+      bp_TGtkScrolledWindow_vscrollbar_visible
+
+proc set_vscrollbar_visible*(a: var TGtkScrolledWindow,
+                             `vscrollbar_visible`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`vscrollbar_visible` shl bp_TGtkScrolledWindow_vscrollbar_visible) and
+      bm_TGtkScrolledWindow_vscrollbar_visible)
+
+proc window_placement*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_window_placement) shr
+      bp_TGtkScrolledWindow_window_placement
+
+proc set_window_placement*(a: var TGtkScrolledWindow, `window_placement`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`window_placement` shl bp_TGtkScrolledWindow_window_placement) and
+      bm_TGtkScrolledWindow_window_placement)
+
+proc focus_out*(a: var TGtkScrolledWindow): guint =
+  result = (a.GtkScrolledWindowflag0 and bm_TGtkScrolledWindow_focus_out) shr
+      bp_TGtkScrolledWindow_focus_out
+
+proc set_focus_out*(a: var TGtkScrolledWindow, `focus_out`: guint) =
+  a.GtkScrolledWindowflag0 = a.GtkScrolledWindowflag0 or
+      ((`focus_out` shl bp_TGtkScrolledWindow_focus_out) and
+      bm_TGtkScrolledWindow_focus_out)
+
+proc GTK_TYPE_SELECTION_DATA*(): GType =
+  result = gtk_selection_data_get_type()
+
+proc GTK_TYPE_SEPARATOR_MENU_ITEM*(): GType =
+  result = gtk_separator_menu_item_get_type()
+
+proc GTK_SEPARATOR_MENU_ITEM*(obj: pointer): PGtkSeparatorMenuItem =
+  result = cast[PGtkSeparatorMenuItem](GTK_CHECK_CAST(obj,
+      GTK_TYPE_SEPARATOR_MENU_ITEM()))
+
+proc GTK_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PGtkSeparatorMenuItemClass =
+  result = cast[PGtkSeparatorMenuItemClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_SEPARATOR_MENU_ITEM()))
+
+proc GTK_IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SEPARATOR_MENU_ITEM())
+
+proc GTK_IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SEPARATOR_MENU_ITEM())
+
+proc GTK_SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkSeparatorMenuItemClass =
+  result = cast[PGtkSeparatorMenuItemClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_SEPARATOR_MENU_ITEM()))
+
+proc gtk_signal_lookup*(name: cstring, object_type: GType): guint =
+  result = g_signal_lookup(name, object_type)
+
+proc gtk_signal_name*(signal_id: guint): cstring =
+  result = g_signal_name(signal_id)
+
+proc gtk_signal_emit_stop*(instance: gpointer, signal_id: guint, detail: TGQuark) =
+  if detail != 0: g_signal_stop_emission(instance, signal_id, 0)
+
+proc gtk_signal_connect_full*(anObject: PGtkObject, name: cstring,
+                         func_: TGtkSignalFunc, unknown1: pointer,
+                         func_data: gpointer, unknown2: pointer,
+                         unknown3, unknown4: int): gulong {.
+  importc, cdecl, dynlib: gtklib.}
+
+proc gtk_signal_compat_matched*(anObject: PGtkObject, func_: TGtkSignalFunc,
+                                data: gpointer, m: TGSignalMatchType,
+                                u: int) {.importc, cdecl, dynlib: gtklib.}
+
+proc gtk_signal_connect*(anObject: PGtkObject, name: cstring,
+                         func_: TGtkSignalFunc, func_data: gpointer): gulong =
+  result = gtk_signal_connect_full(anObject, name, func_, nil, func_data, nil,
+                                   0, 0)
+
+proc gtk_signal_connect_after*(anObject: PGtkObject, name: cstring,
+                               func_: TGtkSignalFunc, func_data: gpointer): gulong =
+  result = gtk_signal_connect_full(anObject, name, func_, nil, func_data, nil,
+                                   0, 1)
+
+proc gtk_signal_connect_object*(anObject: PGtkObject, name: cstring,
+                                func_: TGtkSignalFunc, slot_object: gpointer): gulong =
+  result = gtk_signal_connect_full(anObject, name, func_, nil, slot_object, nil,
+                                   1, 0)
+
+proc gtk_signal_connect_object_after*(anObject: PGtkObject, name: cstring,
+                                      func_: TGtkSignalFunc,
+                                      slot_object: gpointer): gulong =
+  result = gtk_signal_connect_full(anObject, name, func_, nil, slot_object, nil,
+                                   1, 1)
+
+proc gtk_signal_disconnect*(anObject: gpointer, handler_id: gulong) =
+  g_signal_handler_disconnect(anObject, handler_id)
+
+proc gtk_signal_handler_block*(anObject: gpointer, handler_id: gulong) =
+  g_signal_handler_block(anObject, handler_id)
+
+proc gtk_signal_handler_unblock*(anObject: gpointer, handler_id: gulong) =
+  g_signal_handler_unblock(anObject, handler_id)
+
+proc gtk_signal_disconnect_by_data*(anObject: PGtkObject, data: gpointer) =
+  gtk_signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 0)
+
+proc gtk_signal_disconnect_by_func*(anObject: PGtkObject, func_: TGtkSignalFunc,
+                                    data: gpointer) =
+  gtk_signal_compat_matched(anObject, func_, data, cast[TGSignalMatchType](
+      G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0)
+
+proc gtk_signal_handler_block_by_func*(anObject: PGtkObject,
+                                       func_: TGtkSignalFunc, data: gpointer) =
+  gtk_signal_compat_matched(anObject, func_, data, TGSignalMatchType(
+      G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0)
+
+proc gtk_signal_handler_block_by_data*(anObject: PGtkObject, data: gpointer) =
+  gtk_signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 1)
+
+proc gtk_signal_handler_unblock_by_func*(anObject: PGtkObject,
+    func_: TGtkSignalFunc, data: gpointer) =
+  gtk_signal_compat_matched(anObject, func_, data, cast[TGSignalMatchType](
+      G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0)
+
+proc gtk_signal_handler_unblock_by_data*(anObject: PGtkObject, data: gpointer) =
+  gtk_signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 2)
+
+proc gtk_signal_handler_pending*(anObject: PGtkObject, signal_id: guint,
+                                 may_be_blocked: gboolean): gboolean =
+  Result = g_signal_has_handler_pending(anObject, signal_id, 0, may_be_blocked)
+
+proc gtk_signal_handler_pending_by_func*(anObject: PGtkObject, signal_id: guint,
+    may_be_blocked: gboolean, func_: TGtkSignalFunc, data: gpointer): gboolean =
+  var t: TGSignalMatchType
+  t = cast[TGSignalMatchType](G_SIGNAL_MATCH_ID or G_SIGNAL_MATCH_FUNC or
+      G_SIGNAL_MATCH_DATA)
+  if not may_be_blocked:
+    t = t or cast[int](G_SIGNAL_MATCH_UNBLOCKED)
+  Result = g_signal_handler_find(anObject, t, signal_id, 0, nil, addr(func_),
+                                 data) != 0
+
+proc GTK_TYPE_SIZE_GROUP*(): GType =
+  result = gtk_size_group_get_type()
+
+proc GTK_SIZE_GROUP*(obj: pointer): PGtkSizeGroup =
+  result = cast[PGtkSizeGroup](GTK_CHECK_CAST(obj, GTK_TYPE_SIZE_GROUP()))
+
+proc GTK_SIZE_GROUP_CLASS*(klass: pointer): PGtkSizeGroupClass =
+  result = cast[PGtkSizeGroupClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SIZE_GROUP()))
+
+proc GTK_IS_SIZE_GROUP*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SIZE_GROUP())
+
+proc GTK_IS_SIZE_GROUP_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SIZE_GROUP())
+
+proc GTK_SIZE_GROUP_GET_CLASS*(obj: pointer): PGtkSizeGroupClass =
+  result = cast[PGtkSizeGroupClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SIZE_GROUP()))
+
+proc have_width*(a: var TGtkSizeGroup): guint =
+  result = (a.GtkSizeGroupflag0 and bm_TGtkSizeGroup_have_width) shr
+      bp_TGtkSizeGroup_have_width
+
+proc set_have_width*(a: var TGtkSizeGroup, `have_width`: guint) =
+  a.GtkSizeGroupflag0 = a.GtkSizeGroupflag0 or
+      ((`have_width` shl bp_TGtkSizeGroup_have_width) and
+      bm_TGtkSizeGroup_have_width)
+
+proc have_height*(a: var TGtkSizeGroup): guint =
+  result = (a.GtkSizeGroupflag0 and bm_TGtkSizeGroup_have_height) shr
+      bp_TGtkSizeGroup_have_height
+
+proc set_have_height*(a: var TGtkSizeGroup, `have_height`: guint) =
+  a.GtkSizeGroupflag0 = a.GtkSizeGroupflag0 or
+      ((`have_height` shl bp_TGtkSizeGroup_have_height) and
+      bm_TGtkSizeGroup_have_height)
+
+proc GTK_TYPE_SOCKET*(): GType =
+  result = gtk_socket_get_type()
+
+proc GTK_SOCKET*(obj: pointer): PGtkSocket =
+  result = cast[PGtkSocket](GTK_CHECK_CAST(obj, GTK_TYPE_SOCKET()))
+
+proc GTK_SOCKET_CLASS*(klass: pointer): PGtkSocketClass =
+  result = cast[PGtkSocketClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SOCKET()))
+
+proc GTK_IS_SOCKET*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SOCKET())
+
+proc GTK_IS_SOCKET_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SOCKET())
+
+proc GTK_SOCKET_GET_CLASS*(obj: pointer): PGtkSocketClass =
+  result = cast[PGtkSocketClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SOCKET()))
+
+proc same_app*(a: var TGtkSocket): guint =
+  result = (a.GtkSocketflag0 and bm_TGtkSocket_same_app) shr bp_TGtkSocket_same_app
+
+proc set_same_app*(a: var TGtkSocket, `same_app`: guint) =
+  a.GtkSocketflag0 = a.GtkSocketflag0 or
+      ((`same_app` shl bp_TGtkSocket_same_app) and bm_TGtkSocket_same_app)
+
+proc focus_in*(a: var TGtkSocket): guint =
+  result = (a.GtkSocketflag0 and bm_TGtkSocket_focus_in) shr bp_TGtkSocket_focus_in
+
+proc set_focus_in*(a: var TGtkSocket, `focus_in`: guint) =
+  a.GtkSocketflag0 = a.GtkSocketflag0 or
+      ((`focus_in` shl bp_TGtkSocket_focus_in) and bm_TGtkSocket_focus_in)
+
+proc have_size*(a: var TGtkSocket): guint =
+  result = (a.GtkSocketflag0 and bm_TGtkSocket_have_size) shr bp_TGtkSocket_have_size
+
+proc set_have_size*(a: var TGtkSocket, `have_size`: guint) =
+  a.GtkSocketflag0 = a.GtkSocketflag0 or
+      ((`have_size` shl bp_TGtkSocket_have_size) and bm_TGtkSocket_have_size)
+
+proc need_map*(a: var TGtkSocket): guint =
+  result = (a.GtkSocketflag0 and bm_TGtkSocket_need_map) shr bp_TGtkSocket_need_map
+
+proc set_need_map*(a: var TGtkSocket, `need_map`: guint) =
+  a.GtkSocketflag0 = a.GtkSocketflag0 or
+      ((`need_map` shl bp_TGtkSocket_need_map) and bm_TGtkSocket_need_map)
+
+proc is_mapped*(a: var TGtkSocket): guint =
+  result = (a.GtkSocketflag0 and bm_TGtkSocket_is_mapped) shr bp_TGtkSocket_is_mapped
+
+proc set_is_mapped*(a: var TGtkSocket, `is_mapped`: guint) =
+  a.GtkSocketflag0 = a.GtkSocketflag0 or
+      ((`is_mapped` shl bp_TGtkSocket_is_mapped) and bm_TGtkSocket_is_mapped)
+
+proc GTK_TYPE_SPIN_BUTTON*(): GType =
+  result = gtk_spin_button_get_type()
+
+proc GTK_SPIN_BUTTON*(obj: pointer): PGtkSpinButton =
+  result = cast[PGtkSpinButton](GTK_CHECK_CAST(obj, GTK_TYPE_SPIN_BUTTON()))
+
+proc GTK_SPIN_BUTTON_CLASS*(klass: pointer): PGtkSpinButtonClass =
+  result = cast[PGtkSpinButtonClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_SPIN_BUTTON()))
+
+proc GTK_IS_SPIN_BUTTON*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_SPIN_BUTTON())
+
+proc GTK_IS_SPIN_BUTTON_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_SPIN_BUTTON())
+
+proc GTK_SPIN_BUTTON_GET_CLASS*(obj: pointer): PGtkSpinButtonClass =
+  result = cast[PGtkSpinButtonClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_SPIN_BUTTON()))
+
+proc in_child*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_in_child) shr
+      bp_TGtkSpinButton_in_child
+
+proc set_in_child*(a: var TGtkSpinButton, `in_child`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`in_child` shl bp_TGtkSpinButton_in_child) and
+      bm_TGtkSpinButton_in_child)
+
+proc click_child*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_click_child) shr
+      bp_TGtkSpinButton_click_child
+
+proc set_click_child*(a: var TGtkSpinButton, `click_child`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`click_child` shl bp_TGtkSpinButton_click_child) and
+      bm_TGtkSpinButton_click_child)
+
+proc button*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_button) shr
+      bp_TGtkSpinButton_button
+
+proc set_button*(a: var TGtkSpinButton, `button`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`button` shl bp_TGtkSpinButton_button) and bm_TGtkSpinButton_button)
+
+proc need_timer*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_need_timer) shr
+      bp_TGtkSpinButton_need_timer
+
+proc set_need_timer*(a: var TGtkSpinButton, `need_timer`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`need_timer` shl bp_TGtkSpinButton_need_timer) and
+      bm_TGtkSpinButton_need_timer)
+
+proc timer_calls*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_timer_calls) shr
+      bp_TGtkSpinButton_timer_calls
+
+proc set_timer_calls*(a: var TGtkSpinButton, `timer_calls`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`timer_calls` shl bp_TGtkSpinButton_timer_calls) and
+      bm_TGtkSpinButton_timer_calls)
+
+proc digits*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_digits) shr
+      bp_TGtkSpinButton_digits
+
+proc set_digits*(a: var TGtkSpinButton, `digits`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`digits` shl bp_TGtkSpinButton_digits) and bm_TGtkSpinButton_digits)
+
+proc numeric*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_numeric) shr
+      bp_TGtkSpinButton_numeric
+
+proc set_numeric*(a: var TGtkSpinButton, `numeric`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`numeric` shl bp_TGtkSpinButton_numeric) and
+      bm_TGtkSpinButton_numeric)
+
+proc wrap*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_wrap) shr bp_TGtkSpinButton_wrap
+
+proc set_wrap*(a: var TGtkSpinButton, `wrap`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`wrap` shl bp_TGtkSpinButton_wrap) and bm_TGtkSpinButton_wrap)
+
+proc snap_to_ticks*(a: var TGtkSpinButton): guint =
+  result = (a.GtkSpinButtonflag0 and bm_TGtkSpinButton_snap_to_ticks) shr
+      bp_TGtkSpinButton_snap_to_ticks
+
+proc set_snap_to_ticks*(a: var TGtkSpinButton, `snap_to_ticks`: guint) =
+  a.GtkSpinButtonflag0 = a.GtkSpinButtonflag0 or
+      ((`snap_to_ticks` shl bp_TGtkSpinButton_snap_to_ticks) and
+      bm_TGtkSpinButton_snap_to_ticks)
+
+proc GTK_TYPE_STATUSBAR*(): GType =
+  result = gtk_statusbar_get_type()
+
+proc GTK_STATUSBAR*(obj: pointer): PGtkStatusbar =
+  result = cast[PGtkStatusbar](GTK_CHECK_CAST(obj, GTK_TYPE_STATUSBAR()))
+
+proc GTK_STATUSBAR_CLASS*(klass: pointer): PGtkStatusbarClass =
+  result = cast[PGtkStatusbarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_STATUSBAR()))
+
+proc GTK_IS_STATUSBAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_STATUSBAR())
+
+proc GTK_IS_STATUSBAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_STATUSBAR())
+
+proc GTK_STATUSBAR_GET_CLASS*(obj: pointer): PGtkStatusbarClass =
+  result = cast[PGtkStatusbarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_STATUSBAR()))
+
+proc has_resize_grip*(a: var TGtkStatusbar): guint =
+  result = (a.GtkStatusbarflag0 and bm_TGtkStatusbar_has_resize_grip) shr
+      bp_TGtkStatusbar_has_resize_grip
+
+proc set_has_resize_grip*(a: var TGtkStatusbar, `has_resize_grip`: guint) =
+  a.GtkStatusbarflag0 = a.GtkStatusbarflag0 or
+      ((`has_resize_grip` shl bp_TGtkStatusbar_has_resize_grip) and
+      bm_TGtkStatusbar_has_resize_grip)
+
+proc GTK_TYPE_TABLE*(): GType =
+  result = gtk_table_get_type()
+
+proc GTK_TABLE*(obj: pointer): PGtkTable =
+  result = cast[PGtkTable](GTK_CHECK_CAST(obj, GTK_TYPE_TABLE()))
+
+proc GTK_TABLE_CLASS*(klass: pointer): PGtkTableClass =
+  result = cast[PGtkTableClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TABLE()))
+
+proc GTK_IS_TABLE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TABLE())
+
+proc GTK_IS_TABLE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TABLE())
+
+proc GTK_TABLE_GET_CLASS*(obj: pointer): PGtkTableClass =
+  result = cast[PGtkTableClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TABLE()))
+
+proc homogeneous*(a: var TGtkTable): guint =
+  result = (a.GtkTableflag0 and bm_TGtkTable_homogeneous) shr
+      bp_TGtkTable_homogeneous
+
+proc set_homogeneous*(a: var TGtkTable, `homogeneous`: guint) =
+  a.GtkTableflag0 = a.GtkTableflag0 or
+      ((`homogeneous` shl bp_TGtkTable_homogeneous) and
+      bm_TGtkTable_homogeneous)
+
+proc xexpand*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_xexpand) shr
+      bp_TGtkTableChild_xexpand
+
+proc set_xexpand*(a: var TGtkTableChild, `xexpand`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`xexpand` shl bp_TGtkTableChild_xexpand) and
+      bm_TGtkTableChild_xexpand)
+
+proc yexpand*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_yexpand) shr
+      bp_TGtkTableChild_yexpand
+
+proc set_yexpand*(a: var TGtkTableChild, `yexpand`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`yexpand` shl bp_TGtkTableChild_yexpand) and
+      bm_TGtkTableChild_yexpand)
+
+proc xshrink*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_xshrink) shr
+      bp_TGtkTableChild_xshrink
+
+proc set_xshrink*(a: var TGtkTableChild, `xshrink`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`xshrink` shl bp_TGtkTableChild_xshrink) and
+      bm_TGtkTableChild_xshrink)
+
+proc yshrink*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_yshrink) shr
+      bp_TGtkTableChild_yshrink
+
+proc set_yshrink*(a: var TGtkTableChild, `yshrink`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`yshrink` shl bp_TGtkTableChild_yshrink) and
+      bm_TGtkTableChild_yshrink)
+
+proc xfill*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_xfill) shr bp_TGtkTableChild_xfill
+
+proc set_xfill*(a: var TGtkTableChild, `xfill`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`xfill` shl bp_TGtkTableChild_xfill) and bm_TGtkTableChild_xfill)
+
+proc yfill*(a: var TGtkTableChild): guint =
+  result = (a.GtkTableChildflag0 and bm_TGtkTableChild_yfill) shr bp_TGtkTableChild_yfill
+
+proc set_yfill*(a: var TGtkTableChild, `yfill`: guint) =
+  a.GtkTableChildflag0 = a.GtkTableChildflag0 or
+      ((`yfill` shl bp_TGtkTableChild_yfill) and bm_TGtkTableChild_yfill)
+
+proc need_expand*(a: var TGtkTableRowCol): guint =
+  result = (a.flag0 and bm_TGtkTableRowCol_need_expand) shr
+      bp_TGtkTableRowCol_need_expand
+
+proc set_need_expand*(a: var TGtkTableRowCol, `need_expand`: guint) =
+  a.flag0 = a.flag0 or
+      ((`need_expand` shl bp_TGtkTableRowCol_need_expand) and
+      bm_TGtkTableRowCol_need_expand)
+
+proc need_shrink*(a: var TGtkTableRowCol): guint =
+  result = (a.flag0 and bm_TGtkTableRowCol_need_shrink) shr
+      bp_TGtkTableRowCol_need_shrink
+
+proc set_need_shrink*(a: var TGtkTableRowCol, `need_shrink`: guint) =
+  a.flag0 = a.flag0 or
+      ((`need_shrink` shl bp_TGtkTableRowCol_need_shrink) and
+      bm_TGtkTableRowCol_need_shrink)
+
+proc expand*(a: var TGtkTableRowCol): guint =
+  result = (a.flag0 and bm_TGtkTableRowCol_expand) shr
+      bp_TGtkTableRowCol_expand
+
+proc set_expand*(a: var TGtkTableRowCol, `expand`: guint) =
+  a.flag0 = a.flag0 or
+      ((`expand` shl bp_TGtkTableRowCol_expand) and bm_TGtkTableRowCol_expand)
+
+proc shrink*(a: var TGtkTableRowCol): guint =
+  result = (a.flag0 and bm_TGtkTableRowCol_shrink) shr
+      bp_TGtkTableRowCol_shrink
+
+proc set_shrink*(a: var TGtkTableRowCol, `shrink`: guint) =
+  a.flag0 = a.flag0 or
+      ((`shrink` shl bp_TGtkTableRowCol_shrink) and bm_TGtkTableRowCol_shrink)
+
+proc empty*(a: var TGtkTableRowCol): guint =
+  result = (a.flag0 and bm_TGtkTableRowCol_empty) shr
+      bp_TGtkTableRowCol_empty
+
+proc set_empty*(a: var TGtkTableRowCol, `empty`: guint) =
+  a.flag0 = a.flag0 or
+      ((`empty` shl bp_TGtkTableRowCol_empty) and bm_TGtkTableRowCol_empty)
+
+proc GTK_TYPE_TEAROFF_MENU_ITEM*(): GType =
+  result = gtk_tearoff_menu_item_get_type()
+
+proc GTK_TEAROFF_MENU_ITEM*(obj: pointer): PGtkTearoffMenuItem =
+  result = cast[PGtkTearoffMenuItem](GTK_CHECK_CAST(obj, GTK_TYPE_TEAROFF_MENU_ITEM()))
+
+proc GTK_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PGtkTearoffMenuItemClass =
+  result = cast[PGtkTearoffMenuItemClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TEAROFF_MENU_ITEM()))
+
+proc GTK_IS_TEAROFF_MENU_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TEAROFF_MENU_ITEM())
+
+proc GTK_IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEAROFF_MENU_ITEM())
+
+proc GTK_TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PGtkTearoffMenuItemClass =
+  result = cast[PGtkTearoffMenuItemClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TEAROFF_MENU_ITEM()))
+
+proc torn_off*(a: var TGtkTearoffMenuItem): guint =
+  result = (a.GtkTearoffMenuItemflag0 and bm_TGtkTearoffMenuItem_torn_off) shr
+      bp_TGtkTearoffMenuItem_torn_off
+
+proc set_torn_off*(a: var TGtkTearoffMenuItem, `torn_off`: guint) =
+  a.GtkTearoffMenuItemflag0 = a.GtkTearoffMenuItemflag0 or
+      ((`torn_off` shl bp_TGtkTearoffMenuItem_torn_off) and
+      bm_TGtkTearoffMenuItem_torn_off)
+
+proc GTK_TYPE_TEXT*(): GType =
+  result = gtk_text_get_type()
+
+proc GTK_TEXT*(obj: pointer): PGtkText =
+  result = cast[PGtkText](GTK_CHECK_CAST(obj, GTK_TYPE_TEXT()))
+
+proc GTK_TEXT_CLASS*(klass: pointer): PGtkTextClass =
+  result = cast[PGtkTextClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TEXT()))
+
+proc GTK_IS_TEXT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TEXT())
+
+proc GTK_IS_TEXT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT())
+
+proc GTK_TEXT_GET_CLASS*(obj: pointer): PGtkTextClass =
+  result = cast[PGtkTextClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TEXT()))
+
+proc line_wrap*(a: PGtkText): guint =
+  result = (a.GtkTextflag0 and bm_TGtkText_line_wrap) shr bp_TGtkText_line_wrap
+
+proc set_line_wrap*(a: PGtkText, `line_wrap`: guint) =
+  a.GtkTextflag0 = a.GtkTextflag0 or
+      ((`line_wrap` shl bp_TGtkText_line_wrap) and bm_TGtkText_line_wrap)
+
+proc word_wrap*(a: PGtkText): guint =
+  result = (a . GtkTextflag0 and bm_TGtkText_word_wrap) shr bp_TGtkText_word_wrap
+
+proc set_word_wrap*(a: PGtkText, `word_wrap`: guint) =
+  a.GtkTextflag0 = a.GtkTextflag0 or
+      ((`word_wrap` shl bp_TGtkText_word_wrap) and bm_TGtkText_word_wrap)
+
+proc use_wchar*(a: PGtkText): gboolean =
+  result = ((a.GtkTextflag0 and bm_TGtkText_use_wchar) shr bp_TGtkText_use_wchar) >
+      0
+
+proc set_use_wchar*(a: PGtkText, `use_wchar`: gboolean) =
+  if `use_wchar`:
+    a . GtkTextflag0 = a . GtkTextflag0 or bm_TGtkText_use_wchar
+  else:
+    a . GtkTextflag0 = a . GtkTextflag0 and not bm_TGtkText_use_wchar
+
+proc GTK_TEXT_INDEX_WCHAR*(t: PGtkText, index: guint): guint32 =
+  nil
+
+proc GTK_TEXT_INDEX_UCHAR*(t: PGtkText, index: guint): GUChar =
+  nil
+
+proc GTK_TYPE_TEXT_ITER*(): GType =
+  result = gtk_text_iter_get_type()
+
+proc GTK_TYPE_TEXT_TAG*(): GType =
+  result = gtk_text_tag_get_type()
+
+proc GTK_TEXT_TAG*(obj: pointer): PGtkTextTag =
+  result = cast[PGtkTextTag](G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TEXT_TAG()))
+
+proc GTK_TEXT_TAG_CLASS*(klass: pointer): PGtkTextTagClass =
+  result = cast[PGtkTextTagClass](G_TYPE_CHECK_CLASS_CAST(klass, GTK_TYPE_TEXT_TAG()))
+
+proc GTK_IS_TEXT_TAG*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TEXT_TAG())
+
+proc GTK_IS_TEXT_TAG_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_TAG())
+
+proc GTK_TEXT_TAG_GET_CLASS*(obj: pointer): PGtkTextTagClass =
+  result = cast[PGtkTextTagClass](G_TYPE_INSTANCE_GET_CLASS(obj, GTK_TYPE_TEXT_TAG()))
+
+proc GTK_TYPE_TEXT_ATTRIBUTES*(): GType =
+  result = gtk_text_attributes_get_type()
+
+proc bg_color_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_bg_color_set) shr
+      bp_TGtkTextTag_bg_color_set
+
+proc set_bg_color_set*(a: var TGtkTextTag, `bg_color_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`bg_color_set` shl bp_TGtkTextTag_bg_color_set) and
+      bm_TGtkTextTag_bg_color_set)
+
+proc bg_stipple_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_bg_stipple_set) shr
+      bp_TGtkTextTag_bg_stipple_set
+
+proc set_bg_stipple_set*(a: var TGtkTextTag, `bg_stipple_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`bg_stipple_set` shl bp_TGtkTextTag_bg_stipple_set) and
+      bm_TGtkTextTag_bg_stipple_set)
+
+proc fg_color_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_fg_color_set) shr
+      bp_TGtkTextTag_fg_color_set
+
+proc set_fg_color_set*(a: var TGtkTextTag, `fg_color_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`fg_color_set` shl bp_TGtkTextTag_fg_color_set) and
+      bm_TGtkTextTag_fg_color_set)
+
+proc scale_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_scale_set) shr
+      bp_TGtkTextTag_scale_set
+
+proc set_scale_set*(a: var TGtkTextTag, `scale_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`scale_set` shl bp_TGtkTextTag_scale_set) and
+      bm_TGtkTextTag_scale_set)
+
+proc fg_stipple_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_fg_stipple_set) shr
+      bp_TGtkTextTag_fg_stipple_set
+
+proc set_fg_stipple_set*(a: var TGtkTextTag, `fg_stipple_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`fg_stipple_set` shl bp_TGtkTextTag_fg_stipple_set) and
+      bm_TGtkTextTag_fg_stipple_set)
+
+proc justification_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_justification_set) shr
+      bp_TGtkTextTag_justification_set
+
+proc set_justification_set*(a: var TGtkTextTag, `justification_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`justification_set` shl bp_TGtkTextTag_justification_set) and
+      bm_TGtkTextTag_justification_set)
+
+proc left_margin_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_left_margin_set) shr
+      bp_TGtkTextTag_left_margin_set
+
+proc set_left_margin_set*(a: var TGtkTextTag, `left_margin_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`left_margin_set` shl bp_TGtkTextTag_left_margin_set) and
+      bm_TGtkTextTag_left_margin_set)
+
+proc indent_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_indent_set) shr
+      bp_TGtkTextTag_indent_set
+
+proc set_indent_set*(a: var TGtkTextTag, `indent_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`indent_set` shl bp_TGtkTextTag_indent_set) and
+      bm_TGtkTextTag_indent_set)
+
+proc rise_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_rise_set) shr bp_TGtkTextTag_rise_set
+
+proc set_rise_set*(a: var TGtkTextTag, `rise_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`rise_set` shl bp_TGtkTextTag_rise_set) and bm_TGtkTextTag_rise_set)
+
+proc strikethrough_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_strikethrough_set) shr
+      bp_TGtkTextTag_strikethrough_set
+
+proc set_strikethrough_set*(a: var TGtkTextTag, `strikethrough_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`strikethrough_set` shl bp_TGtkTextTag_strikethrough_set) and
+      bm_TGtkTextTag_strikethrough_set)
+
+proc right_margin_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_right_margin_set) shr
+      bp_TGtkTextTag_right_margin_set
+
+proc set_right_margin_set*(a: var TGtkTextTag, `right_margin_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`right_margin_set` shl bp_TGtkTextTag_right_margin_set) and
+      bm_TGtkTextTag_right_margin_set)
+
+proc pixels_above_lines_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pixels_above_lines_set) shr
+      bp_TGtkTextTag_pixels_above_lines_set
+
+proc set_pixels_above_lines_set*(a: var TGtkTextTag,
+                                 `pixels_above_lines_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pixels_above_lines_set` shl bp_TGtkTextTag_pixels_above_lines_set) and
+      bm_TGtkTextTag_pixels_above_lines_set)
+
+proc pixels_below_lines_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pixels_below_lines_set) shr
+      bp_TGtkTextTag_pixels_below_lines_set
+
+proc set_pixels_below_lines_set*(a: var TGtkTextTag,
+                                 `pixels_below_lines_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pixels_below_lines_set` shl bp_TGtkTextTag_pixels_below_lines_set) and
+      bm_TGtkTextTag_pixels_below_lines_set)
+
+proc pixels_inside_wrap_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pixels_inside_wrap_set) shr
+      bp_TGtkTextTag_pixels_inside_wrap_set
+
+proc set_pixels_inside_wrap_set*(a: var TGtkTextTag,
+                                 `pixels_inside_wrap_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pixels_inside_wrap_set` shl bp_TGtkTextTag_pixels_inside_wrap_set) and
+      bm_TGtkTextTag_pixels_inside_wrap_set)
+
+proc tabs_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_tabs_set) shr bp_TGtkTextTag_tabs_set
+
+proc set_tabs_set*(a: var TGtkTextTag, `tabs_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`tabs_set` shl bp_TGtkTextTag_tabs_set) and bm_TGtkTextTag_tabs_set)
+
+proc underline_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_underline_set) shr
+      bp_TGtkTextTag_underline_set
+
+proc set_underline_set*(a: var TGtkTextTag, `underline_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`underline_set` shl bp_TGtkTextTag_underline_set) and
+      bm_TGtkTextTag_underline_set)
+
+proc wrap_mode_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_wrap_mode_set) shr
+      bp_TGtkTextTag_wrap_mode_set
+
+proc set_wrap_mode_set*(a: var TGtkTextTag, `wrap_mode_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`wrap_mode_set` shl bp_TGtkTextTag_wrap_mode_set) and
+      bm_TGtkTextTag_wrap_mode_set)
+
+proc bg_full_height_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_bg_full_height_set) shr
+      bp_TGtkTextTag_bg_full_height_set
+
+proc set_bg_full_height_set*(a: var TGtkTextTag, `bg_full_height_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`bg_full_height_set` shl bp_TGtkTextTag_bg_full_height_set) and
+      bm_TGtkTextTag_bg_full_height_set)
+
+proc invisible_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_invisible_set) shr
+      bp_TGtkTextTag_invisible_set
+
+proc set_invisible_set*(a: var TGtkTextTag, `invisible_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`invisible_set` shl bp_TGtkTextTag_invisible_set) and
+      bm_TGtkTextTag_invisible_set)
+
+proc editable_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_editable_set) shr
+      bp_TGtkTextTag_editable_set
+
+proc set_editable_set*(a: var TGtkTextTag, `editable_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`editable_set` shl bp_TGtkTextTag_editable_set) and
+      bm_TGtkTextTag_editable_set)
+
+proc language_set*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_language_set) shr
+      bp_TGtkTextTag_language_set
+
+proc set_language_set*(a: var TGtkTextTag, `language_set`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`language_set` shl bp_TGtkTextTag_language_set) and
+      bm_TGtkTextTag_language_set)
+
+proc pad1*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pad1) shr bp_TGtkTextTag_pad1
+
+proc set_pad1*(a: var TGtkTextTag, `pad1`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pad1` shl bp_TGtkTextTag_pad1) and bm_TGtkTextTag_pad1)
+
+proc pad2*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pad2) shr bp_TGtkTextTag_pad2
+
+proc set_pad2*(a: var TGtkTextTag, `pad2`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pad2` shl bp_TGtkTextTag_pad2) and bm_TGtkTextTag_pad2)
+
+proc pad3*(a: var TGtkTextTag): guint =
+  result = (a.GtkTextTagflag0 and bm_TGtkTextTag_pad3) shr bp_TGtkTextTag_pad3
+
+proc set_pad3*(a: var TGtkTextTag, `pad3`: guint) =
+  a.GtkTextTagflag0 = a.GtkTextTagflag0 or
+      ((`pad3` shl bp_TGtkTextTag_pad3) and bm_TGtkTextTag_pad3)
+
+proc underline*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_underline) shr
+      bp_TGtkTextAppearance_underline
+
+proc set_underline*(a: var TGtkTextAppearance, `underline`: guint) =
+  a.flag0 = a.flag0 or
+      ((`underline` shl bp_TGtkTextAppearance_underline) and
+      bm_TGtkTextAppearance_underline)
+
+proc strikethrough*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_strikethrough) shr
+      bp_TGtkTextAppearance_strikethrough
+
+proc set_strikethrough*(a: var TGtkTextAppearance, `strikethrough`: guint) =
+  a.flag0 = a.flag0 or
+      ((`strikethrough` shl bp_TGtkTextAppearance_strikethrough) and
+      bm_TGtkTextAppearance_strikethrough)
+
+proc draw_bg*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_draw_bg) shr
+      bp_TGtkTextAppearance_draw_bg
+
+proc set_draw_bg*(a: var TGtkTextAppearance, `draw_bg`: guint) =
+  a.flag0 = a.flag0 or
+      ((`draw_bg` shl bp_TGtkTextAppearance_draw_bg) and
+      bm_TGtkTextAppearance_draw_bg)
+
+proc inside_selection*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_inside_selection) shr
+      bp_TGtkTextAppearance_inside_selection
+
+proc set_inside_selection*(a: var TGtkTextAppearance, `inside_selection`: guint) =
+  a.flag0 = a.flag0 or
+      ((`inside_selection` shl bp_TGtkTextAppearance_inside_selection) and
+      bm_TGtkTextAppearance_inside_selection)
+
+proc is_text*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_is_text) shr
+      bp_TGtkTextAppearance_is_text
+
+proc set_is_text*(a: var TGtkTextAppearance, `is_text`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_text` shl bp_TGtkTextAppearance_is_text) and
+      bm_TGtkTextAppearance_is_text)
+
+proc pad1*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_pad1) shr
+      bp_TGtkTextAppearance_pad1
+
+proc set_pad1*(a: var TGtkTextAppearance, `pad1`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad1` shl bp_TGtkTextAppearance_pad1) and bm_TGtkTextAppearance_pad1)
+
+proc pad2*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_pad2) shr
+      bp_TGtkTextAppearance_pad2
+
+proc set_pad2*(a: var TGtkTextAppearance, `pad2`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad2` shl bp_TGtkTextAppearance_pad2) and bm_TGtkTextAppearance_pad2)
+
+proc pad3*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_pad3) shr
+      bp_TGtkTextAppearance_pad3
+
+proc set_pad3*(a: var TGtkTextAppearance, `pad3`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad3` shl bp_TGtkTextAppearance_pad3) and bm_TGtkTextAppearance_pad3)
+
+proc pad4*(a: var TGtkTextAppearance): guint =
+  result = (a.flag0 and bm_TGtkTextAppearance_pad4) shr
+      bp_TGtkTextAppearance_pad4
+
+proc set_pad4*(a: var TGtkTextAppearance, `pad4`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad4` shl bp_TGtkTextAppearance_pad4) and bm_TGtkTextAppearance_pad4)
+
+proc invisible*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_invisible) shr
+      bp_TGtkTextAttributes_invisible
+
+proc set_invisible*(a: var TGtkTextAttributes, `invisible`: guint) =
+  a.flag0 = a.flag0 or
+      ((`invisible` shl bp_TGtkTextAttributes_invisible) and
+      bm_TGtkTextAttributes_invisible)
+
+proc bg_full_height*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_bg_full_height) shr
+      bp_TGtkTextAttributes_bg_full_height
+
+proc set_bg_full_height*(a: var TGtkTextAttributes, `bg_full_height`: guint) =
+  a.flag0 = a.flag0 or
+      ((`bg_full_height` shl bp_TGtkTextAttributes_bg_full_height) and
+      bm_TGtkTextAttributes_bg_full_height)
+
+proc editable*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_editable) shr
+      bp_TGtkTextAttributes_editable
+
+proc set_editable*(a: var TGtkTextAttributes, `editable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`editable` shl bp_TGtkTextAttributes_editable) and
+      bm_TGtkTextAttributes_editable)
+
+proc realized*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_realized) shr
+      bp_TGtkTextAttributes_realized
+
+proc set_realized*(a: var TGtkTextAttributes, `realized`: guint) =
+  a.flag0 = a.flag0 or
+      ((`realized` shl bp_TGtkTextAttributes_realized) and
+      bm_TGtkTextAttributes_realized)
+
+proc pad1*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_pad1) shr
+      bp_TGtkTextAttributes_pad1
+
+proc set_pad1*(a: var TGtkTextAttributes, `pad1`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad1` shl bp_TGtkTextAttributes_pad1) and bm_TGtkTextAttributes_pad1)
+
+proc pad2*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_pad2) shr
+      bp_TGtkTextAttributes_pad2
+
+proc set_pad2*(a: var TGtkTextAttributes, `pad2`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad2` shl bp_TGtkTextAttributes_pad2) and bm_TGtkTextAttributes_pad2)
+
+proc pad3*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_pad3) shr
+      bp_TGtkTextAttributes_pad3
+
+proc set_pad3*(a: var TGtkTextAttributes, `pad3`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad3` shl bp_TGtkTextAttributes_pad3) and bm_TGtkTextAttributes_pad3)
+
+proc pad4*(a: var TGtkTextAttributes): guint =
+  result = (a.flag0 and bm_TGtkTextAttributes_pad4) shr
+      bp_TGtkTextAttributes_pad4
+
+proc set_pad4*(a: var TGtkTextAttributes, `pad4`: guint) =
+  a.flag0 = a.flag0 or
+      ((`pad4` shl bp_TGtkTextAttributes_pad4) and bm_TGtkTextAttributes_pad4)
+
+proc GTK_TYPE_TEXT_TAG_TABLE*(): GType =
+  result = gtk_text_tag_table_get_type()
+
+proc GTK_TEXT_TAG_TABLE*(obj: pointer): PGtkTextTagTable =
+  result = cast[PGtkTextTagTable](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      GTK_TYPE_TEXT_TAG_TABLE()))
+
+proc GTK_TEXT_TAG_TABLE_CLASS*(klass: pointer): PGtkTextTagTableClass =
+  result = cast[PGtkTextTagTableClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TEXT_TAG_TABLE()))
+
+proc GTK_IS_TEXT_TAG_TABLE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TEXT_TAG_TABLE())
+
+proc GTK_IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_TAG_TABLE())
+
+proc GTK_TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PGtkTextTagTableClass =
+  result = cast[PGtkTextTagTableClass](G_TYPE_INSTANCE_GET_CLASS(obj, GTK_TYPE_TEXT_TAG_TABLE()))
+
+proc GTK_TYPE_TEXT_MARK*(): GType =
+  result = gtk_text_mark_get_type()
+
+proc GTK_TEXT_MARK*(anObject: pointer): PGtkTextMark =
+  result = cast[PGtkTextMark](G_TYPE_CHECK_INSTANCE_CAST(anObject, GTK_TYPE_TEXT_MARK()))
+
+proc GTK_TEXT_MARK_CLASS*(klass: pointer): PGtkTextMarkClass =
+  result = cast[PGtkTextMarkClass](G_TYPE_CHECK_CLASS_CAST(klass, GTK_TYPE_TEXT_MARK()))
+
+proc GTK_IS_TEXT_MARK*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_TEXT_MARK())
+
+proc GTK_IS_TEXT_MARK_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_MARK())
+
+proc GTK_TEXT_MARK_GET_CLASS*(obj: pointer): PGtkTextMarkClass =
+  result = cast[PGtkTextMarkClass](G_TYPE_INSTANCE_GET_CLASS(obj, GTK_TYPE_TEXT_MARK()))
+
+proc visible*(a: var TGtkTextMarkBody): guint =
+  result = (a.flag0 and bm_TGtkTextMarkBody_visible) shr
+      bp_TGtkTextMarkBody_visible
+
+proc set_visible*(a: var TGtkTextMarkBody, `visible`: guint) =
+  a.flag0 = a.flag0 or
+      ((`visible` shl bp_TGtkTextMarkBody_visible) and
+      bm_TGtkTextMarkBody_visible)
+
+proc not_deleteable*(a: var TGtkTextMarkBody): guint =
+  result = (a.flag0 and bm_TGtkTextMarkBody_not_deleteable) shr
+      bp_TGtkTextMarkBody_not_deleteable
+
+proc set_not_deleteable*(a: var TGtkTextMarkBody, `not_deleteable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`not_deleteable` shl bp_TGtkTextMarkBody_not_deleteable) and
+      bm_TGtkTextMarkBody_not_deleteable)
+
+proc GTK_TYPE_TEXT_CHILD_ANCHOR*(): GType =
+  result = gtk_text_child_anchor_get_type()
+
+proc GTK_TEXT_CHILD_ANCHOR*(anObject: pointer): PGtkTextChildAnchor =
+  result = cast[PGtkTextChildAnchor](G_TYPE_CHECK_INSTANCE_CAST(anObject,
+      GTK_TYPE_TEXT_CHILD_ANCHOR()))
+
+proc GTK_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PGtkTextChildAnchorClass =
+  result = cast[PGtkTextChildAnchorClass](G_TYPE_CHECK_CLASS_CAST(klass, GTK_TYPE_TEXT_CHILD_ANCHOR()))
+
+proc GTK_IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, GTK_TYPE_TEXT_CHILD_ANCHOR())
+
+proc GTK_IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_CHILD_ANCHOR())
+
+proc GTK_TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PGtkTextChildAnchorClass =
+  result = cast[PGtkTextChildAnchorClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_TEXT_CHILD_ANCHOR()))
+
+proc width*(a: PGtkTextLineData): gint =
+  result = a . flag0 and bm_TGtkTextLineData_width
+
+proc set_width*(a: PGtkTextLineData, NewWidth: gint) =
+  a . flag0 = (bm_TGtkTextLineData_width and NewWidth) or a . flag0
+
+proc valid*(a: PGtkTextLineData): gint =
+  result = (a . flag0 and bm_TGtkTextLineData_valid) shr
+      bp_TGtkTextLineData_valid
+
+proc set_valid*(a: PGtkTextLineData, `valid`: gint) =
+  a . flag0 = a .
+      flag0 or
+      ((`valid` shl bp_TGtkTextLineData_valid) and bm_TGtkTextLineData_valid)
+
+proc GTK_TYPE_TEXT_BUFFER*(): GType =
+  result = gtk_text_buffer_get_type()
+
+proc GTK_TEXT_BUFFER*(obj: pointer): PGtkTextBuffer =
+  result = cast[PGtkTextBuffer](G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TEXT_BUFFER()))
+
+proc GTK_TEXT_BUFFER_CLASS*(klass: pointer): PGtkTextBufferClass =
+  result = cast[PGtkTextBufferClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TEXT_BUFFER()))
+
+proc GTK_IS_TEXT_BUFFER*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TEXT_BUFFER())
+
+proc GTK_IS_TEXT_BUFFER_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_BUFFER())
+
+proc GTK_TEXT_BUFFER_GET_CLASS*(obj: pointer): PGtkTextBufferClass =
+  result = cast[PGtkTextBufferClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_TEXT_BUFFER()))
+
+proc modified*(a: var TGtkTextBuffer): guint =
+  result = (a.GtkTextBufferflag0 and bm_TGtkTextBuffer_modified) shr
+      bp_TGtkTextBuffer_modified
+
+proc set_modified*(a: var TGtkTextBuffer, `modified`: guint) =
+  a.GtkTextBufferflag0 = a.GtkTextBufferflag0 or
+      ((`modified` shl bp_TGtkTextBuffer_modified) and
+      bm_TGtkTextBuffer_modified)
+
+proc GTK_TYPE_TEXT_LAYOUT*(): GType =
+  result = gtk_text_layout_get_type()
+
+proc GTK_TEXT_LAYOUT*(obj: pointer): PGtkTextLayout =
+  result = cast[PGtkTextLayout](G_TYPE_CHECK_INSTANCE_CAST(obj, GTK_TYPE_TEXT_LAYOUT()))
+
+proc GTK_TEXT_LAYOUT_CLASS*(klass: pointer): PGtkTextLayoutClass =
+  result = cast[PGtkTextLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TEXT_LAYOUT()))
+
+proc GTK_IS_TEXT_LAYOUT*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TEXT_LAYOUT())
+
+proc GTK_IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool =
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_LAYOUT())
+
+proc GTK_TEXT_LAYOUT_GET_CLASS*(obj: pointer): PGtkTextLayoutClass =
+  result = cast[PGtkTextLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj,
+      GTK_TYPE_TEXT_LAYOUT()))
+
+proc cursor_visible*(a: var TGtkTextLayout): guint =
+  result = (a.GtkTextLayoutflag0 and bm_TGtkTextLayout_cursor_visible) shr
+      bp_TGtkTextLayout_cursor_visible
+
+proc set_cursor_visible*(a: var TGtkTextLayout, `cursor_visible`: guint) =
+  a.GtkTextLayoutflag0 = a.GtkTextLayoutflag0 or
+      ((`cursor_visible` shl bp_TGtkTextLayout_cursor_visible) and
+      bm_TGtkTextLayout_cursor_visible)
+
+proc cursor_direction*(a: var TGtkTextLayout): gint =
+  result = (a.GtkTextLayoutflag0 and bm_TGtkTextLayout_cursor_direction) shr
+      bp_TGtkTextLayout_cursor_direction
+
+proc set_cursor_direction*(a: var TGtkTextLayout, `cursor_direction`: gint) =
+  a.GtkTextLayoutflag0 = a.GtkTextLayoutflag0 or
+      ((`cursor_direction` shl bp_TGtkTextLayout_cursor_direction) and
+      bm_TGtkTextLayout_cursor_direction)
+
+proc is_strong*(a: var TGtkTextCursorDisplay): guint =
+  result = (a.flag0 and bm_TGtkTextCursorDisplay_is_strong) shr
+      bp_TGtkTextCursorDisplay_is_strong
+
+proc set_is_strong*(a: var TGtkTextCursorDisplay, `is_strong`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_strong` shl bp_TGtkTextCursorDisplay_is_strong) and
+      bm_TGtkTextCursorDisplay_is_strong)
+
+proc is_weak*(a: var TGtkTextCursorDisplay): guint =
+  result = (a.flag0 and bm_TGtkTextCursorDisplay_is_weak) shr
+      bp_TGtkTextCursorDisplay_is_weak
+
+proc set_is_weak*(a: var TGtkTextCursorDisplay, `is_weak`: guint) =
+  a.flag0 = a.flag0 or
+      ((`is_weak` shl bp_TGtkTextCursorDisplay_is_weak) and
+      bm_TGtkTextCursorDisplay_is_weak)
+
+proc GTK_TYPE_TEXT_VIEW*(): GType =
+  result = gtk_text_view_get_type()
+
+proc GTK_TEXT_VIEW*(obj: pointer): PGtkTextView =
+  result = cast[PGtkTextView](GTK_CHECK_CAST(obj, GTK_TYPE_TEXT_VIEW()))
+
+proc GTK_TEXT_VIEW_CLASS*(klass: pointer): PGtkTextViewClass =
+  result = cast[PGtkTextViewClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TEXT_VIEW()))
+
+proc GTK_IS_TEXT_VIEW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TEXT_VIEW())
+
+proc GTK_IS_TEXT_VIEW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TEXT_VIEW())
+
+proc GTK_TEXT_VIEW_GET_CLASS*(obj: pointer): PGtkTextViewClass =
+  result = cast[PGtkTextViewClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TEXT_VIEW()))
+
+proc editable*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_editable) shr
+      bp_TGtkTextView_editable
+
+proc set_editable*(a: var TGtkTextView, `editable`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`editable` shl bp_TGtkTextView_editable) and bm_TGtkTextView_editable)
+
+proc overwrite_mode*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_overwrite_mode) shr
+      bp_TGtkTextView_overwrite_mode
+
+proc set_overwrite_mode*(a: var TGtkTextView, `overwrite_mode`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`overwrite_mode` shl bp_TGtkTextView_overwrite_mode) and
+      bm_TGtkTextView_overwrite_mode)
+
+proc cursor_visible*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_cursor_visible) shr
+      bp_TGtkTextView_cursor_visible
+
+proc set_cursor_visible*(a: var TGtkTextView, `cursor_visible`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`cursor_visible` shl bp_TGtkTextView_cursor_visible) and
+      bm_TGtkTextView_cursor_visible)
+
+proc need_im_reset*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_need_im_reset) shr
+      bp_TGtkTextView_need_im_reset
+
+proc set_need_im_reset*(a: var TGtkTextView, `need_im_reset`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`need_im_reset` shl bp_TGtkTextView_need_im_reset) and
+      bm_TGtkTextView_need_im_reset)
+
+proc just_selected_element*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_just_selected_element) shr
+      bp_TGtkTextView_just_selected_element
+
+proc set_just_selected_element*(a: var TGtkTextView,
+                                `just_selected_element`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`just_selected_element` shl bp_TGtkTextView_just_selected_element) and
+      bm_TGtkTextView_just_selected_element)
+
+proc disable_scroll_on_focus*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_disable_scroll_on_focus) shr
+      bp_TGtkTextView_disable_scroll_on_focus
+
+proc set_disable_scroll_on_focus*(a: var TGtkTextView,
+                                  `disable_scroll_on_focus`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`disable_scroll_on_focus` shl bp_TGtkTextView_disable_scroll_on_focus) and
+      bm_TGtkTextView_disable_scroll_on_focus)
+
+proc onscreen_validated*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_onscreen_validated) shr
+      bp_TGtkTextView_onscreen_validated
+
+proc set_onscreen_validated*(a: var TGtkTextView, `onscreen_validated`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`onscreen_validated` shl bp_TGtkTextView_onscreen_validated) and
+      bm_TGtkTextView_onscreen_validated)
+
+proc mouse_cursor_obscured*(a: var TGtkTextView): guint =
+  result = (a.GtkTextViewflag0 and bm_TGtkTextView_mouse_cursor_obscured) shr
+      bp_TGtkTextView_mouse_cursor_obscured
+
+proc set_mouse_cursor_obscured*(a: var TGtkTextView,
+                                `mouse_cursor_obscured`: guint) =
+  a.GtkTextViewflag0 = a.GtkTextViewflag0 or
+      ((`mouse_cursor_obscured` shl bp_TGtkTextView_mouse_cursor_obscured) and
+      bm_TGtkTextView_mouse_cursor_obscured)
+
+proc GTK_TYPE_TIPS_QUERY*(): GType =
+  result = gtk_tips_query_get_type()
+
+proc GTK_TIPS_QUERY*(obj: pointer): PGtkTipsQuery =
+  result = cast[PGtkTipsQuery](GTK_CHECK_CAST(obj, GTK_TYPE_TIPS_QUERY()))
+
+proc GTK_TIPS_QUERY_CLASS*(klass: pointer): PGtkTipsQueryClass =
+  result = cast[PGtkTipsQueryClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TIPS_QUERY()))
+
+proc GTK_IS_TIPS_QUERY*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TIPS_QUERY())
+
+proc GTK_IS_TIPS_QUERY_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TIPS_QUERY())
+
+proc GTK_TIPS_QUERY_GET_CLASS*(obj: pointer): PGtkTipsQueryClass =
+  result = cast[PGtkTipsQueryClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TIPS_QUERY()))
+
+proc emit_always*(a: var TGtkTipsQuery): guint =
+  result = (a.GtkTipsQueryflag0 and bm_TGtkTipsQuery_emit_always) shr
+      bp_TGtkTipsQuery_emit_always
+
+proc set_emit_always*(a: var TGtkTipsQuery, `emit_always`: guint) =
+  a.GtkTipsQueryflag0 = a.GtkTipsQueryflag0 or
+      ((`emit_always` shl bp_TGtkTipsQuery_emit_always) and
+      bm_TGtkTipsQuery_emit_always)
+
+proc in_query*(a: var TGtkTipsQuery): guint =
+  result = (a.GtkTipsQueryflag0 and bm_TGtkTipsQuery_in_query) shr
+      bp_TGtkTipsQuery_in_query
+
+proc set_in_query*(a: var TGtkTipsQuery, `in_query`: guint) =
+  a.GtkTipsQueryflag0 = a.GtkTipsQueryflag0 or
+      ((`in_query` shl bp_TGtkTipsQuery_in_query) and
+      bm_TGtkTipsQuery_in_query)
+
+proc GTK_TYPE_TOOLTIPS*(): GType =
+  result = gtk_tooltips_get_type()
+
+proc GTK_TOOLTIPS*(obj: pointer): PGtkTooltips =
+  result = cast[PGtkTooltips](GTK_CHECK_CAST(obj, GTK_TYPE_TOOLTIPS()))
+
+proc GTK_TOOLTIPS_CLASS*(klass: pointer): PGtkTooltipsClass =
+  result = cast[PGtkTooltipsClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TOOLTIPS()))
+
+proc GTK_IS_TOOLTIPS*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TOOLTIPS())
+
+proc GTK_IS_TOOLTIPS_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TOOLTIPS())
+
+proc GTK_TOOLTIPS_GET_CLASS*(obj: pointer): PGtkTooltipsClass =
+  result = cast[PGtkTooltipsClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TOOLTIPS()))
+
+proc delay*(a: var TGtkTooltips): guint =
+  result = (a.GtkTooltipsflag0 and bm_TGtkTooltips_delay) shr bp_TGtkTooltips_delay
+
+proc set_delay*(a: var TGtkTooltips, `delay`: guint) =
+  a.GtkTooltipsflag0 = a.GtkTooltipsflag0 or
+      ((`delay` shl bp_TGtkTooltips_delay) and bm_TGtkTooltips_delay)
+
+proc enabled*(a: var TGtkTooltips): guint =
+  result = (a.GtkTooltipsflag0 and bm_TGtkTooltips_enabled) shr bp_TGtkTooltips_enabled
+
+proc set_enabled*(a: var TGtkTooltips, `enabled`: guint) =
+  a.GtkTooltipsflag0 = a.GtkTooltipsflag0 or
+      ((`enabled` shl bp_TGtkTooltips_enabled) and bm_TGtkTooltips_enabled)
+
+proc have_grab*(a: var TGtkTooltips): guint =
+  result = (a.GtkTooltipsflag0 and bm_TGtkTooltips_have_grab) shr
+      bp_TGtkTooltips_have_grab
+
+proc set_have_grab*(a: var TGtkTooltips, `have_grab`: guint) =
+  a.GtkTooltipsflag0 = a.GtkTooltipsflag0 or
+      ((`have_grab` shl bp_TGtkTooltips_have_grab) and
+      bm_TGtkTooltips_have_grab)
+
+proc use_sticky_delay*(a: var TGtkTooltips): guint =
+  result = (a.GtkTooltipsflag0 and bm_TGtkTooltips_use_sticky_delay) shr
+      bp_TGtkTooltips_use_sticky_delay
+
+proc set_use_sticky_delay*(a: var TGtkTooltips, `use_sticky_delay`: guint) =
+  a.GtkTooltipsflag0 = a.GtkTooltipsflag0 or
+      ((`use_sticky_delay` shl bp_TGtkTooltips_use_sticky_delay) and
+      bm_TGtkTooltips_use_sticky_delay)
+
+proc GTK_TYPE_TOOLBAR*(): GType =
+  result = gtk_toolbar_get_type()
+
+proc GTK_TOOLBAR*(obj: pointer): PGtkToolbar =
+  result = cast[PGtkToolbar](GTK_CHECK_CAST(obj, GTK_TYPE_TOOLBAR()))
+
+proc GTK_TOOLBAR_CLASS*(klass: pointer): PGtkToolbarClass =
+  result = cast[PGtkToolbarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TOOLBAR()))
+
+proc GTK_IS_TOOLBAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TOOLBAR())
+
+proc GTK_IS_TOOLBAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TOOLBAR())
+
+proc GTK_TOOLBAR_GET_CLASS*(obj: pointer): PGtkToolbarClass =
+  result = cast[PGtkToolbarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TOOLBAR()))
+
+proc style_set*(a: var TGtkToolbar): guint =
+  result = (a.GtkToolbarflag0 and bm_TGtkToolbar_style_set) shr
+      bp_TGtkToolbar_style_set
+
+proc set_style_set*(a: var TGtkToolbar, `style_set`: guint) =
+  a.GtkToolbarflag0 = a.GtkToolbarflag0 or
+      ((`style_set` shl bp_TGtkToolbar_style_set) and
+      bm_TGtkToolbar_style_set)
+
+proc icon_size_set*(a: var TGtkToolbar): guint =
+  result = (a.GtkToolbarflag0 and bm_TGtkToolbar_icon_size_set) shr
+      bp_TGtkToolbar_icon_size_set
+
+proc set_icon_size_set*(a: var TGtkToolbar, `icon_size_set`: guint) =
+  a.GtkToolbarflag0 = a.GtkToolbarflag0 or
+      ((`icon_size_set` shl bp_TGtkToolbar_icon_size_set) and
+      bm_TGtkToolbar_icon_size_set)
+
+proc GTK_TYPE_TREE*(): GType =
+  result = gtk_tree_get_type()
+
+proc GTK_TREE*(obj: pointer): PGtkTree =
+  result = cast[PGtkTree](GTK_CHECK_CAST(obj, GTK_TYPE_TREE()))
+
+proc GTK_TREE_CLASS*(klass: pointer): PGtkTreeClass =
+  result = cast[PGtkTreeClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TREE()))
+
+proc GTK_IS_TREE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE())
+
+proc GTK_IS_TREE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE())
+
+proc GTK_TREE_GET_CLASS*(obj: pointer): PGtkTreeClass =
+  result = cast[PGtkTreeClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TREE()))
+
+proc GTK_IS_ROOT_TREE*(obj: pointer): bool =
+  result = (cast[PGtkObject]((GTK_TREE(obj)) . root_tree)) ==
+     (cast[PGtkObject](obj))
+
+proc GTK_TREE_ROOT_TREE*(obj: pointer): PGtkTree =
+  result = GTK_TREE(obj).root_tree
+
+proc GTK_TREE_SELECTION_OLD*(obj: pointer): PGList =
+  result = (GTK_TREE_ROOT_TREE(obj)).selection
+
+proc selection_mode*(a: var TGtkTree): guint =
+  result = (a.GtkTreeflag0 and bm_TGtkTree_selection_mode) shr
+      bp_TGtkTree_selection_mode
+
+proc set_selection_mode*(a: var TGtkTree, `selection_mode`: guint) =
+  a.GtkTreeflag0 = a.GtkTreeflag0 or
+      ((`selection_mode` shl bp_TGtkTree_selection_mode) and
+      bm_TGtkTree_selection_mode)
+
+proc view_mode*(a: var TGtkTree): guint =
+  result = (a.GtkTreeflag0 and bm_TGtkTree_view_mode) shr bp_TGtkTree_view_mode
+
+proc set_view_mode*(a: var TGtkTree, `view_mode`: guint) =
+  a.GtkTreeflag0 = a.GtkTreeflag0 or
+      ((`view_mode` shl bp_TGtkTree_view_mode) and bm_TGtkTree_view_mode)
+
+proc view_line*(a: var TGtkTree): guint =
+  result = (a.GtkTreeflag0 and bm_TGtkTree_view_line) shr bp_TGtkTree_view_line
+
+proc set_view_line*(a: var TGtkTree, `view_line`: guint) =
+  a.GtkTreeflag0 = a.GtkTreeflag0 or
+      ((`view_line` shl bp_TGtkTree_view_line) and bm_TGtkTree_view_line)
+
+proc GTK_TYPE_TREE_DRAG_SOURCE*(): GType =
+  result = gtk_tree_drag_source_get_type()
+
+proc GTK_TREE_DRAG_SOURCE*(obj: pointer): PGtkTreeDragSource =
+  result = cast[PGtkTreeDragSource](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      GTK_TYPE_TREE_DRAG_SOURCE()))
+
+proc GTK_IS_TREE_DRAG_SOURCE*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TREE_DRAG_SOURCE())
+
+proc GTK_TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PGtkTreeDragSourceIface =
+  result = cast[PGtkTreeDragSourceIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      GTK_TYPE_TREE_DRAG_SOURCE()))
+
+proc GTK_TYPE_TREE_DRAG_DEST*(): GType =
+  result = gtk_tree_drag_dest_get_type()
+
+proc GTK_TREE_DRAG_DEST*(obj: pointer): PGtkTreeDragDest =
+  result = cast[PGtkTreeDragDest](G_TYPE_CHECK_INSTANCE_CAST(obj,
+      GTK_TYPE_TREE_DRAG_DEST()))
+
+proc GTK_IS_TREE_DRAG_DEST*(obj: pointer): bool =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_TREE_DRAG_DEST())
+
+proc GTK_TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PGtkTreeDragDestIface =
+  result = cast[PGtkTreeDragDestIface](G_TYPE_INSTANCE_GET_INTERFACE(obj,
+      GTK_TYPE_TREE_DRAG_DEST()))
+
+proc GTK_TYPE_TREE_ITEM*(): GType =
+  result = gtk_tree_item_get_type()
+
+proc GTK_TREE_ITEM*(obj: pointer): PGtkTreeItem =
+  result = cast[PGtkTreeItem](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_ITEM()))
+
+proc GTK_TREE_ITEM_CLASS*(klass: pointer): PGtkTreeItemClass =
+  result = cast[PGtkTreeItemClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TREE_ITEM()))
+
+proc GTK_IS_TREE_ITEM*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_ITEM())
+
+proc GTK_IS_TREE_ITEM_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_ITEM())
+
+proc GTK_TREE_ITEM_GET_CLASS*(obj: pointer): PGtkTreeItemClass =
+  result = cast[PGtkTreeItemClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TREE_ITEM()))
+
+proc GTK_TREE_ITEM_SUBTREE*(obj: pointer): PGtkWidget =
+  result = (GTK_TREE_ITEM(obj)).subtree
+
+proc expanded*(a: var TGtkTreeItem): guint =
+  result = (a.GtkTreeItemflag0 and bm_TGtkTreeItem_expanded) shr
+      bp_TGtkTreeItem_expanded
+
+proc set_expanded*(a: var TGtkTreeItem, `expanded`: guint) =
+  a.GtkTreeItemflag0 = a.GtkTreeItemflag0 or
+      ((`expanded` shl bp_TGtkTreeItem_expanded) and bm_TGtkTreeItem_expanded)
+
+proc GTK_TYPE_TREE_SELECTION*(): GType =
+  result = gtk_tree_selection_get_type()
+
+proc GTK_TREE_SELECTION*(obj: pointer): PGtkTreeSelection =
+  result = cast[PGtkTreeSelection](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_SELECTION()))
+
+proc GTK_TREE_SELECTION_CLASS*(klass: pointer): PGtkTreeSelectionClass =
+  result = cast[PGtkTreeSelectionClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TREE_SELECTION()))
+
+proc GTK_IS_TREE_SELECTION*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_SELECTION())
+
+proc GTK_IS_TREE_SELECTION_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_SELECTION())
+
+proc GTK_TREE_SELECTION_GET_CLASS*(obj: pointer): PGtkTreeSelectionClass =
+  result = cast[PGtkTreeSelectionClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_TREE_SELECTION()))
+
+proc GTK_TYPE_TREE_STORE*(): GType =
+  result = gtk_tree_store_get_type()
+
+proc GTK_TREE_STORE*(obj: pointer): PGtkTreeStore =
+  result = cast[PGtkTreeStore](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_STORE()))
+
+proc GTK_TREE_STORE_CLASS*(klass: pointer): PGtkTreeStoreClass =
+  result = cast[PGtkTreeStoreClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TREE_STORE()))
+
+proc GTK_IS_TREE_STORE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_STORE())
+
+proc GTK_IS_TREE_STORE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_STORE())
+
+proc GTK_TREE_STORE_GET_CLASS*(obj: pointer): PGtkTreeStoreClass =
+  result = cast[PGtkTreeStoreClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TREE_STORE()))
+
+proc columns_dirty*(a: var TGtkTreeStore): guint =
+  result = (a.GtkTreeStoreflag0 and bm_TGtkTreeStore_columns_dirty) shr
+      bp_TGtkTreeStore_columns_dirty
+
+proc set_columns_dirty*(a: var TGtkTreeStore, `columns_dirty`: guint) =
+  a.GtkTreeStoreflag0 = a.GtkTreeStoreflag0 or
+      ((`columns_dirty` shl bp_TGtkTreeStore_columns_dirty) and
+      bm_TGtkTreeStore_columns_dirty)
+
+proc GTK_TYPE_TREE_VIEW_COLUMN*(): GType =
+  result = gtk_tree_view_column_get_type()
+
+proc GTK_TREE_VIEW_COLUMN*(obj: pointer): PGtkTreeViewColumn =
+  result = cast[PGtkTreeViewColumn](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_VIEW_COLUMN()))
+
+proc GTK_TREE_VIEW_COLUMN_CLASS*(klass: pointer): PGtkTreeViewColumnClass =
+  result = cast[PGtkTreeViewColumnClass](GTK_CHECK_CLASS_CAST(klass,
+      GTK_TYPE_TREE_VIEW_COLUMN()))
+
+proc GTK_IS_TREE_VIEW_COLUMN*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_VIEW_COLUMN())
+
+proc GTK_IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_VIEW_COLUMN())
+
+proc GTK_TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PGtkTreeViewColumnClass =
+  result = cast[PGtkTreeViewColumnClass](GTK_CHECK_GET_CLASS(obj,
+      GTK_TYPE_TREE_VIEW_COLUMN()))
+
+proc visible*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_visible) shr
+      bp_TGtkTreeViewColumn_visible
+
+proc set_visible*(a: var TGtkTreeViewColumn, `visible`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`visible` shl bp_TGtkTreeViewColumn_visible) and
+      bm_TGtkTreeViewColumn_visible)
+
+proc resizable*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_resizable) shr
+      bp_TGtkTreeViewColumn_resizable
+
+proc set_resizable*(a: var TGtkTreeViewColumn, `resizable`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`resizable` shl bp_TGtkTreeViewColumn_resizable) and
+      bm_TGtkTreeViewColumn_resizable)
+
+proc clickable*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_clickable) shr
+      bp_TGtkTreeViewColumn_clickable
+
+proc set_clickable*(a: var TGtkTreeViewColumn, `clickable`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`clickable` shl bp_TGtkTreeViewColumn_clickable) and
+      bm_TGtkTreeViewColumn_clickable)
+
+proc dirty*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_dirty) shr
+      bp_TGtkTreeViewColumn_dirty
+
+proc set_dirty*(a: var TGtkTreeViewColumn, `dirty`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`dirty` shl bp_TGtkTreeViewColumn_dirty) and
+      bm_TGtkTreeViewColumn_dirty)
+
+proc show_sort_indicator*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_show_sort_indicator) shr
+      bp_TGtkTreeViewColumn_show_sort_indicator
+
+proc set_show_sort_indicator*(a: var TGtkTreeViewColumn,
+                              `show_sort_indicator`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`show_sort_indicator` shl bp_TGtkTreeViewColumn_show_sort_indicator) and
+      bm_TGtkTreeViewColumn_show_sort_indicator)
+
+proc maybe_reordered*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_maybe_reordered) shr
+      bp_TGtkTreeViewColumn_maybe_reordered
+
+proc set_maybe_reordered*(a: var TGtkTreeViewColumn, `maybe_reordered`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`maybe_reordered` shl bp_TGtkTreeViewColumn_maybe_reordered) and
+      bm_TGtkTreeViewColumn_maybe_reordered)
+
+proc reorderable*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_reorderable) shr
+      bp_TGtkTreeViewColumn_reorderable
+
+proc set_reorderable*(a: var TGtkTreeViewColumn, `reorderable`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`reorderable` shl bp_TGtkTreeViewColumn_reorderable) and
+      bm_TGtkTreeViewColumn_reorderable)
+
+proc use_resized_width*(a: var TGtkTreeViewColumn): guint =
+  result = (a.GtkTreeViewColumnflag0 and bm_TGtkTreeViewColumn_use_resized_width) shr
+      bp_TGtkTreeViewColumn_use_resized_width
+
+proc set_use_resized_width*(a: var TGtkTreeViewColumn,
+                            `use_resized_width`: guint) =
+  a.GtkTreeViewColumnflag0 = a.GtkTreeViewColumnflag0 or
+      ((`use_resized_width` shl bp_TGtkTreeViewColumn_use_resized_width) and
+      bm_TGtkTreeViewColumn_use_resized_width)
+
+proc flags*(a: PGtkRBNode): guint =
+  result = (a . flag0 and bm_TGtkRBNode_flags) shr bp_TGtkRBNode_flags
+
+proc set_flags*(a: PGtkRBNode, `flags`: guint) =
+  a . flag0 = a .
+      flag0 or ((`flags` shl bp_TGtkRBNode_flags) and bm_TGtkRBNode_flags)
+
+proc parity*(a: PGtkRBNode): guint =
+  result = (a . flag0 and bm_TGtkRBNode_parity) shr bp_TGtkRBNode_parity
+
+proc set_parity*(a: PGtkRBNode, `parity`: guint) =
+  a . flag0 = a .
+      flag0 or ((`parity` shl bp_TGtkRBNode_parity) and bm_TGtkRBNode_parity)
+
+proc GTK_RBNODE_GET_COLOR*(node_: PGtkRBNode): guint =
+  if node_ == nil:
+    Result = GTK_RBNODE_BLACK
+  elif (flags(node_) and GTK_RBNODE_RED) == GTK_RBNODE_RED:
+    Result = GTK_RBNODE_RED
+  else:
+    Result = GTK_RBNODE_BLACK
+
+proc GTK_RBNODE_SET_COLOR*(node_: PGtkRBNode, color: guint) =
+  if node_ == nil:
+    return
+  if ((flags(node_) and int(color)) != color):
+    set_flags(node_, flags(node_) xor (GTK_RBNODE_RED or GTK_RBNODE_BLACK))
+
+proc GTK_RBNODE_GET_HEIGHT*(node_: PGtkRBNode): gint =
+  var if_local1: gint
+  if node_ . children != nil:
+    if_local1 = node_.children.root.offset
+  else:
+    if_local1 = 0
+  result = node_.offset - (int(node_.left.offset) + node_.right.offset + if_local1)
+
+proc GTK_RBNODE_FLAG_SET*(node_: PGtkRBNode, flag: guint): bool =
+  result = (node_ != nil) and ((flags(node_) and int(flag)) == flag)
+
+proc GTK_RBNODE_SET_FLAG*(node_: PGtkRBNode, flag: guint16) =
+  set_flags(node_, int(flag) or flags(node_))
+
+proc GTK_RBNODE_UNSET_FLAG*(node_: PGtkRBNode, flag: guint16) =
+  set_flags(node_, (not int(flag)) and flags(node_))
+
+proc GTK_TREE_VIEW_FLAG_SET*(tree_view: PGtkTreeView, flag: guint): bool =
+  result = ((tree_view.priv.flags) and int(flag)) == flag
+
+proc TREE_VIEW_HEADER_HEIGHT*(tree_view: PGtkTreeView): int32 =
+  var if_local1: int32
+  if GTK_TREE_VIEW_FLAG_SET(tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE):
+    if_local1 = tree_view.priv.header_height
+  else:
+    if_local1 = 0
+  result = if_local1
+
+proc TREE_VIEW_COLUMN_REQUESTED_WIDTH*(column: PGtkTreeViewColumn): int32 =
+  var MinWidth, MaxWidth: int
+  if column . min_width != - 1:
+    MinWidth = column . min_width
+  else:
+    MinWidth = column . requested_width
+  if column . max_width != - 1:
+    MaxWidth = column . max_width
+  else:
+    MaxWidth = column . requested_width
+  result = CLAMP(column . requested_width, MinWidth,
+      MaxWidth)
+
+proc TREE_VIEW_DRAW_EXPANDERS*(tree_view: PGtkTreeView): bool =
+  result = (not (GTK_TREE_VIEW_FLAG_SET(tree_view, GTK_TREE_VIEW_IS_LIST))) and
+      (GTK_TREE_VIEW_FLAG_SET(tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
+
+proc TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PGtkTreeView): int32 =
+  result = 10 * (TREE_VIEW_HEADER_HEIGHT(tree_view))
+
+proc scroll_to_use_align*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_scroll_to_use_align) shr
+      bp_TGtkTreeViewPrivate_scroll_to_use_align
+
+proc set_scroll_to_use_align*(a: var TGtkTreeViewPrivate,
+                              `scroll_to_use_align`: guint) =
+  a.flag0 = a.flag0 or
+      ((`scroll_to_use_align` shl bp_TGtkTreeViewPrivate_scroll_to_use_align) and
+      bm_TGtkTreeViewPrivate_scroll_to_use_align)
+
+proc fixed_height_check*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_fixed_height_check) shr
+      bp_TGtkTreeViewPrivate_fixed_height_check
+
+proc set_fixed_height_check*(a: var TGtkTreeViewPrivate,
+                             `fixed_height_check`: guint) =
+  a.flag0 = a.flag0 or
+      ((`fixed_height_check` shl bp_TGtkTreeViewPrivate_fixed_height_check) and
+      bm_TGtkTreeViewPrivate_fixed_height_check)
+
+proc reorderable*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_reorderable) shr
+      bp_TGtkTreeViewPrivate_reorderable
+
+proc set_reorderable*(a: var TGtkTreeViewPrivate, `reorderable`: guint) =
+  a.flag0 = a.flag0 or
+      ((`reorderable` shl bp_TGtkTreeViewPrivate_reorderable) and
+      bm_TGtkTreeViewPrivate_reorderable)
+
+proc header_has_focus*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_header_has_focus) shr
+      bp_TGtkTreeViewPrivate_header_has_focus
+
+proc set_header_has_focus*(a: var TGtkTreeViewPrivate, `header_has_focus`: guint) =
+  a.flag0 = a.flag0 or
+      ((`header_has_focus` shl bp_TGtkTreeViewPrivate_header_has_focus) and
+      bm_TGtkTreeViewPrivate_header_has_focus)
+
+proc drag_column_window_state*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_drag_column_window_state) shr
+      bp_TGtkTreeViewPrivate_drag_column_window_state
+
+proc set_drag_column_window_state*(a: var TGtkTreeViewPrivate,
+                                   `drag_column_window_state`: guint) =
+  a.flag0 = a.flag0 or
+      ((`drag_column_window_state` shl
+      bp_TGtkTreeViewPrivate_drag_column_window_state) and
+      bm_TGtkTreeViewPrivate_drag_column_window_state)
+
+proc has_rules*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_has_rules) shr
+      bp_TGtkTreeViewPrivate_has_rules
+
+proc set_has_rules*(a: var TGtkTreeViewPrivate, `has_rules`: guint) =
+  a.flag0 = a.flag0 or
+      ((`has_rules` shl bp_TGtkTreeViewPrivate_has_rules) and
+      bm_TGtkTreeViewPrivate_has_rules)
+
+proc mark_rows_col_dirty*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_mark_rows_col_dirty) shr
+      bp_TGtkTreeViewPrivate_mark_rows_col_dirty
+
+proc set_mark_rows_col_dirty*(a: var TGtkTreeViewPrivate,
+                              `mark_rows_col_dirty`: guint) =
+  a.flag0 = a.flag0 or
+      ((`mark_rows_col_dirty` shl bp_TGtkTreeViewPrivate_mark_rows_col_dirty) and
+      bm_TGtkTreeViewPrivate_mark_rows_col_dirty)
+
+proc enable_search*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_enable_search) shr
+      bp_TGtkTreeViewPrivate_enable_search
+
+proc set_enable_search*(a: var TGtkTreeViewPrivate, `enable_search`: guint) =
+  a.flag0 = a.flag0 or
+      ((`enable_search` shl bp_TGtkTreeViewPrivate_enable_search) and
+      bm_TGtkTreeViewPrivate_enable_search)
+
+proc disable_popdown*(a: var TGtkTreeViewPrivate): guint =
+  result = (a.flag0 and bm_TGtkTreeViewPrivate_disable_popdown) shr
+      bp_TGtkTreeViewPrivate_disable_popdown
+
+proc set_disable_popdown*(a: var TGtkTreeViewPrivate, `disable_popdown`: guint) =
+  a.flag0 = a.flag0 or
+      ((`disable_popdown` shl bp_TGtkTreeViewPrivate_disable_popdown) and
+      bm_TGtkTreeViewPrivate_disable_popdown)
+
+proc GTK_TREE_VIEW_SET_FLAG*(tree_view: PGtkTreeView, flag: guint) =
+  tree_view . priv . flags = tree_view . priv . flags or int(flag)
+
+proc GTK_TREE_VIEW_UNSET_FLAG*(tree_view: PGtkTreeView, flag: guint) =
+  tree_view . priv . flags = tree_view . priv . flags and not int(flag)
+
+proc GTK_TYPE_TREE_VIEW*(): GType =
+  result = gtk_tree_view_get_type()
+
+proc GTK_TREE_VIEW*(obj: pointer): PGtkTreeView =
+  result = cast[PGtkTreeView](GTK_CHECK_CAST(obj, GTK_TYPE_TREE_VIEW()))
+
+proc GTK_TREE_VIEW_CLASS*(klass: pointer): PGtkTreeViewClass =
+  result = cast[PGtkTreeViewClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_TREE_VIEW()))
+
+proc GTK_IS_TREE_VIEW*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_TREE_VIEW())
+
+proc GTK_IS_TREE_VIEW_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_TREE_VIEW())
+
+proc GTK_TREE_VIEW_GET_CLASS*(obj: pointer): PGtkTreeViewClass =
+  result = cast[PGtkTreeViewClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_TREE_VIEW()))
+
+proc GTK_TYPE_VBUTTON_BOX*(): GType =
+  result = gtk_vbutton_box_get_type()
+
+proc GTK_VBUTTON_BOX*(obj: pointer): PGtkVButtonBox =
+  result = cast[PGtkVButtonBox](GTK_CHECK_CAST(obj, GTK_TYPE_VBUTTON_BOX()))
+
+proc GTK_VBUTTON_BOX_CLASS*(klass: pointer): PGtkVButtonBoxClass =
+  result = cast[PGtkVButtonBoxClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VBUTTON_BOX()))
+
+proc GTK_IS_VBUTTON_BOX*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VBUTTON_BOX())
+
+proc GTK_IS_VBUTTON_BOX_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VBUTTON_BOX())
+
+proc GTK_VBUTTON_BOX_GET_CLASS*(obj: pointer): PGtkVButtonBoxClass =
+  result = cast[PGtkVButtonBoxClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VBUTTON_BOX()))
+
+proc GTK_TYPE_VIEWPORT*(): GType =
+  result = gtk_viewport_get_type()
+
+proc GTK_VIEWPORT*(obj: pointer): PGtkViewport =
+  result = cast[PGtkViewport](GTK_CHECK_CAST(obj, GTK_TYPE_VIEWPORT()))
+
+proc GTK_VIEWPORT_CLASS*(klass: pointer): PGtkViewportClass =
+  result = cast[PGtkViewportClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VIEWPORT()))
+
+proc GTK_IS_VIEWPORT*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VIEWPORT())
+
+proc GTK_IS_VIEWPORT_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VIEWPORT())
+
+proc GTK_VIEWPORT_GET_CLASS*(obj: pointer): PGtkViewportClass =
+  result = cast[PGtkViewportClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VIEWPORT()))
+
+proc GTK_TYPE_VPANED*(): GType =
+  result = gtk_vpaned_get_type()
+
+proc GTK_VPANED*(obj: pointer): PGtkVPaned =
+  result = cast[PGtkVPaned](GTK_CHECK_CAST(obj, GTK_TYPE_VPANED()))
+
+proc GTK_VPANED_CLASS*(klass: pointer): PGtkVPanedClass =
+  result = cast[PGtkVPanedClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VPANED()))
+
+proc GTK_IS_VPANED*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VPANED())
+
+proc GTK_IS_VPANED_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VPANED())
+
+proc GTK_VPANED_GET_CLASS*(obj: pointer): PGtkVPanedClass =
+  result = cast[PGtkVPanedClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VPANED()))
+
+proc GTK_TYPE_VRULER*(): GType =
+  result = gtk_vruler_get_type()
+
+proc GTK_VRULER*(obj: pointer): PGtkVRuler =
+  result = cast[PGtkVRuler](GTK_CHECK_CAST(obj, GTK_TYPE_VRULER()))
+
+proc GTK_VRULER_CLASS*(klass: pointer): PGtkVRulerClass =
+  result = cast[PGtkVRulerClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VRULER()))
+
+proc GTK_IS_VRULER*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VRULER())
+
+proc GTK_IS_VRULER_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VRULER())
+
+proc GTK_VRULER_GET_CLASS*(obj: pointer): PGtkVRulerClass =
+  result = cast[PGtkVRulerClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VRULER()))
+
+proc GTK_TYPE_VSCALE*(): GType =
+  result = gtk_vscale_get_type()
+
+proc GTK_VSCALE*(obj: pointer): PGtkVScale =
+  result = cast[PGtkVScale](GTK_CHECK_CAST(obj, GTK_TYPE_VSCALE()))
+
+proc GTK_VSCALE_CLASS*(klass: pointer): PGtkVScaleClass =
+  result = cast[PGtkVScaleClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VSCALE()))
+
+proc GTK_IS_VSCALE*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VSCALE())
+
+proc GTK_IS_VSCALE_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VSCALE())
+
+proc GTK_VSCALE_GET_CLASS*(obj: pointer): PGtkVScaleClass =
+  result = cast[PGtkVScaleClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VSCALE()))
+
+proc GTK_TYPE_VSCROLLBAR*(): GType =
+  result = gtk_vscrollbar_get_type()
+
+proc GTK_VSCROLLBAR*(obj: pointer): PGtkVScrollbar =
+  result = cast[PGtkVScrollbar](GTK_CHECK_CAST(obj, GTK_TYPE_VSCROLLBAR()))
+
+proc GTK_VSCROLLBAR_CLASS*(klass: pointer): PGtkVScrollbarClass =
+  result = cast[PGtkVScrollbarClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VSCROLLBAR()))
+
+proc GTK_IS_VSCROLLBAR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VSCROLLBAR())
+
+proc GTK_IS_VSCROLLBAR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VSCROLLBAR())
+
+proc GTK_VSCROLLBAR_GET_CLASS*(obj: pointer): PGtkVScrollbarClass =
+  result = cast[PGtkVScrollbarClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VSCROLLBAR()))
+
+proc GTK_TYPE_VSEPARATOR*(): GType =
+  result = gtk_vseparator_get_type()
+
+proc GTK_VSEPARATOR*(obj: pointer): PGtkVSeparator =
+  result = cast[PGtkVSeparator](GTK_CHECK_CAST(obj, GTK_TYPE_VSEPARATOR()))
+
+proc GTK_VSEPARATOR_CLASS*(klass: pointer): PGtkVSeparatorClass =
+  result = cast[PGtkVSeparatorClass](GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_VSEPARATOR()))
+
+proc GTK_IS_VSEPARATOR*(obj: pointer): bool =
+  result = GTK_CHECK_TYPE(obj, GTK_TYPE_VSEPARATOR())
+
+proc GTK_IS_VSEPARATOR_CLASS*(klass: pointer): bool =
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_VSEPARATOR())
+
+proc GTK_VSEPARATOR_GET_CLASS*(obj: pointer): PGtkVSeparatorClass =
+  result = cast[PGtkVSeparatorClass](GTK_CHECK_GET_CLASS(obj, GTK_TYPE_VSEPARATOR()))
+
+
+# these were missing:
+type
+   PGtkCellLayout* = pointer
+   PPGtkCellLayout* = ptr PGtkCellLayout
+   PGtkSignalRunType* = ptr TGtkSignalRunType
+   TGtkSignalRunType* =  int32
+   PGtkFileChooserAction* = ptr TGtkFileChooserAction
+   TGtkFileChooserAction* = enum 
+     GTK_FILE_CHOOSER_ACTION_OPEN,
+     GTK_FILE_CHOOSER_ACTION_SAVE,
+     GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+     GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
+   PGtkFileChooserError* = ptr TGtkFileChooserError
+   TGtkFileChooserError* = enum
+     GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
+     GTK_FILE_CHOOSER_ERROR_BAD_FILENAME
+
+
+const 
+  GTK_ARG_READWRITE* = GTK_ARG_READABLE or GTK_ARG_WRITABLE
+
+proc gtk_binding_entry_add_signal*(binding_set: PGtkBindingSet, keyval: guint, 
+                                   modifiers: TGdkModifierType, 
+                                   signal_name: cstring, n_args: guint){.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_clist_new_with_titles*(columns: gint): PGtkWidget{.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_clist_prepend*(clist: PGtkCList): gint{.importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_clist_append*(clist: PGtkCList): gint{.importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_clist_insert*(clist: PGtkCList, row: gint): gint{.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_cell_layout_set_attributes*(cell_layout: PGtkCellLayout, 
+                                     cell: PGtkCellRenderer){.cdecl, varargs, 
+    importc, dynlib: gtklib, importc: "gtk_cell_layout_set_attributes".}
+proc gtk_container_add_with_properties*(container: PGtkContainer, 
+                                        widget: PGtkWidget, 
+                                        first_prop_name: cstring){.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_container_child_set*(container: PGtkContainer, child: PGtkWidget, 
+                              first_prop_name: cstring){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_container_child_get*(container: PGtkContainer, child: PGtkWidget, 
+                              first_prop_name: cstring){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_container_child_set_valist*(container: PGtkContainer, 
+                                     child: PGtkWidget, 
+                                     first_property_name: cstring){.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_container_child_get_valist*(container: PGtkContainer, 
+                                     child: PGtkWidget, 
+                                     first_property_name: cstring){.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_ctree_new_with_titles*(columns: gint, tree_column: gint): PGtkWidget{.
+    importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_curve_get_vector*(curve: PGtkCurve, veclen: int32){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_curve_set_vector*(curve: PGtkCurve, veclen: int32){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_dialog_add_buttons*(dialog: PGtkDialog, first_button_text: cstring){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_dialog_new_with_buttons*(title: cstring, parent: PGtkWindow, 
+                                  flags: TGtkDialogFlags, 
+                                  first_button_text: cstring): PGtkWidget{.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_list_store_new*(n_columns: gint): PGtkListStore{.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_list_store_set*(list_store: PGtkListStore, iter: PGtkTreeIter){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_list_store_set_valist*(list_store: PGtkListStore, iter: PGtkTreeIter){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_message_dialog_new*(parent: PGtkWindow, flags: TGtkDialogFlags, 
+                             thetype: TGtkMessageType, buttons: TGtkButtonsType, 
+                             message_format: cstring): PGtkWidget{.varargs, 
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_signal_new*(name: cstring, signal_flags: TGtkSignalRunType, 
+                     object_type: TGtkType, function_offset: guint, 
+                     marshaller: TGtkSignalMarshaller, return_val: TGtkType, 
+                     n_args: guint): guint{.
+                     varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_signal_emit*(anObject: PGtkObject, signal_id: guint){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_signal_emit_by_name*(anObject: PGtkObject, name: cstring){.varargs, 
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_text_buffer_insert_with_tags*(buffer: PGtkTextBuffer, 
+                                       iter: PGtkTextIter, text: cstring, 
+                                       length: gint, first_tag: PGtkTextTag){.
+    varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_text_buffer_insert_with_tags_by_name*(buffer: PGtkTextBuffer, 
+    iter: PGtkTextIter, text: cstring, length: gint, first_tag_name: cstring){.
+    varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_text_buffer_create_tag*(buffer: PGtkTextBuffer, tag_name: cstring, 
+                                 first_property_name: cstring): PGtkTextTag{.
+    varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_tree_model_get*(tree_model: PGtkTreeModel, iter: PGtkTreeIter){.
+    varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_tree_model_get_valist*(tree_model: PGtkTreeModel, iter: PGtkTreeIter){.
+    varargs, importc, cdecl, dynlib: gtklib.}
+proc gtk_tree_store_new*(n_columns: gint): PGtkTreeStore{.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_tree_store_set*(tree_store: PGtkTreeStore, iter: PGtkTreeIter){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_tree_store_set_valist*(tree_store: PGtkTreeStore, iter: PGtkTreeIter){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_tree_store_iter_is_valid*(tree_store: PGtkTreeStore, iter: PGtkTreeIter): gboolean{.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_tree_store_reorder*(tree_store: PGtkTreeStore, parent: PGtkTreeIter, 
+                             new_order: pgint){.cdecl, importc, dynlib: gtklib.}
+proc gtk_tree_store_swap*(tree_store: PGtkTreeStore, a: PGtkTreeIter, 
+                          b: PGtkTreeIter){.cdecl, importc, dynlib: gtklib.}
+proc gtk_tree_store_move_before*(tree_store: PGtkTreeStore, iter: PGtkTreeIter, 
+                                 position: PGtkTreeIter){.cdecl,importc,  dynlib: gtklib.}
+proc gtk_tree_store_move_after*(tree_store: PGtkTreeStore, iter: PGtkTreeIter, 
+                                position: PGtkTreeIter){.cdecl,importc,  dynlib: gtklib.}
+proc gtk_tree_view_insert_column_with_attributes*(tree_view: PGtkTreeView, 
+    position: gint, title: cstring, cell: PGtkCellRenderer): gint{.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_tree_view_column_new_with_attributes*(title: cstring, 
+    cell: PGtkCellRenderer): PGtkTreeViewColumn{.importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_tree_view_column_set_attributes*(tree_column: PGtkTreeViewColumn, 
+    cell_renderer: PGtkCellRenderer){.importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_widget_new*(thetype: TGtkType, first_property_name: cstring): PGtkWidget{.
+    importc, varargs, cdecl, dynlib: gtklib.}
+proc gtk_widget_set*(widget: PGtkWidget, first_property_name: cstring){.varargs, 
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_widget_queue_clear*(widget: PGtkWidget){.importc, cdecl, dynlib: gtklib.}
+proc gtk_widget_queue_clear_area*(widget: PGtkWidget, x: gint, y: gint, 
+                                  width: gint, height: gint){.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_widget_draw*(widget: PGtkWidget, area: PGdkRectangle){.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_widget_style_get_valist*(widget: PGtkWidget, 
+                                  first_property_name: cstring){.varargs, cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_widget_style_get*(widget: PGtkWidget, first_property_name: cstring){.
+    varargs, cdecl, importc, dynlib: gtklib.}
+proc gtk_file_chooser_dialog_new*(title: cstring, parent: PGtkWindow, 
+                                  action: TGtkFileChooserAction, 
+                                  first_button_text: cstring): PGtkWidget{.cdecl, 
+    varargs, dynlib: gtklib, importc: "gtk_file_chooser_dialog_new".}
+proc gtk_file_chooser_dialog_new_with_backend*(title: cstring, 
+    parent: PGtkWindow, action: TGtkFileChooserAction, backend: cstring, 
+    first_button_text: cstring): PGtkWidget{.varargs, cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_dialog_new_with_backend".}
+proc gtk_object_ref*(anObject: PGtkObject): PGtkObject{.cdecl,importc,  dynlib: gtklib.}
+proc gtk_object_unref*(anObject: PGtkObject){.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_weakref*(anObject: PGtkObject, notify: TGtkDestroyNotify, 
+                         data: gpointer){.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_weakunref*(anObject: PGtkObject, notify: TGtkDestroyNotify, 
+                           data: gpointer){.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_set_data*(anObject: PGtkObject, key: cstring, data: gpointer){.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_object_set_data_full*(anObject: PGtkObject, key: cstring, 
+                               data: gpointer, destroy: TGtkDestroyNotify){.
+    importc, cdecl, dynlib: gtklib.}
+proc gtk_object_remove_data*(anObject: PGtkObject, key: cstring){.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_object_get_data*(anObject: PGtkObject, key: cstring): gpointer{.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_object_remove_no_notify*(anObject: PGtkObject, key: cstring){.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_object_set_user_data*(anObject: PGtkObject, data: gpointer){.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_object_get_user_data*(anObject: PGtkObject): gpointer{.cdecl, 
+    importc, dynlib: gtklib.}
+proc gtk_object_set_data_by_id*(anObject: PGtkObject, data_id: TGQuark, 
+                                data: gpointer){.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_set_data_by_id_full*(anObject: PGtkObject, data_id: TGQuark, 
+                                     data: gpointer, destroy: TGtkDestroyNotify){.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_object_get_data_by_id*(anObject: PGtkObject, data_id: TGQuark): gpointer{.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_object_remove_data_by_id*(anObject: PGtkObject, data_id: TGQuark){.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_object_remove_no_notify_by_id*(anObject: PGtkObject, key_id: TGQuark){.
+    cdecl, importc, dynlib: gtklib.}
+proc gtk_object_data_try_key*(str: cstring): TGQuark{.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_data_force_id*(str: cstring): TGQuark{.cdecl, importc, dynlib: gtklib.}
+proc gtk_object_get*(anObject: PGtkObject, first_property_name: cstring){.cdecl, 
+    importc, varargs, dynlib: gtklib.}
+proc gtk_object_set*(anObject: PGtkObject, first_property_name: cstring){.cdecl, 
+    importc, varargs, dynlib: gtklib.}
+proc gtk_object_add_arg_type*(arg_name: cstring, arg_type: TGtkType, 
+                              arg_flags: guint, arg_id: guint){.cdecl, 
+    importc, dynlib: gtklib.}
+
+
+type
+  PGtkFileChooser* = pointer
+  PPGtkFileChooser* = ptr PGtkFileChooser
+
+type 
+  PGtkFileFilter* = pointer
+  PPGtkFileFilter* = ref PGtkFileFilter
+  PGtkFileFilterFlags* = ref TGtkFileFilterFlags
+  TGtkFileFilterFlags* = enum 
+    GTK_FILE_FILTER_FILENAME = 1 shl 0, GTK_FILE_FILTER_URI = 1 shl 1, 
+    GTK_FILE_FILTER_DISPLAY_NAME = 1 shl 2, GTK_FILE_FILTER_MIME_TYPE = 1 shl 3
+  PGtkFileFilterInfo* = ref TGtkFileFilterInfo
+  TGtkFileFilterInfo* = record 
+    contains*: TGtkFileFilterFlags
+    filename*: cstring
+    uri*: cstring
+    display_name*: cstring
+    mime_type*: cstring
+
+  TGtkFileFilterFunc* = proc (filter_info: PGtkFileFilterInfo, data: gpointer): gboolean{.
+      cdecl.}
+
+proc GTK_TYPE_FILE_FILTER*(): GType
+proc GTK_FILE_FILTER*(obj: pointer): PGtkFileFilter
+proc GTK_IS_FILE_FILTER*(obj: pointer): gboolean
+proc gtk_file_filter_get_type*(): GType{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_filter_get_type".}
+proc gtk_file_filter_new*(): PGtkFileFilter{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_filter_new".}
+proc gtk_file_filter_set_name*(filter: PGtkFileFilter, name: cstring){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_filter_set_name".}
+proc gtk_file_filter_get_name*(filter: PGtkFileFilter): cstring{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_filter_get_name".}
+proc gtk_file_filter_add_mime_type*(filter: PGtkFileFilter, mime_type: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_file_filter_add_mime_type".}
+proc gtk_file_filter_add_pattern*(filter: PGtkFileFilter, pattern: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_file_filter_add_pattern".}
+proc gtk_file_filter_add_custom*(filter: PGtkFileFilter, 
+                                 needed: TGtkFileFilterFlags, 
+                                 func: TGtkFileFilterFunc, data: gpointer, 
+                                 notify: TGDestroyNotify){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_filter_add_custom".}
+proc gtk_file_filter_get_needed*(filter: PGtkFileFilter): TGtkFileFilterFlags{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_filter_get_needed".}
+proc gtk_file_filter_filter*(filter: PGtkFileFilter, 
+                             filter_info: PGtkFileFilterInfo): gboolean{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_filter_filter".}
+
+proc GTK_TYPE_FILE_FILTER(): GType = 
+  result = gtk_file_filter_get_type()
+
+proc GTK_FILE_FILTER(obj: pointer): PGtkFileFilter = 
+  result = cast[PGtkFileFilter](G_TYPE_CHECK_INSTANCE_CAST(obj, 
+                                GTK_TYPE_FILE_FILTER()))
+
+proc GTK_IS_FILE_FILTER(obj: pointer): gboolean = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_FILE_FILTER())
+
+
+proc gtk_file_chooser_get_type*():GType {.
+  cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_type".}
+
+proc gtk_file_chooser_error_quark*(): TGQuark {.
+  cdecl, dynlib: gtklib, importc: "gtk_file_chooser_error_quark".}
+
+proc GTK_TYPE_FILE_CHOOSER*(): GType =
+  result = gtk_file_chooser_get_type()
+
+proc GTK_FILE_CHOOSER*(obj: pointer): PGtkFileChooser =
+  result = cast[PGtkFileChooser](G_TYPE_CHECK_INSTANCE_CAST(obj, 
+    GTK_TYPE_FILE_CHOOSER()))
+
+proc GTK_IS_FILE_CHOOSER*(obj: pointer): gboolean =
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GTK_TYPE_FILE_CHOOSER())
+
+proc gtk_file_chooser_set_action*(chooser: PGtkFileChooser, 
+                                  action: TGtkFileChooserAction){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_set_action".}
+proc gtk_file_chooser_get_action*(chooser: PGtkFileChooser): TGtkFileChooserAction{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_action".}
+proc gtk_file_chooser_set_local_only*(chooser: PGtkFileChooser, 
+                                      local_only: gboolean){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_set_local_only".}
+proc gtk_file_chooser_get_local_only*(chooser: PGtkFileChooser): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_local_only".}
+proc gtk_file_chooser_set_select_multiple*(chooser: PGtkFileChooser, 
+    select_multiple: gboolean){.cdecl, dynlib: gtklib, 
+                                importc: "gtk_file_chooser_set_select_multiple".}
+proc gtk_file_chooser_get_select_multiple*(chooser: PGtkFileChooser): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_select_multiple".}
+proc gtk_file_chooser_set_current_name*(chooser: PGtkFileChooser, name: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_set_current_name".}
+proc gtk_file_chooser_get_filename*(chooser: PGtkFileChooser): cstring{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_get_filename".}
+proc gtk_file_chooser_set_filename*(chooser: PGtkFileChooser, filename: cstring): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_set_filename".}
+proc gtk_file_chooser_select_filename*(chooser: PGtkFileChooser, 
+                                       filename: cstring): gboolean{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_select_filename".}
+proc gtk_file_chooser_unselect_filename*(chooser: PGtkFileChooser, 
+    filename: cstring){.cdecl, dynlib: gtklib, 
+                        importc: "gtk_file_chooser_unselect_filename".}
+proc gtk_file_chooser_select_all*(chooser: PGtkFileChooser){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_select_all".}
+proc gtk_file_chooser_unselect_all*(chooser: PGtkFileChooser){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_unselect_all".}
+proc gtk_file_chooser_get_filenames*(chooser: PGtkFileChooser): PGSList{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_get_filenames".}
+proc gtk_file_chooser_set_current_folder*(chooser: PGtkFileChooser, 
+    filename: cstring): gboolean{.cdecl, dynlib: gtklib, 
+                                 importc: "gtk_file_chooser_set_current_folder".}
+proc gtk_file_chooser_get_current_folder*(chooser: PGtkFileChooser): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_current_folder".}
+proc gtk_file_chooser_get_uri*(chooser: PGtkFileChooser): cstring{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_get_uri".}
+proc gtk_file_chooser_set_uri*(chooser: PGtkFileChooser, uri: cstring): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_set_uri".}
+proc gtk_file_chooser_select_uri*(chooser: PGtkFileChooser, uri: cstring): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_select_uri".}
+proc gtk_file_chooser_unselect_uri*(chooser: PGtkFileChooser, uri: cstring){.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_unselect_uri".}
+proc gtk_file_chooser_get_uris*(chooser: PGtkFileChooser): PGSList{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_get_uris".}
+proc gtk_file_chooser_set_current_folder_uri*(chooser: PGtkFileChooser, 
+    uri: cstring): gboolean{.cdecl, dynlib: gtklib, 
+                            importc: "gtk_file_chooser_set_current_folder_uri".}
+proc gtk_file_chooser_get_current_folder_uri*(chooser: PGtkFileChooser): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_current_folder_uri".}
+proc gtk_file_chooser_set_preview_widget*(chooser: PGtkFileChooser, 
+    preview_widget: PGtkWidget){.cdecl, dynlib: gtklib, 
+                                 importc: "gtk_file_chooser_set_preview_widget".}
+proc gtk_file_chooser_get_preview_widget*(chooser: PGtkFileChooser): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_preview_widget".}
+proc gtk_file_chooser_set_preview_widget_active*(chooser: PGtkFileChooser, 
+    active: gboolean){.cdecl, dynlib: gtklib, 
+                       importc: "gtk_file_chooser_set_preview_widget_active".}
+proc gtk_file_chooser_get_preview_widget_active*(chooser: PGtkFileChooser): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_preview_widget_active".}
+proc gtk_file_chooser_set_use_preview_label*(chooser: PGtkFileChooser, 
+    use_label: gboolean){.cdecl, dynlib: gtklib, 
+                          importc: "gtk_file_chooser_set_use_preview_label".}
+proc gtk_file_chooser_get_use_preview_label*(chooser: PGtkFileChooser): gboolean{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_use_preview_label".}
+proc gtk_file_chooser_get_preview_filename*(chooser: PGtkFileChooser): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_preview_filename".}
+proc gtk_file_chooser_get_preview_uri*(chooser: PGtkFileChooser): cstring{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_preview_uri".}
+proc gtk_file_chooser_set_extra_widget*(chooser: PGtkFileChooser, 
+                                        extra_widget: PGtkWidget){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_set_extra_widget".}
+proc gtk_file_chooser_get_extra_widget*(chooser: PGtkFileChooser): PGtkWidget{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_extra_widget".}
+proc gtk_file_chooser_add_filter*(chooser: PGtkFileChooser, 
+                                  filter: PGtkFileFilter){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_add_filter".}
+proc gtk_file_chooser_remove_filter*(chooser: PGtkFileChooser, 
+                                     filter: PGtkFileFilter){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_remove_filter".}
+proc gtk_file_chooser_list_filters*(chooser: PGtkFileChooser): PGSList{.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_list_filters".}
+proc gtk_file_chooser_set_filter*(chooser: PGtkFileChooser, 
+                                  filter: PGtkFileFilter){.cdecl, 
+    dynlib: gtklib, importc: "gtk_file_chooser_set_filter".}
+proc gtk_file_chooser_get_filter*(chooser: PGtkFileChooser): PGtkFileFilter{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_get_filter".}
+proc gtk_file_chooser_add_shortcut_folder*(chooser: PGtkFileChooser, 
+    folder: cstring, error: pointer): gboolean{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_add_shortcut_folder".}
+proc gtk_file_chooser_remove_shortcut_folder*(chooser: PGtkFileChooser, 
+    folder: cstring, error: pointer): gboolean{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_remove_shortcut_folder".}
+proc gtk_file_chooser_list_shortcut_folders*(chooser: PGtkFileChooser): PGSList{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_list_shortcut_folders".}
+proc gtk_file_chooser_add_shortcut_folder_uri*(chooser: PGtkFileChooser, 
+    uri: cstring, error: pointer): gboolean{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_add_shortcut_folder_uri".}
+proc gtk_file_chooser_remove_shortcut_folder_uri*(chooser: PGtkFileChooser, 
+    uri: cstring, error: pointer): gboolean{.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_remove_shortcut_folder_uri".}
+proc gtk_file_chooser_list_shortcut_folder_uris*(chooser: PGtkFileChooser): PGSList{.
+    cdecl, dynlib: gtklib, importc: "gtk_file_chooser_list_shortcut_folder_uris".}
+
+proc gtk_file_chooser_set_do_overwrite_confirmation*(chooser: PGtkFileChooser,
+    do_overwrite_confirmation: gboolean) {.cdecl, dynlib: gtklib, 
+    importc: "gtk_file_chooser_set_do_overwrite_confirmation".}
+
+proc gtk_nimrod_init*() =
+  var
+    cmdLine {.importc: "cmdLine".}: array [0..255, cstring]
+    cmdCount {.importc: "cmdCount".}: int
+  gtk_init(addr(cmdLine), addr(cmdCount))
diff --git a/lib/base/gtk/gtkglext.nim b/lib/base/gtk/gtkglext.nim
new file mode 100755
index 000000000..7d9e35b13
--- /dev/null
+++ b/lib/base/gtk/gtkglext.nim
@@ -0,0 +1,48 @@
+import 
+  Glib2, Gdk2, Gtk2, GdkGLExt
+
+const 
+  GtkGLExtLib* = if defined(WIN32): "libgtkglext-win32-1.0-0.dll" else: "libgtkglext-x11-1.0.so"
+
+const 
+  HEADER_GTKGLEXT_MAJOR_VERSION* = 1
+  HEADER_GTKGLEXT_MINOR_VERSION* = 0
+  HEADER_GTKGLEXT_MICRO_VERSION* = 6
+  HEADER_GTKGLEXT_INTERFACE_AGE* = 4
+  HEADER_GTKGLEXT_BINARY_AGE* = 6
+
+proc gtk_gl_parse_args*(argc: Plongint, argv: PPPChar): gboolean{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_gl_parse_args".}
+proc gtk_gl_init_check*(argc: Plongint, argv: PPPChar): gboolean{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_gl_init_check".}
+proc gtk_gl_init*(argc: Plongint, argv: PPPChar){.cdecl, dynlib: GtkGLExtLib, 
+    importc: "gtk_gl_init".}
+proc gtk_widget_set_gl_capability*(widget: PGtkWidget, glconfig: PGdkGLConfig, 
+                                   share_list: PGdkGLContext, direct: gboolean, 
+                                   render_type: int): gboolean{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_set_gl_capability".}
+proc gtk_widget_is_gl_capable*(widget: PGtkWidget): gboolean{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_is_gl_capable".}
+proc gtk_widget_get_gl_config*(widget: PGtkWidget): PGdkGLConfig{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_get_gl_config".}
+proc gtk_widget_create_gl_context*(widget: PGtkWidget, 
+                                   share_list: PGdkGLContext, direct: gboolean, 
+                                   render_type: int): PGdkGLContext{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_create_gl_context".}
+proc gtk_widget_get_gl_context*(widget: PGtkWidget): PGdkGLContext{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_get_gl_context".}
+proc gtk_widget_get_gl_window*(widget: PGtkWidget): PGdkGLWindow{.cdecl, 
+    dynlib: GtkGLExtLib, importc: "gtk_widget_get_gl_window".}
+proc gtk_widget_get_gl_drawable*(widget: PGtkWidget): PGdkGLDrawable = 
+  nil
+
+proc HEADER_GTKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool = 
+  result = (HEADER_GTKGLEXT_MAJOR_VERSION > major) or
+      ((HEADER_GTKGLEXT_MAJOR_VERSION == major) and
+      (HEADER_GTKGLEXT_MINOR_VERSION > minor)) or
+      ((HEADER_GTKGLEXT_MAJOR_VERSION == major) and
+      (HEADER_GTKGLEXT_MINOR_VERSION == minor) and
+      (HEADER_GTKGLEXT_MICRO_VERSION >= micro))
+
+proc gtk_widget_get_gl_drawable*(widget: PGtkWidget): PGdkGLDrawable = 
+  result = GDK_GL_DRAWABLE(gtk_widget_get_gl_window(widget))
diff --git a/lib/base/gtk/gtkhtml.nim b/lib/base/gtk/gtkhtml.nim
new file mode 100755
index 000000000..5599eec2b
--- /dev/null
+++ b/lib/base/gtk/gtkhtml.nim
@@ -0,0 +1,497 @@
+import 
+  gtk2, glib2, atk, pango, gdk2pixbuf, gdk2
+
+when defined(windows): 
+  {.define: GTK_WINDOWING_WIN32.}
+  const 
+    gtkhtmllib = "libgtkhtml-win32-2.0-0.dll"
+else: 
+  const 
+    gtkhtmllib = "libgtkhtml-2.so"
+const 
+  DOM_UNSPECIFIED_EVENT_TYPE_ERR* = 0
+  DOM_INDEX_SIZE_ERR* = 1
+  DOM_DOMSTRING_SIZE_ERR* = 2
+  DOM_HIERARCHY_REQUEST_ERR* = 3
+  DOM_WRONG_DOCUMENT_ERR* = 4
+  DOM_INVALID_CHARACTER_ERR* = 5
+  DOM_NO_DATA_ALLOWED_ERR* = 6
+  DOM_NO_MODIFICATION_ALLOWED_ERR* = 7
+  DOM_NOT_FOUND_ERR* = 8
+  DOM_NOT_SUPPORTED_ERR* = 9
+  DOM_INUSE_ATTRIBUTE_ERR* = 10
+  DOM_INVALID_STATE_ERR* = 11
+  DOM_SYNTAX_ERR* = 12
+  DOM_INVALID_MODIFICATION_ERR* = 13
+  DOM_NAMESPACE_ERR* = 14
+  DOM_INVALID_ACCESS_ERR* = 15
+  DOM_NO_EXCEPTION* = 255
+  DOM_ELEMENT_NODE* = 1
+  DOM_ATTRIBUTE_NODE* = 2
+  DOM_TEXT_NODE* = 3
+  DOM_CDATA_SECTION_NODE* = 4
+  DOM_ENTITY_REFERENCE_NODE* = 5
+  DOM_ENTITY_NODE* = 6
+  DOM_PROCESSING_INSTRUCTION_NODE* = 7
+  DOM_COMMENT_NODE* = 8
+  DOM_DOCUMENT_NODE* = 9
+  DOM_DOCUMENT_TYPE_NODE* = 10
+  DOM_DOCUMENT_FRAGMENT_NODE* = 11
+  DOM_NOTATION_NODE* = 12
+  bm__HtmlFontSpecification_weight* = 0x0000000F
+  bp__HtmlFontSpecification_weight* = 0
+  bm__HtmlFontSpecification_style* = 0x00000030
+  bp__HtmlFontSpecification_style* = 4
+  bm__HtmlFontSpecification_variant* = 0x000000C0
+  bp__HtmlFontSpecification_variant* = 6
+  bm__HtmlFontSpecification_stretch* = 0x00000F00
+  bp__HtmlFontSpecification_stretch* = 8
+  bm__HtmlFontSpecification_decoration* = 0x00007000
+  bp__HtmlFontSpecification_decoration* = 12
+
+type 
+  TDomString* = gchar
+  TDomBoolean* = gboolean
+  TDomException* = gushort
+  TDomTimeStamp* = guint64
+  PDomNode* = ptr TDomNode
+  TDomNode* = object of TGObject
+    xmlnode*: pointer
+    style*: pointer
+
+  PDomNodeClass* = ptr TDomNodeClass
+  TDomNodeClass* = object of TGObjectClass
+    `get_nodeName`*: proc (node: PDomNode): PDomString{.cdecl.}
+    `get_nodeValue`*: proc (node: PDomNode, exc: PDomException): PDomString {.
+        cdecl.}
+    `set_nodeValue`*: proc (node: PDomNode, value: PDomString, 
+                            exc: PDomException): PDomString{.cdecl.}
+
+  PDomDocument* = ptr TDomDocument
+  TDomDocument* = record 
+    parent*: PDomNode
+    iterators*: PGSList
+
+  PDomDocumentClass* = ptr TDomDocumentClass
+  TDomDocumentClass* = record 
+    parent_class*: PDomNodeClass
+
+  PHtmlFocusIterator* = ptr THtmlFocusIterator
+  THtmlFocusIterator* = object of TGObject
+    document*: PDomDocument
+    current_node*: PDomNode
+
+  PHtmlFocusIteratorClass* = ptr THtmlFocusIteratorClass
+  THtmlFocusIteratorClass* = object of TGObjectClass
+
+  THtmlParserType* = enum 
+    HTML_PARSER_TYPE_HTML, HTML_PARSER_TYPE_XML
+  PHtmlParser* = ptr THtmlParser
+  THtmlParser* = object of TGObject
+    parser_type*: THtmlParserType
+    document*: PHtmlDocument
+    stream*: PHtmlStream
+    xmlctxt*: xmlParserCtxtPtr
+    res*: int32
+    chars*: array[0..9, char]
+    blocking*: gboolean
+    blocking_node*: PDomNode
+
+  PHtmlParserClass* = ptr THtmlParserClass
+  THtmlParserClass* = object of TGtkObjectClass
+    done_parsing*: proc (parser: PHtmlParser){.cdecl.}
+    new_node*: proc (parser: PHtmlParser, node: PDomNode)
+    parsed_document_node*: proc (parser: PHtmlParser, document: PDomDocument)
+
+  PHtmlStream* = ptr THtmlStream
+  THtmlStreamCloseFunc* = proc (stream: PHtmlStream, user_data: gpointer){.cdecl.}
+  THtmlStreamWriteFunc* = proc (stream: PHtmlStream, buffer: Pgchar, 
+                                size: guint, user_data: gpointer){.cdecl.}
+  THtmlStreamCancelFunc* = proc (stream: PHtmlStream, user_data: gpointer, 
+                                 cancel_data: gpointer){.cdecl.}
+  THtmlStream* = object of TGObject
+    write_func*: THtmlStreamWriteFunc
+    close_func*: THtmlStreamCloseFunc
+    cancel_func*: THtmlStreamCancelFunc
+    user_data*: gpointer
+    cancel_data*: gpointer
+    written*: gint
+    mime_type*: cstring
+
+  PHtmlStreamClass* = ptr THtmlStreamClass
+  THtmlStreamClass* = object of TGObjectClass
+
+  THtmlStreamBufferCloseFunc* = proc (str: Pgchar, len: gint, 
+                                      user_data: gpointer){.cdecl.}
+  PGtkHtmlContext* = ptr TGtkHtmlContext
+  TGtkHtmlContext* = object of TGObject
+    documents*: PGSList
+    standard_font*: PHtmlFontSpecification
+    fixed_font*: PHtmlFontSpecification
+    debug_painting*: gboolean
+
+  PGtkHtmlContextClass* = ptr TGtkHtmlContextClass
+  TGtkHtmlContextClass* = object of TGObjectClass
+
+  THtmlDocumentState* = enum 
+    HTML_DOCUMENT_STATE_DONE, HTML_DOCUMENT_STATE_PARSING
+  PHtmlDocument* = ptr THtmlDocument
+  THtmlDocument* = object of TGObject
+    stylesheets*: PGSList
+    current_stream*: PHtmlStream
+    state*: THtmlDocumentState
+
+  PHtmlDocumentClass* = ptr THtmlDocumentClass
+  THtmlDocumentClass* = object of TGObjectClass
+    request_url*: proc (document: PHtmlDocument, url: Pgchar, 
+                        stream: PHtmlStream){.cdecl.}
+    link_clicked*: proc (document: PHtmlDocument, url: Pgchar){.cdecl.}
+    set_base*: proc (document: PHtmlDocument, url: Pgchar){.cdecl.}
+    title_changed*: proc (document: PHtmlDocument, new_title: Pgchar){.cdecl.}
+    submit*: proc (document: PHtmlDocument, `method`: Pgchar, url: Pgchar, 
+                   encoding: Pgchar){.cdecl.}
+
+  PHtmlView* = ptr THtmlView
+  THtmlView* = object of TGtkLayout
+    document*: PHtmlDocument
+    node_table*: PGHashTable
+    relayout_idle_id*: guint
+    relayout_timeout_id*: guint
+    mouse_down_x*: gint
+    mouse_down_y*: gint
+    mouse_detail*: gint
+    sel_start_ypos*: gint
+    sel_start_index*: gint
+    sel_end_ypos*: gint
+    sel_end_index*: gint
+    sel_flag*: gboolean
+    sel_backwards*: gboolean
+    sel_start_found*: gboolean
+    sel_list*: PGSList
+    jump_to_anchor*: pgchar
+    magnification*: gdouble
+    magnification_modified*: gboolean
+    on_url*: gboolean
+
+  PHtmlViewClass* = ptr THtmlViewClass
+  THtmlViewClass* = object of TGtkLayoutClass
+    move_cursor*: proc (html_view: PHtmlView, step: TGtkMovementStep, 
+                        count: gint, extend_selection: gboolean){.cdecl.}
+    on_url*: proc (html_view: PHtmlView, url: Pgchar)
+    activate*: proc (html_view: PHtmlView)
+    move_focus_out*: proc (html_view: PHtmlView, direction: TGtkDirectionType)
+
+
+proc DOM_TYPE_NODE*(): GType
+proc DOM_NODE*(theobject: pointer): PDomNode
+proc DOM_NODE_CLASS*(klass: pointer): PDomNodeClass
+proc DOM_IS_NODE*(theobject: pointer): bool
+proc DOM_IS_NODE_CLASS*(klass: pointer): bool
+proc DOM_NODE_GET_CLASS*(obj: pointer): int32
+proc dom_node_get_type*(): GType{.cdecl, dynlib: gtkhtmllib, 
+                                  importc: "dom_node_get_type".}
+proc dom_Node_mkref*(node: pointer): PDomNode{.cdecl, dynlib: gtkhtmllib, 
+    importc: "dom_Node_mkref".}
+proc dom_Node__get_childNodes*(node: PDomNode): PDomNodeList{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_childNodes".}
+proc dom_Node_removeChild*(node: PDomNode, oldChild: PDomNode, 
+                           exc: PDomException): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_removeChild".}
+proc dom_Node__get_nodeValue*(node: PDomNode, exc: PDomException): PDomString{.
+    cdecl, dynlib: gtkhtmllib, importc: "dom_Node__get_nodeValue".}
+proc dom_Node__get_firstChild*(node: PDomNode): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_firstChild".}
+proc dom_Node__get_nodeName*(node: PDomNode): PDomString{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_nodeName".}
+proc dom_Node__get_attributes*(node: PDomNode): PDomNamedNodeMap{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_attributes".}
+proc dom_Document__get_doctype*(doc: PDomDocument): PDomDocumentType{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Document__get_doctype".}
+proc dom_Node_hasChildNodes*(node: PDomNode): DomBoolean{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_hasChildNodes".}
+proc dom_Node__get_parentNode*(node: PDomNode): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_parentNode".}
+proc dom_Node__get_nextSibling*(node: PDomNode): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_nextSibling".}
+proc dom_Node__get_nodeType*(node: PDomNode): gushort{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_nodeType".}
+proc dom_Node_hasAttributes*(node: PDomNode): DomBoolean{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_hasAttributes".}
+proc dom_Node_cloneNode*(node: PDomNode, deep: DomBoolean): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_cloneNode".}
+proc dom_Node_appendChild*(node: PDomNode, newChild: PDomNode, 
+                           exc: PDomException): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_appendChild".}
+proc dom_Node__get_localName*(node: PDomNode): PDomString{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_localName".}
+proc dom_Node__get_namespaceURI*(node: PDomNode): PDomString{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_namespaceURI".}
+proc dom_Node__get_previousSibling*(node: PDomNode): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_previousSibling".}
+proc dom_Node__get_lastChild*(node: PDomNode): PDomNode{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_lastChild".}
+proc dom_Node__set_nodeValue*(node: PDomNode, value: PDomString, 
+                              exc: PDomException){.cdecl, dynlib: gtkhtmllib, 
+    importc: "dom_Node__set_nodeValue".}
+proc dom_Node__get_ownerDocument*(node: PDomNode): PDomDocument{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node__get_ownerDocument".}
+proc dom_Node_hasAttributes*(node: PDomNode): gboolean{.cdecl, 
+    dynlib: gtkhtmllib, importc: "dom_Node_hasAttributes".}
+proc DOM_TYPE_DOCUMENT*(): GType
+proc DOM_DOCUMENT*(theobject: pointer): PDomDocument
+proc DOM_DOCUMENT_CLASS*(klass: pointer): PDomDocumentClass
+proc DOM_IS_DOCUMENT*(theobject: pointer): bool
+proc DOM_IS_DOCUMENT_CLASS*(klass: pointer): bool
+proc DOM_DOCUMENT_GET_CLASS*(obj: pointer): PDomDocumentClass
+proc dom_document_get_type*(): GType
+proc dom_Document__get_documentElement*(doc: PDomDocument): PDomElement
+proc dom_Document_createElement*(doc: PDomDocument, tagName: PDomString): PDomElement
+proc dom_Document_createTextNode*(doc: PDomDocument, data: PDomString): PDomText
+proc dom_Document_createComment*(doc: PDomDocument, data: PDomString): PDomComment
+proc dom_Document_importNode*(doc: PDomDocument, importedNode: PDomNode, 
+                              deep: DomBoolean, exc: PDomException): PDomNode
+proc HTML_TYPE_FOCUS_ITERATOR*(): GType
+proc HTML_FOCUS_ITERATOR*(theobject: pointer): PHtmlFocusIterator
+proc HTML_FOCUS_ITERATOR_CLASS*(klass: pointer): PHtmlFocusIteratorClass
+proc HTML_IS_FOCUS_ITERATOR*(theobject: pointer): bool
+proc HTML_IS_FOCUS_ITERATOR_CLASS*(klass: pointer): bool
+proc HTML_FOCUS_ITERATOR_GET_CLASS*(obj: pointer): PHtmlFocusIteratorClass
+proc html_focus_iterator_next_element*(document: PDomDocument, 
+                                       element: PDomElement): PDomElement{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_focus_iterator_next_element".}
+proc html_focus_iterator_prev_element*(document: PDomDocument, 
+                                       element: PDomElement): PDomElement{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_focus_iterator_prev_element".}
+proc HTML_PARSER_TYPE*(): GType
+proc HTML_PARSER*(obj: pointer): PHtmlParser
+proc HTML_PARSER_CLASS*(klass: pointer): PHtmlParserClass
+proc HTML_IS_PARSER*(obj: pointer): bool
+proc html_parser_get_type*(): GType
+proc html_parser_new*(document: PHtmlDocument, parser_type: THtmlParserType): PHtmlParser
+proc HTML_TYPE_STREAM*(): GType
+proc HTML_STREAM*(obj: pointer): PHtmlStream
+proc HTML_STREAM_CLASS*(klass: pointer): PHtmlStreamClass
+proc HTML_IS_STREAM*(obj: pointer): bool
+proc HTML_IS_STREAM_CLASS*(klass: pointer): bool
+proc HTML_STREAM_GET_CLASS*(obj: pointer): PHtmlStreamClass
+proc html_stream_get_type*(): GType{.cdecl, dynlib: gtkhtmllib, 
+                                     importc: "html_stream_get_type".}
+proc html_stream_new*(write_func: THtmlStreamWriteFunc, 
+                      close_func: THtmlStreamCloseFunc, user_data: gpointer): PHtmlStream{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_stream_new".}
+proc html_stream_write*(stream: PHtmlStream, buffer: Pgchar, size: guint){.
+    cdecl, dynlib: gtkhtmllib, importc: "html_stream_write".}
+proc html_stream_close*(stream: PHtmlStream){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_stream_close".}
+proc html_stream_destroy*(stream: PHtmlStream){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_stream_destroy".}
+proc html_stream_get_written*(stream: PHtmlStream): gint{.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_stream_get_written".}
+proc html_stream_cancel*(stream: PHtmlStream){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_stream_cancel".}
+proc html_stream_set_cancel_func*(stream: PHtmlStream, 
+                                  abort_func: THtmlStreamCancelFunc, 
+                                  cancel_data: gpointer){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_stream_set_cancel_func".}
+proc html_stream_get_mime_type*(stream: PHtmlStream): cstring{.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_stream_get_mime_type".}
+proc html_stream_set_mime_type*(stream: PHtmlStream, mime_type: cstring){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_stream_set_mime_type".}
+proc html_stream_buffer_new*(close_func: THtmlStreamBufferCloseFunc, 
+                             user_data: gpointer): PHtmlStream{.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_stream_buffer_new".}
+proc html_event_mouse_move*(view: PHtmlView, event: PGdkEventMotion){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_event_mouse_move".}
+proc html_event_button_press*(view: PHtmlView, button: PGdkEventButton){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_event_button_press".}
+proc html_event_button_release*(view: PHtmlView, event: PGdkEventButton){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_event_button_release".}
+proc html_event_activate*(view: PHtmlView){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_event_activate".}
+proc html_event_key_press*(view: PHtmlView, event: PGdkEventKey): gboolean{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_event_key_press".}
+proc html_event_find_root_box*(self: PHtmlBox, x: gint, y: gint): PHtmlBox{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_event_find_root_box".}
+proc html_selection_start*(view: PHtmlView, event: PGdkEventButton){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_selection_start".}
+proc html_selection_end*(view: PHtmlView, event: PGdkEventButton){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_selection_end".}
+proc html_selection_update*(view: PHtmlView, event: PGdkEventMotion){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_selection_update".}
+proc html_selection_clear*(view: PHtmlView){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_selection_clear".}
+proc html_selection_set*(view: PHtmlView, start: PDomNode, offset: int32, 
+                         len: int32){.cdecl, dynlib: gtkhtmllib, 
+                                      importc: "html_selection_set".}
+proc GTK_HTML_CONTEXT_TYPE*(): GType
+proc GTK_HTML_CONTEXT*(obj: pointer): PGtkHtmlContext
+proc GTK_HTML_CONTEXT_CLASS*(klass: pointer): PGtkHtmlContextClass
+proc GTK_HTML_IS_CONTEXT*(obj: pointer): bool
+proc GTK_HTML_IS_CONTEXT_CLASS*(klass: pointer): bool
+proc gtk_html_context_get_type*(): GType
+proc gtk_html_context_get*(): PGtkHtmlContext
+proc HTML_TYPE_DOCUMENT*(): GType
+proc HTML_DOCUMENT*(obj: pointer): PHtmlDocument
+proc HTML_DOCUMENT_CLASS*(klass: pointer): PHtmlDocumentClass
+proc HTML_IS_DOCUMENT*(obj: pointer): bool
+proc html_document_get_type*(): GType{.cdecl, dynlib: gtkhtmllib, 
+                                       importc: "html_document_get_type".}
+proc html_document_new*(): PHtmlDocument{.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_document_new".}
+proc html_document_open_stream*(document: PHtmlDocument, mime_type: Pgchar): gboolean{.
+    cdecl, dynlib: gtkhtmllib, importc: "html_document_open_stream".}
+proc html_document_write_stream*(document: PHtmlDocument, buffer: Pgchar, 
+                                 len: gint){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_document_write_stream".}
+proc html_document_close_stream*(document: PHtmlDocument){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_document_close_stream".}
+proc html_document_clear*(document: PHtmlDocument){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_document_clear".}
+proc HTML_TYPE_VIEW*(): GType
+proc HTML_VIEW*(obj: pointer): PHtmlView
+proc HTML_VIEW_CLASS*(klass: pointer): PHtmlViewClass
+proc HTML_IS_VIEW*(obj: pointer): bool
+proc html_view_get_type*(): GType{.cdecl, dynlib: gtkhtmllib, 
+                                   importc: "html_view_get_type".}
+proc html_view_new*(): PGtkWidget{.cdecl, dynlib: gtkhtmllib, 
+                                   importc: "html_view_new".}
+proc html_view_set_document*(view: PHtmlView, document: PHtmlDocument){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_view_set_document".}
+proc html_view_jump_to_anchor*(view: PHtmlView, anchor: Pgchar){.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_view_jump_to_anchor".}
+proc html_view_get_magnification*(view: PHtmlView): gdouble{.cdecl, 
+    dynlib: gtkhtmllib, importc: "html_view_get_magnification".}
+proc html_view_set_magnification*(view: PHtmlView, magnification: gdouble){.
+    cdecl, dynlib: gtkhtmllib, importc: "html_view_set_magnification".}
+proc html_view_zoom_in*(view: PHtmlView){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_view_zoom_in".}
+proc html_view_zoom_out*(view: PHtmlView){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_view_zoom_out".}
+proc html_view_zoom_reset*(view: PHtmlView){.cdecl, dynlib: gtkhtmllib, 
+    importc: "html_view_zoom_reset".}
+proc DOM_TYPE_NODE*(): GType = 
+  result = dom_node_get_type()
+
+proc DOM_NODE*(theobject: pointer): PDomNode = 
+  result = G_TYPE_CHECK_INSTANCE_CAST(theobject, DOM_TYPE_NODE(), TDomNode)
+
+proc DOM_NODE_CLASS*(klass: pointer): PDomNodeClass = 
+  result = G_TYPE_CHECK_CLASS_CAST(klass, DOM_TYPE_NODE(), TDomNodeClass)
+
+proc DOM_IS_NODE*(theobject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, DOM_TYPE_NODE())
+
+proc DOM_IS_NODE_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, DOM_TYPE_NODE())
+
+proc DOM_NODE_GET_CLASS*(obj: pointer): PDomNodeClass = 
+  result = G_TYPE_INSTANCE_GET_CLASS(obj, DOM_TYPE_NODE(), TDomNodeClass)
+
+proc DOM_TYPE_DOCUMENT*(): GType = 
+  result = dom_document_get_type()
+
+proc DOM_DOCUMENT*(theobject: pointer): PDomDocument = 
+  result = G_TYPE_CHECK_INSTANCE_CAST(theobject, DOM_TYPE_DOCUMENT(), TDomDocument)
+
+proc DOM_DOCUMENT_CLASS*(klass: pointer): PDomDocumentClass = 
+  result = G_TYPE_CHECK_CLASS_CAST(klass, DOM_TYPE_DOCUMENT(), TDomDocumentClass)
+
+proc DOM_IS_DOCUMENT*(theobject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, DOM_TYPE_DOCUMENT())
+
+proc DOM_IS_DOCUMENT_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, DOM_TYPE_DOCUMENT())
+
+proc DOM_DOCUMENT_GET_CLASS*(obj: pointer): PDomDocumentClass = 
+  result = G_TYPE_INSTANCE_GET_CLASS(obj, DOM_TYPE_DOCUMENT(), TDomDocumentClass)
+
+proc HTML_TYPE_FOCUS_ITERATOR*(): GType = 
+  result = html_focus_iterator_get_type()
+
+proc HTML_FOCUS_ITERATOR*(theobject: pointer): PHtmlFocusIterator = 
+  result = G_TYPE_CHECK_INSTANCE_CAST(theobject, HTML_TYPE_FOCUS_ITERATOR(), 
+                                      HtmlFocusIterator)
+
+proc HTML_FOCUS_ITERATOR_CLASS*(klass: pointer): PHtmlFocusIteratorClass = 
+  result = G_TYPE_CHECK_CLASS_CAST(klass, HTML_TYPE_FOCUS_ITERATOR(), 
+                                   HtmlFocusIteratorClass)
+
+proc HTML_IS_FOCUS_ITERATOR*(theobject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, HTML_TYPE_FOCUS_ITERATOR())
+
+proc HTML_IS_FOCUS_ITERATOR_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, HTML_TYPE_FOCUS_ITERATOR())
+
+proc HTML_FOCUS_ITERATOR_GET_CLASS*(obj: pointer): PHtmlFocusIteratorClass = 
+  result = G_TYPE_INSTANCE_GET_CLASS(obj, HTML_TYPE_FOCUS_ITERATOR(), 
+                                     HtmlFocusIteratorClass)
+
+proc HTML_PARSER_TYPE*(): GType = 
+  result = html_parser_get_type()
+
+proc HTML_PARSER*(obj: pointer): PHtmlParser = 
+  result = GTK_CHECK_CAST(obj, HTML_PARSER_TYPE(), THtmlParser)
+
+proc HTML_PARSER_CLASS*(klass: pointer): PHtmlParserClass = 
+  result = GTK_CHECK_CLASS_CAST(klass, HTML_PARSER_TYPE(), THtmlParserClass)
+
+proc HTML_IS_PARSER*(obj: pointer): bool = 
+  result = GTK_CHECK_TYPE(obj, HTML_PARSER_TYPE())
+
+proc HTML_TYPE_STREAM*(): GType = 
+  result = html_stream_get_type()
+
+proc HTML_STREAM*(obj: pointer): PHtmlStream = 
+  result = PHtmlStream(G_TYPE_CHECK_INSTANCE_CAST(obj, HTML_TYPE_STREAM()))
+
+proc HTML_STREAM_CLASS*(klass: pointer): PHtmlStreamClass = 
+  result = G_TYPE_CHECK_CLASS_CAST(klass, HTML_TYPE_STREAM())
+
+proc HTML_IS_STREAM*(obj: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, HTML_TYPE_STREAM())
+
+proc HTML_IS_STREAM_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, HTML_TYPE_STREAM())
+
+proc HTML_STREAM_GET_CLASS*(obj: pointer): PHtmlStreamClass = 
+  result = PHtmlStreamClass(G_TYPE_INSTANCE_GET_CLASS(obj, HTML_TYPE_STREAM()))
+
+proc GTK_HTML_CONTEXT_TYPE*(): GType = 
+  result = gtk_html_context_get_type()
+
+proc GTK_HTML_CONTEXT*(obj: pointer): PGtkHtmlContext = 
+  result = GTK_CHECK_CAST(obj, GTK_HTML_CONTEXT_TYPE(), TGtkHtmlContext)
+
+proc GTK_HTML_CONTEXT_CLASS*(klass: pointer): PGtkHtmlContextClass = 
+  result = GTK_CHECK_CLASS_CAST(klass, GTK_HTML_CONTEXT_TYPE(), 
+                                TGtkHtmlContextClass)
+
+proc GTK_HTML_IS_CONTEXT*(obj: pointer): bool = 
+  result = GTK_CHECK_TYPE(obj, GTK_HTML_CONTEXT_TYPE())
+
+proc GTK_HTML_IS_CONTEXT_CLASS*(klass: pointer): bool = 
+  result = GTK_CHECK_CLASS_TYPE(klass, GTK_HTML_CONTEXT_TYPE())
+
+proc HTML_TYPE_DOCUMENT*(): GType = 
+  result = html_document_get_type()
+
+proc HTML_DOCUMENT*(obj: pointer): PHtmlDocument = 
+  result = PHtmlDocument(GTK_CHECK_CAST(obj, HTML_TYPE_DOCUMENT()))
+
+proc HTML_DOCUMENT_CLASS*(klass: pointer): PHtmlDocumentClass = 
+  result = GTK_CHECK_CLASS_CAST(klass, HTML_TYPE_DOCUMENT())
+
+proc HTML_IS_DOCUMENT*(obj: pointer): bool = 
+  result = GTK_CHECK_TYPE(obj, HTML_TYPE_DOCUMENT())
+
+proc HTML_TYPE_VIEW*(): GType = 
+  result = html_view_get_type()
+
+proc HTML_VIEW*(obj: pointer): PHtmlView = 
+  result = PHtmlView(GTK_CHECK_CAST(obj, HTML_TYPE_VIEW()))
+
+proc HTML_VIEW_CLASS*(klass: pointer): PHtmlViewClass = 
+  result = PHtmlViewClass(GTK_CHECK_CLASS_CAST(klass, HTML_TYPE_VIEW()))
+
+proc HTML_IS_VIEW*(obj: pointer): bool = 
+  result = GTK_CHECK_TYPE(obj, HTML_TYPE_VIEW())
diff --git a/lib/base/gtk/libglade2.nim b/lib/base/gtk/libglade2.nim
new file mode 100755
index 000000000..18e76584b
--- /dev/null
+++ b/lib/base/gtk/libglade2.nim
@@ -0,0 +1,117 @@
+import 
+  glib2, gtk2
+
+when defined(win32): 
+  {.define: gtkwin.}
+  const 
+    LibGladeLib = "libglade-2.0-0.dll"
+else: 
+  const 
+    LibGladeLib = "libglade-2.0.so"
+type 
+  PLongint* = ptr int32
+  PSmallInt* = ptr int16
+  PByte* = ptr int8
+  PWord* = ptr int16
+  PDWord* = ptr int32
+  PDouble* = ptr float64
+
+proc glade_init*(){.cdecl, dynlib: LibGladeLib, importc: "glade_init".}
+proc glade_require*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib, 
+    importc: "glade_require".}
+proc glade_provide*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib, 
+    importc: "glade_provide".}
+type 
+  PGladeXMLPrivate* = pointer
+  PGladeXML* = ptr TGladeXML
+  TGladeXML* = object of TGObject
+    filename*: cstring
+    priv*: PGladeXMLPrivate
+
+  PGladeXMLClass* = ptr TGladeXMLClass
+  TGladeXMLClass* = object of TGObjectClass
+
+  TGladeXMLConnectFunc* = proc (handler_name: cstring, anObject: PGObject, 
+                                signal_name: cstring, signal_data: cstring, 
+                                connect_object: PGObject, after: gboolean, 
+                                user_data: gpointer){.cdecl.}
+
+proc GLADE_TYPE_XML*(): GType
+proc GLADE_XML*(obj: pointer): PGladeXML
+proc GLADE_XML_CLASS*(klass: pointer): PGladeXMLClass
+proc GLADE_IS_XML*(obj: pointer): gboolean
+proc GLADE_IS_XML_CLASS*(klass: pointer): gboolean
+proc GLADE_XML_GET_CLASS*(obj: pointer): PGladeXMLClass
+proc glade_xml_get_type*(): GType{.cdecl, dynlib: LibGladeLib, 
+                                   importc: "glade_xml_get_type".}
+proc glade_xml_new*(fname: cstring, root: cstring, domain: cstring): PGladeXML{.
+    cdecl, dynlib: LibGladeLib, importc: "glade_xml_new".}
+proc glade_xml_new_from_buffer*(buffer: cstring, size: int32, root: cstring, 
+                                domain: cstring): PGladeXML{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_new_from_buffer".}
+proc glade_xml_construct*(self: PGladeXML, fname: cstring, root: cstring, 
+                          domain: cstring): gboolean{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_construct".}
+proc glade_xml_signal_connect*(self: PGladeXML, handlername: cstring, 
+                               func: TGCallback){.cdecl, dynlib: LibGladeLib, 
+    importc: "glade_xml_signal_connect".}
+proc glade_xml_signal_connect_data*(self: PGladeXML, handlername: cstring, 
+                                    func: TGCallback, user_data: gpointer){.
+    cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect_data".}
+proc glade_xml_signal_autoconnect*(self: PGladeXML){.cdecl, dynlib: LibGladeLib, 
+    importc: "glade_xml_signal_autoconnect".}
+proc glade_xml_signal_connect_full*(self: PGladeXML, handler_name: cstring, 
+                                    func: TGladeXMLConnectFunc, 
+                                    user_data: gpointer){.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_signal_connect_full".}
+proc glade_xml_signal_autoconnect_full*(self: PGladeXML, 
+                                        func: TGladeXMLConnectFunc, 
+                                        user_data: gpointer){.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_signal_autoconnect_full".}
+proc glade_xml_get_widget*(self: PGladeXML, name: cstring): PGtkWidget{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_get_widget".}
+proc glade_xml_get_widget_prefix*(self: PGladeXML, name: cstring): PGList{.
+    cdecl, dynlib: LibGladeLib, importc: "glade_xml_get_widget_prefix".}
+proc glade_xml_relative_file*(self: PGladeXML, filename: cstring): cstring{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_xml_relative_file".}
+proc glade_get_widget_name*(widget: PGtkWidget): cstring{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_get_widget_name".}
+proc glade_get_widget_tree*(widget: PGtkWidget): PGladeXML{.cdecl, 
+    dynlib: LibGladeLib, importc: "glade_get_widget_tree".}
+type 
+  PGladeXMLCustomWidgetHandler* = ptr TGladeXMLCustomWidgetHandler
+  TGladeXMLCustomWidgetHandler* = TGtkWidget
+
+proc glade_set_custom_handler*(handler: TGladeXMLCustomWidgetHandler, 
+                               user_data: gpointer){.cdecl, dynlib: LibGladeLib, 
+    importc: "glade_set_custom_handler".}
+proc glade_gnome_init*() = 
+  glade_init()
+
+proc glade_bonobo_init*() = 
+  glade_init()
+
+proc glade_xml_new_with_domain*(fname: cstring, root: cstring, domain: cstring): PGladeXML = 
+  result = glade_xml_new(fname, root, domain)
+
+proc glade_xml_new_from_memory*(buffer: cstring, size: int32, root: cstring, 
+                                domain: cstring): PGladeXML = 
+  result = glade_xml_new_from_buffer(buffer, size, root, domain)
+
+proc GLADE_TYPE_XML*(): GType = 
+  result = glade_xml_get_type()
+
+proc GLADE_XML*(obj: pointer): PGladeXML = 
+  result = cast[PGladeXML](G_TYPE_CHECK_INSTANCE_CAST(obj, GLADE_TYPE_XML()))
+
+proc GLADE_XML_CLASS*(klass: pointer): PGladeXMLClass = 
+  result = cast[PGladeXMLClass](G_TYPE_CHECK_CLASS_CAST(klass, GLADE_TYPE_XML()))
+
+proc GLADE_IS_XML*(obj: pointer): gboolean = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(obj, GLADE_TYPE_XML())
+
+proc GLADE_IS_XML_CLASS*(klass: pointer): gboolean = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, GLADE_TYPE_XML())
+
+proc GLADE_XML_GET_CLASS*(obj: pointer): PGladeXMLClass = 
+  result = cast[PGladeXMLClass](G_TYPE_INSTANCE_GET_CLASS(obj, GLADE_TYPE_XML()))
diff --git a/lib/base/gtk/pango.nim b/lib/base/gtk/pango.nim
new file mode 100755
index 000000000..4c6c48bf8
--- /dev/null
+++ b/lib/base/gtk/pango.nim
@@ -0,0 +1,1209 @@
+import 
+  glib2
+
+{.define: PANGO_ENABLE_ENGINE.}
+{.define: PANGO_ENABLE_BACKEND.}
+when defined(win32): 
+  {.define: pangowin.}
+  const 
+    pangolib* = "libpango-1.0-0.dll"
+else: 
+  const 
+    pangolib* = "libpango-1.0.so.0"
+type 
+  PPangoFont* = pointer
+  PPangoFontFamily* = pointer
+  PPangoFontset* = pointer
+  PPangoFontMetrics* = pointer
+  PPangoFontFace* = pointer 
+  PPangoFontMap* = pointer
+  PPangoFontsetClass* = pointer
+  PPangoFontFamilyClass* = pointer
+  PPangoFontFaceClass* = pointer
+  PPangoFontClass* = pointer
+  PPangoFontMapClass* = pointer
+  PPangoFontDescription* = ptr TPangoFontDescription
+  TPangoFontDescription* = pointer
+  PPangoAttrList* = ptr TPangoAttrList
+  TPangoAttrList* = pointer
+  PPangoAttrIterator* = ptr TPangoAttrIterator
+  TPangoAttrIterator* = pointer
+  PPangoLayout* = ptr TPangoLayout
+  TPangoLayout* = pointer
+  PPangoLayoutClass* = ptr TPangoLayoutClass
+  TPangoLayoutClass* = pointer
+  PPangoLayoutIter* = ptr TPangoLayoutIter
+  TPangoLayoutIter* = pointer
+  PPangoContext* = ptr TPangoContext
+  TPangoContext* = pointer
+  PPangoContextClass* = ptr TPangoContextClass
+  TPangoContextClass* = pointer
+  PPangoFontsetSimple* = ptr TPangoFontsetSimple
+  TPangoFontsetSimple* = pointer
+  PPangoTabArray* = ptr TPangoTabArray
+  TPangoTabArray* = pointer
+  PPangoGlyphString* = ptr TPangoGlyphString
+  PPangoAnalysis* = ptr TPangoAnalysis
+  PPangoItem* = ptr TPangoItem
+  PPangoLanguage* = ptr TPangoLanguage
+  TPangoLanguage* = pointer
+  PPangoGlyph* = ptr TPangoGlyph
+  TPangoGlyph* = guint32
+  PPangoRectangle* = ptr TPangoRectangle
+  TPangoRectangle* = record 
+    x*: int32
+    y*: int32
+    width*: int32
+    height*: int32
+
+  PPangoDirection* = ptr TPangoDirection
+  TPangoDirection* = enum 
+    PANGO_DIRECTION_LTR, PANGO_DIRECTION_RTL, PANGO_DIRECTION_TTB_LTR, 
+    PANGO_DIRECTION_TTB_RTL
+  PPangoColor* = ptr TPangoColor
+  TPangoColor* = record 
+    red*: guint16
+    green*: guint16
+    blue*: guint16
+
+  PPangoAttrType* = ptr TPangoAttrType
+  TPangoAttrType* = int32
+  PPangoUnderline* = ptr TPangoUnderline
+  TPangoUnderline* = int32
+  PPangoAttribute* = ptr TPangoAttribute
+  PPangoAttrClass* = ptr TPangoAttrClass
+  TPangoAttribute* = record 
+    klass*: PPangoAttrClass
+    start_index*: int
+    end_index*: int
+
+  TPangoAttrClass* = record 
+    `type`*: TPangoAttrType
+    copy*: proc (attr: PPangoAttribute): PPangoAttribute{.cdecl.}
+    destroy*: proc (attr: PPangoAttribute){.cdecl.}
+    equal*: proc (attr1: PPangoAttribute, attr2: PPangoAttribute): gboolean{.
+        cdecl.}
+
+  PPangoAttrString* = ptr TPangoAttrString
+  TPangoAttrString* = record 
+    attr*: TPangoAttribute
+    value*: cstring
+
+  PPangoAttrLanguage* = ptr TPangoAttrLanguage
+  TPangoAttrLanguage* = record 
+    attr*: TPangoAttribute
+    value*: PPangoLanguage
+
+  PPangoAttrInt* = ptr TPangoAttrInt
+  TPangoAttrInt* = record 
+    attr*: TPangoAttribute
+    value*: int32
+
+  PPangoAttrFloat* = ptr TPangoAttrFloat
+  TPangoAttrFloat* = record 
+    attr*: TPangoAttribute
+    value*: gdouble
+
+  PPangoAttrColor* = ptr TPangoAttrColor
+  TPangoAttrColor* = record 
+    attr*: TPangoAttribute
+    color*: TPangoColor
+
+  PPangoAttrShape* = ptr TPangoAttrShape
+  TPangoAttrShape* = record 
+    attr*: TPangoAttribute
+    ink_rect*: TPangoRectangle
+    logical_rect*: TPangoRectangle
+
+  PPangoAttrFontDesc* = ptr TPangoAttrFontDesc
+  TPangoAttrFontDesc* = record 
+    attr*: TPangoAttribute
+    desc*: PPangoFontDescription
+
+  PPangoLogAttr* = ptr TPangoLogAttr
+  TPangoLogAttr* = record 
+    flag0*: guint16
+
+  PPangoCoverageLevel* = ptr TPangoCoverageLevel
+  TPangoCoverageLevel* = enum 
+    PANGO_COVERAGE_NONE, PANGO_COVERAGE_FALLBACK, PANGO_COVERAGE_APPROXIMATE, 
+    PANGO_COVERAGE_EXACT
+  PPangoBlockInfo* = ptr TPangoBlockInfo
+  TPangoBlockInfo* = record 
+    data*: Pguchar
+    level*: TPangoCoverageLevel
+
+  PPangoCoverage* = ptr TPangoCoverage
+  TPangoCoverage* = record 
+    ref_count*: int
+    n_blocks*: int32
+    data_size*: int32
+    blocks*: PPangoBlockInfo
+
+  PPangoEngineRange* = ptr TPangoEngineRange
+  TPangoEngineRange* = record 
+    start*: int32
+    theEnd*: int32
+    langs*: cstring
+
+  PPangoEngineInfo* = ptr TPangoEngineInfo
+  TPangoEngineInfo* = record 
+    id*: cstring
+    engine_type*: cstring
+    render_type*: cstring
+    ranges*: PPangoEngineRange
+    n_ranges*: gint
+
+  PPangoEngine* = ptr TPangoEngine
+  TPangoEngine* = record 
+    id*: cstring
+    `type`*: cstring
+    length*: gint
+
+  TPangoEngineLangScriptBreak* = proc (text: cstring, len: int32, 
+                                       analysis: PPangoAnalysis, 
+                                       attrs: PPangoLogAttr, attrs_len: int32){.
+      cdecl.}
+  PPangoEngineLang* = ptr TPangoEngineLang
+  TPangoEngineLang* = record 
+    engine*: TPangoEngine
+    script_break*: TPangoEngineLangScriptBreak
+
+  TPangoEngineShapeScript* = proc (font: PPangoFont, text: cstring, 
+                                   length: int32, analysis: PPangoAnalysis, 
+                                   glyphs: PPangoGlyphString){.cdecl.}
+  TPangoEngineShapeGetCoverage* = proc (font: PPangoFont, 
+                                        language: PPangoLanguage): PPangoCoverage{.
+      cdecl.}
+  PPangoEngineShape* = ptr TPangoEngineShape
+  TPangoEngineShape* = record 
+    engine*: TPangoEngine
+    script_shape*: TPangoEngineShapeScript
+    get_coverage*: TPangoEngineShapeGetCoverage
+
+  PPangoStyle* = ptr TPangoStyle
+  TPangoStyle* = gint
+  PPangoVariant* = ptr TPangoVariant
+  TPangoVariant* = gint
+  PPangoWeight* = ptr TPangoWeight
+  TPangoWeight* = gint
+  PPangoStretch* = ptr TPangoStretch
+  TPangoStretch* = gint
+  PPangoFontMask* = ptr TPangoFontMask
+  TPangoFontMask* = int32
+  PPangoGlyphUnit* = ptr TPangoGlyphUnit
+  TPangoGlyphUnit* = gint32
+  PPangoGlyphGeometry* = ptr TPangoGlyphGeometry
+  TPangoGlyphGeometry* = record 
+    width*: TPangoGlyphUnit
+    x_offset*: TPangoGlyphUnit
+    y_offset*: TPangoGlyphUnit
+
+  PPangoGlyphVisAttr* = ptr TPangoGlyphVisAttr
+  TPangoGlyphVisAttr* = record 
+    flag0*: int16
+
+  PPangoGlyphInfo* = ptr TPangoGlyphInfo
+  TPangoGlyphInfo* = record 
+    glyph*: TPangoGlyph
+    geometry*: TPangoGlyphGeometry
+    attr*: TPangoGlyphVisAttr
+
+  TPangoGlyphString* = record 
+    num_glyphs*: gint
+    glyphs*: PPangoGlyphInfo
+    log_clusters*: Pgint
+    space*: gint
+
+  TPangoAnalysis* = record 
+    shape_engine*: PPangoEngineShape
+    lang_engine*: PPangoEngineLang
+    font*: PPangoFont
+    level*: guint8
+    language*: PPangoLanguage
+    extra_attrs*: PGSList
+
+  TPangoItem* = record 
+    offset*: gint
+    length*: gint
+    num_chars*: gint
+    analysis*: TPangoAnalysis
+
+  PPangoAlignment* = ptr TPangoAlignment
+  TPangoAlignment* = enum 
+    PANGO_ALIGN_LEFT, PANGO_ALIGN_CENTER, PANGO_ALIGN_RIGHT
+  PPangoWrapMode* = ptr TPangoWrapMode
+  TPangoWrapMode* = enum 
+    PANGO_WRAP_WORD, PANGO_WRAP_CHAR
+  PPangoLayoutLine* = ptr TPangoLayoutLine
+  TPangoLayoutLine* = record 
+    layout*: PPangoLayout
+    start_index*: gint
+    length*: gint
+    runs*: PGSList
+
+  PPangoLayoutRun* = ptr TPangoLayoutRun
+  TPangoLayoutRun* = record 
+    item*: PPangoItem
+    glyphs*: PPangoGlyphString
+
+  PPangoTabAlign* = ptr TPangoTabAlign
+  TPangoTabAlign* = enum 
+    PANGO_TAB_LEFT
+
+const 
+  PANGO_SCALE* = 1024
+
+proc PANGO_PIXELS*(d: int): int
+proc PANGO_ASCENT*(rect: TPangoRectangle): int32
+proc PANGO_DESCENT*(rect: TPangoRectangle): int32
+proc PANGO_LBEARING*(rect: TPangoRectangle): int32
+proc PANGO_RBEARING*(rect: TPangoRectangle): int32
+proc PANGO_TYPE_LANGUAGE*(): GType
+proc pango_language_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                        importc: "pango_language_get_type".}
+proc pango_language_from_string*(language: cstring): PPangoLanguage{.cdecl, 
+    dynlib: pangolib, importc: "pango_language_from_string".}
+proc pango_language_to_string*(language: PPangoLanguage): cstring
+proc pango_language_matches*(language: PPangoLanguage, range_list: cstring): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_language_matches".}
+const 
+  PANGO_ATTR_INVALID* = 0
+  PANGO_ATTR_LANGUAGE* = 1
+  PANGO_ATTR_FAMILY* = 2
+  PANGO_ATTR_STYLE* = 3
+  PANGO_ATTR_WEIGHT* = 4
+  PANGO_ATTR_VARIANT* = 5
+  PANGO_ATTR_STRETCH* = 6
+  PANGO_ATTR_SIZE* = 7
+  PANGO_ATTR_FONT_DESC* = 8
+  PANGO_ATTR_FOREGROUND* = 9
+  PANGO_ATTR_BACKGROUND* = 10
+  PANGO_ATTR_UNDERLINE* = 11
+  PANGO_ATTR_STRIKETHROUGH* = 12
+  PANGO_ATTR_RISE* = 13
+  PANGO_ATTR_SHAPE* = 14
+  PANGO_ATTR_SCALE* = 15
+  PANGO_UNDERLINE_NONE* = 0
+  PANGO_UNDERLINE_SINGLE* = 1
+  PANGO_UNDERLINE_DOUBLE* = 2
+  PANGO_UNDERLINE_LOW* = 3
+
+proc PANGO_TYPE_COLOR*(): GType
+proc pango_color_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                     importc: "pango_color_get_type".}
+proc pango_color_copy*(src: PPangoColor): PPangoColor{.cdecl, dynlib: pangolib, 
+    importc: "pango_color_copy".}
+proc pango_color_free*(color: PPangoColor){.cdecl, dynlib: pangolib, 
+    importc: "pango_color_free".}
+proc pango_color_parse*(color: PPangoColor, spec: cstring): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_color_parse".}
+proc PANGO_TYPE_ATTR_LIST*(): GType
+proc pango_attr_type_register*(name: cstring): TPangoAttrType{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_type_register".}
+proc pango_attribute_copy*(attr: PPangoAttribute): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attribute_copy".}
+proc pango_attribute_destroy*(attr: PPangoAttribute){.cdecl, dynlib: pangolib, 
+    importc: "pango_attribute_destroy".}
+proc pango_attribute_equal*(attr1: PPangoAttribute, attr2: PPangoAttribute): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_attribute_equal".}
+proc pango_attr_language_new*(language: PPangoLanguage): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_language_new".}
+proc pango_attr_family_new*(family: cstring): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_family_new".}
+proc pango_attr_foreground_new*(red: guint16, green: guint16, blue: guint16): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_foreground_new".}
+proc pango_attr_background_new*(red: guint16, green: guint16, blue: guint16): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_background_new".}
+proc pango_attr_size_new*(size: int32): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_size_new".}
+proc pango_attr_style_new*(style: TPangoStyle): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_style_new".}
+proc pango_attr_weight_new*(weight: TPangoWeight): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_weight_new".}
+proc pango_attr_variant_new*(variant: TPangoVariant): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_variant_new".}
+proc pango_attr_stretch_new*(stretch: TPangoStretch): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_stretch_new".}
+proc pango_attr_font_desc_new*(desc: PPangoFontDescription): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_font_desc_new".}
+proc pango_attr_underline_new*(underline: TPangoUnderline): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_underline_new".}
+proc pango_attr_strikethrough_new*(strikethrough: gboolean): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_strikethrough_new".}
+proc pango_attr_rise_new*(rise: int32): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_rise_new".}
+proc pango_attr_shape_new*(ink_rect: PPangoRectangle, 
+                           logical_rect: PPangoRectangle): PPangoAttribute{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_shape_new".}
+proc pango_attr_scale_new*(scale_factor: gdouble): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_scale_new".}
+proc pango_attr_list_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_list_get_type".}
+proc pango_attr_list_new*(): PPangoAttrList{.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_list_new".}
+proc pango_attr_list_ref*(list: PPangoAttrList){.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_list_ref".}
+proc pango_attr_list_unref*(list: PPangoAttrList){.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_list_unref".}
+proc pango_attr_list_copy*(list: PPangoAttrList): PPangoAttrList{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_list_copy".}
+proc pango_attr_list_insert*(list: PPangoAttrList, attr: PPangoAttribute){.
+    cdecl, dynlib: pangolib, importc: "pango_attr_list_insert".}
+proc pango_attr_list_insert_before*(list: PPangoAttrList, attr: PPangoAttribute){.
+    cdecl, dynlib: pangolib, importc: "pango_attr_list_insert_before".}
+proc pango_attr_list_change*(list: PPangoAttrList, attr: PPangoAttribute){.
+    cdecl, dynlib: pangolib, importc: "pango_attr_list_change".}
+proc pango_attr_list_splice*(list: PPangoAttrList, other: PPangoAttrList, 
+                             pos: gint, len: gint){.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_list_splice".}
+proc pango_attr_list_get_iterator*(list: PPangoAttrList): PPangoAttrIterator{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_list_get_iterator".}
+proc pango_attr_iterator_range*(`iterator`: PPangoAttrIterator, start: Pgint, 
+                                theEnd: Pgint){.cdecl, dynlib: pangolib, 
+    importc: "pango_attr_iterator_range".}
+proc pango_attr_iterator_next*(`iterator`: PPangoAttrIterator): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_iterator_next".}
+proc pango_attr_iterator_copy*(`iterator`: PPangoAttrIterator): PPangoAttrIterator{.
+    cdecl, dynlib: pangolib, importc: "pango_attr_iterator_copy".}
+proc pango_attr_iterator_destroy*(`iterator`: PPangoAttrIterator){.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_iterator_destroy".}
+proc pango_attr_iterator_get*(`iterator`: PPangoAttrIterator, 
+                              `type`: TPangoAttrType): PPangoAttribute{.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_iterator_get".}
+proc pango_attr_iterator_get_font*(`iterator`: PPangoAttrIterator, 
+                                   desc: PPangoFontDescription, 
+                                   language: var PPangoLanguage, 
+                                   extra_attrs: PPGSList){.cdecl, 
+    dynlib: pangolib, importc: "pango_attr_iterator_get_font".}
+proc pango_parse_markup*(markup_text: cstring, length: int32, 
+                         accel_marker: gunichar, attr_list: var PPangoAttrList, 
+                         text: PPchar, accel_char: Pgunichar, error: pointer): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_parse_markup".}
+const 
+  bm_TPangoLogAttr_is_line_break* = 0x00000001
+  bp_TPangoLogAttr_is_line_break* = 0
+  bm_TPangoLogAttr_is_mandatory_break* = 0x00000002
+  bp_TPangoLogAttr_is_mandatory_break* = 1
+  bm_TPangoLogAttr_is_char_break* = 0x00000004
+  bp_TPangoLogAttr_is_char_break* = 2
+  bm_TPangoLogAttr_is_white* = 0x00000008
+  bp_TPangoLogAttr_is_white* = 3
+  bm_TPangoLogAttr_is_cursor_position* = 0x00000010
+  bp_TPangoLogAttr_is_cursor_position* = 4
+  bm_TPangoLogAttr_is_word_start* = 0x00000020
+  bp_TPangoLogAttr_is_word_start* = 5
+  bm_TPangoLogAttr_is_word_end* = 0x00000040
+  bp_TPangoLogAttr_is_word_end* = 6
+  bm_TPangoLogAttr_is_sentence_boundary* = 0x00000080
+  bp_TPangoLogAttr_is_sentence_boundary* = 7
+  bm_TPangoLogAttr_is_sentence_start* = 0x00000100
+  bp_TPangoLogAttr_is_sentence_start* = 8
+  bm_TPangoLogAttr_is_sentence_end* = 0x00000200
+  bp_TPangoLogAttr_is_sentence_end* = 9
+
+proc is_line_break*(a: var TPangoLogAttr): guint
+proc set_is_line_break*(a: var TPangoLogAttr, `is_line_break`: guint)
+proc is_mandatory_break*(a: var TPangoLogAttr): guint
+proc set_is_mandatory_break*(a: var TPangoLogAttr, `is_mandatory_break`: guint)
+proc is_char_break*(a: var TPangoLogAttr): guint
+proc set_is_char_break*(a: var TPangoLogAttr, `is_char_break`: guint)
+proc is_white*(a: var TPangoLogAttr): guint
+proc set_is_white*(a: var TPangoLogAttr, `is_white`: guint)
+proc is_cursor_position*(a: var TPangoLogAttr): guint
+proc set_is_cursor_position*(a: var TPangoLogAttr, `is_cursor_position`: guint)
+proc is_word_start*(a: var TPangoLogAttr): guint
+proc set_is_word_start*(a: var TPangoLogAttr, `is_word_start`: guint)
+proc is_word_end*(a: var TPangoLogAttr): guint
+proc set_is_word_end*(a: var TPangoLogAttr, `is_word_end`: guint)
+proc is_sentence_boundary*(a: var TPangoLogAttr): guint
+proc set_is_sentence_boundary*(a: var TPangoLogAttr, 
+                               `is_sentence_boundary`: guint)
+proc is_sentence_start*(a: var TPangoLogAttr): guint
+proc set_is_sentence_start*(a: var TPangoLogAttr, `is_sentence_start`: guint)
+proc is_sentence_end*(a: var TPangoLogAttr): guint
+proc set_is_sentence_end*(a: var TPangoLogAttr, `is_sentence_end`: guint)
+proc pango_break*(text: cstring, length: int32, analysis: PPangoAnalysis, 
+                  attrs: PPangoLogAttr, attrs_len: int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_break".}
+proc pango_find_paragraph_boundary*(text: cstring, length: gint, 
+                                    paragraph_delimiter_index: Pgint, 
+                                    next_paragraph_start: Pgint){.cdecl, 
+    dynlib: pangolib, importc: "pango_find_paragraph_boundary".}
+proc pango_get_log_attrs*(text: cstring, length: int32, level: int32, 
+                          language: PPangoLanguage, log_attrs: PPangoLogAttr, 
+                          attrs_len: int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_get_log_attrs".}
+proc PANGO_TYPE_CONTEXT*(): GType
+proc PANGO_CONTEXT*(anObject: pointer): PPangoContext
+proc PANGO_CONTEXT_CLASS*(klass: pointer): PPangoContextClass
+proc PANGO_IS_CONTEXT*(anObject: pointer): bool
+proc PANGO_IS_CONTEXT_CLASS*(klass: pointer): bool
+proc PANGO_CONTEXT_GET_CLASS*(obj: PPangoContext): PPangoContextClass
+proc pango_context_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                       importc: "pango_context_get_type".}
+proc pango_context_list_families*(context: PPangoContext, 
+                                  families: openarray[ptr PPangoFontFamily]){.cdecl, 
+    dynlib: pangolib, importc: "pango_context_list_families".}
+proc pango_context_load_font*(context: PPangoContext, 
+                              desc: PPangoFontDescription): PPangoFont{.cdecl, 
+    dynlib: pangolib, importc: "pango_context_load_font".}
+proc pango_context_load_fontset*(context: PPangoContext, 
+                                 desc: PPangoFontDescription, 
+                                 language: PPangoLanguage): PPangoFontset{.
+    cdecl, dynlib: pangolib, importc: "pango_context_load_fontset".}
+proc pango_context_get_metrics*(context: PPangoContext, 
+                                desc: PPangoFontDescription, 
+                                language: PPangoLanguage): PPangoFontMetrics{.
+    cdecl, dynlib: pangolib, importc: "pango_context_get_metrics".}
+proc pango_context_set_font_description*(context: PPangoContext, 
+    desc: PPangoFontDescription){.cdecl, dynlib: pangolib, 
+                                  importc: "pango_context_set_font_description".}
+proc pango_context_get_font_description*(context: PPangoContext): PPangoFontDescription{.
+    cdecl, dynlib: pangolib, importc: "pango_context_get_font_description".}
+proc pango_context_get_language*(context: PPangoContext): PPangoLanguage{.cdecl, 
+    dynlib: pangolib, importc: "pango_context_get_language".}
+proc pango_context_set_language*(context: PPangoContext, 
+                                 language: PPangoLanguage){.cdecl, 
+    dynlib: pangolib, importc: "pango_context_set_language".}
+proc pango_context_set_base_dir*(context: PPangoContext, 
+                                 direction: TPangoDirection){.cdecl, 
+    dynlib: pangolib, importc: "pango_context_set_base_dir".}
+proc pango_context_get_base_dir*(context: PPangoContext): TPangoDirection{.
+    cdecl, dynlib: pangolib, importc: "pango_context_get_base_dir".}
+proc pango_itemize*(context: PPangoContext, text: cstring, start_index: int32, 
+                    length: int32, attrs: PPangoAttrList, 
+                    cached_iter: PPangoAttrIterator): PGList{.cdecl, 
+    dynlib: pangolib, importc: "pango_itemize".}
+proc pango_coverage_new*(): PPangoCoverage{.cdecl, dynlib: pangolib, 
+    importc: "pango_coverage_new".}
+proc pango_coverage_ref*(coverage: PPangoCoverage): PPangoCoverage{.cdecl, 
+    dynlib: pangolib, importc: "pango_coverage_ref".}
+proc pango_coverage_unref*(coverage: PPangoCoverage){.cdecl, dynlib: pangolib, 
+    importc: "pango_coverage_unref".}
+proc pango_coverage_copy*(coverage: PPangoCoverage): PPangoCoverage{.cdecl, 
+    dynlib: pangolib, importc: "pango_coverage_copy".}
+proc pango_coverage_get*(coverage: PPangoCoverage, index: int32): TPangoCoverageLevel{.
+    cdecl, dynlib: pangolib, importc: "pango_coverage_get".}
+proc pango_coverage_set*(coverage: PPangoCoverage, index: int32, 
+                         level: TPangoCoverageLevel){.cdecl, dynlib: pangolib, 
+    importc: "pango_coverage_set".}
+proc pango_coverage_max*(coverage: PPangoCoverage, other: PPangoCoverage){.
+    cdecl, dynlib: pangolib, importc: "pango_coverage_max".}
+proc pango_coverage_to_bytes*(coverage: PPangoCoverage, bytes: PPguchar, 
+                              n_bytes: var int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_coverage_to_bytes".}
+proc pango_coverage_from_bytes*(bytes: Pguchar, n_bytes: int32): PPangoCoverage{.
+    cdecl, dynlib: pangolib, importc: "pango_coverage_from_bytes".}
+proc PANGO_TYPE_FONTSET*(): GType
+proc PANGO_FONTSET*(anObject: pointer): PPangoFontset
+proc PANGO_IS_FONTSET*(anObject: pointer): bool
+proc pango_fontset_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                       importc: "pango_fontset_get_type".}
+proc pango_fontset_get_font*(fontset: PPangoFontset, wc: guint): PPangoFont{.
+    cdecl, dynlib: pangolib, importc: "pango_fontset_get_font".}
+proc pango_fontset_get_metrics*(fontset: PPangoFontset): PPangoFontMetrics{.
+    cdecl, dynlib: pangolib, importc: "pango_fontset_get_metrics".}
+const 
+  PANGO_STYLE_NORMAL* = 0
+  PANGO_STYLE_OBLIQUE* = 1
+  PANGO_STYLE_ITALIC* = 2
+  PANGO_VARIANT_NORMAL* = 0
+  PANGO_VARIANT_SMALL_CAPS* = 1
+  PANGO_WEIGHT_ULTRALIGHT* = 200
+  PANGO_WEIGHT_LIGHT* = 300
+  PANGO_WEIGHT_NORMAL* = 400
+  PANGO_WEIGHT_BOLD* = 700
+  PANGO_WEIGHT_ULTRABOLD* = 800
+  PANGO_WEIGHT_HEAVY* = 900
+  PANGO_STRETCH_ULTRA_CONDENSED* = 0
+  PANGO_STRETCH_EXTRA_CONDENSED* = 1
+  PANGO_STRETCH_CONDENSED* = 2
+  PANGO_STRETCH_SEMI_CONDENSED* = 3
+  PANGO_STRETCH_NORMAL* = 4
+  PANGO_STRETCH_SEMI_EXPANDED* = 5
+  PANGO_STRETCH_EXPANDED* = 6
+  PANGO_STRETCH_EXTRA_EXPANDED* = 7
+  PANGO_STRETCH_ULTRA_EXPANDED* = 8
+  PANGO_FONT_MASK_FAMILY* = 1 shl 0
+  PANGO_FONT_MASK_STYLE* = 1 shl 1
+  PANGO_FONT_MASK_VARIANT* = 1 shl 2
+  PANGO_FONT_MASK_WEIGHT* = 1 shl 3
+  PANGO_FONT_MASK_STRETCH* = 1 shl 4
+  PANGO_FONT_MASK_SIZE* = 1 shl 5
+  PANGO_SCALE_XX_SMALL* = 0.5787037037036999
+  PANGO_SCALE_X_SMALL* = 0.6444444444443999
+  PANGO_SCALE_SMALL* = 0.8333333333332999
+  PANGO_SCALE_MEDIUM* = 1.0
+  PANGO_SCALE_LARGE* = 1.2
+  PANGO_SCALE_X_LARGE* = 1.4399999999999
+  PANGO_SCALE_XX_LARGE* = 1.728
+
+proc PANGO_TYPE_FONT_DESCRIPTION*(): GType
+proc pango_font_description_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_font_description_get_type".}
+proc pango_font_description_new*(): PPangoFontDescription{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_new".}
+proc pango_font_description_copy*(desc: PPangoFontDescription): PPangoFontDescription{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_copy".}
+proc pango_font_description_copy_static*(desc: PPangoFontDescription): PPangoFontDescription{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_copy_static".}
+proc pango_font_description_hash*(desc: PPangoFontDescription): guint{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_hash".}
+proc pango_font_description_equal*(desc1: PPangoFontDescription, 
+                                   desc2: PPangoFontDescription): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_equal".}
+proc pango_font_description_free*(desc: PPangoFontDescription){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_free".}
+proc pango_font_descriptions_free*(descs: var PPangoFontDescription, 
+                                   n_descs: int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_font_descriptions_free".}
+proc pango_font_description_set_family*(desc: PPangoFontDescription, 
+                                        family: cstring){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_set_family".}
+proc pango_font_description_set_family_static*(desc: PPangoFontDescription, 
+    family: cstring){.cdecl, dynlib: pangolib, 
+                      importc: "pango_font_description_set_family_static".}
+proc pango_font_description_get_family*(desc: PPangoFontDescription): cstring{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_family".}
+proc pango_font_description_set_style*(desc: PPangoFontDescription, 
+                                       style: TPangoStyle){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_set_style".}
+proc pango_font_description_get_style*(desc: PPangoFontDescription): TPangoStyle{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_style".}
+proc pango_font_description_set_variant*(desc: PPangoFontDescription, 
+    variant: TPangoVariant){.cdecl, dynlib: pangolib, 
+                             importc: "pango_font_description_set_variant".}
+proc pango_font_description_get_variant*(desc: PPangoFontDescription): TPangoVariant{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_variant".}
+proc pango_font_description_set_weight*(desc: PPangoFontDescription, 
+                                        weight: TPangoWeight){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_set_weight".}
+proc pango_font_description_get_weight*(desc: PPangoFontDescription): TPangoWeight{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_weight".}
+proc pango_font_description_set_stretch*(desc: PPangoFontDescription, 
+    stretch: TPangoStretch){.cdecl, dynlib: pangolib, 
+                             importc: "pango_font_description_set_stretch".}
+proc pango_font_description_get_stretch*(desc: PPangoFontDescription): TPangoStretch{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_stretch".}
+proc pango_font_description_set_size*(desc: PPangoFontDescription, size: gint){.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_set_size".}
+proc pango_font_description_get_size*(desc: PPangoFontDescription): gint{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_get_size".}
+proc pango_font_description_set_absolute_size*(desc: PPangoFontDescription, 
+    size: float64){.cdecl, dynlib: pangolib, 
+                    importc: "pango_font_description_set_absolute_size".}
+proc pango_font_description_get_size_is_absolute*(desc: PPangoFontDescription, 
+    size: float64): gboolean{.cdecl, dynlib: pangolib, importc: "pango_font_description_get_size_is_absolute".}
+proc pango_font_description_get_set_fields*(desc: PPangoFontDescription): TPangoFontMask{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_get_set_fields".}
+proc pango_font_description_unset_fields*(desc: PPangoFontDescription, 
+    to_unset: TPangoFontMask){.cdecl, dynlib: pangolib, 
+                               importc: "pango_font_description_unset_fields".}
+proc pango_font_description_merge*(desc: PPangoFontDescription, 
+                                   desc_to_merge: PPangoFontDescription, 
+                                   replace_existing: gboolean){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_merge".}
+proc pango_font_description_merge_static*(desc: PPangoFontDescription, 
+    desc_to_merge: PPangoFontDescription, replace_existing: gboolean){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_description_merge_static".}
+proc pango_font_description_better_match*(desc: PPangoFontDescription, 
+    old_match: PPangoFontDescription, new_match: PPangoFontDescription): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_better_match".}
+proc pango_font_description_from_string*(str: cstring): PPangoFontDescription{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_from_string".}
+proc pango_font_description_to_string*(desc: PPangoFontDescription): cstring{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_to_string".}
+proc pango_font_description_to_filename*(desc: PPangoFontDescription): cstring{.
+    cdecl, dynlib: pangolib, importc: "pango_font_description_to_filename".}
+proc PANGO_TYPE_FONT_METRICS*(): GType
+proc pango_font_metrics_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_font_metrics_get_type".}
+proc pango_font_metrics_ref*(metrics: PPangoFontMetrics): PPangoFontMetrics{.
+    cdecl, dynlib: pangolib, importc: "pango_font_metrics_ref".}
+proc pango_font_metrics_unref*(metrics: PPangoFontMetrics){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_metrics_unref".}
+proc pango_font_metrics_get_ascent*(metrics: PPangoFontMetrics): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_metrics_get_ascent".}
+proc pango_font_metrics_get_descent*(metrics: PPangoFontMetrics): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_metrics_get_descent".}
+proc pango_font_metrics_get_approximate_char_width*(metrics: PPangoFontMetrics): int32{.
+    cdecl, dynlib: pangolib, 
+    importc: "pango_font_metrics_get_approximate_char_width".}
+proc pango_font_metrics_get_approximate_digit_width*(metrics: PPangoFontMetrics): int32{.
+    cdecl, dynlib: pangolib, 
+    importc: "pango_font_metrics_get_approximate_digit_width".}
+proc PANGO_TYPE_FONT_FAMILY*(): GType
+proc PANGO_FONT_FAMILY*(anObject: Pointer): PPangoFontFamily
+proc PANGO_IS_FONT_FAMILY*(anObject: Pointer): bool
+proc pango_font_family_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_font_family_get_type".}
+proc pango_font_family_list_faces*(family: PPangoFontFamily, 
+                                   faces: var openarray[ptr PPangoFontFace]){.
+    cdecl, dynlib: pangolib, importc: "pango_font_family_list_faces".}
+proc pango_font_family_get_name*(family: PPangoFontFamily): cstring{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_family_get_name".}
+proc PANGO_TYPE_FONT_FACE*(): GType
+proc PANGO_FONT_FACE*(anObject: pointer): PPangoFontFace
+proc PANGO_IS_FONT_FACE*(anObject: pointer): bool
+proc pango_font_face_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_font_face_get_type".}
+proc pango_font_face_describe*(face: PPangoFontFace): PPangoFontDescription{.
+    cdecl, dynlib: pangolib, importc: "pango_font_face_describe".}
+proc pango_font_face_get_face_name*(face: PPangoFontFace): cstring{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_face_get_face_name".}
+proc PANGO_TYPE_FONT*(): GType
+proc PANGO_FONT*(anObject: pointer): PPangoFont
+proc PANGO_IS_FONT*(anObject: pointer): bool
+proc pango_font_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                    importc: "pango_font_get_type".}
+proc pango_font_describe*(font: PPangoFont): PPangoFontDescription{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_describe".}
+proc pango_font_get_coverage*(font: PPangoFont, language: PPangoLanguage): PPangoCoverage{.
+    cdecl, dynlib: pangolib, importc: "pango_font_get_coverage".}
+proc pango_font_find_shaper*(font: PPangoFont, language: PPangoLanguage, 
+                             ch: guint32): PPangoEngineShape{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_find_shaper".}
+proc pango_font_get_metrics*(font: PPangoFont, language: PPangoLanguage): PPangoFontMetrics{.
+    cdecl, dynlib: pangolib, importc: "pango_font_get_metrics".}
+proc pango_font_get_glyph_extents*(font: PPangoFont, glyph: TPangoGlyph, 
+                                   ink_rect: PPangoRectangle, 
+                                   logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_get_glyph_extents".}
+proc PANGO_TYPE_FONT_MAP*(): GType
+proc PANGO_FONT_MAP*(anObject: pointer): PPangoFontMap
+proc PANGO_IS_FONT_MAP*(anObject: pointer): bool
+proc pango_font_map_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                        importc: "pango_font_map_get_type".}
+proc pango_font_map_load_font*(fontmap: PPangoFontMap, context: PPangoContext, 
+                               desc: PPangoFontDescription): PPangoFont{.cdecl, 
+    dynlib: pangolib, importc: "pango_font_map_load_font".}
+proc pango_font_map_load_fontset*(fontmap: PPangoFontMap, 
+                                  context: PPangoContext, 
+                                  desc: PPangoFontDescription, 
+                                  language: PPangoLanguage): PPangoFontset{.
+    cdecl, dynlib: pangolib, importc: "pango_font_map_load_fontset".}
+proc pango_font_map_list_families*(fontmap: PPangoFontMap, 
+                                   families: var openarray[ptr PPangoFontFamily]){.cdecl, 
+    dynlib: pangolib, importc: "pango_font_map_list_families".}
+const 
+  bm_TPangoGlyphVisAttr_is_cluster_start* = 0x00000001
+  bp_TPangoGlyphVisAttr_is_cluster_start* = 0
+
+proc is_cluster_start*(a: var TPangoGlyphVisAttr): guint
+proc set_is_cluster_start*(a: var TPangoGlyphVisAttr, `is_cluster_start`: guint)
+proc PANGO_TYPE_GLYPH_STRING*(): GType
+proc pango_glyph_string_new*(): PPangoGlyphString{.cdecl, dynlib: pangolib, 
+    importc: "pango_glyph_string_new".}
+proc pango_glyph_string_set_size*(`string`: PPangoGlyphString, new_len: gint){.
+    cdecl, dynlib: pangolib, importc: "pango_glyph_string_set_size".}
+proc pango_glyph_string_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_glyph_string_get_type".}
+proc pango_glyph_string_copy*(`string`: PPangoGlyphString): PPangoGlyphString{.
+    cdecl, dynlib: pangolib, importc: "pango_glyph_string_copy".}
+proc pango_glyph_string_free*(`string`: PPangoGlyphString){.cdecl, 
+    dynlib: pangolib, importc: "pango_glyph_string_free".}
+proc pango_glyph_string_extents*(glyphs: PPangoGlyphString, font: PPangoFont, 
+                                 ink_rect: PPangoRectangle, 
+                                 logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_glyph_string_extents".}
+proc pango_glyph_string_extents_range*(glyphs: PPangoGlyphString, start: int32, 
+                                       theEnd: int32, font: PPangoFont, 
+                                       ink_rect: PPangoRectangle, 
+                                       logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_glyph_string_extents_range".}
+proc pango_glyph_string_get_logical_widths*(glyphs: PPangoGlyphString, 
+    text: cstring, length: int32, embedding_level: int32, 
+    logical_widths: var int32){.cdecl, dynlib: pangolib, 
+                               importc: "pango_glyph_string_get_logical_widths".}
+proc pango_glyph_string_index_to_x*(glyphs: PPangoGlyphString, text: cstring, 
+                                    length: int32, analysis: PPangoAnalysis, 
+                                    index: int32, trailing: gboolean, 
+                                    x_pos: var int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_glyph_string_index_to_x".}
+proc pango_glyph_string_x_to_index*(glyphs: PPangoGlyphString, text: cstring, 
+                                    length: int32, analysis: PPangoAnalysis, 
+                                    x_pos: int32, index, 
+                                    trailing: var int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_glyph_string_x_to_index".}
+proc pango_shape*(text: cstring, length: gint, analysis: PPangoAnalysis, 
+                  glyphs: PPangoGlyphString){.cdecl, dynlib: pangolib, 
+    importc: "pango_shape".}
+proc pango_reorder_items*(logical_items: PGList): PGList{.cdecl, 
+    dynlib: pangolib, importc: "pango_reorder_items".}
+proc pango_item_new*(): PPangoItem{.cdecl, dynlib: pangolib, 
+                                    importc: "pango_item_new".}
+proc pango_item_copy*(item: PPangoItem): PPangoItem{.cdecl, dynlib: pangolib, 
+    importc: "pango_item_copy".}
+proc pango_item_free*(item: PPangoItem){.cdecl, dynlib: pangolib, 
+    importc: "pango_item_free".}
+proc pango_item_split*(orig: PPangoItem, split_index: int32, split_offset: int32): PPangoItem{.
+    cdecl, dynlib: pangolib, importc: "pango_item_split".}
+proc PANGO_TYPE_LAYOUT*(): GType
+proc PANGO_LAYOUT*(anObject: pointer): PPangoLayout
+proc PANGO_LAYOUT_CLASS*(klass: pointer): PPangoLayoutClass
+proc PANGO_IS_LAYOUT*(anObject: pointer): bool
+proc PANGO_IS_LAYOUT_CLASS*(klass: pointer): bool
+proc PANGO_LAYOUT_GET_CLASS*(obj: PPangoLayout): PPangoLayoutClass
+proc pango_layout_get_type*(): GType{.cdecl, dynlib: pangolib, 
+                                      importc: "pango_layout_get_type".}
+proc pango_layout_new*(context: PPangoContext): PPangoLayout{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_new".}
+proc pango_layout_copy*(src: PPangoLayout): PPangoLayout{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_copy".}
+proc pango_layout_get_context*(layout: PPangoLayout): PPangoContext{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_context".}
+proc pango_layout_set_attributes*(layout: PPangoLayout, attrs: PPangoAttrList){.
+    cdecl, dynlib: pangolib, importc: "pango_layout_set_attributes".}
+proc pango_layout_get_attributes*(layout: PPangoLayout): PPangoAttrList{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_attributes".}
+proc pango_layout_set_text*(layout: PPangoLayout, text: cstring, length: int32){.
+    cdecl, dynlib: pangolib, importc: "pango_layout_set_text".}
+proc pango_layout_get_text*(layout: PPangoLayout): cstring{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_text".}
+proc pango_layout_set_markup*(layout: PPangoLayout, markup: cstring, 
+                              length: int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_set_markup".}
+proc pango_layout_set_markup_with_accel*(layout: PPangoLayout, markup: cstring, 
+    length: int32, accel_marker: gunichar, accel_char: Pgunichar){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_markup_with_accel".}
+proc pango_layout_set_font_description*(layout: PPangoLayout, 
+                                        desc: PPangoFontDescription){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_font_description".}
+proc pango_layout_set_width*(layout: PPangoLayout, width: int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_width".}
+proc pango_layout_get_width*(layout: PPangoLayout): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_width".}
+proc pango_layout_set_wrap*(layout: PPangoLayout, wrap: TPangoWrapMode){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_wrap".}
+proc pango_layout_get_wrap*(layout: PPangoLayout): TPangoWrapMode{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_wrap".}
+proc pango_layout_set_indent*(layout: PPangoLayout, indent: int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_indent".}
+proc pango_layout_get_indent*(layout: PPangoLayout): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_indent".}
+proc pango_layout_set_spacing*(layout: PPangoLayout, spacing: int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_spacing".}
+proc pango_layout_get_spacing*(layout: PPangoLayout): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_spacing".}
+proc pango_layout_set_justify*(layout: PPangoLayout, justify: gboolean){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_justify".}
+proc pango_layout_get_justify*(layout: PPangoLayout): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_justify".}
+proc pango_layout_set_alignment*(layout: PPangoLayout, 
+                                 alignment: TPangoAlignment){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_alignment".}
+proc pango_layout_get_alignment*(layout: PPangoLayout): TPangoAlignment{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_alignment".}
+proc pango_layout_set_tabs*(layout: PPangoLayout, tabs: PPangoTabArray){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_set_tabs".}
+proc pango_layout_get_tabs*(layout: PPangoLayout): PPangoTabArray{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_tabs".}
+proc pango_layout_set_single_paragraph_mode*(layout: PPangoLayout, 
+    setting: gboolean){.cdecl, dynlib: pangolib, 
+                        importc: "pango_layout_set_single_paragraph_mode".}
+proc pango_layout_get_single_paragraph_mode*(layout: PPangoLayout): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_layout_get_single_paragraph_mode".}
+proc pango_layout_context_changed*(layout: PPangoLayout){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_context_changed".}
+proc pango_layout_get_log_attrs*(layout: PPangoLayout, attrs: var PPangoLogAttr, 
+                                 n_attrs: Pgint){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_get_log_attrs".}
+proc pango_layout_index_to_pos*(layout: PPangoLayout, index: int32, 
+                                pos: PPangoRectangle){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_index_to_pos".}
+proc pango_layout_get_cursor_pos*(layout: PPangoLayout, index: int32, 
+                                  strong_pos: PPangoRectangle, 
+                                  weak_pos: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_cursor_pos".}
+proc pango_layout_move_cursor_visually*(layout: PPangoLayout, strong: gboolean, 
+                                        old_index: int32, old_trailing: int32, 
+                                        direction: int32, new_index, 
+                                        new_trailing: var int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_move_cursor_visually".}
+proc pango_layout_xy_to_index*(layout: PPangoLayout, x: int32, y: int32, 
+                               index, trailing: var int32): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_layout_xy_to_index".}
+proc pango_layout_get_extents*(layout: PPangoLayout, ink_rect: PPangoRectangle, 
+                               logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_extents".}
+proc pango_layout_get_pixel_extents*(layout: PPangoLayout, 
+                                     ink_rect: PPangoRectangle, 
+                                     logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_pixel_extents".}
+proc pango_layout_get_size*(layout: PPangoLayout, width: var int32, 
+                            height: var int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_get_size".}
+proc pango_layout_get_pixel_size*(layout: PPangoLayout, width: var int32, 
+                                  height: var int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_get_pixel_size".}
+proc pango_layout_get_line_count*(layout: PPangoLayout): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_line_count".}
+proc pango_layout_get_line*(layout: PPangoLayout, line: int32): PPangoLayoutLine{.
+    cdecl, dynlib: pangolib, importc: "pango_layout_get_line".}
+proc pango_layout_get_lines*(layout: PPangoLayout): PGSList{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_lines".}
+proc pango_layout_line_ref*(line: PPangoLayoutLine){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_line_ref".}
+proc pango_layout_line_unref*(line: PPangoLayoutLine){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_line_unref".}
+proc pango_layout_line_x_to_index*(line: PPangoLayoutLine, x_pos: int32, 
+                                   index: var int32, trailing: var int32): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_layout_line_x_to_index".}
+proc pango_layout_line_index_to_x*(line: PPangoLayoutLine, index: int32, 
+                                   trailing: gboolean, x_pos: var int32){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_line_index_to_x".}
+proc pango_layout_line_get_extents*(line: PPangoLayoutLine, 
+                                    ink_rect: PPangoRectangle, 
+                                    logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_line_get_extents".}
+proc pango_layout_line_get_pixel_extents*(layout_line: PPangoLayoutLine, 
+    ink_rect: PPangoRectangle, logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_line_get_pixel_extents".}
+proc pango_layout_get_iter*(layout: PPangoLayout): PPangoLayoutIter{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_get_iter".}
+proc pango_layout_iter_free*(iter: PPangoLayoutIter){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_iter_free".}
+proc pango_layout_iter_get_index*(iter: PPangoLayoutIter): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_index".}
+proc pango_layout_iter_get_run*(iter: PPangoLayoutIter): PPangoLayoutRun{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_run".}
+proc pango_layout_iter_get_line*(iter: PPangoLayoutIter): PPangoLayoutLine{.
+    cdecl, dynlib: pangolib, importc: "pango_layout_iter_get_line".}
+proc pango_layout_iter_at_last_line*(iter: PPangoLayoutIter): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_at_last_line".}
+proc pango_layout_iter_next_char*(iter: PPangoLayoutIter): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_next_char".}
+proc pango_layout_iter_next_cluster*(iter: PPangoLayoutIter): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_next_cluster".}
+proc pango_layout_iter_next_run*(iter: PPangoLayoutIter): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_next_run".}
+proc pango_layout_iter_next_line*(iter: PPangoLayoutIter): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_next_line".}
+proc pango_layout_iter_get_char_extents*(iter: PPangoLayoutIter, 
+    logical_rect: PPangoRectangle){.cdecl, dynlib: pangolib, importc: "pango_layout_iter_get_char_extents".}
+proc pango_layout_iter_get_cluster_extents*(iter: PPangoLayoutIter, 
+    ink_rect: PPangoRectangle, logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_cluster_extents".}
+proc pango_layout_iter_get_run_extents*(iter: PPangoLayoutIter, 
+                                        ink_rect: PPangoRectangle, 
+                                        logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_run_extents".}
+proc pango_layout_iter_get_line_extents*(iter: PPangoLayoutIter, 
+    ink_rect: PPangoRectangle, logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_line_extents".}
+proc pango_layout_iter_get_line_yrange*(iter: PPangoLayoutIter, y0: var int32, 
+                                        y1: var int32){.cdecl, dynlib: pangolib, 
+    importc: "pango_layout_iter_get_line_yrange".}
+proc pango_layout_iter_get_layout_extents*(iter: PPangoLayoutIter, 
+    ink_rect: PPangoRectangle, logical_rect: PPangoRectangle){.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_layout_extents".}
+proc pango_layout_iter_get_baseline*(iter: PPangoLayoutIter): int32{.cdecl, 
+    dynlib: pangolib, importc: "pango_layout_iter_get_baseline".}
+proc PANGO_TYPE_TAB_ARRAY*(): GType
+proc pango_tab_array_new*(initial_size: gint, positions_in_pixels: gboolean): PPangoTabArray{.
+    cdecl, dynlib: pangolib, importc: "pango_tab_array_new".}
+proc pango_tab_array_get_type*(): GType{.cdecl, dynlib: pangolib, 
+    importc: "pango_tab_array_get_type".}
+proc pango_tab_array_copy*(src: PPangoTabArray): PPangoTabArray{.cdecl, 
+    dynlib: pangolib, importc: "pango_tab_array_copy".}
+proc pango_tab_array_free*(tab_array: PPangoTabArray){.cdecl, dynlib: pangolib, 
+    importc: "pango_tab_array_free".}
+proc pango_tab_array_get_size*(tab_array: PPangoTabArray): gint{.cdecl, 
+    dynlib: pangolib, importc: "pango_tab_array_get_size".}
+proc pango_tab_array_resize*(tab_array: PPangoTabArray, new_size: gint){.cdecl, 
+    dynlib: pangolib, importc: "pango_tab_array_resize".}
+proc pango_tab_array_set_tab*(tab_array: PPangoTabArray, tab_index: gint, 
+                              alignment: TPangoTabAlign, location: gint){.cdecl, 
+    dynlib: pangolib, importc: "pango_tab_array_set_tab".}
+proc pango_tab_array_get_tab*(tab_array: PPangoTabArray, tab_index: gint, 
+                              alignment: PPangoTabAlign, location: Pgint){.
+    cdecl, dynlib: pangolib, importc: "pango_tab_array_get_tab".}
+proc pango_tab_array_get_positions_in_pixels*(tab_array: PPangoTabArray): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_tab_array_get_positions_in_pixels".}
+proc PANGO_ASCENT*(rect: TPangoRectangle): int32 = 
+  result = - int(rect.y)
+
+proc PANGO_DESCENT*(rect: TPangoRectangle): int32 = 
+  result = int(rect.y) + int(rect.height)
+
+proc PANGO_LBEARING*(rect: TPangoRectangle): int32 = 
+  result = rect.x
+
+proc PANGO_RBEARING*(rect: TPangoRectangle): int32 = 
+  result = int(rect.x) + (rect.width)
+
+proc PANGO_TYPE_LANGUAGE*(): GType = 
+  result = pango_language_get_type()
+
+proc pango_language_to_string*(language: PPangoLanguage): cstring = 
+  result = cast[cstring](language)
+
+proc PANGO_PIXELS*(d: int): int = 
+  if d >= 0: 
+    result = (d + (PANGO_SCALE div 2)) div PANGO_SCALE
+  else: 
+    result = (d - (PANGO_SCALE div 2)) div PANGO_SCALE
+
+proc PANGO_TYPE_COLOR*(): GType = 
+  result = pango_color_get_type()
+
+proc PANGO_TYPE_ATTR_LIST*(): GType = 
+  result = pango_attr_list_get_type()
+
+proc is_line_break*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_line_break) shr
+      bp_TPangoLogAttr_is_line_break
+
+proc set_is_line_break*(a: var TPangoLogAttr, `is_line_break`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_line_break` shl bp_TPangoLogAttr_is_line_break) and
+      bm_TPangoLogAttr_is_line_break)
+
+proc is_mandatory_break*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_mandatory_break) shr
+      bp_TPangoLogAttr_is_mandatory_break
+
+proc set_is_mandatory_break*(a: var TPangoLogAttr, `is_mandatory_break`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_mandatory_break` shl bp_TPangoLogAttr_is_mandatory_break) and
+      bm_TPangoLogAttr_is_mandatory_break)
+
+proc is_char_break*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_char_break) shr
+      bp_TPangoLogAttr_is_char_break
+
+proc set_is_char_break*(a: var TPangoLogAttr, `is_char_break`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_char_break` shl bp_TPangoLogAttr_is_char_break) and
+      bm_TPangoLogAttr_is_char_break)
+
+proc is_white*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_white) shr
+      bp_TPangoLogAttr_is_white
+
+proc set_is_white*(a: var TPangoLogAttr, `is_white`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_white` shl bp_TPangoLogAttr_is_white) and
+      bm_TPangoLogAttr_is_white)
+
+proc is_cursor_position*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_cursor_position) shr
+      bp_TPangoLogAttr_is_cursor_position
+
+proc set_is_cursor_position*(a: var TPangoLogAttr, `is_cursor_position`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_cursor_position` shl bp_TPangoLogAttr_is_cursor_position) and
+      bm_TPangoLogAttr_is_cursor_position)
+
+proc is_word_start*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_word_start) shr
+      bp_TPangoLogAttr_is_word_start
+
+proc set_is_word_start*(a: var TPangoLogAttr, `is_word_start`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_word_start` shl bp_TPangoLogAttr_is_word_start) and
+      bm_TPangoLogAttr_is_word_start)
+
+proc is_word_end*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_word_end) shr
+      bp_TPangoLogAttr_is_word_end
+
+proc set_is_word_end*(a: var TPangoLogAttr, `is_word_end`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_word_end` shl bp_TPangoLogAttr_is_word_end) and
+      bm_TPangoLogAttr_is_word_end)
+
+proc is_sentence_boundary*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_sentence_boundary) shr
+      bp_TPangoLogAttr_is_sentence_boundary
+
+proc set_is_sentence_boundary*(a: var TPangoLogAttr, 
+                               `is_sentence_boundary`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_sentence_boundary` shl bp_TPangoLogAttr_is_sentence_boundary) and
+      bm_TPangoLogAttr_is_sentence_boundary)
+
+proc is_sentence_start*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_sentence_start) shr
+      bp_TPangoLogAttr_is_sentence_start
+
+proc set_is_sentence_start*(a: var TPangoLogAttr, `is_sentence_start`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_sentence_start` shl bp_TPangoLogAttr_is_sentence_start) and
+      bm_TPangoLogAttr_is_sentence_start)
+
+proc is_sentence_end*(a: var TPangoLogAttr): guint = 
+  result = (a.flag0 and bm_TPangoLogAttr_is_sentence_end) shr
+      bp_TPangoLogAttr_is_sentence_end
+
+proc set_is_sentence_end*(a: var TPangoLogAttr, `is_sentence_end`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_sentence_end` shl bp_TPangoLogAttr_is_sentence_end) and
+      bm_TPangoLogAttr_is_sentence_end)
+
+proc PANGO_TYPE_CONTEXT*(): GType = 
+  result = pango_context_get_type()
+
+proc PANGO_CONTEXT*(anObject: pointer): PPangoContext = 
+  result = cast[PPangoContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, PANGO_TYPE_CONTEXT()))
+
+proc PANGO_CONTEXT_CLASS*(klass: pointer): PPangoContextClass = 
+  result = cast[PPangoContextClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_CONTEXT()))
+
+proc PANGO_IS_CONTEXT*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_CONTEXT())
+
+proc PANGO_IS_CONTEXT_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_CONTEXT())
+
+proc PANGO_CONTEXT_GET_CLASS*(obj: PPangoContext): PPangoContextClass = 
+  result = cast[PPangoContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_CONTEXT()))
+
+proc PANGO_TYPE_FONTSET*(): GType = 
+  result = pango_fontset_get_type()
+
+proc PANGO_FONTSET*(anObject: pointer): PPangoFontset = 
+  result = cast[PPangoFontset](G_TYPE_CHECK_INSTANCE_CAST(anObject, PANGO_TYPE_FONTSET()))
+
+proc PANGO_IS_FONTSET*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONTSET())
+
+proc PANGO_FONTSET_CLASS*(klass: pointer): PPangoFontsetClass = 
+  result = cast[PPangoFontsetClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_FONTSET()))
+
+proc PANGO_IS_FONTSET_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONTSET())
+
+proc PANGO_FONTSET_GET_CLASS*(obj: PPangoFontset): PPangoFontsetClass = 
+  result = cast[PPangoFontsetClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_FONTSET()))
+
+proc pango_fontset_simple_get_type(): GType {.importc, cdecl, dynlib: pangolib.}
+
+proc PANGO_TYPE_FONTSET_SIMPLE*(): GType = 
+  result = pango_fontset_simple_get_type()
+
+proc PANGO_FONTSET_SIMPLE*(anObject: pointer): PPangoFontsetSimple = 
+  result = cast[PPangoFontsetSimple](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      PANGO_TYPE_FONTSET_SIMPLE()))
+
+proc PANGO_IS_FONTSET_SIMPLE*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONTSET_SIMPLE())
+
+proc PANGO_TYPE_FONT_DESCRIPTION*(): GType = 
+  result = pango_font_description_get_type()
+
+proc PANGO_TYPE_FONT_METRICS*(): GType = 
+  result = pango_font_metrics_get_type()
+
+proc PANGO_TYPE_FONT_FAMILY*(): GType = 
+  result = pango_font_family_get_type()
+
+proc PANGO_FONT_FAMILY*(anObject: pointer): PPangoFontFamily = 
+  result = cast[PPangoFontFamily](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      PANGO_TYPE_FONT_FAMILY()))
+
+proc PANGO_IS_FONT_FAMILY*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_FAMILY())
+
+proc PANGO_FONT_FAMILY_CLASS*(klass: Pointer): PPangoFontFamilyClass = 
+  result = cast[PPangoFontFamilyClass](G_TYPE_CHECK_CLASS_CAST(klass, 
+      PANGO_TYPE_FONT_FAMILY()))
+
+proc PANGO_IS_FONT_FAMILY_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_FAMILY())
+
+proc PANGO_FONT_FAMILY_GET_CLASS*(obj: PPangoFontFamily): PPangoFontFamilyClass = 
+  result = cast[PPangoFontFamilyClass](G_TYPE_INSTANCE_GET_CLASS(obj, 
+      PANGO_TYPE_FONT_FAMILY()))
+
+proc PANGO_TYPE_FONT_FACE*(): GType = 
+  result = pango_font_face_get_type()
+
+proc PANGO_FONT_FACE*(anObject: Pointer): PPangoFontFace = 
+  result = cast[PPangoFontFace](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      PANGO_TYPE_FONT_FACE()))
+
+proc PANGO_IS_FONT_FACE*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_FACE())
+
+proc PANGO_FONT_FACE_CLASS*(klass: Pointer): PPangoFontFaceClass = 
+  result = cast[PPangoFontFaceClass](G_TYPE_CHECK_CLASS_CAST(klass, 
+      PANGO_TYPE_FONT_FACE()))
+
+proc PANGO_IS_FONT_FACE_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_FACE())
+
+proc PANGO_FONT_FACE_GET_CLASS*(obj: Pointer): PPangoFontFaceClass = 
+  result = cast[PPangoFontFaceClass](G_TYPE_INSTANCE_GET_CLASS(obj, 
+      PANGO_TYPE_FONT_FACE()))
+
+proc PANGO_TYPE_FONT*(): GType = 
+  result = pango_font_get_type()
+
+proc PANGO_FONT*(anObject: Pointer): PPangoFont = 
+  result = cast[PPangoFont](G_TYPE_CHECK_INSTANCE_CAST(anObject, PANGO_TYPE_FONT()))
+
+proc PANGO_IS_FONT*(anObject: Pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT())
+
+proc PANGO_FONT_CLASS*(klass: Pointer): PPangoFontClass = 
+  result = cast[PPangoFontClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_FONT()))
+
+proc PANGO_IS_FONT_CLASS*(klass: Pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT())
+
+proc PANGO_FONT_GET_CLASS*(obj: PPangoFont): PPangoFontClass = 
+  result = cast[PPangoFontClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_FONT()))
+
+proc PANGO_TYPE_FONT_MAP*(): GType = 
+  result = pango_font_map_get_type()
+
+proc PANGO_FONT_MAP*(anObject: pointer): PPangoFontmap = 
+  result = cast[PPangoFontmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, 
+      PANGO_TYPE_FONT_MAP()))
+
+proc PANGO_IS_FONT_MAP*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_MAP())
+
+proc PANGO_FONT_MAP_CLASS*(klass: pointer): PPangoFontMapClass = 
+  result = cast[PPangoFontMapClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_FONT_MAP()))
+
+proc PANGO_IS_FONT_MAP_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_MAP())
+
+proc PANGO_FONT_MAP_GET_CLASS*(obj: PPangoFontMap): PPangoFontMapClass = 
+  result = cast[PPangoFontMapClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_FONT_MAP()))
+
+proc is_cluster_start*(a: var TPangoGlyphVisAttr): guint = 
+  result = (a.flag0 and bm_TPangoGlyphVisAttr_is_cluster_start) shr
+      bp_TPangoGlyphVisAttr_is_cluster_start
+
+proc set_is_cluster_start*(a: var TPangoGlyphVisAttr, `is_cluster_start`: guint) = 
+  a.flag0 = a.flag0 or
+      ((`is_cluster_start` shl bp_TPangoGlyphVisAttr_is_cluster_start) and
+      bm_TPangoGlyphVisAttr_is_cluster_start)
+
+proc PANGO_TYPE_GLYPH_STRING*(): GType = 
+  result = pango_glyph_string_get_type()
+
+proc PANGO_TYPE_LAYOUT*(): GType = 
+  result = pango_layout_get_type()
+
+proc PANGO_LAYOUT*(anObject: pointer): PPangoLayout = 
+  result = cast[PPangoLayout](G_TYPE_CHECK_INSTANCE_CAST(anObject, PANGO_TYPE_LAYOUT()))
+
+proc PANGO_LAYOUT_CLASS*(klass: pointer): PPangoLayoutClass = 
+  result = cast[PPangoLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_LAYOUT()))
+
+proc PANGO_IS_LAYOUT*(anObject: pointer): bool = 
+  result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_LAYOUT())
+
+proc PANGO_IS_LAYOUT_CLASS*(klass: pointer): bool = 
+  result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_LAYOUT())
+
+proc PANGO_LAYOUT_GET_CLASS*(obj: PPangoLayout): PPangoLayoutClass = 
+  result = cast[PPangoLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_LAYOUT()))
+
+proc PANGO_TYPE_TAB_ARRAY*(): GType = 
+  result = pango_tab_array_get_type()
diff --git a/lib/base/gtk/pangoutils.nim b/lib/base/gtk/pangoutils.nim
new file mode 100755
index 000000000..2c328b59a
--- /dev/null
+++ b/lib/base/gtk/pangoutils.nim
@@ -0,0 +1,46 @@
+import 
+  glib2, pango
+
+type 
+  pint32* = ptr int32
+
+proc pango_split_file_list*(str: cstring): PPchar{.cdecl, dynlib: pangolib, 
+    importc: "pango_split_file_list".}
+proc pango_trim_string*(str: cstring): cstring{.cdecl, dynlib: pangolib, 
+    importc: "pango_trim_string".}
+proc pango_read_line*(stream: TFile, str: PGString): gint{.cdecl, 
+    dynlib: pangolib, importc: "pango_read_line".}
+proc pango_skip_space*(pos: PPchar): gboolean{.cdecl, dynlib: pangolib, 
+    importc: "pango_skip_space".}
+proc pango_scan_word*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_scan_word".}
+proc pango_scan_string*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_scan_string".}
+proc pango_scan_int*(pos: PPchar, OutInt: pint32): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_scan_int".}
+when defined(PANGO_ENABLE_BACKEND): 
+  proc pango_config_key_get(key: cstring): cstring{.cdecl, dynlib: pangolib, 
+      importc: "pango_config_key_get".}
+  proc pango_lookup_aliases(fontname: cstring, families: PPPchar, 
+                            n_families: pint32){.cdecl, dynlib: pangolib, 
+      importc: "pango_lookup_aliases".}
+proc pango_parse_style*(str: cstring, style: PPangoStyle, warn: gboolean): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_parse_style".}
+proc pango_parse_variant*(str: cstring, variant: PPangoVariant, warn: gboolean): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_parse_variant".}
+proc pango_parse_weight*(str: cstring, weight: PPangoWeight, warn: gboolean): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_parse_weight".}
+proc pango_parse_stretch*(str: cstring, stretch: PPangoStretch, warn: gboolean): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_parse_stretch".}
+when defined(PANGO_ENABLE_BACKEND): 
+  proc pango_get_sysconf_subdirectory(): cstring{.cdecl, dynlib: pangolib, 
+      importc: "pango_get_sysconf_subdirectory".}
+  proc pango_get_lib_subdirectory(): cstring{.cdecl, dynlib: pangolib, 
+      importc: "pango_get_lib_subdirectory".}
+proc pango_log2vis_get_embedding_levels*(str: Pgunichar, len: int32, 
+    pbase_dir: PPangoDirection, embedding_level_list: Pguint8): gboolean{.cdecl, 
+    dynlib: pangolib, importc: "pango_log2vis_get_embedding_levels".}
+proc pango_get_mirror_char*(ch: gunichar, mirrored_ch: Pgunichar): gboolean{.
+    cdecl, dynlib: pangolib, importc: "pango_get_mirror_char".}
+proc pango_language_get_sample_string*(language: PPangoLanguage): cstring{.
+    cdecl, dynlib: pangolib, importc: "pango_language_get_sample_string".}
\ No newline at end of file
diff --git a/lib/base/nregex.nim b/lib/base/nregex.nim
new file mode 100755
index 000000000..509f77f1b
--- /dev/null
+++ b/lib/base/nregex.nim
@@ -0,0 +1,124 @@
+# new implementation of regular expressions
+
+type
+  TRegexKind = enum 
+    regNone,
+    regChar, 
+    regSet,
+    regConc,
+    regAlt,
+    regStar,
+    regPlus,
+    regMN,
+    regNewline
+  
+  TRegex = record
+    case kind: TRegexKind
+    of regChar: c: char
+    of regSet: s: ref set[char]
+    else: a, b: PRegEx
+    
+  PRegEx* = ref TRegEx
+
+  TRegExFlag* = enum   ## Flags concerning the semantics of regular expressions
+    reCaseInsensitive, ## case insensitive match 
+    reStyleInsensitive ## style insensitive match
+    
+    
+  TRegExFlags* = set[TRegExFlag]
+    ## Flags concerning the semantics of regular expressions
+    
+proc raiseRegex(msg: string) {.noreturn.} = 
+  var e: ref Exception
+  new(e)
+  e.msg = msg
+  raise e
+
+proc compileAux(i: int, s: string, r: PRegEx): int
+    
+proc compileBackslash(i: int, s: string, r: PRegEx): int = 
+  var i = i
+  inc(i)
+  case s[i]
+  of 'A'..'Z': 
+  of 'a'..'z':
+  of '0':
+  of '1'..'9': 
+  
+  else:
+    r.kind = regChar
+    r.c = s[i]
+  inc(i)
+  result = i
+
+proc compileAtom(i: int, s: string, r: PRegEx): int = 
+  var i = i
+  case s[i]
+  of '[':
+    inc(i)
+    var inverse = s[i] == '^'
+    if inverse: inc(i)
+    r.kind = regSet
+    new(r.s)
+    while true: 
+      case s[i]
+      of '\\': i = compileBackslash(i, s, r)
+      of ']': 
+        inc(i)
+        break
+      of '\0': 
+        raiseRegex("']' expected")
+      elif s[i+1] == '-':
+        var x = s[i]
+        inc(i, 2)
+        var y = s[i]
+        inc(i)
+        r.s = r.s + {x..y}
+      else:
+        incl(r.s, s[i])
+        inc(i)
+    if inverse:
+      r.s = {'\0'..'\255'} - r.s
+  of '\\':
+    inc(i)
+    i = compileBackslash(i, s, r)
+  of '.':
+    r.kind = regAny
+    inc(i)
+  of '(': 
+    inc(i)
+    i = compileAux(i, s, r)
+    if s[i] = ')': inc(i)
+    else: raiseRegex("')' expected")
+  of '\0': nil # do nothing
+  else:
+    r.kind = regChar
+    r.c = s[i]
+    inc(i)
+  result = i
+    
+proc compilePostfix(i: int, s: string, r: PRegEx): int = 
+  var i = compileAtom(i, s, r)
+  var a: PRegEx
+  case s[i]
+  of '*':
+  of '+':
+  of '?':
+  else: nil
+
+proc compileAux(i: int, s: string, r: PRegEx): int = 
+  var i = i
+  i = compileAtom(i, s, r)
+  
+  while s[i] != '\0':
+    
+  result = i
+    
+proc compile*(regex: string, flags: TRegExFlags = {}): PRegEx = 
+  ## Compiles the string `regex` that represents a regular expression into 
+  ## an internal data structure that can be used for matching.
+  new(result)
+  var i = compileAux(0, regex, result)
+  if i < len(regex)-1:
+    # not all characters used for the regular expression?
+    raiseRegEx("invalid regular expression")
diff --git a/lib/base/pcre.nim b/lib/base/pcre.nim
new file mode 100755
index 000000000..6a9f14123
--- /dev/null
+++ b/lib/base/pcre.nim
@@ -0,0 +1,296 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+# This file was created by a complicated procedure which saved me a considerable

+# amount of time: the pcre.h header was converted to modpcre.h by hand, so that

+# h2pas could handle it. Then I used pas2mor to generate a Morpork binding.

+# Unfortunately, I had to fix some things later on; thus don't do all this

+# again! My manual changes will be lost!

+

+# Converted by Pas2mor v1.37

+#

+#  Automatically converted by H2Pas 0.99.16 from modpcre.h

+#  The following command line parameters were used:

+#    -D -c -l pcre.lib -T modpcre.h

+

+{.compile: "pcre_all.c" .}

+

+type

+  Pbyte = ptr byte

+  Pchar = CString

+  PPchar = ptr PChar

+  Pint = ptr cint

+  Ppcre* = ptr TPcre

+  Ppcre_callout_block = ptr tpcre_callout_block

+  Ppcre_extra = ptr Tpcre_extra

+

+#************************************************

+#*       Perl-Compatible Regular Expressions    *

+#************************************************

+#

+#   Modified by Andreas Rumpf for h2pas.

+

+# In its original form, this is the .in file that is transformed by

+# "configure" into pcre.h.

+#

+#           Copyright (c) 1997-2005 University of Cambridge

+#

+# -----------------------------------------------------------------------------

+# 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 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.

+# -----------------------------------------------------------------------------

+

+# The file pcre.h is build by "configure". Do not edit it; instead

+# make changes to pcre.in.

+

+const

+  PCRE_MAJOR* = 6

+  PCRE_MINOR* = 3

+  PCRE_DATE* = "2005/11/29"

+  # Options

+  PCRE_CASELESS* = 0x00000001

+  PCRE_MULTILINE* = 0x00000002

+  PCRE_DOTALL* = 0x00000004

+  PCRE_EXTENDED* = 0x00000008

+  PCRE_ANCHORED* = 0x00000010

+  PCRE_DOLLAR_ENDONLY* = 0x00000020

+  PCRE_EXTRA* = 0x00000040

+  PCRE_NOTBOL* = 0x00000080

+  PCRE_NOTEOL* = 0x00000100

+  PCRE_UNGREEDY* = 0x00000200

+  PCRE_NOTEMPTY* = 0x00000400

+  PCRE_UTF8* = 0x00000800

+  PCRE_NO_AUTO_CAPTURE* = 0x00001000

+  PCRE_NO_UTF8_CHECK* = 0x00002000

+  PCRE_AUTO_CALLOUT* = 0x00004000

+  PCRE_PARTIAL* = 0x00008000

+  PCRE_DFA_SHORTEST* = 0x00010000

+  PCRE_DFA_RESTART* = 0x00020000

+  PCRE_FIRSTLINE* = 0x00040000

+  # Exec-time and get/set-time error codes

+  PCRE_ERROR_NOMATCH* = -(1)

+  PCRE_ERROR_NULL* = -(2)

+  PCRE_ERROR_BADOPTION* = -(3)

+  PCRE_ERROR_BADMAGIC* = -(4)

+  PCRE_ERROR_UNKNOWN_NODE* = -(5)

+  PCRE_ERROR_NOMEMORY* = -(6)

+  PCRE_ERROR_NOSUBSTRING* = -(7)

+  PCRE_ERROR_MATCHLIMIT* = -(8)

+  # Never used by PCRE itself

+  PCRE_ERROR_CALLOUT* = -(9)

+  PCRE_ERROR_BADUTF8* = -(10)

+  PCRE_ERROR_BADUTF8_OFFSET* = -(11)

+  PCRE_ERROR_PARTIAL* = -(12)

+  PCRE_ERROR_BADPARTIAL* = -(13)

+  PCRE_ERROR_INTERNAL* = -(14)

+  PCRE_ERROR_BADCOUNT* = -(15)

+  PCRE_ERROR_DFA_UITEM* = -(16)

+  PCRE_ERROR_DFA_UCOND* = -(17)

+  PCRE_ERROR_DFA_UMLIMIT* = -(18)

+  PCRE_ERROR_DFA_WSSIZE* = -(19)

+  PCRE_ERROR_DFA_RECURSE* = -(20)

+  # Request types for pcre_fullinfo()

+  PCRE_INFO_OPTIONS* = 0

+  PCRE_INFO_SIZE* = 1

+  PCRE_INFO_CAPTURECOUNT* = 2

+  PCRE_INFO_BACKREFMAX* = 3

+  PCRE_INFO_FIRSTBYTE* = 4

+  # For backwards compatibility

+  PCRE_INFO_FIRSTCHAR* = 4

+  PCRE_INFO_FIRSTTABLE* = 5

+  PCRE_INFO_LASTLITERAL* = 6

+  PCRE_INFO_NAMEENTRYSIZE* = 7

+  PCRE_INFO_NAMECOUNT* = 8

+  PCRE_INFO_NAMETABLE* = 9

+  PCRE_INFO_STUDYSIZE* = 10

+  PCRE_INFO_DEFAULT_TABLES* = 11

+  # Request types for pcre_config()

+  PCRE_CONFIG_UTF8* = 0

+  PCRE_CONFIG_NEWLINE* = 1

+  PCRE_CONFIG_LINK_SIZE* = 2

+  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD* = 3

+  PCRE_CONFIG_MATCH_LIMIT* = 4

+  PCRE_CONFIG_STACKRECURSE* = 5

+  PCRE_CONFIG_UNICODE_PROPERTIES* = 6

+  # Bit flags for the pcre_extra structure

+  PCRE_EXTRA_STUDY_DATA* = 0x0001

+  PCRE_EXTRA_MATCH_LIMIT* = 0x0002

+  PCRE_EXTRA_CALLOUT_DATA* = 0x0004

+  PCRE_EXTRA_TABLES* = 0x0008

+  # Types

+

+type

+  TPcre = record

+  #undefined structure

+

+

+  # The structure for passing additional data to pcre_exec(). This is defined

+  # in such as way as to be extensible. Always add new fields at the end,

+  # in order to remain compatible. 

+  # Bits for which fields are set 

+  # Opaque data from pcre_study()  

+  # Maximum number of calls to match()  

+  # Data passed back in callouts  

+  # Const before type ignored 

+  # Pointer to character tables  

+  Tpcre_extra* = record

+    flags: cuint

+    study_data: pointer

+    match_limit: cuint

+    callout_data: pointer

+    tables: ptr byte

+

+  # The structure for passing out data via the pcre_callout_function. We use a

+  # structure so that new fields can be added on the end in future versions,

+  # without changing the API of the function, thereby allowing old clients to

+  # work without modification.  

+  # Identifies version of block  

+  # ------------------------ Version 0 -------------------------------  

+  # Number compiled into pattern  

+  # The offset vector  

+  # Const before type ignored 

+  # The subject being matched  

+  # The length of the subject  

+  # Offset to start of this match attempt  

+  # Where we currently are in the subject  

+  # Max current capture  

+  # Most recently closed capture  

+  # Data passed in with the call  

+  # ------------------- Added for Version 1 --------------------------  

+  # Offset to next item in the pattern  

+  # Length of next item in the pattern  

+  # ------------------------------------------------------------------  

+  TPcre_callout_block* = record

+    version: cint

+    callout_number: cint

+    offset_vector: ptr cint

+    subject: ptr char

+    subject_length: cint

+    start_match: cint

+    current_position: cint

+    capture_top: cint

+    capture_last: cint

+    callout_data: pointer

+    pattern_position: cint

+    next_item_length: cint

+

+# Exported PCRE functions  

+

+proc pcre_compile*(para1: Pchar, para2: cint, para3: ptr Pchar,

+                  para4: Pint, para5: Pbyte): Ppcre {.

+                  importc: "pcre_compile", noconv.}

+

+proc pcre_compile2*(para1: Pchar, para2: cint, para3: Pint, para4: PPchar,

+                   para5: Pint, para6: Pbyte): Ppcre {. 

+                   importc: "pcre_compile2", noconv.}

+

+proc pcre_config*(para1: cint, para2: pointer): cint {.

+  importc: "pcre_config", noconv.}

+

+proc pcre_copy_named_substring*(para1: Ppcre, para2: Pchar, para3: Pint,

+                               para4: cint, para5: Pchar, para6: Pchar,

+                               para7: cint): cint {.

+                               importc: "pcre_copy_named_substring", noconv.}

+

+proc pcre_copy_substring*(para1: Pchar, para2: Pint, para3: cint, para4: cint,

+                         para5: Pchar, para6: cint): cint {.

+                         importc: "pcre_copy_substring", noconv.}

+

+proc pcre_dfa_exec*(para1: Ppcre, para2: Ppcre_extra, para3: Pchar,

+                   para4: cint, para5: cint, para6: cint, para7: Pint,

+                   para8: cint, para9: Pint, para10: cint): cint {.

+                   importc: "pcre_dfa_exec", noconv.}

+

+proc pcre_exec*(para1: Ppcre, para2: Ppcre_extra, para3: Pchar,

+               para4: cint, para5: cint, para6: cint, para7: Pint,

+               para8: cint): cint {.importc: "pcre_exec", noconv.}

+

+proc pcre_free_substring*(para1: Pchar) {.

+  importc: "pcre_free_substring", noconv.}

+

+proc pcre_free_substring_list*(para1: PPchar) {.

+  importc: "pcre_free_substring_list", noconv.}

+

+proc pcre_fullinfo*(para1: Ppcre, para2: Ppcre_extra, para3: cint,

+                   para4: pointer): cint {.importc: "pcre_fullinfo", noconv.}

+

+proc pcre_get_named_substring*(para1: Ppcre, para2: Pchar, para3: Pint,

+                              para4: cint, para5: Pchar, para6: PPchar): cint {.

+                              importc: "pcre_get_named_substring", noconv.}

+

+proc pcre_get_stringnumber*(para1: Ppcre, para2: Pchar): cint {.

+  importc: "pcre_get_stringnumber", noconv.}

+

+proc pcre_get_substring*(para1: Pchar, para2: Pint, para3: cint,

+                        para4: cint, para5: PPchar): cint {.

+                        importc: "pcre_get_substring", noconv.}

+

+proc pcre_get_substring_list*(para1: Pchar, para2: Pint, para3: cint,

+                             para4: ptr PPchar): cint {.

+                             importc: "pcre_get_substring_list", noconv.}

+

+proc pcre_info*(para1: Ppcre, para2: Pint, para3: Pint): cint {.

+  importc: "pcre_info", noconv.}

+

+proc pcre_maketables*: ptr byte {.

+  importc: "pcre_maketables", noconv.}

+

+proc pcre_refcount*(para1: Ppcre, para2: cint): cint {.

+  importc: "pcre_refcount", noconv.}

+

+proc pcre_study*(para1: Ppcre, para2: cint,

+                 para3: ptr CString): Ppcre_extra {.importc, noconv.}

+

+proc pcre_version*: CString {.importc: "pcre_version", noconv.}

+

+# Indirection for store get and free functions. These can be set to

+# alternative malloc/free functions if required. Special ones are used in the

+# non-recursive case for "frames". There is also an optional callout function

+# that is triggered by the (?) regex item.

+#

+

+# we use Nimrod's memory manager (but not GC!) for these functions:

+var

+  pcre_malloc {.importc: "pcre_malloc".}: proc (para1: int): pointer {.noconv.}

+  pcre_free {.importc: "pcre_free".}: proc (para1: pointer) {.noconv.}

+  pcre_stack_malloc {.importc: "pcre_stack_malloc".}:

+    proc (para1: int): pointer {.noconv.}

+  pcre_stack_free  {.importc: "pcre_stack_free".}:

+    proc (para1: pointer) {.noconv.}

+  pcre_callout {.importc: "pcre_callout".}:

+    proc (para1: Ppcre_callout_block): cint {.noconv.}

+

+pcre_malloc = system.alloc

+pcre_free = system.dealloc

+pcre_stack_malloc = system.alloc

+pcre_stack_free = system.dealloc

+pcre_callout = nil

diff --git a/lib/base/pcre_all.c b/lib/base/pcre_all.c
new file mode 100755
index 000000000..bcda06e50
--- /dev/null
+++ b/lib/base/pcre_all.c
@@ -0,0 +1,30072 @@
+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* This file is automatically written by the dftables auxiliary

+program. If you edit it by hand, you might like to edit the Makefile to

+prevent its ever being regenerated.

+

+This file contains the default tables for characters with codes less than

+128 (ASCII characters). These tables are used when no external tables are

+passed to PCRE. */

+

+const unsigned char _pcre_default_tables[] = {

+

+/* This table is a lower casing table. */

+

+    0,  1,  2,  3,  4,  5,  6,  7,

+    8,  9, 10, 11, 12, 13, 14, 15,

+   16, 17, 18, 19, 20, 21, 22, 23,

+   24, 25, 26, 27, 28, 29, 30, 31,

+   32, 33, 34, 35, 36, 37, 38, 39,

+   40, 41, 42, 43, 44, 45, 46, 47,

+   48, 49, 50, 51, 52, 53, 54, 55,

+   56, 57, 58, 59, 60, 61, 62, 63,

+   64, 97, 98, 99,100,101,102,103,

+  104,105,106,107,108,109,110,111,

+  112,113,114,115,116,117,118,119,

+  120,121,122, 91, 92, 93, 94, 95,

+   96, 97, 98, 99,100,101,102,103,

+  104,105,106,107,108,109,110,111,

+  112,113,114,115,116,117,118,119,

+  120,121,122,123,124,125,126,127,

+  128,129,130,131,132,133,134,135,

+  136,137,138,139,140,141,142,143,

+  144,145,146,147,148,149,150,151,

+  152,153,154,155,156,157,158,159,

+  160,161,162,163,164,165,166,167,

+  168,169,170,171,172,173,174,175,

+  176,177,178,179,180,181,182,183,

+  184,185,186,187,188,189,190,191,

+  192,193,194,195,196,197,198,199,

+  200,201,202,203,204,205,206,207,

+  208,209,210,211,212,213,214,215,

+  216,217,218,219,220,221,222,223,

+  224,225,226,227,228,229,230,231,

+  232,233,234,235,236,237,238,239,

+  240,241,242,243,244,245,246,247,

+  248,249,250,251,252,253,254,255,

+

+/* This table is a case flipping table. */

+

+    0,  1,  2,  3,  4,  5,  6,  7,

+    8,  9, 10, 11, 12, 13, 14, 15,

+   16, 17, 18, 19, 20, 21, 22, 23,

+   24, 25, 26, 27, 28, 29, 30, 31,

+   32, 33, 34, 35, 36, 37, 38, 39,

+   40, 41, 42, 43, 44, 45, 46, 47,

+   48, 49, 50, 51, 52, 53, 54, 55,

+   56, 57, 58, 59, 60, 61, 62, 63,

+   64, 97, 98, 99,100,101,102,103,

+  104,105,106,107,108,109,110,111,

+  112,113,114,115,116,117,118,119,

+  120,121,122, 91, 92, 93, 94, 95,

+   96, 65, 66, 67, 68, 69, 70, 71,

+   72, 73, 74, 75, 76, 77, 78, 79,

+   80, 81, 82, 83, 84, 85, 86, 87,

+   88, 89, 90,123,124,125,126,127,

+  128,129,130,131,132,133,134,135,

+  136,137,138,139,140,141,142,143,

+  144,145,146,147,148,149,150,151,

+  152,153,154,155,156,157,158,159,

+  160,161,162,163,164,165,166,167,

+  168,169,170,171,172,173,174,175,

+  176,177,178,179,180,181,182,183,

+  184,185,186,187,188,189,190,191,

+  192,193,194,195,196,197,198,199,

+  200,201,202,203,204,205,206,207,

+  208,209,210,211,212,213,214,215,

+  216,217,218,219,220,221,222,223,

+  224,225,226,227,228,229,230,231,

+  232,233,234,235,236,237,238,239,

+  240,241,242,243,244,245,246,247,

+  248,249,250,251,252,253,254,255,

+

+/* This table contains bit maps for various character classes.

+Each map is 32 bytes long and the bits run from the least

+significant end of each byte. The classes that have their own

+maps are: space, xdigit, digit, upper, lower, word, graph

+print, punct, and cntrl. Other classes are built from combinations. */

+

+  0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,

+  0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,

+  0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,

+  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,

+  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,

+  0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+  0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

+

+/* This table identifies various classes of character by individual bits:

+  0x01   white space character

+  0x02   letter

+  0x04   decimal digit

+  0x08   hexadecimal digit

+  0x10   alphanumeric or '_'

+  0x80   regular expression metacharacter or binary zero

+*/

+

+  0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   0-  7 */

+  0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /*   8- 15 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  16- 23 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31 */

+  0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /*    - '  */

+  0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /*  ( - /  */

+  0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /*  0 - 7  */

+  0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /*  8 - ?  */

+  0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  @ - G  */

+  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  H - O  */

+  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  P - W  */

+  0x12,0x12,0x12,0x80,0x00,0x00,0x80,0x10, /*  X - _  */

+  0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  ` - g  */

+  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  h - o  */

+  0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  p - w  */

+  0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /*  x -127 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */

+

+/* End of chartables.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_compile(), along with

+supporting internal functions that are not used by other modules. */

+

+

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+/* This header contains definitions that are shared between the different

+modules, but which are not relevant to the exported API. This includes some

+functions whose names all begin with "_pcre_". */

+

+

+/* Define DEBUG to get debugging output on stdout. */

+

+/****

+#define DEBUG

+****/

+

+/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef

+inline, and there are *still* stupid compilers about that don't like indented

+pre-processor statements, or at least there were when I first wrote this. After

+all, it had only been about 10 years then... */

+

+#ifdef DEBUG

+#define DPRINTF(p) printf p

+#else

+#define DPRINTF(p) /*nothing*/

+#endif

+

+

+/* Get the definitions provided by running "configure" */

+

+

+/* On Unix systems config.in is converted by configure into config.h. PCRE is

+written in Standard C, but there are a few non-standard things it can cope

+with, allowing it to run on SunOS4 and other "close to standard" systems.

+

+On a non-Unix system you should just copy this file into config.h, and set up

+the macros the way you need them. You should normally change the definitions of

+HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way autoconf

+works, these cannot be made the defaults. If your system has bcopy() and not

+memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. If your

+system has neither bcopy() nor memmove(), leave them both as 0; an emulation

+function will be used. */

+

+/* If you are compiling for a system that uses EBCDIC instead of ASCII

+character codes, define this macro as 1. On systems that can use "configure",

+this can be done via --enable-ebcdic. */

+

+#ifndef EBCDIC

+#define EBCDIC 0

+#endif

+

+/* If you are compiling for a system that needs some magic to be inserted

+before the definition of an exported function, define this macro to contain the

+relevant magic. It apears at the start of every exported function. */

+

+#define EXPORT

+

+/* Define to empty if the "const" keyword does not work. */

+

+#undef const

+

+/* Define to "unsigned" if <stddef.h> doesn't define size_t. */

+

+#undef size_t

+

+/* The following two definitions are mainly for the benefit of SunOS4, which

+doesn't have the strerror() or memmove() functions that should be present in

+all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should

+normally be defined with the value 1 for other systems, but unfortunately we

+can't make this the default because "configure" files generated by autoconf

+will only change 0 to 1; they won't change 1 to 0 if the functions are not

+found. */

+

+#define HAVE_STRERROR 1

+#define HAVE_MEMMOVE  1

+

+/* There are some non-Unix systems that don't even have bcopy(). If this macro

+is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of

+HAVE_BCOPY is not relevant. */

+

+#define HAVE_BCOPY    0

+

+/* The value of NEWLINE determines the newline character. The default is to

+leave it up to the compiler, but some sites want to force a particular value.

+On Unix systems, "configure" can be used to override this default. */

+

+#ifndef NEWLINE

+#define NEWLINE '\n'

+#endif

+

+/* The value of LINK_SIZE determines the number of bytes used to store

+links as offsets within the compiled regex. The default is 2, which allows for

+compiled patterns up to 64K long. This covers the vast majority of cases.

+However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for

+longer patterns in extreme cases. On Unix systems, "configure" can be used to

+override this default. */

+

+#ifndef LINK_SIZE

+#define LINK_SIZE   2

+#endif

+

+/* The value of MATCH_LIMIT determines the default number of times the match()

+function can be called during a single execution of pcre_exec(). (There is a

+runtime method of setting a different limit.) The limit exists in order to

+catch runaway regular expressions that take for ever to determine that they do

+not match. The default is set very large so that it does not accidentally catch

+legitimate cases. On Unix systems, "configure" can be used to override this

+default default. */

+

+#ifndef MATCH_LIMIT

+#define MATCH_LIMIT 10000000

+#endif

+

+/* When calling PCRE via the POSIX interface, additional working storage is

+required for holding the pointers to capturing substrings because PCRE requires

+three integers per substring, whereas the POSIX interface provides only two. If

+the number of expected substrings is small, the wrapper function uses space on

+the stack, because this is faster than using malloc() for each call. The

+threshold above which the stack is no longer use is defined by POSIX_MALLOC_

+THRESHOLD. On Unix systems, "configure" can be used to override this default.

+*/

+

+#ifndef POSIX_MALLOC_THRESHOLD

+#define POSIX_MALLOC_THRESHOLD 10

+#endif

+

+/* PCRE uses recursive function calls to handle backtracking while matching.

+This can sometimes be a problem on systems that have stacks of limited size.

+Define NO_RECURSE to get a version that doesn't use recursion in the match()

+function; instead it creates its own stack by steam using pcre_recurse_malloc

+to get memory. For more detail, see comments and other stuff just above the

+match() function. On Unix systems, "configure" can be used to set this in the

+Makefile (use --disable-stack-for-recursion). */

+

+/* #define NO_RECURSE */

+

+/* End */

+

+/* Standard C headers plus the external interface definition. The only time

+setjmp and stdarg are used is when NO_RECURSE is set. */

+

+#include <ctype.h>

+#include <limits.h>

+#include <setjmp.h>

+#include <stdarg.h>

+#include <stddef.h>

+#include <stdio.h>

+#include <stdlib.h>

+#include <string.h>

+

+#ifndef PCRE_SPY

+#define PCRE_DEFINITION       /* Win32 __declspec(export) trigger for .dll */

+#endif

+

+/* We need to have types that specify unsigned 16-bit and 32-bit integers. We

+cannot determine these outside the compilation (e.g. by running a program as

+part of "configure") because PCRE is often cross-compiled for use on other

+systems. Instead we make use of the maximum sizes that are available at

+preprocessor time in standard C environments. */

+

+#if USHRT_MAX == 65535

+  typedef unsigned short pcre_uint16;

+#elif UINT_MAX == 65535

+  typedef unsigned int pcre_uint16;

+#else

+  #error Cannot determine a type for 16-bit unsigned integers

+#endif

+

+#if UINT_MAX == 4294967295

+  typedef unsigned int pcre_uint32;

+#elif ULONG_MAX == 4294967295

+  typedef unsigned long int pcre_uint32;

+#else

+  #error Cannot determine a type for 32-bit unsigned integers

+#endif

+

+/* All character handling must be done as unsigned characters. Otherwise there

+are problems with top-bit-set characters and functions such as isspace().

+However, we leave the interface to the outside world as char *, because that

+should make things easier for callers. We define a short type for unsigned char

+to save lots of typing. I tried "uchar", but it causes problems on Digital

+Unix, where it is defined in sys/types, so use "uschar" instead. */

+

+typedef unsigned char uschar;

+

+/* Include the public PCRE header */

+

+/*************************************************

+*       Perl-Compatible Regular Expressions      *

+*************************************************/

+

+/* In its original form, this is the .in file that is transformed by

+"configure" into pcre.h.

+

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+#ifndef _PCRE_H

+#define _PCRE_H

+

+/* The file pcre.h is build by "configure". Do not edit it; instead

+make changes to pcre.in. */

+

+#define PCRE_MAJOR          6

+#define PCRE_MINOR          3

+#define PCRE_DATE           "2005/11/29"

+

+/* For other operating systems, we use the standard "extern". */

+

+#ifndef PCRE_DATA_SCOPE

+#  ifdef __cplusplus

+#    define PCRE_DATA_SCOPE     extern "C"

+#  else

+#    define PCRE_DATA_SCOPE     extern

+#  endif

+#endif

+

+/* Have to include stdlib.h in order to ensure that size_t is defined;

+it is needed here for malloc. */

+

+#include <stdlib.h>

+

+/* Allow for C++ users */

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/* Options */

+

+#define PCRE_CASELESS           0x00000001

+#define PCRE_MULTILINE          0x00000002

+#define PCRE_DOTALL             0x00000004

+#define PCRE_EXTENDED           0x00000008

+#define PCRE_ANCHORED           0x00000010

+#define PCRE_DOLLAR_ENDONLY     0x00000020

+#define PCRE_EXTRA              0x00000040

+#define PCRE_NOTBOL             0x00000080

+#define PCRE_NOTEOL             0x00000100

+#define PCRE_UNGREEDY           0x00000200

+#define PCRE_NOTEMPTY           0x00000400

+#define PCRE_UTF8               0x00000800

+#define PCRE_NO_AUTO_CAPTURE    0x00001000

+#define PCRE_NO_UTF8_CHECK      0x00002000

+#define PCRE_AUTO_CALLOUT       0x00004000

+#define PCRE_PARTIAL            0x00008000

+#define PCRE_DFA_SHORTEST       0x00010000

+#define PCRE_DFA_RESTART        0x00020000

+#define PCRE_FIRSTLINE          0x00040000

+

+/* Exec-time and get/set-time error codes */

+

+#define PCRE_ERROR_NOMATCH         (-1)

+#define PCRE_ERROR_NULL            (-2)

+#define PCRE_ERROR_BADOPTION       (-3)

+#define PCRE_ERROR_BADMAGIC        (-4)

+#define PCRE_ERROR_UNKNOWN_NODE    (-5)

+#define PCRE_ERROR_NOMEMORY        (-6)

+#define PCRE_ERROR_NOSUBSTRING     (-7)

+#define PCRE_ERROR_MATCHLIMIT      (-8)

+#define PCRE_ERROR_CALLOUT         (-9)  /* Never used by PCRE itself */

+#define PCRE_ERROR_BADUTF8        (-10)

+#define PCRE_ERROR_BADUTF8_OFFSET (-11)

+#define PCRE_ERROR_PARTIAL        (-12)

+#define PCRE_ERROR_BADPARTIAL     (-13)

+#define PCRE_ERROR_INTERNAL       (-14)

+#define PCRE_ERROR_BADCOUNT       (-15)

+#define PCRE_ERROR_DFA_UITEM      (-16)

+#define PCRE_ERROR_DFA_UCOND      (-17)

+#define PCRE_ERROR_DFA_UMLIMIT    (-18)

+#define PCRE_ERROR_DFA_WSSIZE     (-19)

+#define PCRE_ERROR_DFA_RECURSE    (-20)

+

+/* Request types for pcre_fullinfo() */

+

+#define PCRE_INFO_OPTIONS            0

+#define PCRE_INFO_SIZE               1

+#define PCRE_INFO_CAPTURECOUNT       2

+#define PCRE_INFO_BACKREFMAX         3

+#define PCRE_INFO_FIRSTBYTE          4

+#define PCRE_INFO_FIRSTCHAR          4  /* For backwards compatibility */

+#define PCRE_INFO_FIRSTTABLE         5

+#define PCRE_INFO_LASTLITERAL        6

+#define PCRE_INFO_NAMEENTRYSIZE      7

+#define PCRE_INFO_NAMECOUNT          8

+#define PCRE_INFO_NAMETABLE          9

+#define PCRE_INFO_STUDYSIZE         10

+#define PCRE_INFO_DEFAULT_TABLES    11

+

+/* Request types for pcre_config() */

+

+#define PCRE_CONFIG_UTF8                    0

+#define PCRE_CONFIG_NEWLINE                 1

+#define PCRE_CONFIG_LINK_SIZE               2

+#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD  3

+#define PCRE_CONFIG_MATCH_LIMIT             4

+#define PCRE_CONFIG_STACKRECURSE            5

+#define PCRE_CONFIG_UNICODE_PROPERTIES      6

+

+/* Bit flags for the pcre_extra structure */

+

+#define PCRE_EXTRA_STUDY_DATA          0x0001

+#define PCRE_EXTRA_MATCH_LIMIT         0x0002

+#define PCRE_EXTRA_CALLOUT_DATA        0x0004

+#define PCRE_EXTRA_TABLES              0x0008

+

+/* Types */

+

+struct real_pcre;                 /* declaration; the definition is private  */

+typedef struct real_pcre pcre;

+

+/* The structure for passing additional data to pcre_exec(). This is defined in

+such as way as to be extensible. Always add new fields at the end, in order to

+remain compatible. */

+

+typedef struct pcre_extra {

+  unsigned long int flags;        /* Bits for which fields are set */

+  void *study_data;               /* Opaque data from pcre_study() */

+  unsigned long int match_limit;  /* Maximum number of calls to match() */

+  void *callout_data;             /* Data passed back in callouts */

+  const unsigned char *tables;    /* Pointer to character tables */

+} pcre_extra;

+

+/* The structure for passing out data via the pcre_callout_function. We use a

+structure so that new fields can be added on the end in future versions,

+without changing the API of the function, thereby allowing old clients to work

+without modification. */

+

+typedef struct pcre_callout_block {

+  int          version;           /* Identifies version of block */

+  /* ------------------------ Version 0 ------------------------------- */

+  int          callout_number;    /* Number compiled into pattern */

+  int         *offset_vector;     /* The offset vector */

+  const char  *subject;           /* The subject being matched */

+  int          subject_length;    /* The length of the subject */

+  int          start_match;       /* Offset to start of this match attempt */

+  int          current_position;  /* Where we currently are in the subject */

+  int          capture_top;       /* Max current capture */

+  int          capture_last;      /* Most recently closed capture */

+  void        *callout_data;      /* Data passed in with the call */

+  /* ------------------- Added for Version 1 -------------------------- */

+  int          pattern_position;  /* Offset to next item in the pattern */

+  int          next_item_length;  /* Length of next item in the pattern */

+  /* ------------------------------------------------------------------ */

+} pcre_callout_block;

+

+/* Indirection for store get and free functions. These can be set to

+alternative malloc/free functions if required. Special ones are used in the

+non-recursive case for "frames". There is also an optional callout function

+that is triggered by the (?) regex item. For Virtual Pascal, these definitions

+have to take another form. */

+

+#ifndef VPCOMPAT

+PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);

+PCRE_DATA_SCOPE void  (*pcre_free)(void *);

+PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);

+PCRE_DATA_SCOPE void  (*pcre_stack_free)(void *);

+PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);

+#else   /* VPCOMPAT */

+PCRE_DATA_SCOPE void *pcre_malloc(size_t);

+PCRE_DATA_SCOPE void  pcre_free(void *);

+PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t);

+PCRE_DATA_SCOPE void  pcre_stack_free(void *);

+PCRE_DATA_SCOPE int   pcre_callout(pcre_callout_block *);

+#endif  /* VPCOMPAT */

+

+/* Exported PCRE functions */

+

+PCRE_DATA_SCOPE pcre *pcre_compile(const char *, int, const char **, int *,

+                  const unsigned char *);

+PCRE_DATA_SCOPE pcre *pcre_compile2(const char *, int, int *, const char **,

+                  int *, const unsigned char *);

+PCRE_DATA_SCOPE int  pcre_config(int, void *);

+PCRE_DATA_SCOPE int  pcre_copy_named_substring(const pcre *, const char *,

+                  int *, int, const char *, char *, int);

+PCRE_DATA_SCOPE int  pcre_copy_substring(const char *, int *, int, int, char *,

+                  int);

+PCRE_DATA_SCOPE int  pcre_dfa_exec(const pcre *, const pcre_extra *,

+                  const char *, int, int, int, int *, int , int *, int);

+PCRE_DATA_SCOPE int  pcre_exec(const pcre *, const pcre_extra *, const char *,

+                   int, int, int, int *, int);

+PCRE_DATA_SCOPE void pcre_free_substring(const char *);

+PCRE_DATA_SCOPE void pcre_free_substring_list(const char **);

+PCRE_DATA_SCOPE int  pcre_fullinfo(const pcre *, const pcre_extra *, int,

+                  void *);

+PCRE_DATA_SCOPE int  pcre_get_named_substring(const pcre *, const char *,

+                  int *, int, const char *, const char **);

+PCRE_DATA_SCOPE int  pcre_get_stringnumber(const pcre *, const char *);

+PCRE_DATA_SCOPE int  pcre_get_substring(const char *, int *, int, int,

+                  const char **);

+PCRE_DATA_SCOPE int  pcre_get_substring_list(const char *, int *, int,

+                  const char ***);

+PCRE_DATA_SCOPE int  pcre_info(const pcre *, int *, int *);

+PCRE_DATA_SCOPE const unsigned char *pcre_maketables(void);

+PCRE_DATA_SCOPE int  pcre_refcount(pcre *, int);

+PCRE_DATA_SCOPE pcre_extra *pcre_study(const pcre *, int, const char **);

+PCRE_DATA_SCOPE const char *pcre_version(void);

+

+#ifdef __cplusplus

+}  /* extern "C" */

+#endif

+

+#endif /* End of pcre.h */

+

+/* Include the (copy of) the public ucp header, changing the external name into

+a private one. This does no harm, even if we aren't compiling UCP support. */

+

+#define ucp_findchar _pcre_ucp_findchar

+/*************************************************

+*     libucp - Unicode Property Table handler    *

+*************************************************/

+

+

+#ifndef _UCP_H

+#define _UCP_H

+

+/* These are the character categories that are returned by ucp_findchar */

+

+enum {

+  ucp_C,     /* Other */

+  ucp_L,     /* Letter */

+  ucp_M,     /* Mark */

+  ucp_N,     /* Number */

+  ucp_P,     /* Punctuation */

+  ucp_S,     /* Symbol */

+  ucp_Z      /* Separator */

+};

+

+/* These are the detailed character types that are returned by ucp_findchar */

+

+enum {

+  ucp_Cc,    /* Control */

+  ucp_Cf,    /* Format */

+  ucp_Cn,    /* Unassigned */

+  ucp_Co,    /* Private use */

+  ucp_Cs,    /* Surrogate */

+  ucp_Ll,    /* Lower case letter */

+  ucp_Lm,    /* Modifier letter */

+  ucp_Lo,    /* Other letter */

+  ucp_Lt,    /* Title case letter */

+  ucp_Lu,    /* Upper case letter */

+  ucp_Mc,    /* Spacing mark */

+  ucp_Me,    /* Enclosing mark */

+  ucp_Mn,    /* Non-spacing mark */

+  ucp_Nd,    /* Decimal number */

+  ucp_Nl,    /* Letter number */

+  ucp_No,    /* Other number */

+  ucp_Pc,    /* Connector punctuation */

+  ucp_Pd,    /* Dash punctuation */

+  ucp_Pe,    /* Close punctuation */

+  ucp_Pf,    /* Final punctuation */

+  ucp_Pi,    /* Initial punctuation */

+  ucp_Po,    /* Other punctuation */

+  ucp_Ps,    /* Open punctuation */

+  ucp_Sc,    /* Currency symbol */

+  ucp_Sk,    /* Modifier symbol */

+  ucp_Sm,    /* Mathematical symbol */

+  ucp_So,    /* Other symbol */

+  ucp_Zl,    /* Line separator */

+  ucp_Zp,    /* Paragraph separator */

+  ucp_Zs     /* Space separator */

+};

+

+extern int ucp_findchar(const int, int *, int *);

+

+#endif

+

+/* End of ucp.h */

+

+/* When compiling for use with the Virtual Pascal compiler, these functions

+need to have their names changed. PCRE must be compiled with the -DVPCOMPAT

+option on the command line. */

+

+#ifdef VPCOMPAT

+#define strncmp(s1,s2,m) _strncmp(s1,s2,m)

+#define memcpy(d,s,n)    _memcpy(d,s,n)

+#define memmove(d,s,n)   _memmove(d,s,n)

+#define memset(s,c,n)    _memset(s,c,n)

+#else  /* VPCOMPAT */

+

+/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),

+define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY

+is set. Otherwise, include an emulating function for those systems that have

+neither (there some non-Unix environments where this is the case). This assumes

+that all calls to memmove are moving strings upwards in store, which is the

+case in PCRE. */

+

+#if ! HAVE_MEMMOVE

+#undef  memmove        /* some systems may have a macro */

+#if HAVE_BCOPY

+#define memmove(a, b, c) bcopy(b, a, c)

+#else  /* HAVE_BCOPY */

+void *

+pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n)

+{

+int i;

+dest += n;

+src += n;

+for (i = 0; i < n; ++i) *(--dest) =  *(--src);

+}

+#define memmove(a, b, c) pcre_memmove(a, b, c)

+#endif   /* not HAVE_BCOPY */

+#endif   /* not HAVE_MEMMOVE */

+#endif   /* not VPCOMPAT */

+

+

+/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored

+in big-endian order) by default. These are used, for example, to link from the

+start of a subpattern to its alternatives and its end. The use of 2 bytes per

+offset limits the size of the compiled regex to around 64K, which is big enough

+for almost everybody. However, I received a request for an even bigger limit.

+For this reason, and also to make the code easier to maintain, the storing and

+loading of offsets from the byte string is now handled by the macros that are

+defined here.

+

+The macros are controlled by the value of LINK_SIZE. This defaults to 2 in

+the config.h file, but can be overridden by using -D on the command line. This

+is automated on Unix systems via the "configure" command. */

+

+#if LINK_SIZE == 2

+

+#define PUT(a,n,d)   \

+  (a[n] = (d) >> 8), \

+  (a[(n)+1] = (d) & 255)

+

+#define GET(a,n) \

+  (((a)[n] << 8) | (a)[(n)+1])

+

+#define MAX_PATTERN_SIZE (1 << 16)

+

+

+#elif LINK_SIZE == 3

+

+#define PUT(a,n,d)       \

+  (a[n] = (d) >> 16),    \

+  (a[(n)+1] = (d) >> 8), \

+  (a[(n)+2] = (d) & 255)

+

+#define GET(a,n) \

+  (((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])

+

+#define MAX_PATTERN_SIZE (1 << 24)

+

+

+#elif LINK_SIZE == 4

+

+#define PUT(a,n,d)        \

+  (a[n] = (d) >> 24),     \

+  (a[(n)+1] = (d) >> 16), \

+  (a[(n)+2] = (d) >> 8),  \

+  (a[(n)+3] = (d) & 255)

+

+#define GET(a,n) \

+  (((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])

+

+#define MAX_PATTERN_SIZE (1 << 30)   /* Keep it positive */

+

+

+#else

+#error LINK_SIZE must be either 2, 3, or 4

+#endif

+

+

+/* Convenience macro defined in terms of the others */

+

+#define PUTINC(a,n,d)   PUT(a,n,d), a += LINK_SIZE

+

+

+/* PCRE uses some other 2-byte quantities that do not change when the size of

+offsets changes. There are used for repeat counts and for other things such as

+capturing parenthesis numbers in back references. */

+

+#define PUT2(a,n,d)   \

+  a[n] = (d) >> 8; \

+  a[(n)+1] = (d) & 255

+

+#define GET2(a,n) \

+  (((a)[n] << 8) | (a)[(n)+1])

+

+#define PUT2INC(a,n,d)  PUT2(a,n,d), a += 2

+

+

+/* When UTF-8 encoding is being used, a character is no longer just a single

+byte. The macros for character handling generate simple sequences when used in

+byte-mode, and more complicated ones for UTF-8 characters. */

+

+#ifndef SUPPORT_UTF8

+#define GETCHAR(c, eptr) c = *eptr;

+#define GETCHARTEST(c, eptr) c = *eptr;

+#define GETCHARINC(c, eptr) c = *eptr++;

+#define GETCHARINCTEST(c, eptr) c = *eptr++;

+#define GETCHARLEN(c, eptr, len) c = *eptr;

+#define BACKCHAR(eptr)

+

+#else   /* SUPPORT_UTF8 */

+

+/* Get the next UTF-8 character, not advancing the pointer. This is called when

+we know we are in UTF-8 mode. */

+

+#define GETCHAR(c, eptr) \

+  c = *eptr; \

+  if ((c & 0xc0) == 0xc0) \

+    { \

+    int gcii; \

+    int gcaa = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */ \

+    int gcss = 6*gcaa; \

+    c = (c & _pcre_utf8_table3[gcaa]) << gcss; \

+    for (gcii = 1; gcii <= gcaa; gcii++) \

+      { \

+      gcss -= 6; \

+      c |= (eptr[gcii] & 0x3f) << gcss; \

+      } \

+    }

+

+/* Get the next UTF-8 character, testing for UTF-8 mode, and not advancing the

+pointer. */

+

+#define GETCHARTEST(c, eptr) \

+  c = *eptr; \

+  if (utf8 && (c & 0xc0) == 0xc0) \

+    { \

+    int gcii; \

+    int gcaa = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */ \

+    int gcss = 6*gcaa; \

+    c = (c & _pcre_utf8_table3[gcaa]) << gcss; \

+    for (gcii = 1; gcii <= gcaa; gcii++) \

+      { \

+      gcss -= 6; \

+      c |= (eptr[gcii] & 0x3f) << gcss; \

+      } \

+    }

+

+/* Get the next UTF-8 character, advancing the pointer. This is called when we

+know we are in UTF-8 mode. */

+

+#define GETCHARINC(c, eptr) \

+  c = *eptr++; \

+  if ((c & 0xc0) == 0xc0) \

+    { \

+    int gcaa = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */ \

+    int gcss = 6*gcaa; \

+    c = (c & _pcre_utf8_table3[gcaa]) << gcss; \

+    while (gcaa-- > 0) \

+      { \

+      gcss -= 6; \

+      c |= (*eptr++ & 0x3f) << gcss; \

+      } \

+    }

+

+/* Get the next character, testing for UTF-8 mode, and advancing the pointer */

+

+#define GETCHARINCTEST(c, eptr) \

+  c = *eptr++; \

+  if (utf8 && (c & 0xc0) == 0xc0) \

+    { \

+    int gcaa = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */ \

+    int gcss = 6*gcaa; \

+    c = (c & _pcre_utf8_table3[gcaa]) << gcss; \

+    while (gcaa-- > 0) \

+      { \

+      gcss -= 6; \

+      c |= (*eptr++ & 0x3f) << gcss; \

+      } \

+    }

+

+/* Get the next UTF-8 character, not advancing the pointer, incrementing length

+if there are extra bytes. This is called when we know we are in UTF-8 mode. */

+

+#define GETCHARLEN(c, eptr, len) \

+  c = *eptr; \

+  if ((c & 0xc0) == 0xc0) \

+    { \

+    int gcii; \

+    int gcaa = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */ \

+    int gcss = 6*gcaa; \

+    c = (c & _pcre_utf8_table3[gcaa]) << gcss; \

+    for (gcii = 1; gcii <= gcaa; gcii++) \

+      { \

+      gcss -= 6; \

+      c |= (eptr[gcii] & 0x3f) << gcss; \

+      } \

+    len += gcaa; \

+    }

+

+/* If the pointer is not at the start of a character, move it back until

+it is. Called only in UTF-8 mode. */

+

+#define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--;

+

+#endif

+

+

+/* In case there is no definition of offsetof() provided - though any proper

+Standard C system should have one. */

+

+#ifndef offsetof

+#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))

+#endif

+

+

+/* These are the public options that can change during matching. */

+

+#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)

+

+/* Private options flags start at the most significant end of the four bytes,

+but skip the top bit so we can use ints for convenience without getting tangled

+with negative values. The public options defined in pcre.h start at the least

+significant end. Make sure they don't overlap! */

+

+#define PCRE_FIRSTSET      0x40000000  /* first_byte is set */

+#define PCRE_REQCHSET      0x20000000  /* req_byte is set */

+#define PCRE_STARTLINE     0x10000000  /* start after \n for multiline */

+#define PCRE_ICHANGED      0x08000000  /* i option changes within regex */

+#define PCRE_NOPARTIAL     0x04000000  /* can't use partial with this regex */

+

+/* Options for the "extra" block produced by pcre_study(). */

+

+#define PCRE_STUDY_MAPPED   0x01     /* a map of starting chars exists */

+

+/* Masks for identifying the public options that are permitted at compile

+time, run time, or study time, respectively. */

+

+#define PUBLIC_OPTIONS \

+  (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \

+   PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \

+   PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE)

+

+#define PUBLIC_EXEC_OPTIONS \

+  (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \

+   PCRE_PARTIAL)

+

+#define PUBLIC_DFA_EXEC_OPTIONS \

+  (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \

+   PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART)

+

+#define PUBLIC_STUDY_OPTIONS 0   /* None defined */

+

+/* Magic number to provide a small check against being handed junk. Also used

+to detect whether a pattern was compiled on a host of different endianness. */

+

+#define MAGIC_NUMBER  0x50435245UL   /* 'PCRE' */

+

+/* Negative values for the firstchar and reqchar variables */

+

+#define REQ_UNSET (-2)

+#define REQ_NONE  (-1)

+

+/* The maximum remaining length of subject we are prepared to search for a

+req_byte match. */

+

+#define REQ_BYTE_MAX 1000

+

+/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a

+variable-length repeat, or a anything other than literal characters. */

+

+#define REQ_CASELESS 0x0100    /* indicates caselessness */

+#define REQ_VARY     0x0200    /* reqbyte followed non-literal item */

+

+/* Miscellaneous definitions */

+

+typedef int BOOL;

+

+#define FALSE   0

+#define TRUE    1

+

+/* Escape items that are just an encoding of a particular data value. Note that

+ESC_n is defined as yet another macro, which is set in config.h to either \n

+(the default) or \r (which some people want). */

+

+#ifndef ESC_e

+#define ESC_e 27

+#endif

+

+#ifndef ESC_f

+#define ESC_f '\f'

+#endif

+

+#ifndef ESC_n

+#define ESC_n NEWLINE

+#endif

+

+#ifndef ESC_r

+#define ESC_r '\r'

+#endif

+

+/* We can't officially use ESC_t because it is a POSIX reserved identifier

+(presumably because of all the others like size_t). */

+

+#ifndef ESC_tee

+#define ESC_tee '\t'

+#endif

+

+/* These are escaped items that aren't just an encoding of a particular data

+value such as \n. They must have non-zero values, as check_escape() returns

+their negation. Also, they must appear in the same order as in the opcode

+definitions below, up to ESC_z. There's a dummy for OP_ANY because it

+corresponds to "." rather than an escape sequence. The final one must be

+ESC_REF as subsequent values are used for \1, \2, \3, etc. There is are two

+tests in the code for an escape greater than ESC_b and less than ESC_Z to

+detect the types that may be repeated. These are the types that consume

+characters. If any new escapes are put in between that don't consume a

+character, that code will have to change. */

+

+enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W,

+       ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E,

+       ESC_Q, ESC_REF };

+

+/* Flag bits and data types for the extended class (OP_XCLASS) for classes that

+contain UTF-8 characters with values greater than 255. */

+

+#define XCL_NOT    0x01    /* Flag: this is a negative class */

+#define XCL_MAP    0x02    /* Flag: a 32-byte map is present */

+

+#define XCL_END       0    /* Marks end of individual items */

+#define XCL_SINGLE    1    /* Single item (one multibyte char) follows */

+#define XCL_RANGE     2    /* A range (two multibyte chars) follows */

+#define XCL_PROP      3    /* Unicode property (one property code) follows */

+#define XCL_NOTPROP   4    /* Unicode inverted property (ditto) */

+

+

+/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets

+that extract substrings. Starting from 1 (i.e. after OP_END), the values up to

+OP_EOD must correspond in order to the list of escapes immediately above.

+Note that whenever this list is updated, the two macro definitions that follow

+must also be updated to match. */

+

+enum {

+  OP_END,            /* 0 End of pattern */

+

+  /* Values corresponding to backslashed metacharacters */

+

+  OP_SOD,            /* 1 Start of data: \A */

+  OP_SOM,            /* 2 Start of match (subject + offset): \G */

+  OP_NOT_WORD_BOUNDARY,  /*  3 \B */

+  OP_WORD_BOUNDARY,      /*  4 \b */

+  OP_NOT_DIGIT,          /*  5 \D */

+  OP_DIGIT,              /*  6 \d */

+  OP_NOT_WHITESPACE,     /*  7 \S */

+  OP_WHITESPACE,         /*  8 \s */

+  OP_NOT_WORDCHAR,       /*  9 \W */

+  OP_WORDCHAR,           /* 10 \w */

+  OP_ANY,            /* 11 Match any character */

+  OP_ANYBYTE,        /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */

+  OP_NOTPROP,        /* 13 \P (not Unicode property) */

+  OP_PROP,           /* 14 \p (Unicode property) */

+  OP_EXTUNI,         /* 15 \X (extended Unicode sequence */

+  OP_EODN,           /* 16 End of data or \n at end of data: \Z. */

+  OP_EOD,            /* 17 End of data: \z */

+

+  OP_OPT,            /* 18 Set runtime options */

+  OP_CIRC,           /* 19 Start of line - varies with multiline switch */

+  OP_DOLL,           /* 20 End of line - varies with multiline switch */

+  OP_CHAR,           /* 21 Match one character, casefully */

+  OP_CHARNC,         /* 22 Match one character, caselessly */

+  OP_NOT,            /* 23 Match anything but the following char */

+

+  OP_STAR,           /* 24 The maximizing and minimizing versions of */

+  OP_MINSTAR,        /* 25 all these opcodes must come in pairs, with */

+  OP_PLUS,           /* 26 the minimizing one second. */

+  OP_MINPLUS,        /* 27 This first set applies to single characters */

+  OP_QUERY,          /* 28 */

+  OP_MINQUERY,       /* 29 */

+  OP_UPTO,           /* 30 From 0 to n matches */

+  OP_MINUPTO,        /* 31 */

+  OP_EXACT,          /* 32 Exactly n matches */

+

+  OP_NOTSTAR,        /* 33 The maximizing and minimizing versions of */

+  OP_NOTMINSTAR,     /* 34 all these opcodes must come in pairs, with */

+  OP_NOTPLUS,        /* 35 the minimizing one second. */

+  OP_NOTMINPLUS,     /* 36 This set applies to "not" single characters */

+  OP_NOTQUERY,       /* 37 */

+  OP_NOTMINQUERY,    /* 38 */

+  OP_NOTUPTO,        /* 39 From 0 to n matches */

+  OP_NOTMINUPTO,     /* 40 */

+  OP_NOTEXACT,       /* 41 Exactly n matches */

+

+  OP_TYPESTAR,       /* 42 The maximizing and minimizing versions of */

+  OP_TYPEMINSTAR,    /* 43 all these opcodes must come in pairs, with */

+  OP_TYPEPLUS,       /* 44 the minimizing one second. These codes must */

+  OP_TYPEMINPLUS,    /* 45 be in exactly the same order as those above. */

+  OP_TYPEQUERY,      /* 46 This set applies to character types such as \d */

+  OP_TYPEMINQUERY,   /* 47 */

+  OP_TYPEUPTO,       /* 48 From 0 to n matches */

+  OP_TYPEMINUPTO,    /* 49 */

+  OP_TYPEEXACT,      /* 50 Exactly n matches */

+

+  OP_CRSTAR,         /* 51 The maximizing and minimizing versions of */

+  OP_CRMINSTAR,      /* 52 all these opcodes must come in pairs, with */

+  OP_CRPLUS,         /* 53 the minimizing one second. These codes must */

+  OP_CRMINPLUS,      /* 54 be in exactly the same order as those above. */

+  OP_CRQUERY,        /* 55 These are for character classes and back refs */

+  OP_CRMINQUERY,     /* 56 */

+  OP_CRRANGE,        /* 57 These are different to the three sets above. */

+  OP_CRMINRANGE,     /* 58 */

+

+  OP_CLASS,          /* 59 Match a character class, chars < 256 only */

+  OP_NCLASS,         /* 60 Same, but the bitmap was created from a negative

+                           class - the difference is relevant only when a UTF-8

+                           character > 255 is encountered. */

+

+  OP_XCLASS,         /* 61 Extended class for handling UTF-8 chars within the

+                           class. This does both positive and negative. */

+

+  OP_REF,            /* 62 Match a back reference */

+  OP_RECURSE,        /* 63 Match a numbered subpattern (possibly recursive) */

+  OP_CALLOUT,        /* 64 Call out to external function if provided */

+

+  OP_ALT,            /* 65 Start of alternation */

+  OP_KET,            /* 66 End of group that doesn't have an unbounded repeat */

+  OP_KETRMAX,        /* 67 These two must remain together and in this */

+  OP_KETRMIN,        /* 68 order. They are for groups the repeat for ever. */

+

+  /* The assertions must come before ONCE and COND */

+

+  OP_ASSERT,         /* 69 Positive lookahead */

+  OP_ASSERT_NOT,     /* 70 Negative lookahead */

+  OP_ASSERTBACK,     /* 71 Positive lookbehind */

+  OP_ASSERTBACK_NOT, /* 72 Negative lookbehind */

+  OP_REVERSE,        /* 73 Move pointer back - used in lookbehind assertions */

+

+  /* ONCE and COND must come after the assertions, with ONCE first, as there's

+  a test for >= ONCE for a subpattern that isn't an assertion. */

+

+  OP_ONCE,           /* 74 Once matched, don't back up into the subpattern */

+  OP_COND,           /* 75 Conditional group */

+  OP_CREF,           /* 76 Used to hold an extraction string number (cond ref) */

+

+  OP_BRAZERO,        /* 77 These two must remain together and in this */

+  OP_BRAMINZERO,     /* 78 order. */

+

+  OP_BRANUMBER,      /* 79 Used for extracting brackets whose number is greater

+                           than can fit into an opcode. */

+

+  OP_BRA             /* 80 This and greater values are used for brackets that

+                           extract substrings up to EXTRACT_BASIC_MAX. After

+                           that, use is made of OP_BRANUMBER. */

+};

+

+/* WARNING WARNING WARNING: There is an implicit assumption in pcre.c and

+study.c that all opcodes are less than 128 in value. This makes handling UTF-8

+character sequences easier. */

+

+/* The highest extraction number before we have to start using additional

+bytes. (Originally PCRE didn't have support for extraction counts highter than

+this number.) The value is limited by the number of opcodes left after OP_BRA,

+i.e. 255 - OP_BRA. We actually set it a bit lower to leave room for additional

+opcodes. */

+

+#define EXTRACT_BASIC_MAX  100

+

+

+/* This macro defines textual names for all the opcodes. These are used only

+for debugging. The macro is referenced only in pcre_printint.c. */

+

+#define OP_NAME_LIST \

+  "End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d",                \

+  "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte",                   \

+  "notprop", "prop", "extuni",                                    \

+  "\\Z", "\\z",                                                   \

+  "Opt", "^", "$", "char", "charnc", "not",                       \

+  "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \

+  "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \

+  "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \

+  "*", "*?", "+", "+?", "?", "??", "{", "{",                      \

+  "class", "nclass", "xclass", "Ref", "Recurse", "Callout",       \

+  "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \

+  "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\

+  "Brazero", "Braminzero", "Branumber", "Bra"

+

+

+/* This macro defines the length of fixed length operations in the compiled

+regex. The lengths are used when searching for specific things, and also in the

+debugging printing of a compiled regex. We use a macro so that it can be

+defined close to the definitions of the opcodes themselves.

+

+As things have been extended, some of these are no longer fixed lenths, but are

+minima instead. For example, the length of a single-character repeat may vary

+in UTF-8 mode. The code that uses this table must know about such things. */

+

+#define OP_LENGTHS \

+  1,                             /* End                                    */ \

+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \

+  1, 1,                          /* Any, Anybyte                           */ \

+  2, 2, 1,                       /* NOTPROP, PROP, EXTUNI                  */ \

+  1, 1, 2, 1, 1,                 /* \Z, \z, Opt, ^, $                      */ \

+  2,                             /* Char  - the minimum length             */ \

+  2,                             /* Charnc  - the minimum length           */ \

+  2,                             /* not                                    */ \

+  /* Positive single-char repeats                            ** These are  */ \

+  2, 2, 2, 2, 2, 2,              /* *, *?, +, +?, ?, ??      ** minima in  */ \

+  4, 4, 4,                       /* upto, minupto, exact     ** UTF-8 mode */ \

+  /* Negative single-char repeats - only for chars < 256                   */ \

+  2, 2, 2, 2, 2, 2,              /* NOT *, *?, +, +?, ?, ??                */ \

+  4, 4, 4,                       /* NOT upto, minupto, exact               */ \

+  /* Positive type repeats                                                 */ \

+  2, 2, 2, 2, 2, 2,              /* Type *, *?, +, +?, ?, ??               */ \

+  4, 4, 4,                       /* Type upto, minupto, exact              */ \

+  /* Character class & ref repeats                                         */ \

+  1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */ \

+  5, 5,                          /* CRRANGE, CRMINRANGE                    */ \

+ 33,                             /* CLASS                                  */ \

+ 33,                             /* NCLASS                                 */ \

+  0,                             /* XCLASS - variable length               */ \

+  3,                             /* REF                                    */ \

+  1+LINK_SIZE,                   /* RECURSE                                */ \

+  2+2*LINK_SIZE,                 /* CALLOUT                                */ \

+  1+LINK_SIZE,                   /* Alt                                    */ \

+  1+LINK_SIZE,                   /* Ket                                    */ \

+  1+LINK_SIZE,                   /* KetRmax                                */ \

+  1+LINK_SIZE,                   /* KetRmin                                */ \

+  1+LINK_SIZE,                   /* Assert                                 */ \

+  1+LINK_SIZE,                   /* Assert not                             */ \

+  1+LINK_SIZE,                   /* Assert behind                          */ \

+  1+LINK_SIZE,                   /* Assert behind not                      */ \

+  1+LINK_SIZE,                   /* Reverse                                */ \

+  1+LINK_SIZE,                   /* Once                                   */ \

+  1+LINK_SIZE,                   /* COND                                   */ \

+  3,                             /* CREF                                   */ \

+  1, 1,                          /* BRAZERO, BRAMINZERO                    */ \

+  3,                             /* BRANUMBER                              */ \

+  1+LINK_SIZE                    /* BRA                                    */ \

+

+

+/* A magic value for OP_CREF to indicate the "in recursion" condition. */

+

+#define CREF_RECURSE  0xffff

+

+/* Error code numbers. They are given names so that they can more easily be

+tracked. */

+

+enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,  ERR5,  ERR6,  ERR7,  ERR8,  ERR9,

+       ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19,

+       ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,

+       ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,

+       ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47 };

+

+/* The real format of the start of the pcre block; the index of names and the

+code vector run on as long as necessary after the end. We store an explicit

+offset to the name table so that if a regex is compiled on one host, saved, and

+then run on another where the size of pointers is different, all might still

+be well. For the case of compiled-on-4 and run-on-8, we include an extra

+pointer that is always NULL. For future-proofing, a few dummy fields were

+originally included - even though you can never get this planning right - but

+there is only one left now.

+

+NOTE NOTE NOTE:

+Because people can now save and re-use compiled patterns, any additions to this

+structure should be made at the end, and something earlier (e.g. a new

+flag in the options or one of the dummy fields) should indicate that the new

+fields are present. Currently PCRE always sets the dummy fields to zero.

+NOTE NOTE NOTE:

+*/

+

+typedef struct real_pcre {

+  pcre_uint32 magic_number;

+  pcre_uint32 size;               /* Total that was malloced */

+  pcre_uint32 options;

+  pcre_uint32 dummy1;             /* For future use, maybe */

+

+  pcre_uint16 top_bracket;

+  pcre_uint16 top_backref;

+  pcre_uint16 first_byte;

+  pcre_uint16 req_byte;

+  pcre_uint16 name_table_offset;  /* Offset to name table that follows */

+  pcre_uint16 name_entry_size;    /* Size of any name items */

+  pcre_uint16 name_count;         /* Number of name items */

+  pcre_uint16 ref_count;          /* Reference count */

+

+  const unsigned char *tables;    /* Pointer to tables or NULL for std */

+  const unsigned char *nullpad;   /* NULL padding */

+} real_pcre;

+

+/* The format of the block used to store data from pcre_study(). The same

+remark (see NOTE above) about extending this structure applies. */

+

+typedef struct pcre_study_data {

+  pcre_uint32 size;               /* Total that was malloced */

+  pcre_uint32 options;

+  uschar start_bits[32];

+} pcre_study_data;

+

+/* Structure for passing "static" information around between the functions

+doing the compiling, so that they are thread-safe. */

+

+typedef struct compile_data {

+  const uschar *lcc;            /* Points to lower casing table */

+  const uschar *fcc;            /* Points to case-flipping table */

+  const uschar *cbits;          /* Points to character type table */

+  const uschar *ctypes;         /* Points to table of type maps */

+  const uschar *start_code;     /* The start of the compiled code */

+  const uschar *start_pattern;  /* The start of the pattern */

+  uschar *name_table;           /* The name/number table */

+  int  names_found;             /* Number of entries so far */

+  int  name_entry_size;         /* Size of each entry */

+  int  top_backref;             /* Maximum back reference */

+  unsigned int backref_map;     /* Bitmap of low back refs */

+  int  req_varyopt;             /* "After variable item" flag for reqbyte */

+  BOOL nopartial;               /* Set TRUE if partial won't work */

+} compile_data;

+

+/* Structure for maintaining a chain of pointers to the currently incomplete

+branches, for testing for left recursion. */

+

+typedef struct branch_chain {

+  struct branch_chain *outer;

+  uschar *current;

+} branch_chain;

+

+/* Structure for items in a linked list that represents an explicit recursive

+call within the pattern. */

+

+typedef struct recursion_info {

+  struct recursion_info *prevrec; /* Previous recursion record (or NULL) */

+  int group_num;                /* Number of group that was called */

+  const uschar *after_call;     /* "Return value": points after the call in the expr */

+  const uschar *save_start;     /* Old value of md->start_match */

+  int *offset_save;             /* Pointer to start of saved offsets */

+  int saved_max;                /* Number of saved offsets */

+} recursion_info;

+

+/* When compiling in a mode that doesn't use recursive calls to match(),

+a structure is used to remember local variables on the heap. It is defined in

+pcre.c, close to the match() function, so that it is easy to keep it in step

+with any changes of local variable. However, the pointer to the current frame

+must be saved in some "static" place over a longjmp(). We declare the

+structure here so that we can put a pointer in the match_data structure.

+NOTE: This isn't used for a "normal" compilation of pcre. */

+

+struct heapframe;

+

+/* Structure for passing "static" information around between the functions

+doing traditional NFA matching, so that they are thread-safe. */

+

+typedef struct match_data {

+  unsigned long int match_call_count; /* As it says */

+  unsigned long int match_limit;/* As it says */

+  int   *offset_vector;         /* Offset vector */

+  int    offset_end;            /* One past the end */

+  int    offset_max;            /* The maximum usable for return data */

+  const uschar *lcc;            /* Points to lower casing table */

+  const uschar *ctypes;         /* Points to table of type maps */

+  BOOL   offset_overflow;       /* Set if too many extractions */

+  BOOL   notbol;                /* NOTBOL flag */

+  BOOL   noteol;                /* NOTEOL flag */

+  BOOL   utf8;                  /* UTF8 flag */

+  BOOL   endonly;               /* Dollar not before final \n */

+  BOOL   notempty;              /* Empty string match not wanted */

+  BOOL   partial;               /* PARTIAL flag */

+  BOOL   hitend;                /* Hit the end of the subject at some point */

+  const uschar *start_code;     /* For use when recursing */

+  const uschar *start_subject;  /* Start of the subject string */

+  const uschar *end_subject;    /* End of the subject string */

+  const uschar *start_match;    /* Start of this match attempt */

+  const uschar *end_match_ptr;  /* Subject position at end match */

+  int    end_offset_top;        /* Highwater mark at end of match */

+  int    capture_last;          /* Most recent capture number */

+  int    start_offset;          /* The start offset value */

+  recursion_info *recursive;    /* Linked list of recursion data */

+  void  *callout_data;          /* To pass back to callouts */

+  struct heapframe *thisframe;  /* Used only when compiling for no recursion */

+} match_data;

+

+/* A similar structure is used for the same purpose by the DFA matching

+functions. */

+

+typedef struct dfa_match_data {

+  const uschar *start_code;     /* Start of the compiled pattern */

+  const uschar *start_subject;  /* Start of the subject string */

+  const uschar *end_subject;    /* End of subject string */

+  const uschar *tables;         /* Character tables */

+  int   moptions;               /* Match options */

+  int   poptions;               /* Pattern options */

+  void  *callout_data;          /* To pass back to callouts */

+} dfa_match_data;

+

+/* Bit definitions for entries in the pcre_ctypes table. */

+

+#define ctype_space   0x01

+#define ctype_letter  0x02

+#define ctype_digit   0x04

+#define ctype_xdigit  0x08

+#define ctype_word    0x10   /* alphameric or '_' */

+#define ctype_meta    0x80   /* regexp meta char or zero (end pattern) */

+

+/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set

+of bits for a class map. Some classes are built by combining these tables. */

+

+#define cbit_space     0      /* [:space:] or \s */

+#define cbit_xdigit   32      /* [:xdigit:] */

+#define cbit_digit    64      /* [:digit:] or \d */

+#define cbit_upper    96      /* [:upper:] */

+#define cbit_lower   128      /* [:lower:] */

+#define cbit_word    160      /* [:word:] or \w */

+#define cbit_graph   192      /* [:graph:] */

+#define cbit_print   224      /* [:print:] */

+#define cbit_punct   256      /* [:punct:] */

+#define cbit_cntrl   288      /* [:cntrl:] */

+#define cbit_length  320      /* Length of the cbits table */

+

+/* Offsets of the various tables from the base tables pointer, and

+total length. */

+

+#define lcc_offset      0

+#define fcc_offset    256

+#define cbits_offset  512

+#define ctypes_offset (cbits_offset + cbit_length)

+#define tables_length (ctypes_offset + 256)

+

+/* Layout of the UCP type table that translates property names into codes for

+ucp_findchar(). */

+

+typedef struct {

+  const char *name;

+  int value;

+} ucp_type_table;

+

+

+/* Internal shared data tables. These are tables that are used by more than one

+of the exported public functions. They have to be "external" in the C sense,

+but are not part of the PCRE public API. The data for these tables is in the

+pcre_tables.c module. */

+

+extern const int    _pcre_utf8_table1[];

+extern const int    _pcre_utf8_table2[];

+extern const int    _pcre_utf8_table3[];

+extern const uschar _pcre_utf8_table4[];

+

+extern const int    _pcre_utf8_table1_size;

+

+extern const ucp_type_table _pcre_utt[];

+extern const int _pcre_utt_size;

+

+extern const uschar _pcre_default_tables[];

+

+extern const uschar _pcre_OP_lengths[];

+

+

+/* Internal shared functions. These are functions that are used by more than

+one of the exported public functions. They have to be "external" in the C

+sense, but are not part of the PCRE public API. */

+

+extern int         _pcre_ord2utf8(int, uschar *);

+extern void        _pcre_printint(pcre *, FILE *);

+extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *,

+                     const pcre_study_data *, pcre_study_data *);

+extern int         _pcre_ucp_findchar(const int, int *, int *);

+extern int         _pcre_valid_utf8(const uschar *, int);

+extern BOOL        _pcre_xclass(int, const uschar *);

+

+/* End of pcre_internal.h */

+

+

+/*************************************************

+*      Code parameters and static tables         *

+*************************************************/

+

+/* Maximum number of items on the nested bracket stacks at compile time. This

+applies to the nesting of all kinds of parentheses. It does not limit

+un-nested, non-capturing parentheses. This number can be made bigger if

+necessary - it is used to dimension one int and one unsigned char vector at

+compile time. */

+

+#define BRASTACK_SIZE 200

+

+

+/* Table for handling escaped characters in the range '0'-'z'. Positive returns

+are simple data values; negative values are for special things like \d and so

+on. Zero means further processing is needed (for things like \x), or the escape

+is invalid. */

+

+#if !EBCDIC   /* This is the "normal" table for ASCII systems */

+static const short int escapes[] = {

+     0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */

+     0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */

+   '@', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E,      0, -ESC_G,   /* @ - G */

+     0,      0,      0,      0,      0,      0,      0,      0,   /* H - O */

+-ESC_P, -ESC_Q,      0, -ESC_S,      0,      0,      0, -ESC_W,   /* P - W */

+-ESC_X,      0, -ESC_Z,    '[',   '\\',    ']',    '^',    '_',   /* X - _ */

+   '`',      7, -ESC_b,      0, -ESC_d,  ESC_e,  ESC_f,      0,   /* ` - g */

+     0,      0,      0,      0,      0,      0,  ESC_n,      0,   /* h - o */

+-ESC_p,      0,  ESC_r, -ESC_s,  ESC_tee,    0,      0, -ESC_w,   /* p - w */

+     0,      0, -ESC_z                                            /* x - z */

+};

+

+#else         /* This is the "abnormal" table for EBCDIC systems */

+static const short int escapes[] = {

+/*  48 */     0,     0,      0,     '.',    '<',   '(',    '+',    '|',

+/*  50 */   '&',     0,      0,       0,      0,     0,      0,      0,

+/*  58 */     0,     0,    '!',     '$',    '*',   ')',    ';',    '~',

+/*  60 */   '-',   '/',      0,       0,      0,     0,      0,      0,

+/*  68 */     0,     0,    '|',     ',',    '%',   '_',    '>',    '?',

+/*  70 */     0,     0,      0,       0,      0,     0,      0,      0,

+/*  78 */     0,   '`',    ':',     '#',    '@',  '\'',    '=',    '"',

+/*  80 */     0,     7, -ESC_b,       0, -ESC_d, ESC_e,  ESC_f,      0,

+/*  88 */     0,     0,      0,     '{',      0,     0,      0,      0,

+/*  90 */     0,     0,      0,     'l',      0, ESC_n,      0, -ESC_p,

+/*  98 */     0, ESC_r,      0,     '}',      0,     0,      0,      0,

+/*  A0 */     0,   '~', -ESC_s, ESC_tee,      0,     0, -ESC_w,      0,

+/*  A8 */     0,-ESC_z,      0,       0,      0,   '[',      0,      0,

+/*  B0 */     0,     0,      0,       0,      0,     0,      0,      0,

+/*  B8 */     0,     0,      0,       0,      0,   ']',    '=',    '-',

+/*  C0 */   '{',-ESC_A, -ESC_B,  -ESC_C, -ESC_D,-ESC_E,      0, -ESC_G,

+/*  C8 */     0,     0,      0,       0,      0,     0,      0,      0,

+/*  D0 */   '}',     0,      0,       0,      0,     0,      0, -ESC_P,

+/*  D8 */-ESC_Q,     0,      0,       0,      0,     0,      0,      0,

+/*  E0 */  '\\',     0, -ESC_S,       0,      0,     0, -ESC_W, -ESC_X,

+/*  E8 */     0,-ESC_Z,      0,       0,      0,     0,      0,      0,

+/*  F0 */     0,     0,      0,       0,      0,     0,      0,      0,

+/*  F8 */     0,     0,      0,       0,      0,     0,      0,      0

+};

+#endif

+

+

+/* Tables of names of POSIX character classes and their lengths. The list is

+terminated by a zero length entry. The first three must be alpha, upper, lower,

+as this is assumed for handling case independence. */

+

+static const char *const posix_names[] = {

+  "alpha", "lower", "upper",

+  "alnum", "ascii", "blank", "cntrl", "digit", "graph",

+  "print", "punct", "space", "word",  "xdigit" };

+

+static const uschar posix_name_lengths[] = {

+  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 };

+

+/* Table of class bit maps for each POSIX class; up to three may be combined

+to form the class. The table for [:blank:] is dynamically modified to remove

+the vertical space characters. */

+

+static const int posix_class_maps[] = {

+  cbit_lower, cbit_upper, -1,             /* alpha */

+  cbit_lower, -1,         -1,             /* lower */

+  cbit_upper, -1,         -1,             /* upper */

+  cbit_digit, cbit_lower, cbit_upper,     /* alnum */

+  cbit_print, cbit_cntrl, -1,             /* ascii */

+  cbit_space, -1,         -1,             /* blank - a GNU extension */

+  cbit_cntrl, -1,         -1,             /* cntrl */

+  cbit_digit, -1,         -1,             /* digit */

+  cbit_graph, -1,         -1,             /* graph */

+  cbit_print, -1,         -1,             /* print */

+  cbit_punct, -1,         -1,             /* punct */

+  cbit_space, -1,         -1,             /* space */

+  cbit_word,  -1,         -1,             /* word - a Perl extension */

+  cbit_xdigit,-1,         -1              /* xdigit */

+};

+

+

+/* The texts of compile-time error messages. These are "char *" because they

+are passed to the outside world. */

+

+static const char *error_texts[] = {

+  "no error",

+  "\\ at end of pattern",

+  "\\c at end of pattern",

+  "unrecognized character follows \\",

+  "numbers out of order in {} quantifier",

+  /* 5 */

+  "number too big in {} quantifier",

+  "missing terminating ] for character class",

+  "invalid escape sequence in character class",

+  "range out of order in character class",

+  "nothing to repeat",

+  /* 10 */

+  "operand of unlimited repeat could match the empty string",

+  "internal error: unexpected repeat",

+  "unrecognized character after (?",

+  "POSIX named classes are supported only within a class",

+  "missing )",

+  /* 15 */

+  "reference to non-existent subpattern",

+  "erroffset passed as NULL",

+  "unknown option bit(s) set",

+  "missing ) after comment",

+  "parentheses nested too deeply",

+  /* 20 */

+  "regular expression too large",

+  "failed to get memory",

+  "unmatched parentheses",

+  "internal error: code overflow",

+  "unrecognized character after (?<",

+  /* 25 */

+  "lookbehind assertion is not fixed length",

+  "malformed number after (?(",

+  "conditional group contains more than two branches",

+  "assertion expected after (?(",

+  "(?R or (?digits must be followed by )",

+  /* 30 */

+  "unknown POSIX class name",

+  "POSIX collating elements are not supported",

+  "this version of PCRE is not compiled with PCRE_UTF8 support",

+  "spare error",

+  "character value in \\x{...} sequence is too large",

+  /* 35 */

+  "invalid condition (?(0)",

+  "\\C not allowed in lookbehind assertion",

+  "PCRE does not support \\L, \\l, \\N, \\U, or \\u",

+  "number after (?C is > 255",

+  "closing ) for (?C expected",

+  /* 40 */

+  "recursive call could loop indefinitely",

+  "unrecognized character after (?P",

+  "syntax error after (?P",

+  "two named groups have the same name",

+  "invalid UTF-8 string",

+  /* 45 */

+  "support for \\P, \\p, and \\X has not been compiled",

+  "malformed \\P or \\p sequence",

+  "unknown property name after \\P or \\p"

+};

+

+

+/* Table to identify digits and hex digits. This is used when compiling

+patterns. Note that the tables in chartables are dependent on the locale, and

+may mark arbitrary characters as digits - but the PCRE compiling code expects

+to handle only 0-9, a-z, and A-Z as digits when compiling. That is why we have

+a private table here. It costs 256 bytes, but it is a lot faster than doing

+character value tests (at least in some simple cases I timed), and in some

+applications one wants PCRE to compile efficiently as well as match

+efficiently.

+

+For convenience, we use the same bit definitions as in chartables:

+

+  0x04   decimal digit

+  0x08   hexadecimal digit

+

+Then we can use ctype_digit and ctype_xdigit in the code. */

+

+#if !EBCDIC    /* This is the "normal" case, for ASCII systems */

+static const unsigned char digitab[] =

+  {

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   0-  7 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   8- 15 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  16- 23 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*    - '  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  ( - /  */

+  0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /*  0 - 7  */

+  0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /*  8 - ?  */

+  0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /*  @ - G  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  H - O  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  P - W  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  X - _  */

+  0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /*  ` - g  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  h - o  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  p - w  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  x -127 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */

+

+#else          /* This is the "abnormal" case, for EBCDIC systems */

+static const unsigned char digitab[] =

+  {

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   0-  7  0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*   8- 15    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  16- 23 10 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  32- 39 20 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  40- 47    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  48- 55 30 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  56- 63    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*    - 71 40 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  72- |     */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  & - 87 50 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  88- ¬     */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  - -103 60 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ?     */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- "     */

+  0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /* 128- g  80 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  h -143    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144- p  90 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  q -159    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160- x  A0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  y -175    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  ^ -183 B0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191    */

+  0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00, /*  { - G  C0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  H -207    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  } - P  D0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  Q -223    */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  \ - X  E0 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  Y -239    */

+  0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c, /*  0 - 7  F0 */

+  0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00};/*  8 -255    */

+

+static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */

+  0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /*   0-  7 */

+  0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00, /*   8- 15 */

+  0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /*  16- 23 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  24- 31 */

+  0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /*  32- 39 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  40- 47 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  48- 55 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  56- 63 */

+  0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*    - 71 */

+  0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /*  72- |  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  & - 87 */

+  0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /*  88- ¬  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  - -103 */

+  0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ?  */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */

+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 120- "  */

+  0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* 128- g  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  h -143 */

+  0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* 144- p  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  q -159 */

+  0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /* 160- x  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  y -175 */

+  0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*  ^ -183 */

+  0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, /* 184-191 */

+  0x80,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /*  { - G  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  H -207 */

+  0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /*  } - P  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  Q -223 */

+  0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12, /*  \ - X  */

+  0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /*  Y -239 */

+  0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /*  0 - 7  */

+  0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00};/*  8 -255 */

+#endif

+

+

+/* Definition to allow mutual recursion */

+

+static BOOL

+  compile_regex(int, int, int *, uschar **, const uschar **, int *, BOOL, int,

+    int *, int *, branch_chain *, compile_data *);

+

+

+

+/*************************************************

+*            Handle escapes                      *

+*************************************************/

+

+/* This function is called when a \ has been encountered. It either returns a

+positive value for a simple escape such as \n, or a negative value which

+encodes one of the more complicated things such as \d. When UTF-8 is enabled,

+a positive value greater than 255 may be returned. On entry, ptr is pointing at

+the \. On exit, it is on the final character of the escape sequence.

+

+Arguments:

+  ptrptr         points to the pattern position pointer

+  errorcodeptr   points to the errorcode variable

+  bracount       number of previous extracting brackets

+  options        the options bits

+  isclass        TRUE if inside a character class

+

+Returns:         zero or positive => a data character

+                 negative => a special escape sequence

+                 on error, errorptr is set

+*/

+

+static int

+check_escape(const uschar **ptrptr, int *errorcodeptr, int bracount,

+  int options, BOOL isclass)

+{

+const uschar *ptr = *ptrptr;

+int c, i;

+

+/* If backslash is at the end of the pattern, it's an error. */

+

+c = *(++ptr);

+if (c == 0) *errorcodeptr = ERR1;

+

+/* Non-alphamerics are literals. For digits or letters, do an initial lookup in

+a table. A non-zero result is something that can be returned immediately.

+Otherwise further processing may be required. */

+

+#if !EBCDIC    /* ASCII coding */

+else if (c < '0' || c > 'z') {}                           /* Not alphameric */

+else if ((i = escapes[c - '0']) != 0) c = i;

+

+#else          /* EBCDIC coding */

+else if (c < 'a' || (ebcdic_chartab[c] & 0x0E) == 0) {}   /* Not alphameric */

+else if ((i = escapes[c - 0x48]) != 0)  c = i;

+#endif

+

+/* Escapes that need further processing, or are illegal. */

+

+else

+  {

+  const uschar *oldptr;

+  switch (c)

+    {

+    /* A number of Perl escapes are not handled by PCRE. We give an explicit

+    error. */

+

+    case 'l':

+    case 'L':

+    case 'N':

+    case 'u':

+    case 'U':

+    *errorcodeptr = ERR37;

+    break;

+

+    /* The handling of escape sequences consisting of a string of digits

+    starting with one that is not zero is not straightforward. By experiment,

+    the way Perl works seems to be as follows:

+

+    Outside a character class, the digits are read as a decimal number. If the

+    number is less than 10, or if there are that many previous extracting

+    left brackets, then it is a back reference. Otherwise, up to three octal

+    digits are read to form an escaped byte. Thus \123 is likely to be octal

+    123 (cf \0123, which is octal 012 followed by the literal 3). If the octal

+    value is greater than 377, the least significant 8 bits are taken. Inside a

+    character class, \ followed by a digit is always an octal number. */

+

+    case '1': case '2': case '3': case '4': case '5':

+    case '6': case '7': case '8': case '9':

+

+    if (!isclass)

+      {

+      oldptr = ptr;

+      c -= '0';

+      while ((digitab[ptr[1]] & ctype_digit) != 0)

+        c = c * 10 + *(++ptr) - '0';

+      if (c < 10 || c <= bracount)

+        {

+        c = -(ESC_REF + c);

+        break;

+        }

+      ptr = oldptr;      /* Put the pointer back and fall through */

+      }

+

+    /* Handle an octal number following \. If the first digit is 8 or 9, Perl

+    generates a binary zero byte and treats the digit as a following literal.

+    Thus we have to pull back the pointer by one. */

+

+    if ((c = *ptr) >= '8')

+      {

+      ptr--;

+      c = 0;

+      break;

+      }

+

+    /* \0 always starts an octal number, but we may drop through to here with a

+    larger first octal digit. */

+

+    case '0':

+    c -= '0';

+    while(i++ < 2 && ptr[1] >= '0' && ptr[1] <= '7')

+        c = c * 8 + *(++ptr) - '0';

+    c &= 255;     /* Take least significant 8 bits */

+    break;

+

+    /* \x is complicated when UTF-8 is enabled. \x{ddd} is a character number

+    which can be greater than 0xff, but only if the ddd are hex digits. */

+

+    case 'x':

+#ifdef SUPPORT_UTF8

+    if (ptr[1] == '{' && (options & PCRE_UTF8) != 0)

+      {

+      const uschar *pt = ptr + 2;

+      register int count = 0;

+      c = 0;

+      while ((digitab[*pt] & ctype_xdigit) != 0)

+        {

+        int cc = *pt++;

+        count++;

+#if !EBCDIC    /* ASCII coding */

+        if (cc >= 'a') cc -= 32;               /* Convert to upper case */

+        c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10));

+#else          /* EBCDIC coding */

+        if (cc >= 'a' && cc <= 'z') cc += 64;  /* Convert to upper case */

+        c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10));

+#endif

+        }

+      if (*pt == '}')

+        {

+        if (c < 0 || count > 8) *errorcodeptr = ERR34;

+        ptr = pt;

+        break;

+        }

+      /* If the sequence of hex digits does not end with '}', then we don't

+      recognize this construct; fall through to the normal \x handling. */

+      }

+#endif

+

+    /* Read just a single hex char */

+

+    c = 0;

+    while (i++ < 2 && (digitab[ptr[1]] & ctype_xdigit) != 0)

+      {

+      int cc;                               /* Some compilers don't like ++ */

+      cc = *(++ptr);                        /* in initializers */

+#if !EBCDIC    /* ASCII coding */

+      if (cc >= 'a') cc -= 32;              /* Convert to upper case */

+      c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10));

+#else          /* EBCDIC coding */

+      if (cc <= 'z') cc += 64;              /* Convert to upper case */

+      c = c * 16 + cc - ((cc >= '0')? '0' : ('A' - 10));

+#endif

+      }

+    break;

+

+    /* Other special escapes not starting with a digit are straightforward */

+

+    case 'c':

+    c = *(++ptr);

+    if (c == 0)

+      {

+      *errorcodeptr = ERR2;

+      return 0;

+      }

+

+    /* A letter is upper-cased; then the 0x40 bit is flipped. This coding

+    is ASCII-specific, but then the whole concept of \cx is ASCII-specific.

+    (However, an EBCDIC equivalent has now been added.) */

+

+#if !EBCDIC    /* ASCII coding */

+    if (c >= 'a' && c <= 'z') c -= 32;

+    c ^= 0x40;

+#else          /* EBCDIC coding */

+    if (c >= 'a' && c <= 'z') c += 64;

+    c ^= 0xC0;

+#endif

+    break;

+

+    /* PCRE_EXTRA enables extensions to Perl in the matter of escapes. Any

+    other alphameric following \ is an error if PCRE_EXTRA was set; otherwise,

+    for Perl compatibility, it is a literal. This code looks a bit odd, but

+    there used to be some cases other than the default, and there may be again

+    in future, so I haven't "optimized" it. */

+

+    default:

+    if ((options & PCRE_EXTRA) != 0) switch(c)

+      {

+      default:

+      *errorcodeptr = ERR3;

+      break;

+      }

+    break;

+    }

+  }

+

+*ptrptr = ptr;

+return c;

+}

+

+

+

+#ifdef SUPPORT_UCP

+/*************************************************

+*               Handle \P and \p                 *

+*************************************************/

+

+/* This function is called after \P or \p has been encountered, provided that

+PCRE is compiled with support for Unicode properties. On entry, ptrptr is

+pointing at the P or p. On exit, it is pointing at the final character of the

+escape sequence.

+

+Argument:

+  ptrptr         points to the pattern position pointer

+  negptr         points to a boolean that is set TRUE for negation else FALSE

+  errorcodeptr   points to the error code variable

+

+Returns:     value from ucp_type_table, or -1 for an invalid type

+*/

+

+static int

+get_ucp(const uschar **ptrptr, BOOL *negptr, int *errorcodeptr)

+{

+int c, i, bot, top;

+const uschar *ptr = *ptrptr;

+char name[4];

+

+c = *(++ptr);

+if (c == 0) goto ERROR_RETURN;

+

+*negptr = FALSE;

+

+/* \P or \p can be followed by a one- or two-character name in {}, optionally

+preceded by ^ for negation. */

+

+if (c == '{')

+  {

+  if (ptr[1] == '^')

+    {

+    *negptr = TRUE;

+    ptr++;

+    }

+  for (i = 0; i <= 2; i++)

+    {

+    c = *(++ptr);

+    if (c == 0) goto ERROR_RETURN;

+    if (c == '}') break;

+    name[i] = c;

+    }

+  if (c !='}')   /* Try to distinguish error cases */

+    {

+    while (*(++ptr) != 0 && *ptr != '}');

+    if (*ptr == '}') goto UNKNOWN_RETURN; else goto ERROR_RETURN;

+    }

+  name[i] = 0;

+  }

+

+/* Otherwise there is just one following character */

+

+else

+  {

+  name[0] = c;

+  name[1] = 0;

+  }

+

+*ptrptr = ptr;

+

+/* Search for a recognized property name using binary chop */

+

+bot = 0;

+top = _pcre_utt_size;

+

+while (bot < top)

+  {

+  i = (bot + top)/2;

+  c = strcmp(name, _pcre_utt[i].name);

+  if (c == 0) return _pcre_utt[i].value;

+  if (c > 0) bot = i + 1; else top = i;

+  }

+

+UNKNOWN_RETURN:

+*errorcodeptr = ERR47;

+*ptrptr = ptr;

+return -1;

+

+ERROR_RETURN:

+*errorcodeptr = ERR46;

+*ptrptr = ptr;

+return -1;

+}

+#endif

+

+

+

+

+/*************************************************

+*            Check for counted repeat            *

+*************************************************/

+

+/* This function is called when a '{' is encountered in a place where it might

+start a quantifier. It looks ahead to see if it really is a quantifier or not.

+It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}

+where the ddds are digits.

+

+Arguments:

+  p         pointer to the first char after '{'

+

+Returns:    TRUE or FALSE

+*/

+

+static BOOL

+is_counted_repeat(const uschar *p)

+{

+if ((digitab[*p++] & ctype_digit) == 0) return FALSE;

+while ((digitab[*p] & ctype_digit) != 0) p++;

+if (*p == '}') return TRUE;

+

+if (*p++ != ',') return FALSE;

+if (*p == '}') return TRUE;

+

+if ((digitab[*p++] & ctype_digit) == 0) return FALSE;

+while ((digitab[*p] & ctype_digit) != 0) p++;

+

+return (*p == '}');

+}

+

+

+

+/*************************************************

+*         Read repeat counts                     *

+*************************************************/

+

+/* Read an item of the form {n,m} and return the values. This is called only

+after is_counted_repeat() has confirmed that a repeat-count quantifier exists,

+so the syntax is guaranteed to be correct, but we need to check the values.

+

+Arguments:

+  p              pointer to first char after '{'

+  minp           pointer to int for min

+  maxp           pointer to int for max

+                 returned as -1 if no max

+  errorcodeptr   points to error code variable

+

+Returns:         pointer to '}' on success;

+                 current ptr on error, with errorcodeptr set non-zero

+*/

+

+static const uschar *

+read_repeat_counts(const uschar *p, int *minp, int *maxp, int *errorcodeptr)

+{

+int min = 0;

+int max = -1;

+

+/* Read the minimum value and do a paranoid check: a negative value indicates

+an integer overflow. */

+

+while ((digitab[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0';

+if (min < 0 || min > 65535)

+  {

+  *errorcodeptr = ERR5;

+  return p;

+  }

+

+/* Read the maximum value if there is one, and again do a paranoid on its size.

+Also, max must not be less than min. */

+

+if (*p == '}') max = min; else

+  {

+  if (*(++p) != '}')

+    {

+    max = 0;

+    while((digitab[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0';

+    if (max < 0 || max > 65535)

+      {

+      *errorcodeptr = ERR5;

+      return p;

+      }

+    if (max < min)

+      {

+      *errorcodeptr = ERR4;

+      return p;

+      }

+    }

+  }

+

+/* Fill in the required variables, and pass back the pointer to the terminating

+'}'. */

+

+*minp = min;

+*maxp = max;

+return p;

+}

+

+

+

+/*************************************************

+*      Find first significant op code            *

+*************************************************/

+

+/* This is called by several functions that scan a compiled expression looking

+for a fixed first character, or an anchoring op code etc. It skips over things

+that do not influence this. For some calls, a change of option is important.

+For some calls, it makes sense to skip negative forward and all backward

+assertions, and also the \b assertion; for others it does not.

+

+Arguments:

+  code         pointer to the start of the group

+  options      pointer to external options

+  optbit       the option bit whose changing is significant, or

+                 zero if none are

+  skipassert   TRUE if certain assertions are to be skipped

+

+Returns:       pointer to the first significant opcode

+*/

+

+static const uschar*

+first_significant_code(const uschar *code, int *options, int optbit,

+  BOOL skipassert)

+{

+for (;;)

+  {

+  switch ((int)*code)

+    {

+    case OP_OPT:

+    if (optbit > 0 && ((int)code[1] & optbit) != (*options & optbit))

+      *options = (int)code[1];

+    code += 2;

+    break;

+

+    case OP_ASSERT_NOT:

+    case OP_ASSERTBACK:

+    case OP_ASSERTBACK_NOT:

+    if (!skipassert) return code;

+    do code += GET(code, 1); while (*code == OP_ALT);

+    code += _pcre_OP_lengths[*code];

+    break;

+

+    case OP_WORD_BOUNDARY:

+    case OP_NOT_WORD_BOUNDARY:

+    if (!skipassert) return code;

+    /* Fall through */

+

+    case OP_CALLOUT:

+    case OP_CREF:

+    case OP_BRANUMBER:

+    code += _pcre_OP_lengths[*code];

+    break;

+

+    default:

+    return code;

+    }

+  }

+/* Control never reaches here */

+}

+

+

+

+

+/*************************************************

+*        Find the fixed length of a pattern      *

+*************************************************/

+

+/* Scan a pattern and compute the fixed length of subject that will match it,

+if the length is fixed. This is needed for dealing with backward assertions.

+In UTF8 mode, the result is in characters rather than bytes.

+

+Arguments:

+  code     points to the start of the pattern (the bracket)

+  options  the compiling options

+

+Returns:   the fixed length, or -1 if there is no fixed length,

+             or -2 if \C was encountered

+*/

+

+static int

+find_fixedlength(uschar *code, int options)

+{

+int length = -1;

+

+register int branchlength = 0;

+register uschar *cc = code + 1 + LINK_SIZE;

+

+/* Scan along the opcodes for this branch. If we get to the end of the

+branch, check the length against that of the other branches. */

+

+for (;;)

+  {

+  int d;

+  register int op = *cc;

+  if (op >= OP_BRA) op = OP_BRA;

+

+  switch (op)

+    {

+    case OP_BRA:

+    case OP_ONCE:

+    case OP_COND:

+    d = find_fixedlength(cc, options);

+    if (d < 0) return d;

+    branchlength += d;

+    do cc += GET(cc, 1); while (*cc == OP_ALT);

+    cc += 1 + LINK_SIZE;

+    break;

+

+    /* Reached end of a branch; if it's a ket it is the end of a nested

+    call. If it's ALT it is an alternation in a nested call. If it is

+    END it's the end of the outer call. All can be handled by the same code. */

+

+    case OP_ALT:

+    case OP_KET:

+    case OP_KETRMAX:

+    case OP_KETRMIN:

+    case OP_END:

+    if (length < 0) length = branchlength;

+      else if (length != branchlength) return -1;

+    if (*cc != OP_ALT) return length;

+    cc += 1 + LINK_SIZE;

+    branchlength = 0;

+    break;

+

+    /* Skip over assertive subpatterns */

+

+    case OP_ASSERT:

+    case OP_ASSERT_NOT:

+    case OP_ASSERTBACK:

+    case OP_ASSERTBACK_NOT:

+    do cc += GET(cc, 1); while (*cc == OP_ALT);

+    /* Fall through */

+

+    /* Skip over things that don't match chars */

+

+    case OP_REVERSE:

+    case OP_BRANUMBER:

+    case OP_CREF:

+    case OP_OPT:

+    case OP_CALLOUT:

+    case OP_SOD:

+    case OP_SOM:

+    case OP_EOD:

+    case OP_EODN:

+    case OP_CIRC:

+    case OP_DOLL:

+    case OP_NOT_WORD_BOUNDARY:

+    case OP_WORD_BOUNDARY:

+    cc += _pcre_OP_lengths[*cc];

+    break;

+

+    /* Handle literal characters */

+

+    case OP_CHAR:

+    case OP_CHARNC:

+    branchlength++;

+    cc += 2;

+#ifdef SUPPORT_UTF8

+    if ((options & PCRE_UTF8) != 0)

+      {

+      while ((*cc & 0xc0) == 0x80) cc++;

+      }

+#endif

+    break;

+

+    /* Handle exact repetitions. The count is already in characters, but we

+    need to skip over a multibyte character in UTF8 mode.  */

+

+    case OP_EXACT:

+    branchlength += GET2(cc,1);

+    cc += 4;

+#ifdef SUPPORT_UTF8

+    if ((options & PCRE_UTF8) != 0)

+      {

+      while((*cc & 0x80) == 0x80) cc++;

+      }

+#endif

+    break;

+

+    case OP_TYPEEXACT:

+    branchlength += GET2(cc,1);

+    cc += 4;

+    break;

+

+    /* Handle single-char matchers */

+

+    case OP_PROP:

+    case OP_NOTPROP:

+    cc++;

+    /* Fall through */

+

+    case OP_NOT_DIGIT:

+    case OP_DIGIT:

+    case OP_NOT_WHITESPACE:

+    case OP_WHITESPACE:

+    case OP_NOT_WORDCHAR:

+    case OP_WORDCHAR:

+    case OP_ANY:

+    branchlength++;

+    cc++;

+    break;

+

+    /* The single-byte matcher isn't allowed */

+

+    case OP_ANYBYTE:

+    return -2;

+

+    /* Check a class for variable quantification */

+

+#ifdef SUPPORT_UTF8

+    case OP_XCLASS:

+    cc += GET(cc, 1) - 33;

+    /* Fall through */

+#endif

+

+    case OP_CLASS:

+    case OP_NCLASS:

+    cc += 33;

+

+    switch (*cc)

+      {

+      case OP_CRSTAR:

+      case OP_CRMINSTAR:

+      case OP_CRQUERY:

+      case OP_CRMINQUERY:

+      return -1;

+

+      case OP_CRRANGE:

+      case OP_CRMINRANGE:

+      if (GET2(cc,1) != GET2(cc,3)) return -1;

+      branchlength += GET2(cc,1);

+      cc += 5;

+      break;

+

+      default:

+      branchlength++;

+      }

+    break;

+

+    /* Anything else is variable length */

+

+    default:

+    return -1;

+    }

+  }

+/* Control never gets here */

+}

+

+

+

+

+/*************************************************

+*    Scan compiled regex for numbered bracket    *

+*************************************************/

+

+/* This little function scans through a compiled pattern until it finds a

+capturing bracket with the given number.

+

+Arguments:

+  code        points to start of expression

+  utf8        TRUE in UTF-8 mode

+  number      the required bracket number

+

+Returns:      pointer to the opcode for the bracket, or NULL if not found

+*/

+

+static const uschar *

+find_bracket(const uschar *code, BOOL utf8, int number)

+{

+#ifndef SUPPORT_UTF8

+utf8 = utf8;               /* Stop pedantic compilers complaining */

+#endif

+

+for (;;)

+  {

+  register int c = *code;

+  if (c == OP_END) return NULL;

+  else if (c > OP_BRA)

+    {

+    int n = c - OP_BRA;

+    if (n > EXTRACT_BASIC_MAX) n = GET2(code, 2+LINK_SIZE);

+    if (n == number) return (uschar *)code;

+    code += _pcre_OP_lengths[OP_BRA];

+    }

+  else

+    {

+    code += _pcre_OP_lengths[c];

+

+#ifdef SUPPORT_UTF8

+

+    /* In UTF-8 mode, opcodes that are followed by a character may be followed

+    by a multi-byte character. The length in the table is a minimum, so we have

+    to scan along to skip the extra bytes. All opcodes are less than 128, so we

+    can use relatively efficient code. */

+

+    if (utf8) switch(c)

+      {

+      case OP_CHAR:

+      case OP_CHARNC:

+      case OP_EXACT:

+      case OP_UPTO:

+      case OP_MINUPTO:

+      case OP_STAR:

+      case OP_MINSTAR:

+      case OP_PLUS:

+      case OP_MINPLUS:

+      case OP_QUERY:

+      case OP_MINQUERY:

+      while ((*code & 0xc0) == 0x80) code++;

+      break;

+

+      /* XCLASS is used for classes that cannot be represented just by a bit

+      map. This includes negated single high-valued characters. The length in

+      the table is zero; the actual length is stored in the compiled code. */

+

+      case OP_XCLASS:

+      code += GET(code, 1) + 1;

+      break;

+      }

+#endif

+    }

+  }

+}

+

+

+

+/*************************************************

+*   Scan compiled regex for recursion reference  *

+*************************************************/

+

+/* This little function scans through a compiled pattern until it finds an

+instance of OP_RECURSE.

+

+Arguments:

+  code        points to start of expression

+  utf8        TRUE in UTF-8 mode

+

+Returns:      pointer to the opcode for OP_RECURSE, or NULL if not found

+*/

+

+static const uschar *

+find_recurse(const uschar *code, BOOL utf8)

+{

+#ifndef SUPPORT_UTF8

+utf8 = utf8;               /* Stop pedantic compilers complaining */

+#endif

+

+for (;;)

+  {

+  register int c = *code;

+  if (c == OP_END) return NULL;

+  else if (c == OP_RECURSE) return code;

+  else if (c > OP_BRA)

+    {

+    code += _pcre_OP_lengths[OP_BRA];

+    }

+  else

+    {

+    code += _pcre_OP_lengths[c];

+

+#ifdef SUPPORT_UTF8

+

+    /* In UTF-8 mode, opcodes that are followed by a character may be followed

+    by a multi-byte character. The length in the table is a minimum, so we have

+    to scan along to skip the extra bytes. All opcodes are less than 128, so we

+    can use relatively efficient code. */

+

+    if (utf8) switch(c)

+      {

+      case OP_CHAR:

+      case OP_CHARNC:

+      case OP_EXACT:

+      case OP_UPTO:

+      case OP_MINUPTO:

+      case OP_STAR:

+      case OP_MINSTAR:

+      case OP_PLUS:

+      case OP_MINPLUS:

+      case OP_QUERY:

+      case OP_MINQUERY:

+      while ((*code & 0xc0) == 0x80) code++;

+      break;

+

+      /* XCLASS is used for classes that cannot be represented just by a bit

+      map. This includes negated single high-valued characters. The length in

+      the table is zero; the actual length is stored in the compiled code. */

+

+      case OP_XCLASS:

+      code += GET(code, 1) + 1;

+      break;

+      }

+#endif

+    }

+  }

+}

+

+

+

+/*************************************************

+*    Scan compiled branch for non-emptiness      *

+*************************************************/

+

+/* This function scans through a branch of a compiled pattern to see whether it

+can match the empty string or not. It is called only from could_be_empty()

+below. Note that first_significant_code() skips over assertions. If we hit an

+unclosed bracket, we return "empty" - this means we've struck an inner bracket

+whose current branch will already have been scanned.

+

+Arguments:

+  code        points to start of search

+  endcode     points to where to stop

+  utf8        TRUE if in UTF8 mode

+

+Returns:      TRUE if what is matched could be empty

+*/

+

+static BOOL

+could_be_empty_branch(const uschar *code, const uschar *endcode, BOOL utf8)

+{

+register int c;

+for (code = first_significant_code(code + 1 + LINK_SIZE, NULL, 0, TRUE);

+     code < endcode;

+     code = first_significant_code(code + _pcre_OP_lengths[c], NULL, 0, TRUE))

+  {

+  const uschar *ccode;

+

+  c = *code;

+

+  if (c >= OP_BRA)

+    {

+    BOOL empty_branch;

+    if (GET(code, 1) == 0) return TRUE;    /* Hit unclosed bracket */

+

+    /* Scan a closed bracket */

+

+    empty_branch = FALSE;

+    do

+      {

+      if (!empty_branch && could_be_empty_branch(code, endcode, utf8))

+        empty_branch = TRUE;

+      code += GET(code, 1);

+      }

+    while (*code == OP_ALT);

+    if (!empty_branch) return FALSE;   /* All branches are non-empty */

+    code += 1 + LINK_SIZE;

+    c = *code;

+    }

+

+  else switch (c)

+    {

+    /* Check for quantifiers after a class */

+

+#ifdef SUPPORT_UTF8

+    case OP_XCLASS:

+    ccode = code + GET(code, 1);

+    goto CHECK_CLASS_REPEAT;

+#endif

+

+    case OP_CLASS:

+    case OP_NCLASS:

+    ccode = code + 33;

+

+#ifdef SUPPORT_UTF8

+    CHECK_CLASS_REPEAT:

+#endif

+

+    switch (*ccode)

+      {

+      case OP_CRSTAR:            /* These could be empty; continue */

+      case OP_CRMINSTAR:

+      case OP_CRQUERY:

+      case OP_CRMINQUERY:

+      break;

+

+      default:                   /* Non-repeat => class must match */

+      case OP_CRPLUS:            /* These repeats aren't empty */

+      case OP_CRMINPLUS:

+      return FALSE;

+

+      case OP_CRRANGE:

+      case OP_CRMINRANGE:

+      if (GET2(ccode, 1) > 0) return FALSE;  /* Minimum > 0 */

+      break;

+      }

+    break;

+

+    /* Opcodes that must match a character */

+

+    case OP_PROP:

+    case OP_NOTPROP:

+    case OP_EXTUNI:

+    case OP_NOT_DIGIT:

+    case OP_DIGIT:

+    case OP_NOT_WHITESPACE:

+    case OP_WHITESPACE:

+    case OP_NOT_WORDCHAR:

+    case OP_WORDCHAR:

+    case OP_ANY:

+    case OP_ANYBYTE:

+    case OP_CHAR:

+    case OP_CHARNC:

+    case OP_NOT:

+    case OP_PLUS:

+    case OP_MINPLUS:

+    case OP_EXACT:

+    case OP_NOTPLUS:

+    case OP_NOTMINPLUS:

+    case OP_NOTEXACT:

+    case OP_TYPEPLUS:

+    case OP_TYPEMINPLUS:

+    case OP_TYPEEXACT:

+    return FALSE;

+

+    /* End of branch */

+

+    case OP_KET:

+    case OP_KETRMAX:

+    case OP_KETRMIN:

+    case OP_ALT:

+    return TRUE;

+

+    /* In UTF-8 mode, STAR, MINSTAR, QUERY, MINQUERY, UPTO, and MINUPTO  may be

+    followed by a multibyte character */

+

+#ifdef SUPPORT_UTF8

+    case OP_STAR:

+    case OP_MINSTAR:

+    case OP_QUERY:

+    case OP_MINQUERY:

+    case OP_UPTO:

+    case OP_MINUPTO:

+    if (utf8) while ((code[2] & 0xc0) == 0x80) code++;

+    break;

+#endif

+    }

+  }

+

+return TRUE;

+}

+

+

+

+/*************************************************

+*    Scan compiled regex for non-emptiness       *

+*************************************************/

+

+/* This function is called to check for left recursive calls. We want to check

+the current branch of the current pattern to see if it could match the empty

+string. If it could, we must look outwards for branches at other levels,

+stopping when we pass beyond the bracket which is the subject of the recursion.

+

+Arguments:

+  code        points to start of the recursion

+  endcode     points to where to stop (current RECURSE item)

+  bcptr       points to the chain of current (unclosed) branch starts

+  utf8        TRUE if in UTF-8 mode

+

+Returns:      TRUE if what is matched could be empty

+*/

+

+static BOOL

+could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr,

+  BOOL utf8)

+{

+while (bcptr != NULL && bcptr->current >= code)

+  {

+  if (!could_be_empty_branch(bcptr->current, endcode, utf8)) return FALSE;

+  bcptr = bcptr->outer;

+  }

+return TRUE;

+}

+

+

+

+/*************************************************

+*           Check for POSIX class syntax         *

+*************************************************/

+

+/* This function is called when the sequence "[:" or "[." or "[=" is

+encountered in a character class. It checks whether this is followed by an

+optional ^ and then a sequence of letters, terminated by a matching ":]" or

+".]" or "=]".

+

+Argument:

+  ptr      pointer to the initial [

+  endptr   where to return the end pointer

+  cd       pointer to compile data

+

+Returns:   TRUE or FALSE

+*/

+

+static BOOL

+check_posix_syntax(const uschar *ptr, const uschar **endptr, compile_data *cd)

+{

+int terminator;          /* Don't combine these lines; the Solaris cc */

+terminator = *(++ptr);   /* compiler warns about "non-constant" initializer. */

+if (*(++ptr) == '^') ptr++;

+while ((cd->ctypes[*ptr] & ctype_letter) != 0) ptr++;

+if (*ptr == terminator && ptr[1] == ']')

+  {

+  *endptr = ptr;

+  return TRUE;

+  }

+return FALSE;

+}

+

+

+

+

+/*************************************************

+*          Check POSIX class name                *

+*************************************************/

+

+/* This function is called to check the name given in a POSIX-style class entry

+such as [:alnum:].

+

+Arguments:

+  ptr        points to the first letter

+  len        the length of the name

+

+Returns:     a value representing the name, or -1 if unknown

+*/

+

+static int

+check_posix_name(const uschar *ptr, int len)

+{

+register int yield = 0;

+while (posix_name_lengths[yield] != 0)

+  {

+  if (len == posix_name_lengths[yield] &&

+    strncmp((const char *)ptr, posix_names[yield], len) == 0) return yield;

+  yield++;

+  }

+return -1;

+}

+

+

+/*************************************************

+*    Adjust OP_RECURSE items in repeated group   *

+*************************************************/

+

+/* OP_RECURSE items contain an offset from the start of the regex to the group

+that is referenced. This means that groups can be replicated for fixed

+repetition simply by copying (because the recursion is allowed to refer to

+earlier groups that are outside the current group). However, when a group is

+optional (i.e. the minimum quantifier is zero), OP_BRAZERO is inserted before

+it, after it has been compiled. This means that any OP_RECURSE items within it

+that refer to the group itself or any contained groups have to have their

+offsets adjusted. That is the job of this function. Before it is called, the

+partially compiled regex must be temporarily terminated with OP_END.

+

+Arguments:

+  group      points to the start of the group

+  adjust     the amount by which the group is to be moved

+  utf8       TRUE in UTF-8 mode

+  cd         contains pointers to tables etc.

+

+Returns:     nothing

+*/

+

+static void

+adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd)

+{

+uschar *ptr = group;

+while ((ptr = (uschar *)find_recurse(ptr, utf8)) != NULL)

+  {

+  int offset = GET(ptr, 1);

+  if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust);

+  ptr += 1 + LINK_SIZE;

+  }

+}

+

+

+

+/*************************************************

+*        Insert an automatic callout point       *

+*************************************************/

+

+/* This function is called when the PCRE_AUTO_CALLOUT option is set, to insert

+callout points before each pattern item.

+

+Arguments:

+  code           current code pointer

+  ptr            current pattern pointer

+  cd             pointers to tables etc

+

+Returns:         new code pointer

+*/

+

+static uschar *

+auto_callout(uschar *code, const uschar *ptr, compile_data *cd)

+{

+*code++ = OP_CALLOUT;

+*code++ = 255;

+PUT(code, 0, ptr - cd->start_pattern);  /* Pattern offset */

+PUT(code, LINK_SIZE, 0);                /* Default length */

+return code + 2*LINK_SIZE;

+}

+

+

+

+/*************************************************

+*         Complete a callout item                *

+*************************************************/

+

+/* A callout item contains the length of the next item in the pattern, which

+we can't fill in till after we have reached the relevant point. This is used

+for both automatic and manual callouts.

+

+Arguments:

+  previous_callout   points to previous callout item

+  ptr                current pattern pointer

+  cd                 pointers to tables etc

+

+Returns:             nothing

+*/

+

+static void

+complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd)

+{

+int length = ptr - cd->start_pattern - GET(previous_callout, 2);

+PUT(previous_callout, 2 + LINK_SIZE, length);

+}

+

+

+

+#ifdef SUPPORT_UCP

+/*************************************************

+*           Get othercase range                  *

+*************************************************/

+

+/* This function is passed the start and end of a class range, in UTF-8 mode

+with UCP support. It searches up the characters, looking for internal ranges of

+characters in the "other" case. Each call returns the next one, updating the

+start address.

+

+Arguments:

+  cptr        points to starting character value; updated

+  d           end value

+  ocptr       where to put start of othercase range

+  odptr       where to put end of othercase range

+

+Yield:        TRUE when range returned; FALSE when no more

+*/

+

+static BOOL

+get_othercase_range(int *cptr, int d, int *ocptr, int *odptr)

+{

+int c, chartype, othercase, next;

+

+for (c = *cptr; c <= d; c++)

+  {

+  if (_pcre_ucp_findchar(c, &chartype, &othercase) == ucp_L && othercase != 0)

+    break;

+  }

+

+if (c > d) return FALSE;

+

+*ocptr = othercase;

+next = othercase + 1;

+

+for (++c; c <= d; c++)

+  {

+  if (_pcre_ucp_findchar(c, &chartype, &othercase) != ucp_L ||

+        othercase != next)

+    break;

+  next++;

+  }

+

+*odptr = next - 1;

+*cptr = c;

+

+return TRUE;

+}

+#endif  /* SUPPORT_UCP */

+

+

+/*************************************************

+*           Compile one branch                   *

+*************************************************/

+

+/* Scan the pattern, compiling it into the code vector. If the options are

+changed during the branch, the pointer is used to change the external options

+bits.

+

+Arguments:

+  optionsptr     pointer to the option bits

+  brackets       points to number of extracting brackets used

+  codeptr        points to the pointer to the current code point

+  ptrptr         points to the current pattern pointer

+  errorcodeptr   points to error code variable

+  firstbyteptr   set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE)

+  reqbyteptr     set to the last literal character required, else < 0

+  bcptr          points to current branch chain

+  cd             contains pointers to tables etc.

+

+Returns:         TRUE on success

+                 FALSE, with *errorcodeptr set non-zero on error

+*/

+

+static BOOL

+compile_branch(int *optionsptr, int *brackets, uschar **codeptr,

+  const uschar **ptrptr, int *errorcodeptr, int *firstbyteptr,

+  int *reqbyteptr, branch_chain *bcptr, compile_data *cd)

+{

+int repeat_type, op_type;

+int repeat_min = 0, repeat_max = 0;      /* To please picky compilers */

+int bravalue = 0;

+int greedy_default, greedy_non_default;

+int firstbyte, reqbyte;

+int zeroreqbyte, zerofirstbyte;

+int req_caseopt, reqvary, tempreqvary;

+int condcount = 0;

+int options = *optionsptr;

+int after_manual_callout = 0;

+register int c;

+register uschar *code = *codeptr;

+uschar *tempcode;

+BOOL inescq = FALSE;

+BOOL groupsetfirstbyte = FALSE;

+const uschar *ptr = *ptrptr;

+const uschar *tempptr;

+uschar *previous = NULL;

+uschar *previous_callout = NULL;

+uschar classbits[32];

+

+#ifdef SUPPORT_UTF8

+BOOL class_utf8;

+BOOL utf8 = (options & PCRE_UTF8) != 0;

+uschar *class_utf8data;

+uschar utf8_char[6];

+#else

+BOOL utf8 = FALSE;

+#endif

+

+/* Set up the default and non-default settings for greediness */

+

+greedy_default = ((options & PCRE_UNGREEDY) != 0);

+greedy_non_default = greedy_default ^ 1;

+

+/* Initialize no first byte, no required byte. REQ_UNSET means "no char

+matching encountered yet". It gets changed to REQ_NONE if we hit something that

+matches a non-fixed char first char; reqbyte just remains unset if we never

+find one.

+

+When we hit a repeat whose minimum is zero, we may have to adjust these values

+to take the zero repeat into account. This is implemented by setting them to

+zerofirstbyte and zeroreqbyte when such a repeat is encountered. The individual

+item types that can be repeated set these backoff variables appropriately. */

+

+firstbyte = reqbyte = zerofirstbyte = zeroreqbyte = REQ_UNSET;

+

+/* The variable req_caseopt contains either the REQ_CASELESS value or zero,

+according to the current setting of the caseless flag. REQ_CASELESS is a bit

+value > 255. It is added into the firstbyte or reqbyte variables to record the

+case status of the value. This is used only for ASCII characters. */

+

+req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;

+

+/* Switch on next character until the end of the branch */

+

+for (;; ptr++)

+  {

+  BOOL negate_class;

+  BOOL possessive_quantifier;

+  BOOL is_quantifier;

+  int class_charcount;

+  int class_lastchar;

+  int newoptions;

+  int recno;

+  int skipbytes;

+  int subreqbyte;

+  int subfirstbyte;

+  int mclength;

+  uschar mcbuffer[8];

+

+  /* Next byte in the pattern */

+

+  c = *ptr;

+

+  /* If in \Q...\E, check for the end; if not, we have a literal */

+

+  if (inescq && c != 0)

+    {

+    if (c == '\\' && ptr[1] == 'E')

+      {

+      inescq = FALSE;

+      ptr++;

+      continue;

+      }

+    else

+      {

+      if (previous_callout != NULL)

+        {

+        complete_callout(previous_callout, ptr, cd);

+        previous_callout = NULL;

+        }

+      if ((options & PCRE_AUTO_CALLOUT) != 0)

+        {

+        previous_callout = code;

+        code = auto_callout(code, ptr, cd);

+        }

+      goto NORMAL_CHAR;

+      }

+    }

+

+  /* Fill in length of a previous callout, except when the next thing is

+  a quantifier. */

+

+  is_quantifier = c == '*' || c == '+' || c == '?' ||

+    (c == '{' && is_counted_repeat(ptr+1));

+

+  if (!is_quantifier && previous_callout != NULL &&

+       after_manual_callout-- <= 0)

+    {

+    complete_callout(previous_callout, ptr, cd);

+    previous_callout = NULL;

+    }

+

+  /* In extended mode, skip white space and comments */

+

+  if ((options & PCRE_EXTENDED) != 0)

+    {

+    if ((cd->ctypes[c] & ctype_space) != 0) continue;

+    if (c == '#')

+      {

+      /* The space before the ; is to avoid a warning on a silly compiler

+      on the Macintosh. */

+      while ((c = *(++ptr)) != 0 && c != NEWLINE) ;

+      if (c != 0) continue;   /* Else fall through to handle end of string */

+      }

+    }

+

+  /* No auto callout for quantifiers. */

+

+  if ((options & PCRE_AUTO_CALLOUT) != 0 && !is_quantifier)

+    {

+    previous_callout = code;

+    code = auto_callout(code, ptr, cd);

+    }

+

+  switch(c)

+    {

+    /* The branch terminates at end of string, |, or ). */

+

+    case 0:

+    case '|':

+    case ')':

+    *firstbyteptr = firstbyte;

+    *reqbyteptr = reqbyte;

+    *codeptr = code;

+    *ptrptr = ptr;

+    return TRUE;

+

+    /* Handle single-character metacharacters. In multiline mode, ^ disables

+    the setting of any following char as a first character. */

+

+    case '^':

+    if ((options & PCRE_MULTILINE) != 0)

+      {

+      if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;

+      }

+    previous = NULL;

+    *code++ = OP_CIRC;

+    break;

+

+    case '$':

+    previous = NULL;

+    *code++ = OP_DOLL;

+    break;

+

+    /* There can never be a first char if '.' is first, whatever happens about

+    repeats. The value of reqbyte doesn't change either. */

+

+    case '.':

+    if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;

+    zerofirstbyte = firstbyte;

+    zeroreqbyte = reqbyte;

+    previous = code;

+    *code++ = OP_ANY;

+    break;

+

+    /* Character classes. If the included characters are all < 255 in value, we

+    build a 32-byte bitmap of the permitted characters, except in the special

+    case where there is only one such character. For negated classes, we build

+    the map as usual, then invert it at the end. However, we use a different

+    opcode so that data characters > 255 can be handled correctly.

+

+    If the class contains characters outside the 0-255 range, a different

+    opcode is compiled. It may optionally have a bit map for characters < 256,

+    but those above are are explicitly listed afterwards. A flag byte tells

+    whether the bitmap is present, and whether this is a negated class or not.

+    */

+

+    case '[':

+    previous = code;

+

+    /* PCRE supports POSIX class stuff inside a class. Perl gives an error if

+    they are encountered at the top level, so we'll do that too. */

+

+    if ((ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&

+        check_posix_syntax(ptr, &tempptr, cd))

+      {

+      *errorcodeptr = (ptr[1] == ':')? ERR13 : ERR31;

+      goto FAILED;

+      }

+

+    /* If the first character is '^', set the negation flag and skip it. */

+

+    if ((c = *(++ptr)) == '^')

+      {

+      negate_class = TRUE;

+      c = *(++ptr);

+      }

+    else

+      {

+      negate_class = FALSE;

+      }

+

+    /* Keep a count of chars with values < 256 so that we can optimize the case

+    of just a single character (as long as it's < 256). For higher valued UTF-8

+    characters, we don't yet do any optimization. */

+

+    class_charcount = 0;

+    class_lastchar = -1;

+

+#ifdef SUPPORT_UTF8

+    class_utf8 = FALSE;                       /* No chars >= 256 */

+    class_utf8data = code + LINK_SIZE + 34;   /* For UTF-8 items */

+#endif

+

+    /* Initialize the 32-char bit map to all zeros. We have to build the

+    map in a temporary bit of store, in case the class contains only 1

+    character (< 256), because in that case the compiled code doesn't use the

+    bit map. */

+

+    memset(classbits, 0, 32 * sizeof(uschar));

+

+    /* Process characters until ] is reached. By writing this as a "do" it

+    means that an initial ] is taken as a data character. The first pass

+    through the regex checked the overall syntax, so we don't need to be very

+    strict here. At the start of the loop, c contains the first byte of the

+    character. */

+

+    do

+      {

+#ifdef SUPPORT_UTF8

+      if (utf8 && c > 127)

+        {                           /* Braces are required because the */

+        GETCHARLEN(c, ptr, ptr);    /* macro generates multiple statements */

+        }

+#endif

+

+      /* Inside \Q...\E everything is literal except \E */

+

+      if (inescq)

+        {

+        if (c == '\\' && ptr[1] == 'E')

+          {

+          inescq = FALSE;

+          ptr++;

+          continue;

+          }

+        else goto LONE_SINGLE_CHARACTER;

+        }

+

+      /* Handle POSIX class names. Perl allows a negation extension of the

+      form [:^name:]. A square bracket that doesn't match the syntax is

+      treated as a literal. We also recognize the POSIX constructions

+      [.ch.] and [=ch=] ("collating elements") and fault them, as Perl

+      5.6 and 5.8 do. */

+

+      if (c == '[' &&

+          (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&

+          check_posix_syntax(ptr, &tempptr, cd))

+        {

+        BOOL local_negate = FALSE;

+        int posix_class, i;

+        register const uschar *cbits = cd->cbits;

+

+        if (ptr[1] != ':')

+          {

+          *errorcodeptr = ERR31;

+          goto FAILED;

+          }

+

+        ptr += 2;

+        if (*ptr == '^')

+          {

+          local_negate = TRUE;

+          ptr++;

+          }

+

+        posix_class = check_posix_name(ptr, tempptr - ptr);

+        if (posix_class < 0)

+          {

+          *errorcodeptr = ERR30;

+          goto FAILED;

+          }

+

+        /* If matching is caseless, upper and lower are converted to

+        alpha. This relies on the fact that the class table starts with

+        alpha, lower, upper as the first 3 entries. */

+

+        if ((options & PCRE_CASELESS) != 0 && posix_class <= 2)

+          posix_class = 0;

+

+        /* Or into the map we are building up to 3 of the static class

+        tables, or their negations. The [:blank:] class sets up the same

+        chars as the [:space:] class (all white space). We remove the vertical

+        white space chars afterwards. */

+

+        posix_class *= 3;

+        for (i = 0; i < 3; i++)

+          {

+          BOOL blankclass = strncmp((char *)ptr, "blank", 5) == 0;

+          int taboffset = posix_class_maps[posix_class + i];

+          if (taboffset < 0) break;

+          if (local_negate)

+            {

+            if (i == 0)

+              for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+taboffset];

+            else

+              for (c = 0; c < 32; c++) classbits[c] &= ~cbits[c+taboffset];

+            if (blankclass) classbits[1] |= 0x3c;

+            }

+          else

+            {

+            for (c = 0; c < 32; c++) classbits[c] |= cbits[c+taboffset];

+            if (blankclass) classbits[1] &= ~0x3c;

+            }

+          }

+

+        ptr = tempptr + 1;

+        class_charcount = 10;  /* Set > 1; assumes more than 1 per class */

+        continue;    /* End of POSIX syntax handling */

+        }

+

+      /* Backslash may introduce a single character, or it may introduce one

+      of the specials, which just set a flag. Escaped items are checked for

+      validity in the pre-compiling pass. The sequence \b is a special case.

+      Inside a class (and only there) it is treated as backspace. Elsewhere

+      it marks a word boundary. Other escapes have preset maps ready to

+      or into the one we are building. We assume they have more than one

+      character in them, so set class_charcount bigger than one. */

+

+      if (c == '\\')

+        {

+        c = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE);

+

+        if (-c == ESC_b) c = '\b';       /* \b is backslash in a class */

+        else if (-c == ESC_X) c = 'X';   /* \X is literal X in a class */

+        else if (-c == ESC_Q)            /* Handle start of quoted string */

+          {

+          if (ptr[1] == '\\' && ptr[2] == 'E')

+            {

+            ptr += 2; /* avoid empty string */

+            }

+          else inescq = TRUE;

+          continue;

+          }

+

+        if (c < 0)

+          {

+          register const uschar *cbits = cd->cbits;

+          class_charcount += 2;     /* Greater than 1 is what matters */

+          switch (-c)

+            {

+            case ESC_d:

+            for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_digit];

+            continue;

+

+            case ESC_D:

+            for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_digit];

+            continue;

+

+            case ESC_w:

+            for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_word];

+            continue;

+

+            case ESC_W:

+            for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];

+            continue;

+

+            case ESC_s:

+            for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];

+            classbits[1] &= ~0x08;   /* Perl 5.004 onwards omits VT from \s */

+            continue;

+

+            case ESC_S:

+            for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];

+            classbits[1] |= 0x08;    /* Perl 5.004 onwards omits VT from \s */

+            continue;

+

+#ifdef SUPPORT_UCP

+            case ESC_p:

+            case ESC_P:

+              {

+              BOOL negated;

+              int property = get_ucp(&ptr, &negated, errorcodeptr);

+              if (property < 0) goto FAILED;

+              class_utf8 = TRUE;

+              *class_utf8data++ = ((-c == ESC_p) != negated)?

+                XCL_PROP : XCL_NOTPROP;

+              *class_utf8data++ = property;

+              class_charcount -= 2;   /* Not a < 256 character */

+              }

+            continue;

+#endif

+

+            /* Unrecognized escapes are faulted if PCRE is running in its

+            strict mode. By default, for compatibility with Perl, they are

+            treated as literals. */

+

+            default:

+            if ((options & PCRE_EXTRA) != 0)

+              {

+              *errorcodeptr = ERR7;

+              goto FAILED;

+              }

+            c = *ptr;              /* The final character */

+            class_charcount -= 2;  /* Undo the default count from above */

+            }

+          }

+

+        /* Fall through if we have a single character (c >= 0). This may be

+        > 256 in UTF-8 mode. */

+

+        }   /* End of backslash handling */

+

+      /* A single character may be followed by '-' to form a range. However,

+      Perl does not permit ']' to be the end of the range. A '-' character

+      here is treated as a literal. */

+

+      if (ptr[1] == '-' && ptr[2] != ']')

+        {

+        int d;

+        ptr += 2;

+

+#ifdef SUPPORT_UTF8

+        if (utf8)

+          {                           /* Braces are required because the */

+          GETCHARLEN(d, ptr, ptr);    /* macro generates multiple statements */

+          }

+        else

+#endif

+        d = *ptr;  /* Not UTF-8 mode */

+

+        /* The second part of a range can be a single-character escape, but

+        not any of the other escapes. Perl 5.6 treats a hyphen as a literal

+        in such circumstances. */

+

+        if (d == '\\')

+          {

+          const uschar *oldptr = ptr;

+          d = check_escape(&ptr, errorcodeptr, *brackets, options, TRUE);

+

+          /* \b is backslash; \X is literal X; any other special means the '-'

+          was literal */

+

+          if (d < 0)

+            {

+            if (d == -ESC_b) d = '\b';

+            else if (d == -ESC_X) d = 'X'; else

+              {

+              ptr = oldptr - 2;

+              goto LONE_SINGLE_CHARACTER;  /* A few lines below */

+              }

+            }

+          }

+

+        /* The check that the two values are in the correct order happens in

+        the pre-pass. Optimize one-character ranges */

+

+        if (d == c) goto LONE_SINGLE_CHARACTER;  /* A few lines below */

+

+        /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless

+        matching, we have to use an XCLASS with extra data items. Caseless

+        matching for characters > 127 is available only if UCP support is

+        available. */

+

+#ifdef SUPPORT_UTF8

+        if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127)))

+          {

+          class_utf8 = TRUE;

+

+          /* With UCP support, we can find the other case equivalents of

+          the relevant characters. There may be several ranges. Optimize how

+          they fit with the basic range. */

+

+#ifdef SUPPORT_UCP

+          if ((options & PCRE_CASELESS) != 0)

+            {

+            int occ, ocd;

+            int cc = c;

+            int origd = d;

+            while (get_othercase_range(&cc, origd, &occ, &ocd))

+              {

+              if (occ >= c && ocd <= d) continue;  /* Skip embedded ranges */

+

+              if (occ < c  && ocd >= c - 1)        /* Extend the basic range */

+                {                                  /* if there is overlap,   */

+                c = occ;                           /* noting that if occ < c */

+                continue;                          /* we can't have ocd > d  */

+                }                                  /* because a subrange is  */

+              if (ocd > d && occ <= d + 1)         /* always shorter than    */

+                {                                  /* the basic range.       */

+                d = ocd;

+                continue;

+                }

+

+              if (occ == ocd)

+                {

+                *class_utf8data++ = XCL_SINGLE;

+                }

+              else

+                {

+                *class_utf8data++ = XCL_RANGE;

+                class_utf8data += _pcre_ord2utf8(occ, class_utf8data);

+                }

+              class_utf8data += _pcre_ord2utf8(ocd, class_utf8data);

+              }

+            }

+#endif  /* SUPPORT_UCP */

+

+          /* Now record the original range, possibly modified for UCP caseless

+          overlapping ranges. */

+

+          *class_utf8data++ = XCL_RANGE;

+          class_utf8data += _pcre_ord2utf8(c, class_utf8data);

+          class_utf8data += _pcre_ord2utf8(d, class_utf8data);

+

+          /* With UCP support, we are done. Without UCP support, there is no

+          caseless matching for UTF-8 characters > 127; we can use the bit map

+          for the smaller ones. */

+

+#ifdef SUPPORT_UCP

+          continue;    /* With next character in the class */

+#else

+          if ((options & PCRE_CASELESS) == 0 || c > 127) continue;

+

+          /* Adjust upper limit and fall through to set up the map */

+

+          d = 127;

+

+#endif  /* SUPPORT_UCP */

+          }

+#endif  /* SUPPORT_UTF8 */

+

+        /* We use the bit map for all cases when not in UTF-8 mode; else

+        ranges that lie entirely within 0-127 when there is UCP support; else

+        for partial ranges without UCP support. */

+

+        for (; c <= d; c++)

+          {

+          classbits[c/8] |= (1 << (c&7));

+          if ((options & PCRE_CASELESS) != 0)

+            {

+            int uc = cd->fcc[c];           /* flip case */

+            classbits[uc/8] |= (1 << (uc&7));

+            }

+          class_charcount++;                /* in case a one-char range */

+          class_lastchar = c;

+          }

+

+        continue;   /* Go get the next char in the class */

+        }

+

+      /* Handle a lone single character - we can get here for a normal

+      non-escape char, or after \ that introduces a single character or for an

+      apparent range that isn't. */

+

+      LONE_SINGLE_CHARACTER:

+

+      /* Handle a character that cannot go in the bit map */

+

+#ifdef SUPPORT_UTF8

+      if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))

+        {

+        class_utf8 = TRUE;

+        *class_utf8data++ = XCL_SINGLE;

+        class_utf8data += _pcre_ord2utf8(c, class_utf8data);

+

+#ifdef SUPPORT_UCP

+        if ((options & PCRE_CASELESS) != 0)

+          {

+          int chartype;

+          int othercase;

+          if (_pcre_ucp_findchar(c, &chartype, &othercase) >= 0 &&

+               othercase > 0)

+            {

+            *class_utf8data++ = XCL_SINGLE;

+            class_utf8data += _pcre_ord2utf8(othercase, class_utf8data);

+            }

+          }

+#endif  /* SUPPORT_UCP */

+

+        }

+      else

+#endif  /* SUPPORT_UTF8 */

+

+      /* Handle a single-byte character */

+        {

+        classbits[c/8] |= (1 << (c&7));

+        if ((options & PCRE_CASELESS) != 0)

+          {

+          c = cd->fcc[c];   /* flip case */

+          classbits[c/8] |= (1 << (c&7));

+          }

+        class_charcount++;

+        class_lastchar = c;

+        }

+      }

+

+    /* Loop until ']' reached; the check for end of string happens inside the

+    loop. This "while" is the end of the "do" above. */

+

+    while ((c = *(++ptr)) != ']' || inescq);

+

+    /* If class_charcount is 1, we saw precisely one character whose value is

+    less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we

+    can optimize the negative case only if there were no characters >= 128

+    because OP_NOT and the related opcodes like OP_NOTSTAR operate on

+    single-bytes only. This is an historical hangover. Maybe one day we can

+    tidy these opcodes to handle multi-byte characters.

+

+    The optimization throws away the bit map. We turn the item into a

+    1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note

+    that OP_NOT does not support multibyte characters. In the positive case, it

+    can cause firstbyte to be set. Otherwise, there can be no first char if

+    this item is first, whatever repeat count may follow. In the case of

+    reqbyte, save the previous value for reinstating. */

+

+#ifdef SUPPORT_UTF8

+    if (class_charcount == 1 &&

+          (!utf8 ||

+          (!class_utf8 && (!negate_class || class_lastchar < 128))))

+

+#else

+    if (class_charcount == 1)

+#endif

+      {

+      zeroreqbyte = reqbyte;

+

+      /* The OP_NOT opcode works on one-byte characters only. */

+

+      if (negate_class)

+        {

+        if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;

+        zerofirstbyte = firstbyte;

+        *code++ = OP_NOT;

+        *code++ = class_lastchar;

+        break;

+        }

+

+      /* For a single, positive character, get the value into mcbuffer, and

+      then we can handle this with the normal one-character code. */

+

+#ifdef SUPPORT_UTF8

+      if (utf8 && class_lastchar > 127)

+        mclength = _pcre_ord2utf8(class_lastchar, mcbuffer);

+      else

+#endif

+        {

+        mcbuffer[0] = class_lastchar;

+        mclength = 1;

+        }

+      goto ONE_CHAR;

+      }       /* End of 1-char optimization */

+

+    /* The general case - not the one-char optimization. If this is the first

+    thing in the branch, there can be no first char setting, whatever the

+    repeat count. Any reqbyte setting must remain unchanged after any kind of

+    repeat. */

+

+    if (firstbyte == REQ_UNSET) firstbyte = REQ_NONE;

+    zerofirstbyte = firstbyte;

+    zeroreqbyte = reqbyte;

+

+    /* If there are characters with values > 255, we have to compile an

+    extended class, with its own opcode. If there are no characters < 256,

+    we can omit the bitmap. */

+

+#ifdef SUPPORT_UTF8

+    if (class_utf8)

+      {

+      *class_utf8data++ = XCL_END;    /* Marks the end of extra data */

+      *code++ = OP_XCLASS;

+      code += LINK_SIZE;

+      *code = negate_class? XCL_NOT : 0;

+

+      /* If the map is required, install it, and move on to the end of

+      the extra data */

+

+      if (class_charcount > 0)

+        {

+        *code++ |= XCL_MAP;

+        memcpy(code, classbits, 32);

+        code = class_utf8data;

+        }

+

+      /* If the map is not required, slide down the extra data. */

+

+      else

+        {

+        int len = class_utf8data - (code + 33);

+        memmove(code + 1, code + 33, len);

+        code += len + 1;

+        }

+

+      /* Now fill in the complete length of the item */

+

+      PUT(previous, 1, code - previous);

+      break;   /* End of class handling */

+      }

+#endif

+

+    /* If there are no characters > 255, negate the 32-byte map if necessary,

+    and copy it into the code vector. If this is the first thing in the branch,

+    there can be no first char setting, whatever the repeat count. Any reqbyte

+    setting must remain unchanged after any kind of repeat. */

+

+    if (negate_class)

+      {

+      *code++ = OP_NCLASS;

+      for (c = 0; c < 32; c++) code[c] = ~classbits[c];

+      }

+    else

+      {

+      *code++ = OP_CLASS;

+      memcpy(code, classbits, 32);

+      }

+    code += 32;

+    break;

+

+    /* Various kinds of repeat; '{' is not necessarily a quantifier, but this

+    has been tested above. */

+

+    case '{':

+    if (!is_quantifier) goto NORMAL_CHAR;

+    ptr = read_repeat_counts(ptr+1, &repeat_min, &repeat_max, errorcodeptr);

+    if (*errorcodeptr != 0) goto FAILED;

+    goto REPEAT;

+

+    case '*':

+    repeat_min = 0;

+    repeat_max = -1;

+    goto REPEAT;

+

+    case '+':

+    repeat_min = 1;

+    repeat_max = -1;

+    goto REPEAT;

+

+    case '?':

+    repeat_min = 0;

+    repeat_max = 1;

+

+    REPEAT:

+    if (previous == NULL)

+      {

+      *errorcodeptr = ERR9;

+      goto FAILED;

+      }

+

+    if (repeat_min == 0)

+      {

+      firstbyte = zerofirstbyte;    /* Adjust for zero repeat */

+      reqbyte = zeroreqbyte;        /* Ditto */

+      }

+

+    /* Remember whether this is a variable length repeat */

+

+    reqvary = (repeat_min == repeat_max)? 0 : REQ_VARY;

+

+    op_type = 0;                    /* Default single-char op codes */

+    possessive_quantifier = FALSE;  /* Default not possessive quantifier */

+

+    /* Save start of previous item, in case we have to move it up to make space

+    for an inserted OP_ONCE for the additional '+' extension. */

+

+    tempcode = previous;

+

+    /* If the next character is '+', we have a possessive quantifier. This

+    implies greediness, whatever the setting of the PCRE_UNGREEDY option.

+    If the next character is '?' this is a minimizing repeat, by default,

+    but if PCRE_UNGREEDY is set, it works the other way round. We change the

+    repeat type to the non-default. */

+

+    if (ptr[1] == '+')

+      {

+      repeat_type = 0;                  /* Force greedy */

+      possessive_quantifier = TRUE;

+      ptr++;

+      }

+    else if (ptr[1] == '?')

+      {

+      repeat_type = greedy_non_default;

+      ptr++;

+      }

+    else repeat_type = greedy_default;

+

+    /* If previous was a recursion, we need to wrap it inside brackets so that

+    it can be replicated if necessary. */

+

+    if (*previous == OP_RECURSE)

+      {

+      memmove(previous + 1 + LINK_SIZE, previous, 1 + LINK_SIZE);

+      code += 1 + LINK_SIZE;

+      *previous = OP_BRA;

+      PUT(previous, 1, code - previous);

+      *code = OP_KET;

+      PUT(code, 1, code - previous);

+      code += 1 + LINK_SIZE;

+      }

+

+    /* If previous was a character match, abolish the item and generate a

+    repeat item instead. If a char item has a minumum of more than one, ensure

+    that it is set in reqbyte - it might not be if a sequence such as x{3} is

+    the first thing in a branch because the x will have gone into firstbyte

+    instead.  */

+

+    if (*previous == OP_CHAR || *previous == OP_CHARNC)

+      {

+      /* Deal with UTF-8 characters that take up more than one byte. It's

+      easier to write this out separately than try to macrify it. Use c to

+      hold the length of the character in bytes, plus 0x80 to flag that it's a

+      length rather than a small character. */

+

+#ifdef SUPPORT_UTF8

+      if (utf8 && (code[-1] & 0x80) != 0)

+        {

+        uschar *lastchar = code - 1;

+        while((*lastchar & 0xc0) == 0x80) lastchar--;

+        c = code - lastchar;            /* Length of UTF-8 character */

+        memcpy(utf8_char, lastchar, c); /* Save the char */

+        c |= 0x80;                      /* Flag c as a length */

+        }

+      else

+#endif

+

+      /* Handle the case of a single byte - either with no UTF8 support, or

+      with UTF-8 disabled, or for a UTF-8 character < 128. */

+

+        {

+        c = code[-1];

+        if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt;

+        }

+

+      goto OUTPUT_SINGLE_REPEAT;   /* Code shared with single character types */

+      }

+

+    /* If previous was a single negated character ([^a] or similar), we use

+    one of the special opcodes, replacing it. The code is shared with single-

+    character repeats by setting opt_type to add a suitable offset into

+    repeat_type. OP_NOT is currently used only for single-byte chars. */

+

+    else if (*previous == OP_NOT)

+      {

+      op_type = OP_NOTSTAR - OP_STAR;  /* Use "not" opcodes */

+      c = previous[1];

+      goto OUTPUT_SINGLE_REPEAT;

+      }

+

+    /* If previous was a character type match (\d or similar), abolish it and

+    create a suitable repeat item. The code is shared with single-character

+    repeats by setting op_type to add a suitable offset into repeat_type. Note

+    the the Unicode property types will be present only when SUPPORT_UCP is

+    defined, but we don't wrap the little bits of code here because it just

+    makes it horribly messy. */

+

+    else if (*previous < OP_EODN)

+      {

+      uschar *oldcode;

+      int prop_type;

+      op_type = OP_TYPESTAR - OP_STAR;  /* Use type opcodes */

+      c = *previous;

+

+      OUTPUT_SINGLE_REPEAT:

+      prop_type = (*previous == OP_PROP || *previous == OP_NOTPROP)?

+        previous[1] : -1;

+

+      oldcode = code;

+      code = previous;                  /* Usually overwrite previous item */

+

+      /* If the maximum is zero then the minimum must also be zero; Perl allows

+      this case, so we do too - by simply omitting the item altogether. */

+

+      if (repeat_max == 0) goto END_REPEAT;

+

+      /* All real repeats make it impossible to handle partial matching (maybe

+      one day we will be able to remove this restriction). */

+

+      if (repeat_max != 1) cd->nopartial = TRUE;

+

+      /* Combine the op_type with the repeat_type */

+

+      repeat_type += op_type;

+

+      /* A minimum of zero is handled either as the special case * or ?, or as

+      an UPTO, with the maximum given. */

+

+      if (repeat_min == 0)

+        {

+        if (repeat_max == -1) *code++ = OP_STAR + repeat_type;

+          else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type;

+        else

+          {

+          *code++ = OP_UPTO + repeat_type;

+          PUT2INC(code, 0, repeat_max);

+          }

+        }

+

+      /* A repeat minimum of 1 is optimized into some special cases. If the

+      maximum is unlimited, we use OP_PLUS. Otherwise, the original item it

+      left in place and, if the maximum is greater than 1, we use OP_UPTO with

+      one less than the maximum. */

+

+      else if (repeat_min == 1)

+        {

+        if (repeat_max == -1)

+          *code++ = OP_PLUS + repeat_type;

+        else

+          {

+          code = oldcode;                 /* leave previous item in place */

+          if (repeat_max == 1) goto END_REPEAT;

+          *code++ = OP_UPTO + repeat_type;

+          PUT2INC(code, 0, repeat_max - 1);

+          }

+        }

+

+      /* The case {n,n} is just an EXACT, while the general case {n,m} is

+      handled as an EXACT followed by an UPTO. */

+

+      else

+        {

+        *code++ = OP_EXACT + op_type;  /* NB EXACT doesn't have repeat_type */

+        PUT2INC(code, 0, repeat_min);

+

+        /* If the maximum is unlimited, insert an OP_STAR. Before doing so,

+        we have to insert the character for the previous code. For a repeated

+        Unicode property match, there is an extra byte that defines the

+        required property. In UTF-8 mode, long characters have their length in

+        c, with the 0x80 bit as a flag. */

+

+        if (repeat_max < 0)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+            memcpy(code, utf8_char, c & 7);

+            code += c & 7;

+            }

+          else

+#endif

+            {

+            *code++ = c;

+            if (prop_type >= 0) *code++ = prop_type;

+            }

+          *code++ = OP_STAR + repeat_type;

+          }

+

+        /* Else insert an UPTO if the max is greater than the min, again

+        preceded by the character, for the previously inserted code. */

+

+        else if (repeat_max != repeat_min)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+            memcpy(code, utf8_char, c & 7);

+            code += c & 7;

+            }

+          else

+#endif

+          *code++ = c;

+          if (prop_type >= 0) *code++ = prop_type;

+          repeat_max -= repeat_min;

+          *code++ = OP_UPTO + repeat_type;

+          PUT2INC(code, 0, repeat_max);

+          }

+        }

+

+      /* The character or character type itself comes last in all cases. */

+

+#ifdef SUPPORT_UTF8

+      if (utf8 && c >= 128)

+        {

+        memcpy(code, utf8_char, c & 7);

+        code += c & 7;

+        }

+      else

+#endif

+      *code++ = c;

+

+      /* For a repeated Unicode property match, there is an extra byte that

+      defines the required property. */

+

+#ifdef SUPPORT_UCP

+      if (prop_type >= 0) *code++ = prop_type;

+#endif

+      }

+

+    /* If previous was a character class or a back reference, we put the repeat

+    stuff after it, but just skip the item if the repeat was {0,0}. */

+

+    else if (*previous == OP_CLASS ||

+             *previous == OP_NCLASS ||

+#ifdef SUPPORT_UTF8

+             *previous == OP_XCLASS ||

+#endif

+             *previous == OP_REF)

+      {

+      if (repeat_max == 0)

+        {

+        code = previous;

+        goto END_REPEAT;

+        }

+

+      /* All real repeats make it impossible to handle partial matching (maybe

+      one day we will be able to remove this restriction). */

+

+      if (repeat_max != 1) cd->nopartial = TRUE;

+

+      if (repeat_min == 0 && repeat_max == -1)

+        *code++ = OP_CRSTAR + repeat_type;

+      else if (repeat_min == 1 && repeat_max == -1)

+        *code++ = OP_CRPLUS + repeat_type;

+      else if (repeat_min == 0 && repeat_max == 1)

+        *code++ = OP_CRQUERY + repeat_type;

+      else

+        {

+        *code++ = OP_CRRANGE + repeat_type;

+        PUT2INC(code, 0, repeat_min);

+        if (repeat_max == -1) repeat_max = 0;  /* 2-byte encoding for max */

+        PUT2INC(code, 0, repeat_max);

+        }

+      }

+

+    /* If previous was a bracket group, we may have to replicate it in certain

+    cases. */

+

+    else if (*previous >= OP_BRA || *previous == OP_ONCE ||

+             *previous == OP_COND)

+      {

+      register int i;

+      int ketoffset = 0;

+      int len = code - previous;

+      uschar *bralink = NULL;

+

+      /* If the maximum repeat count is unlimited, find the end of the bracket

+      by scanning through from the start, and compute the offset back to it

+      from the current code pointer. There may be an OP_OPT setting following

+      the final KET, so we can't find the end just by going back from the code

+      pointer. */

+

+      if (repeat_max == -1)

+        {

+        register uschar *ket = previous;

+        do ket += GET(ket, 1); while (*ket != OP_KET);

+        ketoffset = code - ket;

+        }

+

+      /* The case of a zero minimum is special because of the need to stick

+      OP_BRAZERO in front of it, and because the group appears once in the

+      data, whereas in other cases it appears the minimum number of times. For

+      this reason, it is simplest to treat this case separately, as otherwise

+      the code gets far too messy. There are several special subcases when the

+      minimum is zero. */

+

+      if (repeat_min == 0)

+        {

+        /* If the maximum is also zero, we just omit the group from the output

+        altogether. */

+

+        if (repeat_max == 0)

+          {

+          code = previous;

+          goto END_REPEAT;

+          }

+

+        /* If the maximum is 1 or unlimited, we just have to stick in the

+        BRAZERO and do no more at this point. However, we do need to adjust

+        any OP_RECURSE calls inside the group that refer to the group itself or

+        any internal group, because the offset is from the start of the whole

+        regex. Temporarily terminate the pattern while doing this. */

+

+        if (repeat_max <= 1)

+          {

+          *code = OP_END;

+          adjust_recurse(previous, 1, utf8, cd);

+          memmove(previous+1, previous, len);

+          code++;

+          *previous++ = OP_BRAZERO + repeat_type;

+          }

+

+        /* If the maximum is greater than 1 and limited, we have to replicate

+        in a nested fashion, sticking OP_BRAZERO before each set of brackets.

+        The first one has to be handled carefully because it's the original

+        copy, which has to be moved up. The remainder can be handled by code

+        that is common with the non-zero minimum case below. We have to

+        adjust the value or repeat_max, since one less copy is required. Once

+        again, we may have to adjust any OP_RECURSE calls inside the group. */

+

+        else

+          {

+          int offset;

+          *code = OP_END;

+          adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd);

+          memmove(previous + 2 + LINK_SIZE, previous, len);

+          code += 2 + LINK_SIZE;

+          *previous++ = OP_BRAZERO + repeat_type;

+          *previous++ = OP_BRA;

+

+          /* We chain together the bracket offset fields that have to be

+          filled in later when the ends of the brackets are reached. */

+

+          offset = (bralink == NULL)? 0 : previous - bralink;

+          bralink = previous;

+          PUTINC(previous, 0, offset);

+          }

+

+        repeat_max--;

+        }

+

+      /* If the minimum is greater than zero, replicate the group as many

+      times as necessary, and adjust the maximum to the number of subsequent

+      copies that we need. If we set a first char from the group, and didn't

+      set a required char, copy the latter from the former. */

+

+      else

+        {

+        if (repeat_min > 1)

+          {

+          if (groupsetfirstbyte && reqbyte < 0) reqbyte = firstbyte;

+          for (i = 1; i < repeat_min; i++)

+            {

+            memcpy(code, previous, len);

+            code += len;

+            }

+          }

+        if (repeat_max > 0) repeat_max -= repeat_min;

+        }

+

+      /* This code is common to both the zero and non-zero minimum cases. If

+      the maximum is limited, it replicates the group in a nested fashion,

+      remembering the bracket starts on a stack. In the case of a zero minimum,

+      the first one was set up above. In all cases the repeat_max now specifies

+      the number of additional copies needed. */

+

+      if (repeat_max >= 0)

+        {

+        for (i = repeat_max - 1; i >= 0; i--)

+          {

+          *code++ = OP_BRAZERO + repeat_type;

+

+          /* All but the final copy start a new nesting, maintaining the

+          chain of brackets outstanding. */

+

+          if (i != 0)

+            {

+            int offset;

+            *code++ = OP_BRA;

+            offset = (bralink == NULL)? 0 : code - bralink;

+            bralink = code;

+            PUTINC(code, 0, offset);

+            }

+

+          memcpy(code, previous, len);

+          code += len;

+          }

+

+        /* Now chain through the pending brackets, and fill in their length

+        fields (which are holding the chain links pro tem). */

+

+        while (bralink != NULL)

+          {

+          int oldlinkoffset;

+          int offset = code - bralink + 1;

+          uschar *bra = code - offset;

+          oldlinkoffset = GET(bra, 1);

+          bralink = (oldlinkoffset == 0)? NULL : bralink - oldlinkoffset;

+          *code++ = OP_KET;

+          PUTINC(code, 0, offset);

+          PUT(bra, 1, offset);

+          }

+        }

+

+      /* If the maximum is unlimited, set a repeater in the final copy. We

+      can't just offset backwards from the current code point, because we

+      don't know if there's been an options resetting after the ket. The

+      correct offset was computed above. */

+

+      else code[-ketoffset] = OP_KETRMAX + repeat_type;

+      }

+

+    /* Else there's some kind of shambles */

+

+    else

+      {

+      *errorcodeptr = ERR11;

+      goto FAILED;

+      }

+

+    /* If the character following a repeat is '+', we wrap the entire repeated

+    item inside OP_ONCE brackets. This is just syntactic sugar, taken from

+    Sun's Java package. The repeated item starts at tempcode, not at previous,

+    which might be the first part of a string whose (former) last char we

+    repeated. However, we don't support '+' after a greediness '?'. */

+

+    if (possessive_quantifier)

+      {

+      int len = code - tempcode;

+      memmove(tempcode + 1+LINK_SIZE, tempcode, len);

+      code += 1 + LINK_SIZE;

+      len += 1 + LINK_SIZE;

+      tempcode[0] = OP_ONCE;

+      *code++ = OP_KET;

+      PUTINC(code, 0, len);

+      PUT(tempcode, 1, len);

+      }

+

+    /* In all case we no longer have a previous item. We also set the

+    "follows varying string" flag for subsequently encountered reqbytes if

+    it isn't already set and we have just passed a varying length item. */

+

+    END_REPEAT:

+    previous = NULL;

+    cd->req_varyopt |= reqvary;

+    break;

+

+

+    /* Start of nested bracket sub-expression, or comment or lookahead or

+    lookbehind or option setting or condition. First deal with special things

+    that can come after a bracket; all are introduced by ?, and the appearance

+    of any of them means that this is not a referencing group. They were

+    checked for validity in the first pass over the string, so we don't have to

+    check for syntax errors here.  */

+

+    case '(':

+    newoptions = options;

+    skipbytes = 0;

+

+    if (*(++ptr) == '?')

+      {

+      int set, unset;

+      int *optset;

+

+      switch (*(++ptr))

+        {

+        case '#':                 /* Comment; skip to ket */

+        ptr++;

+        while (*ptr != ')') ptr++;

+        continue;

+

+        case ':':                 /* Non-extracting bracket */

+        bravalue = OP_BRA;

+        ptr++;

+        break;

+

+        case '(':

+        bravalue = OP_COND;       /* Conditional group */

+

+        /* Condition to test for recursion */

+

+        if (ptr[1] == 'R')

+          {

+          code[1+LINK_SIZE] = OP_CREF;

+          PUT2(code, 2+LINK_SIZE, CREF_RECURSE);

+          skipbytes = 3;

+          ptr += 3;

+          }

+

+        /* Condition to test for a numbered subpattern match. We know that

+        if a digit follows ( then there will just be digits until ) because

+        the syntax was checked in the first pass. */

+

+        else if ((digitab[ptr[1]] && ctype_digit) != 0)

+          {

+          int condref;                 /* Don't amalgamate; some compilers */

+          condref = *(++ptr) - '0';    /* grumble at autoincrement in declaration */

+          while (*(++ptr) != ')') condref = condref*10 + *ptr - '0';

+          if (condref == 0)

+            {

+            *errorcodeptr = ERR35;

+            goto FAILED;

+            }

+          ptr++;

+          code[1+LINK_SIZE] = OP_CREF;

+          PUT2(code, 2+LINK_SIZE, condref);

+          skipbytes = 3;

+          }

+        /* For conditions that are assertions, we just fall through, having

+        set bravalue above. */

+        break;

+

+        case '=':                 /* Positive lookahead */

+        bravalue = OP_ASSERT;

+        ptr++;

+        break;

+

+        case '!':                 /* Negative lookahead */

+        bravalue = OP_ASSERT_NOT;

+        ptr++;

+        break;

+

+        case '<':                 /* Lookbehinds */

+        switch (*(++ptr))

+          {

+          case '=':               /* Positive lookbehind */

+          bravalue = OP_ASSERTBACK;

+          ptr++;

+          break;

+

+          case '!':               /* Negative lookbehind */

+          bravalue = OP_ASSERTBACK_NOT;

+          ptr++;

+          break;

+          }

+        break;

+

+        case '>':                 /* One-time brackets */

+        bravalue = OP_ONCE;

+        ptr++;

+        break;

+

+        case 'C':                 /* Callout - may be followed by digits; */

+        previous_callout = code;  /* Save for later completion */

+        after_manual_callout = 1; /* Skip one item before completing */

+        *code++ = OP_CALLOUT;     /* Already checked that the terminating */

+          {                       /* closing parenthesis is present. */

+          int n = 0;

+          while ((digitab[*(++ptr)] & ctype_digit) != 0)

+            n = n * 10 + *ptr - '0';

+          if (n > 255)

+            {

+            *errorcodeptr = ERR38;

+            goto FAILED;

+            }

+          *code++ = n;

+          PUT(code, 0, ptr - cd->start_pattern + 1);  /* Pattern offset */

+          PUT(code, LINK_SIZE, 0);                    /* Default length */

+          code += 2 * LINK_SIZE;

+          }

+        previous = NULL;

+        continue;

+

+        case 'P':                 /* Named subpattern handling */

+        if (*(++ptr) == '<')      /* Definition */

+          {

+          int i, namelen;

+          uschar *slot = cd->name_table;

+          const uschar *name;     /* Don't amalgamate; some compilers */

+          name = ++ptr;           /* grumble at autoincrement in declaration */

+

+          while (*ptr++ != '>');

+          namelen = ptr - name - 1;

+

+          for (i = 0; i < cd->names_found; i++)

+            {

+            int crc = memcmp(name, slot+2, namelen);

+            if (crc == 0)

+              {

+              if (slot[2+namelen] == 0)

+                {

+                *errorcodeptr = ERR43;

+                goto FAILED;

+                }

+              crc = -1;             /* Current name is substring */

+              }

+            if (crc < 0)

+              {

+              memmove(slot + cd->name_entry_size, slot,

+                (cd->names_found - i) * cd->name_entry_size);

+              break;

+              }

+            slot += cd->name_entry_size;

+            }

+

+          PUT2(slot, 0, *brackets + 1);

+          memcpy(slot + 2, name, namelen);

+          slot[2+namelen] = 0;

+          cd->names_found++;

+          goto NUMBERED_GROUP;

+          }

+

+        if (*ptr == '=' || *ptr == '>')  /* Reference or recursion */

+          {

+          int i, namelen;

+          int type = *ptr++;

+          const uschar *name = ptr;

+          uschar *slot = cd->name_table;

+

+          while (*ptr != ')') ptr++;

+          namelen = ptr - name;

+

+          for (i = 0; i < cd->names_found; i++)

+            {

+            if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break;

+            slot += cd->name_entry_size;

+            }

+          if (i >= cd->names_found)

+            {

+            *errorcodeptr = ERR15;

+            goto FAILED;

+            }

+

+          recno = GET2(slot, 0);

+

+          if (type == '>') goto HANDLE_RECURSION;  /* A few lines below */

+

+          /* Back reference */

+

+          previous = code;

+          *code++ = OP_REF;

+          PUT2INC(code, 0, recno);

+          cd->backref_map |= (recno < 32)? (1 << recno) : 1;

+          if (recno > cd->top_backref) cd->top_backref = recno;

+          continue;

+          }

+

+        /* Should never happen */

+        break;

+

+        case 'R':                 /* Pattern recursion */

+        ptr++;                    /* Same as (?0)      */

+        /* Fall through */

+

+        /* Recursion or "subroutine" call */

+

+        case '0': case '1': case '2': case '3': case '4':

+        case '5': case '6': case '7': case '8': case '9':

+          {

+          const uschar *called;

+          recno = 0;

+          while((digitab[*ptr] & ctype_digit) != 0)

+            recno = recno * 10 + *ptr++ - '0';

+

+          /* Come here from code above that handles a named recursion */

+

+          HANDLE_RECURSION:

+

+          previous = code;

+

+          /* Find the bracket that is being referenced. Temporarily end the

+          regex in case it doesn't exist. */

+

+          *code = OP_END;

+          called = (recno == 0)?

+            cd->start_code : find_bracket(cd->start_code, utf8, recno);

+

+          if (called == NULL)

+            {

+            *errorcodeptr = ERR15;

+            goto FAILED;

+            }

+

+          /* If the subpattern is still open, this is a recursive call. We

+          check to see if this is a left recursion that could loop for ever,

+          and diagnose that case. */

+

+          if (GET(called, 1) == 0 && could_be_empty(called, code, bcptr, utf8))

+            {

+            *errorcodeptr = ERR40;

+            goto FAILED;

+            }

+

+          /* Insert the recursion/subroutine item */

+

+          *code = OP_RECURSE;

+          PUT(code, 1, called - cd->start_code);

+          code += 1 + LINK_SIZE;

+          }

+        continue;

+

+        /* Character after (? not specially recognized */

+

+        default:                  /* Option setting */

+        set = unset = 0;

+        optset = &set;

+

+        while (*ptr != ')' && *ptr != ':')

+          {

+          switch (*ptr++)

+            {

+            case '-': optset = &unset; break;

+

+            case 'i': *optset |= PCRE_CASELESS; break;

+            case 'm': *optset |= PCRE_MULTILINE; break;

+            case 's': *optset |= PCRE_DOTALL; break;

+            case 'x': *optset |= PCRE_EXTENDED; break;

+            case 'U': *optset |= PCRE_UNGREEDY; break;

+            case 'X': *optset |= PCRE_EXTRA; break;

+            }

+          }

+

+        /* Set up the changed option bits, but don't change anything yet. */

+

+        newoptions = (options | set) & (~unset);

+

+        /* If the options ended with ')' this is not the start of a nested

+        group with option changes, so the options change at this level. Compile

+        code to change the ims options if this setting actually changes any of

+        them. We also pass the new setting back so that it can be put at the

+        start of any following branches, and when this group ends (if we are in

+        a group), a resetting item can be compiled.

+

+        Note that if this item is right at the start of the pattern, the

+        options will have been abstracted and made global, so there will be no

+        change to compile. */

+

+        if (*ptr == ')')

+          {

+          if ((options & PCRE_IMS) != (newoptions & PCRE_IMS))

+            {

+            *code++ = OP_OPT;

+            *code++ = newoptions & PCRE_IMS;

+            }

+

+          /* Change options at this level, and pass them back for use

+          in subsequent branches. Reset the greedy defaults and the case

+          value for firstbyte and reqbyte. */

+

+          *optionsptr = options = newoptions;

+          greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);

+          greedy_non_default = greedy_default ^ 1;

+          req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;

+

+          previous = NULL;       /* This item can't be repeated */

+          continue;              /* It is complete */

+          }

+

+        /* If the options ended with ':' we are heading into a nested group

+        with possible change of options. Such groups are non-capturing and are

+        not assertions of any kind. All we need to do is skip over the ':';

+        the newoptions value is handled below. */

+

+        bravalue = OP_BRA;

+        ptr++;

+        }

+      }

+

+    /* If PCRE_NO_AUTO_CAPTURE is set, all unadorned brackets become

+    non-capturing and behave like (?:...) brackets */

+

+    else if ((options & PCRE_NO_AUTO_CAPTURE) != 0)

+      {

+      bravalue = OP_BRA;

+      }

+

+    /* Else we have a referencing group; adjust the opcode. If the bracket

+    number is greater than EXTRACT_BASIC_MAX, we set the opcode one higher, and

+    arrange for the true number to follow later, in an OP_BRANUMBER item. */

+

+    else

+      {

+      NUMBERED_GROUP:

+      if (++(*brackets) > EXTRACT_BASIC_MAX)

+        {

+        bravalue = OP_BRA + EXTRACT_BASIC_MAX + 1;

+        code[1+LINK_SIZE] = OP_BRANUMBER;

+        PUT2(code, 2+LINK_SIZE, *brackets);

+        skipbytes = 3;

+        }

+      else bravalue = OP_BRA + *brackets;

+      }

+

+    /* Process nested bracketed re. Assertions may not be repeated, but other

+    kinds can be. We copy code into a non-register variable in order to be able

+    to pass its address because some compilers complain otherwise. Pass in a

+    new setting for the ims options if they have changed. */

+

+    previous = (bravalue >= OP_ONCE)? code : NULL;

+    *code = bravalue;

+    tempcode = code;

+    tempreqvary = cd->req_varyopt;     /* Save value before bracket */

+

+    if (!compile_regex(

+         newoptions,                   /* The complete new option state */

+         options & PCRE_IMS,           /* The previous ims option state */

+         brackets,                     /* Extracting bracket count */

+         &tempcode,                    /* Where to put code (updated) */

+         &ptr,                         /* Input pointer (updated) */

+         errorcodeptr,                 /* Where to put an error message */

+         (bravalue == OP_ASSERTBACK ||

+          bravalue == OP_ASSERTBACK_NOT), /* TRUE if back assert */

+         skipbytes,                    /* Skip over OP_COND/OP_BRANUMBER */

+         &subfirstbyte,                /* For possible first char */

+         &subreqbyte,                  /* For possible last char */

+         bcptr,                        /* Current branch chain */

+         cd))                          /* Tables block */

+      goto FAILED;

+

+    /* At the end of compiling, code is still pointing to the start of the

+    group, while tempcode has been updated to point past the end of the group

+    and any option resetting that may follow it. The pattern pointer (ptr)

+    is on the bracket. */

+

+    /* If this is a conditional bracket, check that there are no more than

+    two branches in the group. */

+

+    else if (bravalue == OP_COND)

+      {

+      uschar *tc = code;

+      condcount = 0;

+

+      do {

+         condcount++;

+         tc += GET(tc,1);

+         }

+      while (*tc != OP_KET);

+

+      if (condcount > 2)

+        {

+        *errorcodeptr = ERR27;

+        goto FAILED;

+        }

+

+      /* If there is just one branch, we must not make use of its firstbyte or

+      reqbyte, because this is equivalent to an empty second branch. */

+

+      if (condcount == 1) subfirstbyte = subreqbyte = REQ_NONE;

+      }

+

+    /* Handle updating of the required and first characters. Update for normal

+    brackets of all kinds, and conditions with two branches (see code above).

+    If the bracket is followed by a quantifier with zero repeat, we have to

+    back off. Hence the definition of zeroreqbyte and zerofirstbyte outside the

+    main loop so that they can be accessed for the back off. */

+

+    zeroreqbyte = reqbyte;

+    zerofirstbyte = firstbyte;

+    groupsetfirstbyte = FALSE;

+

+    if (bravalue >= OP_BRA || bravalue == OP_ONCE || bravalue == OP_COND)

+      {

+      /* If we have not yet set a firstbyte in this branch, take it from the

+      subpattern, remembering that it was set here so that a repeat of more

+      than one can replicate it as reqbyte if necessary. If the subpattern has

+      no firstbyte, set "none" for the whole branch. In both cases, a zero

+      repeat forces firstbyte to "none". */

+

+      if (firstbyte == REQ_UNSET)

+        {

+        if (subfirstbyte >= 0)

+          {

+          firstbyte = subfirstbyte;

+          groupsetfirstbyte = TRUE;

+          }

+        else firstbyte = REQ_NONE;

+        zerofirstbyte = REQ_NONE;

+        }

+

+      /* If firstbyte was previously set, convert the subpattern's firstbyte

+      into reqbyte if there wasn't one, using the vary flag that was in

+      existence beforehand. */

+

+      else if (subfirstbyte >= 0 && subreqbyte < 0)

+        subreqbyte = subfirstbyte | tempreqvary;

+

+      /* If the subpattern set a required byte (or set a first byte that isn't

+      really the first byte - see above), set it. */

+

+      if (subreqbyte >= 0) reqbyte = subreqbyte;

+      }

+

+    /* For a forward assertion, we take the reqbyte, if set. This can be

+    helpful if the pattern that follows the assertion doesn't set a different

+    char. For example, it's useful for /(?=abcde).+/. We can't set firstbyte

+    for an assertion, however because it leads to incorrect effect for patterns

+    such as /(?=a)a.+/ when the "real" "a" would then become a reqbyte instead

+    of a firstbyte. This is overcome by a scan at the end if there's no

+    firstbyte, looking for an asserted first char. */

+

+    else if (bravalue == OP_ASSERT && subreqbyte >= 0) reqbyte = subreqbyte;

+

+    /* Now update the main code pointer to the end of the group. */

+

+    code = tempcode;

+

+    /* Error if hit end of pattern */

+

+    if (*ptr != ')')

+      {

+      *errorcodeptr = ERR14;

+      goto FAILED;

+      }

+    break;

+

+    /* Check \ for being a real metacharacter; if not, fall through and handle

+    it as a data character at the start of a string. Escape items are checked

+    for validity in the pre-compiling pass. */

+

+    case '\\':

+    tempptr = ptr;

+    c = check_escape(&ptr, errorcodeptr, *brackets, options, FALSE);

+

+    /* Handle metacharacters introduced by \. For ones like \d, the ESC_ values

+    are arranged to be the negation of the corresponding OP_values. For the

+    back references, the values are ESC_REF plus the reference number. Only

+    back references and those types that consume a character may be repeated.

+    We can test for values between ESC_b and ESC_Z for the latter; this may

+    have to change if any new ones are ever created. */

+

+    if (c < 0)

+      {

+      if (-c == ESC_Q)            /* Handle start of quoted string */

+        {

+        if (ptr[1] == '\\' && ptr[2] == 'E') ptr += 2; /* avoid empty string */

+          else inescq = TRUE;

+        continue;

+        }

+

+      /* For metasequences that actually match a character, we disable the

+      setting of a first character if it hasn't already been set. */

+

+      if (firstbyte == REQ_UNSET && -c > ESC_b && -c < ESC_Z)

+        firstbyte = REQ_NONE;

+

+      /* Set values to reset to if this is followed by a zero repeat. */

+

+      zerofirstbyte = firstbyte;

+      zeroreqbyte = reqbyte;

+

+      /* Back references are handled specially */

+

+      if (-c >= ESC_REF)

+        {

+        int number = -c - ESC_REF;

+        previous = code;

+        *code++ = OP_REF;

+        PUT2INC(code, 0, number);

+        }

+

+      /* So are Unicode property matches, if supported. We know that get_ucp

+      won't fail because it was tested in the pre-pass. */

+

+#ifdef SUPPORT_UCP

+      else if (-c == ESC_P || -c == ESC_p)

+        {

+        BOOL negated;

+        int value = get_ucp(&ptr, &negated, errorcodeptr);

+        previous = code;

+        *code++ = ((-c == ESC_p) != negated)? OP_PROP : OP_NOTPROP;

+        *code++ = value;

+        }

+#endif

+

+      /* For the rest, we can obtain the OP value by negating the escape

+      value */

+

+      else

+        {

+        previous = (-c > ESC_b && -c < ESC_Z)? code : NULL;

+        *code++ = -c;

+        }

+      continue;

+      }

+

+    /* We have a data character whose value is in c. In UTF-8 mode it may have

+    a value > 127. We set its representation in the length/buffer, and then

+    handle it as a data character. */

+

+#ifdef SUPPORT_UTF8

+    if (utf8 && c > 127)

+      mclength = _pcre_ord2utf8(c, mcbuffer);

+    else

+#endif

+

+     {

+     mcbuffer[0] = c;

+     mclength = 1;

+     }

+

+    goto ONE_CHAR;

+

+    /* Handle a literal character. It is guaranteed not to be whitespace or #

+    when the extended flag is set. If we are in UTF-8 mode, it may be a

+    multi-byte literal character. */

+

+    default:

+    NORMAL_CHAR:

+    mclength = 1;

+    mcbuffer[0] = c;

+

+#ifdef SUPPORT_UTF8

+    if (utf8 && (c & 0xc0) == 0xc0)

+      {

+      while ((ptr[1] & 0xc0) == 0x80)

+        mcbuffer[mclength++] = *(++ptr);

+      }

+#endif

+

+    /* At this point we have the character's bytes in mcbuffer, and the length

+    in mclength. When not in UTF-8 mode, the length is always 1. */

+

+    ONE_CHAR:

+    previous = code;

+    *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARNC : OP_CHAR;

+    for (c = 0; c < mclength; c++) *code++ = mcbuffer[c];

+

+    /* Set the first and required bytes appropriately. If no previous first

+    byte, set it from this character, but revert to none on a zero repeat.

+    Otherwise, leave the firstbyte value alone, and don't change it on a zero

+    repeat. */

+

+    if (firstbyte == REQ_UNSET)

+      {

+      zerofirstbyte = REQ_NONE;

+      zeroreqbyte = reqbyte;

+

+      /* If the character is more than one byte long, we can set firstbyte

+      only if it is not to be matched caselessly. */

+

+      if (mclength == 1 || req_caseopt == 0)

+        {

+        firstbyte = mcbuffer[0] | req_caseopt;

+        if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt;

+        }

+      else firstbyte = reqbyte = REQ_NONE;

+      }

+

+    /* firstbyte was previously set; we can set reqbyte only the length is

+    1 or the matching is caseful. */

+

+    else

+      {

+      zerofirstbyte = firstbyte;

+      zeroreqbyte = reqbyte;

+      if (mclength == 1 || req_caseopt == 0)

+        reqbyte = code[-1] | req_caseopt | cd->req_varyopt;

+      }

+

+    break;            /* End of literal character handling */

+    }

+  }                   /* end of big loop */

+

+/* Control never reaches here by falling through, only by a goto for all the

+error states. Pass back the position in the pattern so that it can be displayed

+to the user for diagnosing the error. */

+

+FAILED:

+*ptrptr = ptr;

+return FALSE;

+}

+

+

+

+

+/*************************************************

+*     Compile sequence of alternatives           *

+*************************************************/

+

+/* On entry, ptr is pointing past the bracket character, but on return

+it points to the closing bracket, or vertical bar, or end of string.

+The code variable is pointing at the byte into which the BRA operator has been

+stored. If the ims options are changed at the start (for a (?ims: group) or

+during any branch, we need to insert an OP_OPT item at the start of every

+following branch to ensure they get set correctly at run time, and also pass

+the new options into every subsequent branch compile.

+

+Argument:

+  options        option bits, including any changes for this subpattern

+  oldims         previous settings of ims option bits

+  brackets       -> int containing the number of extracting brackets used

+  codeptr        -> the address of the current code pointer

+  ptrptr         -> the address of the current pattern pointer

+  errorcodeptr   -> pointer to error code variable

+  lookbehind     TRUE if this is a lookbehind assertion

+  skipbytes      skip this many bytes at start (for OP_COND, OP_BRANUMBER)

+  firstbyteptr   place to put the first required character, or a negative number

+  reqbyteptr     place to put the last required character, or a negative number

+  bcptr          pointer to the chain of currently open branches

+  cd             points to the data block with tables pointers etc.

+

+Returns:      TRUE on success

+*/

+

+static BOOL

+compile_regex(int options, int oldims, int *brackets, uschar **codeptr,

+  const uschar **ptrptr, int *errorcodeptr, BOOL lookbehind, int skipbytes,

+  int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd)

+{

+const uschar *ptr = *ptrptr;

+uschar *code = *codeptr;

+uschar *last_branch = code;

+uschar *start_bracket = code;

+uschar *reverse_count = NULL;

+int firstbyte, reqbyte;

+int branchfirstbyte, branchreqbyte;

+branch_chain bc;

+

+bc.outer = bcptr;

+bc.current = code;

+

+firstbyte = reqbyte = REQ_UNSET;

+

+/* Offset is set zero to mark that this bracket is still open */

+

+PUT(code, 1, 0);

+code += 1 + LINK_SIZE + skipbytes;

+

+/* Loop for each alternative branch */

+

+for (;;)

+  {

+  /* Handle a change of ims options at the start of the branch */

+

+  if ((options & PCRE_IMS) != oldims)

+    {

+    *code++ = OP_OPT;

+    *code++ = options & PCRE_IMS;

+    }

+

+  /* Set up dummy OP_REVERSE if lookbehind assertion */

+

+  if (lookbehind)

+    {

+    *code++ = OP_REVERSE;

+    reverse_count = code;

+    PUTINC(code, 0, 0);

+    }

+

+  /* Now compile the branch */

+

+  if (!compile_branch(&options, brackets, &code, &ptr, errorcodeptr,

+        &branchfirstbyte, &branchreqbyte, &bc, cd))

+    {

+    *ptrptr = ptr;

+    return FALSE;

+    }

+

+  /* If this is the first branch, the firstbyte and reqbyte values for the

+  branch become the values for the regex. */

+

+  if (*last_branch != OP_ALT)

+    {

+    firstbyte = branchfirstbyte;

+    reqbyte = branchreqbyte;

+    }

+

+  /* If this is not the first branch, the first char and reqbyte have to

+  match the values from all the previous branches, except that if the previous

+  value for reqbyte didn't have REQ_VARY set, it can still match, and we set

+  REQ_VARY for the regex. */

+

+  else

+    {

+    /* If we previously had a firstbyte, but it doesn't match the new branch,

+    we have to abandon the firstbyte for the regex, but if there was previously

+    no reqbyte, it takes on the value of the old firstbyte. */

+

+    if (firstbyte >= 0 && firstbyte != branchfirstbyte)

+      {

+      if (reqbyte < 0) reqbyte = firstbyte;

+      firstbyte = REQ_NONE;

+      }

+

+    /* If we (now or from before) have no firstbyte, a firstbyte from the

+    branch becomes a reqbyte if there isn't a branch reqbyte. */

+

+    if (firstbyte < 0 && branchfirstbyte >= 0 && branchreqbyte < 0)

+        branchreqbyte = branchfirstbyte;

+

+    /* Now ensure that the reqbytes match */

+

+    if ((reqbyte & ~REQ_VARY) != (branchreqbyte & ~REQ_VARY))

+      reqbyte = REQ_NONE;

+    else reqbyte |= branchreqbyte;   /* To "or" REQ_VARY */

+    }

+

+  /* If lookbehind, check that this branch matches a fixed-length string,

+  and put the length into the OP_REVERSE item. Temporarily mark the end of

+  the branch with OP_END. */

+

+  if (lookbehind)

+    {

+    int length;

+    *code = OP_END;

+    length = find_fixedlength(last_branch, options);

+    DPRINTF(("fixed length = %d\n", length));

+    if (length < 0)

+      {

+      *errorcodeptr = (length == -2)? ERR36 : ERR25;

+      *ptrptr = ptr;

+      return FALSE;

+      }

+    PUT(reverse_count, 0, length);

+    }

+

+  /* Reached end of expression, either ')' or end of pattern. Go back through

+  the alternative branches and reverse the chain of offsets, with the field in

+  the BRA item now becoming an offset to the first alternative. If there are

+  no alternatives, it points to the end of the group. The length in the

+  terminating ket is always the length of the whole bracketed item. If any of

+  the ims options were changed inside the group, compile a resetting op-code

+  following, except at the very end of the pattern. Return leaving the pointer

+  at the terminating char. */

+

+  if (*ptr != '|')

+    {

+    int length = code - last_branch;

+    do

+      {

+      int prev_length = GET(last_branch, 1);

+      PUT(last_branch, 1, length);

+      length = prev_length;

+      last_branch -= length;

+      }

+    while (length > 0);

+

+    /* Fill in the ket */

+

+    *code = OP_KET;

+    PUT(code, 1, code - start_bracket);

+    code += 1 + LINK_SIZE;

+

+    /* Resetting option if needed */

+

+    if ((options & PCRE_IMS) != oldims && *ptr == ')')

+      {

+      *code++ = OP_OPT;

+      *code++ = oldims;

+      }

+

+    /* Set values to pass back */

+

+    *codeptr = code;

+    *ptrptr = ptr;

+    *firstbyteptr = firstbyte;

+    *reqbyteptr = reqbyte;

+    return TRUE;

+    }

+

+  /* Another branch follows; insert an "or" node. Its length field points back

+  to the previous branch while the bracket remains open. At the end the chain

+  is reversed. It's done like this so that the start of the bracket has a

+  zero offset until it is closed, making it possible to detect recursion. */

+

+  *code = OP_ALT;

+  PUT(code, 1, code - last_branch);

+  bc.current = last_branch = code;

+  code += 1 + LINK_SIZE;

+  ptr++;

+  }

+/* Control never reaches here */

+}

+

+

+

+

+/*************************************************

+*          Check for anchored expression         *

+*************************************************/

+

+/* Try to find out if this is an anchored regular expression. Consider each

+alternative branch. If they all start with OP_SOD or OP_CIRC, or with a bracket

+all of whose alternatives start with OP_SOD or OP_CIRC (recurse ad lib), then

+it's anchored. However, if this is a multiline pattern, then only OP_SOD

+counts, since OP_CIRC can match in the middle.

+

+We can also consider a regex to be anchored if OP_SOM starts all its branches.

+This is the code for \G, which means "match at start of match position, taking

+into account the match offset".

+

+A branch is also implicitly anchored if it starts with .* and DOTALL is set,

+because that will try the rest of the pattern at all possible matching points,

+so there is no point trying again.... er ....

+

+.... except when the .* appears inside capturing parentheses, and there is a

+subsequent back reference to those parentheses. We haven't enough information

+to catch that case precisely.

+

+At first, the best we could do was to detect when .* was in capturing brackets

+and the highest back reference was greater than or equal to that level.

+However, by keeping a bitmap of the first 31 back references, we can catch some

+of the more common cases more precisely.

+

+Arguments:

+  code           points to start of expression (the bracket)

+  options        points to the options setting

+  bracket_map    a bitmap of which brackets we are inside while testing; this

+                  handles up to substring 31; after that we just have to take

+                  the less precise approach

+  backref_map    the back reference bitmap

+

+Returns:     TRUE or FALSE

+*/

+

+static BOOL

+is_anchored(register const uschar *code, int *options, unsigned int bracket_map,

+  unsigned int backref_map)

+{

+do {

+   const uschar *scode =

+     first_significant_code(code + 1+LINK_SIZE, options, PCRE_MULTILINE, FALSE);

+   register int op = *scode;

+

+   /* Capturing brackets */

+

+   if (op > OP_BRA)

+     {

+     int new_map;

+     op -= OP_BRA;

+     if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE);

+     new_map = bracket_map | ((op < 32)? (1 << op) : 1);

+     if (!is_anchored(scode, options, new_map, backref_map)) return FALSE;

+     }

+

+   /* Other brackets */

+

+   else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND)

+     {

+     if (!is_anchored(scode, options, bracket_map, backref_map)) return FALSE;

+     }

+

+   /* .* is not anchored unless DOTALL is set and it isn't in brackets that

+   are or may be referenced. */

+

+   else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) &&

+            (*options & PCRE_DOTALL) != 0)

+     {

+     if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE;

+     }

+

+   /* Check for explicit anchoring */

+

+   else if (op != OP_SOD && op != OP_SOM &&

+           ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC))

+     return FALSE;

+   code += GET(code, 1);

+   }

+while (*code == OP_ALT);   /* Loop for each alternative */

+return TRUE;

+}

+

+

+

+/*************************************************

+*         Check for starting with ^ or .*        *

+*************************************************/

+

+/* This is called to find out if every branch starts with ^ or .* so that

+"first char" processing can be done to speed things up in multiline

+matching and for non-DOTALL patterns that start with .* (which must start at

+the beginning or after \n). As in the case of is_anchored() (see above), we

+have to take account of back references to capturing brackets that contain .*

+because in that case we can't make the assumption.

+

+Arguments:

+  code           points to start of expression (the bracket)

+  bracket_map    a bitmap of which brackets we are inside while testing; this

+                  handles up to substring 31; after that we just have to take

+                  the less precise approach

+  backref_map    the back reference bitmap

+

+Returns:         TRUE or FALSE

+*/

+

+static BOOL

+is_startline(const uschar *code, unsigned int bracket_map,

+  unsigned int backref_map)

+{

+do {

+   const uschar *scode = first_significant_code(code + 1+LINK_SIZE, NULL, 0,

+     FALSE);

+   register int op = *scode;

+

+   /* Capturing brackets */

+

+   if (op > OP_BRA)

+     {

+     int new_map;

+     op -= OP_BRA;

+     if (op > EXTRACT_BASIC_MAX) op = GET2(scode, 2+LINK_SIZE);

+     new_map = bracket_map | ((op < 32)? (1 << op) : 1);

+     if (!is_startline(scode, new_map, backref_map)) return FALSE;

+     }

+

+   /* Other brackets */

+

+   else if (op == OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND)

+     { if (!is_startline(scode, bracket_map, backref_map)) return FALSE; }

+

+   /* .* means "start at start or after \n" if it isn't in brackets that

+   may be referenced. */

+

+   else if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR)

+     {

+     if (scode[1] != OP_ANY || (bracket_map & backref_map) != 0) return FALSE;

+     }

+

+   /* Check for explicit circumflex */

+

+   else if (op != OP_CIRC) return FALSE;

+

+   /* Move on to the next alternative */

+

+   code += GET(code, 1);

+   }

+while (*code == OP_ALT);  /* Loop for each alternative */

+return TRUE;

+}

+

+

+

+/*************************************************

+*       Check for asserted fixed first char      *

+*************************************************/

+

+/* During compilation, the "first char" settings from forward assertions are

+discarded, because they can cause conflicts with actual literals that follow.

+However, if we end up without a first char setting for an unanchored pattern,

+it is worth scanning the regex to see if there is an initial asserted first

+char. If all branches start with the same asserted char, or with a bracket all

+of whose alternatives start with the same asserted char (recurse ad lib), then

+we return that char, otherwise -1.

+

+Arguments:

+  code       points to start of expression (the bracket)

+  options    pointer to the options (used to check casing changes)

+  inassert   TRUE if in an assertion

+

+Returns:     -1 or the fixed first char

+*/

+

+static int

+find_firstassertedchar(const uschar *code, int *options, BOOL inassert)

+{

+register int c = -1;

+do {

+   int d;

+   const uschar *scode =

+     first_significant_code(code + 1+LINK_SIZE, options, PCRE_CASELESS, TRUE);

+   register int op = *scode;

+

+   if (op >= OP_BRA) op = OP_BRA;

+

+   switch(op)

+     {

+     default:

+     return -1;

+

+     case OP_BRA:

+     case OP_ASSERT:

+     case OP_ONCE:

+     case OP_COND:

+     if ((d = find_firstassertedchar(scode, options, op == OP_ASSERT)) < 0)

+       return -1;

+     if (c < 0) c = d; else if (c != d) return -1;

+     break;

+

+     case OP_EXACT:       /* Fall through */

+     scode += 2;

+

+     case OP_CHAR:

+     case OP_CHARNC:

+     case OP_PLUS:

+     case OP_MINPLUS:

+     if (!inassert) return -1;

+     if (c < 0)

+       {

+       c = scode[1];

+       if ((*options & PCRE_CASELESS) != 0) c |= REQ_CASELESS;

+       }

+     else if (c != scode[1]) return -1;

+     break;

+     }

+

+   code += GET(code, 1);

+   }

+while (*code == OP_ALT);

+return c;

+}

+

+

+

+/*************************************************

+*        Compile a Regular Expression            *

+*************************************************/

+

+/* This function takes a string and returns a pointer to a block of store

+holding a compiled version of the expression. The original API for this

+function had no error code return variable; it is retained for backwards

+compatibility. The new function is given a new name.

+

+Arguments:

+  pattern       the regular expression

+  options       various option bits

+  errorcodeptr  pointer to error code variable (pcre_compile2() only)

+                  can be NULL if you don't want a code value

+  errorptr      pointer to pointer to error text

+  erroroffset   ptr offset in pattern where error was detected

+  tables        pointer to character tables or NULL

+

+Returns:        pointer to compiled data block, or NULL on error,

+                with errorptr and erroroffset set

+*/

+

+EXPORT pcre *

+pcre_compile(const char *pattern, int options, const char **errorptr,

+  int *erroroffset, const unsigned char *tables)

+{

+return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables);

+}

+

+

+EXPORT pcre *

+pcre_compile2(const char *pattern, int options, int *errorcodeptr,

+  const char **errorptr, int *erroroffset, const unsigned char *tables)

+{

+real_pcre *re;

+int length = 1 + LINK_SIZE;      /* For initial BRA plus length */

+int c, firstbyte, reqbyte;

+int bracount = 0;

+int branch_extra = 0;

+int branch_newextra;

+int item_count = -1;

+int name_count = 0;

+int max_name_size = 0;

+int lastitemlength = 0;

+int errorcode = 0;

+#ifdef SUPPORT_UTF8

+BOOL utf8;

+BOOL class_utf8;

+#endif

+BOOL inescq = FALSE;

+BOOL capturing;

+unsigned int brastackptr = 0;

+size_t size;

+uschar *code;

+const uschar *codestart;

+const uschar *ptr;

+compile_data compile_block;

+int brastack[BRASTACK_SIZE];

+uschar bralenstack[BRASTACK_SIZE];

+

+/* We can't pass back an error message if errorptr is NULL; I guess the best we

+can do is just return NULL, but we can set a code value if there is a code

+pointer. */

+

+if (errorptr == NULL)

+  {

+  if (errorcodeptr != NULL) *errorcodeptr = 99;

+  return NULL;

+  }

+

+*errorptr = NULL;

+if (errorcodeptr != NULL) *errorcodeptr = ERR0;

+

+/* However, we can give a message for this error */

+

+if (erroroffset == NULL)

+  {

+  errorcode = ERR16;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+

+*erroroffset = 0;

+

+/* Can't support UTF8 unless PCRE has been compiled to include the code. */

+

+#ifdef SUPPORT_UTF8

+utf8 = (options & PCRE_UTF8) != 0;

+if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&

+     (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0)

+  {

+  errorcode = ERR44;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+#else

+if ((options & PCRE_UTF8) != 0)

+  {

+  errorcode = ERR32;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+#endif

+

+if ((options & ~PUBLIC_OPTIONS) != 0)

+  {

+  errorcode = ERR17;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+

+/* Set up pointers to the individual character tables */

+

+if (tables == NULL) tables = _pcre_default_tables;

+compile_block.lcc = tables + lcc_offset;

+compile_block.fcc = tables + fcc_offset;

+compile_block.cbits = tables + cbits_offset;

+compile_block.ctypes = tables + ctypes_offset;

+

+/* Maximum back reference and backref bitmap. This is updated for numeric

+references during the first pass, but for named references during the actual

+compile pass. The bitmap records up to 31 back references to help in deciding

+whether (.*) can be treated as anchored or not. */

+

+compile_block.top_backref = 0;

+compile_block.backref_map = 0;

+

+/* Reflect pattern for debugging output */

+

+DPRINTF(("------------------------------------------------------------------\n"));

+DPRINTF(("%s\n", pattern));

+

+/* The first thing to do is to make a pass over the pattern to compute the

+amount of store required to hold the compiled code. This does not have to be

+perfect as long as errors are overestimates. At the same time we can detect any

+flag settings right at the start, and extract them. Make an attempt to correct

+for any counted white space if an "extended" flag setting appears late in the

+pattern. We can't be so clever for #-comments. */

+

+ptr = (const uschar *)(pattern - 1);

+while ((c = *(++ptr)) != 0)

+  {

+  int min, max;

+  int class_optcount;

+  int bracket_length;

+  int duplength;

+

+  /* If we are inside a \Q...\E sequence, all chars are literal */

+

+  if (inescq)

+    {

+    if ((options & PCRE_AUTO_CALLOUT) != 0) length += 2 + 2*LINK_SIZE;

+    goto NORMAL_CHAR;

+    }

+

+  /* Otherwise, first check for ignored whitespace and comments */

+

+  if ((options & PCRE_EXTENDED) != 0)

+    {

+    if ((compile_block.ctypes[c] & ctype_space) != 0) continue;

+    if (c == '#')

+      {

+      /* The space before the ; is to avoid a warning on a silly compiler

+      on the Macintosh. */

+      while ((c = *(++ptr)) != 0 && c != NEWLINE) ;

+      if (c == 0) break;

+      continue;

+      }

+    }

+

+  item_count++;    /* Is zero for the first non-comment item */

+

+  /* Allow space for auto callout before every item except quantifiers. */

+

+  if ((options & PCRE_AUTO_CALLOUT) != 0 &&

+       c != '*' && c != '+' && c != '?' &&

+       (c != '{' || !is_counted_repeat(ptr + 1)))

+    length += 2 + 2*LINK_SIZE;

+

+  switch(c)

+    {

+    /* A backslashed item may be an escaped data character or it may be a

+    character type. */

+

+    case '\\':

+    c = check_escape(&ptr, &errorcode, bracount, options, FALSE);

+    if (errorcode != 0) goto PCRE_ERROR_RETURN;

+

+    lastitemlength = 1;     /* Default length of last item for repeats */

+

+    if (c >= 0)             /* Data character */

+      {

+      length += 2;          /* For a one-byte character */

+

+#ifdef SUPPORT_UTF8

+      if (utf8 && c > 127)

+        {

+        int i;

+        for (i = 0; i < _pcre_utf8_table1_size; i++)

+          if (c <= _pcre_utf8_table1[i]) break;

+        length += i;

+        lastitemlength += i;

+        }

+#endif

+

+      continue;

+      }

+

+    /* If \Q, enter "literal" mode */

+

+    if (-c == ESC_Q)

+      {

+      inescq = TRUE;

+      continue;

+      }

+

+    /* \X is supported only if Unicode property support is compiled */

+

+#ifndef SUPPORT_UCP

+    if (-c == ESC_X)

+      {

+      errorcode = ERR45;

+      goto PCRE_ERROR_RETURN;

+      }

+#endif

+

+    /* \P and \p are for Unicode properties, but only when the support has

+    been compiled. Each item needs 2 bytes. */

+

+    else if (-c == ESC_P || -c == ESC_p)

+      {

+#ifdef SUPPORT_UCP

+      BOOL negated;

+      length += 2;

+      lastitemlength = 2;

+      if (get_ucp(&ptr, &negated, &errorcode) < 0) goto PCRE_ERROR_RETURN;

+      continue;

+#else

+      errorcode = ERR45;

+      goto PCRE_ERROR_RETURN;

+#endif

+      }

+

+    /* Other escapes need one byte */

+

+    length++;

+

+    /* A back reference needs an additional 2 bytes, plus either one or 5

+    bytes for a repeat. We also need to keep the value of the highest

+    back reference. */

+

+    if (c <= -ESC_REF)

+      {

+      int refnum = -c - ESC_REF;

+      compile_block.backref_map |= (refnum < 32)? (1 << refnum) : 1;

+      if (refnum > compile_block.top_backref)

+        compile_block.top_backref = refnum;

+      length += 2;   /* For single back reference */

+      if (ptr[1] == '{' && is_counted_repeat(ptr+2))

+        {

+        ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode);

+        if (errorcode != 0) goto PCRE_ERROR_RETURN;

+        if ((min == 0 && (max == 1 || max == -1)) ||

+          (min == 1 && max == -1))

+            length++;

+        else length += 5;

+        if (ptr[1] == '?') ptr++;

+        }

+      }

+    continue;

+

+    case '^':     /* Single-byte metacharacters */

+    case '.':

+    case '$':

+    length++;

+    lastitemlength = 1;

+    continue;

+

+    case '*':            /* These repeats won't be after brackets; */

+    case '+':            /* those are handled separately */

+    case '?':

+    length++;

+    goto POSESSIVE;      /* A few lines below */

+

+    /* This covers the cases of braced repeats after a single char, metachar,

+    class, or back reference. */

+

+    case '{':

+    if (!is_counted_repeat(ptr+1)) goto NORMAL_CHAR;

+    ptr = read_repeat_counts(ptr+1, &min, &max, &errorcode);

+    if (errorcode != 0) goto PCRE_ERROR_RETURN;

+

+    /* These special cases just insert one extra opcode */

+

+    if ((min == 0 && (max == 1 || max == -1)) ||

+      (min == 1 && max == -1))

+        length++;

+

+    /* These cases might insert additional copies of a preceding character. */

+

+    else

+      {

+      if (min != 1)

+        {

+        length -= lastitemlength;   /* Uncount the original char or metachar */

+        if (min > 0) length += 3 + lastitemlength;

+        }

+      length += lastitemlength + ((max > 0)? 3 : 1);

+      }

+

+    if (ptr[1] == '?') ptr++;      /* Needs no extra length */

+

+    POSESSIVE:                     /* Test for possessive quantifier */

+    if (ptr[1] == '+')

+      {

+      ptr++;

+      length += 2 + 2*LINK_SIZE;   /* Allow for atomic brackets */

+      }

+    continue;

+

+    /* An alternation contains an offset to the next branch or ket. If any ims

+    options changed in the previous branch(es), and/or if we are in a

+    lookbehind assertion, extra space will be needed at the start of the

+    branch. This is handled by branch_extra. */

+

+    case '|':

+    length += 1 + LINK_SIZE + branch_extra;

+    continue;

+

+    /* A character class uses 33 characters provided that all the character

+    values are less than 256. Otherwise, it uses a bit map for low valued

+    characters, and individual items for others. Don't worry about character

+    types that aren't allowed in classes - they'll get picked up during the

+    compile. A character class that contains only one single-byte character

+    uses 2 or 3 bytes, depending on whether it is negated or not. Notice this

+    where we can. (In UTF-8 mode we can do this only for chars < 128.) */

+

+    case '[':

+    if (*(++ptr) == '^')

+      {

+      class_optcount = 10;  /* Greater than one */

+      ptr++;

+      }

+    else class_optcount = 0;

+

+#ifdef SUPPORT_UTF8

+    class_utf8 = FALSE;

+#endif

+

+    /* Written as a "do" so that an initial ']' is taken as data */

+

+    if (*ptr != 0) do

+      {

+      /* Inside \Q...\E everything is literal except \E */

+

+      if (inescq)

+        {

+        if (*ptr != '\\' || ptr[1] != 'E') goto GET_ONE_CHARACTER;

+        inescq = FALSE;

+        ptr += 1;

+        continue;

+        }

+

+      /* Outside \Q...\E, check for escapes */

+

+      if (*ptr == '\\')

+        {

+        c = check_escape(&ptr, &errorcode, bracount, options, TRUE);

+        if (errorcode != 0) goto PCRE_ERROR_RETURN;

+

+        /* \b is backspace inside a class; \X is literal */

+

+        if (-c == ESC_b) c = '\b';

+        else if (-c == ESC_X) c = 'X';

+

+        /* \Q enters quoting mode */

+

+        else if (-c == ESC_Q)

+          {

+          inescq = TRUE;

+          continue;

+          }

+

+        /* Handle escapes that turn into characters */

+

+        if (c >= 0) goto NON_SPECIAL_CHARACTER;

+

+        /* Escapes that are meta-things. The normal ones just affect the

+        bit map, but Unicode properties require an XCLASS extended item. */

+

+        else

+          {

+          class_optcount = 10;         /* \d, \s etc; make sure > 1 */

+#ifdef SUPPORT_UTF8

+          if (-c == ESC_p || -c == ESC_P)

+            {

+            if (!class_utf8)

+              {

+              class_utf8 = TRUE;

+              length += LINK_SIZE + 2;

+              }

+            length += 2;

+            }

+#endif

+          }

+        }

+

+      /* Check the syntax for POSIX stuff. The bits we actually handle are

+      checked during the real compile phase. */

+

+      else if (*ptr == '[' && check_posix_syntax(ptr, &ptr, &compile_block))

+        {

+        ptr++;

+        class_optcount = 10;    /* Make sure > 1 */

+        }

+

+      /* Anything else increments the possible optimization count. We have to

+      detect ranges here so that we can compute the number of extra ranges for

+      caseless wide characters when UCP support is available. If there are wide

+      characters, we are going to have to use an XCLASS, even for single

+      characters. */

+

+      else

+        {

+        int d;

+

+        GET_ONE_CHARACTER:

+

+#ifdef SUPPORT_UTF8

+        if (utf8)

+          {

+          int extra = 0;

+          GETCHARLEN(c, ptr, extra);

+          ptr += extra;

+          }

+        else c = *ptr;

+#else

+        c = *ptr;

+#endif

+

+        /* Come here from handling \ above when it escapes to a char value */

+

+        NON_SPECIAL_CHARACTER:

+        class_optcount++;

+

+        d = -1;

+        if (ptr[1] == '-')

+          {

+          uschar const *hyptr = ptr++;

+          if (ptr[1] == '\\')

+            {

+            ptr++;

+            d = check_escape(&ptr, &errorcode, bracount, options, TRUE);

+            if (errorcode != 0) goto PCRE_ERROR_RETURN;

+            if (-d == ESC_b) d = '\b';        /* backspace */

+            else if (-d == ESC_X) d = 'X';    /* literal X in a class */

+            }

+          else if (ptr[1] != 0 && ptr[1] != ']')

+            {

+            ptr++;

+#ifdef SUPPORT_UTF8

+            if (utf8)

+              {

+              int extra = 0;

+              GETCHARLEN(d, ptr, extra);

+              ptr += extra;

+              }

+            else

+#endif

+            d = *ptr;

+            }

+          if (d < 0) ptr = hyptr;      /* go back to hyphen as data */

+          }

+

+        /* If d >= 0 we have a range. In UTF-8 mode, if the end is > 255, or >

+        127 for caseless matching, we will need to use an XCLASS. */

+

+        if (d >= 0)

+          {

+          class_optcount = 10;     /* Ensure > 1 */

+          if (d < c)

+            {

+            errorcode = ERR8;

+            goto PCRE_ERROR_RETURN;

+            }

+

+#ifdef SUPPORT_UTF8

+          if (utf8 && (d > 255 || ((options & PCRE_CASELESS) != 0 && d > 127)))

+            {

+            uschar buffer[6];

+            if (!class_utf8)         /* Allow for XCLASS overhead */

+              {

+              class_utf8 = TRUE;

+              length += LINK_SIZE + 2;

+              }

+

+#ifdef SUPPORT_UCP

+            /* If we have UCP support, find out how many extra ranges are

+            needed to map the other case of characters within this range. We

+            have to mimic the range optimization here, because extending the

+            range upwards might push d over a boundary that makes is use

+            another byte in the UTF-8 representation. */

+

+            if ((options & PCRE_CASELESS) != 0)

+              {

+              int occ, ocd;

+              int cc = c;

+              int origd = d;

+              while (get_othercase_range(&cc, origd, &occ, &ocd))

+                {

+                if (occ >= c && ocd <= d) continue;   /* Skip embedded */

+

+                if (occ < c  && ocd >= c - 1)  /* Extend the basic range */

+                  {                            /* if there is overlap,   */

+                  c = occ;                     /* noting that if occ < c */

+                  continue;                    /* we can't have ocd > d  */

+                  }                            /* because a subrange is  */

+                if (ocd > d && occ <= d + 1)   /* always shorter than    */

+                  {                            /* the basic range.       */

+                  d = ocd;

+                  continue;

+                  }

+

+                /* An extra item is needed */

+

+                length += 1 + _pcre_ord2utf8(occ, buffer) +

+                  ((occ == ocd)? 0 : _pcre_ord2utf8(ocd, buffer));

+                }

+              }

+#endif  /* SUPPORT_UCP */

+

+            /* The length of the (possibly extended) range */

+

+            length += 1 + _pcre_ord2utf8(c, buffer) + _pcre_ord2utf8(d, buffer);

+            }

+#endif  /* SUPPORT_UTF8 */

+

+          }

+

+        /* We have a single character. There is nothing to be done unless we

+        are in UTF-8 mode. If the char is > 255, or 127 when caseless, we must

+        allow for an XCL_SINGLE item, doubled for caselessness if there is UCP

+        support. */

+

+        else

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))

+            {

+            uschar buffer[6];

+            class_optcount = 10;     /* Ensure > 1 */

+            if (!class_utf8)         /* Allow for XCLASS overhead */

+              {

+              class_utf8 = TRUE;

+              length += LINK_SIZE + 2;

+              }

+#ifdef SUPPORT_UCP

+            length += (((options & PCRE_CASELESS) != 0)? 2 : 1) *

+              (1 + _pcre_ord2utf8(c, buffer));

+#else   /* SUPPORT_UCP */

+            length += 1 + _pcre_ord2utf8(c, buffer);

+#endif  /* SUPPORT_UCP */

+            }

+#endif  /* SUPPORT_UTF8 */

+          }

+        }

+      }

+    while (*(++ptr) != 0 && (inescq || *ptr != ']')); /* Concludes "do" above */

+

+    if (*ptr == 0)                          /* Missing terminating ']' */

+      {

+      errorcode = ERR6;

+      goto PCRE_ERROR_RETURN;

+      }

+

+    /* We can optimize when there was only one optimizable character. Repeats

+    for positive and negated single one-byte chars are handled by the general

+    code. Here, we handle repeats for the class opcodes. */

+

+    if (class_optcount == 1) length += 3; else

+      {

+      length += 33;

+

+      /* A repeat needs either 1 or 5 bytes. If it is a possessive quantifier,

+      we also need extra for wrapping the whole thing in a sub-pattern. */

+

+      if (*ptr != 0 && ptr[1] == '{' && is_counted_repeat(ptr+2))

+        {

+        ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode);

+        if (errorcode != 0) goto PCRE_ERROR_RETURN;

+        if ((min == 0 && (max == 1 || max == -1)) ||

+          (min == 1 && max == -1))

+            length++;

+        else length += 5;

+        if (ptr[1] == '+')

+          {

+          ptr++;

+          length += 2 + 2*LINK_SIZE;

+          }

+        else if (ptr[1] == '?') ptr++;

+        }

+      }

+    continue;

+

+    /* Brackets may be genuine groups or special things */

+

+    case '(':

+    branch_newextra = 0;

+    bracket_length = 1 + LINK_SIZE;

+    capturing = FALSE;

+

+    /* Handle special forms of bracket, which all start (? */

+

+    if (ptr[1] == '?')

+      {

+      int set, unset;

+      int *optset;

+

+      switch (c = ptr[2])

+        {

+        /* Skip over comments entirely */

+        case '#':

+        ptr += 3;

+        while (*ptr != 0 && *ptr != ')') ptr++;

+        if (*ptr == 0)

+          {

+          errorcode = ERR18;

+          goto PCRE_ERROR_RETURN;

+          }

+        continue;

+

+        /* Non-referencing groups and lookaheads just move the pointer on, and

+        then behave like a non-special bracket, except that they don't increment

+        the count of extracting brackets. Ditto for the "once only" bracket,

+        which is in Perl from version 5.005. */

+

+        case ':':

+        case '=':

+        case '!':

+        case '>':

+        ptr += 2;

+        break;

+

+        /* (?R) specifies a recursive call to the regex, which is an extension

+        to provide the facility which can be obtained by (?p{perl-code}) in

+        Perl 5.6. In Perl 5.8 this has become (??{perl-code}).

+

+        From PCRE 4.00, items such as (?3) specify subroutine-like "calls" to

+        the appropriate numbered brackets. This includes both recursive and

+        non-recursive calls. (?R) is now synonymous with (?0). */

+

+        case 'R':

+        ptr++;

+

+        case '0': case '1': case '2': case '3': case '4':

+        case '5': case '6': case '7': case '8': case '9':

+        ptr += 2;

+        if (c != 'R')

+          while ((digitab[*(++ptr)] & ctype_digit) != 0);

+        if (*ptr != ')')

+          {

+          errorcode = ERR29;

+          goto PCRE_ERROR_RETURN;

+          }

+        length += 1 + LINK_SIZE;

+

+        /* If this item is quantified, it will get wrapped inside brackets so

+        as to use the code for quantified brackets. We jump down and use the

+        code that handles this for real brackets. */

+

+        if (ptr[1] == '+' || ptr[1] == '*' || ptr[1] == '?' || ptr[1] == '{')

+          {

+          length += 2 + 2 * LINK_SIZE;       /* to make bracketed */

+          duplength = 5 + 3 * LINK_SIZE;

+          goto HANDLE_QUANTIFIED_BRACKETS;

+          }

+        continue;

+

+        /* (?C) is an extension which provides "callout" - to provide a bit of

+        the functionality of the Perl (?{...}) feature. An optional number may

+        follow (default is zero). */

+

+        case 'C':

+        ptr += 2;

+        while ((digitab[*(++ptr)] & ctype_digit) != 0);

+        if (*ptr != ')')

+          {

+          errorcode = ERR39;

+          goto PCRE_ERROR_RETURN;

+          }

+        length += 2 + 2*LINK_SIZE;

+        continue;

+

+        /* Named subpatterns are an extension copied from Python */

+

+        case 'P':

+        ptr += 3;

+

+        /* Handle the definition of a named subpattern */

+

+        if (*ptr == '<')

+          {

+          const uschar *p;    /* Don't amalgamate; some compilers */

+          p = ++ptr;          /* grumble at autoincrement in declaration */

+          while ((compile_block.ctypes[*ptr] & ctype_word) != 0) ptr++;

+          if (*ptr != '>')

+            {

+            errorcode = ERR42;

+            goto PCRE_ERROR_RETURN;

+            }

+          name_count++;

+          if (ptr - p > max_name_size) max_name_size = (ptr - p);

+          capturing = TRUE;   /* Named parentheses are always capturing */

+          break;

+          }

+

+        /* Handle back references and recursive calls to named subpatterns */

+

+        if (*ptr == '=' || *ptr == '>')

+          {

+          while ((compile_block.ctypes[*(++ptr)] & ctype_word) != 0);

+          if (*ptr != ')')

+            {

+            errorcode = ERR42;

+            goto PCRE_ERROR_RETURN;

+            }

+          break;

+          }

+

+        /* Unknown character after (?P */

+

+        errorcode = ERR41;

+        goto PCRE_ERROR_RETURN;

+

+        /* Lookbehinds are in Perl from version 5.005 */

+

+        case '<':

+        ptr += 3;

+        if (*ptr == '=' || *ptr == '!')

+          {

+          branch_newextra = 1 + LINK_SIZE;

+          length += 1 + LINK_SIZE;         /* For the first branch */

+          break;

+          }

+        errorcode = ERR24;

+        goto PCRE_ERROR_RETURN;

+

+        /* Conditionals are in Perl from version 5.005. The bracket must either

+        be followed by a number (for bracket reference) or by an assertion

+        group, or (a PCRE extension) by 'R' for a recursion test. */

+

+        case '(':

+        if (ptr[3] == 'R' && ptr[4] == ')')

+          {

+          ptr += 4;

+          length += 3;

+          }

+        else if ((digitab[ptr[3]] & ctype_digit) != 0)

+          {

+          ptr += 4;

+          length += 3;

+          while ((digitab[*ptr] & ctype_digit) != 0) ptr++;

+          if (*ptr != ')')

+            {

+            errorcode = ERR26;

+            goto PCRE_ERROR_RETURN;

+            }

+          }

+        else   /* An assertion must follow */

+          {

+          ptr++;   /* Can treat like ':' as far as spacing is concerned */

+          if (ptr[2] != '?' ||

+             (ptr[3] != '=' && ptr[3] != '!' && ptr[3] != '<') )

+            {

+            ptr += 2;    /* To get right offset in message */

+            errorcode = ERR28;

+            goto PCRE_ERROR_RETURN;

+            }

+          }

+        break;

+

+        /* Else loop checking valid options until ) is met. Anything else is an

+        error. If we are without any brackets, i.e. at top level, the settings

+        act as if specified in the options, so massage the options immediately.

+        This is for backward compatibility with Perl 5.004. */

+

+        default:

+        set = unset = 0;

+        optset = &set;

+        ptr += 2;

+

+        for (;; ptr++)

+          {

+          c = *ptr;

+          switch (c)

+            {

+            case 'i':

+            *optset |= PCRE_CASELESS;

+            continue;

+

+            case 'm':

+            *optset |= PCRE_MULTILINE;

+            continue;

+

+            case 's':

+            *optset |= PCRE_DOTALL;

+            continue;

+

+            case 'x':

+            *optset |= PCRE_EXTENDED;

+            continue;

+

+            case 'X':

+            *optset |= PCRE_EXTRA;

+            continue;

+

+            case 'U':

+            *optset |= PCRE_UNGREEDY;

+            continue;

+

+            case '-':

+            optset = &unset;

+            continue;

+

+            /* A termination by ')' indicates an options-setting-only item; if

+            this is at the very start of the pattern (indicated by item_count

+            being zero), we use it to set the global options. This is helpful

+            when analyzing the pattern for first characters, etc. Otherwise

+            nothing is done here and it is handled during the compiling

+            process.

+

+            We allow for more than one options setting at the start. If such

+            settings do not change the existing options, nothing is compiled.

+            However, we must leave space just in case something is compiled.

+            This can happen for pathological sequences such as (?i)(?-i)

+            because the global options will end up with -i set. The space is

+            small and not significant. (Before I did this there was a reported

+            bug with (?i)(?-i) in a machine-generated pattern.)

+

+            [Historical note: Up to Perl 5.8, options settings at top level

+            were always global settings, wherever they appeared in the pattern.

+            That is, they were equivalent to an external setting. From 5.8

+            onwards, they apply only to what follows (which is what you might

+            expect).] */

+

+            case ')':

+            if (item_count == 0)

+              {

+              options = (options | set) & (~unset);

+              set = unset = 0;     /* To save length */

+              item_count--;        /* To allow for several */

+              length += 2;

+              }

+

+            /* Fall through */

+

+            /* A termination by ':' indicates the start of a nested group with

+            the given options set. This is again handled at compile time, but

+            we must allow for compiled space if any of the ims options are

+            set. We also have to allow for resetting space at the end of

+            the group, which is why 4 is added to the length and not just 2.

+            If there are several changes of options within the same group, this

+            will lead to an over-estimate on the length, but this shouldn't

+            matter very much. We also have to allow for resetting options at

+            the start of any alternations, which we do by setting

+            branch_newextra to 2. Finally, we record whether the case-dependent

+            flag ever changes within the regex. This is used by the "required

+            character" code. */

+

+            case ':':

+            if (((set|unset) & PCRE_IMS) != 0)

+              {

+              length += 4;

+              branch_newextra = 2;

+              if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED;

+              }

+            goto END_OPTIONS;

+

+            /* Unrecognized option character */

+

+            default:

+            errorcode = ERR12;

+            goto PCRE_ERROR_RETURN;

+            }

+          }

+

+        /* If we hit a closing bracket, that's it - this is a freestanding

+        option-setting. We need to ensure that branch_extra is updated if

+        necessary. The only values branch_newextra can have here are 0 or 2.

+        If the value is 2, then branch_extra must either be 2 or 5, depending

+        on whether this is a lookbehind group or not. */

+

+        END_OPTIONS:

+        if (c == ')')

+          {

+          if (branch_newextra == 2 &&

+              (branch_extra == 0 || branch_extra == 1+LINK_SIZE))

+            branch_extra += branch_newextra;

+          continue;

+          }

+

+        /* If options were terminated by ':' control comes here. This is a

+        non-capturing group with an options change. There is nothing more that

+        needs to be done because "capturing" is already set FALSE by default;

+        we can just fall through. */

+

+        }

+      }

+

+    /* Ordinary parentheses, not followed by '?', are capturing unless

+    PCRE_NO_AUTO_CAPTURE is set. */

+

+    else capturing = (options & PCRE_NO_AUTO_CAPTURE) == 0;

+

+    /* Capturing brackets must be counted so we can process escapes in a

+    Perlish way. If the number exceeds EXTRACT_BASIC_MAX we are going to need

+    an additional 3 bytes of memory per capturing bracket. */

+

+    if (capturing)

+      {

+      bracount++;

+      if (bracount > EXTRACT_BASIC_MAX) bracket_length += 3;

+      }

+

+    /* Save length for computing whole length at end if there's a repeat that

+    requires duplication of the group. Also save the current value of

+    branch_extra, and start the new group with the new value. If non-zero, this

+    will either be 2 for a (?imsx: group, or 3 for a lookbehind assertion. */

+

+    if (brastackptr >= sizeof(brastack)/sizeof(int))

+      {

+      errorcode = ERR19;

+      goto PCRE_ERROR_RETURN;

+      }

+

+    bralenstack[brastackptr] = branch_extra;

+    branch_extra = branch_newextra;

+

+    brastack[brastackptr++] = length;

+    length += bracket_length;

+    continue;

+

+    /* Handle ket. Look for subsequent max/min; for certain sets of values we

+    have to replicate this bracket up to that many times. If brastackptr is

+    0 this is an unmatched bracket which will generate an error, but take care

+    not to try to access brastack[-1] when computing the length and restoring

+    the branch_extra value. */

+

+    case ')':

+    length += 1 + LINK_SIZE;

+    if (brastackptr > 0)

+      {

+      duplength = length - brastack[--brastackptr];

+      branch_extra = bralenstack[brastackptr];

+      }

+    else duplength = 0;

+

+    /* The following code is also used when a recursion such as (?3) is

+    followed by a quantifier, because in that case, it has to be wrapped inside

+    brackets so that the quantifier works. The value of duplength must be

+    set before arrival. */

+

+    HANDLE_QUANTIFIED_BRACKETS:

+

+    /* Leave ptr at the final char; for read_repeat_counts this happens

+    automatically; for the others we need an increment. */

+

+    if ((c = ptr[1]) == '{' && is_counted_repeat(ptr+2))

+      {

+      ptr = read_repeat_counts(ptr+2, &min, &max, &errorcode);

+      if (errorcode != 0) goto PCRE_ERROR_RETURN;

+      }

+    else if (c == '*') { min = 0; max = -1; ptr++; }

+    else if (c == '+') { min = 1; max = -1; ptr++; }

+    else if (c == '?') { min = 0; max = 1;  ptr++; }

+    else { min = 1; max = 1; }

+

+    /* If the minimum is zero, we have to allow for an OP_BRAZERO before the

+    group, and if the maximum is greater than zero, we have to replicate

+    maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting

+    bracket set. */

+

+    if (min == 0)

+      {

+      length++;

+      if (max > 0) length += (max - 1) * (duplength + 3 + 2*LINK_SIZE);

+      }

+

+    /* When the minimum is greater than zero, we have to replicate up to

+    minval-1 times, with no additions required in the copies. Then, if there

+    is a limited maximum we have to replicate up to maxval-1 times allowing

+    for a BRAZERO item before each optional copy and nesting brackets for all

+    but one of the optional copies. */

+

+    else

+      {

+      length += (min - 1) * duplength;

+      if (max > min)   /* Need this test as max=-1 means no limit */

+        length += (max - min) * (duplength + 3 + 2*LINK_SIZE)

+          - (2 + 2*LINK_SIZE);

+      }

+

+    /* Allow space for once brackets for "possessive quantifier" */

+

+    if (ptr[1] == '+')

+      {

+      ptr++;

+      length += 2 + 2*LINK_SIZE;

+      }

+    continue;

+

+    /* Non-special character. It won't be space or # in extended mode, so it is

+    always a genuine character. If we are in a \Q...\E sequence, check for the

+    end; if not, we have a literal. */

+

+    default:

+    NORMAL_CHAR:

+

+    if (inescq && c == '\\' && ptr[1] == 'E')

+      {

+      inescq = FALSE;

+      ptr++;

+      continue;

+      }

+

+    length += 2;          /* For a one-byte character */

+    lastitemlength = 1;   /* Default length of last item for repeats */

+

+    /* In UTF-8 mode, check for additional bytes. */

+

+#ifdef SUPPORT_UTF8

+    if (utf8 && (c & 0xc0) == 0xc0)

+      {

+      while ((ptr[1] & 0xc0) == 0x80)         /* Can't flow over the end */

+        {                                     /* because the end is marked */

+        lastitemlength++;                     /* by a zero byte. */

+        length++;

+        ptr++;

+        }

+      }

+#endif

+

+    continue;

+    }

+  }

+

+length += 2 + LINK_SIZE;    /* For final KET and END */

+

+if ((options & PCRE_AUTO_CALLOUT) != 0)

+  length += 2 + 2*LINK_SIZE;  /* For final callout */

+

+if (length > MAX_PATTERN_SIZE)

+  {

+  errorcode = ERR20;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+

+/* Compute the size of data block needed and get it, either from malloc or

+externally provided function. */

+

+size = length + sizeof(real_pcre) + name_count * (max_name_size + 3);

+re = (real_pcre *)(pcre_malloc)(size);

+

+if (re == NULL)

+  {

+  errorcode = ERR21;

+  goto PCRE_EARLY_ERROR_RETURN;

+  }

+

+/* Put in the magic number, and save the sizes, options, and character table

+pointer. NULL is used for the default character tables. The nullpad field is at

+the end; it's there to help in the case when a regex compiled on a system with

+4-byte pointers is run on another with 8-byte pointers. */

+

+re->magic_number = MAGIC_NUMBER;

+re->size = size;

+re->options = options;

+re->dummy1 = 0;

+re->name_table_offset = sizeof(real_pcre);

+re->name_entry_size = max_name_size + 3;

+re->name_count = name_count;

+re->ref_count = 0;

+re->tables = (tables == _pcre_default_tables)? NULL : tables;

+re->nullpad = NULL;

+

+/* The starting points of the name/number translation table and of the code are

+passed around in the compile data block. */

+

+compile_block.names_found = 0;

+compile_block.name_entry_size = max_name_size + 3;

+compile_block.name_table = (uschar *)re + re->name_table_offset;

+codestart = compile_block.name_table + re->name_entry_size * re->name_count;

+compile_block.start_code = codestart;

+compile_block.start_pattern = (const uschar *)pattern;

+compile_block.req_varyopt = 0;

+compile_block.nopartial = FALSE;

+

+/* Set up a starting, non-extracting bracket, then compile the expression. On

+error, errorcode will be set non-zero, so we don't need to look at the result

+of the function here. */

+

+ptr = (const uschar *)pattern;

+code = (uschar *)codestart;

+*code = OP_BRA;

+bracount = 0;

+(void)compile_regex(options, options & PCRE_IMS, &bracount, &code, &ptr,

+  &errorcode, FALSE, 0, &firstbyte, &reqbyte, NULL, &compile_block);

+re->top_bracket = bracount;

+re->top_backref = compile_block.top_backref;

+

+if (compile_block.nopartial) re->options |= PCRE_NOPARTIAL;

+

+/* If not reached end of pattern on success, there's an excess bracket. */

+

+if (errorcode == 0 && *ptr != 0) errorcode = ERR22;

+

+/* Fill in the terminating state and check for disastrous overflow, but

+if debugging, leave the test till after things are printed out. */

+

+*code++ = OP_END;

+

+#ifndef DEBUG

+if (code - codestart > length) errorcode = ERR23;

+#endif

+

+/* Give an error if there's back reference to a non-existent capturing

+subpattern. */

+

+if (re->top_backref > re->top_bracket) errorcode = ERR15;

+

+/* Failed to compile, or error while post-processing */

+

+if (errorcode != 0)

+  {

+  (pcre_free)(re);

+  PCRE_ERROR_RETURN:

+  *erroroffset = ptr - (const uschar *)pattern;

+  PCRE_EARLY_ERROR_RETURN:

+  *errorptr = error_texts[errorcode];

+  if (errorcodeptr != NULL) *errorcodeptr = errorcode;

+  return NULL;

+  }

+

+/* If the anchored option was not passed, set the flag if we can determine that

+the pattern is anchored by virtue of ^ characters or \A or anything else (such

+as starting with .* when DOTALL is set).

+

+Otherwise, if we know what the first character has to be, save it, because that

+speeds up unanchored matches no end. If not, see if we can set the

+PCRE_STARTLINE flag. This is helpful for multiline matches when all branches

+start with ^. and also when all branches start with .* for non-DOTALL matches.

+*/

+

+if ((options & PCRE_ANCHORED) == 0)

+  {

+  int temp_options = options;

+  if (is_anchored(codestart, &temp_options, 0, compile_block.backref_map))

+    re->options |= PCRE_ANCHORED;

+  else

+    {

+    if (firstbyte < 0)

+      firstbyte = find_firstassertedchar(codestart, &temp_options, FALSE);

+    if (firstbyte >= 0)   /* Remove caseless flag for non-caseable chars */

+      {

+      int ch = firstbyte & 255;

+      re->first_byte = ((firstbyte & REQ_CASELESS) != 0 &&

+         compile_block.fcc[ch] == ch)? ch : firstbyte;

+      re->options |= PCRE_FIRSTSET;

+      }

+    else if (is_startline(codestart, 0, compile_block.backref_map))

+      re->options |= PCRE_STARTLINE;

+    }

+  }

+

+/* For an anchored pattern, we use the "required byte" only if it follows a

+variable length item in the regex. Remove the caseless flag for non-caseable

+bytes. */

+

+if (reqbyte >= 0 &&

+     ((re->options & PCRE_ANCHORED) == 0 || (reqbyte & REQ_VARY) != 0))

+  {

+  int ch = reqbyte & 255;

+  re->req_byte = ((reqbyte & REQ_CASELESS) != 0 &&

+    compile_block.fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte;

+  re->options |= PCRE_REQCHSET;

+  }

+

+/* Print out the compiled data for debugging */

+

+#ifdef DEBUG

+

+printf("Length = %d top_bracket = %d top_backref = %d\n",

+  length, re->top_bracket, re->top_backref);

+

+if (re->options != 0)

+  {

+  printf("%s%s%s%s%s%s%s%s%s%s\n",

+    ((re->options & PCRE_NOPARTIAL) != 0)? "nopartial " : "",

+    ((re->options & PCRE_ANCHORED) != 0)? "anchored " : "",

+    ((re->options & PCRE_CASELESS) != 0)? "caseless " : "",

+    ((re->options & PCRE_ICHANGED) != 0)? "case state changed " : "",

+    ((re->options & PCRE_EXTENDED) != 0)? "extended " : "",

+    ((re->options & PCRE_MULTILINE) != 0)? "multiline " : "",

+    ((re->options & PCRE_DOTALL) != 0)? "dotall " : "",

+    ((re->options & PCRE_DOLLAR_ENDONLY) != 0)? "endonly " : "",

+    ((re->options & PCRE_EXTRA) != 0)? "extra " : "",

+    ((re->options & PCRE_UNGREEDY) != 0)? "ungreedy " : "");

+  }

+

+if ((re->options & PCRE_FIRSTSET) != 0)

+  {

+  int ch = re->first_byte & 255;

+  const char *caseless = ((re->first_byte & REQ_CASELESS) == 0)? "" : " (caseless)";

+  if (isprint(ch)) printf("First char = %c%s\n", ch, caseless);

+    else printf("First char = \\x%02x%s\n", ch, caseless);

+  }

+

+if ((re->options & PCRE_REQCHSET) != 0)

+  {

+  int ch = re->req_byte & 255;

+  const char *caseless = ((re->req_byte & REQ_CASELESS) == 0)? "" : " (caseless)";

+  if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless);

+    else printf("Req char = \\x%02x%s\n", ch, caseless);

+  }

+

+_pcre_printint(re, stdout);

+

+/* This check is done here in the debugging case so that the code that

+was compiled can be seen. */

+

+if (code - codestart > length)

+  {

+  (pcre_free)(re);

+  *errorptr = error_texts[ERR23];

+  *erroroffset = ptr - (uschar *)pattern;

+  if (errorcodeptr != NULL) *errorcodeptr = ERR23;

+  return NULL;

+  }

+#endif

+

+return (pcre *)re;

+}

+

+/* End of pcre_compile.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_config(). */

+

+

+

+

+/*************************************************

+* Return info about what features are configured *

+*************************************************/

+

+/* This function has an extensible interface so that additional items can be

+added compatibly.

+

+Arguments:

+  what             what information is required

+  where            where to put the information

+

+Returns:           0 if data returned, negative on error

+*/

+

+EXPORT int

+pcre_config(int what, void *where)

+{

+switch (what)

+  {

+  case PCRE_CONFIG_UTF8:

+#ifdef SUPPORT_UTF8

+  *((int *)where) = 1;

+#else

+  *((int *)where) = 0;

+#endif

+  break;

+

+  case PCRE_CONFIG_UNICODE_PROPERTIES:

+#ifdef SUPPORT_UCP

+  *((int *)where) = 1;

+#else

+  *((int *)where) = 0;

+#endif

+  break;

+

+  case PCRE_CONFIG_NEWLINE:

+  *((int *)where) = NEWLINE;

+  break;

+

+  case PCRE_CONFIG_LINK_SIZE:

+  *((int *)where) = LINK_SIZE;

+  break;

+

+  case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD:

+  *((int *)where) = POSIX_MALLOC_THRESHOLD;

+  break;

+

+  case PCRE_CONFIG_MATCH_LIMIT:

+  *((unsigned int *)where) = MATCH_LIMIT;

+  break;

+

+  case PCRE_CONFIG_STACKRECURSE:

+#ifdef NO_RECURSE

+  *((int *)where) = 0;

+#else

+  *((int *)where) = 1;

+#endif

+  break;

+

+  default: return PCRE_ERROR_BADOPTION;

+  }

+

+return 0;

+}

+

+/* End of pcre_config.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_dfa_exec(), which is an

+alternative matching function that uses a DFA algorithm. This is NOT Perl-

+compatible, but it has advantages in certain applications. */

+

+

+

+

+/* For use to indent debugging output */

+

+#define SP "                   "

+

+

+

+/*************************************************

+*      Code parameters and static tables         *

+*************************************************/

+

+/* These are offsets that are used to turn the OP_TYPESTAR and friends opcodes

+into others, under special conditions. A gap of 10 between the blocks should be

+enough. */

+

+#define OP_PROP_EXTRA    (EXTRACT_BASIC_MAX+1)

+#define OP_EXTUNI_EXTRA  (EXTRACT_BASIC_MAX+11)

+

+

+/* This table identifies those opcodes that are followed immediately by a

+character that is to be tested in some way. This makes is possible to

+centralize the loading of these characters. In the case of Type * etc, the

+"character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a

+small value. */

+

+static uschar coptable[] = {

+  0,                             /* End                                    */

+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  /* \A, \G, \B, \b, \D, \d, \S, \s, \W, \w */

+  0, 0,                          /* Any, Anybyte                           */

+  0, 0, 0,                       /* NOTPROP, PROP, EXTUNI                  */

+  0, 0, 0, 0, 0,                 /* \Z, \z, Opt, ^, $                      */

+  1,                             /* Char                                   */

+  1,                             /* Charnc                                 */

+  1,                             /* not                                    */

+  /* Positive single-char repeats                                          */

+  1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */

+  3, 3, 3,                       /* upto, minupto, exact                   */

+  /* Negative single-char repeats - only for chars < 256                   */

+  1, 1, 1, 1, 1, 1,              /* NOT *, *?, +, +?, ?, ??                */

+  3, 3, 3,                       /* NOT upto, minupto, exact               */

+  /* Positive type repeats                                                 */

+  1, 1, 1, 1, 1, 1,              /* Type *, *?, +, +?, ?, ??               */

+  3, 3, 3,                       /* Type upto, minupto, exact              */

+  /* Character class & ref repeats                                         */

+  0, 0, 0, 0, 0, 0,              /* *, *?, +, +?, ?, ??                    */

+  0, 0,                          /* CRRANGE, CRMINRANGE                    */

+  0,                             /* CLASS                                  */

+  0,                             /* NCLASS                                 */

+  0,                             /* XCLASS - variable length               */

+  0,                             /* REF                                    */

+  0,                             /* RECURSE                                */

+  0,                             /* CALLOUT                                */

+  0,                             /* Alt                                    */

+  0,                             /* Ket                                    */

+  0,                             /* KetRmax                                */

+  0,                             /* KetRmin                                */

+  0,                             /* Assert                                 */

+  0,                             /* Assert not                             */

+  0,                             /* Assert behind                          */

+  0,                             /* Assert behind not                      */

+  0,                             /* Reverse                                */

+  0,                             /* Once                                   */

+  0,                             /* COND                                   */

+  0,                             /* CREF                                   */

+  0, 0,                          /* BRAZERO, BRAMINZERO                    */

+  0,                             /* BRANUMBER                              */

+  0                              /* BRA                                    */

+};

+

+/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W,

+and \w */

+

+static uschar toptable1[] = {

+  0, 0, 0, 0, 0,

+  ctype_digit, ctype_digit,

+  ctype_space, ctype_space,

+  ctype_word,  ctype_word,

+  0                               /* OP_ANY */

+};

+

+static uschar toptable2[] = {

+  0, 0, 0, 0, 0,

+  ctype_digit, 0,

+  ctype_space, 0,

+  ctype_word,  0,

+  1                               /* OP_ANY */

+};

+

+

+/* Structure for holding data about a particular state, which is in effect the

+current data for an active path through the match tree. It must consist

+entirely of ints because the working vector we are passed, and which we put

+these structures in, is a vector of ints. */

+

+typedef struct stateblock {

+  int offset;                     /* Offset to opcode */

+  int count;                      /* Count for repeats */

+  int ims;                        /* ims flag bits */

+  int data;                       /* Some use extra data */

+} stateblock;

+

+#define INTS_PER_STATEBLOCK  (sizeof(stateblock)/sizeof(int))

+

+

+#ifdef DEBUG

+/*************************************************

+*             Print character string             *

+*************************************************/

+

+/* Character string printing function for debugging.

+

+Arguments:

+  p            points to string

+  length       number of bytes

+  f            where to print

+

+Returns:       nothing

+*/

+

+static void

+pchars(unsigned char *p, int length, FILE *f)

+{

+int c;

+while (length-- > 0)

+  {

+  if (isprint(c = *(p++)))

+    fprintf(f, "%c", c);

+  else

+    fprintf(f, "\\x%02x", c);

+  }

+}

+#endif

+

+

+

+/*************************************************

+*    Execute a Regular Expression - DFA engine   *

+*************************************************/

+

+/* This internal function applies a compiled pattern to a subject string,

+starting at a given point, using a DFA engine. This function is called from the

+external one, possibly multiple times if the pattern is not anchored. The

+function calls itself recursively for some kinds of subpattern.

+

+Arguments:

+  md                the match_data block with fixed information

+  this_start_code   the opening bracket of this subexpression's code

+  current_subject   where we currently are in the subject string

+  start_offset      start offset in the subject string

+  offsets           vector to contain the matching string offsets

+  offsetcount       size of same

+  workspace         vector of workspace

+  wscount           size of same

+  ims               the current ims flags

+  rlevel            function call recursion level

+  recursing         regex recursive call level

+

+Returns:            > 0 =>

+                    = 0 =>

+                     -1 => failed to match

+                   < -1 => some kind of unexpected problem

+

+The following macros are used for adding states to the two state vectors (one

+for the current character, one for the following character). */

+

+#define ADD_ACTIVE(x,y) \

+  if (active_count++ < wscount) \

+    { \

+    next_active_state->offset = (x); \

+    next_active_state->count  = (y); \

+    next_active_state->ims    = ims; \

+    next_active_state++; \

+    DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \

+    } \

+  else return PCRE_ERROR_DFA_WSSIZE

+

+#define ADD_ACTIVE_DATA(x,y,z) \

+  if (active_count++ < wscount) \

+    { \

+    next_active_state->offset = (x); \

+    next_active_state->count  = (y); \

+    next_active_state->ims    = ims; \

+    next_active_state->data   = (z); \

+    next_active_state++; \

+    DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \

+    } \

+  else return PCRE_ERROR_DFA_WSSIZE

+

+#define ADD_NEW(x,y) \

+  if (new_count++ < wscount) \

+    { \

+    next_new_state->offset = (x); \

+    next_new_state->count  = (y); \

+    next_new_state->ims    = ims; \

+    next_new_state++; \

+    DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \

+    } \

+  else return PCRE_ERROR_DFA_WSSIZE

+

+#define ADD_NEW_DATA(x,y,z) \

+  if (new_count++ < wscount) \

+    { \

+    next_new_state->offset = (x); \

+    next_new_state->count  = (y); \

+    next_new_state->ims    = ims; \

+    next_new_state->data   = (z); \

+    next_new_state++; \

+    DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \

+    } \

+  else return PCRE_ERROR_DFA_WSSIZE

+

+/* And now, here is the code */

+

+static int

+internal_dfa_exec(

+  dfa_match_data *md,

+  const uschar *this_start_code,

+  const uschar *current_subject,

+  int start_offset,

+  int *offsets,

+  int offsetcount,

+  int *workspace,

+  int wscount,

+  int ims,

+  int  rlevel,

+  int  recursing)

+{

+stateblock *active_states, *new_states, *temp_states;

+stateblock *next_active_state, *next_new_state;

+

+const uschar *ctypes, *lcc, *fcc;

+const uschar *ptr;

+const uschar *end_code;

+

+int active_count, new_count, match_count;

+

+/* Some fields in the md block are frequently referenced, so we load them into

+independent variables in the hope that this will perform better. */

+

+const uschar *start_subject = md->start_subject;

+const uschar *end_subject = md->end_subject;

+const uschar *start_code = md->start_code;

+

+BOOL utf8 = (md->poptions & PCRE_UTF8) != 0;

+

+rlevel++;

+offsetcount &= (-2);

+

+wscount -= 2;

+wscount = (wscount - (wscount % (INTS_PER_STATEBLOCK * 2))) /

+          (2 * INTS_PER_STATEBLOCK);

+

+DPRINTF(("\n%.*s---------------------\n"

+  "%.*sCall to internal_dfa_exec f=%d r=%d\n",

+  rlevel*2-2, SP, rlevel*2-2, SP, rlevel, recursing));

+

+ctypes = md->tables + ctypes_offset;

+lcc = md->tables + lcc_offset;

+fcc = md->tables + fcc_offset;

+

+match_count = PCRE_ERROR_NOMATCH;   /* A negative number */

+

+active_states = (stateblock *)(workspace + 2);

+next_new_state = new_states = active_states + wscount;

+new_count = 0;

+

+/* The first thing in any (sub) pattern is a bracket of some sort. Push all

+the alternative states onto the list, and find out where the end is. This

+makes is possible to use this function recursively, when we want to stop at a

+matching internal ket rather than at the end.

+

+If the first opcode in the first alternative is OP_REVERSE, we are dealing with

+a backward assertion. In that case, we have to find out the maximum amount to

+move back, and set up each alternative appropriately. */

+

+if (this_start_code[1+LINK_SIZE] == OP_REVERSE)

+  {

+  int max_back = 0;

+  int gone_back;

+

+  end_code = this_start_code;

+  do

+    {

+    int back = GET(end_code, 2+LINK_SIZE);

+    if (back > max_back) max_back = back;

+    end_code += GET(end_code, 1);

+    }

+  while (*end_code == OP_ALT);

+

+  /* If we can't go back the amount required for the longest lookbehind

+  pattern, go back as far as we can; some alternatives may still be viable. */

+

+#ifdef SUPPORT_UTF8

+  /* In character mode we have to step back character by character */

+

+  if (utf8)

+    {

+    for (gone_back = 0; gone_back < max_back; gone_back++)

+      {

+      if (current_subject <= start_subject) break;

+      current_subject--;

+      while (current_subject > start_subject &&

+             (*current_subject & 0xc0) == 0x80)

+        current_subject--;

+      }

+    }

+  else

+#endif

+

+  /* In byte-mode we can do this quickly. */

+

+    {

+    gone_back = (current_subject - max_back < start_subject)?

+      current_subject - start_subject : max_back;

+    current_subject -= gone_back;

+    }

+

+  /* Now we can process the individual branches. */

+

+  end_code = this_start_code;

+  do

+    {

+    int back = GET(end_code, 2+LINK_SIZE);

+    if (back <= gone_back)

+      {

+      int bstate = end_code - start_code + 2 + 2*LINK_SIZE;

+      ADD_NEW_DATA(-bstate, 0, gone_back - back);

+      }

+    end_code += GET(end_code, 1);

+    }

+  while (*end_code == OP_ALT);

+ }

+

+/* This is the code for a "normal" subpattern (not a backward assertion). The

+start of a whole pattern is always one of these. If we are at the top level,

+we may be asked to restart matching from the same point that we reached for a

+previous partial match. We still have to scan through the top-level branches to

+find the end state. */

+

+else

+  {

+  end_code = this_start_code;

+

+  /* Restarting */

+

+  if (rlevel == 1 && (md->moptions & PCRE_DFA_RESTART) != 0)

+    {

+    do { end_code += GET(end_code, 1); } while (*end_code == OP_ALT);

+    new_count = workspace[1];

+    if (!workspace[0])

+      memcpy(new_states, active_states, new_count * sizeof(stateblock));

+    }

+

+  /* Not restarting */

+

+  else

+    {

+    do

+      {

+      ADD_NEW(end_code - start_code + 1 + LINK_SIZE, 0);

+      end_code += GET(end_code, 1);

+      }

+    while (*end_code == OP_ALT);

+    }

+  }

+

+workspace[0] = 0;    /* Bit indicating which vector is current */

+

+DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, end_code - start_code));

+

+/* Loop for scanning the subject */

+

+ptr = current_subject;

+for (;;)

+  {

+  int i, j;

+  int c, d, clen, dlen;

+

+  /* Make the new state list into the active state list and empty the

+  new state list. */

+

+  temp_states = active_states;

+  active_states = new_states;

+  new_states = temp_states;

+  active_count = new_count;

+  new_count = 0;

+

+  workspace[0] ^= 1;              /* Remember for the restarting feature */

+  workspace[1] = active_count;

+

+#ifdef DEBUG

+  printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP);

+  pchars((uschar *)ptr, strlen((char *)ptr), stdout);

+  printf("\"\n");

+

+  printf("%.*sActive states: ", rlevel*2-2, SP);

+  for (i = 0; i < active_count; i++)

+    printf("%d/%d ", active_states[i].offset, active_states[i].count);

+  printf("\n");

+#endif

+

+  /* Set the pointers for adding new states */

+

+  next_active_state = active_states + active_count;

+  next_new_state = new_states;

+

+  /* Load the current character from the subject outside the loop, as many

+  different states may want to look at it, and we assume that at least one

+  will. */

+

+  if (ptr < end_subject)

+    {

+    clen = 1;

+#ifdef SUPPORT_UTF8

+    if (utf8) { GETCHARLEN(c, ptr, clen); } else

+#endif  /* SUPPORT_UTF8 */

+    c = *ptr;

+    }

+  else

+    {

+    clen = 0;    /* At end subject */

+    c = -1;

+    }

+

+  /* Scan up the active states and act on each one. The result of an action

+  may be to add more states to the currently active list (e.g. on hitting a

+  parenthesis) or it may be to put states on the new list, for considering

+  when we move the character pointer on. */

+

+  for (i = 0; i < active_count; i++)

+    {

+    stateblock *current_state = active_states + i;

+    const uschar *code;

+    int state_offset = current_state->offset;

+    int count, codevalue;

+    int chartype, othercase;

+

+#ifdef DEBUG

+    printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);

+    if (c < 0) printf("-1\n");

+      else if (c > 32 && c < 127) printf("'%c'\n", c);

+        else printf("0x%02x\n", c);

+#endif

+

+    /* This variable is referred to implicity in the ADD_xxx macros. */

+

+    ims = current_state->ims;

+

+    /* A negative offset is a special case meaning "hold off going to this

+    (negated) state until the number of characters in the data field have

+    been skipped". */

+

+    if (state_offset < 0)

+      {

+      if (current_state->data > 0)

+        {

+        DPRINTF(("%.*sSkipping this character\n", rlevel*2-2, SP));

+        ADD_NEW_DATA(state_offset, current_state->count,

+          current_state->data - 1);

+        continue;

+        }

+      else

+        {

+        current_state->offset = state_offset = -state_offset;

+        }

+      }

+

+    /* Check for a duplicate state with the same count, and skip if found. */

+

+    for (j = 0; j < i; j++)

+      {

+      if (active_states[j].offset == state_offset &&

+          active_states[j].count == current_state->count)

+        {

+        DPRINTF(("%.*sDuplicate state: skipped\n", rlevel*2-2, SP));

+        goto NEXT_ACTIVE_STATE;

+        }

+      }

+

+    /* The state offset is the offset to the opcode */

+

+    code = start_code + state_offset;

+    codevalue = *code;

+    if (codevalue >= OP_BRA) codevalue = OP_BRA; /* All brackets are equal */

+

+    /* If this opcode is followed by an inline character, load it. It is

+    tempting to test for the presence of a subject character here, but that

+    is wrong, because sometimes zero repetitions of the subject are

+    permitted.

+

+    We also use this mechanism for opcodes such as OP_TYPEPLUS that take an

+    argument that is not a data character - but is always one byte long.

+    Unfortunately, we have to take special action to deal with  \P, \p, and

+    \X in this case. To keep the other cases fast, convert these ones to new

+    opcodes. */

+

+    if (coptable[codevalue] > 0)

+      {

+      dlen = 1;

+#ifdef SUPPORT_UTF8

+      if (utf8) { GETCHARLEN(d, (code + coptable[codevalue]), dlen); } else

+#endif  /* SUPPORT_UTF8 */

+      d = code[coptable[codevalue]];

+      if (codevalue >= OP_TYPESTAR)

+        {

+        if (d == OP_ANYBYTE) return PCRE_ERROR_DFA_UITEM;

+        if (d >= OP_NOTPROP)

+          codevalue += (d == OP_EXTUNI)? OP_EXTUNI_EXTRA : OP_PROP_EXTRA;

+        }

+      }

+    else

+      {

+      dlen = 0;         /* Not strictly necessary, but compilers moan */

+      d = -1;           /* if these variables are not set. */

+      }

+

+

+    /* Now process the individual opcodes */

+

+    switch (codevalue)

+      {

+

+/* ========================================================================== */

+      /* Reached a closing bracket. If not at the end of the pattern, carry

+      on with the next opcode. Otherwise, unless we have an empty string and

+      PCRE_NOTEMPTY is set, save the match data, shifting up all previous

+      matches so we always have the longest first. */

+

+      case OP_KET:

+      case OP_KETRMIN:

+      case OP_KETRMAX:

+      if (code != end_code)

+        {

+        ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0);

+        if (codevalue != OP_KET)

+          {

+          ADD_ACTIVE(state_offset - GET(code, 1), 0);

+          }

+        }

+      else if (ptr > current_subject || (md->moptions & PCRE_NOTEMPTY) == 0)

+        {

+        if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0;

+          else if (match_count > 0 && ++match_count * 2 >= offsetcount)

+            match_count = 0;

+        count = ((match_count == 0)? offsetcount : match_count * 2) - 2;

+        if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));

+        if (offsetcount >= 2)

+          {

+          offsets[0] = current_subject - start_subject;

+          offsets[1] = ptr - start_subject;

+          DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,

+            offsets[1] - offsets[0], current_subject));

+          }

+        if ((md->moptions & PCRE_DFA_SHORTEST) != 0)

+          {

+          DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n"

+            "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel,

+            match_count, rlevel*2-2, SP));

+          return match_count;

+          }

+        }

+      break;

+

+/* ========================================================================== */

+      /* These opcodes add to the current list of states without looking

+      at the current character. */

+

+      /*-----------------------------------------------------------------*/

+      case OP_ALT:

+      do { code += GET(code, 1); } while (*code == OP_ALT);

+      ADD_ACTIVE(code - start_code, 0);

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_BRA:

+      do

+        {

+        ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);

+        code += GET(code, 1);

+        }

+      while (*code == OP_ALT);

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_BRAZERO:

+      case OP_BRAMINZERO:

+      ADD_ACTIVE(state_offset + 1, 0);

+      code += 1 + GET(code, 2);

+      while (*code == OP_ALT) code += GET(code, 1);

+      ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_BRANUMBER:

+      ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0);

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_CIRC:

+      if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) ||

+          ((ims & PCRE_MULTILINE) != 0 && ptr[-1] == NEWLINE))

+        { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EOD:

+      if (ptr >= end_subject) { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_OPT:

+      ims = code[1];

+      ADD_ACTIVE(state_offset + 2, 0);

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_SOD:

+      if (ptr == start_subject) { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_SOM:

+      if (ptr == start_subject + start_offset) { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+

+/* ========================================================================== */

+      /* These opcodes inspect the next subject character, and sometimes

+      the previous one as well, but do not have an argument. The variable

+      clen contains the length of the current character and is zero if we are

+      at the end of the subject. */

+

+      /*-----------------------------------------------------------------*/

+      case OP_ANY:

+      if (clen > 0 && (c != NEWLINE || (ims & PCRE_DOTALL) != 0))

+        { ADD_NEW(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EODN:

+      if (clen == 0 || (c == NEWLINE && ptr + 1 == end_subject))

+        { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_DOLL:

+      if ((md->moptions & PCRE_NOTEOL) == 0)

+        {

+        if (clen == 0 || (c == NEWLINE && (ptr + 1 == end_subject ||

+                                (ims & PCRE_MULTILINE) != 0)))

+          { ADD_ACTIVE(state_offset + 1, 0); }

+        }

+      else if (c == NEWLINE && (ims & PCRE_MULTILINE) != 0)

+        { ADD_ACTIVE(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+

+      case OP_DIGIT:

+      case OP_WHITESPACE:

+      case OP_WORDCHAR:

+      if (clen > 0 && c < 256 &&

+            ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0)

+        { ADD_NEW(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_NOT_DIGIT:

+      case OP_NOT_WHITESPACE:

+      case OP_NOT_WORDCHAR:

+      if (clen > 0 && (c >= 256 ||

+            ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0))

+        { ADD_NEW(state_offset + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_WORD_BOUNDARY:

+      case OP_NOT_WORD_BOUNDARY:

+        {

+        int left_word, right_word;

+

+        if (ptr > start_subject)

+          {

+          const uschar *temp = ptr - 1;

+#ifdef SUPPORT_UTF8

+          if (utf8) BACKCHAR(temp);

+#endif

+          GETCHARTEST(d, temp);

+          left_word = d < 256 && (ctypes[d] & ctype_word) != 0;

+          }

+        else left_word = 0;

+

+        if (clen > 0) right_word = c < 256 && (ctypes[c] & ctype_word) != 0;

+          else right_word = 0;

+

+        if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))

+          { ADD_ACTIVE(state_offset + 1, 0); }

+        }

+      break;

+

+

+#ifdef SUPPORT_UCP

+

+      /*-----------------------------------------------------------------*/

+      /* Check the next character by Unicode property. We will get here only

+      if the support is in the binary; otherwise a compile-time error occurs.

+      */

+

+      case OP_PROP:

+      case OP_NOTPROP:

+      if (clen > 0)

+        {

+        int rqdtype, category;

+        category = ucp_findchar(c, &chartype, &othercase);

+        rqdtype = code[1];

+        if (rqdtype >= 128)

+          {

+          if ((rqdtype - 128 == category) == (codevalue == OP_PROP))

+            { ADD_NEW(state_offset + 2, 0); }

+          }

+        else

+          {

+          if ((rqdtype == chartype) == (codevalue == OP_PROP))

+            { ADD_NEW(state_offset + 2, 0); }

+          }

+        }

+      break;

+#endif

+

+

+

+/* ========================================================================== */

+      /* These opcodes likewise inspect the subject character, but have an

+      argument that is not a data character. It is one of these opcodes:

+      OP_ANY, OP_DIGIT, OP_NOT_DIGIT, OP_WHITESPACE, OP_NOT_SPACE, OP_WORDCHAR,

+      OP_NOT_WORDCHAR. The value is loaded into d. */

+

+      case OP_TYPEPLUS:

+      case OP_TYPEMINPLUS:

+      count = current_state->count;  /* Already matched */

+      if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }

+      if (clen > 0)

+        {

+        if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||

+            (c < 256 &&

+              (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) &&

+              ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))

+          {

+          count++;

+          ADD_NEW(state_offset, count);

+          }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_TYPEQUERY:

+      case OP_TYPEMINQUERY:

+      ADD_ACTIVE(state_offset + 2, 0);

+      if (clen > 0)

+        {

+        if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||

+            (c < 256 &&

+              (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) &&

+              ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))

+          {

+          ADD_NEW(state_offset + 2, 0);

+          }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_TYPESTAR:

+      case OP_TYPEMINSTAR:

+      ADD_ACTIVE(state_offset + 2, 0);

+      if (clen > 0)

+        {

+        if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||

+            (c < 256 &&

+              (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) &&

+              ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))

+          {

+          ADD_NEW(state_offset, 0);

+          }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_TYPEEXACT:

+      case OP_TYPEUPTO:

+      case OP_TYPEMINUPTO:

+      if (codevalue != OP_TYPEEXACT)

+        { ADD_ACTIVE(state_offset + 4, 0); }

+      count = current_state->count;  /* Number already matched */

+      if (clen > 0)

+        {

+        if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||

+            (c < 256 &&

+              (d != OP_ANY || c != '\n' || (ims & PCRE_DOTALL) != 0) &&

+              ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))

+          {

+          if (++count >= GET2(code, 1))

+            { ADD_NEW(state_offset + 4, 0); }

+          else

+            { ADD_NEW(state_offset, count); }

+          }

+        }

+      break;

+

+/* ========================================================================== */

+      /* These are virtual opcodes that are used when something like

+      OP_TYPEPLUS has OP_PROP, OP_NOTPROP, or OP_EXTUNI as its argument. It

+      keeps the code above fast for the other cases. The argument is in the

+      d variable. */

+

+      case OP_PROP_EXTRA + OP_TYPEPLUS:

+      case OP_PROP_EXTRA + OP_TYPEMINPLUS:

+      count = current_state->count;           /* Already matched */

+      if (count > 0) { ADD_ACTIVE(state_offset + 3, 0); }

+      if (clen > 0)

+        {

+        int category = ucp_findchar(c, &chartype, &othercase);

+        int rqdtype = code[2];

+        if ((d == OP_PROP) ==

+            (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype)))

+          { count++; ADD_NEW(state_offset, count); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EXTUNI_EXTRA + OP_TYPEPLUS:

+      case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS:

+      count = current_state->count;  /* Already matched */

+      if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }

+      if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M)

+        {

+        const uschar *nptr = ptr + clen;

+        int ncount = 0;

+        while (nptr < end_subject)

+          {

+          int nd;

+          int ndlen = 1;

+          GETCHARLEN(nd, nptr, ndlen);

+          if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break;

+          ncount++;

+          nptr += ndlen;

+          }

+        count++;

+        ADD_NEW_DATA(-state_offset, count, ncount);

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_PROP_EXTRA + OP_TYPEQUERY:

+      case OP_PROP_EXTRA + OP_TYPEMINQUERY:

+      count = 3;

+      goto QS1;

+

+      case OP_PROP_EXTRA + OP_TYPESTAR:

+      case OP_PROP_EXTRA + OP_TYPEMINSTAR:

+      count = 0;

+

+      QS1:

+

+      ADD_ACTIVE(state_offset + 3, 0);

+      if (clen > 0)

+        {

+        int category = ucp_findchar(c, &chartype, &othercase);

+        int rqdtype = code[2];

+        if ((d == OP_PROP) ==

+            (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype)))

+          { ADD_NEW(state_offset + count, 0); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EXTUNI_EXTRA + OP_TYPEQUERY:

+      case OP_EXTUNI_EXTRA + OP_TYPEMINQUERY:

+      count = 2;

+      goto QS2;

+

+      case OP_EXTUNI_EXTRA + OP_TYPESTAR:

+      case OP_EXTUNI_EXTRA + OP_TYPEMINSTAR:

+      count = 0;

+

+      QS2:

+

+      ADD_ACTIVE(state_offset + 2, 0);

+      if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M)

+        {

+        const uschar *nptr = ptr + clen;

+        int ncount = 0;

+        while (nptr < end_subject)

+          {

+          int nd;

+          int ndlen = 1;

+          GETCHARLEN(nd, nptr, ndlen);

+          if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break;

+          ncount++;

+          nptr += ndlen;

+          }

+        ADD_NEW_DATA(-(state_offset + count), 0, ncount);

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_PROP_EXTRA + OP_TYPEEXACT:

+      case OP_PROP_EXTRA + OP_TYPEUPTO:

+      case OP_PROP_EXTRA + OP_TYPEMINUPTO:

+      if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT)

+        { ADD_ACTIVE(state_offset + 5, 0); }

+      count = current_state->count;  /* Number already matched */

+      if (clen > 0)

+        {

+        int category = ucp_findchar(c, &chartype, &othercase);

+        int rqdtype = code[4];

+        if ((d == OP_PROP) ==

+            (rqdtype == ((rqdtype >= 128)? (category + 128) : chartype)))

+          {

+          if (++count >= GET2(code, 1))

+            { ADD_NEW(state_offset + 5, 0); }

+          else

+            { ADD_NEW(state_offset, count); }

+          }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EXTUNI_EXTRA + OP_TYPEEXACT:

+      case OP_EXTUNI_EXTRA + OP_TYPEUPTO:

+      case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO:

+      if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT)

+        { ADD_ACTIVE(state_offset + 4, 0); }

+      count = current_state->count;  /* Number already matched */

+      if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M)

+        {

+        const uschar *nptr = ptr + clen;

+        int ncount = 0;

+        while (nptr < end_subject)

+          {

+          int nd;

+          int ndlen = 1;

+          GETCHARLEN(nd, nptr, ndlen);

+          if (ucp_findchar(nd, &chartype, &othercase) != ucp_M) break;

+          ncount++;

+          nptr += ndlen;

+          }

+        if (++count >= GET2(code, 1))

+          { ADD_NEW_DATA(-(state_offset + 4), 0, ncount); }

+        else

+          { ADD_NEW_DATA(-state_offset, count, ncount); }

+        }

+      break;

+

+/* ========================================================================== */

+      /* These opcodes are followed by a character that is usually compared

+      to the current subject character; it is loaded into d. We still get

+      here even if there is no subject character, because in some cases zero

+      repetitions are permitted. */

+

+      /*-----------------------------------------------------------------*/

+      case OP_CHAR:

+      if (clen > 0 && c == d) { ADD_NEW(state_offset + dlen + 1, 0); }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_CHARNC:

+      if (clen == 0) break;

+

+#ifdef SUPPORT_UTF8

+      if (utf8)

+        {

+        if (c == d) { ADD_NEW(state_offset + dlen + 1, 0); } else

+          {

+          if (c < 128) othercase = fcc[c]; else

+

+          /* If we have Unicode property support, we can use it to test the

+          other case of the character, if there is one. The result of

+          ucp_findchar() is < 0 if the char isn't found, and othercase is

+          returned as zero if there isn't another case. */

+

+#ifdef SUPPORT_UCP

+          if (ucp_findchar(c, &chartype, &othercase) < 0)

+#endif

+            othercase = -1;

+

+          if (d == othercase) { ADD_NEW(state_offset + dlen + 1, 0); }

+          }

+        }

+      else

+#endif  /* SUPPORT_UTF8 */

+

+      /* Non-UTF-8 mode */

+        {

+        if (lcc[c] == lcc[d]) { ADD_NEW(state_offset + 2, 0); }

+        }

+      break;

+

+

+#ifdef SUPPORT_UCP

+      /*-----------------------------------------------------------------*/

+      /* This is a tricky one because it can match more than one character.

+      Find out how many characters to skip, and then set up a negative state

+      to wait for them to pass before continuing. */

+

+      case OP_EXTUNI:

+      if (clen > 0 && ucp_findchar(c, &chartype, &othercase) != ucp_M)

+        {

+        const uschar *nptr = ptr + clen;

+        int ncount = 0;

+        while (nptr < end_subject)

+          {

+          int nclen = 1;

+          GETCHARLEN(c, nptr, nclen);

+          if (ucp_findchar(c, &chartype, &othercase) != ucp_M) break;

+          ncount++;

+          nptr += nclen;

+          }

+        ADD_NEW_DATA(-(state_offset + 1), 0, ncount);

+        }

+      break;

+#endif

+

+      /*-----------------------------------------------------------------*/

+      /* Match a negated single character. This is only used for one-byte

+      characters, that is, we know that d < 256. The character we are

+      checking (c) can be multibyte. */

+

+      case OP_NOT:

+      if (clen > 0)

+        {

+        int otherd = ((ims & PCRE_CASELESS) != 0)? fcc[d] : d;

+        if (c != d && c != otherd) { ADD_NEW(state_offset + dlen + 1, 0); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_PLUS:

+      case OP_MINPLUS:

+      case OP_NOTPLUS:

+      case OP_NOTMINPLUS:

+      count = current_state->count;  /* Already matched */

+      if (count > 0) { ADD_ACTIVE(state_offset + dlen + 1, 0); }

+      if (clen > 0)

+        {

+        int otherd = -1;

+        if ((ims & PCRE_CASELESS) != 0)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+#ifdef SUPPORT_UCP

+            if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1;

+#endif  /* SUPPORT_UCP */

+            }

+          else

+#endif  /* SUPPORT_UTF8 */

+          otherd = fcc[d];

+          }

+        if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))

+          { count++; ADD_NEW(state_offset, count); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_QUERY:

+      case OP_MINQUERY:

+      case OP_NOTQUERY:

+      case OP_NOTMINQUERY:

+      ADD_ACTIVE(state_offset + dlen + 1, 0);

+      if (clen > 0)

+        {

+        int otherd = -1;

+        if ((ims && PCRE_CASELESS) != 0)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+#ifdef SUPPORT_UCP

+            if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1;

+#endif  /* SUPPORT_UCP */

+            }

+          else

+#endif  /* SUPPORT_UTF8 */

+          otherd = fcc[d];

+          }

+        if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))

+          { ADD_NEW(state_offset + dlen + 1, 0); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_STAR:

+      case OP_MINSTAR:

+      case OP_NOTSTAR:

+      case OP_NOTMINSTAR:

+      ADD_ACTIVE(state_offset + dlen + 1, 0);

+      if (clen > 0)

+        {

+        int otherd = -1;

+        if ((ims && PCRE_CASELESS) != 0)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+#ifdef SUPPORT_UCP

+            if (ucp_findchar(c, &chartype, &otherd) < 0) otherd = -1;

+#endif  /* SUPPORT_UCP */

+            }

+          else

+#endif  /* SUPPORT_UTF8 */

+          otherd = fcc[d];

+          }

+        if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))

+          { ADD_NEW(state_offset, 0); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_EXACT:

+      case OP_UPTO:

+      case OP_MINUPTO:

+      case OP_NOTEXACT:

+      case OP_NOTUPTO:

+      case OP_NOTMINUPTO:

+      if (codevalue != OP_EXACT && codevalue != OP_NOTEXACT)

+        { ADD_ACTIVE(state_offset + dlen + 3, 0); }

+      count = current_state->count;  /* Number already matched */

+      if (clen > 0)

+        {

+        int otherd = -1;

+        if ((ims & PCRE_CASELESS) != 0)

+          {

+#ifdef SUPPORT_UTF8

+          if (utf8 && c >= 128)

+            {

+#ifdef SUPPORT_UCP

+            if (ucp_findchar(d, &chartype, &otherd) < 0) otherd = -1;

+#endif  /* SUPPORT_UCP */

+            }

+          else

+#endif  /* SUPPORT_UTF8 */

+          otherd = fcc[d];

+          }

+        if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))

+          {

+          if (++count >= GET2(code, 1))

+            { ADD_NEW(state_offset + dlen + 3, 0); }

+          else

+            { ADD_NEW(state_offset, count); }

+          }

+        }

+      break;

+

+

+/* ========================================================================== */

+      /* These are the class-handling opcodes */

+

+      case OP_CLASS:

+      case OP_NCLASS:

+      case OP_XCLASS:

+        {

+        BOOL isinclass = FALSE;

+        int next_state_offset;

+        const uschar *ecode;

+

+        /* For a simple class, there is always just a 32-byte table, and we

+        can set isinclass from it. */

+

+        if (codevalue != OP_XCLASS)

+          {

+          ecode = code + 33;

+          if (clen > 0)

+            {

+            isinclass = (c > 255)? (codevalue == OP_NCLASS) :

+              ((code[1 + c/8] & (1 << (c&7))) != 0);

+            }

+          }

+

+        /* An extended class may have a table or a list of single characters,

+        ranges, or both, and it may be positive or negative. There's a

+        function that sorts all this out. */

+

+        else

+         {

+         ecode = code + GET(code, 1);

+         if (clen > 0) isinclass = _pcre_xclass(c, code + 1 + LINK_SIZE);

+         }

+

+        /* At this point, isinclass is set for all kinds of class, and ecode

+        points to the byte after the end of the class. If there is a

+        quantifier, this is where it will be. */

+

+        next_state_offset = ecode - start_code;

+

+        switch (*ecode)

+          {

+          case OP_CRSTAR:

+          case OP_CRMINSTAR:

+          ADD_ACTIVE(next_state_offset + 1, 0);

+          if (isinclass) { ADD_NEW(state_offset, 0); }

+          break;

+

+          case OP_CRPLUS:

+          case OP_CRMINPLUS:

+          count = current_state->count;  /* Already matched */

+          if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); }

+          if (isinclass) { count++; ADD_NEW(state_offset, count); }

+          break;

+

+          case OP_CRQUERY:

+          case OP_CRMINQUERY:

+          ADD_ACTIVE(next_state_offset + 1, 0);

+          if (isinclass) { ADD_NEW(next_state_offset + 1, 0); }

+          break;

+

+          case OP_CRRANGE:

+          case OP_CRMINRANGE:

+          count = current_state->count;  /* Already matched */

+          if (count >= GET2(ecode, 1))

+            { ADD_ACTIVE(next_state_offset + 5, 0); }

+          if (isinclass)

+            {

+            if (++count >= GET2(ecode, 3))

+              { ADD_NEW(next_state_offset + 5, 0); }

+            else

+              { ADD_NEW(state_offset, count); }

+            }

+          break;

+

+          default:

+          if (isinclass) { ADD_NEW(next_state_offset, 0); }

+          break;

+          }

+        }

+      break;

+

+/* ========================================================================== */

+      /* These are the opcodes for fancy brackets of various kinds. We have

+      to use recursion in order to handle them. */

+

+      case OP_ASSERT:

+      case OP_ASSERT_NOT:

+      case OP_ASSERTBACK:

+      case OP_ASSERTBACK_NOT:

+        {

+        int rc;

+        int local_offsets[2];

+        int local_workspace[1000];

+        const uschar *endasscode = code + GET(code, 1);

+

+        while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1);

+

+        rc = internal_dfa_exec(

+          md,                                   /* static match data */

+          code,                                 /* this subexpression's code */

+          ptr,                                  /* where we currently are */

+          ptr - start_subject,                  /* start offset */

+          local_offsets,                        /* offset vector */

+          sizeof(local_offsets)/sizeof(int),    /* size of same */

+          local_workspace,                      /* workspace vector */

+          sizeof(local_workspace)/sizeof(int),  /* size of same */

+          ims,                                  /* the current ims flags */

+          rlevel,                               /* function recursion level */

+          recursing);                           /* pass on regex recursion */

+

+        if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))

+            { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_COND:

+        {

+        int local_offsets[1000];

+        int local_workspace[1000];

+        int condcode = code[LINK_SIZE+1];

+

+        /* The only supported version of OP_CREF is for the value 0xffff, which

+        means "test if in a recursion". */

+

+        if (condcode == OP_CREF)

+          {

+          int value = GET2(code, LINK_SIZE+2);

+          if (value != 0xffff) return PCRE_ERROR_DFA_UCOND;

+          if (recursing > 0) { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); }

+            else { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); }

+          }

+

+        /* Otherwise, the condition is an assertion */

+

+        else

+          {

+          int rc;

+          const uschar *asscode = code + LINK_SIZE + 1;

+          const uschar *endasscode = asscode + GET(asscode, 1);

+

+          while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1);

+

+          rc = internal_dfa_exec(

+            md,                                   /* fixed match data */

+            asscode,                              /* this subexpression's code */

+            ptr,                                  /* where we currently are */

+            ptr - start_subject,                  /* start offset */

+            local_offsets,                        /* offset vector */

+            sizeof(local_offsets)/sizeof(int),    /* size of same */

+            local_workspace,                      /* workspace vector */

+            sizeof(local_workspace)/sizeof(int),  /* size of same */

+            ims,                                  /* the current ims flags */

+            rlevel,                               /* function recursion level */

+            recursing);                           /* pass on regex recursion */

+

+          if ((rc >= 0) ==

+                (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))

+            { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }

+          else

+            { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); }

+          }

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_RECURSE:

+        {

+        int local_offsets[1000];

+        int local_workspace[1000];

+        int rc;

+

+        DPRINTF(("%.*sStarting regex recursion %d\n", rlevel*2-2, SP,

+          recursing + 1));

+

+        rc = internal_dfa_exec(

+          md,                                   /* fixed match data */

+          start_code + GET(code, 1),            /* this subexpression's code */

+          ptr,                                  /* where we currently are */

+          ptr - start_subject,                  /* start offset */

+          local_offsets,                        /* offset vector */

+          sizeof(local_offsets)/sizeof(int),    /* size of same */

+          local_workspace,                      /* workspace vector */

+          sizeof(local_workspace)/sizeof(int),  /* size of same */

+          ims,                                  /* the current ims flags */

+          rlevel,                               /* function recursion level */

+          recursing + 1);                       /* regex recurse level */

+

+        DPRINTF(("%.*sReturn from regex recursion %d: rc=%d\n", rlevel*2-2, SP,

+          recursing + 1, rc));

+

+        /* Ran out of internal offsets */

+

+        if (rc == 0) return PCRE_ERROR_DFA_RECURSE;

+

+        /* For each successful matched substring, set up the next state with a

+        count of characters to skip before trying it. Note that the count is in

+        characters, not bytes. */

+

+        if (rc > 0)

+          {

+          for (rc = rc*2 - 2; rc >= 0; rc -= 2)

+            {

+            const uschar *p = start_subject + local_offsets[rc];

+            const uschar *pp = start_subject + local_offsets[rc+1];

+            int charcount = local_offsets[rc+1] - local_offsets[rc];

+            while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--;

+            if (charcount > 0)

+              {

+              ADD_NEW_DATA(-(state_offset + LINK_SIZE + 1), 0, (charcount - 1));

+              }

+            else

+              {

+              ADD_ACTIVE(state_offset + LINK_SIZE + 1, 0);

+              }

+            }

+          }

+        else if (rc != PCRE_ERROR_NOMATCH) return rc;

+        }

+      break;

+

+      /*-----------------------------------------------------------------*/

+      case OP_ONCE:

+        {

+        const uschar *endcode;

+        int local_offsets[2];

+        int local_workspace[1000];

+

+        int rc = internal_dfa_exec(

+          md,                                   /* fixed match data */

+          code,                                 /* this subexpression's code */

+          ptr,                                  /* where we currently are */

+          ptr - start_subject,                  /* start offset */

+          local_offsets,                        /* offset vector */

+          sizeof(local_offsets)/sizeof(int),    /* size of same */

+          local_workspace,                      /* workspace vector */

+          sizeof(local_workspace)/sizeof(int),  /* size of same */

+          ims,                                  /* the current ims flags */

+          rlevel,                               /* function recursion level */

+          recursing);                           /* pass on regex recursion */

+

+        if (rc >= 0)

+          {

+          const uschar *end_subpattern = code;

+          int charcount = local_offsets[1] - local_offsets[0];

+          int next_state_offset, repeat_state_offset;

+          BOOL is_repeated;

+

+          do { end_subpattern += GET(end_subpattern, 1); }

+            while (*end_subpattern == OP_ALT);

+          next_state_offset = end_subpattern - start_code + LINK_SIZE + 1;

+

+          /* If the end of this subpattern is KETRMAX or KETRMIN, we must

+          arrange for the repeat state also to be added to the relevant list.

+          Calculate the offset, or set -1 for no repeat. */

+

+          repeat_state_offset = (*end_subpattern == OP_KETRMAX ||

+                                 *end_subpattern == OP_KETRMIN)?

+            end_subpattern - start_code - GET(end_subpattern, 1) : -1;

+

+          /* If we have matched an empty string, add the next state at the

+          current character pointer. This is important so that the duplicate

+          checking kicks in, which is what breaks infinite loops that match an

+          empty string. */

+

+          if (charcount == 0)

+            {

+            ADD_ACTIVE(next_state_offset, 0);

+            }

+

+          /* Optimization: if there are no more active states, and there

+          are no new states yet set up, then skip over the subject string

+          right here, to save looping. Otherwise, set up the new state to swing

+          into action when the end of the substring is reached. */

+

+          else if (i + 1 >= active_count && new_count == 0)

+            {

+            ptr += charcount;

+            clen = 0;

+            ADD_NEW(next_state_offset, 0);

+

+            /* If we are adding a repeat state at the new character position,

+            we must fudge things so that it is the only current state.

+            Otherwise, it might be a duplicate of one we processed before, and

+            that would cause it to be skipped. */

+

+            if (repeat_state_offset >= 0)

+              {

+              next_active_state = active_states;

+              active_count = 0;

+              i = -1;

+              ADD_ACTIVE(repeat_state_offset, 0);

+              }

+            }

+          else

+            {

+            const uschar *p = start_subject + local_offsets[0];

+            const uschar *pp = start_subject + local_offsets[1];

+            while (p < pp) if ((*p++ & 0xc0) == 0x80) charcount--;

+            ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));

+            if (repeat_state_offset >= 0)

+              { ADD_NEW_DATA(-repeat_state_offset, 0, (charcount - 1)); }

+            }

+

+          }

+        else if (rc != PCRE_ERROR_NOMATCH) return rc;

+        }

+      break;

+

+

+/* ========================================================================== */

+      /* Handle callouts */

+

+      case OP_CALLOUT:

+      if (pcre_callout != NULL)

+        {

+        int rrc;

+        pcre_callout_block cb;

+        cb.version          = 1;   /* Version 1 of the callout block */

+        cb.callout_number   = code[1];

+        cb.offset_vector    = offsets;

+        cb.subject          = (char *)start_subject;

+        cb.subject_length   = end_subject - start_subject;

+        cb.start_match      = current_subject - start_subject;

+        cb.current_position = ptr - start_subject;

+        cb.pattern_position = GET(code, 2);

+        cb.next_item_length = GET(code, 2 + LINK_SIZE);

+        cb.capture_top      = 1;

+        cb.capture_last     = -1;

+        cb.callout_data     = md->callout_data;

+        if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */

+        if (rrc == 0) { ADD_ACTIVE(state_offset + 2 + 2*LINK_SIZE, 0); }

+        }

+      break;

+

+

+/* ========================================================================== */

+      default:        /* Unsupported opcode */

+      return PCRE_ERROR_DFA_UITEM;

+      }

+

+    NEXT_ACTIVE_STATE: continue;

+

+    }      /* End of loop scanning active states */

+

+  /* We have finished the processing at the current subject character. If no

+  new states have been set for the next character, we have found all the

+  matches that we are going to find. If we are at the top level and partial

+  matching has been requested, check for appropriate conditions. */

+

+  if (new_count <= 0)

+    {

+    if (match_count < 0 &&                     /* No matches found */

+        rlevel == 1 &&                         /* Top level match function */

+        (md->moptions & PCRE_PARTIAL) != 0 &&  /* Want partial matching */

+        ptr >= end_subject &&                  /* Reached end of subject */

+        ptr > current_subject)                 /* Matched non-empty string */

+      {

+      if (offsetcount >= 2)

+        {

+        offsets[0] = current_subject - start_subject;

+        offsets[1] = end_subject - start_subject;

+        }

+      match_count = PCRE_ERROR_PARTIAL;

+      }

+

+    DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n"

+      "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, match_count,

+      rlevel*2-2, SP));

+    return match_count;

+    }

+

+  /* One or more states are active for the next character. */

+

+  ptr += clen;    /* Advance to next subject character */

+  }               /* Loop to move along the subject string */

+

+/* Control never gets here, but we must keep the compiler happy. */

+

+DPRINTF(("%.*s+++ Unexpected end of internal_dfa_exec %d +++\n"

+  "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, rlevel*2-2, SP));

+return PCRE_ERROR_NOMATCH;

+}

+

+

+

+

+/*************************************************

+*    Execute a Regular Expression - DFA engine   *

+*************************************************/

+

+/* This external function applies a compiled re to a subject string using a DFA

+engine. This function calls the internal function multiple times if the pattern

+is not anchored.

+

+Arguments:

+  argument_re     points to the compiled expression

+  extra_data      points to extra data or is NULL (not currently used)

+  subject         points to the subject string

+  length          length of subject string (may contain binary zeros)

+  start_offset    where to start in the subject string

+  options         option bits

+  offsets         vector of match offsets

+  offsetcount     size of same

+  workspace       workspace vector

+  wscount         size of same

+

+Returns:          > 0 => number of match offset pairs placed in offsets

+                  = 0 => offsets overflowed; longest matches are present

+                   -1 => failed to match

+                 < -1 => some kind of unexpected problem

+*/

+

+EXPORT int

+pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data,

+  const char *subject, int length, int start_offset, int options, int *offsets,

+  int offsetcount, int *workspace, int wscount)

+{

+real_pcre *re = (real_pcre *)argument_re;

+dfa_match_data match_block;

+BOOL utf8, anchored, startline, firstline;

+const uschar *current_subject, *end_subject, *lcc;

+

+pcre_study_data internal_study;

+const pcre_study_data *study = NULL;

+real_pcre internal_re;

+

+const uschar *req_byte_ptr;

+const uschar *start_bits = NULL;

+BOOL first_byte_caseless = FALSE;

+BOOL req_byte_caseless = FALSE;

+int first_byte = -1;

+int req_byte = -1;

+int req_byte2 = -1;

+

+/* Plausibility checks */

+

+if ((options & ~PUBLIC_DFA_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;

+if (re == NULL || subject == NULL || workspace == NULL ||

+   (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;

+if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;

+if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;

+

+/* We need to find the pointer to any study data before we test for byte

+flipping, so we scan the extra_data block first. This may set two fields in the

+match block, so we must initialize them beforehand. However, the other fields

+in the match block must not be set until after the byte flipping. */

+

+match_block.tables = re->tables;

+match_block.callout_data = NULL;

+

+if (extra_data != NULL)

+  {

+  unsigned int flags = extra_data->flags;

+  if ((flags & PCRE_EXTRA_STUDY_DATA) != 0)

+    study = (const pcre_study_data *)extra_data->study_data;

+  if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) return PCRE_ERROR_DFA_UMLIMIT;

+  if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)

+    match_block.callout_data = extra_data->callout_data;

+  if ((flags & PCRE_EXTRA_TABLES) != 0)

+    match_block.tables = extra_data->tables;

+  }

+

+/* Check that the first field in the block is the magic number. If it is not,

+test for a regex that was compiled on a host of opposite endianness. If this is

+the case, flipped values are put in internal_re and internal_study if there was

+study data too. */

+

+if (re->magic_number != MAGIC_NUMBER)

+  {

+  re = _pcre_try_flipped(re, &internal_re, study, &internal_study);

+  if (re == NULL) return PCRE_ERROR_BADMAGIC;

+  if (study != NULL) study = &internal_study;

+  }

+

+/* Set some local values */

+

+current_subject = (const unsigned char *)subject + start_offset;

+end_subject = (const unsigned char *)subject + length;

+req_byte_ptr = current_subject - 1;

+

+utf8 = (re->options & PCRE_UTF8) != 0;

+anchored = (options & PCRE_ANCHORED) != 0 || (re->options & PCRE_ANCHORED) != 0;

+

+/* The remaining fixed data for passing around. */

+

+match_block.start_code = (const uschar *)argument_re +

+    re->name_table_offset + re->name_count * re->name_entry_size;

+match_block.start_subject = (const unsigned char *)subject;

+match_block.end_subject = end_subject;

+match_block.moptions = options;

+match_block.poptions = re->options;

+

+/* Check a UTF-8 string if required. Unfortunately there's no way of passing

+back the character offset. */

+

+#ifdef SUPPORT_UTF8

+if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)

+  {

+  if (_pcre_valid_utf8((uschar *)subject, length) >= 0)

+    return PCRE_ERROR_BADUTF8;

+  if (start_offset > 0 && start_offset < length)

+    {

+    int tb = ((uschar *)subject)[start_offset];

+    if (tb > 127)

+      {

+      tb &= 0xc0;

+      if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;

+      }

+    }

+  }

+#endif

+

+/* If the exec call supplied NULL for tables, use the inbuilt ones. This

+is a feature that makes it possible to save compiled regex and re-use them

+in other programs later. */

+

+if (match_block.tables == NULL) match_block.tables = _pcre_default_tables;

+

+/* The lower casing table and the "must be at the start of a line" flag are

+used in a loop when finding where to start. */

+

+lcc = match_block.tables + lcc_offset;

+startline = (re->options & PCRE_STARTLINE) != 0;

+firstline = (re->options & PCRE_FIRSTLINE) != 0;

+

+/* Set up the first character to match, if available. The first_byte value is

+never set for an anchored regular expression, but the anchoring may be forced

+at run time, so we have to test for anchoring. The first char may be unset for

+an unanchored pattern, of course. If there's no first char and the pattern was

+studied, there may be a bitmap of possible first characters. */

+

+if (!anchored)

+  {

+  if ((re->options & PCRE_FIRSTSET) != 0)

+    {

+    first_byte = re->first_byte & 255;

+    if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE)

+      first_byte = lcc[first_byte];

+    }

+  else

+    {

+    if (startline && study != NULL &&

+         (study->options & PCRE_STUDY_MAPPED) != 0)

+      start_bits = study->start_bits;

+    }

+  }

+

+/* For anchored or unanchored matches, there may be a "last known required

+character" set. */

+

+if ((re->options & PCRE_REQCHSET) != 0)

+  {

+  req_byte = re->req_byte & 255;

+  req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0;

+  req_byte2 = (match_block.tables + fcc_offset)[req_byte];  /* case flipped */

+  }

+

+/* Call the main matching function, looping for a non-anchored regex after a

+failed match. Unless restarting, optimize by moving to the first match

+character if possible, when not anchored. Then unless wanting a partial match,

+check for a required later character. */

+

+for (;;)

+  {

+  int rc;

+

+  if ((options & PCRE_DFA_RESTART) == 0)

+    {

+    const uschar *save_end_subject = end_subject;

+

+    /* Advance to a unique first char if possible. If firstline is TRUE, the

+    start of the match is constrained to the first line of a multiline string.

+    Implement this by temporarily adjusting end_subject so that we stop scanning

+    at a newline. If the match fails at the newline, later code breaks this loop.

+    */

+

+    if (firstline)

+      {

+      const uschar *t = current_subject;

+      while (t < save_end_subject && *t != '\n') t++;

+      end_subject = t;

+      }

+

+    if (first_byte >= 0)

+      {

+      if (first_byte_caseless)

+        while (current_subject < end_subject &&

+               lcc[*current_subject] != first_byte)

+          current_subject++;

+      else

+        while (current_subject < end_subject && *current_subject != first_byte)

+          current_subject++;

+      }

+

+    /* Or to just after \n for a multiline match if possible */

+

+    else if (startline)

+      {

+      if (current_subject > match_block.start_subject + start_offset)

+        {

+        while (current_subject < end_subject && current_subject[-1] != NEWLINE)

+          current_subject++;

+        }

+      }

+

+    /* Or to a non-unique first char after study */

+

+    else if (start_bits != NULL)

+      {

+      while (current_subject < end_subject)

+        {

+        register unsigned int c = *current_subject;

+        if ((start_bits[c/8] & (1 << (c&7))) == 0) current_subject++;

+          else break;

+        }

+      }

+

+    /* Restore fudged end_subject */

+

+    end_subject = save_end_subject;

+    }

+

+  /* If req_byte is set, we know that that character must appear in the subject

+  for the match to succeed. If the first character is set, req_byte must be

+  later in the subject; otherwise the test starts at the match point. This

+  optimization can save a huge amount of work in patterns with nested unlimited

+  repeats that aren't going to match. Writing separate code for cased/caseless

+  versions makes it go faster, as does using an autoincrement and backing off

+  on a match.

+

+  HOWEVER: when the subject string is very, very long, searching to its end can

+  take a long time, and give bad performance on quite ordinary patterns. This

+  showed up when somebody was matching /^C/ on a 32-megabyte string... so we

+  don't do this when the string is sufficiently long.

+

+  ALSO: this processing is disabled when partial matching is requested.

+  */

+

+  if (req_byte >= 0 &&

+      end_subject - current_subject < REQ_BYTE_MAX &&

+      (options & PCRE_PARTIAL) == 0)

+    {

+    register const uschar *p = current_subject + ((first_byte >= 0)? 1 : 0);

+

+    /* We don't need to repeat the search if we haven't yet reached the

+    place we found it at last time. */

+

+    if (p > req_byte_ptr)

+      {

+      if (req_byte_caseless)

+        {

+        while (p < end_subject)

+          {

+          register int pp = *p++;

+          if (pp == req_byte || pp == req_byte2) { p--; break; }

+          }

+        }

+      else

+        {

+        while (p < end_subject)

+          {

+          if (*p++ == req_byte) { p--; break; }

+          }

+        }

+

+      /* If we can't find the required character, break the matching loop,

+      which will cause a return or PCRE_ERROR_NOMATCH. */

+

+      if (p >= end_subject) break;

+

+      /* If we have found the required character, save the point where we

+      found it, so that we don't search again next time round the loop if

+      the start hasn't passed this character yet. */

+

+      req_byte_ptr = p;

+      }

+    }

+

+  /* OK, now we can do the business */

+

+  rc = internal_dfa_exec(

+    &match_block,                              /* fixed match data */

+    match_block.start_code,                    /* this subexpression's code */

+    current_subject,                           /* where we currently are */

+    start_offset,                              /* start offset in subject */

+    offsets,                                   /* offset vector */

+    offsetcount,                               /* size of same */

+    workspace,                                 /* workspace vector */

+    wscount,                                   /* size of same */

+    re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL), /* ims flags */

+    0,                                         /* function recurse level */

+    0);                                        /* regex recurse level */

+

+  /* Anything other than "no match" means we are done, always; otherwise, carry

+  on only if not anchored. */

+

+  if (rc != PCRE_ERROR_NOMATCH || anchored) return rc;

+

+  /* Advance to the next subject character unless we are at the end of a line

+  and firstline is set. */

+

+  if (firstline && *current_subject == NEWLINE) break;

+  current_subject++;

+

+#ifdef SUPPORT_UTF8

+  if (utf8)

+    {

+    while (current_subject < end_subject && (*current_subject & 0xc0) == 0x80)

+      current_subject++;

+    }

+#endif

+

+  if (current_subject > end_subject) break;

+  }

+

+return PCRE_ERROR_NOMATCH;

+}

+

+/* End of pcre_dfa_exec.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains pcre_exec(), the externally visible function that does

+pattern matching using an NFA algorithm, trying to mimic Perl as closely as

+possible. There are also some static supporting functions. */

+

+

+

+

+/* Structure for building a chain of data that actually lives on the

+stack, for holding the values of the subject pointer at the start of each

+subpattern, so as to detect when an empty string has been matched by a

+subpattern - to break infinite loops. When NO_RECURSE is set, these blocks

+are on the heap, not on the stack. */

+

+typedef struct eptrblock {

+  struct eptrblock *epb_prev;

+  const uschar *epb_saved_eptr;

+} eptrblock;

+

+/* Flag bits for the match() function */

+

+#define match_condassert   0x01    /* Called to check a condition assertion */

+#define match_isgroup      0x02    /* Set if start of bracketed group */

+

+/* Non-error returns from the match() function. Error returns are externally

+defined PCRE_ERROR_xxx codes, which are all negative. */

+

+#define MATCH_MATCH        1

+#define MATCH_NOMATCH      0

+

+/* Maximum number of ints of offset to save on the stack for recursive calls.

+If the offset vector is bigger, malloc is used. This should be a multiple of 3,

+because the offset vector is always a multiple of 3 long. */

+

+#define REC_STACK_SAVE_MAX 30

+

+/* Min and max values for the common repeats; for the maxima, 0 => infinity */

+

+static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };

+static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };

+

+

+

+#ifdef DEBUG

+/*************************************************

+*        Debugging function to print chars       *

+*************************************************/

+

+/* Print a sequence of chars in printable format, stopping at the end of the

+subject if the requested.

+

+Arguments:

+  p           points to characters

+  length      number to print

+  is_subject  TRUE if printing from within md->start_subject

+  md          pointer to matching data block, if is_subject is TRUE

+

+Returns:     nothing

+*/

+

+static void

+pchars(const uschar *p, int length, BOOL is_subject, match_data *md)

+{

+int c;

+if (is_subject && length > md->end_subject - p) length = md->end_subject - p;

+while (length-- > 0)

+  if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c);

+}

+#endif

+

+

+

+/*************************************************

+*          Match a back-reference                *

+*************************************************/

+

+/* If a back reference hasn't been set, the length that is passed is greater

+than the number of characters left in the string, so the match fails.

+

+Arguments:

+  offset      index into the offset vector

+  eptr        points into the subject

+  length      length to be matched

+  md          points to match data block

+  ims         the ims flags

+

+Returns:      TRUE if matched

+*/

+

+static BOOL

+match_ref(int offset, register const uschar *eptr, int length, match_data *md,

+  unsigned long int ims)

+{

+const uschar *p = md->start_subject + md->offset_vector[offset];

+

+#ifdef DEBUG

+if (eptr >= md->end_subject)

+  printf("matching subject <null>");

+else

+  {

+  printf("matching subject ");

+  pchars(eptr, length, TRUE, md);

+  }

+printf(" against backref ");

+pchars(p, length, FALSE, md);

+printf("\n");

+#endif

+

+/* Always fail if not enough characters left */

+

+if (length > md->end_subject - eptr) return FALSE;

+

+/* Separate the caselesss case for speed */

+

+if ((ims & PCRE_CASELESS) != 0)

+  {

+  while (length-- > 0)

+    if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE;

+  }

+else

+  { while (length-- > 0) if (*p++ != *eptr++) return FALSE; }

+

+return TRUE;

+}

+

+

+

+/***************************************************************************

+****************************************************************************

+                   RECURSION IN THE match() FUNCTION

+

+The match() function is highly recursive. Some regular expressions can cause

+it to recurse thousands of times. I was writing for Unix, so I just let it

+call itself recursively. This uses the stack for saving everything that has

+to be saved for a recursive call. On Unix, the stack can be large, and this

+works fine.

+

+It turns out that on non-Unix systems there are problems with programs that

+use a lot of stack. (This despite the fact that every last chip has oodles

+of memory these days, and techniques for extending the stack have been known

+for decades.) So....

+

+There is a fudge, triggered by defining NO_RECURSE, which avoids recursive

+calls by keeping local variables that need to be preserved in blocks of memory

+obtained from malloc instead instead of on the stack. Macros are used to

+achieve this so that the actual code doesn't look very different to what it

+always used to.

+****************************************************************************

+***************************************************************************/

+

+

+/* These versions of the macros use the stack, as normal */

+

+#ifndef NO_RECURSE

+#define REGISTER register

+#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg) rx = match(ra,rb,rc,rd,re,rf,rg)

+#define RRETURN(ra) return ra

+#else

+

+

+/* These versions of the macros manage a private stack on the heap. Note

+that the rd argument of RMATCH isn't actually used. It's the md argument of

+match(), which never changes. */

+

+#define REGISTER

+

+#define RMATCH(rx,ra,rb,rc,rd,re,rf,rg)\

+  {\

+  heapframe *newframe = (pcre_stack_malloc)(sizeof(heapframe));\

+  if (setjmp(frame->Xwhere) == 0)\

+    {\

+    newframe->Xeptr = ra;\

+    newframe->Xecode = rb;\

+    newframe->Xoffset_top = rc;\

+    newframe->Xims = re;\

+    newframe->Xeptrb = rf;\

+    newframe->Xflags = rg;\

+    newframe->Xprevframe = frame;\

+    frame = newframe;\

+    DPRINTF(("restarting from line %d\n", __LINE__));\

+    goto HEAP_RECURSE;\

+    }\

+  else\

+    {\

+    DPRINTF(("longjumped back to line %d\n", __LINE__));\

+    frame = md->thisframe;\

+    rx = frame->Xresult;\

+    }\

+  }

+

+#define RRETURN(ra)\

+  {\

+  heapframe *newframe = frame;\

+  frame = newframe->Xprevframe;\

+  (pcre_stack_free)(newframe);\

+  if (frame != NULL)\

+    {\

+    frame->Xresult = ra;\

+    md->thisframe = frame;\

+    longjmp(frame->Xwhere, 1);\

+    }\

+  return ra;\

+  }

+

+

+/* Structure for remembering the local variables in a private frame */

+

+typedef struct heapframe {

+  struct heapframe *Xprevframe;

+

+  /* Function arguments that may change */

+

+  const uschar *Xeptr;

+  const uschar *Xecode;

+  int Xoffset_top;

+  long int Xims;

+  eptrblock *Xeptrb;

+  int Xflags;

+

+  /* Function local variables */

+

+  const uschar *Xcallpat;

+  const uschar *Xcharptr;

+  const uschar *Xdata;

+  const uschar *Xnext;

+  const uschar *Xpp;

+  const uschar *Xprev;

+  const uschar *Xsaved_eptr;

+

+  recursion_info Xnew_recursive;

+

+  BOOL Xcur_is_word;

+  BOOL Xcondition;

+  BOOL Xminimize;

+  BOOL Xprev_is_word;

+

+  unsigned long int Xoriginal_ims;

+

+#ifdef SUPPORT_UCP

+  int Xprop_type;

+  int Xprop_fail_result;

+  int Xprop_category;

+  int Xprop_chartype;

+  int Xprop_othercase;

+  int Xprop_test_against;

+  int *Xprop_test_variable;

+#endif

+

+  int Xctype;

+  int Xfc;

+  int Xfi;

+  int Xlength;

+  int Xmax;

+  int Xmin;

+  int Xnumber;

+  int Xoffset;

+  int Xop;

+  int Xsave_capture_last;

+  int Xsave_offset1, Xsave_offset2, Xsave_offset3;

+  int Xstacksave[REC_STACK_SAVE_MAX];

+

+  eptrblock Xnewptrb;

+

+  /* Place to pass back result, and where to jump back to */

+

+  int  Xresult;

+  jmp_buf Xwhere;

+

+} heapframe;

+

+#endif

+

+

+/***************************************************************************

+***************************************************************************/

+

+

+

+/*************************************************

+*         Match from current position            *

+*************************************************/

+

+/* On entry ecode points to the first opcode, and eptr to the first character

+in the subject string, while eptrb holds the value of eptr at the start of the

+last bracketed group - used for breaking infinite loops matching zero-length

+strings. This function is called recursively in many circumstances. Whenever it

+returns a negative (error) response, the outer incarnation must also return the

+same response.

+

+Performance note: It might be tempting to extract commonly used fields from the

+md structure (e.g. utf8, end_subject) into individual variables to improve

+performance. Tests using gcc on a SPARC disproved this; in the first case, it

+made performance worse.

+

+Arguments:

+   eptr        pointer in subject

+   ecode       position in code

+   offset_top  current top pointer

+   md          pointer to "static" info for the match

+   ims         current /i, /m, and /s options

+   eptrb       pointer to chain of blocks containing eptr at start of

+                 brackets - for testing for empty matches

+   flags       can contain

+                 match_condassert - this is an assertion condition

+                 match_isgroup - this is the start of a bracketed group

+

+Returns:       MATCH_MATCH if matched            )  these values are >= 0

+               MATCH_NOMATCH if failed to match  )

+               a negative PCRE_ERROR_xxx value if aborted by an error condition

+                 (e.g. stopped by recursion limit)

+*/

+

+static int

+match(REGISTER const uschar *eptr, REGISTER const uschar *ecode,

+  int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,

+  int flags)

+{

+/* These variables do not need to be preserved over recursion in this function,

+so they can be ordinary variables in all cases. Mark them with "register"

+because they are used a lot in loops. */

+

+register int  rrc;    /* Returns from recursive calls */

+register int  i;      /* Used for loops not involving calls to RMATCH() */

+register int  c;      /* Character values not kept over RMATCH() calls */

+register BOOL utf8;   /* Local copy of UTF-8 flag for speed */

+

+/* When recursion is not being used, all "local" variables that have to be

+preserved over calls to RMATCH() are part of a "frame" which is obtained from

+heap storage. Set up the top-level frame here; others are obtained from the

+heap whenever RMATCH() does a "recursion". See the macro definitions above. */

+

+#ifdef NO_RECURSE

+heapframe *frame = (pcre_stack_malloc)(sizeof(heapframe));

+frame->Xprevframe = NULL;            /* Marks the top level */

+

+/* Copy in the original argument variables */

+

+frame->Xeptr = eptr;

+frame->Xecode = ecode;

+frame->Xoffset_top = offset_top;

+frame->Xims = ims;

+frame->Xeptrb = eptrb;

+frame->Xflags = flags;

+

+/* This is where control jumps back to to effect "recursion" */

+

+HEAP_RECURSE:

+

+/* Macros make the argument variables come from the current frame */

+

+#define eptr               frame->Xeptr

+#define ecode              frame->Xecode

+#define offset_top         frame->Xoffset_top

+#define ims                frame->Xims

+#define eptrb              frame->Xeptrb

+#define flags              frame->Xflags

+

+/* Ditto for the local variables */

+

+#ifdef SUPPORT_UTF8

+#define charptr            frame->Xcharptr

+#endif

+#define callpat            frame->Xcallpat

+#define data               frame->Xdata

+#define next               frame->Xnext

+#define pp                 frame->Xpp

+#define prev               frame->Xprev

+#define saved_eptr         frame->Xsaved_eptr

+

+#define new_recursive      frame->Xnew_recursive

+

+#define cur_is_word        frame->Xcur_is_word

+#define condition          frame->Xcondition

+#define minimize           frame->Xminimize

+#define prev_is_word       frame->Xprev_is_word

+

+#define original_ims       frame->Xoriginal_ims

+

+#ifdef SUPPORT_UCP

+#define prop_type          frame->Xprop_type

+#define prop_fail_result   frame->Xprop_fail_result

+#define prop_category      frame->Xprop_category

+#define prop_chartype      frame->Xprop_chartype

+#define prop_othercase     frame->Xprop_othercase

+#define prop_test_against  frame->Xprop_test_against

+#define prop_test_variable frame->Xprop_test_variable

+#endif

+

+#define ctype              frame->Xctype

+#define fc                 frame->Xfc

+#define fi                 frame->Xfi

+#define length             frame->Xlength

+#define max                frame->Xmax

+#define min                frame->Xmin

+#define number             frame->Xnumber

+#define offset             frame->Xoffset

+#define op                 frame->Xop

+#define save_capture_last  frame->Xsave_capture_last

+#define save_offset1       frame->Xsave_offset1

+#define save_offset2       frame->Xsave_offset2

+#define save_offset3       frame->Xsave_offset3

+#define stacksave          frame->Xstacksave

+

+#define newptrb            frame->Xnewptrb

+

+/* When recursion is being used, local variables are allocated on the stack and

+get preserved during recursion in the normal way. In this environment, fi and

+i, and fc and c, can be the same variables. */

+

+#else

+#define fi i

+#define fc c

+

+

+#ifdef SUPPORT_UTF8                /* Many of these variables are used ony */

+const uschar *charptr;             /* small blocks of the code. My normal  */

+#endif                             /* style of coding would have declared  */

+const uschar *callpat;             /* them within each of those blocks.    */

+const uschar *data;                /* However, in order to accommodate the */

+const uschar *next;                /* version of this code that uses an    */

+const uschar *pp;                  /* external "stack" implemented on the  */

+const uschar *prev;                /* heap, it is easier to declare them   */

+const uschar *saved_eptr;          /* all here, so the declarations can    */

+                                   /* be cut out in a block. The only      */

+recursion_info new_recursive;      /* declarations within blocks below are */

+                                   /* for variables that do not have to    */

+BOOL cur_is_word;                  /* be preserved over a recursive call   */

+BOOL condition;                    /* to RMATCH().                         */

+BOOL minimize;

+BOOL prev_is_word;

+

+unsigned long int original_ims;

+

+#ifdef SUPPORT_UCP

+int prop_type;

+int prop_fail_result;

+int prop_category;

+int prop_chartype;

+int prop_othercase;

+int prop_test_against;

+int *prop_test_variable;

+#endif

+

+int ctype;

+int length;

+int max;

+int min;

+int number;

+int offset;

+int op;

+int save_capture_last;

+int save_offset1, save_offset2, save_offset3;

+int stacksave[REC_STACK_SAVE_MAX];

+

+eptrblock newptrb;

+#endif

+

+/* These statements are here to stop the compiler complaining about unitialized

+variables. */

+

+#ifdef SUPPORT_UCP

+prop_fail_result = 0;

+prop_test_against = 0;

+prop_test_variable = NULL;

+#endif

+

+/* OK, now we can get on with the real code of the function. Recursion is

+specified by the macros RMATCH and RRETURN. When NO_RECURSE is *not* defined,

+these just turn into a recursive call to match() and a "return", respectively.

+However, RMATCH isn't like a function call because it's quite a complicated

+macro. It has to be used in one particular way. This shouldn't, however, impact

+performance when true recursion is being used. */

+

+if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT);

+

+original_ims = ims;    /* Save for resetting on ')' */

+utf8 = md->utf8;       /* Local copy of the flag */

+

+/* At the start of a bracketed group, add the current subject pointer to the

+stack of such pointers, to be re-instated at the end of the group when we hit

+the closing ket. When match() is called in other circumstances, we don't add to

+this stack. */

+

+if ((flags & match_isgroup) != 0)

+  {

+  newptrb.epb_prev = eptrb;

+  newptrb.epb_saved_eptr = eptr;

+  eptrb = &newptrb;

+  }

+

+/* Now start processing the operations. */

+

+for (;;)

+  {

+  op = *ecode;

+  minimize = FALSE;

+

+  /* For partial matching, remember if we ever hit the end of the subject after

+  matching at least one subject character. */

+

+  if (md->partial &&

+      eptr >= md->end_subject &&

+      eptr > md->start_match)

+    md->hitend = TRUE;

+

+  /* Opening capturing bracket. If there is space in the offset vector, save

+  the current subject position in the working slot at the top of the vector. We

+  mustn't change the current values of the data slot, because they may be set

+  from a previous iteration of this group, and be referred to by a reference

+  inside the group.

+

+  If the bracket fails to match, we need to restore this value and also the

+  values of the final offsets, in case they were set by a previous iteration of

+  the same bracket.

+

+  If there isn't enough space in the offset vector, treat this as if it were a

+  non-capturing bracket. Don't worry about setting the flag for the error case

+  here; that is handled in the code for KET. */

+

+  if (op > OP_BRA)

+    {

+    number = op - OP_BRA;

+

+    /* For extended extraction brackets (large number), we have to fish out the

+    number from a dummy opcode at the start. */

+

+    if (number > EXTRACT_BASIC_MAX)

+      number = GET2(ecode, 2+LINK_SIZE);

+    offset = number << 1;

+

+#ifdef DEBUG

+    printf("start bracket %d subject=", number);

+    pchars(eptr, 16, TRUE, md);

+    printf("\n");

+#endif

+

+    if (offset < md->offset_max)

+      {

+      save_offset1 = md->offset_vector[offset];

+      save_offset2 = md->offset_vector[offset+1];

+      save_offset3 = md->offset_vector[md->offset_end - number];

+      save_capture_last = md->capture_last;

+

+      DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));

+      md->offset_vector[md->offset_end - number] = eptr - md->start_subject;

+

+      do

+        {

+        RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb,

+          match_isgroup);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        md->capture_last = save_capture_last;

+        ecode += GET(ecode, 1);

+        }

+      while (*ecode == OP_ALT);

+

+      DPRINTF(("bracket %d failed\n", number));

+

+      md->offset_vector[offset] = save_offset1;

+      md->offset_vector[offset+1] = save_offset2;

+      md->offset_vector[md->offset_end - number] = save_offset3;

+

+      RRETURN(MATCH_NOMATCH);

+      }

+

+    /* Insufficient room for saving captured contents */

+

+    else op = OP_BRA;

+    }

+

+  /* Other types of node can be handled by a switch */

+

+  switch(op)

+    {

+    case OP_BRA:     /* Non-capturing bracket: optimized */

+    DPRINTF(("start bracket 0\n"));

+    do

+      {

+      RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb,

+        match_isgroup);

+      if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+      ecode += GET(ecode, 1);

+      }

+    while (*ecode == OP_ALT);

+    DPRINTF(("bracket 0 failed\n"));

+    RRETURN(MATCH_NOMATCH);

+

+    /* Conditional group: compilation checked that there are no more than

+    two branches. If the condition is false, skipping the first branch takes us

+    past the end if there is only one branch, but that's OK because that is

+    exactly what going to the ket would do. */

+

+    case OP_COND:

+    if (ecode[LINK_SIZE+1] == OP_CREF) /* Condition extract or recurse test */

+      {

+      offset = GET2(ecode, LINK_SIZE+2) << 1;  /* Doubled ref number */

+      condition = (offset == CREF_RECURSE * 2)?

+        (md->recursive != NULL) :

+        (offset < offset_top && md->offset_vector[offset] >= 0);

+      RMATCH(rrc, eptr, ecode + (condition?

+        (LINK_SIZE + 4) : (LINK_SIZE + 1 + GET(ecode, 1))),

+        offset_top, md, ims, eptrb, match_isgroup);

+      RRETURN(rrc);

+      }

+

+    /* The condition is an assertion. Call match() to evaluate it - setting

+    the final argument TRUE causes it to stop at the end of an assertion. */

+

+    else

+      {

+      RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL,

+          match_condassert | match_isgroup);

+      if (rrc == MATCH_MATCH)

+        {

+        ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE+2);

+        while (*ecode == OP_ALT) ecode += GET(ecode, 1);

+        }

+      else if (rrc != MATCH_NOMATCH)

+        {

+        RRETURN(rrc);         /* Need braces because of following else */

+        }

+      else ecode += GET(ecode, 1);

+      RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb,

+        match_isgroup);

+      RRETURN(rrc);

+      }

+    /* Control never reaches here */

+

+    /* Skip over conditional reference or large extraction number data if

+    encountered. */

+

+    case OP_CREF:

+    case OP_BRANUMBER:

+    ecode += 3;

+    break;

+

+    /* End of the pattern. If we are in a recursion, we should restore the

+    offsets appropriately and continue from after the call. */

+

+    case OP_END:

+    if (md->recursive != NULL && md->recursive->group_num == 0)

+      {

+      recursion_info *rec = md->recursive;

+      DPRINTF(("Hit the end in a (?0) recursion\n"));

+      md->recursive = rec->prevrec;

+      memmove(md->offset_vector, rec->offset_save,

+        rec->saved_max * sizeof(int));

+      md->start_match = rec->save_start;

+      ims = original_ims;

+      ecode = rec->after_call;

+      break;

+      }

+

+    /* Otherwise, if PCRE_NOTEMPTY is set, fail if we have matched an empty

+    string - backtracking will then try other alternatives, if any. */

+

+    if (md->notempty && eptr == md->start_match) RRETURN(MATCH_NOMATCH);

+    md->end_match_ptr = eptr;          /* Record where we ended */

+    md->end_offset_top = offset_top;   /* and how many extracts were taken */

+    RRETURN(MATCH_MATCH);

+

+    /* Change option settings */

+

+    case OP_OPT:

+    ims = ecode[1];

+    ecode += 2;

+    DPRINTF(("ims set to %02lx\n", ims));

+    break;

+

+    /* Assertion brackets. Check the alternative branches in turn - the

+    matching won't pass the KET for an assertion. If any one branch matches,

+    the assertion is true. Lookbehind assertions have an OP_REVERSE item at the

+    start of each branch to move the current point backwards, so the code at

+    this level is identical to the lookahead case. */

+

+    case OP_ASSERT:

+    case OP_ASSERTBACK:

+    do

+      {

+      RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL,

+        match_isgroup);

+      if (rrc == MATCH_MATCH) break;

+      if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+      ecode += GET(ecode, 1);

+      }

+    while (*ecode == OP_ALT);

+    if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH);

+

+    /* If checking an assertion for a condition, return MATCH_MATCH. */

+

+    if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH);

+

+    /* Continue from after the assertion, updating the offsets high water

+    mark, since extracts may have been taken during the assertion. */

+

+    do ecode += GET(ecode,1); while (*ecode == OP_ALT);

+    ecode += 1 + LINK_SIZE;

+    offset_top = md->end_offset_top;

+    continue;

+

+    /* Negative assertion: all branches must fail to match */

+

+    case OP_ASSERT_NOT:

+    case OP_ASSERTBACK_NOT:

+    do

+      {

+      RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL,

+        match_isgroup);

+      if (rrc == MATCH_MATCH) RRETURN(MATCH_NOMATCH);

+      if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+      ecode += GET(ecode,1);

+      }

+    while (*ecode == OP_ALT);

+

+    if ((flags & match_condassert) != 0) RRETURN(MATCH_MATCH);

+

+    ecode += 1 + LINK_SIZE;

+    continue;

+

+    /* Move the subject pointer back. This occurs only at the start of

+    each branch of a lookbehind assertion. If we are too close to the start to

+    move back, this match function fails. When working with UTF-8 we move

+    back a number of characters, not bytes. */

+

+    case OP_REVERSE:

+#ifdef SUPPORT_UTF8

+    if (utf8)

+      {

+      c = GET(ecode,1);

+      for (i = 0; i < c; i++)

+        {

+        eptr--;

+        if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);

+        BACKCHAR(eptr)

+        }

+      }

+    else

+#endif

+

+    /* No UTF-8 support, or not in UTF-8 mode: count is byte count */

+

+      {

+      eptr -= GET(ecode,1);

+      if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH);

+      }

+

+    /* Skip to next op code */

+

+    ecode += 1 + LINK_SIZE;

+    break;

+

+    /* The callout item calls an external function, if one is provided, passing

+    details of the match so far. This is mainly for debugging, though the

+    function is able to force a failure. */

+

+    case OP_CALLOUT:

+    if (pcre_callout != NULL)

+      {

+      pcre_callout_block cb;

+      cb.version          = 1;   /* Version 1 of the callout block */

+      cb.callout_number   = ecode[1];

+      cb.offset_vector    = md->offset_vector;

+      cb.subject          = (const char *)md->start_subject;

+      cb.subject_length   = md->end_subject - md->start_subject;

+      cb.start_match      = md->start_match - md->start_subject;

+      cb.current_position = eptr - md->start_subject;

+      cb.pattern_position = GET(ecode, 2);

+      cb.next_item_length = GET(ecode, 2 + LINK_SIZE);

+      cb.capture_top      = offset_top/2;

+      cb.capture_last     = md->capture_last;

+      cb.callout_data     = md->callout_data;

+      if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH);

+      if (rrc < 0) RRETURN(rrc);

+      }

+    ecode += 2 + 2*LINK_SIZE;

+    break;

+

+    /* Recursion either matches the current regex, or some subexpression. The

+    offset data is the offset to the starting bracket from the start of the

+    whole pattern. (This is so that it works from duplicated subpatterns.)

+

+    If there are any capturing brackets started but not finished, we have to

+    save their starting points and reinstate them after the recursion. However,

+    we don't know how many such there are (offset_top records the completed

+    total) so we just have to save all the potential data. There may be up to

+    65535 such values, which is too large to put on the stack, but using malloc

+    for small numbers seems expensive. As a compromise, the stack is used when

+    there are no more than REC_STACK_SAVE_MAX values to store; otherwise malloc

+    is used. A problem is what to do if the malloc fails ... there is no way of

+    returning to the top level with an error. Save the top REC_STACK_SAVE_MAX

+    values on the stack, and accept that the rest may be wrong.

+

+    There are also other values that have to be saved. We use a chained

+    sequence of blocks that actually live on the stack. Thanks to Robin Houston

+    for the original version of this logic. */

+

+    case OP_RECURSE:

+      {

+      callpat = md->start_code + GET(ecode, 1);

+      new_recursive.group_num = *callpat - OP_BRA;

+

+      /* For extended extraction brackets (large number), we have to fish out

+      the number from a dummy opcode at the start. */

+

+      if (new_recursive.group_num > EXTRACT_BASIC_MAX)

+        new_recursive.group_num = GET2(callpat, 2+LINK_SIZE);

+

+      /* Add to "recursing stack" */

+

+      new_recursive.prevrec = md->recursive;

+      md->recursive = &new_recursive;

+

+      /* Find where to continue from afterwards */

+

+      ecode += 1 + LINK_SIZE;

+      new_recursive.after_call = ecode;

+

+      /* Now save the offset data. */

+

+      new_recursive.saved_max = md->offset_end;

+      if (new_recursive.saved_max <= REC_STACK_SAVE_MAX)

+        new_recursive.offset_save = stacksave;

+      else

+        {

+        new_recursive.offset_save =

+          (int *)(pcre_malloc)(new_recursive.saved_max * sizeof(int));

+        if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY);

+        }

+

+      memcpy(new_recursive.offset_save, md->offset_vector,

+            new_recursive.saved_max * sizeof(int));

+      new_recursive.save_start = md->start_match;

+      md->start_match = eptr;

+

+      /* OK, now we can do the recursion. For each top-level alternative we

+      restore the offset and recursion data. */

+

+      DPRINTF(("Recursing into group %d\n", new_recursive.group_num));

+      do

+        {

+        RMATCH(rrc, eptr, callpat + 1 + LINK_SIZE, offset_top, md, ims,

+            eptrb, match_isgroup);

+        if (rrc == MATCH_MATCH)

+          {

+          md->recursive = new_recursive.prevrec;

+          if (new_recursive.offset_save != stacksave)

+            (pcre_free)(new_recursive.offset_save);

+          RRETURN(MATCH_MATCH);

+          }

+        else if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+

+        md->recursive = &new_recursive;

+        memcpy(md->offset_vector, new_recursive.offset_save,

+            new_recursive.saved_max * sizeof(int));

+        callpat += GET(callpat, 1);

+        }

+      while (*callpat == OP_ALT);

+

+      DPRINTF(("Recursion didn't match\n"));

+      md->recursive = new_recursive.prevrec;

+      if (new_recursive.offset_save != stacksave)

+        (pcre_free)(new_recursive.offset_save);

+      RRETURN(MATCH_NOMATCH);

+      }

+    /* Control never reaches here */

+

+    /* "Once" brackets are like assertion brackets except that after a match,

+    the point in the subject string is not moved back. Thus there can never be

+    a move back into the brackets. Friedl calls these "atomic" subpatterns.

+    Check the alternative branches in turn - the matching won't pass the KET

+    for this kind of subpattern. If any one branch matches, we carry on as at

+    the end of a normal bracket, leaving the subject pointer. */

+

+    case OP_ONCE:

+      {

+      prev = ecode;

+      saved_eptr = eptr;

+

+      do

+        {

+        RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims,

+          eptrb, match_isgroup);

+        if (rrc == MATCH_MATCH) break;

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        ecode += GET(ecode,1);

+        }

+      while (*ecode == OP_ALT);

+

+      /* If hit the end of the group (which could be repeated), fail */

+

+      if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH);

+

+      /* Continue as from after the assertion, updating the offsets high water

+      mark, since extracts may have been taken. */

+

+      do ecode += GET(ecode,1); while (*ecode == OP_ALT);

+

+      offset_top = md->end_offset_top;

+      eptr = md->end_match_ptr;

+

+      /* For a non-repeating ket, just continue at this level. This also

+      happens for a repeating ket if no characters were matched in the group.

+      This is the forcible breaking of infinite loops as implemented in Perl

+      5.005. If there is an options reset, it will get obeyed in the normal

+      course of events. */

+

+      if (*ecode == OP_KET || eptr == saved_eptr)

+        {

+        ecode += 1+LINK_SIZE;

+        break;

+        }

+

+      /* The repeating kets try the rest of the pattern or restart from the

+      preceding bracket, in the appropriate order. We need to reset any options

+      that changed within the bracket before re-running it, so check the next

+      opcode. */

+

+      if (ecode[1+LINK_SIZE] == OP_OPT)

+        {

+        ims = (ims & ~PCRE_IMS) | ecode[4];

+        DPRINTF(("ims set to %02lx at group repeat\n", ims));

+        }

+

+      if (*ecode == OP_KETRMIN)

+        {

+        RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        }

+      else  /* OP_KETRMAX */

+        {

+        RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        }

+      }

+    RRETURN(MATCH_NOMATCH);

+

+    /* An alternation is the end of a branch; scan along to find the end of the

+    bracketed group and go to there. */

+

+    case OP_ALT:

+    do ecode += GET(ecode,1); while (*ecode == OP_ALT);

+    break;

+

+    /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating

+    that it may occur zero times. It may repeat infinitely, or not at all -

+    i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper

+    repeat limits are compiled as a number of copies, with the optional ones

+    preceded by BRAZERO or BRAMINZERO. */

+

+    case OP_BRAZERO:

+      {

+      next = ecode+1;

+      RMATCH(rrc, eptr, next, offset_top, md, ims, eptrb, match_isgroup);

+      if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+      do next += GET(next,1); while (*next == OP_ALT);

+      ecode = next + 1+LINK_SIZE;

+      }

+    break;

+

+    case OP_BRAMINZERO:

+      {

+      next = ecode+1;

+      do next += GET(next,1); while (*next == OP_ALT);

+      RMATCH(rrc, eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb,

+        match_isgroup);

+      if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+      ecode++;

+      }

+    break;

+

+    /* End of a group, repeated or non-repeating. If we are at the end of

+    an assertion "group", stop matching and return MATCH_MATCH, but record the

+    current high water mark for use by positive assertions. Do this also

+    for the "once" (not-backup up) groups. */

+

+    case OP_KET:

+    case OP_KETRMIN:

+    case OP_KETRMAX:

+      {

+      prev = ecode - GET(ecode, 1);

+      saved_eptr = eptrb->epb_saved_eptr;

+

+      /* Back up the stack of bracket start pointers. */

+

+      eptrb = eptrb->epb_prev;

+

+      if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||

+          *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||

+          *prev == OP_ONCE)

+        {

+        md->end_match_ptr = eptr;      /* For ONCE */

+        md->end_offset_top = offset_top;

+        RRETURN(MATCH_MATCH);

+        }

+

+      /* In all other cases except a conditional group we have to check the

+      group number back at the start and if necessary complete handling an

+      extraction by setting the offsets and bumping the high water mark. */

+

+      if (*prev != OP_COND)

+        {

+        number = *prev - OP_BRA;

+

+        /* For extended extraction brackets (large number), we have to fish out

+        the number from a dummy opcode at the start. */

+

+        if (number > EXTRACT_BASIC_MAX) number = GET2(prev, 2+LINK_SIZE);

+        offset = number << 1;

+

+#ifdef DEBUG

+        printf("end bracket %d", number);

+        printf("\n");

+#endif

+

+        /* Test for a numbered group. This includes groups called as a result

+        of recursion. Note that whole-pattern recursion is coded as a recurse

+        into group 0, so it won't be picked up here. Instead, we catch it when

+        the OP_END is reached. */

+

+        if (number > 0)

+          {

+          md->capture_last = number;

+          if (offset >= md->offset_max) md->offset_overflow = TRUE; else

+            {

+            md->offset_vector[offset] =

+              md->offset_vector[md->offset_end - number];

+            md->offset_vector[offset+1] = eptr - md->start_subject;

+            if (offset_top <= offset) offset_top = offset + 2;

+            }

+

+          /* Handle a recursively called group. Restore the offsets

+          appropriately and continue from after the call. */

+

+          if (md->recursive != NULL && md->recursive->group_num == number)

+            {

+            recursion_info *rec = md->recursive;

+            DPRINTF(("Recursion (%d) succeeded - continuing\n", number));

+            md->recursive = rec->prevrec;

+            md->start_match = rec->save_start;

+            memcpy(md->offset_vector, rec->offset_save,

+              rec->saved_max * sizeof(int));

+            ecode = rec->after_call;

+            ims = original_ims;

+            break;

+            }

+          }

+        }

+

+      /* Reset the value of the ims flags, in case they got changed during

+      the group. */

+

+      ims = original_ims;

+      DPRINTF(("ims reset to %02lx\n", ims));

+

+      /* For a non-repeating ket, just continue at this level. This also

+      happens for a repeating ket if no characters were matched in the group.

+      This is the forcible breaking of infinite loops as implemented in Perl

+      5.005. If there is an options reset, it will get obeyed in the normal

+      course of events. */

+

+      if (*ecode == OP_KET || eptr == saved_eptr)

+        {

+        ecode += 1 + LINK_SIZE;

+        break;

+        }

+

+      /* The repeating kets try the rest of the pattern or restart from the

+      preceding bracket, in the appropriate order. */

+

+      if (*ecode == OP_KETRMIN)

+        {

+        RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        }

+      else  /* OP_KETRMAX */

+        {

+        RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0);

+        if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+        }

+      }

+

+    RRETURN(MATCH_NOMATCH);

+

+    /* Start of subject unless notbol, or after internal newline if multiline */

+

+    case OP_CIRC:

+    if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH);

+    if ((ims & PCRE_MULTILINE) != 0)

+      {

+      if (eptr != md->start_subject && eptr[-1] != NEWLINE)

+        RRETURN(MATCH_NOMATCH);

+      ecode++;

+      break;

+      }

+    /* ... else fall through */

+

+    /* Start of subject assertion */

+

+    case OP_SOD:

+    if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    /* Start of match assertion */

+

+    case OP_SOM:

+    if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    /* Assert before internal newline if multiline, or before a terminating

+    newline unless endonly is set, else end of subject unless noteol is set. */

+

+    case OP_DOLL:

+    if ((ims & PCRE_MULTILINE) != 0)

+      {

+      if (eptr < md->end_subject)

+        { if (*eptr != NEWLINE) RRETURN(MATCH_NOMATCH); }

+      else

+        { if (md->noteol) RRETURN(MATCH_NOMATCH); }

+      ecode++;

+      break;

+      }

+    else

+      {

+      if (md->noteol) RRETURN(MATCH_NOMATCH);

+      if (!md->endonly)

+        {

+        if (eptr < md->end_subject - 1 ||

+           (eptr == md->end_subject - 1 && *eptr != NEWLINE))

+          RRETURN(MATCH_NOMATCH);

+        ecode++;

+        break;

+        }

+      }

+    /* ... else fall through */

+

+    /* End of subject assertion (\z) */

+

+    case OP_EOD:

+    if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    /* End of subject or ending \n assertion (\Z) */

+

+    case OP_EODN:

+    if (eptr < md->end_subject - 1 ||

+       (eptr == md->end_subject - 1 && *eptr != NEWLINE)) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    /* Word boundary assertions */

+

+    case OP_NOT_WORD_BOUNDARY:

+    case OP_WORD_BOUNDARY:

+      {

+

+      /* Find out if the previous and current characters are "word" characters.

+      It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to

+      be "non-word" characters. */

+

+#ifdef SUPPORT_UTF8

+      if (utf8)

+        {

+        if (eptr == md->start_subject) prev_is_word = FALSE; else

+          {

+          const uschar *lastptr = eptr - 1;

+          while((*lastptr & 0xc0) == 0x80) lastptr--;

+          GETCHAR(c, lastptr);

+          prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;

+          }

+        if (eptr >= md->end_subject) cur_is_word = FALSE; else

+          {

+          GETCHAR(c, eptr);

+          cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;

+          }

+        }

+      else

+#endif

+

+      /* More streamlined when not in UTF-8 mode */

+

+        {

+        prev_is_word = (eptr != md->start_subject) &&

+          ((md->ctypes[eptr[-1]] & ctype_word) != 0);

+        cur_is_word = (eptr < md->end_subject) &&

+          ((md->ctypes[*eptr] & ctype_word) != 0);

+        }

+

+      /* Now see if the situation is what we want */

+

+      if ((*ecode++ == OP_WORD_BOUNDARY)?

+           cur_is_word == prev_is_word : cur_is_word != prev_is_word)

+        RRETURN(MATCH_NOMATCH);

+      }

+    break;

+

+    /* Match a single character type; inline for speed */

+

+    case OP_ANY:

+    if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && *eptr == NEWLINE)

+      RRETURN(MATCH_NOMATCH);

+    if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH);

+#ifdef SUPPORT_UTF8

+    if (utf8)

+      while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+#endif

+    ecode++;

+    break;

+

+    /* Match a single byte, even in UTF-8 mode. This opcode really does match

+    any byte, even newline, independent of the setting of PCRE_DOTALL. */

+

+    case OP_ANYBYTE:

+    if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_NOT_DIGIT:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c < 256 &&

+#endif

+       (md->ctypes[c] & ctype_digit) != 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_DIGIT:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c >= 256 ||

+#endif

+       (md->ctypes[c] & ctype_digit) == 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_NOT_WHITESPACE:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c < 256 &&

+#endif

+       (md->ctypes[c] & ctype_space) != 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_WHITESPACE:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c >= 256 ||

+#endif

+       (md->ctypes[c] & ctype_space) == 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_NOT_WORDCHAR:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c < 256 &&

+#endif

+       (md->ctypes[c] & ctype_word) != 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+    case OP_WORDCHAR:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+    if (

+#ifdef SUPPORT_UTF8

+       c >= 256 ||

+#endif

+       (md->ctypes[c] & ctype_word) == 0

+       )

+      RRETURN(MATCH_NOMATCH);

+    ecode++;

+    break;

+

+#ifdef SUPPORT_UCP

+    /* Check the next character by Unicode property. We will get here only

+    if the support is in the binary; otherwise a compile-time error occurs. */

+

+    case OP_PROP:

+    case OP_NOTPROP:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+      {

+      int chartype, rqdtype;

+      int othercase;

+      int category = ucp_findchar(c, &chartype, &othercase);

+

+      rqdtype = *(++ecode);

+      ecode++;

+

+      if (rqdtype >= 128)

+        {

+        if ((rqdtype - 128 != category) == (op == OP_PROP))

+          RRETURN(MATCH_NOMATCH);

+        }

+      else

+        {

+        if ((rqdtype != chartype) == (op == OP_PROP))

+          RRETURN(MATCH_NOMATCH);

+        }

+      }

+    break;

+

+    /* Match an extended Unicode sequence. We will get here only if the support

+    is in the binary; otherwise a compile-time error occurs. */

+

+    case OP_EXTUNI:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    GETCHARINCTEST(c, eptr);

+      {

+      int chartype;

+      int othercase;

+      int category = ucp_findchar(c, &chartype, &othercase);

+      if (category == ucp_M) RRETURN(MATCH_NOMATCH);

+      while (eptr < md->end_subject)

+        {

+        int len = 1;

+        if (!utf8) c = *eptr; else

+          {

+          GETCHARLEN(c, eptr, len);

+          }

+        category = ucp_findchar(c, &chartype, &othercase);

+        if (category != ucp_M) break;

+        eptr += len;

+        }

+      }

+    ecode++;

+    break;

+#endif

+

+

+    /* Match a back reference, possibly repeatedly. Look past the end of the

+    item to see if there is repeat information following. The code is similar

+    to that for character classes, but repeated for efficiency. Then obey

+    similar code to character type repeats - written out again for speed.

+    However, if the referenced string is the empty string, always treat

+    it as matched, any number of times (otherwise there could be infinite

+    loops). */

+

+    case OP_REF:

+      {

+      offset = GET2(ecode, 1) << 1;               /* Doubled ref number */

+      ecode += 3;                                 /* Advance past item */

+

+      /* If the reference is unset, set the length to be longer than the amount

+      of subject left; this ensures that every attempt at a match fails. We

+      can't just fail here, because of the possibility of quantifiers with zero

+      minima. */

+

+      length = (offset >= offset_top || md->offset_vector[offset] < 0)?

+        md->end_subject - eptr + 1 :

+        md->offset_vector[offset+1] - md->offset_vector[offset];

+

+      /* Set up for repetition, or handle the non-repeated case */

+

+      switch (*ecode)

+        {

+        case OP_CRSTAR:

+        case OP_CRMINSTAR:

+        case OP_CRPLUS:

+        case OP_CRMINPLUS:

+        case OP_CRQUERY:

+        case OP_CRMINQUERY:

+        c = *ecode++ - OP_CRSTAR;

+        minimize = (c & 1) != 0;

+        min = rep_min[c];                 /* Pick up values from tables; */

+        max = rep_max[c];                 /* zero for max => infinity */

+        if (max == 0) max = INT_MAX;

+        break;

+

+        case OP_CRRANGE:

+        case OP_CRMINRANGE:

+        minimize = (*ecode == OP_CRMINRANGE);

+        min = GET2(ecode, 1);

+        max = GET2(ecode, 3);

+        if (max == 0) max = INT_MAX;

+        ecode += 5;

+        break;

+

+        default:               /* No repeat follows */

+        if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH);

+        eptr += length;

+        continue;              /* With the main loop */

+        }

+

+      /* If the length of the reference is zero, just continue with the

+      main loop. */

+

+      if (length == 0) continue;

+

+      /* First, ensure the minimum number of matches are present. We get back

+      the length of the reference string explicitly rather than passing the

+      address of eptr, so that eptr can be a register variable. */

+

+      for (i = 1; i <= min; i++)

+        {

+        if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH);

+        eptr += length;

+        }

+

+      /* If min = max, continue at the same level without recursion.

+      They are not both allowed to be zero. */

+

+      if (min == max) continue;

+

+      /* If minimizing, keep trying and advancing the pointer */

+

+      if (minimize)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || !match_ref(offset, eptr, length, md, ims))

+            RRETURN(MATCH_NOMATCH);

+          eptr += length;

+          }

+        /* Control never gets here */

+        }

+

+      /* If maximizing, find the longest string and work backwards */

+

+      else

+        {

+        pp = eptr;

+        for (i = min; i < max; i++)

+          {

+          if (!match_ref(offset, eptr, length, md, ims)) break;

+          eptr += length;

+          }

+        while (eptr >= pp)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          eptr -= length;

+          }

+        RRETURN(MATCH_NOMATCH);

+        }

+      }

+    /* Control never gets here */

+

+

+

+    /* Match a bit-mapped character class, possibly repeatedly. This op code is

+    used when all the characters in the class have values in the range 0-255,

+    and either the matching is caseful, or the characters are in the range

+    0-127 when UTF-8 processing is enabled. The only difference between

+    OP_CLASS and OP_NCLASS occurs when a data character outside the range is

+    encountered.

+

+    First, look past the end of the item to see if there is repeat information

+    following. Then obey similar code to character type repeats - written out

+    again for speed. */

+

+    case OP_NCLASS:

+    case OP_CLASS:

+      {

+      data = ecode + 1;                /* Save for matching */

+      ecode += 33;                     /* Advance past the item */

+

+      switch (*ecode)

+        {

+        case OP_CRSTAR:

+        case OP_CRMINSTAR:

+        case OP_CRPLUS:

+        case OP_CRMINPLUS:

+        case OP_CRQUERY:

+        case OP_CRMINQUERY:

+        c = *ecode++ - OP_CRSTAR;

+        minimize = (c & 1) != 0;

+        min = rep_min[c];                 /* Pick up values from tables; */

+        max = rep_max[c];                 /* zero for max => infinity */

+        if (max == 0) max = INT_MAX;

+        break;

+

+        case OP_CRRANGE:

+        case OP_CRMINRANGE:

+        minimize = (*ecode == OP_CRMINRANGE);

+        min = GET2(ecode, 1);

+        max = GET2(ecode, 3);

+        if (max == 0) max = INT_MAX;

+        ecode += 5;

+        break;

+

+        default:               /* No repeat follows */

+        min = max = 1;

+        break;

+        }

+

+      /* First, ensure the minimum number of matches are present. */

+

+#ifdef SUPPORT_UTF8

+      /* UTF-8 mode */

+      if (utf8)

+        {

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          GETCHARINC(c, eptr);

+          if (c > 255)

+            {

+            if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);

+            }

+          else

+            {

+            if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);

+            }

+          }

+        }

+      else

+#endif

+      /* Not UTF-8 mode */

+        {

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          c = *eptr++;

+          if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);

+          }

+        }

+

+      /* If max == min we can continue with the main loop without the

+      need to recurse. */

+

+      if (min == max) continue;

+

+      /* If minimizing, keep testing the rest of the expression and advancing

+      the pointer while it matches the class. */

+

+      if (minimize)

+        {

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+            GETCHARINC(c, eptr);

+            if (c > 255)

+              {

+              if (op == OP_CLASS) RRETURN(MATCH_NOMATCH);

+              }

+            else

+              {

+              if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);

+              }

+            }

+          }

+        else

+#endif

+        /* Not UTF-8 mode */

+          {

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+            c = *eptr++;

+            if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH);

+            }

+          }

+        /* Control never gets here */

+        }

+

+      /* If maximizing, find the longest possible run, then work backwards. */

+

+      else

+        {

+        pp = eptr;

+

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c > 255)

+              {

+              if (op == OP_CLASS) break;

+              }

+            else

+              {

+              if ((data[c/8] & (1 << (c&7))) == 0) break;

+              }

+            eptr += len;

+            }

+          for (;;)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (eptr-- == pp) break;        /* Stop if tried at original pos */

+            BACKCHAR(eptr);

+            }

+          }

+        else

+#endif

+          /* Not UTF-8 mode */

+          {

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject) break;

+            c = *eptr;

+            if ((data[c/8] & (1 << (c&7))) == 0) break;

+            eptr++;

+            }

+          while (eptr >= pp)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            eptr--;

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            }

+          }

+

+        RRETURN(MATCH_NOMATCH);

+        }

+      }

+    /* Control never gets here */

+

+

+    /* Match an extended character class. This opcode is encountered only

+    in UTF-8 mode, because that's the only time it is compiled. */

+

+#ifdef SUPPORT_UTF8

+    case OP_XCLASS:

+      {

+      data = ecode + 1 + LINK_SIZE;                /* Save for matching */

+      ecode += GET(ecode, 1);                      /* Advance past the item */

+

+      switch (*ecode)

+        {

+        case OP_CRSTAR:

+        case OP_CRMINSTAR:

+        case OP_CRPLUS:

+        case OP_CRMINPLUS:

+        case OP_CRQUERY:

+        case OP_CRMINQUERY:

+        c = *ecode++ - OP_CRSTAR;

+        minimize = (c & 1) != 0;

+        min = rep_min[c];                 /* Pick up values from tables; */

+        max = rep_max[c];                 /* zero for max => infinity */

+        if (max == 0) max = INT_MAX;

+        break;

+

+        case OP_CRRANGE:

+        case OP_CRMINRANGE:

+        minimize = (*ecode == OP_CRMINRANGE);

+        min = GET2(ecode, 1);

+        max = GET2(ecode, 3);

+        if (max == 0) max = INT_MAX;

+        ecode += 5;

+        break;

+

+        default:               /* No repeat follows */

+        min = max = 1;

+        break;

+        }

+

+      /* First, ensure the minimum number of matches are present. */

+

+      for (i = 1; i <= min; i++)

+        {

+        if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+        GETCHARINC(c, eptr);

+        if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH);

+        }

+

+      /* If max == min we can continue with the main loop without the

+      need to recurse. */

+

+      if (min == max) continue;

+

+      /* If minimizing, keep testing the rest of the expression and advancing

+      the pointer while it matches the class. */

+

+      if (minimize)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          GETCHARINC(c, eptr);

+          if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH);

+          }

+        /* Control never gets here */

+        }

+

+      /* If maximizing, find the longest possible run, then work backwards. */

+

+      else

+        {

+        pp = eptr;

+        for (i = min; i < max; i++)

+          {

+          int len = 1;

+          if (eptr >= md->end_subject) break;

+          GETCHARLEN(c, eptr, len);

+          if (!_pcre_xclass(c, data)) break;

+          eptr += len;

+          }

+        for(;;)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (eptr-- == pp) break;        /* Stop if tried at original pos */

+          BACKCHAR(eptr)

+          }

+        RRETURN(MATCH_NOMATCH);

+        }

+

+      /* Control never gets here */

+      }

+#endif    /* End of XCLASS */

+

+    /* Match a single character, casefully */

+

+    case OP_CHAR:

+#ifdef SUPPORT_UTF8

+    if (utf8)

+      {

+      length = 1;

+      ecode++;

+      GETCHARLEN(fc, ecode, length);

+      if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+      while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH);

+      }

+    else

+#endif

+

+    /* Non-UTF-8 mode */

+      {

+      if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH);

+      if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH);

+      ecode += 2;

+      }

+    break;

+

+    /* Match a single character, caselessly */

+

+    case OP_CHARNC:

+#ifdef SUPPORT_UTF8

+    if (utf8)

+      {

+      length = 1;

+      ecode++;

+      GETCHARLEN(fc, ecode, length);

+

+      if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+

+      /* If the pattern character's value is < 128, we have only one byte, and

+      can use the fast lookup table. */

+

+      if (fc < 128)

+        {

+        if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);

+        }

+

+      /* Otherwise we must pick up the subject character */

+

+      else

+        {

+        int dc;

+        GETCHARINC(dc, eptr);

+        ecode += length;

+

+        /* If we have Unicode property support, we can use it to test the other

+        case of the character, if there is one. The result of ucp_findchar() is

+        < 0 if the char isn't found, and othercase is returned as zero if there

+        isn't one. */

+

+        if (fc != dc)

+          {

+#ifdef SUPPORT_UCP

+          int chartype;

+          int othercase;

+          if (ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase)

+#endif

+            RRETURN(MATCH_NOMATCH);

+          }

+        }

+      }

+    else

+#endif   /* SUPPORT_UTF8 */

+

+    /* Non-UTF-8 mode */

+      {

+      if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH);

+      if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);

+      ecode += 2;

+      }

+    break;

+

+    /* Match a single character repeatedly; different opcodes share code. */

+

+    case OP_EXACT:

+    min = max = GET2(ecode, 1);

+    ecode += 3;

+    goto REPEATCHAR;

+

+    case OP_UPTO:

+    case OP_MINUPTO:

+    min = 0;

+    max = GET2(ecode, 1);

+    minimize = *ecode == OP_MINUPTO;

+    ecode += 3;

+    goto REPEATCHAR;

+

+    case OP_STAR:

+    case OP_MINSTAR:

+    case OP_PLUS:

+    case OP_MINPLUS:

+    case OP_QUERY:

+    case OP_MINQUERY:

+    c = *ecode++ - OP_STAR;

+    minimize = (c & 1) != 0;

+    min = rep_min[c];                 /* Pick up values from tables; */

+    max = rep_max[c];                 /* zero for max => infinity */

+    if (max == 0) max = INT_MAX;

+

+    /* Common code for all repeated single-character matches. We can give

+    up quickly if there are fewer than the minimum number of characters left in

+    the subject. */

+

+    REPEATCHAR:

+#ifdef SUPPORT_UTF8

+    if (utf8)

+      {

+      length = 1;

+      charptr = ecode;

+      GETCHARLEN(fc, ecode, length);

+      if (min * length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+      ecode += length;

+

+      /* Handle multibyte character matching specially here. There is

+      support for caseless matching if UCP support is present. */

+

+      if (length > 1)

+        {

+        int oclength = 0;

+        uschar occhars[8];

+

+#ifdef SUPPORT_UCP

+        int othercase;

+        int chartype;

+        if ((ims & PCRE_CASELESS) != 0 &&

+             ucp_findchar(fc, &chartype, &othercase) >= 0 &&

+             othercase > 0)

+          oclength = _pcre_ord2utf8(othercase, occhars);

+#endif  /* SUPPORT_UCP */

+

+        for (i = 1; i <= min; i++)

+          {

+          if (memcmp(eptr, charptr, length) == 0) eptr += length;

+          /* Need braces because of following else */

+          else if (oclength == 0) { RRETURN(MATCH_NOMATCH); }

+          else

+            {

+            if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH);

+            eptr += oclength;

+            }

+          }

+

+        if (min == max) continue;

+

+        if (minimize)

+          {

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+            if (memcmp(eptr, charptr, length) == 0) eptr += length;

+            /* Need braces because of following else */

+            else if (oclength == 0) { RRETURN(MATCH_NOMATCH); }

+            else

+              {

+              if (memcmp(eptr, occhars, oclength) != 0) RRETURN(MATCH_NOMATCH);

+              eptr += oclength;

+              }

+            }

+          /* Control never gets here */

+          }

+        else

+          {

+          pp = eptr;

+          for (i = min; i < max; i++)

+            {

+            if (eptr > md->end_subject - length) break;

+            if (memcmp(eptr, charptr, length) == 0) eptr += length;

+            else if (oclength == 0) break;

+            else

+              {

+              if (memcmp(eptr, occhars, oclength) != 0) break;

+              eptr += oclength;

+              }

+            }

+          while (eptr >= pp)

+           {

+           RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+           if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+           eptr -= length;

+           }

+          RRETURN(MATCH_NOMATCH);

+          }

+        /* Control never gets here */

+        }

+

+      /* If the length of a UTF-8 character is 1, we fall through here, and

+      obey the code as for non-UTF-8 characters below, though in this case the

+      value of fc will always be < 128. */

+      }

+    else

+#endif  /* SUPPORT_UTF8 */

+

+    /* When not in UTF-8 mode, load a single-byte character. */

+      {

+      if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+      fc = *ecode++;

+      }

+

+    /* The value of fc at this point is always less than 256, though we may or

+    may not be in UTF-8 mode. The code is duplicated for the caseless and

+    caseful cases, for speed, since matching characters is likely to be quite

+    common. First, ensure the minimum number of matches are present. If min =

+    max, continue at the same level without recursing. Otherwise, if

+    minimizing, keep trying the rest of the expression and advancing one

+    matching character if failing, up to the maximum. Alternatively, if

+    maximizing, find the maximum number of characters and work backwards. */

+

+    DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max,

+      max, eptr));

+

+    if ((ims & PCRE_CASELESS) != 0)

+      {

+      fc = md->lcc[fc];

+      for (i = 1; i <= min; i++)

+        if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);

+      if (min == max) continue;

+      if (minimize)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject ||

+              fc != md->lcc[*eptr++])

+            RRETURN(MATCH_NOMATCH);

+          }

+        /* Control never gets here */

+        }

+      else

+        {

+        pp = eptr;

+        for (i = min; i < max; i++)

+          {

+          if (eptr >= md->end_subject || fc != md->lcc[*eptr]) break;

+          eptr++;

+          }

+        while (eptr >= pp)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          eptr--;

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          }

+        RRETURN(MATCH_NOMATCH);

+        }

+      /* Control never gets here */

+      }

+

+    /* Caseful comparisons (includes all multi-byte characters) */

+

+    else

+      {

+      for (i = 1; i <= min; i++) if (fc != *eptr++) RRETURN(MATCH_NOMATCH);

+      if (min == max) continue;

+      if (minimize)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject || fc != *eptr++)

+            RRETURN(MATCH_NOMATCH);

+          }

+        /* Control never gets here */

+        }

+      else

+        {

+        pp = eptr;

+        for (i = min; i < max; i++)

+          {

+          if (eptr >= md->end_subject || fc != *eptr) break;

+          eptr++;

+          }

+        while (eptr >= pp)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          eptr--;

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          }

+        RRETURN(MATCH_NOMATCH);

+        }

+      }

+    /* Control never gets here */

+

+    /* Match a negated single one-byte character. The character we are

+    checking can be multibyte. */

+

+    case OP_NOT:

+    if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+    ecode++;

+    GETCHARINCTEST(c, eptr);

+    if ((ims & PCRE_CASELESS) != 0)

+      {

+#ifdef SUPPORT_UTF8

+      if (c < 256)

+#endif

+      c = md->lcc[c];

+      if (md->lcc[*ecode++] == c) RRETURN(MATCH_NOMATCH);

+      }

+    else

+      {

+      if (*ecode++ == c) RRETURN(MATCH_NOMATCH);

+      }

+    break;

+

+    /* Match a negated single one-byte character repeatedly. This is almost a

+    repeat of the code for a repeated single character, but I haven't found a

+    nice way of commoning these up that doesn't require a test of the

+    positive/negative option for each character match. Maybe that wouldn't add

+    very much to the time taken, but character matching *is* what this is all

+    about... */

+

+    case OP_NOTEXACT:

+    min = max = GET2(ecode, 1);

+    ecode += 3;

+    goto REPEATNOTCHAR;

+

+    case OP_NOTUPTO:

+    case OP_NOTMINUPTO:

+    min = 0;

+    max = GET2(ecode, 1);

+    minimize = *ecode == OP_NOTMINUPTO;

+    ecode += 3;

+    goto REPEATNOTCHAR;

+

+    case OP_NOTSTAR:

+    case OP_NOTMINSTAR:

+    case OP_NOTPLUS:

+    case OP_NOTMINPLUS:

+    case OP_NOTQUERY:

+    case OP_NOTMINQUERY:

+    c = *ecode++ - OP_NOTSTAR;

+    minimize = (c & 1) != 0;

+    min = rep_min[c];                 /* Pick up values from tables; */

+    max = rep_max[c];                 /* zero for max => infinity */

+    if (max == 0) max = INT_MAX;

+

+    /* Common code for all repeated single-byte matches. We can give up quickly

+    if there are fewer than the minimum number of bytes left in the

+    subject. */

+

+    REPEATNOTCHAR:

+    if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+    fc = *ecode++;

+

+    /* The code is duplicated for the caseless and caseful cases, for speed,

+    since matching characters is likely to be quite common. First, ensure the

+    minimum number of matches are present. If min = max, continue at the same

+    level without recursing. Otherwise, if minimizing, keep trying the rest of

+    the expression and advancing one matching character if failing, up to the

+    maximum. Alternatively, if maximizing, find the maximum number of

+    characters and work backwards. */

+

+    DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max,

+      max, eptr));

+

+    if ((ims & PCRE_CASELESS) != 0)

+      {

+      fc = md->lcc[fc];

+

+#ifdef SUPPORT_UTF8

+      /* UTF-8 mode */

+      if (utf8)

+        {

+        register int d;

+        for (i = 1; i <= min; i++)

+          {

+          GETCHARINC(d, eptr);

+          if (d < 256) d = md->lcc[d];

+          if (fc == d) RRETURN(MATCH_NOMATCH);

+          }

+        }

+      else

+#endif

+

+      /* Not UTF-8 mode */

+        {

+        for (i = 1; i <= min; i++)

+          if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);

+        }

+

+      if (min == max) continue;

+

+      if (minimize)

+        {

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          register int d;

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            GETCHARINC(d, eptr);

+            if (d < 256) d = md->lcc[d];

+            if (fi >= max || eptr >= md->end_subject || fc == d)

+              RRETURN(MATCH_NOMATCH);

+            }

+          }

+        else

+#endif

+        /* Not UTF-8 mode */

+          {

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (fi >= max || eptr >= md->end_subject || fc == md->lcc[*eptr++])

+              RRETURN(MATCH_NOMATCH);

+            }

+          }

+        /* Control never gets here */

+        }

+

+      /* Maximize case */

+

+      else

+        {

+        pp = eptr;

+

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          register int d;

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(d, eptr, len);

+            if (d < 256) d = md->lcc[d];

+            if (fc == d) break;

+            eptr += len;

+            }

+          for(;;)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (eptr-- == pp) break;        /* Stop if tried at original pos */

+            BACKCHAR(eptr);

+            }

+          }

+        else

+#endif

+        /* Not UTF-8 mode */

+          {

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break;

+            eptr++;

+            }

+          while (eptr >= pp)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            eptr--;

+            }

+          }

+

+        RRETURN(MATCH_NOMATCH);

+        }

+      /* Control never gets here */

+      }

+

+    /* Caseful comparisons */

+

+    else

+      {

+#ifdef SUPPORT_UTF8

+      /* UTF-8 mode */

+      if (utf8)

+        {

+        register int d;

+        for (i = 1; i <= min; i++)

+          {

+          GETCHARINC(d, eptr);

+          if (fc == d) RRETURN(MATCH_NOMATCH);

+          }

+        }

+      else

+#endif

+      /* Not UTF-8 mode */

+        {

+        for (i = 1; i <= min; i++)

+          if (fc == *eptr++) RRETURN(MATCH_NOMATCH);

+        }

+

+      if (min == max) continue;

+

+      if (minimize)

+        {

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          register int d;

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            GETCHARINC(d, eptr);

+            if (fi >= max || eptr >= md->end_subject || fc == d)

+              RRETURN(MATCH_NOMATCH);

+            }

+          }

+        else

+#endif

+        /* Not UTF-8 mode */

+          {

+          for (fi = min;; fi++)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (fi >= max || eptr >= md->end_subject || fc == *eptr++)

+              RRETURN(MATCH_NOMATCH);

+            }

+          }

+        /* Control never gets here */

+        }

+

+      /* Maximize case */

+

+      else

+        {

+        pp = eptr;

+

+#ifdef SUPPORT_UTF8

+        /* UTF-8 mode */

+        if (utf8)

+          {

+          register int d;

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(d, eptr, len);

+            if (fc == d) break;

+            eptr += len;

+            }

+          for(;;)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            if (eptr-- == pp) break;        /* Stop if tried at original pos */

+            BACKCHAR(eptr);

+            }

+          }

+        else

+#endif

+        /* Not UTF-8 mode */

+          {

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || fc == *eptr) break;

+            eptr++;

+            }

+          while (eptr >= pp)

+            {

+            RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+            if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+            eptr--;

+            }

+          }

+

+        RRETURN(MATCH_NOMATCH);

+        }

+      }

+    /* Control never gets here */

+

+    /* Match a single character type repeatedly; several different opcodes

+    share code. This is very similar to the code for single characters, but we

+    repeat it in the interests of efficiency. */

+

+    case OP_TYPEEXACT:

+    min = max = GET2(ecode, 1);

+    minimize = TRUE;

+    ecode += 3;

+    goto REPEATTYPE;

+

+    case OP_TYPEUPTO:

+    case OP_TYPEMINUPTO:

+    min = 0;

+    max = GET2(ecode, 1);

+    minimize = *ecode == OP_TYPEMINUPTO;

+    ecode += 3;

+    goto REPEATTYPE;

+

+    case OP_TYPESTAR:

+    case OP_TYPEMINSTAR:

+    case OP_TYPEPLUS:

+    case OP_TYPEMINPLUS:

+    case OP_TYPEQUERY:

+    case OP_TYPEMINQUERY:

+    c = *ecode++ - OP_TYPESTAR;

+    minimize = (c & 1) != 0;

+    min = rep_min[c];                 /* Pick up values from tables; */

+    max = rep_max[c];                 /* zero for max => infinity */

+    if (max == 0) max = INT_MAX;

+

+    /* Common code for all repeated single character type matches. Note that

+    in UTF-8 mode, '.' matches a character of any length, but for the other

+    character types, the valid characters are all one-byte long. */

+

+    REPEATTYPE:

+    ctype = *ecode++;      /* Code for the character type */

+

+#ifdef SUPPORT_UCP

+    if (ctype == OP_PROP || ctype == OP_NOTPROP)

+      {

+      prop_fail_result = ctype == OP_NOTPROP;

+      prop_type = *ecode++;

+      if (prop_type >= 128)

+        {

+        prop_test_against = prop_type - 128;

+        prop_test_variable = &prop_category;

+        }

+      else

+        {

+        prop_test_against = prop_type;

+        prop_test_variable = &prop_chartype;

+        }

+      }

+    else prop_type = -1;

+#endif

+

+    /* First, ensure the minimum number of matches are present. Use inline

+    code for maximizing the speed, and do the type test once at the start

+    (i.e. keep it out of the loop). Also we can test that there are at least

+    the minimum number of bytes before we start. This isn't as effective in

+    UTF-8 mode, but it does no harm. Separate the UTF-8 code completely as that

+    is tidier. Also separate the UCP code, which can be the same for both UTF-8

+    and single-bytes. */

+

+    if (min > md->end_subject - eptr) RRETURN(MATCH_NOMATCH);

+    if (min > 0)

+      {

+#ifdef SUPPORT_UCP

+      if (prop_type > 0)

+        {

+        for (i = 1; i <= min; i++)

+          {

+          GETCHARINC(c, eptr);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if ((*prop_test_variable == prop_test_against) == prop_fail_result)

+            RRETURN(MATCH_NOMATCH);

+          }

+        }

+

+      /* Match extended Unicode sequences. We will get here only if the

+      support is in the binary; otherwise a compile-time error occurs. */

+

+      else if (ctype == OP_EXTUNI)

+        {

+        for (i = 1; i <= min; i++)

+          {

+          GETCHARINCTEST(c, eptr);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH);

+          while (eptr < md->end_subject)

+            {

+            int len = 1;

+            if (!utf8) c = *eptr; else

+              {

+              GETCHARLEN(c, eptr, len);

+              }

+            prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+            if (prop_category != ucp_M) break;

+            eptr += len;

+            }

+          }

+        }

+

+      else

+#endif     /* SUPPORT_UCP */

+

+/* Handle all other cases when the coding is UTF-8 */

+

+#ifdef SUPPORT_UTF8

+      if (utf8) switch(ctype)

+        {

+        case OP_ANY:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             (*eptr++ == NEWLINE && (ims & PCRE_DOTALL) == 0))

+            RRETURN(MATCH_NOMATCH);

+          while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+          }

+        break;

+

+        case OP_ANYBYTE:

+        eptr += min;

+        break;

+

+        case OP_NOT_DIGIT:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          GETCHARINC(c, eptr);

+          if (c < 128 && (md->ctypes[c] & ctype_digit) != 0)

+            RRETURN(MATCH_NOMATCH);

+          }

+        break;

+

+        case OP_DIGIT:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             *eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0)

+            RRETURN(MATCH_NOMATCH);

+          /* No need to skip more bytes - we know it's a 1-byte character */

+          }

+        break;

+

+        case OP_NOT_WHITESPACE:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             (*eptr < 128 && (md->ctypes[*eptr++] & ctype_space) != 0))

+            RRETURN(MATCH_NOMATCH);

+          while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+          }

+        break;

+

+        case OP_WHITESPACE:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             *eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0)

+            RRETURN(MATCH_NOMATCH);

+          /* No need to skip more bytes - we know it's a 1-byte character */

+          }

+        break;

+

+        case OP_NOT_WORDCHAR:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             (*eptr < 128 && (md->ctypes[*eptr++] & ctype_word) != 0))

+            RRETURN(MATCH_NOMATCH);

+          while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+          }

+        break;

+

+        case OP_WORDCHAR:

+        for (i = 1; i <= min; i++)

+          {

+          if (eptr >= md->end_subject ||

+             *eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0)

+            RRETURN(MATCH_NOMATCH);

+          /* No need to skip more bytes - we know it's a 1-byte character */

+          }

+        break;

+

+        default:

+        RRETURN(PCRE_ERROR_INTERNAL);

+        }  /* End switch(ctype) */

+

+      else

+#endif     /* SUPPORT_UTF8 */

+

+      /* Code for the non-UTF-8 case for minimum matching of operators other

+      than OP_PROP and OP_NOTPROP. */

+

+      switch(ctype)

+        {

+        case OP_ANY:

+        if ((ims & PCRE_DOTALL) == 0)

+          {

+          for (i = 1; i <= min; i++)

+            if (*eptr++ == NEWLINE) RRETURN(MATCH_NOMATCH);

+          }

+        else eptr += min;

+        break;

+

+        case OP_ANYBYTE:

+        eptr += min;

+        break;

+

+        case OP_NOT_DIGIT:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);

+        break;

+

+        case OP_DIGIT:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);

+        break;

+

+        case OP_NOT_WHITESPACE:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);

+        break;

+

+        case OP_WHITESPACE:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);

+        break;

+

+        case OP_NOT_WORDCHAR:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_word) != 0)

+            RRETURN(MATCH_NOMATCH);

+        break;

+

+        case OP_WORDCHAR:

+        for (i = 1; i <= min; i++)

+          if ((md->ctypes[*eptr++] & ctype_word) == 0)

+            RRETURN(MATCH_NOMATCH);

+        break;

+

+        default:

+        RRETURN(PCRE_ERROR_INTERNAL);

+        }

+      }

+

+    /* If min = max, continue at the same level without recursing */

+

+    if (min == max) continue;

+

+    /* If minimizing, we have to test the rest of the pattern before each

+    subsequent match. Again, separate the UTF-8 case for speed, and also

+    separate the UCP cases. */

+

+    if (minimize)

+      {

+#ifdef SUPPORT_UCP

+      if (prop_type > 0)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          GETCHARINC(c, eptr);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if ((*prop_test_variable == prop_test_against) == prop_fail_result)

+            RRETURN(MATCH_NOMATCH);

+          }

+        }

+

+      /* Match extended Unicode sequences. We will get here only if the

+      support is in the binary; otherwise a compile-time error occurs. */

+

+      else if (ctype == OP_EXTUNI)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          GETCHARINCTEST(c, eptr);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH);

+          while (eptr < md->end_subject)

+            {

+            int len = 1;

+            if (!utf8) c = *eptr; else

+              {

+              GETCHARLEN(c, eptr, len);

+              }

+            prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+            if (prop_category != ucp_M) break;

+            eptr += len;

+            }

+          }

+        }

+

+      else

+#endif     /* SUPPORT_UCP */

+

+#ifdef SUPPORT_UTF8

+      /* UTF-8 mode */

+      if (utf8)

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+

+          GETCHARINC(c, eptr);

+          switch(ctype)

+            {

+            case OP_ANY:

+            if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_ANYBYTE:

+            break;

+

+            case OP_NOT_DIGIT:

+            if (c < 256 && (md->ctypes[c] & ctype_digit) != 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_DIGIT:

+            if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_NOT_WHITESPACE:

+            if (c < 256 && (md->ctypes[c] & ctype_space) != 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_WHITESPACE:

+            if  (c >= 256 || (md->ctypes[c] & ctype_space) == 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_NOT_WORDCHAR:

+            if (c < 256 && (md->ctypes[c] & ctype_word) != 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_WORDCHAR:

+            if (c >= 256 || (md->ctypes[c] & ctype_word) == 0)

+              RRETURN(MATCH_NOMATCH);

+            break;

+

+            default:

+            RRETURN(PCRE_ERROR_INTERNAL);

+            }

+          }

+        }

+      else

+#endif

+      /* Not UTF-8 mode */

+        {

+        for (fi = min;; fi++)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH);

+          c = *eptr++;

+          switch(ctype)

+            {

+            case OP_ANY:

+            if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_ANYBYTE:

+            break;

+

+            case OP_NOT_DIGIT:

+            if ((md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_DIGIT:

+            if ((md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_NOT_WHITESPACE:

+            if ((md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_WHITESPACE:

+            if  ((md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_NOT_WORDCHAR:

+            if ((md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            case OP_WORDCHAR:

+            if ((md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH);

+            break;

+

+            default:

+            RRETURN(PCRE_ERROR_INTERNAL);

+            }

+          }

+        }

+      /* Control never gets here */

+      }

+

+    /* If maximizing it is worth using inline code for speed, doing the type

+    test once at the start (i.e. keep it out of the loop). Again, keep the

+    UTF-8 and UCP stuff separate. */

+

+    else

+      {

+      pp = eptr;  /* Remember where we started */

+

+#ifdef SUPPORT_UCP

+      if (prop_type > 0)

+        {

+        for (i = min; i < max; i++)

+          {

+          int len = 1;

+          if (eptr >= md->end_subject) break;

+          GETCHARLEN(c, eptr, len);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if ((*prop_test_variable == prop_test_against) == prop_fail_result)

+            break;

+          eptr+= len;

+          }

+

+        /* eptr is now past the end of the maximum run */

+

+        for(;;)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (eptr-- == pp) break;        /* Stop if tried at original pos */

+          BACKCHAR(eptr);

+          }

+        }

+

+      /* Match extended Unicode sequences. We will get here only if the

+      support is in the binary; otherwise a compile-time error occurs. */

+

+      else if (ctype == OP_EXTUNI)

+        {

+        for (i = min; i < max; i++)

+          {

+          if (eptr >= md->end_subject) break;

+          GETCHARINCTEST(c, eptr);

+          prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+          if (prop_category == ucp_M) break;

+          while (eptr < md->end_subject)

+            {

+            int len = 1;

+            if (!utf8) c = *eptr; else

+              {

+              GETCHARLEN(c, eptr, len);

+              }

+            prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+            if (prop_category != ucp_M) break;

+            eptr += len;

+            }

+          }

+

+        /* eptr is now past the end of the maximum run */

+

+        for(;;)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (eptr-- == pp) break;        /* Stop if tried at original pos */

+          for (;;)                        /* Move back over one extended */

+            {

+            int len = 1;

+            BACKCHAR(eptr);

+            if (!utf8) c = *eptr; else

+              {

+              GETCHARLEN(c, eptr, len);

+              }

+            prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase);

+            if (prop_category != ucp_M) break;

+            eptr--;

+            }

+          }

+        }

+

+      else

+#endif   /* SUPPORT_UCP */

+

+#ifdef SUPPORT_UTF8

+      /* UTF-8 mode */

+

+      if (utf8)

+        {

+        switch(ctype)

+          {

+          case OP_ANY:

+

+          /* Special code is required for UTF8, but when the maximum is unlimited

+          we don't need it, so we repeat the non-UTF8 code. This is probably

+          worth it, because .* is quite a common idiom. */

+

+          if (max < INT_MAX)

+            {

+            if ((ims & PCRE_DOTALL) == 0)

+              {

+              for (i = min; i < max; i++)

+                {

+                if (eptr >= md->end_subject || *eptr == NEWLINE) break;

+                eptr++;

+                while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+                }

+              }

+            else

+              {

+              for (i = min; i < max; i++)

+                {

+                eptr++;

+                while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;

+                }

+              }

+            }

+

+          /* Handle unlimited UTF-8 repeat */

+

+          else

+            {

+            if ((ims & PCRE_DOTALL) == 0)

+              {

+              for (i = min; i < max; i++)

+                {

+                if (eptr >= md->end_subject || *eptr == NEWLINE) break;

+                eptr++;

+                }

+              break;

+              }

+            else

+              {

+              c = max - min;

+              if (c > md->end_subject - eptr) c = md->end_subject - eptr;

+              eptr += c;

+              }

+            }

+          break;

+

+          /* The byte case is the same as non-UTF8 */

+

+          case OP_ANYBYTE:

+          c = max - min;

+          if (c > md->end_subject - eptr) c = md->end_subject - eptr;

+          eptr += c;

+          break;

+

+          case OP_NOT_DIGIT:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break;

+            eptr+= len;

+            }

+          break;

+

+          case OP_DIGIT:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break;

+            eptr+= len;

+            }

+          break;

+

+          case OP_NOT_WHITESPACE:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c < 256 && (md->ctypes[c] & ctype_space) != 0) break;

+            eptr+= len;

+            }

+          break;

+

+          case OP_WHITESPACE:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c >= 256 ||(md->ctypes[c] & ctype_space) == 0) break;

+            eptr+= len;

+            }

+          break;

+

+          case OP_NOT_WORDCHAR:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break;

+            eptr+= len;

+            }

+          break;

+

+          case OP_WORDCHAR:

+          for (i = min; i < max; i++)

+            {

+            int len = 1;

+            if (eptr >= md->end_subject) break;

+            GETCHARLEN(c, eptr, len);

+            if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break;

+            eptr+= len;

+            }

+          break;

+

+          default:

+          RRETURN(PCRE_ERROR_INTERNAL);

+          }

+

+        /* eptr is now past the end of the maximum run */

+

+        for(;;)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          if (eptr-- == pp) break;        /* Stop if tried at original pos */

+          BACKCHAR(eptr);

+          }

+        }

+      else

+#endif

+

+      /* Not UTF-8 mode */

+        {

+        switch(ctype)

+          {

+          case OP_ANY:

+          if ((ims & PCRE_DOTALL) == 0)

+            {

+            for (i = min; i < max; i++)

+              {

+              if (eptr >= md->end_subject || *eptr == NEWLINE) break;

+              eptr++;

+              }

+            break;

+            }

+          /* For DOTALL case, fall through and treat as \C */

+

+          case OP_ANYBYTE:

+          c = max - min;

+          if (c > md->end_subject - eptr) c = md->end_subject - eptr;

+          eptr += c;

+          break;

+

+          case OP_NOT_DIGIT:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          case OP_DIGIT:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          case OP_NOT_WHITESPACE:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          case OP_WHITESPACE:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          case OP_NOT_WORDCHAR:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          case OP_WORDCHAR:

+          for (i = min; i < max; i++)

+            {

+            if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0)

+              break;

+            eptr++;

+            }

+          break;

+

+          default:

+          RRETURN(PCRE_ERROR_INTERNAL);

+          }

+

+        /* eptr is now past the end of the maximum run */

+

+        while (eptr >= pp)

+          {

+          RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0);

+          eptr--;

+          if (rrc != MATCH_NOMATCH) RRETURN(rrc);

+          }

+        }

+

+      /* Get here if we can't make it match with any permitted repetitions */

+

+      RRETURN(MATCH_NOMATCH);

+      }

+    /* Control never gets here */

+

+    /* There's been some horrible disaster. Since all codes > OP_BRA are

+    for capturing brackets, and there shouldn't be any gaps between 0 and

+    OP_BRA, arrival here can only mean there is something seriously wrong

+    in the code above or the OP_xxx definitions. */

+

+    default:

+    DPRINTF(("Unknown opcode %d\n", *ecode));

+    RRETURN(PCRE_ERROR_UNKNOWN_NODE);

+    }

+

+  /* Do not stick any code in here without much thought; it is assumed

+  that "continue" in the code above comes out to here to repeat the main

+  loop. */

+

+  }             /* End of main loop */

+/* Control never reaches here */

+}

+

+

+/***************************************************************************

+****************************************************************************

+                   RECURSION IN THE match() FUNCTION

+

+Undefine all the macros that were defined above to handle this. */

+

+#ifdef NO_RECURSE

+#undef eptr

+#undef ecode

+#undef offset_top

+#undef ims

+#undef eptrb

+#undef flags

+

+#undef callpat

+#undef charptr

+#undef data

+#undef next

+#undef pp

+#undef prev

+#undef saved_eptr

+

+#undef new_recursive

+

+#undef cur_is_word

+#undef condition

+#undef minimize

+#undef prev_is_word

+

+#undef original_ims

+

+#undef ctype

+#undef length

+#undef max

+#undef min

+#undef number

+#undef offset

+#undef op

+#undef save_capture_last

+#undef save_offset1

+#undef save_offset2

+#undef save_offset3

+#undef stacksave

+

+#undef newptrb

+

+#endif

+

+/* These two are defined as macros in both cases */

+

+#undef fc

+#undef fi

+

+/***************************************************************************

+***************************************************************************/

+

+

+

+/*************************************************

+*         Execute a Regular Expression           *

+*************************************************/

+

+/* This function applies a compiled re to a subject string and picks out

+portions of the string if it matches. Two elements in the vector are set for

+each substring: the offsets to the start and end of the substring.

+

+Arguments:

+  argument_re     points to the compiled expression

+  extra_data      points to extra data or is NULL

+  subject         points to the subject string

+  length          length of subject string (may contain binary zeros)

+  start_offset    where to start in the subject string

+  options         option bits

+  offsets         points to a vector of ints to be filled in with offsets

+  offsetcount     the number of elements in the vector

+

+Returns:          > 0 => success; value is the number of elements filled in

+                  = 0 => success, but offsets is not big enough

+                   -1 => failed to match

+                 < -1 => some kind of unexpected problem

+*/

+

+EXPORT int

+pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,

+  const char *subject, int length, int start_offset, int options, int *offsets,

+  int offsetcount)

+{

+int rc, resetcount, ocount;

+int first_byte = -1;

+int req_byte = -1;

+int req_byte2 = -1;

+unsigned long int ims = 0;

+BOOL using_temporary_offsets = FALSE;

+BOOL anchored;

+BOOL startline;

+BOOL firstline;

+BOOL first_byte_caseless = FALSE;

+BOOL req_byte_caseless = FALSE;

+match_data match_block;

+const uschar *tables;

+const uschar *start_bits = NULL;

+const uschar *start_match = (const uschar *)subject + start_offset;

+const uschar *end_subject;

+const uschar *req_byte_ptr = start_match - 1;

+

+pcre_study_data internal_study;

+const pcre_study_data *study;

+

+real_pcre internal_re;

+const real_pcre *external_re = (const real_pcre *)argument_re;

+const real_pcre *re = external_re;

+

+/* Plausibility checks */

+

+if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;

+if (re == NULL || subject == NULL ||

+   (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;

+if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;

+

+/* Fish out the optional data from the extra_data structure, first setting

+the default values. */

+

+study = NULL;

+match_block.match_limit = MATCH_LIMIT;

+match_block.callout_data = NULL;

+

+/* The table pointer is always in native byte order. */

+

+tables = external_re->tables;

+

+if (extra_data != NULL)

+  {

+  register unsigned int flags = extra_data->flags;

+  if ((flags & PCRE_EXTRA_STUDY_DATA) != 0)

+    study = (const pcre_study_data *)extra_data->study_data;

+  if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0)

+    match_block.match_limit = extra_data->match_limit;

+  if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)

+    match_block.callout_data = extra_data->callout_data;

+  if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;

+  }

+

+/* If the exec call supplied NULL for tables, use the inbuilt ones. This

+is a feature that makes it possible to save compiled regex and re-use them

+in other programs later. */

+

+if (tables == NULL) tables = _pcre_default_tables;

+

+/* Check that the first field in the block is the magic number. If it is not,

+test for a regex that was compiled on a host of opposite endianness. If this is

+the case, flipped values are put in internal_re and internal_study if there was

+study data too. */

+

+if (re->magic_number != MAGIC_NUMBER)

+  {

+  re = _pcre_try_flipped(re, &internal_re, study, &internal_study);

+  if (re == NULL) return PCRE_ERROR_BADMAGIC;

+  if (study != NULL) study = &internal_study;

+  }

+

+/* Set up other data */

+

+anchored = ((re->options | options) & PCRE_ANCHORED) != 0;

+startline = (re->options & PCRE_STARTLINE) != 0;

+firstline = (re->options & PCRE_FIRSTLINE) != 0;

+

+/* The code starts after the real_pcre block and the capture name table. */

+

+match_block.start_code = (const uschar *)external_re + re->name_table_offset +

+  re->name_count * re->name_entry_size;

+

+match_block.start_subject = (const uschar *)subject;

+match_block.start_offset = start_offset;

+match_block.end_subject = match_block.start_subject + length;

+end_subject = match_block.end_subject;

+

+match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;

+match_block.utf8 = (re->options & PCRE_UTF8) != 0;

+

+match_block.notbol = (options & PCRE_NOTBOL) != 0;

+match_block.noteol = (options & PCRE_NOTEOL) != 0;

+match_block.notempty = (options & PCRE_NOTEMPTY) != 0;

+match_block.partial = (options & PCRE_PARTIAL) != 0;

+match_block.hitend = FALSE;

+

+match_block.recursive = NULL;                   /* No recursion at top level */

+

+match_block.lcc = tables + lcc_offset;

+match_block.ctypes = tables + ctypes_offset;

+

+/* Partial matching is supported only for a restricted set of regexes at the

+moment. */

+

+if (match_block.partial && (re->options & PCRE_NOPARTIAL) != 0)

+  return PCRE_ERROR_BADPARTIAL;

+

+/* Check a UTF-8 string if required. Unfortunately there's no way of passing

+back the character offset. */

+

+#ifdef SUPPORT_UTF8

+if (match_block.utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)

+  {

+  if (_pcre_valid_utf8((uschar *)subject, length) >= 0)

+    return PCRE_ERROR_BADUTF8;

+  if (start_offset > 0 && start_offset < length)

+    {

+    int tb = ((uschar *)subject)[start_offset];

+    if (tb > 127)

+      {

+      tb &= 0xc0;

+      if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;

+      }

+    }

+  }

+#endif

+

+/* The ims options can vary during the matching as a result of the presence

+of (?ims) items in the pattern. They are kept in a local variable so that

+restoring at the exit of a group is easy. */

+

+ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL);

+

+/* If the expression has got more back references than the offsets supplied can

+hold, we get a temporary chunk of working store to use during the matching.

+Otherwise, we can use the vector supplied, rounding down its size to a multiple

+of 3. */

+

+ocount = offsetcount - (offsetcount % 3);

+

+if (re->top_backref > 0 && re->top_backref >= ocount/3)

+  {

+  ocount = re->top_backref * 3 + 3;

+  match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));

+  if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;

+  using_temporary_offsets = TRUE;

+  DPRINTF(("Got memory to hold back references\n"));

+  }

+else match_block.offset_vector = offsets;

+

+match_block.offset_end = ocount;

+match_block.offset_max = (2*ocount)/3;

+match_block.offset_overflow = FALSE;

+match_block.capture_last = -1;

+

+/* Compute the minimum number of offsets that we need to reset each time. Doing

+this makes a huge difference to execution time when there aren't many brackets

+in the pattern. */

+

+resetcount = 2 + re->top_bracket * 2;

+if (resetcount > offsetcount) resetcount = ocount;

+

+/* Reset the working variable associated with each extraction. These should

+never be used unless previously set, but they get saved and restored, and so we

+initialize them to avoid reading uninitialized locations. */

+

+if (match_block.offset_vector != NULL)

+  {

+  register int *iptr = match_block.offset_vector + ocount;

+  register int *iend = iptr - resetcount/2 + 1;

+  while (--iptr >= iend) *iptr = -1;

+  }

+

+/* Set up the first character to match, if available. The first_byte value is

+never set for an anchored regular expression, but the anchoring may be forced

+at run time, so we have to test for anchoring. The first char may be unset for

+an unanchored pattern, of course. If there's no first char and the pattern was

+studied, there may be a bitmap of possible first characters. */

+

+if (!anchored)

+  {

+  if ((re->options & PCRE_FIRSTSET) != 0)

+    {

+    first_byte = re->first_byte & 255;

+    if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE)

+      first_byte = match_block.lcc[first_byte];

+    }

+  else

+    if (!startline && study != NULL &&

+      (study->options & PCRE_STUDY_MAPPED) != 0)

+        start_bits = study->start_bits;

+  }

+

+/* For anchored or unanchored matches, there may be a "last known required

+character" set. */

+

+if ((re->options & PCRE_REQCHSET) != 0)

+  {

+  req_byte = re->req_byte & 255;

+  req_byte_caseless = (re->req_byte & REQ_CASELESS) != 0;

+  req_byte2 = (tables + fcc_offset)[req_byte];  /* case flipped */

+  }

+

+/* Loop for handling unanchored repeated matching attempts; for anchored regexs

+the loop runs just once. */

+

+do

+  {

+  const uschar *save_end_subject = end_subject;

+

+  /* Reset the maximum number of extractions we might see. */

+

+  if (match_block.offset_vector != NULL)

+    {

+    register int *iptr = match_block.offset_vector;

+    register int *iend = iptr + resetcount;

+    while (iptr < iend) *iptr++ = -1;

+    }

+

+  /* Advance to a unique first char if possible. If firstline is TRUE, the

+  start of the match is constrained to the first line of a multiline string.

+  Implement this by temporarily adjusting end_subject so that we stop scanning

+  at a newline. If the match fails at the newline, later code breaks this loop.

+  */

+

+  if (firstline)

+    {

+    const uschar *t = start_match;

+    while (t < save_end_subject && *t != '\n') t++;

+    end_subject = t;

+    }

+

+  /* Now test for a unique first byte */

+

+  if (first_byte >= 0)

+    {

+    if (first_byte_caseless)

+      while (start_match < end_subject &&

+             match_block.lcc[*start_match] != first_byte)

+        start_match++;

+    else

+      while (start_match < end_subject && *start_match != first_byte)

+        start_match++;

+    }

+

+  /* Or to just after \n for a multiline match if possible */

+

+  else if (startline)

+    {

+    if (start_match > match_block.start_subject + start_offset)

+      {

+      while (start_match < end_subject && start_match[-1] != NEWLINE)

+        start_match++;

+      }

+    }

+

+  /* Or to a non-unique first char after study */

+

+  else if (start_bits != NULL)

+    {

+    while (start_match < end_subject)

+      {

+      register unsigned int c = *start_match;

+      if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; else break;

+      }

+    }

+

+  /* Restore fudged end_subject */

+

+  end_subject = save_end_subject;

+

+#ifdef DEBUG  /* Sigh. Some compilers never learn. */

+  printf(">>>> Match against: ");

+  pchars(start_match, end_subject - start_match, TRUE, &match_block);

+  printf("\n");

+#endif

+

+  /* If req_byte is set, we know that that character must appear in the subject

+  for the match to succeed. If the first character is set, req_byte must be

+  later in the subject; otherwise the test starts at the match point. This

+  optimization can save a huge amount of backtracking in patterns with nested

+  unlimited repeats that aren't going to match. Writing separate code for

+  cased/caseless versions makes it go faster, as does using an autoincrement

+  and backing off on a match.

+

+  HOWEVER: when the subject string is very, very long, searching to its end can

+  take a long time, and give bad performance on quite ordinary patterns. This

+  showed up when somebody was matching /^C/ on a 32-megabyte string... so we

+  don't do this when the string is sufficiently long.

+

+  ALSO: this processing is disabled when partial matching is requested.

+  */

+

+  if (req_byte >= 0 &&

+      end_subject - start_match < REQ_BYTE_MAX &&

+      !match_block.partial)

+    {

+    register const uschar *p = start_match + ((first_byte >= 0)? 1 : 0);

+

+    /* We don't need to repeat the search if we haven't yet reached the

+    place we found it at last time. */

+

+    if (p > req_byte_ptr)

+      {

+      if (req_byte_caseless)

+        {

+        while (p < end_subject)

+          {

+          register int pp = *p++;

+          if (pp == req_byte || pp == req_byte2) { p--; break; }

+          }

+        }

+      else

+        {

+        while (p < end_subject)

+          {

+          if (*p++ == req_byte) { p--; break; }

+          }

+        }

+

+      /* If we can't find the required character, break the matching loop */

+

+      if (p >= end_subject) break;

+

+      /* If we have found the required character, save the point where we

+      found it, so that we don't search again next time round the loop if

+      the start hasn't passed this character yet. */

+

+      req_byte_ptr = p;

+      }

+    }

+

+  /* When a match occurs, substrings will be set for all internal extractions;

+  we just need to set up the whole thing as substring 0 before returning. If

+  there were too many extractions, set the return code to zero. In the case

+  where we had to get some local store to hold offsets for backreferences, copy

+  those back references that we can. In this case there need not be overflow

+  if certain parts of the pattern were not used. */

+

+  match_block.start_match = start_match;

+  match_block.match_call_count = 0;

+

+  rc = match(start_match, match_block.start_code, 2, &match_block, ims, NULL,

+    match_isgroup);

+

+  /* When the result is no match, if the subject's first character was a

+  newline and the PCRE_FIRSTLINE option is set, break (which will return

+  PCRE_ERROR_NOMATCH). The option requests that a match occur before the first

+  newline in the subject. Otherwise, advance the pointer to the next character

+  and continue - but the continuation will actually happen only when the

+  pattern is not anchored. */

+

+  if (rc == MATCH_NOMATCH)

+    {

+    if (firstline && *start_match == NEWLINE) break;

+    start_match++;

+#ifdef SUPPORT_UTF8

+    if (match_block.utf8)

+      while(start_match < end_subject && (*start_match & 0xc0) == 0x80)

+        start_match++;

+#endif

+    continue;

+    }

+

+  if (rc != MATCH_MATCH)

+    {

+    DPRINTF((">>>> error: returning %d\n", rc));

+    return rc;

+    }

+

+  /* We have a match! Copy the offset information from temporary store if

+  necessary */

+

+  if (using_temporary_offsets)

+    {

+    if (offsetcount >= 4)

+      {

+      memcpy(offsets + 2, match_block.offset_vector + 2,

+        (offsetcount - 2) * sizeof(int));

+      DPRINTF(("Copied offsets from temporary memory\n"));

+      }

+    if (match_block.end_offset_top > offsetcount)

+      match_block.offset_overflow = TRUE;

+

+    DPRINTF(("Freeing temporary memory\n"));

+    (pcre_free)(match_block.offset_vector);

+    }

+

+  rc = match_block.offset_overflow? 0 : match_block.end_offset_top/2;

+

+  if (offsetcount < 2) rc = 0; else

+    {

+    offsets[0] = start_match - match_block.start_subject;

+    offsets[1] = match_block.end_match_ptr - match_block.start_subject;

+    }

+

+  DPRINTF((">>>> returning %d\n", rc));

+  return rc;

+  }

+

+/* This "while" is the end of the "do" above */

+

+while (!anchored && start_match <= end_subject);

+

+if (using_temporary_offsets)

+  {

+  DPRINTF(("Freeing temporary memory\n"));

+  (pcre_free)(match_block.offset_vector);

+  }

+

+if (match_block.partial && match_block.hitend)

+  {

+  DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n"));

+  return PCRE_ERROR_PARTIAL;

+  }

+else

+  {

+  DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n"));

+  return PCRE_ERROR_NOMATCH;

+  }

+}

+

+/* End of pcre_exec.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/*PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_fullinfo(), which returns

+information about a compiled pattern. */

+

+

+

+

+/*************************************************

+*        Return info about compiled pattern      *

+*************************************************/

+

+/* This is a newer "info" function which has an extensible interface so

+that additional items can be added compatibly.

+

+Arguments:

+  argument_re      points to compiled code

+  extra_data       points extra data, or NULL

+  what             what information is required

+  where            where to put the information

+

+Returns:           0 if data returned, negative on error

+*/

+

+EXPORT int

+pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what,

+  void *where)

+{

+real_pcre internal_re;

+pcre_study_data internal_study;

+const real_pcre *re = (const real_pcre *)argument_re;

+const pcre_study_data *study = NULL;

+

+if (re == NULL || where == NULL) return PCRE_ERROR_NULL;

+

+if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)

+  study = (const pcre_study_data *)extra_data->study_data;

+

+if (re->magic_number != MAGIC_NUMBER)

+  {

+  re = _pcre_try_flipped(re, &internal_re, study, &internal_study);

+  if (re == NULL) return PCRE_ERROR_BADMAGIC;

+  if (study != NULL) study = &internal_study;

+  }

+

+switch (what)

+  {

+  case PCRE_INFO_OPTIONS:

+  *((unsigned long int *)where) = re->options & PUBLIC_OPTIONS;

+  break;

+

+  case PCRE_INFO_SIZE:

+  *((size_t *)where) = re->size;

+  break;

+

+  case PCRE_INFO_STUDYSIZE:

+  *((size_t *)where) = (study == NULL)? 0 : study->size;

+  break;

+

+  case PCRE_INFO_CAPTURECOUNT:

+  *((int *)where) = re->top_bracket;

+  break;

+

+  case PCRE_INFO_BACKREFMAX:

+  *((int *)where) = re->top_backref;

+  break;

+

+  case PCRE_INFO_FIRSTBYTE:

+  *((int *)where) =

+    ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte :

+    ((re->options & PCRE_STARTLINE) != 0)? -1 : -2;

+  break;

+

+  /* Make sure we pass back the pointer to the bit vector in the external

+  block, not the internal copy (with flipped integer fields). */

+

+  case PCRE_INFO_FIRSTTABLE:

+  *((const uschar **)where) =

+    (study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)?

+      ((const pcre_study_data *)extra_data->study_data)->start_bits : NULL;

+  break;

+

+  case PCRE_INFO_LASTLITERAL:

+  *((int *)where) =

+    ((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1;

+  break;

+

+  case PCRE_INFO_NAMEENTRYSIZE:

+  *((int *)where) = re->name_entry_size;

+  break;

+

+  case PCRE_INFO_NAMECOUNT:

+  *((int *)where) = re->name_count;

+  break;

+

+  case PCRE_INFO_NAMETABLE:

+  *((const uschar **)where) = (const uschar *)re + re->name_table_offset;

+  break;

+

+  case PCRE_INFO_DEFAULT_TABLES:

+  *((const uschar **)where) = (const uschar *)(_pcre_default_tables);

+  break;

+

+  default: return PCRE_ERROR_BADOPTION;

+  }

+

+return 0;

+}

+

+/* End of pcre_fullinfo.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains some convenience functions for extracting substrings

+from the subject string after a regex match has succeeded. The original idea

+for these functions came from Scott Wimer. */

+

+

+

+

+/*************************************************

+*           Find number for named string         *

+*************************************************/

+

+/* This function is used by the two extraction functions below, as well

+as being generally available.

+

+Arguments:

+  code        the compiled regex

+  stringname  the name whose number is required

+

+Returns:      the number of the named parentheses, or a negative number

+                (PCRE_ERROR_NOSUBSTRING) if not found

+*/

+

+int

+pcre_get_stringnumber(const pcre *code, const char *stringname)

+{

+int rc;

+int entrysize;

+int top, bot;

+uschar *nametable;

+

+if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0)

+  return rc;

+if (top <= 0) return PCRE_ERROR_NOSUBSTRING;

+

+if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0)

+  return rc;

+if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0)

+  return rc;

+

+bot = 0;

+while (top > bot)

+  {

+  int mid = (top + bot) / 2;

+  uschar *entry = nametable + entrysize*mid;

+  int c = strcmp(stringname, (char *)(entry + 2));

+  if (c == 0) return (entry[0] << 8) + entry[1];

+  if (c > 0) bot = mid + 1; else top = mid;

+  }

+

+return PCRE_ERROR_NOSUBSTRING;

+}

+

+

+

+/*************************************************

+*      Copy captured string to given buffer      *

+*************************************************/

+

+/* This function copies a single captured substring into a given buffer.

+Note that we use memcpy() rather than strncpy() in case there are binary zeros

+in the string.

+

+Arguments:

+  subject        the subject string that was matched

+  ovector        pointer to the offsets table

+  stringcount    the number of substrings that were captured

+                   (i.e. the yield of the pcre_exec call, unless

+                   that was zero, in which case it should be 1/3

+                   of the offset table size)

+  stringnumber   the number of the required substring

+  buffer         where to put the substring

+  size           the size of the buffer

+

+Returns:         if successful:

+                   the length of the copied string, not including the zero

+                   that is put on the end; can be zero

+                 if not successful:

+                   PCRE_ERROR_NOMEMORY (-6) buffer too small

+                   PCRE_ERROR_NOSUBSTRING (-7) no such captured substring

+*/

+

+int

+pcre_copy_substring(const char *subject, int *ovector, int stringcount,

+  int stringnumber, char *buffer, int size)

+{

+int yield;

+if (stringnumber < 0 || stringnumber >= stringcount)

+  return PCRE_ERROR_NOSUBSTRING;

+stringnumber *= 2;

+yield = ovector[stringnumber+1] - ovector[stringnumber];

+if (size < yield + 1) return PCRE_ERROR_NOMEMORY;

+memcpy(buffer, subject + ovector[stringnumber], yield);

+buffer[yield] = 0;

+return yield;

+}

+

+

+

+/*************************************************

+*   Copy named captured string to given buffer   *

+*************************************************/

+

+/* This function copies a single captured substring into a given buffer,

+identifying it by name.

+

+Arguments:

+  code           the compiled regex

+  subject        the subject string that was matched

+  ovector        pointer to the offsets table

+  stringcount    the number of substrings that were captured

+                   (i.e. the yield of the pcre_exec call, unless

+                   that was zero, in which case it should be 1/3

+                   of the offset table size)

+  stringname     the name of the required substring

+  buffer         where to put the substring

+  size           the size of the buffer

+

+Returns:         if successful:

+                   the length of the copied string, not including the zero

+                   that is put on the end; can be zero

+                 if not successful:

+                   PCRE_ERROR_NOMEMORY (-6) buffer too small

+                   PCRE_ERROR_NOSUBSTRING (-7) no such captured substring

+*/

+

+int

+pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector,

+  int stringcount, const char *stringname, char *buffer, int size)

+{

+int n = pcre_get_stringnumber(code, stringname);

+if (n <= 0) return n;

+return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);

+}

+

+

+

+/*************************************************

+*      Copy all captured strings to new store    *

+*************************************************/

+

+/* This function gets one chunk of store and builds a list of pointers and all

+of the captured substrings in it. A NULL pointer is put on the end of the list.

+

+Arguments:

+  subject        the subject string that was matched

+  ovector        pointer to the offsets table

+  stringcount    the number of substrings that were captured

+                   (i.e. the yield of the pcre_exec call, unless

+                   that was zero, in which case it should be 1/3

+                   of the offset table size)

+  listptr        set to point to the list of pointers

+

+Returns:         if successful: 0

+                 if not successful:

+                   PCRE_ERROR_NOMEMORY (-6) failed to get store

+*/

+

+int

+pcre_get_substring_list(const char *subject, int *ovector, int stringcount,

+  const char ***listptr)

+{

+int i;

+int size = sizeof(char *);

+int double_count = stringcount * 2;

+char **stringlist;

+char *p;

+

+for (i = 0; i < double_count; i += 2)

+  size += sizeof(char *) + ovector[i+1] - ovector[i] + 1;

+

+stringlist = (char **)(pcre_malloc)(size);

+if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;

+

+*listptr = (const char **)stringlist;

+p = (char *)(stringlist + stringcount + 1);

+

+for (i = 0; i < double_count; i += 2)

+  {

+  int len = ovector[i+1] - ovector[i];

+  memcpy(p, subject + ovector[i], len);

+  *stringlist++ = p;

+  p += len;

+  *p++ = 0;

+  }

+

+*stringlist = NULL;

+return 0;

+}

+

+

+

+/*************************************************

+*   Free store obtained by get_substring_list    *

+*************************************************/

+

+/* This function exists for the benefit of people calling PCRE from non-C

+programs that can call its functions, but not free() or (pcre_free)() directly.

+

+Argument:   the result of a previous pcre_get_substring_list()

+Returns:    nothing

+*/

+

+void

+pcre_free_substring_list(const char **pointer)

+{

+(pcre_free)((void *)pointer);

+}

+

+

+

+/*************************************************

+*      Copy captured string to new store         *

+*************************************************/

+

+/* This function copies a single captured substring into a piece of new

+store

+

+Arguments:

+  subject        the subject string that was matched

+  ovector        pointer to the offsets table

+  stringcount    the number of substrings that were captured

+                   (i.e. the yield of the pcre_exec call, unless

+                   that was zero, in which case it should be 1/3

+                   of the offset table size)

+  stringnumber   the number of the required substring

+  stringptr      where to put a pointer to the substring

+

+Returns:         if successful:

+                   the length of the string, not including the zero that

+                   is put on the end; can be zero

+                 if not successful:

+                   PCRE_ERROR_NOMEMORY (-6) failed to get store

+                   PCRE_ERROR_NOSUBSTRING (-7) substring not present

+*/

+

+int

+pcre_get_substring(const char *subject, int *ovector, int stringcount,

+  int stringnumber, const char **stringptr)

+{

+int yield;

+char *substring;

+if (stringnumber < 0 || stringnumber >= stringcount)

+  return PCRE_ERROR_NOSUBSTRING;

+stringnumber *= 2;

+yield = ovector[stringnumber+1] - ovector[stringnumber];

+substring = (char *)(pcre_malloc)(yield + 1);

+if (substring == NULL) return PCRE_ERROR_NOMEMORY;

+memcpy(substring, subject + ovector[stringnumber], yield);

+substring[yield] = 0;

+*stringptr = substring;

+return yield;

+}

+

+

+

+/*************************************************

+*   Copy named captured string to new store      *

+*************************************************/

+

+/* This function copies a single captured substring, identified by name, into

+new store.

+

+Arguments:

+  code           the compiled regex

+  subject        the subject string that was matched

+  ovector        pointer to the offsets table

+  stringcount    the number of substrings that were captured

+                   (i.e. the yield of the pcre_exec call, unless

+                   that was zero, in which case it should be 1/3

+                   of the offset table size)

+  stringname     the name of the required substring

+  stringptr      where to put the pointer

+

+Returns:         if successful:

+                   the length of the copied string, not including the zero

+                   that is put on the end; can be zero

+                 if not successful:

+                   PCRE_ERROR_NOMEMORY (-6) couldn't get memory

+                   PCRE_ERROR_NOSUBSTRING (-7) no such captured substring

+*/

+

+int

+pcre_get_named_substring(const pcre *code, const char *subject, int *ovector,

+  int stringcount, const char *stringname, const char **stringptr)

+{

+int n = pcre_get_stringnumber(code, stringname);

+if (n <= 0) return n;

+return pcre_get_substring(subject, ovector, stringcount, n, stringptr);

+}

+

+

+

+

+/*************************************************

+*       Free store obtained by get_substring     *

+*************************************************/

+

+/* This function exists for the benefit of people calling PCRE from non-C

+programs that can call its functions, but not free() or (pcre_free)() directly.

+

+Argument:   the result of a previous pcre_get_substring()

+Returns:    nothing

+*/

+

+void

+pcre_free_substring(const char *pointer)

+{

+(pcre_free)((void *)pointer);

+}

+

+/* End of pcre_get.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains global variables that are exported by the PCRE library.

+PCRE is thread-clean and doesn't use any global variables in the normal sense.

+However, it calls memory allocation and freeing functions via the four

+indirections below, and it can optionally do callouts, using the fifth

+indirection. These values can be changed by the caller, but are shared between

+all threads. However, when compiling for Virtual Pascal, things are done

+differently, and global variables are not used (see pcre.in). */

+

+

+

+

+#ifndef VPCOMPAT

+#ifdef __cplusplus

+extern "C" void *(*pcre_malloc)(size_t) = malloc;

+extern "C" void  (*pcre_free)(void *) = free;

+extern "C" void *(*pcre_stack_malloc)(size_t) = malloc;

+extern "C" void  (*pcre_stack_free)(void *) = free;

+extern "C" int   (*pcre_callout)(pcre_callout_block *) = NULL;

+#else

+void *(*pcre_malloc)(size_t) = malloc;

+void  (*pcre_free)(void *) = free;

+void *(*pcre_stack_malloc)(size_t) = malloc;

+void  (*pcre_stack_free)(void *) = free;

+int   (*pcre_callout)(pcre_callout_block *) = NULL;

+#endif

+#endif

+

+/* End of pcre_globals.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_info(), which gives some

+information about a compiled pattern. However, use of this function is now

+deprecated, as it has been superseded by pcre_fullinfo(). */

+

+

+

+

+/*************************************************

+* (Obsolete) Return info about compiled pattern  *

+*************************************************/

+

+/* This is the original "info" function. It picks potentially useful data out

+of the private structure, but its interface was too rigid. It remains for

+backwards compatibility. The public options are passed back in an int - though

+the re->options field has been expanded to a long int, all the public options

+at the low end of it, and so even on 16-bit systems this will still be OK.

+Therefore, I haven't changed the API for pcre_info().

+

+Arguments:

+  argument_re   points to compiled code

+  optptr        where to pass back the options

+  first_byte    where to pass back the first character,

+                or -1 if multiline and all branches start ^,

+                or -2 otherwise

+

+Returns:        number of capturing subpatterns

+                or negative values on error

+*/

+

+EXPORT int

+pcre_info(const pcre *argument_re, int *optptr, int *first_byte)

+{

+real_pcre internal_re;

+const real_pcre *re = (const real_pcre *)argument_re;

+if (re == NULL) return PCRE_ERROR_NULL;

+if (re->magic_number != MAGIC_NUMBER)

+  {

+  re = _pcre_try_flipped(re, &internal_re, NULL, NULL);

+  if (re == NULL) return PCRE_ERROR_BADMAGIC;

+  }

+if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_OPTIONS);

+if (first_byte != NULL)

+  *first_byte = ((re->options & PCRE_FIRSTSET) != 0)? re->first_byte :

+     ((re->options & PCRE_STARTLINE) != 0)? -1 : -2;

+return re->top_bracket;

+}

+

+/* End of pcre_info.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_maketables(), which builds

+character tables for PCRE in the current locale. The file is compiled on its

+own as part of the PCRE library. However, it is also included in the

+compilation of dftables.c, in which case the macro DFTABLES is defined. */

+

+

+#ifndef DFTABLES

+#endif

+

+

+/*************************************************

+*           Create PCRE character tables         *

+*************************************************/

+

+/* This function builds a set of character tables for use by PCRE and returns

+a pointer to them. They are build using the ctype functions, and consequently

+their contents will depend upon the current locale setting. When compiled as

+part of the library, the store is obtained via pcre_malloc(), but when compiled

+inside dftables, use malloc().

+

+Arguments:   none

+Returns:     pointer to the contiguous block of data

+*/

+

+const unsigned char *

+pcre_maketables(void)

+{

+unsigned char *yield, *p;

+int i;

+

+#ifndef DFTABLES

+yield = (unsigned char*)(pcre_malloc)(tables_length);

+#else

+yield = (unsigned char*)malloc(tables_length);

+#endif

+

+if (yield == NULL) return NULL;

+p = yield;

+

+/* First comes the lower casing table */

+

+for (i = 0; i < 256; i++) *p++ = tolower(i);

+

+/* Next the case-flipping table */

+

+for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);

+

+/* Then the character class tables. Don't try to be clever and save effort

+on exclusive ones - in some locales things may be different. Note that the

+table for "space" includes everything "isspace" gives, including VT in the

+default locale. This makes it work for the POSIX class [:space:]. */

+

+memset(p, 0, cbit_length);

+for (i = 0; i < 256; i++)

+  {

+  if (isdigit(i))

+    {

+    p[cbit_digit  + i/8] |= 1 << (i&7);

+    p[cbit_word   + i/8] |= 1 << (i&7);

+    }

+  if (isupper(i))

+    {

+    p[cbit_upper  + i/8] |= 1 << (i&7);

+    p[cbit_word   + i/8] |= 1 << (i&7);

+    }

+  if (islower(i))

+    {

+    p[cbit_lower  + i/8] |= 1 << (i&7);

+    p[cbit_word   + i/8] |= 1 << (i&7);

+    }

+  if (i == '_')   p[cbit_word   + i/8] |= 1 << (i&7);

+  if (isspace(i)) p[cbit_space  + i/8] |= 1 << (i&7);

+  if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);

+  if (isgraph(i)) p[cbit_graph  + i/8] |= 1 << (i&7);

+  if (isprint(i)) p[cbit_print  + i/8] |= 1 << (i&7);

+  if (ispunct(i)) p[cbit_punct  + i/8] |= 1 << (i&7);

+  if (iscntrl(i)) p[cbit_cntrl  + i/8] |= 1 << (i&7);

+  }

+p += cbit_length;

+

+/* Finally, the character type table. In this, we exclude VT from the white

+space chars, because Perl doesn't recognize it as such for \s and for comments

+within regexes. */

+

+for (i = 0; i < 256; i++)

+  {

+  int x = 0;

+  if (i != 0x0b && isspace(i)) x += ctype_space;

+  if (isalpha(i)) x += ctype_letter;

+  if (isdigit(i)) x += ctype_digit;

+  if (isxdigit(i)) x += ctype_xdigit;

+  if (isalnum(i) || i == '_') x += ctype_word;

+

+  /* Note: strchr includes the terminating zero in the characters it considers.

+  In this instance, that is ok because we want binary zero to be flagged as a

+  meta-character, which in this sense is any character that terminates a run

+  of data characters. */

+

+  if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; }

+

+return yield;

+}

+

+/* End of pcre_maketables.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This file contains a private PCRE function that converts an ordinal

+character value into a UTF8 string. */

+

+

+

+

+/*************************************************

+*       Convert character value to UTF-8         *

+*************************************************/

+

+/* This function takes an integer value in the range 0 - 0x7fffffff

+and encodes it as a UTF-8 character in 0 to 6 bytes.

+

+Arguments:

+  cvalue     the character value

+  buffer     pointer to buffer for result - at least 6 bytes long

+

+Returns:     number of characters placed in the buffer

+*/

+

+EXPORT int

+_pcre_ord2utf8(int cvalue, uschar *buffer)

+{

+register int i, j;

+for (i = 0; i < _pcre_utf8_table1_size; i++)

+  if (cvalue <= _pcre_utf8_table1[i]) break;

+buffer += i;

+for (j = i; j > 0; j--)

+ {

+ *buffer-- = 0x80 | (cvalue & 0x3f);

+ cvalue >>= 6;

+ }

+*buffer = _pcre_utf8_table2[i] | cvalue;

+return i + 1;

+}

+

+/* End of pcre_ord2utf8.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains an PCRE private debugging function for printing out the

+internal form of a compiled regular expression, along with some supporting

+local functions. */

+

+

+

+

+static const char *OP_names[] = { OP_NAME_LIST };

+

+

+/*************************************************

+*       Print single- or multi-byte character    *

+*************************************************/

+

+static int

+print_char(FILE *f, uschar *ptr, BOOL utf8)

+{

+int c = *ptr;

+

+if (!utf8 || (c & 0xc0) != 0xc0)

+  {

+  if (isprint(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);

+  return 0;

+  }

+else

+  {

+  int i;

+  int a = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */

+  int s = 6*a;

+  c = (c & _pcre_utf8_table3[a]) << s;

+  for (i = 1; i <= a; i++)

+    {

+    /* This is a check for malformed UTF-8; it should only occur if the sanity

+    check has been turned off. Rather than swallow random bytes, just stop if

+    we hit a bad one. Print it with \X instead of \x as an indication. */

+

+    if ((ptr[i] & 0xc0) != 0x80)

+      {

+      fprintf(f, "\\X{%x}", c);

+      return i - 1;

+      }

+

+    /* The byte is OK */

+

+    s -= 6;

+    c |= (ptr[i] & 0x3f) << s;

+    }

+  if (c < 128) fprintf(f, "\\x%02x", c); else fprintf(f, "\\x{%x}", c);

+  return a;

+  }

+}

+

+

+

+/*************************************************

+*          Find Unicode property name            *

+*************************************************/

+

+static const char *

+get_ucpname(int property)

+{

+#ifdef SUPPORT_UCP

+int i;

+for (i = _pcre_utt_size; i >= 0; i--)

+  {

+  if (property == _pcre_utt[i].value) break;

+  }

+return (i >= 0)? _pcre_utt[i].name : "??";

+#else

+return "??";

+#endif

+}

+

+

+

+/*************************************************

+*         Print compiled regex                   *

+*************************************************/

+

+/* Make this function work for a regex with integers either byte order.

+However, we assume that what we are passed is a compiled regex. */

+

+EXPORT void

+_pcre_printint(pcre *external_re, FILE *f)

+{

+real_pcre *re = (real_pcre *)external_re;

+uschar *codestart, *code;

+BOOL utf8;

+

+unsigned int options = re->options;

+int offset = re->name_table_offset;

+int count = re->name_count;

+int size = re->name_entry_size;

+

+if (re->magic_number != MAGIC_NUMBER)

+  {

+  offset = ((offset << 8) & 0xff00) | ((offset >> 8) & 0xff);

+  count = ((count << 8) & 0xff00) | ((count >> 8) & 0xff);

+  size = ((size << 8) & 0xff00) | ((size >> 8) & 0xff);

+  options = ((options << 24) & 0xff000000) |

+            ((options <<  8) & 0x00ff0000) |

+            ((options >>  8) & 0x0000ff00) |

+            ((options >> 24) & 0x000000ff);

+  }

+

+code = codestart = (uschar *)re + offset + count * size;

+utf8 = (options & PCRE_UTF8) != 0;

+

+for(;;)

+  {

+  uschar *ccode;

+  int c;

+  int extra = 0;

+

+  fprintf(f, "%3d ", (int)(code - codestart));

+

+  if (*code >= OP_BRA)

+    {

+    if (*code - OP_BRA > EXTRACT_BASIC_MAX)

+      fprintf(f, "%3d Bra extra\n", GET(code, 1));

+    else

+      fprintf(f, "%3d Bra %d\n", GET(code, 1), *code - OP_BRA);

+    code += _pcre_OP_lengths[OP_BRA];

+    continue;

+    }

+

+  switch(*code)

+    {

+    case OP_END:

+    fprintf(f, "    %s\n", OP_names[*code]);

+    fprintf(f, "------------------------------------------------------------------\n");

+    return;

+

+    case OP_OPT:

+    fprintf(f, " %.2x %s", code[1], OP_names[*code]);

+    break;

+

+    case OP_CHAR:

+      {

+      fprintf(f, "    ");

+      do

+        {

+        code++;

+        code += 1 + print_char(f, code, utf8);

+        }

+      while (*code == OP_CHAR);

+      fprintf(f, "\n");

+      continue;

+      }

+    break;

+

+    case OP_CHARNC:

+      {

+      fprintf(f, " NC ");

+      do

+        {

+        code++;

+        code += 1 + print_char(f, code, utf8);

+        }

+      while (*code == OP_CHARNC);

+      fprintf(f, "\n");

+      continue;

+      }

+    break;

+

+    case OP_KETRMAX:

+    case OP_KETRMIN:

+    case OP_ALT:

+    case OP_KET:

+    case OP_ASSERT:

+    case OP_ASSERT_NOT:

+    case OP_ASSERTBACK:

+    case OP_ASSERTBACK_NOT:

+    case OP_ONCE:

+    case OP_COND:

+    case OP_REVERSE:

+    fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]);

+    break;

+

+    case OP_BRANUMBER:

+    printf("%3d %s", GET2(code, 1), OP_names[*code]);

+    break;

+

+    case OP_CREF:

+    if (GET2(code, 1) == CREF_RECURSE)

+      fprintf(f, "    Cond recurse");

+    else

+      fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);

+    break;

+

+    case OP_STAR:

+    case OP_MINSTAR:

+    case OP_PLUS:

+    case OP_MINPLUS:

+    case OP_QUERY:

+    case OP_MINQUERY:

+    case OP_TYPESTAR:

+    case OP_TYPEMINSTAR:

+    case OP_TYPEPLUS:

+    case OP_TYPEMINPLUS:

+    case OP_TYPEQUERY:

+    case OP_TYPEMINQUERY:

+    fprintf(f, "    ");

+    if (*code >= OP_TYPESTAR)

+      {

+      fprintf(f, "%s", OP_names[code[1]]);

+      if (code[1] == OP_PROP || code[1] == OP_NOTPROP)

+        {

+        fprintf(f, " %s ", get_ucpname(code[2]));

+        extra = 1;

+        }

+      }

+    else extra = print_char(f, code+1, utf8);

+    fprintf(f, "%s", OP_names[*code]);

+    break;

+

+    case OP_EXACT:

+    case OP_UPTO:

+    case OP_MINUPTO:

+    fprintf(f, "    ");

+    extra = print_char(f, code+3, utf8);

+    fprintf(f, "{");

+    if (*code != OP_EXACT) fprintf(f, ",");

+    fprintf(f, "%d}", GET2(code,1));

+    if (*code == OP_MINUPTO) fprintf(f, "?");

+    break;

+

+    case OP_TYPEEXACT:

+    case OP_TYPEUPTO:

+    case OP_TYPEMINUPTO:

+    fprintf(f, "    %s", OP_names[code[3]]);

+    if (code[3] == OP_PROP || code[3] == OP_NOTPROP)

+      {

+      fprintf(f, " %s ", get_ucpname(code[4]));

+      extra = 1;

+      }

+    fprintf(f, "{");

+    if (*code != OP_TYPEEXACT) fprintf(f, "0,");

+    fprintf(f, "%d}", GET2(code,1));

+    if (*code == OP_TYPEMINUPTO) fprintf(f, "?");

+    break;

+

+    case OP_NOT:

+    if (isprint(c = code[1])) fprintf(f, "    [^%c]", c);

+      else fprintf(f, "    [^\\x%02x]", c);

+    break;

+

+    case OP_NOTSTAR:

+    case OP_NOTMINSTAR:

+    case OP_NOTPLUS:

+    case OP_NOTMINPLUS:

+    case OP_NOTQUERY:

+    case OP_NOTMINQUERY:

+    if (isprint(c = code[1])) fprintf(f, "    [^%c]", c);

+      else fprintf(f, "    [^\\x%02x]", c);

+    fprintf(f, "%s", OP_names[*code]);

+    break;

+

+    case OP_NOTEXACT:

+    case OP_NOTUPTO:

+    case OP_NOTMINUPTO:

+    if (isprint(c = code[3])) fprintf(f, "    [^%c]{", c);

+      else fprintf(f, "    [^\\x%02x]{", c);

+    if (*code != OP_NOTEXACT) fprintf(f, "0,");

+    fprintf(f, "%d}", GET2(code,1));

+    if (*code == OP_NOTMINUPTO) fprintf(f, "?");

+    break;

+

+    case OP_RECURSE:

+    fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]);

+    break;

+

+    case OP_REF:

+    fprintf(f, "    \\%d", GET2(code,1));

+    ccode = code + _pcre_OP_lengths[*code];

+    goto CLASS_REF_REPEAT;

+

+    case OP_CALLOUT:

+    fprintf(f, "    %s %d %d %d", OP_names[*code], code[1], GET(code,2),

+      GET(code, 2 + LINK_SIZE));

+    break;

+

+    case OP_PROP:

+    case OP_NOTPROP:

+    fprintf(f, "    %s %s", OP_names[*code], get_ucpname(code[1]));

+    break;

+

+    /* OP_XCLASS can only occur in UTF-8 mode. However, there's no harm in

+    having this code always here, and it makes it less messy without all those

+    #ifdefs. */

+

+    case OP_CLASS:

+    case OP_NCLASS:

+    case OP_XCLASS:

+      {

+      int i, min, max;

+      BOOL printmap;

+

+      fprintf(f, "    [");

+

+      if (*code == OP_XCLASS)

+        {

+        extra = GET(code, 1);

+        ccode = code + LINK_SIZE + 1;

+        printmap = (*ccode & XCL_MAP) != 0;

+        if ((*ccode++ & XCL_NOT) != 0) fprintf(f, "^");

+        }

+      else

+        {

+        printmap = TRUE;

+        ccode = code + 1;

+        }

+

+      /* Print a bit map */

+

+      if (printmap)

+        {

+        for (i = 0; i < 256; i++)

+          {

+          if ((ccode[i/8] & (1 << (i&7))) != 0)

+            {

+            int j;

+            for (j = i+1; j < 256; j++)

+              if ((ccode[j/8] & (1 << (j&7))) == 0) break;

+            if (i == '-' || i == ']') fprintf(f, "\\");

+            if (isprint(i)) fprintf(f, "%c", i); else fprintf(f, "\\x%02x", i);

+            if (--j > i)

+              {

+              if (j != i + 1) fprintf(f, "-");

+              if (j == '-' || j == ']') fprintf(f, "\\");

+              if (isprint(j)) fprintf(f, "%c", j); else fprintf(f, "\\x%02x", j);

+              }

+            i = j;

+            }

+          }

+        ccode += 32;

+        }

+

+      /* For an XCLASS there is always some additional data */

+

+      if (*code == OP_XCLASS)

+        {

+        int ch;

+        while ((ch = *ccode++) != XCL_END)

+          {

+          if (ch == XCL_PROP)

+            {

+            fprintf(f, "\\p{%s}", get_ucpname(*ccode++));

+            }

+          else if (ch == XCL_NOTPROP)

+            {

+            fprintf(f, "\\P{%s}", get_ucpname(*ccode++));

+            }

+          else

+            {

+            ccode += 1 + print_char(f, ccode, TRUE);

+            if (ch == XCL_RANGE)

+              {

+              fprintf(f, "-");

+              ccode += 1 + print_char(f, ccode, TRUE);

+              }

+            }

+          }

+        }

+

+      /* Indicate a non-UTF8 class which was created by negation */

+

+      fprintf(f, "]%s", (*code == OP_NCLASS)? " (neg)" : "");

+

+      /* Handle repeats after a class or a back reference */

+

+      CLASS_REF_REPEAT:

+      switch(*ccode)

+        {

+        case OP_CRSTAR:

+        case OP_CRMINSTAR:

+        case OP_CRPLUS:

+        case OP_CRMINPLUS:

+        case OP_CRQUERY:

+        case OP_CRMINQUERY:

+        fprintf(f, "%s", OP_names[*ccode]);

+        extra += _pcre_OP_lengths[*ccode];

+        break;

+

+        case OP_CRRANGE:

+        case OP_CRMINRANGE:

+        min = GET2(ccode,1);

+        max = GET2(ccode,3);

+        if (max == 0) fprintf(f, "{%d,}", min);

+        else fprintf(f, "{%d,%d}", min, max);

+        if (*ccode == OP_CRMINRANGE) fprintf(f, "?");

+        extra += _pcre_OP_lengths[*ccode];

+        break;

+        }

+      }

+    break;

+

+    /* Anything else is just an item with no data*/

+

+    default:

+    fprintf(f, "    %s", OP_names[*code]);

+    break;

+    }

+

+  code += _pcre_OP_lengths[*code] + extra;

+  fprintf(f, "\n");

+  }

+}

+

+/* End of pcre_printint.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_refcount(), which is an

+auxiliary function that can be used to maintain a reference count in a compiled

+pattern data block. This might be helpful in applications where the block is

+shared by different users. */

+

+

+

+/*************************************************

+*           Maintain reference count             *

+*************************************************/

+

+/* The reference count is a 16-bit field, initialized to zero. It is not

+possible to transfer a non-zero count from one host to a different host that

+has a different byte order - though I can't see why anyone in their right mind

+would ever want to do that!

+

+Arguments:

+  argument_re   points to compiled code

+  adjust        value to add to the count

+

+Returns:        the (possibly updated) count value (a non-negative number), or

+                a negative error number

+*/

+

+EXPORT int

+pcre_refcount(pcre *argument_re, int adjust)

+{

+real_pcre *re = (real_pcre *)argument_re;

+if (re == NULL) return PCRE_ERROR_NULL;

+re->ref_count = (-adjust > re->ref_count)? 0 :

+                (adjust + re->ref_count > 65535)? 65535 :

+                re->ref_count + adjust;

+return re->ref_count;

+}

+

+/* End of pcre_refcount.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_study(), along with local

+supporting functions. */

+

+

+

+

+/*************************************************

+*      Set a bit and maybe its alternate case    *

+*************************************************/

+

+/* Given a character, set its bit in the table, and also the bit for the other

+version of a letter if we are caseless.

+

+Arguments:

+  start_bits    points to the bit map

+  c             is the character

+  caseless      the caseless flag

+  cd            the block with char table pointers

+

+Returns:        nothing

+*/

+

+static void

+set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd)

+{

+start_bits[c/8] |= (1 << (c&7));

+if (caseless && (cd->ctypes[c] & ctype_letter) != 0)

+  start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7));

+}

+

+

+

+/*************************************************

+*          Create bitmap of starting chars       *

+*************************************************/

+

+/* This function scans a compiled unanchored expression and attempts to build a

+bitmap of the set of initial characters. If it can't, it returns FALSE. As time

+goes by, we may be able to get more clever at doing this.

+

+Arguments:

+  code         points to an expression

+  start_bits   points to a 32-byte table, initialized to 0

+  caseless     the current state of the caseless flag

+  utf8         TRUE if in UTF-8 mode

+  cd           the block with char table pointers

+

+Returns:       TRUE if table built, FALSE otherwise

+*/

+

+static BOOL

+set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless,

+  BOOL utf8, compile_data *cd)

+{

+register int c;

+

+/* This next statement and the later reference to dummy are here in order to

+trick the optimizer of the IBM C compiler for OS/2 into generating correct

+code. Apparently IBM isn't going to fix the problem, and we would rather not

+disable optimization (in this module it actually makes a big difference, and

+the pcre module can use all the optimization it can get). */

+

+volatile int dummy;

+

+do

+  {

+  const uschar *tcode = code + 1 + LINK_SIZE;

+  BOOL try_next = TRUE;

+

+  while (try_next)

+    {

+    /* If a branch starts with a bracket or a positive lookahead assertion,

+    recurse to set bits from within them. That's all for this branch. */

+

+    if ((int)*tcode >= OP_BRA || *tcode == OP_ASSERT)

+      {

+      if (!set_start_bits(tcode, start_bits, caseless, utf8, cd))

+        return FALSE;

+      try_next = FALSE;

+      }

+

+    else switch(*tcode)

+      {

+      default:

+      return FALSE;

+

+      /* Skip over callout */

+

+      case OP_CALLOUT:

+      tcode += 2 + 2*LINK_SIZE;

+      break;

+

+      /* Skip over extended extraction bracket number */

+

+      case OP_BRANUMBER:

+      tcode += 3;

+      break;

+

+      /* Skip over lookbehind and negative lookahead assertions */

+

+      case OP_ASSERT_NOT:

+      case OP_ASSERTBACK:

+      case OP_ASSERTBACK_NOT:

+      do tcode += GET(tcode, 1); while (*tcode == OP_ALT);

+      tcode += 1+LINK_SIZE;

+      break;

+

+      /* Skip over an option setting, changing the caseless flag */

+

+      case OP_OPT:

+      caseless = (tcode[1] & PCRE_CASELESS) != 0;

+      tcode += 2;

+      break;

+

+      /* BRAZERO does the bracket, but carries on. */

+

+      case OP_BRAZERO:

+      case OP_BRAMINZERO:

+      if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd))

+        return FALSE;

+      dummy = 1;

+      do tcode += GET(tcode,1); while (*tcode == OP_ALT);

+      tcode += 1+LINK_SIZE;

+      break;

+

+      /* Single-char * or ? sets the bit and tries the next item */

+

+      case OP_STAR:

+      case OP_MINSTAR:

+      case OP_QUERY:

+      case OP_MINQUERY:

+      set_bit(start_bits, tcode[1], caseless, cd);

+      tcode += 2;

+#ifdef SUPPORT_UTF8

+      if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++;

+#endif

+      break;

+

+      /* Single-char upto sets the bit and tries the next */

+

+      case OP_UPTO:

+      case OP_MINUPTO:

+      set_bit(start_bits, tcode[3], caseless, cd);

+      tcode += 4;

+#ifdef SUPPORT_UTF8

+      if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++;

+#endif

+      break;

+

+      /* At least one single char sets the bit and stops */

+

+      case OP_EXACT:       /* Fall through */

+      tcode += 2;

+

+      case OP_CHAR:

+      case OP_CHARNC:

+      case OP_PLUS:

+      case OP_MINPLUS:

+      set_bit(start_bits, tcode[1], caseless, cd);

+      try_next = FALSE;

+      break;

+

+      /* Single character type sets the bits and stops */

+

+      case OP_NOT_DIGIT:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= ~cd->cbits[c+cbit_digit];

+      try_next = FALSE;

+      break;

+

+      case OP_DIGIT:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= cd->cbits[c+cbit_digit];

+      try_next = FALSE;

+      break;

+

+      case OP_NOT_WHITESPACE:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= ~cd->cbits[c+cbit_space];

+      try_next = FALSE;

+      break;

+

+      case OP_WHITESPACE:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= cd->cbits[c+cbit_space];

+      try_next = FALSE;

+      break;

+

+      case OP_NOT_WORDCHAR:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= ~cd->cbits[c+cbit_word];

+      try_next = FALSE;

+      break;

+

+      case OP_WORDCHAR:

+      for (c = 0; c < 32; c++)

+        start_bits[c] |= cd->cbits[c+cbit_word];

+      try_next = FALSE;

+      break;

+

+      /* One or more character type fudges the pointer and restarts, knowing

+      it will hit a single character type and stop there. */

+

+      case OP_TYPEPLUS:

+      case OP_TYPEMINPLUS:

+      tcode++;

+      break;

+

+      case OP_TYPEEXACT:

+      tcode += 3;

+      break;

+

+      /* Zero or more repeats of character types set the bits and then

+      try again. */

+

+      case OP_TYPEUPTO:

+      case OP_TYPEMINUPTO:

+      tcode += 2;               /* Fall through */

+

+      case OP_TYPESTAR:

+      case OP_TYPEMINSTAR:

+      case OP_TYPEQUERY:

+      case OP_TYPEMINQUERY:

+      switch(tcode[1])

+        {

+        case OP_ANY:

+        return FALSE;

+

+        case OP_NOT_DIGIT:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= ~cd->cbits[c+cbit_digit];

+        break;

+

+        case OP_DIGIT:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= cd->cbits[c+cbit_digit];

+        break;

+

+        case OP_NOT_WHITESPACE:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= ~cd->cbits[c+cbit_space];

+        break;

+

+        case OP_WHITESPACE:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= cd->cbits[c+cbit_space];

+        break;

+

+        case OP_NOT_WORDCHAR:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= ~cd->cbits[c+cbit_word];

+        break;

+

+        case OP_WORDCHAR:

+        for (c = 0; c < 32; c++)

+          start_bits[c] |= cd->cbits[c+cbit_word];

+        break;

+        }

+

+      tcode += 2;

+      break;

+

+      /* Character class where all the information is in a bit map: set the

+      bits and either carry on or not, according to the repeat count. If it was

+      a negative class, and we are operating with UTF-8 characters, any byte

+      with a value >= 0xc4 is a potentially valid starter because it starts a

+      character with a value > 255. */

+

+      case OP_NCLASS:

+      if (utf8)

+        {

+        start_bits[24] |= 0xf0;              /* Bits for 0xc4 - 0xc8 */

+        memset(start_bits+25, 0xff, 7);      /* Bits for 0xc9 - 0xff */

+        }

+      /* Fall through */

+

+      case OP_CLASS:

+        {

+        tcode++;

+

+        /* In UTF-8 mode, the bits in a bit map correspond to character

+        values, not to byte values. However, the bit map we are constructing is

+        for byte values. So we have to do a conversion for characters whose

+        value is > 127. In fact, there are only two possible starting bytes for

+        characters in the range 128 - 255. */

+

+        if (utf8)

+          {

+          for (c = 0; c < 16; c++) start_bits[c] |= tcode[c];

+          for (c = 128; c < 256; c++)

+            {

+            if ((tcode[c/8] && (1 << (c&7))) != 0)

+              {

+              int d = (c >> 6) | 0xc0;            /* Set bit for this starter */

+              start_bits[d/8] |= (1 << (d&7));    /* and then skip on to the */

+              c = (c & 0xc0) + 0x40 - 1;          /* next relevant character. */

+              }

+            }

+          }

+

+        /* In non-UTF-8 mode, the two bit maps are completely compatible. */

+

+        else

+          {

+          for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];

+          }

+

+        /* Advance past the bit map, and act on what follows */

+

+        tcode += 32;

+        switch (*tcode)

+          {

+          case OP_CRSTAR:

+          case OP_CRMINSTAR:

+          case OP_CRQUERY:

+          case OP_CRMINQUERY:

+          tcode++;

+          break;

+

+          case OP_CRRANGE:

+          case OP_CRMINRANGE:

+          if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5;

+            else try_next = FALSE;

+          break;

+

+          default:

+          try_next = FALSE;

+          break;

+          }

+        }

+      break; /* End of bitmap class handling */

+

+      }      /* End of switch */

+    }        /* End of try_next loop */

+

+  code += GET(code, 1);   /* Advance to next branch */

+  }

+while (*code == OP_ALT);

+return TRUE;

+}

+

+

+

+/*************************************************

+*          Study a compiled expression           *

+*************************************************/

+

+/* This function is handed a compiled expression that it must study to produce

+information that will speed up the matching. It returns a pcre_extra block

+which then gets handed back to pcre_exec().

+

+Arguments:

+  re        points to the compiled expression

+  options   contains option bits

+  errorptr  points to where to place error messages;

+            set NULL unless error

+

+Returns:    pointer to a pcre_extra block, with study_data filled in and the

+              appropriate flag set;

+            NULL on error or if no optimization possible

+*/

+

+EXPORT pcre_extra *

+pcre_study(const pcre *external_re, int options, const char **errorptr)

+{

+uschar start_bits[32];

+pcre_extra *extra;

+pcre_study_data *study;

+const uschar *tables;

+const real_pcre *re = (const real_pcre *)external_re;

+uschar *code = (uschar *)re + re->name_table_offset +

+  (re->name_count * re->name_entry_size);

+compile_data compile_block;

+

+*errorptr = NULL;

+

+if (re == NULL || re->magic_number != MAGIC_NUMBER)

+  {

+  *errorptr = "argument is not a compiled regular expression";

+  return NULL;

+  }

+

+if ((options & ~PUBLIC_STUDY_OPTIONS) != 0)

+  {

+  *errorptr = "unknown or incorrect option bit(s) set";

+  return NULL;

+  }

+

+/* For an anchored pattern, or an unanchored pattern that has a first char, or

+a multiline pattern that matches only at "line starts", no further processing

+at present. */

+

+if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)

+  return NULL;

+

+/* Set the character tables in the block that is passed around */

+

+tables = re->tables;

+if (tables == NULL)

+  (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,

+  (void *)(&tables));

+

+compile_block.lcc = tables + lcc_offset;

+compile_block.fcc = tables + fcc_offset;

+compile_block.cbits = tables + cbits_offset;

+compile_block.ctypes = tables + ctypes_offset;

+

+/* See if we can find a fixed set of initial characters for the pattern. */

+

+memset(start_bits, 0, 32 * sizeof(uschar));

+if (!set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0,

+  (re->options & PCRE_UTF8) != 0, &compile_block)) return NULL;

+

+/* Get a pcre_extra block and a pcre_study_data block. The study data is put in

+the latter, which is pointed to by the former, which may also get additional

+data set later by the calling program. At the moment, the size of

+pcre_study_data is fixed. We nevertheless save it in a field for returning via

+the pcre_fullinfo() function so that if it becomes variable in the future, we

+don't have to change that code. */

+

+extra = (pcre_extra *)(pcre_malloc)

+  (sizeof(pcre_extra) + sizeof(pcre_study_data));

+

+if (extra == NULL)

+  {

+  *errorptr = "failed to get memory";

+  return NULL;

+  }

+

+study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));

+extra->flags = PCRE_EXTRA_STUDY_DATA;

+extra->study_data = study;

+

+study->size = sizeof(pcre_study_data);

+study->options = PCRE_STUDY_MAPPED;

+memcpy(study->start_bits, start_bits, sizeof(start_bits));

+

+return extra;

+}

+

+/* End of pcre_study.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains some fixed tables that are used by more than one of the

+PCRE code modules. */

+

+

+

+

+/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that

+the definition is next to the definition of the opcodes in internal.h. */

+

+const uschar _pcre_OP_lengths[] = { OP_LENGTHS };

+

+

+

+/*************************************************

+*           Tables for UTF-8 support             *

+*************************************************/

+

+/* These are the breakpoints for different numbers of bytes in a UTF-8

+character. */

+

+const int _pcre_utf8_table1[] =

+  { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};

+

+const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);

+

+/* These are the indicator bits and the mask for the data bits to set in the

+first byte of a character, indexed by the number of additional bytes. */

+

+const int _pcre_utf8_table2[] = { 0,    0xc0, 0xe0, 0xf0, 0xf8, 0xfc};

+const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};

+

+/* Table of the number of extra characters, indexed by the first character

+masked with 0x3f. The highest number for a valid UTF-8 character is in fact

+0x3d. */

+

+const uschar _pcre_utf8_table4[] = {

+  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

+  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

+  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

+  3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };

+

+/* This table translates Unicode property names into code values for the

+ucp_findchar() function. It is used by pcretest as well as by the library

+functions. */

+

+const ucp_type_table _pcre_utt[] = {

+  { "C",  128 + ucp_C },

+  { "Cc", ucp_Cc },

+  { "Cf", ucp_Cf },

+  { "Cn", ucp_Cn },

+  { "Co", ucp_Co },

+  { "Cs", ucp_Cs },

+  { "L",  128 + ucp_L },

+  { "Ll", ucp_Ll },

+  { "Lm", ucp_Lm },

+  { "Lo", ucp_Lo },

+  { "Lt", ucp_Lt },

+  { "Lu", ucp_Lu },

+  { "M",  128 + ucp_M },

+  { "Mc", ucp_Mc },

+  { "Me", ucp_Me },

+  { "Mn", ucp_Mn },

+  { "N",  128 + ucp_N },

+  { "Nd", ucp_Nd },

+  { "Nl", ucp_Nl },

+  { "No", ucp_No },

+  { "P",  128 + ucp_P },

+  { "Pc", ucp_Pc },

+  { "Pd", ucp_Pd },

+  { "Pe", ucp_Pe },

+  { "Pf", ucp_Pf },

+  { "Pi", ucp_Pi },

+  { "Po", ucp_Po },

+  { "Ps", ucp_Ps },

+  { "S",  128 + ucp_S },

+  { "Sc", ucp_Sc },

+  { "Sk", ucp_Sk },

+  { "Sm", ucp_Sm },

+  { "So", ucp_So },

+  { "Z",  128 + ucp_Z },

+  { "Zl", ucp_Zl },

+  { "Zp", ucp_Zp },

+  { "Zs", ucp_Zs }

+};

+

+const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);

+

+/* End of pcre_tables.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains an internal function that tests a compiled pattern to

+see if it was compiled with the opposite endianness. If so, it uses an

+auxiliary local function to flip the appropriate bytes. */

+

+

+

+

+/*************************************************

+*         Flip bytes in an integer               *

+*************************************************/

+

+/* This function is called when the magic number in a regex doesn't match, in

+order to flip its bytes to see if we are dealing with a pattern that was

+compiled on a host of different endianness. If so, this function is used to

+flip other byte values.

+

+Arguments:

+  value        the number to flip

+  n            the number of bytes to flip (assumed to be 2 or 4)

+

+Returns:       the flipped value

+*/

+

+static long int

+byteflip(long int value, int n)

+{

+if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);

+return ((value & 0x000000ff) << 24) |

+       ((value & 0x0000ff00) <<  8) |

+       ((value & 0x00ff0000) >>  8) |

+       ((value & 0xff000000) >> 24);

+}

+

+

+

+/*************************************************

+*       Test for a byte-flipped compiled regex   *

+*************************************************/

+

+/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from

+pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that

+is, it was compiled on a system of opposite endianness. The function is called

+only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped,

+we flip all the relevant values into a different data block, and return it.

+

+Arguments:

+  re               points to the regex

+  study            points to study data, or NULL

+  internal_re      points to a new regex block

+  internal_study   points to a new study block

+

+Returns:           the new block if is is indeed a byte-flipped regex

+                   NULL if it is not

+*/

+

+EXPORT real_pcre *

+_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,

+  const pcre_study_data *study, pcre_study_data *internal_study)

+{

+if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)

+  return NULL;

+

+*internal_re = *re;           /* To copy other fields */

+internal_re->size = byteflip(re->size, sizeof(re->size));

+internal_re->options = byteflip(re->options, sizeof(re->options));

+internal_re->top_bracket =

+  (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));

+internal_re->top_backref =

+  (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));

+internal_re->first_byte =

+  (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));

+internal_re->req_byte =

+  (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));

+internal_re->name_table_offset =

+  (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));

+internal_re->name_entry_size =

+  (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));

+internal_re->name_count =

+  (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));

+

+if (study != NULL)

+  {

+  *internal_study = *study;   /* To copy other fields */

+  internal_study->size = byteflip(study->size, sizeof(study->size));

+  internal_study->options = byteflip(study->options, sizeof(study->options));

+  }

+

+return internal_re;

+}

+

+/* End of pcre_tryflipped.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module compiles code for supporting the use of Unicode character

+properties. We use the (embryonic at the time of writing) UCP library, by

+including some of its files, copies of which have been put in the PCRE

+distribution. There is a macro in pcre_internal.h that changes the name

+ucp_findchar into _pcre_ucp_findchar. */

+

+

+

+/*************************************************

+*     libucp - Unicode Property Table handler    *

+*************************************************/

+

+/* Copyright (c) University of Cambridge 2004 */

+

+/* This little library provides a fast way of obtaining the basic Unicode

+properties of a character, using a compact binary tree that occupies less than

+100K bytes.

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/*************************************************

+*     libucp - Unicode Property Table handler    *

+*************************************************/

+

+/* Internal header file defining the layout of compact nodes in the tree. */

+

+typedef struct cnode {

+  unsigned short int f0;

+  unsigned short int f1;

+  unsigned short int f2;

+} cnode;

+

+/* Things for the f0 field */

+

+#define f0_leftexists   0x8000    /* Left child exists */

+#define f0_typemask     0x3f00    /* Type bits */

+#define f0_typeshift         8    /* Type shift */

+#define f0_chhmask      0x00ff    /* Character high bits */

+

+/* Things for the f2 field */

+

+#define f2_rightmask    0xf000    /* Mask for right offset bits */

+#define f2_rightshift       12    /* Shift for right offset */

+#define f2_casemask     0x0fff    /* Mask for case offset */

+

+/* The tree consists of a vector of structures of type cnode, with the root

+node as the first element. The three short ints (16-bits) are used as follows:

+

+(f0) (1) The 0x8000 bit of f0 is set if a left child exists. The child's node

+         is the next node in the vector.

+     (2) The 0x4000 bits of f0 is spare.

+     (3) The 0x3f00 bits of f0 contain the character type; this is a number

+         defined by the enumeration in ucp.h (e.g. ucp_Lu).

+     (4) The bottom 8 bits of f0 contain the most significant byte of the

+         character's 24-bit codepoint.

+

+(f1) (1) The f1 field contains the two least significant bytes of the

+         codepoint.

+

+(f2) (1) The 0xf000 bits of f2 contain zero if there is no right child of this

+         node. Otherwise, they contain one plus the exponent of the power of

+         two of the offset to the right node (e.g. a value of 3 means 8). The

+         units of the offset are node items.

+

+     (2) The 0x0fff bits of f2 contain the signed offset from this character to

+         its alternate cased value. They are zero if there is no such

+         character.

+

+

+-----------------------------------------------------------------------------

+||.|.| type (6) | ms char (8) ||  ls char (16)  ||....|  case offset (12)  ||

+-----------------------------------------------------------------------------

+  | |                                              |

+  | |-> spare                                      |

+  |                                        exponent of right

+  |-> left child exists                       child offset

+

+

+The upper/lower casing information is set only for characters that come in

+pairs. There are (at present) four non-one-to-one mappings in the Unicode data.

+These are ignored. They are:

+

+  1FBE Greek Prosgegrammeni (lower, with upper -> capital iota)

+  2126 Ohm

+  212A Kelvin

+  212B Angstrom

+

+Certainly for the last three, having an alternate case would seem to be a

+mistake. I don't know any Greek, so cannot comment on the first one.

+

+

+When searching the tree, proceed as follows:

+

+(1) Start at the first node.

+

+(2) Extract the character value from f1 and the bottom 8 bits of f0;

+

+(3) Compare with the character being sought. If equal, we are done.

+

+(4) If the test character is smaller, inspect the f0_leftexists flag. If it is

+    not set, the character is not in the tree. If it is set, move to the next

+    node, and go to (2).

+

+(5) If the test character is bigger, extract the f2_rightmask bits from f2, and

+    shift them right by f2_rightshift. If the result is zero, the character is

+    not in the tree. Otherwise, calculate the number of nodes to skip by

+    shifting the value 1 left by this number minus one. Go to (2).

+*/

+

+

+/* End of internal.h */

+/* This source module is automatically generated from the Unicode

+property table. See internal.h for a description of the layout. */

+

+static cnode ucp_table[] = {

+  { 0x9a00, 0x2f1f, 0xe000 },

+  { 0x8700, 0x1558, 0xd000 },

+  { 0x8700, 0x0a99, 0xc000 },

+  { 0x8500, 0x0435, 0xbfe0 },

+  { 0x8500, 0x01ff, 0xafff },

+  { 0x8500, 0x00ff, 0x9079 },

+  { 0x8000, 0x007f, 0x8000 },

+  { 0x9500, 0x003f, 0x7000 },

+  { 0x8000, 0x001f, 0x6000 },

+  { 0x8000, 0x000f, 0x5000 },

+  { 0x8000, 0x0007, 0x4000 },

+  { 0x8000, 0x0003, 0x3000 },

+  { 0x8000, 0x0001, 0x2000 },

+  { 0x0000, 0x0000, 0x0000 },

+  { 0x0000, 0x0002, 0x0000 },

+  { 0x8000, 0x0005, 0x2000 },

+  { 0x0000, 0x0004, 0x0000 },

+  { 0x0000, 0x0006, 0x0000 },

+  { 0x8000, 0x000b, 0x3000 },

+  { 0x8000, 0x0009, 0x2000 },

+  { 0x0000, 0x0008, 0x0000 },

+  { 0x0000, 0x000a, 0x0000 },

+  { 0x8000, 0x000d, 0x2000 },

+  { 0x0000, 0x000c, 0x0000 },

+  { 0x0000, 0x000e, 0x0000 },

+  { 0x8000, 0x0017, 0x4000 },

+  { 0x8000, 0x0013, 0x3000 },

+  { 0x8000, 0x0011, 0x2000 },

+  { 0x0000, 0x0010, 0x0000 },

+  { 0x0000, 0x0012, 0x0000 },

+  { 0x8000, 0x0015, 0x2000 },

+  { 0x0000, 0x0014, 0x0000 },

+  { 0x0000, 0x0016, 0x0000 },

+  { 0x8000, 0x001b, 0x3000 },

+  { 0x8000, 0x0019, 0x2000 },

+  { 0x0000, 0x0018, 0x0000 },

+  { 0x0000, 0x001a, 0x0000 },

+  { 0x8000, 0x001d, 0x2000 },

+  { 0x0000, 0x001c, 0x0000 },

+  { 0x0000, 0x001e, 0x0000 },

+  { 0x9500, 0x002f, 0x5000 },

+  { 0x9500, 0x0027, 0x4000 },

+  { 0x9500, 0x0023, 0x3000 },

+  { 0x9500, 0x0021, 0x2000 },

+  { 0x1d00, 0x0020, 0x0000 },

+  { 0x1500, 0x0022, 0x0000 },

+  { 0x9500, 0x0025, 0x2000 },

+  { 0x1700, 0x0024, 0x0000 },

+  { 0x1500, 0x0026, 0x0000 },

+  { 0x9900, 0x002b, 0x3000 },

+  { 0x9200, 0x0029, 0x2000 },

+  { 0x1600, 0x0028, 0x0000 },

+  { 0x1500, 0x002a, 0x0000 },

+  { 0x9100, 0x002d, 0x2000 },

+  { 0x1500, 0x002c, 0x0000 },

+  { 0x1500, 0x002e, 0x0000 },

+  { 0x8d00, 0x0037, 0x4000 },

+  { 0x8d00, 0x0033, 0x3000 },

+  { 0x8d00, 0x0031, 0x2000 },

+  { 0x0d00, 0x0030, 0x0000 },

+  { 0x0d00, 0x0032, 0x0000 },

+  { 0x8d00, 0x0035, 0x2000 },

+  { 0x0d00, 0x0034, 0x0000 },

+  { 0x0d00, 0x0036, 0x0000 },

+  { 0x9500, 0x003b, 0x3000 },

+  { 0x8d00, 0x0039, 0x2000 },

+  { 0x0d00, 0x0038, 0x0000 },

+  { 0x1500, 0x003a, 0x0000 },

+  { 0x9900, 0x003d, 0x2000 },

+  { 0x1900, 0x003c, 0x0000 },

+  { 0x1900, 0x003e, 0x0000 },

+  { 0x9000, 0x005f, 0x6000 },

+  { 0x8900, 0x004f, 0x5020 },

+  { 0x8900, 0x0047, 0x4020 },

+  { 0x8900, 0x0043, 0x3020 },

+  { 0x8900, 0x0041, 0x2020 },

+  { 0x1500, 0x0040, 0x0000 },

+  { 0x0900, 0x0042, 0x0020 },

+  { 0x8900, 0x0045, 0x2020 },

+  { 0x0900, 0x0044, 0x0020 },

+  { 0x0900, 0x0046, 0x0020 },

+  { 0x8900, 0x004b, 0x3020 },

+  { 0x8900, 0x0049, 0x2020 },

+  { 0x0900, 0x0048, 0x0020 },

+  { 0x0900, 0x004a, 0x0020 },

+  { 0x8900, 0x004d, 0x2020 },

+  { 0x0900, 0x004c, 0x0020 },

+  { 0x0900, 0x004e, 0x0020 },

+  { 0x8900, 0x0057, 0x4020 },

+  { 0x8900, 0x0053, 0x3020 },

+  { 0x8900, 0x0051, 0x2020 },

+  { 0x0900, 0x0050, 0x0020 },

+  { 0x0900, 0x0052, 0x0020 },

+  { 0x8900, 0x0055, 0x2020 },

+  { 0x0900, 0x0054, 0x0020 },

+  { 0x0900, 0x0056, 0x0020 },

+  { 0x9600, 0x005b, 0x3000 },

+  { 0x8900, 0x0059, 0x2020 },

+  { 0x0900, 0x0058, 0x0020 },

+  { 0x0900, 0x005a, 0x0020 },

+  { 0x9200, 0x005d, 0x2000 },

+  { 0x1500, 0x005c, 0x0000 },

+  { 0x1800, 0x005e, 0x0000 },

+  { 0x8500, 0x006f, 0x5fe0 },

+  { 0x8500, 0x0067, 0x4fe0 },

+  { 0x8500, 0x0063, 0x3fe0 },

+  { 0x8500, 0x0061, 0x2fe0 },

+  { 0x1800, 0x0060, 0x0000 },

+  { 0x0500, 0x0062, 0x0fe0 },

+  { 0x8500, 0x0065, 0x2fe0 },

+  { 0x0500, 0x0064, 0x0fe0 },

+  { 0x0500, 0x0066, 0x0fe0 },

+  { 0x8500, 0x006b, 0x3fe0 },

+  { 0x8500, 0x0069, 0x2fe0 },

+  { 0x0500, 0x0068, 0x0fe0 },

+  { 0x0500, 0x006a, 0x0fe0 },

+  { 0x8500, 0x006d, 0x2fe0 },

+  { 0x0500, 0x006c, 0x0fe0 },

+  { 0x0500, 0x006e, 0x0fe0 },

+  { 0x8500, 0x0077, 0x4fe0 },

+  { 0x8500, 0x0073, 0x3fe0 },

+  { 0x8500, 0x0071, 0x2fe0 },

+  { 0x0500, 0x0070, 0x0fe0 },

+  { 0x0500, 0x0072, 0x0fe0 },

+  { 0x8500, 0x0075, 0x2fe0 },

+  { 0x0500, 0x0074, 0x0fe0 },

+  { 0x0500, 0x0076, 0x0fe0 },

+  { 0x9600, 0x007b, 0x3000 },

+  { 0x8500, 0x0079, 0x2fe0 },

+  { 0x0500, 0x0078, 0x0fe0 },

+  { 0x0500, 0x007a, 0x0fe0 },

+  { 0x9200, 0x007d, 0x2000 },

+  { 0x1900, 0x007c, 0x0000 },

+  { 0x1900, 0x007e, 0x0000 },

+  { 0x9500, 0x00bf, 0x7000 },

+  { 0x8000, 0x009f, 0x6000 },

+  { 0x8000, 0x008f, 0x5000 },

+  { 0x8000, 0x0087, 0x4000 },

+  { 0x8000, 0x0083, 0x3000 },

+  { 0x8000, 0x0081, 0x2000 },

+  { 0x0000, 0x0080, 0x0000 },

+  { 0x0000, 0x0082, 0x0000 },

+  { 0x8000, 0x0085, 0x2000 },

+  { 0x0000, 0x0084, 0x0000 },

+  { 0x0000, 0x0086, 0x0000 },

+  { 0x8000, 0x008b, 0x3000 },

+  { 0x8000, 0x0089, 0x2000 },

+  { 0x0000, 0x0088, 0x0000 },

+  { 0x0000, 0x008a, 0x0000 },

+  { 0x8000, 0x008d, 0x2000 },

+  { 0x0000, 0x008c, 0x0000 },

+  { 0x0000, 0x008e, 0x0000 },

+  { 0x8000, 0x0097, 0x4000 },

+  { 0x8000, 0x0093, 0x3000 },

+  { 0x8000, 0x0091, 0x2000 },

+  { 0x0000, 0x0090, 0x0000 },

+  { 0x0000, 0x0092, 0x0000 },

+  { 0x8000, 0x0095, 0x2000 },

+  { 0x0000, 0x0094, 0x0000 },

+  { 0x0000, 0x0096, 0x0000 },

+  { 0x8000, 0x009b, 0x3000 },

+  { 0x8000, 0x0099, 0x2000 },

+  { 0x0000, 0x0098, 0x0000 },

+  { 0x0000, 0x009a, 0x0000 },

+  { 0x8000, 0x009d, 0x2000 },

+  { 0x0000, 0x009c, 0x0000 },

+  { 0x0000, 0x009e, 0x0000 },

+  { 0x9800, 0x00af, 0x5000 },

+  { 0x9a00, 0x00a7, 0x4000 },

+  { 0x9700, 0x00a3, 0x3000 },

+  { 0x9500, 0x00a1, 0x2000 },

+  { 0x1d00, 0x00a0, 0x0000 },

+  { 0x1700, 0x00a2, 0x0000 },

+  { 0x9700, 0x00a5, 0x2000 },

+  { 0x1700, 0x00a4, 0x0000 },

+  { 0x1a00, 0x00a6, 0x0000 },

+  { 0x9400, 0x00ab, 0x3000 },

+  { 0x9a00, 0x00a9, 0x2000 },

+  { 0x1800, 0x00a8, 0x0000 },

+  { 0x0500, 0x00aa, 0x0000 },

+  { 0x8100, 0x00ad, 0x2000 },

+  { 0x1900, 0x00ac, 0x0000 },

+  { 0x1a00, 0x00ae, 0x0000 },

+  { 0x9500, 0x00b7, 0x4000 },

+  { 0x8f00, 0x00b3, 0x3000 },

+  { 0x9900, 0x00b1, 0x2000 },

+  { 0x1a00, 0x00b0, 0x0000 },

+  { 0x0f00, 0x00b2, 0x0000 },

+  { 0x8500, 0x00b5, 0x22e7 },

+  { 0x1800, 0x00b4, 0x0000 },

+  { 0x1a00, 0x00b6, 0x0000 },

+  { 0x9300, 0x00bb, 0x3000 },

+  { 0x8f00, 0x00b9, 0x2000 },

+  { 0x1800, 0x00b8, 0x0000 },

+  { 0x0500, 0x00ba, 0x0000 },

+  { 0x8f00, 0x00bd, 0x2000 },

+  { 0x0f00, 0x00bc, 0x0000 },

+  { 0x0f00, 0x00be, 0x0000 },

+  { 0x8500, 0x00df, 0x6000 },

+  { 0x8900, 0x00cf, 0x5020 },

+  { 0x8900, 0x00c7, 0x4020 },

+  { 0x8900, 0x00c3, 0x3020 },

+  { 0x8900, 0x00c1, 0x2020 },

+  { 0x0900, 0x00c0, 0x0020 },

+  { 0x0900, 0x00c2, 0x0020 },

+  { 0x8900, 0x00c5, 0x2020 },

+  { 0x0900, 0x00c4, 0x0020 },

+  { 0x0900, 0x00c6, 0x0020 },

+  { 0x8900, 0x00cb, 0x3020 },

+  { 0x8900, 0x00c9, 0x2020 },

+  { 0x0900, 0x00c8, 0x0020 },

+  { 0x0900, 0x00ca, 0x0020 },

+  { 0x8900, 0x00cd, 0x2020 },

+  { 0x0900, 0x00cc, 0x0020 },

+  { 0x0900, 0x00ce, 0x0020 },

+  { 0x9900, 0x00d7, 0x4000 },

+  { 0x8900, 0x00d3, 0x3020 },

+  { 0x8900, 0x00d1, 0x2020 },

+  { 0x0900, 0x00d0, 0x0020 },

+  { 0x0900, 0x00d2, 0x0020 },

+  { 0x8900, 0x00d5, 0x2020 },

+  { 0x0900, 0x00d4, 0x0020 },

+  { 0x0900, 0x00d6, 0x0020 },

+  { 0x8900, 0x00db, 0x3020 },

+  { 0x8900, 0x00d9, 0x2020 },

+  { 0x0900, 0x00d8, 0x0020 },

+  { 0x0900, 0x00da, 0x0020 },

+  { 0x8900, 0x00dd, 0x2020 },

+  { 0x0900, 0x00dc, 0x0020 },

+  { 0x0900, 0x00de, 0x0020 },

+  { 0x8500, 0x00ef, 0x5fe0 },

+  { 0x8500, 0x00e7, 0x4fe0 },

+  { 0x8500, 0x00e3, 0x3fe0 },

+  { 0x8500, 0x00e1, 0x2fe0 },

+  { 0x0500, 0x00e0, 0x0fe0 },

+  { 0x0500, 0x00e2, 0x0fe0 },

+  { 0x8500, 0x00e5, 0x2fe0 },

+  { 0x0500, 0x00e4, 0x0fe0 },

+  { 0x0500, 0x00e6, 0x0fe0 },

+  { 0x8500, 0x00eb, 0x3fe0 },

+  { 0x8500, 0x00e9, 0x2fe0 },

+  { 0x0500, 0x00e8, 0x0fe0 },

+  { 0x0500, 0x00ea, 0x0fe0 },

+  { 0x8500, 0x00ed, 0x2fe0 },

+  { 0x0500, 0x00ec, 0x0fe0 },

+  { 0x0500, 0x00ee, 0x0fe0 },

+  { 0x9900, 0x00f7, 0x4000 },

+  { 0x8500, 0x00f3, 0x3fe0 },

+  { 0x8500, 0x00f1, 0x2fe0 },

+  { 0x0500, 0x00f0, 0x0fe0 },

+  { 0x0500, 0x00f2, 0x0fe0 },

+  { 0x8500, 0x00f5, 0x2fe0 },

+  { 0x0500, 0x00f4, 0x0fe0 },

+  { 0x0500, 0x00f6, 0x0fe0 },

+  { 0x8500, 0x00fb, 0x3fe0 },

+  { 0x8500, 0x00f9, 0x2fe0 },

+  { 0x0500, 0x00f8, 0x0fe0 },

+  { 0x0500, 0x00fa, 0x0fe0 },

+  { 0x8500, 0x00fd, 0x2fe0 },

+  { 0x0500, 0x00fc, 0x0fe0 },

+  { 0x0500, 0x00fe, 0x0fe0 },

+  { 0x8500, 0x017f, 0x8ed4 },

+  { 0x8900, 0x013f, 0x7001 },

+  { 0x8500, 0x011f, 0x6fff },

+  { 0x8500, 0x010f, 0x5fff },

+  { 0x8500, 0x0107, 0x4fff },

+  { 0x8500, 0x0103, 0x3fff },

+  { 0x8500, 0x0101, 0x2fff },

+  { 0x0900, 0x0100, 0x0001 },

+  { 0x0900, 0x0102, 0x0001 },

+  { 0x8500, 0x0105, 0x2fff },

+  { 0x0900, 0x0104, 0x0001 },

+  { 0x0900, 0x0106, 0x0001 },

+  { 0x8500, 0x010b, 0x3fff },

+  { 0x8500, 0x0109, 0x2fff },

+  { 0x0900, 0x0108, 0x0001 },

+  { 0x0900, 0x010a, 0x0001 },

+  { 0x8500, 0x010d, 0x2fff },

+  { 0x0900, 0x010c, 0x0001 },

+  { 0x0900, 0x010e, 0x0001 },

+  { 0x8500, 0x0117, 0x4fff },

+  { 0x8500, 0x0113, 0x3fff },

+  { 0x8500, 0x0111, 0x2fff },

+  { 0x0900, 0x0110, 0x0001 },

+  { 0x0900, 0x0112, 0x0001 },

+  { 0x8500, 0x0115, 0x2fff },

+  { 0x0900, 0x0114, 0x0001 },

+  { 0x0900, 0x0116, 0x0001 },

+  { 0x8500, 0x011b, 0x3fff },

+  { 0x8500, 0x0119, 0x2fff },

+  { 0x0900, 0x0118, 0x0001 },

+  { 0x0900, 0x011a, 0x0001 },

+  { 0x8500, 0x011d, 0x2fff },

+  { 0x0900, 0x011c, 0x0001 },

+  { 0x0900, 0x011e, 0x0001 },

+  { 0x8500, 0x012f, 0x5fff },

+  { 0x8500, 0x0127, 0x4fff },

+  { 0x8500, 0x0123, 0x3fff },

+  { 0x8500, 0x0121, 0x2fff },

+  { 0x0900, 0x0120, 0x0001 },

+  { 0x0900, 0x0122, 0x0001 },

+  { 0x8500, 0x0125, 0x2fff },

+  { 0x0900, 0x0124, 0x0001 },

+  { 0x0900, 0x0126, 0x0001 },

+  { 0x8500, 0x012b, 0x3fff },

+  { 0x8500, 0x0129, 0x2fff },

+  { 0x0900, 0x0128, 0x0001 },

+  { 0x0900, 0x012a, 0x0001 },

+  { 0x8500, 0x012d, 0x2fff },

+  { 0x0900, 0x012c, 0x0001 },

+  { 0x0900, 0x012e, 0x0001 },

+  { 0x8500, 0x0137, 0x4fff },

+  { 0x8500, 0x0133, 0x3fff },

+  { 0x8500, 0x0131, 0x2f18 },

+  { 0x0900, 0x0130, 0x0f39 },

+  { 0x0900, 0x0132, 0x0001 },

+  { 0x8500, 0x0135, 0x2fff },

+  { 0x0900, 0x0134, 0x0001 },

+  { 0x0900, 0x0136, 0x0001 },

+  { 0x8900, 0x013b, 0x3001 },

+  { 0x8900, 0x0139, 0x2001 },

+  { 0x0500, 0x0138, 0x0000 },

+  { 0x0500, 0x013a, 0x0fff },

+  { 0x8900, 0x013d, 0x2001 },

+  { 0x0500, 0x013c, 0x0fff },

+  { 0x0500, 0x013e, 0x0fff },

+  { 0x8500, 0x015f, 0x6fff },

+  { 0x8500, 0x014f, 0x5fff },

+  { 0x8900, 0x0147, 0x4001 },

+  { 0x8900, 0x0143, 0x3001 },

+  { 0x8900, 0x0141, 0x2001 },

+  { 0x0500, 0x0140, 0x0fff },

+  { 0x0500, 0x0142, 0x0fff },

+  { 0x8900, 0x0145, 0x2001 },

+  { 0x0500, 0x0144, 0x0fff },

+  { 0x0500, 0x0146, 0x0fff },

+  { 0x8500, 0x014b, 0x3fff },

+  { 0x8500, 0x0149, 0x2000 },

+  { 0x0500, 0x0148, 0x0fff },

+  { 0x0900, 0x014a, 0x0001 },

+  { 0x8500, 0x014d, 0x2fff },

+  { 0x0900, 0x014c, 0x0001 },

+  { 0x0900, 0x014e, 0x0001 },

+  { 0x8500, 0x0157, 0x4fff },

+  { 0x8500, 0x0153, 0x3fff },

+  { 0x8500, 0x0151, 0x2fff },

+  { 0x0900, 0x0150, 0x0001 },

+  { 0x0900, 0x0152, 0x0001 },

+  { 0x8500, 0x0155, 0x2fff },

+  { 0x0900, 0x0154, 0x0001 },

+  { 0x0900, 0x0156, 0x0001 },

+  { 0x8500, 0x015b, 0x3fff },

+  { 0x8500, 0x0159, 0x2fff },

+  { 0x0900, 0x0158, 0x0001 },

+  { 0x0900, 0x015a, 0x0001 },

+  { 0x8500, 0x015d, 0x2fff },

+  { 0x0900, 0x015c, 0x0001 },

+  { 0x0900, 0x015e, 0x0001 },

+  { 0x8500, 0x016f, 0x5fff },

+  { 0x8500, 0x0167, 0x4fff },

+  { 0x8500, 0x0163, 0x3fff },

+  { 0x8500, 0x0161, 0x2fff },

+  { 0x0900, 0x0160, 0x0001 },

+  { 0x0900, 0x0162, 0x0001 },

+  { 0x8500, 0x0165, 0x2fff },

+  { 0x0900, 0x0164, 0x0001 },

+  { 0x0900, 0x0166, 0x0001 },

+  { 0x8500, 0x016b, 0x3fff },

+  { 0x8500, 0x0169, 0x2fff },

+  { 0x0900, 0x0168, 0x0001 },

+  { 0x0900, 0x016a, 0x0001 },

+  { 0x8500, 0x016d, 0x2fff },

+  { 0x0900, 0x016c, 0x0001 },

+  { 0x0900, 0x016e, 0x0001 },

+  { 0x8500, 0x0177, 0x4fff },

+  { 0x8500, 0x0173, 0x3fff },

+  { 0x8500, 0x0171, 0x2fff },

+  { 0x0900, 0x0170, 0x0001 },

+  { 0x0900, 0x0172, 0x0001 },

+  { 0x8500, 0x0175, 0x2fff },

+  { 0x0900, 0x0174, 0x0001 },

+  { 0x0900, 0x0176, 0x0001 },

+  { 0x8900, 0x017b, 0x3001 },

+  { 0x8900, 0x0179, 0x2001 },

+  { 0x0900, 0x0178, 0x0f87 },

+  { 0x0500, 0x017a, 0x0fff },

+  { 0x8900, 0x017d, 0x2001 },

+  { 0x0500, 0x017c, 0x0fff },

+  { 0x0500, 0x017e, 0x0fff },

+  { 0x8500, 0x01bf, 0x7038 },

+  { 0x8900, 0x019f, 0x60d6 },

+  { 0x8900, 0x018f, 0x50ca },

+  { 0x8900, 0x0187, 0x4001 },

+  { 0x8500, 0x0183, 0x3fff },

+  { 0x8900, 0x0181, 0x20d2 },

+  { 0x0500, 0x0180, 0x0000 },

+  { 0x0900, 0x0182, 0x0001 },

+  { 0x8500, 0x0185, 0x2fff },

+  { 0x0900, 0x0184, 0x0001 },

+  { 0x0900, 0x0186, 0x00ce },

+  { 0x8900, 0x018b, 0x3001 },

+  { 0x8900, 0x0189, 0x20cd },

+  { 0x0500, 0x0188, 0x0fff },

+  { 0x0900, 0x018a, 0x00cd },

+  { 0x8500, 0x018d, 0x2000 },

+  { 0x0500, 0x018c, 0x0fff },

+  { 0x0900, 0x018e, 0x004f },

+  { 0x8900, 0x0197, 0x40d1 },

+  { 0x8900, 0x0193, 0x30cd },

+  { 0x8900, 0x0191, 0x2001 },

+  { 0x0900, 0x0190, 0x00cb },

+  { 0x0500, 0x0192, 0x0fff },

+  { 0x8500, 0x0195, 0x2061 },

+  { 0x0900, 0x0194, 0x00cf },

+  { 0x0900, 0x0196, 0x00d3 },

+  { 0x8500, 0x019b, 0x3000 },

+  { 0x8500, 0x0199, 0x2fff },

+  { 0x0900, 0x0198, 0x0001 },

+  { 0x0500, 0x019a, 0x0000 },

+  { 0x8900, 0x019d, 0x20d5 },

+  { 0x0900, 0x019c, 0x00d3 },

+  { 0x0500, 0x019e, 0x0082 },

+  { 0x8900, 0x01af, 0x5001 },

+  { 0x8900, 0x01a7, 0x4001 },

+  { 0x8500, 0x01a3, 0x3fff },

+  { 0x8500, 0x01a1, 0x2fff },

+  { 0x0900, 0x01a0, 0x0001 },

+  { 0x0900, 0x01a2, 0x0001 },

+  { 0x8500, 0x01a5, 0x2fff },

+  { 0x0900, 0x01a4, 0x0001 },

+  { 0x0900, 0x01a6, 0x00da },

+  { 0x8500, 0x01ab, 0x3000 },

+  { 0x8900, 0x01a9, 0x20da },

+  { 0x0500, 0x01a8, 0x0fff },

+  { 0x0500, 0x01aa, 0x0000 },

+  { 0x8500, 0x01ad, 0x2fff },

+  { 0x0900, 0x01ac, 0x0001 },

+  { 0x0900, 0x01ae, 0x00da },

+  { 0x8900, 0x01b7, 0x40db },

+  { 0x8900, 0x01b3, 0x3001 },

+  { 0x8900, 0x01b1, 0x20d9 },

+  { 0x0500, 0x01b0, 0x0fff },

+  { 0x0900, 0x01b2, 0x00d9 },

+  { 0x8900, 0x01b5, 0x2001 },

+  { 0x0500, 0x01b4, 0x0fff },

+  { 0x0500, 0x01b6, 0x0fff },

+  { 0x8700, 0x01bb, 0x3000 },

+  { 0x8500, 0x01b9, 0x2fff },

+  { 0x0900, 0x01b8, 0x0001 },

+  { 0x0500, 0x01ba, 0x0000 },

+  { 0x8500, 0x01bd, 0x2fff },

+  { 0x0900, 0x01bc, 0x0001 },

+  { 0x0500, 0x01be, 0x0000 },

+  { 0x8500, 0x01df, 0x6fff },

+  { 0x8900, 0x01cf, 0x5001 },

+  { 0x8900, 0x01c7, 0x4002 },

+  { 0x8700, 0x01c3, 0x3000 },

+  { 0x8700, 0x01c1, 0x2000 },

+  { 0x0700, 0x01c0, 0x0000 },

+  { 0x0700, 0x01c2, 0x0000 },

+  { 0x8800, 0x01c5, 0x2000 },

+  { 0x0900, 0x01c4, 0x0002 },

+  { 0x0500, 0x01c6, 0x0ffe },

+  { 0x8800, 0x01cb, 0x3000 },

+  { 0x8500, 0x01c9, 0x2ffe },

+  { 0x0800, 0x01c8, 0x0000 },

+  { 0x0900, 0x01ca, 0x0002 },

+  { 0x8900, 0x01cd, 0x2001 },

+  { 0x0500, 0x01cc, 0x0ffe },

+  { 0x0500, 0x01ce, 0x0fff },

+  { 0x8900, 0x01d7, 0x4001 },

+  { 0x8900, 0x01d3, 0x3001 },

+  { 0x8900, 0x01d1, 0x2001 },

+  { 0x0500, 0x01d0, 0x0fff },

+  { 0x0500, 0x01d2, 0x0fff },

+  { 0x8900, 0x01d5, 0x2001 },

+  { 0x0500, 0x01d4, 0x0fff },

+  { 0x0500, 0x01d6, 0x0fff },

+  { 0x8900, 0x01db, 0x3001 },

+  { 0x8900, 0x01d9, 0x2001 },

+  { 0x0500, 0x01d8, 0x0fff },

+  { 0x0500, 0x01da, 0x0fff },

+  { 0x8500, 0x01dd, 0x2fb1 },

+  { 0x0500, 0x01dc, 0x0fff },

+  { 0x0900, 0x01de, 0x0001 },

+  { 0x8500, 0x01ef, 0x5fff },

+  { 0x8500, 0x01e7, 0x4fff },

+  { 0x8500, 0x01e3, 0x3fff },

+  { 0x8500, 0x01e1, 0x2fff },

+  { 0x0900, 0x01e0, 0x0001 },

+  { 0x0900, 0x01e2, 0x0001 },

+  { 0x8500, 0x01e5, 0x2fff },

+  { 0x0900, 0x01e4, 0x0001 },

+  { 0x0900, 0x01e6, 0x0001 },

+  { 0x8500, 0x01eb, 0x3fff },

+  { 0x8500, 0x01e9, 0x2fff },

+  { 0x0900, 0x01e8, 0x0001 },

+  { 0x0900, 0x01ea, 0x0001 },

+  { 0x8500, 0x01ed, 0x2fff },

+  { 0x0900, 0x01ec, 0x0001 },

+  { 0x0900, 0x01ee, 0x0001 },

+  { 0x8900, 0x01f7, 0x4fc8 },

+  { 0x8500, 0x01f3, 0x3ffe },

+  { 0x8900, 0x01f1, 0x2002 },

+  { 0x0500, 0x01f0, 0x0000 },

+  { 0x0800, 0x01f2, 0x0000 },

+  { 0x8500, 0x01f5, 0x2fff },

+  { 0x0900, 0x01f4, 0x0001 },

+  { 0x0900, 0x01f6, 0x0f9f },

+  { 0x8500, 0x01fb, 0x3fff },

+  { 0x8500, 0x01f9, 0x2fff },

+  { 0x0900, 0x01f8, 0x0001 },

+  { 0x0900, 0x01fa, 0x0001 },

+  { 0x8500, 0x01fd, 0x2fff },

+  { 0x0900, 0x01fc, 0x0001 },

+  { 0x0900, 0x01fe, 0x0001 },

+  { 0x8c00, 0x0318, 0x9000 },

+  { 0x8500, 0x0298, 0x8000 },

+  { 0x8500, 0x0258, 0x7000 },

+  { 0x8500, 0x021f, 0x6fff },

+  { 0x8500, 0x020f, 0x5fff },

+  { 0x8500, 0x0207, 0x4fff },

+  { 0x8500, 0x0203, 0x3fff },

+  { 0x8500, 0x0201, 0x2fff },

+  { 0x0900, 0x0200, 0x0001 },

+  { 0x0900, 0x0202, 0x0001 },

+  { 0x8500, 0x0205, 0x2fff },

+  { 0x0900, 0x0204, 0x0001 },

+  { 0x0900, 0x0206, 0x0001 },

+  { 0x8500, 0x020b, 0x3fff },

+  { 0x8500, 0x0209, 0x2fff },

+  { 0x0900, 0x0208, 0x0001 },

+  { 0x0900, 0x020a, 0x0001 },

+  { 0x8500, 0x020d, 0x2fff },

+  { 0x0900, 0x020c, 0x0001 },

+  { 0x0900, 0x020e, 0x0001 },

+  { 0x8500, 0x0217, 0x4fff },

+  { 0x8500, 0x0213, 0x3fff },

+  { 0x8500, 0x0211, 0x2fff },

+  { 0x0900, 0x0210, 0x0001 },

+  { 0x0900, 0x0212, 0x0001 },

+  { 0x8500, 0x0215, 0x2fff },

+  { 0x0900, 0x0214, 0x0001 },

+  { 0x0900, 0x0216, 0x0001 },

+  { 0x8500, 0x021b, 0x3fff },

+  { 0x8500, 0x0219, 0x2fff },

+  { 0x0900, 0x0218, 0x0001 },

+  { 0x0900, 0x021a, 0x0001 },

+  { 0x8500, 0x021d, 0x2fff },

+  { 0x0900, 0x021c, 0x0001 },

+  { 0x0900, 0x021e, 0x0001 },

+  { 0x8500, 0x022f, 0x5fff },

+  { 0x8500, 0x0227, 0x4fff },

+  { 0x8500, 0x0223, 0x3fff },

+  { 0x8500, 0x0221, 0x2000 },

+  { 0x0900, 0x0220, 0x0f7e },

+  { 0x0900, 0x0222, 0x0001 },

+  { 0x8500, 0x0225, 0x2fff },

+  { 0x0900, 0x0224, 0x0001 },

+  { 0x0900, 0x0226, 0x0001 },

+  { 0x8500, 0x022b, 0x3fff },

+  { 0x8500, 0x0229, 0x2fff },

+  { 0x0900, 0x0228, 0x0001 },

+  { 0x0900, 0x022a, 0x0001 },

+  { 0x8500, 0x022d, 0x2fff },

+  { 0x0900, 0x022c, 0x0001 },

+  { 0x0900, 0x022e, 0x0001 },

+  { 0x8500, 0x0250, 0x4000 },

+  { 0x8500, 0x0233, 0x3fff },

+  { 0x8500, 0x0231, 0x2fff },

+  { 0x0900, 0x0230, 0x0001 },

+  { 0x0900, 0x0232, 0x0001 },

+  { 0x8500, 0x0235, 0x2000 },

+  { 0x0500, 0x0234, 0x0000 },

+  { 0x0500, 0x0236, 0x0000 },

+  { 0x8500, 0x0254, 0x3f32 },

+  { 0x8500, 0x0252, 0x2000 },

+  { 0x0500, 0x0251, 0x0000 },

+  { 0x0500, 0x0253, 0x0f2e },

+  { 0x8500, 0x0256, 0x2f33 },

+  { 0x0500, 0x0255, 0x0000 },

+  { 0x0500, 0x0257, 0x0f33 },

+  { 0x8500, 0x0278, 0x6000 },

+  { 0x8500, 0x0268, 0x5f2f },

+  { 0x8500, 0x0260, 0x4f33 },

+  { 0x8500, 0x025c, 0x3000 },

+  { 0x8500, 0x025a, 0x2000 },

+  { 0x0500, 0x0259, 0x0f36 },

+  { 0x0500, 0x025b, 0x0f35 },

+  { 0x8500, 0x025e, 0x2000 },

+  { 0x0500, 0x025d, 0x0000 },

+  { 0x0500, 0x025f, 0x0000 },

+  { 0x8500, 0x0264, 0x3000 },

+  { 0x8500, 0x0262, 0x2000 },

+  { 0x0500, 0x0261, 0x0000 },

+  { 0x0500, 0x0263, 0x0f31 },

+  { 0x8500, 0x0266, 0x2000 },

+  { 0x0500, 0x0265, 0x0000 },

+  { 0x0500, 0x0267, 0x0000 },

+  { 0x8500, 0x0270, 0x4000 },

+  { 0x8500, 0x026c, 0x3000 },

+  { 0x8500, 0x026a, 0x2000 },

+  { 0x0500, 0x0269, 0x0f2d },

+  { 0x0500, 0x026b, 0x0000 },

+  { 0x8500, 0x026e, 0x2000 },

+  { 0x0500, 0x026d, 0x0000 },

+  { 0x0500, 0x026f, 0x0f2d },

+  { 0x8500, 0x0274, 0x3000 },

+  { 0x8500, 0x0272, 0x2f2b },

+  { 0x0500, 0x0271, 0x0000 },

+  { 0x0500, 0x0273, 0x0000 },

+  { 0x8500, 0x0276, 0x2000 },

+  { 0x0500, 0x0275, 0x0f2a },

+  { 0x0500, 0x0277, 0x0000 },

+  { 0x8500, 0x0288, 0x5f26 },

+  { 0x8500, 0x0280, 0x4f26 },

+  { 0x8500, 0x027c, 0x3000 },

+  { 0x8500, 0x027a, 0x2000 },

+  { 0x0500, 0x0279, 0x0000 },

+  { 0x0500, 0x027b, 0x0000 },

+  { 0x8500, 0x027e, 0x2000 },

+  { 0x0500, 0x027d, 0x0000 },

+  { 0x0500, 0x027f, 0x0000 },

+  { 0x8500, 0x0284, 0x3000 },

+  { 0x8500, 0x0282, 0x2000 },

+  { 0x0500, 0x0281, 0x0000 },

+  { 0x0500, 0x0283, 0x0f26 },

+  { 0x8500, 0x0286, 0x2000 },

+  { 0x0500, 0x0285, 0x0000 },

+  { 0x0500, 0x0287, 0x0000 },

+  { 0x8500, 0x0290, 0x4000 },

+  { 0x8500, 0x028c, 0x3000 },

+  { 0x8500, 0x028a, 0x2f27 },

+  { 0x0500, 0x0289, 0x0000 },

+  { 0x0500, 0x028b, 0x0f27 },

+  { 0x8500, 0x028e, 0x2000 },

+  { 0x0500, 0x028d, 0x0000 },

+  { 0x0500, 0x028f, 0x0000 },

+  { 0x8500, 0x0294, 0x3000 },

+  { 0x8500, 0x0292, 0x2f25 },

+  { 0x0500, 0x0291, 0x0000 },

+  { 0x0500, 0x0293, 0x0000 },

+  { 0x8500, 0x0296, 0x2000 },

+  { 0x0500, 0x0295, 0x0000 },

+  { 0x0500, 0x0297, 0x0000 },

+  { 0x9800, 0x02d8, 0x7000 },

+  { 0x8600, 0x02b8, 0x6000 },

+  { 0x8500, 0x02a8, 0x5000 },

+  { 0x8500, 0x02a0, 0x4000 },

+  { 0x8500, 0x029c, 0x3000 },

+  { 0x8500, 0x029a, 0x2000 },

+  { 0x0500, 0x0299, 0x0000 },

+  { 0x0500, 0x029b, 0x0000 },

+  { 0x8500, 0x029e, 0x2000 },

+  { 0x0500, 0x029d, 0x0000 },

+  { 0x0500, 0x029f, 0x0000 },

+  { 0x8500, 0x02a4, 0x3000 },

+  { 0x8500, 0x02a2, 0x2000 },

+  { 0x0500, 0x02a1, 0x0000 },

+  { 0x0500, 0x02a3, 0x0000 },

+  { 0x8500, 0x02a6, 0x2000 },

+  { 0x0500, 0x02a5, 0x0000 },

+  { 0x0500, 0x02a7, 0x0000 },

+  { 0x8600, 0x02b0, 0x4000 },

+  { 0x8500, 0x02ac, 0x3000 },

+  { 0x8500, 0x02aa, 0x2000 },

+  { 0x0500, 0x02a9, 0x0000 },

+  { 0x0500, 0x02ab, 0x0000 },

+  { 0x8500, 0x02ae, 0x2000 },

+  { 0x0500, 0x02ad, 0x0000 },

+  { 0x0500, 0x02af, 0x0000 },

+  { 0x8600, 0x02b4, 0x3000 },

+  { 0x8600, 0x02b2, 0x2000 },

+  { 0x0600, 0x02b1, 0x0000 },

+  { 0x0600, 0x02b3, 0x0000 },

+  { 0x8600, 0x02b6, 0x2000 },

+  { 0x0600, 0x02b5, 0x0000 },

+  { 0x0600, 0x02b7, 0x0000 },

+  { 0x8600, 0x02c8, 0x5000 },

+  { 0x8600, 0x02c0, 0x4000 },

+  { 0x8600, 0x02bc, 0x3000 },

+  { 0x8600, 0x02ba, 0x2000 },

+  { 0x0600, 0x02b9, 0x0000 },

+  { 0x0600, 0x02bb, 0x0000 },

+  { 0x8600, 0x02be, 0x2000 },

+  { 0x0600, 0x02bd, 0x0000 },

+  { 0x0600, 0x02bf, 0x0000 },

+  { 0x9800, 0x02c4, 0x3000 },

+  { 0x9800, 0x02c2, 0x2000 },

+  { 0x0600, 0x02c1, 0x0000 },

+  { 0x1800, 0x02c3, 0x0000 },

+  { 0x8600, 0x02c6, 0x2000 },

+  { 0x1800, 0x02c5, 0x0000 },

+  { 0x0600, 0x02c7, 0x0000 },

+  { 0x8600, 0x02d0, 0x4000 },

+  { 0x8600, 0x02cc, 0x3000 },

+  { 0x8600, 0x02ca, 0x2000 },

+  { 0x0600, 0x02c9, 0x0000 },

+  { 0x0600, 0x02cb, 0x0000 },

+  { 0x8600, 0x02ce, 0x2000 },

+  { 0x0600, 0x02cd, 0x0000 },

+  { 0x0600, 0x02cf, 0x0000 },

+  { 0x9800, 0x02d4, 0x3000 },

+  { 0x9800, 0x02d2, 0x2000 },

+  { 0x0600, 0x02d1, 0x0000 },

+  { 0x1800, 0x02d3, 0x0000 },

+  { 0x9800, 0x02d6, 0x2000 },

+  { 0x1800, 0x02d5, 0x0000 },

+  { 0x1800, 0x02d7, 0x0000 },

+  { 0x9800, 0x02f8, 0x6000 },

+  { 0x9800, 0x02e8, 0x5000 },

+  { 0x8600, 0x02e0, 0x4000 },

+  { 0x9800, 0x02dc, 0x3000 },

+  { 0x9800, 0x02da, 0x2000 },

+  { 0x1800, 0x02d9, 0x0000 },

+  { 0x1800, 0x02db, 0x0000 },

+  { 0x9800, 0x02de, 0x2000 },

+  { 0x1800, 0x02dd, 0x0000 },

+  { 0x1800, 0x02df, 0x0000 },

+  { 0x8600, 0x02e4, 0x3000 },

+  { 0x8600, 0x02e2, 0x2000 },

+  { 0x0600, 0x02e1, 0x0000 },

+  { 0x0600, 0x02e3, 0x0000 },

+  { 0x9800, 0x02e6, 0x2000 },

+  { 0x1800, 0x02e5, 0x0000 },

+  { 0x1800, 0x02e7, 0x0000 },

+  { 0x9800, 0x02f0, 0x4000 },

+  { 0x9800, 0x02ec, 0x3000 },

+  { 0x9800, 0x02ea, 0x2000 },

+  { 0x1800, 0x02e9, 0x0000 },

+  { 0x1800, 0x02eb, 0x0000 },

+  { 0x8600, 0x02ee, 0x2000 },

+  { 0x1800, 0x02ed, 0x0000 },

+  { 0x1800, 0x02ef, 0x0000 },

+  { 0x9800, 0x02f4, 0x3000 },

+  { 0x9800, 0x02f2, 0x2000 },

+  { 0x1800, 0x02f1, 0x0000 },

+  { 0x1800, 0x02f3, 0x0000 },

+  { 0x9800, 0x02f6, 0x2000 },

+  { 0x1800, 0x02f5, 0x0000 },

+  { 0x1800, 0x02f7, 0x0000 },

+  { 0x8c00, 0x0308, 0x5000 },

+  { 0x8c00, 0x0300, 0x4000 },

+  { 0x9800, 0x02fc, 0x3000 },

+  { 0x9800, 0x02fa, 0x2000 },

+  { 0x1800, 0x02f9, 0x0000 },

+  { 0x1800, 0x02fb, 0x0000 },

+  { 0x9800, 0x02fe, 0x2000 },

+  { 0x1800, 0x02fd, 0x0000 },

+  { 0x1800, 0x02ff, 0x0000 },

+  { 0x8c00, 0x0304, 0x3000 },

+  { 0x8c00, 0x0302, 0x2000 },

+  { 0x0c00, 0x0301, 0x0000 },

+  { 0x0c00, 0x0303, 0x0000 },

+  { 0x8c00, 0x0306, 0x2000 },

+  { 0x0c00, 0x0305, 0x0000 },

+  { 0x0c00, 0x0307, 0x0000 },

+  { 0x8c00, 0x0310, 0x4000 },

+  { 0x8c00, 0x030c, 0x3000 },

+  { 0x8c00, 0x030a, 0x2000 },

+  { 0x0c00, 0x0309, 0x0000 },

+  { 0x0c00, 0x030b, 0x0000 },

+  { 0x8c00, 0x030e, 0x2000 },

+  { 0x0c00, 0x030d, 0x0000 },

+  { 0x0c00, 0x030f, 0x0000 },

+  { 0x8c00, 0x0314, 0x3000 },

+  { 0x8c00, 0x0312, 0x2000 },

+  { 0x0c00, 0x0311, 0x0000 },

+  { 0x0c00, 0x0313, 0x0000 },

+  { 0x8c00, 0x0316, 0x2000 },

+  { 0x0c00, 0x0315, 0x0000 },

+  { 0x0c00, 0x0317, 0x0000 },

+  { 0x8500, 0x03b0, 0x8000 },

+  { 0x8c00, 0x035d, 0x7000 },

+  { 0x8c00, 0x0338, 0x6000 },

+  { 0x8c00, 0x0328, 0x5000 },

+  { 0x8c00, 0x0320, 0x4000 },

+  { 0x8c00, 0x031c, 0x3000 },

+  { 0x8c00, 0x031a, 0x2000 },

+  { 0x0c00, 0x0319, 0x0000 },

+  { 0x0c00, 0x031b, 0x0000 },

+  { 0x8c00, 0x031e, 0x2000 },

+  { 0x0c00, 0x031d, 0x0000 },

+  { 0x0c00, 0x031f, 0x0000 },

+  { 0x8c00, 0x0324, 0x3000 },

+  { 0x8c00, 0x0322, 0x2000 },

+  { 0x0c00, 0x0321, 0x0000 },

+  { 0x0c00, 0x0323, 0x0000 },

+  { 0x8c00, 0x0326, 0x2000 },

+  { 0x0c00, 0x0325, 0x0000 },

+  { 0x0c00, 0x0327, 0x0000 },

+  { 0x8c00, 0x0330, 0x4000 },

+  { 0x8c00, 0x032c, 0x3000 },

+  { 0x8c00, 0x032a, 0x2000 },

+  { 0x0c00, 0x0329, 0x0000 },

+  { 0x0c00, 0x032b, 0x0000 },

+  { 0x8c00, 0x032e, 0x2000 },

+  { 0x0c00, 0x032d, 0x0000 },

+  { 0x0c00, 0x032f, 0x0000 },

+  { 0x8c00, 0x0334, 0x3000 },

+  { 0x8c00, 0x0332, 0x2000 },

+  { 0x0c00, 0x0331, 0x0000 },

+  { 0x0c00, 0x0333, 0x0000 },

+  { 0x8c00, 0x0336, 0x2000 },

+  { 0x0c00, 0x0335, 0x0000 },

+  { 0x0c00, 0x0337, 0x0000 },

+  { 0x8c00, 0x0348, 0x5000 },

+  { 0x8c00, 0x0340, 0x4000 },

+  { 0x8c00, 0x033c, 0x3000 },

+  { 0x8c00, 0x033a, 0x2000 },

+  { 0x0c00, 0x0339, 0x0000 },

+  { 0x0c00, 0x033b, 0x0000 },

+  { 0x8c00, 0x033e, 0x2000 },

+  { 0x0c00, 0x033d, 0x0000 },

+  { 0x0c00, 0x033f, 0x0000 },

+  { 0x8c00, 0x0344, 0x3000 },

+  { 0x8c00, 0x0342, 0x2000 },

+  { 0x0c00, 0x0341, 0x0000 },

+  { 0x0c00, 0x0343, 0x0000 },

+  { 0x8c00, 0x0346, 0x2000 },

+  { 0x0c00, 0x0345, 0x0000 },

+  { 0x0c00, 0x0347, 0x0000 },

+  { 0x8c00, 0x0350, 0x4000 },

+  { 0x8c00, 0x034c, 0x3000 },

+  { 0x8c00, 0x034a, 0x2000 },

+  { 0x0c00, 0x0349, 0x0000 },

+  { 0x0c00, 0x034b, 0x0000 },

+  { 0x8c00, 0x034e, 0x2000 },

+  { 0x0c00, 0x034d, 0x0000 },

+  { 0x0c00, 0x034f, 0x0000 },

+  { 0x8c00, 0x0354, 0x3000 },

+  { 0x8c00, 0x0352, 0x2000 },

+  { 0x0c00, 0x0351, 0x0000 },

+  { 0x0c00, 0x0353, 0x0000 },

+  { 0x8c00, 0x0356, 0x2000 },

+  { 0x0c00, 0x0355, 0x0000 },

+  { 0x0c00, 0x0357, 0x0000 },

+  { 0x8900, 0x038f, 0x603f },

+  { 0x8c00, 0x036d, 0x5000 },

+  { 0x8c00, 0x0365, 0x4000 },

+  { 0x8c00, 0x0361, 0x3000 },

+  { 0x8c00, 0x035f, 0x2000 },

+  { 0x0c00, 0x035e, 0x0000 },

+  { 0x0c00, 0x0360, 0x0000 },

+  { 0x8c00, 0x0363, 0x2000 },

+  { 0x0c00, 0x0362, 0x0000 },

+  { 0x0c00, 0x0364, 0x0000 },

+  { 0x8c00, 0x0369, 0x3000 },

+  { 0x8c00, 0x0367, 0x2000 },

+  { 0x0c00, 0x0366, 0x0000 },

+  { 0x0c00, 0x0368, 0x0000 },

+  { 0x8c00, 0x036b, 0x2000 },

+  { 0x0c00, 0x036a, 0x0000 },

+  { 0x0c00, 0x036c, 0x0000 },

+  { 0x9800, 0x0385, 0x4000 },

+  { 0x9800, 0x0375, 0x3000 },

+  { 0x8c00, 0x036f, 0x2000 },

+  { 0x0c00, 0x036e, 0x0000 },

+  { 0x1800, 0x0374, 0x0000 },

+  { 0x9500, 0x037e, 0x2000 },

+  { 0x0600, 0x037a, 0x0000 },

+  { 0x1800, 0x0384, 0x0000 },

+  { 0x8900, 0x0389, 0x3025 },

+  { 0x9500, 0x0387, 0x2000 },

+  { 0x0900, 0x0386, 0x0026 },

+  { 0x0900, 0x0388, 0x0025 },

+  { 0x8900, 0x038c, 0x2040 },

+  { 0x0900, 0x038a, 0x0025 },

+  { 0x0900, 0x038e, 0x003f },

+  { 0x8900, 0x039f, 0x5020 },

+  { 0x8900, 0x0397, 0x4020 },

+  { 0x8900, 0x0393, 0x3020 },

+  { 0x8900, 0x0391, 0x2020 },

+  { 0x0500, 0x0390, 0x0000 },

+  { 0x0900, 0x0392, 0x0020 },

+  { 0x8900, 0x0395, 0x2020 },

+  { 0x0900, 0x0394, 0x0020 },

+  { 0x0900, 0x0396, 0x0020 },

+  { 0x8900, 0x039b, 0x3020 },

+  { 0x8900, 0x0399, 0x2020 },

+  { 0x0900, 0x0398, 0x0020 },

+  { 0x0900, 0x039a, 0x0020 },

+  { 0x8900, 0x039d, 0x2020 },

+  { 0x0900, 0x039c, 0x0020 },

+  { 0x0900, 0x039e, 0x0020 },

+  { 0x8900, 0x03a8, 0x4020 },

+  { 0x8900, 0x03a4, 0x3020 },

+  { 0x8900, 0x03a1, 0x2020 },

+  { 0x0900, 0x03a0, 0x0020 },

+  { 0x0900, 0x03a3, 0x0020 },

+  { 0x8900, 0x03a6, 0x2020 },

+  { 0x0900, 0x03a5, 0x0020 },

+  { 0x0900, 0x03a7, 0x0020 },

+  { 0x8500, 0x03ac, 0x3fda },

+  { 0x8900, 0x03aa, 0x2020 },

+  { 0x0900, 0x03a9, 0x0020 },

+  { 0x0900, 0x03ab, 0x0020 },

+  { 0x8500, 0x03ae, 0x2fdb },

+  { 0x0500, 0x03ad, 0x0fdb },

+  { 0x0500, 0x03af, 0x0fdb },

+  { 0x8500, 0x03f1, 0x7fb0 },

+  { 0x8500, 0x03d1, 0x6fc7 },

+  { 0x8500, 0x03c0, 0x5fe0 },

+  { 0x8500, 0x03b8, 0x4fe0 },

+  { 0x8500, 0x03b4, 0x3fe0 },

+  { 0x8500, 0x03b2, 0x2fe0 },

+  { 0x0500, 0x03b1, 0x0fe0 },

+  { 0x0500, 0x03b3, 0x0fe0 },

+  { 0x8500, 0x03b6, 0x2fe0 },

+  { 0x0500, 0x03b5, 0x0fe0 },

+  { 0x0500, 0x03b7, 0x0fe0 },

+  { 0x8500, 0x03bc, 0x3fe0 },

+  { 0x8500, 0x03ba, 0x2fe0 },

+  { 0x0500, 0x03b9, 0x0fe0 },

+  { 0x0500, 0x03bb, 0x0fe0 },

+  { 0x8500, 0x03be, 0x2fe0 },

+  { 0x0500, 0x03bd, 0x0fe0 },

+  { 0x0500, 0x03bf, 0x0fe0 },

+  { 0x8500, 0x03c8, 0x4fe0 },

+  { 0x8500, 0x03c4, 0x3fe0 },

+  { 0x8500, 0x03c2, 0x2fe1 },

+  { 0x0500, 0x03c1, 0x0fe0 },

+  { 0x0500, 0x03c3, 0x0fe0 },

+  { 0x8500, 0x03c6, 0x2fe0 },

+  { 0x0500, 0x03c5, 0x0fe0 },

+  { 0x0500, 0x03c7, 0x0fe0 },

+  { 0x8500, 0x03cc, 0x3fc0 },

+  { 0x8500, 0x03ca, 0x2fe0 },

+  { 0x0500, 0x03c9, 0x0fe0 },

+  { 0x0500, 0x03cb, 0x0fe0 },

+  { 0x8500, 0x03ce, 0x2fc1 },

+  { 0x0500, 0x03cd, 0x0fc1 },

+  { 0x0500, 0x03d0, 0x0fc2 },

+  { 0x8500, 0x03e1, 0x5fff },

+  { 0x8500, 0x03d9, 0x4fff },

+  { 0x8500, 0x03d5, 0x3fd1 },

+  { 0x8900, 0x03d3, 0x2000 },

+  { 0x0900, 0x03d2, 0x0000 },

+  { 0x0900, 0x03d4, 0x0000 },

+  { 0x8500, 0x03d7, 0x2000 },

+  { 0x0500, 0x03d6, 0x0fca },

+  { 0x0900, 0x03d8, 0x0001 },

+  { 0x8500, 0x03dd, 0x3fff },

+  { 0x8500, 0x03db, 0x2fff },

+  { 0x0900, 0x03da, 0x0001 },

+  { 0x0900, 0x03dc, 0x0001 },

+  { 0x8500, 0x03df, 0x2fff },

+  { 0x0900, 0x03de, 0x0001 },

+  { 0x0900, 0x03e0, 0x0001 },

+  { 0x8500, 0x03e9, 0x4fff },

+  { 0x8500, 0x03e5, 0x3fff },

+  { 0x8500, 0x03e3, 0x2fff },

+  { 0x0900, 0x03e2, 0x0001 },

+  { 0x0900, 0x03e4, 0x0001 },

+  { 0x8500, 0x03e7, 0x2fff },

+  { 0x0900, 0x03e6, 0x0001 },

+  { 0x0900, 0x03e8, 0x0001 },

+  { 0x8500, 0x03ed, 0x3fff },

+  { 0x8500, 0x03eb, 0x2fff },

+  { 0x0900, 0x03ea, 0x0001 },

+  { 0x0900, 0x03ec, 0x0001 },

+  { 0x8500, 0x03ef, 0x2fff },

+  { 0x0900, 0x03ee, 0x0001 },

+  { 0x0500, 0x03f0, 0x0faa },

+  { 0x8900, 0x0415, 0x6020 },

+  { 0x8900, 0x0405, 0x5050 },

+  { 0x8900, 0x03f9, 0x4ff9 },

+  { 0x8500, 0x03f5, 0x3fa0 },

+  { 0x8500, 0x03f3, 0x2000 },

+  { 0x0500, 0x03f2, 0x0007 },

+  { 0x0900, 0x03f4, 0x0fc4 },

+  { 0x8900, 0x03f7, 0x2001 },

+  { 0x1900, 0x03f6, 0x0000 },

+  { 0x0500, 0x03f8, 0x0fff },

+  { 0x8900, 0x0401, 0x3050 },

+  { 0x8500, 0x03fb, 0x2fff },

+  { 0x0900, 0x03fa, 0x0001 },

+  { 0x0900, 0x0400, 0x0050 },

+  { 0x8900, 0x0403, 0x2050 },

+  { 0x0900, 0x0402, 0x0050 },

+  { 0x0900, 0x0404, 0x0050 },

+  { 0x8900, 0x040d, 0x4050 },

+  { 0x8900, 0x0409, 0x3050 },

+  { 0x8900, 0x0407, 0x2050 },

+  { 0x0900, 0x0406, 0x0050 },

+  { 0x0900, 0x0408, 0x0050 },

+  { 0x8900, 0x040b, 0x2050 },

+  { 0x0900, 0x040a, 0x0050 },

+  { 0x0900, 0x040c, 0x0050 },

+  { 0x8900, 0x0411, 0x3020 },

+  { 0x8900, 0x040f, 0x2050 },

+  { 0x0900, 0x040e, 0x0050 },

+  { 0x0900, 0x0410, 0x0020 },

+  { 0x8900, 0x0413, 0x2020 },

+  { 0x0900, 0x0412, 0x0020 },

+  { 0x0900, 0x0414, 0x0020 },

+  { 0x8900, 0x0425, 0x5020 },

+  { 0x8900, 0x041d, 0x4020 },

+  { 0x8900, 0x0419, 0x3020 },

+  { 0x8900, 0x0417, 0x2020 },

+  { 0x0900, 0x0416, 0x0020 },

+  { 0x0900, 0x0418, 0x0020 },

+  { 0x8900, 0x041b, 0x2020 },

+  { 0x0900, 0x041a, 0x0020 },

+  { 0x0900, 0x041c, 0x0020 },

+  { 0x8900, 0x0421, 0x3020 },

+  { 0x8900, 0x041f, 0x2020 },

+  { 0x0900, 0x041e, 0x0020 },

+  { 0x0900, 0x0420, 0x0020 },

+  { 0x8900, 0x0423, 0x2020 },

+  { 0x0900, 0x0422, 0x0020 },

+  { 0x0900, 0x0424, 0x0020 },

+  { 0x8900, 0x042d, 0x4020 },

+  { 0x8900, 0x0429, 0x3020 },

+  { 0x8900, 0x0427, 0x2020 },

+  { 0x0900, 0x0426, 0x0020 },

+  { 0x0900, 0x0428, 0x0020 },

+  { 0x8900, 0x042b, 0x2020 },

+  { 0x0900, 0x042a, 0x0020 },

+  { 0x0900, 0x042c, 0x0020 },

+  { 0x8500, 0x0431, 0x3fe0 },

+  { 0x8900, 0x042f, 0x2020 },

+  { 0x0900, 0x042e, 0x0020 },

+  { 0x0500, 0x0430, 0x0fe0 },

+  { 0x8500, 0x0433, 0x2fe0 },

+  { 0x0500, 0x0432, 0x0fe0 },

+  { 0x0500, 0x0434, 0x0fe0 },

+  { 0x8700, 0x06a4, 0xa000 },

+  { 0x8500, 0x0563, 0x9fd0 },

+  { 0x8900, 0x04b6, 0x8001 },

+  { 0x8500, 0x0475, 0x7fff },

+  { 0x8500, 0x0455, 0x6fb0 },

+  { 0x8500, 0x0445, 0x5fe0 },

+  { 0x8500, 0x043d, 0x4fe0 },

+  { 0x8500, 0x0439, 0x3fe0 },

+  { 0x8500, 0x0437, 0x2fe0 },

+  { 0x0500, 0x0436, 0x0fe0 },

+  { 0x0500, 0x0438, 0x0fe0 },

+  { 0x8500, 0x043b, 0x2fe0 },

+  { 0x0500, 0x043a, 0x0fe0 },

+  { 0x0500, 0x043c, 0x0fe0 },

+  { 0x8500, 0x0441, 0x3fe0 },

+  { 0x8500, 0x043f, 0x2fe0 },

+  { 0x0500, 0x043e, 0x0fe0 },

+  { 0x0500, 0x0440, 0x0fe0 },

+  { 0x8500, 0x0443, 0x2fe0 },

+  { 0x0500, 0x0442, 0x0fe0 },

+  { 0x0500, 0x0444, 0x0fe0 },

+  { 0x8500, 0x044d, 0x4fe0 },

+  { 0x8500, 0x0449, 0x3fe0 },

+  { 0x8500, 0x0447, 0x2fe0 },

+  { 0x0500, 0x0446, 0x0fe0 },

+  { 0x0500, 0x0448, 0x0fe0 },

+  { 0x8500, 0x044b, 0x2fe0 },

+  { 0x0500, 0x044a, 0x0fe0 },

+  { 0x0500, 0x044c, 0x0fe0 },

+  { 0x8500, 0x0451, 0x3fb0 },

+  { 0x8500, 0x044f, 0x2fe0 },

+  { 0x0500, 0x044e, 0x0fe0 },

+  { 0x0500, 0x0450, 0x0fb0 },

+  { 0x8500, 0x0453, 0x2fb0 },

+  { 0x0500, 0x0452, 0x0fb0 },

+  { 0x0500, 0x0454, 0x0fb0 },

+  { 0x8500, 0x0465, 0x5fff },

+  { 0x8500, 0x045d, 0x4fb0 },

+  { 0x8500, 0x0459, 0x3fb0 },

+  { 0x8500, 0x0457, 0x2fb0 },

+  { 0x0500, 0x0456, 0x0fb0 },

+  { 0x0500, 0x0458, 0x0fb0 },

+  { 0x8500, 0x045b, 0x2fb0 },

+  { 0x0500, 0x045a, 0x0fb0 },

+  { 0x0500, 0x045c, 0x0fb0 },

+  { 0x8500, 0x0461, 0x3fff },

+  { 0x8500, 0x045f, 0x2fb0 },

+  { 0x0500, 0x045e, 0x0fb0 },

+  { 0x0900, 0x0460, 0x0001 },

+  { 0x8500, 0x0463, 0x2fff },

+  { 0x0900, 0x0462, 0x0001 },

+  { 0x0900, 0x0464, 0x0001 },

+  { 0x8500, 0x046d, 0x4fff },

+  { 0x8500, 0x0469, 0x3fff },

+  { 0x8500, 0x0467, 0x2fff },

+  { 0x0900, 0x0466, 0x0001 },

+  { 0x0900, 0x0468, 0x0001 },

+  { 0x8500, 0x046b, 0x2fff },

+  { 0x0900, 0x046a, 0x0001 },

+  { 0x0900, 0x046c, 0x0001 },

+  { 0x8500, 0x0471, 0x3fff },

+  { 0x8500, 0x046f, 0x2fff },

+  { 0x0900, 0x046e, 0x0001 },

+  { 0x0900, 0x0470, 0x0001 },

+  { 0x8500, 0x0473, 0x2fff },

+  { 0x0900, 0x0472, 0x0001 },

+  { 0x0900, 0x0474, 0x0001 },

+  { 0x8900, 0x0496, 0x6001 },

+  { 0x8c00, 0x0485, 0x5000 },

+  { 0x8500, 0x047d, 0x4fff },

+  { 0x8500, 0x0479, 0x3fff },

+  { 0x8500, 0x0477, 0x2fff },

+  { 0x0900, 0x0476, 0x0001 },

+  { 0x0900, 0x0478, 0x0001 },

+  { 0x8500, 0x047b, 0x2fff },

+  { 0x0900, 0x047a, 0x0001 },

+  { 0x0900, 0x047c, 0x0001 },

+  { 0x8500, 0x0481, 0x3fff },

+  { 0x8500, 0x047f, 0x2fff },

+  { 0x0900, 0x047e, 0x0001 },

+  { 0x0900, 0x0480, 0x0001 },

+  { 0x8c00, 0x0483, 0x2000 },

+  { 0x1a00, 0x0482, 0x0000 },

+  { 0x0c00, 0x0484, 0x0000 },

+  { 0x8900, 0x048e, 0x4001 },

+  { 0x8900, 0x048a, 0x3001 },

+  { 0x8b00, 0x0488, 0x2000 },

+  { 0x0c00, 0x0486, 0x0000 },

+  { 0x0b00, 0x0489, 0x0000 },

+  { 0x8900, 0x048c, 0x2001 },

+  { 0x0500, 0x048b, 0x0fff },

+  { 0x0500, 0x048d, 0x0fff },

+  { 0x8900, 0x0492, 0x3001 },

+  { 0x8900, 0x0490, 0x2001 },

+  { 0x0500, 0x048f, 0x0fff },

+  { 0x0500, 0x0491, 0x0fff },

+  { 0x8900, 0x0494, 0x2001 },

+  { 0x0500, 0x0493, 0x0fff },

+  { 0x0500, 0x0495, 0x0fff },

+  { 0x8900, 0x04a6, 0x5001 },

+  { 0x8900, 0x049e, 0x4001 },

+  { 0x8900, 0x049a, 0x3001 },

+  { 0x8900, 0x0498, 0x2001 },

+  { 0x0500, 0x0497, 0x0fff },

+  { 0x0500, 0x0499, 0x0fff },

+  { 0x8900, 0x049c, 0x2001 },

+  { 0x0500, 0x049b, 0x0fff },

+  { 0x0500, 0x049d, 0x0fff },

+  { 0x8900, 0x04a2, 0x3001 },

+  { 0x8900, 0x04a0, 0x2001 },

+  { 0x0500, 0x049f, 0x0fff },

+  { 0x0500, 0x04a1, 0x0fff },

+  { 0x8900, 0x04a4, 0x2001 },

+  { 0x0500, 0x04a3, 0x0fff },

+  { 0x0500, 0x04a5, 0x0fff },

+  { 0x8900, 0x04ae, 0x4001 },

+  { 0x8900, 0x04aa, 0x3001 },

+  { 0x8900, 0x04a8, 0x2001 },

+  { 0x0500, 0x04a7, 0x0fff },

+  { 0x0500, 0x04a9, 0x0fff },

+  { 0x8900, 0x04ac, 0x2001 },

+  { 0x0500, 0x04ab, 0x0fff },

+  { 0x0500, 0x04ad, 0x0fff },

+  { 0x8900, 0x04b2, 0x3001 },

+  { 0x8900, 0x04b0, 0x2001 },

+  { 0x0500, 0x04af, 0x0fff },

+  { 0x0500, 0x04b1, 0x0fff },

+  { 0x8900, 0x04b4, 0x2001 },

+  { 0x0500, 0x04b3, 0x0fff },

+  { 0x0500, 0x04b5, 0x0fff },

+  { 0x8500, 0x04f9, 0x7fff },

+  { 0x8500, 0x04d7, 0x6fff },

+  { 0x8500, 0x04c6, 0x5fff },

+  { 0x8900, 0x04be, 0x4001 },

+  { 0x8900, 0x04ba, 0x3001 },

+  { 0x8900, 0x04b8, 0x2001 },

+  { 0x0500, 0x04b7, 0x0fff },

+  { 0x0500, 0x04b9, 0x0fff },

+  { 0x8900, 0x04bc, 0x2001 },

+  { 0x0500, 0x04bb, 0x0fff },

+  { 0x0500, 0x04bd, 0x0fff },

+  { 0x8500, 0x04c2, 0x3fff },

+  { 0x8900, 0x04c0, 0x2000 },

+  { 0x0500, 0x04bf, 0x0fff },

+  { 0x0900, 0x04c1, 0x0001 },

+  { 0x8500, 0x04c4, 0x2fff },

+  { 0x0900, 0x04c3, 0x0001 },

+  { 0x0900, 0x04c5, 0x0001 },

+  { 0x8500, 0x04ce, 0x4fff },

+  { 0x8500, 0x04ca, 0x3fff },

+  { 0x8500, 0x04c8, 0x2fff },

+  { 0x0900, 0x04c7, 0x0001 },

+  { 0x0900, 0x04c9, 0x0001 },

+  { 0x8500, 0x04cc, 0x2fff },

+  { 0x0900, 0x04cb, 0x0001 },

+  { 0x0900, 0x04cd, 0x0001 },

+  { 0x8500, 0x04d3, 0x3fff },

+  { 0x8500, 0x04d1, 0x2fff },

+  { 0x0900, 0x04d0, 0x0001 },

+  { 0x0900, 0x04d2, 0x0001 },

+  { 0x8500, 0x04d5, 0x2fff },

+  { 0x0900, 0x04d4, 0x0001 },

+  { 0x0900, 0x04d6, 0x0001 },

+  { 0x8500, 0x04e7, 0x5fff },

+  { 0x8500, 0x04df, 0x4fff },

+  { 0x8500, 0x04db, 0x3fff },

+  { 0x8500, 0x04d9, 0x2fff },

+  { 0x0900, 0x04d8, 0x0001 },

+  { 0x0900, 0x04da, 0x0001 },

+  { 0x8500, 0x04dd, 0x2fff },

+  { 0x0900, 0x04dc, 0x0001 },

+  { 0x0900, 0x04de, 0x0001 },

+  { 0x8500, 0x04e3, 0x3fff },

+  { 0x8500, 0x04e1, 0x2fff },

+  { 0x0900, 0x04e0, 0x0001 },

+  { 0x0900, 0x04e2, 0x0001 },

+  { 0x8500, 0x04e5, 0x2fff },

+  { 0x0900, 0x04e4, 0x0001 },

+  { 0x0900, 0x04e6, 0x0001 },

+  { 0x8500, 0x04ef, 0x4fff },

+  { 0x8500, 0x04eb, 0x3fff },

+  { 0x8500, 0x04e9, 0x2fff },

+  { 0x0900, 0x04e8, 0x0001 },

+  { 0x0900, 0x04ea, 0x0001 },

+  { 0x8500, 0x04ed, 0x2fff },

+  { 0x0900, 0x04ec, 0x0001 },

+  { 0x0900, 0x04ee, 0x0001 },

+  { 0x8500, 0x04f3, 0x3fff },

+  { 0x8500, 0x04f1, 0x2fff },

+  { 0x0900, 0x04f0, 0x0001 },

+  { 0x0900, 0x04f2, 0x0001 },

+  { 0x8500, 0x04f5, 0x2fff },

+  { 0x0900, 0x04f4, 0x0001 },

+  { 0x0900, 0x04f8, 0x0001 },

+  { 0x8900, 0x0540, 0x6030 },

+  { 0x8500, 0x050f, 0x5fff },

+  { 0x8500, 0x0507, 0x4fff },

+  { 0x8500, 0x0503, 0x3fff },

+  { 0x8500, 0x0501, 0x2fff },

+  { 0x0900, 0x0500, 0x0001 },

+  { 0x0900, 0x0502, 0x0001 },

+  { 0x8500, 0x0505, 0x2fff },

+  { 0x0900, 0x0504, 0x0001 },

+  { 0x0900, 0x0506, 0x0001 },

+  { 0x8500, 0x050b, 0x3fff },

+  { 0x8500, 0x0509, 0x2fff },

+  { 0x0900, 0x0508, 0x0001 },

+  { 0x0900, 0x050a, 0x0001 },

+  { 0x8500, 0x050d, 0x2fff },

+  { 0x0900, 0x050c, 0x0001 },

+  { 0x0900, 0x050e, 0x0001 },

+  { 0x8900, 0x0538, 0x4030 },

+  { 0x8900, 0x0534, 0x3030 },

+  { 0x8900, 0x0532, 0x2030 },

+  { 0x0900, 0x0531, 0x0030 },

+  { 0x0900, 0x0533, 0x0030 },

+  { 0x8900, 0x0536, 0x2030 },

+  { 0x0900, 0x0535, 0x0030 },

+  { 0x0900, 0x0537, 0x0030 },

+  { 0x8900, 0x053c, 0x3030 },

+  { 0x8900, 0x053a, 0x2030 },

+  { 0x0900, 0x0539, 0x0030 },

+  { 0x0900, 0x053b, 0x0030 },

+  { 0x8900, 0x053e, 0x2030 },

+  { 0x0900, 0x053d, 0x0030 },

+  { 0x0900, 0x053f, 0x0030 },

+  { 0x8900, 0x0550, 0x5030 },

+  { 0x8900, 0x0548, 0x4030 },

+  { 0x8900, 0x0544, 0x3030 },

+  { 0x8900, 0x0542, 0x2030 },

+  { 0x0900, 0x0541, 0x0030 },

+  { 0x0900, 0x0543, 0x0030 },

+  { 0x8900, 0x0546, 0x2030 },

+  { 0x0900, 0x0545, 0x0030 },

+  { 0x0900, 0x0547, 0x0030 },

+  { 0x8900, 0x054c, 0x3030 },

+  { 0x8900, 0x054a, 0x2030 },

+  { 0x0900, 0x0549, 0x0030 },

+  { 0x0900, 0x054b, 0x0030 },

+  { 0x8900, 0x054e, 0x2030 },

+  { 0x0900, 0x054d, 0x0030 },

+  { 0x0900, 0x054f, 0x0030 },

+  { 0x9500, 0x055a, 0x4000 },

+  { 0x8900, 0x0554, 0x3030 },

+  { 0x8900, 0x0552, 0x2030 },

+  { 0x0900, 0x0551, 0x0030 },

+  { 0x0900, 0x0553, 0x0030 },

+  { 0x8900, 0x0556, 0x2030 },

+  { 0x0900, 0x0555, 0x0030 },

+  { 0x0600, 0x0559, 0x0000 },

+  { 0x9500, 0x055e, 0x3000 },

+  { 0x9500, 0x055c, 0x2000 },

+  { 0x1500, 0x055b, 0x0000 },

+  { 0x1500, 0x055d, 0x0000 },

+  { 0x8500, 0x0561, 0x2fd0 },

+  { 0x1500, 0x055f, 0x0000 },

+  { 0x0500, 0x0562, 0x0fd0 },

+  { 0x9a00, 0x060f, 0x8000 },

+  { 0x8c00, 0x05ab, 0x7000 },

+  { 0x8500, 0x0583, 0x6fd0 },

+  { 0x8500, 0x0573, 0x5fd0 },

+  { 0x8500, 0x056b, 0x4fd0 },

+  { 0x8500, 0x0567, 0x3fd0 },

+  { 0x8500, 0x0565, 0x2fd0 },

+  { 0x0500, 0x0564, 0x0fd0 },

+  { 0x0500, 0x0566, 0x0fd0 },

+  { 0x8500, 0x0569, 0x2fd0 },

+  { 0x0500, 0x0568, 0x0fd0 },

+  { 0x0500, 0x056a, 0x0fd0 },

+  { 0x8500, 0x056f, 0x3fd0 },

+  { 0x8500, 0x056d, 0x2fd0 },

+  { 0x0500, 0x056c, 0x0fd0 },

+  { 0x0500, 0x056e, 0x0fd0 },

+  { 0x8500, 0x0571, 0x2fd0 },

+  { 0x0500, 0x0570, 0x0fd0 },

+  { 0x0500, 0x0572, 0x0fd0 },

+  { 0x8500, 0x057b, 0x4fd0 },

+  { 0x8500, 0x0577, 0x3fd0 },

+  { 0x8500, 0x0575, 0x2fd0 },

+  { 0x0500, 0x0574, 0x0fd0 },

+  { 0x0500, 0x0576, 0x0fd0 },

+  { 0x8500, 0x0579, 0x2fd0 },

+  { 0x0500, 0x0578, 0x0fd0 },

+  { 0x0500, 0x057a, 0x0fd0 },

+  { 0x8500, 0x057f, 0x3fd0 },

+  { 0x8500, 0x057d, 0x2fd0 },

+  { 0x0500, 0x057c, 0x0fd0 },

+  { 0x0500, 0x057e, 0x0fd0 },

+  { 0x8500, 0x0581, 0x2fd0 },

+  { 0x0500, 0x0580, 0x0fd0 },

+  { 0x0500, 0x0582, 0x0fd0 },

+  { 0x8c00, 0x059a, 0x5000 },

+  { 0x8c00, 0x0592, 0x4000 },

+  { 0x8500, 0x0587, 0x3000 },

+  { 0x8500, 0x0585, 0x2fd0 },

+  { 0x0500, 0x0584, 0x0fd0 },

+  { 0x0500, 0x0586, 0x0fd0 },

+  { 0x9100, 0x058a, 0x2000 },

+  { 0x1500, 0x0589, 0x0000 },

+  { 0x0c00, 0x0591, 0x0000 },

+  { 0x8c00, 0x0596, 0x3000 },

+  { 0x8c00, 0x0594, 0x2000 },

+  { 0x0c00, 0x0593, 0x0000 },

+  { 0x0c00, 0x0595, 0x0000 },

+  { 0x8c00, 0x0598, 0x2000 },

+  { 0x0c00, 0x0597, 0x0000 },

+  { 0x0c00, 0x0599, 0x0000 },

+  { 0x8c00, 0x05a3, 0x4000 },

+  { 0x8c00, 0x059e, 0x3000 },

+  { 0x8c00, 0x059c, 0x2000 },

+  { 0x0c00, 0x059b, 0x0000 },

+  { 0x0c00, 0x059d, 0x0000 },

+  { 0x8c00, 0x05a0, 0x2000 },

+  { 0x0c00, 0x059f, 0x0000 },

+  { 0x0c00, 0x05a1, 0x0000 },

+  { 0x8c00, 0x05a7, 0x3000 },

+  { 0x8c00, 0x05a5, 0x2000 },

+  { 0x0c00, 0x05a4, 0x0000 },

+  { 0x0c00, 0x05a6, 0x0000 },

+  { 0x8c00, 0x05a9, 0x2000 },

+  { 0x0c00, 0x05a8, 0x0000 },

+  { 0x0c00, 0x05aa, 0x0000 },

+  { 0x8700, 0x05d7, 0x6000 },

+  { 0x8c00, 0x05bc, 0x5000 },

+  { 0x8c00, 0x05b3, 0x4000 },

+  { 0x8c00, 0x05af, 0x3000 },

+  { 0x8c00, 0x05ad, 0x2000 },

+  { 0x0c00, 0x05ac, 0x0000 },

+  { 0x0c00, 0x05ae, 0x0000 },

+  { 0x8c00, 0x05b1, 0x2000 },

+  { 0x0c00, 0x05b0, 0x0000 },

+  { 0x0c00, 0x05b2, 0x0000 },

+  { 0x8c00, 0x05b7, 0x3000 },

+  { 0x8c00, 0x05b5, 0x2000 },

+  { 0x0c00, 0x05b4, 0x0000 },

+  { 0x0c00, 0x05b6, 0x0000 },

+  { 0x8c00, 0x05b9, 0x2000 },

+  { 0x0c00, 0x05b8, 0x0000 },

+  { 0x0c00, 0x05bb, 0x0000 },

+  { 0x8c00, 0x05c4, 0x4000 },

+  { 0x9500, 0x05c0, 0x3000 },

+  { 0x9500, 0x05be, 0x2000 },

+  { 0x0c00, 0x05bd, 0x0000 },

+  { 0x0c00, 0x05bf, 0x0000 },

+  { 0x8c00, 0x05c2, 0x2000 },

+  { 0x0c00, 0x05c1, 0x0000 },

+  { 0x1500, 0x05c3, 0x0000 },

+  { 0x8700, 0x05d3, 0x3000 },

+  { 0x8700, 0x05d1, 0x2000 },

+  { 0x0700, 0x05d0, 0x0000 },

+  { 0x0700, 0x05d2, 0x0000 },

+  { 0x8700, 0x05d5, 0x2000 },

+  { 0x0700, 0x05d4, 0x0000 },

+  { 0x0700, 0x05d6, 0x0000 },

+  { 0x8700, 0x05e7, 0x5000 },

+  { 0x8700, 0x05df, 0x4000 },

+  { 0x8700, 0x05db, 0x3000 },

+  { 0x8700, 0x05d9, 0x2000 },

+  { 0x0700, 0x05d8, 0x0000 },

+  { 0x0700, 0x05da, 0x0000 },

+  { 0x8700, 0x05dd, 0x2000 },

+  { 0x0700, 0x05dc, 0x0000 },

+  { 0x0700, 0x05de, 0x0000 },

+  { 0x8700, 0x05e3, 0x3000 },

+  { 0x8700, 0x05e1, 0x2000 },

+  { 0x0700, 0x05e0, 0x0000 },

+  { 0x0700, 0x05e2, 0x0000 },

+  { 0x8700, 0x05e5, 0x2000 },

+  { 0x0700, 0x05e4, 0x0000 },

+  { 0x0700, 0x05e6, 0x0000 },

+  { 0x9500, 0x05f4, 0x4000 },

+  { 0x8700, 0x05f0, 0x3000 },

+  { 0x8700, 0x05e9, 0x2000 },

+  { 0x0700, 0x05e8, 0x0000 },

+  { 0x0700, 0x05ea, 0x0000 },

+  { 0x8700, 0x05f2, 0x2000 },

+  { 0x0700, 0x05f1, 0x0000 },

+  { 0x1500, 0x05f3, 0x0000 },

+  { 0x8100, 0x0603, 0x3000 },

+  { 0x8100, 0x0601, 0x2000 },

+  { 0x0100, 0x0600, 0x0000 },

+  { 0x0100, 0x0602, 0x0000 },

+  { 0x9500, 0x060d, 0x2000 },

+  { 0x1500, 0x060c, 0x0000 },

+  { 0x1a00, 0x060e, 0x0000 },

+  { 0x8d00, 0x0664, 0x7000 },

+  { 0x8700, 0x0638, 0x6000 },

+  { 0x8700, 0x0628, 0x5000 },

+  { 0x9500, 0x061f, 0x4000 },

+  { 0x8c00, 0x0613, 0x3000 },

+  { 0x8c00, 0x0611, 0x2000 },

+  { 0x0c00, 0x0610, 0x0000 },

+  { 0x0c00, 0x0612, 0x0000 },

+  { 0x8c00, 0x0615, 0x2000 },

+  { 0x0c00, 0x0614, 0x0000 },

+  { 0x1500, 0x061b, 0x0000 },

+  { 0x8700, 0x0624, 0x3000 },

+  { 0x8700, 0x0622, 0x2000 },

+  { 0x0700, 0x0621, 0x0000 },

+  { 0x0700, 0x0623, 0x0000 },

+  { 0x8700, 0x0626, 0x2000 },

+  { 0x0700, 0x0625, 0x0000 },

+  { 0x0700, 0x0627, 0x0000 },

+  { 0x8700, 0x0630, 0x4000 },

+  { 0x8700, 0x062c, 0x3000 },

+  { 0x8700, 0x062a, 0x2000 },

+  { 0x0700, 0x0629, 0x0000 },

+  { 0x0700, 0x062b, 0x0000 },

+  { 0x8700, 0x062e, 0x2000 },

+  { 0x0700, 0x062d, 0x0000 },

+  { 0x0700, 0x062f, 0x0000 },

+  { 0x8700, 0x0634, 0x3000 },

+  { 0x8700, 0x0632, 0x2000 },

+  { 0x0700, 0x0631, 0x0000 },

+  { 0x0700, 0x0633, 0x0000 },

+  { 0x8700, 0x0636, 0x2000 },

+  { 0x0700, 0x0635, 0x0000 },

+  { 0x0700, 0x0637, 0x0000 },

+  { 0x8c00, 0x064d, 0x5000 },

+  { 0x8700, 0x0645, 0x4000 },

+  { 0x8700, 0x0641, 0x3000 },

+  { 0x8700, 0x063a, 0x2000 },

+  { 0x0700, 0x0639, 0x0000 },

+  { 0x0600, 0x0640, 0x0000 },

+  { 0x8700, 0x0643, 0x2000 },

+  { 0x0700, 0x0642, 0x0000 },

+  { 0x0700, 0x0644, 0x0000 },

+  { 0x8700, 0x0649, 0x3000 },

+  { 0x8700, 0x0647, 0x2000 },

+  { 0x0700, 0x0646, 0x0000 },

+  { 0x0700, 0x0648, 0x0000 },

+  { 0x8c00, 0x064b, 0x2000 },

+  { 0x0700, 0x064a, 0x0000 },

+  { 0x0c00, 0x064c, 0x0000 },

+  { 0x8c00, 0x0655, 0x4000 },

+  { 0x8c00, 0x0651, 0x3000 },

+  { 0x8c00, 0x064f, 0x2000 },

+  { 0x0c00, 0x064e, 0x0000 },

+  { 0x0c00, 0x0650, 0x0000 },

+  { 0x8c00, 0x0653, 0x2000 },

+  { 0x0c00, 0x0652, 0x0000 },

+  { 0x0c00, 0x0654, 0x0000 },

+  { 0x8d00, 0x0660, 0x3000 },

+  { 0x8c00, 0x0657, 0x2000 },

+  { 0x0c00, 0x0656, 0x0000 },

+  { 0x0c00, 0x0658, 0x0000 },

+  { 0x8d00, 0x0662, 0x2000 },

+  { 0x0d00, 0x0661, 0x0000 },

+  { 0x0d00, 0x0663, 0x0000 },

+  { 0x8700, 0x0684, 0x6000 },

+  { 0x8700, 0x0674, 0x5000 },

+  { 0x9500, 0x066c, 0x4000 },

+  { 0x8d00, 0x0668, 0x3000 },

+  { 0x8d00, 0x0666, 0x2000 },

+  { 0x0d00, 0x0665, 0x0000 },

+  { 0x0d00, 0x0667, 0x0000 },

+  { 0x9500, 0x066a, 0x2000 },

+  { 0x0d00, 0x0669, 0x0000 },

+  { 0x1500, 0x066b, 0x0000 },

+  { 0x8c00, 0x0670, 0x3000 },

+  { 0x8700, 0x066e, 0x2000 },

+  { 0x1500, 0x066d, 0x0000 },

+  { 0x0700, 0x066f, 0x0000 },

+  { 0x8700, 0x0672, 0x2000 },

+  { 0x0700, 0x0671, 0x0000 },

+  { 0x0700, 0x0673, 0x0000 },

+  { 0x8700, 0x067c, 0x4000 },

+  { 0x8700, 0x0678, 0x3000 },

+  { 0x8700, 0x0676, 0x2000 },

+  { 0x0700, 0x0675, 0x0000 },

+  { 0x0700, 0x0677, 0x0000 },

+  { 0x8700, 0x067a, 0x2000 },

+  { 0x0700, 0x0679, 0x0000 },

+  { 0x0700, 0x067b, 0x0000 },

+  { 0x8700, 0x0680, 0x3000 },

+  { 0x8700, 0x067e, 0x2000 },

+  { 0x0700, 0x067d, 0x0000 },

+  { 0x0700, 0x067f, 0x0000 },

+  { 0x8700, 0x0682, 0x2000 },

+  { 0x0700, 0x0681, 0x0000 },

+  { 0x0700, 0x0683, 0x0000 },

+  { 0x8700, 0x0694, 0x5000 },

+  { 0x8700, 0x068c, 0x4000 },

+  { 0x8700, 0x0688, 0x3000 },

+  { 0x8700, 0x0686, 0x2000 },

+  { 0x0700, 0x0685, 0x0000 },

+  { 0x0700, 0x0687, 0x0000 },

+  { 0x8700, 0x068a, 0x2000 },

+  { 0x0700, 0x0689, 0x0000 },

+  { 0x0700, 0x068b, 0x0000 },

+  { 0x8700, 0x0690, 0x3000 },

+  { 0x8700, 0x068e, 0x2000 },

+  { 0x0700, 0x068d, 0x0000 },

+  { 0x0700, 0x068f, 0x0000 },

+  { 0x8700, 0x0692, 0x2000 },

+  { 0x0700, 0x0691, 0x0000 },

+  { 0x0700, 0x0693, 0x0000 },

+  { 0x8700, 0x069c, 0x4000 },

+  { 0x8700, 0x0698, 0x3000 },

+  { 0x8700, 0x0696, 0x2000 },

+  { 0x0700, 0x0695, 0x0000 },

+  { 0x0700, 0x0697, 0x0000 },

+  { 0x8700, 0x069a, 0x2000 },

+  { 0x0700, 0x0699, 0x0000 },

+  { 0x0700, 0x069b, 0x0000 },

+  { 0x8700, 0x06a0, 0x3000 },

+  { 0x8700, 0x069e, 0x2000 },

+  { 0x0700, 0x069d, 0x0000 },

+  { 0x0700, 0x069f, 0x0000 },

+  { 0x8700, 0x06a2, 0x2000 },

+  { 0x0700, 0x06a1, 0x0000 },

+  { 0x0700, 0x06a3, 0x0000 },

+  { 0x8700, 0x0926, 0x9000 },

+  { 0x8700, 0x0725, 0x8000 },

+  { 0x8c00, 0x06e4, 0x7000 },

+  { 0x8700, 0x06c4, 0x6000 },

+  { 0x8700, 0x06b4, 0x5000 },

+  { 0x8700, 0x06ac, 0x4000 },

+  { 0x8700, 0x06a8, 0x3000 },

+  { 0x8700, 0x06a6, 0x2000 },

+  { 0x0700, 0x06a5, 0x0000 },

+  { 0x0700, 0x06a7, 0x0000 },

+  { 0x8700, 0x06aa, 0x2000 },

+  { 0x0700, 0x06a9, 0x0000 },

+  { 0x0700, 0x06ab, 0x0000 },

+  { 0x8700, 0x06b0, 0x3000 },

+  { 0x8700, 0x06ae, 0x2000 },

+  { 0x0700, 0x06ad, 0x0000 },

+  { 0x0700, 0x06af, 0x0000 },

+  { 0x8700, 0x06b2, 0x2000 },

+  { 0x0700, 0x06b1, 0x0000 },

+  { 0x0700, 0x06b3, 0x0000 },

+  { 0x8700, 0x06bc, 0x4000 },

+  { 0x8700, 0x06b8, 0x3000 },

+  { 0x8700, 0x06b6, 0x2000 },

+  { 0x0700, 0x06b5, 0x0000 },

+  { 0x0700, 0x06b7, 0x0000 },

+  { 0x8700, 0x06ba, 0x2000 },

+  { 0x0700, 0x06b9, 0x0000 },

+  { 0x0700, 0x06bb, 0x0000 },

+  { 0x8700, 0x06c0, 0x3000 },

+  { 0x8700, 0x06be, 0x2000 },

+  { 0x0700, 0x06bd, 0x0000 },

+  { 0x0700, 0x06bf, 0x0000 },

+  { 0x8700, 0x06c2, 0x2000 },

+  { 0x0700, 0x06c1, 0x0000 },

+  { 0x0700, 0x06c3, 0x0000 },

+  { 0x9500, 0x06d4, 0x5000 },

+  { 0x8700, 0x06cc, 0x4000 },

+  { 0x8700, 0x06c8, 0x3000 },

+  { 0x8700, 0x06c6, 0x2000 },

+  { 0x0700, 0x06c5, 0x0000 },

+  { 0x0700, 0x06c7, 0x0000 },

+  { 0x8700, 0x06ca, 0x2000 },

+  { 0x0700, 0x06c9, 0x0000 },

+  { 0x0700, 0x06cb, 0x0000 },

+  { 0x8700, 0x06d0, 0x3000 },

+  { 0x8700, 0x06ce, 0x2000 },

+  { 0x0700, 0x06cd, 0x0000 },

+  { 0x0700, 0x06cf, 0x0000 },

+  { 0x8700, 0x06d2, 0x2000 },

+  { 0x0700, 0x06d1, 0x0000 },

+  { 0x0700, 0x06d3, 0x0000 },

+  { 0x8c00, 0x06dc, 0x4000 },

+  { 0x8c00, 0x06d8, 0x3000 },

+  { 0x8c00, 0x06d6, 0x2000 },

+  { 0x0700, 0x06d5, 0x0000 },

+  { 0x0c00, 0x06d7, 0x0000 },

+  { 0x8c00, 0x06da, 0x2000 },

+  { 0x0c00, 0x06d9, 0x0000 },

+  { 0x0c00, 0x06db, 0x0000 },

+  { 0x8c00, 0x06e0, 0x3000 },

+  { 0x8b00, 0x06de, 0x2000 },

+  { 0x0100, 0x06dd, 0x0000 },

+  { 0x0c00, 0x06df, 0x0000 },

+  { 0x8c00, 0x06e2, 0x2000 },

+  { 0x0c00, 0x06e1, 0x0000 },

+  { 0x0c00, 0x06e3, 0x0000 },

+  { 0x9500, 0x0704, 0x6000 },

+  { 0x8d00, 0x06f4, 0x5000 },

+  { 0x8c00, 0x06ec, 0x4000 },

+  { 0x8c00, 0x06e8, 0x3000 },

+  { 0x8600, 0x06e6, 0x2000 },

+  { 0x0600, 0x06e5, 0x0000 },

+  { 0x0c00, 0x06e7, 0x0000 },

+  { 0x8c00, 0x06ea, 0x2000 },

+  { 0x1a00, 0x06e9, 0x0000 },

+  { 0x0c00, 0x06eb, 0x0000 },

+  { 0x8d00, 0x06f0, 0x3000 },

+  { 0x8700, 0x06ee, 0x2000 },

+  { 0x0c00, 0x06ed, 0x0000 },

+  { 0x0700, 0x06ef, 0x0000 },

+  { 0x8d00, 0x06f2, 0x2000 },

+  { 0x0d00, 0x06f1, 0x0000 },

+  { 0x0d00, 0x06f3, 0x0000 },

+  { 0x8700, 0x06fc, 0x4000 },

+  { 0x8d00, 0x06f8, 0x3000 },

+  { 0x8d00, 0x06f6, 0x2000 },

+  { 0x0d00, 0x06f5, 0x0000 },

+  { 0x0d00, 0x06f7, 0x0000 },

+  { 0x8700, 0x06fa, 0x2000 },

+  { 0x0d00, 0x06f9, 0x0000 },

+  { 0x0700, 0x06fb, 0x0000 },

+  { 0x9500, 0x0700, 0x3000 },

+  { 0x9a00, 0x06fe, 0x2000 },

+  { 0x1a00, 0x06fd, 0x0000 },

+  { 0x0700, 0x06ff, 0x0000 },

+  { 0x9500, 0x0702, 0x2000 },

+  { 0x1500, 0x0701, 0x0000 },

+  { 0x1500, 0x0703, 0x0000 },

+  { 0x8700, 0x0715, 0x5000 },

+  { 0x9500, 0x070c, 0x4000 },

+  { 0x9500, 0x0708, 0x3000 },

+  { 0x9500, 0x0706, 0x2000 },

+  { 0x1500, 0x0705, 0x0000 },

+  { 0x1500, 0x0707, 0x0000 },

+  { 0x9500, 0x070a, 0x2000 },

+  { 0x1500, 0x0709, 0x0000 },

+  { 0x1500, 0x070b, 0x0000 },

+  { 0x8c00, 0x0711, 0x3000 },

+  { 0x8100, 0x070f, 0x2000 },

+  { 0x1500, 0x070d, 0x0000 },

+  { 0x0700, 0x0710, 0x0000 },

+  { 0x8700, 0x0713, 0x2000 },

+  { 0x0700, 0x0712, 0x0000 },

+  { 0x0700, 0x0714, 0x0000 },

+  { 0x8700, 0x071d, 0x4000 },

+  { 0x8700, 0x0719, 0x3000 },

+  { 0x8700, 0x0717, 0x2000 },

+  { 0x0700, 0x0716, 0x0000 },

+  { 0x0700, 0x0718, 0x0000 },

+  { 0x8700, 0x071b, 0x2000 },

+  { 0x0700, 0x071a, 0x0000 },

+  { 0x0700, 0x071c, 0x0000 },

+  { 0x8700, 0x0721, 0x3000 },

+  { 0x8700, 0x071f, 0x2000 },

+  { 0x0700, 0x071e, 0x0000 },

+  { 0x0700, 0x0720, 0x0000 },

+  { 0x8700, 0x0723, 0x2000 },

+  { 0x0700, 0x0722, 0x0000 },

+  { 0x0700, 0x0724, 0x0000 },

+  { 0x8700, 0x0797, 0x7000 },

+  { 0x8c00, 0x0745, 0x6000 },

+  { 0x8c00, 0x0735, 0x5000 },

+  { 0x8700, 0x072d, 0x4000 },

+  { 0x8700, 0x0729, 0x3000 },

+  { 0x8700, 0x0727, 0x2000 },

+  { 0x0700, 0x0726, 0x0000 },

+  { 0x0700, 0x0728, 0x0000 },

+  { 0x8700, 0x072b, 0x2000 },

+  { 0x0700, 0x072a, 0x0000 },

+  { 0x0700, 0x072c, 0x0000 },

+  { 0x8c00, 0x0731, 0x3000 },

+  { 0x8700, 0x072f, 0x2000 },

+  { 0x0700, 0x072e, 0x0000 },

+  { 0x0c00, 0x0730, 0x0000 },

+  { 0x8c00, 0x0733, 0x2000 },

+  { 0x0c00, 0x0732, 0x0000 },

+  { 0x0c00, 0x0734, 0x0000 },

+  { 0x8c00, 0x073d, 0x4000 },

+  { 0x8c00, 0x0739, 0x3000 },

+  { 0x8c00, 0x0737, 0x2000 },

+  { 0x0c00, 0x0736, 0x0000 },

+  { 0x0c00, 0x0738, 0x0000 },

+  { 0x8c00, 0x073b, 0x2000 },

+  { 0x0c00, 0x073a, 0x0000 },

+  { 0x0c00, 0x073c, 0x0000 },

+  { 0x8c00, 0x0741, 0x3000 },

+  { 0x8c00, 0x073f, 0x2000 },

+  { 0x0c00, 0x073e, 0x0000 },

+  { 0x0c00, 0x0740, 0x0000 },

+  { 0x8c00, 0x0743, 0x2000 },

+  { 0x0c00, 0x0742, 0x0000 },

+  { 0x0c00, 0x0744, 0x0000 },

+  { 0x8700, 0x0787, 0x5000 },

+  { 0x8700, 0x074f, 0x4000 },

+  { 0x8c00, 0x0749, 0x3000 },

+  { 0x8c00, 0x0747, 0x2000 },

+  { 0x0c00, 0x0746, 0x0000 },

+  { 0x0c00, 0x0748, 0x0000 },

+  { 0x8700, 0x074d, 0x2000 },

+  { 0x0c00, 0x074a, 0x0000 },

+  { 0x0700, 0x074e, 0x0000 },

+  { 0x8700, 0x0783, 0x3000 },

+  { 0x8700, 0x0781, 0x2000 },

+  { 0x0700, 0x0780, 0x0000 },

+  { 0x0700, 0x0782, 0x0000 },

+  { 0x8700, 0x0785, 0x2000 },

+  { 0x0700, 0x0784, 0x0000 },

+  { 0x0700, 0x0786, 0x0000 },

+  { 0x8700, 0x078f, 0x4000 },

+  { 0x8700, 0x078b, 0x3000 },

+  { 0x8700, 0x0789, 0x2000 },

+  { 0x0700, 0x0788, 0x0000 },

+  { 0x0700, 0x078a, 0x0000 },

+  { 0x8700, 0x078d, 0x2000 },

+  { 0x0700, 0x078c, 0x0000 },

+  { 0x0700, 0x078e, 0x0000 },

+  { 0x8700, 0x0793, 0x3000 },

+  { 0x8700, 0x0791, 0x2000 },

+  { 0x0700, 0x0790, 0x0000 },

+  { 0x0700, 0x0792, 0x0000 },

+  { 0x8700, 0x0795, 0x2000 },

+  { 0x0700, 0x0794, 0x0000 },

+  { 0x0700, 0x0796, 0x0000 },

+  { 0x8700, 0x0906, 0x6000 },

+  { 0x8c00, 0x07a7, 0x5000 },

+  { 0x8700, 0x079f, 0x4000 },

+  { 0x8700, 0x079b, 0x3000 },

+  { 0x8700, 0x0799, 0x2000 },

+  { 0x0700, 0x0798, 0x0000 },

+  { 0x0700, 0x079a, 0x0000 },

+  { 0x8700, 0x079d, 0x2000 },

+  { 0x0700, 0x079c, 0x0000 },

+  { 0x0700, 0x079e, 0x0000 },

+  { 0x8700, 0x07a3, 0x3000 },

+  { 0x8700, 0x07a1, 0x2000 },

+  { 0x0700, 0x07a0, 0x0000 },

+  { 0x0700, 0x07a2, 0x0000 },

+  { 0x8700, 0x07a5, 0x2000 },

+  { 0x0700, 0x07a4, 0x0000 },

+  { 0x0c00, 0x07a6, 0x0000 },

+  { 0x8c00, 0x07af, 0x4000 },

+  { 0x8c00, 0x07ab, 0x3000 },

+  { 0x8c00, 0x07a9, 0x2000 },

+  { 0x0c00, 0x07a8, 0x0000 },

+  { 0x0c00, 0x07aa, 0x0000 },

+  { 0x8c00, 0x07ad, 0x2000 },

+  { 0x0c00, 0x07ac, 0x0000 },

+  { 0x0c00, 0x07ae, 0x0000 },

+  { 0x8c00, 0x0902, 0x3000 },

+  { 0x8700, 0x07b1, 0x2000 },

+  { 0x0c00, 0x07b0, 0x0000 },

+  { 0x0c00, 0x0901, 0x0000 },

+  { 0x8700, 0x0904, 0x2000 },

+  { 0x0a00, 0x0903, 0x0000 },

+  { 0x0700, 0x0905, 0x0000 },

+  { 0x8700, 0x0916, 0x5000 },

+  { 0x8700, 0x090e, 0x4000 },

+  { 0x8700, 0x090a, 0x3000 },

+  { 0x8700, 0x0908, 0x2000 },

+  { 0x0700, 0x0907, 0x0000 },

+  { 0x0700, 0x0909, 0x0000 },

+  { 0x8700, 0x090c, 0x2000 },

+  { 0x0700, 0x090b, 0x0000 },

+  { 0x0700, 0x090d, 0x0000 },

+  { 0x8700, 0x0912, 0x3000 },

+  { 0x8700, 0x0910, 0x2000 },

+  { 0x0700, 0x090f, 0x0000 },

+  { 0x0700, 0x0911, 0x0000 },

+  { 0x8700, 0x0914, 0x2000 },

+  { 0x0700, 0x0913, 0x0000 },

+  { 0x0700, 0x0915, 0x0000 },

+  { 0x8700, 0x091e, 0x4000 },

+  { 0x8700, 0x091a, 0x3000 },

+  { 0x8700, 0x0918, 0x2000 },

+  { 0x0700, 0x0917, 0x0000 },

+  { 0x0700, 0x0919, 0x0000 },

+  { 0x8700, 0x091c, 0x2000 },

+  { 0x0700, 0x091b, 0x0000 },

+  { 0x0700, 0x091d, 0x0000 },

+  { 0x8700, 0x0922, 0x3000 },

+  { 0x8700, 0x0920, 0x2000 },

+  { 0x0700, 0x091f, 0x0000 },

+  { 0x0700, 0x0921, 0x0000 },

+  { 0x8700, 0x0924, 0x2000 },

+  { 0x0700, 0x0923, 0x0000 },

+  { 0x0700, 0x0925, 0x0000 },

+  { 0x8c00, 0x09cd, 0x8000 },

+  { 0x8d00, 0x096d, 0x7000 },

+  { 0x8c00, 0x0948, 0x6000 },

+  { 0x8700, 0x0936, 0x5000 },

+  { 0x8700, 0x092e, 0x4000 },

+  { 0x8700, 0x092a, 0x3000 },

+  { 0x8700, 0x0928, 0x2000 },

+  { 0x0700, 0x0927, 0x0000 },

+  { 0x0700, 0x0929, 0x0000 },

+  { 0x8700, 0x092c, 0x2000 },

+  { 0x0700, 0x092b, 0x0000 },

+  { 0x0700, 0x092d, 0x0000 },

+  { 0x8700, 0x0932, 0x3000 },

+  { 0x8700, 0x0930, 0x2000 },

+  { 0x0700, 0x092f, 0x0000 },

+  { 0x0700, 0x0931, 0x0000 },

+  { 0x8700, 0x0934, 0x2000 },

+  { 0x0700, 0x0933, 0x0000 },

+  { 0x0700, 0x0935, 0x0000 },

+  { 0x8a00, 0x0940, 0x4000 },

+  { 0x8c00, 0x093c, 0x3000 },

+  { 0x8700, 0x0938, 0x2000 },

+  { 0x0700, 0x0937, 0x0000 },

+  { 0x0700, 0x0939, 0x0000 },

+  { 0x8a00, 0x093e, 0x2000 },

+  { 0x0700, 0x093d, 0x0000 },

+  { 0x0a00, 0x093f, 0x0000 },

+  { 0x8c00, 0x0944, 0x3000 },

+  { 0x8c00, 0x0942, 0x2000 },

+  { 0x0c00, 0x0941, 0x0000 },

+  { 0x0c00, 0x0943, 0x0000 },

+  { 0x8c00, 0x0946, 0x2000 },

+  { 0x0c00, 0x0945, 0x0000 },

+  { 0x0c00, 0x0947, 0x0000 },

+  { 0x8700, 0x095d, 0x5000 },

+  { 0x8c00, 0x0952, 0x4000 },

+  { 0x8a00, 0x094c, 0x3000 },

+  { 0x8a00, 0x094a, 0x2000 },

+  { 0x0a00, 0x0949, 0x0000 },

+  { 0x0a00, 0x094b, 0x0000 },

+  { 0x8700, 0x0950, 0x2000 },

+  { 0x0c00, 0x094d, 0x0000 },

+  { 0x0c00, 0x0951, 0x0000 },

+  { 0x8700, 0x0959, 0x3000 },

+  { 0x8c00, 0x0954, 0x2000 },

+  { 0x0c00, 0x0953, 0x0000 },

+  { 0x0700, 0x0958, 0x0000 },

+  { 0x8700, 0x095b, 0x2000 },

+  { 0x0700, 0x095a, 0x0000 },

+  { 0x0700, 0x095c, 0x0000 },

+  { 0x9500, 0x0965, 0x4000 },

+  { 0x8700, 0x0961, 0x3000 },

+  { 0x8700, 0x095f, 0x2000 },

+  { 0x0700, 0x095e, 0x0000 },

+  { 0x0700, 0x0960, 0x0000 },

+  { 0x8c00, 0x0963, 0x2000 },

+  { 0x0c00, 0x0962, 0x0000 },

+  { 0x1500, 0x0964, 0x0000 },

+  { 0x8d00, 0x0969, 0x3000 },

+  { 0x8d00, 0x0967, 0x2000 },

+  { 0x0d00, 0x0966, 0x0000 },

+  { 0x0d00, 0x0968, 0x0000 },

+  { 0x8d00, 0x096b, 0x2000 },

+  { 0x0d00, 0x096a, 0x0000 },

+  { 0x0d00, 0x096c, 0x0000 },

+  { 0x8700, 0x09a2, 0x6000 },

+  { 0x8700, 0x0990, 0x5000 },

+  { 0x8700, 0x0986, 0x4000 },

+  { 0x8c00, 0x0981, 0x3000 },

+  { 0x8d00, 0x096f, 0x2000 },

+  { 0x0d00, 0x096e, 0x0000 },

+  { 0x1500, 0x0970, 0x0000 },

+  { 0x8a00, 0x0983, 0x2000 },

+  { 0x0a00, 0x0982, 0x0000 },

+  { 0x0700, 0x0985, 0x0000 },

+  { 0x8700, 0x098a, 0x3000 },

+  { 0x8700, 0x0988, 0x2000 },

+  { 0x0700, 0x0987, 0x0000 },

+  { 0x0700, 0x0989, 0x0000 },

+  { 0x8700, 0x098c, 0x2000 },

+  { 0x0700, 0x098b, 0x0000 },

+  { 0x0700, 0x098f, 0x0000 },

+  { 0x8700, 0x099a, 0x4000 },

+  { 0x8700, 0x0996, 0x3000 },

+  { 0x8700, 0x0994, 0x2000 },

+  { 0x0700, 0x0993, 0x0000 },

+  { 0x0700, 0x0995, 0x0000 },

+  { 0x8700, 0x0998, 0x2000 },

+  { 0x0700, 0x0997, 0x0000 },

+  { 0x0700, 0x0999, 0x0000 },

+  { 0x8700, 0x099e, 0x3000 },

+  { 0x8700, 0x099c, 0x2000 },

+  { 0x0700, 0x099b, 0x0000 },

+  { 0x0700, 0x099d, 0x0000 },

+  { 0x8700, 0x09a0, 0x2000 },

+  { 0x0700, 0x099f, 0x0000 },

+  { 0x0700, 0x09a1, 0x0000 },

+  { 0x8700, 0x09b7, 0x5000 },

+  { 0x8700, 0x09ab, 0x4000 },

+  { 0x8700, 0x09a6, 0x3000 },

+  { 0x8700, 0x09a4, 0x2000 },

+  { 0x0700, 0x09a3, 0x0000 },

+  { 0x0700, 0x09a5, 0x0000 },

+  { 0x8700, 0x09a8, 0x2000 },

+  { 0x0700, 0x09a7, 0x0000 },

+  { 0x0700, 0x09aa, 0x0000 },

+  { 0x8700, 0x09af, 0x3000 },

+  { 0x8700, 0x09ad, 0x2000 },

+  { 0x0700, 0x09ac, 0x0000 },

+  { 0x0700, 0x09ae, 0x0000 },

+  { 0x8700, 0x09b2, 0x2000 },

+  { 0x0700, 0x09b0, 0x0000 },

+  { 0x0700, 0x09b6, 0x0000 },

+  { 0x8c00, 0x09c1, 0x4000 },

+  { 0x8700, 0x09bd, 0x3000 },

+  { 0x8700, 0x09b9, 0x2000 },

+  { 0x0700, 0x09b8, 0x0000 },

+  { 0x0c00, 0x09bc, 0x0000 },

+  { 0x8a00, 0x09bf, 0x2000 },

+  { 0x0a00, 0x09be, 0x0000 },

+  { 0x0a00, 0x09c0, 0x0000 },

+  { 0x8a00, 0x09c7, 0x3000 },

+  { 0x8c00, 0x09c3, 0x2000 },

+  { 0x0c00, 0x09c2, 0x0000 },

+  { 0x0c00, 0x09c4, 0x0000 },

+  { 0x8a00, 0x09cb, 0x2000 },

+  { 0x0a00, 0x09c8, 0x0000 },

+  { 0x0a00, 0x09cc, 0x0000 },

+  { 0x8700, 0x0a2b, 0x7000 },

+  { 0x8a00, 0x0a03, 0x6000 },

+  { 0x8d00, 0x09ed, 0x5000 },

+  { 0x8c00, 0x09e3, 0x4000 },

+  { 0x8700, 0x09df, 0x3000 },

+  { 0x8700, 0x09dc, 0x2000 },

+  { 0x0a00, 0x09d7, 0x0000 },

+  { 0x0700, 0x09dd, 0x0000 },

+  { 0x8700, 0x09e1, 0x2000 },

+  { 0x0700, 0x09e0, 0x0000 },

+  { 0x0c00, 0x09e2, 0x0000 },

+  { 0x8d00, 0x09e9, 0x3000 },

+  { 0x8d00, 0x09e7, 0x2000 },

+  { 0x0d00, 0x09e6, 0x0000 },

+  { 0x0d00, 0x09e8, 0x0000 },

+  { 0x8d00, 0x09eb, 0x2000 },

+  { 0x0d00, 0x09ea, 0x0000 },

+  { 0x0d00, 0x09ec, 0x0000 },

+  { 0x8f00, 0x09f5, 0x4000 },

+  { 0x8700, 0x09f1, 0x3000 },

+  { 0x8d00, 0x09ef, 0x2000 },

+  { 0x0d00, 0x09ee, 0x0000 },

+  { 0x0700, 0x09f0, 0x0000 },

+  { 0x9700, 0x09f3, 0x2000 },

+  { 0x1700, 0x09f2, 0x0000 },

+  { 0x0f00, 0x09f4, 0x0000 },

+  { 0x8f00, 0x09f9, 0x3000 },

+  { 0x8f00, 0x09f7, 0x2000 },

+  { 0x0f00, 0x09f6, 0x0000 },

+  { 0x0f00, 0x09f8, 0x0000 },

+  { 0x8c00, 0x0a01, 0x2000 },

+  { 0x1a00, 0x09fa, 0x0000 },

+  { 0x0c00, 0x0a02, 0x0000 },

+  { 0x8700, 0x0a1a, 0x5000 },

+  { 0x8700, 0x0a10, 0x4000 },

+  { 0x8700, 0x0a08, 0x3000 },

+  { 0x8700, 0x0a06, 0x2000 },

+  { 0x0700, 0x0a05, 0x0000 },

+  { 0x0700, 0x0a07, 0x0000 },

+  { 0x8700, 0x0a0a, 0x2000 },

+  { 0x0700, 0x0a09, 0x0000 },

+  { 0x0700, 0x0a0f, 0x0000 },

+  { 0x8700, 0x0a16, 0x3000 },

+  { 0x8700, 0x0a14, 0x2000 },

+  { 0x0700, 0x0a13, 0x0000 },

+  { 0x0700, 0x0a15, 0x0000 },

+  { 0x8700, 0x0a18, 0x2000 },

+  { 0x0700, 0x0a17, 0x0000 },

+  { 0x0700, 0x0a19, 0x0000 },

+  { 0x8700, 0x0a22, 0x4000 },

+  { 0x8700, 0x0a1e, 0x3000 },

+  { 0x8700, 0x0a1c, 0x2000 },

+  { 0x0700, 0x0a1b, 0x0000 },

+  { 0x0700, 0x0a1d, 0x0000 },

+  { 0x8700, 0x0a20, 0x2000 },

+  { 0x0700, 0x0a1f, 0x0000 },

+  { 0x0700, 0x0a21, 0x0000 },

+  { 0x8700, 0x0a26, 0x3000 },

+  { 0x8700, 0x0a24, 0x2000 },

+  { 0x0700, 0x0a23, 0x0000 },

+  { 0x0700, 0x0a25, 0x0000 },

+  { 0x8700, 0x0a28, 0x2000 },

+  { 0x0700, 0x0a27, 0x0000 },

+  { 0x0700, 0x0a2a, 0x0000 },

+  { 0x8d00, 0x0a6a, 0x6000 },

+  { 0x8c00, 0x0a41, 0x5000 },

+  { 0x8700, 0x0a35, 0x4000 },

+  { 0x8700, 0x0a2f, 0x3000 },

+  { 0x8700, 0x0a2d, 0x2000 },

+  { 0x0700, 0x0a2c, 0x0000 },

+  { 0x0700, 0x0a2e, 0x0000 },

+  { 0x8700, 0x0a32, 0x2000 },

+  { 0x0700, 0x0a30, 0x0000 },

+  { 0x0700, 0x0a33, 0x0000 },

+  { 0x8c00, 0x0a3c, 0x3000 },

+  { 0x8700, 0x0a38, 0x2000 },

+  { 0x0700, 0x0a36, 0x0000 },

+  { 0x0700, 0x0a39, 0x0000 },

+  { 0x8a00, 0x0a3f, 0x2000 },

+  { 0x0a00, 0x0a3e, 0x0000 },

+  { 0x0a00, 0x0a40, 0x0000 },

+  { 0x8700, 0x0a5a, 0x4000 },

+  { 0x8c00, 0x0a4b, 0x3000 },

+  { 0x8c00, 0x0a47, 0x2000 },

+  { 0x0c00, 0x0a42, 0x0000 },

+  { 0x0c00, 0x0a48, 0x0000 },

+  { 0x8c00, 0x0a4d, 0x2000 },

+  { 0x0c00, 0x0a4c, 0x0000 },

+  { 0x0700, 0x0a59, 0x0000 },

+  { 0x8d00, 0x0a66, 0x3000 },

+  { 0x8700, 0x0a5c, 0x2000 },

+  { 0x0700, 0x0a5b, 0x0000 },

+  { 0x0700, 0x0a5e, 0x0000 },

+  { 0x8d00, 0x0a68, 0x2000 },

+  { 0x0d00, 0x0a67, 0x0000 },

+  { 0x0d00, 0x0a69, 0x0000 },

+  { 0x8700, 0x0a87, 0x5000 },

+  { 0x8700, 0x0a72, 0x4000 },

+  { 0x8d00, 0x0a6e, 0x3000 },

+  { 0x8d00, 0x0a6c, 0x2000 },

+  { 0x0d00, 0x0a6b, 0x0000 },

+  { 0x0d00, 0x0a6d, 0x0000 },

+  { 0x8c00, 0x0a70, 0x2000 },

+  { 0x0d00, 0x0a6f, 0x0000 },

+  { 0x0c00, 0x0a71, 0x0000 },

+  { 0x8c00, 0x0a82, 0x3000 },

+  { 0x8700, 0x0a74, 0x2000 },

+  { 0x0700, 0x0a73, 0x0000 },

+  { 0x0c00, 0x0a81, 0x0000 },

+  { 0x8700, 0x0a85, 0x2000 },

+  { 0x0a00, 0x0a83, 0x0000 },

+  { 0x0700, 0x0a86, 0x0000 },

+  { 0x8700, 0x0a90, 0x4000 },

+  { 0x8700, 0x0a8b, 0x3000 },

+  { 0x8700, 0x0a89, 0x2000 },

+  { 0x0700, 0x0a88, 0x0000 },

+  { 0x0700, 0x0a8a, 0x0000 },

+  { 0x8700, 0x0a8d, 0x2000 },

+  { 0x0700, 0x0a8c, 0x0000 },

+  { 0x0700, 0x0a8f, 0x0000 },

+  { 0x8700, 0x0a95, 0x3000 },

+  { 0x8700, 0x0a93, 0x2000 },

+  { 0x0700, 0x0a91, 0x0000 },

+  { 0x0700, 0x0a94, 0x0000 },

+  { 0x8700, 0x0a97, 0x2000 },

+  { 0x0700, 0x0a96, 0x0000 },

+  { 0x0700, 0x0a98, 0x0000 },

+  { 0x8700, 0x10ef, 0xb000 },

+  { 0x8700, 0x0dc6, 0xa000 },

+  { 0x8700, 0x0c31, 0x9000 },

+  { 0x8700, 0x0b5f, 0x8000 },

+  { 0x8a00, 0x0b03, 0x7000 },

+  { 0x8a00, 0x0abe, 0x6000 },

+  { 0x8700, 0x0aaa, 0x5000 },

+  { 0x8700, 0x0aa1, 0x4000 },

+  { 0x8700, 0x0a9d, 0x3000 },

+  { 0x8700, 0x0a9b, 0x2000 },

+  { 0x0700, 0x0a9a, 0x0000 },

+  { 0x0700, 0x0a9c, 0x0000 },

+  { 0x8700, 0x0a9f, 0x2000 },

+  { 0x0700, 0x0a9e, 0x0000 },

+  { 0x0700, 0x0aa0, 0x0000 },

+  { 0x8700, 0x0aa5, 0x3000 },

+  { 0x8700, 0x0aa3, 0x2000 },

+  { 0x0700, 0x0aa2, 0x0000 },

+  { 0x0700, 0x0aa4, 0x0000 },

+  { 0x8700, 0x0aa7, 0x2000 },

+  { 0x0700, 0x0aa6, 0x0000 },

+  { 0x0700, 0x0aa8, 0x0000 },

+  { 0x8700, 0x0ab3, 0x4000 },

+  { 0x8700, 0x0aae, 0x3000 },

+  { 0x8700, 0x0aac, 0x2000 },

+  { 0x0700, 0x0aab, 0x0000 },

+  { 0x0700, 0x0aad, 0x0000 },

+  { 0x8700, 0x0ab0, 0x2000 },

+  { 0x0700, 0x0aaf, 0x0000 },

+  { 0x0700, 0x0ab2, 0x0000 },

+  { 0x8700, 0x0ab8, 0x3000 },

+  { 0x8700, 0x0ab6, 0x2000 },

+  { 0x0700, 0x0ab5, 0x0000 },

+  { 0x0700, 0x0ab7, 0x0000 },

+  { 0x8c00, 0x0abc, 0x2000 },

+  { 0x0700, 0x0ab9, 0x0000 },

+  { 0x0700, 0x0abd, 0x0000 },

+  { 0x8700, 0x0ae1, 0x5000 },

+  { 0x8c00, 0x0ac7, 0x4000 },

+  { 0x8c00, 0x0ac2, 0x3000 },

+  { 0x8a00, 0x0ac0, 0x2000 },

+  { 0x0a00, 0x0abf, 0x0000 },

+  { 0x0c00, 0x0ac1, 0x0000 },

+  { 0x8c00, 0x0ac4, 0x2000 },

+  { 0x0c00, 0x0ac3, 0x0000 },

+  { 0x0c00, 0x0ac5, 0x0000 },

+  { 0x8a00, 0x0acc, 0x3000 },

+  { 0x8a00, 0x0ac9, 0x2000 },

+  { 0x0c00, 0x0ac8, 0x0000 },

+  { 0x0a00, 0x0acb, 0x0000 },

+  { 0x8700, 0x0ad0, 0x2000 },

+  { 0x0c00, 0x0acd, 0x0000 },

+  { 0x0700, 0x0ae0, 0x0000 },

+  { 0x8d00, 0x0aeb, 0x4000 },

+  { 0x8d00, 0x0ae7, 0x3000 },

+  { 0x8c00, 0x0ae3, 0x2000 },

+  { 0x0c00, 0x0ae2, 0x0000 },

+  { 0x0d00, 0x0ae6, 0x0000 },

+  { 0x8d00, 0x0ae9, 0x2000 },

+  { 0x0d00, 0x0ae8, 0x0000 },

+  { 0x0d00, 0x0aea, 0x0000 },

+  { 0x8d00, 0x0aef, 0x3000 },

+  { 0x8d00, 0x0aed, 0x2000 },

+  { 0x0d00, 0x0aec, 0x0000 },

+  { 0x0d00, 0x0aee, 0x0000 },

+  { 0x8c00, 0x0b01, 0x2000 },

+  { 0x1700, 0x0af1, 0x0000 },

+  { 0x0a00, 0x0b02, 0x0000 },

+  { 0x8700, 0x0b28, 0x6000 },

+  { 0x8700, 0x0b18, 0x5000 },

+  { 0x8700, 0x0b0c, 0x4000 },

+  { 0x8700, 0x0b08, 0x3000 },

+  { 0x8700, 0x0b06, 0x2000 },

+  { 0x0700, 0x0b05, 0x0000 },

+  { 0x0700, 0x0b07, 0x0000 },

+  { 0x8700, 0x0b0a, 0x2000 },

+  { 0x0700, 0x0b09, 0x0000 },

+  { 0x0700, 0x0b0b, 0x0000 },

+  { 0x8700, 0x0b14, 0x3000 },

+  { 0x8700, 0x0b10, 0x2000 },

+  { 0x0700, 0x0b0f, 0x0000 },

+  { 0x0700, 0x0b13, 0x0000 },

+  { 0x8700, 0x0b16, 0x2000 },

+  { 0x0700, 0x0b15, 0x0000 },

+  { 0x0700, 0x0b17, 0x0000 },

+  { 0x8700, 0x0b20, 0x4000 },

+  { 0x8700, 0x0b1c, 0x3000 },

+  { 0x8700, 0x0b1a, 0x2000 },

+  { 0x0700, 0x0b19, 0x0000 },

+  { 0x0700, 0x0b1b, 0x0000 },

+  { 0x8700, 0x0b1e, 0x2000 },

+  { 0x0700, 0x0b1d, 0x0000 },

+  { 0x0700, 0x0b1f, 0x0000 },

+  { 0x8700, 0x0b24, 0x3000 },

+  { 0x8700, 0x0b22, 0x2000 },

+  { 0x0700, 0x0b21, 0x0000 },

+  { 0x0700, 0x0b23, 0x0000 },

+  { 0x8700, 0x0b26, 0x2000 },

+  { 0x0700, 0x0b25, 0x0000 },

+  { 0x0700, 0x0b27, 0x0000 },

+  { 0x8700, 0x0b3d, 0x5000 },

+  { 0x8700, 0x0b32, 0x4000 },

+  { 0x8700, 0x0b2d, 0x3000 },

+  { 0x8700, 0x0b2b, 0x2000 },

+  { 0x0700, 0x0b2a, 0x0000 },

+  { 0x0700, 0x0b2c, 0x0000 },

+  { 0x8700, 0x0b2f, 0x2000 },

+  { 0x0700, 0x0b2e, 0x0000 },

+  { 0x0700, 0x0b30, 0x0000 },

+  { 0x8700, 0x0b37, 0x3000 },

+  { 0x8700, 0x0b35, 0x2000 },

+  { 0x0700, 0x0b33, 0x0000 },

+  { 0x0700, 0x0b36, 0x0000 },

+  { 0x8700, 0x0b39, 0x2000 },

+  { 0x0700, 0x0b38, 0x0000 },

+  { 0x0c00, 0x0b3c, 0x0000 },

+  { 0x8a00, 0x0b48, 0x4000 },

+  { 0x8c00, 0x0b41, 0x3000 },

+  { 0x8c00, 0x0b3f, 0x2000 },

+  { 0x0a00, 0x0b3e, 0x0000 },

+  { 0x0a00, 0x0b40, 0x0000 },

+  { 0x8c00, 0x0b43, 0x2000 },

+  { 0x0c00, 0x0b42, 0x0000 },

+  { 0x0a00, 0x0b47, 0x0000 },

+  { 0x8c00, 0x0b56, 0x3000 },

+  { 0x8a00, 0x0b4c, 0x2000 },

+  { 0x0a00, 0x0b4b, 0x0000 },

+  { 0x0c00, 0x0b4d, 0x0000 },

+  { 0x8700, 0x0b5c, 0x2000 },

+  { 0x0a00, 0x0b57, 0x0000 },

+  { 0x0700, 0x0b5d, 0x0000 },

+  { 0x8d00, 0x0be7, 0x7000 },

+  { 0x8700, 0x0b9c, 0x6000 },

+  { 0x8700, 0x0b83, 0x5000 },

+  { 0x8d00, 0x0b6b, 0x4000 },

+  { 0x8d00, 0x0b67, 0x3000 },

+  { 0x8700, 0x0b61, 0x2000 },

+  { 0x0700, 0x0b60, 0x0000 },

+  { 0x0d00, 0x0b66, 0x0000 },

+  { 0x8d00, 0x0b69, 0x2000 },

+  { 0x0d00, 0x0b68, 0x0000 },

+  { 0x0d00, 0x0b6a, 0x0000 },

+  { 0x8d00, 0x0b6f, 0x3000 },

+  { 0x8d00, 0x0b6d, 0x2000 },

+  { 0x0d00, 0x0b6c, 0x0000 },

+  { 0x0d00, 0x0b6e, 0x0000 },

+  { 0x8700, 0x0b71, 0x2000 },

+  { 0x1a00, 0x0b70, 0x0000 },

+  { 0x0c00, 0x0b82, 0x0000 },

+  { 0x8700, 0x0b8f, 0x4000 },

+  { 0x8700, 0x0b88, 0x3000 },

+  { 0x8700, 0x0b86, 0x2000 },

+  { 0x0700, 0x0b85, 0x0000 },

+  { 0x0700, 0x0b87, 0x0000 },

+  { 0x8700, 0x0b8a, 0x2000 },

+  { 0x0700, 0x0b89, 0x0000 },

+  { 0x0700, 0x0b8e, 0x0000 },

+  { 0x8700, 0x0b94, 0x3000 },

+  { 0x8700, 0x0b92, 0x2000 },

+  { 0x0700, 0x0b90, 0x0000 },

+  { 0x0700, 0x0b93, 0x0000 },

+  { 0x8700, 0x0b99, 0x2000 },

+  { 0x0700, 0x0b95, 0x0000 },

+  { 0x0700, 0x0b9a, 0x0000 },

+  { 0x8700, 0x0bb7, 0x5000 },

+  { 0x8700, 0x0bae, 0x4000 },

+  { 0x8700, 0x0ba4, 0x3000 },

+  { 0x8700, 0x0b9f, 0x2000 },

+  { 0x0700, 0x0b9e, 0x0000 },

+  { 0x0700, 0x0ba3, 0x0000 },

+  { 0x8700, 0x0ba9, 0x2000 },

+  { 0x0700, 0x0ba8, 0x0000 },

+  { 0x0700, 0x0baa, 0x0000 },

+  { 0x8700, 0x0bb2, 0x3000 },

+  { 0x8700, 0x0bb0, 0x2000 },

+  { 0x0700, 0x0baf, 0x0000 },

+  { 0x0700, 0x0bb1, 0x0000 },

+  { 0x8700, 0x0bb4, 0x2000 },

+  { 0x0700, 0x0bb3, 0x0000 },

+  { 0x0700, 0x0bb5, 0x0000 },

+  { 0x8a00, 0x0bc6, 0x4000 },

+  { 0x8a00, 0x0bbf, 0x3000 },

+  { 0x8700, 0x0bb9, 0x2000 },

+  { 0x0700, 0x0bb8, 0x0000 },

+  { 0x0a00, 0x0bbe, 0x0000 },

+  { 0x8a00, 0x0bc1, 0x2000 },

+  { 0x0c00, 0x0bc0, 0x0000 },

+  { 0x0a00, 0x0bc2, 0x0000 },

+  { 0x8a00, 0x0bcb, 0x3000 },

+  { 0x8a00, 0x0bc8, 0x2000 },

+  { 0x0a00, 0x0bc7, 0x0000 },

+  { 0x0a00, 0x0bca, 0x0000 },

+  { 0x8c00, 0x0bcd, 0x2000 },

+  { 0x0a00, 0x0bcc, 0x0000 },

+  { 0x0a00, 0x0bd7, 0x0000 },

+  { 0x8700, 0x0c0f, 0x6000 },

+  { 0x9a00, 0x0bf7, 0x5000 },

+  { 0x8d00, 0x0bef, 0x4000 },

+  { 0x8d00, 0x0beb, 0x3000 },

+  { 0x8d00, 0x0be9, 0x2000 },

+  { 0x0d00, 0x0be8, 0x0000 },

+  { 0x0d00, 0x0bea, 0x0000 },

+  { 0x8d00, 0x0bed, 0x2000 },

+  { 0x0d00, 0x0bec, 0x0000 },

+  { 0x0d00, 0x0bee, 0x0000 },

+  { 0x9a00, 0x0bf3, 0x3000 },

+  { 0x8f00, 0x0bf1, 0x2000 },

+  { 0x0f00, 0x0bf0, 0x0000 },

+  { 0x0f00, 0x0bf2, 0x0000 },

+  { 0x9a00, 0x0bf5, 0x2000 },

+  { 0x1a00, 0x0bf4, 0x0000 },

+  { 0x1a00, 0x0bf6, 0x0000 },

+  { 0x8700, 0x0c06, 0x4000 },

+  { 0x8a00, 0x0c01, 0x3000 },

+  { 0x9700, 0x0bf9, 0x2000 },

+  { 0x1a00, 0x0bf8, 0x0000 },

+  { 0x1a00, 0x0bfa, 0x0000 },

+  { 0x8a00, 0x0c03, 0x2000 },

+  { 0x0a00, 0x0c02, 0x0000 },

+  { 0x0700, 0x0c05, 0x0000 },

+  { 0x8700, 0x0c0a, 0x3000 },

+  { 0x8700, 0x0c08, 0x2000 },

+  { 0x0700, 0x0c07, 0x0000 },

+  { 0x0700, 0x0c09, 0x0000 },

+  { 0x8700, 0x0c0c, 0x2000 },

+  { 0x0700, 0x0c0b, 0x0000 },

+  { 0x0700, 0x0c0e, 0x0000 },

+  { 0x8700, 0x0c20, 0x5000 },

+  { 0x8700, 0x0c18, 0x4000 },

+  { 0x8700, 0x0c14, 0x3000 },

+  { 0x8700, 0x0c12, 0x2000 },

+  { 0x0700, 0x0c10, 0x0000 },

+  { 0x0700, 0x0c13, 0x0000 },

+  { 0x8700, 0x0c16, 0x2000 },

+  { 0x0700, 0x0c15, 0x0000 },

+  { 0x0700, 0x0c17, 0x0000 },

+  { 0x8700, 0x0c1c, 0x3000 },

+  { 0x8700, 0x0c1a, 0x2000 },

+  { 0x0700, 0x0c19, 0x0000 },

+  { 0x0700, 0x0c1b, 0x0000 },

+  { 0x8700, 0x0c1e, 0x2000 },

+  { 0x0700, 0x0c1d, 0x0000 },

+  { 0x0700, 0x0c1f, 0x0000 },

+  { 0x8700, 0x0c28, 0x4000 },

+  { 0x8700, 0x0c24, 0x3000 },

+  { 0x8700, 0x0c22, 0x2000 },

+  { 0x0700, 0x0c21, 0x0000 },

+  { 0x0700, 0x0c23, 0x0000 },

+  { 0x8700, 0x0c26, 0x2000 },

+  { 0x0700, 0x0c25, 0x0000 },

+  { 0x0700, 0x0c27, 0x0000 },

+  { 0x8700, 0x0c2d, 0x3000 },

+  { 0x8700, 0x0c2b, 0x2000 },

+  { 0x0700, 0x0c2a, 0x0000 },

+  { 0x0700, 0x0c2c, 0x0000 },

+  { 0x8700, 0x0c2f, 0x2000 },

+  { 0x0700, 0x0c2e, 0x0000 },

+  { 0x0700, 0x0c30, 0x0000 },

+  { 0x8700, 0x0d0e, 0x8000 },

+  { 0x8700, 0x0ca1, 0x7000 },

+  { 0x8d00, 0x0c6c, 0x6000 },

+  { 0x8c00, 0x0c47, 0x5000 },

+  { 0x8c00, 0x0c3e, 0x4000 },

+  { 0x8700, 0x0c36, 0x3000 },

+  { 0x8700, 0x0c33, 0x2000 },

+  { 0x0700, 0x0c32, 0x0000 },

+  { 0x0700, 0x0c35, 0x0000 },

+  { 0x8700, 0x0c38, 0x2000 },

+  { 0x0700, 0x0c37, 0x0000 },

+  { 0x0700, 0x0c39, 0x0000 },

+  { 0x8a00, 0x0c42, 0x3000 },

+  { 0x8c00, 0x0c40, 0x2000 },

+  { 0x0c00, 0x0c3f, 0x0000 },

+  { 0x0a00, 0x0c41, 0x0000 },

+  { 0x8a00, 0x0c44, 0x2000 },

+  { 0x0a00, 0x0c43, 0x0000 },

+  { 0x0c00, 0x0c46, 0x0000 },

+  { 0x8700, 0x0c60, 0x4000 },

+  { 0x8c00, 0x0c4c, 0x3000 },

+  { 0x8c00, 0x0c4a, 0x2000 },

+  { 0x0c00, 0x0c48, 0x0000 },

+  { 0x0c00, 0x0c4b, 0x0000 },

+  { 0x8c00, 0x0c55, 0x2000 },

+  { 0x0c00, 0x0c4d, 0x0000 },

+  { 0x0c00, 0x0c56, 0x0000 },

+  { 0x8d00, 0x0c68, 0x3000 },

+  { 0x8d00, 0x0c66, 0x2000 },

+  { 0x0700, 0x0c61, 0x0000 },

+  { 0x0d00, 0x0c67, 0x0000 },

+  { 0x8d00, 0x0c6a, 0x2000 },

+  { 0x0d00, 0x0c69, 0x0000 },

+  { 0x0d00, 0x0c6b, 0x0000 },

+  { 0x8700, 0x0c90, 0x5000 },

+  { 0x8700, 0x0c87, 0x4000 },

+  { 0x8a00, 0x0c82, 0x3000 },

+  { 0x8d00, 0x0c6e, 0x2000 },

+  { 0x0d00, 0x0c6d, 0x0000 },

+  { 0x0d00, 0x0c6f, 0x0000 },

+  { 0x8700, 0x0c85, 0x2000 },

+  { 0x0a00, 0x0c83, 0x0000 },

+  { 0x0700, 0x0c86, 0x0000 },

+  { 0x8700, 0x0c8b, 0x3000 },

+  { 0x8700, 0x0c89, 0x2000 },

+  { 0x0700, 0x0c88, 0x0000 },

+  { 0x0700, 0x0c8a, 0x0000 },

+  { 0x8700, 0x0c8e, 0x2000 },

+  { 0x0700, 0x0c8c, 0x0000 },

+  { 0x0700, 0x0c8f, 0x0000 },

+  { 0x8700, 0x0c99, 0x4000 },

+  { 0x8700, 0x0c95, 0x3000 },

+  { 0x8700, 0x0c93, 0x2000 },

+  { 0x0700, 0x0c92, 0x0000 },

+  { 0x0700, 0x0c94, 0x0000 },

+  { 0x8700, 0x0c97, 0x2000 },

+  { 0x0700, 0x0c96, 0x0000 },

+  { 0x0700, 0x0c98, 0x0000 },

+  { 0x8700, 0x0c9d, 0x3000 },

+  { 0x8700, 0x0c9b, 0x2000 },

+  { 0x0700, 0x0c9a, 0x0000 },

+  { 0x0700, 0x0c9c, 0x0000 },

+  { 0x8700, 0x0c9f, 0x2000 },

+  { 0x0700, 0x0c9e, 0x0000 },

+  { 0x0700, 0x0ca0, 0x0000 },

+  { 0x8c00, 0x0cc6, 0x6000 },

+  { 0x8700, 0x0cb2, 0x5000 },

+  { 0x8700, 0x0caa, 0x4000 },

+  { 0x8700, 0x0ca5, 0x3000 },

+  { 0x8700, 0x0ca3, 0x2000 },

+  { 0x0700, 0x0ca2, 0x0000 },

+  { 0x0700, 0x0ca4, 0x0000 },

+  { 0x8700, 0x0ca7, 0x2000 },

+  { 0x0700, 0x0ca6, 0x0000 },

+  { 0x0700, 0x0ca8, 0x0000 },

+  { 0x8700, 0x0cae, 0x3000 },

+  { 0x8700, 0x0cac, 0x2000 },

+  { 0x0700, 0x0cab, 0x0000 },

+  { 0x0700, 0x0cad, 0x0000 },

+  { 0x8700, 0x0cb0, 0x2000 },

+  { 0x0700, 0x0caf, 0x0000 },

+  { 0x0700, 0x0cb1, 0x0000 },

+  { 0x8700, 0x0cbd, 0x4000 },

+  { 0x8700, 0x0cb7, 0x3000 },

+  { 0x8700, 0x0cb5, 0x2000 },

+  { 0x0700, 0x0cb3, 0x0000 },

+  { 0x0700, 0x0cb6, 0x0000 },

+  { 0x8700, 0x0cb9, 0x2000 },

+  { 0x0700, 0x0cb8, 0x0000 },

+  { 0x0c00, 0x0cbc, 0x0000 },

+  { 0x8a00, 0x0cc1, 0x3000 },

+  { 0x8c00, 0x0cbf, 0x2000 },

+  { 0x0a00, 0x0cbe, 0x0000 },

+  { 0x0a00, 0x0cc0, 0x0000 },

+  { 0x8a00, 0x0cc3, 0x2000 },

+  { 0x0a00, 0x0cc2, 0x0000 },

+  { 0x0a00, 0x0cc4, 0x0000 },

+  { 0x8d00, 0x0cea, 0x5000 },

+  { 0x8a00, 0x0cd6, 0x4000 },

+  { 0x8a00, 0x0ccb, 0x3000 },

+  { 0x8a00, 0x0cc8, 0x2000 },

+  { 0x0a00, 0x0cc7, 0x0000 },

+  { 0x0a00, 0x0cca, 0x0000 },

+  { 0x8c00, 0x0ccd, 0x2000 },

+  { 0x0c00, 0x0ccc, 0x0000 },

+  { 0x0a00, 0x0cd5, 0x0000 },

+  { 0x8d00, 0x0ce6, 0x3000 },

+  { 0x8700, 0x0ce0, 0x2000 },

+  { 0x0700, 0x0cde, 0x0000 },

+  { 0x0700, 0x0ce1, 0x0000 },

+  { 0x8d00, 0x0ce8, 0x2000 },

+  { 0x0d00, 0x0ce7, 0x0000 },

+  { 0x0d00, 0x0ce9, 0x0000 },

+  { 0x8700, 0x0d05, 0x4000 },

+  { 0x8d00, 0x0cee, 0x3000 },

+  { 0x8d00, 0x0cec, 0x2000 },

+  { 0x0d00, 0x0ceb, 0x0000 },

+  { 0x0d00, 0x0ced, 0x0000 },

+  { 0x8a00, 0x0d02, 0x2000 },

+  { 0x0d00, 0x0cef, 0x0000 },

+  { 0x0a00, 0x0d03, 0x0000 },

+  { 0x8700, 0x0d09, 0x3000 },

+  { 0x8700, 0x0d07, 0x2000 },

+  { 0x0700, 0x0d06, 0x0000 },

+  { 0x0700, 0x0d08, 0x0000 },

+  { 0x8700, 0x0d0b, 0x2000 },

+  { 0x0700, 0x0d0a, 0x0000 },

+  { 0x0700, 0x0d0c, 0x0000 },

+  { 0x8d00, 0x0d6c, 0x7000 },

+  { 0x8700, 0x0d30, 0x6000 },

+  { 0x8700, 0x0d1f, 0x5000 },

+  { 0x8700, 0x0d17, 0x4000 },

+  { 0x8700, 0x0d13, 0x3000 },

+  { 0x8700, 0x0d10, 0x2000 },

+  { 0x0700, 0x0d0f, 0x0000 },

+  { 0x0700, 0x0d12, 0x0000 },

+  { 0x8700, 0x0d15, 0x2000 },

+  { 0x0700, 0x0d14, 0x0000 },

+  { 0x0700, 0x0d16, 0x0000 },

+  { 0x8700, 0x0d1b, 0x3000 },

+  { 0x8700, 0x0d19, 0x2000 },

+  { 0x0700, 0x0d18, 0x0000 },

+  { 0x0700, 0x0d1a, 0x0000 },

+  { 0x8700, 0x0d1d, 0x2000 },

+  { 0x0700, 0x0d1c, 0x0000 },

+  { 0x0700, 0x0d1e, 0x0000 },

+  { 0x8700, 0x0d27, 0x4000 },

+  { 0x8700, 0x0d23, 0x3000 },

+  { 0x8700, 0x0d21, 0x2000 },

+  { 0x0700, 0x0d20, 0x0000 },

+  { 0x0700, 0x0d22, 0x0000 },

+  { 0x8700, 0x0d25, 0x2000 },

+  { 0x0700, 0x0d24, 0x0000 },

+  { 0x0700, 0x0d26, 0x0000 },

+  { 0x8700, 0x0d2c, 0x3000 },

+  { 0x8700, 0x0d2a, 0x2000 },

+  { 0x0700, 0x0d28, 0x0000 },

+  { 0x0700, 0x0d2b, 0x0000 },

+  { 0x8700, 0x0d2e, 0x2000 },

+  { 0x0700, 0x0d2d, 0x0000 },

+  { 0x0700, 0x0d2f, 0x0000 },

+  { 0x8a00, 0x0d46, 0x5000 },

+  { 0x8700, 0x0d38, 0x4000 },

+  { 0x8700, 0x0d34, 0x3000 },

+  { 0x8700, 0x0d32, 0x2000 },

+  { 0x0700, 0x0d31, 0x0000 },

+  { 0x0700, 0x0d33, 0x0000 },

+  { 0x8700, 0x0d36, 0x2000 },

+  { 0x0700, 0x0d35, 0x0000 },

+  { 0x0700, 0x0d37, 0x0000 },

+  { 0x8a00, 0x0d40, 0x3000 },

+  { 0x8a00, 0x0d3e, 0x2000 },

+  { 0x0700, 0x0d39, 0x0000 },

+  { 0x0a00, 0x0d3f, 0x0000 },

+  { 0x8c00, 0x0d42, 0x2000 },

+  { 0x0c00, 0x0d41, 0x0000 },

+  { 0x0c00, 0x0d43, 0x0000 },

+  { 0x8700, 0x0d60, 0x4000 },

+  { 0x8a00, 0x0d4b, 0x3000 },

+  { 0x8a00, 0x0d48, 0x2000 },

+  { 0x0a00, 0x0d47, 0x0000 },

+  { 0x0a00, 0x0d4a, 0x0000 },

+  { 0x8c00, 0x0d4d, 0x2000 },

+  { 0x0a00, 0x0d4c, 0x0000 },

+  { 0x0a00, 0x0d57, 0x0000 },

+  { 0x8d00, 0x0d68, 0x3000 },

+  { 0x8d00, 0x0d66, 0x2000 },

+  { 0x0700, 0x0d61, 0x0000 },

+  { 0x0d00, 0x0d67, 0x0000 },

+  { 0x8d00, 0x0d6a, 0x2000 },

+  { 0x0d00, 0x0d69, 0x0000 },

+  { 0x0d00, 0x0d6b, 0x0000 },

+  { 0x8700, 0x0da2, 0x6000 },

+  { 0x8700, 0x0d8f, 0x5000 },

+  { 0x8700, 0x0d87, 0x4000 },

+  { 0x8a00, 0x0d82, 0x3000 },

+  { 0x8d00, 0x0d6e, 0x2000 },

+  { 0x0d00, 0x0d6d, 0x0000 },

+  { 0x0d00, 0x0d6f, 0x0000 },

+  { 0x8700, 0x0d85, 0x2000 },

+  { 0x0a00, 0x0d83, 0x0000 },

+  { 0x0700, 0x0d86, 0x0000 },

+  { 0x8700, 0x0d8b, 0x3000 },

+  { 0x8700, 0x0d89, 0x2000 },

+  { 0x0700, 0x0d88, 0x0000 },

+  { 0x0700, 0x0d8a, 0x0000 },

+  { 0x8700, 0x0d8d, 0x2000 },

+  { 0x0700, 0x0d8c, 0x0000 },

+  { 0x0700, 0x0d8e, 0x0000 },

+  { 0x8700, 0x0d9a, 0x4000 },

+  { 0x8700, 0x0d93, 0x3000 },

+  { 0x8700, 0x0d91, 0x2000 },

+  { 0x0700, 0x0d90, 0x0000 },

+  { 0x0700, 0x0d92, 0x0000 },

+  { 0x8700, 0x0d95, 0x2000 },

+  { 0x0700, 0x0d94, 0x0000 },

+  { 0x0700, 0x0d96, 0x0000 },

+  { 0x8700, 0x0d9e, 0x3000 },

+  { 0x8700, 0x0d9c, 0x2000 },

+  { 0x0700, 0x0d9b, 0x0000 },

+  { 0x0700, 0x0d9d, 0x0000 },

+  { 0x8700, 0x0da0, 0x2000 },

+  { 0x0700, 0x0d9f, 0x0000 },

+  { 0x0700, 0x0da1, 0x0000 },

+  { 0x8700, 0x0db3, 0x5000 },

+  { 0x8700, 0x0daa, 0x4000 },

+  { 0x8700, 0x0da6, 0x3000 },

+  { 0x8700, 0x0da4, 0x2000 },

+  { 0x0700, 0x0da3, 0x0000 },

+  { 0x0700, 0x0da5, 0x0000 },

+  { 0x8700, 0x0da8, 0x2000 },

+  { 0x0700, 0x0da7, 0x0000 },

+  { 0x0700, 0x0da9, 0x0000 },

+  { 0x8700, 0x0dae, 0x3000 },

+  { 0x8700, 0x0dac, 0x2000 },

+  { 0x0700, 0x0dab, 0x0000 },

+  { 0x0700, 0x0dad, 0x0000 },

+  { 0x8700, 0x0db0, 0x2000 },

+  { 0x0700, 0x0daf, 0x0000 },

+  { 0x0700, 0x0db1, 0x0000 },

+  { 0x8700, 0x0dbb, 0x4000 },

+  { 0x8700, 0x0db7, 0x3000 },

+  { 0x8700, 0x0db5, 0x2000 },

+  { 0x0700, 0x0db4, 0x0000 },

+  { 0x0700, 0x0db6, 0x0000 },

+  { 0x8700, 0x0db9, 0x2000 },

+  { 0x0700, 0x0db8, 0x0000 },

+  { 0x0700, 0x0dba, 0x0000 },

+  { 0x8700, 0x0dc2, 0x3000 },

+  { 0x8700, 0x0dc0, 0x2000 },

+  { 0x0700, 0x0dbd, 0x0000 },

+  { 0x0700, 0x0dc1, 0x0000 },

+  { 0x8700, 0x0dc4, 0x2000 },

+  { 0x0700, 0x0dc3, 0x0000 },

+  { 0x0700, 0x0dc5, 0x0000 },

+  { 0x8700, 0x0f55, 0x9000 },

+  { 0x8700, 0x0ea5, 0x8000 },

+  { 0x8700, 0x0e2d, 0x7000 },

+  { 0x8700, 0x0e0d, 0x6000 },

+  { 0x8a00, 0x0ddf, 0x5000 },

+  { 0x8c00, 0x0dd6, 0x4000 },

+  { 0x8a00, 0x0dd1, 0x3000 },

+  { 0x8a00, 0x0dcf, 0x2000 },

+  { 0x0c00, 0x0dca, 0x0000 },

+  { 0x0a00, 0x0dd0, 0x0000 },

+  { 0x8c00, 0x0dd3, 0x2000 },

+  { 0x0c00, 0x0dd2, 0x0000 },

+  { 0x0c00, 0x0dd4, 0x0000 },

+  { 0x8a00, 0x0ddb, 0x3000 },

+  { 0x8a00, 0x0dd9, 0x2000 },

+  { 0x0a00, 0x0dd8, 0x0000 },

+  { 0x0a00, 0x0dda, 0x0000 },

+  { 0x8a00, 0x0ddd, 0x2000 },

+  { 0x0a00, 0x0ddc, 0x0000 },

+  { 0x0a00, 0x0dde, 0x0000 },

+  { 0x8700, 0x0e05, 0x4000 },

+  { 0x8700, 0x0e01, 0x3000 },

+  { 0x8a00, 0x0df3, 0x2000 },

+  { 0x0a00, 0x0df2, 0x0000 },

+  { 0x1500, 0x0df4, 0x0000 },

+  { 0x8700, 0x0e03, 0x2000 },

+  { 0x0700, 0x0e02, 0x0000 },

+  { 0x0700, 0x0e04, 0x0000 },

+  { 0x8700, 0x0e09, 0x3000 },

+  { 0x8700, 0x0e07, 0x2000 },

+  { 0x0700, 0x0e06, 0x0000 },

+  { 0x0700, 0x0e08, 0x0000 },

+  { 0x8700, 0x0e0b, 0x2000 },

+  { 0x0700, 0x0e0a, 0x0000 },

+  { 0x0700, 0x0e0c, 0x0000 },

+  { 0x8700, 0x0e1d, 0x5000 },

+  { 0x8700, 0x0e15, 0x4000 },

+  { 0x8700, 0x0e11, 0x3000 },

+  { 0x8700, 0x0e0f, 0x2000 },

+  { 0x0700, 0x0e0e, 0x0000 },

+  { 0x0700, 0x0e10, 0x0000 },

+  { 0x8700, 0x0e13, 0x2000 },

+  { 0x0700, 0x0e12, 0x0000 },

+  { 0x0700, 0x0e14, 0x0000 },

+  { 0x8700, 0x0e19, 0x3000 },

+  { 0x8700, 0x0e17, 0x2000 },

+  { 0x0700, 0x0e16, 0x0000 },

+  { 0x0700, 0x0e18, 0x0000 },

+  { 0x8700, 0x0e1b, 0x2000 },

+  { 0x0700, 0x0e1a, 0x0000 },

+  { 0x0700, 0x0e1c, 0x0000 },

+  { 0x8700, 0x0e25, 0x4000 },

+  { 0x8700, 0x0e21, 0x3000 },

+  { 0x8700, 0x0e1f, 0x2000 },

+  { 0x0700, 0x0e1e, 0x0000 },

+  { 0x0700, 0x0e20, 0x0000 },

+  { 0x8700, 0x0e23, 0x2000 },

+  { 0x0700, 0x0e22, 0x0000 },

+  { 0x0700, 0x0e24, 0x0000 },

+  { 0x8700, 0x0e29, 0x3000 },

+  { 0x8700, 0x0e27, 0x2000 },

+  { 0x0700, 0x0e26, 0x0000 },

+  { 0x0700, 0x0e28, 0x0000 },

+  { 0x8700, 0x0e2b, 0x2000 },

+  { 0x0700, 0x0e2a, 0x0000 },

+  { 0x0700, 0x0e2c, 0x0000 },

+  { 0x8d00, 0x0e51, 0x6000 },

+  { 0x8700, 0x0e41, 0x5000 },

+  { 0x8c00, 0x0e35, 0x4000 },

+  { 0x8c00, 0x0e31, 0x3000 },

+  { 0x8700, 0x0e2f, 0x2000 },

+  { 0x0700, 0x0e2e, 0x0000 },

+  { 0x0700, 0x0e30, 0x0000 },

+  { 0x8700, 0x0e33, 0x2000 },

+  { 0x0700, 0x0e32, 0x0000 },

+  { 0x0c00, 0x0e34, 0x0000 },

+  { 0x8c00, 0x0e39, 0x3000 },

+  { 0x8c00, 0x0e37, 0x2000 },

+  { 0x0c00, 0x0e36, 0x0000 },

+  { 0x0c00, 0x0e38, 0x0000 },

+  { 0x9700, 0x0e3f, 0x2000 },

+  { 0x0c00, 0x0e3a, 0x0000 },

+  { 0x0700, 0x0e40, 0x0000 },

+  { 0x8c00, 0x0e49, 0x4000 },

+  { 0x8700, 0x0e45, 0x3000 },

+  { 0x8700, 0x0e43, 0x2000 },

+  { 0x0700, 0x0e42, 0x0000 },

+  { 0x0700, 0x0e44, 0x0000 },

+  { 0x8c00, 0x0e47, 0x2000 },

+  { 0x0600, 0x0e46, 0x0000 },

+  { 0x0c00, 0x0e48, 0x0000 },

+  { 0x8c00, 0x0e4d, 0x3000 },

+  { 0x8c00, 0x0e4b, 0x2000 },

+  { 0x0c00, 0x0e4a, 0x0000 },

+  { 0x0c00, 0x0e4c, 0x0000 },

+  { 0x9500, 0x0e4f, 0x2000 },

+  { 0x0c00, 0x0e4e, 0x0000 },

+  { 0x0d00, 0x0e50, 0x0000 },

+  { 0x8700, 0x0e8a, 0x5000 },

+  { 0x8d00, 0x0e59, 0x4000 },

+  { 0x8d00, 0x0e55, 0x3000 },

+  { 0x8d00, 0x0e53, 0x2000 },

+  { 0x0d00, 0x0e52, 0x0000 },

+  { 0x0d00, 0x0e54, 0x0000 },

+  { 0x8d00, 0x0e57, 0x2000 },

+  { 0x0d00, 0x0e56, 0x0000 },

+  { 0x0d00, 0x0e58, 0x0000 },

+  { 0x8700, 0x0e82, 0x3000 },

+  { 0x9500, 0x0e5b, 0x2000 },

+  { 0x1500, 0x0e5a, 0x0000 },

+  { 0x0700, 0x0e81, 0x0000 },

+  { 0x8700, 0x0e87, 0x2000 },

+  { 0x0700, 0x0e84, 0x0000 },

+  { 0x0700, 0x0e88, 0x0000 },

+  { 0x8700, 0x0e9b, 0x4000 },

+  { 0x8700, 0x0e96, 0x3000 },

+  { 0x8700, 0x0e94, 0x2000 },

+  { 0x0700, 0x0e8d, 0x0000 },

+  { 0x0700, 0x0e95, 0x0000 },

+  { 0x8700, 0x0e99, 0x2000 },

+  { 0x0700, 0x0e97, 0x0000 },

+  { 0x0700, 0x0e9a, 0x0000 },

+  { 0x8700, 0x0e9f, 0x3000 },

+  { 0x8700, 0x0e9d, 0x2000 },

+  { 0x0700, 0x0e9c, 0x0000 },

+  { 0x0700, 0x0e9e, 0x0000 },

+  { 0x8700, 0x0ea2, 0x2000 },

+  { 0x0700, 0x0ea1, 0x0000 },

+  { 0x0700, 0x0ea3, 0x0000 },

+  { 0x9a00, 0x0f14, 0x7000 },

+  { 0x8d00, 0x0ed0, 0x6000 },

+  { 0x8c00, 0x0eb9, 0x5000 },

+  { 0x8c00, 0x0eb1, 0x4000 },

+  { 0x8700, 0x0ead, 0x3000 },

+  { 0x8700, 0x0eaa, 0x2000 },

+  { 0x0700, 0x0ea7, 0x0000 },

+  { 0x0700, 0x0eab, 0x0000 },

+  { 0x8700, 0x0eaf, 0x2000 },

+  { 0x0700, 0x0eae, 0x0000 },

+  { 0x0700, 0x0eb0, 0x0000 },

+  { 0x8c00, 0x0eb5, 0x3000 },

+  { 0x8700, 0x0eb3, 0x2000 },

+  { 0x0700, 0x0eb2, 0x0000 },

+  { 0x0c00, 0x0eb4, 0x0000 },

+  { 0x8c00, 0x0eb7, 0x2000 },

+  { 0x0c00, 0x0eb6, 0x0000 },

+  { 0x0c00, 0x0eb8, 0x0000 },

+  { 0x8700, 0x0ec4, 0x4000 },

+  { 0x8700, 0x0ec0, 0x3000 },

+  { 0x8c00, 0x0ebc, 0x2000 },

+  { 0x0c00, 0x0ebb, 0x0000 },

+  { 0x0700, 0x0ebd, 0x0000 },

+  { 0x8700, 0x0ec2, 0x2000 },

+  { 0x0700, 0x0ec1, 0x0000 },

+  { 0x0700, 0x0ec3, 0x0000 },

+  { 0x8c00, 0x0eca, 0x3000 },

+  { 0x8c00, 0x0ec8, 0x2000 },

+  { 0x0600, 0x0ec6, 0x0000 },

+  { 0x0c00, 0x0ec9, 0x0000 },

+  { 0x8c00, 0x0ecc, 0x2000 },

+  { 0x0c00, 0x0ecb, 0x0000 },

+  { 0x0c00, 0x0ecd, 0x0000 },

+  { 0x9500, 0x0f04, 0x5000 },

+  { 0x8d00, 0x0ed8, 0x4000 },

+  { 0x8d00, 0x0ed4, 0x3000 },

+  { 0x8d00, 0x0ed2, 0x2000 },

+  { 0x0d00, 0x0ed1, 0x0000 },

+  { 0x0d00, 0x0ed3, 0x0000 },

+  { 0x8d00, 0x0ed6, 0x2000 },

+  { 0x0d00, 0x0ed5, 0x0000 },

+  { 0x0d00, 0x0ed7, 0x0000 },

+  { 0x8700, 0x0f00, 0x3000 },

+  { 0x8700, 0x0edc, 0x2000 },

+  { 0x0d00, 0x0ed9, 0x0000 },

+  { 0x0700, 0x0edd, 0x0000 },

+  { 0x9a00, 0x0f02, 0x2000 },

+  { 0x1a00, 0x0f01, 0x0000 },

+  { 0x1a00, 0x0f03, 0x0000 },

+  { 0x9500, 0x0f0c, 0x4000 },

+  { 0x9500, 0x0f08, 0x3000 },

+  { 0x9500, 0x0f06, 0x2000 },

+  { 0x1500, 0x0f05, 0x0000 },

+  { 0x1500, 0x0f07, 0x0000 },

+  { 0x9500, 0x0f0a, 0x2000 },

+  { 0x1500, 0x0f09, 0x0000 },

+  { 0x1500, 0x0f0b, 0x0000 },

+  { 0x9500, 0x0f10, 0x3000 },

+  { 0x9500, 0x0f0e, 0x2000 },

+  { 0x1500, 0x0f0d, 0x0000 },

+  { 0x1500, 0x0f0f, 0x0000 },

+  { 0x9500, 0x0f12, 0x2000 },

+  { 0x1500, 0x0f11, 0x0000 },

+  { 0x1a00, 0x0f13, 0x0000 },

+  { 0x9a00, 0x0f34, 0x6000 },

+  { 0x8d00, 0x0f24, 0x5000 },

+  { 0x9a00, 0x0f1c, 0x4000 },

+  { 0x8c00, 0x0f18, 0x3000 },

+  { 0x9a00, 0x0f16, 0x2000 },

+  { 0x1a00, 0x0f15, 0x0000 },

+  { 0x1a00, 0x0f17, 0x0000 },

+  { 0x9a00, 0x0f1a, 0x2000 },

+  { 0x0c00, 0x0f19, 0x0000 },

+  { 0x1a00, 0x0f1b, 0x0000 },

+  { 0x8d00, 0x0f20, 0x3000 },

+  { 0x9a00, 0x0f1e, 0x2000 },

+  { 0x1a00, 0x0f1d, 0x0000 },

+  { 0x1a00, 0x0f1f, 0x0000 },

+  { 0x8d00, 0x0f22, 0x2000 },

+  { 0x0d00, 0x0f21, 0x0000 },

+  { 0x0d00, 0x0f23, 0x0000 },

+  { 0x8f00, 0x0f2c, 0x4000 },

+  { 0x8d00, 0x0f28, 0x3000 },

+  { 0x8d00, 0x0f26, 0x2000 },

+  { 0x0d00, 0x0f25, 0x0000 },

+  { 0x0d00, 0x0f27, 0x0000 },

+  { 0x8f00, 0x0f2a, 0x2000 },

+  { 0x0d00, 0x0f29, 0x0000 },

+  { 0x0f00, 0x0f2b, 0x0000 },

+  { 0x8f00, 0x0f30, 0x3000 },

+  { 0x8f00, 0x0f2e, 0x2000 },

+  { 0x0f00, 0x0f2d, 0x0000 },

+  { 0x0f00, 0x0f2f, 0x0000 },

+  { 0x8f00, 0x0f32, 0x2000 },

+  { 0x0f00, 0x0f31, 0x0000 },

+  { 0x0f00, 0x0f33, 0x0000 },

+  { 0x8700, 0x0f44, 0x5000 },

+  { 0x9600, 0x0f3c, 0x4000 },

+  { 0x9a00, 0x0f38, 0x3000 },

+  { 0x9a00, 0x0f36, 0x2000 },

+  { 0x0c00, 0x0f35, 0x0000 },

+  { 0x0c00, 0x0f37, 0x0000 },

+  { 0x9600, 0x0f3a, 0x2000 },

+  { 0x0c00, 0x0f39, 0x0000 },

+  { 0x1200, 0x0f3b, 0x0000 },

+  { 0x8700, 0x0f40, 0x3000 },

+  { 0x8a00, 0x0f3e, 0x2000 },

+  { 0x1200, 0x0f3d, 0x0000 },

+  { 0x0a00, 0x0f3f, 0x0000 },

+  { 0x8700, 0x0f42, 0x2000 },

+  { 0x0700, 0x0f41, 0x0000 },

+  { 0x0700, 0x0f43, 0x0000 },

+  { 0x8700, 0x0f4d, 0x4000 },

+  { 0x8700, 0x0f49, 0x3000 },

+  { 0x8700, 0x0f46, 0x2000 },

+  { 0x0700, 0x0f45, 0x0000 },

+  { 0x0700, 0x0f47, 0x0000 },

+  { 0x8700, 0x0f4b, 0x2000 },

+  { 0x0700, 0x0f4a, 0x0000 },

+  { 0x0700, 0x0f4c, 0x0000 },

+  { 0x8700, 0x0f51, 0x3000 },

+  { 0x8700, 0x0f4f, 0x2000 },

+  { 0x0700, 0x0f4e, 0x0000 },

+  { 0x0700, 0x0f50, 0x0000 },

+  { 0x8700, 0x0f53, 0x2000 },

+  { 0x0700, 0x0f52, 0x0000 },

+  { 0x0700, 0x0f54, 0x0000 },

+  { 0x8700, 0x1013, 0x8000 },

+  { 0x8c00, 0x0fa0, 0x7000 },

+  { 0x8c00, 0x0f7b, 0x6000 },

+  { 0x8700, 0x0f65, 0x5000 },

+  { 0x8700, 0x0f5d, 0x4000 },

+  { 0x8700, 0x0f59, 0x3000 },

+  { 0x8700, 0x0f57, 0x2000 },

+  { 0x0700, 0x0f56, 0x0000 },

+  { 0x0700, 0x0f58, 0x0000 },

+  { 0x8700, 0x0f5b, 0x2000 },

+  { 0x0700, 0x0f5a, 0x0000 },

+  { 0x0700, 0x0f5c, 0x0000 },

+  { 0x8700, 0x0f61, 0x3000 },

+  { 0x8700, 0x0f5f, 0x2000 },

+  { 0x0700, 0x0f5e, 0x0000 },

+  { 0x0700, 0x0f60, 0x0000 },

+  { 0x8700, 0x0f63, 0x2000 },

+  { 0x0700, 0x0f62, 0x0000 },

+  { 0x0700, 0x0f64, 0x0000 },

+  { 0x8c00, 0x0f73, 0x4000 },

+  { 0x8700, 0x0f69, 0x3000 },

+  { 0x8700, 0x0f67, 0x2000 },

+  { 0x0700, 0x0f66, 0x0000 },

+  { 0x0700, 0x0f68, 0x0000 },

+  { 0x8c00, 0x0f71, 0x2000 },

+  { 0x0700, 0x0f6a, 0x0000 },

+  { 0x0c00, 0x0f72, 0x0000 },

+  { 0x8c00, 0x0f77, 0x3000 },

+  { 0x8c00, 0x0f75, 0x2000 },

+  { 0x0c00, 0x0f74, 0x0000 },

+  { 0x0c00, 0x0f76, 0x0000 },

+  { 0x8c00, 0x0f79, 0x2000 },

+  { 0x0c00, 0x0f78, 0x0000 },

+  { 0x0c00, 0x0f7a, 0x0000 },

+  { 0x8700, 0x0f8b, 0x5000 },

+  { 0x8c00, 0x0f83, 0x4000 },

+  { 0x8a00, 0x0f7f, 0x3000 },

+  { 0x8c00, 0x0f7d, 0x2000 },

+  { 0x0c00, 0x0f7c, 0x0000 },

+  { 0x0c00, 0x0f7e, 0x0000 },

+  { 0x8c00, 0x0f81, 0x2000 },

+  { 0x0c00, 0x0f80, 0x0000 },

+  { 0x0c00, 0x0f82, 0x0000 },

+  { 0x8c00, 0x0f87, 0x3000 },

+  { 0x9500, 0x0f85, 0x2000 },

+  { 0x0c00, 0x0f84, 0x0000 },

+  { 0x0c00, 0x0f86, 0x0000 },

+  { 0x8700, 0x0f89, 0x2000 },

+  { 0x0700, 0x0f88, 0x0000 },

+  { 0x0700, 0x0f8a, 0x0000 },

+  { 0x8c00, 0x0f97, 0x4000 },

+  { 0x8c00, 0x0f93, 0x3000 },

+  { 0x8c00, 0x0f91, 0x2000 },

+  { 0x0c00, 0x0f90, 0x0000 },

+  { 0x0c00, 0x0f92, 0x0000 },

+  { 0x8c00, 0x0f95, 0x2000 },

+  { 0x0c00, 0x0f94, 0x0000 },

+  { 0x0c00, 0x0f96, 0x0000 },

+  { 0x8c00, 0x0f9c, 0x3000 },

+  { 0x8c00, 0x0f9a, 0x2000 },

+  { 0x0c00, 0x0f99, 0x0000 },

+  { 0x0c00, 0x0f9b, 0x0000 },

+  { 0x8c00, 0x0f9e, 0x2000 },

+  { 0x0c00, 0x0f9d, 0x0000 },

+  { 0x0c00, 0x0f9f, 0x0000 },

+  { 0x9a00, 0x0fc1, 0x6000 },

+  { 0x8c00, 0x0fb0, 0x5000 },

+  { 0x8c00, 0x0fa8, 0x4000 },

+  { 0x8c00, 0x0fa4, 0x3000 },

+  { 0x8c00, 0x0fa2, 0x2000 },

+  { 0x0c00, 0x0fa1, 0x0000 },

+  { 0x0c00, 0x0fa3, 0x0000 },

+  { 0x8c00, 0x0fa6, 0x2000 },

+  { 0x0c00, 0x0fa5, 0x0000 },

+  { 0x0c00, 0x0fa7, 0x0000 },

+  { 0x8c00, 0x0fac, 0x3000 },

+  { 0x8c00, 0x0faa, 0x2000 },

+  { 0x0c00, 0x0fa9, 0x0000 },

+  { 0x0c00, 0x0fab, 0x0000 },

+  { 0x8c00, 0x0fae, 0x2000 },

+  { 0x0c00, 0x0fad, 0x0000 },

+  { 0x0c00, 0x0faf, 0x0000 },

+  { 0x8c00, 0x0fb8, 0x4000 },

+  { 0x8c00, 0x0fb4, 0x3000 },

+  { 0x8c00, 0x0fb2, 0x2000 },

+  { 0x0c00, 0x0fb1, 0x0000 },

+  { 0x0c00, 0x0fb3, 0x0000 },

+  { 0x8c00, 0x0fb6, 0x2000 },

+  { 0x0c00, 0x0fb5, 0x0000 },

+  { 0x0c00, 0x0fb7, 0x0000 },

+  { 0x8c00, 0x0fbc, 0x3000 },

+  { 0x8c00, 0x0fba, 0x2000 },

+  { 0x0c00, 0x0fb9, 0x0000 },

+  { 0x0c00, 0x0fbb, 0x0000 },

+  { 0x9a00, 0x0fbf, 0x2000 },

+  { 0x1a00, 0x0fbe, 0x0000 },

+  { 0x1a00, 0x0fc0, 0x0000 },

+  { 0x8700, 0x1003, 0x5000 },

+  { 0x9a00, 0x0fc9, 0x4000 },

+  { 0x9a00, 0x0fc5, 0x3000 },

+  { 0x9a00, 0x0fc3, 0x2000 },

+  { 0x1a00, 0x0fc2, 0x0000 },

+  { 0x1a00, 0x0fc4, 0x0000 },

+  { 0x9a00, 0x0fc7, 0x2000 },

+  { 0x0c00, 0x0fc6, 0x0000 },

+  { 0x1a00, 0x0fc8, 0x0000 },

+  { 0x9a00, 0x0fcf, 0x3000 },

+  { 0x9a00, 0x0fcb, 0x2000 },

+  { 0x1a00, 0x0fca, 0x0000 },

+  { 0x1a00, 0x0fcc, 0x0000 },

+  { 0x8700, 0x1001, 0x2000 },

+  { 0x0700, 0x1000, 0x0000 },

+  { 0x0700, 0x1002, 0x0000 },

+  { 0x8700, 0x100b, 0x4000 },

+  { 0x8700, 0x1007, 0x3000 },

+  { 0x8700, 0x1005, 0x2000 },

+  { 0x0700, 0x1004, 0x0000 },

+  { 0x0700, 0x1006, 0x0000 },

+  { 0x8700, 0x1009, 0x2000 },

+  { 0x0700, 0x1008, 0x0000 },

+  { 0x0700, 0x100a, 0x0000 },

+  { 0x8700, 0x100f, 0x3000 },

+  { 0x8700, 0x100d, 0x2000 },

+  { 0x0700, 0x100c, 0x0000 },

+  { 0x0700, 0x100e, 0x0000 },

+  { 0x8700, 0x1011, 0x2000 },

+  { 0x0700, 0x1010, 0x0000 },

+  { 0x0700, 0x1012, 0x0000 },

+  { 0x8900, 0x10a5, 0x7000 },

+  { 0x8c00, 0x1039, 0x6000 },

+  { 0x8700, 0x1024, 0x5000 },

+  { 0x8700, 0x101b, 0x4000 },

+  { 0x8700, 0x1017, 0x3000 },

+  { 0x8700, 0x1015, 0x2000 },

+  { 0x0700, 0x1014, 0x0000 },

+  { 0x0700, 0x1016, 0x0000 },

+  { 0x8700, 0x1019, 0x2000 },

+  { 0x0700, 0x1018, 0x0000 },

+  { 0x0700, 0x101a, 0x0000 },

+  { 0x8700, 0x101f, 0x3000 },

+  { 0x8700, 0x101d, 0x2000 },

+  { 0x0700, 0x101c, 0x0000 },

+  { 0x0700, 0x101e, 0x0000 },

+  { 0x8700, 0x1021, 0x2000 },

+  { 0x0700, 0x1020, 0x0000 },

+  { 0x0700, 0x1023, 0x0000 },

+  { 0x8c00, 0x102e, 0x4000 },

+  { 0x8700, 0x1029, 0x3000 },

+  { 0x8700, 0x1026, 0x2000 },

+  { 0x0700, 0x1025, 0x0000 },

+  { 0x0700, 0x1027, 0x0000 },

+  { 0x8a00, 0x102c, 0x2000 },

+  { 0x0700, 0x102a, 0x0000 },

+  { 0x0c00, 0x102d, 0x0000 },

+  { 0x8c00, 0x1032, 0x3000 },

+  { 0x8c00, 0x1030, 0x2000 },

+  { 0x0c00, 0x102f, 0x0000 },

+  { 0x0a00, 0x1031, 0x0000 },

+  { 0x8c00, 0x1037, 0x2000 },

+  { 0x0c00, 0x1036, 0x0000 },

+  { 0x0a00, 0x1038, 0x0000 },

+  { 0x9500, 0x104f, 0x5000 },

+  { 0x8d00, 0x1047, 0x4000 },

+  { 0x8d00, 0x1043, 0x3000 },

+  { 0x8d00, 0x1041, 0x2000 },

+  { 0x0d00, 0x1040, 0x0000 },

+  { 0x0d00, 0x1042, 0x0000 },

+  { 0x8d00, 0x1045, 0x2000 },

+  { 0x0d00, 0x1044, 0x0000 },

+  { 0x0d00, 0x1046, 0x0000 },

+  { 0x9500, 0x104b, 0x3000 },

+  { 0x8d00, 0x1049, 0x2000 },

+  { 0x0d00, 0x1048, 0x0000 },

+  { 0x1500, 0x104a, 0x0000 },

+  { 0x9500, 0x104d, 0x2000 },

+  { 0x1500, 0x104c, 0x0000 },

+  { 0x1500, 0x104e, 0x0000 },

+  { 0x8a00, 0x1057, 0x4000 },

+  { 0x8700, 0x1053, 0x3000 },

+  { 0x8700, 0x1051, 0x2000 },

+  { 0x0700, 0x1050, 0x0000 },

+  { 0x0700, 0x1052, 0x0000 },

+  { 0x8700, 0x1055, 0x2000 },

+  { 0x0700, 0x1054, 0x0000 },

+  { 0x0a00, 0x1056, 0x0000 },

+  { 0x8900, 0x10a1, 0x3000 },

+  { 0x8c00, 0x1059, 0x2000 },

+  { 0x0c00, 0x1058, 0x0000 },

+  { 0x0900, 0x10a0, 0x0000 },

+  { 0x8900, 0x10a3, 0x2000 },

+  { 0x0900, 0x10a2, 0x0000 },

+  { 0x0900, 0x10a4, 0x0000 },

+  { 0x8900, 0x10c5, 0x6000 },

+  { 0x8900, 0x10b5, 0x5000 },

+  { 0x8900, 0x10ad, 0x4000 },

+  { 0x8900, 0x10a9, 0x3000 },

+  { 0x8900, 0x10a7, 0x2000 },

+  { 0x0900, 0x10a6, 0x0000 },

+  { 0x0900, 0x10a8, 0x0000 },

+  { 0x8900, 0x10ab, 0x2000 },

+  { 0x0900, 0x10aa, 0x0000 },

+  { 0x0900, 0x10ac, 0x0000 },

+  { 0x8900, 0x10b1, 0x3000 },

+  { 0x8900, 0x10af, 0x2000 },

+  { 0x0900, 0x10ae, 0x0000 },

+  { 0x0900, 0x10b0, 0x0000 },

+  { 0x8900, 0x10b3, 0x2000 },

+  { 0x0900, 0x10b2, 0x0000 },

+  { 0x0900, 0x10b4, 0x0000 },

+  { 0x8900, 0x10bd, 0x4000 },

+  { 0x8900, 0x10b9, 0x3000 },

+  { 0x8900, 0x10b7, 0x2000 },

+  { 0x0900, 0x10b6, 0x0000 },

+  { 0x0900, 0x10b8, 0x0000 },

+  { 0x8900, 0x10bb, 0x2000 },

+  { 0x0900, 0x10ba, 0x0000 },

+  { 0x0900, 0x10bc, 0x0000 },

+  { 0x8900, 0x10c1, 0x3000 },

+  { 0x8900, 0x10bf, 0x2000 },

+  { 0x0900, 0x10be, 0x0000 },

+  { 0x0900, 0x10c0, 0x0000 },

+  { 0x8900, 0x10c3, 0x2000 },

+  { 0x0900, 0x10c2, 0x0000 },

+  { 0x0900, 0x10c4, 0x0000 },

+  { 0x8700, 0x10df, 0x5000 },

+  { 0x8700, 0x10d7, 0x4000 },

+  { 0x8700, 0x10d3, 0x3000 },

+  { 0x8700, 0x10d1, 0x2000 },

+  { 0x0700, 0x10d0, 0x0000 },

+  { 0x0700, 0x10d2, 0x0000 },

+  { 0x8700, 0x10d5, 0x2000 },

+  { 0x0700, 0x10d4, 0x0000 },

+  { 0x0700, 0x10d6, 0x0000 },

+  { 0x8700, 0x10db, 0x3000 },

+  { 0x8700, 0x10d9, 0x2000 },

+  { 0x0700, 0x10d8, 0x0000 },

+  { 0x0700, 0x10da, 0x0000 },

+  { 0x8700, 0x10dd, 0x2000 },

+  { 0x0700, 0x10dc, 0x0000 },

+  { 0x0700, 0x10de, 0x0000 },

+  { 0x8700, 0x10e7, 0x4000 },

+  { 0x8700, 0x10e3, 0x3000 },

+  { 0x8700, 0x10e1, 0x2000 },

+  { 0x0700, 0x10e0, 0x0000 },

+  { 0x0700, 0x10e2, 0x0000 },

+  { 0x8700, 0x10e5, 0x2000 },

+  { 0x0700, 0x10e4, 0x0000 },

+  { 0x0700, 0x10e6, 0x0000 },

+  { 0x8700, 0x10eb, 0x3000 },

+  { 0x8700, 0x10e9, 0x2000 },

+  { 0x0700, 0x10e8, 0x0000 },

+  { 0x0700, 0x10ea, 0x0000 },

+  { 0x8700, 0x10ed, 0x2000 },

+  { 0x0700, 0x10ec, 0x0000 },

+  { 0x0700, 0x10ee, 0x0000 },

+  { 0x8700, 0x1322, 0xa000 },

+  { 0x8700, 0x1205, 0x9000 },

+  { 0x8700, 0x117a, 0x8000 },

+  { 0x8700, 0x1135, 0x7000 },

+  { 0x8700, 0x1115, 0x6000 },

+  { 0x8700, 0x1105, 0x5000 },

+  { 0x8700, 0x10f7, 0x4000 },

+  { 0x8700, 0x10f3, 0x3000 },

+  { 0x8700, 0x10f1, 0x2000 },

+  { 0x0700, 0x10f0, 0x0000 },

+  { 0x0700, 0x10f2, 0x0000 },

+  { 0x8700, 0x10f5, 0x2000 },

+  { 0x0700, 0x10f4, 0x0000 },

+  { 0x0700, 0x10f6, 0x0000 },

+  { 0x8700, 0x1101, 0x3000 },

+  { 0x9500, 0x10fb, 0x2000 },

+  { 0x0700, 0x10f8, 0x0000 },

+  { 0x0700, 0x1100, 0x0000 },

+  { 0x8700, 0x1103, 0x2000 },

+  { 0x0700, 0x1102, 0x0000 },

+  { 0x0700, 0x1104, 0x0000 },

+  { 0x8700, 0x110d, 0x4000 },

+  { 0x8700, 0x1109, 0x3000 },

+  { 0x8700, 0x1107, 0x2000 },

+  { 0x0700, 0x1106, 0x0000 },

+  { 0x0700, 0x1108, 0x0000 },

+  { 0x8700, 0x110b, 0x2000 },

+  { 0x0700, 0x110a, 0x0000 },

+  { 0x0700, 0x110c, 0x0000 },

+  { 0x8700, 0x1111, 0x3000 },

+  { 0x8700, 0x110f, 0x2000 },

+  { 0x0700, 0x110e, 0x0000 },

+  { 0x0700, 0x1110, 0x0000 },

+  { 0x8700, 0x1113, 0x2000 },

+  { 0x0700, 0x1112, 0x0000 },

+  { 0x0700, 0x1114, 0x0000 },

+  { 0x8700, 0x1125, 0x5000 },

+  { 0x8700, 0x111d, 0x4000 },

+  { 0x8700, 0x1119, 0x3000 },

+  { 0x8700, 0x1117, 0x2000 },

+  { 0x0700, 0x1116, 0x0000 },

+  { 0x0700, 0x1118, 0x0000 },

+  { 0x8700, 0x111b, 0x2000 },

+  { 0x0700, 0x111a, 0x0000 },

+  { 0x0700, 0x111c, 0x0000 },

+  { 0x8700, 0x1121, 0x3000 },

+  { 0x8700, 0x111f, 0x2000 },

+  { 0x0700, 0x111e, 0x0000 },

+  { 0x0700, 0x1120, 0x0000 },

+  { 0x8700, 0x1123, 0x2000 },

+  { 0x0700, 0x1122, 0x0000 },

+  { 0x0700, 0x1124, 0x0000 },

+  { 0x8700, 0x112d, 0x4000 },

+  { 0x8700, 0x1129, 0x3000 },

+  { 0x8700, 0x1127, 0x2000 },

+  { 0x0700, 0x1126, 0x0000 },

+  { 0x0700, 0x1128, 0x0000 },

+  { 0x8700, 0x112b, 0x2000 },

+  { 0x0700, 0x112a, 0x0000 },

+  { 0x0700, 0x112c, 0x0000 },

+  { 0x8700, 0x1131, 0x3000 },

+  { 0x8700, 0x112f, 0x2000 },

+  { 0x0700, 0x112e, 0x0000 },

+  { 0x0700, 0x1130, 0x0000 },

+  { 0x8700, 0x1133, 0x2000 },

+  { 0x0700, 0x1132, 0x0000 },

+  { 0x0700, 0x1134, 0x0000 },

+  { 0x8700, 0x1155, 0x6000 },

+  { 0x8700, 0x1145, 0x5000 },

+  { 0x8700, 0x113d, 0x4000 },

+  { 0x8700, 0x1139, 0x3000 },

+  { 0x8700, 0x1137, 0x2000 },

+  { 0x0700, 0x1136, 0x0000 },

+  { 0x0700, 0x1138, 0x0000 },

+  { 0x8700, 0x113b, 0x2000 },

+  { 0x0700, 0x113a, 0x0000 },

+  { 0x0700, 0x113c, 0x0000 },

+  { 0x8700, 0x1141, 0x3000 },

+  { 0x8700, 0x113f, 0x2000 },

+  { 0x0700, 0x113e, 0x0000 },

+  { 0x0700, 0x1140, 0x0000 },

+  { 0x8700, 0x1143, 0x2000 },

+  { 0x0700, 0x1142, 0x0000 },

+  { 0x0700, 0x1144, 0x0000 },

+  { 0x8700, 0x114d, 0x4000 },

+  { 0x8700, 0x1149, 0x3000 },

+  { 0x8700, 0x1147, 0x2000 },

+  { 0x0700, 0x1146, 0x0000 },

+  { 0x0700, 0x1148, 0x0000 },

+  { 0x8700, 0x114b, 0x2000 },

+  { 0x0700, 0x114a, 0x0000 },

+  { 0x0700, 0x114c, 0x0000 },

+  { 0x8700, 0x1151, 0x3000 },

+  { 0x8700, 0x114f, 0x2000 },

+  { 0x0700, 0x114e, 0x0000 },

+  { 0x0700, 0x1150, 0x0000 },

+  { 0x8700, 0x1153, 0x2000 },

+  { 0x0700, 0x1152, 0x0000 },

+  { 0x0700, 0x1154, 0x0000 },

+  { 0x8700, 0x116a, 0x5000 },

+  { 0x8700, 0x1162, 0x4000 },

+  { 0x8700, 0x1159, 0x3000 },

+  { 0x8700, 0x1157, 0x2000 },

+  { 0x0700, 0x1156, 0x0000 },

+  { 0x0700, 0x1158, 0x0000 },

+  { 0x8700, 0x1160, 0x2000 },

+  { 0x0700, 0x115f, 0x0000 },

+  { 0x0700, 0x1161, 0x0000 },

+  { 0x8700, 0x1166, 0x3000 },

+  { 0x8700, 0x1164, 0x2000 },

+  { 0x0700, 0x1163, 0x0000 },

+  { 0x0700, 0x1165, 0x0000 },

+  { 0x8700, 0x1168, 0x2000 },

+  { 0x0700, 0x1167, 0x0000 },

+  { 0x0700, 0x1169, 0x0000 },

+  { 0x8700, 0x1172, 0x4000 },

+  { 0x8700, 0x116e, 0x3000 },

+  { 0x8700, 0x116c, 0x2000 },

+  { 0x0700, 0x116b, 0x0000 },

+  { 0x0700, 0x116d, 0x0000 },

+  { 0x8700, 0x1170, 0x2000 },

+  { 0x0700, 0x116f, 0x0000 },

+  { 0x0700, 0x1171, 0x0000 },

+  { 0x8700, 0x1176, 0x3000 },

+  { 0x8700, 0x1174, 0x2000 },

+  { 0x0700, 0x1173, 0x0000 },

+  { 0x0700, 0x1175, 0x0000 },

+  { 0x8700, 0x1178, 0x2000 },

+  { 0x0700, 0x1177, 0x0000 },

+  { 0x0700, 0x1179, 0x0000 },

+  { 0x8700, 0x11bf, 0x7000 },

+  { 0x8700, 0x119a, 0x6000 },

+  { 0x8700, 0x118a, 0x5000 },

+  { 0x8700, 0x1182, 0x4000 },

+  { 0x8700, 0x117e, 0x3000 },

+  { 0x8700, 0x117c, 0x2000 },

+  { 0x0700, 0x117b, 0x0000 },

+  { 0x0700, 0x117d, 0x0000 },

+  { 0x8700, 0x1180, 0x2000 },

+  { 0x0700, 0x117f, 0x0000 },

+  { 0x0700, 0x1181, 0x0000 },

+  { 0x8700, 0x1186, 0x3000 },

+  { 0x8700, 0x1184, 0x2000 },

+  { 0x0700, 0x1183, 0x0000 },

+  { 0x0700, 0x1185, 0x0000 },

+  { 0x8700, 0x1188, 0x2000 },

+  { 0x0700, 0x1187, 0x0000 },

+  { 0x0700, 0x1189, 0x0000 },

+  { 0x8700, 0x1192, 0x4000 },

+  { 0x8700, 0x118e, 0x3000 },

+  { 0x8700, 0x118c, 0x2000 },

+  { 0x0700, 0x118b, 0x0000 },

+  { 0x0700, 0x118d, 0x0000 },

+  { 0x8700, 0x1190, 0x2000 },

+  { 0x0700, 0x118f, 0x0000 },

+  { 0x0700, 0x1191, 0x0000 },

+  { 0x8700, 0x1196, 0x3000 },

+  { 0x8700, 0x1194, 0x2000 },

+  { 0x0700, 0x1193, 0x0000 },

+  { 0x0700, 0x1195, 0x0000 },

+  { 0x8700, 0x1198, 0x2000 },

+  { 0x0700, 0x1197, 0x0000 },

+  { 0x0700, 0x1199, 0x0000 },

+  { 0x8700, 0x11af, 0x5000 },

+  { 0x8700, 0x11a2, 0x4000 },

+  { 0x8700, 0x119e, 0x3000 },

+  { 0x8700, 0x119c, 0x2000 },

+  { 0x0700, 0x119b, 0x0000 },

+  { 0x0700, 0x119d, 0x0000 },

+  { 0x8700, 0x11a0, 0x2000 },

+  { 0x0700, 0x119f, 0x0000 },

+  { 0x0700, 0x11a1, 0x0000 },

+  { 0x8700, 0x11ab, 0x3000 },

+  { 0x8700, 0x11a9, 0x2000 },

+  { 0x0700, 0x11a8, 0x0000 },

+  { 0x0700, 0x11aa, 0x0000 },

+  { 0x8700, 0x11ad, 0x2000 },

+  { 0x0700, 0x11ac, 0x0000 },

+  { 0x0700, 0x11ae, 0x0000 },

+  { 0x8700, 0x11b7, 0x4000 },

+  { 0x8700, 0x11b3, 0x3000 },

+  { 0x8700, 0x11b1, 0x2000 },

+  { 0x0700, 0x11b0, 0x0000 },

+  { 0x0700, 0x11b2, 0x0000 },

+  { 0x8700, 0x11b5, 0x2000 },

+  { 0x0700, 0x11b4, 0x0000 },

+  { 0x0700, 0x11b6, 0x0000 },

+  { 0x8700, 0x11bb, 0x3000 },

+  { 0x8700, 0x11b9, 0x2000 },

+  { 0x0700, 0x11b8, 0x0000 },

+  { 0x0700, 0x11ba, 0x0000 },

+  { 0x8700, 0x11bd, 0x2000 },

+  { 0x0700, 0x11bc, 0x0000 },

+  { 0x0700, 0x11be, 0x0000 },

+  { 0x8700, 0x11df, 0x6000 },

+  { 0x8700, 0x11cf, 0x5000 },

+  { 0x8700, 0x11c7, 0x4000 },

+  { 0x8700, 0x11c3, 0x3000 },

+  { 0x8700, 0x11c1, 0x2000 },

+  { 0x0700, 0x11c0, 0x0000 },

+  { 0x0700, 0x11c2, 0x0000 },

+  { 0x8700, 0x11c5, 0x2000 },

+  { 0x0700, 0x11c4, 0x0000 },

+  { 0x0700, 0x11c6, 0x0000 },

+  { 0x8700, 0x11cb, 0x3000 },

+  { 0x8700, 0x11c9, 0x2000 },

+  { 0x0700, 0x11c8, 0x0000 },

+  { 0x0700, 0x11ca, 0x0000 },

+  { 0x8700, 0x11cd, 0x2000 },

+  { 0x0700, 0x11cc, 0x0000 },

+  { 0x0700, 0x11ce, 0x0000 },

+  { 0x8700, 0x11d7, 0x4000 },

+  { 0x8700, 0x11d3, 0x3000 },

+  { 0x8700, 0x11d1, 0x2000 },

+  { 0x0700, 0x11d0, 0x0000 },

+  { 0x0700, 0x11d2, 0x0000 },

+  { 0x8700, 0x11d5, 0x2000 },

+  { 0x0700, 0x11d4, 0x0000 },

+  { 0x0700, 0x11d6, 0x0000 },

+  { 0x8700, 0x11db, 0x3000 },

+  { 0x8700, 0x11d9, 0x2000 },

+  { 0x0700, 0x11d8, 0x0000 },

+  { 0x0700, 0x11da, 0x0000 },

+  { 0x8700, 0x11dd, 0x2000 },

+  { 0x0700, 0x11dc, 0x0000 },

+  { 0x0700, 0x11de, 0x0000 },

+  { 0x8700, 0x11ef, 0x5000 },

+  { 0x8700, 0x11e7, 0x4000 },

+  { 0x8700, 0x11e3, 0x3000 },

+  { 0x8700, 0x11e1, 0x2000 },

+  { 0x0700, 0x11e0, 0x0000 },

+  { 0x0700, 0x11e2, 0x0000 },

+  { 0x8700, 0x11e5, 0x2000 },

+  { 0x0700, 0x11e4, 0x0000 },

+  { 0x0700, 0x11e6, 0x0000 },

+  { 0x8700, 0x11eb, 0x3000 },

+  { 0x8700, 0x11e9, 0x2000 },

+  { 0x0700, 0x11e8, 0x0000 },

+  { 0x0700, 0x11ea, 0x0000 },

+  { 0x8700, 0x11ed, 0x2000 },

+  { 0x0700, 0x11ec, 0x0000 },

+  { 0x0700, 0x11ee, 0x0000 },

+  { 0x8700, 0x11f7, 0x4000 },

+  { 0x8700, 0x11f3, 0x3000 },

+  { 0x8700, 0x11f1, 0x2000 },

+  { 0x0700, 0x11f0, 0x0000 },

+  { 0x0700, 0x11f2, 0x0000 },

+  { 0x8700, 0x11f5, 0x2000 },

+  { 0x0700, 0x11f4, 0x0000 },

+  { 0x0700, 0x11f6, 0x0000 },

+  { 0x8700, 0x1201, 0x3000 },

+  { 0x8700, 0x11f9, 0x2000 },

+  { 0x0700, 0x11f8, 0x0000 },

+  { 0x0700, 0x1200, 0x0000 },

+  { 0x8700, 0x1203, 0x2000 },

+  { 0x0700, 0x1202, 0x0000 },

+  { 0x0700, 0x1204, 0x0000 },

+  { 0x8700, 0x1292, 0x8000 },

+  { 0x8700, 0x1246, 0x7000 },

+  { 0x8700, 0x1226, 0x6000 },

+  { 0x8700, 0x1216, 0x5000 },

+  { 0x8700, 0x120e, 0x4000 },

+  { 0x8700, 0x120a, 0x3000 },

+  { 0x8700, 0x1208, 0x2000 },

+  { 0x0700, 0x1206, 0x0000 },

+  { 0x0700, 0x1209, 0x0000 },

+  { 0x8700, 0x120c, 0x2000 },

+  { 0x0700, 0x120b, 0x0000 },

+  { 0x0700, 0x120d, 0x0000 },

+  { 0x8700, 0x1212, 0x3000 },

+  { 0x8700, 0x1210, 0x2000 },

+  { 0x0700, 0x120f, 0x0000 },

+  { 0x0700, 0x1211, 0x0000 },

+  { 0x8700, 0x1214, 0x2000 },

+  { 0x0700, 0x1213, 0x0000 },

+  { 0x0700, 0x1215, 0x0000 },

+  { 0x8700, 0x121e, 0x4000 },

+  { 0x8700, 0x121a, 0x3000 },

+  { 0x8700, 0x1218, 0x2000 },

+  { 0x0700, 0x1217, 0x0000 },

+  { 0x0700, 0x1219, 0x0000 },

+  { 0x8700, 0x121c, 0x2000 },

+  { 0x0700, 0x121b, 0x0000 },

+  { 0x0700, 0x121d, 0x0000 },

+  { 0x8700, 0x1222, 0x3000 },

+  { 0x8700, 0x1220, 0x2000 },

+  { 0x0700, 0x121f, 0x0000 },

+  { 0x0700, 0x1221, 0x0000 },

+  { 0x8700, 0x1224, 0x2000 },

+  { 0x0700, 0x1223, 0x0000 },

+  { 0x0700, 0x1225, 0x0000 },

+  { 0x8700, 0x1236, 0x5000 },

+  { 0x8700, 0x122e, 0x4000 },

+  { 0x8700, 0x122a, 0x3000 },

+  { 0x8700, 0x1228, 0x2000 },

+  { 0x0700, 0x1227, 0x0000 },

+  { 0x0700, 0x1229, 0x0000 },

+  { 0x8700, 0x122c, 0x2000 },

+  { 0x0700, 0x122b, 0x0000 },

+  { 0x0700, 0x122d, 0x0000 },

+  { 0x8700, 0x1232, 0x3000 },

+  { 0x8700, 0x1230, 0x2000 },

+  { 0x0700, 0x122f, 0x0000 },

+  { 0x0700, 0x1231, 0x0000 },

+  { 0x8700, 0x1234, 0x2000 },

+  { 0x0700, 0x1233, 0x0000 },

+  { 0x0700, 0x1235, 0x0000 },

+  { 0x8700, 0x123e, 0x4000 },

+  { 0x8700, 0x123a, 0x3000 },

+  { 0x8700, 0x1238, 0x2000 },

+  { 0x0700, 0x1237, 0x0000 },

+  { 0x0700, 0x1239, 0x0000 },

+  { 0x8700, 0x123c, 0x2000 },

+  { 0x0700, 0x123b, 0x0000 },

+  { 0x0700, 0x123d, 0x0000 },

+  { 0x8700, 0x1242, 0x3000 },

+  { 0x8700, 0x1240, 0x2000 },

+  { 0x0700, 0x123f, 0x0000 },

+  { 0x0700, 0x1241, 0x0000 },

+  { 0x8700, 0x1244, 0x2000 },

+  { 0x0700, 0x1243, 0x0000 },

+  { 0x0700, 0x1245, 0x0000 },

+  { 0x8700, 0x126e, 0x6000 },

+  { 0x8700, 0x125c, 0x5000 },

+  { 0x8700, 0x1252, 0x4000 },

+  { 0x8700, 0x124c, 0x3000 },

+  { 0x8700, 0x124a, 0x2000 },

+  { 0x0700, 0x1248, 0x0000 },

+  { 0x0700, 0x124b, 0x0000 },

+  { 0x8700, 0x1250, 0x2000 },

+  { 0x0700, 0x124d, 0x0000 },

+  { 0x0700, 0x1251, 0x0000 },

+  { 0x8700, 0x1256, 0x3000 },

+  { 0x8700, 0x1254, 0x2000 },

+  { 0x0700, 0x1253, 0x0000 },

+  { 0x0700, 0x1255, 0x0000 },

+  { 0x8700, 0x125a, 0x2000 },

+  { 0x0700, 0x1258, 0x0000 },

+  { 0x0700, 0x125b, 0x0000 },

+  { 0x8700, 0x1266, 0x4000 },

+  { 0x8700, 0x1262, 0x3000 },

+  { 0x8700, 0x1260, 0x2000 },

+  { 0x0700, 0x125d, 0x0000 },

+  { 0x0700, 0x1261, 0x0000 },

+  { 0x8700, 0x1264, 0x2000 },

+  { 0x0700, 0x1263, 0x0000 },

+  { 0x0700, 0x1265, 0x0000 },

+  { 0x8700, 0x126a, 0x3000 },

+  { 0x8700, 0x1268, 0x2000 },

+  { 0x0700, 0x1267, 0x0000 },

+  { 0x0700, 0x1269, 0x0000 },

+  { 0x8700, 0x126c, 0x2000 },

+  { 0x0700, 0x126b, 0x0000 },

+  { 0x0700, 0x126d, 0x0000 },

+  { 0x8700, 0x127e, 0x5000 },

+  { 0x8700, 0x1276, 0x4000 },

+  { 0x8700, 0x1272, 0x3000 },

+  { 0x8700, 0x1270, 0x2000 },

+  { 0x0700, 0x126f, 0x0000 },

+  { 0x0700, 0x1271, 0x0000 },

+  { 0x8700, 0x1274, 0x2000 },

+  { 0x0700, 0x1273, 0x0000 },

+  { 0x0700, 0x1275, 0x0000 },

+  { 0x8700, 0x127a, 0x3000 },

+  { 0x8700, 0x1278, 0x2000 },

+  { 0x0700, 0x1277, 0x0000 },

+  { 0x0700, 0x1279, 0x0000 },

+  { 0x8700, 0x127c, 0x2000 },

+  { 0x0700, 0x127b, 0x0000 },

+  { 0x0700, 0x127d, 0x0000 },

+  { 0x8700, 0x1286, 0x4000 },

+  { 0x8700, 0x1282, 0x3000 },

+  { 0x8700, 0x1280, 0x2000 },

+  { 0x0700, 0x127f, 0x0000 },

+  { 0x0700, 0x1281, 0x0000 },

+  { 0x8700, 0x1284, 0x2000 },

+  { 0x0700, 0x1283, 0x0000 },

+  { 0x0700, 0x1285, 0x0000 },

+  { 0x8700, 0x128c, 0x3000 },

+  { 0x8700, 0x128a, 0x2000 },

+  { 0x0700, 0x1288, 0x0000 },

+  { 0x0700, 0x128b, 0x0000 },

+  { 0x8700, 0x1290, 0x2000 },

+  { 0x0700, 0x128d, 0x0000 },

+  { 0x0700, 0x1291, 0x0000 },

+  { 0x8700, 0x12dc, 0x7000 },

+  { 0x8700, 0x12b4, 0x6000 },

+  { 0x8700, 0x12a2, 0x5000 },

+  { 0x8700, 0x129a, 0x4000 },

+  { 0x8700, 0x1296, 0x3000 },

+  { 0x8700, 0x1294, 0x2000 },

+  { 0x0700, 0x1293, 0x0000 },

+  { 0x0700, 0x1295, 0x0000 },

+  { 0x8700, 0x1298, 0x2000 },

+  { 0x0700, 0x1297, 0x0000 },

+  { 0x0700, 0x1299, 0x0000 },

+  { 0x8700, 0x129e, 0x3000 },

+  { 0x8700, 0x129c, 0x2000 },

+  { 0x0700, 0x129b, 0x0000 },

+  { 0x0700, 0x129d, 0x0000 },

+  { 0x8700, 0x12a0, 0x2000 },

+  { 0x0700, 0x129f, 0x0000 },

+  { 0x0700, 0x12a1, 0x0000 },

+  { 0x8700, 0x12aa, 0x4000 },

+  { 0x8700, 0x12a6, 0x3000 },

+  { 0x8700, 0x12a4, 0x2000 },

+  { 0x0700, 0x12a3, 0x0000 },

+  { 0x0700, 0x12a5, 0x0000 },

+  { 0x8700, 0x12a8, 0x2000 },

+  { 0x0700, 0x12a7, 0x0000 },

+  { 0x0700, 0x12a9, 0x0000 },

+  { 0x8700, 0x12ae, 0x3000 },

+  { 0x8700, 0x12ac, 0x2000 },

+  { 0x0700, 0x12ab, 0x0000 },

+  { 0x0700, 0x12ad, 0x0000 },

+  { 0x8700, 0x12b2, 0x2000 },

+  { 0x0700, 0x12b0, 0x0000 },

+  { 0x0700, 0x12b3, 0x0000 },

+  { 0x8700, 0x12ca, 0x5000 },

+  { 0x8700, 0x12be, 0x4000 },

+  { 0x8700, 0x12ba, 0x3000 },

+  { 0x8700, 0x12b8, 0x2000 },

+  { 0x0700, 0x12b5, 0x0000 },

+  { 0x0700, 0x12b9, 0x0000 },

+  { 0x8700, 0x12bc, 0x2000 },

+  { 0x0700, 0x12bb, 0x0000 },

+  { 0x0700, 0x12bd, 0x0000 },

+  { 0x8700, 0x12c4, 0x3000 },

+  { 0x8700, 0x12c2, 0x2000 },

+  { 0x0700, 0x12c0, 0x0000 },

+  { 0x0700, 0x12c3, 0x0000 },

+  { 0x8700, 0x12c8, 0x2000 },

+  { 0x0700, 0x12c5, 0x0000 },

+  { 0x0700, 0x12c9, 0x0000 },

+  { 0x8700, 0x12d3, 0x4000 },

+  { 0x8700, 0x12ce, 0x3000 },

+  { 0x8700, 0x12cc, 0x2000 },

+  { 0x0700, 0x12cb, 0x0000 },

+  { 0x0700, 0x12cd, 0x0000 },

+  { 0x8700, 0x12d1, 0x2000 },

+  { 0x0700, 0x12d0, 0x0000 },

+  { 0x0700, 0x12d2, 0x0000 },

+  { 0x8700, 0x12d8, 0x3000 },

+  { 0x8700, 0x12d5, 0x2000 },

+  { 0x0700, 0x12d4, 0x0000 },

+  { 0x0700, 0x12d6, 0x0000 },

+  { 0x8700, 0x12da, 0x2000 },

+  { 0x0700, 0x12d9, 0x0000 },

+  { 0x0700, 0x12db, 0x0000 },

+  { 0x8700, 0x12fd, 0x6000 },

+  { 0x8700, 0x12ec, 0x5000 },

+  { 0x8700, 0x12e4, 0x4000 },

+  { 0x8700, 0x12e0, 0x3000 },

+  { 0x8700, 0x12de, 0x2000 },

+  { 0x0700, 0x12dd, 0x0000 },

+  { 0x0700, 0x12df, 0x0000 },

+  { 0x8700, 0x12e2, 0x2000 },

+  { 0x0700, 0x12e1, 0x0000 },

+  { 0x0700, 0x12e3, 0x0000 },

+  { 0x8700, 0x12e8, 0x3000 },

+  { 0x8700, 0x12e6, 0x2000 },

+  { 0x0700, 0x12e5, 0x0000 },

+  { 0x0700, 0x12e7, 0x0000 },

+  { 0x8700, 0x12ea, 0x2000 },

+  { 0x0700, 0x12e9, 0x0000 },

+  { 0x0700, 0x12eb, 0x0000 },

+  { 0x8700, 0x12f5, 0x4000 },

+  { 0x8700, 0x12f1, 0x3000 },

+  { 0x8700, 0x12ee, 0x2000 },

+  { 0x0700, 0x12ed, 0x0000 },

+  { 0x0700, 0x12f0, 0x0000 },

+  { 0x8700, 0x12f3, 0x2000 },

+  { 0x0700, 0x12f2, 0x0000 },

+  { 0x0700, 0x12f4, 0x0000 },

+  { 0x8700, 0x12f9, 0x3000 },

+  { 0x8700, 0x12f7, 0x2000 },

+  { 0x0700, 0x12f6, 0x0000 },

+  { 0x0700, 0x12f8, 0x0000 },

+  { 0x8700, 0x12fb, 0x2000 },

+  { 0x0700, 0x12fa, 0x0000 },

+  { 0x0700, 0x12fc, 0x0000 },

+  { 0x8700, 0x130d, 0x5000 },

+  { 0x8700, 0x1305, 0x4000 },

+  { 0x8700, 0x1301, 0x3000 },

+  { 0x8700, 0x12ff, 0x2000 },

+  { 0x0700, 0x12fe, 0x0000 },

+  { 0x0700, 0x1300, 0x0000 },

+  { 0x8700, 0x1303, 0x2000 },

+  { 0x0700, 0x1302, 0x0000 },

+  { 0x0700, 0x1304, 0x0000 },

+  { 0x8700, 0x1309, 0x3000 },

+  { 0x8700, 0x1307, 0x2000 },

+  { 0x0700, 0x1306, 0x0000 },

+  { 0x0700, 0x1308, 0x0000 },

+  { 0x8700, 0x130b, 0x2000 },

+  { 0x0700, 0x130a, 0x0000 },

+  { 0x0700, 0x130c, 0x0000 },

+  { 0x8700, 0x1319, 0x4000 },

+  { 0x8700, 0x1313, 0x3000 },

+  { 0x8700, 0x1310, 0x2000 },

+  { 0x0700, 0x130e, 0x0000 },

+  { 0x0700, 0x1312, 0x0000 },

+  { 0x8700, 0x1315, 0x2000 },

+  { 0x0700, 0x1314, 0x0000 },

+  { 0x0700, 0x1318, 0x0000 },

+  { 0x8700, 0x131d, 0x3000 },

+  { 0x8700, 0x131b, 0x2000 },

+  { 0x0700, 0x131a, 0x0000 },

+  { 0x0700, 0x131c, 0x0000 },

+  { 0x8700, 0x1320, 0x2000 },

+  { 0x0700, 0x131e, 0x0000 },

+  { 0x0700, 0x1321, 0x0000 },

+  { 0x8700, 0x1458, 0x9000 },

+  { 0x8700, 0x13cc, 0x8000 },

+  { 0x8d00, 0x1369, 0x7000 },

+  { 0x8700, 0x1342, 0x6000 },

+  { 0x8700, 0x1332, 0x5000 },

+  { 0x8700, 0x132a, 0x4000 },

+  { 0x8700, 0x1326, 0x3000 },

+  { 0x8700, 0x1324, 0x2000 },

+  { 0x0700, 0x1323, 0x0000 },

+  { 0x0700, 0x1325, 0x0000 },

+  { 0x8700, 0x1328, 0x2000 },

+  { 0x0700, 0x1327, 0x0000 },

+  { 0x0700, 0x1329, 0x0000 },

+  { 0x8700, 0x132e, 0x3000 },

+  { 0x8700, 0x132c, 0x2000 },

+  { 0x0700, 0x132b, 0x0000 },

+  { 0x0700, 0x132d, 0x0000 },

+  { 0x8700, 0x1330, 0x2000 },

+  { 0x0700, 0x132f, 0x0000 },

+  { 0x0700, 0x1331, 0x0000 },

+  { 0x8700, 0x133a, 0x4000 },

+  { 0x8700, 0x1336, 0x3000 },

+  { 0x8700, 0x1334, 0x2000 },

+  { 0x0700, 0x1333, 0x0000 },

+  { 0x0700, 0x1335, 0x0000 },

+  { 0x8700, 0x1338, 0x2000 },

+  { 0x0700, 0x1337, 0x0000 },

+  { 0x0700, 0x1339, 0x0000 },

+  { 0x8700, 0x133e, 0x3000 },

+  { 0x8700, 0x133c, 0x2000 },

+  { 0x0700, 0x133b, 0x0000 },

+  { 0x0700, 0x133d, 0x0000 },

+  { 0x8700, 0x1340, 0x2000 },

+  { 0x0700, 0x133f, 0x0000 },

+  { 0x0700, 0x1341, 0x0000 },

+  { 0x8700, 0x1353, 0x5000 },

+  { 0x8700, 0x134b, 0x4000 },

+  { 0x8700, 0x1346, 0x3000 },

+  { 0x8700, 0x1344, 0x2000 },

+  { 0x0700, 0x1343, 0x0000 },

+  { 0x0700, 0x1345, 0x0000 },

+  { 0x8700, 0x1349, 0x2000 },

+  { 0x0700, 0x1348, 0x0000 },

+  { 0x0700, 0x134a, 0x0000 },

+  { 0x8700, 0x134f, 0x3000 },

+  { 0x8700, 0x134d, 0x2000 },

+  { 0x0700, 0x134c, 0x0000 },

+  { 0x0700, 0x134e, 0x0000 },

+  { 0x8700, 0x1351, 0x2000 },

+  { 0x0700, 0x1350, 0x0000 },

+  { 0x0700, 0x1352, 0x0000 },

+  { 0x9500, 0x1361, 0x4000 },

+  { 0x8700, 0x1357, 0x3000 },

+  { 0x8700, 0x1355, 0x2000 },

+  { 0x0700, 0x1354, 0x0000 },

+  { 0x0700, 0x1356, 0x0000 },

+  { 0x8700, 0x1359, 0x2000 },

+  { 0x0700, 0x1358, 0x0000 },

+  { 0x0700, 0x135a, 0x0000 },

+  { 0x9500, 0x1365, 0x3000 },

+  { 0x9500, 0x1363, 0x2000 },

+  { 0x1500, 0x1362, 0x0000 },

+  { 0x1500, 0x1364, 0x0000 },

+  { 0x9500, 0x1367, 0x2000 },

+  { 0x1500, 0x1366, 0x0000 },

+  { 0x1500, 0x1368, 0x0000 },

+  { 0x8700, 0x13ac, 0x6000 },

+  { 0x8f00, 0x1379, 0x5000 },

+  { 0x8d00, 0x1371, 0x4000 },

+  { 0x8d00, 0x136d, 0x3000 },

+  { 0x8d00, 0x136b, 0x2000 },

+  { 0x0d00, 0x136a, 0x0000 },

+  { 0x0d00, 0x136c, 0x0000 },

+  { 0x8d00, 0x136f, 0x2000 },

+  { 0x0d00, 0x136e, 0x0000 },

+  { 0x0d00, 0x1370, 0x0000 },

+  { 0x8f00, 0x1375, 0x3000 },

+  { 0x8f00, 0x1373, 0x2000 },

+  { 0x0f00, 0x1372, 0x0000 },

+  { 0x0f00, 0x1374, 0x0000 },

+  { 0x8f00, 0x1377, 0x2000 },

+  { 0x0f00, 0x1376, 0x0000 },

+  { 0x0f00, 0x1378, 0x0000 },

+  { 0x8700, 0x13a4, 0x4000 },

+  { 0x8700, 0x13a0, 0x3000 },

+  { 0x8f00, 0x137b, 0x2000 },

+  { 0x0f00, 0x137a, 0x0000 },

+  { 0x0f00, 0x137c, 0x0000 },

+  { 0x8700, 0x13a2, 0x2000 },

+  { 0x0700, 0x13a1, 0x0000 },

+  { 0x0700, 0x13a3, 0x0000 },

+  { 0x8700, 0x13a8, 0x3000 },

+  { 0x8700, 0x13a6, 0x2000 },

+  { 0x0700, 0x13a5, 0x0000 },

+  { 0x0700, 0x13a7, 0x0000 },

+  { 0x8700, 0x13aa, 0x2000 },

+  { 0x0700, 0x13a9, 0x0000 },

+  { 0x0700, 0x13ab, 0x0000 },

+  { 0x8700, 0x13bc, 0x5000 },

+  { 0x8700, 0x13b4, 0x4000 },

+  { 0x8700, 0x13b0, 0x3000 },

+  { 0x8700, 0x13ae, 0x2000 },

+  { 0x0700, 0x13ad, 0x0000 },

+  { 0x0700, 0x13af, 0x0000 },

+  { 0x8700, 0x13b2, 0x2000 },

+  { 0x0700, 0x13b1, 0x0000 },

+  { 0x0700, 0x13b3, 0x0000 },

+  { 0x8700, 0x13b8, 0x3000 },

+  { 0x8700, 0x13b6, 0x2000 },

+  { 0x0700, 0x13b5, 0x0000 },

+  { 0x0700, 0x13b7, 0x0000 },

+  { 0x8700, 0x13ba, 0x2000 },

+  { 0x0700, 0x13b9, 0x0000 },

+  { 0x0700, 0x13bb, 0x0000 },

+  { 0x8700, 0x13c4, 0x4000 },

+  { 0x8700, 0x13c0, 0x3000 },

+  { 0x8700, 0x13be, 0x2000 },

+  { 0x0700, 0x13bd, 0x0000 },

+  { 0x0700, 0x13bf, 0x0000 },

+  { 0x8700, 0x13c2, 0x2000 },

+  { 0x0700, 0x13c1, 0x0000 },

+  { 0x0700, 0x13c3, 0x0000 },

+  { 0x8700, 0x13c8, 0x3000 },

+  { 0x8700, 0x13c6, 0x2000 },

+  { 0x0700, 0x13c5, 0x0000 },

+  { 0x0700, 0x13c7, 0x0000 },

+  { 0x8700, 0x13ca, 0x2000 },

+  { 0x0700, 0x13c9, 0x0000 },

+  { 0x0700, 0x13cb, 0x0000 },

+  { 0x8700, 0x1418, 0x7000 },

+  { 0x8700, 0x13ec, 0x6000 },

+  { 0x8700, 0x13dc, 0x5000 },

+  { 0x8700, 0x13d4, 0x4000 },

+  { 0x8700, 0x13d0, 0x3000 },

+  { 0x8700, 0x13ce, 0x2000 },

+  { 0x0700, 0x13cd, 0x0000 },

+  { 0x0700, 0x13cf, 0x0000 },

+  { 0x8700, 0x13d2, 0x2000 },

+  { 0x0700, 0x13d1, 0x0000 },

+  { 0x0700, 0x13d3, 0x0000 },

+  { 0x8700, 0x13d8, 0x3000 },

+  { 0x8700, 0x13d6, 0x2000 },

+  { 0x0700, 0x13d5, 0x0000 },

+  { 0x0700, 0x13d7, 0x0000 },

+  { 0x8700, 0x13da, 0x2000 },

+  { 0x0700, 0x13d9, 0x0000 },

+  { 0x0700, 0x13db, 0x0000 },

+  { 0x8700, 0x13e4, 0x4000 },

+  { 0x8700, 0x13e0, 0x3000 },

+  { 0x8700, 0x13de, 0x2000 },

+  { 0x0700, 0x13dd, 0x0000 },

+  { 0x0700, 0x13df, 0x0000 },

+  { 0x8700, 0x13e2, 0x2000 },

+  { 0x0700, 0x13e1, 0x0000 },

+  { 0x0700, 0x13e3, 0x0000 },

+  { 0x8700, 0x13e8, 0x3000 },

+  { 0x8700, 0x13e6, 0x2000 },

+  { 0x0700, 0x13e5, 0x0000 },

+  { 0x0700, 0x13e7, 0x0000 },

+  { 0x8700, 0x13ea, 0x2000 },

+  { 0x0700, 0x13e9, 0x0000 },

+  { 0x0700, 0x13eb, 0x0000 },

+  { 0x8700, 0x1408, 0x5000 },

+  { 0x8700, 0x13f4, 0x4000 },

+  { 0x8700, 0x13f0, 0x3000 },

+  { 0x8700, 0x13ee, 0x2000 },

+  { 0x0700, 0x13ed, 0x0000 },

+  { 0x0700, 0x13ef, 0x0000 },

+  { 0x8700, 0x13f2, 0x2000 },

+  { 0x0700, 0x13f1, 0x0000 },

+  { 0x0700, 0x13f3, 0x0000 },

+  { 0x8700, 0x1404, 0x3000 },

+  { 0x8700, 0x1402, 0x2000 },

+  { 0x0700, 0x1401, 0x0000 },

+  { 0x0700, 0x1403, 0x0000 },

+  { 0x8700, 0x1406, 0x2000 },

+  { 0x0700, 0x1405, 0x0000 },

+  { 0x0700, 0x1407, 0x0000 },

+  { 0x8700, 0x1410, 0x4000 },

+  { 0x8700, 0x140c, 0x3000 },

+  { 0x8700, 0x140a, 0x2000 },

+  { 0x0700, 0x1409, 0x0000 },

+  { 0x0700, 0x140b, 0x0000 },

+  { 0x8700, 0x140e, 0x2000 },

+  { 0x0700, 0x140d, 0x0000 },

+  { 0x0700, 0x140f, 0x0000 },

+  { 0x8700, 0x1414, 0x3000 },

+  { 0x8700, 0x1412, 0x2000 },

+  { 0x0700, 0x1411, 0x0000 },

+  { 0x0700, 0x1413, 0x0000 },

+  { 0x8700, 0x1416, 0x2000 },

+  { 0x0700, 0x1415, 0x0000 },

+  { 0x0700, 0x1417, 0x0000 },

+  { 0x8700, 0x1438, 0x6000 },

+  { 0x8700, 0x1428, 0x5000 },

+  { 0x8700, 0x1420, 0x4000 },

+  { 0x8700, 0x141c, 0x3000 },

+  { 0x8700, 0x141a, 0x2000 },

+  { 0x0700, 0x1419, 0x0000 },

+  { 0x0700, 0x141b, 0x0000 },

+  { 0x8700, 0x141e, 0x2000 },

+  { 0x0700, 0x141d, 0x0000 },

+  { 0x0700, 0x141f, 0x0000 },

+  { 0x8700, 0x1424, 0x3000 },

+  { 0x8700, 0x1422, 0x2000 },

+  { 0x0700, 0x1421, 0x0000 },

+  { 0x0700, 0x1423, 0x0000 },

+  { 0x8700, 0x1426, 0x2000 },

+  { 0x0700, 0x1425, 0x0000 },

+  { 0x0700, 0x1427, 0x0000 },

+  { 0x8700, 0x1430, 0x4000 },

+  { 0x8700, 0x142c, 0x3000 },

+  { 0x8700, 0x142a, 0x2000 },

+  { 0x0700, 0x1429, 0x0000 },

+  { 0x0700, 0x142b, 0x0000 },

+  { 0x8700, 0x142e, 0x2000 },

+  { 0x0700, 0x142d, 0x0000 },

+  { 0x0700, 0x142f, 0x0000 },

+  { 0x8700, 0x1434, 0x3000 },

+  { 0x8700, 0x1432, 0x2000 },

+  { 0x0700, 0x1431, 0x0000 },

+  { 0x0700, 0x1433, 0x0000 },

+  { 0x8700, 0x1436, 0x2000 },

+  { 0x0700, 0x1435, 0x0000 },

+  { 0x0700, 0x1437, 0x0000 },

+  { 0x8700, 0x1448, 0x5000 },

+  { 0x8700, 0x1440, 0x4000 },

+  { 0x8700, 0x143c, 0x3000 },

+  { 0x8700, 0x143a, 0x2000 },

+  { 0x0700, 0x1439, 0x0000 },

+  { 0x0700, 0x143b, 0x0000 },

+  { 0x8700, 0x143e, 0x2000 },

+  { 0x0700, 0x143d, 0x0000 },

+  { 0x0700, 0x143f, 0x0000 },

+  { 0x8700, 0x1444, 0x3000 },

+  { 0x8700, 0x1442, 0x2000 },

+  { 0x0700, 0x1441, 0x0000 },

+  { 0x0700, 0x1443, 0x0000 },

+  { 0x8700, 0x1446, 0x2000 },

+  { 0x0700, 0x1445, 0x0000 },

+  { 0x0700, 0x1447, 0x0000 },

+  { 0x8700, 0x1450, 0x4000 },

+  { 0x8700, 0x144c, 0x3000 },

+  { 0x8700, 0x144a, 0x2000 },

+  { 0x0700, 0x1449, 0x0000 },

+  { 0x0700, 0x144b, 0x0000 },

+  { 0x8700, 0x144e, 0x2000 },

+  { 0x0700, 0x144d, 0x0000 },

+  { 0x0700, 0x144f, 0x0000 },

+  { 0x8700, 0x1454, 0x3000 },

+  { 0x8700, 0x1452, 0x2000 },

+  { 0x0700, 0x1451, 0x0000 },

+  { 0x0700, 0x1453, 0x0000 },

+  { 0x8700, 0x1456, 0x2000 },

+  { 0x0700, 0x1455, 0x0000 },

+  { 0x0700, 0x1457, 0x0000 },

+  { 0x8700, 0x14d8, 0x8000 },

+  { 0x8700, 0x1498, 0x7000 },

+  { 0x8700, 0x1478, 0x6000 },

+  { 0x8700, 0x1468, 0x5000 },

+  { 0x8700, 0x1460, 0x4000 },

+  { 0x8700, 0x145c, 0x3000 },

+  { 0x8700, 0x145a, 0x2000 },

+  { 0x0700, 0x1459, 0x0000 },

+  { 0x0700, 0x145b, 0x0000 },

+  { 0x8700, 0x145e, 0x2000 },

+  { 0x0700, 0x145d, 0x0000 },

+  { 0x0700, 0x145f, 0x0000 },

+  { 0x8700, 0x1464, 0x3000 },

+  { 0x8700, 0x1462, 0x2000 },

+  { 0x0700, 0x1461, 0x0000 },

+  { 0x0700, 0x1463, 0x0000 },

+  { 0x8700, 0x1466, 0x2000 },

+  { 0x0700, 0x1465, 0x0000 },

+  { 0x0700, 0x1467, 0x0000 },

+  { 0x8700, 0x1470, 0x4000 },

+  { 0x8700, 0x146c, 0x3000 },

+  { 0x8700, 0x146a, 0x2000 },

+  { 0x0700, 0x1469, 0x0000 },

+  { 0x0700, 0x146b, 0x0000 },

+  { 0x8700, 0x146e, 0x2000 },

+  { 0x0700, 0x146d, 0x0000 },

+  { 0x0700, 0x146f, 0x0000 },

+  { 0x8700, 0x1474, 0x3000 },

+  { 0x8700, 0x1472, 0x2000 },

+  { 0x0700, 0x1471, 0x0000 },

+  { 0x0700, 0x1473, 0x0000 },

+  { 0x8700, 0x1476, 0x2000 },

+  { 0x0700, 0x1475, 0x0000 },

+  { 0x0700, 0x1477, 0x0000 },

+  { 0x8700, 0x1488, 0x5000 },

+  { 0x8700, 0x1480, 0x4000 },

+  { 0x8700, 0x147c, 0x3000 },

+  { 0x8700, 0x147a, 0x2000 },

+  { 0x0700, 0x1479, 0x0000 },

+  { 0x0700, 0x147b, 0x0000 },

+  { 0x8700, 0x147e, 0x2000 },

+  { 0x0700, 0x147d, 0x0000 },

+  { 0x0700, 0x147f, 0x0000 },

+  { 0x8700, 0x1484, 0x3000 },

+  { 0x8700, 0x1482, 0x2000 },

+  { 0x0700, 0x1481, 0x0000 },

+  { 0x0700, 0x1483, 0x0000 },

+  { 0x8700, 0x1486, 0x2000 },

+  { 0x0700, 0x1485, 0x0000 },

+  { 0x0700, 0x1487, 0x0000 },

+  { 0x8700, 0x1490, 0x4000 },

+  { 0x8700, 0x148c, 0x3000 },

+  { 0x8700, 0x148a, 0x2000 },

+  { 0x0700, 0x1489, 0x0000 },

+  { 0x0700, 0x148b, 0x0000 },

+  { 0x8700, 0x148e, 0x2000 },

+  { 0x0700, 0x148d, 0x0000 },

+  { 0x0700, 0x148f, 0x0000 },

+  { 0x8700, 0x1494, 0x3000 },

+  { 0x8700, 0x1492, 0x2000 },

+  { 0x0700, 0x1491, 0x0000 },

+  { 0x0700, 0x1493, 0x0000 },

+  { 0x8700, 0x1496, 0x2000 },

+  { 0x0700, 0x1495, 0x0000 },

+  { 0x0700, 0x1497, 0x0000 },

+  { 0x8700, 0x14b8, 0x6000 },

+  { 0x8700, 0x14a8, 0x5000 },

+  { 0x8700, 0x14a0, 0x4000 },

+  { 0x8700, 0x149c, 0x3000 },

+  { 0x8700, 0x149a, 0x2000 },

+  { 0x0700, 0x1499, 0x0000 },

+  { 0x0700, 0x149b, 0x0000 },

+  { 0x8700, 0x149e, 0x2000 },

+  { 0x0700, 0x149d, 0x0000 },

+  { 0x0700, 0x149f, 0x0000 },

+  { 0x8700, 0x14a4, 0x3000 },

+  { 0x8700, 0x14a2, 0x2000 },

+  { 0x0700, 0x14a1, 0x0000 },

+  { 0x0700, 0x14a3, 0x0000 },

+  { 0x8700, 0x14a6, 0x2000 },

+  { 0x0700, 0x14a5, 0x0000 },

+  { 0x0700, 0x14a7, 0x0000 },

+  { 0x8700, 0x14b0, 0x4000 },

+  { 0x8700, 0x14ac, 0x3000 },

+  { 0x8700, 0x14aa, 0x2000 },

+  { 0x0700, 0x14a9, 0x0000 },

+  { 0x0700, 0x14ab, 0x0000 },

+  { 0x8700, 0x14ae, 0x2000 },

+  { 0x0700, 0x14ad, 0x0000 },

+  { 0x0700, 0x14af, 0x0000 },

+  { 0x8700, 0x14b4, 0x3000 },

+  { 0x8700, 0x14b2, 0x2000 },

+  { 0x0700, 0x14b1, 0x0000 },

+  { 0x0700, 0x14b3, 0x0000 },

+  { 0x8700, 0x14b6, 0x2000 },

+  { 0x0700, 0x14b5, 0x0000 },

+  { 0x0700, 0x14b7, 0x0000 },

+  { 0x8700, 0x14c8, 0x5000 },

+  { 0x8700, 0x14c0, 0x4000 },

+  { 0x8700, 0x14bc, 0x3000 },

+  { 0x8700, 0x14ba, 0x2000 },

+  { 0x0700, 0x14b9, 0x0000 },

+  { 0x0700, 0x14bb, 0x0000 },

+  { 0x8700, 0x14be, 0x2000 },

+  { 0x0700, 0x14bd, 0x0000 },

+  { 0x0700, 0x14bf, 0x0000 },

+  { 0x8700, 0x14c4, 0x3000 },

+  { 0x8700, 0x14c2, 0x2000 },

+  { 0x0700, 0x14c1, 0x0000 },

+  { 0x0700, 0x14c3, 0x0000 },

+  { 0x8700, 0x14c6, 0x2000 },

+  { 0x0700, 0x14c5, 0x0000 },

+  { 0x0700, 0x14c7, 0x0000 },

+  { 0x8700, 0x14d0, 0x4000 },

+  { 0x8700, 0x14cc, 0x3000 },

+  { 0x8700, 0x14ca, 0x2000 },

+  { 0x0700, 0x14c9, 0x0000 },

+  { 0x0700, 0x14cb, 0x0000 },

+  { 0x8700, 0x14ce, 0x2000 },

+  { 0x0700, 0x14cd, 0x0000 },

+  { 0x0700, 0x14cf, 0x0000 },

+  { 0x8700, 0x14d4, 0x3000 },

+  { 0x8700, 0x14d2, 0x2000 },

+  { 0x0700, 0x14d1, 0x0000 },

+  { 0x0700, 0x14d3, 0x0000 },

+  { 0x8700, 0x14d6, 0x2000 },

+  { 0x0700, 0x14d5, 0x0000 },

+  { 0x0700, 0x14d7, 0x0000 },

+  { 0x8700, 0x1518, 0x7000 },

+  { 0x8700, 0x14f8, 0x6000 },

+  { 0x8700, 0x14e8, 0x5000 },

+  { 0x8700, 0x14e0, 0x4000 },

+  { 0x8700, 0x14dc, 0x3000 },

+  { 0x8700, 0x14da, 0x2000 },

+  { 0x0700, 0x14d9, 0x0000 },

+  { 0x0700, 0x14db, 0x0000 },

+  { 0x8700, 0x14de, 0x2000 },

+  { 0x0700, 0x14dd, 0x0000 },

+  { 0x0700, 0x14df, 0x0000 },

+  { 0x8700, 0x14e4, 0x3000 },

+  { 0x8700, 0x14e2, 0x2000 },

+  { 0x0700, 0x14e1, 0x0000 },

+  { 0x0700, 0x14e3, 0x0000 },

+  { 0x8700, 0x14e6, 0x2000 },

+  { 0x0700, 0x14e5, 0x0000 },

+  { 0x0700, 0x14e7, 0x0000 },

+  { 0x8700, 0x14f0, 0x4000 },

+  { 0x8700, 0x14ec, 0x3000 },

+  { 0x8700, 0x14ea, 0x2000 },

+  { 0x0700, 0x14e9, 0x0000 },

+  { 0x0700, 0x14eb, 0x0000 },

+  { 0x8700, 0x14ee, 0x2000 },

+  { 0x0700, 0x14ed, 0x0000 },

+  { 0x0700, 0x14ef, 0x0000 },

+  { 0x8700, 0x14f4, 0x3000 },

+  { 0x8700, 0x14f2, 0x2000 },

+  { 0x0700, 0x14f1, 0x0000 },

+  { 0x0700, 0x14f3, 0x0000 },

+  { 0x8700, 0x14f6, 0x2000 },

+  { 0x0700, 0x14f5, 0x0000 },

+  { 0x0700, 0x14f7, 0x0000 },

+  { 0x8700, 0x1508, 0x5000 },

+  { 0x8700, 0x1500, 0x4000 },

+  { 0x8700, 0x14fc, 0x3000 },

+  { 0x8700, 0x14fa, 0x2000 },

+  { 0x0700, 0x14f9, 0x0000 },

+  { 0x0700, 0x14fb, 0x0000 },

+  { 0x8700, 0x14fe, 0x2000 },

+  { 0x0700, 0x14fd, 0x0000 },

+  { 0x0700, 0x14ff, 0x0000 },

+  { 0x8700, 0x1504, 0x3000 },

+  { 0x8700, 0x1502, 0x2000 },

+  { 0x0700, 0x1501, 0x0000 },

+  { 0x0700, 0x1503, 0x0000 },

+  { 0x8700, 0x1506, 0x2000 },

+  { 0x0700, 0x1505, 0x0000 },

+  { 0x0700, 0x1507, 0x0000 },

+  { 0x8700, 0x1510, 0x4000 },

+  { 0x8700, 0x150c, 0x3000 },

+  { 0x8700, 0x150a, 0x2000 },

+  { 0x0700, 0x1509, 0x0000 },

+  { 0x0700, 0x150b, 0x0000 },

+  { 0x8700, 0x150e, 0x2000 },

+  { 0x0700, 0x150d, 0x0000 },

+  { 0x0700, 0x150f, 0x0000 },

+  { 0x8700, 0x1514, 0x3000 },

+  { 0x8700, 0x1512, 0x2000 },

+  { 0x0700, 0x1511, 0x0000 },

+  { 0x0700, 0x1513, 0x0000 },

+  { 0x8700, 0x1516, 0x2000 },

+  { 0x0700, 0x1515, 0x0000 },

+  { 0x0700, 0x1517, 0x0000 },

+  { 0x8700, 0x1538, 0x6000 },

+  { 0x8700, 0x1528, 0x5000 },

+  { 0x8700, 0x1520, 0x4000 },

+  { 0x8700, 0x151c, 0x3000 },

+  { 0x8700, 0x151a, 0x2000 },

+  { 0x0700, 0x1519, 0x0000 },

+  { 0x0700, 0x151b, 0x0000 },

+  { 0x8700, 0x151e, 0x2000 },

+  { 0x0700, 0x151d, 0x0000 },

+  { 0x0700, 0x151f, 0x0000 },

+  { 0x8700, 0x1524, 0x3000 },

+  { 0x8700, 0x1522, 0x2000 },

+  { 0x0700, 0x1521, 0x0000 },

+  { 0x0700, 0x1523, 0x0000 },

+  { 0x8700, 0x1526, 0x2000 },

+  { 0x0700, 0x1525, 0x0000 },

+  { 0x0700, 0x1527, 0x0000 },

+  { 0x8700, 0x1530, 0x4000 },

+  { 0x8700, 0x152c, 0x3000 },

+  { 0x8700, 0x152a, 0x2000 },

+  { 0x0700, 0x1529, 0x0000 },

+  { 0x0700, 0x152b, 0x0000 },

+  { 0x8700, 0x152e, 0x2000 },

+  { 0x0700, 0x152d, 0x0000 },

+  { 0x0700, 0x152f, 0x0000 },

+  { 0x8700, 0x1534, 0x3000 },

+  { 0x8700, 0x1532, 0x2000 },

+  { 0x0700, 0x1531, 0x0000 },

+  { 0x0700, 0x1533, 0x0000 },

+  { 0x8700, 0x1536, 0x2000 },

+  { 0x0700, 0x1535, 0x0000 },

+  { 0x0700, 0x1537, 0x0000 },

+  { 0x8700, 0x1548, 0x5000 },

+  { 0x8700, 0x1540, 0x4000 },

+  { 0x8700, 0x153c, 0x3000 },

+  { 0x8700, 0x153a, 0x2000 },

+  { 0x0700, 0x1539, 0x0000 },

+  { 0x0700, 0x153b, 0x0000 },

+  { 0x8700, 0x153e, 0x2000 },

+  { 0x0700, 0x153d, 0x0000 },

+  { 0x0700, 0x153f, 0x0000 },

+  { 0x8700, 0x1544, 0x3000 },

+  { 0x8700, 0x1542, 0x2000 },

+  { 0x0700, 0x1541, 0x0000 },

+  { 0x0700, 0x1543, 0x0000 },

+  { 0x8700, 0x1546, 0x2000 },

+  { 0x0700, 0x1545, 0x0000 },

+  { 0x0700, 0x1547, 0x0000 },

+  { 0x8700, 0x1550, 0x4000 },

+  { 0x8700, 0x154c, 0x3000 },

+  { 0x8700, 0x154a, 0x2000 },

+  { 0x0700, 0x1549, 0x0000 },

+  { 0x0700, 0x154b, 0x0000 },

+  { 0x8700, 0x154e, 0x2000 },

+  { 0x0700, 0x154d, 0x0000 },

+  { 0x0700, 0x154f, 0x0000 },

+  { 0x8700, 0x1554, 0x3000 },

+  { 0x8700, 0x1552, 0x2000 },

+  { 0x0700, 0x1551, 0x0000 },

+  { 0x0700, 0x1553, 0x0000 },

+  { 0x8700, 0x1556, 0x2000 },

+  { 0x0700, 0x1555, 0x0000 },

+  { 0x0700, 0x1557, 0x0000 },

+  { 0x9900, 0x22ae, 0xc000 },

+  { 0x8900, 0x1e24, 0xb001 },

+  { 0x8700, 0x17a2, 0xa000 },

+  { 0x8700, 0x1658, 0x9000 },

+  { 0x8700, 0x15d8, 0x8000 },

+  { 0x8700, 0x1598, 0x7000 },

+  { 0x8700, 0x1578, 0x6000 },

+  { 0x8700, 0x1568, 0x5000 },

+  { 0x8700, 0x1560, 0x4000 },

+  { 0x8700, 0x155c, 0x3000 },

+  { 0x8700, 0x155a, 0x2000 },

+  { 0x0700, 0x1559, 0x0000 },

+  { 0x0700, 0x155b, 0x0000 },

+  { 0x8700, 0x155e, 0x2000 },

+  { 0x0700, 0x155d, 0x0000 },

+  { 0x0700, 0x155f, 0x0000 },

+  { 0x8700, 0x1564, 0x3000 },

+  { 0x8700, 0x1562, 0x2000 },

+  { 0x0700, 0x1561, 0x0000 },

+  { 0x0700, 0x1563, 0x0000 },

+  { 0x8700, 0x1566, 0x2000 },

+  { 0x0700, 0x1565, 0x0000 },

+  { 0x0700, 0x1567, 0x0000 },

+  { 0x8700, 0x1570, 0x4000 },

+  { 0x8700, 0x156c, 0x3000 },

+  { 0x8700, 0x156a, 0x2000 },

+  { 0x0700, 0x1569, 0x0000 },

+  { 0x0700, 0x156b, 0x0000 },

+  { 0x8700, 0x156e, 0x2000 },

+  { 0x0700, 0x156d, 0x0000 },

+  { 0x0700, 0x156f, 0x0000 },

+  { 0x8700, 0x1574, 0x3000 },

+  { 0x8700, 0x1572, 0x2000 },

+  { 0x0700, 0x1571, 0x0000 },

+  { 0x0700, 0x1573, 0x0000 },

+  { 0x8700, 0x1576, 0x2000 },

+  { 0x0700, 0x1575, 0x0000 },

+  { 0x0700, 0x1577, 0x0000 },

+  { 0x8700, 0x1588, 0x5000 },

+  { 0x8700, 0x1580, 0x4000 },

+  { 0x8700, 0x157c, 0x3000 },

+  { 0x8700, 0x157a, 0x2000 },

+  { 0x0700, 0x1579, 0x0000 },

+  { 0x0700, 0x157b, 0x0000 },

+  { 0x8700, 0x157e, 0x2000 },

+  { 0x0700, 0x157d, 0x0000 },

+  { 0x0700, 0x157f, 0x0000 },

+  { 0x8700, 0x1584, 0x3000 },

+  { 0x8700, 0x1582, 0x2000 },

+  { 0x0700, 0x1581, 0x0000 },

+  { 0x0700, 0x1583, 0x0000 },

+  { 0x8700, 0x1586, 0x2000 },

+  { 0x0700, 0x1585, 0x0000 },

+  { 0x0700, 0x1587, 0x0000 },

+  { 0x8700, 0x1590, 0x4000 },

+  { 0x8700, 0x158c, 0x3000 },

+  { 0x8700, 0x158a, 0x2000 },

+  { 0x0700, 0x1589, 0x0000 },

+  { 0x0700, 0x158b, 0x0000 },

+  { 0x8700, 0x158e, 0x2000 },

+  { 0x0700, 0x158d, 0x0000 },

+  { 0x0700, 0x158f, 0x0000 },

+  { 0x8700, 0x1594, 0x3000 },

+  { 0x8700, 0x1592, 0x2000 },

+  { 0x0700, 0x1591, 0x0000 },

+  { 0x0700, 0x1593, 0x0000 },

+  { 0x8700, 0x1596, 0x2000 },

+  { 0x0700, 0x1595, 0x0000 },

+  { 0x0700, 0x1597, 0x0000 },

+  { 0x8700, 0x15b8, 0x6000 },

+  { 0x8700, 0x15a8, 0x5000 },

+  { 0x8700, 0x15a0, 0x4000 },

+  { 0x8700, 0x159c, 0x3000 },

+  { 0x8700, 0x159a, 0x2000 },

+  { 0x0700, 0x1599, 0x0000 },

+  { 0x0700, 0x159b, 0x0000 },

+  { 0x8700, 0x159e, 0x2000 },

+  { 0x0700, 0x159d, 0x0000 },

+  { 0x0700, 0x159f, 0x0000 },

+  { 0x8700, 0x15a4, 0x3000 },

+  { 0x8700, 0x15a2, 0x2000 },

+  { 0x0700, 0x15a1, 0x0000 },

+  { 0x0700, 0x15a3, 0x0000 },

+  { 0x8700, 0x15a6, 0x2000 },

+  { 0x0700, 0x15a5, 0x0000 },

+  { 0x0700, 0x15a7, 0x0000 },

+  { 0x8700, 0x15b0, 0x4000 },

+  { 0x8700, 0x15ac, 0x3000 },

+  { 0x8700, 0x15aa, 0x2000 },

+  { 0x0700, 0x15a9, 0x0000 },

+  { 0x0700, 0x15ab, 0x0000 },

+  { 0x8700, 0x15ae, 0x2000 },

+  { 0x0700, 0x15ad, 0x0000 },

+  { 0x0700, 0x15af, 0x0000 },

+  { 0x8700, 0x15b4, 0x3000 },

+  { 0x8700, 0x15b2, 0x2000 },

+  { 0x0700, 0x15b1, 0x0000 },

+  { 0x0700, 0x15b3, 0x0000 },

+  { 0x8700, 0x15b6, 0x2000 },

+  { 0x0700, 0x15b5, 0x0000 },

+  { 0x0700, 0x15b7, 0x0000 },

+  { 0x8700, 0x15c8, 0x5000 },

+  { 0x8700, 0x15c0, 0x4000 },

+  { 0x8700, 0x15bc, 0x3000 },

+  { 0x8700, 0x15ba, 0x2000 },

+  { 0x0700, 0x15b9, 0x0000 },

+  { 0x0700, 0x15bb, 0x0000 },

+  { 0x8700, 0x15be, 0x2000 },

+  { 0x0700, 0x15bd, 0x0000 },

+  { 0x0700, 0x15bf, 0x0000 },

+  { 0x8700, 0x15c4, 0x3000 },

+  { 0x8700, 0x15c2, 0x2000 },

+  { 0x0700, 0x15c1, 0x0000 },

+  { 0x0700, 0x15c3, 0x0000 },

+  { 0x8700, 0x15c6, 0x2000 },

+  { 0x0700, 0x15c5, 0x0000 },

+  { 0x0700, 0x15c7, 0x0000 },

+  { 0x8700, 0x15d0, 0x4000 },

+  { 0x8700, 0x15cc, 0x3000 },

+  { 0x8700, 0x15ca, 0x2000 },

+  { 0x0700, 0x15c9, 0x0000 },

+  { 0x0700, 0x15cb, 0x0000 },

+  { 0x8700, 0x15ce, 0x2000 },

+  { 0x0700, 0x15cd, 0x0000 },

+  { 0x0700, 0x15cf, 0x0000 },

+  { 0x8700, 0x15d4, 0x3000 },

+  { 0x8700, 0x15d2, 0x2000 },

+  { 0x0700, 0x15d1, 0x0000 },

+  { 0x0700, 0x15d3, 0x0000 },

+  { 0x8700, 0x15d6, 0x2000 },

+  { 0x0700, 0x15d5, 0x0000 },

+  { 0x0700, 0x15d7, 0x0000 },

+  { 0x8700, 0x1618, 0x7000 },

+  { 0x8700, 0x15f8, 0x6000 },

+  { 0x8700, 0x15e8, 0x5000 },

+  { 0x8700, 0x15e0, 0x4000 },

+  { 0x8700, 0x15dc, 0x3000 },

+  { 0x8700, 0x15da, 0x2000 },

+  { 0x0700, 0x15d9, 0x0000 },

+  { 0x0700, 0x15db, 0x0000 },

+  { 0x8700, 0x15de, 0x2000 },

+  { 0x0700, 0x15dd, 0x0000 },

+  { 0x0700, 0x15df, 0x0000 },

+  { 0x8700, 0x15e4, 0x3000 },

+  { 0x8700, 0x15e2, 0x2000 },

+  { 0x0700, 0x15e1, 0x0000 },

+  { 0x0700, 0x15e3, 0x0000 },

+  { 0x8700, 0x15e6, 0x2000 },

+  { 0x0700, 0x15e5, 0x0000 },

+  { 0x0700, 0x15e7, 0x0000 },

+  { 0x8700, 0x15f0, 0x4000 },

+  { 0x8700, 0x15ec, 0x3000 },

+  { 0x8700, 0x15ea, 0x2000 },

+  { 0x0700, 0x15e9, 0x0000 },

+  { 0x0700, 0x15eb, 0x0000 },

+  { 0x8700, 0x15ee, 0x2000 },

+  { 0x0700, 0x15ed, 0x0000 },

+  { 0x0700, 0x15ef, 0x0000 },

+  { 0x8700, 0x15f4, 0x3000 },

+  { 0x8700, 0x15f2, 0x2000 },

+  { 0x0700, 0x15f1, 0x0000 },

+  { 0x0700, 0x15f3, 0x0000 },

+  { 0x8700, 0x15f6, 0x2000 },

+  { 0x0700, 0x15f5, 0x0000 },

+  { 0x0700, 0x15f7, 0x0000 },

+  { 0x8700, 0x1608, 0x5000 },

+  { 0x8700, 0x1600, 0x4000 },

+  { 0x8700, 0x15fc, 0x3000 },

+  { 0x8700, 0x15fa, 0x2000 },

+  { 0x0700, 0x15f9, 0x0000 },

+  { 0x0700, 0x15fb, 0x0000 },

+  { 0x8700, 0x15fe, 0x2000 },

+  { 0x0700, 0x15fd, 0x0000 },

+  { 0x0700, 0x15ff, 0x0000 },

+  { 0x8700, 0x1604, 0x3000 },

+  { 0x8700, 0x1602, 0x2000 },

+  { 0x0700, 0x1601, 0x0000 },

+  { 0x0700, 0x1603, 0x0000 },

+  { 0x8700, 0x1606, 0x2000 },

+  { 0x0700, 0x1605, 0x0000 },

+  { 0x0700, 0x1607, 0x0000 },

+  { 0x8700, 0x1610, 0x4000 },

+  { 0x8700, 0x160c, 0x3000 },

+  { 0x8700, 0x160a, 0x2000 },

+  { 0x0700, 0x1609, 0x0000 },

+  { 0x0700, 0x160b, 0x0000 },

+  { 0x8700, 0x160e, 0x2000 },

+  { 0x0700, 0x160d, 0x0000 },

+  { 0x0700, 0x160f, 0x0000 },

+  { 0x8700, 0x1614, 0x3000 },

+  { 0x8700, 0x1612, 0x2000 },

+  { 0x0700, 0x1611, 0x0000 },

+  { 0x0700, 0x1613, 0x0000 },

+  { 0x8700, 0x1616, 0x2000 },

+  { 0x0700, 0x1615, 0x0000 },

+  { 0x0700, 0x1617, 0x0000 },

+  { 0x8700, 0x1638, 0x6000 },

+  { 0x8700, 0x1628, 0x5000 },

+  { 0x8700, 0x1620, 0x4000 },

+  { 0x8700, 0x161c, 0x3000 },

+  { 0x8700, 0x161a, 0x2000 },

+  { 0x0700, 0x1619, 0x0000 },

+  { 0x0700, 0x161b, 0x0000 },

+  { 0x8700, 0x161e, 0x2000 },

+  { 0x0700, 0x161d, 0x0000 },

+  { 0x0700, 0x161f, 0x0000 },

+  { 0x8700, 0x1624, 0x3000 },

+  { 0x8700, 0x1622, 0x2000 },

+  { 0x0700, 0x1621, 0x0000 },

+  { 0x0700, 0x1623, 0x0000 },

+  { 0x8700, 0x1626, 0x2000 },

+  { 0x0700, 0x1625, 0x0000 },

+  { 0x0700, 0x1627, 0x0000 },

+  { 0x8700, 0x1630, 0x4000 },

+  { 0x8700, 0x162c, 0x3000 },

+  { 0x8700, 0x162a, 0x2000 },

+  { 0x0700, 0x1629, 0x0000 },

+  { 0x0700, 0x162b, 0x0000 },

+  { 0x8700, 0x162e, 0x2000 },

+  { 0x0700, 0x162d, 0x0000 },

+  { 0x0700, 0x162f, 0x0000 },

+  { 0x8700, 0x1634, 0x3000 },

+  { 0x8700, 0x1632, 0x2000 },

+  { 0x0700, 0x1631, 0x0000 },

+  { 0x0700, 0x1633, 0x0000 },

+  { 0x8700, 0x1636, 0x2000 },

+  { 0x0700, 0x1635, 0x0000 },

+  { 0x0700, 0x1637, 0x0000 },

+  { 0x8700, 0x1648, 0x5000 },

+  { 0x8700, 0x1640, 0x4000 },

+  { 0x8700, 0x163c, 0x3000 },

+  { 0x8700, 0x163a, 0x2000 },

+  { 0x0700, 0x1639, 0x0000 },

+  { 0x0700, 0x163b, 0x0000 },

+  { 0x8700, 0x163e, 0x2000 },

+  { 0x0700, 0x163d, 0x0000 },

+  { 0x0700, 0x163f, 0x0000 },

+  { 0x8700, 0x1644, 0x3000 },

+  { 0x8700, 0x1642, 0x2000 },

+  { 0x0700, 0x1641, 0x0000 },

+  { 0x0700, 0x1643, 0x0000 },

+  { 0x8700, 0x1646, 0x2000 },

+  { 0x0700, 0x1645, 0x0000 },

+  { 0x0700, 0x1647, 0x0000 },

+  { 0x8700, 0x1650, 0x4000 },

+  { 0x8700, 0x164c, 0x3000 },

+  { 0x8700, 0x164a, 0x2000 },

+  { 0x0700, 0x1649, 0x0000 },

+  { 0x0700, 0x164b, 0x0000 },

+  { 0x8700, 0x164e, 0x2000 },

+  { 0x0700, 0x164d, 0x0000 },

+  { 0x0700, 0x164f, 0x0000 },

+  { 0x8700, 0x1654, 0x3000 },

+  { 0x8700, 0x1652, 0x2000 },

+  { 0x0700, 0x1651, 0x0000 },

+  { 0x0700, 0x1653, 0x0000 },

+  { 0x8700, 0x1656, 0x2000 },

+  { 0x0700, 0x1655, 0x0000 },

+  { 0x0700, 0x1657, 0x0000 },

+  { 0x8700, 0x16e4, 0x8000 },

+  { 0x8700, 0x16a4, 0x7000 },

+  { 0x8700, 0x1681, 0x6000 },

+  { 0x8700, 0x1668, 0x5000 },

+  { 0x8700, 0x1660, 0x4000 },

+  { 0x8700, 0x165c, 0x3000 },

+  { 0x8700, 0x165a, 0x2000 },

+  { 0x0700, 0x1659, 0x0000 },

+  { 0x0700, 0x165b, 0x0000 },

+  { 0x8700, 0x165e, 0x2000 },

+  { 0x0700, 0x165d, 0x0000 },

+  { 0x0700, 0x165f, 0x0000 },

+  { 0x8700, 0x1664, 0x3000 },

+  { 0x8700, 0x1662, 0x2000 },

+  { 0x0700, 0x1661, 0x0000 },

+  { 0x0700, 0x1663, 0x0000 },

+  { 0x8700, 0x1666, 0x2000 },

+  { 0x0700, 0x1665, 0x0000 },

+  { 0x0700, 0x1667, 0x0000 },

+  { 0x8700, 0x1670, 0x4000 },

+  { 0x8700, 0x166c, 0x3000 },

+  { 0x8700, 0x166a, 0x2000 },

+  { 0x0700, 0x1669, 0x0000 },

+  { 0x0700, 0x166b, 0x0000 },

+  { 0x9500, 0x166e, 0x2000 },

+  { 0x1500, 0x166d, 0x0000 },

+  { 0x0700, 0x166f, 0x0000 },

+  { 0x8700, 0x1674, 0x3000 },

+  { 0x8700, 0x1672, 0x2000 },

+  { 0x0700, 0x1671, 0x0000 },

+  { 0x0700, 0x1673, 0x0000 },

+  { 0x8700, 0x1676, 0x2000 },

+  { 0x0700, 0x1675, 0x0000 },

+  { 0x1d00, 0x1680, 0x0000 },

+  { 0x8700, 0x1691, 0x5000 },

+  { 0x8700, 0x1689, 0x4000 },

+  { 0x8700, 0x1685, 0x3000 },

+  { 0x8700, 0x1683, 0x2000 },

+  { 0x0700, 0x1682, 0x0000 },

+  { 0x0700, 0x1684, 0x0000 },

+  { 0x8700, 0x1687, 0x2000 },

+  { 0x0700, 0x1686, 0x0000 },

+  { 0x0700, 0x1688, 0x0000 },

+  { 0x8700, 0x168d, 0x3000 },

+  { 0x8700, 0x168b, 0x2000 },

+  { 0x0700, 0x168a, 0x0000 },

+  { 0x0700, 0x168c, 0x0000 },

+  { 0x8700, 0x168f, 0x2000 },

+  { 0x0700, 0x168e, 0x0000 },

+  { 0x0700, 0x1690, 0x0000 },

+  { 0x8700, 0x1699, 0x4000 },

+  { 0x8700, 0x1695, 0x3000 },

+  { 0x8700, 0x1693, 0x2000 },

+  { 0x0700, 0x1692, 0x0000 },

+  { 0x0700, 0x1694, 0x0000 },

+  { 0x8700, 0x1697, 0x2000 },

+  { 0x0700, 0x1696, 0x0000 },

+  { 0x0700, 0x1698, 0x0000 },

+  { 0x8700, 0x16a0, 0x3000 },

+  { 0x9600, 0x169b, 0x2000 },

+  { 0x0700, 0x169a, 0x0000 },

+  { 0x1200, 0x169c, 0x0000 },

+  { 0x8700, 0x16a2, 0x2000 },

+  { 0x0700, 0x16a1, 0x0000 },

+  { 0x0700, 0x16a3, 0x0000 },

+  { 0x8700, 0x16c4, 0x6000 },

+  { 0x8700, 0x16b4, 0x5000 },

+  { 0x8700, 0x16ac, 0x4000 },

+  { 0x8700, 0x16a8, 0x3000 },

+  { 0x8700, 0x16a6, 0x2000 },

+  { 0x0700, 0x16a5, 0x0000 },

+  { 0x0700, 0x16a7, 0x0000 },

+  { 0x8700, 0x16aa, 0x2000 },

+  { 0x0700, 0x16a9, 0x0000 },

+  { 0x0700, 0x16ab, 0x0000 },

+  { 0x8700, 0x16b0, 0x3000 },

+  { 0x8700, 0x16ae, 0x2000 },

+  { 0x0700, 0x16ad, 0x0000 },

+  { 0x0700, 0x16af, 0x0000 },

+  { 0x8700, 0x16b2, 0x2000 },

+  { 0x0700, 0x16b1, 0x0000 },

+  { 0x0700, 0x16b3, 0x0000 },

+  { 0x8700, 0x16bc, 0x4000 },

+  { 0x8700, 0x16b8, 0x3000 },

+  { 0x8700, 0x16b6, 0x2000 },

+  { 0x0700, 0x16b5, 0x0000 },

+  { 0x0700, 0x16b7, 0x0000 },

+  { 0x8700, 0x16ba, 0x2000 },

+  { 0x0700, 0x16b9, 0x0000 },

+  { 0x0700, 0x16bb, 0x0000 },

+  { 0x8700, 0x16c0, 0x3000 },

+  { 0x8700, 0x16be, 0x2000 },

+  { 0x0700, 0x16bd, 0x0000 },

+  { 0x0700, 0x16bf, 0x0000 },

+  { 0x8700, 0x16c2, 0x2000 },

+  { 0x0700, 0x16c1, 0x0000 },

+  { 0x0700, 0x16c3, 0x0000 },

+  { 0x8700, 0x16d4, 0x5000 },

+  { 0x8700, 0x16cc, 0x4000 },

+  { 0x8700, 0x16c8, 0x3000 },

+  { 0x8700, 0x16c6, 0x2000 },

+  { 0x0700, 0x16c5, 0x0000 },

+  { 0x0700, 0x16c7, 0x0000 },

+  { 0x8700, 0x16ca, 0x2000 },

+  { 0x0700, 0x16c9, 0x0000 },

+  { 0x0700, 0x16cb, 0x0000 },

+  { 0x8700, 0x16d0, 0x3000 },

+  { 0x8700, 0x16ce, 0x2000 },

+  { 0x0700, 0x16cd, 0x0000 },

+  { 0x0700, 0x16cf, 0x0000 },

+  { 0x8700, 0x16d2, 0x2000 },

+  { 0x0700, 0x16d1, 0x0000 },

+  { 0x0700, 0x16d3, 0x0000 },

+  { 0x8700, 0x16dc, 0x4000 },

+  { 0x8700, 0x16d8, 0x3000 },

+  { 0x8700, 0x16d6, 0x2000 },

+  { 0x0700, 0x16d5, 0x0000 },

+  { 0x0700, 0x16d7, 0x0000 },

+  { 0x8700, 0x16da, 0x2000 },

+  { 0x0700, 0x16d9, 0x0000 },

+  { 0x0700, 0x16db, 0x0000 },

+  { 0x8700, 0x16e0, 0x3000 },

+  { 0x8700, 0x16de, 0x2000 },

+  { 0x0700, 0x16dd, 0x0000 },

+  { 0x0700, 0x16df, 0x0000 },

+  { 0x8700, 0x16e2, 0x2000 },

+  { 0x0700, 0x16e1, 0x0000 },

+  { 0x0700, 0x16e3, 0x0000 },

+  { 0x8700, 0x1748, 0x7000 },

+  { 0x8c00, 0x1714, 0x6000 },

+  { 0x8700, 0x1703, 0x5000 },

+  { 0x9500, 0x16ec, 0x4000 },

+  { 0x8700, 0x16e8, 0x3000 },

+  { 0x8700, 0x16e6, 0x2000 },

+  { 0x0700, 0x16e5, 0x0000 },

+  { 0x0700, 0x16e7, 0x0000 },

+  { 0x8700, 0x16ea, 0x2000 },

+  { 0x0700, 0x16e9, 0x0000 },

+  { 0x1500, 0x16eb, 0x0000 },

+  { 0x8e00, 0x16f0, 0x3000 },

+  { 0x8e00, 0x16ee, 0x2000 },

+  { 0x1500, 0x16ed, 0x0000 },

+  { 0x0e00, 0x16ef, 0x0000 },

+  { 0x8700, 0x1701, 0x2000 },

+  { 0x0700, 0x1700, 0x0000 },

+  { 0x0700, 0x1702, 0x0000 },

+  { 0x8700, 0x170b, 0x4000 },

+  { 0x8700, 0x1707, 0x3000 },

+  { 0x8700, 0x1705, 0x2000 },

+  { 0x0700, 0x1704, 0x0000 },

+  { 0x0700, 0x1706, 0x0000 },

+  { 0x8700, 0x1709, 0x2000 },

+  { 0x0700, 0x1708, 0x0000 },

+  { 0x0700, 0x170a, 0x0000 },

+  { 0x8700, 0x1710, 0x3000 },

+  { 0x8700, 0x170e, 0x2000 },

+  { 0x0700, 0x170c, 0x0000 },

+  { 0x0700, 0x170f, 0x0000 },

+  { 0x8c00, 0x1712, 0x2000 },

+  { 0x0700, 0x1711, 0x0000 },

+  { 0x0c00, 0x1713, 0x0000 },

+  { 0x8700, 0x172f, 0x5000 },

+  { 0x8700, 0x1727, 0x4000 },

+  { 0x8700, 0x1723, 0x3000 },

+  { 0x8700, 0x1721, 0x2000 },

+  { 0x0700, 0x1720, 0x0000 },

+  { 0x0700, 0x1722, 0x0000 },

+  { 0x8700, 0x1725, 0x2000 },

+  { 0x0700, 0x1724, 0x0000 },

+  { 0x0700, 0x1726, 0x0000 },

+  { 0x8700, 0x172b, 0x3000 },

+  { 0x8700, 0x1729, 0x2000 },

+  { 0x0700, 0x1728, 0x0000 },

+  { 0x0700, 0x172a, 0x0000 },

+  { 0x8700, 0x172d, 0x2000 },

+  { 0x0700, 0x172c, 0x0000 },

+  { 0x0700, 0x172e, 0x0000 },

+  { 0x8700, 0x1740, 0x4000 },

+  { 0x8c00, 0x1733, 0x3000 },

+  { 0x8700, 0x1731, 0x2000 },

+  { 0x0700, 0x1730, 0x0000 },

+  { 0x0c00, 0x1732, 0x0000 },

+  { 0x9500, 0x1735, 0x2000 },

+  { 0x0c00, 0x1734, 0x0000 },

+  { 0x1500, 0x1736, 0x0000 },

+  { 0x8700, 0x1744, 0x3000 },

+  { 0x8700, 0x1742, 0x2000 },

+  { 0x0700, 0x1741, 0x0000 },

+  { 0x0700, 0x1743, 0x0000 },

+  { 0x8700, 0x1746, 0x2000 },

+  { 0x0700, 0x1745, 0x0000 },

+  { 0x0700, 0x1747, 0x0000 },

+  { 0x8700, 0x1782, 0x6000 },

+  { 0x8700, 0x1764, 0x5000 },

+  { 0x8700, 0x1750, 0x4000 },

+  { 0x8700, 0x174c, 0x3000 },

+  { 0x8700, 0x174a, 0x2000 },

+  { 0x0700, 0x1749, 0x0000 },

+  { 0x0700, 0x174b, 0x0000 },

+  { 0x8700, 0x174e, 0x2000 },

+  { 0x0700, 0x174d, 0x0000 },

+  { 0x0700, 0x174f, 0x0000 },

+  { 0x8700, 0x1760, 0x3000 },

+  { 0x8c00, 0x1752, 0x2000 },

+  { 0x0700, 0x1751, 0x0000 },

+  { 0x0c00, 0x1753, 0x0000 },

+  { 0x8700, 0x1762, 0x2000 },

+  { 0x0700, 0x1761, 0x0000 },

+  { 0x0700, 0x1763, 0x0000 },

+  { 0x8700, 0x176c, 0x4000 },

+  { 0x8700, 0x1768, 0x3000 },

+  { 0x8700, 0x1766, 0x2000 },

+  { 0x0700, 0x1765, 0x0000 },

+  { 0x0700, 0x1767, 0x0000 },

+  { 0x8700, 0x176a, 0x2000 },

+  { 0x0700, 0x1769, 0x0000 },

+  { 0x0700, 0x176b, 0x0000 },

+  { 0x8c00, 0x1772, 0x3000 },

+  { 0x8700, 0x176f, 0x2000 },

+  { 0x0700, 0x176e, 0x0000 },

+  { 0x0700, 0x1770, 0x0000 },

+  { 0x8700, 0x1780, 0x2000 },

+  { 0x0c00, 0x1773, 0x0000 },

+  { 0x0700, 0x1781, 0x0000 },

+  { 0x8700, 0x1792, 0x5000 },

+  { 0x8700, 0x178a, 0x4000 },

+  { 0x8700, 0x1786, 0x3000 },

+  { 0x8700, 0x1784, 0x2000 },

+  { 0x0700, 0x1783, 0x0000 },

+  { 0x0700, 0x1785, 0x0000 },

+  { 0x8700, 0x1788, 0x2000 },

+  { 0x0700, 0x1787, 0x0000 },

+  { 0x0700, 0x1789, 0x0000 },

+  { 0x8700, 0x178e, 0x3000 },

+  { 0x8700, 0x178c, 0x2000 },

+  { 0x0700, 0x178b, 0x0000 },

+  { 0x0700, 0x178d, 0x0000 },

+  { 0x8700, 0x1790, 0x2000 },

+  { 0x0700, 0x178f, 0x0000 },

+  { 0x0700, 0x1791, 0x0000 },

+  { 0x8700, 0x179a, 0x4000 },

+  { 0x8700, 0x1796, 0x3000 },

+  { 0x8700, 0x1794, 0x2000 },

+  { 0x0700, 0x1793, 0x0000 },

+  { 0x0700, 0x1795, 0x0000 },

+  { 0x8700, 0x1798, 0x2000 },

+  { 0x0700, 0x1797, 0x0000 },

+  { 0x0700, 0x1799, 0x0000 },

+  { 0x8700, 0x179e, 0x3000 },

+  { 0x8700, 0x179c, 0x2000 },

+  { 0x0700, 0x179b, 0x0000 },

+  { 0x0700, 0x179d, 0x0000 },

+  { 0x8700, 0x17a0, 0x2000 },

+  { 0x0700, 0x179f, 0x0000 },

+  { 0x0700, 0x17a1, 0x0000 },

+  { 0x8700, 0x1915, 0x9000 },

+  { 0x8700, 0x1837, 0x8000 },

+  { 0x8d00, 0x17e4, 0x7000 },

+  { 0x8a00, 0x17c2, 0x6000 },

+  { 0x8700, 0x17b2, 0x5000 },

+  { 0x8700, 0x17aa, 0x4000 },

+  { 0x8700, 0x17a6, 0x3000 },

+  { 0x8700, 0x17a4, 0x2000 },

+  { 0x0700, 0x17a3, 0x0000 },

+  { 0x0700, 0x17a5, 0x0000 },

+  { 0x8700, 0x17a8, 0x2000 },

+  { 0x0700, 0x17a7, 0x0000 },

+  { 0x0700, 0x17a9, 0x0000 },

+  { 0x8700, 0x17ae, 0x3000 },

+  { 0x8700, 0x17ac, 0x2000 },

+  { 0x0700, 0x17ab, 0x0000 },

+  { 0x0700, 0x17ad, 0x0000 },

+  { 0x8700, 0x17b0, 0x2000 },

+  { 0x0700, 0x17af, 0x0000 },

+  { 0x0700, 0x17b1, 0x0000 },

+  { 0x8c00, 0x17ba, 0x4000 },

+  { 0x8a00, 0x17b6, 0x3000 },

+  { 0x8100, 0x17b4, 0x2000 },

+  { 0x0700, 0x17b3, 0x0000 },

+  { 0x0100, 0x17b5, 0x0000 },

+  { 0x8c00, 0x17b8, 0x2000 },

+  { 0x0c00, 0x17b7, 0x0000 },

+  { 0x0c00, 0x17b9, 0x0000 },

+  { 0x8a00, 0x17be, 0x3000 },

+  { 0x8c00, 0x17bc, 0x2000 },

+  { 0x0c00, 0x17bb, 0x0000 },

+  { 0x0c00, 0x17bd, 0x0000 },

+  { 0x8a00, 0x17c0, 0x2000 },

+  { 0x0a00, 0x17bf, 0x0000 },

+  { 0x0a00, 0x17c1, 0x0000 },

+  { 0x8c00, 0x17d2, 0x5000 },

+  { 0x8c00, 0x17ca, 0x4000 },

+  { 0x8c00, 0x17c6, 0x3000 },

+  { 0x8a00, 0x17c4, 0x2000 },

+  { 0x0a00, 0x17c3, 0x0000 },

+  { 0x0a00, 0x17c5, 0x0000 },

+  { 0x8a00, 0x17c8, 0x2000 },

+  { 0x0a00, 0x17c7, 0x0000 },

+  { 0x0c00, 0x17c9, 0x0000 },

+  { 0x8c00, 0x17ce, 0x3000 },

+  { 0x8c00, 0x17cc, 0x2000 },

+  { 0x0c00, 0x17cb, 0x0000 },

+  { 0x0c00, 0x17cd, 0x0000 },

+  { 0x8c00, 0x17d0, 0x2000 },

+  { 0x0c00, 0x17cf, 0x0000 },

+  { 0x0c00, 0x17d1, 0x0000 },

+  { 0x9500, 0x17da, 0x4000 },

+  { 0x9500, 0x17d6, 0x3000 },

+  { 0x9500, 0x17d4, 0x2000 },

+  { 0x0c00, 0x17d3, 0x0000 },

+  { 0x1500, 0x17d5, 0x0000 },

+  { 0x9500, 0x17d8, 0x2000 },

+  { 0x0600, 0x17d7, 0x0000 },

+  { 0x1500, 0x17d9, 0x0000 },

+  { 0x8d00, 0x17e0, 0x3000 },

+  { 0x8700, 0x17dc, 0x2000 },

+  { 0x1700, 0x17db, 0x0000 },

+  { 0x0c00, 0x17dd, 0x0000 },

+  { 0x8d00, 0x17e2, 0x2000 },

+  { 0x0d00, 0x17e1, 0x0000 },

+  { 0x0d00, 0x17e3, 0x0000 },

+  { 0x8d00, 0x1811, 0x6000 },

+  { 0x9500, 0x1800, 0x5000 },

+  { 0x8f00, 0x17f2, 0x4000 },

+  { 0x8d00, 0x17e8, 0x3000 },

+  { 0x8d00, 0x17e6, 0x2000 },

+  { 0x0d00, 0x17e5, 0x0000 },

+  { 0x0d00, 0x17e7, 0x0000 },

+  { 0x8f00, 0x17f0, 0x2000 },

+  { 0x0d00, 0x17e9, 0x0000 },

+  { 0x0f00, 0x17f1, 0x0000 },

+  { 0x8f00, 0x17f6, 0x3000 },

+  { 0x8f00, 0x17f4, 0x2000 },

+  { 0x0f00, 0x17f3, 0x0000 },

+  { 0x0f00, 0x17f5, 0x0000 },

+  { 0x8f00, 0x17f8, 0x2000 },

+  { 0x0f00, 0x17f7, 0x0000 },

+  { 0x0f00, 0x17f9, 0x0000 },

+  { 0x9500, 0x1808, 0x4000 },

+  { 0x9500, 0x1804, 0x3000 },

+  { 0x9500, 0x1802, 0x2000 },

+  { 0x1500, 0x1801, 0x0000 },

+  { 0x1500, 0x1803, 0x0000 },

+  { 0x9100, 0x1806, 0x2000 },

+  { 0x1500, 0x1805, 0x0000 },

+  { 0x1500, 0x1807, 0x0000 },

+  { 0x8c00, 0x180c, 0x3000 },

+  { 0x9500, 0x180a, 0x2000 },

+  { 0x1500, 0x1809, 0x0000 },

+  { 0x0c00, 0x180b, 0x0000 },

+  { 0x9d00, 0x180e, 0x2000 },

+  { 0x0c00, 0x180d, 0x0000 },

+  { 0x0d00, 0x1810, 0x0000 },

+  { 0x8700, 0x1827, 0x5000 },

+  { 0x8d00, 0x1819, 0x4000 },

+  { 0x8d00, 0x1815, 0x3000 },

+  { 0x8d00, 0x1813, 0x2000 },

+  { 0x0d00, 0x1812, 0x0000 },

+  { 0x0d00, 0x1814, 0x0000 },

+  { 0x8d00, 0x1817, 0x2000 },

+  { 0x0d00, 0x1816, 0x0000 },

+  { 0x0d00, 0x1818, 0x0000 },

+  { 0x8700, 0x1823, 0x3000 },

+  { 0x8700, 0x1821, 0x2000 },

+  { 0x0700, 0x1820, 0x0000 },

+  { 0x0700, 0x1822, 0x0000 },

+  { 0x8700, 0x1825, 0x2000 },

+  { 0x0700, 0x1824, 0x0000 },

+  { 0x0700, 0x1826, 0x0000 },

+  { 0x8700, 0x182f, 0x4000 },

+  { 0x8700, 0x182b, 0x3000 },

+  { 0x8700, 0x1829, 0x2000 },

+  { 0x0700, 0x1828, 0x0000 },

+  { 0x0700, 0x182a, 0x0000 },

+  { 0x8700, 0x182d, 0x2000 },

+  { 0x0700, 0x182c, 0x0000 },

+  { 0x0700, 0x182e, 0x0000 },

+  { 0x8700, 0x1833, 0x3000 },

+  { 0x8700, 0x1831, 0x2000 },

+  { 0x0700, 0x1830, 0x0000 },

+  { 0x0700, 0x1832, 0x0000 },

+  { 0x8700, 0x1835, 0x2000 },

+  { 0x0700, 0x1834, 0x0000 },

+  { 0x0700, 0x1836, 0x0000 },

+  { 0x8700, 0x1877, 0x7000 },

+  { 0x8700, 0x1857, 0x6000 },

+  { 0x8700, 0x1847, 0x5000 },

+  { 0x8700, 0x183f, 0x4000 },

+  { 0x8700, 0x183b, 0x3000 },

+  { 0x8700, 0x1839, 0x2000 },

+  { 0x0700, 0x1838, 0x0000 },

+  { 0x0700, 0x183a, 0x0000 },

+  { 0x8700, 0x183d, 0x2000 },

+  { 0x0700, 0x183c, 0x0000 },

+  { 0x0700, 0x183e, 0x0000 },

+  { 0x8600, 0x1843, 0x3000 },

+  { 0x8700, 0x1841, 0x2000 },

+  { 0x0700, 0x1840, 0x0000 },

+  { 0x0700, 0x1842, 0x0000 },

+  { 0x8700, 0x1845, 0x2000 },

+  { 0x0700, 0x1844, 0x0000 },

+  { 0x0700, 0x1846, 0x0000 },

+  { 0x8700, 0x184f, 0x4000 },

+  { 0x8700, 0x184b, 0x3000 },

+  { 0x8700, 0x1849, 0x2000 },

+  { 0x0700, 0x1848, 0x0000 },

+  { 0x0700, 0x184a, 0x0000 },

+  { 0x8700, 0x184d, 0x2000 },

+  { 0x0700, 0x184c, 0x0000 },

+  { 0x0700, 0x184e, 0x0000 },

+  { 0x8700, 0x1853, 0x3000 },

+  { 0x8700, 0x1851, 0x2000 },

+  { 0x0700, 0x1850, 0x0000 },

+  { 0x0700, 0x1852, 0x0000 },

+  { 0x8700, 0x1855, 0x2000 },

+  { 0x0700, 0x1854, 0x0000 },

+  { 0x0700, 0x1856, 0x0000 },

+  { 0x8700, 0x1867, 0x5000 },

+  { 0x8700, 0x185f, 0x4000 },

+  { 0x8700, 0x185b, 0x3000 },

+  { 0x8700, 0x1859, 0x2000 },

+  { 0x0700, 0x1858, 0x0000 },

+  { 0x0700, 0x185a, 0x0000 },

+  { 0x8700, 0x185d, 0x2000 },

+  { 0x0700, 0x185c, 0x0000 },

+  { 0x0700, 0x185e, 0x0000 },

+  { 0x8700, 0x1863, 0x3000 },

+  { 0x8700, 0x1861, 0x2000 },

+  { 0x0700, 0x1860, 0x0000 },

+  { 0x0700, 0x1862, 0x0000 },

+  { 0x8700, 0x1865, 0x2000 },

+  { 0x0700, 0x1864, 0x0000 },

+  { 0x0700, 0x1866, 0x0000 },

+  { 0x8700, 0x186f, 0x4000 },

+  { 0x8700, 0x186b, 0x3000 },

+  { 0x8700, 0x1869, 0x2000 },

+  { 0x0700, 0x1868, 0x0000 },

+  { 0x0700, 0x186a, 0x0000 },

+  { 0x8700, 0x186d, 0x2000 },

+  { 0x0700, 0x186c, 0x0000 },

+  { 0x0700, 0x186e, 0x0000 },

+  { 0x8700, 0x1873, 0x3000 },

+  { 0x8700, 0x1871, 0x2000 },

+  { 0x0700, 0x1870, 0x0000 },

+  { 0x0700, 0x1872, 0x0000 },

+  { 0x8700, 0x1875, 0x2000 },

+  { 0x0700, 0x1874, 0x0000 },

+  { 0x0700, 0x1876, 0x0000 },

+  { 0x8700, 0x189f, 0x6000 },

+  { 0x8700, 0x188f, 0x5000 },

+  { 0x8700, 0x1887, 0x4000 },

+  { 0x8700, 0x1883, 0x3000 },

+  { 0x8700, 0x1881, 0x2000 },

+  { 0x0700, 0x1880, 0x0000 },

+  { 0x0700, 0x1882, 0x0000 },

+  { 0x8700, 0x1885, 0x2000 },

+  { 0x0700, 0x1884, 0x0000 },

+  { 0x0700, 0x1886, 0x0000 },

+  { 0x8700, 0x188b, 0x3000 },

+  { 0x8700, 0x1889, 0x2000 },

+  { 0x0700, 0x1888, 0x0000 },

+  { 0x0700, 0x188a, 0x0000 },

+  { 0x8700, 0x188d, 0x2000 },

+  { 0x0700, 0x188c, 0x0000 },

+  { 0x0700, 0x188e, 0x0000 },

+  { 0x8700, 0x1897, 0x4000 },

+  { 0x8700, 0x1893, 0x3000 },

+  { 0x8700, 0x1891, 0x2000 },

+  { 0x0700, 0x1890, 0x0000 },

+  { 0x0700, 0x1892, 0x0000 },

+  { 0x8700, 0x1895, 0x2000 },

+  { 0x0700, 0x1894, 0x0000 },

+  { 0x0700, 0x1896, 0x0000 },

+  { 0x8700, 0x189b, 0x3000 },

+  { 0x8700, 0x1899, 0x2000 },

+  { 0x0700, 0x1898, 0x0000 },

+  { 0x0700, 0x189a, 0x0000 },

+  { 0x8700, 0x189d, 0x2000 },

+  { 0x0700, 0x189c, 0x0000 },

+  { 0x0700, 0x189e, 0x0000 },

+  { 0x8700, 0x1905, 0x5000 },

+  { 0x8700, 0x18a7, 0x4000 },

+  { 0x8700, 0x18a3, 0x3000 },

+  { 0x8700, 0x18a1, 0x2000 },

+  { 0x0700, 0x18a0, 0x0000 },

+  { 0x0700, 0x18a2, 0x0000 },

+  { 0x8700, 0x18a5, 0x2000 },

+  { 0x0700, 0x18a4, 0x0000 },

+  { 0x0700, 0x18a6, 0x0000 },

+  { 0x8700, 0x1901, 0x3000 },

+  { 0x8c00, 0x18a9, 0x2000 },

+  { 0x0700, 0x18a8, 0x0000 },

+  { 0x0700, 0x1900, 0x0000 },

+  { 0x8700, 0x1903, 0x2000 },

+  { 0x0700, 0x1902, 0x0000 },

+  { 0x0700, 0x1904, 0x0000 },

+  { 0x8700, 0x190d, 0x4000 },

+  { 0x8700, 0x1909, 0x3000 },

+  { 0x8700, 0x1907, 0x2000 },

+  { 0x0700, 0x1906, 0x0000 },

+  { 0x0700, 0x1908, 0x0000 },

+  { 0x8700, 0x190b, 0x2000 },

+  { 0x0700, 0x190a, 0x0000 },

+  { 0x0700, 0x190c, 0x0000 },

+  { 0x8700, 0x1911, 0x3000 },

+  { 0x8700, 0x190f, 0x2000 },

+  { 0x0700, 0x190e, 0x0000 },

+  { 0x0700, 0x1910, 0x0000 },

+  { 0x8700, 0x1913, 0x2000 },

+  { 0x0700, 0x1912, 0x0000 },

+  { 0x0700, 0x1914, 0x0000 },

+  { 0x8500, 0x1d10, 0x8000 },

+  { 0x8700, 0x1963, 0x7000 },

+  { 0x9a00, 0x1940, 0x6000 },

+  { 0x8c00, 0x1928, 0x5000 },

+  { 0x8c00, 0x1920, 0x4000 },

+  { 0x8700, 0x1919, 0x3000 },

+  { 0x8700, 0x1917, 0x2000 },

+  { 0x0700, 0x1916, 0x0000 },

+  { 0x0700, 0x1918, 0x0000 },

+  { 0x8700, 0x191b, 0x2000 },

+  { 0x0700, 0x191a, 0x0000 },

+  { 0x0700, 0x191c, 0x0000 },

+  { 0x8a00, 0x1924, 0x3000 },

+  { 0x8c00, 0x1922, 0x2000 },

+  { 0x0c00, 0x1921, 0x0000 },

+  { 0x0a00, 0x1923, 0x0000 },

+  { 0x8a00, 0x1926, 0x2000 },

+  { 0x0a00, 0x1925, 0x0000 },

+  { 0x0c00, 0x1927, 0x0000 },

+  { 0x8a00, 0x1934, 0x4000 },

+  { 0x8a00, 0x1930, 0x3000 },

+  { 0x8a00, 0x192a, 0x2000 },

+  { 0x0a00, 0x1929, 0x0000 },

+  { 0x0a00, 0x192b, 0x0000 },

+  { 0x8c00, 0x1932, 0x2000 },

+  { 0x0a00, 0x1931, 0x0000 },

+  { 0x0a00, 0x1933, 0x0000 },

+  { 0x8a00, 0x1938, 0x3000 },

+  { 0x8a00, 0x1936, 0x2000 },

+  { 0x0a00, 0x1935, 0x0000 },

+  { 0x0a00, 0x1937, 0x0000 },

+  { 0x8c00, 0x193a, 0x2000 },

+  { 0x0c00, 0x1939, 0x0000 },

+  { 0x0c00, 0x193b, 0x0000 },

+  { 0x8700, 0x1953, 0x5000 },

+  { 0x8d00, 0x194b, 0x4000 },

+  { 0x8d00, 0x1947, 0x3000 },

+  { 0x9500, 0x1945, 0x2000 },

+  { 0x1500, 0x1944, 0x0000 },

+  { 0x0d00, 0x1946, 0x0000 },

+  { 0x8d00, 0x1949, 0x2000 },

+  { 0x0d00, 0x1948, 0x0000 },

+  { 0x0d00, 0x194a, 0x0000 },

+  { 0x8d00, 0x194f, 0x3000 },

+  { 0x8d00, 0x194d, 0x2000 },

+  { 0x0d00, 0x194c, 0x0000 },

+  { 0x0d00, 0x194e, 0x0000 },

+  { 0x8700, 0x1951, 0x2000 },

+  { 0x0700, 0x1950, 0x0000 },

+  { 0x0700, 0x1952, 0x0000 },

+  { 0x8700, 0x195b, 0x4000 },

+  { 0x8700, 0x1957, 0x3000 },

+  { 0x8700, 0x1955, 0x2000 },

+  { 0x0700, 0x1954, 0x0000 },

+  { 0x0700, 0x1956, 0x0000 },

+  { 0x8700, 0x1959, 0x2000 },

+  { 0x0700, 0x1958, 0x0000 },

+  { 0x0700, 0x195a, 0x0000 },

+  { 0x8700, 0x195f, 0x3000 },

+  { 0x8700, 0x195d, 0x2000 },

+  { 0x0700, 0x195c, 0x0000 },

+  { 0x0700, 0x195e, 0x0000 },

+  { 0x8700, 0x1961, 0x2000 },

+  { 0x0700, 0x1960, 0x0000 },

+  { 0x0700, 0x1962, 0x0000 },

+  { 0x9a00, 0x19f0, 0x6000 },

+  { 0x9a00, 0x19e0, 0x5000 },

+  { 0x8700, 0x196b, 0x4000 },

+  { 0x8700, 0x1967, 0x3000 },

+  { 0x8700, 0x1965, 0x2000 },

+  { 0x0700, 0x1964, 0x0000 },

+  { 0x0700, 0x1966, 0x0000 },

+  { 0x8700, 0x1969, 0x2000 },

+  { 0x0700, 0x1968, 0x0000 },

+  { 0x0700, 0x196a, 0x0000 },

+  { 0x8700, 0x1971, 0x3000 },

+  { 0x8700, 0x196d, 0x2000 },

+  { 0x0700, 0x196c, 0x0000 },

+  { 0x0700, 0x1970, 0x0000 },

+  { 0x8700, 0x1973, 0x2000 },

+  { 0x0700, 0x1972, 0x0000 },

+  { 0x0700, 0x1974, 0x0000 },

+  { 0x9a00, 0x19e8, 0x4000 },

+  { 0x9a00, 0x19e4, 0x3000 },

+  { 0x9a00, 0x19e2, 0x2000 },

+  { 0x1a00, 0x19e1, 0x0000 },

+  { 0x1a00, 0x19e3, 0x0000 },

+  { 0x9a00, 0x19e6, 0x2000 },

+  { 0x1a00, 0x19e5, 0x0000 },

+  { 0x1a00, 0x19e7, 0x0000 },

+  { 0x9a00, 0x19ec, 0x3000 },

+  { 0x9a00, 0x19ea, 0x2000 },

+  { 0x1a00, 0x19e9, 0x0000 },

+  { 0x1a00, 0x19eb, 0x0000 },

+  { 0x9a00, 0x19ee, 0x2000 },

+  { 0x1a00, 0x19ed, 0x0000 },

+  { 0x1a00, 0x19ef, 0x0000 },

+  { 0x8500, 0x1d00, 0x5000 },

+  { 0x9a00, 0x19f8, 0x4000 },

+  { 0x9a00, 0x19f4, 0x3000 },

+  { 0x9a00, 0x19f2, 0x2000 },

+  { 0x1a00, 0x19f1, 0x0000 },

+  { 0x1a00, 0x19f3, 0x0000 },

+  { 0x9a00, 0x19f6, 0x2000 },

+  { 0x1a00, 0x19f5, 0x0000 },

+  { 0x1a00, 0x19f7, 0x0000 },

+  { 0x9a00, 0x19fc, 0x3000 },

+  { 0x9a00, 0x19fa, 0x2000 },

+  { 0x1a00, 0x19f9, 0x0000 },

+  { 0x1a00, 0x19fb, 0x0000 },

+  { 0x9a00, 0x19fe, 0x2000 },

+  { 0x1a00, 0x19fd, 0x0000 },

+  { 0x1a00, 0x19ff, 0x0000 },

+  { 0x8500, 0x1d08, 0x4000 },

+  { 0x8500, 0x1d04, 0x3000 },

+  { 0x8500, 0x1d02, 0x2000 },

+  { 0x0500, 0x1d01, 0x0000 },

+  { 0x0500, 0x1d03, 0x0000 },

+  { 0x8500, 0x1d06, 0x2000 },

+  { 0x0500, 0x1d05, 0x0000 },

+  { 0x0500, 0x1d07, 0x0000 },

+  { 0x8500, 0x1d0c, 0x3000 },

+  { 0x8500, 0x1d0a, 0x2000 },

+  { 0x0500, 0x1d09, 0x0000 },

+  { 0x0500, 0x1d0b, 0x0000 },

+  { 0x8500, 0x1d0e, 0x2000 },

+  { 0x0500, 0x1d0d, 0x0000 },

+  { 0x0500, 0x1d0f, 0x0000 },

+  { 0x8600, 0x1d50, 0x7000 },

+  { 0x8600, 0x1d30, 0x6000 },

+  { 0x8500, 0x1d20, 0x5000 },

+  { 0x8500, 0x1d18, 0x4000 },

+  { 0x8500, 0x1d14, 0x3000 },

+  { 0x8500, 0x1d12, 0x2000 },

+  { 0x0500, 0x1d11, 0x0000 },

+  { 0x0500, 0x1d13, 0x0000 },

+  { 0x8500, 0x1d16, 0x2000 },

+  { 0x0500, 0x1d15, 0x0000 },

+  { 0x0500, 0x1d17, 0x0000 },

+  { 0x8500, 0x1d1c, 0x3000 },

+  { 0x8500, 0x1d1a, 0x2000 },

+  { 0x0500, 0x1d19, 0x0000 },

+  { 0x0500, 0x1d1b, 0x0000 },

+  { 0x8500, 0x1d1e, 0x2000 },

+  { 0x0500, 0x1d1d, 0x0000 },

+  { 0x0500, 0x1d1f, 0x0000 },

+  { 0x8500, 0x1d28, 0x4000 },

+  { 0x8500, 0x1d24, 0x3000 },

+  { 0x8500, 0x1d22, 0x2000 },

+  { 0x0500, 0x1d21, 0x0000 },

+  { 0x0500, 0x1d23, 0x0000 },

+  { 0x8500, 0x1d26, 0x2000 },

+  { 0x0500, 0x1d25, 0x0000 },

+  { 0x0500, 0x1d27, 0x0000 },

+  { 0x8600, 0x1d2c, 0x3000 },

+  { 0x8500, 0x1d2a, 0x2000 },

+  { 0x0500, 0x1d29, 0x0000 },

+  { 0x0500, 0x1d2b, 0x0000 },

+  { 0x8600, 0x1d2e, 0x2000 },

+  { 0x0600, 0x1d2d, 0x0000 },

+  { 0x0600, 0x1d2f, 0x0000 },

+  { 0x8600, 0x1d40, 0x5000 },

+  { 0x8600, 0x1d38, 0x4000 },

+  { 0x8600, 0x1d34, 0x3000 },

+  { 0x8600, 0x1d32, 0x2000 },

+  { 0x0600, 0x1d31, 0x0000 },

+  { 0x0600, 0x1d33, 0x0000 },

+  { 0x8600, 0x1d36, 0x2000 },

+  { 0x0600, 0x1d35, 0x0000 },

+  { 0x0600, 0x1d37, 0x0000 },

+  { 0x8600, 0x1d3c, 0x3000 },

+  { 0x8600, 0x1d3a, 0x2000 },

+  { 0x0600, 0x1d39, 0x0000 },

+  { 0x0600, 0x1d3b, 0x0000 },

+  { 0x8600, 0x1d3e, 0x2000 },

+  { 0x0600, 0x1d3d, 0x0000 },

+  { 0x0600, 0x1d3f, 0x0000 },

+  { 0x8600, 0x1d48, 0x4000 },

+  { 0x8600, 0x1d44, 0x3000 },

+  { 0x8600, 0x1d42, 0x2000 },

+  { 0x0600, 0x1d41, 0x0000 },

+  { 0x0600, 0x1d43, 0x0000 },

+  { 0x8600, 0x1d46, 0x2000 },

+  { 0x0600, 0x1d45, 0x0000 },

+  { 0x0600, 0x1d47, 0x0000 },

+  { 0x8600, 0x1d4c, 0x3000 },

+  { 0x8600, 0x1d4a, 0x2000 },

+  { 0x0600, 0x1d49, 0x0000 },

+  { 0x0600, 0x1d4b, 0x0000 },

+  { 0x8600, 0x1d4e, 0x2000 },

+  { 0x0600, 0x1d4d, 0x0000 },

+  { 0x0600, 0x1d4f, 0x0000 },

+  { 0x8900, 0x1e04, 0x6001 },

+  { 0x8600, 0x1d60, 0x5000 },

+  { 0x8600, 0x1d58, 0x4000 },

+  { 0x8600, 0x1d54, 0x3000 },

+  { 0x8600, 0x1d52, 0x2000 },

+  { 0x0600, 0x1d51, 0x0000 },

+  { 0x0600, 0x1d53, 0x0000 },

+  { 0x8600, 0x1d56, 0x2000 },

+  { 0x0600, 0x1d55, 0x0000 },

+  { 0x0600, 0x1d57, 0x0000 },

+  { 0x8600, 0x1d5c, 0x3000 },

+  { 0x8600, 0x1d5a, 0x2000 },

+  { 0x0600, 0x1d59, 0x0000 },

+  { 0x0600, 0x1d5b, 0x0000 },

+  { 0x8600, 0x1d5e, 0x2000 },

+  { 0x0600, 0x1d5d, 0x0000 },

+  { 0x0600, 0x1d5f, 0x0000 },

+  { 0x8500, 0x1d68, 0x4000 },

+  { 0x8500, 0x1d64, 0x3000 },

+  { 0x8500, 0x1d62, 0x2000 },

+  { 0x0600, 0x1d61, 0x0000 },

+  { 0x0500, 0x1d63, 0x0000 },

+  { 0x8500, 0x1d66, 0x2000 },

+  { 0x0500, 0x1d65, 0x0000 },

+  { 0x0500, 0x1d67, 0x0000 },

+  { 0x8900, 0x1e00, 0x3001 },

+  { 0x8500, 0x1d6a, 0x2000 },

+  { 0x0500, 0x1d69, 0x0000 },

+  { 0x0500, 0x1d6b, 0x0000 },

+  { 0x8900, 0x1e02, 0x2001 },

+  { 0x0500, 0x1e01, 0x0fff },

+  { 0x0500, 0x1e03, 0x0fff },

+  { 0x8900, 0x1e14, 0x5001 },

+  { 0x8900, 0x1e0c, 0x4001 },

+  { 0x8900, 0x1e08, 0x3001 },

+  { 0x8900, 0x1e06, 0x2001 },

+  { 0x0500, 0x1e05, 0x0fff },

+  { 0x0500, 0x1e07, 0x0fff },

+  { 0x8900, 0x1e0a, 0x2001 },

+  { 0x0500, 0x1e09, 0x0fff },

+  { 0x0500, 0x1e0b, 0x0fff },

+  { 0x8900, 0x1e10, 0x3001 },

+  { 0x8900, 0x1e0e, 0x2001 },

+  { 0x0500, 0x1e0d, 0x0fff },

+  { 0x0500, 0x1e0f, 0x0fff },

+  { 0x8900, 0x1e12, 0x2001 },

+  { 0x0500, 0x1e11, 0x0fff },

+  { 0x0500, 0x1e13, 0x0fff },

+  { 0x8900, 0x1e1c, 0x4001 },

+  { 0x8900, 0x1e18, 0x3001 },

+  { 0x8900, 0x1e16, 0x2001 },

+  { 0x0500, 0x1e15, 0x0fff },

+  { 0x0500, 0x1e17, 0x0fff },

+  { 0x8900, 0x1e1a, 0x2001 },

+  { 0x0500, 0x1e19, 0x0fff },

+  { 0x0500, 0x1e1b, 0x0fff },

+  { 0x8900, 0x1e20, 0x3001 },

+  { 0x8900, 0x1e1e, 0x2001 },

+  { 0x0500, 0x1e1d, 0x0fff },

+  { 0x0500, 0x1e1f, 0x0fff },

+  { 0x8900, 0x1e22, 0x2001 },

+  { 0x0500, 0x1e21, 0x0fff },

+  { 0x0500, 0x1e23, 0x0fff },

+  { 0x9600, 0x2045, 0xa000 },

+  { 0x8500, 0x1f32, 0x9008 },

+  { 0x8900, 0x1ea8, 0x8001 },

+  { 0x8900, 0x1e64, 0x7001 },

+  { 0x8900, 0x1e44, 0x6001 },

+  { 0x8900, 0x1e34, 0x5001 },

+  { 0x8900, 0x1e2c, 0x4001 },

+  { 0x8900, 0x1e28, 0x3001 },

+  { 0x8900, 0x1e26, 0x2001 },

+  { 0x0500, 0x1e25, 0x0fff },

+  { 0x0500, 0x1e27, 0x0fff },

+  { 0x8900, 0x1e2a, 0x2001 },

+  { 0x0500, 0x1e29, 0x0fff },

+  { 0x0500, 0x1e2b, 0x0fff },

+  { 0x8900, 0x1e30, 0x3001 },

+  { 0x8900, 0x1e2e, 0x2001 },

+  { 0x0500, 0x1e2d, 0x0fff },

+  { 0x0500, 0x1e2f, 0x0fff },

+  { 0x8900, 0x1e32, 0x2001 },

+  { 0x0500, 0x1e31, 0x0fff },

+  { 0x0500, 0x1e33, 0x0fff },

+  { 0x8900, 0x1e3c, 0x4001 },

+  { 0x8900, 0x1e38, 0x3001 },

+  { 0x8900, 0x1e36, 0x2001 },

+  { 0x0500, 0x1e35, 0x0fff },

+  { 0x0500, 0x1e37, 0x0fff },

+  { 0x8900, 0x1e3a, 0x2001 },

+  { 0x0500, 0x1e39, 0x0fff },

+  { 0x0500, 0x1e3b, 0x0fff },

+  { 0x8900, 0x1e40, 0x3001 },

+  { 0x8900, 0x1e3e, 0x2001 },

+  { 0x0500, 0x1e3d, 0x0fff },

+  { 0x0500, 0x1e3f, 0x0fff },

+  { 0x8900, 0x1e42, 0x2001 },

+  { 0x0500, 0x1e41, 0x0fff },

+  { 0x0500, 0x1e43, 0x0fff },

+  { 0x8900, 0x1e54, 0x5001 },

+  { 0x8900, 0x1e4c, 0x4001 },

+  { 0x8900, 0x1e48, 0x3001 },

+  { 0x8900, 0x1e46, 0x2001 },

+  { 0x0500, 0x1e45, 0x0fff },

+  { 0x0500, 0x1e47, 0x0fff },

+  { 0x8900, 0x1e4a, 0x2001 },

+  { 0x0500, 0x1e49, 0x0fff },

+  { 0x0500, 0x1e4b, 0x0fff },

+  { 0x8900, 0x1e50, 0x3001 },

+  { 0x8900, 0x1e4e, 0x2001 },

+  { 0x0500, 0x1e4d, 0x0fff },

+  { 0x0500, 0x1e4f, 0x0fff },

+  { 0x8900, 0x1e52, 0x2001 },

+  { 0x0500, 0x1e51, 0x0fff },

+  { 0x0500, 0x1e53, 0x0fff },

+  { 0x8900, 0x1e5c, 0x4001 },

+  { 0x8900, 0x1e58, 0x3001 },

+  { 0x8900, 0x1e56, 0x2001 },

+  { 0x0500, 0x1e55, 0x0fff },

+  { 0x0500, 0x1e57, 0x0fff },

+  { 0x8900, 0x1e5a, 0x2001 },

+  { 0x0500, 0x1e59, 0x0fff },

+  { 0x0500, 0x1e5b, 0x0fff },

+  { 0x8900, 0x1e60, 0x3001 },

+  { 0x8900, 0x1e5e, 0x2001 },

+  { 0x0500, 0x1e5d, 0x0fff },

+  { 0x0500, 0x1e5f, 0x0fff },

+  { 0x8900, 0x1e62, 0x2001 },

+  { 0x0500, 0x1e61, 0x0fff },

+  { 0x0500, 0x1e63, 0x0fff },

+  { 0x8900, 0x1e84, 0x6001 },

+  { 0x8900, 0x1e74, 0x5001 },

+  { 0x8900, 0x1e6c, 0x4001 },

+  { 0x8900, 0x1e68, 0x3001 },

+  { 0x8900, 0x1e66, 0x2001 },

+  { 0x0500, 0x1e65, 0x0fff },

+  { 0x0500, 0x1e67, 0x0fff },

+  { 0x8900, 0x1e6a, 0x2001 },

+  { 0x0500, 0x1e69, 0x0fff },

+  { 0x0500, 0x1e6b, 0x0fff },

+  { 0x8900, 0x1e70, 0x3001 },

+  { 0x8900, 0x1e6e, 0x2001 },

+  { 0x0500, 0x1e6d, 0x0fff },

+  { 0x0500, 0x1e6f, 0x0fff },

+  { 0x8900, 0x1e72, 0x2001 },

+  { 0x0500, 0x1e71, 0x0fff },

+  { 0x0500, 0x1e73, 0x0fff },

+  { 0x8900, 0x1e7c, 0x4001 },

+  { 0x8900, 0x1e78, 0x3001 },

+  { 0x8900, 0x1e76, 0x2001 },

+  { 0x0500, 0x1e75, 0x0fff },

+  { 0x0500, 0x1e77, 0x0fff },

+  { 0x8900, 0x1e7a, 0x2001 },

+  { 0x0500, 0x1e79, 0x0fff },

+  { 0x0500, 0x1e7b, 0x0fff },

+  { 0x8900, 0x1e80, 0x3001 },

+  { 0x8900, 0x1e7e, 0x2001 },

+  { 0x0500, 0x1e7d, 0x0fff },

+  { 0x0500, 0x1e7f, 0x0fff },

+  { 0x8900, 0x1e82, 0x2001 },

+  { 0x0500, 0x1e81, 0x0fff },

+  { 0x0500, 0x1e83, 0x0fff },

+  { 0x8900, 0x1e94, 0x5001 },

+  { 0x8900, 0x1e8c, 0x4001 },

+  { 0x8900, 0x1e88, 0x3001 },

+  { 0x8900, 0x1e86, 0x2001 },

+  { 0x0500, 0x1e85, 0x0fff },

+  { 0x0500, 0x1e87, 0x0fff },

+  { 0x8900, 0x1e8a, 0x2001 },

+  { 0x0500, 0x1e89, 0x0fff },

+  { 0x0500, 0x1e8b, 0x0fff },

+  { 0x8900, 0x1e90, 0x3001 },

+  { 0x8900, 0x1e8e, 0x2001 },

+  { 0x0500, 0x1e8d, 0x0fff },

+  { 0x0500, 0x1e8f, 0x0fff },

+  { 0x8900, 0x1e92, 0x2001 },

+  { 0x0500, 0x1e91, 0x0fff },

+  { 0x0500, 0x1e93, 0x0fff },

+  { 0x8900, 0x1ea0, 0x4001 },

+  { 0x8500, 0x1e98, 0x3000 },

+  { 0x8500, 0x1e96, 0x2000 },

+  { 0x0500, 0x1e95, 0x0fff },

+  { 0x0500, 0x1e97, 0x0000 },

+  { 0x8500, 0x1e9a, 0x2000 },

+  { 0x0500, 0x1e99, 0x0000 },

+  { 0x0500, 0x1e9b, 0x0fc5 },

+  { 0x8900, 0x1ea4, 0x3001 },

+  { 0x8900, 0x1ea2, 0x2001 },

+  { 0x0500, 0x1ea1, 0x0fff },

+  { 0x0500, 0x1ea3, 0x0fff },

+  { 0x8900, 0x1ea6, 0x2001 },

+  { 0x0500, 0x1ea5, 0x0fff },

+  { 0x0500, 0x1ea7, 0x0fff },

+  { 0x8900, 0x1ee8, 0x7001 },

+  { 0x8900, 0x1ec8, 0x6001 },

+  { 0x8900, 0x1eb8, 0x5001 },

+  { 0x8900, 0x1eb0, 0x4001 },

+  { 0x8900, 0x1eac, 0x3001 },

+  { 0x8900, 0x1eaa, 0x2001 },

+  { 0x0500, 0x1ea9, 0x0fff },

+  { 0x0500, 0x1eab, 0x0fff },

+  { 0x8900, 0x1eae, 0x2001 },

+  { 0x0500, 0x1ead, 0x0fff },

+  { 0x0500, 0x1eaf, 0x0fff },

+  { 0x8900, 0x1eb4, 0x3001 },

+  { 0x8900, 0x1eb2, 0x2001 },

+  { 0x0500, 0x1eb1, 0x0fff },

+  { 0x0500, 0x1eb3, 0x0fff },

+  { 0x8900, 0x1eb6, 0x2001 },

+  { 0x0500, 0x1eb5, 0x0fff },

+  { 0x0500, 0x1eb7, 0x0fff },

+  { 0x8900, 0x1ec0, 0x4001 },

+  { 0x8900, 0x1ebc, 0x3001 },

+  { 0x8900, 0x1eba, 0x2001 },

+  { 0x0500, 0x1eb9, 0x0fff },

+  { 0x0500, 0x1ebb, 0x0fff },

+  { 0x8900, 0x1ebe, 0x2001 },

+  { 0x0500, 0x1ebd, 0x0fff },

+  { 0x0500, 0x1ebf, 0x0fff },

+  { 0x8900, 0x1ec4, 0x3001 },

+  { 0x8900, 0x1ec2, 0x2001 },

+  { 0x0500, 0x1ec1, 0x0fff },

+  { 0x0500, 0x1ec3, 0x0fff },

+  { 0x8900, 0x1ec6, 0x2001 },

+  { 0x0500, 0x1ec5, 0x0fff },

+  { 0x0500, 0x1ec7, 0x0fff },

+  { 0x8900, 0x1ed8, 0x5001 },

+  { 0x8900, 0x1ed0, 0x4001 },

+  { 0x8900, 0x1ecc, 0x3001 },

+  { 0x8900, 0x1eca, 0x2001 },

+  { 0x0500, 0x1ec9, 0x0fff },

+  { 0x0500, 0x1ecb, 0x0fff },

+  { 0x8900, 0x1ece, 0x2001 },

+  { 0x0500, 0x1ecd, 0x0fff },

+  { 0x0500, 0x1ecf, 0x0fff },

+  { 0x8900, 0x1ed4, 0x3001 },

+  { 0x8900, 0x1ed2, 0x2001 },

+  { 0x0500, 0x1ed1, 0x0fff },

+  { 0x0500, 0x1ed3, 0x0fff },

+  { 0x8900, 0x1ed6, 0x2001 },

+  { 0x0500, 0x1ed5, 0x0fff },

+  { 0x0500, 0x1ed7, 0x0fff },

+  { 0x8900, 0x1ee0, 0x4001 },

+  { 0x8900, 0x1edc, 0x3001 },

+  { 0x8900, 0x1eda, 0x2001 },

+  { 0x0500, 0x1ed9, 0x0fff },

+  { 0x0500, 0x1edb, 0x0fff },

+  { 0x8900, 0x1ede, 0x2001 },

+  { 0x0500, 0x1edd, 0x0fff },

+  { 0x0500, 0x1edf, 0x0fff },

+  { 0x8900, 0x1ee4, 0x3001 },

+  { 0x8900, 0x1ee2, 0x2001 },

+  { 0x0500, 0x1ee1, 0x0fff },

+  { 0x0500, 0x1ee3, 0x0fff },

+  { 0x8900, 0x1ee6, 0x2001 },

+  { 0x0500, 0x1ee5, 0x0fff },

+  { 0x0500, 0x1ee7, 0x0fff },

+  { 0x8900, 0x1f0e, 0x6ff8 },

+  { 0x8900, 0x1ef8, 0x5001 },

+  { 0x8900, 0x1ef0, 0x4001 },

+  { 0x8900, 0x1eec, 0x3001 },

+  { 0x8900, 0x1eea, 0x2001 },

+  { 0x0500, 0x1ee9, 0x0fff },

+  { 0x0500, 0x1eeb, 0x0fff },

+  { 0x8900, 0x1eee, 0x2001 },

+  { 0x0500, 0x1eed, 0x0fff },

+  { 0x0500, 0x1eef, 0x0fff },

+  { 0x8900, 0x1ef4, 0x3001 },

+  { 0x8900, 0x1ef2, 0x2001 },

+  { 0x0500, 0x1ef1, 0x0fff },

+  { 0x0500, 0x1ef3, 0x0fff },

+  { 0x8900, 0x1ef6, 0x2001 },

+  { 0x0500, 0x1ef5, 0x0fff },

+  { 0x0500, 0x1ef7, 0x0fff },

+  { 0x8500, 0x1f06, 0x4008 },

+  { 0x8500, 0x1f02, 0x3008 },

+  { 0x8500, 0x1f00, 0x2008 },

+  { 0x0500, 0x1ef9, 0x0fff },

+  { 0x0500, 0x1f01, 0x0008 },

+  { 0x8500, 0x1f04, 0x2008 },

+  { 0x0500, 0x1f03, 0x0008 },

+  { 0x0500, 0x1f05, 0x0008 },

+  { 0x8900, 0x1f0a, 0x3ff8 },

+  { 0x8900, 0x1f08, 0x2ff8 },

+  { 0x0500, 0x1f07, 0x0008 },

+  { 0x0900, 0x1f09, 0x0ff8 },

+  { 0x8900, 0x1f0c, 0x2ff8 },

+  { 0x0900, 0x1f0b, 0x0ff8 },

+  { 0x0900, 0x1f0d, 0x0ff8 },

+  { 0x8500, 0x1f22, 0x5008 },

+  { 0x8900, 0x1f18, 0x4ff8 },

+  { 0x8500, 0x1f12, 0x3008 },

+  { 0x8500, 0x1f10, 0x2008 },

+  { 0x0900, 0x1f0f, 0x0ff8 },

+  { 0x0500, 0x1f11, 0x0008 },

+  { 0x8500, 0x1f14, 0x2008 },

+  { 0x0500, 0x1f13, 0x0008 },

+  { 0x0500, 0x1f15, 0x0008 },

+  { 0x8900, 0x1f1c, 0x3ff8 },

+  { 0x8900, 0x1f1a, 0x2ff8 },

+  { 0x0900, 0x1f19, 0x0ff8 },

+  { 0x0900, 0x1f1b, 0x0ff8 },

+  { 0x8500, 0x1f20, 0x2008 },

+  { 0x0900, 0x1f1d, 0x0ff8 },

+  { 0x0500, 0x1f21, 0x0008 },

+  { 0x8900, 0x1f2a, 0x4ff8 },

+  { 0x8500, 0x1f26, 0x3008 },

+  { 0x8500, 0x1f24, 0x2008 },

+  { 0x0500, 0x1f23, 0x0008 },

+  { 0x0500, 0x1f25, 0x0008 },

+  { 0x8900, 0x1f28, 0x2ff8 },

+  { 0x0500, 0x1f27, 0x0008 },

+  { 0x0900, 0x1f29, 0x0ff8 },

+  { 0x8900, 0x1f2e, 0x3ff8 },

+  { 0x8900, 0x1f2c, 0x2ff8 },

+  { 0x0900, 0x1f2b, 0x0ff8 },

+  { 0x0900, 0x1f2d, 0x0ff8 },

+  { 0x8500, 0x1f30, 0x2008 },

+  { 0x0900, 0x1f2f, 0x0ff8 },

+  { 0x0500, 0x1f31, 0x0008 },

+  { 0x9800, 0x1fbd, 0x8000 },

+  { 0x8500, 0x1f7a, 0x7070 },

+  { 0x8500, 0x1f56, 0x6000 },

+  { 0x8500, 0x1f42, 0x5008 },

+  { 0x8900, 0x1f3a, 0x4ff8 },

+  { 0x8500, 0x1f36, 0x3008 },

+  { 0x8500, 0x1f34, 0x2008 },

+  { 0x0500, 0x1f33, 0x0008 },

+  { 0x0500, 0x1f35, 0x0008 },

+  { 0x8900, 0x1f38, 0x2ff8 },

+  { 0x0500, 0x1f37, 0x0008 },

+  { 0x0900, 0x1f39, 0x0ff8 },

+  { 0x8900, 0x1f3e, 0x3ff8 },

+  { 0x8900, 0x1f3c, 0x2ff8 },

+  { 0x0900, 0x1f3b, 0x0ff8 },

+  { 0x0900, 0x1f3d, 0x0ff8 },

+  { 0x8500, 0x1f40, 0x2008 },

+  { 0x0900, 0x1f3f, 0x0ff8 },

+  { 0x0500, 0x1f41, 0x0008 },

+  { 0x8900, 0x1f4c, 0x4ff8 },

+  { 0x8900, 0x1f48, 0x3ff8 },

+  { 0x8500, 0x1f44, 0x2008 },

+  { 0x0500, 0x1f43, 0x0008 },

+  { 0x0500, 0x1f45, 0x0008 },

+  { 0x8900, 0x1f4a, 0x2ff8 },

+  { 0x0900, 0x1f49, 0x0ff8 },

+  { 0x0900, 0x1f4b, 0x0ff8 },

+  { 0x8500, 0x1f52, 0x3000 },

+  { 0x8500, 0x1f50, 0x2000 },

+  { 0x0900, 0x1f4d, 0x0ff8 },

+  { 0x0500, 0x1f51, 0x0008 },

+  { 0x8500, 0x1f54, 0x2000 },

+  { 0x0500, 0x1f53, 0x0008 },

+  { 0x0500, 0x1f55, 0x0008 },

+  { 0x8900, 0x1f6a, 0x5ff8 },

+  { 0x8500, 0x1f62, 0x4008 },

+  { 0x8900, 0x1f5d, 0x3ff8 },

+  { 0x8900, 0x1f59, 0x2ff8 },

+  { 0x0500, 0x1f57, 0x0008 },

+  { 0x0900, 0x1f5b, 0x0ff8 },

+  { 0x8500, 0x1f60, 0x2008 },

+  { 0x0900, 0x1f5f, 0x0ff8 },

+  { 0x0500, 0x1f61, 0x0008 },

+  { 0x8500, 0x1f66, 0x3008 },

+  { 0x8500, 0x1f64, 0x2008 },

+  { 0x0500, 0x1f63, 0x0008 },

+  { 0x0500, 0x1f65, 0x0008 },

+  { 0x8900, 0x1f68, 0x2ff8 },

+  { 0x0500, 0x1f67, 0x0008 },

+  { 0x0900, 0x1f69, 0x0ff8 },

+  { 0x8500, 0x1f72, 0x4056 },

+  { 0x8900, 0x1f6e, 0x3ff8 },

+  { 0x8900, 0x1f6c, 0x2ff8 },

+  { 0x0900, 0x1f6b, 0x0ff8 },

+  { 0x0900, 0x1f6d, 0x0ff8 },

+  { 0x8500, 0x1f70, 0x204a },

+  { 0x0900, 0x1f6f, 0x0ff8 },

+  { 0x0500, 0x1f71, 0x004a },

+  { 0x8500, 0x1f76, 0x3064 },

+  { 0x8500, 0x1f74, 0x2056 },

+  { 0x0500, 0x1f73, 0x0056 },

+  { 0x0500, 0x1f75, 0x0056 },

+  { 0x8500, 0x1f78, 0x2080 },

+  { 0x0500, 0x1f77, 0x0064 },

+  { 0x0500, 0x1f79, 0x0080 },

+  { 0x8800, 0x1f9c, 0x6000 },

+  { 0x8800, 0x1f8c, 0x5000 },

+  { 0x8500, 0x1f84, 0x4008 },

+  { 0x8500, 0x1f80, 0x3008 },

+  { 0x8500, 0x1f7c, 0x207e },

+  { 0x0500, 0x1f7b, 0x0070 },

+  { 0x0500, 0x1f7d, 0x007e },

+  { 0x8500, 0x1f82, 0x2008 },

+  { 0x0500, 0x1f81, 0x0008 },

+  { 0x0500, 0x1f83, 0x0008 },

+  { 0x8800, 0x1f88, 0x3000 },

+  { 0x8500, 0x1f86, 0x2008 },

+  { 0x0500, 0x1f85, 0x0008 },

+  { 0x0500, 0x1f87, 0x0008 },

+  { 0x8800, 0x1f8a, 0x2000 },

+  { 0x0800, 0x1f89, 0x0000 },

+  { 0x0800, 0x1f8b, 0x0000 },

+  { 0x8500, 0x1f94, 0x4008 },

+  { 0x8500, 0x1f90, 0x3008 },

+  { 0x8800, 0x1f8e, 0x2000 },

+  { 0x0800, 0x1f8d, 0x0000 },

+  { 0x0800, 0x1f8f, 0x0000 },

+  { 0x8500, 0x1f92, 0x2008 },

+  { 0x0500, 0x1f91, 0x0008 },

+  { 0x0500, 0x1f93, 0x0008 },

+  { 0x8800, 0x1f98, 0x3000 },

+  { 0x8500, 0x1f96, 0x2008 },

+  { 0x0500, 0x1f95, 0x0008 },

+  { 0x0500, 0x1f97, 0x0008 },

+  { 0x8800, 0x1f9a, 0x2000 },

+  { 0x0800, 0x1f99, 0x0000 },

+  { 0x0800, 0x1f9b, 0x0000 },

+  { 0x8800, 0x1fac, 0x5000 },

+  { 0x8500, 0x1fa4, 0x4008 },

+  { 0x8500, 0x1fa0, 0x3008 },

+  { 0x8800, 0x1f9e, 0x2000 },

+  { 0x0800, 0x1f9d, 0x0000 },

+  { 0x0800, 0x1f9f, 0x0000 },

+  { 0x8500, 0x1fa2, 0x2008 },

+  { 0x0500, 0x1fa1, 0x0008 },

+  { 0x0500, 0x1fa3, 0x0008 },

+  { 0x8800, 0x1fa8, 0x3000 },

+  { 0x8500, 0x1fa6, 0x2008 },

+  { 0x0500, 0x1fa5, 0x0008 },

+  { 0x0500, 0x1fa7, 0x0008 },

+  { 0x8800, 0x1faa, 0x2000 },

+  { 0x0800, 0x1fa9, 0x0000 },

+  { 0x0800, 0x1fab, 0x0000 },

+  { 0x8500, 0x1fb4, 0x4000 },

+  { 0x8500, 0x1fb0, 0x3008 },

+  { 0x8800, 0x1fae, 0x2000 },

+  { 0x0800, 0x1fad, 0x0000 },

+  { 0x0800, 0x1faf, 0x0000 },

+  { 0x8500, 0x1fb2, 0x2000 },

+  { 0x0500, 0x1fb1, 0x0008 },

+  { 0x0500, 0x1fb3, 0x0009 },

+  { 0x8900, 0x1fb9, 0x3ff8 },

+  { 0x8500, 0x1fb7, 0x2000 },

+  { 0x0500, 0x1fb6, 0x0000 },

+  { 0x0900, 0x1fb8, 0x0ff8 },

+  { 0x8900, 0x1fbb, 0x2fb6 },

+  { 0x0900, 0x1fba, 0x0fb6 },

+  { 0x0800, 0x1fbc, 0x0000 },

+  { 0x9d00, 0x2005, 0x7000 },

+  { 0x8500, 0x1fe1, 0x6008 },

+  { 0x9800, 0x1fce, 0x5000 },

+  { 0x8500, 0x1fc6, 0x4000 },

+  { 0x9800, 0x1fc1, 0x3000 },

+  { 0x9800, 0x1fbf, 0x2000 },

+  { 0x0500, 0x1fbe, 0x0000 },

+  { 0x1800, 0x1fc0, 0x0000 },

+  { 0x8500, 0x1fc3, 0x2009 },

+  { 0x0500, 0x1fc2, 0x0000 },

+  { 0x0500, 0x1fc4, 0x0000 },

+  { 0x8900, 0x1fca, 0x3faa },

+  { 0x8900, 0x1fc8, 0x2faa },

+  { 0x0500, 0x1fc7, 0x0000 },

+  { 0x0900, 0x1fc9, 0x0faa },

+  { 0x8800, 0x1fcc, 0x2000 },

+  { 0x0900, 0x1fcb, 0x0faa },

+  { 0x1800, 0x1fcd, 0x0000 },

+  { 0x8900, 0x1fd8, 0x4ff8 },

+  { 0x8500, 0x1fd2, 0x3000 },

+  { 0x8500, 0x1fd0, 0x2008 },

+  { 0x1800, 0x1fcf, 0x0000 },

+  { 0x0500, 0x1fd1, 0x0008 },

+  { 0x8500, 0x1fd6, 0x2000 },

+  { 0x0500, 0x1fd3, 0x0000 },

+  { 0x0500, 0x1fd7, 0x0000 },

+  { 0x9800, 0x1fdd, 0x3000 },

+  { 0x8900, 0x1fda, 0x2f9c },

+  { 0x0900, 0x1fd9, 0x0ff8 },

+  { 0x0900, 0x1fdb, 0x0f9c },

+  { 0x9800, 0x1fdf, 0x2000 },

+  { 0x1800, 0x1fde, 0x0000 },

+  { 0x0500, 0x1fe0, 0x0008 },

+  { 0x8500, 0x1ff3, 0x5009 },

+  { 0x8900, 0x1fe9, 0x4ff8 },

+  { 0x8500, 0x1fe5, 0x3007 },

+  { 0x8500, 0x1fe3, 0x2000 },

+  { 0x0500, 0x1fe2, 0x0000 },

+  { 0x0500, 0x1fe4, 0x0000 },

+  { 0x8500, 0x1fe7, 0x2000 },

+  { 0x0500, 0x1fe6, 0x0000 },

+  { 0x0900, 0x1fe8, 0x0ff8 },

+  { 0x9800, 0x1fed, 0x3000 },

+  { 0x8900, 0x1feb, 0x2f90 },

+  { 0x0900, 0x1fea, 0x0f90 },

+  { 0x0900, 0x1fec, 0x0ff9 },

+  { 0x9800, 0x1fef, 0x2000 },

+  { 0x1800, 0x1fee, 0x0000 },

+  { 0x0500, 0x1ff2, 0x0000 },

+  { 0x8800, 0x1ffc, 0x4000 },

+  { 0x8900, 0x1ff8, 0x3f80 },

+  { 0x8500, 0x1ff6, 0x2000 },

+  { 0x0500, 0x1ff4, 0x0000 },

+  { 0x0500, 0x1ff7, 0x0000 },

+  { 0x8900, 0x1ffa, 0x2f82 },

+  { 0x0900, 0x1ff9, 0x0f80 },

+  { 0x0900, 0x1ffb, 0x0f82 },

+  { 0x9d00, 0x2001, 0x3000 },

+  { 0x9800, 0x1ffe, 0x2000 },

+  { 0x1800, 0x1ffd, 0x0000 },

+  { 0x1d00, 0x2000, 0x0000 },

+  { 0x9d00, 0x2003, 0x2000 },

+  { 0x1d00, 0x2002, 0x0000 },

+  { 0x1d00, 0x2004, 0x0000 },

+  { 0x9500, 0x2025, 0x6000 },

+  { 0x9100, 0x2015, 0x5000 },

+  { 0x8100, 0x200d, 0x4000 },

+  { 0x9d00, 0x2009, 0x3000 },

+  { 0x9d00, 0x2007, 0x2000 },

+  { 0x1d00, 0x2006, 0x0000 },

+  { 0x1d00, 0x2008, 0x0000 },

+  { 0x9d00, 0x200b, 0x2000 },

+  { 0x1d00, 0x200a, 0x0000 },

+  { 0x0100, 0x200c, 0x0000 },

+  { 0x9100, 0x2011, 0x3000 },

+  { 0x8100, 0x200f, 0x2000 },

+  { 0x0100, 0x200e, 0x0000 },

+  { 0x1100, 0x2010, 0x0000 },

+  { 0x9100, 0x2013, 0x2000 },

+  { 0x1100, 0x2012, 0x0000 },

+  { 0x1100, 0x2014, 0x0000 },

+  { 0x9300, 0x201d, 0x4000 },

+  { 0x9300, 0x2019, 0x3000 },

+  { 0x9500, 0x2017, 0x2000 },

+  { 0x1500, 0x2016, 0x0000 },

+  { 0x1400, 0x2018, 0x0000 },

+  { 0x9400, 0x201b, 0x2000 },

+  { 0x1600, 0x201a, 0x0000 },

+  { 0x1400, 0x201c, 0x0000 },

+  { 0x9500, 0x2021, 0x3000 },

+  { 0x9400, 0x201f, 0x2000 },

+  { 0x1600, 0x201e, 0x0000 },

+  { 0x1500, 0x2020, 0x0000 },

+  { 0x9500, 0x2023, 0x2000 },

+  { 0x1500, 0x2022, 0x0000 },

+  { 0x1500, 0x2024, 0x0000 },

+  { 0x9500, 0x2035, 0x5000 },

+  { 0x8100, 0x202d, 0x4000 },

+  { 0x9c00, 0x2029, 0x3000 },

+  { 0x9500, 0x2027, 0x2000 },

+  { 0x1500, 0x2026, 0x0000 },

+  { 0x1b00, 0x2028, 0x0000 },

+  { 0x8100, 0x202b, 0x2000 },

+  { 0x0100, 0x202a, 0x0000 },

+  { 0x0100, 0x202c, 0x0000 },

+  { 0x9500, 0x2031, 0x3000 },

+  { 0x9d00, 0x202f, 0x2000 },

+  { 0x0100, 0x202e, 0x0000 },

+  { 0x1500, 0x2030, 0x0000 },

+  { 0x9500, 0x2033, 0x2000 },

+  { 0x1500, 0x2032, 0x0000 },

+  { 0x1500, 0x2034, 0x0000 },

+  { 0x9500, 0x203d, 0x4000 },

+  { 0x9400, 0x2039, 0x3000 },

+  { 0x9500, 0x2037, 0x2000 },

+  { 0x1500, 0x2036, 0x0000 },

+  { 0x1500, 0x2038, 0x0000 },

+  { 0x9500, 0x203b, 0x2000 },

+  { 0x1300, 0x203a, 0x0000 },

+  { 0x1500, 0x203c, 0x0000 },

+  { 0x9500, 0x2041, 0x3000 },

+  { 0x9000, 0x203f, 0x2000 },

+  { 0x1500, 0x203e, 0x0000 },

+  { 0x1000, 0x2040, 0x0000 },

+  { 0x9500, 0x2043, 0x2000 },

+  { 0x1500, 0x2042, 0x0000 },

+  { 0x1900, 0x2044, 0x0000 },

+  { 0x9900, 0x21ae, 0x9000 },

+  { 0x8900, 0x211a, 0x8000 },

+  { 0x9700, 0x20a7, 0x7000 },

+  { 0x8f00, 0x2076, 0x6000 },

+  { 0x9500, 0x2057, 0x5000 },

+  { 0x9500, 0x204d, 0x4000 },

+  { 0x9500, 0x2049, 0x3000 },

+  { 0x9500, 0x2047, 0x2000 },

+  { 0x1200, 0x2046, 0x0000 },

+  { 0x1500, 0x2048, 0x0000 },

+  { 0x9500, 0x204b, 0x2000 },

+  { 0x1500, 0x204a, 0x0000 },

+  { 0x1500, 0x204c, 0x0000 },

+  { 0x9500, 0x2051, 0x3000 },

+  { 0x9500, 0x204f, 0x2000 },

+  { 0x1500, 0x204e, 0x0000 },

+  { 0x1500, 0x2050, 0x0000 },

+  { 0x9500, 0x2053, 0x2000 },

+  { 0x1900, 0x2052, 0x0000 },

+  { 0x1000, 0x2054, 0x0000 },

+  { 0x8100, 0x206c, 0x4000 },

+  { 0x8100, 0x2062, 0x3000 },

+  { 0x8100, 0x2060, 0x2000 },

+  { 0x1d00, 0x205f, 0x0000 },

+  { 0x0100, 0x2061, 0x0000 },

+  { 0x8100, 0x206a, 0x2000 },

+  { 0x0100, 0x2063, 0x0000 },

+  { 0x0100, 0x206b, 0x0000 },

+  { 0x8f00, 0x2070, 0x3000 },

+  { 0x8100, 0x206e, 0x2000 },

+  { 0x0100, 0x206d, 0x0000 },

+  { 0x0100, 0x206f, 0x0000 },

+  { 0x8f00, 0x2074, 0x2000 },

+  { 0x0500, 0x2071, 0x0000 },

+  { 0x0f00, 0x2075, 0x0000 },

+  { 0x8f00, 0x2086, 0x5000 },

+  { 0x9200, 0x207e, 0x4000 },

+  { 0x9900, 0x207a, 0x3000 },

+  { 0x8f00, 0x2078, 0x2000 },

+  { 0x0f00, 0x2077, 0x0000 },

+  { 0x0f00, 0x2079, 0x0000 },

+  { 0x9900, 0x207c, 0x2000 },

+  { 0x1900, 0x207b, 0x0000 },

+  { 0x1600, 0x207d, 0x0000 },

+  { 0x8f00, 0x2082, 0x3000 },

+  { 0x8f00, 0x2080, 0x2000 },

+  { 0x0500, 0x207f, 0x0000 },

+  { 0x0f00, 0x2081, 0x0000 },

+  { 0x8f00, 0x2084, 0x2000 },

+  { 0x0f00, 0x2083, 0x0000 },

+  { 0x0f00, 0x2085, 0x0000 },

+  { 0x9200, 0x208e, 0x4000 },

+  { 0x9900, 0x208a, 0x3000 },

+  { 0x8f00, 0x2088, 0x2000 },

+  { 0x0f00, 0x2087, 0x0000 },

+  { 0x0f00, 0x2089, 0x0000 },

+  { 0x9900, 0x208c, 0x2000 },

+  { 0x1900, 0x208b, 0x0000 },

+  { 0x1600, 0x208d, 0x0000 },

+  { 0x9700, 0x20a3, 0x3000 },

+  { 0x9700, 0x20a1, 0x2000 },

+  { 0x1700, 0x20a0, 0x0000 },

+  { 0x1700, 0x20a2, 0x0000 },

+  { 0x9700, 0x20a5, 0x2000 },

+  { 0x1700, 0x20a4, 0x0000 },

+  { 0x1700, 0x20a6, 0x0000 },

+  { 0x8c00, 0x20e5, 0x6000 },

+  { 0x8c00, 0x20d5, 0x5000 },

+  { 0x9700, 0x20af, 0x4000 },

+  { 0x9700, 0x20ab, 0x3000 },

+  { 0x9700, 0x20a9, 0x2000 },

+  { 0x1700, 0x20a8, 0x0000 },

+  { 0x1700, 0x20aa, 0x0000 },

+  { 0x9700, 0x20ad, 0x2000 },

+  { 0x1700, 0x20ac, 0x0000 },

+  { 0x1700, 0x20ae, 0x0000 },

+  { 0x8c00, 0x20d1, 0x3000 },

+  { 0x9700, 0x20b1, 0x2000 },

+  { 0x1700, 0x20b0, 0x0000 },

+  { 0x0c00, 0x20d0, 0x0000 },

+  { 0x8c00, 0x20d3, 0x2000 },

+  { 0x0c00, 0x20d2, 0x0000 },

+  { 0x0c00, 0x20d4, 0x0000 },

+  { 0x8b00, 0x20dd, 0x4000 },

+  { 0x8c00, 0x20d9, 0x3000 },

+  { 0x8c00, 0x20d7, 0x2000 },

+  { 0x0c00, 0x20d6, 0x0000 },

+  { 0x0c00, 0x20d8, 0x0000 },

+  { 0x8c00, 0x20db, 0x2000 },

+  { 0x0c00, 0x20da, 0x0000 },

+  { 0x0c00, 0x20dc, 0x0000 },

+  { 0x8c00, 0x20e1, 0x3000 },

+  { 0x8b00, 0x20df, 0x2000 },

+  { 0x0b00, 0x20de, 0x0000 },

+  { 0x0b00, 0x20e0, 0x0000 },

+  { 0x8b00, 0x20e3, 0x2000 },

+  { 0x0b00, 0x20e2, 0x0000 },

+  { 0x0b00, 0x20e4, 0x0000 },

+  { 0x8500, 0x210a, 0x5000 },

+  { 0x8900, 0x2102, 0x4000 },

+  { 0x8c00, 0x20e9, 0x3000 },

+  { 0x8c00, 0x20e7, 0x2000 },

+  { 0x0c00, 0x20e6, 0x0000 },

+  { 0x0c00, 0x20e8, 0x0000 },

+  { 0x9a00, 0x2100, 0x2000 },

+  { 0x0c00, 0x20ea, 0x0000 },

+  { 0x1a00, 0x2101, 0x0000 },

+  { 0x9a00, 0x2106, 0x3000 },

+  { 0x9a00, 0x2104, 0x2000 },

+  { 0x1a00, 0x2103, 0x0000 },

+  { 0x1a00, 0x2105, 0x0000 },

+  { 0x9a00, 0x2108, 0x2000 },

+  { 0x0900, 0x2107, 0x0000 },

+  { 0x1a00, 0x2109, 0x0000 },

+  { 0x8900, 0x2112, 0x4000 },

+  { 0x8500, 0x210e, 0x3000 },

+  { 0x8900, 0x210c, 0x2000 },

+  { 0x0900, 0x210b, 0x0000 },

+  { 0x0900, 0x210d, 0x0000 },

+  { 0x8900, 0x2110, 0x2000 },

+  { 0x0500, 0x210f, 0x0000 },

+  { 0x0900, 0x2111, 0x0000 },

+  { 0x9a00, 0x2116, 0x3000 },

+  { 0x9a00, 0x2114, 0x2000 },

+  { 0x0500, 0x2113, 0x0000 },

+  { 0x0900, 0x2115, 0x0000 },

+  { 0x9a00, 0x2118, 0x2000 },

+  { 0x1a00, 0x2117, 0x0000 },

+  { 0x0900, 0x2119, 0x0000 },

+  { 0x8e00, 0x2162, 0x7000 },

+  { 0x9a00, 0x213a, 0x6000 },

+  { 0x8900, 0x212a, 0x5000 },

+  { 0x9a00, 0x2122, 0x4000 },

+  { 0x9a00, 0x211e, 0x3000 },

+  { 0x8900, 0x211c, 0x2000 },

+  { 0x0900, 0x211b, 0x0000 },

+  { 0x0900, 0x211d, 0x0000 },

+  { 0x9a00, 0x2120, 0x2000 },

+  { 0x1a00, 0x211f, 0x0000 },

+  { 0x1a00, 0x2121, 0x0000 },

+  { 0x8900, 0x2126, 0x3000 },

+  { 0x8900, 0x2124, 0x2000 },

+  { 0x1a00, 0x2123, 0x0000 },

+  { 0x1a00, 0x2125, 0x0000 },

+  { 0x8900, 0x2128, 0x2000 },

+  { 0x1a00, 0x2127, 0x0000 },

+  { 0x1a00, 0x2129, 0x0000 },

+  { 0x9a00, 0x2132, 0x4000 },

+  { 0x9a00, 0x212e, 0x3000 },

+  { 0x8900, 0x212c, 0x2000 },

+  { 0x0900, 0x212b, 0x0000 },

+  { 0x0900, 0x212d, 0x0000 },

+  { 0x8900, 0x2130, 0x2000 },

+  { 0x0500, 0x212f, 0x0000 },

+  { 0x0900, 0x2131, 0x0000 },

+  { 0x8700, 0x2136, 0x3000 },

+  { 0x8500, 0x2134, 0x2000 },

+  { 0x0900, 0x2133, 0x0000 },

+  { 0x0700, 0x2135, 0x0000 },

+  { 0x8700, 0x2138, 0x2000 },

+  { 0x0700, 0x2137, 0x0000 },

+  { 0x0500, 0x2139, 0x0000 },

+  { 0x9900, 0x214b, 0x5000 },

+  { 0x9900, 0x2143, 0x4000 },

+  { 0x8900, 0x213f, 0x3000 },

+  { 0x8500, 0x213d, 0x2000 },

+  { 0x1a00, 0x213b, 0x0000 },

+  { 0x0900, 0x213e, 0x0000 },

+  { 0x9900, 0x2141, 0x2000 },

+  { 0x1900, 0x2140, 0x0000 },

+  { 0x1900, 0x2142, 0x0000 },

+  { 0x8500, 0x2147, 0x3000 },

+  { 0x8900, 0x2145, 0x2000 },

+  { 0x1900, 0x2144, 0x0000 },

+  { 0x0500, 0x2146, 0x0000 },

+  { 0x8500, 0x2149, 0x2000 },

+  { 0x0500, 0x2148, 0x0000 },

+  { 0x1a00, 0x214a, 0x0000 },

+  { 0x8f00, 0x215a, 0x4000 },

+  { 0x8f00, 0x2156, 0x3000 },

+  { 0x8f00, 0x2154, 0x2000 },

+  { 0x0f00, 0x2153, 0x0000 },

+  { 0x0f00, 0x2155, 0x0000 },

+  { 0x8f00, 0x2158, 0x2000 },

+  { 0x0f00, 0x2157, 0x0000 },

+  { 0x0f00, 0x2159, 0x0000 },

+  { 0x8f00, 0x215e, 0x3000 },

+  { 0x8f00, 0x215c, 0x2000 },

+  { 0x0f00, 0x215b, 0x0000 },

+  { 0x0f00, 0x215d, 0x0000 },

+  { 0x8e00, 0x2160, 0x2000 },

+  { 0x0f00, 0x215f, 0x0000 },

+  { 0x0e00, 0x2161, 0x0000 },

+  { 0x8e00, 0x2182, 0x6000 },

+  { 0x8e00, 0x2172, 0x5000 },

+  { 0x8e00, 0x216a, 0x4000 },

+  { 0x8e00, 0x2166, 0x3000 },

+  { 0x8e00, 0x2164, 0x2000 },

+  { 0x0e00, 0x2163, 0x0000 },

+  { 0x0e00, 0x2165, 0x0000 },

+  { 0x8e00, 0x2168, 0x2000 },

+  { 0x0e00, 0x2167, 0x0000 },

+  { 0x0e00, 0x2169, 0x0000 },

+  { 0x8e00, 0x216e, 0x3000 },

+  { 0x8e00, 0x216c, 0x2000 },

+  { 0x0e00, 0x216b, 0x0000 },

+  { 0x0e00, 0x216d, 0x0000 },

+  { 0x8e00, 0x2170, 0x2000 },

+  { 0x0e00, 0x216f, 0x0000 },

+  { 0x0e00, 0x2171, 0x0000 },

+  { 0x8e00, 0x217a, 0x4000 },

+  { 0x8e00, 0x2176, 0x3000 },

+  { 0x8e00, 0x2174, 0x2000 },

+  { 0x0e00, 0x2173, 0x0000 },

+  { 0x0e00, 0x2175, 0x0000 },

+  { 0x8e00, 0x2178, 0x2000 },

+  { 0x0e00, 0x2177, 0x0000 },

+  { 0x0e00, 0x2179, 0x0000 },

+  { 0x8e00, 0x217e, 0x3000 },

+  { 0x8e00, 0x217c, 0x2000 },

+  { 0x0e00, 0x217b, 0x0000 },

+  { 0x0e00, 0x217d, 0x0000 },

+  { 0x8e00, 0x2180, 0x2000 },

+  { 0x0e00, 0x217f, 0x0000 },

+  { 0x0e00, 0x2181, 0x0000 },

+  { 0x9a00, 0x219e, 0x5000 },

+  { 0x9a00, 0x2196, 0x4000 },

+  { 0x9900, 0x2192, 0x3000 },

+  { 0x9900, 0x2190, 0x2000 },

+  { 0x0e00, 0x2183, 0x0000 },

+  { 0x1900, 0x2191, 0x0000 },

+  { 0x9900, 0x2194, 0x2000 },

+  { 0x1900, 0x2193, 0x0000 },

+  { 0x1a00, 0x2195, 0x0000 },

+  { 0x9900, 0x219a, 0x3000 },

+  { 0x9a00, 0x2198, 0x2000 },

+  { 0x1a00, 0x2197, 0x0000 },

+  { 0x1a00, 0x2199, 0x0000 },

+  { 0x9a00, 0x219c, 0x2000 },

+  { 0x1900, 0x219b, 0x0000 },

+  { 0x1a00, 0x219d, 0x0000 },

+  { 0x9900, 0x21a6, 0x4000 },

+  { 0x9a00, 0x21a2, 0x3000 },

+  { 0x9900, 0x21a0, 0x2000 },

+  { 0x1a00, 0x219f, 0x0000 },

+  { 0x1a00, 0x21a1, 0x0000 },

+  { 0x9a00, 0x21a4, 0x2000 },

+  { 0x1900, 0x21a3, 0x0000 },

+  { 0x1a00, 0x21a5, 0x0000 },

+  { 0x9a00, 0x21aa, 0x3000 },

+  { 0x9a00, 0x21a8, 0x2000 },

+  { 0x1a00, 0x21a7, 0x0000 },

+  { 0x1a00, 0x21a9, 0x0000 },

+  { 0x9a00, 0x21ac, 0x2000 },

+  { 0x1a00, 0x21ab, 0x0000 },

+  { 0x1a00, 0x21ad, 0x0000 },

+  { 0x9900, 0x222e, 0x8000 },

+  { 0x9a00, 0x21ee, 0x7000 },

+  { 0x9900, 0x21ce, 0x6000 },

+  { 0x9a00, 0x21be, 0x5000 },

+  { 0x9a00, 0x21b6, 0x4000 },

+  { 0x9a00, 0x21b2, 0x3000 },

+  { 0x9a00, 0x21b0, 0x2000 },

+  { 0x1a00, 0x21af, 0x0000 },

+  { 0x1a00, 0x21b1, 0x0000 },

+  { 0x9a00, 0x21b4, 0x2000 },

+  { 0x1a00, 0x21b3, 0x0000 },

+  { 0x1a00, 0x21b5, 0x0000 },

+  { 0x9a00, 0x21ba, 0x3000 },

+  { 0x9a00, 0x21b8, 0x2000 },

+  { 0x1a00, 0x21b7, 0x0000 },

+  { 0x1a00, 0x21b9, 0x0000 },

+  { 0x9a00, 0x21bc, 0x2000 },

+  { 0x1a00, 0x21bb, 0x0000 },

+  { 0x1a00, 0x21bd, 0x0000 },

+  { 0x9a00, 0x21c6, 0x4000 },

+  { 0x9a00, 0x21c2, 0x3000 },

+  { 0x9a00, 0x21c0, 0x2000 },

+  { 0x1a00, 0x21bf, 0x0000 },

+  { 0x1a00, 0x21c1, 0x0000 },

+  { 0x9a00, 0x21c4, 0x2000 },

+  { 0x1a00, 0x21c3, 0x0000 },

+  { 0x1a00, 0x21c5, 0x0000 },

+  { 0x9a00, 0x21ca, 0x3000 },

+  { 0x9a00, 0x21c8, 0x2000 },

+  { 0x1a00, 0x21c7, 0x0000 },

+  { 0x1a00, 0x21c9, 0x0000 },

+  { 0x9a00, 0x21cc, 0x2000 },

+  { 0x1a00, 0x21cb, 0x0000 },

+  { 0x1a00, 0x21cd, 0x0000 },

+  { 0x9a00, 0x21de, 0x5000 },

+  { 0x9a00, 0x21d6, 0x4000 },

+  { 0x9900, 0x21d2, 0x3000 },

+  { 0x9a00, 0x21d0, 0x2000 },

+  { 0x1900, 0x21cf, 0x0000 },

+  { 0x1a00, 0x21d1, 0x0000 },

+  { 0x9900, 0x21d4, 0x2000 },

+  { 0x1a00, 0x21d3, 0x0000 },

+  { 0x1a00, 0x21d5, 0x0000 },

+  { 0x9a00, 0x21da, 0x3000 },

+  { 0x9a00, 0x21d8, 0x2000 },

+  { 0x1a00, 0x21d7, 0x0000 },

+  { 0x1a00, 0x21d9, 0x0000 },

+  { 0x9a00, 0x21dc, 0x2000 },

+  { 0x1a00, 0x21db, 0x0000 },

+  { 0x1a00, 0x21dd, 0x0000 },

+  { 0x9a00, 0x21e6, 0x4000 },

+  { 0x9a00, 0x21e2, 0x3000 },

+  { 0x9a00, 0x21e0, 0x2000 },

+  { 0x1a00, 0x21df, 0x0000 },

+  { 0x1a00, 0x21e1, 0x0000 },

+  { 0x9a00, 0x21e4, 0x2000 },

+  { 0x1a00, 0x21e3, 0x0000 },

+  { 0x1a00, 0x21e5, 0x0000 },

+  { 0x9a00, 0x21ea, 0x3000 },

+  { 0x9a00, 0x21e8, 0x2000 },

+  { 0x1a00, 0x21e7, 0x0000 },

+  { 0x1a00, 0x21e9, 0x0000 },

+  { 0x9a00, 0x21ec, 0x2000 },

+  { 0x1a00, 0x21eb, 0x0000 },

+  { 0x1a00, 0x21ed, 0x0000 },

+  { 0x9900, 0x220e, 0x6000 },

+  { 0x9900, 0x21fe, 0x5000 },

+  { 0x9900, 0x21f6, 0x4000 },

+  { 0x9a00, 0x21f2, 0x3000 },

+  { 0x9a00, 0x21f0, 0x2000 },

+  { 0x1a00, 0x21ef, 0x0000 },

+  { 0x1a00, 0x21f1, 0x0000 },

+  { 0x9900, 0x21f4, 0x2000 },

+  { 0x1a00, 0x21f3, 0x0000 },

+  { 0x1900, 0x21f5, 0x0000 },

+  { 0x9900, 0x21fa, 0x3000 },

+  { 0x9900, 0x21f8, 0x2000 },

+  { 0x1900, 0x21f7, 0x0000 },

+  { 0x1900, 0x21f9, 0x0000 },

+  { 0x9900, 0x21fc, 0x2000 },

+  { 0x1900, 0x21fb, 0x0000 },

+  { 0x1900, 0x21fd, 0x0000 },

+  { 0x9900, 0x2206, 0x4000 },

+  { 0x9900, 0x2202, 0x3000 },

+  { 0x9900, 0x2200, 0x2000 },

+  { 0x1900, 0x21ff, 0x0000 },

+  { 0x1900, 0x2201, 0x0000 },

+  { 0x9900, 0x2204, 0x2000 },

+  { 0x1900, 0x2203, 0x0000 },

+  { 0x1900, 0x2205, 0x0000 },

+  { 0x9900, 0x220a, 0x3000 },

+  { 0x9900, 0x2208, 0x2000 },

+  { 0x1900, 0x2207, 0x0000 },

+  { 0x1900, 0x2209, 0x0000 },

+  { 0x9900, 0x220c, 0x2000 },

+  { 0x1900, 0x220b, 0x0000 },

+  { 0x1900, 0x220d, 0x0000 },

+  { 0x9900, 0x221e, 0x5000 },

+  { 0x9900, 0x2216, 0x4000 },

+  { 0x9900, 0x2212, 0x3000 },

+  { 0x9900, 0x2210, 0x2000 },

+  { 0x1900, 0x220f, 0x0000 },

+  { 0x1900, 0x2211, 0x0000 },

+  { 0x9900, 0x2214, 0x2000 },

+  { 0x1900, 0x2213, 0x0000 },

+  { 0x1900, 0x2215, 0x0000 },

+  { 0x9900, 0x221a, 0x3000 },

+  { 0x9900, 0x2218, 0x2000 },

+  { 0x1900, 0x2217, 0x0000 },

+  { 0x1900, 0x2219, 0x0000 },

+  { 0x9900, 0x221c, 0x2000 },

+  { 0x1900, 0x221b, 0x0000 },

+  { 0x1900, 0x221d, 0x0000 },

+  { 0x9900, 0x2226, 0x4000 },

+  { 0x9900, 0x2222, 0x3000 },

+  { 0x9900, 0x2220, 0x2000 },

+  { 0x1900, 0x221f, 0x0000 },

+  { 0x1900, 0x2221, 0x0000 },

+  { 0x9900, 0x2224, 0x2000 },

+  { 0x1900, 0x2223, 0x0000 },

+  { 0x1900, 0x2225, 0x0000 },

+  { 0x9900, 0x222a, 0x3000 },

+  { 0x9900, 0x2228, 0x2000 },

+  { 0x1900, 0x2227, 0x0000 },

+  { 0x1900, 0x2229, 0x0000 },

+  { 0x9900, 0x222c, 0x2000 },

+  { 0x1900, 0x222b, 0x0000 },

+  { 0x1900, 0x222d, 0x0000 },

+  { 0x9900, 0x226e, 0x7000 },

+  { 0x9900, 0x224e, 0x6000 },

+  { 0x9900, 0x223e, 0x5000 },

+  { 0x9900, 0x2236, 0x4000 },

+  { 0x9900, 0x2232, 0x3000 },

+  { 0x9900, 0x2230, 0x2000 },

+  { 0x1900, 0x222f, 0x0000 },

+  { 0x1900, 0x2231, 0x0000 },

+  { 0x9900, 0x2234, 0x2000 },

+  { 0x1900, 0x2233, 0x0000 },

+  { 0x1900, 0x2235, 0x0000 },

+  { 0x9900, 0x223a, 0x3000 },

+  { 0x9900, 0x2238, 0x2000 },

+  { 0x1900, 0x2237, 0x0000 },

+  { 0x1900, 0x2239, 0x0000 },

+  { 0x9900, 0x223c, 0x2000 },

+  { 0x1900, 0x223b, 0x0000 },

+  { 0x1900, 0x223d, 0x0000 },

+  { 0x9900, 0x2246, 0x4000 },

+  { 0x9900, 0x2242, 0x3000 },

+  { 0x9900, 0x2240, 0x2000 },

+  { 0x1900, 0x223f, 0x0000 },

+  { 0x1900, 0x2241, 0x0000 },

+  { 0x9900, 0x2244, 0x2000 },

+  { 0x1900, 0x2243, 0x0000 },

+  { 0x1900, 0x2245, 0x0000 },

+  { 0x9900, 0x224a, 0x3000 },

+  { 0x9900, 0x2248, 0x2000 },

+  { 0x1900, 0x2247, 0x0000 },

+  { 0x1900, 0x2249, 0x0000 },

+  { 0x9900, 0x224c, 0x2000 },

+  { 0x1900, 0x224b, 0x0000 },

+  { 0x1900, 0x224d, 0x0000 },

+  { 0x9900, 0x225e, 0x5000 },

+  { 0x9900, 0x2256, 0x4000 },

+  { 0x9900, 0x2252, 0x3000 },

+  { 0x9900, 0x2250, 0x2000 },

+  { 0x1900, 0x224f, 0x0000 },

+  { 0x1900, 0x2251, 0x0000 },

+  { 0x9900, 0x2254, 0x2000 },

+  { 0x1900, 0x2253, 0x0000 },

+  { 0x1900, 0x2255, 0x0000 },

+  { 0x9900, 0x225a, 0x3000 },

+  { 0x9900, 0x2258, 0x2000 },

+  { 0x1900, 0x2257, 0x0000 },

+  { 0x1900, 0x2259, 0x0000 },

+  { 0x9900, 0x225c, 0x2000 },

+  { 0x1900, 0x225b, 0x0000 },

+  { 0x1900, 0x225d, 0x0000 },

+  { 0x9900, 0x2266, 0x4000 },

+  { 0x9900, 0x2262, 0x3000 },

+  { 0x9900, 0x2260, 0x2000 },

+  { 0x1900, 0x225f, 0x0000 },

+  { 0x1900, 0x2261, 0x0000 },

+  { 0x9900, 0x2264, 0x2000 },

+  { 0x1900, 0x2263, 0x0000 },

+  { 0x1900, 0x2265, 0x0000 },

+  { 0x9900, 0x226a, 0x3000 },

+  { 0x9900, 0x2268, 0x2000 },

+  { 0x1900, 0x2267, 0x0000 },

+  { 0x1900, 0x2269, 0x0000 },

+  { 0x9900, 0x226c, 0x2000 },

+  { 0x1900, 0x226b, 0x0000 },

+  { 0x1900, 0x226d, 0x0000 },

+  { 0x9900, 0x228e, 0x6000 },

+  { 0x9900, 0x227e, 0x5000 },

+  { 0x9900, 0x2276, 0x4000 },

+  { 0x9900, 0x2272, 0x3000 },

+  { 0x9900, 0x2270, 0x2000 },

+  { 0x1900, 0x226f, 0x0000 },

+  { 0x1900, 0x2271, 0x0000 },

+  { 0x9900, 0x2274, 0x2000 },

+  { 0x1900, 0x2273, 0x0000 },

+  { 0x1900, 0x2275, 0x0000 },

+  { 0x9900, 0x227a, 0x3000 },

+  { 0x9900, 0x2278, 0x2000 },

+  { 0x1900, 0x2277, 0x0000 },

+  { 0x1900, 0x2279, 0x0000 },

+  { 0x9900, 0x227c, 0x2000 },

+  { 0x1900, 0x227b, 0x0000 },

+  { 0x1900, 0x227d, 0x0000 },

+  { 0x9900, 0x2286, 0x4000 },

+  { 0x9900, 0x2282, 0x3000 },

+  { 0x9900, 0x2280, 0x2000 },

+  { 0x1900, 0x227f, 0x0000 },

+  { 0x1900, 0x2281, 0x0000 },

+  { 0x9900, 0x2284, 0x2000 },

+  { 0x1900, 0x2283, 0x0000 },

+  { 0x1900, 0x2285, 0x0000 },

+  { 0x9900, 0x228a, 0x3000 },

+  { 0x9900, 0x2288, 0x2000 },

+  { 0x1900, 0x2287, 0x0000 },

+  { 0x1900, 0x2289, 0x0000 },

+  { 0x9900, 0x228c, 0x2000 },

+  { 0x1900, 0x228b, 0x0000 },

+  { 0x1900, 0x228d, 0x0000 },

+  { 0x9900, 0x229e, 0x5000 },

+  { 0x9900, 0x2296, 0x4000 },

+  { 0x9900, 0x2292, 0x3000 },

+  { 0x9900, 0x2290, 0x2000 },

+  { 0x1900, 0x228f, 0x0000 },

+  { 0x1900, 0x2291, 0x0000 },

+  { 0x9900, 0x2294, 0x2000 },

+  { 0x1900, 0x2293, 0x0000 },

+  { 0x1900, 0x2295, 0x0000 },

+  { 0x9900, 0x229a, 0x3000 },

+  { 0x9900, 0x2298, 0x2000 },

+  { 0x1900, 0x2297, 0x0000 },

+  { 0x1900, 0x2299, 0x0000 },

+  { 0x9900, 0x229c, 0x2000 },

+  { 0x1900, 0x229b, 0x0000 },

+  { 0x1900, 0x229d, 0x0000 },

+  { 0x9900, 0x22a6, 0x4000 },

+  { 0x9900, 0x22a2, 0x3000 },

+  { 0x9900, 0x22a0, 0x2000 },

+  { 0x1900, 0x229f, 0x0000 },

+  { 0x1900, 0x22a1, 0x0000 },

+  { 0x9900, 0x22a4, 0x2000 },

+  { 0x1900, 0x22a3, 0x0000 },

+  { 0x1900, 0x22a5, 0x0000 },

+  { 0x9900, 0x22aa, 0x3000 },

+  { 0x9900, 0x22a8, 0x2000 },

+  { 0x1900, 0x22a7, 0x0000 },

+  { 0x1900, 0x22a9, 0x0000 },

+  { 0x9900, 0x22ac, 0x2000 },

+  { 0x1900, 0x22ab, 0x0000 },

+  { 0x1900, 0x22ad, 0x0000 },

+  { 0x8f00, 0x2787, 0xb000 },

+  { 0x9a00, 0x250b, 0xa000 },

+  { 0x9900, 0x23ae, 0x9000 },

+  { 0x9a00, 0x232e, 0x8000 },

+  { 0x9900, 0x22ee, 0x7000 },

+  { 0x9900, 0x22ce, 0x6000 },

+  { 0x9900, 0x22be, 0x5000 },

+  { 0x9900, 0x22b6, 0x4000 },

+  { 0x9900, 0x22b2, 0x3000 },

+  { 0x9900, 0x22b0, 0x2000 },

+  { 0x1900, 0x22af, 0x0000 },

+  { 0x1900, 0x22b1, 0x0000 },

+  { 0x9900, 0x22b4, 0x2000 },

+  { 0x1900, 0x22b3, 0x0000 },

+  { 0x1900, 0x22b5, 0x0000 },

+  { 0x9900, 0x22ba, 0x3000 },

+  { 0x9900, 0x22b8, 0x2000 },

+  { 0x1900, 0x22b7, 0x0000 },

+  { 0x1900, 0x22b9, 0x0000 },

+  { 0x9900, 0x22bc, 0x2000 },

+  { 0x1900, 0x22bb, 0x0000 },

+  { 0x1900, 0x22bd, 0x0000 },

+  { 0x9900, 0x22c6, 0x4000 },

+  { 0x9900, 0x22c2, 0x3000 },

+  { 0x9900, 0x22c0, 0x2000 },

+  { 0x1900, 0x22bf, 0x0000 },

+  { 0x1900, 0x22c1, 0x0000 },

+  { 0x9900, 0x22c4, 0x2000 },

+  { 0x1900, 0x22c3, 0x0000 },

+  { 0x1900, 0x22c5, 0x0000 },

+  { 0x9900, 0x22ca, 0x3000 },

+  { 0x9900, 0x22c8, 0x2000 },

+  { 0x1900, 0x22c7, 0x0000 },

+  { 0x1900, 0x22c9, 0x0000 },

+  { 0x9900, 0x22cc, 0x2000 },

+  { 0x1900, 0x22cb, 0x0000 },

+  { 0x1900, 0x22cd, 0x0000 },

+  { 0x9900, 0x22de, 0x5000 },

+  { 0x9900, 0x22d6, 0x4000 },

+  { 0x9900, 0x22d2, 0x3000 },

+  { 0x9900, 0x22d0, 0x2000 },

+  { 0x1900, 0x22cf, 0x0000 },

+  { 0x1900, 0x22d1, 0x0000 },

+  { 0x9900, 0x22d4, 0x2000 },

+  { 0x1900, 0x22d3, 0x0000 },

+  { 0x1900, 0x22d5, 0x0000 },

+  { 0x9900, 0x22da, 0x3000 },

+  { 0x9900, 0x22d8, 0x2000 },

+  { 0x1900, 0x22d7, 0x0000 },

+  { 0x1900, 0x22d9, 0x0000 },

+  { 0x9900, 0x22dc, 0x2000 },

+  { 0x1900, 0x22db, 0x0000 },

+  { 0x1900, 0x22dd, 0x0000 },

+  { 0x9900, 0x22e6, 0x4000 },

+  { 0x9900, 0x22e2, 0x3000 },

+  { 0x9900, 0x22e0, 0x2000 },

+  { 0x1900, 0x22df, 0x0000 },

+  { 0x1900, 0x22e1, 0x0000 },

+  { 0x9900, 0x22e4, 0x2000 },

+  { 0x1900, 0x22e3, 0x0000 },

+  { 0x1900, 0x22e5, 0x0000 },

+  { 0x9900, 0x22ea, 0x3000 },

+  { 0x9900, 0x22e8, 0x2000 },

+  { 0x1900, 0x22e7, 0x0000 },

+  { 0x1900, 0x22e9, 0x0000 },

+  { 0x9900, 0x22ec, 0x2000 },

+  { 0x1900, 0x22eb, 0x0000 },

+  { 0x1900, 0x22ed, 0x0000 },

+  { 0x9a00, 0x230e, 0x6000 },

+  { 0x9900, 0x22fe, 0x5000 },

+  { 0x9900, 0x22f6, 0x4000 },

+  { 0x9900, 0x22f2, 0x3000 },

+  { 0x9900, 0x22f0, 0x2000 },

+  { 0x1900, 0x22ef, 0x0000 },

+  { 0x1900, 0x22f1, 0x0000 },

+  { 0x9900, 0x22f4, 0x2000 },

+  { 0x1900, 0x22f3, 0x0000 },

+  { 0x1900, 0x22f5, 0x0000 },

+  { 0x9900, 0x22fa, 0x3000 },

+  { 0x9900, 0x22f8, 0x2000 },

+  { 0x1900, 0x22f7, 0x0000 },

+  { 0x1900, 0x22f9, 0x0000 },

+  { 0x9900, 0x22fc, 0x2000 },

+  { 0x1900, 0x22fb, 0x0000 },

+  { 0x1900, 0x22fd, 0x0000 },

+  { 0x9a00, 0x2306, 0x4000 },

+  { 0x9a00, 0x2302, 0x3000 },

+  { 0x9a00, 0x2300, 0x2000 },

+  { 0x1900, 0x22ff, 0x0000 },

+  { 0x1a00, 0x2301, 0x0000 },

+  { 0x9a00, 0x2304, 0x2000 },

+  { 0x1a00, 0x2303, 0x0000 },

+  { 0x1a00, 0x2305, 0x0000 },

+  { 0x9900, 0x230a, 0x3000 },

+  { 0x9900, 0x2308, 0x2000 },

+  { 0x1a00, 0x2307, 0x0000 },

+  { 0x1900, 0x2309, 0x0000 },

+  { 0x9a00, 0x230c, 0x2000 },

+  { 0x1900, 0x230b, 0x0000 },

+  { 0x1a00, 0x230d, 0x0000 },

+  { 0x9a00, 0x231e, 0x5000 },

+  { 0x9a00, 0x2316, 0x4000 },

+  { 0x9a00, 0x2312, 0x3000 },

+  { 0x9a00, 0x2310, 0x2000 },

+  { 0x1a00, 0x230f, 0x0000 },

+  { 0x1a00, 0x2311, 0x0000 },

+  { 0x9a00, 0x2314, 0x2000 },

+  { 0x1a00, 0x2313, 0x0000 },

+  { 0x1a00, 0x2315, 0x0000 },

+  { 0x9a00, 0x231a, 0x3000 },

+  { 0x9a00, 0x2318, 0x2000 },

+  { 0x1a00, 0x2317, 0x0000 },

+  { 0x1a00, 0x2319, 0x0000 },

+  { 0x9a00, 0x231c, 0x2000 },

+  { 0x1a00, 0x231b, 0x0000 },

+  { 0x1a00, 0x231d, 0x0000 },

+  { 0x9a00, 0x2326, 0x4000 },

+  { 0x9a00, 0x2322, 0x3000 },

+  { 0x9900, 0x2320, 0x2000 },

+  { 0x1a00, 0x231f, 0x0000 },

+  { 0x1900, 0x2321, 0x0000 },

+  { 0x9a00, 0x2324, 0x2000 },

+  { 0x1a00, 0x2323, 0x0000 },

+  { 0x1a00, 0x2325, 0x0000 },

+  { 0x9200, 0x232a, 0x3000 },

+  { 0x9a00, 0x2328, 0x2000 },

+  { 0x1a00, 0x2327, 0x0000 },

+  { 0x1600, 0x2329, 0x0000 },

+  { 0x9a00, 0x232c, 0x2000 },

+  { 0x1a00, 0x232b, 0x0000 },

+  { 0x1a00, 0x232d, 0x0000 },

+  { 0x9a00, 0x236e, 0x7000 },

+  { 0x9a00, 0x234e, 0x6000 },

+  { 0x9a00, 0x233e, 0x5000 },

+  { 0x9a00, 0x2336, 0x4000 },

+  { 0x9a00, 0x2332, 0x3000 },

+  { 0x9a00, 0x2330, 0x2000 },

+  { 0x1a00, 0x232f, 0x0000 },

+  { 0x1a00, 0x2331, 0x0000 },

+  { 0x9a00, 0x2334, 0x2000 },

+  { 0x1a00, 0x2333, 0x0000 },

+  { 0x1a00, 0x2335, 0x0000 },

+  { 0x9a00, 0x233a, 0x3000 },

+  { 0x9a00, 0x2338, 0x2000 },

+  { 0x1a00, 0x2337, 0x0000 },

+  { 0x1a00, 0x2339, 0x0000 },

+  { 0x9a00, 0x233c, 0x2000 },

+  { 0x1a00, 0x233b, 0x0000 },

+  { 0x1a00, 0x233d, 0x0000 },

+  { 0x9a00, 0x2346, 0x4000 },

+  { 0x9a00, 0x2342, 0x3000 },

+  { 0x9a00, 0x2340, 0x2000 },

+  { 0x1a00, 0x233f, 0x0000 },

+  { 0x1a00, 0x2341, 0x0000 },

+  { 0x9a00, 0x2344, 0x2000 },

+  { 0x1a00, 0x2343, 0x0000 },

+  { 0x1a00, 0x2345, 0x0000 },

+  { 0x9a00, 0x234a, 0x3000 },

+  { 0x9a00, 0x2348, 0x2000 },

+  { 0x1a00, 0x2347, 0x0000 },

+  { 0x1a00, 0x2349, 0x0000 },

+  { 0x9a00, 0x234c, 0x2000 },

+  { 0x1a00, 0x234b, 0x0000 },

+  { 0x1a00, 0x234d, 0x0000 },

+  { 0x9a00, 0x235e, 0x5000 },

+  { 0x9a00, 0x2356, 0x4000 },

+  { 0x9a00, 0x2352, 0x3000 },

+  { 0x9a00, 0x2350, 0x2000 },

+  { 0x1a00, 0x234f, 0x0000 },

+  { 0x1a00, 0x2351, 0x0000 },

+  { 0x9a00, 0x2354, 0x2000 },

+  { 0x1a00, 0x2353, 0x0000 },

+  { 0x1a00, 0x2355, 0x0000 },

+  { 0x9a00, 0x235a, 0x3000 },

+  { 0x9a00, 0x2358, 0x2000 },

+  { 0x1a00, 0x2357, 0x0000 },

+  { 0x1a00, 0x2359, 0x0000 },

+  { 0x9a00, 0x235c, 0x2000 },

+  { 0x1a00, 0x235b, 0x0000 },

+  { 0x1a00, 0x235d, 0x0000 },

+  { 0x9a00, 0x2366, 0x4000 },

+  { 0x9a00, 0x2362, 0x3000 },

+  { 0x9a00, 0x2360, 0x2000 },

+  { 0x1a00, 0x235f, 0x0000 },

+  { 0x1a00, 0x2361, 0x0000 },

+  { 0x9a00, 0x2364, 0x2000 },

+  { 0x1a00, 0x2363, 0x0000 },

+  { 0x1a00, 0x2365, 0x0000 },

+  { 0x9a00, 0x236a, 0x3000 },

+  { 0x9a00, 0x2368, 0x2000 },

+  { 0x1a00, 0x2367, 0x0000 },

+  { 0x1a00, 0x2369, 0x0000 },

+  { 0x9a00, 0x236c, 0x2000 },

+  { 0x1a00, 0x236b, 0x0000 },

+  { 0x1a00, 0x236d, 0x0000 },

+  { 0x9a00, 0x238e, 0x6000 },

+  { 0x9a00, 0x237e, 0x5000 },

+  { 0x9a00, 0x2376, 0x4000 },

+  { 0x9a00, 0x2372, 0x3000 },

+  { 0x9a00, 0x2370, 0x2000 },

+  { 0x1a00, 0x236f, 0x0000 },

+  { 0x1a00, 0x2371, 0x0000 },

+  { 0x9a00, 0x2374, 0x2000 },

+  { 0x1a00, 0x2373, 0x0000 },

+  { 0x1a00, 0x2375, 0x0000 },

+  { 0x9a00, 0x237a, 0x3000 },

+  { 0x9a00, 0x2378, 0x2000 },

+  { 0x1a00, 0x2377, 0x0000 },

+  { 0x1a00, 0x2379, 0x0000 },

+  { 0x9900, 0x237c, 0x2000 },

+  { 0x1a00, 0x237b, 0x0000 },

+  { 0x1a00, 0x237d, 0x0000 },

+  { 0x9a00, 0x2386, 0x4000 },

+  { 0x9a00, 0x2382, 0x3000 },

+  { 0x9a00, 0x2380, 0x2000 },

+  { 0x1a00, 0x237f, 0x0000 },

+  { 0x1a00, 0x2381, 0x0000 },

+  { 0x9a00, 0x2384, 0x2000 },

+  { 0x1a00, 0x2383, 0x0000 },

+  { 0x1a00, 0x2385, 0x0000 },

+  { 0x9a00, 0x238a, 0x3000 },

+  { 0x9a00, 0x2388, 0x2000 },

+  { 0x1a00, 0x2387, 0x0000 },

+  { 0x1a00, 0x2389, 0x0000 },

+  { 0x9a00, 0x238c, 0x2000 },

+  { 0x1a00, 0x238b, 0x0000 },

+  { 0x1a00, 0x238d, 0x0000 },

+  { 0x9900, 0x239e, 0x5000 },

+  { 0x9a00, 0x2396, 0x4000 },

+  { 0x9a00, 0x2392, 0x3000 },

+  { 0x9a00, 0x2390, 0x2000 },

+  { 0x1a00, 0x238f, 0x0000 },

+  { 0x1a00, 0x2391, 0x0000 },

+  { 0x9a00, 0x2394, 0x2000 },

+  { 0x1a00, 0x2393, 0x0000 },

+  { 0x1a00, 0x2395, 0x0000 },

+  { 0x9a00, 0x239a, 0x3000 },

+  { 0x9a00, 0x2398, 0x2000 },

+  { 0x1a00, 0x2397, 0x0000 },

+  { 0x1a00, 0x2399, 0x0000 },

+  { 0x9900, 0x239c, 0x2000 },

+  { 0x1900, 0x239b, 0x0000 },

+  { 0x1900, 0x239d, 0x0000 },

+  { 0x9900, 0x23a6, 0x4000 },

+  { 0x9900, 0x23a2, 0x3000 },

+  { 0x9900, 0x23a0, 0x2000 },

+  { 0x1900, 0x239f, 0x0000 },

+  { 0x1900, 0x23a1, 0x0000 },

+  { 0x9900, 0x23a4, 0x2000 },

+  { 0x1900, 0x23a3, 0x0000 },

+  { 0x1900, 0x23a5, 0x0000 },

+  { 0x9900, 0x23aa, 0x3000 },

+  { 0x9900, 0x23a8, 0x2000 },

+  { 0x1900, 0x23a7, 0x0000 },

+  { 0x1900, 0x23a9, 0x0000 },

+  { 0x9900, 0x23ac, 0x2000 },

+  { 0x1900, 0x23ab, 0x0000 },

+  { 0x1900, 0x23ad, 0x0000 },

+  { 0x8f00, 0x248b, 0x8000 },

+  { 0x9a00, 0x241d, 0x7000 },

+  { 0x9a00, 0x23ce, 0x6000 },

+  { 0x9a00, 0x23be, 0x5000 },

+  { 0x9500, 0x23b6, 0x4000 },

+  { 0x9900, 0x23b2, 0x3000 },

+  { 0x9900, 0x23b0, 0x2000 },

+  { 0x1900, 0x23af, 0x0000 },

+  { 0x1900, 0x23b1, 0x0000 },

+  { 0x9600, 0x23b4, 0x2000 },

+  { 0x1900, 0x23b3, 0x0000 },

+  { 0x1200, 0x23b5, 0x0000 },

+  { 0x9a00, 0x23ba, 0x3000 },

+  { 0x9a00, 0x23b8, 0x2000 },

+  { 0x1a00, 0x23b7, 0x0000 },

+  { 0x1a00, 0x23b9, 0x0000 },

+  { 0x9a00, 0x23bc, 0x2000 },

+  { 0x1a00, 0x23bb, 0x0000 },

+  { 0x1a00, 0x23bd, 0x0000 },

+  { 0x9a00, 0x23c6, 0x4000 },

+  { 0x9a00, 0x23c2, 0x3000 },

+  { 0x9a00, 0x23c0, 0x2000 },

+  { 0x1a00, 0x23bf, 0x0000 },

+  { 0x1a00, 0x23c1, 0x0000 },

+  { 0x9a00, 0x23c4, 0x2000 },

+  { 0x1a00, 0x23c3, 0x0000 },

+  { 0x1a00, 0x23c5, 0x0000 },

+  { 0x9a00, 0x23ca, 0x3000 },

+  { 0x9a00, 0x23c8, 0x2000 },

+  { 0x1a00, 0x23c7, 0x0000 },

+  { 0x1a00, 0x23c9, 0x0000 },

+  { 0x9a00, 0x23cc, 0x2000 },

+  { 0x1a00, 0x23cb, 0x0000 },

+  { 0x1a00, 0x23cd, 0x0000 },

+  { 0x9a00, 0x240d, 0x5000 },

+  { 0x9a00, 0x2405, 0x4000 },

+  { 0x9a00, 0x2401, 0x3000 },

+  { 0x9a00, 0x23d0, 0x2000 },

+  { 0x1a00, 0x23cf, 0x0000 },

+  { 0x1a00, 0x2400, 0x0000 },

+  { 0x9a00, 0x2403, 0x2000 },

+  { 0x1a00, 0x2402, 0x0000 },

+  { 0x1a00, 0x2404, 0x0000 },

+  { 0x9a00, 0x2409, 0x3000 },

+  { 0x9a00, 0x2407, 0x2000 },

+  { 0x1a00, 0x2406, 0x0000 },

+  { 0x1a00, 0x2408, 0x0000 },

+  { 0x9a00, 0x240b, 0x2000 },

+  { 0x1a00, 0x240a, 0x0000 },

+  { 0x1a00, 0x240c, 0x0000 },

+  { 0x9a00, 0x2415, 0x4000 },

+  { 0x9a00, 0x2411, 0x3000 },

+  { 0x9a00, 0x240f, 0x2000 },

+  { 0x1a00, 0x240e, 0x0000 },

+  { 0x1a00, 0x2410, 0x0000 },

+  { 0x9a00, 0x2413, 0x2000 },

+  { 0x1a00, 0x2412, 0x0000 },

+  { 0x1a00, 0x2414, 0x0000 },

+  { 0x9a00, 0x2419, 0x3000 },

+  { 0x9a00, 0x2417, 0x2000 },

+  { 0x1a00, 0x2416, 0x0000 },

+  { 0x1a00, 0x2418, 0x0000 },

+  { 0x9a00, 0x241b, 0x2000 },

+  { 0x1a00, 0x241a, 0x0000 },

+  { 0x1a00, 0x241c, 0x0000 },

+  { 0x8f00, 0x246b, 0x6000 },

+  { 0x9a00, 0x2446, 0x5000 },

+  { 0x9a00, 0x2425, 0x4000 },

+  { 0x9a00, 0x2421, 0x3000 },

+  { 0x9a00, 0x241f, 0x2000 },

+  { 0x1a00, 0x241e, 0x0000 },

+  { 0x1a00, 0x2420, 0x0000 },

+  { 0x9a00, 0x2423, 0x2000 },

+  { 0x1a00, 0x2422, 0x0000 },

+  { 0x1a00, 0x2424, 0x0000 },

+  { 0x9a00, 0x2442, 0x3000 },

+  { 0x9a00, 0x2440, 0x2000 },

+  { 0x1a00, 0x2426, 0x0000 },

+  { 0x1a00, 0x2441, 0x0000 },

+  { 0x9a00, 0x2444, 0x2000 },

+  { 0x1a00, 0x2443, 0x0000 },

+  { 0x1a00, 0x2445, 0x0000 },

+  { 0x8f00, 0x2463, 0x4000 },

+  { 0x9a00, 0x244a, 0x3000 },

+  { 0x9a00, 0x2448, 0x2000 },

+  { 0x1a00, 0x2447, 0x0000 },

+  { 0x1a00, 0x2449, 0x0000 },

+  { 0x8f00, 0x2461, 0x2000 },

+  { 0x0f00, 0x2460, 0x0000 },

+  { 0x0f00, 0x2462, 0x0000 },

+  { 0x8f00, 0x2467, 0x3000 },

+  { 0x8f00, 0x2465, 0x2000 },

+  { 0x0f00, 0x2464, 0x0000 },

+  { 0x0f00, 0x2466, 0x0000 },

+  { 0x8f00, 0x2469, 0x2000 },

+  { 0x0f00, 0x2468, 0x0000 },

+  { 0x0f00, 0x246a, 0x0000 },

+  { 0x8f00, 0x247b, 0x5000 },

+  { 0x8f00, 0x2473, 0x4000 },

+  { 0x8f00, 0x246f, 0x3000 },

+  { 0x8f00, 0x246d, 0x2000 },

+  { 0x0f00, 0x246c, 0x0000 },

+  { 0x0f00, 0x246e, 0x0000 },

+  { 0x8f00, 0x2471, 0x2000 },

+  { 0x0f00, 0x2470, 0x0000 },

+  { 0x0f00, 0x2472, 0x0000 },

+  { 0x8f00, 0x2477, 0x3000 },

+  { 0x8f00, 0x2475, 0x2000 },

+  { 0x0f00, 0x2474, 0x0000 },

+  { 0x0f00, 0x2476, 0x0000 },

+  { 0x8f00, 0x2479, 0x2000 },

+  { 0x0f00, 0x2478, 0x0000 },

+  { 0x0f00, 0x247a, 0x0000 },

+  { 0x8f00, 0x2483, 0x4000 },

+  { 0x8f00, 0x247f, 0x3000 },

+  { 0x8f00, 0x247d, 0x2000 },

+  { 0x0f00, 0x247c, 0x0000 },

+  { 0x0f00, 0x247e, 0x0000 },

+  { 0x8f00, 0x2481, 0x2000 },

+  { 0x0f00, 0x2480, 0x0000 },

+  { 0x0f00, 0x2482, 0x0000 },

+  { 0x8f00, 0x2487, 0x3000 },

+  { 0x8f00, 0x2485, 0x2000 },

+  { 0x0f00, 0x2484, 0x0000 },

+  { 0x0f00, 0x2486, 0x0000 },

+  { 0x8f00, 0x2489, 0x2000 },

+  { 0x0f00, 0x2488, 0x0000 },

+  { 0x0f00, 0x248a, 0x0000 },

+  { 0x9a00, 0x24cb, 0x7000 },

+  { 0x9a00, 0x24ab, 0x6000 },

+  { 0x8f00, 0x249b, 0x5000 },

+  { 0x8f00, 0x2493, 0x4000 },

+  { 0x8f00, 0x248f, 0x3000 },

+  { 0x8f00, 0x248d, 0x2000 },

+  { 0x0f00, 0x248c, 0x0000 },

+  { 0x0f00, 0x248e, 0x0000 },

+  { 0x8f00, 0x2491, 0x2000 },

+  { 0x0f00, 0x2490, 0x0000 },

+  { 0x0f00, 0x2492, 0x0000 },

+  { 0x8f00, 0x2497, 0x3000 },

+  { 0x8f00, 0x2495, 0x2000 },

+  { 0x0f00, 0x2494, 0x0000 },

+  { 0x0f00, 0x2496, 0x0000 },

+  { 0x8f00, 0x2499, 0x2000 },

+  { 0x0f00, 0x2498, 0x0000 },

+  { 0x0f00, 0x249a, 0x0000 },

+  { 0x9a00, 0x24a3, 0x4000 },

+  { 0x9a00, 0x249f, 0x3000 },

+  { 0x9a00, 0x249d, 0x2000 },

+  { 0x1a00, 0x249c, 0x0000 },

+  { 0x1a00, 0x249e, 0x0000 },

+  { 0x9a00, 0x24a1, 0x2000 },

+  { 0x1a00, 0x24a0, 0x0000 },

+  { 0x1a00, 0x24a2, 0x0000 },

+  { 0x9a00, 0x24a7, 0x3000 },

+  { 0x9a00, 0x24a5, 0x2000 },

+  { 0x1a00, 0x24a4, 0x0000 },

+  { 0x1a00, 0x24a6, 0x0000 },

+  { 0x9a00, 0x24a9, 0x2000 },

+  { 0x1a00, 0x24a8, 0x0000 },

+  { 0x1a00, 0x24aa, 0x0000 },

+  { 0x9a00, 0x24bb, 0x5000 },

+  { 0x9a00, 0x24b3, 0x4000 },

+  { 0x9a00, 0x24af, 0x3000 },

+  { 0x9a00, 0x24ad, 0x2000 },

+  { 0x1a00, 0x24ac, 0x0000 },

+  { 0x1a00, 0x24ae, 0x0000 },

+  { 0x9a00, 0x24b1, 0x2000 },

+  { 0x1a00, 0x24b0, 0x0000 },

+  { 0x1a00, 0x24b2, 0x0000 },

+  { 0x9a00, 0x24b7, 0x3000 },

+  { 0x9a00, 0x24b5, 0x2000 },

+  { 0x1a00, 0x24b4, 0x0000 },

+  { 0x1a00, 0x24b6, 0x0000 },

+  { 0x9a00, 0x24b9, 0x2000 },

+  { 0x1a00, 0x24b8, 0x0000 },

+  { 0x1a00, 0x24ba, 0x0000 },

+  { 0x9a00, 0x24c3, 0x4000 },

+  { 0x9a00, 0x24bf, 0x3000 },

+  { 0x9a00, 0x24bd, 0x2000 },

+  { 0x1a00, 0x24bc, 0x0000 },

+  { 0x1a00, 0x24be, 0x0000 },

+  { 0x9a00, 0x24c1, 0x2000 },

+  { 0x1a00, 0x24c0, 0x0000 },

+  { 0x1a00, 0x24c2, 0x0000 },

+  { 0x9a00, 0x24c7, 0x3000 },

+  { 0x9a00, 0x24c5, 0x2000 },

+  { 0x1a00, 0x24c4, 0x0000 },

+  { 0x1a00, 0x24c6, 0x0000 },

+  { 0x9a00, 0x24c9, 0x2000 },

+  { 0x1a00, 0x24c8, 0x0000 },

+  { 0x1a00, 0x24ca, 0x0000 },

+  { 0x8f00, 0x24eb, 0x6000 },

+  { 0x9a00, 0x24db, 0x5000 },

+  { 0x9a00, 0x24d3, 0x4000 },

+  { 0x9a00, 0x24cf, 0x3000 },

+  { 0x9a00, 0x24cd, 0x2000 },

+  { 0x1a00, 0x24cc, 0x0000 },

+  { 0x1a00, 0x24ce, 0x0000 },

+  { 0x9a00, 0x24d1, 0x2000 },

+  { 0x1a00, 0x24d0, 0x0000 },

+  { 0x1a00, 0x24d2, 0x0000 },

+  { 0x9a00, 0x24d7, 0x3000 },

+  { 0x9a00, 0x24d5, 0x2000 },

+  { 0x1a00, 0x24d4, 0x0000 },

+  { 0x1a00, 0x24d6, 0x0000 },

+  { 0x9a00, 0x24d9, 0x2000 },

+  { 0x1a00, 0x24d8, 0x0000 },

+  { 0x1a00, 0x24da, 0x0000 },

+  { 0x9a00, 0x24e3, 0x4000 },

+  { 0x9a00, 0x24df, 0x3000 },

+  { 0x9a00, 0x24dd, 0x2000 },

+  { 0x1a00, 0x24dc, 0x0000 },

+  { 0x1a00, 0x24de, 0x0000 },

+  { 0x9a00, 0x24e1, 0x2000 },

+  { 0x1a00, 0x24e0, 0x0000 },

+  { 0x1a00, 0x24e2, 0x0000 },

+  { 0x9a00, 0x24e7, 0x3000 },

+  { 0x9a00, 0x24e5, 0x2000 },

+  { 0x1a00, 0x24e4, 0x0000 },

+  { 0x1a00, 0x24e6, 0x0000 },

+  { 0x9a00, 0x24e9, 0x2000 },

+  { 0x1a00, 0x24e8, 0x0000 },

+  { 0x0f00, 0x24ea, 0x0000 },

+  { 0x8f00, 0x24fb, 0x5000 },

+  { 0x8f00, 0x24f3, 0x4000 },

+  { 0x8f00, 0x24ef, 0x3000 },

+  { 0x8f00, 0x24ed, 0x2000 },

+  { 0x0f00, 0x24ec, 0x0000 },

+  { 0x0f00, 0x24ee, 0x0000 },

+  { 0x8f00, 0x24f1, 0x2000 },

+  { 0x0f00, 0x24f0, 0x0000 },

+  { 0x0f00, 0x24f2, 0x0000 },

+  { 0x8f00, 0x24f7, 0x3000 },

+  { 0x8f00, 0x24f5, 0x2000 },

+  { 0x0f00, 0x24f4, 0x0000 },

+  { 0x0f00, 0x24f6, 0x0000 },

+  { 0x8f00, 0x24f9, 0x2000 },

+  { 0x0f00, 0x24f8, 0x0000 },

+  { 0x0f00, 0x24fa, 0x0000 },

+  { 0x9a00, 0x2503, 0x4000 },

+  { 0x8f00, 0x24ff, 0x3000 },

+  { 0x8f00, 0x24fd, 0x2000 },

+  { 0x0f00, 0x24fc, 0x0000 },

+  { 0x0f00, 0x24fe, 0x0000 },

+  { 0x9a00, 0x2501, 0x2000 },

+  { 0x1a00, 0x2500, 0x0000 },

+  { 0x1a00, 0x2502, 0x0000 },

+  { 0x9a00, 0x2507, 0x3000 },

+  { 0x9a00, 0x2505, 0x2000 },

+  { 0x1a00, 0x2504, 0x0000 },

+  { 0x1a00, 0x2506, 0x0000 },

+  { 0x9a00, 0x2509, 0x2000 },

+  { 0x1a00, 0x2508, 0x0000 },

+  { 0x1a00, 0x250a, 0x0000 },

+  { 0x9a00, 0x260b, 0x9000 },

+  { 0x9a00, 0x258b, 0x8000 },

+  { 0x9a00, 0x254b, 0x7000 },

+  { 0x9a00, 0x252b, 0x6000 },

+  { 0x9a00, 0x251b, 0x5000 },

+  { 0x9a00, 0x2513, 0x4000 },

+  { 0x9a00, 0x250f, 0x3000 },

+  { 0x9a00, 0x250d, 0x2000 },

+  { 0x1a00, 0x250c, 0x0000 },

+  { 0x1a00, 0x250e, 0x0000 },

+  { 0x9a00, 0x2511, 0x2000 },

+  { 0x1a00, 0x2510, 0x0000 },

+  { 0x1a00, 0x2512, 0x0000 },

+  { 0x9a00, 0x2517, 0x3000 },

+  { 0x9a00, 0x2515, 0x2000 },

+  { 0x1a00, 0x2514, 0x0000 },

+  { 0x1a00, 0x2516, 0x0000 },

+  { 0x9a00, 0x2519, 0x2000 },

+  { 0x1a00, 0x2518, 0x0000 },

+  { 0x1a00, 0x251a, 0x0000 },

+  { 0x9a00, 0x2523, 0x4000 },

+  { 0x9a00, 0x251f, 0x3000 },

+  { 0x9a00, 0x251d, 0x2000 },

+  { 0x1a00, 0x251c, 0x0000 },

+  { 0x1a00, 0x251e, 0x0000 },

+  { 0x9a00, 0x2521, 0x2000 },

+  { 0x1a00, 0x2520, 0x0000 },

+  { 0x1a00, 0x2522, 0x0000 },

+  { 0x9a00, 0x2527, 0x3000 },

+  { 0x9a00, 0x2525, 0x2000 },

+  { 0x1a00, 0x2524, 0x0000 },

+  { 0x1a00, 0x2526, 0x0000 },

+  { 0x9a00, 0x2529, 0x2000 },

+  { 0x1a00, 0x2528, 0x0000 },

+  { 0x1a00, 0x252a, 0x0000 },

+  { 0x9a00, 0x253b, 0x5000 },

+  { 0x9a00, 0x2533, 0x4000 },

+  { 0x9a00, 0x252f, 0x3000 },

+  { 0x9a00, 0x252d, 0x2000 },

+  { 0x1a00, 0x252c, 0x0000 },

+  { 0x1a00, 0x252e, 0x0000 },

+  { 0x9a00, 0x2531, 0x2000 },

+  { 0x1a00, 0x2530, 0x0000 },

+  { 0x1a00, 0x2532, 0x0000 },

+  { 0x9a00, 0x2537, 0x3000 },

+  { 0x9a00, 0x2535, 0x2000 },

+  { 0x1a00, 0x2534, 0x0000 },

+  { 0x1a00, 0x2536, 0x0000 },

+  { 0x9a00, 0x2539, 0x2000 },

+  { 0x1a00, 0x2538, 0x0000 },

+  { 0x1a00, 0x253a, 0x0000 },

+  { 0x9a00, 0x2543, 0x4000 },

+  { 0x9a00, 0x253f, 0x3000 },

+  { 0x9a00, 0x253d, 0x2000 },

+  { 0x1a00, 0x253c, 0x0000 },

+  { 0x1a00, 0x253e, 0x0000 },

+  { 0x9a00, 0x2541, 0x2000 },

+  { 0x1a00, 0x2540, 0x0000 },

+  { 0x1a00, 0x2542, 0x0000 },

+  { 0x9a00, 0x2547, 0x3000 },

+  { 0x9a00, 0x2545, 0x2000 },

+  { 0x1a00, 0x2544, 0x0000 },

+  { 0x1a00, 0x2546, 0x0000 },

+  { 0x9a00, 0x2549, 0x2000 },

+  { 0x1a00, 0x2548, 0x0000 },

+  { 0x1a00, 0x254a, 0x0000 },

+  { 0x9a00, 0x256b, 0x6000 },

+  { 0x9a00, 0x255b, 0x5000 },

+  { 0x9a00, 0x2553, 0x4000 },

+  { 0x9a00, 0x254f, 0x3000 },

+  { 0x9a00, 0x254d, 0x2000 },

+  { 0x1a00, 0x254c, 0x0000 },

+  { 0x1a00, 0x254e, 0x0000 },

+  { 0x9a00, 0x2551, 0x2000 },

+  { 0x1a00, 0x2550, 0x0000 },

+  { 0x1a00, 0x2552, 0x0000 },

+  { 0x9a00, 0x2557, 0x3000 },

+  { 0x9a00, 0x2555, 0x2000 },

+  { 0x1a00, 0x2554, 0x0000 },

+  { 0x1a00, 0x2556, 0x0000 },

+  { 0x9a00, 0x2559, 0x2000 },

+  { 0x1a00, 0x2558, 0x0000 },

+  { 0x1a00, 0x255a, 0x0000 },

+  { 0x9a00, 0x2563, 0x4000 },

+  { 0x9a00, 0x255f, 0x3000 },

+  { 0x9a00, 0x255d, 0x2000 },

+  { 0x1a00, 0x255c, 0x0000 },

+  { 0x1a00, 0x255e, 0x0000 },

+  { 0x9a00, 0x2561, 0x2000 },

+  { 0x1a00, 0x2560, 0x0000 },

+  { 0x1a00, 0x2562, 0x0000 },

+  { 0x9a00, 0x2567, 0x3000 },

+  { 0x9a00, 0x2565, 0x2000 },

+  { 0x1a00, 0x2564, 0x0000 },

+  { 0x1a00, 0x2566, 0x0000 },

+  { 0x9a00, 0x2569, 0x2000 },

+  { 0x1a00, 0x2568, 0x0000 },

+  { 0x1a00, 0x256a, 0x0000 },

+  { 0x9a00, 0x257b, 0x5000 },

+  { 0x9a00, 0x2573, 0x4000 },

+  { 0x9a00, 0x256f, 0x3000 },

+  { 0x9a00, 0x256d, 0x2000 },

+  { 0x1a00, 0x256c, 0x0000 },

+  { 0x1a00, 0x256e, 0x0000 },

+  { 0x9a00, 0x2571, 0x2000 },

+  { 0x1a00, 0x2570, 0x0000 },

+  { 0x1a00, 0x2572, 0x0000 },

+  { 0x9a00, 0x2577, 0x3000 },

+  { 0x9a00, 0x2575, 0x2000 },

+  { 0x1a00, 0x2574, 0x0000 },

+  { 0x1a00, 0x2576, 0x0000 },

+  { 0x9a00, 0x2579, 0x2000 },

+  { 0x1a00, 0x2578, 0x0000 },

+  { 0x1a00, 0x257a, 0x0000 },

+  { 0x9a00, 0x2583, 0x4000 },

+  { 0x9a00, 0x257f, 0x3000 },

+  { 0x9a00, 0x257d, 0x2000 },

+  { 0x1a00, 0x257c, 0x0000 },

+  { 0x1a00, 0x257e, 0x0000 },

+  { 0x9a00, 0x2581, 0x2000 },

+  { 0x1a00, 0x2580, 0x0000 },

+  { 0x1a00, 0x2582, 0x0000 },

+  { 0x9a00, 0x2587, 0x3000 },

+  { 0x9a00, 0x2585, 0x2000 },

+  { 0x1a00, 0x2584, 0x0000 },

+  { 0x1a00, 0x2586, 0x0000 },

+  { 0x9a00, 0x2589, 0x2000 },

+  { 0x1a00, 0x2588, 0x0000 },

+  { 0x1a00, 0x258a, 0x0000 },

+  { 0x9a00, 0x25cb, 0x7000 },

+  { 0x9a00, 0x25ab, 0x6000 },

+  { 0x9a00, 0x259b, 0x5000 },

+  { 0x9a00, 0x2593, 0x4000 },

+  { 0x9a00, 0x258f, 0x3000 },

+  { 0x9a00, 0x258d, 0x2000 },

+  { 0x1a00, 0x258c, 0x0000 },

+  { 0x1a00, 0x258e, 0x0000 },

+  { 0x9a00, 0x2591, 0x2000 },

+  { 0x1a00, 0x2590, 0x0000 },

+  { 0x1a00, 0x2592, 0x0000 },

+  { 0x9a00, 0x2597, 0x3000 },

+  { 0x9a00, 0x2595, 0x2000 },

+  { 0x1a00, 0x2594, 0x0000 },

+  { 0x1a00, 0x2596, 0x0000 },

+  { 0x9a00, 0x2599, 0x2000 },

+  { 0x1a00, 0x2598, 0x0000 },

+  { 0x1a00, 0x259a, 0x0000 },

+  { 0x9a00, 0x25a3, 0x4000 },

+  { 0x9a00, 0x259f, 0x3000 },

+  { 0x9a00, 0x259d, 0x2000 },

+  { 0x1a00, 0x259c, 0x0000 },

+  { 0x1a00, 0x259e, 0x0000 },

+  { 0x9a00, 0x25a1, 0x2000 },

+  { 0x1a00, 0x25a0, 0x0000 },

+  { 0x1a00, 0x25a2, 0x0000 },

+  { 0x9a00, 0x25a7, 0x3000 },

+  { 0x9a00, 0x25a5, 0x2000 },

+  { 0x1a00, 0x25a4, 0x0000 },

+  { 0x1a00, 0x25a6, 0x0000 },

+  { 0x9a00, 0x25a9, 0x2000 },

+  { 0x1a00, 0x25a8, 0x0000 },

+  { 0x1a00, 0x25aa, 0x0000 },

+  { 0x9a00, 0x25bb, 0x5000 },

+  { 0x9a00, 0x25b3, 0x4000 },

+  { 0x9a00, 0x25af, 0x3000 },

+  { 0x9a00, 0x25ad, 0x2000 },

+  { 0x1a00, 0x25ac, 0x0000 },

+  { 0x1a00, 0x25ae, 0x0000 },

+  { 0x9a00, 0x25b1, 0x2000 },

+  { 0x1a00, 0x25b0, 0x0000 },

+  { 0x1a00, 0x25b2, 0x0000 },

+  { 0x9900, 0x25b7, 0x3000 },

+  { 0x9a00, 0x25b5, 0x2000 },

+  { 0x1a00, 0x25b4, 0x0000 },

+  { 0x1a00, 0x25b6, 0x0000 },

+  { 0x9a00, 0x25b9, 0x2000 },

+  { 0x1a00, 0x25b8, 0x0000 },

+  { 0x1a00, 0x25ba, 0x0000 },

+  { 0x9a00, 0x25c3, 0x4000 },

+  { 0x9a00, 0x25bf, 0x3000 },

+  { 0x9a00, 0x25bd, 0x2000 },

+  { 0x1a00, 0x25bc, 0x0000 },

+  { 0x1a00, 0x25be, 0x0000 },

+  { 0x9900, 0x25c1, 0x2000 },

+  { 0x1a00, 0x25c0, 0x0000 },

+  { 0x1a00, 0x25c2, 0x0000 },

+  { 0x9a00, 0x25c7, 0x3000 },

+  { 0x9a00, 0x25c5, 0x2000 },

+  { 0x1a00, 0x25c4, 0x0000 },

+  { 0x1a00, 0x25c6, 0x0000 },

+  { 0x9a00, 0x25c9, 0x2000 },

+  { 0x1a00, 0x25c8, 0x0000 },

+  { 0x1a00, 0x25ca, 0x0000 },

+  { 0x9a00, 0x25eb, 0x6000 },

+  { 0x9a00, 0x25db, 0x5000 },

+  { 0x9a00, 0x25d3, 0x4000 },

+  { 0x9a00, 0x25cf, 0x3000 },

+  { 0x9a00, 0x25cd, 0x2000 },

+  { 0x1a00, 0x25cc, 0x0000 },

+  { 0x1a00, 0x25ce, 0x0000 },

+  { 0x9a00, 0x25d1, 0x2000 },

+  { 0x1a00, 0x25d0, 0x0000 },

+  { 0x1a00, 0x25d2, 0x0000 },

+  { 0x9a00, 0x25d7, 0x3000 },

+  { 0x9a00, 0x25d5, 0x2000 },

+  { 0x1a00, 0x25d4, 0x0000 },

+  { 0x1a00, 0x25d6, 0x0000 },

+  { 0x9a00, 0x25d9, 0x2000 },

+  { 0x1a00, 0x25d8, 0x0000 },

+  { 0x1a00, 0x25da, 0x0000 },

+  { 0x9a00, 0x25e3, 0x4000 },

+  { 0x9a00, 0x25df, 0x3000 },

+  { 0x9a00, 0x25dd, 0x2000 },

+  { 0x1a00, 0x25dc, 0x0000 },

+  { 0x1a00, 0x25de, 0x0000 },

+  { 0x9a00, 0x25e1, 0x2000 },

+  { 0x1a00, 0x25e0, 0x0000 },

+  { 0x1a00, 0x25e2, 0x0000 },

+  { 0x9a00, 0x25e7, 0x3000 },

+  { 0x9a00, 0x25e5, 0x2000 },

+  { 0x1a00, 0x25e4, 0x0000 },

+  { 0x1a00, 0x25e6, 0x0000 },

+  { 0x9a00, 0x25e9, 0x2000 },

+  { 0x1a00, 0x25e8, 0x0000 },

+  { 0x1a00, 0x25ea, 0x0000 },

+  { 0x9900, 0x25fb, 0x5000 },

+  { 0x9a00, 0x25f3, 0x4000 },

+  { 0x9a00, 0x25ef, 0x3000 },

+  { 0x9a00, 0x25ed, 0x2000 },

+  { 0x1a00, 0x25ec, 0x0000 },

+  { 0x1a00, 0x25ee, 0x0000 },

+  { 0x9a00, 0x25f1, 0x2000 },

+  { 0x1a00, 0x25f0, 0x0000 },

+  { 0x1a00, 0x25f2, 0x0000 },

+  { 0x9a00, 0x25f7, 0x3000 },

+  { 0x9a00, 0x25f5, 0x2000 },

+  { 0x1a00, 0x25f4, 0x0000 },

+  { 0x1a00, 0x25f6, 0x0000 },

+  { 0x9900, 0x25f9, 0x2000 },

+  { 0x1900, 0x25f8, 0x0000 },

+  { 0x1900, 0x25fa, 0x0000 },

+  { 0x9a00, 0x2603, 0x4000 },

+  { 0x9900, 0x25ff, 0x3000 },

+  { 0x9900, 0x25fd, 0x2000 },

+  { 0x1900, 0x25fc, 0x0000 },

+  { 0x1900, 0x25fe, 0x0000 },

+  { 0x9a00, 0x2601, 0x2000 },

+  { 0x1a00, 0x2600, 0x0000 },

+  { 0x1a00, 0x2602, 0x0000 },

+  { 0x9a00, 0x2607, 0x3000 },

+  { 0x9a00, 0x2605, 0x2000 },

+  { 0x1a00, 0x2604, 0x0000 },

+  { 0x1a00, 0x2606, 0x0000 },

+  { 0x9a00, 0x2609, 0x2000 },

+  { 0x1a00, 0x2608, 0x0000 },

+  { 0x1a00, 0x260a, 0x0000 },

+  { 0x9a00, 0x268e, 0x8000 },

+  { 0x9a00, 0x264c, 0x7000 },

+  { 0x9a00, 0x262c, 0x6000 },

+  { 0x9a00, 0x261c, 0x5000 },

+  { 0x9a00, 0x2613, 0x4000 },

+  { 0x9a00, 0x260f, 0x3000 },

+  { 0x9a00, 0x260d, 0x2000 },

+  { 0x1a00, 0x260c, 0x0000 },

+  { 0x1a00, 0x260e, 0x0000 },

+  { 0x9a00, 0x2611, 0x2000 },

+  { 0x1a00, 0x2610, 0x0000 },

+  { 0x1a00, 0x2612, 0x0000 },

+  { 0x9a00, 0x2617, 0x3000 },

+  { 0x9a00, 0x2615, 0x2000 },

+  { 0x1a00, 0x2614, 0x0000 },

+  { 0x1a00, 0x2616, 0x0000 },

+  { 0x9a00, 0x261a, 0x2000 },

+  { 0x1a00, 0x2619, 0x0000 },

+  { 0x1a00, 0x261b, 0x0000 },

+  { 0x9a00, 0x2624, 0x4000 },

+  { 0x9a00, 0x2620, 0x3000 },

+  { 0x9a00, 0x261e, 0x2000 },

+  { 0x1a00, 0x261d, 0x0000 },

+  { 0x1a00, 0x261f, 0x0000 },

+  { 0x9a00, 0x2622, 0x2000 },

+  { 0x1a00, 0x2621, 0x0000 },

+  { 0x1a00, 0x2623, 0x0000 },

+  { 0x9a00, 0x2628, 0x3000 },

+  { 0x9a00, 0x2626, 0x2000 },

+  { 0x1a00, 0x2625, 0x0000 },

+  { 0x1a00, 0x2627, 0x0000 },

+  { 0x9a00, 0x262a, 0x2000 },

+  { 0x1a00, 0x2629, 0x0000 },

+  { 0x1a00, 0x262b, 0x0000 },

+  { 0x9a00, 0x263c, 0x5000 },

+  { 0x9a00, 0x2634, 0x4000 },

+  { 0x9a00, 0x2630, 0x3000 },

+  { 0x9a00, 0x262e, 0x2000 },

+  { 0x1a00, 0x262d, 0x0000 },

+  { 0x1a00, 0x262f, 0x0000 },

+  { 0x9a00, 0x2632, 0x2000 },

+  { 0x1a00, 0x2631, 0x0000 },

+  { 0x1a00, 0x2633, 0x0000 },

+  { 0x9a00, 0x2638, 0x3000 },

+  { 0x9a00, 0x2636, 0x2000 },

+  { 0x1a00, 0x2635, 0x0000 },

+  { 0x1a00, 0x2637, 0x0000 },

+  { 0x9a00, 0x263a, 0x2000 },

+  { 0x1a00, 0x2639, 0x0000 },

+  { 0x1a00, 0x263b, 0x0000 },

+  { 0x9a00, 0x2644, 0x4000 },

+  { 0x9a00, 0x2640, 0x3000 },

+  { 0x9a00, 0x263e, 0x2000 },

+  { 0x1a00, 0x263d, 0x0000 },

+  { 0x1a00, 0x263f, 0x0000 },

+  { 0x9a00, 0x2642, 0x2000 },

+  { 0x1a00, 0x2641, 0x0000 },

+  { 0x1a00, 0x2643, 0x0000 },

+  { 0x9a00, 0x2648, 0x3000 },

+  { 0x9a00, 0x2646, 0x2000 },

+  { 0x1a00, 0x2645, 0x0000 },

+  { 0x1a00, 0x2647, 0x0000 },

+  { 0x9a00, 0x264a, 0x2000 },

+  { 0x1a00, 0x2649, 0x0000 },

+  { 0x1a00, 0x264b, 0x0000 },

+  { 0x9a00, 0x266c, 0x6000 },

+  { 0x9a00, 0x265c, 0x5000 },

+  { 0x9a00, 0x2654, 0x4000 },

+  { 0x9a00, 0x2650, 0x3000 },

+  { 0x9a00, 0x264e, 0x2000 },

+  { 0x1a00, 0x264d, 0x0000 },

+  { 0x1a00, 0x264f, 0x0000 },

+  { 0x9a00, 0x2652, 0x2000 },

+  { 0x1a00, 0x2651, 0x0000 },

+  { 0x1a00, 0x2653, 0x0000 },

+  { 0x9a00, 0x2658, 0x3000 },

+  { 0x9a00, 0x2656, 0x2000 },

+  { 0x1a00, 0x2655, 0x0000 },

+  { 0x1a00, 0x2657, 0x0000 },

+  { 0x9a00, 0x265a, 0x2000 },

+  { 0x1a00, 0x2659, 0x0000 },

+  { 0x1a00, 0x265b, 0x0000 },

+  { 0x9a00, 0x2664, 0x4000 },

+  { 0x9a00, 0x2660, 0x3000 },

+  { 0x9a00, 0x265e, 0x2000 },

+  { 0x1a00, 0x265d, 0x0000 },

+  { 0x1a00, 0x265f, 0x0000 },

+  { 0x9a00, 0x2662, 0x2000 },

+  { 0x1a00, 0x2661, 0x0000 },

+  { 0x1a00, 0x2663, 0x0000 },

+  { 0x9a00, 0x2668, 0x3000 },

+  { 0x9a00, 0x2666, 0x2000 },

+  { 0x1a00, 0x2665, 0x0000 },

+  { 0x1a00, 0x2667, 0x0000 },

+  { 0x9a00, 0x266a, 0x2000 },

+  { 0x1a00, 0x2669, 0x0000 },

+  { 0x1a00, 0x266b, 0x0000 },

+  { 0x9a00, 0x267c, 0x5000 },

+  { 0x9a00, 0x2674, 0x4000 },

+  { 0x9a00, 0x2670, 0x3000 },

+  { 0x9a00, 0x266e, 0x2000 },

+  { 0x1a00, 0x266d, 0x0000 },

+  { 0x1900, 0x266f, 0x0000 },

+  { 0x9a00, 0x2672, 0x2000 },

+  { 0x1a00, 0x2671, 0x0000 },

+  { 0x1a00, 0x2673, 0x0000 },

+  { 0x9a00, 0x2678, 0x3000 },

+  { 0x9a00, 0x2676, 0x2000 },

+  { 0x1a00, 0x2675, 0x0000 },

+  { 0x1a00, 0x2677, 0x0000 },

+  { 0x9a00, 0x267a, 0x2000 },

+  { 0x1a00, 0x2679, 0x0000 },

+  { 0x1a00, 0x267b, 0x0000 },

+  { 0x9a00, 0x2686, 0x4000 },

+  { 0x9a00, 0x2682, 0x3000 },

+  { 0x9a00, 0x2680, 0x2000 },

+  { 0x1a00, 0x267d, 0x0000 },

+  { 0x1a00, 0x2681, 0x0000 },

+  { 0x9a00, 0x2684, 0x2000 },

+  { 0x1a00, 0x2683, 0x0000 },

+  { 0x1a00, 0x2685, 0x0000 },

+  { 0x9a00, 0x268a, 0x3000 },

+  { 0x9a00, 0x2688, 0x2000 },

+  { 0x1a00, 0x2687, 0x0000 },

+  { 0x1a00, 0x2689, 0x0000 },

+  { 0x9a00, 0x268c, 0x2000 },

+  { 0x1a00, 0x268b, 0x0000 },

+  { 0x1a00, 0x268d, 0x0000 },

+  { 0x9a00, 0x273f, 0x7000 },

+  { 0x9a00, 0x271e, 0x6000 },

+  { 0x9a00, 0x270e, 0x5000 },

+  { 0x9a00, 0x2703, 0x4000 },

+  { 0x9a00, 0x26a0, 0x3000 },

+  { 0x9a00, 0x2690, 0x2000 },

+  { 0x1a00, 0x268f, 0x0000 },

+  { 0x1a00, 0x2691, 0x0000 },

+  { 0x9a00, 0x2701, 0x2000 },

+  { 0x1a00, 0x26a1, 0x0000 },

+  { 0x1a00, 0x2702, 0x0000 },

+  { 0x9a00, 0x2708, 0x3000 },

+  { 0x9a00, 0x2706, 0x2000 },

+  { 0x1a00, 0x2704, 0x0000 },

+  { 0x1a00, 0x2707, 0x0000 },

+  { 0x9a00, 0x270c, 0x2000 },

+  { 0x1a00, 0x2709, 0x0000 },

+  { 0x1a00, 0x270d, 0x0000 },

+  { 0x9a00, 0x2716, 0x4000 },

+  { 0x9a00, 0x2712, 0x3000 },

+  { 0x9a00, 0x2710, 0x2000 },

+  { 0x1a00, 0x270f, 0x0000 },

+  { 0x1a00, 0x2711, 0x0000 },

+  { 0x9a00, 0x2714, 0x2000 },

+  { 0x1a00, 0x2713, 0x0000 },

+  { 0x1a00, 0x2715, 0x0000 },

+  { 0x9a00, 0x271a, 0x3000 },

+  { 0x9a00, 0x2718, 0x2000 },

+  { 0x1a00, 0x2717, 0x0000 },

+  { 0x1a00, 0x2719, 0x0000 },

+  { 0x9a00, 0x271c, 0x2000 },

+  { 0x1a00, 0x271b, 0x0000 },

+  { 0x1a00, 0x271d, 0x0000 },

+  { 0x9a00, 0x272f, 0x5000 },

+  { 0x9a00, 0x2726, 0x4000 },

+  { 0x9a00, 0x2722, 0x3000 },

+  { 0x9a00, 0x2720, 0x2000 },

+  { 0x1a00, 0x271f, 0x0000 },

+  { 0x1a00, 0x2721, 0x0000 },

+  { 0x9a00, 0x2724, 0x2000 },

+  { 0x1a00, 0x2723, 0x0000 },

+  { 0x1a00, 0x2725, 0x0000 },

+  { 0x9a00, 0x272b, 0x3000 },

+  { 0x9a00, 0x2729, 0x2000 },

+  { 0x1a00, 0x2727, 0x0000 },

+  { 0x1a00, 0x272a, 0x0000 },

+  { 0x9a00, 0x272d, 0x2000 },

+  { 0x1a00, 0x272c, 0x0000 },

+  { 0x1a00, 0x272e, 0x0000 },

+  { 0x9a00, 0x2737, 0x4000 },

+  { 0x9a00, 0x2733, 0x3000 },

+  { 0x9a00, 0x2731, 0x2000 },

+  { 0x1a00, 0x2730, 0x0000 },

+  { 0x1a00, 0x2732, 0x0000 },

+  { 0x9a00, 0x2735, 0x2000 },

+  { 0x1a00, 0x2734, 0x0000 },

+  { 0x1a00, 0x2736, 0x0000 },

+  { 0x9a00, 0x273b, 0x3000 },

+  { 0x9a00, 0x2739, 0x2000 },

+  { 0x1a00, 0x2738, 0x0000 },

+  { 0x1a00, 0x273a, 0x0000 },

+  { 0x9a00, 0x273d, 0x2000 },

+  { 0x1a00, 0x273c, 0x0000 },

+  { 0x1a00, 0x273e, 0x0000 },

+  { 0x9a00, 0x2767, 0x6000 },

+  { 0x9a00, 0x2751, 0x5000 },

+  { 0x9a00, 0x2747, 0x4000 },

+  { 0x9a00, 0x2743, 0x3000 },

+  { 0x9a00, 0x2741, 0x2000 },

+  { 0x1a00, 0x2740, 0x0000 },

+  { 0x1a00, 0x2742, 0x0000 },

+  { 0x9a00, 0x2745, 0x2000 },

+  { 0x1a00, 0x2744, 0x0000 },

+  { 0x1a00, 0x2746, 0x0000 },

+  { 0x9a00, 0x274b, 0x3000 },

+  { 0x9a00, 0x2749, 0x2000 },

+  { 0x1a00, 0x2748, 0x0000 },

+  { 0x1a00, 0x274a, 0x0000 },

+  { 0x9a00, 0x274f, 0x2000 },

+  { 0x1a00, 0x274d, 0x0000 },

+  { 0x1a00, 0x2750, 0x0000 },

+  { 0x9a00, 0x275d, 0x4000 },

+  { 0x9a00, 0x2759, 0x3000 },

+  { 0x9a00, 0x2756, 0x2000 },

+  { 0x1a00, 0x2752, 0x0000 },

+  { 0x1a00, 0x2758, 0x0000 },

+  { 0x9a00, 0x275b, 0x2000 },

+  { 0x1a00, 0x275a, 0x0000 },

+  { 0x1a00, 0x275c, 0x0000 },

+  { 0x9a00, 0x2763, 0x3000 },

+  { 0x9a00, 0x2761, 0x2000 },

+  { 0x1a00, 0x275e, 0x0000 },

+  { 0x1a00, 0x2762, 0x0000 },

+  { 0x9a00, 0x2765, 0x2000 },

+  { 0x1a00, 0x2764, 0x0000 },

+  { 0x1a00, 0x2766, 0x0000 },

+  { 0x8f00, 0x2777, 0x5000 },

+  { 0x9200, 0x276f, 0x4000 },

+  { 0x9200, 0x276b, 0x3000 },

+  { 0x9200, 0x2769, 0x2000 },

+  { 0x1600, 0x2768, 0x0000 },

+  { 0x1600, 0x276a, 0x0000 },

+  { 0x9200, 0x276d, 0x2000 },

+  { 0x1600, 0x276c, 0x0000 },

+  { 0x1600, 0x276e, 0x0000 },

+  { 0x9200, 0x2773, 0x3000 },

+  { 0x9200, 0x2771, 0x2000 },

+  { 0x1600, 0x2770, 0x0000 },

+  { 0x1600, 0x2772, 0x0000 },

+  { 0x9200, 0x2775, 0x2000 },

+  { 0x1600, 0x2774, 0x0000 },

+  { 0x0f00, 0x2776, 0x0000 },

+  { 0x8f00, 0x277f, 0x4000 },

+  { 0x8f00, 0x277b, 0x3000 },

+  { 0x8f00, 0x2779, 0x2000 },

+  { 0x0f00, 0x2778, 0x0000 },

+  { 0x0f00, 0x277a, 0x0000 },

+  { 0x8f00, 0x277d, 0x2000 },

+  { 0x0f00, 0x277c, 0x0000 },

+  { 0x0f00, 0x277e, 0x0000 },

+  { 0x8f00, 0x2783, 0x3000 },

+  { 0x8f00, 0x2781, 0x2000 },

+  { 0x0f00, 0x2780, 0x0000 },

+  { 0x0f00, 0x2782, 0x0000 },

+  { 0x8f00, 0x2785, 0x2000 },

+  { 0x0f00, 0x2784, 0x0000 },

+  { 0x0f00, 0x2786, 0x0000 },

+  { 0x9900, 0x29a0, 0xa000 },

+  { 0x9a00, 0x28a0, 0x9000 },

+  { 0x9a00, 0x2820, 0x8000 },

+  { 0x9900, 0x27dc, 0x7000 },

+  { 0x9a00, 0x27aa, 0x6000 },

+  { 0x9a00, 0x279a, 0x5000 },

+  { 0x8f00, 0x278f, 0x4000 },

+  { 0x8f00, 0x278b, 0x3000 },

+  { 0x8f00, 0x2789, 0x2000 },

+  { 0x0f00, 0x2788, 0x0000 },

+  { 0x0f00, 0x278a, 0x0000 },

+  { 0x8f00, 0x278d, 0x2000 },

+  { 0x0f00, 0x278c, 0x0000 },

+  { 0x0f00, 0x278e, 0x0000 },

+  { 0x8f00, 0x2793, 0x3000 },

+  { 0x8f00, 0x2791, 0x2000 },

+  { 0x0f00, 0x2790, 0x0000 },

+  { 0x0f00, 0x2792, 0x0000 },

+  { 0x9a00, 0x2798, 0x2000 },

+  { 0x1a00, 0x2794, 0x0000 },

+  { 0x1a00, 0x2799, 0x0000 },

+  { 0x9a00, 0x27a2, 0x4000 },

+  { 0x9a00, 0x279e, 0x3000 },

+  { 0x9a00, 0x279c, 0x2000 },

+  { 0x1a00, 0x279b, 0x0000 },

+  { 0x1a00, 0x279d, 0x0000 },

+  { 0x9a00, 0x27a0, 0x2000 },

+  { 0x1a00, 0x279f, 0x0000 },

+  { 0x1a00, 0x27a1, 0x0000 },

+  { 0x9a00, 0x27a6, 0x3000 },

+  { 0x9a00, 0x27a4, 0x2000 },

+  { 0x1a00, 0x27a3, 0x0000 },

+  { 0x1a00, 0x27a5, 0x0000 },

+  { 0x9a00, 0x27a8, 0x2000 },

+  { 0x1a00, 0x27a7, 0x0000 },

+  { 0x1a00, 0x27a9, 0x0000 },

+  { 0x9a00, 0x27bb, 0x5000 },

+  { 0x9a00, 0x27b3, 0x4000 },

+  { 0x9a00, 0x27ae, 0x3000 },

+  { 0x9a00, 0x27ac, 0x2000 },

+  { 0x1a00, 0x27ab, 0x0000 },

+  { 0x1a00, 0x27ad, 0x0000 },

+  { 0x9a00, 0x27b1, 0x2000 },

+  { 0x1a00, 0x27af, 0x0000 },

+  { 0x1a00, 0x27b2, 0x0000 },

+  { 0x9a00, 0x27b7, 0x3000 },

+  { 0x9a00, 0x27b5, 0x2000 },

+  { 0x1a00, 0x27b4, 0x0000 },

+  { 0x1a00, 0x27b6, 0x0000 },

+  { 0x9a00, 0x27b9, 0x2000 },

+  { 0x1a00, 0x27b8, 0x0000 },

+  { 0x1a00, 0x27ba, 0x0000 },

+  { 0x9900, 0x27d4, 0x4000 },

+  { 0x9900, 0x27d0, 0x3000 },

+  { 0x9a00, 0x27bd, 0x2000 },

+  { 0x1a00, 0x27bc, 0x0000 },

+  { 0x1a00, 0x27be, 0x0000 },

+  { 0x9900, 0x27d2, 0x2000 },

+  { 0x1900, 0x27d1, 0x0000 },

+  { 0x1900, 0x27d3, 0x0000 },

+  { 0x9900, 0x27d8, 0x3000 },

+  { 0x9900, 0x27d6, 0x2000 },

+  { 0x1900, 0x27d5, 0x0000 },

+  { 0x1900, 0x27d7, 0x0000 },

+  { 0x9900, 0x27da, 0x2000 },

+  { 0x1900, 0x27d9, 0x0000 },

+  { 0x1900, 0x27db, 0x0000 },

+  { 0x9a00, 0x2800, 0x6000 },

+  { 0x9900, 0x27f0, 0x5000 },

+  { 0x9900, 0x27e4, 0x4000 },

+  { 0x9900, 0x27e0, 0x3000 },

+  { 0x9900, 0x27de, 0x2000 },

+  { 0x1900, 0x27dd, 0x0000 },

+  { 0x1900, 0x27df, 0x0000 },

+  { 0x9900, 0x27e2, 0x2000 },

+  { 0x1900, 0x27e1, 0x0000 },

+  { 0x1900, 0x27e3, 0x0000 },

+  { 0x9600, 0x27e8, 0x3000 },

+  { 0x9600, 0x27e6, 0x2000 },

+  { 0x1900, 0x27e5, 0x0000 },

+  { 0x1200, 0x27e7, 0x0000 },

+  { 0x9600, 0x27ea, 0x2000 },

+  { 0x1200, 0x27e9, 0x0000 },

+  { 0x1200, 0x27eb, 0x0000 },

+  { 0x9900, 0x27f8, 0x4000 },

+  { 0x9900, 0x27f4, 0x3000 },

+  { 0x9900, 0x27f2, 0x2000 },

+  { 0x1900, 0x27f1, 0x0000 },

+  { 0x1900, 0x27f3, 0x0000 },

+  { 0x9900, 0x27f6, 0x2000 },

+  { 0x1900, 0x27f5, 0x0000 },

+  { 0x1900, 0x27f7, 0x0000 },

+  { 0x9900, 0x27fc, 0x3000 },

+  { 0x9900, 0x27fa, 0x2000 },

+  { 0x1900, 0x27f9, 0x0000 },

+  { 0x1900, 0x27fb, 0x0000 },

+  { 0x9900, 0x27fe, 0x2000 },

+  { 0x1900, 0x27fd, 0x0000 },

+  { 0x1900, 0x27ff, 0x0000 },

+  { 0x9a00, 0x2810, 0x5000 },

+  { 0x9a00, 0x2808, 0x4000 },

+  { 0x9a00, 0x2804, 0x3000 },

+  { 0x9a00, 0x2802, 0x2000 },

+  { 0x1a00, 0x2801, 0x0000 },

+  { 0x1a00, 0x2803, 0x0000 },

+  { 0x9a00, 0x2806, 0x2000 },

+  { 0x1a00, 0x2805, 0x0000 },

+  { 0x1a00, 0x2807, 0x0000 },

+  { 0x9a00, 0x280c, 0x3000 },

+  { 0x9a00, 0x280a, 0x2000 },

+  { 0x1a00, 0x2809, 0x0000 },

+  { 0x1a00, 0x280b, 0x0000 },

+  { 0x9a00, 0x280e, 0x2000 },

+  { 0x1a00, 0x280d, 0x0000 },

+  { 0x1a00, 0x280f, 0x0000 },

+  { 0x9a00, 0x2818, 0x4000 },

+  { 0x9a00, 0x2814, 0x3000 },

+  { 0x9a00, 0x2812, 0x2000 },

+  { 0x1a00, 0x2811, 0x0000 },

+  { 0x1a00, 0x2813, 0x0000 },

+  { 0x9a00, 0x2816, 0x2000 },

+  { 0x1a00, 0x2815, 0x0000 },

+  { 0x1a00, 0x2817, 0x0000 },

+  { 0x9a00, 0x281c, 0x3000 },

+  { 0x9a00, 0x281a, 0x2000 },

+  { 0x1a00, 0x2819, 0x0000 },

+  { 0x1a00, 0x281b, 0x0000 },

+  { 0x9a00, 0x281e, 0x2000 },

+  { 0x1a00, 0x281d, 0x0000 },

+  { 0x1a00, 0x281f, 0x0000 },

+  { 0x9a00, 0x2860, 0x7000 },

+  { 0x9a00, 0x2840, 0x6000 },

+  { 0x9a00, 0x2830, 0x5000 },

+  { 0x9a00, 0x2828, 0x4000 },

+  { 0x9a00, 0x2824, 0x3000 },

+  { 0x9a00, 0x2822, 0x2000 },

+  { 0x1a00, 0x2821, 0x0000 },

+  { 0x1a00, 0x2823, 0x0000 },

+  { 0x9a00, 0x2826, 0x2000 },

+  { 0x1a00, 0x2825, 0x0000 },

+  { 0x1a00, 0x2827, 0x0000 },

+  { 0x9a00, 0x282c, 0x3000 },

+  { 0x9a00, 0x282a, 0x2000 },

+  { 0x1a00, 0x2829, 0x0000 },

+  { 0x1a00, 0x282b, 0x0000 },

+  { 0x9a00, 0x282e, 0x2000 },

+  { 0x1a00, 0x282d, 0x0000 },

+  { 0x1a00, 0x282f, 0x0000 },

+  { 0x9a00, 0x2838, 0x4000 },

+  { 0x9a00, 0x2834, 0x3000 },

+  { 0x9a00, 0x2832, 0x2000 },

+  { 0x1a00, 0x2831, 0x0000 },

+  { 0x1a00, 0x2833, 0x0000 },

+  { 0x9a00, 0x2836, 0x2000 },

+  { 0x1a00, 0x2835, 0x0000 },

+  { 0x1a00, 0x2837, 0x0000 },

+  { 0x9a00, 0x283c, 0x3000 },

+  { 0x9a00, 0x283a, 0x2000 },

+  { 0x1a00, 0x2839, 0x0000 },

+  { 0x1a00, 0x283b, 0x0000 },

+  { 0x9a00, 0x283e, 0x2000 },

+  { 0x1a00, 0x283d, 0x0000 },

+  { 0x1a00, 0x283f, 0x0000 },

+  { 0x9a00, 0x2850, 0x5000 },

+  { 0x9a00, 0x2848, 0x4000 },

+  { 0x9a00, 0x2844, 0x3000 },

+  { 0x9a00, 0x2842, 0x2000 },

+  { 0x1a00, 0x2841, 0x0000 },

+  { 0x1a00, 0x2843, 0x0000 },

+  { 0x9a00, 0x2846, 0x2000 },

+  { 0x1a00, 0x2845, 0x0000 },

+  { 0x1a00, 0x2847, 0x0000 },

+  { 0x9a00, 0x284c, 0x3000 },

+  { 0x9a00, 0x284a, 0x2000 },

+  { 0x1a00, 0x2849, 0x0000 },

+  { 0x1a00, 0x284b, 0x0000 },

+  { 0x9a00, 0x284e, 0x2000 },

+  { 0x1a00, 0x284d, 0x0000 },

+  { 0x1a00, 0x284f, 0x0000 },

+  { 0x9a00, 0x2858, 0x4000 },

+  { 0x9a00, 0x2854, 0x3000 },

+  { 0x9a00, 0x2852, 0x2000 },

+  { 0x1a00, 0x2851, 0x0000 },

+  { 0x1a00, 0x2853, 0x0000 },

+  { 0x9a00, 0x2856, 0x2000 },

+  { 0x1a00, 0x2855, 0x0000 },

+  { 0x1a00, 0x2857, 0x0000 },

+  { 0x9a00, 0x285c, 0x3000 },

+  { 0x9a00, 0x285a, 0x2000 },

+  { 0x1a00, 0x2859, 0x0000 },

+  { 0x1a00, 0x285b, 0x0000 },

+  { 0x9a00, 0x285e, 0x2000 },

+  { 0x1a00, 0x285d, 0x0000 },

+  { 0x1a00, 0x285f, 0x0000 },

+  { 0x9a00, 0x2880, 0x6000 },

+  { 0x9a00, 0x2870, 0x5000 },

+  { 0x9a00, 0x2868, 0x4000 },

+  { 0x9a00, 0x2864, 0x3000 },

+  { 0x9a00, 0x2862, 0x2000 },

+  { 0x1a00, 0x2861, 0x0000 },

+  { 0x1a00, 0x2863, 0x0000 },

+  { 0x9a00, 0x2866, 0x2000 },

+  { 0x1a00, 0x2865, 0x0000 },

+  { 0x1a00, 0x2867, 0x0000 },

+  { 0x9a00, 0x286c, 0x3000 },

+  { 0x9a00, 0x286a, 0x2000 },

+  { 0x1a00, 0x2869, 0x0000 },

+  { 0x1a00, 0x286b, 0x0000 },

+  { 0x9a00, 0x286e, 0x2000 },

+  { 0x1a00, 0x286d, 0x0000 },

+  { 0x1a00, 0x286f, 0x0000 },

+  { 0x9a00, 0x2878, 0x4000 },

+  { 0x9a00, 0x2874, 0x3000 },

+  { 0x9a00, 0x2872, 0x2000 },

+  { 0x1a00, 0x2871, 0x0000 },

+  { 0x1a00, 0x2873, 0x0000 },

+  { 0x9a00, 0x2876, 0x2000 },

+  { 0x1a00, 0x2875, 0x0000 },

+  { 0x1a00, 0x2877, 0x0000 },

+  { 0x9a00, 0x287c, 0x3000 },

+  { 0x9a00, 0x287a, 0x2000 },

+  { 0x1a00, 0x2879, 0x0000 },

+  { 0x1a00, 0x287b, 0x0000 },

+  { 0x9a00, 0x287e, 0x2000 },

+  { 0x1a00, 0x287d, 0x0000 },

+  { 0x1a00, 0x287f, 0x0000 },

+  { 0x9a00, 0x2890, 0x5000 },

+  { 0x9a00, 0x2888, 0x4000 },

+  { 0x9a00, 0x2884, 0x3000 },

+  { 0x9a00, 0x2882, 0x2000 },

+  { 0x1a00, 0x2881, 0x0000 },

+  { 0x1a00, 0x2883, 0x0000 },

+  { 0x9a00, 0x2886, 0x2000 },

+  { 0x1a00, 0x2885, 0x0000 },

+  { 0x1a00, 0x2887, 0x0000 },

+  { 0x9a00, 0x288c, 0x3000 },

+  { 0x9a00, 0x288a, 0x2000 },

+  { 0x1a00, 0x2889, 0x0000 },

+  { 0x1a00, 0x288b, 0x0000 },

+  { 0x9a00, 0x288e, 0x2000 },

+  { 0x1a00, 0x288d, 0x0000 },

+  { 0x1a00, 0x288f, 0x0000 },

+  { 0x9a00, 0x2898, 0x4000 },

+  { 0x9a00, 0x2894, 0x3000 },

+  { 0x9a00, 0x2892, 0x2000 },

+  { 0x1a00, 0x2891, 0x0000 },

+  { 0x1a00, 0x2893, 0x0000 },

+  { 0x9a00, 0x2896, 0x2000 },

+  { 0x1a00, 0x2895, 0x0000 },

+  { 0x1a00, 0x2897, 0x0000 },

+  { 0x9a00, 0x289c, 0x3000 },

+  { 0x9a00, 0x289a, 0x2000 },

+  { 0x1a00, 0x2899, 0x0000 },

+  { 0x1a00, 0x289b, 0x0000 },

+  { 0x9a00, 0x289e, 0x2000 },

+  { 0x1a00, 0x289d, 0x0000 },

+  { 0x1a00, 0x289f, 0x0000 },

+  { 0x9900, 0x2920, 0x8000 },

+  { 0x9a00, 0x28e0, 0x7000 },

+  { 0x9a00, 0x28c0, 0x6000 },

+  { 0x9a00, 0x28b0, 0x5000 },

+  { 0x9a00, 0x28a8, 0x4000 },

+  { 0x9a00, 0x28a4, 0x3000 },

+  { 0x9a00, 0x28a2, 0x2000 },

+  { 0x1a00, 0x28a1, 0x0000 },

+  { 0x1a00, 0x28a3, 0x0000 },

+  { 0x9a00, 0x28a6, 0x2000 },

+  { 0x1a00, 0x28a5, 0x0000 },

+  { 0x1a00, 0x28a7, 0x0000 },

+  { 0x9a00, 0x28ac, 0x3000 },

+  { 0x9a00, 0x28aa, 0x2000 },

+  { 0x1a00, 0x28a9, 0x0000 },

+  { 0x1a00, 0x28ab, 0x0000 },

+  { 0x9a00, 0x28ae, 0x2000 },

+  { 0x1a00, 0x28ad, 0x0000 },

+  { 0x1a00, 0x28af, 0x0000 },

+  { 0x9a00, 0x28b8, 0x4000 },

+  { 0x9a00, 0x28b4, 0x3000 },

+  { 0x9a00, 0x28b2, 0x2000 },

+  { 0x1a00, 0x28b1, 0x0000 },

+  { 0x1a00, 0x28b3, 0x0000 },

+  { 0x9a00, 0x28b6, 0x2000 },

+  { 0x1a00, 0x28b5, 0x0000 },

+  { 0x1a00, 0x28b7, 0x0000 },

+  { 0x9a00, 0x28bc, 0x3000 },

+  { 0x9a00, 0x28ba, 0x2000 },

+  { 0x1a00, 0x28b9, 0x0000 },

+  { 0x1a00, 0x28bb, 0x0000 },

+  { 0x9a00, 0x28be, 0x2000 },

+  { 0x1a00, 0x28bd, 0x0000 },

+  { 0x1a00, 0x28bf, 0x0000 },

+  { 0x9a00, 0x28d0, 0x5000 },

+  { 0x9a00, 0x28c8, 0x4000 },

+  { 0x9a00, 0x28c4, 0x3000 },

+  { 0x9a00, 0x28c2, 0x2000 },

+  { 0x1a00, 0x28c1, 0x0000 },

+  { 0x1a00, 0x28c3, 0x0000 },

+  { 0x9a00, 0x28c6, 0x2000 },

+  { 0x1a00, 0x28c5, 0x0000 },

+  { 0x1a00, 0x28c7, 0x0000 },

+  { 0x9a00, 0x28cc, 0x3000 },

+  { 0x9a00, 0x28ca, 0x2000 },

+  { 0x1a00, 0x28c9, 0x0000 },

+  { 0x1a00, 0x28cb, 0x0000 },

+  { 0x9a00, 0x28ce, 0x2000 },

+  { 0x1a00, 0x28cd, 0x0000 },

+  { 0x1a00, 0x28cf, 0x0000 },

+  { 0x9a00, 0x28d8, 0x4000 },

+  { 0x9a00, 0x28d4, 0x3000 },

+  { 0x9a00, 0x28d2, 0x2000 },

+  { 0x1a00, 0x28d1, 0x0000 },

+  { 0x1a00, 0x28d3, 0x0000 },

+  { 0x9a00, 0x28d6, 0x2000 },

+  { 0x1a00, 0x28d5, 0x0000 },

+  { 0x1a00, 0x28d7, 0x0000 },

+  { 0x9a00, 0x28dc, 0x3000 },

+  { 0x9a00, 0x28da, 0x2000 },

+  { 0x1a00, 0x28d9, 0x0000 },

+  { 0x1a00, 0x28db, 0x0000 },

+  { 0x9a00, 0x28de, 0x2000 },

+  { 0x1a00, 0x28dd, 0x0000 },

+  { 0x1a00, 0x28df, 0x0000 },

+  { 0x9900, 0x2900, 0x6000 },

+  { 0x9a00, 0x28f0, 0x5000 },

+  { 0x9a00, 0x28e8, 0x4000 },

+  { 0x9a00, 0x28e4, 0x3000 },

+  { 0x9a00, 0x28e2, 0x2000 },

+  { 0x1a00, 0x28e1, 0x0000 },

+  { 0x1a00, 0x28e3, 0x0000 },

+  { 0x9a00, 0x28e6, 0x2000 },

+  { 0x1a00, 0x28e5, 0x0000 },

+  { 0x1a00, 0x28e7, 0x0000 },

+  { 0x9a00, 0x28ec, 0x3000 },

+  { 0x9a00, 0x28ea, 0x2000 },

+  { 0x1a00, 0x28e9, 0x0000 },

+  { 0x1a00, 0x28eb, 0x0000 },

+  { 0x9a00, 0x28ee, 0x2000 },

+  { 0x1a00, 0x28ed, 0x0000 },

+  { 0x1a00, 0x28ef, 0x0000 },

+  { 0x9a00, 0x28f8, 0x4000 },

+  { 0x9a00, 0x28f4, 0x3000 },

+  { 0x9a00, 0x28f2, 0x2000 },

+  { 0x1a00, 0x28f1, 0x0000 },

+  { 0x1a00, 0x28f3, 0x0000 },

+  { 0x9a00, 0x28f6, 0x2000 },

+  { 0x1a00, 0x28f5, 0x0000 },

+  { 0x1a00, 0x28f7, 0x0000 },

+  { 0x9a00, 0x28fc, 0x3000 },

+  { 0x9a00, 0x28fa, 0x2000 },

+  { 0x1a00, 0x28f9, 0x0000 },

+  { 0x1a00, 0x28fb, 0x0000 },

+  { 0x9a00, 0x28fe, 0x2000 },

+  { 0x1a00, 0x28fd, 0x0000 },

+  { 0x1a00, 0x28ff, 0x0000 },

+  { 0x9900, 0x2910, 0x5000 },

+  { 0x9900, 0x2908, 0x4000 },

+  { 0x9900, 0x2904, 0x3000 },

+  { 0x9900, 0x2902, 0x2000 },

+  { 0x1900, 0x2901, 0x0000 },

+  { 0x1900, 0x2903, 0x0000 },

+  { 0x9900, 0x2906, 0x2000 },

+  { 0x1900, 0x2905, 0x0000 },

+  { 0x1900, 0x2907, 0x0000 },

+  { 0x9900, 0x290c, 0x3000 },

+  { 0x9900, 0x290a, 0x2000 },

+  { 0x1900, 0x2909, 0x0000 },

+  { 0x1900, 0x290b, 0x0000 },

+  { 0x9900, 0x290e, 0x2000 },

+  { 0x1900, 0x290d, 0x0000 },

+  { 0x1900, 0x290f, 0x0000 },

+  { 0x9900, 0x2918, 0x4000 },

+  { 0x9900, 0x2914, 0x3000 },

+  { 0x9900, 0x2912, 0x2000 },

+  { 0x1900, 0x2911, 0x0000 },

+  { 0x1900, 0x2913, 0x0000 },

+  { 0x9900, 0x2916, 0x2000 },

+  { 0x1900, 0x2915, 0x0000 },

+  { 0x1900, 0x2917, 0x0000 },

+  { 0x9900, 0x291c, 0x3000 },

+  { 0x9900, 0x291a, 0x2000 },

+  { 0x1900, 0x2919, 0x0000 },

+  { 0x1900, 0x291b, 0x0000 },

+  { 0x9900, 0x291e, 0x2000 },

+  { 0x1900, 0x291d, 0x0000 },

+  { 0x1900, 0x291f, 0x0000 },

+  { 0x9900, 0x2960, 0x7000 },

+  { 0x9900, 0x2940, 0x6000 },

+  { 0x9900, 0x2930, 0x5000 },

+  { 0x9900, 0x2928, 0x4000 },

+  { 0x9900, 0x2924, 0x3000 },

+  { 0x9900, 0x2922, 0x2000 },

+  { 0x1900, 0x2921, 0x0000 },

+  { 0x1900, 0x2923, 0x0000 },

+  { 0x9900, 0x2926, 0x2000 },

+  { 0x1900, 0x2925, 0x0000 },

+  { 0x1900, 0x2927, 0x0000 },

+  { 0x9900, 0x292c, 0x3000 },

+  { 0x9900, 0x292a, 0x2000 },

+  { 0x1900, 0x2929, 0x0000 },

+  { 0x1900, 0x292b, 0x0000 },

+  { 0x9900, 0x292e, 0x2000 },

+  { 0x1900, 0x292d, 0x0000 },

+  { 0x1900, 0x292f, 0x0000 },

+  { 0x9900, 0x2938, 0x4000 },

+  { 0x9900, 0x2934, 0x3000 },

+  { 0x9900, 0x2932, 0x2000 },

+  { 0x1900, 0x2931, 0x0000 },

+  { 0x1900, 0x2933, 0x0000 },

+  { 0x9900, 0x2936, 0x2000 },

+  { 0x1900, 0x2935, 0x0000 },

+  { 0x1900, 0x2937, 0x0000 },

+  { 0x9900, 0x293c, 0x3000 },

+  { 0x9900, 0x293a, 0x2000 },

+  { 0x1900, 0x2939, 0x0000 },

+  { 0x1900, 0x293b, 0x0000 },

+  { 0x9900, 0x293e, 0x2000 },

+  { 0x1900, 0x293d, 0x0000 },

+  { 0x1900, 0x293f, 0x0000 },

+  { 0x9900, 0x2950, 0x5000 },

+  { 0x9900, 0x2948, 0x4000 },

+  { 0x9900, 0x2944, 0x3000 },

+  { 0x9900, 0x2942, 0x2000 },

+  { 0x1900, 0x2941, 0x0000 },

+  { 0x1900, 0x2943, 0x0000 },

+  { 0x9900, 0x2946, 0x2000 },

+  { 0x1900, 0x2945, 0x0000 },

+  { 0x1900, 0x2947, 0x0000 },

+  { 0x9900, 0x294c, 0x3000 },

+  { 0x9900, 0x294a, 0x2000 },

+  { 0x1900, 0x2949, 0x0000 },

+  { 0x1900, 0x294b, 0x0000 },

+  { 0x9900, 0x294e, 0x2000 },

+  { 0x1900, 0x294d, 0x0000 },

+  { 0x1900, 0x294f, 0x0000 },

+  { 0x9900, 0x2958, 0x4000 },

+  { 0x9900, 0x2954, 0x3000 },

+  { 0x9900, 0x2952, 0x2000 },

+  { 0x1900, 0x2951, 0x0000 },

+  { 0x1900, 0x2953, 0x0000 },

+  { 0x9900, 0x2956, 0x2000 },

+  { 0x1900, 0x2955, 0x0000 },

+  { 0x1900, 0x2957, 0x0000 },

+  { 0x9900, 0x295c, 0x3000 },

+  { 0x9900, 0x295a, 0x2000 },

+  { 0x1900, 0x2959, 0x0000 },

+  { 0x1900, 0x295b, 0x0000 },

+  { 0x9900, 0x295e, 0x2000 },

+  { 0x1900, 0x295d, 0x0000 },

+  { 0x1900, 0x295f, 0x0000 },

+  { 0x9900, 0x2980, 0x6000 },

+  { 0x9900, 0x2970, 0x5000 },

+  { 0x9900, 0x2968, 0x4000 },

+  { 0x9900, 0x2964, 0x3000 },

+  { 0x9900, 0x2962, 0x2000 },

+  { 0x1900, 0x2961, 0x0000 },

+  { 0x1900, 0x2963, 0x0000 },

+  { 0x9900, 0x2966, 0x2000 },

+  { 0x1900, 0x2965, 0x0000 },

+  { 0x1900, 0x2967, 0x0000 },

+  { 0x9900, 0x296c, 0x3000 },

+  { 0x9900, 0x296a, 0x2000 },

+  { 0x1900, 0x2969, 0x0000 },

+  { 0x1900, 0x296b, 0x0000 },

+  { 0x9900, 0x296e, 0x2000 },

+  { 0x1900, 0x296d, 0x0000 },

+  { 0x1900, 0x296f, 0x0000 },

+  { 0x9900, 0x2978, 0x4000 },

+  { 0x9900, 0x2974, 0x3000 },

+  { 0x9900, 0x2972, 0x2000 },

+  { 0x1900, 0x2971, 0x0000 },

+  { 0x1900, 0x2973, 0x0000 },

+  { 0x9900, 0x2976, 0x2000 },

+  { 0x1900, 0x2975, 0x0000 },

+  { 0x1900, 0x2977, 0x0000 },

+  { 0x9900, 0x297c, 0x3000 },

+  { 0x9900, 0x297a, 0x2000 },

+  { 0x1900, 0x2979, 0x0000 },

+  { 0x1900, 0x297b, 0x0000 },

+  { 0x9900, 0x297e, 0x2000 },

+  { 0x1900, 0x297d, 0x0000 },

+  { 0x1900, 0x297f, 0x0000 },

+  { 0x9200, 0x2990, 0x5000 },

+  { 0x9200, 0x2988, 0x4000 },

+  { 0x9200, 0x2984, 0x3000 },

+  { 0x9900, 0x2982, 0x2000 },

+  { 0x1900, 0x2981, 0x0000 },

+  { 0x1600, 0x2983, 0x0000 },

+  { 0x9200, 0x2986, 0x2000 },

+  { 0x1600, 0x2985, 0x0000 },

+  { 0x1600, 0x2987, 0x0000 },

+  { 0x9200, 0x298c, 0x3000 },

+  { 0x9200, 0x298a, 0x2000 },

+  { 0x1600, 0x2989, 0x0000 },

+  { 0x1600, 0x298b, 0x0000 },

+  { 0x9200, 0x298e, 0x2000 },

+  { 0x1600, 0x298d, 0x0000 },

+  { 0x1600, 0x298f, 0x0000 },

+  { 0x9200, 0x2998, 0x4000 },

+  { 0x9200, 0x2994, 0x3000 },

+  { 0x9200, 0x2992, 0x2000 },

+  { 0x1600, 0x2991, 0x0000 },

+  { 0x1600, 0x2993, 0x0000 },

+  { 0x9200, 0x2996, 0x2000 },

+  { 0x1600, 0x2995, 0x0000 },

+  { 0x1600, 0x2997, 0x0000 },

+  { 0x9900, 0x299c, 0x3000 },

+  { 0x9900, 0x299a, 0x2000 },

+  { 0x1900, 0x2999, 0x0000 },

+  { 0x1900, 0x299b, 0x0000 },

+  { 0x9900, 0x299e, 0x2000 },

+  { 0x1900, 0x299d, 0x0000 },

+  { 0x1900, 0x299f, 0x0000 },

+  { 0x9900, 0x2aa0, 0x9000 },

+  { 0x9900, 0x2a20, 0x8000 },

+  { 0x9900, 0x29e0, 0x7000 },

+  { 0x9900, 0x29c0, 0x6000 },

+  { 0x9900, 0x29b0, 0x5000 },

+  { 0x9900, 0x29a8, 0x4000 },

+  { 0x9900, 0x29a4, 0x3000 },

+  { 0x9900, 0x29a2, 0x2000 },

+  { 0x1900, 0x29a1, 0x0000 },

+  { 0x1900, 0x29a3, 0x0000 },

+  { 0x9900, 0x29a6, 0x2000 },

+  { 0x1900, 0x29a5, 0x0000 },

+  { 0x1900, 0x29a7, 0x0000 },

+  { 0x9900, 0x29ac, 0x3000 },

+  { 0x9900, 0x29aa, 0x2000 },

+  { 0x1900, 0x29a9, 0x0000 },

+  { 0x1900, 0x29ab, 0x0000 },

+  { 0x9900, 0x29ae, 0x2000 },

+  { 0x1900, 0x29ad, 0x0000 },

+  { 0x1900, 0x29af, 0x0000 },

+  { 0x9900, 0x29b8, 0x4000 },

+  { 0x9900, 0x29b4, 0x3000 },

+  { 0x9900, 0x29b2, 0x2000 },

+  { 0x1900, 0x29b1, 0x0000 },

+  { 0x1900, 0x29b3, 0x0000 },

+  { 0x9900, 0x29b6, 0x2000 },

+  { 0x1900, 0x29b5, 0x0000 },

+  { 0x1900, 0x29b7, 0x0000 },

+  { 0x9900, 0x29bc, 0x3000 },

+  { 0x9900, 0x29ba, 0x2000 },

+  { 0x1900, 0x29b9, 0x0000 },

+  { 0x1900, 0x29bb, 0x0000 },

+  { 0x9900, 0x29be, 0x2000 },

+  { 0x1900, 0x29bd, 0x0000 },

+  { 0x1900, 0x29bf, 0x0000 },

+  { 0x9900, 0x29d0, 0x5000 },

+  { 0x9900, 0x29c8, 0x4000 },

+  { 0x9900, 0x29c4, 0x3000 },

+  { 0x9900, 0x29c2, 0x2000 },

+  { 0x1900, 0x29c1, 0x0000 },

+  { 0x1900, 0x29c3, 0x0000 },

+  { 0x9900, 0x29c6, 0x2000 },

+  { 0x1900, 0x29c5, 0x0000 },

+  { 0x1900, 0x29c7, 0x0000 },

+  { 0x9900, 0x29cc, 0x3000 },

+  { 0x9900, 0x29ca, 0x2000 },

+  { 0x1900, 0x29c9, 0x0000 },

+  { 0x1900, 0x29cb, 0x0000 },

+  { 0x9900, 0x29ce, 0x2000 },

+  { 0x1900, 0x29cd, 0x0000 },

+  { 0x1900, 0x29cf, 0x0000 },

+  { 0x9600, 0x29d8, 0x4000 },

+  { 0x9900, 0x29d4, 0x3000 },

+  { 0x9900, 0x29d2, 0x2000 },

+  { 0x1900, 0x29d1, 0x0000 },

+  { 0x1900, 0x29d3, 0x0000 },

+  { 0x9900, 0x29d6, 0x2000 },

+  { 0x1900, 0x29d5, 0x0000 },

+  { 0x1900, 0x29d7, 0x0000 },

+  { 0x9900, 0x29dc, 0x3000 },

+  { 0x9600, 0x29da, 0x2000 },

+  { 0x1200, 0x29d9, 0x0000 },

+  { 0x1200, 0x29db, 0x0000 },

+  { 0x9900, 0x29de, 0x2000 },

+  { 0x1900, 0x29dd, 0x0000 },

+  { 0x1900, 0x29df, 0x0000 },

+  { 0x9900, 0x2a00, 0x6000 },

+  { 0x9900, 0x29f0, 0x5000 },

+  { 0x9900, 0x29e8, 0x4000 },

+  { 0x9900, 0x29e4, 0x3000 },

+  { 0x9900, 0x29e2, 0x2000 },

+  { 0x1900, 0x29e1, 0x0000 },

+  { 0x1900, 0x29e3, 0x0000 },

+  { 0x9900, 0x29e6, 0x2000 },

+  { 0x1900, 0x29e5, 0x0000 },

+  { 0x1900, 0x29e7, 0x0000 },

+  { 0x9900, 0x29ec, 0x3000 },

+  { 0x9900, 0x29ea, 0x2000 },

+  { 0x1900, 0x29e9, 0x0000 },

+  { 0x1900, 0x29eb, 0x0000 },

+  { 0x9900, 0x29ee, 0x2000 },

+  { 0x1900, 0x29ed, 0x0000 },

+  { 0x1900, 0x29ef, 0x0000 },

+  { 0x9900, 0x29f8, 0x4000 },

+  { 0x9900, 0x29f4, 0x3000 },

+  { 0x9900, 0x29f2, 0x2000 },

+  { 0x1900, 0x29f1, 0x0000 },

+  { 0x1900, 0x29f3, 0x0000 },

+  { 0x9900, 0x29f6, 0x2000 },

+  { 0x1900, 0x29f5, 0x0000 },

+  { 0x1900, 0x29f7, 0x0000 },

+  { 0x9600, 0x29fc, 0x3000 },

+  { 0x9900, 0x29fa, 0x2000 },

+  { 0x1900, 0x29f9, 0x0000 },

+  { 0x1900, 0x29fb, 0x0000 },

+  { 0x9900, 0x29fe, 0x2000 },

+  { 0x1200, 0x29fd, 0x0000 },

+  { 0x1900, 0x29ff, 0x0000 },

+  { 0x9900, 0x2a10, 0x5000 },

+  { 0x9900, 0x2a08, 0x4000 },

+  { 0x9900, 0x2a04, 0x3000 },

+  { 0x9900, 0x2a02, 0x2000 },

+  { 0x1900, 0x2a01, 0x0000 },

+  { 0x1900, 0x2a03, 0x0000 },

+  { 0x9900, 0x2a06, 0x2000 },

+  { 0x1900, 0x2a05, 0x0000 },

+  { 0x1900, 0x2a07, 0x0000 },

+  { 0x9900, 0x2a0c, 0x3000 },

+  { 0x9900, 0x2a0a, 0x2000 },

+  { 0x1900, 0x2a09, 0x0000 },

+  { 0x1900, 0x2a0b, 0x0000 },

+  { 0x9900, 0x2a0e, 0x2000 },

+  { 0x1900, 0x2a0d, 0x0000 },

+  { 0x1900, 0x2a0f, 0x0000 },

+  { 0x9900, 0x2a18, 0x4000 },

+  { 0x9900, 0x2a14, 0x3000 },

+  { 0x9900, 0x2a12, 0x2000 },

+  { 0x1900, 0x2a11, 0x0000 },

+  { 0x1900, 0x2a13, 0x0000 },

+  { 0x9900, 0x2a16, 0x2000 },

+  { 0x1900, 0x2a15, 0x0000 },

+  { 0x1900, 0x2a17, 0x0000 },

+  { 0x9900, 0x2a1c, 0x3000 },

+  { 0x9900, 0x2a1a, 0x2000 },

+  { 0x1900, 0x2a19, 0x0000 },

+  { 0x1900, 0x2a1b, 0x0000 },

+  { 0x9900, 0x2a1e, 0x2000 },

+  { 0x1900, 0x2a1d, 0x0000 },

+  { 0x1900, 0x2a1f, 0x0000 },

+  { 0x9900, 0x2a60, 0x7000 },

+  { 0x9900, 0x2a40, 0x6000 },

+  { 0x9900, 0x2a30, 0x5000 },

+  { 0x9900, 0x2a28, 0x4000 },

+  { 0x9900, 0x2a24, 0x3000 },

+  { 0x9900, 0x2a22, 0x2000 },

+  { 0x1900, 0x2a21, 0x0000 },

+  { 0x1900, 0x2a23, 0x0000 },

+  { 0x9900, 0x2a26, 0x2000 },

+  { 0x1900, 0x2a25, 0x0000 },

+  { 0x1900, 0x2a27, 0x0000 },

+  { 0x9900, 0x2a2c, 0x3000 },

+  { 0x9900, 0x2a2a, 0x2000 },

+  { 0x1900, 0x2a29, 0x0000 },

+  { 0x1900, 0x2a2b, 0x0000 },

+  { 0x9900, 0x2a2e, 0x2000 },

+  { 0x1900, 0x2a2d, 0x0000 },

+  { 0x1900, 0x2a2f, 0x0000 },

+  { 0x9900, 0x2a38, 0x4000 },

+  { 0x9900, 0x2a34, 0x3000 },

+  { 0x9900, 0x2a32, 0x2000 },

+  { 0x1900, 0x2a31, 0x0000 },

+  { 0x1900, 0x2a33, 0x0000 },

+  { 0x9900, 0x2a36, 0x2000 },

+  { 0x1900, 0x2a35, 0x0000 },

+  { 0x1900, 0x2a37, 0x0000 },

+  { 0x9900, 0x2a3c, 0x3000 },

+  { 0x9900, 0x2a3a, 0x2000 },

+  { 0x1900, 0x2a39, 0x0000 },

+  { 0x1900, 0x2a3b, 0x0000 },

+  { 0x9900, 0x2a3e, 0x2000 },

+  { 0x1900, 0x2a3d, 0x0000 },

+  { 0x1900, 0x2a3f, 0x0000 },

+  { 0x9900, 0x2a50, 0x5000 },

+  { 0x9900, 0x2a48, 0x4000 },

+  { 0x9900, 0x2a44, 0x3000 },

+  { 0x9900, 0x2a42, 0x2000 },

+  { 0x1900, 0x2a41, 0x0000 },

+  { 0x1900, 0x2a43, 0x0000 },

+  { 0x9900, 0x2a46, 0x2000 },

+  { 0x1900, 0x2a45, 0x0000 },

+  { 0x1900, 0x2a47, 0x0000 },

+  { 0x9900, 0x2a4c, 0x3000 },

+  { 0x9900, 0x2a4a, 0x2000 },

+  { 0x1900, 0x2a49, 0x0000 },

+  { 0x1900, 0x2a4b, 0x0000 },

+  { 0x9900, 0x2a4e, 0x2000 },

+  { 0x1900, 0x2a4d, 0x0000 },

+  { 0x1900, 0x2a4f, 0x0000 },

+  { 0x9900, 0x2a58, 0x4000 },

+  { 0x9900, 0x2a54, 0x3000 },

+  { 0x9900, 0x2a52, 0x2000 },

+  { 0x1900, 0x2a51, 0x0000 },

+  { 0x1900, 0x2a53, 0x0000 },

+  { 0x9900, 0x2a56, 0x2000 },

+  { 0x1900, 0x2a55, 0x0000 },

+  { 0x1900, 0x2a57, 0x0000 },

+  { 0x9900, 0x2a5c, 0x3000 },

+  { 0x9900, 0x2a5a, 0x2000 },

+  { 0x1900, 0x2a59, 0x0000 },

+  { 0x1900, 0x2a5b, 0x0000 },

+  { 0x9900, 0x2a5e, 0x2000 },

+  { 0x1900, 0x2a5d, 0x0000 },

+  { 0x1900, 0x2a5f, 0x0000 },

+  { 0x9900, 0x2a80, 0x6000 },

+  { 0x9900, 0x2a70, 0x5000 },

+  { 0x9900, 0x2a68, 0x4000 },

+  { 0x9900, 0x2a64, 0x3000 },

+  { 0x9900, 0x2a62, 0x2000 },

+  { 0x1900, 0x2a61, 0x0000 },

+  { 0x1900, 0x2a63, 0x0000 },

+  { 0x9900, 0x2a66, 0x2000 },

+  { 0x1900, 0x2a65, 0x0000 },

+  { 0x1900, 0x2a67, 0x0000 },

+  { 0x9900, 0x2a6c, 0x3000 },

+  { 0x9900, 0x2a6a, 0x2000 },

+  { 0x1900, 0x2a69, 0x0000 },

+  { 0x1900, 0x2a6b, 0x0000 },

+  { 0x9900, 0x2a6e, 0x2000 },

+  { 0x1900, 0x2a6d, 0x0000 },

+  { 0x1900, 0x2a6f, 0x0000 },

+  { 0x9900, 0x2a78, 0x4000 },

+  { 0x9900, 0x2a74, 0x3000 },

+  { 0x9900, 0x2a72, 0x2000 },

+  { 0x1900, 0x2a71, 0x0000 },

+  { 0x1900, 0x2a73, 0x0000 },

+  { 0x9900, 0x2a76, 0x2000 },

+  { 0x1900, 0x2a75, 0x0000 },

+  { 0x1900, 0x2a77, 0x0000 },

+  { 0x9900, 0x2a7c, 0x3000 },

+  { 0x9900, 0x2a7a, 0x2000 },

+  { 0x1900, 0x2a79, 0x0000 },

+  { 0x1900, 0x2a7b, 0x0000 },

+  { 0x9900, 0x2a7e, 0x2000 },

+  { 0x1900, 0x2a7d, 0x0000 },

+  { 0x1900, 0x2a7f, 0x0000 },

+  { 0x9900, 0x2a90, 0x5000 },

+  { 0x9900, 0x2a88, 0x4000 },

+  { 0x9900, 0x2a84, 0x3000 },

+  { 0x9900, 0x2a82, 0x2000 },

+  { 0x1900, 0x2a81, 0x0000 },

+  { 0x1900, 0x2a83, 0x0000 },

+  { 0x9900, 0x2a86, 0x2000 },

+  { 0x1900, 0x2a85, 0x0000 },

+  { 0x1900, 0x2a87, 0x0000 },

+  { 0x9900, 0x2a8c, 0x3000 },

+  { 0x9900, 0x2a8a, 0x2000 },

+  { 0x1900, 0x2a89, 0x0000 },

+  { 0x1900, 0x2a8b, 0x0000 },

+  { 0x9900, 0x2a8e, 0x2000 },

+  { 0x1900, 0x2a8d, 0x0000 },

+  { 0x1900, 0x2a8f, 0x0000 },

+  { 0x9900, 0x2a98, 0x4000 },

+  { 0x9900, 0x2a94, 0x3000 },

+  { 0x9900, 0x2a92, 0x2000 },

+  { 0x1900, 0x2a91, 0x0000 },

+  { 0x1900, 0x2a93, 0x0000 },

+  { 0x9900, 0x2a96, 0x2000 },

+  { 0x1900, 0x2a95, 0x0000 },

+  { 0x1900, 0x2a97, 0x0000 },

+  { 0x9900, 0x2a9c, 0x3000 },

+  { 0x9900, 0x2a9a, 0x2000 },

+  { 0x1900, 0x2a99, 0x0000 },

+  { 0x1900, 0x2a9b, 0x0000 },

+  { 0x9900, 0x2a9e, 0x2000 },

+  { 0x1900, 0x2a9d, 0x0000 },

+  { 0x1900, 0x2a9f, 0x0000 },

+  { 0x9a00, 0x2e92, 0x8000 },

+  { 0x9900, 0x2ae0, 0x7000 },

+  { 0x9900, 0x2ac0, 0x6000 },

+  { 0x9900, 0x2ab0, 0x5000 },

+  { 0x9900, 0x2aa8, 0x4000 },

+  { 0x9900, 0x2aa4, 0x3000 },

+  { 0x9900, 0x2aa2, 0x2000 },

+  { 0x1900, 0x2aa1, 0x0000 },

+  { 0x1900, 0x2aa3, 0x0000 },

+  { 0x9900, 0x2aa6, 0x2000 },

+  { 0x1900, 0x2aa5, 0x0000 },

+  { 0x1900, 0x2aa7, 0x0000 },

+  { 0x9900, 0x2aac, 0x3000 },

+  { 0x9900, 0x2aaa, 0x2000 },

+  { 0x1900, 0x2aa9, 0x0000 },

+  { 0x1900, 0x2aab, 0x0000 },

+  { 0x9900, 0x2aae, 0x2000 },

+  { 0x1900, 0x2aad, 0x0000 },

+  { 0x1900, 0x2aaf, 0x0000 },

+  { 0x9900, 0x2ab8, 0x4000 },

+  { 0x9900, 0x2ab4, 0x3000 },

+  { 0x9900, 0x2ab2, 0x2000 },

+  { 0x1900, 0x2ab1, 0x0000 },

+  { 0x1900, 0x2ab3, 0x0000 },

+  { 0x9900, 0x2ab6, 0x2000 },

+  { 0x1900, 0x2ab5, 0x0000 },

+  { 0x1900, 0x2ab7, 0x0000 },

+  { 0x9900, 0x2abc, 0x3000 },

+  { 0x9900, 0x2aba, 0x2000 },

+  { 0x1900, 0x2ab9, 0x0000 },

+  { 0x1900, 0x2abb, 0x0000 },

+  { 0x9900, 0x2abe, 0x2000 },

+  { 0x1900, 0x2abd, 0x0000 },

+  { 0x1900, 0x2abf, 0x0000 },

+  { 0x9900, 0x2ad0, 0x5000 },

+  { 0x9900, 0x2ac8, 0x4000 },

+  { 0x9900, 0x2ac4, 0x3000 },

+  { 0x9900, 0x2ac2, 0x2000 },

+  { 0x1900, 0x2ac1, 0x0000 },

+  { 0x1900, 0x2ac3, 0x0000 },

+  { 0x9900, 0x2ac6, 0x2000 },

+  { 0x1900, 0x2ac5, 0x0000 },

+  { 0x1900, 0x2ac7, 0x0000 },

+  { 0x9900, 0x2acc, 0x3000 },

+  { 0x9900, 0x2aca, 0x2000 },

+  { 0x1900, 0x2ac9, 0x0000 },

+  { 0x1900, 0x2acb, 0x0000 },

+  { 0x9900, 0x2ace, 0x2000 },

+  { 0x1900, 0x2acd, 0x0000 },

+  { 0x1900, 0x2acf, 0x0000 },

+  { 0x9900, 0x2ad8, 0x4000 },

+  { 0x9900, 0x2ad4, 0x3000 },

+  { 0x9900, 0x2ad2, 0x2000 },

+  { 0x1900, 0x2ad1, 0x0000 },

+  { 0x1900, 0x2ad3, 0x0000 },

+  { 0x9900, 0x2ad6, 0x2000 },

+  { 0x1900, 0x2ad5, 0x0000 },

+  { 0x1900, 0x2ad7, 0x0000 },

+  { 0x9900, 0x2adc, 0x3000 },

+  { 0x9900, 0x2ada, 0x2000 },

+  { 0x1900, 0x2ad9, 0x0000 },

+  { 0x1900, 0x2adb, 0x0000 },

+  { 0x9900, 0x2ade, 0x2000 },

+  { 0x1900, 0x2add, 0x0000 },

+  { 0x1900, 0x2adf, 0x0000 },

+  { 0x9a00, 0x2b00, 0x6000 },

+  { 0x9900, 0x2af0, 0x5000 },

+  { 0x9900, 0x2ae8, 0x4000 },

+  { 0x9900, 0x2ae4, 0x3000 },

+  { 0x9900, 0x2ae2, 0x2000 },

+  { 0x1900, 0x2ae1, 0x0000 },

+  { 0x1900, 0x2ae3, 0x0000 },

+  { 0x9900, 0x2ae6, 0x2000 },

+  { 0x1900, 0x2ae5, 0x0000 },

+  { 0x1900, 0x2ae7, 0x0000 },

+  { 0x9900, 0x2aec, 0x3000 },

+  { 0x9900, 0x2aea, 0x2000 },

+  { 0x1900, 0x2ae9, 0x0000 },

+  { 0x1900, 0x2aeb, 0x0000 },

+  { 0x9900, 0x2aee, 0x2000 },

+  { 0x1900, 0x2aed, 0x0000 },

+  { 0x1900, 0x2aef, 0x0000 },

+  { 0x9900, 0x2af8, 0x4000 },

+  { 0x9900, 0x2af4, 0x3000 },

+  { 0x9900, 0x2af2, 0x2000 },

+  { 0x1900, 0x2af1, 0x0000 },

+  { 0x1900, 0x2af3, 0x0000 },

+  { 0x9900, 0x2af6, 0x2000 },

+  { 0x1900, 0x2af5, 0x0000 },

+  { 0x1900, 0x2af7, 0x0000 },

+  { 0x9900, 0x2afc, 0x3000 },

+  { 0x9900, 0x2afa, 0x2000 },

+  { 0x1900, 0x2af9, 0x0000 },

+  { 0x1900, 0x2afb, 0x0000 },

+  { 0x9900, 0x2afe, 0x2000 },

+  { 0x1900, 0x2afd, 0x0000 },

+  { 0x1900, 0x2aff, 0x0000 },

+  { 0x9a00, 0x2e82, 0x5000 },

+  { 0x9a00, 0x2b08, 0x4000 },

+  { 0x9a00, 0x2b04, 0x3000 },

+  { 0x9a00, 0x2b02, 0x2000 },

+  { 0x1a00, 0x2b01, 0x0000 },

+  { 0x1a00, 0x2b03, 0x0000 },

+  { 0x9a00, 0x2b06, 0x2000 },

+  { 0x1a00, 0x2b05, 0x0000 },

+  { 0x1a00, 0x2b07, 0x0000 },

+  { 0x9a00, 0x2b0c, 0x3000 },

+  { 0x9a00, 0x2b0a, 0x2000 },

+  { 0x1a00, 0x2b09, 0x0000 },

+  { 0x1a00, 0x2b0b, 0x0000 },

+  { 0x9a00, 0x2e80, 0x2000 },

+  { 0x1a00, 0x2b0d, 0x0000 },

+  { 0x1a00, 0x2e81, 0x0000 },

+  { 0x9a00, 0x2e8a, 0x4000 },

+  { 0x9a00, 0x2e86, 0x3000 },

+  { 0x9a00, 0x2e84, 0x2000 },

+  { 0x1a00, 0x2e83, 0x0000 },

+  { 0x1a00, 0x2e85, 0x0000 },

+  { 0x9a00, 0x2e88, 0x2000 },

+  { 0x1a00, 0x2e87, 0x0000 },

+  { 0x1a00, 0x2e89, 0x0000 },

+  { 0x9a00, 0x2e8e, 0x3000 },

+  { 0x9a00, 0x2e8c, 0x2000 },

+  { 0x1a00, 0x2e8b, 0x0000 },

+  { 0x1a00, 0x2e8d, 0x0000 },

+  { 0x9a00, 0x2e90, 0x2000 },

+  { 0x1a00, 0x2e8f, 0x0000 },

+  { 0x1a00, 0x2e91, 0x0000 },

+  { 0x9a00, 0x2ed3, 0x7000 },

+  { 0x9a00, 0x2eb3, 0x6000 },

+  { 0x9a00, 0x2ea3, 0x5000 },

+  { 0x9a00, 0x2e9b, 0x4000 },

+  { 0x9a00, 0x2e96, 0x3000 },

+  { 0x9a00, 0x2e94, 0x2000 },

+  { 0x1a00, 0x2e93, 0x0000 },

+  { 0x1a00, 0x2e95, 0x0000 },

+  { 0x9a00, 0x2e98, 0x2000 },

+  { 0x1a00, 0x2e97, 0x0000 },

+  { 0x1a00, 0x2e99, 0x0000 },

+  { 0x9a00, 0x2e9f, 0x3000 },

+  { 0x9a00, 0x2e9d, 0x2000 },

+  { 0x1a00, 0x2e9c, 0x0000 },

+  { 0x1a00, 0x2e9e, 0x0000 },

+  { 0x9a00, 0x2ea1, 0x2000 },

+  { 0x1a00, 0x2ea0, 0x0000 },

+  { 0x1a00, 0x2ea2, 0x0000 },

+  { 0x9a00, 0x2eab, 0x4000 },

+  { 0x9a00, 0x2ea7, 0x3000 },

+  { 0x9a00, 0x2ea5, 0x2000 },

+  { 0x1a00, 0x2ea4, 0x0000 },

+  { 0x1a00, 0x2ea6, 0x0000 },

+  { 0x9a00, 0x2ea9, 0x2000 },

+  { 0x1a00, 0x2ea8, 0x0000 },

+  { 0x1a00, 0x2eaa, 0x0000 },

+  { 0x9a00, 0x2eaf, 0x3000 },

+  { 0x9a00, 0x2ead, 0x2000 },

+  { 0x1a00, 0x2eac, 0x0000 },

+  { 0x1a00, 0x2eae, 0x0000 },

+  { 0x9a00, 0x2eb1, 0x2000 },

+  { 0x1a00, 0x2eb0, 0x0000 },

+  { 0x1a00, 0x2eb2, 0x0000 },

+  { 0x9a00, 0x2ec3, 0x5000 },

+  { 0x9a00, 0x2ebb, 0x4000 },

+  { 0x9a00, 0x2eb7, 0x3000 },

+  { 0x9a00, 0x2eb5, 0x2000 },

+  { 0x1a00, 0x2eb4, 0x0000 },

+  { 0x1a00, 0x2eb6, 0x0000 },

+  { 0x9a00, 0x2eb9, 0x2000 },

+  { 0x1a00, 0x2eb8, 0x0000 },

+  { 0x1a00, 0x2eba, 0x0000 },

+  { 0x9a00, 0x2ebf, 0x3000 },

+  { 0x9a00, 0x2ebd, 0x2000 },

+  { 0x1a00, 0x2ebc, 0x0000 },

+  { 0x1a00, 0x2ebe, 0x0000 },

+  { 0x9a00, 0x2ec1, 0x2000 },

+  { 0x1a00, 0x2ec0, 0x0000 },

+  { 0x1a00, 0x2ec2, 0x0000 },

+  { 0x9a00, 0x2ecb, 0x4000 },

+  { 0x9a00, 0x2ec7, 0x3000 },

+  { 0x9a00, 0x2ec5, 0x2000 },

+  { 0x1a00, 0x2ec4, 0x0000 },

+  { 0x1a00, 0x2ec6, 0x0000 },

+  { 0x9a00, 0x2ec9, 0x2000 },

+  { 0x1a00, 0x2ec8, 0x0000 },

+  { 0x1a00, 0x2eca, 0x0000 },

+  { 0x9a00, 0x2ecf, 0x3000 },

+  { 0x9a00, 0x2ecd, 0x2000 },

+  { 0x1a00, 0x2ecc, 0x0000 },

+  { 0x1a00, 0x2ece, 0x0000 },

+  { 0x9a00, 0x2ed1, 0x2000 },

+  { 0x1a00, 0x2ed0, 0x0000 },

+  { 0x1a00, 0x2ed2, 0x0000 },

+  { 0x9a00, 0x2ef3, 0x6000 },

+  { 0x9a00, 0x2ee3, 0x5000 },

+  { 0x9a00, 0x2edb, 0x4000 },

+  { 0x9a00, 0x2ed7, 0x3000 },

+  { 0x9a00, 0x2ed5, 0x2000 },

+  { 0x1a00, 0x2ed4, 0x0000 },

+  { 0x1a00, 0x2ed6, 0x0000 },

+  { 0x9a00, 0x2ed9, 0x2000 },

+  { 0x1a00, 0x2ed8, 0x0000 },

+  { 0x1a00, 0x2eda, 0x0000 },

+  { 0x9a00, 0x2edf, 0x3000 },

+  { 0x9a00, 0x2edd, 0x2000 },

+  { 0x1a00, 0x2edc, 0x0000 },

+  { 0x1a00, 0x2ede, 0x0000 },

+  { 0x9a00, 0x2ee1, 0x2000 },

+  { 0x1a00, 0x2ee0, 0x0000 },

+  { 0x1a00, 0x2ee2, 0x0000 },

+  { 0x9a00, 0x2eeb, 0x4000 },

+  { 0x9a00, 0x2ee7, 0x3000 },

+  { 0x9a00, 0x2ee5, 0x2000 },

+  { 0x1a00, 0x2ee4, 0x0000 },

+  { 0x1a00, 0x2ee6, 0x0000 },

+  { 0x9a00, 0x2ee9, 0x2000 },

+  { 0x1a00, 0x2ee8, 0x0000 },

+  { 0x1a00, 0x2eea, 0x0000 },

+  { 0x9a00, 0x2eef, 0x3000 },

+  { 0x9a00, 0x2eed, 0x2000 },

+  { 0x1a00, 0x2eec, 0x0000 },

+  { 0x1a00, 0x2eee, 0x0000 },

+  { 0x9a00, 0x2ef1, 0x2000 },

+  { 0x1a00, 0x2ef0, 0x0000 },

+  { 0x1a00, 0x2ef2, 0x0000 },

+  { 0x9a00, 0x2f0f, 0x5000 },

+  { 0x9a00, 0x2f07, 0x4000 },

+  { 0x9a00, 0x2f03, 0x3000 },

+  { 0x9a00, 0x2f01, 0x2000 },

+  { 0x1a00, 0x2f00, 0x0000 },

+  { 0x1a00, 0x2f02, 0x0000 },

+  { 0x9a00, 0x2f05, 0x2000 },

+  { 0x1a00, 0x2f04, 0x0000 },

+  { 0x1a00, 0x2f06, 0x0000 },

+  { 0x9a00, 0x2f0b, 0x3000 },

+  { 0x9a00, 0x2f09, 0x2000 },

+  { 0x1a00, 0x2f08, 0x0000 },

+  { 0x1a00, 0x2f0a, 0x0000 },

+  { 0x9a00, 0x2f0d, 0x2000 },

+  { 0x1a00, 0x2f0c, 0x0000 },

+  { 0x1a00, 0x2f0e, 0x0000 },

+  { 0x9a00, 0x2f17, 0x4000 },

+  { 0x9a00, 0x2f13, 0x3000 },

+  { 0x9a00, 0x2f11, 0x2000 },

+  { 0x1a00, 0x2f10, 0x0000 },

+  { 0x1a00, 0x2f12, 0x0000 },

+  { 0x9a00, 0x2f15, 0x2000 },

+  { 0x1a00, 0x2f14, 0x0000 },

+  { 0x1a00, 0x2f16, 0x0000 },

+  { 0x9a00, 0x2f1b, 0x3000 },

+  { 0x9a00, 0x2f19, 0x2000 },

+  { 0x1a00, 0x2f18, 0x0000 },

+  { 0x1a00, 0x2f1a, 0x0000 },

+  { 0x9a00, 0x2f1d, 0x2000 },

+  { 0x1a00, 0x2f1c, 0x0000 },

+  { 0x1a00, 0x2f1e, 0x0000 },

+  { 0x8701, 0x00f0, 0xd000 },

+  { 0x8700, 0xa34d, 0xc000 },

+  { 0x9a00, 0x3391, 0xb000 },

+  { 0x8700, 0x3149, 0xa000 },

+  { 0x9500, 0x303d, 0x9000 },

+  { 0x9a00, 0x2f9f, 0x8000 },

+  { 0x9a00, 0x2f5f, 0x7000 },

+  { 0x9a00, 0x2f3f, 0x6000 },

+  { 0x9a00, 0x2f2f, 0x5000 },

+  { 0x9a00, 0x2f27, 0x4000 },

+  { 0x9a00, 0x2f23, 0x3000 },

+  { 0x9a00, 0x2f21, 0x2000 },

+  { 0x1a00, 0x2f20, 0x0000 },

+  { 0x1a00, 0x2f22, 0x0000 },

+  { 0x9a00, 0x2f25, 0x2000 },

+  { 0x1a00, 0x2f24, 0x0000 },

+  { 0x1a00, 0x2f26, 0x0000 },

+  { 0x9a00, 0x2f2b, 0x3000 },

+  { 0x9a00, 0x2f29, 0x2000 },

+  { 0x1a00, 0x2f28, 0x0000 },

+  { 0x1a00, 0x2f2a, 0x0000 },

+  { 0x9a00, 0x2f2d, 0x2000 },

+  { 0x1a00, 0x2f2c, 0x0000 },

+  { 0x1a00, 0x2f2e, 0x0000 },

+  { 0x9a00, 0x2f37, 0x4000 },

+  { 0x9a00, 0x2f33, 0x3000 },

+  { 0x9a00, 0x2f31, 0x2000 },

+  { 0x1a00, 0x2f30, 0x0000 },

+  { 0x1a00, 0x2f32, 0x0000 },

+  { 0x9a00, 0x2f35, 0x2000 },

+  { 0x1a00, 0x2f34, 0x0000 },

+  { 0x1a00, 0x2f36, 0x0000 },

+  { 0x9a00, 0x2f3b, 0x3000 },

+  { 0x9a00, 0x2f39, 0x2000 },

+  { 0x1a00, 0x2f38, 0x0000 },

+  { 0x1a00, 0x2f3a, 0x0000 },

+  { 0x9a00, 0x2f3d, 0x2000 },

+  { 0x1a00, 0x2f3c, 0x0000 },

+  { 0x1a00, 0x2f3e, 0x0000 },

+  { 0x9a00, 0x2f4f, 0x5000 },

+  { 0x9a00, 0x2f47, 0x4000 },

+  { 0x9a00, 0x2f43, 0x3000 },

+  { 0x9a00, 0x2f41, 0x2000 },

+  { 0x1a00, 0x2f40, 0x0000 },

+  { 0x1a00, 0x2f42, 0x0000 },

+  { 0x9a00, 0x2f45, 0x2000 },

+  { 0x1a00, 0x2f44, 0x0000 },

+  { 0x1a00, 0x2f46, 0x0000 },

+  { 0x9a00, 0x2f4b, 0x3000 },

+  { 0x9a00, 0x2f49, 0x2000 },

+  { 0x1a00, 0x2f48, 0x0000 },

+  { 0x1a00, 0x2f4a, 0x0000 },

+  { 0x9a00, 0x2f4d, 0x2000 },

+  { 0x1a00, 0x2f4c, 0x0000 },

+  { 0x1a00, 0x2f4e, 0x0000 },

+  { 0x9a00, 0x2f57, 0x4000 },

+  { 0x9a00, 0x2f53, 0x3000 },

+  { 0x9a00, 0x2f51, 0x2000 },

+  { 0x1a00, 0x2f50, 0x0000 },

+  { 0x1a00, 0x2f52, 0x0000 },

+  { 0x9a00, 0x2f55, 0x2000 },

+  { 0x1a00, 0x2f54, 0x0000 },

+  { 0x1a00, 0x2f56, 0x0000 },

+  { 0x9a00, 0x2f5b, 0x3000 },

+  { 0x9a00, 0x2f59, 0x2000 },

+  { 0x1a00, 0x2f58, 0x0000 },

+  { 0x1a00, 0x2f5a, 0x0000 },

+  { 0x9a00, 0x2f5d, 0x2000 },

+  { 0x1a00, 0x2f5c, 0x0000 },

+  { 0x1a00, 0x2f5e, 0x0000 },

+  { 0x9a00, 0x2f7f, 0x6000 },

+  { 0x9a00, 0x2f6f, 0x5000 },

+  { 0x9a00, 0x2f67, 0x4000 },

+  { 0x9a00, 0x2f63, 0x3000 },

+  { 0x9a00, 0x2f61, 0x2000 },

+  { 0x1a00, 0x2f60, 0x0000 },

+  { 0x1a00, 0x2f62, 0x0000 },

+  { 0x9a00, 0x2f65, 0x2000 },

+  { 0x1a00, 0x2f64, 0x0000 },

+  { 0x1a00, 0x2f66, 0x0000 },

+  { 0x9a00, 0x2f6b, 0x3000 },

+  { 0x9a00, 0x2f69, 0x2000 },

+  { 0x1a00, 0x2f68, 0x0000 },

+  { 0x1a00, 0x2f6a, 0x0000 },

+  { 0x9a00, 0x2f6d, 0x2000 },

+  { 0x1a00, 0x2f6c, 0x0000 },

+  { 0x1a00, 0x2f6e, 0x0000 },

+  { 0x9a00, 0x2f77, 0x4000 },

+  { 0x9a00, 0x2f73, 0x3000 },

+  { 0x9a00, 0x2f71, 0x2000 },

+  { 0x1a00, 0x2f70, 0x0000 },

+  { 0x1a00, 0x2f72, 0x0000 },

+  { 0x9a00, 0x2f75, 0x2000 },

+  { 0x1a00, 0x2f74, 0x0000 },

+  { 0x1a00, 0x2f76, 0x0000 },

+  { 0x9a00, 0x2f7b, 0x3000 },

+  { 0x9a00, 0x2f79, 0x2000 },

+  { 0x1a00, 0x2f78, 0x0000 },

+  { 0x1a00, 0x2f7a, 0x0000 },

+  { 0x9a00, 0x2f7d, 0x2000 },

+  { 0x1a00, 0x2f7c, 0x0000 },

+  { 0x1a00, 0x2f7e, 0x0000 },

+  { 0x9a00, 0x2f8f, 0x5000 },

+  { 0x9a00, 0x2f87, 0x4000 },

+  { 0x9a00, 0x2f83, 0x3000 },

+  { 0x9a00, 0x2f81, 0x2000 },

+  { 0x1a00, 0x2f80, 0x0000 },

+  { 0x1a00, 0x2f82, 0x0000 },

+  { 0x9a00, 0x2f85, 0x2000 },

+  { 0x1a00, 0x2f84, 0x0000 },

+  { 0x1a00, 0x2f86, 0x0000 },

+  { 0x9a00, 0x2f8b, 0x3000 },

+  { 0x9a00, 0x2f89, 0x2000 },

+  { 0x1a00, 0x2f88, 0x0000 },

+  { 0x1a00, 0x2f8a, 0x0000 },

+  { 0x9a00, 0x2f8d, 0x2000 },

+  { 0x1a00, 0x2f8c, 0x0000 },

+  { 0x1a00, 0x2f8e, 0x0000 },

+  { 0x9a00, 0x2f97, 0x4000 },

+  { 0x9a00, 0x2f93, 0x3000 },

+  { 0x9a00, 0x2f91, 0x2000 },

+  { 0x1a00, 0x2f90, 0x0000 },

+  { 0x1a00, 0x2f92, 0x0000 },

+  { 0x9a00, 0x2f95, 0x2000 },

+  { 0x1a00, 0x2f94, 0x0000 },

+  { 0x1a00, 0x2f96, 0x0000 },

+  { 0x9a00, 0x2f9b, 0x3000 },

+  { 0x9a00, 0x2f99, 0x2000 },

+  { 0x1a00, 0x2f98, 0x0000 },

+  { 0x1a00, 0x2f9a, 0x0000 },

+  { 0x9a00, 0x2f9d, 0x2000 },

+  { 0x1a00, 0x2f9c, 0x0000 },

+  { 0x1a00, 0x2f9e, 0x0000 },

+  { 0x9a00, 0x2ff9, 0x7000 },

+  { 0x9a00, 0x2fbf, 0x6000 },

+  { 0x9a00, 0x2faf, 0x5000 },

+  { 0x9a00, 0x2fa7, 0x4000 },

+  { 0x9a00, 0x2fa3, 0x3000 },

+  { 0x9a00, 0x2fa1, 0x2000 },

+  { 0x1a00, 0x2fa0, 0x0000 },

+  { 0x1a00, 0x2fa2, 0x0000 },

+  { 0x9a00, 0x2fa5, 0x2000 },

+  { 0x1a00, 0x2fa4, 0x0000 },

+  { 0x1a00, 0x2fa6, 0x0000 },

+  { 0x9a00, 0x2fab, 0x3000 },

+  { 0x9a00, 0x2fa9, 0x2000 },

+  { 0x1a00, 0x2fa8, 0x0000 },

+  { 0x1a00, 0x2faa, 0x0000 },

+  { 0x9a00, 0x2fad, 0x2000 },

+  { 0x1a00, 0x2fac, 0x0000 },

+  { 0x1a00, 0x2fae, 0x0000 },

+  { 0x9a00, 0x2fb7, 0x4000 },

+  { 0x9a00, 0x2fb3, 0x3000 },

+  { 0x9a00, 0x2fb1, 0x2000 },

+  { 0x1a00, 0x2fb0, 0x0000 },

+  { 0x1a00, 0x2fb2, 0x0000 },

+  { 0x9a00, 0x2fb5, 0x2000 },

+  { 0x1a00, 0x2fb4, 0x0000 },

+  { 0x1a00, 0x2fb6, 0x0000 },

+  { 0x9a00, 0x2fbb, 0x3000 },

+  { 0x9a00, 0x2fb9, 0x2000 },

+  { 0x1a00, 0x2fb8, 0x0000 },

+  { 0x1a00, 0x2fba, 0x0000 },

+  { 0x9a00, 0x2fbd, 0x2000 },

+  { 0x1a00, 0x2fbc, 0x0000 },

+  { 0x1a00, 0x2fbe, 0x0000 },

+  { 0x9a00, 0x2fcf, 0x5000 },

+  { 0x9a00, 0x2fc7, 0x4000 },

+  { 0x9a00, 0x2fc3, 0x3000 },

+  { 0x9a00, 0x2fc1, 0x2000 },

+  { 0x1a00, 0x2fc0, 0x0000 },

+  { 0x1a00, 0x2fc2, 0x0000 },

+  { 0x9a00, 0x2fc5, 0x2000 },

+  { 0x1a00, 0x2fc4, 0x0000 },

+  { 0x1a00, 0x2fc6, 0x0000 },

+  { 0x9a00, 0x2fcb, 0x3000 },

+  { 0x9a00, 0x2fc9, 0x2000 },

+  { 0x1a00, 0x2fc8, 0x0000 },

+  { 0x1a00, 0x2fca, 0x0000 },

+  { 0x9a00, 0x2fcd, 0x2000 },

+  { 0x1a00, 0x2fcc, 0x0000 },

+  { 0x1a00, 0x2fce, 0x0000 },

+  { 0x9a00, 0x2ff1, 0x4000 },

+  { 0x9a00, 0x2fd3, 0x3000 },

+  { 0x9a00, 0x2fd1, 0x2000 },

+  { 0x1a00, 0x2fd0, 0x0000 },

+  { 0x1a00, 0x2fd2, 0x0000 },

+  { 0x9a00, 0x2fd5, 0x2000 },

+  { 0x1a00, 0x2fd4, 0x0000 },

+  { 0x1a00, 0x2ff0, 0x0000 },

+  { 0x9a00, 0x2ff5, 0x3000 },

+  { 0x9a00, 0x2ff3, 0x2000 },

+  { 0x1a00, 0x2ff2, 0x0000 },

+  { 0x1a00, 0x2ff4, 0x0000 },

+  { 0x9a00, 0x2ff7, 0x2000 },

+  { 0x1a00, 0x2ff6, 0x0000 },

+  { 0x1a00, 0x2ff8, 0x0000 },

+  { 0x9600, 0x301d, 0x6000 },

+  { 0x9200, 0x300d, 0x5000 },

+  { 0x8600, 0x3005, 0x4000 },

+  { 0x9500, 0x3001, 0x3000 },

+  { 0x9a00, 0x2ffb, 0x2000 },

+  { 0x1a00, 0x2ffa, 0x0000 },

+  { 0x1d00, 0x3000, 0x0000 },

+  { 0x9500, 0x3003, 0x2000 },

+  { 0x1500, 0x3002, 0x0000 },

+  { 0x1a00, 0x3004, 0x0000 },

+  { 0x9200, 0x3009, 0x3000 },

+  { 0x8e00, 0x3007, 0x2000 },

+  { 0x0700, 0x3006, 0x0000 },

+  { 0x1600, 0x3008, 0x0000 },

+  { 0x9200, 0x300b, 0x2000 },

+  { 0x1600, 0x300a, 0x0000 },

+  { 0x1600, 0x300c, 0x0000 },

+  { 0x9200, 0x3015, 0x4000 },

+  { 0x9200, 0x3011, 0x3000 },

+  { 0x9200, 0x300f, 0x2000 },

+  { 0x1600, 0x300e, 0x0000 },

+  { 0x1600, 0x3010, 0x0000 },

+  { 0x9a00, 0x3013, 0x2000 },

+  { 0x1a00, 0x3012, 0x0000 },

+  { 0x1600, 0x3014, 0x0000 },

+  { 0x9200, 0x3019, 0x3000 },

+  { 0x9200, 0x3017, 0x2000 },

+  { 0x1600, 0x3016, 0x0000 },

+  { 0x1600, 0x3018, 0x0000 },

+  { 0x9200, 0x301b, 0x2000 },

+  { 0x1600, 0x301a, 0x0000 },

+  { 0x1100, 0x301c, 0x0000 },

+  { 0x8c00, 0x302d, 0x5000 },

+  { 0x8e00, 0x3025, 0x4000 },

+  { 0x8e00, 0x3021, 0x3000 },

+  { 0x9200, 0x301f, 0x2000 },

+  { 0x1200, 0x301e, 0x0000 },

+  { 0x1a00, 0x3020, 0x0000 },

+  { 0x8e00, 0x3023, 0x2000 },

+  { 0x0e00, 0x3022, 0x0000 },

+  { 0x0e00, 0x3024, 0x0000 },

+  { 0x8e00, 0x3029, 0x3000 },

+  { 0x8e00, 0x3027, 0x2000 },

+  { 0x0e00, 0x3026, 0x0000 },

+  { 0x0e00, 0x3028, 0x0000 },

+  { 0x8c00, 0x302b, 0x2000 },

+  { 0x0c00, 0x302a, 0x0000 },

+  { 0x0c00, 0x302c, 0x0000 },

+  { 0x8600, 0x3035, 0x4000 },

+  { 0x8600, 0x3031, 0x3000 },

+  { 0x8c00, 0x302f, 0x2000 },

+  { 0x0c00, 0x302e, 0x0000 },

+  { 0x1100, 0x3030, 0x0000 },

+  { 0x8600, 0x3033, 0x2000 },

+  { 0x0600, 0x3032, 0x0000 },

+  { 0x0600, 0x3034, 0x0000 },

+  { 0x8e00, 0x3039, 0x3000 },

+  { 0x9a00, 0x3037, 0x2000 },

+  { 0x1a00, 0x3036, 0x0000 },

+  { 0x0e00, 0x3038, 0x0000 },

+  { 0x8600, 0x303b, 0x2000 },

+  { 0x0e00, 0x303a, 0x0000 },

+  { 0x0700, 0x303c, 0x0000 },

+  { 0x8700, 0x30c0, 0x8000 },

+  { 0x8700, 0x307e, 0x7000 },

+  { 0x8700, 0x305e, 0x6000 },

+  { 0x8700, 0x304e, 0x5000 },

+  { 0x8700, 0x3046, 0x4000 },

+  { 0x8700, 0x3042, 0x3000 },

+  { 0x9a00, 0x303f, 0x2000 },

+  { 0x1a00, 0x303e, 0x0000 },

+  { 0x0700, 0x3041, 0x0000 },

+  { 0x8700, 0x3044, 0x2000 },

+  { 0x0700, 0x3043, 0x0000 },

+  { 0x0700, 0x3045, 0x0000 },

+  { 0x8700, 0x304a, 0x3000 },

+  { 0x8700, 0x3048, 0x2000 },

+  { 0x0700, 0x3047, 0x0000 },

+  { 0x0700, 0x3049, 0x0000 },

+  { 0x8700, 0x304c, 0x2000 },

+  { 0x0700, 0x304b, 0x0000 },

+  { 0x0700, 0x304d, 0x0000 },

+  { 0x8700, 0x3056, 0x4000 },

+  { 0x8700, 0x3052, 0x3000 },

+  { 0x8700, 0x3050, 0x2000 },

+  { 0x0700, 0x304f, 0x0000 },

+  { 0x0700, 0x3051, 0x0000 },

+  { 0x8700, 0x3054, 0x2000 },

+  { 0x0700, 0x3053, 0x0000 },

+  { 0x0700, 0x3055, 0x0000 },

+  { 0x8700, 0x305a, 0x3000 },

+  { 0x8700, 0x3058, 0x2000 },

+  { 0x0700, 0x3057, 0x0000 },

+  { 0x0700, 0x3059, 0x0000 },

+  { 0x8700, 0x305c, 0x2000 },

+  { 0x0700, 0x305b, 0x0000 },

+  { 0x0700, 0x305d, 0x0000 },

+  { 0x8700, 0x306e, 0x5000 },

+  { 0x8700, 0x3066, 0x4000 },

+  { 0x8700, 0x3062, 0x3000 },

+  { 0x8700, 0x3060, 0x2000 },

+  { 0x0700, 0x305f, 0x0000 },

+  { 0x0700, 0x3061, 0x0000 },

+  { 0x8700, 0x3064, 0x2000 },

+  { 0x0700, 0x3063, 0x0000 },

+  { 0x0700, 0x3065, 0x0000 },

+  { 0x8700, 0x306a, 0x3000 },

+  { 0x8700, 0x3068, 0x2000 },

+  { 0x0700, 0x3067, 0x0000 },

+  { 0x0700, 0x3069, 0x0000 },

+  { 0x8700, 0x306c, 0x2000 },

+  { 0x0700, 0x306b, 0x0000 },

+  { 0x0700, 0x306d, 0x0000 },

+  { 0x8700, 0x3076, 0x4000 },

+  { 0x8700, 0x3072, 0x3000 },

+  { 0x8700, 0x3070, 0x2000 },

+  { 0x0700, 0x306f, 0x0000 },

+  { 0x0700, 0x3071, 0x0000 },

+  { 0x8700, 0x3074, 0x2000 },

+  { 0x0700, 0x3073, 0x0000 },

+  { 0x0700, 0x3075, 0x0000 },

+  { 0x8700, 0x307a, 0x3000 },

+  { 0x8700, 0x3078, 0x2000 },

+  { 0x0700, 0x3077, 0x0000 },

+  { 0x0700, 0x3079, 0x0000 },

+  { 0x8700, 0x307c, 0x2000 },

+  { 0x0700, 0x307b, 0x0000 },

+  { 0x0700, 0x307d, 0x0000 },

+  { 0x9100, 0x30a0, 0x6000 },

+  { 0x8700, 0x308e, 0x5000 },

+  { 0x8700, 0x3086, 0x4000 },

+  { 0x8700, 0x3082, 0x3000 },

+  { 0x8700, 0x3080, 0x2000 },

+  { 0x0700, 0x307f, 0x0000 },

+  { 0x0700, 0x3081, 0x0000 },

+  { 0x8700, 0x3084, 0x2000 },

+  { 0x0700, 0x3083, 0x0000 },

+  { 0x0700, 0x3085, 0x0000 },

+  { 0x8700, 0x308a, 0x3000 },

+  { 0x8700, 0x3088, 0x2000 },

+  { 0x0700, 0x3087, 0x0000 },

+  { 0x0700, 0x3089, 0x0000 },

+  { 0x8700, 0x308c, 0x2000 },

+  { 0x0700, 0x308b, 0x0000 },

+  { 0x0700, 0x308d, 0x0000 },

+  { 0x8700, 0x3096, 0x4000 },

+  { 0x8700, 0x3092, 0x3000 },

+  { 0x8700, 0x3090, 0x2000 },

+  { 0x0700, 0x308f, 0x0000 },

+  { 0x0700, 0x3091, 0x0000 },

+  { 0x8700, 0x3094, 0x2000 },

+  { 0x0700, 0x3093, 0x0000 },

+  { 0x0700, 0x3095, 0x0000 },

+  { 0x9800, 0x309c, 0x3000 },

+  { 0x8c00, 0x309a, 0x2000 },

+  { 0x0c00, 0x3099, 0x0000 },

+  { 0x1800, 0x309b, 0x0000 },

+  { 0x8600, 0x309e, 0x2000 },

+  { 0x0600, 0x309d, 0x0000 },

+  { 0x0700, 0x309f, 0x0000 },

+  { 0x8700, 0x30b0, 0x5000 },

+  { 0x8700, 0x30a8, 0x4000 },

+  { 0x8700, 0x30a4, 0x3000 },

+  { 0x8700, 0x30a2, 0x2000 },

+  { 0x0700, 0x30a1, 0x0000 },

+  { 0x0700, 0x30a3, 0x0000 },

+  { 0x8700, 0x30a6, 0x2000 },

+  { 0x0700, 0x30a5, 0x0000 },

+  { 0x0700, 0x30a7, 0x0000 },

+  { 0x8700, 0x30ac, 0x3000 },

+  { 0x8700, 0x30aa, 0x2000 },

+  { 0x0700, 0x30a9, 0x0000 },

+  { 0x0700, 0x30ab, 0x0000 },

+  { 0x8700, 0x30ae, 0x2000 },

+  { 0x0700, 0x30ad, 0x0000 },

+  { 0x0700, 0x30af, 0x0000 },

+  { 0x8700, 0x30b8, 0x4000 },

+  { 0x8700, 0x30b4, 0x3000 },

+  { 0x8700, 0x30b2, 0x2000 },

+  { 0x0700, 0x30b1, 0x0000 },

+  { 0x0700, 0x30b3, 0x0000 },

+  { 0x8700, 0x30b6, 0x2000 },

+  { 0x0700, 0x30b5, 0x0000 },

+  { 0x0700, 0x30b7, 0x0000 },

+  { 0x8700, 0x30bc, 0x3000 },

+  { 0x8700, 0x30ba, 0x2000 },

+  { 0x0700, 0x30b9, 0x0000 },

+  { 0x0700, 0x30bb, 0x0000 },

+  { 0x8700, 0x30be, 0x2000 },

+  { 0x0700, 0x30bd, 0x0000 },

+  { 0x0700, 0x30bf, 0x0000 },

+  { 0x8700, 0x3105, 0x7000 },

+  { 0x8700, 0x30e0, 0x6000 },

+  { 0x8700, 0x30d0, 0x5000 },

+  { 0x8700, 0x30c8, 0x4000 },

+  { 0x8700, 0x30c4, 0x3000 },

+  { 0x8700, 0x30c2, 0x2000 },

+  { 0x0700, 0x30c1, 0x0000 },

+  { 0x0700, 0x30c3, 0x0000 },

+  { 0x8700, 0x30c6, 0x2000 },

+  { 0x0700, 0x30c5, 0x0000 },

+  { 0x0700, 0x30c7, 0x0000 },

+  { 0x8700, 0x30cc, 0x3000 },

+  { 0x8700, 0x30ca, 0x2000 },

+  { 0x0700, 0x30c9, 0x0000 },

+  { 0x0700, 0x30cb, 0x0000 },

+  { 0x8700, 0x30ce, 0x2000 },

+  { 0x0700, 0x30cd, 0x0000 },

+  { 0x0700, 0x30cf, 0x0000 },

+  { 0x8700, 0x30d8, 0x4000 },

+  { 0x8700, 0x30d4, 0x3000 },

+  { 0x8700, 0x30d2, 0x2000 },

+  { 0x0700, 0x30d1, 0x0000 },

+  { 0x0700, 0x30d3, 0x0000 },

+  { 0x8700, 0x30d6, 0x2000 },

+  { 0x0700, 0x30d5, 0x0000 },

+  { 0x0700, 0x30d7, 0x0000 },

+  { 0x8700, 0x30dc, 0x3000 },

+  { 0x8700, 0x30da, 0x2000 },

+  { 0x0700, 0x30d9, 0x0000 },

+  { 0x0700, 0x30db, 0x0000 },

+  { 0x8700, 0x30de, 0x2000 },

+  { 0x0700, 0x30dd, 0x0000 },

+  { 0x0700, 0x30df, 0x0000 },

+  { 0x8700, 0x30f0, 0x5000 },

+  { 0x8700, 0x30e8, 0x4000 },

+  { 0x8700, 0x30e4, 0x3000 },

+  { 0x8700, 0x30e2, 0x2000 },

+  { 0x0700, 0x30e1, 0x0000 },

+  { 0x0700, 0x30e3, 0x0000 },

+  { 0x8700, 0x30e6, 0x2000 },

+  { 0x0700, 0x30e5, 0x0000 },

+  { 0x0700, 0x30e7, 0x0000 },

+  { 0x8700, 0x30ec, 0x3000 },

+  { 0x8700, 0x30ea, 0x2000 },

+  { 0x0700, 0x30e9, 0x0000 },

+  { 0x0700, 0x30eb, 0x0000 },

+  { 0x8700, 0x30ee, 0x2000 },

+  { 0x0700, 0x30ed, 0x0000 },

+  { 0x0700, 0x30ef, 0x0000 },

+  { 0x8700, 0x30f8, 0x4000 },

+  { 0x8700, 0x30f4, 0x3000 },

+  { 0x8700, 0x30f2, 0x2000 },

+  { 0x0700, 0x30f1, 0x0000 },

+  { 0x0700, 0x30f3, 0x0000 },

+  { 0x8700, 0x30f6, 0x2000 },

+  { 0x0700, 0x30f5, 0x0000 },

+  { 0x0700, 0x30f7, 0x0000 },

+  { 0x8600, 0x30fc, 0x3000 },

+  { 0x8700, 0x30fa, 0x2000 },

+  { 0x0700, 0x30f9, 0x0000 },

+  { 0x1000, 0x30fb, 0x0000 },

+  { 0x8600, 0x30fe, 0x2000 },

+  { 0x0600, 0x30fd, 0x0000 },

+  { 0x0700, 0x30ff, 0x0000 },

+  { 0x8700, 0x3125, 0x6000 },

+  { 0x8700, 0x3115, 0x5000 },

+  { 0x8700, 0x310d, 0x4000 },

+  { 0x8700, 0x3109, 0x3000 },

+  { 0x8700, 0x3107, 0x2000 },

+  { 0x0700, 0x3106, 0x0000 },

+  { 0x0700, 0x3108, 0x0000 },

+  { 0x8700, 0x310b, 0x2000 },

+  { 0x0700, 0x310a, 0x0000 },

+  { 0x0700, 0x310c, 0x0000 },

+  { 0x8700, 0x3111, 0x3000 },

+  { 0x8700, 0x310f, 0x2000 },

+  { 0x0700, 0x310e, 0x0000 },

+  { 0x0700, 0x3110, 0x0000 },

+  { 0x8700, 0x3113, 0x2000 },

+  { 0x0700, 0x3112, 0x0000 },

+  { 0x0700, 0x3114, 0x0000 },

+  { 0x8700, 0x311d, 0x4000 },

+  { 0x8700, 0x3119, 0x3000 },

+  { 0x8700, 0x3117, 0x2000 },

+  { 0x0700, 0x3116, 0x0000 },

+  { 0x0700, 0x3118, 0x0000 },

+  { 0x8700, 0x311b, 0x2000 },

+  { 0x0700, 0x311a, 0x0000 },

+  { 0x0700, 0x311c, 0x0000 },

+  { 0x8700, 0x3121, 0x3000 },

+  { 0x8700, 0x311f, 0x2000 },

+  { 0x0700, 0x311e, 0x0000 },

+  { 0x0700, 0x3120, 0x0000 },

+  { 0x8700, 0x3123, 0x2000 },

+  { 0x0700, 0x3122, 0x0000 },

+  { 0x0700, 0x3124, 0x0000 },

+  { 0x8700, 0x3139, 0x5000 },

+  { 0x8700, 0x3131, 0x4000 },

+  { 0x8700, 0x3129, 0x3000 },

+  { 0x8700, 0x3127, 0x2000 },

+  { 0x0700, 0x3126, 0x0000 },

+  { 0x0700, 0x3128, 0x0000 },

+  { 0x8700, 0x312b, 0x2000 },

+  { 0x0700, 0x312a, 0x0000 },

+  { 0x0700, 0x312c, 0x0000 },

+  { 0x8700, 0x3135, 0x3000 },

+  { 0x8700, 0x3133, 0x2000 },

+  { 0x0700, 0x3132, 0x0000 },

+  { 0x0700, 0x3134, 0x0000 },

+  { 0x8700, 0x3137, 0x2000 },

+  { 0x0700, 0x3136, 0x0000 },

+  { 0x0700, 0x3138, 0x0000 },

+  { 0x8700, 0x3141, 0x4000 },

+  { 0x8700, 0x313d, 0x3000 },

+  { 0x8700, 0x313b, 0x2000 },

+  { 0x0700, 0x313a, 0x0000 },

+  { 0x0700, 0x313c, 0x0000 },

+  { 0x8700, 0x313f, 0x2000 },

+  { 0x0700, 0x313e, 0x0000 },

+  { 0x0700, 0x3140, 0x0000 },

+  { 0x8700, 0x3145, 0x3000 },

+  { 0x8700, 0x3143, 0x2000 },

+  { 0x0700, 0x3142, 0x0000 },

+  { 0x0700, 0x3144, 0x0000 },

+  { 0x8700, 0x3147, 0x2000 },

+  { 0x0700, 0x3146, 0x0000 },

+  { 0x0700, 0x3148, 0x0000 },

+  { 0x9a00, 0x3290, 0x9000 },

+  { 0x9a00, 0x3202, 0x8000 },

+  { 0x8700, 0x3189, 0x7000 },

+  { 0x8700, 0x3169, 0x6000 },

+  { 0x8700, 0x3159, 0x5000 },

+  { 0x8700, 0x3151, 0x4000 },

+  { 0x8700, 0x314d, 0x3000 },

+  { 0x8700, 0x314b, 0x2000 },

+  { 0x0700, 0x314a, 0x0000 },

+  { 0x0700, 0x314c, 0x0000 },

+  { 0x8700, 0x314f, 0x2000 },

+  { 0x0700, 0x314e, 0x0000 },

+  { 0x0700, 0x3150, 0x0000 },

+  { 0x8700, 0x3155, 0x3000 },

+  { 0x8700, 0x3153, 0x2000 },

+  { 0x0700, 0x3152, 0x0000 },

+  { 0x0700, 0x3154, 0x0000 },

+  { 0x8700, 0x3157, 0x2000 },

+  { 0x0700, 0x3156, 0x0000 },

+  { 0x0700, 0x3158, 0x0000 },

+  { 0x8700, 0x3161, 0x4000 },

+  { 0x8700, 0x315d, 0x3000 },

+  { 0x8700, 0x315b, 0x2000 },

+  { 0x0700, 0x315a, 0x0000 },

+  { 0x0700, 0x315c, 0x0000 },

+  { 0x8700, 0x315f, 0x2000 },

+  { 0x0700, 0x315e, 0x0000 },

+  { 0x0700, 0x3160, 0x0000 },

+  { 0x8700, 0x3165, 0x3000 },

+  { 0x8700, 0x3163, 0x2000 },

+  { 0x0700, 0x3162, 0x0000 },

+  { 0x0700, 0x3164, 0x0000 },

+  { 0x8700, 0x3167, 0x2000 },

+  { 0x0700, 0x3166, 0x0000 },

+  { 0x0700, 0x3168, 0x0000 },

+  { 0x8700, 0x3179, 0x5000 },

+  { 0x8700, 0x3171, 0x4000 },

+  { 0x8700, 0x316d, 0x3000 },

+  { 0x8700, 0x316b, 0x2000 },

+  { 0x0700, 0x316a, 0x0000 },

+  { 0x0700, 0x316c, 0x0000 },

+  { 0x8700, 0x316f, 0x2000 },

+  { 0x0700, 0x316e, 0x0000 },

+  { 0x0700, 0x3170, 0x0000 },

+  { 0x8700, 0x3175, 0x3000 },

+  { 0x8700, 0x3173, 0x2000 },

+  { 0x0700, 0x3172, 0x0000 },

+  { 0x0700, 0x3174, 0x0000 },

+  { 0x8700, 0x3177, 0x2000 },

+  { 0x0700, 0x3176, 0x0000 },

+  { 0x0700, 0x3178, 0x0000 },

+  { 0x8700, 0x3181, 0x4000 },

+  { 0x8700, 0x317d, 0x3000 },

+  { 0x8700, 0x317b, 0x2000 },

+  { 0x0700, 0x317a, 0x0000 },

+  { 0x0700, 0x317c, 0x0000 },

+  { 0x8700, 0x317f, 0x2000 },

+  { 0x0700, 0x317e, 0x0000 },

+  { 0x0700, 0x3180, 0x0000 },

+  { 0x8700, 0x3185, 0x3000 },

+  { 0x8700, 0x3183, 0x2000 },

+  { 0x0700, 0x3182, 0x0000 },

+  { 0x0700, 0x3184, 0x0000 },

+  { 0x8700, 0x3187, 0x2000 },

+  { 0x0700, 0x3186, 0x0000 },

+  { 0x0700, 0x3188, 0x0000 },

+  { 0x8700, 0x31aa, 0x6000 },

+  { 0x9a00, 0x319a, 0x5000 },

+  { 0x8f00, 0x3192, 0x4000 },

+  { 0x8700, 0x318d, 0x3000 },

+  { 0x8700, 0x318b, 0x2000 },

+  { 0x0700, 0x318a, 0x0000 },

+  { 0x0700, 0x318c, 0x0000 },

+  { 0x9a00, 0x3190, 0x2000 },

+  { 0x0700, 0x318e, 0x0000 },

+  { 0x1a00, 0x3191, 0x0000 },

+  { 0x9a00, 0x3196, 0x3000 },

+  { 0x8f00, 0x3194, 0x2000 },

+  { 0x0f00, 0x3193, 0x0000 },

+  { 0x0f00, 0x3195, 0x0000 },

+  { 0x9a00, 0x3198, 0x2000 },

+  { 0x1a00, 0x3197, 0x0000 },

+  { 0x1a00, 0x3199, 0x0000 },

+  { 0x8700, 0x31a2, 0x4000 },

+  { 0x9a00, 0x319e, 0x3000 },

+  { 0x9a00, 0x319c, 0x2000 },

+  { 0x1a00, 0x319b, 0x0000 },

+  { 0x1a00, 0x319d, 0x0000 },

+  { 0x8700, 0x31a0, 0x2000 },

+  { 0x1a00, 0x319f, 0x0000 },

+  { 0x0700, 0x31a1, 0x0000 },

+  { 0x8700, 0x31a6, 0x3000 },

+  { 0x8700, 0x31a4, 0x2000 },

+  { 0x0700, 0x31a3, 0x0000 },

+  { 0x0700, 0x31a5, 0x0000 },

+  { 0x8700, 0x31a8, 0x2000 },

+  { 0x0700, 0x31a7, 0x0000 },

+  { 0x0700, 0x31a9, 0x0000 },

+  { 0x8700, 0x31f2, 0x5000 },

+  { 0x8700, 0x31b2, 0x4000 },

+  { 0x8700, 0x31ae, 0x3000 },

+  { 0x8700, 0x31ac, 0x2000 },

+  { 0x0700, 0x31ab, 0x0000 },

+  { 0x0700, 0x31ad, 0x0000 },

+  { 0x8700, 0x31b0, 0x2000 },

+  { 0x0700, 0x31af, 0x0000 },

+  { 0x0700, 0x31b1, 0x0000 },

+  { 0x8700, 0x31b6, 0x3000 },

+  { 0x8700, 0x31b4, 0x2000 },

+  { 0x0700, 0x31b3, 0x0000 },

+  { 0x0700, 0x31b5, 0x0000 },

+  { 0x8700, 0x31f0, 0x2000 },

+  { 0x0700, 0x31b7, 0x0000 },

+  { 0x0700, 0x31f1, 0x0000 },

+  { 0x8700, 0x31fa, 0x4000 },

+  { 0x8700, 0x31f6, 0x3000 },

+  { 0x8700, 0x31f4, 0x2000 },

+  { 0x0700, 0x31f3, 0x0000 },

+  { 0x0700, 0x31f5, 0x0000 },

+  { 0x8700, 0x31f8, 0x2000 },

+  { 0x0700, 0x31f7, 0x0000 },

+  { 0x0700, 0x31f9, 0x0000 },

+  { 0x8700, 0x31fe, 0x3000 },

+  { 0x8700, 0x31fc, 0x2000 },

+  { 0x0700, 0x31fb, 0x0000 },

+  { 0x0700, 0x31fd, 0x0000 },

+  { 0x9a00, 0x3200, 0x2000 },

+  { 0x0700, 0x31ff, 0x0000 },

+  { 0x1a00, 0x3201, 0x0000 },

+  { 0x9a00, 0x3243, 0x7000 },

+  { 0x8f00, 0x3223, 0x6000 },

+  { 0x9a00, 0x3212, 0x5000 },

+  { 0x9a00, 0x320a, 0x4000 },

+  { 0x9a00, 0x3206, 0x3000 },

+  { 0x9a00, 0x3204, 0x2000 },

+  { 0x1a00, 0x3203, 0x0000 },

+  { 0x1a00, 0x3205, 0x0000 },

+  { 0x9a00, 0x3208, 0x2000 },

+  { 0x1a00, 0x3207, 0x0000 },

+  { 0x1a00, 0x3209, 0x0000 },

+  { 0x9a00, 0x320e, 0x3000 },

+  { 0x9a00, 0x320c, 0x2000 },

+  { 0x1a00, 0x320b, 0x0000 },

+  { 0x1a00, 0x320d, 0x0000 },

+  { 0x9a00, 0x3210, 0x2000 },

+  { 0x1a00, 0x320f, 0x0000 },

+  { 0x1a00, 0x3211, 0x0000 },

+  { 0x9a00, 0x321a, 0x4000 },

+  { 0x9a00, 0x3216, 0x3000 },

+  { 0x9a00, 0x3214, 0x2000 },

+  { 0x1a00, 0x3213, 0x0000 },

+  { 0x1a00, 0x3215, 0x0000 },

+  { 0x9a00, 0x3218, 0x2000 },

+  { 0x1a00, 0x3217, 0x0000 },

+  { 0x1a00, 0x3219, 0x0000 },

+  { 0x9a00, 0x321e, 0x3000 },

+  { 0x9a00, 0x321c, 0x2000 },

+  { 0x1a00, 0x321b, 0x0000 },

+  { 0x1a00, 0x321d, 0x0000 },

+  { 0x8f00, 0x3221, 0x2000 },

+  { 0x0f00, 0x3220, 0x0000 },

+  { 0x0f00, 0x3222, 0x0000 },

+  { 0x9a00, 0x3233, 0x5000 },

+  { 0x9a00, 0x322b, 0x4000 },

+  { 0x8f00, 0x3227, 0x3000 },

+  { 0x8f00, 0x3225, 0x2000 },

+  { 0x0f00, 0x3224, 0x0000 },

+  { 0x0f00, 0x3226, 0x0000 },

+  { 0x8f00, 0x3229, 0x2000 },

+  { 0x0f00, 0x3228, 0x0000 },

+  { 0x1a00, 0x322a, 0x0000 },

+  { 0x9a00, 0x322f, 0x3000 },

+  { 0x9a00, 0x322d, 0x2000 },

+  { 0x1a00, 0x322c, 0x0000 },

+  { 0x1a00, 0x322e, 0x0000 },

+  { 0x9a00, 0x3231, 0x2000 },

+  { 0x1a00, 0x3230, 0x0000 },

+  { 0x1a00, 0x3232, 0x0000 },

+  { 0x9a00, 0x323b, 0x4000 },

+  { 0x9a00, 0x3237, 0x3000 },

+  { 0x9a00, 0x3235, 0x2000 },

+  { 0x1a00, 0x3234, 0x0000 },

+  { 0x1a00, 0x3236, 0x0000 },

+  { 0x9a00, 0x3239, 0x2000 },

+  { 0x1a00, 0x3238, 0x0000 },

+  { 0x1a00, 0x323a, 0x0000 },

+  { 0x9a00, 0x323f, 0x3000 },

+  { 0x9a00, 0x323d, 0x2000 },

+  { 0x1a00, 0x323c, 0x0000 },

+  { 0x1a00, 0x323e, 0x0000 },

+  { 0x9a00, 0x3241, 0x2000 },

+  { 0x1a00, 0x3240, 0x0000 },

+  { 0x1a00, 0x3242, 0x0000 },

+  { 0x9a00, 0x326f, 0x6000 },

+  { 0x8f00, 0x325f, 0x5000 },

+  { 0x8f00, 0x3257, 0x4000 },

+  { 0x8f00, 0x3253, 0x3000 },

+  { 0x8f00, 0x3251, 0x2000 },

+  { 0x1a00, 0x3250, 0x0000 },

+  { 0x0f00, 0x3252, 0x0000 },

+  { 0x8f00, 0x3255, 0x2000 },

+  { 0x0f00, 0x3254, 0x0000 },

+  { 0x0f00, 0x3256, 0x0000 },

+  { 0x8f00, 0x325b, 0x3000 },

+  { 0x8f00, 0x3259, 0x2000 },

+  { 0x0f00, 0x3258, 0x0000 },

+  { 0x0f00, 0x325a, 0x0000 },

+  { 0x8f00, 0x325d, 0x2000 },

+  { 0x0f00, 0x325c, 0x0000 },

+  { 0x0f00, 0x325e, 0x0000 },

+  { 0x9a00, 0x3267, 0x4000 },

+  { 0x9a00, 0x3263, 0x3000 },

+  { 0x9a00, 0x3261, 0x2000 },

+  { 0x1a00, 0x3260, 0x0000 },

+  { 0x1a00, 0x3262, 0x0000 },

+  { 0x9a00, 0x3265, 0x2000 },

+  { 0x1a00, 0x3264, 0x0000 },

+  { 0x1a00, 0x3266, 0x0000 },

+  { 0x9a00, 0x326b, 0x3000 },

+  { 0x9a00, 0x3269, 0x2000 },

+  { 0x1a00, 0x3268, 0x0000 },

+  { 0x1a00, 0x326a, 0x0000 },

+  { 0x9a00, 0x326d, 0x2000 },

+  { 0x1a00, 0x326c, 0x0000 },

+  { 0x1a00, 0x326e, 0x0000 },

+  { 0x8f00, 0x3280, 0x5000 },

+  { 0x9a00, 0x3277, 0x4000 },

+  { 0x9a00, 0x3273, 0x3000 },

+  { 0x9a00, 0x3271, 0x2000 },

+  { 0x1a00, 0x3270, 0x0000 },

+  { 0x1a00, 0x3272, 0x0000 },

+  { 0x9a00, 0x3275, 0x2000 },

+  { 0x1a00, 0x3274, 0x0000 },

+  { 0x1a00, 0x3276, 0x0000 },

+  { 0x9a00, 0x327b, 0x3000 },

+  { 0x9a00, 0x3279, 0x2000 },

+  { 0x1a00, 0x3278, 0x0000 },

+  { 0x1a00, 0x327a, 0x0000 },

+  { 0x9a00, 0x327d, 0x2000 },

+  { 0x1a00, 0x327c, 0x0000 },

+  { 0x1a00, 0x327f, 0x0000 },

+  { 0x8f00, 0x3288, 0x4000 },

+  { 0x8f00, 0x3284, 0x3000 },

+  { 0x8f00, 0x3282, 0x2000 },

+  { 0x0f00, 0x3281, 0x0000 },

+  { 0x0f00, 0x3283, 0x0000 },

+  { 0x8f00, 0x3286, 0x2000 },

+  { 0x0f00, 0x3285, 0x0000 },

+  { 0x0f00, 0x3287, 0x0000 },

+  { 0x9a00, 0x328c, 0x3000 },

+  { 0x9a00, 0x328a, 0x2000 },

+  { 0x0f00, 0x3289, 0x0000 },

+  { 0x1a00, 0x328b, 0x0000 },

+  { 0x9a00, 0x328e, 0x2000 },

+  { 0x1a00, 0x328d, 0x0000 },

+  { 0x1a00, 0x328f, 0x0000 },

+  { 0x9a00, 0x3311, 0x8000 },

+  { 0x9a00, 0x32d0, 0x7000 },

+  { 0x9a00, 0x32b0, 0x6000 },

+  { 0x9a00, 0x32a0, 0x5000 },

+  { 0x9a00, 0x3298, 0x4000 },

+  { 0x9a00, 0x3294, 0x3000 },

+  { 0x9a00, 0x3292, 0x2000 },

+  { 0x1a00, 0x3291, 0x0000 },

+  { 0x1a00, 0x3293, 0x0000 },

+  { 0x9a00, 0x3296, 0x2000 },

+  { 0x1a00, 0x3295, 0x0000 },

+  { 0x1a00, 0x3297, 0x0000 },

+  { 0x9a00, 0x329c, 0x3000 },

+  { 0x9a00, 0x329a, 0x2000 },

+  { 0x1a00, 0x3299, 0x0000 },

+  { 0x1a00, 0x329b, 0x0000 },

+  { 0x9a00, 0x329e, 0x2000 },

+  { 0x1a00, 0x329d, 0x0000 },

+  { 0x1a00, 0x329f, 0x0000 },

+  { 0x9a00, 0x32a8, 0x4000 },

+  { 0x9a00, 0x32a4, 0x3000 },

+  { 0x9a00, 0x32a2, 0x2000 },

+  { 0x1a00, 0x32a1, 0x0000 },

+  { 0x1a00, 0x32a3, 0x0000 },

+  { 0x9a00, 0x32a6, 0x2000 },

+  { 0x1a00, 0x32a5, 0x0000 },

+  { 0x1a00, 0x32a7, 0x0000 },

+  { 0x9a00, 0x32ac, 0x3000 },

+  { 0x9a00, 0x32aa, 0x2000 },

+  { 0x1a00, 0x32a9, 0x0000 },

+  { 0x1a00, 0x32ab, 0x0000 },

+  { 0x9a00, 0x32ae, 0x2000 },

+  { 0x1a00, 0x32ad, 0x0000 },

+  { 0x1a00, 0x32af, 0x0000 },

+  { 0x9a00, 0x32c0, 0x5000 },

+  { 0x8f00, 0x32b8, 0x4000 },

+  { 0x8f00, 0x32b4, 0x3000 },

+  { 0x8f00, 0x32b2, 0x2000 },

+  { 0x0f00, 0x32b1, 0x0000 },

+  { 0x0f00, 0x32b3, 0x0000 },

+  { 0x8f00, 0x32b6, 0x2000 },

+  { 0x0f00, 0x32b5, 0x0000 },

+  { 0x0f00, 0x32b7, 0x0000 },

+  { 0x8f00, 0x32bc, 0x3000 },

+  { 0x8f00, 0x32ba, 0x2000 },

+  { 0x0f00, 0x32b9, 0x0000 },

+  { 0x0f00, 0x32bb, 0x0000 },

+  { 0x8f00, 0x32be, 0x2000 },

+  { 0x0f00, 0x32bd, 0x0000 },

+  { 0x0f00, 0x32bf, 0x0000 },

+  { 0x9a00, 0x32c8, 0x4000 },

+  { 0x9a00, 0x32c4, 0x3000 },

+  { 0x9a00, 0x32c2, 0x2000 },

+  { 0x1a00, 0x32c1, 0x0000 },

+  { 0x1a00, 0x32c3, 0x0000 },

+  { 0x9a00, 0x32c6, 0x2000 },

+  { 0x1a00, 0x32c5, 0x0000 },

+  { 0x1a00, 0x32c7, 0x0000 },

+  { 0x9a00, 0x32cc, 0x3000 },

+  { 0x9a00, 0x32ca, 0x2000 },

+  { 0x1a00, 0x32c9, 0x0000 },

+  { 0x1a00, 0x32cb, 0x0000 },

+  { 0x9a00, 0x32ce, 0x2000 },

+  { 0x1a00, 0x32cd, 0x0000 },

+  { 0x1a00, 0x32cf, 0x0000 },

+  { 0x9a00, 0x32f0, 0x6000 },

+  { 0x9a00, 0x32e0, 0x5000 },

+  { 0x9a00, 0x32d8, 0x4000 },

+  { 0x9a00, 0x32d4, 0x3000 },

+  { 0x9a00, 0x32d2, 0x2000 },

+  { 0x1a00, 0x32d1, 0x0000 },

+  { 0x1a00, 0x32d3, 0x0000 },

+  { 0x9a00, 0x32d6, 0x2000 },

+  { 0x1a00, 0x32d5, 0x0000 },

+  { 0x1a00, 0x32d7, 0x0000 },

+  { 0x9a00, 0x32dc, 0x3000 },

+  { 0x9a00, 0x32da, 0x2000 },

+  { 0x1a00, 0x32d9, 0x0000 },

+  { 0x1a00, 0x32db, 0x0000 },

+  { 0x9a00, 0x32de, 0x2000 },

+  { 0x1a00, 0x32dd, 0x0000 },

+  { 0x1a00, 0x32df, 0x0000 },

+  { 0x9a00, 0x32e8, 0x4000 },

+  { 0x9a00, 0x32e4, 0x3000 },

+  { 0x9a00, 0x32e2, 0x2000 },

+  { 0x1a00, 0x32e1, 0x0000 },

+  { 0x1a00, 0x32e3, 0x0000 },

+  { 0x9a00, 0x32e6, 0x2000 },

+  { 0x1a00, 0x32e5, 0x0000 },

+  { 0x1a00, 0x32e7, 0x0000 },

+  { 0x9a00, 0x32ec, 0x3000 },

+  { 0x9a00, 0x32ea, 0x2000 },

+  { 0x1a00, 0x32e9, 0x0000 },

+  { 0x1a00, 0x32eb, 0x0000 },

+  { 0x9a00, 0x32ee, 0x2000 },

+  { 0x1a00, 0x32ed, 0x0000 },

+  { 0x1a00, 0x32ef, 0x0000 },

+  { 0x9a00, 0x3301, 0x5000 },

+  { 0x9a00, 0x32f8, 0x4000 },

+  { 0x9a00, 0x32f4, 0x3000 },

+  { 0x9a00, 0x32f2, 0x2000 },

+  { 0x1a00, 0x32f1, 0x0000 },

+  { 0x1a00, 0x32f3, 0x0000 },

+  { 0x9a00, 0x32f6, 0x2000 },

+  { 0x1a00, 0x32f5, 0x0000 },

+  { 0x1a00, 0x32f7, 0x0000 },

+  { 0x9a00, 0x32fc, 0x3000 },

+  { 0x9a00, 0x32fa, 0x2000 },

+  { 0x1a00, 0x32f9, 0x0000 },

+  { 0x1a00, 0x32fb, 0x0000 },

+  { 0x9a00, 0x32fe, 0x2000 },

+  { 0x1a00, 0x32fd, 0x0000 },

+  { 0x1a00, 0x3300, 0x0000 },

+  { 0x9a00, 0x3309, 0x4000 },

+  { 0x9a00, 0x3305, 0x3000 },

+  { 0x9a00, 0x3303, 0x2000 },

+  { 0x1a00, 0x3302, 0x0000 },

+  { 0x1a00, 0x3304, 0x0000 },

+  { 0x9a00, 0x3307, 0x2000 },

+  { 0x1a00, 0x3306, 0x0000 },

+  { 0x1a00, 0x3308, 0x0000 },

+  { 0x9a00, 0x330d, 0x3000 },

+  { 0x9a00, 0x330b, 0x2000 },

+  { 0x1a00, 0x330a, 0x0000 },

+  { 0x1a00, 0x330c, 0x0000 },

+  { 0x9a00, 0x330f, 0x2000 },

+  { 0x1a00, 0x330e, 0x0000 },

+  { 0x1a00, 0x3310, 0x0000 },

+  { 0x9a00, 0x3351, 0x7000 },

+  { 0x9a00, 0x3331, 0x6000 },

+  { 0x9a00, 0x3321, 0x5000 },

+  { 0x9a00, 0x3319, 0x4000 },

+  { 0x9a00, 0x3315, 0x3000 },

+  { 0x9a00, 0x3313, 0x2000 },

+  { 0x1a00, 0x3312, 0x0000 },

+  { 0x1a00, 0x3314, 0x0000 },

+  { 0x9a00, 0x3317, 0x2000 },

+  { 0x1a00, 0x3316, 0x0000 },

+  { 0x1a00, 0x3318, 0x0000 },

+  { 0x9a00, 0x331d, 0x3000 },

+  { 0x9a00, 0x331b, 0x2000 },

+  { 0x1a00, 0x331a, 0x0000 },

+  { 0x1a00, 0x331c, 0x0000 },

+  { 0x9a00, 0x331f, 0x2000 },

+  { 0x1a00, 0x331e, 0x0000 },

+  { 0x1a00, 0x3320, 0x0000 },

+  { 0x9a00, 0x3329, 0x4000 },

+  { 0x9a00, 0x3325, 0x3000 },

+  { 0x9a00, 0x3323, 0x2000 },

+  { 0x1a00, 0x3322, 0x0000 },

+  { 0x1a00, 0x3324, 0x0000 },

+  { 0x9a00, 0x3327, 0x2000 },

+  { 0x1a00, 0x3326, 0x0000 },

+  { 0x1a00, 0x3328, 0x0000 },

+  { 0x9a00, 0x332d, 0x3000 },

+  { 0x9a00, 0x332b, 0x2000 },

+  { 0x1a00, 0x332a, 0x0000 },

+  { 0x1a00, 0x332c, 0x0000 },

+  { 0x9a00, 0x332f, 0x2000 },

+  { 0x1a00, 0x332e, 0x0000 },

+  { 0x1a00, 0x3330, 0x0000 },

+  { 0x9a00, 0x3341, 0x5000 },

+  { 0x9a00, 0x3339, 0x4000 },

+  { 0x9a00, 0x3335, 0x3000 },

+  { 0x9a00, 0x3333, 0x2000 },

+  { 0x1a00, 0x3332, 0x0000 },

+  { 0x1a00, 0x3334, 0x0000 },

+  { 0x9a00, 0x3337, 0x2000 },

+  { 0x1a00, 0x3336, 0x0000 },

+  { 0x1a00, 0x3338, 0x0000 },

+  { 0x9a00, 0x333d, 0x3000 },

+  { 0x9a00, 0x333b, 0x2000 },

+  { 0x1a00, 0x333a, 0x0000 },

+  { 0x1a00, 0x333c, 0x0000 },

+  { 0x9a00, 0x333f, 0x2000 },

+  { 0x1a00, 0x333e, 0x0000 },

+  { 0x1a00, 0x3340, 0x0000 },

+  { 0x9a00, 0x3349, 0x4000 },

+  { 0x9a00, 0x3345, 0x3000 },

+  { 0x9a00, 0x3343, 0x2000 },

+  { 0x1a00, 0x3342, 0x0000 },

+  { 0x1a00, 0x3344, 0x0000 },

+  { 0x9a00, 0x3347, 0x2000 },

+  { 0x1a00, 0x3346, 0x0000 },

+  { 0x1a00, 0x3348, 0x0000 },

+  { 0x9a00, 0x334d, 0x3000 },

+  { 0x9a00, 0x334b, 0x2000 },

+  { 0x1a00, 0x334a, 0x0000 },

+  { 0x1a00, 0x334c, 0x0000 },

+  { 0x9a00, 0x334f, 0x2000 },

+  { 0x1a00, 0x334e, 0x0000 },

+  { 0x1a00, 0x3350, 0x0000 },

+  { 0x9a00, 0x3371, 0x6000 },

+  { 0x9a00, 0x3361, 0x5000 },

+  { 0x9a00, 0x3359, 0x4000 },

+  { 0x9a00, 0x3355, 0x3000 },

+  { 0x9a00, 0x3353, 0x2000 },

+  { 0x1a00, 0x3352, 0x0000 },

+  { 0x1a00, 0x3354, 0x0000 },

+  { 0x9a00, 0x3357, 0x2000 },

+  { 0x1a00, 0x3356, 0x0000 },

+  { 0x1a00, 0x3358, 0x0000 },

+  { 0x9a00, 0x335d, 0x3000 },

+  { 0x9a00, 0x335b, 0x2000 },

+  { 0x1a00, 0x335a, 0x0000 },

+  { 0x1a00, 0x335c, 0x0000 },

+  { 0x9a00, 0x335f, 0x2000 },

+  { 0x1a00, 0x335e, 0x0000 },

+  { 0x1a00, 0x3360, 0x0000 },

+  { 0x9a00, 0x3369, 0x4000 },

+  { 0x9a00, 0x3365, 0x3000 },

+  { 0x9a00, 0x3363, 0x2000 },

+  { 0x1a00, 0x3362, 0x0000 },

+  { 0x1a00, 0x3364, 0x0000 },

+  { 0x9a00, 0x3367, 0x2000 },

+  { 0x1a00, 0x3366, 0x0000 },

+  { 0x1a00, 0x3368, 0x0000 },

+  { 0x9a00, 0x336d, 0x3000 },

+  { 0x9a00, 0x336b, 0x2000 },

+  { 0x1a00, 0x336a, 0x0000 },

+  { 0x1a00, 0x336c, 0x0000 },

+  { 0x9a00, 0x336f, 0x2000 },

+  { 0x1a00, 0x336e, 0x0000 },

+  { 0x1a00, 0x3370, 0x0000 },

+  { 0x9a00, 0x3381, 0x5000 },

+  { 0x9a00, 0x3379, 0x4000 },

+  { 0x9a00, 0x3375, 0x3000 },

+  { 0x9a00, 0x3373, 0x2000 },

+  { 0x1a00, 0x3372, 0x0000 },

+  { 0x1a00, 0x3374, 0x0000 },

+  { 0x9a00, 0x3377, 0x2000 },

+  { 0x1a00, 0x3376, 0x0000 },

+  { 0x1a00, 0x3378, 0x0000 },

+  { 0x9a00, 0x337d, 0x3000 },

+  { 0x9a00, 0x337b, 0x2000 },

+  { 0x1a00, 0x337a, 0x0000 },

+  { 0x1a00, 0x337c, 0x0000 },

+  { 0x9a00, 0x337f, 0x2000 },

+  { 0x1a00, 0x337e, 0x0000 },

+  { 0x1a00, 0x3380, 0x0000 },

+  { 0x9a00, 0x3389, 0x4000 },

+  { 0x9a00, 0x3385, 0x3000 },

+  { 0x9a00, 0x3383, 0x2000 },

+  { 0x1a00, 0x3382, 0x0000 },

+  { 0x1a00, 0x3384, 0x0000 },

+  { 0x9a00, 0x3387, 0x2000 },

+  { 0x1a00, 0x3386, 0x0000 },

+  { 0x1a00, 0x3388, 0x0000 },

+  { 0x9a00, 0x338d, 0x3000 },

+  { 0x9a00, 0x338b, 0x2000 },

+  { 0x1a00, 0x338a, 0x0000 },

+  { 0x1a00, 0x338c, 0x0000 },

+  { 0x9a00, 0x338f, 0x2000 },

+  { 0x1a00, 0x338e, 0x0000 },

+  { 0x1a00, 0x3390, 0x0000 },

+  { 0x8700, 0xa14d, 0xa000 },

+  { 0x8700, 0xa04d, 0x9000 },

+  { 0x9a00, 0x4dcf, 0x8000 },

+  { 0x9a00, 0x33d1, 0x7000 },

+  { 0x9a00, 0x33b1, 0x6000 },

+  { 0x9a00, 0x33a1, 0x5000 },

+  { 0x9a00, 0x3399, 0x4000 },

+  { 0x9a00, 0x3395, 0x3000 },

+  { 0x9a00, 0x3393, 0x2000 },

+  { 0x1a00, 0x3392, 0x0000 },

+  { 0x1a00, 0x3394, 0x0000 },

+  { 0x9a00, 0x3397, 0x2000 },

+  { 0x1a00, 0x3396, 0x0000 },

+  { 0x1a00, 0x3398, 0x0000 },

+  { 0x9a00, 0x339d, 0x3000 },

+  { 0x9a00, 0x339b, 0x2000 },

+  { 0x1a00, 0x339a, 0x0000 },

+  { 0x1a00, 0x339c, 0x0000 },

+  { 0x9a00, 0x339f, 0x2000 },

+  { 0x1a00, 0x339e, 0x0000 },

+  { 0x1a00, 0x33a0, 0x0000 },

+  { 0x9a00, 0x33a9, 0x4000 },

+  { 0x9a00, 0x33a5, 0x3000 },

+  { 0x9a00, 0x33a3, 0x2000 },

+  { 0x1a00, 0x33a2, 0x0000 },

+  { 0x1a00, 0x33a4, 0x0000 },

+  { 0x9a00, 0x33a7, 0x2000 },

+  { 0x1a00, 0x33a6, 0x0000 },

+  { 0x1a00, 0x33a8, 0x0000 },

+  { 0x9a00, 0x33ad, 0x3000 },

+  { 0x9a00, 0x33ab, 0x2000 },

+  { 0x1a00, 0x33aa, 0x0000 },

+  { 0x1a00, 0x33ac, 0x0000 },

+  { 0x9a00, 0x33af, 0x2000 },

+  { 0x1a00, 0x33ae, 0x0000 },

+  { 0x1a00, 0x33b0, 0x0000 },

+  { 0x9a00, 0x33c1, 0x5000 },

+  { 0x9a00, 0x33b9, 0x4000 },

+  { 0x9a00, 0x33b5, 0x3000 },

+  { 0x9a00, 0x33b3, 0x2000 },

+  { 0x1a00, 0x33b2, 0x0000 },

+  { 0x1a00, 0x33b4, 0x0000 },

+  { 0x9a00, 0x33b7, 0x2000 },

+  { 0x1a00, 0x33b6, 0x0000 },

+  { 0x1a00, 0x33b8, 0x0000 },

+  { 0x9a00, 0x33bd, 0x3000 },

+  { 0x9a00, 0x33bb, 0x2000 },

+  { 0x1a00, 0x33ba, 0x0000 },

+  { 0x1a00, 0x33bc, 0x0000 },

+  { 0x9a00, 0x33bf, 0x2000 },

+  { 0x1a00, 0x33be, 0x0000 },

+  { 0x1a00, 0x33c0, 0x0000 },

+  { 0x9a00, 0x33c9, 0x4000 },

+  { 0x9a00, 0x33c5, 0x3000 },

+  { 0x9a00, 0x33c3, 0x2000 },

+  { 0x1a00, 0x33c2, 0x0000 },

+  { 0x1a00, 0x33c4, 0x0000 },

+  { 0x9a00, 0x33c7, 0x2000 },

+  { 0x1a00, 0x33c6, 0x0000 },

+  { 0x1a00, 0x33c8, 0x0000 },

+  { 0x9a00, 0x33cd, 0x3000 },

+  { 0x9a00, 0x33cb, 0x2000 },

+  { 0x1a00, 0x33ca, 0x0000 },

+  { 0x1a00, 0x33cc, 0x0000 },

+  { 0x9a00, 0x33cf, 0x2000 },

+  { 0x1a00, 0x33ce, 0x0000 },

+  { 0x1a00, 0x33d0, 0x0000 },

+  { 0x9a00, 0x33f1, 0x6000 },

+  { 0x9a00, 0x33e1, 0x5000 },

+  { 0x9a00, 0x33d9, 0x4000 },

+  { 0x9a00, 0x33d5, 0x3000 },

+  { 0x9a00, 0x33d3, 0x2000 },

+  { 0x1a00, 0x33d2, 0x0000 },

+  { 0x1a00, 0x33d4, 0x0000 },

+  { 0x9a00, 0x33d7, 0x2000 },

+  { 0x1a00, 0x33d6, 0x0000 },

+  { 0x1a00, 0x33d8, 0x0000 },

+  { 0x9a00, 0x33dd, 0x3000 },

+  { 0x9a00, 0x33db, 0x2000 },

+  { 0x1a00, 0x33da, 0x0000 },

+  { 0x1a00, 0x33dc, 0x0000 },

+  { 0x9a00, 0x33df, 0x2000 },

+  { 0x1a00, 0x33de, 0x0000 },

+  { 0x1a00, 0x33e0, 0x0000 },

+  { 0x9a00, 0x33e9, 0x4000 },

+  { 0x9a00, 0x33e5, 0x3000 },

+  { 0x9a00, 0x33e3, 0x2000 },

+  { 0x1a00, 0x33e2, 0x0000 },

+  { 0x1a00, 0x33e4, 0x0000 },

+  { 0x9a00, 0x33e7, 0x2000 },

+  { 0x1a00, 0x33e6, 0x0000 },

+  { 0x1a00, 0x33e8, 0x0000 },

+  { 0x9a00, 0x33ed, 0x3000 },

+  { 0x9a00, 0x33eb, 0x2000 },

+  { 0x1a00, 0x33ea, 0x0000 },

+  { 0x1a00, 0x33ec, 0x0000 },

+  { 0x9a00, 0x33ef, 0x2000 },

+  { 0x1a00, 0x33ee, 0x0000 },

+  { 0x1a00, 0x33f0, 0x0000 },

+  { 0x8700, 0x4db5, 0x5000 },

+  { 0x9a00, 0x33f9, 0x4000 },

+  { 0x9a00, 0x33f5, 0x3000 },

+  { 0x9a00, 0x33f3, 0x2000 },

+  { 0x1a00, 0x33f2, 0x0000 },

+  { 0x1a00, 0x33f4, 0x0000 },

+  { 0x9a00, 0x33f7, 0x2000 },

+  { 0x1a00, 0x33f6, 0x0000 },

+  { 0x1a00, 0x33f8, 0x0000 },

+  { 0x9a00, 0x33fd, 0x3000 },

+  { 0x9a00, 0x33fb, 0x2000 },

+  { 0x1a00, 0x33fa, 0x0000 },

+  { 0x1a00, 0x33fc, 0x0000 },

+  { 0x9a00, 0x33ff, 0x2000 },

+  { 0x1a00, 0x33fe, 0x0000 },

+  { 0x0700, 0x3400, 0x0000 },

+  { 0x9a00, 0x4dc7, 0x4000 },

+  { 0x9a00, 0x4dc3, 0x3000 },

+  { 0x9a00, 0x4dc1, 0x2000 },

+  { 0x1a00, 0x4dc0, 0x0000 },

+  { 0x1a00, 0x4dc2, 0x0000 },

+  { 0x9a00, 0x4dc5, 0x2000 },

+  { 0x1a00, 0x4dc4, 0x0000 },

+  { 0x1a00, 0x4dc6, 0x0000 },

+  { 0x9a00, 0x4dcb, 0x3000 },

+  { 0x9a00, 0x4dc9, 0x2000 },

+  { 0x1a00, 0x4dc8, 0x0000 },

+  { 0x1a00, 0x4dca, 0x0000 },

+  { 0x9a00, 0x4dcd, 0x2000 },

+  { 0x1a00, 0x4dcc, 0x0000 },

+  { 0x1a00, 0x4dce, 0x0000 },

+  { 0x8700, 0xa00d, 0x7000 },

+  { 0x9a00, 0x4def, 0x6000 },

+  { 0x9a00, 0x4ddf, 0x5000 },

+  { 0x9a00, 0x4dd7, 0x4000 },

+  { 0x9a00, 0x4dd3, 0x3000 },

+  { 0x9a00, 0x4dd1, 0x2000 },

+  { 0x1a00, 0x4dd0, 0x0000 },

+  { 0x1a00, 0x4dd2, 0x0000 },

+  { 0x9a00, 0x4dd5, 0x2000 },

+  { 0x1a00, 0x4dd4, 0x0000 },

+  { 0x1a00, 0x4dd6, 0x0000 },

+  { 0x9a00, 0x4ddb, 0x3000 },

+  { 0x9a00, 0x4dd9, 0x2000 },

+  { 0x1a00, 0x4dd8, 0x0000 },

+  { 0x1a00, 0x4dda, 0x0000 },

+  { 0x9a00, 0x4ddd, 0x2000 },

+  { 0x1a00, 0x4ddc, 0x0000 },

+  { 0x1a00, 0x4dde, 0x0000 },

+  { 0x9a00, 0x4de7, 0x4000 },

+  { 0x9a00, 0x4de3, 0x3000 },

+  { 0x9a00, 0x4de1, 0x2000 },

+  { 0x1a00, 0x4de0, 0x0000 },

+  { 0x1a00, 0x4de2, 0x0000 },

+  { 0x9a00, 0x4de5, 0x2000 },

+  { 0x1a00, 0x4de4, 0x0000 },

+  { 0x1a00, 0x4de6, 0x0000 },

+  { 0x9a00, 0x4deb, 0x3000 },

+  { 0x9a00, 0x4de9, 0x2000 },

+  { 0x1a00, 0x4de8, 0x0000 },

+  { 0x1a00, 0x4dea, 0x0000 },

+  { 0x9a00, 0x4ded, 0x2000 },

+  { 0x1a00, 0x4dec, 0x0000 },

+  { 0x1a00, 0x4dee, 0x0000 },

+  { 0x9a00, 0x4dff, 0x5000 },

+  { 0x9a00, 0x4df7, 0x4000 },

+  { 0x9a00, 0x4df3, 0x3000 },

+  { 0x9a00, 0x4df1, 0x2000 },

+  { 0x1a00, 0x4df0, 0x0000 },

+  { 0x1a00, 0x4df2, 0x0000 },

+  { 0x9a00, 0x4df5, 0x2000 },

+  { 0x1a00, 0x4df4, 0x0000 },

+  { 0x1a00, 0x4df6, 0x0000 },

+  { 0x9a00, 0x4dfb, 0x3000 },

+  { 0x9a00, 0x4df9, 0x2000 },

+  { 0x1a00, 0x4df8, 0x0000 },

+  { 0x1a00, 0x4dfa, 0x0000 },

+  { 0x9a00, 0x4dfd, 0x2000 },

+  { 0x1a00, 0x4dfc, 0x0000 },

+  { 0x1a00, 0x4dfe, 0x0000 },

+  { 0x8700, 0xa005, 0x4000 },

+  { 0x8700, 0xa001, 0x3000 },

+  { 0x8700, 0x9fa5, 0x2000 },

+  { 0x0700, 0x4e00, 0x0000 },

+  { 0x0700, 0xa000, 0x0000 },

+  { 0x8700, 0xa003, 0x2000 },

+  { 0x0700, 0xa002, 0x0000 },

+  { 0x0700, 0xa004, 0x0000 },

+  { 0x8700, 0xa009, 0x3000 },

+  { 0x8700, 0xa007, 0x2000 },

+  { 0x0700, 0xa006, 0x0000 },

+  { 0x0700, 0xa008, 0x0000 },

+  { 0x8700, 0xa00b, 0x2000 },

+  { 0x0700, 0xa00a, 0x0000 },

+  { 0x0700, 0xa00c, 0x0000 },

+  { 0x8700, 0xa02d, 0x6000 },

+  { 0x8700, 0xa01d, 0x5000 },

+  { 0x8700, 0xa015, 0x4000 },

+  { 0x8700, 0xa011, 0x3000 },

+  { 0x8700, 0xa00f, 0x2000 },

+  { 0x0700, 0xa00e, 0x0000 },

+  { 0x0700, 0xa010, 0x0000 },

+  { 0x8700, 0xa013, 0x2000 },

+  { 0x0700, 0xa012, 0x0000 },

+  { 0x0700, 0xa014, 0x0000 },

+  { 0x8700, 0xa019, 0x3000 },

+  { 0x8700, 0xa017, 0x2000 },

+  { 0x0700, 0xa016, 0x0000 },

+  { 0x0700, 0xa018, 0x0000 },

+  { 0x8700, 0xa01b, 0x2000 },

+  { 0x0700, 0xa01a, 0x0000 },

+  { 0x0700, 0xa01c, 0x0000 },

+  { 0x8700, 0xa025, 0x4000 },

+  { 0x8700, 0xa021, 0x3000 },

+  { 0x8700, 0xa01f, 0x2000 },

+  { 0x0700, 0xa01e, 0x0000 },

+  { 0x0700, 0xa020, 0x0000 },

+  { 0x8700, 0xa023, 0x2000 },

+  { 0x0700, 0xa022, 0x0000 },

+  { 0x0700, 0xa024, 0x0000 },

+  { 0x8700, 0xa029, 0x3000 },

+  { 0x8700, 0xa027, 0x2000 },

+  { 0x0700, 0xa026, 0x0000 },

+  { 0x0700, 0xa028, 0x0000 },

+  { 0x8700, 0xa02b, 0x2000 },

+  { 0x0700, 0xa02a, 0x0000 },

+  { 0x0700, 0xa02c, 0x0000 },

+  { 0x8700, 0xa03d, 0x5000 },

+  { 0x8700, 0xa035, 0x4000 },

+  { 0x8700, 0xa031, 0x3000 },

+  { 0x8700, 0xa02f, 0x2000 },

+  { 0x0700, 0xa02e, 0x0000 },

+  { 0x0700, 0xa030, 0x0000 },

+  { 0x8700, 0xa033, 0x2000 },

+  { 0x0700, 0xa032, 0x0000 },

+  { 0x0700, 0xa034, 0x0000 },

+  { 0x8700, 0xa039, 0x3000 },

+  { 0x8700, 0xa037, 0x2000 },

+  { 0x0700, 0xa036, 0x0000 },

+  { 0x0700, 0xa038, 0x0000 },

+  { 0x8700, 0xa03b, 0x2000 },

+  { 0x0700, 0xa03a, 0x0000 },

+  { 0x0700, 0xa03c, 0x0000 },

+  { 0x8700, 0xa045, 0x4000 },

+  { 0x8700, 0xa041, 0x3000 },

+  { 0x8700, 0xa03f, 0x2000 },

+  { 0x0700, 0xa03e, 0x0000 },

+  { 0x0700, 0xa040, 0x0000 },

+  { 0x8700, 0xa043, 0x2000 },

+  { 0x0700, 0xa042, 0x0000 },

+  { 0x0700, 0xa044, 0x0000 },

+  { 0x8700, 0xa049, 0x3000 },

+  { 0x8700, 0xa047, 0x2000 },

+  { 0x0700, 0xa046, 0x0000 },

+  { 0x0700, 0xa048, 0x0000 },

+  { 0x8700, 0xa04b, 0x2000 },

+  { 0x0700, 0xa04a, 0x0000 },

+  { 0x0700, 0xa04c, 0x0000 },

+  { 0x8700, 0xa0cd, 0x8000 },

+  { 0x8700, 0xa08d, 0x7000 },

+  { 0x8700, 0xa06d, 0x6000 },

+  { 0x8700, 0xa05d, 0x5000 },

+  { 0x8700, 0xa055, 0x4000 },

+  { 0x8700, 0xa051, 0x3000 },

+  { 0x8700, 0xa04f, 0x2000 },

+  { 0x0700, 0xa04e, 0x0000 },

+  { 0x0700, 0xa050, 0x0000 },

+  { 0x8700, 0xa053, 0x2000 },

+  { 0x0700, 0xa052, 0x0000 },

+  { 0x0700, 0xa054, 0x0000 },

+  { 0x8700, 0xa059, 0x3000 },

+  { 0x8700, 0xa057, 0x2000 },

+  { 0x0700, 0xa056, 0x0000 },

+  { 0x0700, 0xa058, 0x0000 },

+  { 0x8700, 0xa05b, 0x2000 },

+  { 0x0700, 0xa05a, 0x0000 },

+  { 0x0700, 0xa05c, 0x0000 },

+  { 0x8700, 0xa065, 0x4000 },

+  { 0x8700, 0xa061, 0x3000 },

+  { 0x8700, 0xa05f, 0x2000 },

+  { 0x0700, 0xa05e, 0x0000 },

+  { 0x0700, 0xa060, 0x0000 },

+  { 0x8700, 0xa063, 0x2000 },

+  { 0x0700, 0xa062, 0x0000 },

+  { 0x0700, 0xa064, 0x0000 },

+  { 0x8700, 0xa069, 0x3000 },

+  { 0x8700, 0xa067, 0x2000 },

+  { 0x0700, 0xa066, 0x0000 },

+  { 0x0700, 0xa068, 0x0000 },

+  { 0x8700, 0xa06b, 0x2000 },

+  { 0x0700, 0xa06a, 0x0000 },

+  { 0x0700, 0xa06c, 0x0000 },

+  { 0x8700, 0xa07d, 0x5000 },

+  { 0x8700, 0xa075, 0x4000 },

+  { 0x8700, 0xa071, 0x3000 },

+  { 0x8700, 0xa06f, 0x2000 },

+  { 0x0700, 0xa06e, 0x0000 },

+  { 0x0700, 0xa070, 0x0000 },

+  { 0x8700, 0xa073, 0x2000 },

+  { 0x0700, 0xa072, 0x0000 },

+  { 0x0700, 0xa074, 0x0000 },

+  { 0x8700, 0xa079, 0x3000 },

+  { 0x8700, 0xa077, 0x2000 },

+  { 0x0700, 0xa076, 0x0000 },

+  { 0x0700, 0xa078, 0x0000 },

+  { 0x8700, 0xa07b, 0x2000 },

+  { 0x0700, 0xa07a, 0x0000 },

+  { 0x0700, 0xa07c, 0x0000 },

+  { 0x8700, 0xa085, 0x4000 },

+  { 0x8700, 0xa081, 0x3000 },

+  { 0x8700, 0xa07f, 0x2000 },

+  { 0x0700, 0xa07e, 0x0000 },

+  { 0x0700, 0xa080, 0x0000 },

+  { 0x8700, 0xa083, 0x2000 },

+  { 0x0700, 0xa082, 0x0000 },

+  { 0x0700, 0xa084, 0x0000 },

+  { 0x8700, 0xa089, 0x3000 },

+  { 0x8700, 0xa087, 0x2000 },

+  { 0x0700, 0xa086, 0x0000 },

+  { 0x0700, 0xa088, 0x0000 },

+  { 0x8700, 0xa08b, 0x2000 },

+  { 0x0700, 0xa08a, 0x0000 },

+  { 0x0700, 0xa08c, 0x0000 },

+  { 0x8700, 0xa0ad, 0x6000 },

+  { 0x8700, 0xa09d, 0x5000 },

+  { 0x8700, 0xa095, 0x4000 },

+  { 0x8700, 0xa091, 0x3000 },

+  { 0x8700, 0xa08f, 0x2000 },

+  { 0x0700, 0xa08e, 0x0000 },

+  { 0x0700, 0xa090, 0x0000 },

+  { 0x8700, 0xa093, 0x2000 },

+  { 0x0700, 0xa092, 0x0000 },

+  { 0x0700, 0xa094, 0x0000 },

+  { 0x8700, 0xa099, 0x3000 },

+  { 0x8700, 0xa097, 0x2000 },

+  { 0x0700, 0xa096, 0x0000 },

+  { 0x0700, 0xa098, 0x0000 },

+  { 0x8700, 0xa09b, 0x2000 },

+  { 0x0700, 0xa09a, 0x0000 },

+  { 0x0700, 0xa09c, 0x0000 },

+  { 0x8700, 0xa0a5, 0x4000 },

+  { 0x8700, 0xa0a1, 0x3000 },

+  { 0x8700, 0xa09f, 0x2000 },

+  { 0x0700, 0xa09e, 0x0000 },

+  { 0x0700, 0xa0a0, 0x0000 },

+  { 0x8700, 0xa0a3, 0x2000 },

+  { 0x0700, 0xa0a2, 0x0000 },

+  { 0x0700, 0xa0a4, 0x0000 },

+  { 0x8700, 0xa0a9, 0x3000 },

+  { 0x8700, 0xa0a7, 0x2000 },

+  { 0x0700, 0xa0a6, 0x0000 },

+  { 0x0700, 0xa0a8, 0x0000 },

+  { 0x8700, 0xa0ab, 0x2000 },

+  { 0x0700, 0xa0aa, 0x0000 },

+  { 0x0700, 0xa0ac, 0x0000 },

+  { 0x8700, 0xa0bd, 0x5000 },

+  { 0x8700, 0xa0b5, 0x4000 },

+  { 0x8700, 0xa0b1, 0x3000 },

+  { 0x8700, 0xa0af, 0x2000 },

+  { 0x0700, 0xa0ae, 0x0000 },

+  { 0x0700, 0xa0b0, 0x0000 },

+  { 0x8700, 0xa0b3, 0x2000 },

+  { 0x0700, 0xa0b2, 0x0000 },

+  { 0x0700, 0xa0b4, 0x0000 },

+  { 0x8700, 0xa0b9, 0x3000 },

+  { 0x8700, 0xa0b7, 0x2000 },

+  { 0x0700, 0xa0b6, 0x0000 },

+  { 0x0700, 0xa0b8, 0x0000 },

+  { 0x8700, 0xa0bb, 0x2000 },

+  { 0x0700, 0xa0ba, 0x0000 },

+  { 0x0700, 0xa0bc, 0x0000 },

+  { 0x8700, 0xa0c5, 0x4000 },

+  { 0x8700, 0xa0c1, 0x3000 },

+  { 0x8700, 0xa0bf, 0x2000 },

+  { 0x0700, 0xa0be, 0x0000 },

+  { 0x0700, 0xa0c0, 0x0000 },

+  { 0x8700, 0xa0c3, 0x2000 },

+  { 0x0700, 0xa0c2, 0x0000 },

+  { 0x0700, 0xa0c4, 0x0000 },

+  { 0x8700, 0xa0c9, 0x3000 },

+  { 0x8700, 0xa0c7, 0x2000 },

+  { 0x0700, 0xa0c6, 0x0000 },

+  { 0x0700, 0xa0c8, 0x0000 },

+  { 0x8700, 0xa0cb, 0x2000 },

+  { 0x0700, 0xa0ca, 0x0000 },

+  { 0x0700, 0xa0cc, 0x0000 },

+  { 0x8700, 0xa10d, 0x7000 },

+  { 0x8700, 0xa0ed, 0x6000 },

+  { 0x8700, 0xa0dd, 0x5000 },

+  { 0x8700, 0xa0d5, 0x4000 },

+  { 0x8700, 0xa0d1, 0x3000 },

+  { 0x8700, 0xa0cf, 0x2000 },

+  { 0x0700, 0xa0ce, 0x0000 },

+  { 0x0700, 0xa0d0, 0x0000 },

+  { 0x8700, 0xa0d3, 0x2000 },

+  { 0x0700, 0xa0d2, 0x0000 },

+  { 0x0700, 0xa0d4, 0x0000 },

+  { 0x8700, 0xa0d9, 0x3000 },

+  { 0x8700, 0xa0d7, 0x2000 },

+  { 0x0700, 0xa0d6, 0x0000 },

+  { 0x0700, 0xa0d8, 0x0000 },

+  { 0x8700, 0xa0db, 0x2000 },

+  { 0x0700, 0xa0da, 0x0000 },

+  { 0x0700, 0xa0dc, 0x0000 },

+  { 0x8700, 0xa0e5, 0x4000 },

+  { 0x8700, 0xa0e1, 0x3000 },

+  { 0x8700, 0xa0df, 0x2000 },

+  { 0x0700, 0xa0de, 0x0000 },

+  { 0x0700, 0xa0e0, 0x0000 },

+  { 0x8700, 0xa0e3, 0x2000 },

+  { 0x0700, 0xa0e2, 0x0000 },

+  { 0x0700, 0xa0e4, 0x0000 },

+  { 0x8700, 0xa0e9, 0x3000 },

+  { 0x8700, 0xa0e7, 0x2000 },

+  { 0x0700, 0xa0e6, 0x0000 },

+  { 0x0700, 0xa0e8, 0x0000 },

+  { 0x8700, 0xa0eb, 0x2000 },

+  { 0x0700, 0xa0ea, 0x0000 },

+  { 0x0700, 0xa0ec, 0x0000 },

+  { 0x8700, 0xa0fd, 0x5000 },

+  { 0x8700, 0xa0f5, 0x4000 },

+  { 0x8700, 0xa0f1, 0x3000 },

+  { 0x8700, 0xa0ef, 0x2000 },

+  { 0x0700, 0xa0ee, 0x0000 },

+  { 0x0700, 0xa0f0, 0x0000 },

+  { 0x8700, 0xa0f3, 0x2000 },

+  { 0x0700, 0xa0f2, 0x0000 },

+  { 0x0700, 0xa0f4, 0x0000 },

+  { 0x8700, 0xa0f9, 0x3000 },

+  { 0x8700, 0xa0f7, 0x2000 },

+  { 0x0700, 0xa0f6, 0x0000 },

+  { 0x0700, 0xa0f8, 0x0000 },

+  { 0x8700, 0xa0fb, 0x2000 },

+  { 0x0700, 0xa0fa, 0x0000 },

+  { 0x0700, 0xa0fc, 0x0000 },

+  { 0x8700, 0xa105, 0x4000 },

+  { 0x8700, 0xa101, 0x3000 },

+  { 0x8700, 0xa0ff, 0x2000 },

+  { 0x0700, 0xa0fe, 0x0000 },

+  { 0x0700, 0xa100, 0x0000 },

+  { 0x8700, 0xa103, 0x2000 },

+  { 0x0700, 0xa102, 0x0000 },

+  { 0x0700, 0xa104, 0x0000 },

+  { 0x8700, 0xa109, 0x3000 },

+  { 0x8700, 0xa107, 0x2000 },

+  { 0x0700, 0xa106, 0x0000 },

+  { 0x0700, 0xa108, 0x0000 },

+  { 0x8700, 0xa10b, 0x2000 },

+  { 0x0700, 0xa10a, 0x0000 },

+  { 0x0700, 0xa10c, 0x0000 },

+  { 0x8700, 0xa12d, 0x6000 },

+  { 0x8700, 0xa11d, 0x5000 },

+  { 0x8700, 0xa115, 0x4000 },

+  { 0x8700, 0xa111, 0x3000 },

+  { 0x8700, 0xa10f, 0x2000 },

+  { 0x0700, 0xa10e, 0x0000 },

+  { 0x0700, 0xa110, 0x0000 },

+  { 0x8700, 0xa113, 0x2000 },

+  { 0x0700, 0xa112, 0x0000 },

+  { 0x0700, 0xa114, 0x0000 },

+  { 0x8700, 0xa119, 0x3000 },

+  { 0x8700, 0xa117, 0x2000 },

+  { 0x0700, 0xa116, 0x0000 },

+  { 0x0700, 0xa118, 0x0000 },

+  { 0x8700, 0xa11b, 0x2000 },

+  { 0x0700, 0xa11a, 0x0000 },

+  { 0x0700, 0xa11c, 0x0000 },

+  { 0x8700, 0xa125, 0x4000 },

+  { 0x8700, 0xa121, 0x3000 },

+  { 0x8700, 0xa11f, 0x2000 },

+  { 0x0700, 0xa11e, 0x0000 },

+  { 0x0700, 0xa120, 0x0000 },

+  { 0x8700, 0xa123, 0x2000 },

+  { 0x0700, 0xa122, 0x0000 },

+  { 0x0700, 0xa124, 0x0000 },

+  { 0x8700, 0xa129, 0x3000 },

+  { 0x8700, 0xa127, 0x2000 },

+  { 0x0700, 0xa126, 0x0000 },

+  { 0x0700, 0xa128, 0x0000 },

+  { 0x8700, 0xa12b, 0x2000 },

+  { 0x0700, 0xa12a, 0x0000 },

+  { 0x0700, 0xa12c, 0x0000 },

+  { 0x8700, 0xa13d, 0x5000 },

+  { 0x8700, 0xa135, 0x4000 },

+  { 0x8700, 0xa131, 0x3000 },

+  { 0x8700, 0xa12f, 0x2000 },

+  { 0x0700, 0xa12e, 0x0000 },

+  { 0x0700, 0xa130, 0x0000 },

+  { 0x8700, 0xa133, 0x2000 },

+  { 0x0700, 0xa132, 0x0000 },

+  { 0x0700, 0xa134, 0x0000 },

+  { 0x8700, 0xa139, 0x3000 },

+  { 0x8700, 0xa137, 0x2000 },

+  { 0x0700, 0xa136, 0x0000 },

+  { 0x0700, 0xa138, 0x0000 },

+  { 0x8700, 0xa13b, 0x2000 },

+  { 0x0700, 0xa13a, 0x0000 },

+  { 0x0700, 0xa13c, 0x0000 },

+  { 0x8700, 0xa145, 0x4000 },

+  { 0x8700, 0xa141, 0x3000 },

+  { 0x8700, 0xa13f, 0x2000 },

+  { 0x0700, 0xa13e, 0x0000 },

+  { 0x0700, 0xa140, 0x0000 },

+  { 0x8700, 0xa143, 0x2000 },

+  { 0x0700, 0xa142, 0x0000 },

+  { 0x0700, 0xa144, 0x0000 },

+  { 0x8700, 0xa149, 0x3000 },

+  { 0x8700, 0xa147, 0x2000 },

+  { 0x0700, 0xa146, 0x0000 },

+  { 0x0700, 0xa148, 0x0000 },

+  { 0x8700, 0xa14b, 0x2000 },

+  { 0x0700, 0xa14a, 0x0000 },

+  { 0x0700, 0xa14c, 0x0000 },

+  { 0x8700, 0xa24d, 0x9000 },

+  { 0x8700, 0xa1cd, 0x8000 },

+  { 0x8700, 0xa18d, 0x7000 },

+  { 0x8700, 0xa16d, 0x6000 },

+  { 0x8700, 0xa15d, 0x5000 },

+  { 0x8700, 0xa155, 0x4000 },

+  { 0x8700, 0xa151, 0x3000 },

+  { 0x8700, 0xa14f, 0x2000 },

+  { 0x0700, 0xa14e, 0x0000 },

+  { 0x0700, 0xa150, 0x0000 },

+  { 0x8700, 0xa153, 0x2000 },

+  { 0x0700, 0xa152, 0x0000 },

+  { 0x0700, 0xa154, 0x0000 },

+  { 0x8700, 0xa159, 0x3000 },

+  { 0x8700, 0xa157, 0x2000 },

+  { 0x0700, 0xa156, 0x0000 },

+  { 0x0700, 0xa158, 0x0000 },

+  { 0x8700, 0xa15b, 0x2000 },

+  { 0x0700, 0xa15a, 0x0000 },

+  { 0x0700, 0xa15c, 0x0000 },

+  { 0x8700, 0xa165, 0x4000 },

+  { 0x8700, 0xa161, 0x3000 },

+  { 0x8700, 0xa15f, 0x2000 },

+  { 0x0700, 0xa15e, 0x0000 },

+  { 0x0700, 0xa160, 0x0000 },

+  { 0x8700, 0xa163, 0x2000 },

+  { 0x0700, 0xa162, 0x0000 },

+  { 0x0700, 0xa164, 0x0000 },

+  { 0x8700, 0xa169, 0x3000 },

+  { 0x8700, 0xa167, 0x2000 },

+  { 0x0700, 0xa166, 0x0000 },

+  { 0x0700, 0xa168, 0x0000 },

+  { 0x8700, 0xa16b, 0x2000 },

+  { 0x0700, 0xa16a, 0x0000 },

+  { 0x0700, 0xa16c, 0x0000 },

+  { 0x8700, 0xa17d, 0x5000 },

+  { 0x8700, 0xa175, 0x4000 },

+  { 0x8700, 0xa171, 0x3000 },

+  { 0x8700, 0xa16f, 0x2000 },

+  { 0x0700, 0xa16e, 0x0000 },

+  { 0x0700, 0xa170, 0x0000 },

+  { 0x8700, 0xa173, 0x2000 },

+  { 0x0700, 0xa172, 0x0000 },

+  { 0x0700, 0xa174, 0x0000 },

+  { 0x8700, 0xa179, 0x3000 },

+  { 0x8700, 0xa177, 0x2000 },

+  { 0x0700, 0xa176, 0x0000 },

+  { 0x0700, 0xa178, 0x0000 },

+  { 0x8700, 0xa17b, 0x2000 },

+  { 0x0700, 0xa17a, 0x0000 },

+  { 0x0700, 0xa17c, 0x0000 },

+  { 0x8700, 0xa185, 0x4000 },

+  { 0x8700, 0xa181, 0x3000 },

+  { 0x8700, 0xa17f, 0x2000 },

+  { 0x0700, 0xa17e, 0x0000 },

+  { 0x0700, 0xa180, 0x0000 },

+  { 0x8700, 0xa183, 0x2000 },

+  { 0x0700, 0xa182, 0x0000 },

+  { 0x0700, 0xa184, 0x0000 },

+  { 0x8700, 0xa189, 0x3000 },

+  { 0x8700, 0xa187, 0x2000 },

+  { 0x0700, 0xa186, 0x0000 },

+  { 0x0700, 0xa188, 0x0000 },

+  { 0x8700, 0xa18b, 0x2000 },

+  { 0x0700, 0xa18a, 0x0000 },

+  { 0x0700, 0xa18c, 0x0000 },

+  { 0x8700, 0xa1ad, 0x6000 },

+  { 0x8700, 0xa19d, 0x5000 },

+  { 0x8700, 0xa195, 0x4000 },

+  { 0x8700, 0xa191, 0x3000 },

+  { 0x8700, 0xa18f, 0x2000 },

+  { 0x0700, 0xa18e, 0x0000 },

+  { 0x0700, 0xa190, 0x0000 },

+  { 0x8700, 0xa193, 0x2000 },

+  { 0x0700, 0xa192, 0x0000 },

+  { 0x0700, 0xa194, 0x0000 },

+  { 0x8700, 0xa199, 0x3000 },

+  { 0x8700, 0xa197, 0x2000 },

+  { 0x0700, 0xa196, 0x0000 },

+  { 0x0700, 0xa198, 0x0000 },

+  { 0x8700, 0xa19b, 0x2000 },

+  { 0x0700, 0xa19a, 0x0000 },

+  { 0x0700, 0xa19c, 0x0000 },

+  { 0x8700, 0xa1a5, 0x4000 },

+  { 0x8700, 0xa1a1, 0x3000 },

+  { 0x8700, 0xa19f, 0x2000 },

+  { 0x0700, 0xa19e, 0x0000 },

+  { 0x0700, 0xa1a0, 0x0000 },

+  { 0x8700, 0xa1a3, 0x2000 },

+  { 0x0700, 0xa1a2, 0x0000 },

+  { 0x0700, 0xa1a4, 0x0000 },

+  { 0x8700, 0xa1a9, 0x3000 },

+  { 0x8700, 0xa1a7, 0x2000 },

+  { 0x0700, 0xa1a6, 0x0000 },

+  { 0x0700, 0xa1a8, 0x0000 },

+  { 0x8700, 0xa1ab, 0x2000 },

+  { 0x0700, 0xa1aa, 0x0000 },

+  { 0x0700, 0xa1ac, 0x0000 },

+  { 0x8700, 0xa1bd, 0x5000 },

+  { 0x8700, 0xa1b5, 0x4000 },

+  { 0x8700, 0xa1b1, 0x3000 },

+  { 0x8700, 0xa1af, 0x2000 },

+  { 0x0700, 0xa1ae, 0x0000 },

+  { 0x0700, 0xa1b0, 0x0000 },

+  { 0x8700, 0xa1b3, 0x2000 },

+  { 0x0700, 0xa1b2, 0x0000 },

+  { 0x0700, 0xa1b4, 0x0000 },

+  { 0x8700, 0xa1b9, 0x3000 },

+  { 0x8700, 0xa1b7, 0x2000 },

+  { 0x0700, 0xa1b6, 0x0000 },

+  { 0x0700, 0xa1b8, 0x0000 },

+  { 0x8700, 0xa1bb, 0x2000 },

+  { 0x0700, 0xa1ba, 0x0000 },

+  { 0x0700, 0xa1bc, 0x0000 },

+  { 0x8700, 0xa1c5, 0x4000 },

+  { 0x8700, 0xa1c1, 0x3000 },

+  { 0x8700, 0xa1bf, 0x2000 },

+  { 0x0700, 0xa1be, 0x0000 },

+  { 0x0700, 0xa1c0, 0x0000 },

+  { 0x8700, 0xa1c3, 0x2000 },

+  { 0x0700, 0xa1c2, 0x0000 },

+  { 0x0700, 0xa1c4, 0x0000 },

+  { 0x8700, 0xa1c9, 0x3000 },

+  { 0x8700, 0xa1c7, 0x2000 },

+  { 0x0700, 0xa1c6, 0x0000 },

+  { 0x0700, 0xa1c8, 0x0000 },

+  { 0x8700, 0xa1cb, 0x2000 },

+  { 0x0700, 0xa1ca, 0x0000 },

+  { 0x0700, 0xa1cc, 0x0000 },

+  { 0x8700, 0xa20d, 0x7000 },

+  { 0x8700, 0xa1ed, 0x6000 },

+  { 0x8700, 0xa1dd, 0x5000 },

+  { 0x8700, 0xa1d5, 0x4000 },

+  { 0x8700, 0xa1d1, 0x3000 },

+  { 0x8700, 0xa1cf, 0x2000 },

+  { 0x0700, 0xa1ce, 0x0000 },

+  { 0x0700, 0xa1d0, 0x0000 },

+  { 0x8700, 0xa1d3, 0x2000 },

+  { 0x0700, 0xa1d2, 0x0000 },

+  { 0x0700, 0xa1d4, 0x0000 },

+  { 0x8700, 0xa1d9, 0x3000 },

+  { 0x8700, 0xa1d7, 0x2000 },

+  { 0x0700, 0xa1d6, 0x0000 },

+  { 0x0700, 0xa1d8, 0x0000 },

+  { 0x8700, 0xa1db, 0x2000 },

+  { 0x0700, 0xa1da, 0x0000 },

+  { 0x0700, 0xa1dc, 0x0000 },

+  { 0x8700, 0xa1e5, 0x4000 },

+  { 0x8700, 0xa1e1, 0x3000 },

+  { 0x8700, 0xa1df, 0x2000 },

+  { 0x0700, 0xa1de, 0x0000 },

+  { 0x0700, 0xa1e0, 0x0000 },

+  { 0x8700, 0xa1e3, 0x2000 },

+  { 0x0700, 0xa1e2, 0x0000 },

+  { 0x0700, 0xa1e4, 0x0000 },

+  { 0x8700, 0xa1e9, 0x3000 },

+  { 0x8700, 0xa1e7, 0x2000 },

+  { 0x0700, 0xa1e6, 0x0000 },

+  { 0x0700, 0xa1e8, 0x0000 },

+  { 0x8700, 0xa1eb, 0x2000 },

+  { 0x0700, 0xa1ea, 0x0000 },

+  { 0x0700, 0xa1ec, 0x0000 },

+  { 0x8700, 0xa1fd, 0x5000 },

+  { 0x8700, 0xa1f5, 0x4000 },

+  { 0x8700, 0xa1f1, 0x3000 },

+  { 0x8700, 0xa1ef, 0x2000 },

+  { 0x0700, 0xa1ee, 0x0000 },

+  { 0x0700, 0xa1f0, 0x0000 },

+  { 0x8700, 0xa1f3, 0x2000 },

+  { 0x0700, 0xa1f2, 0x0000 },

+  { 0x0700, 0xa1f4, 0x0000 },

+  { 0x8700, 0xa1f9, 0x3000 },

+  { 0x8700, 0xa1f7, 0x2000 },

+  { 0x0700, 0xa1f6, 0x0000 },

+  { 0x0700, 0xa1f8, 0x0000 },

+  { 0x8700, 0xa1fb, 0x2000 },

+  { 0x0700, 0xa1fa, 0x0000 },

+  { 0x0700, 0xa1fc, 0x0000 },

+  { 0x8700, 0xa205, 0x4000 },

+  { 0x8700, 0xa201, 0x3000 },

+  { 0x8700, 0xa1ff, 0x2000 },

+  { 0x0700, 0xa1fe, 0x0000 },

+  { 0x0700, 0xa200, 0x0000 },

+  { 0x8700, 0xa203, 0x2000 },

+  { 0x0700, 0xa202, 0x0000 },

+  { 0x0700, 0xa204, 0x0000 },

+  { 0x8700, 0xa209, 0x3000 },

+  { 0x8700, 0xa207, 0x2000 },

+  { 0x0700, 0xa206, 0x0000 },

+  { 0x0700, 0xa208, 0x0000 },

+  { 0x8700, 0xa20b, 0x2000 },

+  { 0x0700, 0xa20a, 0x0000 },

+  { 0x0700, 0xa20c, 0x0000 },

+  { 0x8700, 0xa22d, 0x6000 },

+  { 0x8700, 0xa21d, 0x5000 },

+  { 0x8700, 0xa215, 0x4000 },

+  { 0x8700, 0xa211, 0x3000 },

+  { 0x8700, 0xa20f, 0x2000 },

+  { 0x0700, 0xa20e, 0x0000 },

+  { 0x0700, 0xa210, 0x0000 },

+  { 0x8700, 0xa213, 0x2000 },

+  { 0x0700, 0xa212, 0x0000 },

+  { 0x0700, 0xa214, 0x0000 },

+  { 0x8700, 0xa219, 0x3000 },

+  { 0x8700, 0xa217, 0x2000 },

+  { 0x0700, 0xa216, 0x0000 },

+  { 0x0700, 0xa218, 0x0000 },

+  { 0x8700, 0xa21b, 0x2000 },

+  { 0x0700, 0xa21a, 0x0000 },

+  { 0x0700, 0xa21c, 0x0000 },

+  { 0x8700, 0xa225, 0x4000 },

+  { 0x8700, 0xa221, 0x3000 },

+  { 0x8700, 0xa21f, 0x2000 },

+  { 0x0700, 0xa21e, 0x0000 },

+  { 0x0700, 0xa220, 0x0000 },

+  { 0x8700, 0xa223, 0x2000 },

+  { 0x0700, 0xa222, 0x0000 },

+  { 0x0700, 0xa224, 0x0000 },

+  { 0x8700, 0xa229, 0x3000 },

+  { 0x8700, 0xa227, 0x2000 },

+  { 0x0700, 0xa226, 0x0000 },

+  { 0x0700, 0xa228, 0x0000 },

+  { 0x8700, 0xa22b, 0x2000 },

+  { 0x0700, 0xa22a, 0x0000 },

+  { 0x0700, 0xa22c, 0x0000 },

+  { 0x8700, 0xa23d, 0x5000 },

+  { 0x8700, 0xa235, 0x4000 },

+  { 0x8700, 0xa231, 0x3000 },

+  { 0x8700, 0xa22f, 0x2000 },

+  { 0x0700, 0xa22e, 0x0000 },

+  { 0x0700, 0xa230, 0x0000 },

+  { 0x8700, 0xa233, 0x2000 },

+  { 0x0700, 0xa232, 0x0000 },

+  { 0x0700, 0xa234, 0x0000 },

+  { 0x8700, 0xa239, 0x3000 },

+  { 0x8700, 0xa237, 0x2000 },

+  { 0x0700, 0xa236, 0x0000 },

+  { 0x0700, 0xa238, 0x0000 },

+  { 0x8700, 0xa23b, 0x2000 },

+  { 0x0700, 0xa23a, 0x0000 },

+  { 0x0700, 0xa23c, 0x0000 },

+  { 0x8700, 0xa245, 0x4000 },

+  { 0x8700, 0xa241, 0x3000 },

+  { 0x8700, 0xa23f, 0x2000 },

+  { 0x0700, 0xa23e, 0x0000 },

+  { 0x0700, 0xa240, 0x0000 },

+  { 0x8700, 0xa243, 0x2000 },

+  { 0x0700, 0xa242, 0x0000 },

+  { 0x0700, 0xa244, 0x0000 },

+  { 0x8700, 0xa249, 0x3000 },

+  { 0x8700, 0xa247, 0x2000 },

+  { 0x0700, 0xa246, 0x0000 },

+  { 0x0700, 0xa248, 0x0000 },

+  { 0x8700, 0xa24b, 0x2000 },

+  { 0x0700, 0xa24a, 0x0000 },

+  { 0x0700, 0xa24c, 0x0000 },

+  { 0x8700, 0xa2cd, 0x8000 },

+  { 0x8700, 0xa28d, 0x7000 },

+  { 0x8700, 0xa26d, 0x6000 },

+  { 0x8700, 0xa25d, 0x5000 },

+  { 0x8700, 0xa255, 0x4000 },

+  { 0x8700, 0xa251, 0x3000 },

+  { 0x8700, 0xa24f, 0x2000 },

+  { 0x0700, 0xa24e, 0x0000 },

+  { 0x0700, 0xa250, 0x0000 },

+  { 0x8700, 0xa253, 0x2000 },

+  { 0x0700, 0xa252, 0x0000 },

+  { 0x0700, 0xa254, 0x0000 },

+  { 0x8700, 0xa259, 0x3000 },

+  { 0x8700, 0xa257, 0x2000 },

+  { 0x0700, 0xa256, 0x0000 },

+  { 0x0700, 0xa258, 0x0000 },

+  { 0x8700, 0xa25b, 0x2000 },

+  { 0x0700, 0xa25a, 0x0000 },

+  { 0x0700, 0xa25c, 0x0000 },

+  { 0x8700, 0xa265, 0x4000 },

+  { 0x8700, 0xa261, 0x3000 },

+  { 0x8700, 0xa25f, 0x2000 },

+  { 0x0700, 0xa25e, 0x0000 },

+  { 0x0700, 0xa260, 0x0000 },

+  { 0x8700, 0xa263, 0x2000 },

+  { 0x0700, 0xa262, 0x0000 },

+  { 0x0700, 0xa264, 0x0000 },

+  { 0x8700, 0xa269, 0x3000 },

+  { 0x8700, 0xa267, 0x2000 },

+  { 0x0700, 0xa266, 0x0000 },

+  { 0x0700, 0xa268, 0x0000 },

+  { 0x8700, 0xa26b, 0x2000 },

+  { 0x0700, 0xa26a, 0x0000 },

+  { 0x0700, 0xa26c, 0x0000 },

+  { 0x8700, 0xa27d, 0x5000 },

+  { 0x8700, 0xa275, 0x4000 },

+  { 0x8700, 0xa271, 0x3000 },

+  { 0x8700, 0xa26f, 0x2000 },

+  { 0x0700, 0xa26e, 0x0000 },

+  { 0x0700, 0xa270, 0x0000 },

+  { 0x8700, 0xa273, 0x2000 },

+  { 0x0700, 0xa272, 0x0000 },

+  { 0x0700, 0xa274, 0x0000 },

+  { 0x8700, 0xa279, 0x3000 },

+  { 0x8700, 0xa277, 0x2000 },

+  { 0x0700, 0xa276, 0x0000 },

+  { 0x0700, 0xa278, 0x0000 },

+  { 0x8700, 0xa27b, 0x2000 },

+  { 0x0700, 0xa27a, 0x0000 },

+  { 0x0700, 0xa27c, 0x0000 },

+  { 0x8700, 0xa285, 0x4000 },

+  { 0x8700, 0xa281, 0x3000 },

+  { 0x8700, 0xa27f, 0x2000 },

+  { 0x0700, 0xa27e, 0x0000 },

+  { 0x0700, 0xa280, 0x0000 },

+  { 0x8700, 0xa283, 0x2000 },

+  { 0x0700, 0xa282, 0x0000 },

+  { 0x0700, 0xa284, 0x0000 },

+  { 0x8700, 0xa289, 0x3000 },

+  { 0x8700, 0xa287, 0x2000 },

+  { 0x0700, 0xa286, 0x0000 },

+  { 0x0700, 0xa288, 0x0000 },

+  { 0x8700, 0xa28b, 0x2000 },

+  { 0x0700, 0xa28a, 0x0000 },

+  { 0x0700, 0xa28c, 0x0000 },

+  { 0x8700, 0xa2ad, 0x6000 },

+  { 0x8700, 0xa29d, 0x5000 },

+  { 0x8700, 0xa295, 0x4000 },

+  { 0x8700, 0xa291, 0x3000 },

+  { 0x8700, 0xa28f, 0x2000 },

+  { 0x0700, 0xa28e, 0x0000 },

+  { 0x0700, 0xa290, 0x0000 },

+  { 0x8700, 0xa293, 0x2000 },

+  { 0x0700, 0xa292, 0x0000 },

+  { 0x0700, 0xa294, 0x0000 },

+  { 0x8700, 0xa299, 0x3000 },

+  { 0x8700, 0xa297, 0x2000 },

+  { 0x0700, 0xa296, 0x0000 },

+  { 0x0700, 0xa298, 0x0000 },

+  { 0x8700, 0xa29b, 0x2000 },

+  { 0x0700, 0xa29a, 0x0000 },

+  { 0x0700, 0xa29c, 0x0000 },

+  { 0x8700, 0xa2a5, 0x4000 },

+  { 0x8700, 0xa2a1, 0x3000 },

+  { 0x8700, 0xa29f, 0x2000 },

+  { 0x0700, 0xa29e, 0x0000 },

+  { 0x0700, 0xa2a0, 0x0000 },

+  { 0x8700, 0xa2a3, 0x2000 },

+  { 0x0700, 0xa2a2, 0x0000 },

+  { 0x0700, 0xa2a4, 0x0000 },

+  { 0x8700, 0xa2a9, 0x3000 },

+  { 0x8700, 0xa2a7, 0x2000 },

+  { 0x0700, 0xa2a6, 0x0000 },

+  { 0x0700, 0xa2a8, 0x0000 },

+  { 0x8700, 0xa2ab, 0x2000 },

+  { 0x0700, 0xa2aa, 0x0000 },

+  { 0x0700, 0xa2ac, 0x0000 },

+  { 0x8700, 0xa2bd, 0x5000 },

+  { 0x8700, 0xa2b5, 0x4000 },

+  { 0x8700, 0xa2b1, 0x3000 },

+  { 0x8700, 0xa2af, 0x2000 },

+  { 0x0700, 0xa2ae, 0x0000 },

+  { 0x0700, 0xa2b0, 0x0000 },

+  { 0x8700, 0xa2b3, 0x2000 },

+  { 0x0700, 0xa2b2, 0x0000 },

+  { 0x0700, 0xa2b4, 0x0000 },

+  { 0x8700, 0xa2b9, 0x3000 },

+  { 0x8700, 0xa2b7, 0x2000 },

+  { 0x0700, 0xa2b6, 0x0000 },

+  { 0x0700, 0xa2b8, 0x0000 },

+  { 0x8700, 0xa2bb, 0x2000 },

+  { 0x0700, 0xa2ba, 0x0000 },

+  { 0x0700, 0xa2bc, 0x0000 },

+  { 0x8700, 0xa2c5, 0x4000 },

+  { 0x8700, 0xa2c1, 0x3000 },

+  { 0x8700, 0xa2bf, 0x2000 },

+  { 0x0700, 0xa2be, 0x0000 },

+  { 0x0700, 0xa2c0, 0x0000 },

+  { 0x8700, 0xa2c3, 0x2000 },

+  { 0x0700, 0xa2c2, 0x0000 },

+  { 0x0700, 0xa2c4, 0x0000 },

+  { 0x8700, 0xa2c9, 0x3000 },

+  { 0x8700, 0xa2c7, 0x2000 },

+  { 0x0700, 0xa2c6, 0x0000 },

+  { 0x0700, 0xa2c8, 0x0000 },

+  { 0x8700, 0xa2cb, 0x2000 },

+  { 0x0700, 0xa2ca, 0x0000 },

+  { 0x0700, 0xa2cc, 0x0000 },

+  { 0x8700, 0xa30d, 0x7000 },

+  { 0x8700, 0xa2ed, 0x6000 },

+  { 0x8700, 0xa2dd, 0x5000 },

+  { 0x8700, 0xa2d5, 0x4000 },

+  { 0x8700, 0xa2d1, 0x3000 },

+  { 0x8700, 0xa2cf, 0x2000 },

+  { 0x0700, 0xa2ce, 0x0000 },

+  { 0x0700, 0xa2d0, 0x0000 },

+  { 0x8700, 0xa2d3, 0x2000 },

+  { 0x0700, 0xa2d2, 0x0000 },

+  { 0x0700, 0xa2d4, 0x0000 },

+  { 0x8700, 0xa2d9, 0x3000 },

+  { 0x8700, 0xa2d7, 0x2000 },

+  { 0x0700, 0xa2d6, 0x0000 },

+  { 0x0700, 0xa2d8, 0x0000 },

+  { 0x8700, 0xa2db, 0x2000 },

+  { 0x0700, 0xa2da, 0x0000 },

+  { 0x0700, 0xa2dc, 0x0000 },

+  { 0x8700, 0xa2e5, 0x4000 },

+  { 0x8700, 0xa2e1, 0x3000 },

+  { 0x8700, 0xa2df, 0x2000 },

+  { 0x0700, 0xa2de, 0x0000 },

+  { 0x0700, 0xa2e0, 0x0000 },

+  { 0x8700, 0xa2e3, 0x2000 },

+  { 0x0700, 0xa2e2, 0x0000 },

+  { 0x0700, 0xa2e4, 0x0000 },

+  { 0x8700, 0xa2e9, 0x3000 },

+  { 0x8700, 0xa2e7, 0x2000 },

+  { 0x0700, 0xa2e6, 0x0000 },

+  { 0x0700, 0xa2e8, 0x0000 },

+  { 0x8700, 0xa2eb, 0x2000 },

+  { 0x0700, 0xa2ea, 0x0000 },

+  { 0x0700, 0xa2ec, 0x0000 },

+  { 0x8700, 0xa2fd, 0x5000 },

+  { 0x8700, 0xa2f5, 0x4000 },

+  { 0x8700, 0xa2f1, 0x3000 },

+  { 0x8700, 0xa2ef, 0x2000 },

+  { 0x0700, 0xa2ee, 0x0000 },

+  { 0x0700, 0xa2f0, 0x0000 },

+  { 0x8700, 0xa2f3, 0x2000 },

+  { 0x0700, 0xa2f2, 0x0000 },

+  { 0x0700, 0xa2f4, 0x0000 },

+  { 0x8700, 0xa2f9, 0x3000 },

+  { 0x8700, 0xa2f7, 0x2000 },

+  { 0x0700, 0xa2f6, 0x0000 },

+  { 0x0700, 0xa2f8, 0x0000 },

+  { 0x8700, 0xa2fb, 0x2000 },

+  { 0x0700, 0xa2fa, 0x0000 },

+  { 0x0700, 0xa2fc, 0x0000 },

+  { 0x8700, 0xa305, 0x4000 },

+  { 0x8700, 0xa301, 0x3000 },

+  { 0x8700, 0xa2ff, 0x2000 },

+  { 0x0700, 0xa2fe, 0x0000 },

+  { 0x0700, 0xa300, 0x0000 },

+  { 0x8700, 0xa303, 0x2000 },

+  { 0x0700, 0xa302, 0x0000 },

+  { 0x0700, 0xa304, 0x0000 },

+  { 0x8700, 0xa309, 0x3000 },

+  { 0x8700, 0xa307, 0x2000 },

+  { 0x0700, 0xa306, 0x0000 },

+  { 0x0700, 0xa308, 0x0000 },

+  { 0x8700, 0xa30b, 0x2000 },

+  { 0x0700, 0xa30a, 0x0000 },

+  { 0x0700, 0xa30c, 0x0000 },

+  { 0x8700, 0xa32d, 0x6000 },

+  { 0x8700, 0xa31d, 0x5000 },

+  { 0x8700, 0xa315, 0x4000 },

+  { 0x8700, 0xa311, 0x3000 },

+  { 0x8700, 0xa30f, 0x2000 },

+  { 0x0700, 0xa30e, 0x0000 },

+  { 0x0700, 0xa310, 0x0000 },

+  { 0x8700, 0xa313, 0x2000 },

+  { 0x0700, 0xa312, 0x0000 },

+  { 0x0700, 0xa314, 0x0000 },

+  { 0x8700, 0xa319, 0x3000 },

+  { 0x8700, 0xa317, 0x2000 },

+  { 0x0700, 0xa316, 0x0000 },

+  { 0x0700, 0xa318, 0x0000 },

+  { 0x8700, 0xa31b, 0x2000 },

+  { 0x0700, 0xa31a, 0x0000 },

+  { 0x0700, 0xa31c, 0x0000 },

+  { 0x8700, 0xa325, 0x4000 },

+  { 0x8700, 0xa321, 0x3000 },

+  { 0x8700, 0xa31f, 0x2000 },

+  { 0x0700, 0xa31e, 0x0000 },

+  { 0x0700, 0xa320, 0x0000 },

+  { 0x8700, 0xa323, 0x2000 },

+  { 0x0700, 0xa322, 0x0000 },

+  { 0x0700, 0xa324, 0x0000 },

+  { 0x8700, 0xa329, 0x3000 },

+  { 0x8700, 0xa327, 0x2000 },

+  { 0x0700, 0xa326, 0x0000 },

+  { 0x0700, 0xa328, 0x0000 },

+  { 0x8700, 0xa32b, 0x2000 },

+  { 0x0700, 0xa32a, 0x0000 },

+  { 0x0700, 0xa32c, 0x0000 },

+  { 0x8700, 0xa33d, 0x5000 },

+  { 0x8700, 0xa335, 0x4000 },

+  { 0x8700, 0xa331, 0x3000 },

+  { 0x8700, 0xa32f, 0x2000 },

+  { 0x0700, 0xa32e, 0x0000 },

+  { 0x0700, 0xa330, 0x0000 },

+  { 0x8700, 0xa333, 0x2000 },

+  { 0x0700, 0xa332, 0x0000 },

+  { 0x0700, 0xa334, 0x0000 },

+  { 0x8700, 0xa339, 0x3000 },

+  { 0x8700, 0xa337, 0x2000 },

+  { 0x0700, 0xa336, 0x0000 },

+  { 0x0700, 0xa338, 0x0000 },

+  { 0x8700, 0xa33b, 0x2000 },

+  { 0x0700, 0xa33a, 0x0000 },

+  { 0x0700, 0xa33c, 0x0000 },

+  { 0x8700, 0xa345, 0x4000 },

+  { 0x8700, 0xa341, 0x3000 },

+  { 0x8700, 0xa33f, 0x2000 },

+  { 0x0700, 0xa33e, 0x0000 },

+  { 0x0700, 0xa340, 0x0000 },

+  { 0x8700, 0xa343, 0x2000 },

+  { 0x0700, 0xa342, 0x0000 },

+  { 0x0700, 0xa344, 0x0000 },

+  { 0x8700, 0xa349, 0x3000 },

+  { 0x8700, 0xa347, 0x2000 },

+  { 0x0700, 0xa346, 0x0000 },

+  { 0x0700, 0xa348, 0x0000 },

+  { 0x8700, 0xa34b, 0x2000 },

+  { 0x0700, 0xa34a, 0x0000 },

+  { 0x0700, 0xa34c, 0x0000 },

+  { 0x8700, 0xfc4d, 0xb000 },

+  { 0x8700, 0xf97f, 0xa000 },

+  { 0x8700, 0xa44d, 0x9000 },

+  { 0x8700, 0xa3cd, 0x8000 },

+  { 0x8700, 0xa38d, 0x7000 },

+  { 0x8700, 0xa36d, 0x6000 },

+  { 0x8700, 0xa35d, 0x5000 },

+  { 0x8700, 0xa355, 0x4000 },

+  { 0x8700, 0xa351, 0x3000 },

+  { 0x8700, 0xa34f, 0x2000 },

+  { 0x0700, 0xa34e, 0x0000 },

+  { 0x0700, 0xa350, 0x0000 },

+  { 0x8700, 0xa353, 0x2000 },

+  { 0x0700, 0xa352, 0x0000 },

+  { 0x0700, 0xa354, 0x0000 },

+  { 0x8700, 0xa359, 0x3000 },

+  { 0x8700, 0xa357, 0x2000 },

+  { 0x0700, 0xa356, 0x0000 },

+  { 0x0700, 0xa358, 0x0000 },

+  { 0x8700, 0xa35b, 0x2000 },

+  { 0x0700, 0xa35a, 0x0000 },

+  { 0x0700, 0xa35c, 0x0000 },

+  { 0x8700, 0xa365, 0x4000 },

+  { 0x8700, 0xa361, 0x3000 },

+  { 0x8700, 0xa35f, 0x2000 },

+  { 0x0700, 0xa35e, 0x0000 },

+  { 0x0700, 0xa360, 0x0000 },

+  { 0x8700, 0xa363, 0x2000 },

+  { 0x0700, 0xa362, 0x0000 },

+  { 0x0700, 0xa364, 0x0000 },

+  { 0x8700, 0xa369, 0x3000 },

+  { 0x8700, 0xa367, 0x2000 },

+  { 0x0700, 0xa366, 0x0000 },

+  { 0x0700, 0xa368, 0x0000 },

+  { 0x8700, 0xa36b, 0x2000 },

+  { 0x0700, 0xa36a, 0x0000 },

+  { 0x0700, 0xa36c, 0x0000 },

+  { 0x8700, 0xa37d, 0x5000 },

+  { 0x8700, 0xa375, 0x4000 },

+  { 0x8700, 0xa371, 0x3000 },

+  { 0x8700, 0xa36f, 0x2000 },

+  { 0x0700, 0xa36e, 0x0000 },

+  { 0x0700, 0xa370, 0x0000 },

+  { 0x8700, 0xa373, 0x2000 },

+  { 0x0700, 0xa372, 0x0000 },

+  { 0x0700, 0xa374, 0x0000 },

+  { 0x8700, 0xa379, 0x3000 },

+  { 0x8700, 0xa377, 0x2000 },

+  { 0x0700, 0xa376, 0x0000 },

+  { 0x0700, 0xa378, 0x0000 },

+  { 0x8700, 0xa37b, 0x2000 },

+  { 0x0700, 0xa37a, 0x0000 },

+  { 0x0700, 0xa37c, 0x0000 },

+  { 0x8700, 0xa385, 0x4000 },

+  { 0x8700, 0xa381, 0x3000 },

+  { 0x8700, 0xa37f, 0x2000 },

+  { 0x0700, 0xa37e, 0x0000 },

+  { 0x0700, 0xa380, 0x0000 },

+  { 0x8700, 0xa383, 0x2000 },

+  { 0x0700, 0xa382, 0x0000 },

+  { 0x0700, 0xa384, 0x0000 },

+  { 0x8700, 0xa389, 0x3000 },

+  { 0x8700, 0xa387, 0x2000 },

+  { 0x0700, 0xa386, 0x0000 },

+  { 0x0700, 0xa388, 0x0000 },

+  { 0x8700, 0xa38b, 0x2000 },

+  { 0x0700, 0xa38a, 0x0000 },

+  { 0x0700, 0xa38c, 0x0000 },

+  { 0x8700, 0xa3ad, 0x6000 },

+  { 0x8700, 0xa39d, 0x5000 },

+  { 0x8700, 0xa395, 0x4000 },

+  { 0x8700, 0xa391, 0x3000 },

+  { 0x8700, 0xa38f, 0x2000 },

+  { 0x0700, 0xa38e, 0x0000 },

+  { 0x0700, 0xa390, 0x0000 },

+  { 0x8700, 0xa393, 0x2000 },

+  { 0x0700, 0xa392, 0x0000 },

+  { 0x0700, 0xa394, 0x0000 },

+  { 0x8700, 0xa399, 0x3000 },

+  { 0x8700, 0xa397, 0x2000 },

+  { 0x0700, 0xa396, 0x0000 },

+  { 0x0700, 0xa398, 0x0000 },

+  { 0x8700, 0xa39b, 0x2000 },

+  { 0x0700, 0xa39a, 0x0000 },

+  { 0x0700, 0xa39c, 0x0000 },

+  { 0x8700, 0xa3a5, 0x4000 },

+  { 0x8700, 0xa3a1, 0x3000 },

+  { 0x8700, 0xa39f, 0x2000 },

+  { 0x0700, 0xa39e, 0x0000 },

+  { 0x0700, 0xa3a0, 0x0000 },

+  { 0x8700, 0xa3a3, 0x2000 },

+  { 0x0700, 0xa3a2, 0x0000 },

+  { 0x0700, 0xa3a4, 0x0000 },

+  { 0x8700, 0xa3a9, 0x3000 },

+  { 0x8700, 0xa3a7, 0x2000 },

+  { 0x0700, 0xa3a6, 0x0000 },

+  { 0x0700, 0xa3a8, 0x0000 },

+  { 0x8700, 0xa3ab, 0x2000 },

+  { 0x0700, 0xa3aa, 0x0000 },

+  { 0x0700, 0xa3ac, 0x0000 },

+  { 0x8700, 0xa3bd, 0x5000 },

+  { 0x8700, 0xa3b5, 0x4000 },

+  { 0x8700, 0xa3b1, 0x3000 },

+  { 0x8700, 0xa3af, 0x2000 },

+  { 0x0700, 0xa3ae, 0x0000 },

+  { 0x0700, 0xa3b0, 0x0000 },

+  { 0x8700, 0xa3b3, 0x2000 },

+  { 0x0700, 0xa3b2, 0x0000 },

+  { 0x0700, 0xa3b4, 0x0000 },

+  { 0x8700, 0xa3b9, 0x3000 },

+  { 0x8700, 0xa3b7, 0x2000 },

+  { 0x0700, 0xa3b6, 0x0000 },

+  { 0x0700, 0xa3b8, 0x0000 },

+  { 0x8700, 0xa3bb, 0x2000 },

+  { 0x0700, 0xa3ba, 0x0000 },

+  { 0x0700, 0xa3bc, 0x0000 },

+  { 0x8700, 0xa3c5, 0x4000 },

+  { 0x8700, 0xa3c1, 0x3000 },

+  { 0x8700, 0xa3bf, 0x2000 },

+  { 0x0700, 0xa3be, 0x0000 },

+  { 0x0700, 0xa3c0, 0x0000 },

+  { 0x8700, 0xa3c3, 0x2000 },

+  { 0x0700, 0xa3c2, 0x0000 },

+  { 0x0700, 0xa3c4, 0x0000 },

+  { 0x8700, 0xa3c9, 0x3000 },

+  { 0x8700, 0xa3c7, 0x2000 },

+  { 0x0700, 0xa3c6, 0x0000 },

+  { 0x0700, 0xa3c8, 0x0000 },

+  { 0x8700, 0xa3cb, 0x2000 },

+  { 0x0700, 0xa3ca, 0x0000 },

+  { 0x0700, 0xa3cc, 0x0000 },

+  { 0x8700, 0xa40d, 0x7000 },

+  { 0x8700, 0xa3ed, 0x6000 },

+  { 0x8700, 0xa3dd, 0x5000 },

+  { 0x8700, 0xa3d5, 0x4000 },

+  { 0x8700, 0xa3d1, 0x3000 },

+  { 0x8700, 0xa3cf, 0x2000 },

+  { 0x0700, 0xa3ce, 0x0000 },

+  { 0x0700, 0xa3d0, 0x0000 },

+  { 0x8700, 0xa3d3, 0x2000 },

+  { 0x0700, 0xa3d2, 0x0000 },

+  { 0x0700, 0xa3d4, 0x0000 },

+  { 0x8700, 0xa3d9, 0x3000 },

+  { 0x8700, 0xa3d7, 0x2000 },

+  { 0x0700, 0xa3d6, 0x0000 },

+  { 0x0700, 0xa3d8, 0x0000 },

+  { 0x8700, 0xa3db, 0x2000 },

+  { 0x0700, 0xa3da, 0x0000 },

+  { 0x0700, 0xa3dc, 0x0000 },

+  { 0x8700, 0xa3e5, 0x4000 },

+  { 0x8700, 0xa3e1, 0x3000 },

+  { 0x8700, 0xa3df, 0x2000 },

+  { 0x0700, 0xa3de, 0x0000 },

+  { 0x0700, 0xa3e0, 0x0000 },

+  { 0x8700, 0xa3e3, 0x2000 },

+  { 0x0700, 0xa3e2, 0x0000 },

+  { 0x0700, 0xa3e4, 0x0000 },

+  { 0x8700, 0xa3e9, 0x3000 },

+  { 0x8700, 0xa3e7, 0x2000 },

+  { 0x0700, 0xa3e6, 0x0000 },

+  { 0x0700, 0xa3e8, 0x0000 },

+  { 0x8700, 0xa3eb, 0x2000 },

+  { 0x0700, 0xa3ea, 0x0000 },

+  { 0x0700, 0xa3ec, 0x0000 },

+  { 0x8700, 0xa3fd, 0x5000 },

+  { 0x8700, 0xa3f5, 0x4000 },

+  { 0x8700, 0xa3f1, 0x3000 },

+  { 0x8700, 0xa3ef, 0x2000 },

+  { 0x0700, 0xa3ee, 0x0000 },

+  { 0x0700, 0xa3f0, 0x0000 },

+  { 0x8700, 0xa3f3, 0x2000 },

+  { 0x0700, 0xa3f2, 0x0000 },

+  { 0x0700, 0xa3f4, 0x0000 },

+  { 0x8700, 0xa3f9, 0x3000 },

+  { 0x8700, 0xa3f7, 0x2000 },

+  { 0x0700, 0xa3f6, 0x0000 },

+  { 0x0700, 0xa3f8, 0x0000 },

+  { 0x8700, 0xa3fb, 0x2000 },

+  { 0x0700, 0xa3fa, 0x0000 },

+  { 0x0700, 0xa3fc, 0x0000 },

+  { 0x8700, 0xa405, 0x4000 },

+  { 0x8700, 0xa401, 0x3000 },

+  { 0x8700, 0xa3ff, 0x2000 },

+  { 0x0700, 0xa3fe, 0x0000 },

+  { 0x0700, 0xa400, 0x0000 },

+  { 0x8700, 0xa403, 0x2000 },

+  { 0x0700, 0xa402, 0x0000 },

+  { 0x0700, 0xa404, 0x0000 },

+  { 0x8700, 0xa409, 0x3000 },

+  { 0x8700, 0xa407, 0x2000 },

+  { 0x0700, 0xa406, 0x0000 },

+  { 0x0700, 0xa408, 0x0000 },

+  { 0x8700, 0xa40b, 0x2000 },

+  { 0x0700, 0xa40a, 0x0000 },

+  { 0x0700, 0xa40c, 0x0000 },

+  { 0x8700, 0xa42d, 0x6000 },

+  { 0x8700, 0xa41d, 0x5000 },

+  { 0x8700, 0xa415, 0x4000 },

+  { 0x8700, 0xa411, 0x3000 },

+  { 0x8700, 0xa40f, 0x2000 },

+  { 0x0700, 0xa40e, 0x0000 },

+  { 0x0700, 0xa410, 0x0000 },

+  { 0x8700, 0xa413, 0x2000 },

+  { 0x0700, 0xa412, 0x0000 },

+  { 0x0700, 0xa414, 0x0000 },

+  { 0x8700, 0xa419, 0x3000 },

+  { 0x8700, 0xa417, 0x2000 },

+  { 0x0700, 0xa416, 0x0000 },

+  { 0x0700, 0xa418, 0x0000 },

+  { 0x8700, 0xa41b, 0x2000 },

+  { 0x0700, 0xa41a, 0x0000 },

+  { 0x0700, 0xa41c, 0x0000 },

+  { 0x8700, 0xa425, 0x4000 },

+  { 0x8700, 0xa421, 0x3000 },

+  { 0x8700, 0xa41f, 0x2000 },

+  { 0x0700, 0xa41e, 0x0000 },

+  { 0x0700, 0xa420, 0x0000 },

+  { 0x8700, 0xa423, 0x2000 },

+  { 0x0700, 0xa422, 0x0000 },

+  { 0x0700, 0xa424, 0x0000 },

+  { 0x8700, 0xa429, 0x3000 },

+  { 0x8700, 0xa427, 0x2000 },

+  { 0x0700, 0xa426, 0x0000 },

+  { 0x0700, 0xa428, 0x0000 },

+  { 0x8700, 0xa42b, 0x2000 },

+  { 0x0700, 0xa42a, 0x0000 },

+  { 0x0700, 0xa42c, 0x0000 },

+  { 0x8700, 0xa43d, 0x5000 },

+  { 0x8700, 0xa435, 0x4000 },

+  { 0x8700, 0xa431, 0x3000 },

+  { 0x8700, 0xa42f, 0x2000 },

+  { 0x0700, 0xa42e, 0x0000 },

+  { 0x0700, 0xa430, 0x0000 },

+  { 0x8700, 0xa433, 0x2000 },

+  { 0x0700, 0xa432, 0x0000 },

+  { 0x0700, 0xa434, 0x0000 },

+  { 0x8700, 0xa439, 0x3000 },

+  { 0x8700, 0xa437, 0x2000 },

+  { 0x0700, 0xa436, 0x0000 },

+  { 0x0700, 0xa438, 0x0000 },

+  { 0x8700, 0xa43b, 0x2000 },

+  { 0x0700, 0xa43a, 0x0000 },

+  { 0x0700, 0xa43c, 0x0000 },

+  { 0x8700, 0xa445, 0x4000 },

+  { 0x8700, 0xa441, 0x3000 },

+  { 0x8700, 0xa43f, 0x2000 },

+  { 0x0700, 0xa43e, 0x0000 },

+  { 0x0700, 0xa440, 0x0000 },

+  { 0x8700, 0xa443, 0x2000 },

+  { 0x0700, 0xa442, 0x0000 },

+  { 0x0700, 0xa444, 0x0000 },

+  { 0x8700, 0xa449, 0x3000 },

+  { 0x8700, 0xa447, 0x2000 },

+  { 0x0700, 0xa446, 0x0000 },

+  { 0x0700, 0xa448, 0x0000 },

+  { 0x8700, 0xa44b, 0x2000 },

+  { 0x0700, 0xa44a, 0x0000 },

+  { 0x0700, 0xa44c, 0x0000 },

+  { 0x8300, 0xf8ff, 0x8000 },

+  { 0x9a00, 0xa490, 0x7000 },

+  { 0x8700, 0xa46d, 0x6000 },

+  { 0x8700, 0xa45d, 0x5000 },

+  { 0x8700, 0xa455, 0x4000 },

+  { 0x8700, 0xa451, 0x3000 },

+  { 0x8700, 0xa44f, 0x2000 },

+  { 0x0700, 0xa44e, 0x0000 },

+  { 0x0700, 0xa450, 0x0000 },

+  { 0x8700, 0xa453, 0x2000 },

+  { 0x0700, 0xa452, 0x0000 },

+  { 0x0700, 0xa454, 0x0000 },

+  { 0x8700, 0xa459, 0x3000 },

+  { 0x8700, 0xa457, 0x2000 },

+  { 0x0700, 0xa456, 0x0000 },

+  { 0x0700, 0xa458, 0x0000 },

+  { 0x8700, 0xa45b, 0x2000 },

+  { 0x0700, 0xa45a, 0x0000 },

+  { 0x0700, 0xa45c, 0x0000 },

+  { 0x8700, 0xa465, 0x4000 },

+  { 0x8700, 0xa461, 0x3000 },

+  { 0x8700, 0xa45f, 0x2000 },

+  { 0x0700, 0xa45e, 0x0000 },

+  { 0x0700, 0xa460, 0x0000 },

+  { 0x8700, 0xa463, 0x2000 },

+  { 0x0700, 0xa462, 0x0000 },

+  { 0x0700, 0xa464, 0x0000 },

+  { 0x8700, 0xa469, 0x3000 },

+  { 0x8700, 0xa467, 0x2000 },

+  { 0x0700, 0xa466, 0x0000 },

+  { 0x0700, 0xa468, 0x0000 },

+  { 0x8700, 0xa46b, 0x2000 },

+  { 0x0700, 0xa46a, 0x0000 },

+  { 0x0700, 0xa46c, 0x0000 },

+  { 0x8700, 0xa47d, 0x5000 },

+  { 0x8700, 0xa475, 0x4000 },

+  { 0x8700, 0xa471, 0x3000 },

+  { 0x8700, 0xa46f, 0x2000 },

+  { 0x0700, 0xa46e, 0x0000 },

+  { 0x0700, 0xa470, 0x0000 },

+  { 0x8700, 0xa473, 0x2000 },

+  { 0x0700, 0xa472, 0x0000 },

+  { 0x0700, 0xa474, 0x0000 },

+  { 0x8700, 0xa479, 0x3000 },

+  { 0x8700, 0xa477, 0x2000 },

+  { 0x0700, 0xa476, 0x0000 },

+  { 0x0700, 0xa478, 0x0000 },

+  { 0x8700, 0xa47b, 0x2000 },

+  { 0x0700, 0xa47a, 0x0000 },

+  { 0x0700, 0xa47c, 0x0000 },

+  { 0x8700, 0xa485, 0x4000 },

+  { 0x8700, 0xa481, 0x3000 },

+  { 0x8700, 0xa47f, 0x2000 },

+  { 0x0700, 0xa47e, 0x0000 },

+  { 0x0700, 0xa480, 0x0000 },

+  { 0x8700, 0xa483, 0x2000 },

+  { 0x0700, 0xa482, 0x0000 },

+  { 0x0700, 0xa484, 0x0000 },

+  { 0x8700, 0xa489, 0x3000 },

+  { 0x8700, 0xa487, 0x2000 },

+  { 0x0700, 0xa486, 0x0000 },

+  { 0x0700, 0xa488, 0x0000 },

+  { 0x8700, 0xa48b, 0x2000 },

+  { 0x0700, 0xa48a, 0x0000 },

+  { 0x0700, 0xa48c, 0x0000 },

+  { 0x9a00, 0xa4b0, 0x6000 },

+  { 0x9a00, 0xa4a0, 0x5000 },

+  { 0x9a00, 0xa498, 0x4000 },

+  { 0x9a00, 0xa494, 0x3000 },

+  { 0x9a00, 0xa492, 0x2000 },

+  { 0x1a00, 0xa491, 0x0000 },

+  { 0x1a00, 0xa493, 0x0000 },

+  { 0x9a00, 0xa496, 0x2000 },

+  { 0x1a00, 0xa495, 0x0000 },

+  { 0x1a00, 0xa497, 0x0000 },

+  { 0x9a00, 0xa49c, 0x3000 },

+  { 0x9a00, 0xa49a, 0x2000 },

+  { 0x1a00, 0xa499, 0x0000 },

+  { 0x1a00, 0xa49b, 0x0000 },

+  { 0x9a00, 0xa49e, 0x2000 },

+  { 0x1a00, 0xa49d, 0x0000 },

+  { 0x1a00, 0xa49f, 0x0000 },

+  { 0x9a00, 0xa4a8, 0x4000 },

+  { 0x9a00, 0xa4a4, 0x3000 },

+  { 0x9a00, 0xa4a2, 0x2000 },

+  { 0x1a00, 0xa4a1, 0x0000 },

+  { 0x1a00, 0xa4a3, 0x0000 },

+  { 0x9a00, 0xa4a6, 0x2000 },

+  { 0x1a00, 0xa4a5, 0x0000 },

+  { 0x1a00, 0xa4a7, 0x0000 },

+  { 0x9a00, 0xa4ac, 0x3000 },

+  { 0x9a00, 0xa4aa, 0x2000 },

+  { 0x1a00, 0xa4a9, 0x0000 },

+  { 0x1a00, 0xa4ab, 0x0000 },

+  { 0x9a00, 0xa4ae, 0x2000 },

+  { 0x1a00, 0xa4ad, 0x0000 },

+  { 0x1a00, 0xa4af, 0x0000 },

+  { 0x9a00, 0xa4c0, 0x5000 },

+  { 0x9a00, 0xa4b8, 0x4000 },

+  { 0x9a00, 0xa4b4, 0x3000 },

+  { 0x9a00, 0xa4b2, 0x2000 },

+  { 0x1a00, 0xa4b1, 0x0000 },

+  { 0x1a00, 0xa4b3, 0x0000 },

+  { 0x9a00, 0xa4b6, 0x2000 },

+  { 0x1a00, 0xa4b5, 0x0000 },

+  { 0x1a00, 0xa4b7, 0x0000 },

+  { 0x9a00, 0xa4bc, 0x3000 },

+  { 0x9a00, 0xa4ba, 0x2000 },

+  { 0x1a00, 0xa4b9, 0x0000 },

+  { 0x1a00, 0xa4bb, 0x0000 },

+  { 0x9a00, 0xa4be, 0x2000 },

+  { 0x1a00, 0xa4bd, 0x0000 },

+  { 0x1a00, 0xa4bf, 0x0000 },

+  { 0x8700, 0xd7a3, 0x4000 },

+  { 0x9a00, 0xa4c4, 0x3000 },

+  { 0x9a00, 0xa4c2, 0x2000 },

+  { 0x1a00, 0xa4c1, 0x0000 },

+  { 0x1a00, 0xa4c3, 0x0000 },

+  { 0x9a00, 0xa4c6, 0x2000 },

+  { 0x1a00, 0xa4c5, 0x0000 },

+  { 0x0700, 0xac00, 0x0000 },

+  { 0x8400, 0xdbff, 0x3000 },

+  { 0x8400, 0xdb7f, 0x2000 },

+  { 0x0400, 0xd800, 0x0000 },

+  { 0x0400, 0xdb80, 0x0000 },

+  { 0x8400, 0xdfff, 0x2000 },

+  { 0x0400, 0xdc00, 0x0000 },

+  { 0x0300, 0xe000, 0x0000 },

+  { 0x8700, 0xf93f, 0x7000 },

+  { 0x8700, 0xf91f, 0x6000 },

+  { 0x8700, 0xf90f, 0x5000 },

+  { 0x8700, 0xf907, 0x4000 },

+  { 0x8700, 0xf903, 0x3000 },

+  { 0x8700, 0xf901, 0x2000 },

+  { 0x0700, 0xf900, 0x0000 },

+  { 0x0700, 0xf902, 0x0000 },

+  { 0x8700, 0xf905, 0x2000 },

+  { 0x0700, 0xf904, 0x0000 },

+  { 0x0700, 0xf906, 0x0000 },

+  { 0x8700, 0xf90b, 0x3000 },

+  { 0x8700, 0xf909, 0x2000 },

+  { 0x0700, 0xf908, 0x0000 },

+  { 0x0700, 0xf90a, 0x0000 },

+  { 0x8700, 0xf90d, 0x2000 },

+  { 0x0700, 0xf90c, 0x0000 },

+  { 0x0700, 0xf90e, 0x0000 },

+  { 0x8700, 0xf917, 0x4000 },

+  { 0x8700, 0xf913, 0x3000 },

+  { 0x8700, 0xf911, 0x2000 },

+  { 0x0700, 0xf910, 0x0000 },

+  { 0x0700, 0xf912, 0x0000 },

+  { 0x8700, 0xf915, 0x2000 },

+  { 0x0700, 0xf914, 0x0000 },

+  { 0x0700, 0xf916, 0x0000 },

+  { 0x8700, 0xf91b, 0x3000 },

+  { 0x8700, 0xf919, 0x2000 },

+  { 0x0700, 0xf918, 0x0000 },

+  { 0x0700, 0xf91a, 0x0000 },

+  { 0x8700, 0xf91d, 0x2000 },

+  { 0x0700, 0xf91c, 0x0000 },

+  { 0x0700, 0xf91e, 0x0000 },

+  { 0x8700, 0xf92f, 0x5000 },

+  { 0x8700, 0xf927, 0x4000 },

+  { 0x8700, 0xf923, 0x3000 },

+  { 0x8700, 0xf921, 0x2000 },

+  { 0x0700, 0xf920, 0x0000 },

+  { 0x0700, 0xf922, 0x0000 },

+  { 0x8700, 0xf925, 0x2000 },

+  { 0x0700, 0xf924, 0x0000 },

+  { 0x0700, 0xf926, 0x0000 },

+  { 0x8700, 0xf92b, 0x3000 },

+  { 0x8700, 0xf929, 0x2000 },

+  { 0x0700, 0xf928, 0x0000 },

+  { 0x0700, 0xf92a, 0x0000 },

+  { 0x8700, 0xf92d, 0x2000 },

+  { 0x0700, 0xf92c, 0x0000 },

+  { 0x0700, 0xf92e, 0x0000 },

+  { 0x8700, 0xf937, 0x4000 },

+  { 0x8700, 0xf933, 0x3000 },

+  { 0x8700, 0xf931, 0x2000 },

+  { 0x0700, 0xf930, 0x0000 },

+  { 0x0700, 0xf932, 0x0000 },

+  { 0x8700, 0xf935, 0x2000 },

+  { 0x0700, 0xf934, 0x0000 },

+  { 0x0700, 0xf936, 0x0000 },

+  { 0x8700, 0xf93b, 0x3000 },

+  { 0x8700, 0xf939, 0x2000 },

+  { 0x0700, 0xf938, 0x0000 },

+  { 0x0700, 0xf93a, 0x0000 },

+  { 0x8700, 0xf93d, 0x2000 },

+  { 0x0700, 0xf93c, 0x0000 },

+  { 0x0700, 0xf93e, 0x0000 },

+  { 0x8700, 0xf95f, 0x6000 },

+  { 0x8700, 0xf94f, 0x5000 },

+  { 0x8700, 0xf947, 0x4000 },

+  { 0x8700, 0xf943, 0x3000 },

+  { 0x8700, 0xf941, 0x2000 },

+  { 0x0700, 0xf940, 0x0000 },

+  { 0x0700, 0xf942, 0x0000 },

+  { 0x8700, 0xf945, 0x2000 },

+  { 0x0700, 0xf944, 0x0000 },

+  { 0x0700, 0xf946, 0x0000 },

+  { 0x8700, 0xf94b, 0x3000 },

+  { 0x8700, 0xf949, 0x2000 },

+  { 0x0700, 0xf948, 0x0000 },

+  { 0x0700, 0xf94a, 0x0000 },

+  { 0x8700, 0xf94d, 0x2000 },

+  { 0x0700, 0xf94c, 0x0000 },

+  { 0x0700, 0xf94e, 0x0000 },

+  { 0x8700, 0xf957, 0x4000 },

+  { 0x8700, 0xf953, 0x3000 },

+  { 0x8700, 0xf951, 0x2000 },

+  { 0x0700, 0xf950, 0x0000 },

+  { 0x0700, 0xf952, 0x0000 },

+  { 0x8700, 0xf955, 0x2000 },

+  { 0x0700, 0xf954, 0x0000 },

+  { 0x0700, 0xf956, 0x0000 },

+  { 0x8700, 0xf95b, 0x3000 },

+  { 0x8700, 0xf959, 0x2000 },

+  { 0x0700, 0xf958, 0x0000 },

+  { 0x0700, 0xf95a, 0x0000 },

+  { 0x8700, 0xf95d, 0x2000 },

+  { 0x0700, 0xf95c, 0x0000 },

+  { 0x0700, 0xf95e, 0x0000 },

+  { 0x8700, 0xf96f, 0x5000 },

+  { 0x8700, 0xf967, 0x4000 },

+  { 0x8700, 0xf963, 0x3000 },

+  { 0x8700, 0xf961, 0x2000 },

+  { 0x0700, 0xf960, 0x0000 },

+  { 0x0700, 0xf962, 0x0000 },

+  { 0x8700, 0xf965, 0x2000 },

+  { 0x0700, 0xf964, 0x0000 },

+  { 0x0700, 0xf966, 0x0000 },

+  { 0x8700, 0xf96b, 0x3000 },

+  { 0x8700, 0xf969, 0x2000 },

+  { 0x0700, 0xf968, 0x0000 },

+  { 0x0700, 0xf96a, 0x0000 },

+  { 0x8700, 0xf96d, 0x2000 },

+  { 0x0700, 0xf96c, 0x0000 },

+  { 0x0700, 0xf96e, 0x0000 },

+  { 0x8700, 0xf977, 0x4000 },

+  { 0x8700, 0xf973, 0x3000 },

+  { 0x8700, 0xf971, 0x2000 },

+  { 0x0700, 0xf970, 0x0000 },

+  { 0x0700, 0xf972, 0x0000 },

+  { 0x8700, 0xf975, 0x2000 },

+  { 0x0700, 0xf974, 0x0000 },

+  { 0x0700, 0xf976, 0x0000 },

+  { 0x8700, 0xf97b, 0x3000 },

+  { 0x8700, 0xf979, 0x2000 },

+  { 0x0700, 0xf978, 0x0000 },

+  { 0x0700, 0xf97a, 0x0000 },

+  { 0x8700, 0xf97d, 0x2000 },

+  { 0x0700, 0xf97c, 0x0000 },

+  { 0x0700, 0xf97e, 0x0000 },

+  { 0x8700, 0xfb27, 0x9000 },

+  { 0x8700, 0xf9ff, 0x8000 },

+  { 0x8700, 0xf9bf, 0x7000 },

+  { 0x8700, 0xf99f, 0x6000 },

+  { 0x8700, 0xf98f, 0x5000 },

+  { 0x8700, 0xf987, 0x4000 },

+  { 0x8700, 0xf983, 0x3000 },

+  { 0x8700, 0xf981, 0x2000 },

+  { 0x0700, 0xf980, 0x0000 },

+  { 0x0700, 0xf982, 0x0000 },

+  { 0x8700, 0xf985, 0x2000 },

+  { 0x0700, 0xf984, 0x0000 },

+  { 0x0700, 0xf986, 0x0000 },

+  { 0x8700, 0xf98b, 0x3000 },

+  { 0x8700, 0xf989, 0x2000 },

+  { 0x0700, 0xf988, 0x0000 },

+  { 0x0700, 0xf98a, 0x0000 },

+  { 0x8700, 0xf98d, 0x2000 },

+  { 0x0700, 0xf98c, 0x0000 },

+  { 0x0700, 0xf98e, 0x0000 },

+  { 0x8700, 0xf997, 0x4000 },

+  { 0x8700, 0xf993, 0x3000 },

+  { 0x8700, 0xf991, 0x2000 },

+  { 0x0700, 0xf990, 0x0000 },

+  { 0x0700, 0xf992, 0x0000 },

+  { 0x8700, 0xf995, 0x2000 },

+  { 0x0700, 0xf994, 0x0000 },

+  { 0x0700, 0xf996, 0x0000 },

+  { 0x8700, 0xf99b, 0x3000 },

+  { 0x8700, 0xf999, 0x2000 },

+  { 0x0700, 0xf998, 0x0000 },

+  { 0x0700, 0xf99a, 0x0000 },

+  { 0x8700, 0xf99d, 0x2000 },

+  { 0x0700, 0xf99c, 0x0000 },

+  { 0x0700, 0xf99e, 0x0000 },

+  { 0x8700, 0xf9af, 0x5000 },

+  { 0x8700, 0xf9a7, 0x4000 },

+  { 0x8700, 0xf9a3, 0x3000 },

+  { 0x8700, 0xf9a1, 0x2000 },

+  { 0x0700, 0xf9a0, 0x0000 },

+  { 0x0700, 0xf9a2, 0x0000 },

+  { 0x8700, 0xf9a5, 0x2000 },

+  { 0x0700, 0xf9a4, 0x0000 },

+  { 0x0700, 0xf9a6, 0x0000 },

+  { 0x8700, 0xf9ab, 0x3000 },

+  { 0x8700, 0xf9a9, 0x2000 },

+  { 0x0700, 0xf9a8, 0x0000 },

+  { 0x0700, 0xf9aa, 0x0000 },

+  { 0x8700, 0xf9ad, 0x2000 },

+  { 0x0700, 0xf9ac, 0x0000 },

+  { 0x0700, 0xf9ae, 0x0000 },

+  { 0x8700, 0xf9b7, 0x4000 },

+  { 0x8700, 0xf9b3, 0x3000 },

+  { 0x8700, 0xf9b1, 0x2000 },

+  { 0x0700, 0xf9b0, 0x0000 },

+  { 0x0700, 0xf9b2, 0x0000 },

+  { 0x8700, 0xf9b5, 0x2000 },

+  { 0x0700, 0xf9b4, 0x0000 },

+  { 0x0700, 0xf9b6, 0x0000 },

+  { 0x8700, 0xf9bb, 0x3000 },

+  { 0x8700, 0xf9b9, 0x2000 },

+  { 0x0700, 0xf9b8, 0x0000 },

+  { 0x0700, 0xf9ba, 0x0000 },

+  { 0x8700, 0xf9bd, 0x2000 },

+  { 0x0700, 0xf9bc, 0x0000 },

+  { 0x0700, 0xf9be, 0x0000 },

+  { 0x8700, 0xf9df, 0x6000 },

+  { 0x8700, 0xf9cf, 0x5000 },

+  { 0x8700, 0xf9c7, 0x4000 },

+  { 0x8700, 0xf9c3, 0x3000 },

+  { 0x8700, 0xf9c1, 0x2000 },

+  { 0x0700, 0xf9c0, 0x0000 },

+  { 0x0700, 0xf9c2, 0x0000 },

+  { 0x8700, 0xf9c5, 0x2000 },

+  { 0x0700, 0xf9c4, 0x0000 },

+  { 0x0700, 0xf9c6, 0x0000 },

+  { 0x8700, 0xf9cb, 0x3000 },

+  { 0x8700, 0xf9c9, 0x2000 },

+  { 0x0700, 0xf9c8, 0x0000 },

+  { 0x0700, 0xf9ca, 0x0000 },

+  { 0x8700, 0xf9cd, 0x2000 },

+  { 0x0700, 0xf9cc, 0x0000 },

+  { 0x0700, 0xf9ce, 0x0000 },

+  { 0x8700, 0xf9d7, 0x4000 },

+  { 0x8700, 0xf9d3, 0x3000 },

+  { 0x8700, 0xf9d1, 0x2000 },

+  { 0x0700, 0xf9d0, 0x0000 },

+  { 0x0700, 0xf9d2, 0x0000 },

+  { 0x8700, 0xf9d5, 0x2000 },

+  { 0x0700, 0xf9d4, 0x0000 },

+  { 0x0700, 0xf9d6, 0x0000 },

+  { 0x8700, 0xf9db, 0x3000 },

+  { 0x8700, 0xf9d9, 0x2000 },

+  { 0x0700, 0xf9d8, 0x0000 },

+  { 0x0700, 0xf9da, 0x0000 },

+  { 0x8700, 0xf9dd, 0x2000 },

+  { 0x0700, 0xf9dc, 0x0000 },

+  { 0x0700, 0xf9de, 0x0000 },

+  { 0x8700, 0xf9ef, 0x5000 },

+  { 0x8700, 0xf9e7, 0x4000 },

+  { 0x8700, 0xf9e3, 0x3000 },

+  { 0x8700, 0xf9e1, 0x2000 },

+  { 0x0700, 0xf9e0, 0x0000 },

+  { 0x0700, 0xf9e2, 0x0000 },

+  { 0x8700, 0xf9e5, 0x2000 },

+  { 0x0700, 0xf9e4, 0x0000 },

+  { 0x0700, 0xf9e6, 0x0000 },

+  { 0x8700, 0xf9eb, 0x3000 },

+  { 0x8700, 0xf9e9, 0x2000 },

+  { 0x0700, 0xf9e8, 0x0000 },

+  { 0x0700, 0xf9ea, 0x0000 },

+  { 0x8700, 0xf9ed, 0x2000 },

+  { 0x0700, 0xf9ec, 0x0000 },

+  { 0x0700, 0xf9ee, 0x0000 },

+  { 0x8700, 0xf9f7, 0x4000 },

+  { 0x8700, 0xf9f3, 0x3000 },

+  { 0x8700, 0xf9f1, 0x2000 },

+  { 0x0700, 0xf9f0, 0x0000 },

+  { 0x0700, 0xf9f2, 0x0000 },

+  { 0x8700, 0xf9f5, 0x2000 },

+  { 0x0700, 0xf9f4, 0x0000 },

+  { 0x0700, 0xf9f6, 0x0000 },

+  { 0x8700, 0xf9fb, 0x3000 },

+  { 0x8700, 0xf9f9, 0x2000 },

+  { 0x0700, 0xf9f8, 0x0000 },

+  { 0x0700, 0xf9fa, 0x0000 },

+  { 0x8700, 0xf9fd, 0x2000 },

+  { 0x0700, 0xf9fc, 0x0000 },

+  { 0x0700, 0xf9fe, 0x0000 },

+  { 0x8700, 0xfa41, 0x7000 },

+  { 0x8700, 0xfa1f, 0x6000 },

+  { 0x8700, 0xfa0f, 0x5000 },

+  { 0x8700, 0xfa07, 0x4000 },

+  { 0x8700, 0xfa03, 0x3000 },

+  { 0x8700, 0xfa01, 0x2000 },

+  { 0x0700, 0xfa00, 0x0000 },

+  { 0x0700, 0xfa02, 0x0000 },

+  { 0x8700, 0xfa05, 0x2000 },

+  { 0x0700, 0xfa04, 0x0000 },

+  { 0x0700, 0xfa06, 0x0000 },

+  { 0x8700, 0xfa0b, 0x3000 },

+  { 0x8700, 0xfa09, 0x2000 },

+  { 0x0700, 0xfa08, 0x0000 },

+  { 0x0700, 0xfa0a, 0x0000 },

+  { 0x8700, 0xfa0d, 0x2000 },

+  { 0x0700, 0xfa0c, 0x0000 },

+  { 0x0700, 0xfa0e, 0x0000 },

+  { 0x8700, 0xfa17, 0x4000 },

+  { 0x8700, 0xfa13, 0x3000 },

+  { 0x8700, 0xfa11, 0x2000 },

+  { 0x0700, 0xfa10, 0x0000 },

+  { 0x0700, 0xfa12, 0x0000 },

+  { 0x8700, 0xfa15, 0x2000 },

+  { 0x0700, 0xfa14, 0x0000 },

+  { 0x0700, 0xfa16, 0x0000 },

+  { 0x8700, 0xfa1b, 0x3000 },

+  { 0x8700, 0xfa19, 0x2000 },

+  { 0x0700, 0xfa18, 0x0000 },

+  { 0x0700, 0xfa1a, 0x0000 },

+  { 0x8700, 0xfa1d, 0x2000 },

+  { 0x0700, 0xfa1c, 0x0000 },

+  { 0x0700, 0xfa1e, 0x0000 },

+  { 0x8700, 0xfa31, 0x5000 },

+  { 0x8700, 0xfa27, 0x4000 },

+  { 0x8700, 0xfa23, 0x3000 },

+  { 0x8700, 0xfa21, 0x2000 },

+  { 0x0700, 0xfa20, 0x0000 },

+  { 0x0700, 0xfa22, 0x0000 },

+  { 0x8700, 0xfa25, 0x2000 },

+  { 0x0700, 0xfa24, 0x0000 },

+  { 0x0700, 0xfa26, 0x0000 },

+  { 0x8700, 0xfa2b, 0x3000 },

+  { 0x8700, 0xfa29, 0x2000 },

+  { 0x0700, 0xfa28, 0x0000 },

+  { 0x0700, 0xfa2a, 0x0000 },

+  { 0x8700, 0xfa2d, 0x2000 },

+  { 0x0700, 0xfa2c, 0x0000 },

+  { 0x0700, 0xfa30, 0x0000 },

+  { 0x8700, 0xfa39, 0x4000 },

+  { 0x8700, 0xfa35, 0x3000 },

+  { 0x8700, 0xfa33, 0x2000 },

+  { 0x0700, 0xfa32, 0x0000 },

+  { 0x0700, 0xfa34, 0x0000 },

+  { 0x8700, 0xfa37, 0x2000 },

+  { 0x0700, 0xfa36, 0x0000 },

+  { 0x0700, 0xfa38, 0x0000 },

+  { 0x8700, 0xfa3d, 0x3000 },

+  { 0x8700, 0xfa3b, 0x2000 },

+  { 0x0700, 0xfa3a, 0x0000 },

+  { 0x0700, 0xfa3c, 0x0000 },

+  { 0x8700, 0xfa3f, 0x2000 },

+  { 0x0700, 0xfa3e, 0x0000 },

+  { 0x0700, 0xfa40, 0x0000 },

+  { 0x8700, 0xfa61, 0x6000 },

+  { 0x8700, 0xfa51, 0x5000 },

+  { 0x8700, 0xfa49, 0x4000 },

+  { 0x8700, 0xfa45, 0x3000 },

+  { 0x8700, 0xfa43, 0x2000 },

+  { 0x0700, 0xfa42, 0x0000 },

+  { 0x0700, 0xfa44, 0x0000 },

+  { 0x8700, 0xfa47, 0x2000 },

+  { 0x0700, 0xfa46, 0x0000 },

+  { 0x0700, 0xfa48, 0x0000 },

+  { 0x8700, 0xfa4d, 0x3000 },

+  { 0x8700, 0xfa4b, 0x2000 },

+  { 0x0700, 0xfa4a, 0x0000 },

+  { 0x0700, 0xfa4c, 0x0000 },

+  { 0x8700, 0xfa4f, 0x2000 },

+  { 0x0700, 0xfa4e, 0x0000 },

+  { 0x0700, 0xfa50, 0x0000 },

+  { 0x8700, 0xfa59, 0x4000 },

+  { 0x8700, 0xfa55, 0x3000 },

+  { 0x8700, 0xfa53, 0x2000 },

+  { 0x0700, 0xfa52, 0x0000 },

+  { 0x0700, 0xfa54, 0x0000 },

+  { 0x8700, 0xfa57, 0x2000 },

+  { 0x0700, 0xfa56, 0x0000 },

+  { 0x0700, 0xfa58, 0x0000 },

+  { 0x8700, 0xfa5d, 0x3000 },

+  { 0x8700, 0xfa5b, 0x2000 },

+  { 0x0700, 0xfa5a, 0x0000 },

+  { 0x0700, 0xfa5c, 0x0000 },

+  { 0x8700, 0xfa5f, 0x2000 },

+  { 0x0700, 0xfa5e, 0x0000 },

+  { 0x0700, 0xfa60, 0x0000 },

+  { 0x8500, 0xfb06, 0x5000 },

+  { 0x8700, 0xfa69, 0x4000 },

+  { 0x8700, 0xfa65, 0x3000 },

+  { 0x8700, 0xfa63, 0x2000 },

+  { 0x0700, 0xfa62, 0x0000 },

+  { 0x0700, 0xfa64, 0x0000 },

+  { 0x8700, 0xfa67, 0x2000 },

+  { 0x0700, 0xfa66, 0x0000 },

+  { 0x0700, 0xfa68, 0x0000 },

+  { 0x8500, 0xfb02, 0x3000 },

+  { 0x8500, 0xfb00, 0x2000 },

+  { 0x0700, 0xfa6a, 0x0000 },

+  { 0x0500, 0xfb01, 0x0000 },

+  { 0x8500, 0xfb04, 0x2000 },

+  { 0x0500, 0xfb03, 0x0000 },

+  { 0x0500, 0xfb05, 0x0000 },

+  { 0x8700, 0xfb1f, 0x4000 },

+  { 0x8500, 0xfb16, 0x3000 },

+  { 0x8500, 0xfb14, 0x2000 },

+  { 0x0500, 0xfb13, 0x0000 },

+  { 0x0500, 0xfb15, 0x0000 },

+  { 0x8700, 0xfb1d, 0x2000 },

+  { 0x0500, 0xfb17, 0x0000 },

+  { 0x0c00, 0xfb1e, 0x0000 },

+  { 0x8700, 0xfb23, 0x3000 },

+  { 0x8700, 0xfb21, 0x2000 },

+  { 0x0700, 0xfb20, 0x0000 },

+  { 0x0700, 0xfb22, 0x0000 },

+  { 0x8700, 0xfb25, 0x2000 },

+  { 0x0700, 0xfb24, 0x0000 },

+  { 0x0700, 0xfb26, 0x0000 },

+  { 0x8700, 0xfbac, 0x8000 },

+  { 0x8700, 0xfb6c, 0x7000 },

+  { 0x8700, 0xfb4c, 0x6000 },

+  { 0x8700, 0xfb38, 0x5000 },

+  { 0x8700, 0xfb2f, 0x4000 },

+  { 0x8700, 0xfb2b, 0x3000 },

+  { 0x9900, 0xfb29, 0x2000 },

+  { 0x0700, 0xfb28, 0x0000 },

+  { 0x0700, 0xfb2a, 0x0000 },

+  { 0x8700, 0xfb2d, 0x2000 },

+  { 0x0700, 0xfb2c, 0x0000 },

+  { 0x0700, 0xfb2e, 0x0000 },

+  { 0x8700, 0xfb33, 0x3000 },

+  { 0x8700, 0xfb31, 0x2000 },

+  { 0x0700, 0xfb30, 0x0000 },

+  { 0x0700, 0xfb32, 0x0000 },

+  { 0x8700, 0xfb35, 0x2000 },

+  { 0x0700, 0xfb34, 0x0000 },

+  { 0x0700, 0xfb36, 0x0000 },

+  { 0x8700, 0xfb43, 0x4000 },

+  { 0x8700, 0xfb3c, 0x3000 },

+  { 0x8700, 0xfb3a, 0x2000 },

+  { 0x0700, 0xfb39, 0x0000 },

+  { 0x0700, 0xfb3b, 0x0000 },

+  { 0x8700, 0xfb40, 0x2000 },

+  { 0x0700, 0xfb3e, 0x0000 },

+  { 0x0700, 0xfb41, 0x0000 },

+  { 0x8700, 0xfb48, 0x3000 },

+  { 0x8700, 0xfb46, 0x2000 },

+  { 0x0700, 0xfb44, 0x0000 },

+  { 0x0700, 0xfb47, 0x0000 },

+  { 0x8700, 0xfb4a, 0x2000 },

+  { 0x0700, 0xfb49, 0x0000 },

+  { 0x0700, 0xfb4b, 0x0000 },

+  { 0x8700, 0xfb5c, 0x5000 },

+  { 0x8700, 0xfb54, 0x4000 },

+  { 0x8700, 0xfb50, 0x3000 },

+  { 0x8700, 0xfb4e, 0x2000 },

+  { 0x0700, 0xfb4d, 0x0000 },

+  { 0x0700, 0xfb4f, 0x0000 },

+  { 0x8700, 0xfb52, 0x2000 },

+  { 0x0700, 0xfb51, 0x0000 },

+  { 0x0700, 0xfb53, 0x0000 },

+  { 0x8700, 0xfb58, 0x3000 },

+  { 0x8700, 0xfb56, 0x2000 },

+  { 0x0700, 0xfb55, 0x0000 },

+  { 0x0700, 0xfb57, 0x0000 },

+  { 0x8700, 0xfb5a, 0x2000 },

+  { 0x0700, 0xfb59, 0x0000 },

+  { 0x0700, 0xfb5b, 0x0000 },

+  { 0x8700, 0xfb64, 0x4000 },

+  { 0x8700, 0xfb60, 0x3000 },

+  { 0x8700, 0xfb5e, 0x2000 },

+  { 0x0700, 0xfb5d, 0x0000 },

+  { 0x0700, 0xfb5f, 0x0000 },

+  { 0x8700, 0xfb62, 0x2000 },

+  { 0x0700, 0xfb61, 0x0000 },

+  { 0x0700, 0xfb63, 0x0000 },

+  { 0x8700, 0xfb68, 0x3000 },

+  { 0x8700, 0xfb66, 0x2000 },

+  { 0x0700, 0xfb65, 0x0000 },

+  { 0x0700, 0xfb67, 0x0000 },

+  { 0x8700, 0xfb6a, 0x2000 },

+  { 0x0700, 0xfb69, 0x0000 },

+  { 0x0700, 0xfb6b, 0x0000 },

+  { 0x8700, 0xfb8c, 0x6000 },

+  { 0x8700, 0xfb7c, 0x5000 },

+  { 0x8700, 0xfb74, 0x4000 },

+  { 0x8700, 0xfb70, 0x3000 },

+  { 0x8700, 0xfb6e, 0x2000 },

+  { 0x0700, 0xfb6d, 0x0000 },

+  { 0x0700, 0xfb6f, 0x0000 },

+  { 0x8700, 0xfb72, 0x2000 },

+  { 0x0700, 0xfb71, 0x0000 },

+  { 0x0700, 0xfb73, 0x0000 },

+  { 0x8700, 0xfb78, 0x3000 },

+  { 0x8700, 0xfb76, 0x2000 },

+  { 0x0700, 0xfb75, 0x0000 },

+  { 0x0700, 0xfb77, 0x0000 },

+  { 0x8700, 0xfb7a, 0x2000 },

+  { 0x0700, 0xfb79, 0x0000 },

+  { 0x0700, 0xfb7b, 0x0000 },

+  { 0x8700, 0xfb84, 0x4000 },

+  { 0x8700, 0xfb80, 0x3000 },

+  { 0x8700, 0xfb7e, 0x2000 },

+  { 0x0700, 0xfb7d, 0x0000 },

+  { 0x0700, 0xfb7f, 0x0000 },

+  { 0x8700, 0xfb82, 0x2000 },

+  { 0x0700, 0xfb81, 0x0000 },

+  { 0x0700, 0xfb83, 0x0000 },

+  { 0x8700, 0xfb88, 0x3000 },

+  { 0x8700, 0xfb86, 0x2000 },

+  { 0x0700, 0xfb85, 0x0000 },

+  { 0x0700, 0xfb87, 0x0000 },

+  { 0x8700, 0xfb8a, 0x2000 },

+  { 0x0700, 0xfb89, 0x0000 },

+  { 0x0700, 0xfb8b, 0x0000 },

+  { 0x8700, 0xfb9c, 0x5000 },

+  { 0x8700, 0xfb94, 0x4000 },

+  { 0x8700, 0xfb90, 0x3000 },

+  { 0x8700, 0xfb8e, 0x2000 },

+  { 0x0700, 0xfb8d, 0x0000 },

+  { 0x0700, 0xfb8f, 0x0000 },

+  { 0x8700, 0xfb92, 0x2000 },

+  { 0x0700, 0xfb91, 0x0000 },

+  { 0x0700, 0xfb93, 0x0000 },

+  { 0x8700, 0xfb98, 0x3000 },

+  { 0x8700, 0xfb96, 0x2000 },

+  { 0x0700, 0xfb95, 0x0000 },

+  { 0x0700, 0xfb97, 0x0000 },

+  { 0x8700, 0xfb9a, 0x2000 },

+  { 0x0700, 0xfb99, 0x0000 },

+  { 0x0700, 0xfb9b, 0x0000 },

+  { 0x8700, 0xfba4, 0x4000 },

+  { 0x8700, 0xfba0, 0x3000 },

+  { 0x8700, 0xfb9e, 0x2000 },

+  { 0x0700, 0xfb9d, 0x0000 },

+  { 0x0700, 0xfb9f, 0x0000 },

+  { 0x8700, 0xfba2, 0x2000 },

+  { 0x0700, 0xfba1, 0x0000 },

+  { 0x0700, 0xfba3, 0x0000 },

+  { 0x8700, 0xfba8, 0x3000 },

+  { 0x8700, 0xfba6, 0x2000 },

+  { 0x0700, 0xfba5, 0x0000 },

+  { 0x0700, 0xfba7, 0x0000 },

+  { 0x8700, 0xfbaa, 0x2000 },

+  { 0x0700, 0xfba9, 0x0000 },

+  { 0x0700, 0xfbab, 0x0000 },

+  { 0x8700, 0xfc0d, 0x7000 },

+  { 0x8700, 0xfbed, 0x6000 },

+  { 0x8700, 0xfbdd, 0x5000 },

+  { 0x8700, 0xfbd5, 0x4000 },

+  { 0x8700, 0xfbb0, 0x3000 },

+  { 0x8700, 0xfbae, 0x2000 },

+  { 0x0700, 0xfbad, 0x0000 },

+  { 0x0700, 0xfbaf, 0x0000 },

+  { 0x8700, 0xfbd3, 0x2000 },

+  { 0x0700, 0xfbb1, 0x0000 },

+  { 0x0700, 0xfbd4, 0x0000 },

+  { 0x8700, 0xfbd9, 0x3000 },

+  { 0x8700, 0xfbd7, 0x2000 },

+  { 0x0700, 0xfbd6, 0x0000 },

+  { 0x0700, 0xfbd8, 0x0000 },

+  { 0x8700, 0xfbdb, 0x2000 },

+  { 0x0700, 0xfbda, 0x0000 },

+  { 0x0700, 0xfbdc, 0x0000 },

+  { 0x8700, 0xfbe5, 0x4000 },

+  { 0x8700, 0xfbe1, 0x3000 },

+  { 0x8700, 0xfbdf, 0x2000 },

+  { 0x0700, 0xfbde, 0x0000 },

+  { 0x0700, 0xfbe0, 0x0000 },

+  { 0x8700, 0xfbe3, 0x2000 },

+  { 0x0700, 0xfbe2, 0x0000 },

+  { 0x0700, 0xfbe4, 0x0000 },

+  { 0x8700, 0xfbe9, 0x3000 },

+  { 0x8700, 0xfbe7, 0x2000 },

+  { 0x0700, 0xfbe6, 0x0000 },

+  { 0x0700, 0xfbe8, 0x0000 },

+  { 0x8700, 0xfbeb, 0x2000 },

+  { 0x0700, 0xfbea, 0x0000 },

+  { 0x0700, 0xfbec, 0x0000 },

+  { 0x8700, 0xfbfd, 0x5000 },

+  { 0x8700, 0xfbf5, 0x4000 },

+  { 0x8700, 0xfbf1, 0x3000 },

+  { 0x8700, 0xfbef, 0x2000 },

+  { 0x0700, 0xfbee, 0x0000 },

+  { 0x0700, 0xfbf0, 0x0000 },

+  { 0x8700, 0xfbf3, 0x2000 },

+  { 0x0700, 0xfbf2, 0x0000 },

+  { 0x0700, 0xfbf4, 0x0000 },

+  { 0x8700, 0xfbf9, 0x3000 },

+  { 0x8700, 0xfbf7, 0x2000 },

+  { 0x0700, 0xfbf6, 0x0000 },

+  { 0x0700, 0xfbf8, 0x0000 },

+  { 0x8700, 0xfbfb, 0x2000 },

+  { 0x0700, 0xfbfa, 0x0000 },

+  { 0x0700, 0xfbfc, 0x0000 },

+  { 0x8700, 0xfc05, 0x4000 },

+  { 0x8700, 0xfc01, 0x3000 },

+  { 0x8700, 0xfbff, 0x2000 },

+  { 0x0700, 0xfbfe, 0x0000 },

+  { 0x0700, 0xfc00, 0x0000 },

+  { 0x8700, 0xfc03, 0x2000 },

+  { 0x0700, 0xfc02, 0x0000 },

+  { 0x0700, 0xfc04, 0x0000 },

+  { 0x8700, 0xfc09, 0x3000 },

+  { 0x8700, 0xfc07, 0x2000 },

+  { 0x0700, 0xfc06, 0x0000 },

+  { 0x0700, 0xfc08, 0x0000 },

+  { 0x8700, 0xfc0b, 0x2000 },

+  { 0x0700, 0xfc0a, 0x0000 },

+  { 0x0700, 0xfc0c, 0x0000 },

+  { 0x8700, 0xfc2d, 0x6000 },

+  { 0x8700, 0xfc1d, 0x5000 },

+  { 0x8700, 0xfc15, 0x4000 },

+  { 0x8700, 0xfc11, 0x3000 },

+  { 0x8700, 0xfc0f, 0x2000 },

+  { 0x0700, 0xfc0e, 0x0000 },

+  { 0x0700, 0xfc10, 0x0000 },

+  { 0x8700, 0xfc13, 0x2000 },

+  { 0x0700, 0xfc12, 0x0000 },

+  { 0x0700, 0xfc14, 0x0000 },

+  { 0x8700, 0xfc19, 0x3000 },

+  { 0x8700, 0xfc17, 0x2000 },

+  { 0x0700, 0xfc16, 0x0000 },

+  { 0x0700, 0xfc18, 0x0000 },

+  { 0x8700, 0xfc1b, 0x2000 },

+  { 0x0700, 0xfc1a, 0x0000 },

+  { 0x0700, 0xfc1c, 0x0000 },

+  { 0x8700, 0xfc25, 0x4000 },

+  { 0x8700, 0xfc21, 0x3000 },

+  { 0x8700, 0xfc1f, 0x2000 },

+  { 0x0700, 0xfc1e, 0x0000 },

+  { 0x0700, 0xfc20, 0x0000 },

+  { 0x8700, 0xfc23, 0x2000 },

+  { 0x0700, 0xfc22, 0x0000 },

+  { 0x0700, 0xfc24, 0x0000 },

+  { 0x8700, 0xfc29, 0x3000 },

+  { 0x8700, 0xfc27, 0x2000 },

+  { 0x0700, 0xfc26, 0x0000 },

+  { 0x0700, 0xfc28, 0x0000 },

+  { 0x8700, 0xfc2b, 0x2000 },

+  { 0x0700, 0xfc2a, 0x0000 },

+  { 0x0700, 0xfc2c, 0x0000 },

+  { 0x8700, 0xfc3d, 0x5000 },

+  { 0x8700, 0xfc35, 0x4000 },

+  { 0x8700, 0xfc31, 0x3000 },

+  { 0x8700, 0xfc2f, 0x2000 },

+  { 0x0700, 0xfc2e, 0x0000 },

+  { 0x0700, 0xfc30, 0x0000 },

+  { 0x8700, 0xfc33, 0x2000 },

+  { 0x0700, 0xfc32, 0x0000 },

+  { 0x0700, 0xfc34, 0x0000 },

+  { 0x8700, 0xfc39, 0x3000 },

+  { 0x8700, 0xfc37, 0x2000 },

+  { 0x0700, 0xfc36, 0x0000 },

+  { 0x0700, 0xfc38, 0x0000 },

+  { 0x8700, 0xfc3b, 0x2000 },

+  { 0x0700, 0xfc3a, 0x0000 },

+  { 0x0700, 0xfc3c, 0x0000 },

+  { 0x8700, 0xfc45, 0x4000 },

+  { 0x8700, 0xfc41, 0x3000 },

+  { 0x8700, 0xfc3f, 0x2000 },

+  { 0x0700, 0xfc3e, 0x0000 },

+  { 0x0700, 0xfc40, 0x0000 },

+  { 0x8700, 0xfc43, 0x2000 },

+  { 0x0700, 0xfc42, 0x0000 },

+  { 0x0700, 0xfc44, 0x0000 },

+  { 0x8700, 0xfc49, 0x3000 },

+  { 0x8700, 0xfc47, 0x2000 },

+  { 0x0700, 0xfc46, 0x0000 },

+  { 0x0700, 0xfc48, 0x0000 },

+  { 0x8700, 0xfc4b, 0x2000 },

+  { 0x0700, 0xfc4a, 0x0000 },

+  { 0x0700, 0xfc4c, 0x0000 },

+  { 0x8700, 0xfeac, 0xa000 },

+  { 0x8700, 0xfd5d, 0x9000 },

+  { 0x8700, 0xfccd, 0x8000 },

+  { 0x8700, 0xfc8d, 0x7000 },

+  { 0x8700, 0xfc6d, 0x6000 },

+  { 0x8700, 0xfc5d, 0x5000 },

+  { 0x8700, 0xfc55, 0x4000 },

+  { 0x8700, 0xfc51, 0x3000 },

+  { 0x8700, 0xfc4f, 0x2000 },

+  { 0x0700, 0xfc4e, 0x0000 },

+  { 0x0700, 0xfc50, 0x0000 },

+  { 0x8700, 0xfc53, 0x2000 },

+  { 0x0700, 0xfc52, 0x0000 },

+  { 0x0700, 0xfc54, 0x0000 },

+  { 0x8700, 0xfc59, 0x3000 },

+  { 0x8700, 0xfc57, 0x2000 },

+  { 0x0700, 0xfc56, 0x0000 },

+  { 0x0700, 0xfc58, 0x0000 },

+  { 0x8700, 0xfc5b, 0x2000 },

+  { 0x0700, 0xfc5a, 0x0000 },

+  { 0x0700, 0xfc5c, 0x0000 },

+  { 0x8700, 0xfc65, 0x4000 },

+  { 0x8700, 0xfc61, 0x3000 },

+  { 0x8700, 0xfc5f, 0x2000 },

+  { 0x0700, 0xfc5e, 0x0000 },

+  { 0x0700, 0xfc60, 0x0000 },

+  { 0x8700, 0xfc63, 0x2000 },

+  { 0x0700, 0xfc62, 0x0000 },

+  { 0x0700, 0xfc64, 0x0000 },

+  { 0x8700, 0xfc69, 0x3000 },

+  { 0x8700, 0xfc67, 0x2000 },

+  { 0x0700, 0xfc66, 0x0000 },

+  { 0x0700, 0xfc68, 0x0000 },

+  { 0x8700, 0xfc6b, 0x2000 },

+  { 0x0700, 0xfc6a, 0x0000 },

+  { 0x0700, 0xfc6c, 0x0000 },

+  { 0x8700, 0xfc7d, 0x5000 },

+  { 0x8700, 0xfc75, 0x4000 },

+  { 0x8700, 0xfc71, 0x3000 },

+  { 0x8700, 0xfc6f, 0x2000 },

+  { 0x0700, 0xfc6e, 0x0000 },

+  { 0x0700, 0xfc70, 0x0000 },

+  { 0x8700, 0xfc73, 0x2000 },

+  { 0x0700, 0xfc72, 0x0000 },

+  { 0x0700, 0xfc74, 0x0000 },

+  { 0x8700, 0xfc79, 0x3000 },

+  { 0x8700, 0xfc77, 0x2000 },

+  { 0x0700, 0xfc76, 0x0000 },

+  { 0x0700, 0xfc78, 0x0000 },

+  { 0x8700, 0xfc7b, 0x2000 },

+  { 0x0700, 0xfc7a, 0x0000 },

+  { 0x0700, 0xfc7c, 0x0000 },

+  { 0x8700, 0xfc85, 0x4000 },

+  { 0x8700, 0xfc81, 0x3000 },

+  { 0x8700, 0xfc7f, 0x2000 },

+  { 0x0700, 0xfc7e, 0x0000 },

+  { 0x0700, 0xfc80, 0x0000 },

+  { 0x8700, 0xfc83, 0x2000 },

+  { 0x0700, 0xfc82, 0x0000 },

+  { 0x0700, 0xfc84, 0x0000 },

+  { 0x8700, 0xfc89, 0x3000 },

+  { 0x8700, 0xfc87, 0x2000 },

+  { 0x0700, 0xfc86, 0x0000 },

+  { 0x0700, 0xfc88, 0x0000 },

+  { 0x8700, 0xfc8b, 0x2000 },

+  { 0x0700, 0xfc8a, 0x0000 },

+  { 0x0700, 0xfc8c, 0x0000 },

+  { 0x8700, 0xfcad, 0x6000 },

+  { 0x8700, 0xfc9d, 0x5000 },

+  { 0x8700, 0xfc95, 0x4000 },

+  { 0x8700, 0xfc91, 0x3000 },

+  { 0x8700, 0xfc8f, 0x2000 },

+  { 0x0700, 0xfc8e, 0x0000 },

+  { 0x0700, 0xfc90, 0x0000 },

+  { 0x8700, 0xfc93, 0x2000 },

+  { 0x0700, 0xfc92, 0x0000 },

+  { 0x0700, 0xfc94, 0x0000 },

+  { 0x8700, 0xfc99, 0x3000 },

+  { 0x8700, 0xfc97, 0x2000 },

+  { 0x0700, 0xfc96, 0x0000 },

+  { 0x0700, 0xfc98, 0x0000 },

+  { 0x8700, 0xfc9b, 0x2000 },

+  { 0x0700, 0xfc9a, 0x0000 },

+  { 0x0700, 0xfc9c, 0x0000 },

+  { 0x8700, 0xfca5, 0x4000 },

+  { 0x8700, 0xfca1, 0x3000 },

+  { 0x8700, 0xfc9f, 0x2000 },

+  { 0x0700, 0xfc9e, 0x0000 },

+  { 0x0700, 0xfca0, 0x0000 },

+  { 0x8700, 0xfca3, 0x2000 },

+  { 0x0700, 0xfca2, 0x0000 },

+  { 0x0700, 0xfca4, 0x0000 },

+  { 0x8700, 0xfca9, 0x3000 },

+  { 0x8700, 0xfca7, 0x2000 },

+  { 0x0700, 0xfca6, 0x0000 },

+  { 0x0700, 0xfca8, 0x0000 },

+  { 0x8700, 0xfcab, 0x2000 },

+  { 0x0700, 0xfcaa, 0x0000 },

+  { 0x0700, 0xfcac, 0x0000 },

+  { 0x8700, 0xfcbd, 0x5000 },

+  { 0x8700, 0xfcb5, 0x4000 },

+  { 0x8700, 0xfcb1, 0x3000 },

+  { 0x8700, 0xfcaf, 0x2000 },

+  { 0x0700, 0xfcae, 0x0000 },

+  { 0x0700, 0xfcb0, 0x0000 },

+  { 0x8700, 0xfcb3, 0x2000 },

+  { 0x0700, 0xfcb2, 0x0000 },

+  { 0x0700, 0xfcb4, 0x0000 },

+  { 0x8700, 0xfcb9, 0x3000 },

+  { 0x8700, 0xfcb7, 0x2000 },

+  { 0x0700, 0xfcb6, 0x0000 },

+  { 0x0700, 0xfcb8, 0x0000 },

+  { 0x8700, 0xfcbb, 0x2000 },

+  { 0x0700, 0xfcba, 0x0000 },

+  { 0x0700, 0xfcbc, 0x0000 },

+  { 0x8700, 0xfcc5, 0x4000 },

+  { 0x8700, 0xfcc1, 0x3000 },

+  { 0x8700, 0xfcbf, 0x2000 },

+  { 0x0700, 0xfcbe, 0x0000 },

+  { 0x0700, 0xfcc0, 0x0000 },

+  { 0x8700, 0xfcc3, 0x2000 },

+  { 0x0700, 0xfcc2, 0x0000 },

+  { 0x0700, 0xfcc4, 0x0000 },

+  { 0x8700, 0xfcc9, 0x3000 },

+  { 0x8700, 0xfcc7, 0x2000 },

+  { 0x0700, 0xfcc6, 0x0000 },

+  { 0x0700, 0xfcc8, 0x0000 },

+  { 0x8700, 0xfccb, 0x2000 },

+  { 0x0700, 0xfcca, 0x0000 },

+  { 0x0700, 0xfccc, 0x0000 },

+  { 0x8700, 0xfd0d, 0x7000 },

+  { 0x8700, 0xfced, 0x6000 },

+  { 0x8700, 0xfcdd, 0x5000 },

+  { 0x8700, 0xfcd5, 0x4000 },

+  { 0x8700, 0xfcd1, 0x3000 },

+  { 0x8700, 0xfccf, 0x2000 },

+  { 0x0700, 0xfcce, 0x0000 },

+  { 0x0700, 0xfcd0, 0x0000 },

+  { 0x8700, 0xfcd3, 0x2000 },

+  { 0x0700, 0xfcd2, 0x0000 },

+  { 0x0700, 0xfcd4, 0x0000 },

+  { 0x8700, 0xfcd9, 0x3000 },

+  { 0x8700, 0xfcd7, 0x2000 },

+  { 0x0700, 0xfcd6, 0x0000 },

+  { 0x0700, 0xfcd8, 0x0000 },

+  { 0x8700, 0xfcdb, 0x2000 },

+  { 0x0700, 0xfcda, 0x0000 },

+  { 0x0700, 0xfcdc, 0x0000 },

+  { 0x8700, 0xfce5, 0x4000 },

+  { 0x8700, 0xfce1, 0x3000 },

+  { 0x8700, 0xfcdf, 0x2000 },

+  { 0x0700, 0xfcde, 0x0000 },

+  { 0x0700, 0xfce0, 0x0000 },

+  { 0x8700, 0xfce3, 0x2000 },

+  { 0x0700, 0xfce2, 0x0000 },

+  { 0x0700, 0xfce4, 0x0000 },

+  { 0x8700, 0xfce9, 0x3000 },

+  { 0x8700, 0xfce7, 0x2000 },

+  { 0x0700, 0xfce6, 0x0000 },

+  { 0x0700, 0xfce8, 0x0000 },

+  { 0x8700, 0xfceb, 0x2000 },

+  { 0x0700, 0xfcea, 0x0000 },

+  { 0x0700, 0xfcec, 0x0000 },

+  { 0x8700, 0xfcfd, 0x5000 },

+  { 0x8700, 0xfcf5, 0x4000 },

+  { 0x8700, 0xfcf1, 0x3000 },

+  { 0x8700, 0xfcef, 0x2000 },

+  { 0x0700, 0xfcee, 0x0000 },

+  { 0x0700, 0xfcf0, 0x0000 },

+  { 0x8700, 0xfcf3, 0x2000 },

+  { 0x0700, 0xfcf2, 0x0000 },

+  { 0x0700, 0xfcf4, 0x0000 },

+  { 0x8700, 0xfcf9, 0x3000 },

+  { 0x8700, 0xfcf7, 0x2000 },

+  { 0x0700, 0xfcf6, 0x0000 },

+  { 0x0700, 0xfcf8, 0x0000 },

+  { 0x8700, 0xfcfb, 0x2000 },

+  { 0x0700, 0xfcfa, 0x0000 },

+  { 0x0700, 0xfcfc, 0x0000 },

+  { 0x8700, 0xfd05, 0x4000 },

+  { 0x8700, 0xfd01, 0x3000 },

+  { 0x8700, 0xfcff, 0x2000 },

+  { 0x0700, 0xfcfe, 0x0000 },

+  { 0x0700, 0xfd00, 0x0000 },

+  { 0x8700, 0xfd03, 0x2000 },

+  { 0x0700, 0xfd02, 0x0000 },

+  { 0x0700, 0xfd04, 0x0000 },

+  { 0x8700, 0xfd09, 0x3000 },

+  { 0x8700, 0xfd07, 0x2000 },

+  { 0x0700, 0xfd06, 0x0000 },

+  { 0x0700, 0xfd08, 0x0000 },

+  { 0x8700, 0xfd0b, 0x2000 },

+  { 0x0700, 0xfd0a, 0x0000 },

+  { 0x0700, 0xfd0c, 0x0000 },

+  { 0x8700, 0xfd2d, 0x6000 },

+  { 0x8700, 0xfd1d, 0x5000 },

+  { 0x8700, 0xfd15, 0x4000 },

+  { 0x8700, 0xfd11, 0x3000 },

+  { 0x8700, 0xfd0f, 0x2000 },

+  { 0x0700, 0xfd0e, 0x0000 },

+  { 0x0700, 0xfd10, 0x0000 },

+  { 0x8700, 0xfd13, 0x2000 },

+  { 0x0700, 0xfd12, 0x0000 },

+  { 0x0700, 0xfd14, 0x0000 },

+  { 0x8700, 0xfd19, 0x3000 },

+  { 0x8700, 0xfd17, 0x2000 },

+  { 0x0700, 0xfd16, 0x0000 },

+  { 0x0700, 0xfd18, 0x0000 },

+  { 0x8700, 0xfd1b, 0x2000 },

+  { 0x0700, 0xfd1a, 0x0000 },

+  { 0x0700, 0xfd1c, 0x0000 },

+  { 0x8700, 0xfd25, 0x4000 },

+  { 0x8700, 0xfd21, 0x3000 },

+  { 0x8700, 0xfd1f, 0x2000 },

+  { 0x0700, 0xfd1e, 0x0000 },

+  { 0x0700, 0xfd20, 0x0000 },

+  { 0x8700, 0xfd23, 0x2000 },

+  { 0x0700, 0xfd22, 0x0000 },

+  { 0x0700, 0xfd24, 0x0000 },

+  { 0x8700, 0xfd29, 0x3000 },

+  { 0x8700, 0xfd27, 0x2000 },

+  { 0x0700, 0xfd26, 0x0000 },

+  { 0x0700, 0xfd28, 0x0000 },

+  { 0x8700, 0xfd2b, 0x2000 },

+  { 0x0700, 0xfd2a, 0x0000 },

+  { 0x0700, 0xfd2c, 0x0000 },

+  { 0x8700, 0xfd3d, 0x5000 },

+  { 0x8700, 0xfd35, 0x4000 },

+  { 0x8700, 0xfd31, 0x3000 },

+  { 0x8700, 0xfd2f, 0x2000 },

+  { 0x0700, 0xfd2e, 0x0000 },

+  { 0x0700, 0xfd30, 0x0000 },

+  { 0x8700, 0xfd33, 0x2000 },

+  { 0x0700, 0xfd32, 0x0000 },

+  { 0x0700, 0xfd34, 0x0000 },

+  { 0x8700, 0xfd39, 0x3000 },

+  { 0x8700, 0xfd37, 0x2000 },

+  { 0x0700, 0xfd36, 0x0000 },

+  { 0x0700, 0xfd38, 0x0000 },

+  { 0x8700, 0xfd3b, 0x2000 },

+  { 0x0700, 0xfd3a, 0x0000 },

+  { 0x0700, 0xfd3c, 0x0000 },

+  { 0x8700, 0xfd55, 0x4000 },

+  { 0x8700, 0xfd51, 0x3000 },

+  { 0x9200, 0xfd3f, 0x2000 },

+  { 0x1600, 0xfd3e, 0x0000 },

+  { 0x0700, 0xfd50, 0x0000 },

+  { 0x8700, 0xfd53, 0x2000 },

+  { 0x0700, 0xfd52, 0x0000 },

+  { 0x0700, 0xfd54, 0x0000 },

+  { 0x8700, 0xfd59, 0x3000 },

+  { 0x8700, 0xfd57, 0x2000 },

+  { 0x0700, 0xfd56, 0x0000 },

+  { 0x0700, 0xfd58, 0x0000 },

+  { 0x8700, 0xfd5b, 0x2000 },

+  { 0x0700, 0xfd5a, 0x0000 },

+  { 0x0700, 0xfd5c, 0x0000 },

+  { 0x8c00, 0xfe09, 0x8000 },

+  { 0x8700, 0xfd9f, 0x7000 },

+  { 0x8700, 0xfd7d, 0x6000 },

+  { 0x8700, 0xfd6d, 0x5000 },

+  { 0x8700, 0xfd65, 0x4000 },

+  { 0x8700, 0xfd61, 0x3000 },

+  { 0x8700, 0xfd5f, 0x2000 },

+  { 0x0700, 0xfd5e, 0x0000 },

+  { 0x0700, 0xfd60, 0x0000 },

+  { 0x8700, 0xfd63, 0x2000 },

+  { 0x0700, 0xfd62, 0x0000 },

+  { 0x0700, 0xfd64, 0x0000 },

+  { 0x8700, 0xfd69, 0x3000 },

+  { 0x8700, 0xfd67, 0x2000 },

+  { 0x0700, 0xfd66, 0x0000 },

+  { 0x0700, 0xfd68, 0x0000 },

+  { 0x8700, 0xfd6b, 0x2000 },

+  { 0x0700, 0xfd6a, 0x0000 },

+  { 0x0700, 0xfd6c, 0x0000 },

+  { 0x8700, 0xfd75, 0x4000 },

+  { 0x8700, 0xfd71, 0x3000 },

+  { 0x8700, 0xfd6f, 0x2000 },

+  { 0x0700, 0xfd6e, 0x0000 },

+  { 0x0700, 0xfd70, 0x0000 },

+  { 0x8700, 0xfd73, 0x2000 },

+  { 0x0700, 0xfd72, 0x0000 },

+  { 0x0700, 0xfd74, 0x0000 },

+  { 0x8700, 0xfd79, 0x3000 },

+  { 0x8700, 0xfd77, 0x2000 },

+  { 0x0700, 0xfd76, 0x0000 },

+  { 0x0700, 0xfd78, 0x0000 },

+  { 0x8700, 0xfd7b, 0x2000 },

+  { 0x0700, 0xfd7a, 0x0000 },

+  { 0x0700, 0xfd7c, 0x0000 },

+  { 0x8700, 0xfd8d, 0x5000 },

+  { 0x8700, 0xfd85, 0x4000 },

+  { 0x8700, 0xfd81, 0x3000 },

+  { 0x8700, 0xfd7f, 0x2000 },

+  { 0x0700, 0xfd7e, 0x0000 },

+  { 0x0700, 0xfd80, 0x0000 },

+  { 0x8700, 0xfd83, 0x2000 },

+  { 0x0700, 0xfd82, 0x0000 },

+  { 0x0700, 0xfd84, 0x0000 },

+  { 0x8700, 0xfd89, 0x3000 },

+  { 0x8700, 0xfd87, 0x2000 },

+  { 0x0700, 0xfd86, 0x0000 },

+  { 0x0700, 0xfd88, 0x0000 },

+  { 0x8700, 0xfd8b, 0x2000 },

+  { 0x0700, 0xfd8a, 0x0000 },

+  { 0x0700, 0xfd8c, 0x0000 },

+  { 0x8700, 0xfd97, 0x4000 },

+  { 0x8700, 0xfd93, 0x3000 },

+  { 0x8700, 0xfd8f, 0x2000 },

+  { 0x0700, 0xfd8e, 0x0000 },

+  { 0x0700, 0xfd92, 0x0000 },

+  { 0x8700, 0xfd95, 0x2000 },

+  { 0x0700, 0xfd94, 0x0000 },

+  { 0x0700, 0xfd96, 0x0000 },

+  { 0x8700, 0xfd9b, 0x3000 },

+  { 0x8700, 0xfd99, 0x2000 },

+  { 0x0700, 0xfd98, 0x0000 },

+  { 0x0700, 0xfd9a, 0x0000 },

+  { 0x8700, 0xfd9d, 0x2000 },

+  { 0x0700, 0xfd9c, 0x0000 },

+  { 0x0700, 0xfd9e, 0x0000 },

+  { 0x8700, 0xfdbf, 0x6000 },

+  { 0x8700, 0xfdaf, 0x5000 },

+  { 0x8700, 0xfda7, 0x4000 },

+  { 0x8700, 0xfda3, 0x3000 },

+  { 0x8700, 0xfda1, 0x2000 },

+  { 0x0700, 0xfda0, 0x0000 },

+  { 0x0700, 0xfda2, 0x0000 },

+  { 0x8700, 0xfda5, 0x2000 },

+  { 0x0700, 0xfda4, 0x0000 },

+  { 0x0700, 0xfda6, 0x0000 },

+  { 0x8700, 0xfdab, 0x3000 },

+  { 0x8700, 0xfda9, 0x2000 },

+  { 0x0700, 0xfda8, 0x0000 },

+  { 0x0700, 0xfdaa, 0x0000 },

+  { 0x8700, 0xfdad, 0x2000 },

+  { 0x0700, 0xfdac, 0x0000 },

+  { 0x0700, 0xfdae, 0x0000 },

+  { 0x8700, 0xfdb7, 0x4000 },

+  { 0x8700, 0xfdb3, 0x3000 },

+  { 0x8700, 0xfdb1, 0x2000 },

+  { 0x0700, 0xfdb0, 0x0000 },

+  { 0x0700, 0xfdb2, 0x0000 },

+  { 0x8700, 0xfdb5, 0x2000 },

+  { 0x0700, 0xfdb4, 0x0000 },

+  { 0x0700, 0xfdb6, 0x0000 },

+  { 0x8700, 0xfdbb, 0x3000 },

+  { 0x8700, 0xfdb9, 0x2000 },

+  { 0x0700, 0xfdb8, 0x0000 },

+  { 0x0700, 0xfdba, 0x0000 },

+  { 0x8700, 0xfdbd, 0x2000 },

+  { 0x0700, 0xfdbc, 0x0000 },

+  { 0x0700, 0xfdbe, 0x0000 },

+  { 0x8700, 0xfdf7, 0x5000 },

+  { 0x8700, 0xfdc7, 0x4000 },

+  { 0x8700, 0xfdc3, 0x3000 },

+  { 0x8700, 0xfdc1, 0x2000 },

+  { 0x0700, 0xfdc0, 0x0000 },

+  { 0x0700, 0xfdc2, 0x0000 },

+  { 0x8700, 0xfdc5, 0x2000 },

+  { 0x0700, 0xfdc4, 0x0000 },

+  { 0x0700, 0xfdc6, 0x0000 },

+  { 0x8700, 0xfdf3, 0x3000 },

+  { 0x8700, 0xfdf1, 0x2000 },

+  { 0x0700, 0xfdf0, 0x0000 },

+  { 0x0700, 0xfdf2, 0x0000 },

+  { 0x8700, 0xfdf5, 0x2000 },

+  { 0x0700, 0xfdf4, 0x0000 },

+  { 0x0700, 0xfdf6, 0x0000 },

+  { 0x8c00, 0xfe01, 0x4000 },

+  { 0x8700, 0xfdfb, 0x3000 },

+  { 0x8700, 0xfdf9, 0x2000 },

+  { 0x0700, 0xfdf8, 0x0000 },

+  { 0x0700, 0xfdfa, 0x0000 },

+  { 0x9a00, 0xfdfd, 0x2000 },

+  { 0x1700, 0xfdfc, 0x0000 },

+  { 0x0c00, 0xfe00, 0x0000 },

+  { 0x8c00, 0xfe05, 0x3000 },

+  { 0x8c00, 0xfe03, 0x2000 },

+  { 0x0c00, 0xfe02, 0x0000 },

+  { 0x0c00, 0xfe04, 0x0000 },

+  { 0x8c00, 0xfe07, 0x2000 },

+  { 0x0c00, 0xfe06, 0x0000 },

+  { 0x0c00, 0xfe08, 0x0000 },

+  { 0x9900, 0xfe66, 0x7000 },

+  { 0x9500, 0xfe45, 0x6000 },

+  { 0x9600, 0xfe35, 0x5000 },

+  { 0x8c00, 0xfe21, 0x4000 },

+  { 0x8c00, 0xfe0d, 0x3000 },

+  { 0x8c00, 0xfe0b, 0x2000 },

+  { 0x0c00, 0xfe0a, 0x0000 },

+  { 0x0c00, 0xfe0c, 0x0000 },

+  { 0x8c00, 0xfe0f, 0x2000 },

+  { 0x0c00, 0xfe0e, 0x0000 },

+  { 0x0c00, 0xfe20, 0x0000 },

+  { 0x9100, 0xfe31, 0x3000 },

+  { 0x8c00, 0xfe23, 0x2000 },

+  { 0x0c00, 0xfe22, 0x0000 },

+  { 0x1500, 0xfe30, 0x0000 },

+  { 0x9000, 0xfe33, 0x2000 },

+  { 0x1100, 0xfe32, 0x0000 },

+  { 0x1000, 0xfe34, 0x0000 },

+  { 0x9600, 0xfe3d, 0x4000 },

+  { 0x9600, 0xfe39, 0x3000 },

+  { 0x9600, 0xfe37, 0x2000 },

+  { 0x1200, 0xfe36, 0x0000 },

+  { 0x1200, 0xfe38, 0x0000 },

+  { 0x9600, 0xfe3b, 0x2000 },

+  { 0x1200, 0xfe3a, 0x0000 },

+  { 0x1200, 0xfe3c, 0x0000 },

+  { 0x9600, 0xfe41, 0x3000 },

+  { 0x9600, 0xfe3f, 0x2000 },

+  { 0x1200, 0xfe3e, 0x0000 },

+  { 0x1200, 0xfe40, 0x0000 },

+  { 0x9600, 0xfe43, 0x2000 },

+  { 0x1200, 0xfe42, 0x0000 },

+  { 0x1200, 0xfe44, 0x0000 },

+  { 0x9500, 0xfe56, 0x5000 },

+  { 0x9000, 0xfe4d, 0x4000 },

+  { 0x9500, 0xfe49, 0x3000 },

+  { 0x9600, 0xfe47, 0x2000 },

+  { 0x1500, 0xfe46, 0x0000 },

+  { 0x1200, 0xfe48, 0x0000 },

+  { 0x9500, 0xfe4b, 0x2000 },

+  { 0x1500, 0xfe4a, 0x0000 },

+  { 0x1500, 0xfe4c, 0x0000 },

+  { 0x9500, 0xfe51, 0x3000 },

+  { 0x9000, 0xfe4f, 0x2000 },

+  { 0x1000, 0xfe4e, 0x0000 },

+  { 0x1500, 0xfe50, 0x0000 },

+  { 0x9500, 0xfe54, 0x2000 },

+  { 0x1500, 0xfe52, 0x0000 },

+  { 0x1500, 0xfe55, 0x0000 },

+  { 0x9200, 0xfe5e, 0x4000 },

+  { 0x9200, 0xfe5a, 0x3000 },

+  { 0x9100, 0xfe58, 0x2000 },

+  { 0x1500, 0xfe57, 0x0000 },

+  { 0x1600, 0xfe59, 0x0000 },

+  { 0x9200, 0xfe5c, 0x2000 },

+  { 0x1600, 0xfe5b, 0x0000 },

+  { 0x1600, 0xfe5d, 0x0000 },

+  { 0x9900, 0xfe62, 0x3000 },

+  { 0x9500, 0xfe60, 0x2000 },

+  { 0x1500, 0xfe5f, 0x0000 },

+  { 0x1500, 0xfe61, 0x0000 },

+  { 0x9900, 0xfe64, 0x2000 },

+  { 0x1100, 0xfe63, 0x0000 },

+  { 0x1900, 0xfe65, 0x0000 },

+  { 0x8700, 0xfe8c, 0x6000 },

+  { 0x8700, 0xfe7c, 0x5000 },

+  { 0x8700, 0xfe73, 0x4000 },

+  { 0x9500, 0xfe6b, 0x3000 },

+  { 0x9700, 0xfe69, 0x2000 },

+  { 0x1500, 0xfe68, 0x0000 },

+  { 0x1500, 0xfe6a, 0x0000 },

+  { 0x8700, 0xfe71, 0x2000 },

+  { 0x0700, 0xfe70, 0x0000 },

+  { 0x0700, 0xfe72, 0x0000 },

+  { 0x8700, 0xfe78, 0x3000 },

+  { 0x8700, 0xfe76, 0x2000 },

+  { 0x0700, 0xfe74, 0x0000 },

+  { 0x0700, 0xfe77, 0x0000 },

+  { 0x8700, 0xfe7a, 0x2000 },

+  { 0x0700, 0xfe79, 0x0000 },

+  { 0x0700, 0xfe7b, 0x0000 },

+  { 0x8700, 0xfe84, 0x4000 },

+  { 0x8700, 0xfe80, 0x3000 },

+  { 0x8700, 0xfe7e, 0x2000 },

+  { 0x0700, 0xfe7d, 0x0000 },

+  { 0x0700, 0xfe7f, 0x0000 },

+  { 0x8700, 0xfe82, 0x2000 },

+  { 0x0700, 0xfe81, 0x0000 },

+  { 0x0700, 0xfe83, 0x0000 },

+  { 0x8700, 0xfe88, 0x3000 },

+  { 0x8700, 0xfe86, 0x2000 },

+  { 0x0700, 0xfe85, 0x0000 },

+  { 0x0700, 0xfe87, 0x0000 },

+  { 0x8700, 0xfe8a, 0x2000 },

+  { 0x0700, 0xfe89, 0x0000 },

+  { 0x0700, 0xfe8b, 0x0000 },

+  { 0x8700, 0xfe9c, 0x5000 },

+  { 0x8700, 0xfe94, 0x4000 },

+  { 0x8700, 0xfe90, 0x3000 },

+  { 0x8700, 0xfe8e, 0x2000 },

+  { 0x0700, 0xfe8d, 0x0000 },

+  { 0x0700, 0xfe8f, 0x0000 },

+  { 0x8700, 0xfe92, 0x2000 },

+  { 0x0700, 0xfe91, 0x0000 },

+  { 0x0700, 0xfe93, 0x0000 },

+  { 0x8700, 0xfe98, 0x3000 },

+  { 0x8700, 0xfe96, 0x2000 },

+  { 0x0700, 0xfe95, 0x0000 },

+  { 0x0700, 0xfe97, 0x0000 },

+  { 0x8700, 0xfe9a, 0x2000 },

+  { 0x0700, 0xfe99, 0x0000 },

+  { 0x0700, 0xfe9b, 0x0000 },

+  { 0x8700, 0xfea4, 0x4000 },

+  { 0x8700, 0xfea0, 0x3000 },

+  { 0x8700, 0xfe9e, 0x2000 },

+  { 0x0700, 0xfe9d, 0x0000 },

+  { 0x0700, 0xfe9f, 0x0000 },

+  { 0x8700, 0xfea2, 0x2000 },

+  { 0x0700, 0xfea1, 0x0000 },

+  { 0x0700, 0xfea3, 0x0000 },

+  { 0x8700, 0xfea8, 0x3000 },

+  { 0x8700, 0xfea6, 0x2000 },

+  { 0x0700, 0xfea5, 0x0000 },

+  { 0x0700, 0xfea7, 0x0000 },

+  { 0x8700, 0xfeaa, 0x2000 },

+  { 0x0700, 0xfea9, 0x0000 },

+  { 0x0700, 0xfeab, 0x0000 },

+  { 0x8700, 0xffaf, 0x9000 },

+  { 0x8900, 0xff2f, 0x8020 },

+  { 0x8700, 0xfeec, 0x7000 },

+  { 0x8700, 0xfecc, 0x6000 },

+  { 0x8700, 0xfebc, 0x5000 },

+  { 0x8700, 0xfeb4, 0x4000 },

+  { 0x8700, 0xfeb0, 0x3000 },

+  { 0x8700, 0xfeae, 0x2000 },

+  { 0x0700, 0xfead, 0x0000 },

+  { 0x0700, 0xfeaf, 0x0000 },

+  { 0x8700, 0xfeb2, 0x2000 },

+  { 0x0700, 0xfeb1, 0x0000 },

+  { 0x0700, 0xfeb3, 0x0000 },

+  { 0x8700, 0xfeb8, 0x3000 },

+  { 0x8700, 0xfeb6, 0x2000 },

+  { 0x0700, 0xfeb5, 0x0000 },

+  { 0x0700, 0xfeb7, 0x0000 },

+  { 0x8700, 0xfeba, 0x2000 },

+  { 0x0700, 0xfeb9, 0x0000 },

+  { 0x0700, 0xfebb, 0x0000 },

+  { 0x8700, 0xfec4, 0x4000 },

+  { 0x8700, 0xfec0, 0x3000 },

+  { 0x8700, 0xfebe, 0x2000 },

+  { 0x0700, 0xfebd, 0x0000 },

+  { 0x0700, 0xfebf, 0x0000 },

+  { 0x8700, 0xfec2, 0x2000 },

+  { 0x0700, 0xfec1, 0x0000 },

+  { 0x0700, 0xfec3, 0x0000 },

+  { 0x8700, 0xfec8, 0x3000 },

+  { 0x8700, 0xfec6, 0x2000 },

+  { 0x0700, 0xfec5, 0x0000 },

+  { 0x0700, 0xfec7, 0x0000 },

+  { 0x8700, 0xfeca, 0x2000 },

+  { 0x0700, 0xfec9, 0x0000 },

+  { 0x0700, 0xfecb, 0x0000 },

+  { 0x8700, 0xfedc, 0x5000 },

+  { 0x8700, 0xfed4, 0x4000 },

+  { 0x8700, 0xfed0, 0x3000 },

+  { 0x8700, 0xfece, 0x2000 },

+  { 0x0700, 0xfecd, 0x0000 },

+  { 0x0700, 0xfecf, 0x0000 },

+  { 0x8700, 0xfed2, 0x2000 },

+  { 0x0700, 0xfed1, 0x0000 },

+  { 0x0700, 0xfed3, 0x0000 },

+  { 0x8700, 0xfed8, 0x3000 },

+  { 0x8700, 0xfed6, 0x2000 },

+  { 0x0700, 0xfed5, 0x0000 },

+  { 0x0700, 0xfed7, 0x0000 },

+  { 0x8700, 0xfeda, 0x2000 },

+  { 0x0700, 0xfed9, 0x0000 },

+  { 0x0700, 0xfedb, 0x0000 },

+  { 0x8700, 0xfee4, 0x4000 },

+  { 0x8700, 0xfee0, 0x3000 },

+  { 0x8700, 0xfede, 0x2000 },

+  { 0x0700, 0xfedd, 0x0000 },

+  { 0x0700, 0xfedf, 0x0000 },

+  { 0x8700, 0xfee2, 0x2000 },

+  { 0x0700, 0xfee1, 0x0000 },

+  { 0x0700, 0xfee3, 0x0000 },

+  { 0x8700, 0xfee8, 0x3000 },

+  { 0x8700, 0xfee6, 0x2000 },

+  { 0x0700, 0xfee5, 0x0000 },

+  { 0x0700, 0xfee7, 0x0000 },

+  { 0x8700, 0xfeea, 0x2000 },

+  { 0x0700, 0xfee9, 0x0000 },

+  { 0x0700, 0xfeeb, 0x0000 },

+  { 0x9500, 0xff0f, 0x6000 },

+  { 0x8700, 0xfefc, 0x5000 },

+  { 0x8700, 0xfef4, 0x4000 },

+  { 0x8700, 0xfef0, 0x3000 },

+  { 0x8700, 0xfeee, 0x2000 },

+  { 0x0700, 0xfeed, 0x0000 },

+  { 0x0700, 0xfeef, 0x0000 },

+  { 0x8700, 0xfef2, 0x2000 },

+  { 0x0700, 0xfef1, 0x0000 },

+  { 0x0700, 0xfef3, 0x0000 },

+  { 0x8700, 0xfef8, 0x3000 },

+  { 0x8700, 0xfef6, 0x2000 },

+  { 0x0700, 0xfef5, 0x0000 },

+  { 0x0700, 0xfef7, 0x0000 },

+  { 0x8700, 0xfefa, 0x2000 },

+  { 0x0700, 0xfef9, 0x0000 },

+  { 0x0700, 0xfefb, 0x0000 },

+  { 0x9500, 0xff07, 0x4000 },

+  { 0x9500, 0xff03, 0x3000 },

+  { 0x9500, 0xff01, 0x2000 },

+  { 0x0100, 0xfeff, 0x0000 },

+  { 0x1500, 0xff02, 0x0000 },

+  { 0x9500, 0xff05, 0x2000 },

+  { 0x1700, 0xff04, 0x0000 },

+  { 0x1500, 0xff06, 0x0000 },

+  { 0x9900, 0xff0b, 0x3000 },

+  { 0x9200, 0xff09, 0x2000 },

+  { 0x1600, 0xff08, 0x0000 },

+  { 0x1500, 0xff0a, 0x0000 },

+  { 0x9100, 0xff0d, 0x2000 },

+  { 0x1500, 0xff0c, 0x0000 },

+  { 0x1500, 0xff0e, 0x0000 },

+  { 0x9500, 0xff1f, 0x5000 },

+  { 0x8d00, 0xff17, 0x4000 },

+  { 0x8d00, 0xff13, 0x3000 },

+  { 0x8d00, 0xff11, 0x2000 },

+  { 0x0d00, 0xff10, 0x0000 },

+  { 0x0d00, 0xff12, 0x0000 },

+  { 0x8d00, 0xff15, 0x2000 },

+  { 0x0d00, 0xff14, 0x0000 },

+  { 0x0d00, 0xff16, 0x0000 },

+  { 0x9500, 0xff1b, 0x3000 },

+  { 0x8d00, 0xff19, 0x2000 },

+  { 0x0d00, 0xff18, 0x0000 },

+  { 0x1500, 0xff1a, 0x0000 },

+  { 0x9900, 0xff1d, 0x2000 },

+  { 0x1900, 0xff1c, 0x0000 },

+  { 0x1900, 0xff1e, 0x0000 },

+  { 0x8900, 0xff27, 0x4020 },

+  { 0x8900, 0xff23, 0x3020 },

+  { 0x8900, 0xff21, 0x2020 },

+  { 0x1500, 0xff20, 0x0000 },

+  { 0x0900, 0xff22, 0x0020 },

+  { 0x8900, 0xff25, 0x2020 },

+  { 0x0900, 0xff24, 0x0020 },

+  { 0x0900, 0xff26, 0x0020 },

+  { 0x8900, 0xff2b, 0x3020 },

+  { 0x8900, 0xff29, 0x2020 },

+  { 0x0900, 0xff28, 0x0020 },

+  { 0x0900, 0xff2a, 0x0020 },

+  { 0x8900, 0xff2d, 0x2020 },

+  { 0x0900, 0xff2c, 0x0020 },

+  { 0x0900, 0xff2e, 0x0020 },

+  { 0x8700, 0xff6f, 0x7000 },

+  { 0x8500, 0xff4f, 0x6fe0 },

+  { 0x9000, 0xff3f, 0x5000 },

+  { 0x8900, 0xff37, 0x4020 },

+  { 0x8900, 0xff33, 0x3020 },

+  { 0x8900, 0xff31, 0x2020 },

+  { 0x0900, 0xff30, 0x0020 },

+  { 0x0900, 0xff32, 0x0020 },

+  { 0x8900, 0xff35, 0x2020 },

+  { 0x0900, 0xff34, 0x0020 },

+  { 0x0900, 0xff36, 0x0020 },

+  { 0x9600, 0xff3b, 0x3000 },

+  { 0x8900, 0xff39, 0x2020 },

+  { 0x0900, 0xff38, 0x0020 },

+  { 0x0900, 0xff3a, 0x0020 },

+  { 0x9200, 0xff3d, 0x2000 },

+  { 0x1500, 0xff3c, 0x0000 },

+  { 0x1800, 0xff3e, 0x0000 },

+  { 0x8500, 0xff47, 0x4fe0 },

+  { 0x8500, 0xff43, 0x3fe0 },

+  { 0x8500, 0xff41, 0x2fe0 },

+  { 0x1800, 0xff40, 0x0000 },

+  { 0x0500, 0xff42, 0x0fe0 },

+  { 0x8500, 0xff45, 0x2fe0 },

+  { 0x0500, 0xff44, 0x0fe0 },

+  { 0x0500, 0xff46, 0x0fe0 },

+  { 0x8500, 0xff4b, 0x3fe0 },

+  { 0x8500, 0xff49, 0x2fe0 },

+  { 0x0500, 0xff48, 0x0fe0 },

+  { 0x0500, 0xff4a, 0x0fe0 },

+  { 0x8500, 0xff4d, 0x2fe0 },

+  { 0x0500, 0xff4c, 0x0fe0 },

+  { 0x0500, 0xff4e, 0x0fe0 },

+  { 0x9600, 0xff5f, 0x5000 },

+  { 0x8500, 0xff57, 0x4fe0 },

+  { 0x8500, 0xff53, 0x3fe0 },

+  { 0x8500, 0xff51, 0x2fe0 },

+  { 0x0500, 0xff50, 0x0fe0 },

+  { 0x0500, 0xff52, 0x0fe0 },

+  { 0x8500, 0xff55, 0x2fe0 },

+  { 0x0500, 0xff54, 0x0fe0 },

+  { 0x0500, 0xff56, 0x0fe0 },

+  { 0x9600, 0xff5b, 0x3000 },

+  { 0x8500, 0xff59, 0x2fe0 },

+  { 0x0500, 0xff58, 0x0fe0 },

+  { 0x0500, 0xff5a, 0x0fe0 },

+  { 0x9200, 0xff5d, 0x2000 },

+  { 0x1900, 0xff5c, 0x0000 },

+  { 0x1900, 0xff5e, 0x0000 },

+  { 0x8700, 0xff67, 0x4000 },

+  { 0x9200, 0xff63, 0x3000 },

+  { 0x9500, 0xff61, 0x2000 },

+  { 0x1200, 0xff60, 0x0000 },

+  { 0x1600, 0xff62, 0x0000 },

+  { 0x9000, 0xff65, 0x2000 },

+  { 0x1500, 0xff64, 0x0000 },

+  { 0x0700, 0xff66, 0x0000 },

+  { 0x8700, 0xff6b, 0x3000 },

+  { 0x8700, 0xff69, 0x2000 },

+  { 0x0700, 0xff68, 0x0000 },

+  { 0x0700, 0xff6a, 0x0000 },

+  { 0x8700, 0xff6d, 0x2000 },

+  { 0x0700, 0xff6c, 0x0000 },

+  { 0x0700, 0xff6e, 0x0000 },

+  { 0x8700, 0xff8f, 0x6000 },

+  { 0x8700, 0xff7f, 0x5000 },

+  { 0x8700, 0xff77, 0x4000 },

+  { 0x8700, 0xff73, 0x3000 },

+  { 0x8700, 0xff71, 0x2000 },

+  { 0x0600, 0xff70, 0x0000 },

+  { 0x0700, 0xff72, 0x0000 },

+  { 0x8700, 0xff75, 0x2000 },

+  { 0x0700, 0xff74, 0x0000 },

+  { 0x0700, 0xff76, 0x0000 },

+  { 0x8700, 0xff7b, 0x3000 },

+  { 0x8700, 0xff79, 0x2000 },

+  { 0x0700, 0xff78, 0x0000 },

+  { 0x0700, 0xff7a, 0x0000 },

+  { 0x8700, 0xff7d, 0x2000 },

+  { 0x0700, 0xff7c, 0x0000 },

+  { 0x0700, 0xff7e, 0x0000 },

+  { 0x8700, 0xff87, 0x4000 },

+  { 0x8700, 0xff83, 0x3000 },

+  { 0x8700, 0xff81, 0x2000 },

+  { 0x0700, 0xff80, 0x0000 },

+  { 0x0700, 0xff82, 0x0000 },

+  { 0x8700, 0xff85, 0x2000 },

+  { 0x0700, 0xff84, 0x0000 },

+  { 0x0700, 0xff86, 0x0000 },

+  { 0x8700, 0xff8b, 0x3000 },

+  { 0x8700, 0xff89, 0x2000 },

+  { 0x0700, 0xff88, 0x0000 },

+  { 0x0700, 0xff8a, 0x0000 },

+  { 0x8700, 0xff8d, 0x2000 },

+  { 0x0700, 0xff8c, 0x0000 },

+  { 0x0700, 0xff8e, 0x0000 },

+  { 0x8600, 0xff9f, 0x5000 },

+  { 0x8700, 0xff97, 0x4000 },

+  { 0x8700, 0xff93, 0x3000 },

+  { 0x8700, 0xff91, 0x2000 },

+  { 0x0700, 0xff90, 0x0000 },

+  { 0x0700, 0xff92, 0x0000 },

+  { 0x8700, 0xff95, 0x2000 },

+  { 0x0700, 0xff94, 0x0000 },

+  { 0x0700, 0xff96, 0x0000 },

+  { 0x8700, 0xff9b, 0x3000 },

+  { 0x8700, 0xff99, 0x2000 },

+  { 0x0700, 0xff98, 0x0000 },

+  { 0x0700, 0xff9a, 0x0000 },

+  { 0x8700, 0xff9d, 0x2000 },

+  { 0x0700, 0xff9c, 0x0000 },

+  { 0x0600, 0xff9e, 0x0000 },

+  { 0x8700, 0xffa7, 0x4000 },

+  { 0x8700, 0xffa3, 0x3000 },

+  { 0x8700, 0xffa1, 0x2000 },

+  { 0x0700, 0xffa0, 0x0000 },

+  { 0x0700, 0xffa2, 0x0000 },

+  { 0x8700, 0xffa5, 0x2000 },

+  { 0x0700, 0xffa4, 0x0000 },

+  { 0x0700, 0xffa6, 0x0000 },

+  { 0x8700, 0xffab, 0x3000 },

+  { 0x8700, 0xffa9, 0x2000 },

+  { 0x0700, 0xffa8, 0x0000 },

+  { 0x0700, 0xffaa, 0x0000 },

+  { 0x8700, 0xffad, 0x2000 },

+  { 0x0700, 0xffac, 0x0000 },

+  { 0x0700, 0xffae, 0x0000 },

+  { 0x8701, 0x004c, 0x8000 },

+  { 0x8701, 0x0008, 0x7000 },

+  { 0x8700, 0xffd6, 0x6000 },

+  { 0x8700, 0xffc2, 0x5000 },

+  { 0x8700, 0xffb7, 0x4000 },

+  { 0x8700, 0xffb3, 0x3000 },

+  { 0x8700, 0xffb1, 0x2000 },

+  { 0x0700, 0xffb0, 0x0000 },

+  { 0x0700, 0xffb2, 0x0000 },

+  { 0x8700, 0xffb5, 0x2000 },

+  { 0x0700, 0xffb4, 0x0000 },

+  { 0x0700, 0xffb6, 0x0000 },

+  { 0x8700, 0xffbb, 0x3000 },

+  { 0x8700, 0xffb9, 0x2000 },

+  { 0x0700, 0xffb8, 0x0000 },

+  { 0x0700, 0xffba, 0x0000 },

+  { 0x8700, 0xffbd, 0x2000 },

+  { 0x0700, 0xffbc, 0x0000 },

+  { 0x0700, 0xffbe, 0x0000 },

+  { 0x8700, 0xffcc, 0x4000 },

+  { 0x8700, 0xffc6, 0x3000 },

+  { 0x8700, 0xffc4, 0x2000 },

+  { 0x0700, 0xffc3, 0x0000 },

+  { 0x0700, 0xffc5, 0x0000 },

+  { 0x8700, 0xffca, 0x2000 },

+  { 0x0700, 0xffc7, 0x0000 },

+  { 0x0700, 0xffcb, 0x0000 },

+  { 0x8700, 0xffd2, 0x3000 },

+  { 0x8700, 0xffce, 0x2000 },

+  { 0x0700, 0xffcd, 0x0000 },

+  { 0x0700, 0xffcf, 0x0000 },

+  { 0x8700, 0xffd4, 0x2000 },

+  { 0x0700, 0xffd3, 0x0000 },

+  { 0x0700, 0xffd5, 0x0000 },

+  { 0x9900, 0xffec, 0x5000 },

+  { 0x9800, 0xffe3, 0x4000 },

+  { 0x8700, 0xffdc, 0x3000 },

+  { 0x8700, 0xffda, 0x2000 },

+  { 0x0700, 0xffd7, 0x0000 },

+  { 0x0700, 0xffdb, 0x0000 },

+  { 0x9700, 0xffe1, 0x2000 },

+  { 0x1700, 0xffe0, 0x0000 },

+  { 0x1900, 0xffe2, 0x0000 },

+  { 0x9a00, 0xffe8, 0x3000 },

+  { 0x9700, 0xffe5, 0x2000 },

+  { 0x1a00, 0xffe4, 0x0000 },

+  { 0x1700, 0xffe6, 0x0000 },

+  { 0x9900, 0xffea, 0x2000 },

+  { 0x1900, 0xffe9, 0x0000 },

+  { 0x1900, 0xffeb, 0x0000 },

+  { 0x8701, 0x0000, 0x4000 },

+  { 0x8100, 0xfffa, 0x3000 },

+  { 0x9a00, 0xffee, 0x2000 },

+  { 0x1a00, 0xffed, 0x0000 },

+  { 0x0100, 0xfff9, 0x0000 },

+  { 0x9a00, 0xfffc, 0x2000 },

+  { 0x0100, 0xfffb, 0x0000 },

+  { 0x1a00, 0xfffd, 0x0000 },

+  { 0x8701, 0x0004, 0x3000 },

+  { 0x8701, 0x0002, 0x2000 },

+  { 0x0701, 0x0001, 0x0000 },

+  { 0x0701, 0x0003, 0x0000 },

+  { 0x8701, 0x0006, 0x2000 },

+  { 0x0701, 0x0005, 0x0000 },

+  { 0x0701, 0x0007, 0x0000 },

+  { 0x8701, 0x002a, 0x6000 },

+  { 0x8701, 0x0019, 0x5000 },

+  { 0x8701, 0x0011, 0x4000 },

+  { 0x8701, 0x000d, 0x3000 },

+  { 0x8701, 0x000a, 0x2000 },

+  { 0x0701, 0x0009, 0x0000 },

+  { 0x0701, 0x000b, 0x0000 },

+  { 0x8701, 0x000f, 0x2000 },

+  { 0x0701, 0x000e, 0x0000 },

+  { 0x0701, 0x0010, 0x0000 },

+  { 0x8701, 0x0015, 0x3000 },

+  { 0x8701, 0x0013, 0x2000 },

+  { 0x0701, 0x0012, 0x0000 },

+  { 0x0701, 0x0014, 0x0000 },

+  { 0x8701, 0x0017, 0x2000 },

+  { 0x0701, 0x0016, 0x0000 },

+  { 0x0701, 0x0018, 0x0000 },

+  { 0x8701, 0x0021, 0x4000 },

+  { 0x8701, 0x001d, 0x3000 },

+  { 0x8701, 0x001b, 0x2000 },

+  { 0x0701, 0x001a, 0x0000 },

+  { 0x0701, 0x001c, 0x0000 },

+  { 0x8701, 0x001f, 0x2000 },

+  { 0x0701, 0x001e, 0x0000 },

+  { 0x0701, 0x0020, 0x0000 },

+  { 0x8701, 0x0025, 0x3000 },

+  { 0x8701, 0x0023, 0x2000 },

+  { 0x0701, 0x0022, 0x0000 },

+  { 0x0701, 0x0024, 0x0000 },

+  { 0x8701, 0x0028, 0x2000 },

+  { 0x0701, 0x0026, 0x0000 },

+  { 0x0701, 0x0029, 0x0000 },

+  { 0x8701, 0x003a, 0x5000 },

+  { 0x8701, 0x0032, 0x4000 },

+  { 0x8701, 0x002e, 0x3000 },

+  { 0x8701, 0x002c, 0x2000 },

+  { 0x0701, 0x002b, 0x0000 },

+  { 0x0701, 0x002d, 0x0000 },

+  { 0x8701, 0x0030, 0x2000 },

+  { 0x0701, 0x002f, 0x0000 },

+  { 0x0701, 0x0031, 0x0000 },

+  { 0x8701, 0x0036, 0x3000 },

+  { 0x8701, 0x0034, 0x2000 },

+  { 0x0701, 0x0033, 0x0000 },

+  { 0x0701, 0x0035, 0x0000 },

+  { 0x8701, 0x0038, 0x2000 },

+  { 0x0701, 0x0037, 0x0000 },

+  { 0x0701, 0x0039, 0x0000 },

+  { 0x8701, 0x0044, 0x4000 },

+  { 0x8701, 0x0040, 0x3000 },

+  { 0x8701, 0x003d, 0x2000 },

+  { 0x0701, 0x003c, 0x0000 },

+  { 0x0701, 0x003f, 0x0000 },

+  { 0x8701, 0x0042, 0x2000 },

+  { 0x0701, 0x0041, 0x0000 },

+  { 0x0701, 0x0043, 0x0000 },

+  { 0x8701, 0x0048, 0x3000 },

+  { 0x8701, 0x0046, 0x2000 },

+  { 0x0701, 0x0045, 0x0000 },

+  { 0x0701, 0x0047, 0x0000 },

+  { 0x8701, 0x004a, 0x2000 },

+  { 0x0701, 0x0049, 0x0000 },

+  { 0x0701, 0x004b, 0x0000 },

+  { 0x8701, 0x00b0, 0x7000 },

+  { 0x8701, 0x0090, 0x6000 },

+  { 0x8701, 0x0080, 0x5000 },

+  { 0x8701, 0x0056, 0x4000 },

+  { 0x8701, 0x0052, 0x3000 },

+  { 0x8701, 0x0050, 0x2000 },

+  { 0x0701, 0x004d, 0x0000 },

+  { 0x0701, 0x0051, 0x0000 },

+  { 0x8701, 0x0054, 0x2000 },

+  { 0x0701, 0x0053, 0x0000 },

+  { 0x0701, 0x0055, 0x0000 },

+  { 0x8701, 0x005a, 0x3000 },

+  { 0x8701, 0x0058, 0x2000 },

+  { 0x0701, 0x0057, 0x0000 },

+  { 0x0701, 0x0059, 0x0000 },

+  { 0x8701, 0x005c, 0x2000 },

+  { 0x0701, 0x005b, 0x0000 },

+  { 0x0701, 0x005d, 0x0000 },

+  { 0x8701, 0x0088, 0x4000 },

+  { 0x8701, 0x0084, 0x3000 },

+  { 0x8701, 0x0082, 0x2000 },

+  { 0x0701, 0x0081, 0x0000 },

+  { 0x0701, 0x0083, 0x0000 },

+  { 0x8701, 0x0086, 0x2000 },

+  { 0x0701, 0x0085, 0x0000 },

+  { 0x0701, 0x0087, 0x0000 },

+  { 0x8701, 0x008c, 0x3000 },

+  { 0x8701, 0x008a, 0x2000 },

+  { 0x0701, 0x0089, 0x0000 },

+  { 0x0701, 0x008b, 0x0000 },

+  { 0x8701, 0x008e, 0x2000 },

+  { 0x0701, 0x008d, 0x0000 },

+  { 0x0701, 0x008f, 0x0000 },

+  { 0x8701, 0x00a0, 0x5000 },

+  { 0x8701, 0x0098, 0x4000 },

+  { 0x8701, 0x0094, 0x3000 },

+  { 0x8701, 0x0092, 0x2000 },

+  { 0x0701, 0x0091, 0x0000 },

+  { 0x0701, 0x0093, 0x0000 },

+  { 0x8701, 0x0096, 0x2000 },

+  { 0x0701, 0x0095, 0x0000 },

+  { 0x0701, 0x0097, 0x0000 },

+  { 0x8701, 0x009c, 0x3000 },

+  { 0x8701, 0x009a, 0x2000 },

+  { 0x0701, 0x0099, 0x0000 },

+  { 0x0701, 0x009b, 0x0000 },

+  { 0x8701, 0x009e, 0x2000 },

+  { 0x0701, 0x009d, 0x0000 },

+  { 0x0701, 0x009f, 0x0000 },

+  { 0x8701, 0x00a8, 0x4000 },

+  { 0x8701, 0x00a4, 0x3000 },

+  { 0x8701, 0x00a2, 0x2000 },

+  { 0x0701, 0x00a1, 0x0000 },

+  { 0x0701, 0x00a3, 0x0000 },

+  { 0x8701, 0x00a6, 0x2000 },

+  { 0x0701, 0x00a5, 0x0000 },

+  { 0x0701, 0x00a7, 0x0000 },

+  { 0x8701, 0x00ac, 0x3000 },

+  { 0x8701, 0x00aa, 0x2000 },

+  { 0x0701, 0x00a9, 0x0000 },

+  { 0x0701, 0x00ab, 0x0000 },

+  { 0x8701, 0x00ae, 0x2000 },

+  { 0x0701, 0x00ad, 0x0000 },

+  { 0x0701, 0x00af, 0x0000 },

+  { 0x8701, 0x00d0, 0x6000 },

+  { 0x8701, 0x00c0, 0x5000 },

+  { 0x8701, 0x00b8, 0x4000 },

+  { 0x8701, 0x00b4, 0x3000 },

+  { 0x8701, 0x00b2, 0x2000 },

+  { 0x0701, 0x00b1, 0x0000 },

+  { 0x0701, 0x00b3, 0x0000 },

+  { 0x8701, 0x00b6, 0x2000 },

+  { 0x0701, 0x00b5, 0x0000 },

+  { 0x0701, 0x00b7, 0x0000 },

+  { 0x8701, 0x00bc, 0x3000 },

+  { 0x8701, 0x00ba, 0x2000 },

+  { 0x0701, 0x00b9, 0x0000 },

+  { 0x0701, 0x00bb, 0x0000 },

+  { 0x8701, 0x00be, 0x2000 },

+  { 0x0701, 0x00bd, 0x0000 },

+  { 0x0701, 0x00bf, 0x0000 },

+  { 0x8701, 0x00c8, 0x4000 },

+  { 0x8701, 0x00c4, 0x3000 },

+  { 0x8701, 0x00c2, 0x2000 },

+  { 0x0701, 0x00c1, 0x0000 },

+  { 0x0701, 0x00c3, 0x0000 },

+  { 0x8701, 0x00c6, 0x2000 },

+  { 0x0701, 0x00c5, 0x0000 },

+  { 0x0701, 0x00c7, 0x0000 },

+  { 0x8701, 0x00cc, 0x3000 },

+  { 0x8701, 0x00ca, 0x2000 },

+  { 0x0701, 0x00c9, 0x0000 },

+  { 0x0701, 0x00cb, 0x0000 },

+  { 0x8701, 0x00ce, 0x2000 },

+  { 0x0701, 0x00cd, 0x0000 },

+  { 0x0701, 0x00cf, 0x0000 },

+  { 0x8701, 0x00e0, 0x5000 },

+  { 0x8701, 0x00d8, 0x4000 },

+  { 0x8701, 0x00d4, 0x3000 },

+  { 0x8701, 0x00d2, 0x2000 },

+  { 0x0701, 0x00d1, 0x0000 },

+  { 0x0701, 0x00d3, 0x0000 },

+  { 0x8701, 0x00d6, 0x2000 },

+  { 0x0701, 0x00d5, 0x0000 },

+  { 0x0701, 0x00d7, 0x0000 },

+  { 0x8701, 0x00dc, 0x3000 },

+  { 0x8701, 0x00da, 0x2000 },

+  { 0x0701, 0x00d9, 0x0000 },

+  { 0x0701, 0x00db, 0x0000 },

+  { 0x8701, 0x00de, 0x2000 },

+  { 0x0701, 0x00dd, 0x0000 },

+  { 0x0701, 0x00df, 0x0000 },

+  { 0x8701, 0x00e8, 0x4000 },

+  { 0x8701, 0x00e4, 0x3000 },

+  { 0x8701, 0x00e2, 0x2000 },

+  { 0x0701, 0x00e1, 0x0000 },

+  { 0x0701, 0x00e3, 0x0000 },

+  { 0x8701, 0x00e6, 0x2000 },

+  { 0x0701, 0x00e5, 0x0000 },

+  { 0x0701, 0x00e7, 0x0000 },

+  { 0x8701, 0x00ec, 0x3000 },

+  { 0x8701, 0x00ea, 0x2000 },

+  { 0x0701, 0x00e9, 0x0000 },

+  { 0x0701, 0x00eb, 0x0000 },

+  { 0x8701, 0x00ee, 0x2000 },

+  { 0x0701, 0x00ed, 0x0000 },

+  { 0x0701, 0x00ef, 0x0000 },

+  { 0x8501, 0xd459, 0xb000 },

+  { 0x9a01, 0xd080, 0xa000 },

+  { 0x8701, 0x045f, 0x9000 },

+  { 0x8701, 0x0349, 0x8000 },

+  { 0x9a01, 0x013c, 0x7000 },

+  { 0x8f01, 0x0119, 0x6000 },

+  { 0x8f01, 0x0109, 0x5000 },

+  { 0x8701, 0x00f8, 0x4000 },

+  { 0x8701, 0x00f4, 0x3000 },

+  { 0x8701, 0x00f2, 0x2000 },

+  { 0x0701, 0x00f1, 0x0000 },

+  { 0x0701, 0x00f3, 0x0000 },

+  { 0x8701, 0x00f6, 0x2000 },

+  { 0x0701, 0x00f5, 0x0000 },

+  { 0x0701, 0x00f7, 0x0000 },

+  { 0x9501, 0x0101, 0x3000 },

+  { 0x8701, 0x00fa, 0x2000 },

+  { 0x0701, 0x00f9, 0x0000 },

+  { 0x1501, 0x0100, 0x0000 },

+  { 0x8f01, 0x0107, 0x2000 },

+  { 0x1a01, 0x0102, 0x0000 },

+  { 0x0f01, 0x0108, 0x0000 },

+  { 0x8f01, 0x0111, 0x4000 },

+  { 0x8f01, 0x010d, 0x3000 },

+  { 0x8f01, 0x010b, 0x2000 },

+  { 0x0f01, 0x010a, 0x0000 },

+  { 0x0f01, 0x010c, 0x0000 },

+  { 0x8f01, 0x010f, 0x2000 },

+  { 0x0f01, 0x010e, 0x0000 },

+  { 0x0f01, 0x0110, 0x0000 },

+  { 0x8f01, 0x0115, 0x3000 },

+  { 0x8f01, 0x0113, 0x2000 },

+  { 0x0f01, 0x0112, 0x0000 },

+  { 0x0f01, 0x0114, 0x0000 },

+  { 0x8f01, 0x0117, 0x2000 },

+  { 0x0f01, 0x0116, 0x0000 },

+  { 0x0f01, 0x0118, 0x0000 },

+  { 0x8f01, 0x0129, 0x5000 },

+  { 0x8f01, 0x0121, 0x4000 },

+  { 0x8f01, 0x011d, 0x3000 },

+  { 0x8f01, 0x011b, 0x2000 },

+  { 0x0f01, 0x011a, 0x0000 },

+  { 0x0f01, 0x011c, 0x0000 },

+  { 0x8f01, 0x011f, 0x2000 },

+  { 0x0f01, 0x011e, 0x0000 },

+  { 0x0f01, 0x0120, 0x0000 },

+  { 0x8f01, 0x0125, 0x3000 },

+  { 0x8f01, 0x0123, 0x2000 },

+  { 0x0f01, 0x0122, 0x0000 },

+  { 0x0f01, 0x0124, 0x0000 },

+  { 0x8f01, 0x0127, 0x2000 },

+  { 0x0f01, 0x0126, 0x0000 },

+  { 0x0f01, 0x0128, 0x0000 },

+  { 0x8f01, 0x0131, 0x4000 },

+  { 0x8f01, 0x012d, 0x3000 },

+  { 0x8f01, 0x012b, 0x2000 },

+  { 0x0f01, 0x012a, 0x0000 },

+  { 0x0f01, 0x012c, 0x0000 },

+  { 0x8f01, 0x012f, 0x2000 },

+  { 0x0f01, 0x012e, 0x0000 },

+  { 0x0f01, 0x0130, 0x0000 },

+  { 0x9a01, 0x0138, 0x3000 },

+  { 0x8f01, 0x0133, 0x2000 },

+  { 0x0f01, 0x0132, 0x0000 },

+  { 0x1a01, 0x0137, 0x0000 },

+  { 0x9a01, 0x013a, 0x2000 },

+  { 0x1a01, 0x0139, 0x0000 },

+  { 0x1a01, 0x013b, 0x0000 },

+  { 0x8701, 0x031c, 0x6000 },

+  { 0x8701, 0x030c, 0x5000 },

+  { 0x8701, 0x0304, 0x4000 },

+  { 0x8701, 0x0300, 0x3000 },

+  { 0x9a01, 0x013e, 0x2000 },

+  { 0x1a01, 0x013d, 0x0000 },

+  { 0x1a01, 0x013f, 0x0000 },

+  { 0x8701, 0x0302, 0x2000 },

+  { 0x0701, 0x0301, 0x0000 },

+  { 0x0701, 0x0303, 0x0000 },

+  { 0x8701, 0x0308, 0x3000 },

+  { 0x8701, 0x0306, 0x2000 },

+  { 0x0701, 0x0305, 0x0000 },

+  { 0x0701, 0x0307, 0x0000 },

+  { 0x8701, 0x030a, 0x2000 },

+  { 0x0701, 0x0309, 0x0000 },

+  { 0x0701, 0x030b, 0x0000 },

+  { 0x8701, 0x0314, 0x4000 },

+  { 0x8701, 0x0310, 0x3000 },

+  { 0x8701, 0x030e, 0x2000 },

+  { 0x0701, 0x030d, 0x0000 },

+  { 0x0701, 0x030f, 0x0000 },

+  { 0x8701, 0x0312, 0x2000 },

+  { 0x0701, 0x0311, 0x0000 },

+  { 0x0701, 0x0313, 0x0000 },

+  { 0x8701, 0x0318, 0x3000 },

+  { 0x8701, 0x0316, 0x2000 },

+  { 0x0701, 0x0315, 0x0000 },

+  { 0x0701, 0x0317, 0x0000 },

+  { 0x8701, 0x031a, 0x2000 },

+  { 0x0701, 0x0319, 0x0000 },

+  { 0x0701, 0x031b, 0x0000 },

+  { 0x8701, 0x0339, 0x5000 },

+  { 0x8701, 0x0331, 0x4000 },

+  { 0x8f01, 0x0321, 0x3000 },

+  { 0x8701, 0x031e, 0x2000 },

+  { 0x0701, 0x031d, 0x0000 },

+  { 0x0f01, 0x0320, 0x0000 },

+  { 0x8f01, 0x0323, 0x2000 },

+  { 0x0f01, 0x0322, 0x0000 },

+  { 0x0701, 0x0330, 0x0000 },

+  { 0x8701, 0x0335, 0x3000 },

+  { 0x8701, 0x0333, 0x2000 },

+  { 0x0701, 0x0332, 0x0000 },

+  { 0x0701, 0x0334, 0x0000 },

+  { 0x8701, 0x0337, 0x2000 },

+  { 0x0701, 0x0336, 0x0000 },

+  { 0x0701, 0x0338, 0x0000 },

+  { 0x8701, 0x0341, 0x4000 },

+  { 0x8701, 0x033d, 0x3000 },

+  { 0x8701, 0x033b, 0x2000 },

+  { 0x0701, 0x033a, 0x0000 },

+  { 0x0701, 0x033c, 0x0000 },

+  { 0x8701, 0x033f, 0x2000 },

+  { 0x0701, 0x033e, 0x0000 },

+  { 0x0701, 0x0340, 0x0000 },

+  { 0x8701, 0x0345, 0x3000 },

+  { 0x8701, 0x0343, 0x2000 },

+  { 0x0701, 0x0342, 0x0000 },

+  { 0x0701, 0x0344, 0x0000 },

+  { 0x8701, 0x0347, 0x2000 },

+  { 0x0701, 0x0346, 0x0000 },

+  { 0x0701, 0x0348, 0x0000 },

+  { 0x8901, 0x041f, 0x7028 },

+  { 0x9501, 0x039f, 0x6000 },

+  { 0x8701, 0x038e, 0x5000 },

+  { 0x8701, 0x0386, 0x4000 },

+  { 0x8701, 0x0382, 0x3000 },

+  { 0x8701, 0x0380, 0x2000 },

+  { 0x0e01, 0x034a, 0x0000 },

+  { 0x0701, 0x0381, 0x0000 },

+  { 0x8701, 0x0384, 0x2000 },

+  { 0x0701, 0x0383, 0x0000 },

+  { 0x0701, 0x0385, 0x0000 },

+  { 0x8701, 0x038a, 0x3000 },

+  { 0x8701, 0x0388, 0x2000 },

+  { 0x0701, 0x0387, 0x0000 },

+  { 0x0701, 0x0389, 0x0000 },

+  { 0x8701, 0x038c, 0x2000 },

+  { 0x0701, 0x038b, 0x0000 },

+  { 0x0701, 0x038d, 0x0000 },

+  { 0x8701, 0x0396, 0x4000 },

+  { 0x8701, 0x0392, 0x3000 },

+  { 0x8701, 0x0390, 0x2000 },

+  { 0x0701, 0x038f, 0x0000 },

+  { 0x0701, 0x0391, 0x0000 },

+  { 0x8701, 0x0394, 0x2000 },

+  { 0x0701, 0x0393, 0x0000 },

+  { 0x0701, 0x0395, 0x0000 },

+  { 0x8701, 0x039a, 0x3000 },

+  { 0x8701, 0x0398, 0x2000 },

+  { 0x0701, 0x0397, 0x0000 },

+  { 0x0701, 0x0399, 0x0000 },

+  { 0x8701, 0x039c, 0x2000 },

+  { 0x0701, 0x039b, 0x0000 },

+  { 0x0701, 0x039d, 0x0000 },

+  { 0x8901, 0x040f, 0x5028 },

+  { 0x8901, 0x0407, 0x4028 },

+  { 0x8901, 0x0403, 0x3028 },

+  { 0x8901, 0x0401, 0x2028 },

+  { 0x0901, 0x0400, 0x0028 },

+  { 0x0901, 0x0402, 0x0028 },

+  { 0x8901, 0x0405, 0x2028 },

+  { 0x0901, 0x0404, 0x0028 },

+  { 0x0901, 0x0406, 0x0028 },

+  { 0x8901, 0x040b, 0x3028 },

+  { 0x8901, 0x0409, 0x2028 },

+  { 0x0901, 0x0408, 0x0028 },

+  { 0x0901, 0x040a, 0x0028 },

+  { 0x8901, 0x040d, 0x2028 },

+  { 0x0901, 0x040c, 0x0028 },

+  { 0x0901, 0x040e, 0x0028 },

+  { 0x8901, 0x0417, 0x4028 },

+  { 0x8901, 0x0413, 0x3028 },

+  { 0x8901, 0x0411, 0x2028 },

+  { 0x0901, 0x0410, 0x0028 },

+  { 0x0901, 0x0412, 0x0028 },

+  { 0x8901, 0x0415, 0x2028 },

+  { 0x0901, 0x0414, 0x0028 },

+  { 0x0901, 0x0416, 0x0028 },

+  { 0x8901, 0x041b, 0x3028 },

+  { 0x8901, 0x0419, 0x2028 },

+  { 0x0901, 0x0418, 0x0028 },

+  { 0x0901, 0x041a, 0x0028 },

+  { 0x8901, 0x041d, 0x2028 },

+  { 0x0901, 0x041c, 0x0028 },

+  { 0x0901, 0x041e, 0x0028 },

+  { 0x8501, 0x043f, 0x6fd8 },

+  { 0x8501, 0x042f, 0x5fd8 },

+  { 0x8901, 0x0427, 0x4028 },

+  { 0x8901, 0x0423, 0x3028 },

+  { 0x8901, 0x0421, 0x2028 },

+  { 0x0901, 0x0420, 0x0028 },

+  { 0x0901, 0x0422, 0x0028 },

+  { 0x8901, 0x0425, 0x2028 },

+  { 0x0901, 0x0424, 0x0028 },

+  { 0x0901, 0x0426, 0x0028 },

+  { 0x8501, 0x042b, 0x3fd8 },

+  { 0x8501, 0x0429, 0x2fd8 },

+  { 0x0501, 0x0428, 0x0fd8 },

+  { 0x0501, 0x042a, 0x0fd8 },

+  { 0x8501, 0x042d, 0x2fd8 },

+  { 0x0501, 0x042c, 0x0fd8 },

+  { 0x0501, 0x042e, 0x0fd8 },

+  { 0x8501, 0x0437, 0x4fd8 },

+  { 0x8501, 0x0433, 0x3fd8 },

+  { 0x8501, 0x0431, 0x2fd8 },

+  { 0x0501, 0x0430, 0x0fd8 },

+  { 0x0501, 0x0432, 0x0fd8 },

+  { 0x8501, 0x0435, 0x2fd8 },

+  { 0x0501, 0x0434, 0x0fd8 },

+  { 0x0501, 0x0436, 0x0fd8 },

+  { 0x8501, 0x043b, 0x3fd8 },

+  { 0x8501, 0x0439, 0x2fd8 },

+  { 0x0501, 0x0438, 0x0fd8 },

+  { 0x0501, 0x043a, 0x0fd8 },

+  { 0x8501, 0x043d, 0x2fd8 },

+  { 0x0501, 0x043c, 0x0fd8 },

+  { 0x0501, 0x043e, 0x0fd8 },

+  { 0x8501, 0x044f, 0x5fd8 },

+  { 0x8501, 0x0447, 0x4fd8 },

+  { 0x8501, 0x0443, 0x3fd8 },

+  { 0x8501, 0x0441, 0x2fd8 },

+  { 0x0501, 0x0440, 0x0fd8 },

+  { 0x0501, 0x0442, 0x0fd8 },

+  { 0x8501, 0x0445, 0x2fd8 },

+  { 0x0501, 0x0444, 0x0fd8 },

+  { 0x0501, 0x0446, 0x0fd8 },

+  { 0x8501, 0x044b, 0x3fd8 },

+  { 0x8501, 0x0449, 0x2fd8 },

+  { 0x0501, 0x0448, 0x0fd8 },

+  { 0x0501, 0x044a, 0x0fd8 },

+  { 0x8501, 0x044d, 0x2fd8 },

+  { 0x0501, 0x044c, 0x0fd8 },

+  { 0x0501, 0x044e, 0x0fd8 },

+  { 0x8701, 0x0457, 0x4000 },

+  { 0x8701, 0x0453, 0x3000 },

+  { 0x8701, 0x0451, 0x2000 },

+  { 0x0701, 0x0450, 0x0000 },

+  { 0x0701, 0x0452, 0x0000 },

+  { 0x8701, 0x0455, 0x2000 },

+  { 0x0701, 0x0454, 0x0000 },

+  { 0x0701, 0x0456, 0x0000 },

+  { 0x8701, 0x045b, 0x3000 },

+  { 0x8701, 0x0459, 0x2000 },

+  { 0x0701, 0x0458, 0x0000 },

+  { 0x0701, 0x045a, 0x0000 },

+  { 0x8701, 0x045d, 0x2000 },

+  { 0x0701, 0x045c, 0x0000 },

+  { 0x0701, 0x045e, 0x0000 },

+  { 0x9a01, 0xd000, 0x8000 },

+  { 0x8d01, 0x04a1, 0x7000 },

+  { 0x8701, 0x047f, 0x6000 },

+  { 0x8701, 0x046f, 0x5000 },

+  { 0x8701, 0x0467, 0x4000 },

+  { 0x8701, 0x0463, 0x3000 },

+  { 0x8701, 0x0461, 0x2000 },

+  { 0x0701, 0x0460, 0x0000 },

+  { 0x0701, 0x0462, 0x0000 },

+  { 0x8701, 0x0465, 0x2000 },

+  { 0x0701, 0x0464, 0x0000 },

+  { 0x0701, 0x0466, 0x0000 },

+  { 0x8701, 0x046b, 0x3000 },

+  { 0x8701, 0x0469, 0x2000 },

+  { 0x0701, 0x0468, 0x0000 },

+  { 0x0701, 0x046a, 0x0000 },

+  { 0x8701, 0x046d, 0x2000 },

+  { 0x0701, 0x046c, 0x0000 },

+  { 0x0701, 0x046e, 0x0000 },

+  { 0x8701, 0x0477, 0x4000 },

+  { 0x8701, 0x0473, 0x3000 },

+  { 0x8701, 0x0471, 0x2000 },

+  { 0x0701, 0x0470, 0x0000 },

+  { 0x0701, 0x0472, 0x0000 },

+  { 0x8701, 0x0475, 0x2000 },

+  { 0x0701, 0x0474, 0x0000 },

+  { 0x0701, 0x0476, 0x0000 },

+  { 0x8701, 0x047b, 0x3000 },

+  { 0x8701, 0x0479, 0x2000 },

+  { 0x0701, 0x0478, 0x0000 },

+  { 0x0701, 0x047a, 0x0000 },

+  { 0x8701, 0x047d, 0x2000 },

+  { 0x0701, 0x047c, 0x0000 },

+  { 0x0701, 0x047e, 0x0000 },

+  { 0x8701, 0x048f, 0x5000 },

+  { 0x8701, 0x0487, 0x4000 },

+  { 0x8701, 0x0483, 0x3000 },

+  { 0x8701, 0x0481, 0x2000 },

+  { 0x0701, 0x0480, 0x0000 },

+  { 0x0701, 0x0482, 0x0000 },

+  { 0x8701, 0x0485, 0x2000 },

+  { 0x0701, 0x0484, 0x0000 },

+  { 0x0701, 0x0486, 0x0000 },

+  { 0x8701, 0x048b, 0x3000 },

+  { 0x8701, 0x0489, 0x2000 },

+  { 0x0701, 0x0488, 0x0000 },

+  { 0x0701, 0x048a, 0x0000 },

+  { 0x8701, 0x048d, 0x2000 },

+  { 0x0701, 0x048c, 0x0000 },

+  { 0x0701, 0x048e, 0x0000 },

+  { 0x8701, 0x0497, 0x4000 },

+  { 0x8701, 0x0493, 0x3000 },

+  { 0x8701, 0x0491, 0x2000 },

+  { 0x0701, 0x0490, 0x0000 },

+  { 0x0701, 0x0492, 0x0000 },

+  { 0x8701, 0x0495, 0x2000 },

+  { 0x0701, 0x0494, 0x0000 },

+  { 0x0701, 0x0496, 0x0000 },

+  { 0x8701, 0x049b, 0x3000 },

+  { 0x8701, 0x0499, 0x2000 },

+  { 0x0701, 0x0498, 0x0000 },

+  { 0x0701, 0x049a, 0x0000 },

+  { 0x8701, 0x049d, 0x2000 },

+  { 0x0701, 0x049c, 0x0000 },

+  { 0x0d01, 0x04a0, 0x0000 },

+  { 0x8701, 0x081a, 0x6000 },

+  { 0x8701, 0x080a, 0x5000 },

+  { 0x8d01, 0x04a9, 0x4000 },

+  { 0x8d01, 0x04a5, 0x3000 },

+  { 0x8d01, 0x04a3, 0x2000 },

+  { 0x0d01, 0x04a2, 0x0000 },

+  { 0x0d01, 0x04a4, 0x0000 },

+  { 0x8d01, 0x04a7, 0x2000 },

+  { 0x0d01, 0x04a6, 0x0000 },

+  { 0x0d01, 0x04a8, 0x0000 },

+  { 0x8701, 0x0803, 0x3000 },

+  { 0x8701, 0x0801, 0x2000 },

+  { 0x0701, 0x0800, 0x0000 },

+  { 0x0701, 0x0802, 0x0000 },

+  { 0x8701, 0x0805, 0x2000 },

+  { 0x0701, 0x0804, 0x0000 },

+  { 0x0701, 0x0808, 0x0000 },

+  { 0x8701, 0x0812, 0x4000 },

+  { 0x8701, 0x080e, 0x3000 },

+  { 0x8701, 0x080c, 0x2000 },

+  { 0x0701, 0x080b, 0x0000 },

+  { 0x0701, 0x080d, 0x0000 },

+  { 0x8701, 0x0810, 0x2000 },

+  { 0x0701, 0x080f, 0x0000 },

+  { 0x0701, 0x0811, 0x0000 },

+  { 0x8701, 0x0816, 0x3000 },

+  { 0x8701, 0x0814, 0x2000 },

+  { 0x0701, 0x0813, 0x0000 },

+  { 0x0701, 0x0815, 0x0000 },

+  { 0x8701, 0x0818, 0x2000 },

+  { 0x0701, 0x0817, 0x0000 },

+  { 0x0701, 0x0819, 0x0000 },

+  { 0x8701, 0x082a, 0x5000 },

+  { 0x8701, 0x0822, 0x4000 },

+  { 0x8701, 0x081e, 0x3000 },

+  { 0x8701, 0x081c, 0x2000 },

+  { 0x0701, 0x081b, 0x0000 },

+  { 0x0701, 0x081d, 0x0000 },

+  { 0x8701, 0x0820, 0x2000 },

+  { 0x0701, 0x081f, 0x0000 },

+  { 0x0701, 0x0821, 0x0000 },

+  { 0x8701, 0x0826, 0x3000 },

+  { 0x8701, 0x0824, 0x2000 },

+  { 0x0701, 0x0823, 0x0000 },

+  { 0x0701, 0x0825, 0x0000 },

+  { 0x8701, 0x0828, 0x2000 },

+  { 0x0701, 0x0827, 0x0000 },

+  { 0x0701, 0x0829, 0x0000 },

+  { 0x8701, 0x0832, 0x4000 },

+  { 0x8701, 0x082e, 0x3000 },

+  { 0x8701, 0x082c, 0x2000 },

+  { 0x0701, 0x082b, 0x0000 },

+  { 0x0701, 0x082d, 0x0000 },

+  { 0x8701, 0x0830, 0x2000 },

+  { 0x0701, 0x082f, 0x0000 },

+  { 0x0701, 0x0831, 0x0000 },

+  { 0x8701, 0x0837, 0x3000 },

+  { 0x8701, 0x0834, 0x2000 },

+  { 0x0701, 0x0833, 0x0000 },

+  { 0x0701, 0x0835, 0x0000 },

+  { 0x8701, 0x083c, 0x2000 },

+  { 0x0701, 0x0838, 0x0000 },

+  { 0x0701, 0x083f, 0x0000 },

+  { 0x9a01, 0xd040, 0x7000 },

+  { 0x9a01, 0xd020, 0x6000 },

+  { 0x9a01, 0xd010, 0x5000 },

+  { 0x9a01, 0xd008, 0x4000 },

+  { 0x9a01, 0xd004, 0x3000 },

+  { 0x9a01, 0xd002, 0x2000 },

+  { 0x1a01, 0xd001, 0x0000 },

+  { 0x1a01, 0xd003, 0x0000 },

+  { 0x9a01, 0xd006, 0x2000 },

+  { 0x1a01, 0xd005, 0x0000 },

+  { 0x1a01, 0xd007, 0x0000 },

+  { 0x9a01, 0xd00c, 0x3000 },

+  { 0x9a01, 0xd00a, 0x2000 },

+  { 0x1a01, 0xd009, 0x0000 },

+  { 0x1a01, 0xd00b, 0x0000 },

+  { 0x9a01, 0xd00e, 0x2000 },

+  { 0x1a01, 0xd00d, 0x0000 },

+  { 0x1a01, 0xd00f, 0x0000 },

+  { 0x9a01, 0xd018, 0x4000 },

+  { 0x9a01, 0xd014, 0x3000 },

+  { 0x9a01, 0xd012, 0x2000 },

+  { 0x1a01, 0xd011, 0x0000 },

+  { 0x1a01, 0xd013, 0x0000 },

+  { 0x9a01, 0xd016, 0x2000 },

+  { 0x1a01, 0xd015, 0x0000 },

+  { 0x1a01, 0xd017, 0x0000 },

+  { 0x9a01, 0xd01c, 0x3000 },

+  { 0x9a01, 0xd01a, 0x2000 },

+  { 0x1a01, 0xd019, 0x0000 },

+  { 0x1a01, 0xd01b, 0x0000 },

+  { 0x9a01, 0xd01e, 0x2000 },

+  { 0x1a01, 0xd01d, 0x0000 },

+  { 0x1a01, 0xd01f, 0x0000 },

+  { 0x9a01, 0xd030, 0x5000 },

+  { 0x9a01, 0xd028, 0x4000 },

+  { 0x9a01, 0xd024, 0x3000 },

+  { 0x9a01, 0xd022, 0x2000 },

+  { 0x1a01, 0xd021, 0x0000 },

+  { 0x1a01, 0xd023, 0x0000 },

+  { 0x9a01, 0xd026, 0x2000 },

+  { 0x1a01, 0xd025, 0x0000 },

+  { 0x1a01, 0xd027, 0x0000 },

+  { 0x9a01, 0xd02c, 0x3000 },

+  { 0x9a01, 0xd02a, 0x2000 },

+  { 0x1a01, 0xd029, 0x0000 },

+  { 0x1a01, 0xd02b, 0x0000 },

+  { 0x9a01, 0xd02e, 0x2000 },

+  { 0x1a01, 0xd02d, 0x0000 },

+  { 0x1a01, 0xd02f, 0x0000 },

+  { 0x9a01, 0xd038, 0x4000 },

+  { 0x9a01, 0xd034, 0x3000 },

+  { 0x9a01, 0xd032, 0x2000 },

+  { 0x1a01, 0xd031, 0x0000 },

+  { 0x1a01, 0xd033, 0x0000 },

+  { 0x9a01, 0xd036, 0x2000 },

+  { 0x1a01, 0xd035, 0x0000 },

+  { 0x1a01, 0xd037, 0x0000 },

+  { 0x9a01, 0xd03c, 0x3000 },

+  { 0x9a01, 0xd03a, 0x2000 },

+  { 0x1a01, 0xd039, 0x0000 },

+  { 0x1a01, 0xd03b, 0x0000 },

+  { 0x9a01, 0xd03e, 0x2000 },

+  { 0x1a01, 0xd03d, 0x0000 },

+  { 0x1a01, 0xd03f, 0x0000 },

+  { 0x9a01, 0xd060, 0x6000 },

+  { 0x9a01, 0xd050, 0x5000 },

+  { 0x9a01, 0xd048, 0x4000 },

+  { 0x9a01, 0xd044, 0x3000 },

+  { 0x9a01, 0xd042, 0x2000 },

+  { 0x1a01, 0xd041, 0x0000 },

+  { 0x1a01, 0xd043, 0x0000 },

+  { 0x9a01, 0xd046, 0x2000 },

+  { 0x1a01, 0xd045, 0x0000 },

+  { 0x1a01, 0xd047, 0x0000 },

+  { 0x9a01, 0xd04c, 0x3000 },

+  { 0x9a01, 0xd04a, 0x2000 },

+  { 0x1a01, 0xd049, 0x0000 },

+  { 0x1a01, 0xd04b, 0x0000 },

+  { 0x9a01, 0xd04e, 0x2000 },

+  { 0x1a01, 0xd04d, 0x0000 },

+  { 0x1a01, 0xd04f, 0x0000 },

+  { 0x9a01, 0xd058, 0x4000 },

+  { 0x9a01, 0xd054, 0x3000 },

+  { 0x9a01, 0xd052, 0x2000 },

+  { 0x1a01, 0xd051, 0x0000 },

+  { 0x1a01, 0xd053, 0x0000 },

+  { 0x9a01, 0xd056, 0x2000 },

+  { 0x1a01, 0xd055, 0x0000 },

+  { 0x1a01, 0xd057, 0x0000 },

+  { 0x9a01, 0xd05c, 0x3000 },

+  { 0x9a01, 0xd05a, 0x2000 },

+  { 0x1a01, 0xd059, 0x0000 },

+  { 0x1a01, 0xd05b, 0x0000 },

+  { 0x9a01, 0xd05e, 0x2000 },

+  { 0x1a01, 0xd05d, 0x0000 },

+  { 0x1a01, 0xd05f, 0x0000 },

+  { 0x9a01, 0xd070, 0x5000 },

+  { 0x9a01, 0xd068, 0x4000 },

+  { 0x9a01, 0xd064, 0x3000 },

+  { 0x9a01, 0xd062, 0x2000 },

+  { 0x1a01, 0xd061, 0x0000 },

+  { 0x1a01, 0xd063, 0x0000 },

+  { 0x9a01, 0xd066, 0x2000 },

+  { 0x1a01, 0xd065, 0x0000 },

+  { 0x1a01, 0xd067, 0x0000 },

+  { 0x9a01, 0xd06c, 0x3000 },

+  { 0x9a01, 0xd06a, 0x2000 },

+  { 0x1a01, 0xd069, 0x0000 },

+  { 0x1a01, 0xd06b, 0x0000 },

+  { 0x9a01, 0xd06e, 0x2000 },

+  { 0x1a01, 0xd06d, 0x0000 },

+  { 0x1a01, 0xd06f, 0x0000 },

+  { 0x9a01, 0xd078, 0x4000 },

+  { 0x9a01, 0xd074, 0x3000 },

+  { 0x9a01, 0xd072, 0x2000 },

+  { 0x1a01, 0xd071, 0x0000 },

+  { 0x1a01, 0xd073, 0x0000 },

+  { 0x9a01, 0xd076, 0x2000 },

+  { 0x1a01, 0xd075, 0x0000 },

+  { 0x1a01, 0xd077, 0x0000 },

+  { 0x9a01, 0xd07c, 0x3000 },

+  { 0x9a01, 0xd07a, 0x2000 },

+  { 0x1a01, 0xd079, 0x0000 },

+  { 0x1a01, 0xd07b, 0x0000 },

+  { 0x9a01, 0xd07e, 0x2000 },

+  { 0x1a01, 0xd07d, 0x0000 },

+  { 0x1a01, 0xd07f, 0x0000 },

+  { 0x9a01, 0xd18d, 0x9000 },

+  { 0x9a01, 0xd10a, 0x8000 },

+  { 0x9a01, 0xd0c0, 0x7000 },

+  { 0x9a01, 0xd0a0, 0x6000 },

+  { 0x9a01, 0xd090, 0x5000 },

+  { 0x9a01, 0xd088, 0x4000 },

+  { 0x9a01, 0xd084, 0x3000 },

+  { 0x9a01, 0xd082, 0x2000 },

+  { 0x1a01, 0xd081, 0x0000 },

+  { 0x1a01, 0xd083, 0x0000 },

+  { 0x9a01, 0xd086, 0x2000 },

+  { 0x1a01, 0xd085, 0x0000 },

+  { 0x1a01, 0xd087, 0x0000 },

+  { 0x9a01, 0xd08c, 0x3000 },

+  { 0x9a01, 0xd08a, 0x2000 },

+  { 0x1a01, 0xd089, 0x0000 },

+  { 0x1a01, 0xd08b, 0x0000 },

+  { 0x9a01, 0xd08e, 0x2000 },

+  { 0x1a01, 0xd08d, 0x0000 },

+  { 0x1a01, 0xd08f, 0x0000 },

+  { 0x9a01, 0xd098, 0x4000 },

+  { 0x9a01, 0xd094, 0x3000 },

+  { 0x9a01, 0xd092, 0x2000 },

+  { 0x1a01, 0xd091, 0x0000 },

+  { 0x1a01, 0xd093, 0x0000 },

+  { 0x9a01, 0xd096, 0x2000 },

+  { 0x1a01, 0xd095, 0x0000 },

+  { 0x1a01, 0xd097, 0x0000 },

+  { 0x9a01, 0xd09c, 0x3000 },

+  { 0x9a01, 0xd09a, 0x2000 },

+  { 0x1a01, 0xd099, 0x0000 },

+  { 0x1a01, 0xd09b, 0x0000 },

+  { 0x9a01, 0xd09e, 0x2000 },

+  { 0x1a01, 0xd09d, 0x0000 },

+  { 0x1a01, 0xd09f, 0x0000 },

+  { 0x9a01, 0xd0b0, 0x5000 },

+  { 0x9a01, 0xd0a8, 0x4000 },

+  { 0x9a01, 0xd0a4, 0x3000 },

+  { 0x9a01, 0xd0a2, 0x2000 },

+  { 0x1a01, 0xd0a1, 0x0000 },

+  { 0x1a01, 0xd0a3, 0x0000 },

+  { 0x9a01, 0xd0a6, 0x2000 },

+  { 0x1a01, 0xd0a5, 0x0000 },

+  { 0x1a01, 0xd0a7, 0x0000 },

+  { 0x9a01, 0xd0ac, 0x3000 },

+  { 0x9a01, 0xd0aa, 0x2000 },

+  { 0x1a01, 0xd0a9, 0x0000 },

+  { 0x1a01, 0xd0ab, 0x0000 },

+  { 0x9a01, 0xd0ae, 0x2000 },

+  { 0x1a01, 0xd0ad, 0x0000 },

+  { 0x1a01, 0xd0af, 0x0000 },

+  { 0x9a01, 0xd0b8, 0x4000 },

+  { 0x9a01, 0xd0b4, 0x3000 },

+  { 0x9a01, 0xd0b2, 0x2000 },

+  { 0x1a01, 0xd0b1, 0x0000 },

+  { 0x1a01, 0xd0b3, 0x0000 },

+  { 0x9a01, 0xd0b6, 0x2000 },

+  { 0x1a01, 0xd0b5, 0x0000 },

+  { 0x1a01, 0xd0b7, 0x0000 },

+  { 0x9a01, 0xd0bc, 0x3000 },

+  { 0x9a01, 0xd0ba, 0x2000 },

+  { 0x1a01, 0xd0b9, 0x0000 },

+  { 0x1a01, 0xd0bb, 0x0000 },

+  { 0x9a01, 0xd0be, 0x2000 },

+  { 0x1a01, 0xd0bd, 0x0000 },

+  { 0x1a01, 0xd0bf, 0x0000 },

+  { 0x9a01, 0xd0e0, 0x6000 },

+  { 0x9a01, 0xd0d0, 0x5000 },

+  { 0x9a01, 0xd0c8, 0x4000 },

+  { 0x9a01, 0xd0c4, 0x3000 },

+  { 0x9a01, 0xd0c2, 0x2000 },

+  { 0x1a01, 0xd0c1, 0x0000 },

+  { 0x1a01, 0xd0c3, 0x0000 },

+  { 0x9a01, 0xd0c6, 0x2000 },

+  { 0x1a01, 0xd0c5, 0x0000 },

+  { 0x1a01, 0xd0c7, 0x0000 },

+  { 0x9a01, 0xd0cc, 0x3000 },

+  { 0x9a01, 0xd0ca, 0x2000 },

+  { 0x1a01, 0xd0c9, 0x0000 },

+  { 0x1a01, 0xd0cb, 0x0000 },

+  { 0x9a01, 0xd0ce, 0x2000 },

+  { 0x1a01, 0xd0cd, 0x0000 },

+  { 0x1a01, 0xd0cf, 0x0000 },

+  { 0x9a01, 0xd0d8, 0x4000 },

+  { 0x9a01, 0xd0d4, 0x3000 },

+  { 0x9a01, 0xd0d2, 0x2000 },

+  { 0x1a01, 0xd0d1, 0x0000 },

+  { 0x1a01, 0xd0d3, 0x0000 },

+  { 0x9a01, 0xd0d6, 0x2000 },

+  { 0x1a01, 0xd0d5, 0x0000 },

+  { 0x1a01, 0xd0d7, 0x0000 },

+  { 0x9a01, 0xd0dc, 0x3000 },

+  { 0x9a01, 0xd0da, 0x2000 },

+  { 0x1a01, 0xd0d9, 0x0000 },

+  { 0x1a01, 0xd0db, 0x0000 },

+  { 0x9a01, 0xd0de, 0x2000 },

+  { 0x1a01, 0xd0dd, 0x0000 },

+  { 0x1a01, 0xd0df, 0x0000 },

+  { 0x9a01, 0xd0f0, 0x5000 },

+  { 0x9a01, 0xd0e8, 0x4000 },

+  { 0x9a01, 0xd0e4, 0x3000 },

+  { 0x9a01, 0xd0e2, 0x2000 },

+  { 0x1a01, 0xd0e1, 0x0000 },

+  { 0x1a01, 0xd0e3, 0x0000 },

+  { 0x9a01, 0xd0e6, 0x2000 },

+  { 0x1a01, 0xd0e5, 0x0000 },

+  { 0x1a01, 0xd0e7, 0x0000 },

+  { 0x9a01, 0xd0ec, 0x3000 },

+  { 0x9a01, 0xd0ea, 0x2000 },

+  { 0x1a01, 0xd0e9, 0x0000 },

+  { 0x1a01, 0xd0eb, 0x0000 },

+  { 0x9a01, 0xd0ee, 0x2000 },

+  { 0x1a01, 0xd0ed, 0x0000 },

+  { 0x1a01, 0xd0ef, 0x0000 },

+  { 0x9a01, 0xd102, 0x4000 },

+  { 0x9a01, 0xd0f4, 0x3000 },

+  { 0x9a01, 0xd0f2, 0x2000 },

+  { 0x1a01, 0xd0f1, 0x0000 },

+  { 0x1a01, 0xd0f3, 0x0000 },

+  { 0x9a01, 0xd100, 0x2000 },

+  { 0x1a01, 0xd0f5, 0x0000 },

+  { 0x1a01, 0xd101, 0x0000 },

+  { 0x9a01, 0xd106, 0x3000 },

+  { 0x9a01, 0xd104, 0x2000 },

+  { 0x1a01, 0xd103, 0x0000 },

+  { 0x1a01, 0xd105, 0x0000 },

+  { 0x9a01, 0xd108, 0x2000 },

+  { 0x1a01, 0xd107, 0x0000 },

+  { 0x1a01, 0xd109, 0x0000 },

+  { 0x9a01, 0xd14d, 0x7000 },

+  { 0x9a01, 0xd12d, 0x6000 },

+  { 0x9a01, 0xd11a, 0x5000 },

+  { 0x9a01, 0xd112, 0x4000 },

+  { 0x9a01, 0xd10e, 0x3000 },

+  { 0x9a01, 0xd10c, 0x2000 },

+  { 0x1a01, 0xd10b, 0x0000 },

+  { 0x1a01, 0xd10d, 0x0000 },

+  { 0x9a01, 0xd110, 0x2000 },

+  { 0x1a01, 0xd10f, 0x0000 },

+  { 0x1a01, 0xd111, 0x0000 },

+  { 0x9a01, 0xd116, 0x3000 },

+  { 0x9a01, 0xd114, 0x2000 },

+  { 0x1a01, 0xd113, 0x0000 },

+  { 0x1a01, 0xd115, 0x0000 },

+  { 0x9a01, 0xd118, 0x2000 },

+  { 0x1a01, 0xd117, 0x0000 },

+  { 0x1a01, 0xd119, 0x0000 },

+  { 0x9a01, 0xd122, 0x4000 },

+  { 0x9a01, 0xd11e, 0x3000 },

+  { 0x9a01, 0xd11c, 0x2000 },

+  { 0x1a01, 0xd11b, 0x0000 },

+  { 0x1a01, 0xd11d, 0x0000 },

+  { 0x9a01, 0xd120, 0x2000 },

+  { 0x1a01, 0xd11f, 0x0000 },

+  { 0x1a01, 0xd121, 0x0000 },

+  { 0x9a01, 0xd126, 0x3000 },

+  { 0x9a01, 0xd124, 0x2000 },

+  { 0x1a01, 0xd123, 0x0000 },

+  { 0x1a01, 0xd125, 0x0000 },

+  { 0x9a01, 0xd12b, 0x2000 },

+  { 0x1a01, 0xd12a, 0x0000 },

+  { 0x1a01, 0xd12c, 0x0000 },

+  { 0x9a01, 0xd13d, 0x5000 },

+  { 0x9a01, 0xd135, 0x4000 },

+  { 0x9a01, 0xd131, 0x3000 },

+  { 0x9a01, 0xd12f, 0x2000 },

+  { 0x1a01, 0xd12e, 0x0000 },

+  { 0x1a01, 0xd130, 0x0000 },

+  { 0x9a01, 0xd133, 0x2000 },

+  { 0x1a01, 0xd132, 0x0000 },

+  { 0x1a01, 0xd134, 0x0000 },

+  { 0x9a01, 0xd139, 0x3000 },

+  { 0x9a01, 0xd137, 0x2000 },

+  { 0x1a01, 0xd136, 0x0000 },

+  { 0x1a01, 0xd138, 0x0000 },

+  { 0x9a01, 0xd13b, 0x2000 },

+  { 0x1a01, 0xd13a, 0x0000 },

+  { 0x1a01, 0xd13c, 0x0000 },

+  { 0x9a01, 0xd145, 0x4000 },

+  { 0x9a01, 0xd141, 0x3000 },

+  { 0x9a01, 0xd13f, 0x2000 },

+  { 0x1a01, 0xd13e, 0x0000 },

+  { 0x1a01, 0xd140, 0x0000 },

+  { 0x9a01, 0xd143, 0x2000 },

+  { 0x1a01, 0xd142, 0x0000 },

+  { 0x1a01, 0xd144, 0x0000 },

+  { 0x9a01, 0xd149, 0x3000 },

+  { 0x9a01, 0xd147, 0x2000 },

+  { 0x1a01, 0xd146, 0x0000 },

+  { 0x1a01, 0xd148, 0x0000 },

+  { 0x9a01, 0xd14b, 0x2000 },

+  { 0x1a01, 0xd14a, 0x0000 },

+  { 0x1a01, 0xd14c, 0x0000 },

+  { 0x8a01, 0xd16d, 0x6000 },

+  { 0x9a01, 0xd15d, 0x5000 },

+  { 0x9a01, 0xd155, 0x4000 },

+  { 0x9a01, 0xd151, 0x3000 },

+  { 0x9a01, 0xd14f, 0x2000 },

+  { 0x1a01, 0xd14e, 0x0000 },

+  { 0x1a01, 0xd150, 0x0000 },

+  { 0x9a01, 0xd153, 0x2000 },

+  { 0x1a01, 0xd152, 0x0000 },

+  { 0x1a01, 0xd154, 0x0000 },

+  { 0x9a01, 0xd159, 0x3000 },

+  { 0x9a01, 0xd157, 0x2000 },

+  { 0x1a01, 0xd156, 0x0000 },

+  { 0x1a01, 0xd158, 0x0000 },

+  { 0x9a01, 0xd15b, 0x2000 },

+  { 0x1a01, 0xd15a, 0x0000 },

+  { 0x1a01, 0xd15c, 0x0000 },

+  { 0x8a01, 0xd165, 0x4000 },

+  { 0x9a01, 0xd161, 0x3000 },

+  { 0x9a01, 0xd15f, 0x2000 },

+  { 0x1a01, 0xd15e, 0x0000 },

+  { 0x1a01, 0xd160, 0x0000 },

+  { 0x9a01, 0xd163, 0x2000 },

+  { 0x1a01, 0xd162, 0x0000 },

+  { 0x1a01, 0xd164, 0x0000 },

+  { 0x8c01, 0xd169, 0x3000 },

+  { 0x8c01, 0xd167, 0x2000 },

+  { 0x0a01, 0xd166, 0x0000 },

+  { 0x0c01, 0xd168, 0x0000 },

+  { 0x9a01, 0xd16b, 0x2000 },

+  { 0x1a01, 0xd16a, 0x0000 },

+  { 0x1a01, 0xd16c, 0x0000 },

+  { 0x8c01, 0xd17d, 0x5000 },

+  { 0x8101, 0xd175, 0x4000 },

+  { 0x8a01, 0xd171, 0x3000 },

+  { 0x8a01, 0xd16f, 0x2000 },

+  { 0x0a01, 0xd16e, 0x0000 },

+  { 0x0a01, 0xd170, 0x0000 },

+  { 0x8101, 0xd173, 0x2000 },

+  { 0x0a01, 0xd172, 0x0000 },

+  { 0x0101, 0xd174, 0x0000 },

+  { 0x8101, 0xd179, 0x3000 },

+  { 0x8101, 0xd177, 0x2000 },

+  { 0x0101, 0xd176, 0x0000 },

+  { 0x0101, 0xd178, 0x0000 },

+  { 0x8c01, 0xd17b, 0x2000 },

+  { 0x0101, 0xd17a, 0x0000 },

+  { 0x0c01, 0xd17c, 0x0000 },

+  { 0x8c01, 0xd185, 0x4000 },

+  { 0x8c01, 0xd181, 0x3000 },

+  { 0x8c01, 0xd17f, 0x2000 },

+  { 0x0c01, 0xd17e, 0x0000 },

+  { 0x0c01, 0xd180, 0x0000 },

+  { 0x9a01, 0xd183, 0x2000 },

+  { 0x0c01, 0xd182, 0x0000 },

+  { 0x1a01, 0xd184, 0x0000 },

+  { 0x8c01, 0xd189, 0x3000 },

+  { 0x8c01, 0xd187, 0x2000 },

+  { 0x0c01, 0xd186, 0x0000 },

+  { 0x0c01, 0xd188, 0x0000 },

+  { 0x8c01, 0xd18b, 0x2000 },

+  { 0x0c01, 0xd18a, 0x0000 },

+  { 0x1a01, 0xd18c, 0x0000 },

+  { 0x9a01, 0xd32f, 0x8000 },

+  { 0x9a01, 0xd1cd, 0x7000 },

+  { 0x8c01, 0xd1ad, 0x6000 },

+  { 0x9a01, 0xd19d, 0x5000 },

+  { 0x9a01, 0xd195, 0x4000 },

+  { 0x9a01, 0xd191, 0x3000 },

+  { 0x9a01, 0xd18f, 0x2000 },

+  { 0x1a01, 0xd18e, 0x0000 },

+  { 0x1a01, 0xd190, 0x0000 },

+  { 0x9a01, 0xd193, 0x2000 },

+  { 0x1a01, 0xd192, 0x0000 },

+  { 0x1a01, 0xd194, 0x0000 },

+  { 0x9a01, 0xd199, 0x3000 },

+  { 0x9a01, 0xd197, 0x2000 },

+  { 0x1a01, 0xd196, 0x0000 },

+  { 0x1a01, 0xd198, 0x0000 },

+  { 0x9a01, 0xd19b, 0x2000 },

+  { 0x1a01, 0xd19a, 0x0000 },

+  { 0x1a01, 0xd19c, 0x0000 },

+  { 0x9a01, 0xd1a5, 0x4000 },

+  { 0x9a01, 0xd1a1, 0x3000 },

+  { 0x9a01, 0xd19f, 0x2000 },

+  { 0x1a01, 0xd19e, 0x0000 },

+  { 0x1a01, 0xd1a0, 0x0000 },

+  { 0x9a01, 0xd1a3, 0x2000 },

+  { 0x1a01, 0xd1a2, 0x0000 },

+  { 0x1a01, 0xd1a4, 0x0000 },

+  { 0x9a01, 0xd1a9, 0x3000 },

+  { 0x9a01, 0xd1a7, 0x2000 },

+  { 0x1a01, 0xd1a6, 0x0000 },

+  { 0x1a01, 0xd1a8, 0x0000 },

+  { 0x8c01, 0xd1ab, 0x2000 },

+  { 0x0c01, 0xd1aa, 0x0000 },

+  { 0x0c01, 0xd1ac, 0x0000 },

+  { 0x9a01, 0xd1bd, 0x5000 },

+  { 0x9a01, 0xd1b5, 0x4000 },

+  { 0x9a01, 0xd1b1, 0x3000 },

+  { 0x9a01, 0xd1af, 0x2000 },

+  { 0x1a01, 0xd1ae, 0x0000 },

+  { 0x1a01, 0xd1b0, 0x0000 },

+  { 0x9a01, 0xd1b3, 0x2000 },

+  { 0x1a01, 0xd1b2, 0x0000 },

+  { 0x1a01, 0xd1b4, 0x0000 },

+  { 0x9a01, 0xd1b9, 0x3000 },

+  { 0x9a01, 0xd1b7, 0x2000 },

+  { 0x1a01, 0xd1b6, 0x0000 },

+  { 0x1a01, 0xd1b8, 0x0000 },

+  { 0x9a01, 0xd1bb, 0x2000 },

+  { 0x1a01, 0xd1ba, 0x0000 },

+  { 0x1a01, 0xd1bc, 0x0000 },

+  { 0x9a01, 0xd1c5, 0x4000 },

+  { 0x9a01, 0xd1c1, 0x3000 },

+  { 0x9a01, 0xd1bf, 0x2000 },

+  { 0x1a01, 0xd1be, 0x0000 },

+  { 0x1a01, 0xd1c0, 0x0000 },

+  { 0x9a01, 0xd1c3, 0x2000 },

+  { 0x1a01, 0xd1c2, 0x0000 },

+  { 0x1a01, 0xd1c4, 0x0000 },

+  { 0x9a01, 0xd1c9, 0x3000 },

+  { 0x9a01, 0xd1c7, 0x2000 },

+  { 0x1a01, 0xd1c6, 0x0000 },

+  { 0x1a01, 0xd1c8, 0x0000 },

+  { 0x9a01, 0xd1cb, 0x2000 },

+  { 0x1a01, 0xd1ca, 0x0000 },

+  { 0x1a01, 0xd1cc, 0x0000 },

+  { 0x9a01, 0xd30f, 0x6000 },

+  { 0x9a01, 0xd1dd, 0x5000 },

+  { 0x9a01, 0xd1d5, 0x4000 },

+  { 0x9a01, 0xd1d1, 0x3000 },

+  { 0x9a01, 0xd1cf, 0x2000 },

+  { 0x1a01, 0xd1ce, 0x0000 },

+  { 0x1a01, 0xd1d0, 0x0000 },

+  { 0x9a01, 0xd1d3, 0x2000 },

+  { 0x1a01, 0xd1d2, 0x0000 },

+  { 0x1a01, 0xd1d4, 0x0000 },

+  { 0x9a01, 0xd1d9, 0x3000 },

+  { 0x9a01, 0xd1d7, 0x2000 },

+  { 0x1a01, 0xd1d6, 0x0000 },

+  { 0x1a01, 0xd1d8, 0x0000 },

+  { 0x9a01, 0xd1db, 0x2000 },

+  { 0x1a01, 0xd1da, 0x0000 },

+  { 0x1a01, 0xd1dc, 0x0000 },

+  { 0x9a01, 0xd307, 0x4000 },

+  { 0x9a01, 0xd303, 0x3000 },

+  { 0x9a01, 0xd301, 0x2000 },

+  { 0x1a01, 0xd300, 0x0000 },

+  { 0x1a01, 0xd302, 0x0000 },

+  { 0x9a01, 0xd305, 0x2000 },

+  { 0x1a01, 0xd304, 0x0000 },

+  { 0x1a01, 0xd306, 0x0000 },

+  { 0x9a01, 0xd30b, 0x3000 },

+  { 0x9a01, 0xd309, 0x2000 },

+  { 0x1a01, 0xd308, 0x0000 },

+  { 0x1a01, 0xd30a, 0x0000 },

+  { 0x9a01, 0xd30d, 0x2000 },

+  { 0x1a01, 0xd30c, 0x0000 },

+  { 0x1a01, 0xd30e, 0x0000 },

+  { 0x9a01, 0xd31f, 0x5000 },

+  { 0x9a01, 0xd317, 0x4000 },

+  { 0x9a01, 0xd313, 0x3000 },

+  { 0x9a01, 0xd311, 0x2000 },

+  { 0x1a01, 0xd310, 0x0000 },

+  { 0x1a01, 0xd312, 0x0000 },

+  { 0x9a01, 0xd315, 0x2000 },

+  { 0x1a01, 0xd314, 0x0000 },

+  { 0x1a01, 0xd316, 0x0000 },

+  { 0x9a01, 0xd31b, 0x3000 },

+  { 0x9a01, 0xd319, 0x2000 },

+  { 0x1a01, 0xd318, 0x0000 },

+  { 0x1a01, 0xd31a, 0x0000 },

+  { 0x9a01, 0xd31d, 0x2000 },

+  { 0x1a01, 0xd31c, 0x0000 },

+  { 0x1a01, 0xd31e, 0x0000 },

+  { 0x9a01, 0xd327, 0x4000 },

+  { 0x9a01, 0xd323, 0x3000 },

+  { 0x9a01, 0xd321, 0x2000 },

+  { 0x1a01, 0xd320, 0x0000 },

+  { 0x1a01, 0xd322, 0x0000 },

+  { 0x9a01, 0xd325, 0x2000 },

+  { 0x1a01, 0xd324, 0x0000 },

+  { 0x1a01, 0xd326, 0x0000 },

+  { 0x9a01, 0xd32b, 0x3000 },

+  { 0x9a01, 0xd329, 0x2000 },

+  { 0x1a01, 0xd328, 0x0000 },

+  { 0x1a01, 0xd32a, 0x0000 },

+  { 0x9a01, 0xd32d, 0x2000 },

+  { 0x1a01, 0xd32c, 0x0000 },

+  { 0x1a01, 0xd32e, 0x0000 },

+  { 0x8901, 0xd418, 0x7000 },

+  { 0x9a01, 0xd34f, 0x6000 },

+  { 0x9a01, 0xd33f, 0x5000 },

+  { 0x9a01, 0xd337, 0x4000 },

+  { 0x9a01, 0xd333, 0x3000 },

+  { 0x9a01, 0xd331, 0x2000 },

+  { 0x1a01, 0xd330, 0x0000 },

+  { 0x1a01, 0xd332, 0x0000 },

+  { 0x9a01, 0xd335, 0x2000 },

+  { 0x1a01, 0xd334, 0x0000 },

+  { 0x1a01, 0xd336, 0x0000 },

+  { 0x9a01, 0xd33b, 0x3000 },

+  { 0x9a01, 0xd339, 0x2000 },

+  { 0x1a01, 0xd338, 0x0000 },

+  { 0x1a01, 0xd33a, 0x0000 },

+  { 0x9a01, 0xd33d, 0x2000 },

+  { 0x1a01, 0xd33c, 0x0000 },

+  { 0x1a01, 0xd33e, 0x0000 },

+  { 0x9a01, 0xd347, 0x4000 },

+  { 0x9a01, 0xd343, 0x3000 },

+  { 0x9a01, 0xd341, 0x2000 },

+  { 0x1a01, 0xd340, 0x0000 },

+  { 0x1a01, 0xd342, 0x0000 },

+  { 0x9a01, 0xd345, 0x2000 },

+  { 0x1a01, 0xd344, 0x0000 },

+  { 0x1a01, 0xd346, 0x0000 },

+  { 0x9a01, 0xd34b, 0x3000 },

+  { 0x9a01, 0xd349, 0x2000 },

+  { 0x1a01, 0xd348, 0x0000 },

+  { 0x1a01, 0xd34a, 0x0000 },

+  { 0x9a01, 0xd34d, 0x2000 },

+  { 0x1a01, 0xd34c, 0x0000 },

+  { 0x1a01, 0xd34e, 0x0000 },

+  { 0x8901, 0xd408, 0x5000 },

+  { 0x8901, 0xd400, 0x4000 },

+  { 0x9a01, 0xd353, 0x3000 },

+  { 0x9a01, 0xd351, 0x2000 },

+  { 0x1a01, 0xd350, 0x0000 },

+  { 0x1a01, 0xd352, 0x0000 },

+  { 0x9a01, 0xd355, 0x2000 },

+  { 0x1a01, 0xd354, 0x0000 },

+  { 0x1a01, 0xd356, 0x0000 },

+  { 0x8901, 0xd404, 0x3000 },

+  { 0x8901, 0xd402, 0x2000 },

+  { 0x0901, 0xd401, 0x0000 },

+  { 0x0901, 0xd403, 0x0000 },

+  { 0x8901, 0xd406, 0x2000 },

+  { 0x0901, 0xd405, 0x0000 },

+  { 0x0901, 0xd407, 0x0000 },

+  { 0x8901, 0xd410, 0x4000 },

+  { 0x8901, 0xd40c, 0x3000 },

+  { 0x8901, 0xd40a, 0x2000 },

+  { 0x0901, 0xd409, 0x0000 },

+  { 0x0901, 0xd40b, 0x0000 },

+  { 0x8901, 0xd40e, 0x2000 },

+  { 0x0901, 0xd40d, 0x0000 },

+  { 0x0901, 0xd40f, 0x0000 },

+  { 0x8901, 0xd414, 0x3000 },

+  { 0x8901, 0xd412, 0x2000 },

+  { 0x0901, 0xd411, 0x0000 },

+  { 0x0901, 0xd413, 0x0000 },

+  { 0x8901, 0xd416, 0x2000 },

+  { 0x0901, 0xd415, 0x0000 },

+  { 0x0901, 0xd417, 0x0000 },

+  { 0x8901, 0xd438, 0x6000 },

+  { 0x8501, 0xd428, 0x5000 },

+  { 0x8501, 0xd420, 0x4000 },

+  { 0x8501, 0xd41c, 0x3000 },

+  { 0x8501, 0xd41a, 0x2000 },

+  { 0x0901, 0xd419, 0x0000 },

+  { 0x0501, 0xd41b, 0x0000 },

+  { 0x8501, 0xd41e, 0x2000 },

+  { 0x0501, 0xd41d, 0x0000 },

+  { 0x0501, 0xd41f, 0x0000 },

+  { 0x8501, 0xd424, 0x3000 },

+  { 0x8501, 0xd422, 0x2000 },

+  { 0x0501, 0xd421, 0x0000 },

+  { 0x0501, 0xd423, 0x0000 },

+  { 0x8501, 0xd426, 0x2000 },

+  { 0x0501, 0xd425, 0x0000 },

+  { 0x0501, 0xd427, 0x0000 },

+  { 0x8501, 0xd430, 0x4000 },

+  { 0x8501, 0xd42c, 0x3000 },

+  { 0x8501, 0xd42a, 0x2000 },

+  { 0x0501, 0xd429, 0x0000 },

+  { 0x0501, 0xd42b, 0x0000 },

+  { 0x8501, 0xd42e, 0x2000 },

+  { 0x0501, 0xd42d, 0x0000 },

+  { 0x0501, 0xd42f, 0x0000 },

+  { 0x8901, 0xd434, 0x3000 },

+  { 0x8501, 0xd432, 0x2000 },

+  { 0x0501, 0xd431, 0x0000 },

+  { 0x0501, 0xd433, 0x0000 },

+  { 0x8901, 0xd436, 0x2000 },

+  { 0x0901, 0xd435, 0x0000 },

+  { 0x0901, 0xd437, 0x0000 },

+  { 0x8901, 0xd448, 0x5000 },

+  { 0x8901, 0xd440, 0x4000 },

+  { 0x8901, 0xd43c, 0x3000 },

+  { 0x8901, 0xd43a, 0x2000 },

+  { 0x0901, 0xd439, 0x0000 },

+  { 0x0901, 0xd43b, 0x0000 },

+  { 0x8901, 0xd43e, 0x2000 },

+  { 0x0901, 0xd43d, 0x0000 },

+  { 0x0901, 0xd43f, 0x0000 },

+  { 0x8901, 0xd444, 0x3000 },

+  { 0x8901, 0xd442, 0x2000 },

+  { 0x0901, 0xd441, 0x0000 },

+  { 0x0901, 0xd443, 0x0000 },

+  { 0x8901, 0xd446, 0x2000 },

+  { 0x0901, 0xd445, 0x0000 },

+  { 0x0901, 0xd447, 0x0000 },

+  { 0x8501, 0xd450, 0x4000 },

+  { 0x8901, 0xd44c, 0x3000 },

+  { 0x8901, 0xd44a, 0x2000 },

+  { 0x0901, 0xd449, 0x0000 },

+  { 0x0901, 0xd44b, 0x0000 },

+  { 0x8501, 0xd44e, 0x2000 },

+  { 0x0901, 0xd44d, 0x0000 },

+  { 0x0501, 0xd44f, 0x0000 },

+  { 0x8501, 0xd454, 0x3000 },

+  { 0x8501, 0xd452, 0x2000 },

+  { 0x0501, 0xd451, 0x0000 },

+  { 0x0501, 0xd453, 0x0000 },

+  { 0x8501, 0xd457, 0x2000 },

+  { 0x0501, 0xd456, 0x0000 },

+  { 0x0501, 0xd458, 0x0000 },

+  { 0x8702, 0xf876, 0xb000 },

+  { 0x8901, 0xd670, 0xa000 },

+  { 0x8901, 0xd570, 0x9000 },

+  { 0x8901, 0xd4e4, 0x8000 },

+  { 0x8501, 0xd499, 0x7000 },

+  { 0x8901, 0xd479, 0x6000 },

+  { 0x8901, 0xd469, 0x5000 },

+  { 0x8501, 0xd461, 0x4000 },

+  { 0x8501, 0xd45d, 0x3000 },

+  { 0x8501, 0xd45b, 0x2000 },

+  { 0x0501, 0xd45a, 0x0000 },

+  { 0x0501, 0xd45c, 0x0000 },

+  { 0x8501, 0xd45f, 0x2000 },

+  { 0x0501, 0xd45e, 0x0000 },

+  { 0x0501, 0xd460, 0x0000 },

+  { 0x8501, 0xd465, 0x3000 },

+  { 0x8501, 0xd463, 0x2000 },

+  { 0x0501, 0xd462, 0x0000 },

+  { 0x0501, 0xd464, 0x0000 },

+  { 0x8501, 0xd467, 0x2000 },

+  { 0x0501, 0xd466, 0x0000 },

+  { 0x0901, 0xd468, 0x0000 },

+  { 0x8901, 0xd471, 0x4000 },

+  { 0x8901, 0xd46d, 0x3000 },

+  { 0x8901, 0xd46b, 0x2000 },

+  { 0x0901, 0xd46a, 0x0000 },

+  { 0x0901, 0xd46c, 0x0000 },

+  { 0x8901, 0xd46f, 0x2000 },

+  { 0x0901, 0xd46e, 0x0000 },

+  { 0x0901, 0xd470, 0x0000 },

+  { 0x8901, 0xd475, 0x3000 },

+  { 0x8901, 0xd473, 0x2000 },

+  { 0x0901, 0xd472, 0x0000 },

+  { 0x0901, 0xd474, 0x0000 },

+  { 0x8901, 0xd477, 0x2000 },

+  { 0x0901, 0xd476, 0x0000 },

+  { 0x0901, 0xd478, 0x0000 },

+  { 0x8501, 0xd489, 0x5000 },

+  { 0x8901, 0xd481, 0x4000 },

+  { 0x8901, 0xd47d, 0x3000 },

+  { 0x8901, 0xd47b, 0x2000 },

+  { 0x0901, 0xd47a, 0x0000 },

+  { 0x0901, 0xd47c, 0x0000 },

+  { 0x8901, 0xd47f, 0x2000 },

+  { 0x0901, 0xd47e, 0x0000 },

+  { 0x0901, 0xd480, 0x0000 },

+  { 0x8501, 0xd485, 0x3000 },

+  { 0x8501, 0xd483, 0x2000 },

+  { 0x0501, 0xd482, 0x0000 },

+  { 0x0501, 0xd484, 0x0000 },

+  { 0x8501, 0xd487, 0x2000 },

+  { 0x0501, 0xd486, 0x0000 },

+  { 0x0501, 0xd488, 0x0000 },

+  { 0x8501, 0xd491, 0x4000 },

+  { 0x8501, 0xd48d, 0x3000 },

+  { 0x8501, 0xd48b, 0x2000 },

+  { 0x0501, 0xd48a, 0x0000 },

+  { 0x0501, 0xd48c, 0x0000 },

+  { 0x8501, 0xd48f, 0x2000 },

+  { 0x0501, 0xd48e, 0x0000 },

+  { 0x0501, 0xd490, 0x0000 },

+  { 0x8501, 0xd495, 0x3000 },

+  { 0x8501, 0xd493, 0x2000 },

+  { 0x0501, 0xd492, 0x0000 },

+  { 0x0501, 0xd494, 0x0000 },

+  { 0x8501, 0xd497, 0x2000 },

+  { 0x0501, 0xd496, 0x0000 },

+  { 0x0501, 0xd498, 0x0000 },

+  { 0x8501, 0xd4c3, 0x6000 },

+  { 0x8901, 0xd4b1, 0x5000 },

+  { 0x8901, 0xd4a6, 0x4000 },

+  { 0x8901, 0xd49e, 0x3000 },

+  { 0x8501, 0xd49b, 0x2000 },

+  { 0x0501, 0xd49a, 0x0000 },

+  { 0x0901, 0xd49c, 0x0000 },

+  { 0x8901, 0xd4a2, 0x2000 },

+  { 0x0901, 0xd49f, 0x0000 },

+  { 0x0901, 0xd4a5, 0x0000 },

+  { 0x8901, 0xd4ac, 0x3000 },

+  { 0x8901, 0xd4aa, 0x2000 },

+  { 0x0901, 0xd4a9, 0x0000 },

+  { 0x0901, 0xd4ab, 0x0000 },

+  { 0x8901, 0xd4af, 0x2000 },

+  { 0x0901, 0xd4ae, 0x0000 },

+  { 0x0901, 0xd4b0, 0x0000 },

+  { 0x8501, 0xd4b9, 0x4000 },

+  { 0x8901, 0xd4b5, 0x3000 },

+  { 0x8901, 0xd4b3, 0x2000 },

+  { 0x0901, 0xd4b2, 0x0000 },

+  { 0x0901, 0xd4b4, 0x0000 },

+  { 0x8501, 0xd4b7, 0x2000 },

+  { 0x0501, 0xd4b6, 0x0000 },

+  { 0x0501, 0xd4b8, 0x0000 },

+  { 0x8501, 0xd4bf, 0x3000 },

+  { 0x8501, 0xd4bd, 0x2000 },

+  { 0x0501, 0xd4bb, 0x0000 },

+  { 0x0501, 0xd4be, 0x0000 },

+  { 0x8501, 0xd4c1, 0x2000 },

+  { 0x0501, 0xd4c0, 0x0000 },

+  { 0x0501, 0xd4c2, 0x0000 },

+  { 0x8901, 0xd4d4, 0x5000 },

+  { 0x8501, 0xd4cc, 0x4000 },

+  { 0x8501, 0xd4c8, 0x3000 },

+  { 0x8501, 0xd4c6, 0x2000 },

+  { 0x0501, 0xd4c5, 0x0000 },

+  { 0x0501, 0xd4c7, 0x0000 },

+  { 0x8501, 0xd4ca, 0x2000 },

+  { 0x0501, 0xd4c9, 0x0000 },

+  { 0x0501, 0xd4cb, 0x0000 },

+  { 0x8901, 0xd4d0, 0x3000 },

+  { 0x8501, 0xd4ce, 0x2000 },

+  { 0x0501, 0xd4cd, 0x0000 },

+  { 0x0501, 0xd4cf, 0x0000 },

+  { 0x8901, 0xd4d2, 0x2000 },

+  { 0x0901, 0xd4d1, 0x0000 },

+  { 0x0901, 0xd4d3, 0x0000 },

+  { 0x8901, 0xd4dc, 0x4000 },

+  { 0x8901, 0xd4d8, 0x3000 },

+  { 0x8901, 0xd4d6, 0x2000 },

+  { 0x0901, 0xd4d5, 0x0000 },

+  { 0x0901, 0xd4d7, 0x0000 },

+  { 0x8901, 0xd4da, 0x2000 },

+  { 0x0901, 0xd4d9, 0x0000 },

+  { 0x0901, 0xd4db, 0x0000 },

+  { 0x8901, 0xd4e0, 0x3000 },

+  { 0x8901, 0xd4de, 0x2000 },

+  { 0x0901, 0xd4dd, 0x0000 },

+  { 0x0901, 0xd4df, 0x0000 },

+  { 0x8901, 0xd4e2, 0x2000 },

+  { 0x0901, 0xd4e1, 0x0000 },

+  { 0x0901, 0xd4e3, 0x0000 },

+  { 0x8501, 0xd529, 0x7000 },

+  { 0x8901, 0xd504, 0x6000 },

+  { 0x8501, 0xd4f4, 0x5000 },

+  { 0x8501, 0xd4ec, 0x4000 },

+  { 0x8901, 0xd4e8, 0x3000 },

+  { 0x8901, 0xd4e6, 0x2000 },

+  { 0x0901, 0xd4e5, 0x0000 },

+  { 0x0901, 0xd4e7, 0x0000 },

+  { 0x8501, 0xd4ea, 0x2000 },

+  { 0x0901, 0xd4e9, 0x0000 },

+  { 0x0501, 0xd4eb, 0x0000 },

+  { 0x8501, 0xd4f0, 0x3000 },

+  { 0x8501, 0xd4ee, 0x2000 },

+  { 0x0501, 0xd4ed, 0x0000 },

+  { 0x0501, 0xd4ef, 0x0000 },

+  { 0x8501, 0xd4f2, 0x2000 },

+  { 0x0501, 0xd4f1, 0x0000 },

+  { 0x0501, 0xd4f3, 0x0000 },

+  { 0x8501, 0xd4fc, 0x4000 },

+  { 0x8501, 0xd4f8, 0x3000 },

+  { 0x8501, 0xd4f6, 0x2000 },

+  { 0x0501, 0xd4f5, 0x0000 },

+  { 0x0501, 0xd4f7, 0x0000 },

+  { 0x8501, 0xd4fa, 0x2000 },

+  { 0x0501, 0xd4f9, 0x0000 },

+  { 0x0501, 0xd4fb, 0x0000 },

+  { 0x8501, 0xd500, 0x3000 },

+  { 0x8501, 0xd4fe, 0x2000 },

+  { 0x0501, 0xd4fd, 0x0000 },

+  { 0x0501, 0xd4ff, 0x0000 },

+  { 0x8501, 0xd502, 0x2000 },

+  { 0x0501, 0xd501, 0x0000 },

+  { 0x0501, 0xd503, 0x0000 },

+  { 0x8901, 0xd518, 0x5000 },

+  { 0x8901, 0xd50f, 0x4000 },

+  { 0x8901, 0xd509, 0x3000 },

+  { 0x8901, 0xd507, 0x2000 },

+  { 0x0901, 0xd505, 0x0000 },

+  { 0x0901, 0xd508, 0x0000 },

+  { 0x8901, 0xd50d, 0x2000 },

+  { 0x0901, 0xd50a, 0x0000 },

+  { 0x0901, 0xd50e, 0x0000 },

+  { 0x8901, 0xd513, 0x3000 },

+  { 0x8901, 0xd511, 0x2000 },

+  { 0x0901, 0xd510, 0x0000 },

+  { 0x0901, 0xd512, 0x0000 },

+  { 0x8901, 0xd516, 0x2000 },

+  { 0x0901, 0xd514, 0x0000 },

+  { 0x0901, 0xd517, 0x0000 },

+  { 0x8501, 0xd521, 0x4000 },

+  { 0x8901, 0xd51c, 0x3000 },

+  { 0x8901, 0xd51a, 0x2000 },

+  { 0x0901, 0xd519, 0x0000 },

+  { 0x0901, 0xd51b, 0x0000 },

+  { 0x8501, 0xd51f, 0x2000 },

+  { 0x0501, 0xd51e, 0x0000 },

+  { 0x0501, 0xd520, 0x0000 },

+  { 0x8501, 0xd525, 0x3000 },

+  { 0x8501, 0xd523, 0x2000 },

+  { 0x0501, 0xd522, 0x0000 },

+  { 0x0501, 0xd524, 0x0000 },

+  { 0x8501, 0xd527, 0x2000 },

+  { 0x0501, 0xd526, 0x0000 },

+  { 0x0501, 0xd528, 0x0000 },

+  { 0x8901, 0xd54f, 0x6000 },

+  { 0x8901, 0xd539, 0x5000 },

+  { 0x8501, 0xd531, 0x4000 },

+  { 0x8501, 0xd52d, 0x3000 },

+  { 0x8501, 0xd52b, 0x2000 },

+  { 0x0501, 0xd52a, 0x0000 },

+  { 0x0501, 0xd52c, 0x0000 },

+  { 0x8501, 0xd52f, 0x2000 },

+  { 0x0501, 0xd52e, 0x0000 },

+  { 0x0501, 0xd530, 0x0000 },

+  { 0x8501, 0xd535, 0x3000 },

+  { 0x8501, 0xd533, 0x2000 },

+  { 0x0501, 0xd532, 0x0000 },

+  { 0x0501, 0xd534, 0x0000 },

+  { 0x8501, 0xd537, 0x2000 },

+  { 0x0501, 0xd536, 0x0000 },

+  { 0x0901, 0xd538, 0x0000 },

+  { 0x8901, 0xd543, 0x4000 },

+  { 0x8901, 0xd53e, 0x3000 },

+  { 0x8901, 0xd53c, 0x2000 },

+  { 0x0901, 0xd53b, 0x0000 },

+  { 0x0901, 0xd53d, 0x0000 },

+  { 0x8901, 0xd541, 0x2000 },

+  { 0x0901, 0xd540, 0x0000 },

+  { 0x0901, 0xd542, 0x0000 },

+  { 0x8901, 0xd54b, 0x3000 },

+  { 0x8901, 0xd546, 0x2000 },

+  { 0x0901, 0xd544, 0x0000 },

+  { 0x0901, 0xd54a, 0x0000 },

+  { 0x8901, 0xd54d, 0x2000 },

+  { 0x0901, 0xd54c, 0x0000 },

+  { 0x0901, 0xd54e, 0x0000 },

+  { 0x8501, 0xd560, 0x5000 },

+  { 0x8501, 0xd558, 0x4000 },

+  { 0x8501, 0xd554, 0x3000 },

+  { 0x8501, 0xd552, 0x2000 },

+  { 0x0901, 0xd550, 0x0000 },

+  { 0x0501, 0xd553, 0x0000 },

+  { 0x8501, 0xd556, 0x2000 },

+  { 0x0501, 0xd555, 0x0000 },

+  { 0x0501, 0xd557, 0x0000 },

+  { 0x8501, 0xd55c, 0x3000 },

+  { 0x8501, 0xd55a, 0x2000 },

+  { 0x0501, 0xd559, 0x0000 },

+  { 0x0501, 0xd55b, 0x0000 },

+  { 0x8501, 0xd55e, 0x2000 },

+  { 0x0501, 0xd55d, 0x0000 },

+  { 0x0501, 0xd55f, 0x0000 },

+  { 0x8501, 0xd568, 0x4000 },

+  { 0x8501, 0xd564, 0x3000 },

+  { 0x8501, 0xd562, 0x2000 },

+  { 0x0501, 0xd561, 0x0000 },

+  { 0x0501, 0xd563, 0x0000 },

+  { 0x8501, 0xd566, 0x2000 },

+  { 0x0501, 0xd565, 0x0000 },

+  { 0x0501, 0xd567, 0x0000 },

+  { 0x8901, 0xd56c, 0x3000 },

+  { 0x8501, 0xd56a, 0x2000 },

+  { 0x0501, 0xd569, 0x0000 },

+  { 0x0501, 0xd56b, 0x0000 },

+  { 0x8901, 0xd56e, 0x2000 },

+  { 0x0901, 0xd56d, 0x0000 },

+  { 0x0901, 0xd56f, 0x0000 },

+  { 0x8501, 0xd5f0, 0x8000 },

+  { 0x8901, 0xd5b0, 0x7000 },

+  { 0x8501, 0xd590, 0x6000 },

+  { 0x8901, 0xd580, 0x5000 },

+  { 0x8901, 0xd578, 0x4000 },

+  { 0x8901, 0xd574, 0x3000 },

+  { 0x8901, 0xd572, 0x2000 },

+  { 0x0901, 0xd571, 0x0000 },

+  { 0x0901, 0xd573, 0x0000 },

+  { 0x8901, 0xd576, 0x2000 },

+  { 0x0901, 0xd575, 0x0000 },

+  { 0x0901, 0xd577, 0x0000 },

+  { 0x8901, 0xd57c, 0x3000 },

+  { 0x8901, 0xd57a, 0x2000 },

+  { 0x0901, 0xd579, 0x0000 },

+  { 0x0901, 0xd57b, 0x0000 },

+  { 0x8901, 0xd57e, 0x2000 },

+  { 0x0901, 0xd57d, 0x0000 },

+  { 0x0901, 0xd57f, 0x0000 },

+  { 0x8501, 0xd588, 0x4000 },

+  { 0x8901, 0xd584, 0x3000 },

+  { 0x8901, 0xd582, 0x2000 },

+  { 0x0901, 0xd581, 0x0000 },

+  { 0x0901, 0xd583, 0x0000 },

+  { 0x8501, 0xd586, 0x2000 },

+  { 0x0901, 0xd585, 0x0000 },

+  { 0x0501, 0xd587, 0x0000 },

+  { 0x8501, 0xd58c, 0x3000 },

+  { 0x8501, 0xd58a, 0x2000 },

+  { 0x0501, 0xd589, 0x0000 },

+  { 0x0501, 0xd58b, 0x0000 },

+  { 0x8501, 0xd58e, 0x2000 },

+  { 0x0501, 0xd58d, 0x0000 },

+  { 0x0501, 0xd58f, 0x0000 },

+  { 0x8901, 0xd5a0, 0x5000 },

+  { 0x8501, 0xd598, 0x4000 },

+  { 0x8501, 0xd594, 0x3000 },

+  { 0x8501, 0xd592, 0x2000 },

+  { 0x0501, 0xd591, 0x0000 },

+  { 0x0501, 0xd593, 0x0000 },

+  { 0x8501, 0xd596, 0x2000 },

+  { 0x0501, 0xd595, 0x0000 },

+  { 0x0501, 0xd597, 0x0000 },

+  { 0x8501, 0xd59c, 0x3000 },

+  { 0x8501, 0xd59a, 0x2000 },

+  { 0x0501, 0xd599, 0x0000 },

+  { 0x0501, 0xd59b, 0x0000 },

+  { 0x8501, 0xd59e, 0x2000 },

+  { 0x0501, 0xd59d, 0x0000 },

+  { 0x0501, 0xd59f, 0x0000 },

+  { 0x8901, 0xd5a8, 0x4000 },

+  { 0x8901, 0xd5a4, 0x3000 },

+  { 0x8901, 0xd5a2, 0x2000 },

+  { 0x0901, 0xd5a1, 0x0000 },

+  { 0x0901, 0xd5a3, 0x0000 },

+  { 0x8901, 0xd5a6, 0x2000 },

+  { 0x0901, 0xd5a5, 0x0000 },

+  { 0x0901, 0xd5a7, 0x0000 },

+  { 0x8901, 0xd5ac, 0x3000 },

+  { 0x8901, 0xd5aa, 0x2000 },

+  { 0x0901, 0xd5a9, 0x0000 },

+  { 0x0901, 0xd5ab, 0x0000 },

+  { 0x8901, 0xd5ae, 0x2000 },

+  { 0x0901, 0xd5ad, 0x0000 },

+  { 0x0901, 0xd5af, 0x0000 },

+  { 0x8501, 0xd5d0, 0x6000 },

+  { 0x8501, 0xd5c0, 0x5000 },

+  { 0x8901, 0xd5b8, 0x4000 },

+  { 0x8901, 0xd5b4, 0x3000 },

+  { 0x8901, 0xd5b2, 0x2000 },

+  { 0x0901, 0xd5b1, 0x0000 },

+  { 0x0901, 0xd5b3, 0x0000 },

+  { 0x8901, 0xd5b6, 0x2000 },

+  { 0x0901, 0xd5b5, 0x0000 },

+  { 0x0901, 0xd5b7, 0x0000 },

+  { 0x8501, 0xd5bc, 0x3000 },

+  { 0x8501, 0xd5ba, 0x2000 },

+  { 0x0901, 0xd5b9, 0x0000 },

+  { 0x0501, 0xd5bb, 0x0000 },

+  { 0x8501, 0xd5be, 0x2000 },

+  { 0x0501, 0xd5bd, 0x0000 },

+  { 0x0501, 0xd5bf, 0x0000 },

+  { 0x8501, 0xd5c8, 0x4000 },

+  { 0x8501, 0xd5c4, 0x3000 },

+  { 0x8501, 0xd5c2, 0x2000 },

+  { 0x0501, 0xd5c1, 0x0000 },

+  { 0x0501, 0xd5c3, 0x0000 },

+  { 0x8501, 0xd5c6, 0x2000 },

+  { 0x0501, 0xd5c5, 0x0000 },

+  { 0x0501, 0xd5c7, 0x0000 },

+  { 0x8501, 0xd5cc, 0x3000 },

+  { 0x8501, 0xd5ca, 0x2000 },

+  { 0x0501, 0xd5c9, 0x0000 },

+  { 0x0501, 0xd5cb, 0x0000 },

+  { 0x8501, 0xd5ce, 0x2000 },

+  { 0x0501, 0xd5cd, 0x0000 },

+  { 0x0501, 0xd5cf, 0x0000 },

+  { 0x8901, 0xd5e0, 0x5000 },

+  { 0x8901, 0xd5d8, 0x4000 },

+  { 0x8901, 0xd5d4, 0x3000 },

+  { 0x8501, 0xd5d2, 0x2000 },

+  { 0x0501, 0xd5d1, 0x0000 },

+  { 0x0501, 0xd5d3, 0x0000 },

+  { 0x8901, 0xd5d6, 0x2000 },

+  { 0x0901, 0xd5d5, 0x0000 },

+  { 0x0901, 0xd5d7, 0x0000 },

+  { 0x8901, 0xd5dc, 0x3000 },

+  { 0x8901, 0xd5da, 0x2000 },

+  { 0x0901, 0xd5d9, 0x0000 },

+  { 0x0901, 0xd5db, 0x0000 },

+  { 0x8901, 0xd5de, 0x2000 },

+  { 0x0901, 0xd5dd, 0x0000 },

+  { 0x0901, 0xd5df, 0x0000 },

+  { 0x8901, 0xd5e8, 0x4000 },

+  { 0x8901, 0xd5e4, 0x3000 },

+  { 0x8901, 0xd5e2, 0x2000 },

+  { 0x0901, 0xd5e1, 0x0000 },

+  { 0x0901, 0xd5e3, 0x0000 },

+  { 0x8901, 0xd5e6, 0x2000 },

+  { 0x0901, 0xd5e5, 0x0000 },

+  { 0x0901, 0xd5e7, 0x0000 },

+  { 0x8901, 0xd5ec, 0x3000 },

+  { 0x8901, 0xd5ea, 0x2000 },

+  { 0x0901, 0xd5e9, 0x0000 },

+  { 0x0901, 0xd5eb, 0x0000 },

+  { 0x8501, 0xd5ee, 0x2000 },

+  { 0x0901, 0xd5ed, 0x0000 },

+  { 0x0501, 0xd5ef, 0x0000 },

+  { 0x8501, 0xd630, 0x7000 },

+  { 0x8901, 0xd610, 0x6000 },

+  { 0x8501, 0xd600, 0x5000 },

+  { 0x8501, 0xd5f8, 0x4000 },

+  { 0x8501, 0xd5f4, 0x3000 },

+  { 0x8501, 0xd5f2, 0x2000 },

+  { 0x0501, 0xd5f1, 0x0000 },

+  { 0x0501, 0xd5f3, 0x0000 },

+  { 0x8501, 0xd5f6, 0x2000 },

+  { 0x0501, 0xd5f5, 0x0000 },

+  { 0x0501, 0xd5f7, 0x0000 },

+  { 0x8501, 0xd5fc, 0x3000 },

+  { 0x8501, 0xd5fa, 0x2000 },

+  { 0x0501, 0xd5f9, 0x0000 },

+  { 0x0501, 0xd5fb, 0x0000 },

+  { 0x8501, 0xd5fe, 0x2000 },

+  { 0x0501, 0xd5fd, 0x0000 },

+  { 0x0501, 0xd5ff, 0x0000 },

+  { 0x8901, 0xd608, 0x4000 },

+  { 0x8501, 0xd604, 0x3000 },

+  { 0x8501, 0xd602, 0x2000 },

+  { 0x0501, 0xd601, 0x0000 },

+  { 0x0501, 0xd603, 0x0000 },

+  { 0x8501, 0xd606, 0x2000 },

+  { 0x0501, 0xd605, 0x0000 },

+  { 0x0501, 0xd607, 0x0000 },

+  { 0x8901, 0xd60c, 0x3000 },

+  { 0x8901, 0xd60a, 0x2000 },

+  { 0x0901, 0xd609, 0x0000 },

+  { 0x0901, 0xd60b, 0x0000 },

+  { 0x8901, 0xd60e, 0x2000 },

+  { 0x0901, 0xd60d, 0x0000 },

+  { 0x0901, 0xd60f, 0x0000 },

+  { 0x8901, 0xd620, 0x5000 },

+  { 0x8901, 0xd618, 0x4000 },

+  { 0x8901, 0xd614, 0x3000 },

+  { 0x8901, 0xd612, 0x2000 },

+  { 0x0901, 0xd611, 0x0000 },

+  { 0x0901, 0xd613, 0x0000 },

+  { 0x8901, 0xd616, 0x2000 },

+  { 0x0901, 0xd615, 0x0000 },

+  { 0x0901, 0xd617, 0x0000 },

+  { 0x8901, 0xd61c, 0x3000 },

+  { 0x8901, 0xd61a, 0x2000 },

+  { 0x0901, 0xd619, 0x0000 },

+  { 0x0901, 0xd61b, 0x0000 },

+  { 0x8901, 0xd61e, 0x2000 },

+  { 0x0901, 0xd61d, 0x0000 },

+  { 0x0901, 0xd61f, 0x0000 },

+  { 0x8501, 0xd628, 0x4000 },

+  { 0x8501, 0xd624, 0x3000 },

+  { 0x8501, 0xd622, 0x2000 },

+  { 0x0901, 0xd621, 0x0000 },

+  { 0x0501, 0xd623, 0x0000 },

+  { 0x8501, 0xd626, 0x2000 },

+  { 0x0501, 0xd625, 0x0000 },

+  { 0x0501, 0xd627, 0x0000 },

+  { 0x8501, 0xd62c, 0x3000 },

+  { 0x8501, 0xd62a, 0x2000 },

+  { 0x0501, 0xd629, 0x0000 },

+  { 0x0501, 0xd62b, 0x0000 },

+  { 0x8501, 0xd62e, 0x2000 },

+  { 0x0501, 0xd62d, 0x0000 },

+  { 0x0501, 0xd62f, 0x0000 },

+  { 0x8901, 0xd650, 0x6000 },

+  { 0x8901, 0xd640, 0x5000 },

+  { 0x8501, 0xd638, 0x4000 },

+  { 0x8501, 0xd634, 0x3000 },

+  { 0x8501, 0xd632, 0x2000 },

+  { 0x0501, 0xd631, 0x0000 },

+  { 0x0501, 0xd633, 0x0000 },

+  { 0x8501, 0xd636, 0x2000 },

+  { 0x0501, 0xd635, 0x0000 },

+  { 0x0501, 0xd637, 0x0000 },

+  { 0x8901, 0xd63c, 0x3000 },

+  { 0x8501, 0xd63a, 0x2000 },

+  { 0x0501, 0xd639, 0x0000 },

+  { 0x0501, 0xd63b, 0x0000 },

+  { 0x8901, 0xd63e, 0x2000 },

+  { 0x0901, 0xd63d, 0x0000 },

+  { 0x0901, 0xd63f, 0x0000 },

+  { 0x8901, 0xd648, 0x4000 },

+  { 0x8901, 0xd644, 0x3000 },

+  { 0x8901, 0xd642, 0x2000 },

+  { 0x0901, 0xd641, 0x0000 },

+  { 0x0901, 0xd643, 0x0000 },

+  { 0x8901, 0xd646, 0x2000 },

+  { 0x0901, 0xd645, 0x0000 },

+  { 0x0901, 0xd647, 0x0000 },

+  { 0x8901, 0xd64c, 0x3000 },

+  { 0x8901, 0xd64a, 0x2000 },

+  { 0x0901, 0xd649, 0x0000 },

+  { 0x0901, 0xd64b, 0x0000 },

+  { 0x8901, 0xd64e, 0x2000 },

+  { 0x0901, 0xd64d, 0x0000 },

+  { 0x0901, 0xd64f, 0x0000 },

+  { 0x8501, 0xd660, 0x5000 },

+  { 0x8501, 0xd658, 0x4000 },

+  { 0x8901, 0xd654, 0x3000 },

+  { 0x8901, 0xd652, 0x2000 },

+  { 0x0901, 0xd651, 0x0000 },

+  { 0x0901, 0xd653, 0x0000 },

+  { 0x8501, 0xd656, 0x2000 },

+  { 0x0901, 0xd655, 0x0000 },

+  { 0x0501, 0xd657, 0x0000 },

+  { 0x8501, 0xd65c, 0x3000 },

+  { 0x8501, 0xd65a, 0x2000 },

+  { 0x0501, 0xd659, 0x0000 },

+  { 0x0501, 0xd65b, 0x0000 },

+  { 0x8501, 0xd65e, 0x2000 },

+  { 0x0501, 0xd65d, 0x0000 },

+  { 0x0501, 0xd65f, 0x0000 },

+  { 0x8501, 0xd668, 0x4000 },

+  { 0x8501, 0xd664, 0x3000 },

+  { 0x8501, 0xd662, 0x2000 },

+  { 0x0501, 0xd661, 0x0000 },

+  { 0x0501, 0xd663, 0x0000 },

+  { 0x8501, 0xd666, 0x2000 },

+  { 0x0501, 0xd665, 0x0000 },

+  { 0x0501, 0xd667, 0x0000 },

+  { 0x8501, 0xd66c, 0x3000 },

+  { 0x8501, 0xd66a, 0x2000 },

+  { 0x0501, 0xd669, 0x0000 },

+  { 0x0501, 0xd66b, 0x0000 },

+  { 0x8501, 0xd66e, 0x2000 },

+  { 0x0501, 0xd66d, 0x0000 },

+  { 0x0501, 0xd66f, 0x0000 },

+  { 0x8501, 0xd774, 0x9000 },

+  { 0x8901, 0xd6f4, 0x8000 },

+  { 0x8901, 0xd6b4, 0x7000 },

+  { 0x8501, 0xd690, 0x6000 },

+  { 0x8901, 0xd680, 0x5000 },

+  { 0x8901, 0xd678, 0x4000 },

+  { 0x8901, 0xd674, 0x3000 },

+  { 0x8901, 0xd672, 0x2000 },

+  { 0x0901, 0xd671, 0x0000 },

+  { 0x0901, 0xd673, 0x0000 },

+  { 0x8901, 0xd676, 0x2000 },

+  { 0x0901, 0xd675, 0x0000 },

+  { 0x0901, 0xd677, 0x0000 },

+  { 0x8901, 0xd67c, 0x3000 },

+  { 0x8901, 0xd67a, 0x2000 },

+  { 0x0901, 0xd679, 0x0000 },

+  { 0x0901, 0xd67b, 0x0000 },

+  { 0x8901, 0xd67e, 0x2000 },

+  { 0x0901, 0xd67d, 0x0000 },

+  { 0x0901, 0xd67f, 0x0000 },

+  { 0x8901, 0xd688, 0x4000 },

+  { 0x8901, 0xd684, 0x3000 },

+  { 0x8901, 0xd682, 0x2000 },

+  { 0x0901, 0xd681, 0x0000 },

+  { 0x0901, 0xd683, 0x0000 },

+  { 0x8901, 0xd686, 0x2000 },

+  { 0x0901, 0xd685, 0x0000 },

+  { 0x0901, 0xd687, 0x0000 },

+  { 0x8501, 0xd68c, 0x3000 },

+  { 0x8501, 0xd68a, 0x2000 },

+  { 0x0901, 0xd689, 0x0000 },

+  { 0x0501, 0xd68b, 0x0000 },

+  { 0x8501, 0xd68e, 0x2000 },

+  { 0x0501, 0xd68d, 0x0000 },

+  { 0x0501, 0xd68f, 0x0000 },

+  { 0x8501, 0xd6a0, 0x5000 },

+  { 0x8501, 0xd698, 0x4000 },

+  { 0x8501, 0xd694, 0x3000 },

+  { 0x8501, 0xd692, 0x2000 },

+  { 0x0501, 0xd691, 0x0000 },

+  { 0x0501, 0xd693, 0x0000 },

+  { 0x8501, 0xd696, 0x2000 },

+  { 0x0501, 0xd695, 0x0000 },

+  { 0x0501, 0xd697, 0x0000 },

+  { 0x8501, 0xd69c, 0x3000 },

+  { 0x8501, 0xd69a, 0x2000 },

+  { 0x0501, 0xd699, 0x0000 },

+  { 0x0501, 0xd69b, 0x0000 },

+  { 0x8501, 0xd69e, 0x2000 },

+  { 0x0501, 0xd69d, 0x0000 },

+  { 0x0501, 0xd69f, 0x0000 },

+  { 0x8901, 0xd6ac, 0x4000 },

+  { 0x8901, 0xd6a8, 0x3000 },

+  { 0x8501, 0xd6a2, 0x2000 },

+  { 0x0501, 0xd6a1, 0x0000 },

+  { 0x0501, 0xd6a3, 0x0000 },

+  { 0x8901, 0xd6aa, 0x2000 },

+  { 0x0901, 0xd6a9, 0x0000 },

+  { 0x0901, 0xd6ab, 0x0000 },

+  { 0x8901, 0xd6b0, 0x3000 },

+  { 0x8901, 0xd6ae, 0x2000 },

+  { 0x0901, 0xd6ad, 0x0000 },

+  { 0x0901, 0xd6af, 0x0000 },

+  { 0x8901, 0xd6b2, 0x2000 },

+  { 0x0901, 0xd6b1, 0x0000 },

+  { 0x0901, 0xd6b3, 0x0000 },

+  { 0x8501, 0xd6d4, 0x6000 },

+  { 0x8501, 0xd6c4, 0x5000 },

+  { 0x8901, 0xd6bc, 0x4000 },

+  { 0x8901, 0xd6b8, 0x3000 },

+  { 0x8901, 0xd6b6, 0x2000 },

+  { 0x0901, 0xd6b5, 0x0000 },

+  { 0x0901, 0xd6b7, 0x0000 },

+  { 0x8901, 0xd6ba, 0x2000 },

+  { 0x0901, 0xd6b9, 0x0000 },

+  { 0x0901, 0xd6bb, 0x0000 },

+  { 0x8901, 0xd6c0, 0x3000 },

+  { 0x8901, 0xd6be, 0x2000 },

+  { 0x0901, 0xd6bd, 0x0000 },

+  { 0x0901, 0xd6bf, 0x0000 },

+  { 0x8501, 0xd6c2, 0x2000 },

+  { 0x1901, 0xd6c1, 0x0000 },

+  { 0x0501, 0xd6c3, 0x0000 },

+  { 0x8501, 0xd6cc, 0x4000 },

+  { 0x8501, 0xd6c8, 0x3000 },

+  { 0x8501, 0xd6c6, 0x2000 },

+  { 0x0501, 0xd6c5, 0x0000 },

+  { 0x0501, 0xd6c7, 0x0000 },

+  { 0x8501, 0xd6ca, 0x2000 },

+  { 0x0501, 0xd6c9, 0x0000 },

+  { 0x0501, 0xd6cb, 0x0000 },

+  { 0x8501, 0xd6d0, 0x3000 },

+  { 0x8501, 0xd6ce, 0x2000 },

+  { 0x0501, 0xd6cd, 0x0000 },

+  { 0x0501, 0xd6cf, 0x0000 },

+  { 0x8501, 0xd6d2, 0x2000 },

+  { 0x0501, 0xd6d1, 0x0000 },

+  { 0x0501, 0xd6d3, 0x0000 },

+  { 0x8901, 0xd6e4, 0x5000 },

+  { 0x8501, 0xd6dc, 0x4000 },

+  { 0x8501, 0xd6d8, 0x3000 },

+  { 0x8501, 0xd6d6, 0x2000 },

+  { 0x0501, 0xd6d5, 0x0000 },

+  { 0x0501, 0xd6d7, 0x0000 },

+  { 0x8501, 0xd6da, 0x2000 },

+  { 0x0501, 0xd6d9, 0x0000 },

+  { 0x1901, 0xd6db, 0x0000 },

+  { 0x8501, 0xd6e0, 0x3000 },

+  { 0x8501, 0xd6de, 0x2000 },

+  { 0x0501, 0xd6dd, 0x0000 },

+  { 0x0501, 0xd6df, 0x0000 },

+  { 0x8901, 0xd6e2, 0x2000 },

+  { 0x0501, 0xd6e1, 0x0000 },

+  { 0x0901, 0xd6e3, 0x0000 },

+  { 0x8901, 0xd6ec, 0x4000 },

+  { 0x8901, 0xd6e8, 0x3000 },

+  { 0x8901, 0xd6e6, 0x2000 },

+  { 0x0901, 0xd6e5, 0x0000 },

+  { 0x0901, 0xd6e7, 0x0000 },

+  { 0x8901, 0xd6ea, 0x2000 },

+  { 0x0901, 0xd6e9, 0x0000 },

+  { 0x0901, 0xd6eb, 0x0000 },

+  { 0x8901, 0xd6f0, 0x3000 },

+  { 0x8901, 0xd6ee, 0x2000 },

+  { 0x0901, 0xd6ed, 0x0000 },

+  { 0x0901, 0xd6ef, 0x0000 },

+  { 0x8901, 0xd6f2, 0x2000 },

+  { 0x0901, 0xd6f1, 0x0000 },

+  { 0x0901, 0xd6f3, 0x0000 },

+  { 0x8901, 0xd734, 0x7000 },

+  { 0x8501, 0xd714, 0x6000 },

+  { 0x8501, 0xd704, 0x5000 },

+  { 0x8501, 0xd6fc, 0x4000 },

+  { 0x8901, 0xd6f8, 0x3000 },

+  { 0x8901, 0xd6f6, 0x2000 },

+  { 0x0901, 0xd6f5, 0x0000 },

+  { 0x0901, 0xd6f7, 0x0000 },

+  { 0x8901, 0xd6fa, 0x2000 },

+  { 0x0901, 0xd6f9, 0x0000 },

+  { 0x1901, 0xd6fb, 0x0000 },

+  { 0x8501, 0xd700, 0x3000 },

+  { 0x8501, 0xd6fe, 0x2000 },

+  { 0x0501, 0xd6fd, 0x0000 },

+  { 0x0501, 0xd6ff, 0x0000 },

+  { 0x8501, 0xd702, 0x2000 },

+  { 0x0501, 0xd701, 0x0000 },

+  { 0x0501, 0xd703, 0x0000 },

+  { 0x8501, 0xd70c, 0x4000 },

+  { 0x8501, 0xd708, 0x3000 },

+  { 0x8501, 0xd706, 0x2000 },

+  { 0x0501, 0xd705, 0x0000 },

+  { 0x0501, 0xd707, 0x0000 },

+  { 0x8501, 0xd70a, 0x2000 },

+  { 0x0501, 0xd709, 0x0000 },

+  { 0x0501, 0xd70b, 0x0000 },

+  { 0x8501, 0xd710, 0x3000 },

+  { 0x8501, 0xd70e, 0x2000 },

+  { 0x0501, 0xd70d, 0x0000 },

+  { 0x0501, 0xd70f, 0x0000 },

+  { 0x8501, 0xd712, 0x2000 },

+  { 0x0501, 0xd711, 0x0000 },

+  { 0x0501, 0xd713, 0x0000 },

+  { 0x8901, 0xd724, 0x5000 },

+  { 0x8901, 0xd71c, 0x4000 },

+  { 0x8501, 0xd718, 0x3000 },

+  { 0x8501, 0xd716, 0x2000 },

+  { 0x1901, 0xd715, 0x0000 },

+  { 0x0501, 0xd717, 0x0000 },

+  { 0x8501, 0xd71a, 0x2000 },

+  { 0x0501, 0xd719, 0x0000 },

+  { 0x0501, 0xd71b, 0x0000 },

+  { 0x8901, 0xd720, 0x3000 },

+  { 0x8901, 0xd71e, 0x2000 },

+  { 0x0901, 0xd71d, 0x0000 },

+  { 0x0901, 0xd71f, 0x0000 },

+  { 0x8901, 0xd722, 0x2000 },

+  { 0x0901, 0xd721, 0x0000 },

+  { 0x0901, 0xd723, 0x0000 },

+  { 0x8901, 0xd72c, 0x4000 },

+  { 0x8901, 0xd728, 0x3000 },

+  { 0x8901, 0xd726, 0x2000 },

+  { 0x0901, 0xd725, 0x0000 },

+  { 0x0901, 0xd727, 0x0000 },

+  { 0x8901, 0xd72a, 0x2000 },

+  { 0x0901, 0xd729, 0x0000 },

+  { 0x0901, 0xd72b, 0x0000 },

+  { 0x8901, 0xd730, 0x3000 },

+  { 0x8901, 0xd72e, 0x2000 },

+  { 0x0901, 0xd72d, 0x0000 },

+  { 0x0901, 0xd72f, 0x0000 },

+  { 0x8901, 0xd732, 0x2000 },

+  { 0x0901, 0xd731, 0x0000 },

+  { 0x0901, 0xd733, 0x0000 },

+  { 0x8501, 0xd754, 0x6000 },

+  { 0x8501, 0xd744, 0x5000 },

+  { 0x8501, 0xd73c, 0x4000 },

+  { 0x8501, 0xd738, 0x3000 },

+  { 0x8501, 0xd736, 0x2000 },

+  { 0x1901, 0xd735, 0x0000 },

+  { 0x0501, 0xd737, 0x0000 },

+  { 0x8501, 0xd73a, 0x2000 },

+  { 0x0501, 0xd739, 0x0000 },

+  { 0x0501, 0xd73b, 0x0000 },

+  { 0x8501, 0xd740, 0x3000 },

+  { 0x8501, 0xd73e, 0x2000 },

+  { 0x0501, 0xd73d, 0x0000 },

+  { 0x0501, 0xd73f, 0x0000 },

+  { 0x8501, 0xd742, 0x2000 },

+  { 0x0501, 0xd741, 0x0000 },

+  { 0x0501, 0xd743, 0x0000 },

+  { 0x8501, 0xd74c, 0x4000 },

+  { 0x8501, 0xd748, 0x3000 },

+  { 0x8501, 0xd746, 0x2000 },

+  { 0x0501, 0xd745, 0x0000 },

+  { 0x0501, 0xd747, 0x0000 },

+  { 0x8501, 0xd74a, 0x2000 },

+  { 0x0501, 0xd749, 0x0000 },

+  { 0x0501, 0xd74b, 0x0000 },

+  { 0x8501, 0xd750, 0x3000 },

+  { 0x8501, 0xd74e, 0x2000 },

+  { 0x0501, 0xd74d, 0x0000 },

+  { 0x1901, 0xd74f, 0x0000 },

+  { 0x8501, 0xd752, 0x2000 },

+  { 0x0501, 0xd751, 0x0000 },

+  { 0x0501, 0xd753, 0x0000 },

+  { 0x8901, 0xd764, 0x5000 },

+  { 0x8901, 0xd75c, 0x4000 },

+  { 0x8901, 0xd758, 0x3000 },

+  { 0x8901, 0xd756, 0x2000 },

+  { 0x0501, 0xd755, 0x0000 },

+  { 0x0901, 0xd757, 0x0000 },

+  { 0x8901, 0xd75a, 0x2000 },

+  { 0x0901, 0xd759, 0x0000 },

+  { 0x0901, 0xd75b, 0x0000 },

+  { 0x8901, 0xd760, 0x3000 },

+  { 0x8901, 0xd75e, 0x2000 },

+  { 0x0901, 0xd75d, 0x0000 },

+  { 0x0901, 0xd75f, 0x0000 },

+  { 0x8901, 0xd762, 0x2000 },

+  { 0x0901, 0xd761, 0x0000 },

+  { 0x0901, 0xd763, 0x0000 },

+  { 0x8901, 0xd76c, 0x4000 },

+  { 0x8901, 0xd768, 0x3000 },

+  { 0x8901, 0xd766, 0x2000 },

+  { 0x0901, 0xd765, 0x0000 },

+  { 0x0901, 0xd767, 0x0000 },

+  { 0x8901, 0xd76a, 0x2000 },

+  { 0x0901, 0xd769, 0x0000 },

+  { 0x0901, 0xd76b, 0x0000 },

+  { 0x8501, 0xd770, 0x3000 },

+  { 0x8901, 0xd76e, 0x2000 },

+  { 0x0901, 0xd76d, 0x0000 },

+  { 0x1901, 0xd76f, 0x0000 },

+  { 0x8501, 0xd772, 0x2000 },

+  { 0x0501, 0xd771, 0x0000 },

+  { 0x0501, 0xd773, 0x0000 },

+  { 0x8d01, 0xd7f8, 0x8000 },

+  { 0x8501, 0xd7b4, 0x7000 },

+  { 0x8901, 0xd794, 0x6000 },

+  { 0x8501, 0xd784, 0x5000 },

+  { 0x8501, 0xd77c, 0x4000 },

+  { 0x8501, 0xd778, 0x3000 },

+  { 0x8501, 0xd776, 0x2000 },

+  { 0x0501, 0xd775, 0x0000 },

+  { 0x0501, 0xd777, 0x0000 },

+  { 0x8501, 0xd77a, 0x2000 },

+  { 0x0501, 0xd779, 0x0000 },

+  { 0x0501, 0xd77b, 0x0000 },

+  { 0x8501, 0xd780, 0x3000 },

+  { 0x8501, 0xd77e, 0x2000 },

+  { 0x0501, 0xd77d, 0x0000 },

+  { 0x0501, 0xd77f, 0x0000 },

+  { 0x8501, 0xd782, 0x2000 },

+  { 0x0501, 0xd781, 0x0000 },

+  { 0x0501, 0xd783, 0x0000 },

+  { 0x8501, 0xd78c, 0x4000 },

+  { 0x8501, 0xd788, 0x3000 },

+  { 0x8501, 0xd786, 0x2000 },

+  { 0x0501, 0xd785, 0x0000 },

+  { 0x0501, 0xd787, 0x0000 },

+  { 0x8501, 0xd78a, 0x2000 },

+  { 0x1901, 0xd789, 0x0000 },

+  { 0x0501, 0xd78b, 0x0000 },

+  { 0x8901, 0xd790, 0x3000 },

+  { 0x8501, 0xd78e, 0x2000 },

+  { 0x0501, 0xd78d, 0x0000 },

+  { 0x0501, 0xd78f, 0x0000 },

+  { 0x8901, 0xd792, 0x2000 },

+  { 0x0901, 0xd791, 0x0000 },

+  { 0x0901, 0xd793, 0x0000 },

+  { 0x8901, 0xd7a4, 0x5000 },

+  { 0x8901, 0xd79c, 0x4000 },

+  { 0x8901, 0xd798, 0x3000 },

+  { 0x8901, 0xd796, 0x2000 },

+  { 0x0901, 0xd795, 0x0000 },

+  { 0x0901, 0xd797, 0x0000 },

+  { 0x8901, 0xd79a, 0x2000 },

+  { 0x0901, 0xd799, 0x0000 },

+  { 0x0901, 0xd79b, 0x0000 },

+  { 0x8901, 0xd7a0, 0x3000 },

+  { 0x8901, 0xd79e, 0x2000 },

+  { 0x0901, 0xd79d, 0x0000 },

+  { 0x0901, 0xd79f, 0x0000 },

+  { 0x8901, 0xd7a2, 0x2000 },

+  { 0x0901, 0xd7a1, 0x0000 },

+  { 0x0901, 0xd7a3, 0x0000 },

+  { 0x8501, 0xd7ac, 0x4000 },

+  { 0x8901, 0xd7a8, 0x3000 },

+  { 0x8901, 0xd7a6, 0x2000 },

+  { 0x0901, 0xd7a5, 0x0000 },

+  { 0x0901, 0xd7a7, 0x0000 },

+  { 0x8501, 0xd7aa, 0x2000 },

+  { 0x1901, 0xd7a9, 0x0000 },

+  { 0x0501, 0xd7ab, 0x0000 },

+  { 0x8501, 0xd7b0, 0x3000 },

+  { 0x8501, 0xd7ae, 0x2000 },

+  { 0x0501, 0xd7ad, 0x0000 },

+  { 0x0501, 0xd7af, 0x0000 },

+  { 0x8501, 0xd7b2, 0x2000 },

+  { 0x0501, 0xd7b1, 0x0000 },

+  { 0x0501, 0xd7b3, 0x0000 },

+  { 0x8d01, 0xd7d8, 0x6000 },

+  { 0x8501, 0xd7c4, 0x5000 },

+  { 0x8501, 0xd7bc, 0x4000 },

+  { 0x8501, 0xd7b8, 0x3000 },

+  { 0x8501, 0xd7b6, 0x2000 },

+  { 0x0501, 0xd7b5, 0x0000 },

+  { 0x0501, 0xd7b7, 0x0000 },

+  { 0x8501, 0xd7ba, 0x2000 },

+  { 0x0501, 0xd7b9, 0x0000 },

+  { 0x0501, 0xd7bb, 0x0000 },

+  { 0x8501, 0xd7c0, 0x3000 },

+  { 0x8501, 0xd7be, 0x2000 },

+  { 0x0501, 0xd7bd, 0x0000 },

+  { 0x0501, 0xd7bf, 0x0000 },

+  { 0x8501, 0xd7c2, 0x2000 },

+  { 0x0501, 0xd7c1, 0x0000 },

+  { 0x1901, 0xd7c3, 0x0000 },

+  { 0x8d01, 0xd7d0, 0x4000 },

+  { 0x8501, 0xd7c8, 0x3000 },

+  { 0x8501, 0xd7c6, 0x2000 },

+  { 0x0501, 0xd7c5, 0x0000 },

+  { 0x0501, 0xd7c7, 0x0000 },

+  { 0x8d01, 0xd7ce, 0x2000 },

+  { 0x0501, 0xd7c9, 0x0000 },

+  { 0x0d01, 0xd7cf, 0x0000 },

+  { 0x8d01, 0xd7d4, 0x3000 },

+  { 0x8d01, 0xd7d2, 0x2000 },

+  { 0x0d01, 0xd7d1, 0x0000 },

+  { 0x0d01, 0xd7d3, 0x0000 },

+  { 0x8d01, 0xd7d6, 0x2000 },

+  { 0x0d01, 0xd7d5, 0x0000 },

+  { 0x0d01, 0xd7d7, 0x0000 },

+  { 0x8d01, 0xd7e8, 0x5000 },

+  { 0x8d01, 0xd7e0, 0x4000 },

+  { 0x8d01, 0xd7dc, 0x3000 },

+  { 0x8d01, 0xd7da, 0x2000 },

+  { 0x0d01, 0xd7d9, 0x0000 },

+  { 0x0d01, 0xd7db, 0x0000 },

+  { 0x8d01, 0xd7de, 0x2000 },

+  { 0x0d01, 0xd7dd, 0x0000 },

+  { 0x0d01, 0xd7df, 0x0000 },

+  { 0x8d01, 0xd7e4, 0x3000 },

+  { 0x8d01, 0xd7e2, 0x2000 },

+  { 0x0d01, 0xd7e1, 0x0000 },

+  { 0x0d01, 0xd7e3, 0x0000 },

+  { 0x8d01, 0xd7e6, 0x2000 },

+  { 0x0d01, 0xd7e5, 0x0000 },

+  { 0x0d01, 0xd7e7, 0x0000 },

+  { 0x8d01, 0xd7f0, 0x4000 },

+  { 0x8d01, 0xd7ec, 0x3000 },

+  { 0x8d01, 0xd7ea, 0x2000 },

+  { 0x0d01, 0xd7e9, 0x0000 },

+  { 0x0d01, 0xd7eb, 0x0000 },

+  { 0x8d01, 0xd7ee, 0x2000 },

+  { 0x0d01, 0xd7ed, 0x0000 },

+  { 0x0d01, 0xd7ef, 0x0000 },

+  { 0x8d01, 0xd7f4, 0x3000 },

+  { 0x8d01, 0xd7f2, 0x2000 },

+  { 0x0d01, 0xd7f1, 0x0000 },

+  { 0x0d01, 0xd7f3, 0x0000 },

+  { 0x8d01, 0xd7f6, 0x2000 },

+  { 0x0d01, 0xd7f5, 0x0000 },

+  { 0x0d01, 0xd7f7, 0x0000 },

+  { 0x8702, 0xf836, 0x7000 },

+  { 0x8702, 0xf816, 0x6000 },

+  { 0x8702, 0xf806, 0x5000 },

+  { 0x8702, 0x0000, 0x4000 },

+  { 0x8d01, 0xd7fc, 0x3000 },

+  { 0x8d01, 0xd7fa, 0x2000 },

+  { 0x0d01, 0xd7f9, 0x0000 },

+  { 0x0d01, 0xd7fb, 0x0000 },

+  { 0x8d01, 0xd7fe, 0x2000 },

+  { 0x0d01, 0xd7fd, 0x0000 },

+  { 0x0d01, 0xd7ff, 0x0000 },

+  { 0x8702, 0xf802, 0x3000 },

+  { 0x8702, 0xf800, 0x2000 },

+  { 0x0702, 0xa6d6, 0x0000 },

+  { 0x0702, 0xf801, 0x0000 },

+  { 0x8702, 0xf804, 0x2000 },

+  { 0x0702, 0xf803, 0x0000 },

+  { 0x0702, 0xf805, 0x0000 },

+  { 0x8702, 0xf80e, 0x4000 },

+  { 0x8702, 0xf80a, 0x3000 },

+  { 0x8702, 0xf808, 0x2000 },

+  { 0x0702, 0xf807, 0x0000 },

+  { 0x0702, 0xf809, 0x0000 },

+  { 0x8702, 0xf80c, 0x2000 },

+  { 0x0702, 0xf80b, 0x0000 },

+  { 0x0702, 0xf80d, 0x0000 },

+  { 0x8702, 0xf812, 0x3000 },

+  { 0x8702, 0xf810, 0x2000 },

+  { 0x0702, 0xf80f, 0x0000 },

+  { 0x0702, 0xf811, 0x0000 },

+  { 0x8702, 0xf814, 0x2000 },

+  { 0x0702, 0xf813, 0x0000 },

+  { 0x0702, 0xf815, 0x0000 },

+  { 0x8702, 0xf826, 0x5000 },

+  { 0x8702, 0xf81e, 0x4000 },

+  { 0x8702, 0xf81a, 0x3000 },

+  { 0x8702, 0xf818, 0x2000 },

+  { 0x0702, 0xf817, 0x0000 },

+  { 0x0702, 0xf819, 0x0000 },

+  { 0x8702, 0xf81c, 0x2000 },

+  { 0x0702, 0xf81b, 0x0000 },

+  { 0x0702, 0xf81d, 0x0000 },

+  { 0x8702, 0xf822, 0x3000 },

+  { 0x8702, 0xf820, 0x2000 },

+  { 0x0702, 0xf81f, 0x0000 },

+  { 0x0702, 0xf821, 0x0000 },

+  { 0x8702, 0xf824, 0x2000 },

+  { 0x0702, 0xf823, 0x0000 },

+  { 0x0702, 0xf825, 0x0000 },

+  { 0x8702, 0xf82e, 0x4000 },

+  { 0x8702, 0xf82a, 0x3000 },

+  { 0x8702, 0xf828, 0x2000 },

+  { 0x0702, 0xf827, 0x0000 },

+  { 0x0702, 0xf829, 0x0000 },

+  { 0x8702, 0xf82c, 0x2000 },

+  { 0x0702, 0xf82b, 0x0000 },

+  { 0x0702, 0xf82d, 0x0000 },

+  { 0x8702, 0xf832, 0x3000 },

+  { 0x8702, 0xf830, 0x2000 },

+  { 0x0702, 0xf82f, 0x0000 },

+  { 0x0702, 0xf831, 0x0000 },

+  { 0x8702, 0xf834, 0x2000 },

+  { 0x0702, 0xf833, 0x0000 },

+  { 0x0702, 0xf835, 0x0000 },

+  { 0x8702, 0xf856, 0x6000 },

+  { 0x8702, 0xf846, 0x5000 },

+  { 0x8702, 0xf83e, 0x4000 },

+  { 0x8702, 0xf83a, 0x3000 },

+  { 0x8702, 0xf838, 0x2000 },

+  { 0x0702, 0xf837, 0x0000 },

+  { 0x0702, 0xf839, 0x0000 },

+  { 0x8702, 0xf83c, 0x2000 },

+  { 0x0702, 0xf83b, 0x0000 },

+  { 0x0702, 0xf83d, 0x0000 },

+  { 0x8702, 0xf842, 0x3000 },

+  { 0x8702, 0xf840, 0x2000 },

+  { 0x0702, 0xf83f, 0x0000 },

+  { 0x0702, 0xf841, 0x0000 },

+  { 0x8702, 0xf844, 0x2000 },

+  { 0x0702, 0xf843, 0x0000 },

+  { 0x0702, 0xf845, 0x0000 },

+  { 0x8702, 0xf84e, 0x4000 },

+  { 0x8702, 0xf84a, 0x3000 },

+  { 0x8702, 0xf848, 0x2000 },

+  { 0x0702, 0xf847, 0x0000 },

+  { 0x0702, 0xf849, 0x0000 },

+  { 0x8702, 0xf84c, 0x2000 },

+  { 0x0702, 0xf84b, 0x0000 },

+  { 0x0702, 0xf84d, 0x0000 },

+  { 0x8702, 0xf852, 0x3000 },

+  { 0x8702, 0xf850, 0x2000 },

+  { 0x0702, 0xf84f, 0x0000 },

+  { 0x0702, 0xf851, 0x0000 },

+  { 0x8702, 0xf854, 0x2000 },

+  { 0x0702, 0xf853, 0x0000 },

+  { 0x0702, 0xf855, 0x0000 },

+  { 0x8702, 0xf866, 0x5000 },

+  { 0x8702, 0xf85e, 0x4000 },

+  { 0x8702, 0xf85a, 0x3000 },

+  { 0x8702, 0xf858, 0x2000 },

+  { 0x0702, 0xf857, 0x0000 },

+  { 0x0702, 0xf859, 0x0000 },

+  { 0x8702, 0xf85c, 0x2000 },

+  { 0x0702, 0xf85b, 0x0000 },

+  { 0x0702, 0xf85d, 0x0000 },

+  { 0x8702, 0xf862, 0x3000 },

+  { 0x8702, 0xf860, 0x2000 },

+  { 0x0702, 0xf85f, 0x0000 },

+  { 0x0702, 0xf861, 0x0000 },

+  { 0x8702, 0xf864, 0x2000 },

+  { 0x0702, 0xf863, 0x0000 },

+  { 0x0702, 0xf865, 0x0000 },

+  { 0x8702, 0xf86e, 0x4000 },

+  { 0x8702, 0xf86a, 0x3000 },

+  { 0x8702, 0xf868, 0x2000 },

+  { 0x0702, 0xf867, 0x0000 },

+  { 0x0702, 0xf869, 0x0000 },

+  { 0x8702, 0xf86c, 0x2000 },

+  { 0x0702, 0xf86b, 0x0000 },

+  { 0x0702, 0xf86d, 0x0000 },

+  { 0x8702, 0xf872, 0x3000 },

+  { 0x8702, 0xf870, 0x2000 },

+  { 0x0702, 0xf86f, 0x0000 },

+  { 0x0702, 0xf871, 0x0000 },

+  { 0x8702, 0xf874, 0x2000 },

+  { 0x0702, 0xf873, 0x0000 },

+  { 0x0702, 0xf875, 0x0000 },

+  { 0x8702, 0xf976, 0x9000 },

+  { 0x8702, 0xf8f6, 0x8000 },

+  { 0x8702, 0xf8b6, 0x7000 },

+  { 0x8702, 0xf896, 0x6000 },

+  { 0x8702, 0xf886, 0x5000 },

+  { 0x8702, 0xf87e, 0x4000 },

+  { 0x8702, 0xf87a, 0x3000 },

+  { 0x8702, 0xf878, 0x2000 },

+  { 0x0702, 0xf877, 0x0000 },

+  { 0x0702, 0xf879, 0x0000 },

+  { 0x8702, 0xf87c, 0x2000 },

+  { 0x0702, 0xf87b, 0x0000 },

+  { 0x0702, 0xf87d, 0x0000 },

+  { 0x8702, 0xf882, 0x3000 },

+  { 0x8702, 0xf880, 0x2000 },

+  { 0x0702, 0xf87f, 0x0000 },

+  { 0x0702, 0xf881, 0x0000 },

+  { 0x8702, 0xf884, 0x2000 },

+  { 0x0702, 0xf883, 0x0000 },

+  { 0x0702, 0xf885, 0x0000 },

+  { 0x8702, 0xf88e, 0x4000 },

+  { 0x8702, 0xf88a, 0x3000 },

+  { 0x8702, 0xf888, 0x2000 },

+  { 0x0702, 0xf887, 0x0000 },

+  { 0x0702, 0xf889, 0x0000 },

+  { 0x8702, 0xf88c, 0x2000 },

+  { 0x0702, 0xf88b, 0x0000 },

+  { 0x0702, 0xf88d, 0x0000 },

+  { 0x8702, 0xf892, 0x3000 },

+  { 0x8702, 0xf890, 0x2000 },

+  { 0x0702, 0xf88f, 0x0000 },

+  { 0x0702, 0xf891, 0x0000 },

+  { 0x8702, 0xf894, 0x2000 },

+  { 0x0702, 0xf893, 0x0000 },

+  { 0x0702, 0xf895, 0x0000 },

+  { 0x8702, 0xf8a6, 0x5000 },

+  { 0x8702, 0xf89e, 0x4000 },

+  { 0x8702, 0xf89a, 0x3000 },

+  { 0x8702, 0xf898, 0x2000 },

+  { 0x0702, 0xf897, 0x0000 },

+  { 0x0702, 0xf899, 0x0000 },

+  { 0x8702, 0xf89c, 0x2000 },

+  { 0x0702, 0xf89b, 0x0000 },

+  { 0x0702, 0xf89d, 0x0000 },

+  { 0x8702, 0xf8a2, 0x3000 },

+  { 0x8702, 0xf8a0, 0x2000 },

+  { 0x0702, 0xf89f, 0x0000 },

+  { 0x0702, 0xf8a1, 0x0000 },

+  { 0x8702, 0xf8a4, 0x2000 },

+  { 0x0702, 0xf8a3, 0x0000 },

+  { 0x0702, 0xf8a5, 0x0000 },

+  { 0x8702, 0xf8ae, 0x4000 },

+  { 0x8702, 0xf8aa, 0x3000 },

+  { 0x8702, 0xf8a8, 0x2000 },

+  { 0x0702, 0xf8a7, 0x0000 },

+  { 0x0702, 0xf8a9, 0x0000 },

+  { 0x8702, 0xf8ac, 0x2000 },

+  { 0x0702, 0xf8ab, 0x0000 },

+  { 0x0702, 0xf8ad, 0x0000 },

+  { 0x8702, 0xf8b2, 0x3000 },

+  { 0x8702, 0xf8b0, 0x2000 },

+  { 0x0702, 0xf8af, 0x0000 },

+  { 0x0702, 0xf8b1, 0x0000 },

+  { 0x8702, 0xf8b4, 0x2000 },

+  { 0x0702, 0xf8b3, 0x0000 },

+  { 0x0702, 0xf8b5, 0x0000 },

+  { 0x8702, 0xf8d6, 0x6000 },

+  { 0x8702, 0xf8c6, 0x5000 },

+  { 0x8702, 0xf8be, 0x4000 },

+  { 0x8702, 0xf8ba, 0x3000 },

+  { 0x8702, 0xf8b8, 0x2000 },

+  { 0x0702, 0xf8b7, 0x0000 },

+  { 0x0702, 0xf8b9, 0x0000 },

+  { 0x8702, 0xf8bc, 0x2000 },

+  { 0x0702, 0xf8bb, 0x0000 },

+  { 0x0702, 0xf8bd, 0x0000 },

+  { 0x8702, 0xf8c2, 0x3000 },

+  { 0x8702, 0xf8c0, 0x2000 },

+  { 0x0702, 0xf8bf, 0x0000 },

+  { 0x0702, 0xf8c1, 0x0000 },

+  { 0x8702, 0xf8c4, 0x2000 },

+  { 0x0702, 0xf8c3, 0x0000 },

+  { 0x0702, 0xf8c5, 0x0000 },

+  { 0x8702, 0xf8ce, 0x4000 },

+  { 0x8702, 0xf8ca, 0x3000 },

+  { 0x8702, 0xf8c8, 0x2000 },

+  { 0x0702, 0xf8c7, 0x0000 },

+  { 0x0702, 0xf8c9, 0x0000 },

+  { 0x8702, 0xf8cc, 0x2000 },

+  { 0x0702, 0xf8cb, 0x0000 },

+  { 0x0702, 0xf8cd, 0x0000 },

+  { 0x8702, 0xf8d2, 0x3000 },

+  { 0x8702, 0xf8d0, 0x2000 },

+  { 0x0702, 0xf8cf, 0x0000 },

+  { 0x0702, 0xf8d1, 0x0000 },

+  { 0x8702, 0xf8d4, 0x2000 },

+  { 0x0702, 0xf8d3, 0x0000 },

+  { 0x0702, 0xf8d5, 0x0000 },

+  { 0x8702, 0xf8e6, 0x5000 },

+  { 0x8702, 0xf8de, 0x4000 },

+  { 0x8702, 0xf8da, 0x3000 },

+  { 0x8702, 0xf8d8, 0x2000 },

+  { 0x0702, 0xf8d7, 0x0000 },

+  { 0x0702, 0xf8d9, 0x0000 },

+  { 0x8702, 0xf8dc, 0x2000 },

+  { 0x0702, 0xf8db, 0x0000 },

+  { 0x0702, 0xf8dd, 0x0000 },

+  { 0x8702, 0xf8e2, 0x3000 },

+  { 0x8702, 0xf8e0, 0x2000 },

+  { 0x0702, 0xf8df, 0x0000 },

+  { 0x0702, 0xf8e1, 0x0000 },

+  { 0x8702, 0xf8e4, 0x2000 },

+  { 0x0702, 0xf8e3, 0x0000 },

+  { 0x0702, 0xf8e5, 0x0000 },

+  { 0x8702, 0xf8ee, 0x4000 },

+  { 0x8702, 0xf8ea, 0x3000 },

+  { 0x8702, 0xf8e8, 0x2000 },

+  { 0x0702, 0xf8e7, 0x0000 },

+  { 0x0702, 0xf8e9, 0x0000 },

+  { 0x8702, 0xf8ec, 0x2000 },

+  { 0x0702, 0xf8eb, 0x0000 },

+  { 0x0702, 0xf8ed, 0x0000 },

+  { 0x8702, 0xf8f2, 0x3000 },

+  { 0x8702, 0xf8f0, 0x2000 },

+  { 0x0702, 0xf8ef, 0x0000 },

+  { 0x0702, 0xf8f1, 0x0000 },

+  { 0x8702, 0xf8f4, 0x2000 },

+  { 0x0702, 0xf8f3, 0x0000 },

+  { 0x0702, 0xf8f5, 0x0000 },

+  { 0x8702, 0xf936, 0x7000 },

+  { 0x8702, 0xf916, 0x6000 },

+  { 0x8702, 0xf906, 0x5000 },

+  { 0x8702, 0xf8fe, 0x4000 },

+  { 0x8702, 0xf8fa, 0x3000 },

+  { 0x8702, 0xf8f8, 0x2000 },

+  { 0x0702, 0xf8f7, 0x0000 },

+  { 0x0702, 0xf8f9, 0x0000 },

+  { 0x8702, 0xf8fc, 0x2000 },

+  { 0x0702, 0xf8fb, 0x0000 },

+  { 0x0702, 0xf8fd, 0x0000 },

+  { 0x8702, 0xf902, 0x3000 },

+  { 0x8702, 0xf900, 0x2000 },

+  { 0x0702, 0xf8ff, 0x0000 },

+  { 0x0702, 0xf901, 0x0000 },

+  { 0x8702, 0xf904, 0x2000 },

+  { 0x0702, 0xf903, 0x0000 },

+  { 0x0702, 0xf905, 0x0000 },

+  { 0x8702, 0xf90e, 0x4000 },

+  { 0x8702, 0xf90a, 0x3000 },

+  { 0x8702, 0xf908, 0x2000 },

+  { 0x0702, 0xf907, 0x0000 },

+  { 0x0702, 0xf909, 0x0000 },

+  { 0x8702, 0xf90c, 0x2000 },

+  { 0x0702, 0xf90b, 0x0000 },

+  { 0x0702, 0xf90d, 0x0000 },

+  { 0x8702, 0xf912, 0x3000 },

+  { 0x8702, 0xf910, 0x2000 },

+  { 0x0702, 0xf90f, 0x0000 },

+  { 0x0702, 0xf911, 0x0000 },

+  { 0x8702, 0xf914, 0x2000 },

+  { 0x0702, 0xf913, 0x0000 },

+  { 0x0702, 0xf915, 0x0000 },

+  { 0x8702, 0xf926, 0x5000 },

+  { 0x8702, 0xf91e, 0x4000 },

+  { 0x8702, 0xf91a, 0x3000 },

+  { 0x8702, 0xf918, 0x2000 },

+  { 0x0702, 0xf917, 0x0000 },

+  { 0x0702, 0xf919, 0x0000 },

+  { 0x8702, 0xf91c, 0x2000 },

+  { 0x0702, 0xf91b, 0x0000 },

+  { 0x0702, 0xf91d, 0x0000 },

+  { 0x8702, 0xf922, 0x3000 },

+  { 0x8702, 0xf920, 0x2000 },

+  { 0x0702, 0xf91f, 0x0000 },

+  { 0x0702, 0xf921, 0x0000 },

+  { 0x8702, 0xf924, 0x2000 },

+  { 0x0702, 0xf923, 0x0000 },

+  { 0x0702, 0xf925, 0x0000 },

+  { 0x8702, 0xf92e, 0x4000 },

+  { 0x8702, 0xf92a, 0x3000 },

+  { 0x8702, 0xf928, 0x2000 },

+  { 0x0702, 0xf927, 0x0000 },

+  { 0x0702, 0xf929, 0x0000 },

+  { 0x8702, 0xf92c, 0x2000 },

+  { 0x0702, 0xf92b, 0x0000 },

+  { 0x0702, 0xf92d, 0x0000 },

+  { 0x8702, 0xf932, 0x3000 },

+  { 0x8702, 0xf930, 0x2000 },

+  { 0x0702, 0xf92f, 0x0000 },

+  { 0x0702, 0xf931, 0x0000 },

+  { 0x8702, 0xf934, 0x2000 },

+  { 0x0702, 0xf933, 0x0000 },

+  { 0x0702, 0xf935, 0x0000 },

+  { 0x8702, 0xf956, 0x6000 },

+  { 0x8702, 0xf946, 0x5000 },

+  { 0x8702, 0xf93e, 0x4000 },

+  { 0x8702, 0xf93a, 0x3000 },

+  { 0x8702, 0xf938, 0x2000 },

+  { 0x0702, 0xf937, 0x0000 },

+  { 0x0702, 0xf939, 0x0000 },

+  { 0x8702, 0xf93c, 0x2000 },

+  { 0x0702, 0xf93b, 0x0000 },

+  { 0x0702, 0xf93d, 0x0000 },

+  { 0x8702, 0xf942, 0x3000 },

+  { 0x8702, 0xf940, 0x2000 },

+  { 0x0702, 0xf93f, 0x0000 },

+  { 0x0702, 0xf941, 0x0000 },

+  { 0x8702, 0xf944, 0x2000 },

+  { 0x0702, 0xf943, 0x0000 },

+  { 0x0702, 0xf945, 0x0000 },

+  { 0x8702, 0xf94e, 0x4000 },

+  { 0x8702, 0xf94a, 0x3000 },

+  { 0x8702, 0xf948, 0x2000 },

+  { 0x0702, 0xf947, 0x0000 },

+  { 0x0702, 0xf949, 0x0000 },

+  { 0x8702, 0xf94c, 0x2000 },

+  { 0x0702, 0xf94b, 0x0000 },

+  { 0x0702, 0xf94d, 0x0000 },

+  { 0x8702, 0xf952, 0x3000 },

+  { 0x8702, 0xf950, 0x2000 },

+  { 0x0702, 0xf94f, 0x0000 },

+  { 0x0702, 0xf951, 0x0000 },

+  { 0x8702, 0xf954, 0x2000 },

+  { 0x0702, 0xf953, 0x0000 },

+  { 0x0702, 0xf955, 0x0000 },

+  { 0x8702, 0xf966, 0x5000 },

+  { 0x8702, 0xf95e, 0x4000 },

+  { 0x8702, 0xf95a, 0x3000 },

+  { 0x8702, 0xf958, 0x2000 },

+  { 0x0702, 0xf957, 0x0000 },

+  { 0x0702, 0xf959, 0x0000 },

+  { 0x8702, 0xf95c, 0x2000 },

+  { 0x0702, 0xf95b, 0x0000 },

+  { 0x0702, 0xf95d, 0x0000 },

+  { 0x8702, 0xf962, 0x3000 },

+  { 0x8702, 0xf960, 0x2000 },

+  { 0x0702, 0xf95f, 0x0000 },

+  { 0x0702, 0xf961, 0x0000 },

+  { 0x8702, 0xf964, 0x2000 },

+  { 0x0702, 0xf963, 0x0000 },

+  { 0x0702, 0xf965, 0x0000 },

+  { 0x8702, 0xf96e, 0x4000 },

+  { 0x8702, 0xf96a, 0x3000 },

+  { 0x8702, 0xf968, 0x2000 },

+  { 0x0702, 0xf967, 0x0000 },

+  { 0x0702, 0xf969, 0x0000 },

+  { 0x8702, 0xf96c, 0x2000 },

+  { 0x0702, 0xf96b, 0x0000 },

+  { 0x0702, 0xf96d, 0x0000 },

+  { 0x8702, 0xf972, 0x3000 },

+  { 0x8702, 0xf970, 0x2000 },

+  { 0x0702, 0xf96f, 0x0000 },

+  { 0x0702, 0xf971, 0x0000 },

+  { 0x8702, 0xf974, 0x2000 },

+  { 0x0702, 0xf973, 0x0000 },

+  { 0x0702, 0xf975, 0x0000 },

+  { 0x810e, 0x0077, 0x9000 },

+  { 0x8702, 0xf9f6, 0x8000 },

+  { 0x8702, 0xf9b6, 0x7000 },

+  { 0x8702, 0xf996, 0x6000 },

+  { 0x8702, 0xf986, 0x5000 },

+  { 0x8702, 0xf97e, 0x4000 },

+  { 0x8702, 0xf97a, 0x3000 },

+  { 0x8702, 0xf978, 0x2000 },

+  { 0x0702, 0xf977, 0x0000 },

+  { 0x0702, 0xf979, 0x0000 },

+  { 0x8702, 0xf97c, 0x2000 },

+  { 0x0702, 0xf97b, 0x0000 },

+  { 0x0702, 0xf97d, 0x0000 },

+  { 0x8702, 0xf982, 0x3000 },

+  { 0x8702, 0xf980, 0x2000 },

+  { 0x0702, 0xf97f, 0x0000 },

+  { 0x0702, 0xf981, 0x0000 },

+  { 0x8702, 0xf984, 0x2000 },

+  { 0x0702, 0xf983, 0x0000 },

+  { 0x0702, 0xf985, 0x0000 },

+  { 0x8702, 0xf98e, 0x4000 },

+  { 0x8702, 0xf98a, 0x3000 },

+  { 0x8702, 0xf988, 0x2000 },

+  { 0x0702, 0xf987, 0x0000 },

+  { 0x0702, 0xf989, 0x0000 },

+  { 0x8702, 0xf98c, 0x2000 },

+  { 0x0702, 0xf98b, 0x0000 },

+  { 0x0702, 0xf98d, 0x0000 },

+  { 0x8702, 0xf992, 0x3000 },

+  { 0x8702, 0xf990, 0x2000 },

+  { 0x0702, 0xf98f, 0x0000 },

+  { 0x0702, 0xf991, 0x0000 },

+  { 0x8702, 0xf994, 0x2000 },

+  { 0x0702, 0xf993, 0x0000 },

+  { 0x0702, 0xf995, 0x0000 },

+  { 0x8702, 0xf9a6, 0x5000 },

+  { 0x8702, 0xf99e, 0x4000 },

+  { 0x8702, 0xf99a, 0x3000 },

+  { 0x8702, 0xf998, 0x2000 },

+  { 0x0702, 0xf997, 0x0000 },

+  { 0x0702, 0xf999, 0x0000 },

+  { 0x8702, 0xf99c, 0x2000 },

+  { 0x0702, 0xf99b, 0x0000 },

+  { 0x0702, 0xf99d, 0x0000 },

+  { 0x8702, 0xf9a2, 0x3000 },

+  { 0x8702, 0xf9a0, 0x2000 },

+  { 0x0702, 0xf99f, 0x0000 },

+  { 0x0702, 0xf9a1, 0x0000 },

+  { 0x8702, 0xf9a4, 0x2000 },

+  { 0x0702, 0xf9a3, 0x0000 },

+  { 0x0702, 0xf9a5, 0x0000 },

+  { 0x8702, 0xf9ae, 0x4000 },

+  { 0x8702, 0xf9aa, 0x3000 },

+  { 0x8702, 0xf9a8, 0x2000 },

+  { 0x0702, 0xf9a7, 0x0000 },

+  { 0x0702, 0xf9a9, 0x0000 },

+  { 0x8702, 0xf9ac, 0x2000 },

+  { 0x0702, 0xf9ab, 0x0000 },

+  { 0x0702, 0xf9ad, 0x0000 },

+  { 0x8702, 0xf9b2, 0x3000 },

+  { 0x8702, 0xf9b0, 0x2000 },

+  { 0x0702, 0xf9af, 0x0000 },

+  { 0x0702, 0xf9b1, 0x0000 },

+  { 0x8702, 0xf9b4, 0x2000 },

+  { 0x0702, 0xf9b3, 0x0000 },

+  { 0x0702, 0xf9b5, 0x0000 },

+  { 0x8702, 0xf9d6, 0x6000 },

+  { 0x8702, 0xf9c6, 0x5000 },

+  { 0x8702, 0xf9be, 0x4000 },

+  { 0x8702, 0xf9ba, 0x3000 },

+  { 0x8702, 0xf9b8, 0x2000 },

+  { 0x0702, 0xf9b7, 0x0000 },

+  { 0x0702, 0xf9b9, 0x0000 },

+  { 0x8702, 0xf9bc, 0x2000 },

+  { 0x0702, 0xf9bb, 0x0000 },

+  { 0x0702, 0xf9bd, 0x0000 },

+  { 0x8702, 0xf9c2, 0x3000 },

+  { 0x8702, 0xf9c0, 0x2000 },

+  { 0x0702, 0xf9bf, 0x0000 },

+  { 0x0702, 0xf9c1, 0x0000 },

+  { 0x8702, 0xf9c4, 0x2000 },

+  { 0x0702, 0xf9c3, 0x0000 },

+  { 0x0702, 0xf9c5, 0x0000 },

+  { 0x8702, 0xf9ce, 0x4000 },

+  { 0x8702, 0xf9ca, 0x3000 },

+  { 0x8702, 0xf9c8, 0x2000 },

+  { 0x0702, 0xf9c7, 0x0000 },

+  { 0x0702, 0xf9c9, 0x0000 },

+  { 0x8702, 0xf9cc, 0x2000 },

+  { 0x0702, 0xf9cb, 0x0000 },

+  { 0x0702, 0xf9cd, 0x0000 },

+  { 0x8702, 0xf9d2, 0x3000 },

+  { 0x8702, 0xf9d0, 0x2000 },

+  { 0x0702, 0xf9cf, 0x0000 },

+  { 0x0702, 0xf9d1, 0x0000 },

+  { 0x8702, 0xf9d4, 0x2000 },

+  { 0x0702, 0xf9d3, 0x0000 },

+  { 0x0702, 0xf9d5, 0x0000 },

+  { 0x8702, 0xf9e6, 0x5000 },

+  { 0x8702, 0xf9de, 0x4000 },

+  { 0x8702, 0xf9da, 0x3000 },

+  { 0x8702, 0xf9d8, 0x2000 },

+  { 0x0702, 0xf9d7, 0x0000 },

+  { 0x0702, 0xf9d9, 0x0000 },

+  { 0x8702, 0xf9dc, 0x2000 },

+  { 0x0702, 0xf9db, 0x0000 },

+  { 0x0702, 0xf9dd, 0x0000 },

+  { 0x8702, 0xf9e2, 0x3000 },

+  { 0x8702, 0xf9e0, 0x2000 },

+  { 0x0702, 0xf9df, 0x0000 },

+  { 0x0702, 0xf9e1, 0x0000 },

+  { 0x8702, 0xf9e4, 0x2000 },

+  { 0x0702, 0xf9e3, 0x0000 },

+  { 0x0702, 0xf9e5, 0x0000 },

+  { 0x8702, 0xf9ee, 0x4000 },

+  { 0x8702, 0xf9ea, 0x3000 },

+  { 0x8702, 0xf9e8, 0x2000 },

+  { 0x0702, 0xf9e7, 0x0000 },

+  { 0x0702, 0xf9e9, 0x0000 },

+  { 0x8702, 0xf9ec, 0x2000 },

+  { 0x0702, 0xf9eb, 0x0000 },

+  { 0x0702, 0xf9ed, 0x0000 },

+  { 0x8702, 0xf9f2, 0x3000 },

+  { 0x8702, 0xf9f0, 0x2000 },

+  { 0x0702, 0xf9ef, 0x0000 },

+  { 0x0702, 0xf9f1, 0x0000 },

+  { 0x8702, 0xf9f4, 0x2000 },

+  { 0x0702, 0xf9f3, 0x0000 },

+  { 0x0702, 0xf9f5, 0x0000 },

+  { 0x810e, 0x0037, 0x7000 },

+  { 0x8702, 0xfa16, 0x6000 },

+  { 0x8702, 0xfa06, 0x5000 },

+  { 0x8702, 0xf9fe, 0x4000 },

+  { 0x8702, 0xf9fa, 0x3000 },

+  { 0x8702, 0xf9f8, 0x2000 },

+  { 0x0702, 0xf9f7, 0x0000 },

+  { 0x0702, 0xf9f9, 0x0000 },

+  { 0x8702, 0xf9fc, 0x2000 },

+  { 0x0702, 0xf9fb, 0x0000 },

+  { 0x0702, 0xf9fd, 0x0000 },

+  { 0x8702, 0xfa02, 0x3000 },

+  { 0x8702, 0xfa00, 0x2000 },

+  { 0x0702, 0xf9ff, 0x0000 },

+  { 0x0702, 0xfa01, 0x0000 },

+  { 0x8702, 0xfa04, 0x2000 },

+  { 0x0702, 0xfa03, 0x0000 },

+  { 0x0702, 0xfa05, 0x0000 },

+  { 0x8702, 0xfa0e, 0x4000 },

+  { 0x8702, 0xfa0a, 0x3000 },

+  { 0x8702, 0xfa08, 0x2000 },

+  { 0x0702, 0xfa07, 0x0000 },

+  { 0x0702, 0xfa09, 0x0000 },

+  { 0x8702, 0xfa0c, 0x2000 },

+  { 0x0702, 0xfa0b, 0x0000 },

+  { 0x0702, 0xfa0d, 0x0000 },

+  { 0x8702, 0xfa12, 0x3000 },

+  { 0x8702, 0xfa10, 0x2000 },

+  { 0x0702, 0xfa0f, 0x0000 },

+  { 0x0702, 0xfa11, 0x0000 },

+  { 0x8702, 0xfa14, 0x2000 },

+  { 0x0702, 0xfa13, 0x0000 },

+  { 0x0702, 0xfa15, 0x0000 },

+  { 0x810e, 0x0027, 0x5000 },

+  { 0x810e, 0x0001, 0x4000 },

+  { 0x8702, 0xfa1a, 0x3000 },

+  { 0x8702, 0xfa18, 0x2000 },

+  { 0x0702, 0xfa17, 0x0000 },

+  { 0x0702, 0xfa19, 0x0000 },

+  { 0x8702, 0xfa1c, 0x2000 },

+  { 0x0702, 0xfa1b, 0x0000 },

+  { 0x0702, 0xfa1d, 0x0000 },

+  { 0x810e, 0x0023, 0x3000 },

+  { 0x810e, 0x0021, 0x2000 },

+  { 0x010e, 0x0020, 0x0000 },

+  { 0x010e, 0x0022, 0x0000 },

+  { 0x810e, 0x0025, 0x2000 },

+  { 0x010e, 0x0024, 0x0000 },

+  { 0x010e, 0x0026, 0x0000 },

+  { 0x810e, 0x002f, 0x4000 },

+  { 0x810e, 0x002b, 0x3000 },

+  { 0x810e, 0x0029, 0x2000 },

+  { 0x010e, 0x0028, 0x0000 },

+  { 0x010e, 0x002a, 0x0000 },

+  { 0x810e, 0x002d, 0x2000 },

+  { 0x010e, 0x002c, 0x0000 },

+  { 0x010e, 0x002e, 0x0000 },

+  { 0x810e, 0x0033, 0x3000 },

+  { 0x810e, 0x0031, 0x2000 },

+  { 0x010e, 0x0030, 0x0000 },

+  { 0x010e, 0x0032, 0x0000 },

+  { 0x810e, 0x0035, 0x2000 },

+  { 0x010e, 0x0034, 0x0000 },

+  { 0x010e, 0x0036, 0x0000 },

+  { 0x810e, 0x0057, 0x6000 },

+  { 0x810e, 0x0047, 0x5000 },

+  { 0x810e, 0x003f, 0x4000 },

+  { 0x810e, 0x003b, 0x3000 },

+  { 0x810e, 0x0039, 0x2000 },

+  { 0x010e, 0x0038, 0x0000 },

+  { 0x010e, 0x003a, 0x0000 },

+  { 0x810e, 0x003d, 0x2000 },

+  { 0x010e, 0x003c, 0x0000 },

+  { 0x010e, 0x003e, 0x0000 },

+  { 0x810e, 0x0043, 0x3000 },

+  { 0x810e, 0x0041, 0x2000 },

+  { 0x010e, 0x0040, 0x0000 },

+  { 0x010e, 0x0042, 0x0000 },

+  { 0x810e, 0x0045, 0x2000 },

+  { 0x010e, 0x0044, 0x0000 },

+  { 0x010e, 0x0046, 0x0000 },

+  { 0x810e, 0x004f, 0x4000 },

+  { 0x810e, 0x004b, 0x3000 },

+  { 0x810e, 0x0049, 0x2000 },

+  { 0x010e, 0x0048, 0x0000 },

+  { 0x010e, 0x004a, 0x0000 },

+  { 0x810e, 0x004d, 0x2000 },

+  { 0x010e, 0x004c, 0x0000 },

+  { 0x010e, 0x004e, 0x0000 },

+  { 0x810e, 0x0053, 0x3000 },

+  { 0x810e, 0x0051, 0x2000 },

+  { 0x010e, 0x0050, 0x0000 },

+  { 0x010e, 0x0052, 0x0000 },

+  { 0x810e, 0x0055, 0x2000 },

+  { 0x010e, 0x0054, 0x0000 },

+  { 0x010e, 0x0056, 0x0000 },

+  { 0x810e, 0x0067, 0x5000 },

+  { 0x810e, 0x005f, 0x4000 },

+  { 0x810e, 0x005b, 0x3000 },

+  { 0x810e, 0x0059, 0x2000 },

+  { 0x010e, 0x0058, 0x0000 },

+  { 0x010e, 0x005a, 0x0000 },

+  { 0x810e, 0x005d, 0x2000 },

+  { 0x010e, 0x005c, 0x0000 },

+  { 0x010e, 0x005e, 0x0000 },

+  { 0x810e, 0x0063, 0x3000 },

+  { 0x810e, 0x0061, 0x2000 },

+  { 0x010e, 0x0060, 0x0000 },

+  { 0x010e, 0x0062, 0x0000 },

+  { 0x810e, 0x0065, 0x2000 },

+  { 0x010e, 0x0064, 0x0000 },

+  { 0x010e, 0x0066, 0x0000 },

+  { 0x810e, 0x006f, 0x4000 },

+  { 0x810e, 0x006b, 0x3000 },

+  { 0x810e, 0x0069, 0x2000 },

+  { 0x010e, 0x0068, 0x0000 },

+  { 0x010e, 0x006a, 0x0000 },

+  { 0x810e, 0x006d, 0x2000 },

+  { 0x010e, 0x006c, 0x0000 },

+  { 0x010e, 0x006e, 0x0000 },

+  { 0x810e, 0x0073, 0x3000 },

+  { 0x810e, 0x0071, 0x2000 },

+  { 0x010e, 0x0070, 0x0000 },

+  { 0x010e, 0x0072, 0x0000 },

+  { 0x810e, 0x0075, 0x2000 },

+  { 0x010e, 0x0074, 0x0000 },

+  { 0x010e, 0x0076, 0x0000 },

+  { 0x8c0e, 0x0177, 0x8000 },

+  { 0x8c0e, 0x0137, 0x7000 },

+  { 0x8c0e, 0x0117, 0x6000 },

+  { 0x8c0e, 0x0107, 0x5000 },

+  { 0x810e, 0x007f, 0x4000 },

+  { 0x810e, 0x007b, 0x3000 },

+  { 0x810e, 0x0079, 0x2000 },

+  { 0x010e, 0x0078, 0x0000 },

+  { 0x010e, 0x007a, 0x0000 },

+  { 0x810e, 0x007d, 0x2000 },

+  { 0x010e, 0x007c, 0x0000 },

+  { 0x010e, 0x007e, 0x0000 },

+  { 0x8c0e, 0x0103, 0x3000 },

+  { 0x8c0e, 0x0101, 0x2000 },

+  { 0x0c0e, 0x0100, 0x0000 },

+  { 0x0c0e, 0x0102, 0x0000 },

+  { 0x8c0e, 0x0105, 0x2000 },

+  { 0x0c0e, 0x0104, 0x0000 },

+  { 0x0c0e, 0x0106, 0x0000 },

+  { 0x8c0e, 0x010f, 0x4000 },

+  { 0x8c0e, 0x010b, 0x3000 },

+  { 0x8c0e, 0x0109, 0x2000 },

+  { 0x0c0e, 0x0108, 0x0000 },

+  { 0x0c0e, 0x010a, 0x0000 },

+  { 0x8c0e, 0x010d, 0x2000 },

+  { 0x0c0e, 0x010c, 0x0000 },

+  { 0x0c0e, 0x010e, 0x0000 },

+  { 0x8c0e, 0x0113, 0x3000 },

+  { 0x8c0e, 0x0111, 0x2000 },

+  { 0x0c0e, 0x0110, 0x0000 },

+  { 0x0c0e, 0x0112, 0x0000 },

+  { 0x8c0e, 0x0115, 0x2000 },

+  { 0x0c0e, 0x0114, 0x0000 },

+  { 0x0c0e, 0x0116, 0x0000 },

+  { 0x8c0e, 0x0127, 0x5000 },

+  { 0x8c0e, 0x011f, 0x4000 },

+  { 0x8c0e, 0x011b, 0x3000 },

+  { 0x8c0e, 0x0119, 0x2000 },

+  { 0x0c0e, 0x0118, 0x0000 },

+  { 0x0c0e, 0x011a, 0x0000 },

+  { 0x8c0e, 0x011d, 0x2000 },

+  { 0x0c0e, 0x011c, 0x0000 },

+  { 0x0c0e, 0x011e, 0x0000 },

+  { 0x8c0e, 0x0123, 0x3000 },

+  { 0x8c0e, 0x0121, 0x2000 },

+  { 0x0c0e, 0x0120, 0x0000 },

+  { 0x0c0e, 0x0122, 0x0000 },

+  { 0x8c0e, 0x0125, 0x2000 },

+  { 0x0c0e, 0x0124, 0x0000 },

+  { 0x0c0e, 0x0126, 0x0000 },

+  { 0x8c0e, 0x012f, 0x4000 },

+  { 0x8c0e, 0x012b, 0x3000 },

+  { 0x8c0e, 0x0129, 0x2000 },

+  { 0x0c0e, 0x0128, 0x0000 },

+  { 0x0c0e, 0x012a, 0x0000 },

+  { 0x8c0e, 0x012d, 0x2000 },

+  { 0x0c0e, 0x012c, 0x0000 },

+  { 0x0c0e, 0x012e, 0x0000 },

+  { 0x8c0e, 0x0133, 0x3000 },

+  { 0x8c0e, 0x0131, 0x2000 },

+  { 0x0c0e, 0x0130, 0x0000 },

+  { 0x0c0e, 0x0132, 0x0000 },

+  { 0x8c0e, 0x0135, 0x2000 },

+  { 0x0c0e, 0x0134, 0x0000 },

+  { 0x0c0e, 0x0136, 0x0000 },

+  { 0x8c0e, 0x0157, 0x6000 },

+  { 0x8c0e, 0x0147, 0x5000 },

+  { 0x8c0e, 0x013f, 0x4000 },

+  { 0x8c0e, 0x013b, 0x3000 },

+  { 0x8c0e, 0x0139, 0x2000 },

+  { 0x0c0e, 0x0138, 0x0000 },

+  { 0x0c0e, 0x013a, 0x0000 },

+  { 0x8c0e, 0x013d, 0x2000 },

+  { 0x0c0e, 0x013c, 0x0000 },

+  { 0x0c0e, 0x013e, 0x0000 },

+  { 0x8c0e, 0x0143, 0x3000 },

+  { 0x8c0e, 0x0141, 0x2000 },

+  { 0x0c0e, 0x0140, 0x0000 },

+  { 0x0c0e, 0x0142, 0x0000 },

+  { 0x8c0e, 0x0145, 0x2000 },

+  { 0x0c0e, 0x0144, 0x0000 },

+  { 0x0c0e, 0x0146, 0x0000 },

+  { 0x8c0e, 0x014f, 0x4000 },

+  { 0x8c0e, 0x014b, 0x3000 },

+  { 0x8c0e, 0x0149, 0x2000 },

+  { 0x0c0e, 0x0148, 0x0000 },

+  { 0x0c0e, 0x014a, 0x0000 },

+  { 0x8c0e, 0x014d, 0x2000 },

+  { 0x0c0e, 0x014c, 0x0000 },

+  { 0x0c0e, 0x014e, 0x0000 },

+  { 0x8c0e, 0x0153, 0x3000 },

+  { 0x8c0e, 0x0151, 0x2000 },

+  { 0x0c0e, 0x0150, 0x0000 },

+  { 0x0c0e, 0x0152, 0x0000 },

+  { 0x8c0e, 0x0155, 0x2000 },

+  { 0x0c0e, 0x0154, 0x0000 },

+  { 0x0c0e, 0x0156, 0x0000 },

+  { 0x8c0e, 0x0167, 0x5000 },

+  { 0x8c0e, 0x015f, 0x4000 },

+  { 0x8c0e, 0x015b, 0x3000 },

+  { 0x8c0e, 0x0159, 0x2000 },

+  { 0x0c0e, 0x0158, 0x0000 },

+  { 0x0c0e, 0x015a, 0x0000 },

+  { 0x8c0e, 0x015d, 0x2000 },

+  { 0x0c0e, 0x015c, 0x0000 },

+  { 0x0c0e, 0x015e, 0x0000 },

+  { 0x8c0e, 0x0163, 0x3000 },

+  { 0x8c0e, 0x0161, 0x2000 },

+  { 0x0c0e, 0x0160, 0x0000 },

+  { 0x0c0e, 0x0162, 0x0000 },

+  { 0x8c0e, 0x0165, 0x2000 },

+  { 0x0c0e, 0x0164, 0x0000 },

+  { 0x0c0e, 0x0166, 0x0000 },

+  { 0x8c0e, 0x016f, 0x4000 },

+  { 0x8c0e, 0x016b, 0x3000 },

+  { 0x8c0e, 0x0169, 0x2000 },

+  { 0x0c0e, 0x0168, 0x0000 },

+  { 0x0c0e, 0x016a, 0x0000 },

+  { 0x8c0e, 0x016d, 0x2000 },

+  { 0x0c0e, 0x016c, 0x0000 },

+  { 0x0c0e, 0x016e, 0x0000 },

+  { 0x8c0e, 0x0173, 0x3000 },

+  { 0x8c0e, 0x0171, 0x2000 },

+  { 0x0c0e, 0x0170, 0x0000 },

+  { 0x0c0e, 0x0172, 0x0000 },

+  { 0x8c0e, 0x0175, 0x2000 },

+  { 0x0c0e, 0x0174, 0x0000 },

+  { 0x0c0e, 0x0176, 0x0000 },

+  { 0x8c0e, 0x01b7, 0x7000 },

+  { 0x8c0e, 0x0197, 0x6000 },

+  { 0x8c0e, 0x0187, 0x5000 },

+  { 0x8c0e, 0x017f, 0x4000 },

+  { 0x8c0e, 0x017b, 0x3000 },

+  { 0x8c0e, 0x0179, 0x2000 },

+  { 0x0c0e, 0x0178, 0x0000 },

+  { 0x0c0e, 0x017a, 0x0000 },

+  { 0x8c0e, 0x017d, 0x2000 },

+  { 0x0c0e, 0x017c, 0x0000 },

+  { 0x0c0e, 0x017e, 0x0000 },

+  { 0x8c0e, 0x0183, 0x3000 },

+  { 0x8c0e, 0x0181, 0x2000 },

+  { 0x0c0e, 0x0180, 0x0000 },

+  { 0x0c0e, 0x0182, 0x0000 },

+  { 0x8c0e, 0x0185, 0x2000 },

+  { 0x0c0e, 0x0184, 0x0000 },

+  { 0x0c0e, 0x0186, 0x0000 },

+  { 0x8c0e, 0x018f, 0x4000 },

+  { 0x8c0e, 0x018b, 0x3000 },

+  { 0x8c0e, 0x0189, 0x2000 },

+  { 0x0c0e, 0x0188, 0x0000 },

+  { 0x0c0e, 0x018a, 0x0000 },

+  { 0x8c0e, 0x018d, 0x2000 },

+  { 0x0c0e, 0x018c, 0x0000 },

+  { 0x0c0e, 0x018e, 0x0000 },

+  { 0x8c0e, 0x0193, 0x3000 },

+  { 0x8c0e, 0x0191, 0x2000 },

+  { 0x0c0e, 0x0190, 0x0000 },

+  { 0x0c0e, 0x0192, 0x0000 },

+  { 0x8c0e, 0x0195, 0x2000 },

+  { 0x0c0e, 0x0194, 0x0000 },

+  { 0x0c0e, 0x0196, 0x0000 },

+  { 0x8c0e, 0x01a7, 0x5000 },

+  { 0x8c0e, 0x019f, 0x4000 },

+  { 0x8c0e, 0x019b, 0x3000 },

+  { 0x8c0e, 0x0199, 0x2000 },

+  { 0x0c0e, 0x0198, 0x0000 },

+  { 0x0c0e, 0x019a, 0x0000 },

+  { 0x8c0e, 0x019d, 0x2000 },

+  { 0x0c0e, 0x019c, 0x0000 },

+  { 0x0c0e, 0x019e, 0x0000 },

+  { 0x8c0e, 0x01a3, 0x3000 },

+  { 0x8c0e, 0x01a1, 0x2000 },

+  { 0x0c0e, 0x01a0, 0x0000 },

+  { 0x0c0e, 0x01a2, 0x0000 },

+  { 0x8c0e, 0x01a5, 0x2000 },

+  { 0x0c0e, 0x01a4, 0x0000 },

+  { 0x0c0e, 0x01a6, 0x0000 },

+  { 0x8c0e, 0x01af, 0x4000 },

+  { 0x8c0e, 0x01ab, 0x3000 },

+  { 0x8c0e, 0x01a9, 0x2000 },

+  { 0x0c0e, 0x01a8, 0x0000 },

+  { 0x0c0e, 0x01aa, 0x0000 },

+  { 0x8c0e, 0x01ad, 0x2000 },

+  { 0x0c0e, 0x01ac, 0x0000 },

+  { 0x0c0e, 0x01ae, 0x0000 },

+  { 0x8c0e, 0x01b3, 0x3000 },

+  { 0x8c0e, 0x01b1, 0x2000 },

+  { 0x0c0e, 0x01b0, 0x0000 },

+  { 0x0c0e, 0x01b2, 0x0000 },

+  { 0x8c0e, 0x01b5, 0x2000 },

+  { 0x0c0e, 0x01b4, 0x0000 },

+  { 0x0c0e, 0x01b6, 0x0000 },

+  { 0x8c0e, 0x01d7, 0x6000 },

+  { 0x8c0e, 0x01c7, 0x5000 },

+  { 0x8c0e, 0x01bf, 0x4000 },

+  { 0x8c0e, 0x01bb, 0x3000 },

+  { 0x8c0e, 0x01b9, 0x2000 },

+  { 0x0c0e, 0x01b8, 0x0000 },

+  { 0x0c0e, 0x01ba, 0x0000 },

+  { 0x8c0e, 0x01bd, 0x2000 },

+  { 0x0c0e, 0x01bc, 0x0000 },

+  { 0x0c0e, 0x01be, 0x0000 },

+  { 0x8c0e, 0x01c3, 0x3000 },

+  { 0x8c0e, 0x01c1, 0x2000 },

+  { 0x0c0e, 0x01c0, 0x0000 },

+  { 0x0c0e, 0x01c2, 0x0000 },

+  { 0x8c0e, 0x01c5, 0x2000 },

+  { 0x0c0e, 0x01c4, 0x0000 },

+  { 0x0c0e, 0x01c6, 0x0000 },

+  { 0x8c0e, 0x01cf, 0x4000 },

+  { 0x8c0e, 0x01cb, 0x3000 },

+  { 0x8c0e, 0x01c9, 0x2000 },

+  { 0x0c0e, 0x01c8, 0x0000 },

+  { 0x0c0e, 0x01ca, 0x0000 },

+  { 0x8c0e, 0x01cd, 0x2000 },

+  { 0x0c0e, 0x01cc, 0x0000 },

+  { 0x0c0e, 0x01ce, 0x0000 },

+  { 0x8c0e, 0x01d3, 0x3000 },

+  { 0x8c0e, 0x01d1, 0x2000 },

+  { 0x0c0e, 0x01d0, 0x0000 },

+  { 0x0c0e, 0x01d2, 0x0000 },

+  { 0x8c0e, 0x01d5, 0x2000 },

+  { 0x0c0e, 0x01d4, 0x0000 },

+  { 0x0c0e, 0x01d6, 0x0000 },

+  { 0x8c0e, 0x01e7, 0x5000 },

+  { 0x8c0e, 0x01df, 0x4000 },

+  { 0x8c0e, 0x01db, 0x3000 },

+  { 0x8c0e, 0x01d9, 0x2000 },

+  { 0x0c0e, 0x01d8, 0x0000 },

+  { 0x0c0e, 0x01da, 0x0000 },

+  { 0x8c0e, 0x01dd, 0x2000 },

+  { 0x0c0e, 0x01dc, 0x0000 },

+  { 0x0c0e, 0x01de, 0x0000 },

+  { 0x8c0e, 0x01e3, 0x3000 },

+  { 0x8c0e, 0x01e1, 0x2000 },

+  { 0x0c0e, 0x01e0, 0x0000 },

+  { 0x0c0e, 0x01e2, 0x0000 },

+  { 0x8c0e, 0x01e5, 0x2000 },

+  { 0x0c0e, 0x01e4, 0x0000 },

+  { 0x0c0e, 0x01e6, 0x0000 },

+  { 0x8c0e, 0x01ef, 0x4000 },

+  { 0x8c0e, 0x01eb, 0x3000 },

+  { 0x8c0e, 0x01e9, 0x2000 },

+  { 0x0c0e, 0x01e8, 0x0000 },

+  { 0x0c0e, 0x01ea, 0x0000 },

+  { 0x8c0e, 0x01ed, 0x2000 },

+  { 0x0c0e, 0x01ec, 0x0000 },

+  { 0x0c0e, 0x01ee, 0x0000 },

+  { 0x830f, 0xfffd, 0x2000 },

+  { 0x030f, 0x0000, 0x0000 },

+  { 0x0310, 0x0000, 0x1000 },

+  { 0x0310, 0xfffd, 0x0000 },

+};

+

+

+/* In some environments, external functions have to be preceded by some magic.

+In my world (Unix), they do not. Use a macro to deal with this. */

+

+#ifndef EXPORT

+#define EXPORT

+#endif

+

+

+

+/*************************************************

+*         Search table and return data           *

+*************************************************/

+

+/* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed

+character type is ucp_Lu, ucp_Nd, etc.

+

+Arguments:

+  c           the character value

+  type_ptr    the detailed character type is returned here

+  case_ptr    for letters, the opposite case is returned here, if there

+                is one, else zero

+

+Returns:      the character type category or -1 if not found

+*/

+

+EXPORT int

+ucp_findchar(const int c, int *type_ptr, int *case_ptr)

+{

+cnode *node = ucp_table;

+register int cc = c;

+int case_offset;

+

+for (;;)

+  {

+  register int d = node->f1 | ((node->f0 & f0_chhmask) << 16);

+  if (cc == d) break;

+  if (cc < d)

+    {

+    if ((node->f0 & f0_leftexists) == 0) return -1;

+    node ++;

+    }

+  else

+    {

+    register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift;

+    if (roffset == 0) return -1;

+    node += 1 << (roffset - 1);

+    }

+  }

+

+switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift)))

+  {

+  case ucp_Cc:

+  case ucp_Cf:

+  case ucp_Cn:

+  case ucp_Co:

+  case ucp_Cs:

+  return ucp_C;

+  break;

+

+  case ucp_Ll:

+  case ucp_Lu:

+  case_offset = node->f2 & f2_casemask;

+  if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000;

+  *case_ptr = (case_offset == 0)? 0 : cc + case_offset;

+  return ucp_L;

+

+  case ucp_Lm:

+  case ucp_Lo:

+  case ucp_Lt:

+  *case_ptr = 0;

+  return ucp_L;

+  break;

+

+  case ucp_Mc:

+  case ucp_Me:

+  case ucp_Mn:

+  return ucp_M;

+  break;

+

+  case ucp_Nd:

+  case ucp_Nl:

+  case ucp_No:

+  return ucp_N;

+  break;

+

+  case ucp_Pc:

+  case ucp_Pd:

+  case ucp_Pe:

+  case ucp_Pf:

+  case ucp_Pi:

+  case ucp_Ps:

+  case ucp_Po:

+  return ucp_P;

+  break;

+

+  case ucp_Sc:

+  case ucp_Sk:

+  case ucp_Sm:

+  case ucp_So:

+  return ucp_S;

+  break;

+

+  case ucp_Zl:

+  case ucp_Zp:

+  case ucp_Zs:

+  return ucp_Z;

+  break;

+

+  default:         /* "Should never happen" */

+  return -1;

+  break;

+  }

+}

+

+/* End of ucp_findchar.c */

+

+

+/* End of pcre_ucp_findchar.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains an internal function for validating UTF-8 character

+strings. */

+

+

+

+

+/*************************************************

+*         Validate a UTF-8 string                *

+*************************************************/

+

+/* This function is called (optionally) at the start of compile or match, to

+validate that a supposed UTF-8 string is actually valid. The early check means

+that subsequent code can assume it is dealing with a valid string. The check

+can be turned off for maximum performance, but the consequences of supplying

+an invalid string are then undefined.

+

+Arguments:

+  string       points to the string

+  length       length of string, or -1 if the string is zero-terminated

+

+Returns:       < 0    if the string is a valid UTF-8 string

+               >= 0   otherwise; the value is the offset of the bad byte

+*/

+

+EXPORT int

+_pcre_valid_utf8(const uschar *string, int length)

+{

+register const uschar *p;

+

+if (length < 0)

+  {

+  for (p = string; *p != 0; p++);

+  length = p - string;

+  }

+

+for (p = string; length-- > 0; p++)

+  {

+  register int ab;

+  register int c = *p;

+  if (c < 128) continue;

+  if ((c & 0xc0) != 0xc0) return p - string;

+  ab = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */

+  if (length < ab) return p - string;

+  length -= ab;

+

+  /* Check top bits in the second byte */

+  if ((*(++p) & 0xc0) != 0x80) return p - string;

+

+  /* Check for overlong sequences for each different length */

+  switch (ab)

+    {

+    /* Check for xx00 000x */

+    case 1:

+    if ((c & 0x3e) == 0) return p - string;

+    continue;   /* We know there aren't any more bytes to check */

+

+    /* Check for 1110 0000, xx0x xxxx */

+    case 2:

+    if (c == 0xe0 && (*p & 0x20) == 0) return p - string;

+    break;

+

+    /* Check for 1111 0000, xx00 xxxx */

+    case 3:

+    if (c == 0xf0 && (*p & 0x30) == 0) return p - string;

+    break;

+

+    /* Check for 1111 1000, xx00 0xxx */

+    case 4:

+    if (c == 0xf8 && (*p & 0x38) == 0) return p - string;

+    break;

+

+    /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */

+    case 5:

+    if (c == 0xfe || c == 0xff ||

+       (c == 0xfc && (*p & 0x3c) == 0)) return p - string;

+    break;

+    }

+

+  /* Check for valid bytes after the 2nd, if any; all must start 10 */

+  while (--ab > 0)

+    {

+    if ((*(++p) & 0xc0) != 0x80) return p - string;

+    }

+  }

+

+return -1;

+}

+

+/* End of pcre_valid_utf8.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains the external function pcre_version(), which returns a

+string that identifies the PCRE version that is in use. */

+

+

+

+

+/*************************************************

+*          Return version string                 *

+*************************************************/

+

+#define STRING(a)  # a

+#define XSTRING(s) STRING(s)

+

+EXPORT const char *

+pcre_version(void)

+{

+return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE);

+}

+

+/* End of pcre_version.c */

+/*************************************************

+*      Perl-Compatible Regular Expressions       *

+*************************************************/

+

+/* PCRE is a library of functions to support regular expressions whose syntax

+and semantics are as close as possible to those of the Perl 5 language.

+

+                       Written by Philip Hazel

+           Copyright (c) 1997-2005 University of Cambridge

+

+-----------------------------------------------------------------------------

+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 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.

+-----------------------------------------------------------------------------

+*/

+

+

+/* This module contains an internal function that is used to match an extended

+class (one that contains characters whose values are > 255). It is used by both

+pcre_exec() and pcre_def_exec(). */

+

+

+

+

+/*************************************************

+*       Match character against an XCLASS        *

+*************************************************/

+

+/* This function is called to match a character against an extended class that

+might contain values > 255.

+

+Arguments:

+  c           the character

+  data        points to the flag byte of the XCLASS data

+

+Returns:      TRUE if character matches, else FALSE

+*/

+

+EXPORT BOOL

+_pcre_xclass(int c, const uschar *data)

+{

+int t;

+BOOL negated = (*data & XCL_NOT) != 0;

+

+/* Character values < 256 are matched against a bitmap, if one is present. If

+not, we still carry on, because there may be ranges that start below 256 in the

+additional data. */

+

+if (c < 256)

+  {

+  if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0)

+    return !negated;   /* char found */

+  }

+

+/* First skip the bit map if present. Then match against the list of Unicode

+properties or large chars or ranges that end with a large char. We won't ever

+encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */

+

+if ((*data++ & XCL_MAP) != 0) data += 32;

+

+while ((t = *data++) != XCL_END)

+  {

+  int x, y;

+  if (t == XCL_SINGLE)

+    {

+    GETCHARINC(x, data);

+    if (c == x) return !negated;

+    }

+  else if (t == XCL_RANGE)

+    {

+    GETCHARINC(x, data);

+    GETCHARINC(y, data);

+    if (c >= x && c <= y) return !negated;

+    }

+

+#ifdef SUPPORT_UCP

+  else  /* XCL_PROP & XCL_NOTPROP */

+    {

+    int chartype, othercase;

+    int rqdtype = *data++;

+    int category = ucp_findchar(c, &chartype, &othercase);

+    if (rqdtype >= 128)

+      {

+      if ((rqdtype - 128 == category) == (t == XCL_PROP)) return !negated;

+      }

+    else

+      {

+      if ((rqdtype == chartype) == (t == XCL_PROP)) return !negated;

+      }

+    }

+#endif  /* SUPPORT_UCP */

+  }

+

+return negated;   /* char did not match */

+}

+

+/* End of pcre_xclass.c */

diff --git a/lib/base/regexprs.nim b/lib/base/regexprs.nim
new file mode 100755
index 000000000..b9272ca47
--- /dev/null
+++ b/lib/base/regexprs.nim
@@ -0,0 +1,114 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+## Regular expression support for Nimrod.

+## Currently this module is implemented by providing a wrapper around the

+## `PRCE (Perl-Compatible Regular Expressions) <http://www.pcre.org>`_

+## C library. This means that your application will depend on the PRCE

+## library's licence when using this module, which should not be a problem

+## though.

+## PRCE's licence follows:

+##

+## .. include:: ../doc/regexprs.txt

+##

+

+# This is not just a convenient wrapper for the pcre library; the

+# API will stay the same if the implementation should change.

+

+import

+  pcre, strutils

+

+type

+  EInvalidRegEx* = object of EInvalidValue

+    ## is raised if the pattern is no valid regular expression.

+

+const

+  MaxSubpatterns* = 10

+    ## defines the maximum number of subpatterns that can be captured.

+    ## More subpatterns cannot be captured!

+

+proc match*(s, pattern: string, substrs: var openarray[string],

+            start: int = 0): bool

+  ## returns ``true`` if ``s`` matches the ``pattern[start..]`` and

+  ## the captured substrings in the array ``substrs``. If it does not

+  ## match, nothing is written into ``substrs`` and ``false`` is

+  ## returned.

+

+proc match*(s, pattern: string, start: int = 0): bool

+  ## returns ``true`` if ``s`` matches the ``pattern`` beginning from ``start``. 

+

+proc matchLen*(s, pattern: string, substrs: var openarray[string],

+               start: int = 0): int

+  ## the same as ``match``, but it returns the length of the match,

+  ## if there is no match, -1 is returned. Note that a match length

+  ## of zero can happen.

+

+proc find*(s, pattern: string, substrs: var openarray[string],

+           start: int = 0): bool

+  ## returns ``true`` if ``pattern`` occurs in ``s`` and the captured

+  ## substrings in the array ``substrs``. If it does not match, nothing

+  ## is written into ``substrs``.

+proc find*(s, pattern: string, start: int = 0): bool

+  ## returns ``true`` if ``pattern`` occurs in ``s``.

+

+

+proc rawCompile(pattern: string, flags: cint): PPcre =

+  var

+    msg: CString

+    offset: cint

+    com = pcreCompile(pattern, flags, addr(msg), addr(offset), nil)

+  if com == nil:

+    var e: ref EInvalidRegEx

+    new(e)

+    e.msg = $msg & "\n" & pattern & "\n" & repeatChar(offset) & "^\n"

+    raise e

+  return com

+

+proc matchOrFind(s: string, pattern: PPcre, substrs: var openarray[string],

+                 start: cint): cint =

+  var

+    rawMatches: array [0..maxSubpatterns * 3 - 1, cint]

+    res = int(pcreExec(pattern, nil, s, length(s), start, 0,

+      cast[pint](addr(rawMatches)), maxSubpatterns * 3))

+  dealloc(pattern)

+  if res < 0: return res

+  for i in 0..res-1:

+    var

+      a = rawMatches[i * 3]

+      b = rawMatches[i * 3 + 1]

+    if a >= 0: substrs[i] = copy(s, a, b)

+    else: substrs[i] = ""

+  return res

+

+proc matchOrFind(s: string, pattern: PPcre, start: cint): cint =

+  var

+    rawMatches: array [0..maxSubpatterns * 3 - 1, cint]

+    res = pcreExec(pattern, nil, s, length(s), start, 0,

+                   cast[pint](addr(rawMatches)), maxSubpatterns * 3)

+  dealloc(pattern)

+  return res

+

+proc match(s, pattern: string, substrs: var openarray[string],

+           start: int = 0): bool =

+  return matchOrFind(s, rawCompile(pattern, PCRE_ANCHORED),

+                     substrs, start) >= 0

+

+proc matchLen(s, pattern: string, substrs: var openarray[string],

+              start: int = 0): int =

+  return matchOrFind(s, rawCompile(pattern, PCRE_ANCHORED), substrs, start)

+

+proc find(s, pattern: string, substrs: var openarray[string],

+          start: int = 0): bool =

+  return matchOrFind(s, rawCompile(pattern, 0), substrs, start) >= 0

+

+proc match(s, pattern: string, start: int = 0): bool =

+  return matchOrFind(s, rawCompile(pattern, PCRE_ANCHORED), start) >= 0

+

+proc find(s, pattern: string, start: int = 0): bool =

+  return matchOrFind(s, rawCompile(pattern, 0), start) >= 0

diff --git a/lib/cntbits.nim b/lib/cntbits.nim
new file mode 100755
index 000000000..0218bf4f2
--- /dev/null
+++ b/lib/cntbits.nim
@@ -0,0 +1,20 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+

+proc population16(a: int): int {.inline.} =

+  var x = a

+  x = ((x and 0xAAAA) shr 1) + (x and 0x5555)

+  x = ((x and 0xCCCC) shr 2) + (x and 0x3333)

+  x = ((x and 0xF0F0) shr 4) + (x and 0x0F0F)

+  x = ((x and 0xFF00) shr 8) + (x and 0x00FF)

+  return x

+

+proc countBits(n: int32): int =

+  result = population16(n and 0xffff) + population16(n shr 16)

diff --git a/lib/complex.nim b/lib/complex.nim
new file mode 100755
index 000000000..b5724e48f
--- /dev/null
+++ b/lib/complex.nim
@@ -0,0 +1,108 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+

+

+## This module implements complex numbers.

+

+{.push checks:off, line_dir:off, stack_trace:off, debugger:off.}

+# the user does not want to trace a part

+# of the standard library!

+

+import

+  math

+

+type

+  TComplex* = record ## a complex number, consisting of a real and an

+                     ## imaginary part

+    re*: float       ## real part of the complex number

+    im*: float       ## imarginary part of the complex number

+

+proc `==` *(x, y: TComplex): bool =

+  ## Compare two complex numbers `x` and `y` for equality.

+  result = x.re == y.re and x.im == y.im

+

+proc `+` *(x, y: TComplex): TComplex =

+  ## Add two complex numbers.

+  result.re = x.re + y.re

+  result.im = x.im + y.im

+

+proc `-` *(x, y: TComplex): TComplex =

+  ## Subtract two complex numbers.

+  result.re = x.re - y.re

+  result.im = x.im - y.im

+

+proc `-` *(z: TComplex): TComplex =

+  ## Unary minus for complex numbers.

+  result.re = -z.re

+  result.im = -z.im

+

+proc `/` *(x, y: TComplex): TComplex =

+  ## Divide `x` by `y`.

+  var

+    r, den: float

+  if abs(y.re) < abs(y.im):

+    r = y.re / y.im

+    den = y.im + r * y.re

+    result.re = (x.re * r + x.im) / den

+    result.im = (x.im * r - x.re) / den

+  else:

+    r = y.im / y.re

+    den = y.re + r * y.im

+    result.re = (x.re + r * x.im) / den

+    result.im = (x.im - r * x.re) / den

+

+proc `*` *(x, y: TComplex): TComplex =

+  ## Multiply `x` with `y`.

+  result.re = x.re * y.re - x.im * y.im

+  result.im = x.im * y.re + x.re * y.im

+

+proc abs*(z: TComplex): float =

+  ## Return the distance from (0,0) to `z`.

+

+  # optimized by checking special cases (sqrt is expensive)

+  var x, y, temp: float

+

+  x = abs(z.re)

+  y = abs(z.im)

+  if x == 0.0:

+    result = y

+  elif y == 0.0:

+    result = x

+  elif x > y:

+    temp = y / x

+    result = x * sqrt(1.0 + temp * temp)

+  else:

+    temp = x / y

+    result = y * sqrt(1.0 + temp * temp)

+

+proc sqrt*(z: TComplex): TComplex =

+  ## Square root for a complex number `z`.

+  var x, y, w, r: float

+

+  if z.re == 0.0 and z.im == 0.0:

+    result = z

+  else:

+    x = abs(z.re)

+    y = abs(z.im)

+    if x >= y:

+      r = y / x

+      w = sqrt(x) * sqrt(0.5 * (1.0 + sqrt(1.0 + r * r)))

+    else:

+      r = x / y

+      w = sqrt(y) * sqrt(0.5 * (r + sqrt(1.0 + r * r)))

+    if z.re >= 0.0:

+      result.re = w

+      result.im = z.im / (w * 2)

+    else:

+      if z.im >= 0.0: result.im = w

+      else:           result.im = -w

+      result.re = z.im / (c.im + c.im)

+

+{.pop.}

diff --git a/lib/copying.txt b/lib/copying.txt
new file mode 100755
index 000000000..2657a09df
--- /dev/null
+++ b/lib/copying.txt
@@ -0,0 +1,29 @@
+=======================================================

+                  The Nimrod Runtime Library

+             Copyright (C) 2004-2007  Andreas Rumpf

+=======================================================

+

+This is the file copying.txt, it applies to the Nimrod Run-Time Library

+(lib) and base packages (base) distributed by members of the Nimrod

+Development Team.

+

+The source code of the Nimrod Runtime Libraries and packages are

+distributed under the Library GNU General Public License

+(see the file lgpl.txt) with the following modification:

+

+As a special exception, the copyright holders of this library give you

+permission to link this library with independent modules to produce an

+executable, regardless of the license terms of these independent modules,

+and to copy and distribute the resulting executable under terms of your choice,

+provided that you also meet, for each linked independent module, the terms

+and conditions of the license of that module. An independent module is a module

+which is not derived from or based on this library. If you modify this

+library, you may extend this exception to your version of the library, but

+you are not obligated to do so. If you do not wish to do so, delete this

+exception statement from your version.

+

+If you didn't receive a copy of the file lgpl.txt, contact:

+      Free Software Foundation

+      675 Mass Ave

+      Cambridge, MA  02139

+      USA

diff --git a/lib/debugger.nim b/lib/debugger.nim
new file mode 100755
index 000000000..dca346fe0
--- /dev/null
+++ b/lib/debugger.nim
@@ -0,0 +1,499 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2008 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+# This file implements the embedded debugger that can be linked

+# with the application. We should not use dynamic memory here as that

+# would interfere with the GC and trigger ON/OFF errors if the

+# user program corrupts memory. Unfortunately, for dispaying

+# variables we use the system.repr() proc which uses Nimrod

+# strings and thus allocates memory from the heap. Pity, but

+# I do not want to implement repr() twice. We also cannot deactivate

+# the GC here as that might run out of memory too quickly...

+

+type

+  TDbgState = enum

+    dbOff,        # debugger is turned off

+    dbStepInto,   # debugger is in tracing mode

+    dbStepOver,

+    dbSkipCurrent,

+    dbQuiting,    # debugger wants to quit

+    dbBreakpoints # debugger is only interested in breakpoints

+

+  TDbgBreakpoint = record

+    low, high: int   # range from low to high; if disabled

+                     # both low and high are set to their negative values

+                     # this makes the check faster and safes memory

+    filename: string

+    name: string     # name of breakpoint

+

+  TVarSlot {.compilerproc.} = record # variable slots used for debugger:

+    address: pointer

+    typ: PNimType

+    name: cstring   # for globals this is "module.name"

+

+  PExtendedFrame = ptr TExtendedFrame

+  TExtendedFrame = record  # If the debugger is enabled the compiler provides 

+                           # an extended frame. Of course only slots that are

+                           # needed are allocated and not 10_000, except for

+                           # the global data description.

+    f: TFrame

+    slots: array[0..10_000, TVarSlot]

+

+var

+  dbgInSignal: bool # wether the debugger is in the signal handler

+  dbgIn: TFile # debugger input stream

+  dbgUser: string = "s" # buffer for user input; first command is ``step_into``

+                        # needs to be global cause we store the last command

+                        # in it

+  dbgState: TDbgState = dbStepInto # state of debugger

+  dbgBP: array[0..127, TDbgBreakpoint] # breakpoints

+  dbgBPlen: int = 0

+

+  dbgSkipToFrame: PFrame # frame to be skipped to

+

+  dbgGlobalData: TExtendedFrame # this reserves much space, but

+                                # for now it is the most practical way

+

+  maxDisplayRecDepth: int = 5 # do not display too much data!

+

+proc findBreakpoint(name: string): int =

+  # returns -1 if not found

+  for i in countdown(dbgBPlen-1, 0):

+    if name == dbgBP[i].name: return i

+  return -1

+

+proc ListBreakPoints() =

+  write(stdout, "*** emdb| Breakpoints:\n")

+  for i in 0 .. dbgBPlen-1:

+    write(stdout, dbgBP[i].name & ": " & $abs(dbgBP[i].low) & ".." &

+                  $abs(dbgBP[i].high) & dbgBP[i].filename)

+    if dbgBP[i].low < 0:

+      write(stdout, " [disabled]\n")

+    else:

+      write(stdout, "\n")

+  write(stdout, "***\n")

+

+proc openAppend(filename: string): TFile =

+  if openFile(result, filename, fmAppend):

+    write(result, "----------------------------------------\n")

+

+proc dbgRepr(p: pointer, typ: PNimType): string =

+  var

+    cl: TReprClosure

+  initReprClosure(cl)

+  cl.recDepth = maxDisplayRecDepth

+  # locks for the GC turned out to be a bad idea...

+  # inc(recGcLock)

+  result = ""

+  reprAux(result, p, typ, cl)

+  # dec(recGcLock)

+  deinitReprClosure(cl)

+

+proc writeVariable(stream: TFile, slot: TVarSlot) =

+  write(stream, slot.name)

+  write(stream, " = ")

+  writeln(stream, dbgRepr(slot.address, slot.typ))

+

+proc ListFrame(stream: TFile, f: PExtendedFrame) =

+  write(stream, "*** emdb| Frame (" & $f.f.len &  " slots):\n")

+  for i in 0 .. f.f.len-1:

+    writeVariable(stream, f.slots[i])

+  write(stream, "***\n")

+

+proc ListVariables(stream: TFile, f: PExtendedFrame) =

+  write(stream, "*** emdb| Frame (" & $f.f.len & " slots):\n")

+  for i in 0 .. f.f.len-1:

+    writeln(stream, f.slots[i].name)

+  write(stream, "***\n")

+

+proc debugOut(msg: cstring) =

+  # the *** *** markers are for easy recognition of debugger

+  # output for external frontends.

+  write(stdout, "*** emdb| ")

+  write(stdout, msg)

+  write(stdout, "***\n")

+

+proc dbgFatal(msg: cstring) =

+  debugOut(msg)

+  dbgAborting = True # the debugger wants to abort

+  quit(1)

+

+proc findVariable(frame: PExtendedFrame, varname: cstring): int =

+  for i in 0 .. frame.f.len - 1:

+    if c_strcmp(frame.slots[i].name, varname) == 0: return i

+  return -1

+

+proc dbgShowCurrentProc(dbgFramePointer: PFrame) =

+  if dbgFramePointer != nil:

+    write(stdout, "*** emdb| now in proc: ")

+    write(stdout, dbgFramePointer.procname)

+    write(stdout, " ***\n")

+  else:

+    write(stdout, "*** emdb| (procedure name not available) ***\n")

+

+proc dbgShowExecutionPoint() =

+  write(stdout, "*** emdb| " & $framePtr.filename & "(" & $framePtr.line &

+                ") " & $framePtr.procname & " ***\n")

+

+when defined(windows) or defined(dos) or defined(os2):

+  {.define: FileSystemCaseInsensitive.}

+

+proc fileMatches(c, bp: cstring): bool =

+  # bp = breakpoint filename

+  # c = current filename

+  # we consider it a match if bp is a suffix of c

+  # and the character for the suffix does not exist or

+  # is one of: \  /  :

+  # depending on the OS case does not matter!

+  var blen: int = c_strlen(bp)

+  var clen: int = c_strlen(c)

+  if blen > clen: return false

+  # check for \ /  :

+  if clen-blen-1 >= 0 and c[clen-blen-1] notin {'\\', '/', ':'}:

+    return false

+  var i = 0

+  while i < blen:

+    var x, y: char

+    x = bp[i]

+    y = c[i+clen-blen]

+    when defined(FileSystemCaseInsensitive):

+      if x >= 'A' and x <= 'Z': x = chr(ord(x) - ord('A') + ord('a'))

+      if y >= 'A' and y <= 'Z': y = chr(ord(y) - ord('A') + ord('a'))

+    if x != y: return false

+    inc(i)

+  return true

+

+proc dbgBreakpointReached(line: int): int =

+  for i in 0..dbgBPlen-1:

+    if line >= dbgBP[i].low and line <= dbgBP[i].high and

+        fileMatches(framePtr.filename, dbgBP[i].filename): return i

+  return -1

+

+proc scanAndAppendWord(src: string, a: var string, start: int): int =

+  result = start

+  # skip whitespace:

+  while src[result] in {'\t', ' '}: inc(result)

+  while True:

+    case src[result]

+    of 'a'..'z', '0'..'9': add(a, src[result])

+    of '_': nil # just skip it

+    of 'A'..'Z': add(a, chr(ord(src[result]) - ord('A') + ord('a')))

+    else: break

+    inc(result)

+

+proc scanWord(src: string, a: var string, start: int): int =

+  a = ""

+  result = scanAndAppendWord(src, a, start)

+

+proc scanFilename(src: string, a: var string, start: int): int =

+  result = start

+  a = ""

+  # skip whitespace:

+  while src[result] in {'\t', ' '}: inc(result)

+  while src[result] notin {'\t', ' ', '\0'}:

+    add(a, src[result])

+    inc(result)

+

+proc scanNumber(src: string, a: var int, start: int): int =

+  result = start

+  a = 0

+  while src[result] in {'\t', ' '}: inc(result)

+  while true:

+    case src[result]

+    of '0'..'9': a = a * 10 + ord(src[result]) - ord('0')

+    of '_': nil # skip underscores (nice for long line numbers)

+    else: break

+    inc(result)

+

+proc dbgHelp() =

+  debugOut("""

+list of commands (see the manual for further help):

+              GENERAL

+h, help                 display this help message

+q, quit                 quit the debugger and the program

+<ENTER>                 repeat the previous debugger command

+              EXECUTING

+s, stepinto             single step, stepping into routine calls

+n, stepover             single step, without stepping into routine calls

+f, skipcurrent          continue execution until the current routine finishes

+c, continue             continue execution until the next breakpoint

+i, ignore               continue execution, ignore all breakpoints

+              BREAKPOINTS

+b, setbreak  <name> [fromline [toline]] [file]

+                        set a new breakpoint named 'name' for line and file

+                        if line or file are omitted the current one is used

+breakpoints             display the entire breakpoint list

+disable <name>          disable a breakpoint

+enable  <name>          enable a breakpoint

+              DATA DISPLAY

+e, eval <exp>           evaluate the expression <exp>

+o, out <file> <exp>     evaluate <exp> and write it to <file>

+w, where                display the current execution point

+stackframe [file]       display current stack frame [and write it to file]

+u, up                   go up in the call stack

+d, down                 go down in the call stack

+callstack               display the entire call stack

+l, locals               display available local variables

+g, globals              display available global variables

+maxdisplay <integer>    set the display's recursion maximum

+""")

+

+proc InvalidCommand() =

+  debugOut("[Warning] invalid command ignored (type 'h' for help) ")

+

+proc hasExt(s: string): bool =

+  # returns true if s has a filename extension

+  for i in countdown(len(s)-1, 0):

+    if s[i] == '.': return true

+  return false

+

+proc setBreakPoint(s: string, start: int) =

+  var dbgTemp: string

+  var i = scanWord(s, dbgTemp, start)

+  if i <= start:

+    InvalidCommand()

+    return

+  if dbgBPlen >= high(dbgBP):

+    debugOut("[Warning] no breakpoint could be set; out of breakpoint space ")

+    return

+  var x = dbgBPlen

+  inc(dbgBPlen)

+  dbgBP[x].name = dbgTemp

+  i = scanNumber(s, dbgBP[x].low, i)

+  if dbgBP[x].low == 0:

+    # set to current line:

+    dbgBP[x].low = framePtr.line

+  i = scanNumber(s, dbgBP[x].high, i)

+  if dbgBP[x].high == 0: # set to low:

+    dbgBP[x].high = dbgBP[x].low

+  i = scanFilename(s, dbgTemp, i)

+  if not (dbgTemp.len == 0):

+    if not hasExt(dbgTemp): add(dbgTemp, ".nim")

+    dbgBP[x].filename = dbgTemp

+  else: # use current filename

+    dbgBP[x].filename = $framePtr.filename

+  # skip whitespace:

+  while s[i] in {' ', '\t'}: inc(i)

+  if s[i] != '\0':

+    dec(dbgBPLen) # remove buggy breakpoint

+    InvalidCommand()

+

+proc BreakpointSetEnabled(s: string, start, enabled: int) =

+  var dbgTemp: string

+  var i = scanWord(s, dbgTemp, start)

+  if i <= start:

+    InvalidCommand()

+    return

+  var x = findBreakpoint(dbgTemp)

+  if x < 0: debugOut("[Warning] breakpoint does not exist ")

+  elif enabled * dbgBP[x].low < 0: # signs are different?

+    dbgBP[x].low = -dbgBP[x].low

+    dbgBP[x].high = -dbgBP[x].high

+

+proc dbgEvaluate(stream: TFile, s: string, start: int,

+                 currFrame: PExtendedFrame) =

+  var dbgTemp: string

+  var i = scanWord(s, dbgTemp, start)

+  while s[i] in {' ', '\t'}: inc(i)

+  var f = currFrame

+  if s[i] == '.':

+    inc(i) # skip '.'

+    add(dbgTemp, '.')

+    i = scanAndAppendWord(s, dbgTemp, i)

+    # search for global var:

+    f = addr(dbgGlobalData)

+  if s[i] != '\0':

+    debugOut("[Warning] could not parse expr ")

+    return

+  var j = findVariable(f, dbgTemp)

+  if j < 0:

+    debugOut("[Warning] could not find variable ")

+    return

+  writeVariable(stream, f.slots[j])

+

+proc dbgOut(s: string, start: int, currFrame: PExtendedFrame) =

+  var dbgTemp: string

+  var i = scanFilename(s, dbgTemp, start)

+  if dbgTemp.len == 0:

+    InvalidCommand()

+    return

+  var stream = openAppend(dbgTemp)

+  if stream == nil:

+    debugOut("[Warning] could not open or create file ")

+    return

+  dbgEvaluate(stream, s, i, currFrame)

+  closeFile(stream)

+

+proc dbgStackFrame(s: string, start: int, currFrame: PExtendedFrame) =

+  var dbgTemp: string

+  var i = scanFilename(s, dbgTemp, start)

+  if dbgTemp.len == 0:

+    # just write it to stdout:

+    ListFrame(stdout, currFrame)

+  else:

+    var stream = openAppend(dbgTemp)

+    if stream == nil:

+      debugOut("[Warning] could not open or create file ")

+      return

+    ListFrame(stream, currFrame)

+    closeFile(stream)

+

+proc CommandPrompt() =

+  # if we return from this routine, user code executes again

+  var

+    again: bool = True

+    dbgFramePtr = framePtr # for going down and up the stack

+    dbgDown: int = 0 # how often we did go down

+

+  while again:

+    write(stdout, "*** emdb| >>")

+    var tmp = readLine(stdin)

+    if tmp.len > 0: dbgUser = tmp

+    # now look what we have to do:

+    var dbgTemp: string

+    var i = scanWord(dbgUser, dbgTemp, 0)

+    case dbgTemp

+    of "": InvalidCommand()

+    of "s", "stepinto":

+      dbgState = dbStepInto

+      again = false

+    of "n", "stepover":

+      dbgState = dbStepOver

+      dbgSkipToFrame = framePtr

+      again = false

+    of "f", "skipcurrent":

+      dbgState = dbSkipCurrent

+      dbgSkipToFrame = framePtr.prev

+      again = false

+    of "c", "continue":

+      dbgState = dbBreakpoints

+      again = false

+    of "i", "ignore":

+      dbgState = dbOff

+      again = false

+    of "h", "help":

+      dbgHelp()

+    of "q", "quit":

+      dbgState = dbQuiting

+      dbgAborting = True

+      again = false

+      quit(1) # BUGFIX: quit with error code > 0

+    of "e", "eval":

+      dbgEvaluate(stdout, dbgUser, i, cast[PExtendedFrame](dbgFramePtr))

+    of "o", "out":

+      dbgOut(dbgUser, i, cast[PExtendedFrame](dbgFramePtr))

+    of "stackframe":

+      dbgStackFrame(dbgUser, i, cast[PExtendedFrame](dbgFramePtr))

+    of "w", "where":

+      dbgShowExecutionPoint()

+    of "l", "locals":

+      ListVariables(stdout, cast[PExtendedFrame](dbgFramePtr))

+    of "g", "globals":

+      ListVariables(stdout, addr(dbgGlobalData))

+    of "u", "up":

+      if dbgDown <= 0:

+        debugOut("[Warning] cannot go up any further ")

+      else:

+        dbgFramePtr = framePtr

+        for j in 0 .. dbgDown-2: # BUGFIX

+          dbgFramePtr = dbgFramePtr.prev

+        dec(dbgDown)

+      dbgShowCurrentProc(dbgFramePtr)

+    of "d", "down":

+      if dbgFramePtr != nil:

+        inc(dbgDown)

+        dbgFramePtr = dbgFramePtr.prev

+        dbgShowCurrentProc(dbgFramePtr)

+      else:

+        debugOut("[Warning] cannot go down any further ")

+    of "callstack":

+      WriteStackTrace()

+    of "b", "setbreak":

+      setBreakPoint(dbgUser, i)

+    of "breakpoints":

+      ListBreakPoints()

+    of "disable":

+      BreakpointSetEnabled(dbgUser, i, -1)

+    of "enable":

+      BreakpointSetEnabled(dbgUser, i, +1)

+    of "maxdisplay":

+      var parsed: int

+      i = scanNumber(dbgUser, parsed, i)

+      if dbgUser[i-1] in {'0'..'9'}:

+        if parsed == 0: maxDisplayRecDepth = -1

+        else: maxDisplayRecDepth = parsed

+      else:

+        InvalidCommand()

+    else:

+      InvalidCommand()

+

+proc endbStep() =

+  # we get into here if an unhandled exception has been raised

+  # XXX: do not allow the user to run the program any further?

+  # XXX: BUG: the frame is lost here!

+  dbgShowExecutionPoint()

+  CommandPrompt()

+

+proc checkForBreakpoint() =

+  var i = dbgBreakpointReached(framePtr.line)

+  if i >= 0:

+    write(stdout, "*** emdb| reached ")

+    write(stdout, dbgBP[i].name)

+    write(stdout, " in ")

+    write(stdout, framePtr.filename)

+    write(stdout, "(")

+    write(stdout, framePtr.line)

+    write(stdout, ") ")

+    write(stdout, framePtr.procname)

+    write(stdout, " ***\n")

+    CommandPrompt()

+

+# interface to the user program:

+

+proc dbgRegisterBreakpoint(line: int,

+                           filename, name: cstring) {.compilerproc.} =

+  var x = dbgBPlen

+  inc(dbgBPlen)

+  dbgBP[x].name = $name

+  dbgBP[x].filename = $filename

+  dbgBP[x].low = line

+  dbgBP[x].high = line

+

+proc dbgRegisterGlobal(name: cstring, address: pointer,

+                       typ: PNimType) {.compilerproc.} =

+  var i = dbgGlobalData.f.len

+  if i >= high(dbgGlobalData.slots):

+    debugOut("[Warning] cannot register global ")

+    return

+  dbgGlobalData.slots[i].name = name

+  dbgGlobalData.slots[i].typ = typ

+  dbgGlobalData.slots[i].address = address

+  inc(dbgGlobalData.f.len)

+

+proc endb(line: int) {.compilerproc.} =

+  # This proc is called before any Nimrod code line!

+  # Thus, it must have as few parameters as possible to keep the

+  # code size small!

+  # check if we are at an enabled breakpoint or "in the mood"

+  framePtr.line = line # this is done here for smaller code size!

+  if dbgLineHook != nil: dbgLineHook()

+  case dbgState

+  of dbStepInto:

+    # we really want the command prompt here:

+    dbgShowExecutionPoint()

+    CommandPrompt()

+  of dbSkipCurrent, dbStepOver: # skip current routine

+    if framePtr == dbgSkipToFrame:

+      dbgShowExecutionPoint()

+      CommandPrompt()

+    else: # breakpoints are wanted though (I guess)

+      checkForBreakpoint()

+  of dbBreakpoints: # debugger is only interested in breakpoints

+    checkForBreakpoint()

+  else: nil

diff --git a/lib/dlmalloc.c b/lib/dlmalloc.c
new file mode 100755
index 000000000..79fb5801b
--- /dev/null
+++ b/lib/dlmalloc.c
@@ -0,0 +1,5071 @@
+#define USE_DL_PREFIX

+

+#define FOOTERS 1

+#define DEBUG 1

+/*

+#define ABORT_ON_ASSERT_FAILURE 0

+*/

+

+/*

+  This is a version (aka dlmalloc) of malloc/free/realloc written by

+  Doug Lea and released to the public domain, as explained at

+  http://creativecommons.org/licenses/publicdomain.  Send questions,

+  comments, complaints, performance data, etc to dl@cs.oswego.edu

+

+* Version 2.8.3 Thu Sep 22 11:16:15 2005  Doug Lea  (dl at gee)

+

+   Note: There may be an updated version of this malloc obtainable at

+           ftp://gee.cs.oswego.edu/pub/misc/malloc.c

+         Check before installing!

+

+* Quickstart

+

+  This library is all in one file to simplify the most common usage:

+  ftp it, compile it (-O3), and link it into another program. All of

+  the compile-time options default to reasonable values for use on

+  most platforms.  You might later want to step through various

+  compile-time and dynamic tuning options.

+

+  For convenience, an include file for code using this malloc is at:

+     ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h

+  You don't really need this .h file unless you call functions not

+  defined in your system include files.  The .h file contains only the

+  excerpts from this file needed for using this malloc on ANSI C/C++

+  systems, so long as you haven't changed compile-time options about

+  naming and tuning parameters.  If you do, then you can create your

+  own malloc.h that does include all settings by cutting at the point

+  indicated below. Note that you may already by default be using a C

+  library containing a malloc that is based on some version of this

+  malloc (for example in linux). You might still want to use the one

+  in this file to customize settings or to avoid overheads associated

+  with library versions.

+

+* Vital statistics:

+

+  Supported pointer/size_t representation:       4 or 8 bytes

+       size_t MUST be an unsigned type of the same width as

+       pointers. (If you are using an ancient system that declares

+       size_t as a signed type, or need it to be a different width

+       than pointers, you can use a previous release of this malloc

+       (e.g. 2.7.2) supporting these.)

+

+  Alignment:                                     8 bytes (default)

+       This suffices for nearly all current machines and C compilers.

+       However, you can define MALLOC_ALIGNMENT to be wider than this

+       if necessary (up to 128bytes), at the expense of using more space.

+

+  Minimum overhead per allocated chunk:   4 or  8 bytes (if 4byte sizes)

+                                          8 or 16 bytes (if 8byte sizes)

+       Each malloced chunk has a hidden word of overhead holding size

+       and status information, and additional cross-check word

+       if FOOTERS is defined.

+

+  Minimum allocated size: 4-byte ptrs:  16 bytes    (including overhead)

+                          8-byte ptrs:  32 bytes    (including overhead)

+

+       Even a request for zero bytes (i.e., malloc(0)) returns a

+       pointer to something of the minimum allocatable size.

+       The maximum overhead wastage (i.e., number of extra bytes

+       allocated than were requested in malloc) is less than or equal

+       to the minimum size, except for requests >= mmap_threshold that

+       are serviced via mmap(), where the worst case wastage is about

+       32 bytes plus the remainder from a system page (the minimal

+       mmap unit); typically 4096 or 8192 bytes.

+

+  Security: static-safe; optionally more or less

+       The "security" of malloc refers to the ability of malicious

+       code to accentuate the effects of errors (for example, freeing

+       space that is not currently malloc'ed or overwriting past the

+       ends of chunks) in code that calls malloc.  This malloc

+       guarantees not to modify any memory locations below the base of

+       heap, i.e., static variables, even in the presence of usage

+       errors.  The routines additionally detect most improper frees

+       and reallocs.  All this holds as long as the static bookkeeping

+       for malloc itself is not corrupted by some other means.  This

+       is only one aspect of security -- these checks do not, and

+       cannot, detect all possible programming errors.

+

+       If FOOTERS is defined nonzero, then each allocated chunk

+       carries an additional check word to verify that it was malloced

+       from its space.  These check words are the same within each

+       execution of a program using malloc, but differ across

+       executions, so externally crafted fake chunks cannot be

+       freed. This improves security by rejecting frees/reallocs that

+       could corrupt heap memory, in addition to the checks preventing

+       writes to statics that are always on.  This may further improve

+       security at the expense of time and space overhead.  (Note that

+       FOOTERS may also be worth using with MSPACES.)

+

+       By default detected errors cause the program to abort (calling

+       "abort()"). You can override this to instead proceed past

+       errors by defining PROCEED_ON_ERROR.  In this case, a bad free

+       has no effect, and a malloc that encounters a bad address

+       caused by user overwrites will ignore the bad address by

+       dropping pointers and indices to all known memory. This may

+       be appropriate for programs that should continue if at all

+       possible in the face of programming errors, although they may

+       run out of memory because dropped memory is never reclaimed.

+

+       If you don't like either of these options, you can define

+       CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything

+       else. And if if you are sure that your program using malloc has

+       no errors or vulnerabilities, you can define INSECURE to 1,

+       which might (or might not) provide a small performance improvement.

+

+  Thread-safety: NOT thread-safe unless USE_LOCKS defined

+       When USE_LOCKS is defined, each public call to malloc, free,

+       etc is surrounded with either a pthread mutex or a win32

+       spinlock (depending on WIN32). This is not especially fast, and

+       can be a major bottleneck.  It is designed only to provide

+       minimal protection in concurrent environments, and to provide a

+       basis for extensions.  If you are using malloc in a concurrent

+       program, consider instead using ptmalloc, which is derived from

+       a version of this malloc. (See http://www.malloc.de).

+

+  System requirements: Any combination of MORECORE and/or MMAP/MUNMAP

+       This malloc can use unix sbrk or any emulation (invoked using

+       the CALL_MORECORE macro) and/or mmap/munmap or any emulation

+       (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system

+       memory.  On most unix systems, it tends to work best if both

+       MORECORE and MMAP are enabled.  On Win32, it uses emulations

+       based on VirtualAlloc. It also uses common C library functions

+       like memset.

+

+  Compliance: I believe it is compliant with the Single Unix Specification

+       (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably

+       others as well.

+

+* Overview of algorithms

+

+  This is not the fastest, most space-conserving, most portable, or

+  most tunable malloc ever written. However it is among the fastest

+  while also being among the most space-conserving, portable and

+  tunable.  Consistent balance across these factors results in a good

+  general-purpose allocator for malloc-intensive programs.

+

+  In most ways, this malloc is a best-fit allocator. Generally, it

+  chooses the best-fitting existing chunk for a request, with ties

+  broken in approximately least-recently-used order. (This strategy

+  normally maintains low fragmentation.) However, for requests less

+  than 256bytes, it deviates from best-fit when there is not an

+  exactly fitting available chunk by preferring to use space adjacent

+  to that used for the previous small request, as well as by breaking

+  ties in approximately most-recently-used order. (These enhance

+  locality of series of small allocations.)  And for very large requests

+  (>= 256Kb by default), it relies on system memory mapping

+  facilities, if supported.  (This helps avoid carrying around and

+  possibly fragmenting memory used only for large chunks.)

+

+  All operations (except malloc_stats and mallinfo) have execution

+  times that are bounded by a constant factor of the number of bits in

+  a size_t, not counting any clearing in calloc or copying in realloc,

+  or actions surrounding MORECORE and MMAP that have times

+  proportional to the number of non-contiguous regions returned by

+  system allocation routines, which is often just 1.

+

+  The implementation is not very modular and seriously overuses

+  macros. Perhaps someday all C compilers will do as good a job

+  inlining modular code as can now be done by brute-force expansion,

+  but now, enough of them seem not to.

+

+  Some compilers issue a lot of warnings about code that is

+  dead/unreachable only on some platforms, and also about intentional

+  uses of negation on unsigned types. All known cases of each can be

+  ignored.

+

+  For a longer but out of date high-level description, see

+     http://gee.cs.oswego.edu/dl/html/malloc.html

+

+* MSPACES

+  If MSPACES is defined, then in addition to malloc, free, etc.,

+  this file also defines mspace_malloc, mspace_free, etc. These

+  are versions of malloc routines that take an "mspace" argument

+  obtained using create_mspace, to control all internal bookkeeping.

+  If ONLY_MSPACES is defined, only these versions are compiled.

+  So if you would like to use this allocator for only some allocations,

+  and your system malloc for others, you can compile with

+  ONLY_MSPACES and then do something like...

+    static mspace mymspace = create_mspace(0,0); // for example

+    #define mymalloc(bytes)  mspace_malloc(mymspace, bytes)

+

+  (Note: If you only need one instance of an mspace, you can instead

+  use "USE_DL_PREFIX" to relabel the global malloc.)

+

+  You can similarly create thread-local allocators by storing

+  mspaces as thread-locals. For example:

+    static __thread mspace tlms = 0;

+    void*  tlmalloc(size_t bytes) {

+      if (tlms == 0) tlms = create_mspace(0, 0);

+      return mspace_malloc(tlms, bytes);

+    }

+    void  tlfree(void* mem) { mspace_free(tlms, mem); }

+

+  Unless FOOTERS is defined, each mspace is completely independent.

+  You cannot allocate from one and free to another (although

+  conformance is only weakly checked, so usage errors are not always

+  caught). If FOOTERS is defined, then each chunk carries around a tag

+  indicating its originating mspace, and frees are directed to their

+  originating spaces.

+

+ -------------------------  Compile-time options ---------------------------

+

+Be careful in setting #define values for numerical constants of type

+size_t. On some systems, literal values are not automatically extended

+to size_t precision unless they are explicitly casted.

+

+WIN32                    default: defined if _WIN32 defined

+  Defining WIN32 sets up defaults for MS environment and compilers.

+  Otherwise defaults are for unix.

+

+MALLOC_ALIGNMENT         default: (size_t)8

+  Controls the minimum alignment for malloc'ed chunks.  It must be a

+  power of two and at least 8, even on machines for which smaller

+  alignments would suffice. It may be defined as larger than this

+  though. Note however that code and data structures are optimized for

+  the case of 8-byte alignment.

+

+MSPACES                  default: 0 (false)

+  If true, compile in support for independent allocation spaces.

+  This is only supported if HAVE_MMAP is true.

+

+ONLY_MSPACES             default: 0 (false)

+  If true, only compile in mspace versions, not regular versions.

+

+USE_LOCKS                default: 0 (false)

+  Causes each call to each public routine to be surrounded with

+  pthread or WIN32 mutex lock/unlock. (If set true, this can be

+  overridden on a per-mspace basis for mspace versions.)

+

+FOOTERS                  default: 0

+  If true, provide extra checking and dispatching by placing

+  information in the footers of allocated chunks. This adds

+  space and time overhead.

+

+INSECURE                 default: 0

+  If true, omit checks for usage errors and heap space overwrites.

+

+USE_DL_PREFIX            default: NOT defined

+  Causes compiler to prefix all public routines with the string 'dl'.

+  This can be useful when you only want to use this malloc in one part

+  of a program, using your regular system malloc elsewhere.

+

+ABORT                    default: defined as abort()

+  Defines how to abort on failed checks.  On most systems, a failed

+  check cannot die with an "assert" or even print an informative

+  message, because the underlying print routines in turn call malloc,

+  which will fail again.  Generally, the best policy is to simply call

+  abort(). It's not very useful to do more than this because many

+  errors due to overwriting will show up as address faults (null, odd

+  addresses etc) rather than malloc-triggered checks, so will also

+  abort.  Also, most compilers know that abort() does not return, so

+  can better optimize code conditionally calling it.

+

+PROCEED_ON_ERROR           default: defined as 0 (false)

+  Controls whether detected bad addresses cause them to bypassed

+  rather than aborting. If set, detected bad arguments to free and

+  realloc are ignored. And all bookkeeping information is zeroed out

+  upon a detected overwrite of freed heap space, thus losing the

+  ability to ever return it from malloc again, but enabling the

+  application to proceed. If PROCEED_ON_ERROR is defined, the

+  static variable malloc_corruption_error_count is compiled in

+  and can be examined to see if errors have occurred. This option

+  generates slower code than the default abort policy.

+

+DEBUG                    default: NOT defined

+  The DEBUG setting is mainly intended for people trying to modify

+  this code or diagnose problems when porting to new platforms.

+  However, it may also be able to better isolate user errors than just

+  using runtime checks.  The assertions in the check routines spell

+  out in more detail the assumptions and invariants underlying the

+  algorithms.  The checking is fairly extensive, and will slow down

+  execution noticeably. Calling malloc_stats or mallinfo with DEBUG

+  set will attempt to check every non-mmapped allocated and free chunk

+  in the course of computing the summaries.

+

+ABORT_ON_ASSERT_FAILURE   default: defined as 1 (true)

+  Debugging assertion failures can be nearly impossible if your

+  version of the assert macro causes malloc to be called, which will

+  lead to a cascade of further failures, blowing the runtime stack.

+  ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),

+  which will usually make debugging easier.

+

+MALLOC_FAILURE_ACTION     default: sets errno to ENOMEM, or no-op on win32

+  The action to take before "return 0" when malloc fails to be able to

+  return memory because there is none available.

+

+HAVE_MORECORE             default: 1 (true) unless win32 or ONLY_MSPACES

+  True if this system supports sbrk or an emulation of it.

+

+MORECORE                  default: sbrk

+  The name of the sbrk-style system routine to call to obtain more

+  memory.  See below for guidance on writing custom MORECORE

+  functions. The type of the argument to sbrk/MORECORE varies across

+  systems.  It cannot be size_t, because it supports negative

+  arguments, so it is normally the signed type of the same width as

+  size_t (sometimes declared as "intptr_t").  It doesn't much matter

+  though. Internally, we only call it with arguments less than half

+  the max value of a size_t, which should work across all reasonable

+  possibilities, although sometimes generating compiler warnings.  See

+  near the end of this file for guidelines for creating a custom

+  version of MORECORE.

+

+MORECORE_CONTIGUOUS       default: 1 (true)

+  If true, take advantage of fact that consecutive calls to MORECORE

+  with positive arguments always return contiguous increasing

+  addresses.  This is true of unix sbrk. It does not hurt too much to

+  set it true anyway, since malloc copes with non-contiguities.

+  Setting it false when definitely non-contiguous saves time

+  and possibly wasted space it would take to discover this though.

+

+MORECORE_CANNOT_TRIM      default: NOT defined

+  True if MORECORE cannot release space back to the system when given

+  negative arguments. This is generally necessary only if you are

+  using a hand-crafted MORECORE function that cannot handle negative

+  arguments.

+

+HAVE_MMAP                 default: 1 (true)

+  True if this system supports mmap or an emulation of it.  If so, and

+  HAVE_MORECORE is not true, MMAP is used for all system

+  allocation. If set and HAVE_MORECORE is true as well, MMAP is

+  primarily used to directly allocate very large blocks. It is also

+  used as a backup strategy in cases where MORECORE fails to provide

+  space from system. Note: A single call to MUNMAP is assumed to be

+  able to unmap memory that may have be allocated using multiple calls

+  to MMAP, so long as they are adjacent.

+

+HAVE_MREMAP               default: 1 on linux, else 0

+  If true realloc() uses mremap() to re-allocate large blocks and

+  extend or shrink allocation spaces.

+

+MMAP_CLEARS               default: 1 on unix

+  True if mmap clears memory so calloc doesn't need to. This is true

+  for standard unix mmap using /dev/zero.

+

+USE_BUILTIN_FFS            default: 0 (i.e., not used)

+  Causes malloc to use the builtin ffs() function to compute indices.

+  Some compilers may recognize and intrinsify ffs to be faster than the

+  supplied C version. Also, the case of x86 using gcc is special-cased

+  to an asm instruction, so is already as fast as it can be, and so

+  this setting has no effect. (On most x86s, the asm version is only

+  slightly faster than the C version.)

+

+malloc_getpagesize         default: derive from system includes, or 4096.

+  The system page size. To the extent possible, this malloc manages

+  memory from the system in page-size units.  This may be (and

+  usually is) a function rather than a constant. This is ignored

+  if WIN32, where page size is determined using getSystemInfo during

+  initialization.

+

+USE_DEV_RANDOM             default: 0 (i.e., not used)

+  Causes malloc to use /dev/random to initialize secure magic seed for

+  stamping footers. Otherwise, the current time is used.

+

+NO_MALLINFO                default: 0

+  If defined, don't compile "mallinfo". This can be a simple way

+  of dealing with mismatches between system declarations and

+  those in this file.

+

+MALLINFO_FIELD_TYPE        default: size_t

+  The type of the fields in the mallinfo struct. This was originally

+  defined as "int" in SVID etc, but is more usefully defined as

+  size_t. The value is used only if  HAVE_USR_INCLUDE_MALLOC_H is not set

+

+REALLOC_ZERO_BYTES_FREES    default: not defined

+  This should be set if a call to realloc with zero bytes should

+  be the same as a call to free. Some people think it should. Otherwise,

+  since this malloc returns a unique pointer for malloc(0), so does

+  realloc(p, 0).

+

+LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H

+LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H,  LACKS_ERRNO_H

+LACKS_STDLIB_H                default: NOT defined unless on WIN32

+  Define these if your system does not have these header files.

+  You might need to manually insert some of the declarations they provide.

+

+DEFAULT_GRANULARITY        default: page size if MORECORE_CONTIGUOUS,

+                                system_info.dwAllocationGranularity in WIN32,

+                                otherwise 64K.

+      Also settable using mallopt(M_GRANULARITY, x)

+  The unit for allocating and deallocating memory from the system.  On

+  most systems with contiguous MORECORE, there is no reason to

+  make this more than a page. However, systems with MMAP tend to

+  either require or encourage larger granularities.  You can increase

+  this value to prevent system allocation functions to be called so

+  often, especially if they are slow.  The value must be at least one

+  page and must be a power of two.  Setting to 0 causes initialization

+  to either page size or win32 region size.  (Note: In previous

+  versions of malloc, the equivalent of this option was called

+  "TOP_PAD")

+

+DEFAULT_TRIM_THRESHOLD    default: 2MB

+      Also settable using mallopt(M_TRIM_THRESHOLD, x)

+  The maximum amount of unused top-most memory to keep before

+  releasing via malloc_trim in free().  Automatic trimming is mainly

+  useful in long-lived programs using contiguous MORECORE.  Because

+  trimming via sbrk can be slow on some systems, and can sometimes be

+  wasteful (in cases where programs immediately afterward allocate

+  more large chunks) the value should be high enough so that your

+  overall system performance would improve by releasing this much

+  memory.  As a rough guide, you might set to a value close to the

+  average size of a process (program) running on your system.

+  Releasing this much memory would allow such a process to run in

+  memory.  Generally, it is worth tuning trim thresholds when a

+  program undergoes phases where several large chunks are allocated

+  and released in ways that can reuse each other's storage, perhaps

+  mixed with phases where there are no such chunks at all. The trim

+  value must be greater than page size to have any useful effect.  To

+  disable trimming completely, you can set to MAX_SIZE_T. Note that the trick

+  some people use of mallocing a huge space and then freeing it at

+  program startup, in an attempt to reserve system memory, doesn't

+  have the intended effect under automatic trimming, since that memory

+  will immediately be returned to the system.

+

+DEFAULT_MMAP_THRESHOLD       default: 256K

+      Also settable using mallopt(M_MMAP_THRESHOLD, x)

+  The request size threshold for using MMAP to directly service a

+  request. Requests of at least this size that cannot be allocated

+  using already-existing space will be serviced via mmap.  (If enough

+  normal freed space already exists it is used instead.)  Using mmap

+  segregates relatively large chunks of memory so that they can be

+  individually obtained and released from the host system. A request

+  serviced through mmap is never reused by any other request (at least

+  not directly; the system may just so happen to remap successive

+  requests to the same locations).  Segregating space in this way has

+  the benefits that: Mmapped space can always be individually released

+  back to the system, which helps keep the system level memory demands

+  of a long-lived program low.  Also, mapped memory doesn't become

+  `locked' between other chunks, as can happen with normally allocated

+  chunks, which means that even trimming via malloc_trim would not

+  release them.  However, it has the disadvantage that the space

+  cannot be reclaimed, consolidated, and then used to service later

+  requests, as happens with normal chunks.  The advantages of mmap

+  nearly always outweigh disadvantages for "large" chunks, but the

+  value of "large" may vary across systems.  The default is an

+  empirically derived value that works well in most systems. You can

+  disable mmap by setting to MAX_SIZE_T.

+

+*/

+#if defined(__WATCOMC__) || defined(_MSC_VER)

+#define WIN32 1

+#endif

+

+#ifndef WIN32

+#ifdef _WIN32

+#define WIN32 1

+#endif  /* _WIN32 */

+#endif  /* WIN32 */

+#ifdef WIN32

+#define WIN32_LEAN_AND_MEAN

+#include <windows.h>

+#define HAVE_MORECORE 0

+#define LACKS_UNISTD_H

+#define LACKS_SYS_PARAM_H

+#define LACKS_SYS_MMAN_H

+#define LACKS_STRING_H

+#define LACKS_STRINGS_H

+#define LACKS_SYS_TYPES_H

+#define LACKS_ERRNO_H

+#define MALLOC_FAILURE_ACTION

+#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */

+#endif  /* WIN32 */

+

+#if defined(DARWIN) || defined(_DARWIN)

+/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */

+#ifndef HAVE_MORECORE

+#define HAVE_MORECORE 0

+#define HAVE_MMAP 1

+#endif  /* HAVE_MORECORE */

+#endif  /* DARWIN */

+

+#ifndef LACKS_SYS_TYPES_H

+#include <sys/types.h>  /* For size_t */

+#endif  /* LACKS_SYS_TYPES_H */

+

+/* The maximum possible size_t value has all bits set */

+#define MAX_SIZE_T           (~(size_t)0)

+

+#ifndef ONLY_MSPACES

+#define ONLY_MSPACES 0

+#endif  /* ONLY_MSPACES */

+#ifndef MSPACES

+#if ONLY_MSPACES

+#define MSPACES 1

+#else   /* ONLY_MSPACES */

+#define MSPACES 0

+#endif  /* ONLY_MSPACES */

+#endif  /* MSPACES */

+#ifndef MALLOC_ALIGNMENT

+#define MALLOC_ALIGNMENT ((size_t)8U)

+#endif  /* MALLOC_ALIGNMENT */

+#ifndef FOOTERS

+#define FOOTERS 0

+#endif  /* FOOTERS */

+#ifndef ABORT

+#define ABORT  abort()

+#endif  /* ABORT */

+#ifndef ABORT_ON_ASSERT_FAILURE

+#define ABORT_ON_ASSERT_FAILURE 1

+#endif  /* ABORT_ON_ASSERT_FAILURE */

+#ifndef PROCEED_ON_ERROR

+#define PROCEED_ON_ERROR 0

+#endif  /* PROCEED_ON_ERROR */

+#ifndef USE_LOCKS

+#define USE_LOCKS 0

+#endif  /* USE_LOCKS */

+#ifndef INSECURE

+#define INSECURE 0

+#endif  /* INSECURE */

+#ifndef HAVE_MMAP

+#define HAVE_MMAP 1

+#endif  /* HAVE_MMAP */

+#ifndef MMAP_CLEARS

+#define MMAP_CLEARS 1

+#endif  /* MMAP_CLEARS */

+#ifndef HAVE_MREMAP

+#ifdef linux

+#define HAVE_MREMAP 1

+#else   /* linux */

+#define HAVE_MREMAP 0

+#endif  /* linux */

+#endif  /* HAVE_MREMAP */

+#ifndef MALLOC_FAILURE_ACTION

+#define MALLOC_FAILURE_ACTION  errno = ENOMEM;

+#endif  /* MALLOC_FAILURE_ACTION */

+#ifndef HAVE_MORECORE

+#if ONLY_MSPACES

+#define HAVE_MORECORE 0

+#else   /* ONLY_MSPACES */

+#define HAVE_MORECORE 1

+#endif  /* ONLY_MSPACES */

+#endif  /* HAVE_MORECORE */

+#if !HAVE_MORECORE

+#define MORECORE_CONTIGUOUS 0

+#else   /* !HAVE_MORECORE */

+#ifndef MORECORE

+#define MORECORE sbrk

+#endif  /* MORECORE */

+#ifndef MORECORE_CONTIGUOUS

+#define MORECORE_CONTIGUOUS 1

+#endif  /* MORECORE_CONTIGUOUS */

+#endif  /* HAVE_MORECORE */

+#ifndef DEFAULT_GRANULARITY

+#if MORECORE_CONTIGUOUS

+#define DEFAULT_GRANULARITY (0)  /* 0 means to compute in init_mparams */

+#else   /* MORECORE_CONTIGUOUS */

+#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)

+#endif  /* MORECORE_CONTIGUOUS */

+#endif  /* DEFAULT_GRANULARITY */

+#ifndef DEFAULT_TRIM_THRESHOLD

+#ifndef MORECORE_CANNOT_TRIM

+#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)

+#else   /* MORECORE_CANNOT_TRIM */

+#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T

+#endif  /* MORECORE_CANNOT_TRIM */

+#endif  /* DEFAULT_TRIM_THRESHOLD */

+#ifndef DEFAULT_MMAP_THRESHOLD

+#if HAVE_MMAP

+#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)

+#else   /* HAVE_MMAP */

+#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T

+#endif  /* HAVE_MMAP */

+#endif  /* DEFAULT_MMAP_THRESHOLD */

+#ifndef USE_BUILTIN_FFS

+#define USE_BUILTIN_FFS 0

+#endif  /* USE_BUILTIN_FFS */

+#ifndef USE_DEV_RANDOM

+#define USE_DEV_RANDOM 0

+#endif  /* USE_DEV_RANDOM */

+#ifndef NO_MALLINFO

+#define NO_MALLINFO 0

+#endif  /* NO_MALLINFO */

+#ifndef MALLINFO_FIELD_TYPE

+#define MALLINFO_FIELD_TYPE size_t

+#endif  /* MALLINFO_FIELD_TYPE */

+

+/*

+  mallopt tuning options.  SVID/XPG defines four standard parameter

+  numbers for mallopt, normally defined in malloc.h.  None of these

+  are used in this malloc, so setting them has no effect. But this

+  malloc does support the following options.

+*/

+

+#define M_TRIM_THRESHOLD     (-1)

+#define M_GRANULARITY        (-2)

+#define M_MMAP_THRESHOLD     (-3)

+

+/* ------------------------ Mallinfo declarations ------------------------ */

+

+#if !NO_MALLINFO

+/*

+  This version of malloc supports the standard SVID/XPG mallinfo

+  routine that returns a struct containing usage properties and

+  statistics. It should work on any system that has a

+  /usr/include/malloc.h defining struct mallinfo.  The main

+  declaration needed is the mallinfo struct that is returned (by-copy)

+  by mallinfo().  The malloinfo struct contains a bunch of fields that

+  are not even meaningful in this version of malloc.  These fields are

+  are instead filled by mallinfo() with other numbers that might be of

+  interest.

+

+  HAVE_USR_INCLUDE_MALLOC_H should be set if you have a

+  /usr/include/malloc.h file that includes a declaration of struct

+  mallinfo.  If so, it is included; else a compliant version is

+  declared below.  These must be precisely the same for mallinfo() to

+  work.  The original SVID version of this struct, defined on most

+  systems with mallinfo, declares all fields as ints. But some others

+  define as unsigned long. If your system defines the fields using a

+  type of different width than listed here, you MUST #include your

+  system version and #define HAVE_USR_INCLUDE_MALLOC_H.

+*/

+

+/* #define HAVE_USR_INCLUDE_MALLOC_H */

+

+#ifdef HAVE_USR_INCLUDE_MALLOC_H

+#include "/usr/include/malloc.h"

+#else /* HAVE_USR_INCLUDE_MALLOC_H */

+

+struct mallinfo {

+  MALLINFO_FIELD_TYPE arena;    /* non-mmapped space allocated from system */

+  MALLINFO_FIELD_TYPE ordblks;  /* number of free chunks */

+  MALLINFO_FIELD_TYPE smblks;   /* always 0 */

+  MALLINFO_FIELD_TYPE hblks;    /* always 0 */

+  MALLINFO_FIELD_TYPE hblkhd;   /* space in mmapped regions */

+  MALLINFO_FIELD_TYPE usmblks;  /* maximum total allocated space */

+  MALLINFO_FIELD_TYPE fsmblks;  /* always 0 */

+  MALLINFO_FIELD_TYPE uordblks; /* total allocated space */

+  MALLINFO_FIELD_TYPE fordblks; /* total free space */

+  MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */

+};

+

+#endif /* HAVE_USR_INCLUDE_MALLOC_H */

+#endif /* NO_MALLINFO */

+

+#ifdef __cplusplus

+extern "C" {

+#endif /* __cplusplus */

+

+#if !ONLY_MSPACES

+

+/* ------------------- Declarations of public routines ------------------- */

+

+#ifndef USE_DL_PREFIX

+#define dlcalloc               calloc

+#define dlfree                 free

+#define dlmalloc               malloc

+#define dlmemalign             memalign

+#define dlrealloc              realloc

+#define dlvalloc               valloc

+#define dlpvalloc              pvalloc

+#define dlmallinfo             mallinfo

+#define dlmallopt              mallopt

+#define dlmalloc_trim          malloc_trim

+#define dlmalloc_stats         malloc_stats

+#define dlmalloc_usable_size   malloc_usable_size

+#define dlmalloc_footprint     malloc_footprint

+#define dlmalloc_max_footprint malloc_max_footprint

+#define dlindependent_calloc   independent_calloc

+#define dlindependent_comalloc independent_comalloc

+#endif /* USE_DL_PREFIX */

+

+

+/*

+  malloc(size_t n)

+  Returns a pointer to a newly allocated chunk of at least n bytes, or

+  null if no space is available, in which case errno is set to ENOMEM

+  on ANSI C systems.

+

+  If n is zero, malloc returns a minimum-sized chunk. (The minimum

+  size is 16 bytes on most 32bit systems, and 32 bytes on 64bit

+  systems.)  Note that size_t is an unsigned type, so calls with

+  arguments that would be negative if signed are interpreted as

+  requests for huge amounts of space, which will often fail. The

+  maximum supported value of n differs across systems, but is in all

+  cases less than the maximum representable value of a size_t.

+*/

+void* dlmalloc(size_t);

+

+/*

+  free(void* p)

+  Releases the chunk of memory pointed to by p, that had been previously

+  allocated using malloc or a related routine such as realloc.

+  It has no effect if p is null. If p was not malloced or already

+  freed, free(p) will by default cause the current program to abort.

+*/

+void  dlfree(void*);

+

+/*

+  calloc(size_t n_elements, size_t element_size);

+  Returns a pointer to n_elements * element_size bytes, with all locations

+  set to zero.

+*/

+void* dlcalloc(size_t, size_t);

+

+/*

+  realloc(void* p, size_t n)

+  Returns a pointer to a chunk of size n that contains the same data

+  as does chunk p up to the minimum of (n, p's size) bytes, or null

+  if no space is available.

+

+  The returned pointer may or may not be the same as p. The algorithm

+  prefers extending p in most cases when possible, otherwise it

+  employs the equivalent of a malloc-copy-free sequence.

+

+  If p is null, realloc is equivalent to malloc.

+

+  If space is not available, realloc returns null, errno is set (if on

+  ANSI) and p is NOT freed.

+

+  if n is for fewer bytes than already held by p, the newly unused

+  space is lopped off and freed if possible.  realloc with a size

+  argument of zero (re)allocates a minimum-sized chunk.

+

+  The old unix realloc convention of allowing the last-free'd chunk

+  to be used as an argument to realloc is not supported.

+*/

+

+void* dlrealloc(void*, size_t);

+

+/*

+  memalign(size_t alignment, size_t n);

+  Returns a pointer to a newly allocated chunk of n bytes, aligned

+  in accord with the alignment argument.

+

+  The alignment argument should be a power of two. If the argument is

+  not a power of two, the nearest greater power is used.

+  8-byte alignment is guaranteed by normal malloc calls, so don't

+  bother calling memalign with an argument of 8 or less.

+

+  Overreliance on memalign is a sure way to fragment space.

+*/

+void* dlmemalign(size_t, size_t);

+

+/*

+  valloc(size_t n);

+  Equivalent to memalign(pagesize, n), where pagesize is the page

+  size of the system. If the pagesize is unknown, 4096 is used.

+*/

+void* dlvalloc(size_t);

+

+/*

+  mallopt(int parameter_number, int parameter_value)

+  Sets tunable parameters The format is to provide a

+  (parameter-number, parameter-value) pair.  mallopt then sets the

+  corresponding parameter to the argument value if it can (i.e., so

+  long as the value is meaningful), and returns 1 if successful else

+  0.  SVID/XPG/ANSI defines four standard param numbers for mallopt,

+  normally defined in malloc.h.  None of these are use in this malloc,

+  so setting them has no effect. But this malloc also supports other

+  options in mallopt. See below for details.  Briefly, supported

+  parameters are as follows (listed defaults are for "typical"

+  configurations).

+

+  Symbol            param #  default    allowed param values

+  M_TRIM_THRESHOLD     -1   2*1024*1024   any   (MAX_SIZE_T disables)

+  M_GRANULARITY        -2     page size   any power of 2 >= page size

+  M_MMAP_THRESHOLD     -3      256*1024   any   (or 0 if no MMAP support)

+*/

+int dlmallopt(int, int);

+

+/*

+  malloc_footprint();

+  Returns the number of bytes obtained from the system.  The total

+  number of bytes allocated by malloc, realloc etc., is less than this

+  value. Unlike mallinfo, this function returns only a precomputed

+  result, so can be called frequently to monitor memory consumption.

+  Even if locks are otherwise defined, this function does not use them,

+  so results might not be up to date.

+*/

+size_t dlmalloc_footprint(void);

+

+/*

+  malloc_max_footprint();

+  Returns the maximum number of bytes obtained from the system. This

+  value will be greater than current footprint if deallocated space

+  has been reclaimed by the system. The peak number of bytes allocated

+  by malloc, realloc etc., is less than this value. Unlike mallinfo,

+  this function returns only a precomputed result, so can be called

+  frequently to monitor memory consumption.  Even if locks are

+  otherwise defined, this function does not use them, so results might

+  not be up to date.

+*/

+size_t dlmalloc_max_footprint(void);

+

+#if !NO_MALLINFO

+/*

+  mallinfo()

+  Returns (by copy) a struct containing various summary statistics:

+

+  arena:     current total non-mmapped bytes allocated from system

+  ordblks:   the number of free chunks

+  smblks:    always zero.

+  hblks:     current number of mmapped regions

+  hblkhd:    total bytes held in mmapped regions

+  usmblks:   the maximum total allocated space. This will be greater

+                than current total if trimming has occurred.

+  fsmblks:   always zero

+  uordblks:  current total allocated space (normal or mmapped)

+  fordblks:  total free space

+  keepcost:  the maximum number of bytes that could ideally be released

+               back to system via malloc_trim. ("ideally" means that

+               it ignores page restrictions etc.)

+

+  Because these fields are ints, but internal bookkeeping may

+  be kept as longs, the reported values may wrap around zero and

+  thus be inaccurate.

+*/

+struct mallinfo dlmallinfo(void);

+#endif /* NO_MALLINFO */

+

+/*

+  independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);

+

+  independent_calloc is similar to calloc, but instead of returning a

+  single cleared space, it returns an array of pointers to n_elements

+  independent elements that can hold contents of size elem_size, each

+  of which starts out cleared, and can be independently freed,

+  realloc'ed etc. The elements are guaranteed to be adjacently

+  allocated (this is not guaranteed to occur with multiple callocs or

+  mallocs), which may also improve cache locality in some

+  applications.

+

+  The "chunks" argument is optional (i.e., may be null, which is

+  probably the most typical usage). If it is null, the returned array

+  is itself dynamically allocated and should also be freed when it is

+  no longer needed. Otherwise, the chunks array must be of at least

+  n_elements in length. It is filled in with the pointers to the

+  chunks.

+

+  In either case, independent_calloc returns this pointer array, or

+  null if the allocation failed.  If n_elements is zero and "chunks"

+  is null, it returns a chunk representing an array with zero elements

+  (which should be freed if not wanted).

+

+  Each element must be individually freed when it is no longer

+  needed. If you'd like to instead be able to free all at once, you

+  should instead use regular calloc and assign pointers into this

+  space to represent elements.  (In this case though, you cannot

+  independently free elements.)

+

+  independent_calloc simplifies and speeds up implementations of many

+  kinds of pools.  It may also be useful when constructing large data

+  structures that initially have a fixed number of fixed-sized nodes,

+  but the number is not known at compile time, and some of the nodes

+  may later need to be freed. For example:

+

+  struct Node { int item; struct Node* next; };

+

+  struct Node* build_list() {

+    struct Node** pool;

+    int n = read_number_of_nodes_needed();

+    if (n <= 0) return 0;

+    pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);

+    if (pool == 0) die();

+    // organize into a linked list...

+    struct Node* first = pool[0];

+    for (i = 0; i < n-1; ++i)

+      pool[i]->next = pool[i+1];

+    free(pool);     // Can now free the array (or not, if it is needed later)

+    return first;

+  }

+*/

+void** dlindependent_calloc(size_t, size_t, void**);

+

+/*

+  independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);

+

+  independent_comalloc allocates, all at once, a set of n_elements

+  chunks with sizes indicated in the "sizes" array.    It returns

+  an array of pointers to these elements, each of which can be

+  independently freed, realloc'ed etc. The elements are guaranteed to

+  be adjacently allocated (this is not guaranteed to occur with

+  multiple callocs or mallocs), which may also improve cache locality

+  in some applications.

+

+  The "chunks" argument is optional (i.e., may be null). If it is null

+  the returned array is itself dynamically allocated and should also

+  be freed when it is no longer needed. Otherwise, the chunks array

+  must be of at least n_elements in length. It is filled in with the

+  pointers to the chunks.

+

+  In either case, independent_comalloc returns this pointer array, or

+  null if the allocation failed.  If n_elements is zero and chunks is

+  null, it returns a chunk representing an array with zero elements

+  (which should be freed if not wanted).

+

+  Each element must be individually freed when it is no longer

+  needed. If you'd like to instead be able to free all at once, you

+  should instead use a single regular malloc, and assign pointers at

+  particular offsets in the aggregate space. (In this case though, you

+  cannot independently free elements.)

+

+  independent_comallac differs from independent_calloc in that each

+  element may have a different size, and also that it does not

+  automatically clear elements.

+

+  independent_comalloc can be used to speed up allocation in cases

+  where several structs or objects must always be allocated at the

+  same time.  For example:

+

+  struct Head { ... }

+  struct Foot { ... }

+

+  void send_message(char* msg) {

+    int msglen = strlen(msg);

+    size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };

+    void* chunks[3];

+    if (independent_comalloc(3, sizes, chunks) == 0)

+      die();

+    struct Head* head = (struct Head*)(chunks[0]);

+    char*        body = (char*)(chunks[1]);

+    struct Foot* foot = (struct Foot*)(chunks[2]);

+    // ...

+  }

+

+  In general though, independent_comalloc is worth using only for

+  larger values of n_elements. For small values, you probably won't

+  detect enough difference from series of malloc calls to bother.

+

+  Overuse of independent_comalloc can increase overall memory usage,

+  since it cannot reuse existing noncontiguous small chunks that

+  might be available for some of the elements.

+*/

+void** dlindependent_comalloc(size_t, size_t*, void**);

+

+

+/*

+  pvalloc(size_t n);

+  Equivalent to valloc(minimum-page-that-holds(n)), that is,

+  round up n to nearest pagesize.

+ */

+void*  dlpvalloc(size_t);

+

+/*

+  malloc_trim(size_t pad);

+

+  If possible, gives memory back to the system (via negative arguments

+  to sbrk) if there is unused memory at the `high' end of the malloc

+  pool or in unused MMAP segments. You can call this after freeing

+  large blocks of memory to potentially reduce the system-level memory

+  requirements of a program. However, it cannot guarantee to reduce

+  memory. Under some allocation patterns, some large free blocks of

+  memory will be locked between two used chunks, so they cannot be

+  given back to the system.

+

+  The `pad' argument to malloc_trim represents the amount of free

+  trailing space to leave untrimmed. If this argument is zero, only

+  the minimum amount of memory to maintain internal data structures

+  will be left. Non-zero arguments can be supplied to maintain enough

+  trailing space to service future expected allocations without having

+  to re-obtain memory from the system.

+

+  Malloc_trim returns 1 if it actually released any memory, else 0.

+*/

+int  dlmalloc_trim(size_t);

+

+/*

+  malloc_usable_size(void* p);

+

+  Returns the number of bytes you can actually use in

+  an allocated chunk, which may be more than you requested (although

+  often not) due to alignment and minimum size constraints.

+  You can use this many bytes without worrying about

+  overwriting other allocated objects. This is not a particularly great

+  programming practice. malloc_usable_size can be more useful in

+  debugging and assertions, for example:

+

+  p = malloc(n);

+  assert(malloc_usable_size(p) >= 256);

+*/

+size_t dlmalloc_usable_size(void*);

+

+/*

+  malloc_stats();

+  Prints on stderr the amount of space obtained from the system (both

+  via sbrk and mmap), the maximum amount (which may be more than

+  current if malloc_trim and/or munmap got called), and the current

+  number of bytes allocated via malloc (or realloc, etc) but not yet

+  freed. Note that this is the number of bytes allocated, not the

+  number requested. It will be larger than the number requested

+  because of alignment and bookkeeping overhead. Because it includes

+  alignment wastage as being in use, this figure may be greater than

+  zero even when no user-level chunks are allocated.

+

+  The reported current and maximum system memory can be inaccurate if

+  a program makes other calls to system memory allocation functions

+  (normally sbrk) outside of malloc.

+

+  malloc_stats prints only the most commonly interesting statistics.

+  More information can be obtained by calling mallinfo.

+*/

+void  dlmalloc_stats(void);

+

+#endif /* ONLY_MSPACES */

+

+#if MSPACES

+

+/*

+  mspace is an opaque type representing an independent

+  region of space that supports mspace_malloc, etc.

+*/

+typedef void* mspace;

+

+/*

+  create_mspace creates and returns a new independent space with the

+  given initial capacity, or, if 0, the default granularity size.  It

+  returns null if there is no system memory available to create the

+  space.  If argument locked is non-zero, the space uses a separate

+  lock to control access. The capacity of the space will grow

+  dynamically as needed to service mspace_malloc requests.  You can

+  control the sizes of incremental increases of this space by

+  compiling with a different DEFAULT_GRANULARITY or dynamically

+  setting with mallopt(M_GRANULARITY, value).

+*/

+mspace create_mspace(size_t capacity, int locked);

+

+/*

+  destroy_mspace destroys the given space, and attempts to return all

+  of its memory back to the system, returning the total number of

+  bytes freed. After destruction, the results of access to all memory

+  used by the space become undefined.

+*/

+size_t destroy_mspace(mspace msp);

+

+/*

+  create_mspace_with_base uses the memory supplied as the initial base

+  of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this

+  space is used for bookkeeping, so the capacity must be at least this

+  large. (Otherwise 0 is returned.) When this initial space is

+  exhausted, additional memory will be obtained from the system.

+  Destroying this space will deallocate all additionally allocated

+  space (if possible) but not the initial base.

+*/

+mspace create_mspace_with_base(void* base, size_t capacity, int locked);

+

+/*

+  mspace_malloc behaves as malloc, but operates within

+  the given space.

+*/

+void* mspace_malloc(mspace msp, size_t bytes);

+

+/*

+  mspace_free behaves as free, but operates within

+  the given space.

+

+  If compiled with FOOTERS==1, mspace_free is not actually needed.

+  free may be called instead of mspace_free because freed chunks from

+  any space are handled by their originating spaces.

+*/

+void mspace_free(mspace msp, void* mem);

+

+/*

+  mspace_realloc behaves as realloc, but operates within

+  the given space.

+

+  If compiled with FOOTERS==1, mspace_realloc is not actually

+  needed.  realloc may be called instead of mspace_realloc because

+  realloced chunks from any space are handled by their originating

+  spaces.

+*/

+void* mspace_realloc(mspace msp, void* mem, size_t newsize);

+

+/*

+  mspace_calloc behaves as calloc, but operates within

+  the given space.

+*/

+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);

+

+/*

+  mspace_memalign behaves as memalign, but operates within

+  the given space.

+*/

+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);

+

+/*

+  mspace_independent_calloc behaves as independent_calloc, but

+  operates within the given space.

+*/

+void** mspace_independent_calloc(mspace msp, size_t n_elements,

+                                 size_t elem_size, void* chunks[]);

+

+/*

+  mspace_independent_comalloc behaves as independent_comalloc, but

+  operates within the given space.

+*/

+void** mspace_independent_comalloc(mspace msp, size_t n_elements,

+                                   size_t sizes[], void* chunks[]);

+

+/*

+  mspace_footprint() returns the number of bytes obtained from the

+  system for this space.

+*/

+size_t mspace_footprint(mspace msp);

+

+/*

+  mspace_max_footprint() returns the peak number of bytes obtained from the

+  system for this space.

+*/

+size_t mspace_max_footprint(mspace msp);

+

+

+#if !NO_MALLINFO

+/*

+  mspace_mallinfo behaves as mallinfo, but reports properties of

+  the given space.

+*/

+struct mallinfo mspace_mallinfo(mspace msp);

+#endif /* NO_MALLINFO */

+

+/*

+  mspace_malloc_stats behaves as malloc_stats, but reports

+  properties of the given space.

+*/

+void mspace_malloc_stats(mspace msp);

+

+/*

+  mspace_trim behaves as malloc_trim, but

+  operates within the given space.

+*/

+int mspace_trim(mspace msp, size_t pad);

+

+/*

+  An alias for mallopt.

+*/

+int mspace_mallopt(int, int);

+

+#endif /* MSPACES */

+

+#ifdef __cplusplus

+};  /* end of extern "C" */

+#endif /* __cplusplus */

+

+/*

+  ========================================================================

+  To make a fully customizable malloc.h header file, cut everything

+  above this line, put into file malloc.h, edit to suit, and #include it

+  on the next line, as well as in programs that use this malloc.

+  ========================================================================

+*/

+

+/* #include "malloc.h" */

+

+/*------------------------------ internal #includes ---------------------- */

+

+#ifdef WIN32

+#pragma warning( disable : 4146 ) /* no "unsigned" warnings */

+#endif /* WIN32 */

+

+#include <stdio.h>       /* for printing in malloc_stats */

+

+#ifndef LACKS_ERRNO_H

+#include <errno.h>       /* for MALLOC_FAILURE_ACTION */

+#endif /* LACKS_ERRNO_H */

+#if FOOTERS

+#include <time.h>        /* for magic initialization */

+#endif /* FOOTERS */

+#ifndef LACKS_STDLIB_H

+#include <stdlib.h>      /* for abort() */

+#endif /* LACKS_STDLIB_H */

+#ifdef DEBUG

+#if ABORT_ON_ASSERT_FAILURE

+#define assert(x) if(!(x)) ABORT

+#else /* ABORT_ON_ASSERT_FAILURE */

+#include <assert.h>

+#endif /* ABORT_ON_ASSERT_FAILURE */

+#else  /* DEBUG */

+#define assert(x)

+#endif /* DEBUG */

+#ifndef LACKS_STRING_H

+#include <string.h>      /* for memset etc */

+#endif  /* LACKS_STRING_H */

+#if USE_BUILTIN_FFS

+#ifndef LACKS_STRINGS_H

+#include <strings.h>     /* for ffs */

+#endif /* LACKS_STRINGS_H */

+#endif /* USE_BUILTIN_FFS */

+#if HAVE_MMAP

+#ifndef LACKS_SYS_MMAN_H

+#include <sys/mman.h>    /* for mmap */

+#endif /* LACKS_SYS_MMAN_H */

+#ifndef LACKS_FCNTL_H

+#include <fcntl.h>

+#endif /* LACKS_FCNTL_H */

+#endif /* HAVE_MMAP */

+#if HAVE_MORECORE

+#ifndef LACKS_UNISTD_H

+#include <unistd.h>     /* for sbrk */

+#else /* LACKS_UNISTD_H */

+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)

+extern void*     sbrk(ptrdiff_t);

+#endif /* FreeBSD etc */

+#endif /* LACKS_UNISTD_H */

+#endif /* HAVE_MMAP */

+

+#ifndef WIN32

+#ifndef malloc_getpagesize

+#  ifdef _SC_PAGESIZE         /* some SVR4 systems omit an underscore */

+#    ifndef _SC_PAGE_SIZE

+#      define _SC_PAGE_SIZE _SC_PAGESIZE

+#    endif

+#  endif

+#  ifdef _SC_PAGE_SIZE

+#    define malloc_getpagesize sysconf(_SC_PAGE_SIZE)

+#  else

+#    if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)

+       extern size_t getpagesize();

+#      define malloc_getpagesize getpagesize()

+#    else

+#      ifdef WIN32 /* use supplied emulation of getpagesize */

+#        define malloc_getpagesize getpagesize()

+#      else

+#        ifndef LACKS_SYS_PARAM_H

+#          include <sys/param.h>

+#        endif

+#        ifdef EXEC_PAGESIZE

+#          define malloc_getpagesize EXEC_PAGESIZE

+#        else

+#          ifdef NBPG

+#            ifndef CLSIZE

+#              define malloc_getpagesize NBPG

+#            else

+#              define malloc_getpagesize (NBPG * CLSIZE)

+#            endif

+#          else

+#            ifdef NBPC

+#              define malloc_getpagesize NBPC

+#            else

+#              ifdef PAGESIZE

+#                define malloc_getpagesize PAGESIZE

+#              else /* just guess */

+#                define malloc_getpagesize ((size_t)4096U)

+#              endif

+#            endif

+#          endif

+#        endif

+#      endif

+#    endif

+#  endif

+#endif

+#endif

+

+/* ------------------- size_t and alignment properties -------------------- */

+

+/* The byte and bit size of a size_t */

+#define SIZE_T_SIZE         (sizeof(size_t))

+#define SIZE_T_BITSIZE      (sizeof(size_t) << 3)

+

+/* Some constants coerced to size_t */

+/* Annoying but necessary to avoid errors on some plaftorms */

+#define SIZE_T_ZERO         ((size_t)0)

+#define SIZE_T_ONE          ((size_t)1)

+#define SIZE_T_TWO          ((size_t)2)

+#define TWO_SIZE_T_SIZES    (SIZE_T_SIZE<<1)

+#define FOUR_SIZE_T_SIZES   (SIZE_T_SIZE<<2)

+#define SIX_SIZE_T_SIZES    (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)

+#define HALF_MAX_SIZE_T     (MAX_SIZE_T / 2U)

+

+/* The bit mask value corresponding to MALLOC_ALIGNMENT */

+#define CHUNK_ALIGN_MASK    (MALLOC_ALIGNMENT - SIZE_T_ONE)

+

+/* True if address a has acceptable alignment */

+#define is_aligned(A)       (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)

+

+/* the number of bytes to offset an address to align it */

+#define align_offset(A)\

+ ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\

+  ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))

+

+/* -------------------------- MMAP preliminaries ------------------------- */

+

+/*

+   If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and

+   checks to fail so compiler optimizer can delete code rather than

+   using so many "#if"s.

+*/

+

+

+/* MORECORE and MMAP must return MFAIL on failure */

+#define MFAIL                ((void*)(MAX_SIZE_T))

+#define CMFAIL               ((char*)(MFAIL)) /* defined for convenience */

+

+#if !HAVE_MMAP

+#define IS_MMAPPED_BIT       (SIZE_T_ZERO)

+#define USE_MMAP_BIT         (SIZE_T_ZERO)

+#define CALL_MMAP(s)         MFAIL

+#define CALL_MUNMAP(a, s)    (-1)

+#define DIRECT_MMAP(s)       MFAIL

+

+#else /* HAVE_MMAP */

+#define IS_MMAPPED_BIT       (SIZE_T_ONE)

+#define USE_MMAP_BIT         (SIZE_T_ONE)

+

+#ifndef WIN32

+#define CALL_MUNMAP(a, s)    munmap((a), (s))

+#define MMAP_PROT            (PROT_READ|PROT_WRITE)

+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)

+#define MAP_ANONYMOUS        MAP_ANON

+#endif /* MAP_ANON */

+#ifdef MAP_ANONYMOUS

+#define MMAP_FLAGS           (MAP_PRIVATE|MAP_ANONYMOUS)

+#define CALL_MMAP(s)         mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)

+#else /* MAP_ANONYMOUS */

+/*

+   Nearly all versions of mmap support MAP_ANONYMOUS, so the following

+   is unlikely to be needed, but is supplied just in case.

+*/

+#define MMAP_FLAGS           (MAP_PRIVATE)

+static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */

+#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \

+           (dev_zero_fd = open("/dev/zero", O_RDWR), \

+            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \

+            mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))

+#endif /* MAP_ANONYMOUS */

+

+#define DIRECT_MMAP(s)       CALL_MMAP(s)

+#else /* WIN32 */

+

+/* Win32 MMAP via VirtualAlloc */

+static void* win32mmap(size_t size) {

+  void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);

+  return (ptr != 0)? ptr: MFAIL;

+}

+

+/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */

+static void* win32direct_mmap(size_t size) {

+  void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,

+                           PAGE_READWRITE);

+  return (ptr != 0)? ptr: MFAIL;

+}

+

+/* This function supports releasing coalesed segments */

+static int win32munmap(void* ptr, size_t size) {

+  MEMORY_BASIC_INFORMATION minfo;

+  char* cptr = ptr;

+  while (size) {

+    if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)

+      return -1;

+    if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||

+        minfo.State != MEM_COMMIT || minfo.RegionSize > size)

+      return -1;

+    if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)

+      return -1;

+    cptr += minfo.RegionSize;

+    size -= minfo.RegionSize;

+  }

+  return 0;

+}

+

+#define CALL_MMAP(s)         win32mmap(s)

+#define CALL_MUNMAP(a, s)    win32munmap((a), (s))

+#define DIRECT_MMAP(s)       win32direct_mmap(s)

+#endif /* WIN32 */

+#endif /* HAVE_MMAP */

+

+#if HAVE_MMAP && HAVE_MREMAP

+#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))

+#else  /* HAVE_MMAP && HAVE_MREMAP */

+#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL

+#endif /* HAVE_MMAP && HAVE_MREMAP */

+

+#if HAVE_MORECORE

+#define CALL_MORECORE(S)     MORECORE(S)

+#else  /* HAVE_MORECORE */

+#define CALL_MORECORE(S)     MFAIL

+#endif /* HAVE_MORECORE */

+

+/* mstate bit set if continguous morecore disabled or failed */

+#define USE_NONCONTIGUOUS_BIT (4U)

+

+/* segment bit set in create_mspace_with_base */

+#define EXTERN_BIT            (8U)

+

+

+/* --------------------------- Lock preliminaries ------------------------ */

+

+#if USE_LOCKS

+

+/*

+  When locks are defined, there are up to two global locks:

+

+  * If HAVE_MORECORE, morecore_mutex protects sequences of calls to

+    MORECORE.  In many cases sys_alloc requires two calls, that should

+    not be interleaved with calls by other threads.  This does not

+    protect against direct calls to MORECORE by other threads not

+    using this lock, so there is still code to cope the best we can on

+    interference.

+

+  * magic_init_mutex ensures that mparams.magic and other

+    unique mparams values are initialized only once.

+*/

+

+#ifndef WIN32

+/* By default use posix locks */

+#include <pthread.h>

+#define MLOCK_T pthread_mutex_t

+#define INITIAL_LOCK(l)      pthread_mutex_init(l, NULL)

+#define ACQUIRE_LOCK(l)      pthread_mutex_lock(l)

+#define RELEASE_LOCK(l)      pthread_mutex_unlock(l)

+

+#if HAVE_MORECORE

+static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;

+#endif /* HAVE_MORECORE */

+

+static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;

+

+#else /* WIN32 */

+/*

+   Because lock-protected regions have bounded times, and there

+   are no recursive lock calls, we can use simple spinlocks.

+*/

+

+#define MLOCK_T long

+static int win32_acquire_lock (MLOCK_T *sl) {

+  for (;;) {

+#ifdef InterlockedCompareExchangePointer

+    if (!InterlockedCompareExchange(sl, 1, 0))

+      return 0;

+#else  /* Use older void* version */

+    if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0))

+      return 0;

+#endif /* InterlockedCompareExchangePointer */

+    Sleep (0);

+  }

+}

+

+static void win32_release_lock (MLOCK_T *sl) {

+  InterlockedExchange (sl, 0);

+}

+

+#define INITIAL_LOCK(l)      *(l)=0

+#define ACQUIRE_LOCK(l)      win32_acquire_lock(l)

+#define RELEASE_LOCK(l)      win32_release_lock(l)

+#if HAVE_MORECORE

+static MLOCK_T morecore_mutex;

+#endif /* HAVE_MORECORE */

+static MLOCK_T magic_init_mutex;

+#endif /* WIN32 */

+

+#define USE_LOCK_BIT               (2U)

+#else  /* USE_LOCKS */

+#define USE_LOCK_BIT               (0U)

+#define INITIAL_LOCK(l)

+#endif /* USE_LOCKS */

+

+#if USE_LOCKS && HAVE_MORECORE

+#define ACQUIRE_MORECORE_LOCK()    ACQUIRE_LOCK(&morecore_mutex);

+#define RELEASE_MORECORE_LOCK()    RELEASE_LOCK(&morecore_mutex);

+#else /* USE_LOCKS && HAVE_MORECORE */

+#define ACQUIRE_MORECORE_LOCK()

+#define RELEASE_MORECORE_LOCK()

+#endif /* USE_LOCKS && HAVE_MORECORE */

+

+#if USE_LOCKS

+#define ACQUIRE_MAGIC_INIT_LOCK()  ACQUIRE_LOCK(&magic_init_mutex);

+#define RELEASE_MAGIC_INIT_LOCK()  RELEASE_LOCK(&magic_init_mutex);

+#else  /* USE_LOCKS */

+#define ACQUIRE_MAGIC_INIT_LOCK()

+#define RELEASE_MAGIC_INIT_LOCK()

+#endif /* USE_LOCKS */

+

+

+/* -----------------------  Chunk representations ------------------------ */

+

+/*

+  (The following includes lightly edited explanations by Colin Plumb.)

+

+  The malloc_chunk declaration below is misleading (but accurate and

+  necessary).  It declares a "view" into memory allowing access to

+  necessary fields at known offsets from a given base.

+

+  Chunks of memory are maintained using a `boundary tag' method as

+  originally described by Knuth.  (See the paper by Paul Wilson

+  ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such

+  techniques.)  Sizes of free chunks are stored both in the front of

+  each chunk and at the end.  This makes consolidating fragmented

+  chunks into bigger chunks fast.  The head fields also hold bits

+  representing whether chunks are free or in use.

+

+  Here are some pictures to make it clearer.  They are "exploded" to

+  show that the state of a chunk can be thought of as extending from

+  the high 31 bits of the head field of its header through the

+  prev_foot and PINUSE_BIT bit of the following chunk header.

+

+  A chunk that's in use looks like:

+

+   chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+           | Size of previous chunk (if P = 1)                             |

+           +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|

+         | Size of this chunk                                         1| +-+

+   mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         |                                                               |

+         +-                                                             -+

+         |                                                               |

+         +-                                                             -+

+         |                                                               :

+         +-      size - sizeof(size_t) available payload bytes          -+

+         :                                                               |

+ chunk-> +-                                                             -+

+         |                                                               |

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|

+       | Size of next chunk (may or may not be in use)               | +-+

+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+

+    And if it's free, it looks like this:

+

+   chunk-> +-                                                             -+

+           | User payload (must be in use, or we would have merged!)       |

+           +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|

+         | Size of this chunk                                         0| +-+

+   mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         | Next pointer                                                  |

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         | Prev pointer                                                  |

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         |                                                               :

+         +-      size - sizeof(struct chunk) unused bytes               -+

+         :                                                               |

+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+         | Size of this chunk                                            |

+         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|

+       | Size of next chunk (must be in use, or we would have merged)| +-+

+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+       |                                                               :

+       +- User payload                                                -+

+       :                                                               |

+       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+                                                                     |0|

+                                                                     +-+

+  Note that since we always merge adjacent free chunks, the chunks

+  adjacent to a free chunk must be in use.

+

+  Given a pointer to a chunk (which can be derived trivially from the

+  payload pointer) we can, in O(1) time, find out whether the adjacent

+  chunks are free, and if so, unlink them from the lists that they

+  are on and merge them with the current chunk.

+

+  Chunks always begin on even word boundaries, so the mem portion

+  (which is returned to the user) is also on an even word boundary, and

+  thus at least double-word aligned.

+

+  The P (PINUSE_BIT) bit, stored in the unused low-order bit of the

+  chunk size (which is always a multiple of two words), is an in-use

+  bit for the *previous* chunk.  If that bit is *clear*, then the

+  word before the current chunk size contains the previous chunk

+  size, and can be used to find the front of the previous chunk.

+  The very first chunk allocated always has this bit set, preventing

+  access to non-existent (or non-owned) memory. If pinuse is set for

+  any given chunk, then you CANNOT determine the size of the

+  previous chunk, and might even get a memory addressing fault when

+  trying to do so.

+

+  The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of

+  the chunk size redundantly records whether the current chunk is

+  inuse. This redundancy enables usage checks within free and realloc,

+  and reduces indirection when freeing and consolidating chunks.

+

+  Each freshly allocated chunk must have both cinuse and pinuse set.

+  That is, each allocated chunk borders either a previously allocated

+  and still in-use chunk, or the base of its memory arena. This is

+  ensured by making all allocations from the the `lowest' part of any

+  found chunk.  Further, no free chunk physically borders another one,

+  so each free chunk is known to be preceded and followed by either

+  inuse chunks or the ends of memory.

+

+  Note that the `foot' of the current chunk is actually represented

+  as the prev_foot of the NEXT chunk. This makes it easier to

+  deal with alignments etc but can be very confusing when trying

+  to extend or adapt this code.

+

+  The exceptions to all this are

+

+     1. The special chunk `top' is the top-most available chunk (i.e.,

+        the one bordering the end of available memory). It is treated

+        specially.  Top is never included in any bin, is used only if

+        no other chunk is available, and is released back to the

+        system if it is very large (see M_TRIM_THRESHOLD).  In effect,

+        the top chunk is treated as larger (and thus less well

+        fitting) than any other available chunk.  The top chunk

+        doesn't update its trailing size field since there is no next

+        contiguous chunk that would have to index off it. However,

+        space is still allocated for it (TOP_FOOT_SIZE) to enable

+        separation or merging when space is extended.

+

+     3. Chunks allocated via mmap, which have the lowest-order bit

+        (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set

+        PINUSE_BIT in their head fields.  Because they are allocated

+        one-by-one, each must carry its own prev_foot field, which is

+        also used to hold the offset this chunk has within its mmapped

+        region, which is needed to preserve alignment. Each mmapped

+        chunk is trailed by the first two fields of a fake next-chunk

+        for sake of usage checks.

+

+*/

+

+struct malloc_chunk {

+  size_t               prev_foot;  /* Size of previous chunk (if free).  */

+  size_t               head;       /* Size and inuse bits. */

+  struct malloc_chunk* fd;         /* double links -- used only if free. */

+  struct malloc_chunk* bk;

+};

+

+typedef struct malloc_chunk  mchunk;

+typedef struct malloc_chunk* mchunkptr;

+typedef struct malloc_chunk* sbinptr;  /* The type of bins of chunks */

+typedef unsigned int bindex_t;         /* Described below */

+typedef unsigned int binmap_t;         /* Described below */

+typedef unsigned int flag_t;           /* The type of various bit flag sets */

+

+/* ------------------- Chunks sizes and alignments ----------------------- */

+

+#define MCHUNK_SIZE         (sizeof(mchunk))

+

+#if FOOTERS

+#define CHUNK_OVERHEAD      (TWO_SIZE_T_SIZES)

+#else /* FOOTERS */

+#define CHUNK_OVERHEAD      (SIZE_T_SIZE)

+#endif /* FOOTERS */

+

+/* MMapped chunks need a second word of overhead ... */

+#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)

+/* ... and additional padding for fake next-chunk at foot */

+#define MMAP_FOOT_PAD       (FOUR_SIZE_T_SIZES)

+

+/* The smallest size we can malloc is an aligned minimal chunk */

+#define MIN_CHUNK_SIZE\

+  ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)

+

+/* conversion from malloc headers to user pointers, and back */

+#define chunk2mem(p)        ((void*)((char*)(p)       + TWO_SIZE_T_SIZES))

+#define mem2chunk(mem)      ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))

+/* chunk associated with aligned address A */

+#define align_as_chunk(A)   (mchunkptr)((A) + align_offset(chunk2mem(A)))

+

+/* Bounds on request (not chunk) sizes. */

+#define MAX_REQUEST         ((-MIN_CHUNK_SIZE) << 2)

+#define MIN_REQUEST         (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)

+

+/* pad request bytes into a usable size */

+#define pad_request(req) \

+   (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)

+

+/* pad request, checking for minimum (but not maximum) */

+#define request2size(req) \

+  (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))

+

+

+/* ------------------ Operations on head and foot fields ----------------- */

+

+/*

+  The head field of a chunk is or'ed with PINUSE_BIT when previous

+  adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in

+  use. If the chunk was obtained with mmap, the prev_foot field has

+  IS_MMAPPED_BIT set, otherwise holding the offset of the base of the

+  mmapped region to the base of the chunk.

+*/

+

+#define PINUSE_BIT          (SIZE_T_ONE)

+#define CINUSE_BIT          (SIZE_T_TWO)

+#define INUSE_BITS          (PINUSE_BIT|CINUSE_BIT)

+

+/* Head value for fenceposts */

+#define FENCEPOST_HEAD      (INUSE_BITS|SIZE_T_SIZE)

+

+/* extraction of fields from head words */

+#define cinuse(p)           ((p)->head & CINUSE_BIT)

+#define pinuse(p)           ((p)->head & PINUSE_BIT)

+#define chunksize(p)        ((p)->head & ~(INUSE_BITS))

+

+#define clear_pinuse(p)     ((p)->head &= ~PINUSE_BIT)

+#define clear_cinuse(p)     ((p)->head &= ~CINUSE_BIT)

+

+/* Treat space at ptr +/- offset as a chunk */

+#define chunk_plus_offset(p, s)  ((mchunkptr)(((char*)(p)) + (s)))

+#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))

+

+/* Ptr to next or previous physical malloc_chunk. */

+#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))

+#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))

+

+/* extract next chunk's pinuse bit */

+#define next_pinuse(p)  ((next_chunk(p)->head) & PINUSE_BIT)

+

+/* Get/set size at footer */

+#define get_foot(p, s)  (((mchunkptr)((char*)(p) + (s)))->prev_foot)

+#define set_foot(p, s)  (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))

+

+/* Set size, pinuse bit, and foot */

+#define set_size_and_pinuse_of_free_chunk(p, s)\

+  ((p)->head = (s|PINUSE_BIT), set_foot(p, s))

+

+/* Set size, pinuse bit, foot, and clear next pinuse */

+#define set_free_with_pinuse(p, s, n)\

+  (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))

+

+#define is_mmapped(p)\

+  (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))

+

+/* Get the internal overhead associated with chunk p */

+#define overhead_for(p)\

+ (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)

+

+/* Return true if malloced space is not necessarily cleared */

+#if MMAP_CLEARS

+#define calloc_must_clear(p) (!is_mmapped(p))

+#else /* MMAP_CLEARS */

+#define calloc_must_clear(p) (1)

+#endif /* MMAP_CLEARS */

+

+/* ---------------------- Overlaid data structures ----------------------- */

+

+/*

+  When chunks are not in use, they are treated as nodes of either

+  lists or trees.

+

+  "Small"  chunks are stored in circular doubly-linked lists, and look

+  like this:

+

+    chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Size of previous chunk                            |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+    `head:' |             Size of chunk, in bytes                         |P|

+      mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Forward pointer to next chunk in list             |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Back pointer to previous chunk in list            |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Unused space (may be 0 bytes long)                .

+            .                                                               .

+            .                                                               |

+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+    `foot:' |             Size of chunk, in bytes                           |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+

+  Larger chunks are kept in a form of bitwise digital trees (aka

+  tries) keyed on chunksizes.  Because malloc_tree_chunks are only for

+  free chunks greater than 256 bytes, their size doesn't impose any

+  constraints on user chunk sizes.  Each node looks like:

+

+    chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Size of previous chunk                            |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+    `head:' |             Size of chunk, in bytes                         |P|

+      mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Forward pointer to next chunk of same size        |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Back pointer to previous chunk of same size       |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Pointer to left child (child[0])                  |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Pointer to right child (child[1])                 |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Pointer to parent                                 |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             bin index of this chunk                           |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+            |             Unused space                                      .

+            .                                                               |

+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+    `foot:' |             Size of chunk, in bytes                           |

+            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+

+  Each tree holding treenodes is a tree of unique chunk sizes.  Chunks

+  of the same size are arranged in a circularly-linked list, with only

+  the oldest chunk (the next to be used, in our FIFO ordering)

+  actually in the tree.  (Tree members are distinguished by a non-null

+  parent pointer.)  If a chunk with the same size an an existing node

+  is inserted, it is linked off the existing node using pointers that

+  work in the same way as fd/bk pointers of small chunks.

+

+  Each tree contains a power of 2 sized range of chunk sizes (the

+  smallest is 0x100 <= x < 0x180), which is is divided in half at each

+  tree level, with the chunks in the smaller half of the range (0x100

+  <= x < 0x140 for the top nose) in the left subtree and the larger

+  half (0x140 <= x < 0x180) in the right subtree.  This is, of course,

+  done by inspecting individual bits.

+

+  Using these rules, each node's left subtree contains all smaller

+  sizes than its right subtree.  However, the node at the root of each

+  subtree has no particular ordering relationship to either.  (The

+  dividing line between the subtree sizes is based on trie relation.)

+  If we remove the last chunk of a given size from the interior of the

+  tree, we need to replace it with a leaf node.  The tree ordering

+  rules permit a node to be replaced by any leaf below it.

+

+  The smallest chunk in a tree (a common operation in a best-fit

+  allocator) can be found by walking a path to the leftmost leaf in

+  the tree.  Unlike a usual binary tree, where we follow left child

+  pointers until we reach a null, here we follow the right child

+  pointer any time the left one is null, until we reach a leaf with

+  both child pointers null. The smallest chunk in the tree will be

+  somewhere along that path.

+

+  The worst case number of steps to add, find, or remove a node is

+  bounded by the number of bits differentiating chunks within

+  bins. Under current bin calculations, this ranges from 6 up to 21

+  (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case

+  is of course much better.

+*/

+

+struct malloc_tree_chunk {

+  /* The first four fields must be compatible with malloc_chunk */

+  size_t                    prev_foot;

+  size_t                    head;

+  struct malloc_tree_chunk* fd;

+  struct malloc_tree_chunk* bk;

+

+  struct malloc_tree_chunk* child[2];

+  struct malloc_tree_chunk* parent;

+  bindex_t                  index;

+};

+

+typedef struct malloc_tree_chunk  tchunk;

+typedef struct malloc_tree_chunk* tchunkptr;

+typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */

+

+/* A little helper macro for trees */

+#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])

+

+/* ----------------------------- Segments -------------------------------- */

+

+/*

+  Each malloc space may include non-contiguous segments, held in a

+  list headed by an embedded malloc_segment record representing the

+  top-most space. Segments also include flags holding properties of

+  the space. Large chunks that are directly allocated by mmap are not

+  included in this list. They are instead independently created and

+  destroyed without otherwise keeping track of them.

+

+  Segment management mainly comes into play for spaces allocated by

+  MMAP.  Any call to MMAP might or might not return memory that is

+  adjacent to an existing segment.  MORECORE normally contiguously

+  extends the current space, so this space is almost always adjacent,

+  which is simpler and faster to deal with. (This is why MORECORE is

+  used preferentially to MMAP when both are available -- see

+  sys_alloc.)  When allocating using MMAP, we don't use any of the

+  hinting mechanisms (inconsistently) supported in various

+  implementations of unix mmap, or distinguish reserving from

+  committing memory. Instead, we just ask for space, and exploit

+  contiguity when we get it.  It is probably possible to do

+  better than this on some systems, but no general scheme seems

+  to be significantly better.

+

+  Management entails a simpler variant of the consolidation scheme

+  used for chunks to reduce fragmentation -- new adjacent memory is

+  normally prepended or appended to an existing segment. However,

+  there are limitations compared to chunk consolidation that mostly

+  reflect the fact that segment processing is relatively infrequent

+  (occurring only when getting memory from system) and that we

+  don't expect to have huge numbers of segments:

+

+  * Segments are not indexed, so traversal requires linear scans.  (It

+    would be possible to index these, but is not worth the extra

+    overhead and complexity for most programs on most platforms.)

+  * New segments are only appended to old ones when holding top-most

+    memory; if they cannot be prepended to others, they are held in

+    different segments.

+

+  Except for the top-most segment of an mstate, each segment record

+  is kept at the tail of its segment. Segments are added by pushing

+  segment records onto the list headed by &mstate.seg for the

+  containing mstate.

+

+  Segment flags control allocation/merge/deallocation policies:

+  * If EXTERN_BIT set, then we did not allocate this segment,

+    and so should not try to deallocate or merge with others.

+    (This currently holds only for the initial segment passed

+    into create_mspace_with_base.)

+  * If IS_MMAPPED_BIT set, the segment may be merged with

+    other surrounding mmapped segments and trimmed/de-allocated

+    using munmap.

+  * If neither bit is set, then the segment was obtained using

+    MORECORE so can be merged with surrounding MORECORE'd segments

+    and deallocated/trimmed using MORECORE with negative arguments.

+*/

+

+struct malloc_segment {

+  char*        base;             /* base address */

+  size_t       size;             /* allocated size */

+  struct malloc_segment* next;   /* ptr to next segment */

+  flag_t       sflags;           /* mmap and extern flag */

+};

+

+#define is_mmapped_segment(S)  ((S)->sflags & IS_MMAPPED_BIT)

+#define is_extern_segment(S)   ((S)->sflags & EXTERN_BIT)

+

+typedef struct malloc_segment  msegment;

+typedef struct malloc_segment* msegmentptr;

+

+/* ---------------------------- malloc_state ----------------------------- */

+

+/*

+   A malloc_state holds all of the bookkeeping for a space.

+   The main fields are:

+

+  Top

+    The topmost chunk of the currently active segment. Its size is

+    cached in topsize.  The actual size of topmost space is

+    topsize+TOP_FOOT_SIZE, which includes space reserved for adding

+    fenceposts and segment records if necessary when getting more

+    space from the system.  The size at which to autotrim top is

+    cached from mparams in trim_check, except that it is disabled if

+    an autotrim fails.

+

+  Designated victim (dv)

+    This is the preferred chunk for servicing small requests that

+    don't have exact fits.  It is normally the chunk split off most

+    recently to service another small request.  Its size is cached in

+    dvsize. The link fields of this chunk are not maintained since it

+    is not kept in a bin.

+

+  SmallBins

+    An array of bin headers for free chunks.  These bins hold chunks

+    with sizes less than MIN_LARGE_SIZE bytes. Each bin contains

+    chunks of all the same size, spaced 8 bytes apart.  To simplify

+    use in double-linked lists, each bin header acts as a malloc_chunk

+    pointing to the real first node, if it exists (else pointing to

+    itself).  This avoids special-casing for headers.  But to avoid

+    waste, we allocate only the fd/bk pointers of bins, and then use

+    repositioning tricks to treat these as the fields of a chunk.

+

+  TreeBins

+    Treebins are pointers to the roots of trees holding a range of

+    sizes. There are 2 equally spaced treebins for each power of two

+    from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything

+    larger.

+

+  Bin maps

+    There is one bit map for small bins ("smallmap") and one for

+    treebins ("treemap).  Each bin sets its bit when non-empty, and

+    clears the bit when empty.  Bit operations are then used to avoid

+    bin-by-bin searching -- nearly all "search" is done without ever

+    looking at bins that won't be selected.  The bit maps

+    conservatively use 32 bits per map word, even if on 64bit system.

+    For a good description of some of the bit-based techniques used

+    here, see Henry S. Warren Jr's book "Hacker's Delight" (and

+    supplement at http://hackersdelight.org/). Many of these are

+    intended to reduce the branchiness of paths through malloc etc, as

+    well as to reduce the number of memory locations read or written.

+

+  Segments

+    A list of segments headed by an embedded malloc_segment record

+    representing the initial space.

+

+  Address check support

+    The least_addr field is the least address ever obtained from

+    MORECORE or MMAP. Attempted frees and reallocs of any address less

+    than this are trapped (unless INSECURE is defined).

+

+  Magic tag

+    A cross-check field that should always hold same value as mparams.magic.

+

+  Flags

+    Bits recording whether to use MMAP, locks, or contiguous MORECORE

+

+  Statistics

+    Each space keeps track of current and maximum system memory

+    obtained via MORECORE or MMAP.

+

+  Locking

+    If USE_LOCKS is defined, the "mutex" lock is acquired and released

+    around every public call using this mspace.

+*/

+

+/* Bin types, widths and sizes */

+#define NSMALLBINS        (32U)

+#define NTREEBINS         (32U)

+#define SMALLBIN_SHIFT    (3U)

+#define SMALLBIN_WIDTH    (SIZE_T_ONE << SMALLBIN_SHIFT)

+#define TREEBIN_SHIFT     (8U)

+#define MIN_LARGE_SIZE    (SIZE_T_ONE << TREEBIN_SHIFT)

+#define MAX_SMALL_SIZE    (MIN_LARGE_SIZE - SIZE_T_ONE)

+#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)

+

+struct malloc_state {

+  binmap_t   smallmap;

+  binmap_t   treemap;

+  size_t     dvsize;

+  size_t     topsize;

+  char*      least_addr;

+  mchunkptr  dv;

+  mchunkptr  top;

+  size_t     trim_check;

+  size_t     magic;

+  mchunkptr  smallbins[(NSMALLBINS+1)*2];

+  tbinptr    treebins[NTREEBINS];

+  size_t     footprint;

+  size_t     max_footprint;

+  flag_t     mflags;

+#if USE_LOCKS

+  MLOCK_T    mutex;     /* locate lock among fields that rarely change */

+#endif /* USE_LOCKS */

+  msegment   seg;

+};

+

+typedef struct malloc_state*    mstate;

+

+/* ------------- Global malloc_state and malloc_params ------------------- */

+

+/*

+  malloc_params holds global properties, including those that can be

+  dynamically set using mallopt. There is a single instance, mparams,

+  initialized in init_mparams.

+*/

+

+struct malloc_params {

+  size_t magic;

+  size_t page_size;

+  size_t granularity;

+  size_t mmap_threshold;

+  size_t trim_threshold;

+  flag_t default_mflags;

+};

+

+static struct malloc_params mparams;

+

+/* The global malloc_state used for all non-"mspace" calls */

+static struct malloc_state _gm_;

+#define gm                 (&_gm_)

+#define is_global(M)       ((M) == &_gm_)

+#define is_initialized(M)  ((M)->top != 0)

+

+/* -------------------------- system alloc setup ------------------------- */

+

+/* Operations on mflags */

+

+#define use_lock(M)           ((M)->mflags &   USE_LOCK_BIT)

+#define enable_lock(M)        ((M)->mflags |=  USE_LOCK_BIT)

+#define disable_lock(M)       ((M)->mflags &= ~USE_LOCK_BIT)

+

+#define use_mmap(M)           ((M)->mflags &   USE_MMAP_BIT)

+#define enable_mmap(M)        ((M)->mflags |=  USE_MMAP_BIT)

+#define disable_mmap(M)       ((M)->mflags &= ~USE_MMAP_BIT)

+

+#define use_noncontiguous(M)  ((M)->mflags &   USE_NONCONTIGUOUS_BIT)

+#define disable_contiguous(M) ((M)->mflags |=  USE_NONCONTIGUOUS_BIT)

+

+#define set_lock(M,L)\

+ ((M)->mflags = (L)?\

+  ((M)->mflags | USE_LOCK_BIT) :\

+  ((M)->mflags & ~USE_LOCK_BIT))

+

+/* page-align a size */

+#define page_align(S)\

+ (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))

+

+/* granularity-align a size */

+#define granularity_align(S)\

+  (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))

+

+#define is_page_aligned(S)\

+   (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)

+#define is_granularity_aligned(S)\

+   (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)

+

+/*  True if segment S holds address A */

+#define segment_holds(S, A)\

+  ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)

+

+/* Return segment holding given address */

+static msegmentptr segment_holding(mstate m, char* addr) {

+  msegmentptr sp = &m->seg;

+  for (;;) {

+    if (addr >= sp->base && addr < sp->base + sp->size)

+      return sp;

+    if ((sp = sp->next) == 0)

+      return 0;

+  }

+}

+

+/* Return true if segment contains a segment link */

+static int has_segment_link(mstate m, msegmentptr ss) {

+  msegmentptr sp = &m->seg;

+  for (;;) {

+    if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size)

+      return 1;

+    if ((sp = sp->next) == 0)

+      return 0;

+  }

+}

+

+#ifndef MORECORE_CANNOT_TRIM

+#define should_trim(M,s)  ((s) > (M)->trim_check)

+#else  /* MORECORE_CANNOT_TRIM */

+#define should_trim(M,s)  (0)

+#endif /* MORECORE_CANNOT_TRIM */

+

+/*

+  TOP_FOOT_SIZE is padding at the end of a segment, including space

+  that may be needed to place segment records and fenceposts when new

+  noncontiguous segments are added.

+*/

+#define TOP_FOOT_SIZE\

+  (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)

+

+

+/* -------------------------------  Hooks -------------------------------- */

+

+/*

+  PREACTION should be defined to return 0 on success, and nonzero on

+  failure. If you are not using locking, you can redefine these to do

+  anything you like.

+*/

+

+#if USE_LOCKS

+

+/* Ensure locks are initialized */

+#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())

+

+#define PREACTION(M)  ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)

+#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }

+#else /* USE_LOCKS */

+

+#ifndef PREACTION

+#define PREACTION(M) (0)

+#endif  /* PREACTION */

+

+#ifndef POSTACTION

+#define POSTACTION(M)

+#endif  /* POSTACTION */

+

+#endif /* USE_LOCKS */

+

+/*

+  CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.

+  USAGE_ERROR_ACTION is triggered on detected bad frees and

+  reallocs. The argument p is an address that might have triggered the

+  fault. It is ignored by the two predefined actions, but might be

+  useful in custom actions that try to help diagnose errors.

+*/

+

+#if PROCEED_ON_ERROR

+

+/* A count of the number of corruption errors causing resets */

+int malloc_corruption_error_count;

+

+/* default corruption action */

+static void reset_on_error(mstate m);

+

+#define CORRUPTION_ERROR_ACTION(m)  reset_on_error(m)

+#define USAGE_ERROR_ACTION(m, p)

+

+#else /* PROCEED_ON_ERROR */

+

+#ifndef CORRUPTION_ERROR_ACTION

+#define CORRUPTION_ERROR_ACTION(m) ABORT

+#endif /* CORRUPTION_ERROR_ACTION */

+

+#ifndef USAGE_ERROR_ACTION

+#define USAGE_ERROR_ACTION(m,p) ABORT

+#endif /* USAGE_ERROR_ACTION */

+

+#endif /* PROCEED_ON_ERROR */

+

+/* -------------------------- Debugging setup ---------------------------- */

+

+#if ! DEBUG

+

+#define check_free_chunk(M,P)

+#define check_inuse_chunk(M,P)

+#define check_malloced_chunk(M,P,N)

+#define check_mmapped_chunk(M,P)

+#define check_malloc_state(M)

+#define check_top_chunk(M,P)

+

+#else /* DEBUG */

+#define check_free_chunk(M,P)       do_check_free_chunk(M,P)

+#define check_inuse_chunk(M,P)      do_check_inuse_chunk(M,P)

+#define check_top_chunk(M,P)        do_check_top_chunk(M,P)

+#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)

+#define check_mmapped_chunk(M,P)    do_check_mmapped_chunk(M,P)

+#define check_malloc_state(M)       do_check_malloc_state(M)

+

+static void   do_check_any_chunk(mstate m, mchunkptr p);

+static void   do_check_top_chunk(mstate m, mchunkptr p);

+static void   do_check_mmapped_chunk(mstate m, mchunkptr p);

+static void   do_check_inuse_chunk(mstate m, mchunkptr p);

+static void   do_check_free_chunk(mstate m, mchunkptr p);

+static void   do_check_malloced_chunk(mstate m, void* mem, size_t s);

+static void   do_check_tree(mstate m, tchunkptr t);

+static void   do_check_treebin(mstate m, bindex_t i);

+static void   do_check_smallbin(mstate m, bindex_t i);

+static void   do_check_malloc_state(mstate m);

+static int    bin_find(mstate m, mchunkptr x);

+static size_t traverse_and_check(mstate m);

+#endif /* DEBUG */

+

+/* ---------------------------- Indexing Bins ---------------------------- */

+

+#define is_small(s)         (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)

+#define small_index(s)      ((s)  >> SMALLBIN_SHIFT)

+#define small_index2size(i) ((i)  << SMALLBIN_SHIFT)

+#define MIN_SMALL_INDEX     (small_index(MIN_CHUNK_SIZE))

+

+/* addressing by index. See above about smallbin repositioning */

+#define smallbin_at(M, i)   ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))

+#define treebin_at(M,i)     (&((M)->treebins[i]))

+

+/* assign tree index for size S to variable I */

+#if defined(__GNUC__) && defined(i386)

+#define compute_tree_index(S, I)\

+{\

+  size_t X = S >> TREEBIN_SHIFT;\

+  if (X == 0)\

+    I = 0;\

+  else if (X > 0xFFFF)\

+    I = NTREEBINS-1;\

+  else {\

+    unsigned int K;\

+    __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm"  (X));\

+    I =  (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\

+  }\

+}

+#else /* GNUC */

+#define compute_tree_index(S, I)\

+{\

+  size_t X = S >> TREEBIN_SHIFT;\

+  if (X == 0)\

+    I = 0;\

+  else if (X > 0xFFFF)\

+    I = NTREEBINS-1;\

+  else {\

+    unsigned int Y = (unsigned int)X;\

+    unsigned int N = ((Y - 0x100) >> 16) & 8;\

+    unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\

+    N += K;\

+    N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\

+    K = 14 - N + ((Y <<= K) >> 15);\

+    I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\

+  }\

+}

+#endif /* GNUC */

+

+/* Bit representing maximum resolved size in a treebin at i */

+#define bit_for_tree_index(i) \

+   (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)

+

+/* Shift placing maximum resolved bit in a treebin at i as sign bit */

+#define leftshift_for_tree_index(i) \

+   ((i == NTREEBINS-1)? 0 : \

+    ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))

+

+/* The size of the smallest chunk held in bin with index i */

+#define minsize_for_tree_index(i) \

+   ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) |  \

+   (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))

+

+

+/* ------------------------ Operations on bin maps ----------------------- */

+

+/* bit corresponding to given index */

+#define idx2bit(i)              ((binmap_t)(1) << (i))

+

+/* Mark/Clear bits with given index */

+#define mark_smallmap(M,i)      ((M)->smallmap |=  idx2bit(i))

+#define clear_smallmap(M,i)     ((M)->smallmap &= ~idx2bit(i))

+#define smallmap_is_marked(M,i) ((M)->smallmap &   idx2bit(i))

+

+#define mark_treemap(M,i)       ((M)->treemap  |=  idx2bit(i))

+#define clear_treemap(M,i)      ((M)->treemap  &= ~idx2bit(i))

+#define treemap_is_marked(M,i)  ((M)->treemap  &   idx2bit(i))

+

+/* index corresponding to given bit */

+

+#if defined(__GNUC__) && defined(i386)

+#define compute_bit2idx(X, I)\

+{\

+  unsigned int J;\

+  __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\

+  I = (bindex_t)J;\

+}

+

+#else /* GNUC */

+#if  USE_BUILTIN_FFS

+#define compute_bit2idx(X, I) I = ffs(X)-1

+

+#else /* USE_BUILTIN_FFS */

+#define compute_bit2idx(X, I)\

+{\

+  unsigned int Y = X - 1;\

+  unsigned int K = Y >> (16-4) & 16;\

+  unsigned int N = K;        Y >>= K;\

+  N += K = Y >> (8-3) &  8;  Y >>= K;\

+  N += K = Y >> (4-2) &  4;  Y >>= K;\

+  N += K = Y >> (2-1) &  2;  Y >>= K;\

+  N += K = Y >> (1-0) &  1;  Y >>= K;\

+  I = (bindex_t)(N + Y);\

+}

+#endif /* USE_BUILTIN_FFS */

+#endif /* GNUC */

+

+/* isolate the least set bit of a bitmap */

+#define least_bit(x)         ((x) & -(x))

+

+/* mask with all bits to left of least bit of x on */

+#define left_bits(x)         ((x<<1) | -(x<<1))

+

+/* mask with all bits to left of or equal to least bit of x on */

+#define same_or_left_bits(x) ((x) | -(x))

+

+

+/* ----------------------- Runtime Check Support ------------------------- */

+

+/*

+  For security, the main invariant is that malloc/free/etc never

+  writes to a static address other than malloc_state, unless static

+  malloc_state itself has been corrupted, which cannot occur via

+  malloc (because of these checks). In essence this means that we

+  believe all pointers, sizes, maps etc held in malloc_state, but

+  check all of those linked or offsetted from other embedded data

+  structures.  These checks are interspersed with main code in a way

+  that tends to minimize their run-time cost.

+

+  When FOOTERS is defined, in addition to range checking, we also

+  verify footer fields of inuse chunks, which can be used guarantee

+  that the mstate controlling malloc/free is intact.  This is a

+  streamlined version of the approach described by William Robertson

+  et al in "Run-time Detection of Heap-based Overflows" LISA'03

+  http://www.usenix.org/events/lisa03/tech/robertson.html The footer

+  of an inuse chunk holds the xor of its mstate and a random seed,

+  that is checked upon calls to free() and realloc().  This is

+  (probablistically) unguessable from outside the program, but can be

+  computed by any code successfully malloc'ing any chunk, so does not

+  itself provide protection against code that has already broken

+  security through some other means.  Unlike Robertson et al, we

+  always dynamically check addresses of all offset chunks (previous,

+  next, etc). This turns out to be cheaper than relying on hashes.

+*/

+

+#if !INSECURE

+/* Check if address a is at least as high as any from MORECORE or MMAP */

+#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)

+/* Check if address of next chunk n is higher than base chunk p */

+#define ok_next(p, n)    ((char*)(p) < (char*)(n))

+/* Check if p has its cinuse bit on */

+#define ok_cinuse(p)     cinuse(p)

+/* Check if p has its pinuse bit on */

+#define ok_pinuse(p)     pinuse(p)

+

+#else /* !INSECURE */

+#define ok_address(M, a) (1)

+#define ok_next(b, n)    (1)

+#define ok_cinuse(p)     (1)

+#define ok_pinuse(p)     (1)

+#endif /* !INSECURE */

+

+#if (FOOTERS && !INSECURE)

+/* Check if (alleged) mstate m has expected magic field */

+#define ok_magic(M)      ((M)->magic == mparams.magic)

+#else  /* (FOOTERS && !INSECURE) */

+#define ok_magic(M)      (1)

+#endif /* (FOOTERS && !INSECURE) */

+

+

+/* In gcc, use __builtin_expect to minimize impact of checks */

+#if !INSECURE

+#if defined(__GNUC__) && __GNUC__ >= 3

+#define RTCHECK(e)  __builtin_expect(e, 1)

+#else /* GNUC */

+#define RTCHECK(e)  (e)

+#endif /* GNUC */

+#else /* !INSECURE */

+#define RTCHECK(e)  (1)

+#endif /* !INSECURE */

+

+/* macros to set up inuse chunks with or without footers */

+

+#if !FOOTERS

+

+#define mark_inuse_foot(M,p,s)

+

+/* Set cinuse bit and pinuse bit of next chunk */

+#define set_inuse(M,p,s)\

+  ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\

+  ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)

+

+/* Set cinuse and pinuse of this chunk and pinuse of next chunk */

+#define set_inuse_and_pinuse(M,p,s)\

+  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\

+  ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)

+

+/* Set size, cinuse and pinuse bit of this chunk */

+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\

+  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))

+

+#else /* FOOTERS */

+

+/* Set foot of inuse chunk to be xor of mstate and seed */

+#define mark_inuse_foot(M,p,s)\

+  (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))

+

+#define get_mstate_for(p)\

+  ((mstate)(((mchunkptr)((char*)(p) +\

+    (chunksize(p))))->prev_foot ^ mparams.magic))

+

+#define set_inuse(M,p,s)\

+  ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\

+  (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \

+  mark_inuse_foot(M,p,s))

+

+#define set_inuse_and_pinuse(M,p,s)\

+  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\

+  (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\

+ mark_inuse_foot(M,p,s))

+

+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\

+  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\

+  mark_inuse_foot(M, p, s))

+

+#endif /* !FOOTERS */

+

+/* ---------------------------- setting mparams -------------------------- */

+

+/* Initialize mparams */

+static int init_mparams(void) {

+  if (mparams.page_size == 0) {

+    size_t s;

+

+    mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;

+    mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;

+#if MORECORE_CONTIGUOUS

+    mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT;

+#else  /* MORECORE_CONTIGUOUS */

+    mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT;

+#endif /* MORECORE_CONTIGUOUS */

+

+#if (FOOTERS && !INSECURE)

+    {

+#if USE_DEV_RANDOM

+      int fd;

+      unsigned char buf[sizeof(size_t)];

+      /* Try to use /dev/urandom, else fall back on using time */

+      if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&

+          read(fd, buf, sizeof(buf)) == sizeof(buf)) {

+        s = *((size_t *) buf);

+        close(fd);

+      }

+      else

+#endif /* USE_DEV_RANDOM */

+        s = (size_t)(time(0) ^ (size_t)0x55555555U);

+

+      s |= (size_t)8U;    /* ensure nonzero */

+      s &= ~(size_t)7U;   /* improve chances of fault for bad values */

+

+    }

+#else /* (FOOTERS && !INSECURE) */

+    s = (size_t)0x58585858U;

+#endif /* (FOOTERS && !INSECURE) */

+    ACQUIRE_MAGIC_INIT_LOCK();

+    if (mparams.magic == 0) {

+      mparams.magic = s;

+      /* Set up lock for main malloc area */

+      INITIAL_LOCK(&gm->mutex);

+      gm->mflags = mparams.default_mflags;

+    }

+    RELEASE_MAGIC_INIT_LOCK();

+

+#ifndef WIN32

+    mparams.page_size = malloc_getpagesize;

+    mparams.granularity = ((DEFAULT_GRANULARITY != 0)?

+                           DEFAULT_GRANULARITY : mparams.page_size);

+#else /* WIN32 */

+    {

+      SYSTEM_INFO system_info;

+      GetSystemInfo(&system_info);

+      mparams.page_size = system_info.dwPageSize;

+      mparams.granularity = system_info.dwAllocationGranularity;

+    }

+#endif /* WIN32 */

+

+    /* Sanity-check configuration:

+       size_t must be unsigned and as wide as pointer type.

+       ints must be at least 4 bytes.

+       alignment must be at least 8.

+       Alignment, min chunk size, and page size must all be powers of 2.

+    */

+    if ((sizeof(size_t) != sizeof(char*)) ||

+        (MAX_SIZE_T < MIN_CHUNK_SIZE)  ||

+        (sizeof(int) < 4)  ||

+        (MALLOC_ALIGNMENT < (size_t)8U) ||

+        ((MALLOC_ALIGNMENT    & (MALLOC_ALIGNMENT-SIZE_T_ONE))    != 0) ||

+        ((MCHUNK_SIZE         & (MCHUNK_SIZE-SIZE_T_ONE))         != 0) ||

+        ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) ||

+        ((mparams.page_size   & (mparams.page_size-SIZE_T_ONE))   != 0))

+      ABORT;

+  }

+  return 0;

+}

+

+/* support for mallopt */

+static int change_mparam(int param_number, int value) {

+  size_t val = (size_t)value;

+  init_mparams();

+  switch(param_number) {

+  case M_TRIM_THRESHOLD:

+    mparams.trim_threshold = val;

+    return 1;

+  case M_GRANULARITY:

+    if (val >= mparams.page_size && ((val & (val-1)) == 0)) {

+      mparams.granularity = val;

+      return 1;

+    }

+    else

+      return 0;

+  case M_MMAP_THRESHOLD:

+    mparams.mmap_threshold = val;

+    return 1;

+  default:

+    return 0;

+  }

+}

+

+#if DEBUG

+/* ------------------------- Debugging Support --------------------------- */

+

+/* Check properties of any chunk, whether free, inuse, mmapped etc  */

+static void do_check_any_chunk(mstate m, mchunkptr p) {

+  assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));

+  assert(ok_address(m, p));

+}

+

+/* Check properties of top chunk */

+static void do_check_top_chunk(mstate m, mchunkptr p) {

+  msegmentptr sp = segment_holding(m, (char*)p);

+  size_t  sz = chunksize(p);

+  assert(sp != 0);

+  assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));

+  assert(ok_address(m, p));

+  assert(sz == m->topsize);

+  assert(sz > 0);

+  assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE);

+  assert(pinuse(p));

+  assert(!next_pinuse(p));

+}

+

+/* Check properties of (inuse) mmapped chunks */

+static void do_check_mmapped_chunk(mstate m, mchunkptr p) {

+  size_t  sz = chunksize(p);

+  size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);

+  assert(is_mmapped(p));

+  assert(use_mmap(m));

+  assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));

+  assert(ok_address(m, p));

+  assert(!is_small(sz));

+  assert((len & (mparams.page_size-SIZE_T_ONE)) == 0);

+  assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);

+  assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0);

+}

+

+/* Check properties of inuse chunks */

+static void do_check_inuse_chunk(mstate m, mchunkptr p) {

+  do_check_any_chunk(m, p);

+  assert(cinuse(p));

+  assert(next_pinuse(p));

+  /* If not pinuse and not mmapped, previous chunk has OK offset */

+  assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);

+  if (is_mmapped(p))

+    do_check_mmapped_chunk(m, p);

+}

+

+/* Check properties of free chunks */

+static void do_check_free_chunk(mstate m, mchunkptr p) {

+  size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);

+  mchunkptr next = chunk_plus_offset(p, sz);

+  do_check_any_chunk(m, p);

+  assert(!cinuse(p));

+  assert(!next_pinuse(p));

+  assert (!is_mmapped(p));

+  if (p != m->dv && p != m->top) {

+    if (sz >= MIN_CHUNK_SIZE) {

+      assert((sz & CHUNK_ALIGN_MASK) == 0);

+      assert(is_aligned(chunk2mem(p)));

+      assert(next->prev_foot == sz);

+      assert(pinuse(p));

+      assert (next == m->top || cinuse(next));

+      assert(p->fd->bk == p);

+      assert(p->bk->fd == p);

+    }

+    else  /* markers are always of size SIZE_T_SIZE */

+      assert(sz == SIZE_T_SIZE);

+  }

+}

+

+/* Check properties of malloced chunks at the point they are malloced */

+static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {

+  if (mem != 0) {

+    mchunkptr p = mem2chunk(mem);

+    size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);

+    do_check_inuse_chunk(m, p);

+    assert((sz & CHUNK_ALIGN_MASK) == 0);

+    assert(sz >= MIN_CHUNK_SIZE);

+    assert(sz >= s);

+    /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */

+    assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));

+  }

+}

+

+/* Check a tree and its subtrees.  */

+static void do_check_tree(mstate m, tchunkptr t) {

+  tchunkptr head = 0;

+  tchunkptr u = t;

+  bindex_t tindex = t->index;

+  size_t tsize = chunksize(t);

+  bindex_t idx;

+  compute_tree_index(tsize, idx);

+  assert(tindex == idx);

+  assert(tsize >= MIN_LARGE_SIZE);

+  assert(tsize >= minsize_for_tree_index(idx));

+  assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1))));

+

+  do { /* traverse through chain of same-sized nodes */

+    do_check_any_chunk(m, ((mchunkptr)u));

+    assert(u->index == tindex);

+    assert(chunksize(u) == tsize);

+    assert(!cinuse(u));

+    assert(!next_pinuse(u));

+    assert(u->fd->bk == u);

+    assert(u->bk->fd == u);

+    if (u->parent == 0) {

+      assert(u->child[0] == 0);

+      assert(u->child[1] == 0);

+    }

+    else {

+      assert(head == 0); /* only one node on chain has parent */

+      head = u;

+      assert(u->parent != u);

+      assert (u->parent->child[0] == u ||

+              u->parent->child[1] == u ||

+              *((tbinptr*)(u->parent)) == u);

+      if (u->child[0] != 0) {

+        assert(u->child[0]->parent == u);

+        assert(u->child[0] != u);

+        do_check_tree(m, u->child[0]);

+      }

+      if (u->child[1] != 0) {

+        assert(u->child[1]->parent == u);

+        assert(u->child[1] != u);

+        do_check_tree(m, u->child[1]);

+      }

+      if (u->child[0] != 0 && u->child[1] != 0) {

+        assert(chunksize(u->child[0]) < chunksize(u->child[1]));

+      }

+    }

+    u = u->fd;

+  } while (u != t);

+  assert(head != 0);

+}

+

+/*  Check all the chunks in a treebin.  */

+static void do_check_treebin(mstate m, bindex_t i) {

+  tbinptr* tb = treebin_at(m, i);

+  tchunkptr t = *tb;

+  int empty = (m->treemap & (1U << i)) == 0;

+  if (t == 0)

+    assert(empty);

+  if (!empty)

+    do_check_tree(m, t);

+}

+

+/*  Check all the chunks in a smallbin.  */

+static void do_check_smallbin(mstate m, bindex_t i) {

+  sbinptr b = smallbin_at(m, i);

+  mchunkptr p = b->bk;

+  unsigned int empty = (m->smallmap & (1U << i)) == 0;

+  if (p == b)

+    assert(empty);

+  if (!empty) {

+    for (; p != b; p = p->bk) {

+      size_t size = chunksize(p);

+      mchunkptr q;

+      /* each chunk claims to be free */

+      do_check_free_chunk(m, p);

+      /* chunk belongs in bin */

+      assert(small_index(size) == i);

+      assert(p->bk == b || chunksize(p->bk) == chunksize(p));

+      /* chunk is followed by an inuse chunk */

+      q = next_chunk(p);

+      if (q->head != FENCEPOST_HEAD)

+        do_check_inuse_chunk(m, q);

+    }

+  }

+}

+

+/* Find x in a bin. Used in other check functions. */

+static int bin_find(mstate m, mchunkptr x) {

+  size_t size = chunksize(x);

+  if (is_small(size)) {

+    bindex_t sidx = small_index(size);

+    sbinptr b = smallbin_at(m, sidx);

+    if (smallmap_is_marked(m, sidx)) {

+      mchunkptr p = b;

+      do {

+        if (p == x)

+          return 1;

+      } while ((p = p->fd) != b);

+    }

+  }

+  else {

+    bindex_t tidx;

+    compute_tree_index(size, tidx);

+    if (treemap_is_marked(m, tidx)) {

+      tchunkptr t = *treebin_at(m, tidx);

+      size_t sizebits = size << leftshift_for_tree_index(tidx);

+      while (t != 0 && chunksize(t) != size) {

+        t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];

+        sizebits <<= 1;

+      }

+      if (t != 0) {

+        tchunkptr u = t;

+        do {

+          if (u == (tchunkptr)x)

+            return 1;

+        } while ((u = u->fd) != t);

+      }

+    }

+  }

+  return 0;

+}

+

+/* Traverse each chunk and check it; return total */

+static size_t traverse_and_check(mstate m) {

+  size_t sum = 0;

+  if (is_initialized(m)) {

+    msegmentptr s = &m->seg;

+    sum += m->topsize + TOP_FOOT_SIZE;

+    while (s != 0) {

+      mchunkptr q = align_as_chunk(s->base);

+      mchunkptr lastq = 0;

+      assert(pinuse(q));

+      while (segment_holds(s, q) &&

+             q != m->top && q->head != FENCEPOST_HEAD) {

+        sum += chunksize(q);

+        if (cinuse(q)) {

+          assert(!bin_find(m, q));

+          do_check_inuse_chunk(m, q);

+        }

+        else {

+          assert(q == m->dv || bin_find(m, q));

+          assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */

+          do_check_free_chunk(m, q);

+        }

+        lastq = q;

+        q = next_chunk(q);

+      }

+      s = s->next;

+    }

+  }

+  return sum;

+}

+

+/* Check all properties of malloc_state. */

+static void do_check_malloc_state(mstate m) {

+  bindex_t i;

+  size_t total;

+  /* check bins */

+  for (i = 0; i < NSMALLBINS; ++i)

+    do_check_smallbin(m, i);

+  for (i = 0; i < NTREEBINS; ++i)

+    do_check_treebin(m, i);

+

+  if (m->dvsize != 0) { /* check dv chunk */

+    do_check_any_chunk(m, m->dv);

+    assert(m->dvsize == chunksize(m->dv));

+    assert(m->dvsize >= MIN_CHUNK_SIZE);

+    assert(bin_find(m, m->dv) == 0);

+  }

+

+  if (m->top != 0) {   /* check top chunk */

+    do_check_top_chunk(m, m->top);

+    assert(m->topsize == chunksize(m->top));

+    assert(m->topsize > 0);

+    assert(bin_find(m, m->top) == 0);

+  }

+

+  total = traverse_and_check(m);

+  assert(total <= m->footprint);

+  assert(m->footprint <= m->max_footprint);

+}

+#endif /* DEBUG */

+

+/* ----------------------------- statistics ------------------------------ */

+

+#if !NO_MALLINFO

+static struct mallinfo internal_mallinfo(mstate m) {

+  struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

+  if (!PREACTION(m)) {

+    check_malloc_state(m);

+    if (is_initialized(m)) {

+      size_t nfree = SIZE_T_ONE; /* top always free */

+      size_t mfree = m->topsize + TOP_FOOT_SIZE;

+      size_t sum = mfree;

+      msegmentptr s = &m->seg;

+      while (s != 0) {

+        mchunkptr q = align_as_chunk(s->base);

+        while (segment_holds(s, q) &&

+               q != m->top && q->head != FENCEPOST_HEAD) {

+          size_t sz = chunksize(q);

+          sum += sz;

+          if (!cinuse(q)) {

+            mfree += sz;

+            ++nfree;

+          }

+          q = next_chunk(q);

+        }

+        s = s->next;

+      }

+

+      nm.arena    = sum;

+      nm.ordblks  = nfree;

+      nm.hblkhd   = m->footprint - sum;

+      nm.usmblks  = m->max_footprint;

+      nm.uordblks = m->footprint - mfree;

+      nm.fordblks = mfree;

+      nm.keepcost = m->topsize;

+    }

+

+    POSTACTION(m);

+  }

+  return nm;

+}

+#endif /* !NO_MALLINFO */

+

+static void internal_malloc_stats(mstate m) {

+  if (!PREACTION(m)) {

+    size_t maxfp = 0;

+    size_t fp = 0;

+    size_t used = 0;

+    check_malloc_state(m);

+    if (is_initialized(m)) {

+      msegmentptr s = &m->seg;

+      maxfp = m->max_footprint;

+      fp = m->footprint;

+      used = fp - (m->topsize + TOP_FOOT_SIZE);

+

+      while (s != 0) {

+        mchunkptr q = align_as_chunk(s->base);

+        while (segment_holds(s, q) &&

+               q != m->top && q->head != FENCEPOST_HEAD) {

+          if (!cinuse(q))

+            used -= chunksize(q);

+          q = next_chunk(q);

+        }

+        s = s->next;

+      }

+    }

+

+    fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp));

+    fprintf(stderr, "system bytes     = %10lu\n", (unsigned long)(fp));

+    fprintf(stderr, "in use bytes     = %10lu\n", (unsigned long)(used));

+

+    POSTACTION(m);

+  }

+}

+

+/* ----------------------- Operations on smallbins ----------------------- */

+

+/*

+  Various forms of linking and unlinking are defined as macros.  Even

+  the ones for trees, which are very long but have very short typical

+  paths.  This is ugly but reduces reliance on inlining support of

+  compilers.

+*/

+

+/* Link a free chunk into a smallbin  */

+#define insert_small_chunk(M, P, S) {\

+  bindex_t I  = small_index(S);\

+  mchunkptr B = smallbin_at(M, I);\

+  mchunkptr F = B;\

+  assert(S >= MIN_CHUNK_SIZE);\

+  if (!smallmap_is_marked(M, I))\

+    mark_smallmap(M, I);\

+  else if (RTCHECK(ok_address(M, B->fd)))\

+    F = B->fd;\

+  else {\

+    CORRUPTION_ERROR_ACTION(M);\

+  }\

+  B->fd = P;\

+  F->bk = P;\

+  P->fd = F;\

+  P->bk = B;\

+}

+

+/* Unlink a chunk from a smallbin  */

+#define unlink_small_chunk(M, P, S) {\

+  mchunkptr F = P->fd;\

+  mchunkptr B = P->bk;\

+  bindex_t I = small_index(S);\

+  assert(P != B);\

+  assert(P != F);\

+  assert(chunksize(P) == small_index2size(I));\

+  if (F == B)\

+    clear_smallmap(M, I);\

+  else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\

+                   (B == smallbin_at(M,I) || ok_address(M, B)))) {\

+    F->bk = B;\

+    B->fd = F;\

+  }\

+  else {\

+    CORRUPTION_ERROR_ACTION(M);\

+  }\

+}

+

+/* Unlink the first chunk from a smallbin */

+#define unlink_first_small_chunk(M, B, P, I) {\

+  mchunkptr F = P->fd;\

+  assert(P != B);\

+  assert(P != F);\

+  assert(chunksize(P) == small_index2size(I));\

+  if (B == F)\

+    clear_smallmap(M, I);\

+  else if (RTCHECK(ok_address(M, F))) {\

+    B->fd = F;\

+    F->bk = B;\

+  }\

+  else {\

+    CORRUPTION_ERROR_ACTION(M);\

+  }\

+}

+

+/* Replace dv node, binning the old one */

+/* Used only when dvsize known to be small */

+#define replace_dv(M, P, S) {\

+  size_t DVS = M->dvsize;\

+  if (DVS != 0) {\

+    mchunkptr DV = M->dv;\

+    assert(is_small(DVS));\

+    insert_small_chunk(M, DV, DVS);\

+  }\

+  M->dvsize = S;\

+  M->dv = P;\

+}

+

+/* ------------------------- Operations on trees ------------------------- */

+

+/* Insert chunk into tree */

+#define insert_large_chunk(M, X, S) {\

+  tbinptr* H;\

+  bindex_t I;\

+  compute_tree_index(S, I);\

+  H = treebin_at(M, I);\

+  X->index = I;\

+  X->child[0] = X->child[1] = 0;\

+  if (!treemap_is_marked(M, I)) {\

+    mark_treemap(M, I);\

+    *H = X;\

+    X->parent = (tchunkptr)H;\

+    X->fd = X->bk = X;\

+  }\

+  else {\

+    tchunkptr T = *H;\

+    size_t K = S << leftshift_for_tree_index(I);\

+    for (;;) {\

+      if (chunksize(T) != S) {\

+        tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\

+        K <<= 1;\

+        if (*C != 0)\

+          T = *C;\

+        else if (RTCHECK(ok_address(M, C))) {\

+          *C = X;\

+          X->parent = T;\

+          X->fd = X->bk = X;\

+          break;\

+        }\

+        else {\

+          CORRUPTION_ERROR_ACTION(M);\

+          break;\

+        }\

+      }\

+      else {\

+        tchunkptr F = T->fd;\

+        if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\

+          T->fd = F->bk = X;\

+          X->fd = F;\

+          X->bk = T;\

+          X->parent = 0;\

+          break;\

+        }\

+        else {\

+          CORRUPTION_ERROR_ACTION(M);\

+          break;\

+        }\

+      }\

+    }\

+  }\

+}

+

+/*

+  Unlink steps:

+

+  1. If x is a chained node, unlink it from its same-sized fd/bk links

+     and choose its bk node as its replacement.

+  2. If x was the last node of its size, but not a leaf node, it must

+     be replaced with a leaf node (not merely one with an open left or

+     right), to make sure that lefts and rights of descendents

+     correspond properly to bit masks.  We use the rightmost descendent

+     of x.  We could use any other leaf, but this is easy to locate and

+     tends to counteract removal of leftmosts elsewhere, and so keeps

+     paths shorter than minimally guaranteed.  This doesn't loop much

+     because on average a node in a tree is near the bottom.

+  3. If x is the base of a chain (i.e., has parent links) relink

+     x's parent and children to x's replacement (or null if none).

+*/

+

+#define unlink_large_chunk(M, X) {\

+  tchunkptr XP = X->parent;\

+  tchunkptr R;\

+  if (X->bk != X) {\

+    tchunkptr F = X->fd;\

+    R = X->bk;\

+    if (RTCHECK(ok_address(M, F))) {\

+      F->bk = R;\

+      R->fd = F;\

+    }\

+    else {\

+      CORRUPTION_ERROR_ACTION(M);\

+    }\

+  }\

+  else {\

+    tchunkptr* RP;\

+    if (((R = *(RP = &(X->child[1]))) != 0) ||\

+        ((R = *(RP = &(X->child[0]))) != 0)) {\

+      tchunkptr* CP;\

+      while ((*(CP = &(R->child[1])) != 0) ||\

+             (*(CP = &(R->child[0])) != 0)) {\

+        R = *(RP = CP);\

+      }\

+      if (RTCHECK(ok_address(M, RP)))\

+        *RP = 0;\

+      else {\

+        CORRUPTION_ERROR_ACTION(M);\

+      }\

+    }\

+  }\

+  if (XP != 0) {\

+    tbinptr* H = treebin_at(M, X->index);\

+    if (X == *H) {\

+      if ((*H = R) == 0) \

+        clear_treemap(M, X->index);\

+    }\

+    else if (RTCHECK(ok_address(M, XP))) {\

+      if (XP->child[0] == X) \

+        XP->child[0] = R;\

+      else \

+        XP->child[1] = R;\

+    }\

+    else\

+      CORRUPTION_ERROR_ACTION(M);\

+    if (R != 0) {\

+      if (RTCHECK(ok_address(M, R))) {\

+        tchunkptr C0, C1;\

+        R->parent = XP;\

+        if ((C0 = X->child[0]) != 0) {\

+          if (RTCHECK(ok_address(M, C0))) {\

+            R->child[0] = C0;\

+            C0->parent = R;\

+          }\

+          else\

+            CORRUPTION_ERROR_ACTION(M);\

+        }\

+        if ((C1 = X->child[1]) != 0) {\

+          if (RTCHECK(ok_address(M, C1))) {\

+            R->child[1] = C1;\

+            C1->parent = R;\

+          }\

+          else\

+            CORRUPTION_ERROR_ACTION(M);\

+        }\

+      }\

+      else\

+        CORRUPTION_ERROR_ACTION(M);\

+    }\

+  }\

+}

+

+/* Relays to large vs small bin operations */

+

+#define insert_chunk(M, P, S)\

+  if (is_small(S)) insert_small_chunk(M, P, S)\

+  else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }

+

+#define unlink_chunk(M, P, S)\

+  if (is_small(S)) unlink_small_chunk(M, P, S)\

+  else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }

+

+

+/* Relays to internal calls to malloc/free from realloc, memalign etc */

+

+#if ONLY_MSPACES

+#define internal_malloc(m, b) mspace_malloc(m, b)

+#define internal_free(m, mem) mspace_free(m,mem);

+#else /* ONLY_MSPACES */

+#if MSPACES

+#define internal_malloc(m, b)\

+   (m == gm)? dlmalloc(b) : mspace_malloc(m, b)

+#define internal_free(m, mem)\

+   if (m == gm) dlfree(mem); else mspace_free(m,mem);

+#else /* MSPACES */

+#define internal_malloc(m, b) dlmalloc(b)

+#define internal_free(m, mem) dlfree(mem)

+#endif /* MSPACES */

+#endif /* ONLY_MSPACES */

+

+/* -----------------------  Direct-mmapping chunks ----------------------- */

+

+/*

+  Directly mmapped chunks are set up with an offset to the start of

+  the mmapped region stored in the prev_foot field of the chunk. This

+  allows reconstruction of the required argument to MUNMAP when freed,

+  and also allows adjustment of the returned chunk to meet alignment

+  requirements (especially in memalign).  There is also enough space

+  allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain

+  the PINUSE bit so frees can be checked.

+*/

+

+/* Malloc using mmap */

+static void* mmap_alloc(mstate m, size_t nb) {

+  size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);

+  if (mmsize > nb) {     /* Check for wrap around 0 */

+    char* mm = (char*)(DIRECT_MMAP(mmsize));

+    if (mm != CMFAIL) {

+      size_t offset = align_offset(chunk2mem(mm));

+      size_t psize = mmsize - offset - MMAP_FOOT_PAD;

+      mchunkptr p = (mchunkptr)(mm + offset);

+      p->prev_foot = offset | IS_MMAPPED_BIT;

+      (p)->head = (psize|CINUSE_BIT);

+      mark_inuse_foot(m, p, psize);

+      chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;

+      chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;

+

+      if (mm < m->least_addr)

+        m->least_addr = mm;

+      if ((m->footprint += mmsize) > m->max_footprint)

+        m->max_footprint = m->footprint;

+      assert(is_aligned(chunk2mem(p)));

+      check_mmapped_chunk(m, p);

+      return chunk2mem(p);

+    }

+  }

+  return 0;

+}

+

+/* Realloc using mmap */

+static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) {

+  size_t oldsize = chunksize(oldp);

+  if (is_small(nb)) /* Can't shrink mmap regions below small size */

+    return 0;

+  /* Keep old chunk if big enough but not too big */

+  if (oldsize >= nb + SIZE_T_SIZE &&

+      (oldsize - nb) <= (mparams.granularity << 1))

+    return oldp;

+  else {

+    size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;

+    size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;

+    size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +

+                                         CHUNK_ALIGN_MASK);

+    char* cp = (char*)CALL_MREMAP((char*)oldp - offset,

+                                  oldmmsize, newmmsize, 1);

+    if (cp != CMFAIL) {

+      mchunkptr newp = (mchunkptr)(cp + offset);

+      size_t psize = newmmsize - offset - MMAP_FOOT_PAD;

+      newp->head = (psize|CINUSE_BIT);

+      mark_inuse_foot(m, newp, psize);

+      chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;

+      chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;

+

+      if (cp < m->least_addr)

+        m->least_addr = cp;

+      if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)

+        m->max_footprint = m->footprint;

+      check_mmapped_chunk(m, newp);

+      return newp;

+    }

+  }

+  return 0;

+}

+

+/* -------------------------- mspace management -------------------------- */

+

+/* Initialize top chunk and its size */

+static void init_top(mstate m, mchunkptr p, size_t psize) {

+  /* Ensure alignment */

+  size_t offset = align_offset(chunk2mem(p));

+  p = (mchunkptr)((char*)p + offset);

+  psize -= offset;

+

+  m->top = p;

+  m->topsize = psize;

+  p->head = psize | PINUSE_BIT;

+  /* set size of fake trailing chunk holding overhead space only once */

+  chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;

+  m->trim_check = mparams.trim_threshold; /* reset on each update */

+}

+

+/* Initialize bins for a new mstate that is otherwise zeroed out */

+static void init_bins(mstate m) {

+  /* Establish circular links for smallbins */

+  bindex_t i;

+  for (i = 0; i < NSMALLBINS; ++i) {

+    sbinptr bin = smallbin_at(m,i);

+    bin->fd = bin->bk = bin;

+  }

+}

+

+#if PROCEED_ON_ERROR

+

+/* default corruption action */

+static void reset_on_error(mstate m) {

+  int i;

+  ++malloc_corruption_error_count;

+  /* Reinitialize fields to forget about all memory */

+  m->smallbins = m->treebins = 0;

+  m->dvsize = m->topsize = 0;

+  m->seg.base = 0;

+  m->seg.size = 0;

+  m->seg.next = 0;

+  m->top = m->dv = 0;

+  for (i = 0; i < NTREEBINS; ++i)

+    *treebin_at(m, i) = 0;

+  init_bins(m);

+}

+#endif /* PROCEED_ON_ERROR */

+

+/* Allocate chunk and prepend remainder with chunk in successor base. */

+static void* prepend_alloc(mstate m, char* newbase, char* oldbase,

+                           size_t nb) {

+  mchunkptr p = align_as_chunk(newbase);

+  mchunkptr oldfirst = align_as_chunk(oldbase);

+  size_t psize = (char*)oldfirst - (char*)p;

+  mchunkptr q = chunk_plus_offset(p, nb);

+  size_t qsize = psize - nb;

+  set_size_and_pinuse_of_inuse_chunk(m, p, nb);

+

+  assert((char*)oldfirst > (char*)q);

+  assert(pinuse(oldfirst));

+  assert(qsize >= MIN_CHUNK_SIZE);

+

+  /* consolidate remainder with first chunk of old base */

+  if (oldfirst == m->top) {

+    size_t tsize = m->topsize += qsize;

+    m->top = q;

+    q->head = tsize | PINUSE_BIT;

+    check_top_chunk(m, q);

+  }

+  else if (oldfirst == m->dv) {

+    size_t dsize = m->dvsize += qsize;

+    m->dv = q;

+    set_size_and_pinuse_of_free_chunk(q, dsize);

+  }

+  else {

+    if (!cinuse(oldfirst)) {

+      size_t nsize = chunksize(oldfirst);

+      unlink_chunk(m, oldfirst, nsize);

+      oldfirst = chunk_plus_offset(oldfirst, nsize);

+      qsize += nsize;

+    }

+    set_free_with_pinuse(q, qsize, oldfirst);

+    insert_chunk(m, q, qsize);

+    check_free_chunk(m, q);

+  }

+

+  check_malloced_chunk(m, chunk2mem(p), nb);

+  return chunk2mem(p);

+}

+

+

+/* Add a segment to hold a new noncontiguous region */

+static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {

+  /* Determine locations and sizes of segment, fenceposts, old top */

+  char* old_top = (char*)m->top;

+  msegmentptr oldsp = segment_holding(m, old_top);

+  char* old_end = oldsp->base + oldsp->size;

+  size_t ssize = pad_request(sizeof(struct malloc_segment));

+  char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);

+  size_t offset = align_offset(chunk2mem(rawsp));

+  char* asp = rawsp + offset;

+  char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;

+  mchunkptr sp = (mchunkptr)csp;

+  msegmentptr ss = (msegmentptr)(chunk2mem(sp));

+  mchunkptr tnext = chunk_plus_offset(sp, ssize);

+  mchunkptr p = tnext;

+  int nfences = 0;

+

+  /* reset top to new space */

+  init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);

+

+  /* Set up segment record */

+  assert(is_aligned(ss));

+  set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);

+  *ss = m->seg; /* Push current record */

+  m->seg.base = tbase;

+  m->seg.size = tsize;

+  m->seg.sflags = mmapped;

+  m->seg.next = ss;

+

+  /* Insert trailing fenceposts */

+  for (;;) {

+    mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);

+    p->head = FENCEPOST_HEAD;

+    ++nfences;

+    if ((char*)(&(nextp->head)) < old_end)

+      p = nextp;

+    else

+      break;

+  }

+  assert(nfences >= 2);

+

+  /* Insert the rest of old top into a bin as an ordinary free chunk */

+  if (csp != old_top) {

+    mchunkptr q = (mchunkptr)old_top;

+    size_t psize = csp - old_top;

+    mchunkptr tn = chunk_plus_offset(q, psize);

+    set_free_with_pinuse(q, psize, tn);

+    insert_chunk(m, q, psize);

+  }

+

+  check_top_chunk(m, m->top);

+}

+

+/* -------------------------- System allocation -------------------------- */

+

+/* Get memory from system using MORECORE or MMAP */

+static void* sys_alloc(mstate m, size_t nb) {

+  char* tbase = CMFAIL;

+  size_t tsize = 0;

+  flag_t mmap_flag = 0;

+

+  init_mparams();

+

+  /* Directly map large chunks */

+  if (use_mmap(m) && nb >= mparams.mmap_threshold) {

+    void* mem = mmap_alloc(m, nb);

+    if (mem != 0)

+      return mem;

+  }

+

+  /*

+    Try getting memory in any of three ways (in most-preferred to

+    least-preferred order):

+    1. A call to MORECORE that can normally contiguously extend memory.

+       (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or

+       or main space is mmapped or a previous contiguous call failed)

+    2. A call to MMAP new space (disabled if not HAVE_MMAP).

+       Note that under the default settings, if MORECORE is unable to

+       fulfill a request, and HAVE_MMAP is true, then mmap is

+       used as a noncontiguous system allocator. This is a useful backup

+       strategy for systems with holes in address spaces -- in this case

+       sbrk cannot contiguously expand the heap, but mmap may be able to

+       find space.

+    3. A call to MORECORE that cannot usually contiguously extend memory.

+       (disabled if not HAVE_MORECORE)

+  */

+

+  if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {

+    char* br = CMFAIL;

+    msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top);

+    size_t asize = 0;

+    ACQUIRE_MORECORE_LOCK();

+

+    if (ss == 0) {  /* First time through or recovery */

+      char* base = (char*)CALL_MORECORE(0);

+      if (base != CMFAIL) {

+        asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);

+        /* Adjust to end on a page boundary */

+        if (!is_page_aligned(base))

+          asize += (page_align((size_t)base) - (size_t)base);

+        /* Can't call MORECORE if size is negative when treated as signed */

+        if (asize < HALF_MAX_SIZE_T &&

+            (br = (char*)(CALL_MORECORE(asize))) == base) {

+          tbase = base;

+          tsize = asize;

+        }

+      }

+    }

+    else {

+      /* Subtract out existing available top space from MORECORE request. */

+      asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE);

+      /* Use mem here only if it did continuously extend old space */

+      if (asize < HALF_MAX_SIZE_T &&

+          (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) {

+        tbase = br;

+        tsize = asize;

+      }

+    }

+

+    if (tbase == CMFAIL) {    /* Cope with partial failure */

+      if (br != CMFAIL) {    /* Try to use/extend the space we did get */

+        if (asize < HALF_MAX_SIZE_T &&

+            asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {

+          size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize);

+          if (esize < HALF_MAX_SIZE_T) {

+            char* end = (char*)CALL_MORECORE(esize);

+            if (end != CMFAIL)

+              asize += esize;

+            else {            /* Can't use; try to release */

+              CALL_MORECORE(-asize);

+              br = CMFAIL;

+            }

+          }

+        }

+      }

+      if (br != CMFAIL) {    /* Use the space we did get */

+        tbase = br;

+        tsize = asize;

+      }

+      else

+        disable_contiguous(m); /* Don't try contiguous path in the future */

+    }

+

+    RELEASE_MORECORE_LOCK();

+  }

+

+  if (HAVE_MMAP && tbase == CMFAIL) {  /* Try MMAP */

+    size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE;

+    size_t rsize = granularity_align(req);

+    if (rsize > nb) { /* Fail if wraps around zero */

+      char* mp = (char*)(CALL_MMAP(rsize));

+      if (mp != CMFAIL) {

+        tbase = mp;

+        tsize = rsize;

+        mmap_flag = IS_MMAPPED_BIT;

+      }

+    }

+  }

+

+  if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */

+    size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);

+    if (asize < HALF_MAX_SIZE_T) {

+      char* br = CMFAIL;

+      char* end = CMFAIL;

+      ACQUIRE_MORECORE_LOCK();

+      br = (char*)(CALL_MORECORE(asize));

+      end = (char*)(CALL_MORECORE(0));

+      RELEASE_MORECORE_LOCK();

+      if (br != CMFAIL && end != CMFAIL && br < end) {

+        size_t ssize = end - br;

+        if (ssize > nb + TOP_FOOT_SIZE) {

+          tbase = br;

+          tsize = ssize;

+        }

+      }

+    }

+  }

+

+  if (tbase != CMFAIL) {

+

+    if ((m->footprint += tsize) > m->max_footprint)

+      m->max_footprint = m->footprint;

+

+    if (!is_initialized(m)) { /* first-time initialization */

+      m->seg.base = m->least_addr = tbase;

+      m->seg.size = tsize;

+      m->seg.sflags = mmap_flag;

+      m->magic = mparams.magic;

+      init_bins(m);

+      if (is_global(m))

+        init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);

+      else {

+        /* Offset top by embedded malloc_state */

+        mchunkptr mn = next_chunk(mem2chunk(m));

+        init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE);

+      }

+    }

+

+    else {

+      /* Try to merge with an existing segment */

+      msegmentptr sp = &m->seg;

+      while (sp != 0 && tbase != sp->base + sp->size)

+        sp = sp->next;

+      if (sp != 0 &&

+          !is_extern_segment(sp) &&

+          (sp->sflags & IS_MMAPPED_BIT) == mmap_flag &&

+          segment_holds(sp, m->top)) { /* append */

+        sp->size += tsize;

+        init_top(m, m->top, m->topsize + tsize);

+      }

+      else {

+        if (tbase < m->least_addr)

+          m->least_addr = tbase;

+        sp = &m->seg;

+        while (sp != 0 && sp->base != tbase + tsize)

+          sp = sp->next;

+        if (sp != 0 &&

+            !is_extern_segment(sp) &&

+            (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) {

+          char* oldbase = sp->base;

+          sp->base = tbase;

+          sp->size += tsize;

+          return prepend_alloc(m, tbase, oldbase, nb);

+        }

+        else

+          add_segment(m, tbase, tsize, mmap_flag);

+      }

+    }

+

+    if (nb < m->topsize) { /* Allocate from new or extended top space */

+      size_t rsize = m->topsize -= nb;

+      mchunkptr p = m->top;

+      mchunkptr r = m->top = chunk_plus_offset(p, nb);

+      r->head = rsize | PINUSE_BIT;

+      set_size_and_pinuse_of_inuse_chunk(m, p, nb);

+      check_top_chunk(m, m->top);

+      check_malloced_chunk(m, chunk2mem(p), nb);

+      return chunk2mem(p);

+    }

+  }

+

+  MALLOC_FAILURE_ACTION;

+  return 0;

+}

+

+/* -----------------------  system deallocation -------------------------- */

+

+/* Unmap and unlink any mmapped segments that don't contain used chunks */

+static size_t release_unused_segments(mstate m) {

+  size_t released = 0;

+  msegmentptr pred = &m->seg;

+  msegmentptr sp = pred->next;

+  while (sp != 0) {

+    char* base = sp->base;

+    size_t size = sp->size;

+    msegmentptr next = sp->next;

+    if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {

+      mchunkptr p = align_as_chunk(base);

+      size_t psize = chunksize(p);

+      /* Can unmap if first chunk holds entire segment and not pinned */

+      if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {

+        tchunkptr tp = (tchunkptr)p;

+        assert(segment_holds(sp, (char*)sp));

+        if (p == m->dv) {

+          m->dv = 0;

+          m->dvsize = 0;

+        }

+        else {

+          unlink_large_chunk(m, tp);

+        }

+        if (CALL_MUNMAP(base, size) == 0) {

+          released += size;

+          m->footprint -= size;

+          /* unlink obsoleted record */

+          sp = pred;

+          sp->next = next;

+        }

+        else { /* back out if cannot unmap */

+          insert_large_chunk(m, tp, psize);

+        }

+      }

+    }

+    pred = sp;

+    sp = next;

+  }

+  return released;

+}

+

+static int sys_trim(mstate m, size_t pad) {

+  size_t released = 0;

+  if (pad < MAX_REQUEST && is_initialized(m)) {

+    pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */

+

+    if (m->topsize > pad) {

+      /* Shrink top space in granularity-size units, keeping at least one */

+      size_t unit = mparams.granularity;

+      size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -

+                      SIZE_T_ONE) * unit;

+      msegmentptr sp = segment_holding(m, (char*)m->top);

+

+      if (!is_extern_segment(sp)) {

+        if (is_mmapped_segment(sp)) {

+          if (HAVE_MMAP &&

+              sp->size >= extra &&

+              !has_segment_link(m, sp)) { /* can't shrink if pinned */

+            size_t newsize = sp->size - extra;

+            /* Prefer mremap, fall back to munmap */

+            if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||

+                (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {

+              released = extra;

+            }

+          }

+        }

+        else if (HAVE_MORECORE) {

+          if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */

+            extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;

+          ACQUIRE_MORECORE_LOCK();

+          {

+            /* Make sure end of memory is where we last set it. */

+            char* old_br = (char*)(CALL_MORECORE(0));

+            if (old_br == sp->base + sp->size) {

+              char* rel_br = (char*)(CALL_MORECORE(-extra));

+              char* new_br = (char*)(CALL_MORECORE(0));

+              if (rel_br != CMFAIL && new_br < old_br)

+                released = old_br - new_br;

+            }

+          }

+          RELEASE_MORECORE_LOCK();

+        }

+      }

+

+      if (released != 0) {

+        sp->size -= released;

+        m->footprint -= released;

+        init_top(m, m->top, m->topsize - released);

+        check_top_chunk(m, m->top);

+      }

+    }

+

+    /* Unmap any unused mmapped segments */

+    if (HAVE_MMAP)

+      released += release_unused_segments(m);

+

+    /* On failure, disable autotrim to avoid repeated failed future calls */

+    if (released == 0)

+      m->trim_check = MAX_SIZE_T;

+  }

+

+  return (released != 0)? 1 : 0;

+}

+

+/* ---------------------------- malloc support --------------------------- */

+

+/* allocate a large request from the best fitting chunk in a treebin */

+static void* tmalloc_large(mstate m, size_t nb) {

+  tchunkptr v = 0;

+  size_t rsize = -nb; /* Unsigned negation */

+  tchunkptr t;

+  bindex_t idx;

+  compute_tree_index(nb, idx);

+

+  if ((t = *treebin_at(m, idx)) != 0) {

+    /* Traverse tree for this bin looking for node with size == nb */

+    size_t sizebits = nb << leftshift_for_tree_index(idx);

+    tchunkptr rst = 0;  /* The deepest untaken right subtree */

+    for (;;) {

+      tchunkptr rt;

+      size_t trem = chunksize(t) - nb;

+      if (trem < rsize) {

+        v = t;

+        if ((rsize = trem) == 0)

+          break;

+      }

+      rt = t->child[1];

+      t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];

+      if (rt != 0 && rt != t)

+        rst = rt;

+      if (t == 0) {

+        t = rst; /* set t to least subtree holding sizes > nb */

+        break;

+      }

+      sizebits <<= 1;

+    }

+  }

+

+  if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */

+    binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;

+    if (leftbits != 0) {

+      bindex_t i;

+      binmap_t leastbit = least_bit(leftbits);

+      compute_bit2idx(leastbit, i);

+      t = *treebin_at(m, i);

+    }

+  }

+

+  while (t != 0) { /* find smallest of tree or subtree */

+    size_t trem = chunksize(t) - nb;

+    if (trem < rsize) {

+      rsize = trem;

+      v = t;

+    }

+    t = leftmost_child(t);

+  }

+

+  /*  If dv is a better fit, return 0 so malloc will use it */

+  if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {

+    if (RTCHECK(ok_address(m, v))) { /* split */

+      mchunkptr r = chunk_plus_offset(v, nb);

+      assert(chunksize(v) == rsize + nb);

+      if (RTCHECK(ok_next(v, r))) {

+        unlink_large_chunk(m, v);

+        if (rsize < MIN_CHUNK_SIZE)

+          set_inuse_and_pinuse(m, v, (rsize + nb));

+        else {

+          set_size_and_pinuse_of_inuse_chunk(m, v, nb);

+          set_size_and_pinuse_of_free_chunk(r, rsize);

+          insert_chunk(m, r, rsize);

+        }

+        return chunk2mem(v);

+      }

+    }

+    CORRUPTION_ERROR_ACTION(m);

+  }

+  return 0;

+}

+

+/* allocate a small request from the best fitting chunk in a treebin */

+static void* tmalloc_small(mstate m, size_t nb) {

+  tchunkptr t, v;

+  size_t rsize;

+  bindex_t i;

+  binmap_t leastbit = least_bit(m->treemap);

+  compute_bit2idx(leastbit, i);

+

+  v = t = *treebin_at(m, i);

+  rsize = chunksize(t) - nb;

+

+  while ((t = leftmost_child(t)) != 0) {

+    size_t trem = chunksize(t) - nb;

+    if (trem < rsize) {

+      rsize = trem;

+      v = t;

+    }

+  }

+

+  if (RTCHECK(ok_address(m, v))) {

+    mchunkptr r = chunk_plus_offset(v, nb);

+    assert(chunksize(v) == rsize + nb);

+    if (RTCHECK(ok_next(v, r))) {

+      unlink_large_chunk(m, v);

+      if (rsize < MIN_CHUNK_SIZE)

+        set_inuse_and_pinuse(m, v, (rsize + nb));

+      else {

+        set_size_and_pinuse_of_inuse_chunk(m, v, nb);

+        set_size_and_pinuse_of_free_chunk(r, rsize);

+        replace_dv(m, r, rsize);

+      }

+      return chunk2mem(v);

+    }

+  }

+

+  CORRUPTION_ERROR_ACTION(m);

+  return 0;

+}

+

+/* --------------------------- realloc support --------------------------- */

+

+static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {

+  if (bytes >= MAX_REQUEST) {

+    MALLOC_FAILURE_ACTION;

+    return 0;

+  }

+  if (!PREACTION(m)) {

+    mchunkptr oldp = mem2chunk(oldmem);

+    size_t oldsize = chunksize(oldp);

+    mchunkptr next = chunk_plus_offset(oldp, oldsize);

+    mchunkptr newp = 0;

+    void* extra = 0;

+

+    /* Try to either shrink or extend into top. Else malloc-copy-free */

+

+    if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&

+                ok_next(oldp, next) && ok_pinuse(next))) {

+      size_t nb = request2size(bytes);

+      if (is_mmapped(oldp))

+        newp = mmap_resize(m, oldp, nb);

+      else if (oldsize >= nb) { /* already big enough */

+        size_t rsize = oldsize - nb;

+        newp = oldp;

+        if (rsize >= MIN_CHUNK_SIZE) {

+          mchunkptr remainder = chunk_plus_offset(newp, nb);

+          set_inuse(m, newp, nb);

+          set_inuse(m, remainder, rsize);

+          extra = chunk2mem(remainder);

+        }

+      }

+      else if (next == m->top && oldsize + m->topsize > nb) {

+        /* Expand into top */

+        size_t newsize = oldsize + m->topsize;

+        size_t newtopsize = newsize - nb;

+        mchunkptr newtop = chunk_plus_offset(oldp, nb);

+        set_inuse(m, oldp, nb);

+        newtop->head = newtopsize |PINUSE_BIT;

+        m->top = newtop;

+        m->topsize = newtopsize;

+        newp = oldp;

+      }

+    }

+    else {

+      USAGE_ERROR_ACTION(m, oldmem);

+      POSTACTION(m);

+      return 0;

+    }

+

+    POSTACTION(m);

+

+    if (newp != 0) {

+      if (extra != 0) {

+        internal_free(m, extra);

+      }

+      check_inuse_chunk(m, newp);

+      return chunk2mem(newp);

+    }

+    else {

+      void* newmem = internal_malloc(m, bytes);

+      if (newmem != 0) {

+        size_t oc = oldsize - overhead_for(oldp);

+        memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);

+        internal_free(m, oldmem);

+      }

+      return newmem;

+    }

+  }

+  return 0;

+}

+

+/* --------------------------- memalign support -------------------------- */

+

+static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {

+  if (alignment <= MALLOC_ALIGNMENT)    /* Can just use malloc */

+    return internal_malloc(m, bytes);

+  if (alignment <  MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */

+    alignment = MIN_CHUNK_SIZE;

+  if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */

+    size_t a = MALLOC_ALIGNMENT << 1;

+    while (a < alignment) a <<= 1;

+    alignment = a;

+  }

+

+  if (bytes >= MAX_REQUEST - alignment) {

+    if (m != 0)  { /* Test isn't needed but avoids compiler warning */

+      MALLOC_FAILURE_ACTION;

+    }

+  }

+  else {

+    size_t nb = request2size(bytes);

+    size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;

+    char* mem = (char*)internal_malloc(m, req);

+    if (mem != 0) {

+      void* leader = 0;

+      void* trailer = 0;

+      mchunkptr p = mem2chunk(mem);

+

+      if (PREACTION(m)) return 0;

+      if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */

+        /*

+          Find an aligned spot inside chunk.  Since we need to give

+          back leading space in a chunk of at least MIN_CHUNK_SIZE, if

+          the first calculation places us at a spot with less than

+          MIN_CHUNK_SIZE leader, we can move to the next aligned spot.

+          We've allocated enough total room so that this is always

+          possible.

+        */

+        char* br = (char*)mem2chunk((size_t)(((size_t)(mem +

+                                                       alignment -

+                                                       SIZE_T_ONE)) &

+                                             -alignment));

+        char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)?

+          br : br+alignment;

+        mchunkptr newp = (mchunkptr)pos;

+        size_t leadsize = pos - (char*)(p);

+        size_t newsize = chunksize(p) - leadsize;

+

+        if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */

+          newp->prev_foot = p->prev_foot + leadsize;

+          newp->head = (newsize|CINUSE_BIT);

+        }

+        else { /* Otherwise, give back leader, use the rest */

+          set_inuse(m, newp, newsize);

+          set_inuse(m, p, leadsize);

+          leader = chunk2mem(p);

+        }

+        p = newp;

+      }

+

+      /* Give back spare room at the end */

+      if (!is_mmapped(p)) {

+        size_t size = chunksize(p);

+        if (size > nb + MIN_CHUNK_SIZE) {

+          size_t remainder_size = size - nb;

+          mchunkptr remainder = chunk_plus_offset(p, nb);

+          set_inuse(m, p, nb);

+          set_inuse(m, remainder, remainder_size);

+          trailer = chunk2mem(remainder);

+        }

+      }

+

+      assert (chunksize(p) >= nb);

+      assert((((size_t)(chunk2mem(p))) % alignment) == 0);

+      check_inuse_chunk(m, p);

+      POSTACTION(m);

+      if (leader != 0) {

+        internal_free(m, leader);

+      }

+      if (trailer != 0) {

+        internal_free(m, trailer);

+      }

+      return chunk2mem(p);

+    }

+  }

+  return 0;

+}

+

+/* ------------------------ comalloc/coalloc support --------------------- */

+

+static void** ialloc(mstate m,

+                     size_t n_elements,

+                     size_t* sizes,

+                     int opts,

+                     void* chunks[]) {

+  /*

+    This provides common support for independent_X routines, handling

+    all of the combinations that can result.

+

+    The opts arg has:

+    bit 0 set if all elements are same size (using sizes[0])

+    bit 1 set if elements should be zeroed

+  */

+

+  size_t    element_size;   /* chunksize of each element, if all same */

+  size_t    contents_size;  /* total size of elements */

+  size_t    array_size;     /* request size of pointer array */

+  void*     mem;            /* malloced aggregate space */

+  mchunkptr p;              /* corresponding chunk */

+  size_t    remainder_size; /* remaining bytes while splitting */

+  void**    marray;         /* either "chunks" or malloced ptr array */

+  mchunkptr array_chunk;    /* chunk for malloced ptr array */

+  flag_t    was_enabled;    /* to disable mmap */

+  size_t    size;

+  size_t    i;

+

+  /* compute array length, if needed */

+  if (chunks != 0) {

+    if (n_elements == 0)

+      return chunks; /* nothing to do */

+    marray = chunks;

+    array_size = 0;

+  }

+  else {

+    /* if empty req, must still return chunk representing empty array */

+    if (n_elements == 0)

+      return (void**)internal_malloc(m, 0);

+    marray = 0;

+    array_size = request2size(n_elements * (sizeof(void*)));

+  }

+

+  /* compute total element size */

+  if (opts & 0x1) { /* all-same-size */

+    element_size = request2size(*sizes);

+    contents_size = n_elements * element_size;

+  }

+  else { /* add up all the sizes */

+    element_size = 0;

+    contents_size = 0;

+    for (i = 0; i != n_elements; ++i)

+      contents_size += request2size(sizes[i]);

+  }

+

+  size = contents_size + array_size;

+

+  /*

+     Allocate the aggregate chunk.  First disable direct-mmapping so

+     malloc won't use it, since we would not be able to later

+     free/realloc space internal to a segregated mmap region.

+  */

+  was_enabled = use_mmap(m);

+  disable_mmap(m);

+  mem = internal_malloc(m, size - CHUNK_OVERHEAD);

+  if (was_enabled)

+    enable_mmap(m);

+  if (mem == 0)

+    return 0;

+

+  if (PREACTION(m)) return 0;

+  p = mem2chunk(mem);

+  remainder_size = chunksize(p);

+

+  assert(!is_mmapped(p));

+

+  if (opts & 0x2) {       /* optionally clear the elements */

+    memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size);

+  }

+

+  /* If not provided, allocate the pointer array as final part of chunk */

+  if (marray == 0) {

+    size_t  array_chunk_size;

+    array_chunk = chunk_plus_offset(p, contents_size);

+    array_chunk_size = remainder_size - contents_size;

+    marray = (void**) (chunk2mem(array_chunk));

+    set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);

+    remainder_size = contents_size;

+  }

+

+  /* split out elements */

+  for (i = 0; ; ++i) {

+    marray[i] = chunk2mem(p);

+    if (i != n_elements-1) {

+      if (element_size != 0)

+        size = element_size;

+      else

+        size = request2size(sizes[i]);

+      remainder_size -= size;

+      set_size_and_pinuse_of_inuse_chunk(m, p, size);

+      p = chunk_plus_offset(p, size);

+    }

+    else { /* the final element absorbs any overallocation slop */

+      set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);

+      break;

+    }

+  }

+

+#if DEBUG

+  if (marray != chunks) {

+    /* final element must have exactly exhausted chunk */

+    if (element_size != 0) {

+      assert(remainder_size == element_size);

+    }

+    else {

+      assert(remainder_size == request2size(sizes[i]));

+    }

+    check_inuse_chunk(m, mem2chunk(marray));

+  }

+  for (i = 0; i != n_elements; ++i)

+    check_inuse_chunk(m, mem2chunk(marray[i]));

+

+#endif /* DEBUG */

+

+  POSTACTION(m);

+  return marray;

+}

+

+

+/* -------------------------- public routines ---------------------------- */

+

+#if !ONLY_MSPACES

+

+void* dlmalloc(size_t bytes) {

+  /*

+     Basic algorithm:

+     If a small request (< 256 bytes minus per-chunk overhead):

+       1. If one exists, use a remainderless chunk in associated smallbin.

+          (Remainderless means that there are too few excess bytes to

+          represent as a chunk.)

+       2. If it is big enough, use the dv chunk, which is normally the

+          chunk adjacent to the one used for the most recent small request.

+       3. If one exists, split the smallest available chunk in a bin,

+          saving remainder in dv.

+       4. If it is big enough, use the top chunk.

+       5. If available, get memory from system and use it

+     Otherwise, for a large request:

+       1. Find the smallest available binned chunk that fits, and use it

+          if it is better fitting than dv chunk, splitting if necessary.

+       2. If better fitting than any binned chunk, use the dv chunk.

+       3. If it is big enough, use the top chunk.

+       4. If request size >= mmap threshold, try to directly mmap this chunk.

+       5. If available, get memory from system and use it

+

+     The ugly goto's here ensure that postaction occurs along all paths.

+  */

+

+  if (!PREACTION(gm)) {

+    void* mem;

+    size_t nb;

+    if (bytes <= MAX_SMALL_REQUEST) {

+      bindex_t idx;

+      binmap_t smallbits;

+      nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);

+      idx = small_index(nb);

+      smallbits = gm->smallmap >> idx;

+

+      if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */

+        mchunkptr b, p;

+        idx += ~smallbits & 1;       /* Uses next bin if idx empty */

+        b = smallbin_at(gm, idx);

+        p = b->fd;

+        assert(chunksize(p) == small_index2size(idx));

+        unlink_first_small_chunk(gm, b, p, idx);

+        set_inuse_and_pinuse(gm, p, small_index2size(idx));

+        mem = chunk2mem(p);

+        check_malloced_chunk(gm, mem, nb);

+        goto postaction;

+      }

+

+      else if (nb > gm->dvsize) {

+        if (smallbits != 0) { /* Use chunk in next nonempty smallbin */

+          mchunkptr b, p, r;

+          size_t rsize;

+          bindex_t i;

+          binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));

+          binmap_t leastbit = least_bit(leftbits);

+          compute_bit2idx(leastbit, i);

+          b = smallbin_at(gm, i);

+          p = b->fd;

+          assert(chunksize(p) == small_index2size(i));

+          unlink_first_small_chunk(gm, b, p, i);

+          rsize = small_index2size(i) - nb;

+          /* Fit here cannot be remainderless if 4byte sizes */

+          if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)

+            set_inuse_and_pinuse(gm, p, small_index2size(i));

+          else {

+            set_size_and_pinuse_of_inuse_chunk(gm, p, nb);

+            r = chunk_plus_offset(p, nb);

+            set_size_and_pinuse_of_free_chunk(r, rsize);

+            replace_dv(gm, r, rsize);

+          }

+          mem = chunk2mem(p);

+          check_malloced_chunk(gm, mem, nb);

+          goto postaction;

+        }

+

+        else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {

+          check_malloced_chunk(gm, mem, nb);

+          goto postaction;

+        }

+      }

+    }

+    else if (bytes >= MAX_REQUEST)

+      nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */

+    else {

+      nb = pad_request(bytes);

+      if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {

+        check_malloced_chunk(gm, mem, nb);

+        goto postaction;

+      }

+    }

+

+    if (nb <= gm->dvsize) {

+      size_t rsize = gm->dvsize - nb;

+      mchunkptr p = gm->dv;

+      if (rsize >= MIN_CHUNK_SIZE) { /* split dv */

+        mchunkptr r = gm->dv = chunk_plus_offset(p, nb);

+        gm->dvsize = rsize;

+        set_size_and_pinuse_of_free_chunk(r, rsize);

+        set_size_and_pinuse_of_inuse_chunk(gm, p, nb);

+      }

+      else { /* exhaust dv */

+        size_t dvs = gm->dvsize;

+        gm->dvsize = 0;

+        gm->dv = 0;

+        set_inuse_and_pinuse(gm, p, dvs);

+      }

+      mem = chunk2mem(p);

+      check_malloced_chunk(gm, mem, nb);

+      goto postaction;

+    }

+

+    else if (nb < gm->topsize) { /* Split top */

+      size_t rsize = gm->topsize -= nb;

+      mchunkptr p = gm->top;

+      mchunkptr r = gm->top = chunk_plus_offset(p, nb);

+      r->head = rsize | PINUSE_BIT;

+      set_size_and_pinuse_of_inuse_chunk(gm, p, nb);

+      mem = chunk2mem(p);

+      check_top_chunk(gm, gm->top);

+      check_malloced_chunk(gm, mem, nb);

+      goto postaction;

+    }

+

+    mem = sys_alloc(gm, nb);

+

+  postaction:

+    POSTACTION(gm);

+    return mem;

+  }

+

+  return 0;

+}

+

+void dlfree(void* mem) {

+  /*

+     Consolidate freed chunks with preceeding or succeeding bordering

+     free chunks, if they exist, and then place in a bin.  Intermixed

+     with special cases for top, dv, mmapped chunks, and usage errors.

+  */

+

+  if (mem != 0) {

+    mchunkptr p  = mem2chunk(mem);

+#if FOOTERS

+    mstate fm = get_mstate_for(p);

+    if (!ok_magic(fm)) {

+      USAGE_ERROR_ACTION(fm, p);

+      return;

+    }

+#else /* FOOTERS */

+#define fm gm

+#endif /* FOOTERS */

+    if (!PREACTION(fm)) {

+      check_inuse_chunk(fm, p);

+      if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {

+        size_t psize = chunksize(p);

+        mchunkptr next = chunk_plus_offset(p, psize);

+        if (!pinuse(p)) {

+          size_t prevsize = p->prev_foot;

+          if ((prevsize & IS_MMAPPED_BIT) != 0) {

+            prevsize &= ~IS_MMAPPED_BIT;

+            psize += prevsize + MMAP_FOOT_PAD;

+            if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)

+              fm->footprint -= psize;

+            goto postaction;

+          }

+          else {

+            mchunkptr prev = chunk_minus_offset(p, prevsize);

+            psize += prevsize;

+            p = prev;

+            if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */

+              if (p != fm->dv) {

+                unlink_chunk(fm, p, prevsize);

+              }

+              else if ((next->head & INUSE_BITS) == INUSE_BITS) {

+                fm->dvsize = psize;

+                set_free_with_pinuse(p, psize, next);

+                goto postaction;

+              }

+            }

+            else

+              goto erroraction;

+          }

+        }

+

+        if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {

+          if (!cinuse(next)) {  /* consolidate forward */

+            if (next == fm->top) {

+              size_t tsize = fm->topsize += psize;

+              fm->top = p;

+              p->head = tsize | PINUSE_BIT;

+              if (p == fm->dv) {

+                fm->dv = 0;

+                fm->dvsize = 0;

+              }

+              if (should_trim(fm, tsize))

+                sys_trim(fm, 0);

+              goto postaction;

+            }

+            else if (next == fm->dv) {

+              size_t dsize = fm->dvsize += psize;

+              fm->dv = p;

+              set_size_and_pinuse_of_free_chunk(p, dsize);

+              goto postaction;

+            }

+            else {

+              size_t nsize = chunksize(next);

+              psize += nsize;

+              unlink_chunk(fm, next, nsize);

+              set_size_and_pinuse_of_free_chunk(p, psize);

+              if (p == fm->dv) {

+                fm->dvsize = psize;

+                goto postaction;

+              }

+            }

+          }

+          else

+            set_free_with_pinuse(p, psize, next);

+          insert_chunk(fm, p, psize);

+          check_free_chunk(fm, p);

+          goto postaction;

+        }

+      }

+    erroraction:

+      USAGE_ERROR_ACTION(fm, p);

+    postaction:

+      POSTACTION(fm);

+    }

+  }

+#if !FOOTERS

+#undef fm

+#endif /* FOOTERS */

+}

+

+void* dlcalloc(size_t n_elements, size_t elem_size) {

+  void* mem;

+  size_t req = 0;

+  if (n_elements != 0) {

+    req = n_elements * elem_size;

+    if (((n_elements | elem_size) & ~(size_t)0xffff) &&

+        (req / n_elements != elem_size))

+      req = MAX_SIZE_T; /* force downstream failure on overflow */

+  }

+  mem = dlmalloc(req);

+  if (mem != 0 && calloc_must_clear(mem2chunk(mem)))

+    memset(mem, 0, req);

+  return mem;

+}

+

+void* dlrealloc(void* oldmem, size_t bytes) {

+  if (oldmem == 0)

+    return dlmalloc(bytes);

+#ifdef REALLOC_ZERO_BYTES_FREES

+  if (bytes == 0) {

+    dlfree(oldmem);

+    return 0;

+  }

+#endif /* REALLOC_ZERO_BYTES_FREES */

+  else {

+#if ! FOOTERS

+    mstate m = gm;

+#else /* FOOTERS */

+    mstate m = get_mstate_for(mem2chunk(oldmem));

+    if (!ok_magic(m)) {

+      USAGE_ERROR_ACTION(m, oldmem);

+      return 0;

+    }

+#endif /* FOOTERS */

+    return internal_realloc(m, oldmem, bytes);

+  }

+}

+

+void* dlmemalign(size_t alignment, size_t bytes) {

+  return internal_memalign(gm, alignment, bytes);

+}

+

+void** dlindependent_calloc(size_t n_elements, size_t elem_size,

+                                 void* chunks[]) {

+  size_t sz = elem_size; /* serves as 1-element array */

+  return ialloc(gm, n_elements, &sz, 3, chunks);

+}

+

+void** dlindependent_comalloc(size_t n_elements, size_t sizes[],

+                                   void* chunks[]) {

+  return ialloc(gm, n_elements, sizes, 0, chunks);

+}

+

+void* dlvalloc(size_t bytes) {

+  size_t pagesz;

+  init_mparams();

+  pagesz = mparams.page_size;

+  return dlmemalign(pagesz, bytes);

+}

+

+void* dlpvalloc(size_t bytes) {

+  size_t pagesz;

+  init_mparams();

+  pagesz = mparams.page_size;

+  return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));

+}

+

+int dlmalloc_trim(size_t pad) {

+  int result = 0;

+  if (!PREACTION(gm)) {

+    result = sys_trim(gm, pad);

+    POSTACTION(gm);

+  }

+  return result;

+}

+

+size_t dlmalloc_footprint(void) {

+  return gm->footprint;

+}

+

+size_t dlmalloc_max_footprint(void) {

+  return gm->max_footprint;

+}

+

+#if !NO_MALLINFO

+struct mallinfo dlmallinfo(void) {

+  return internal_mallinfo(gm);

+}

+#endif /* NO_MALLINFO */

+

+void dlmalloc_stats() {

+  internal_malloc_stats(gm);

+}

+

+size_t dlmalloc_usable_size(void* mem) {

+  if (mem != 0) {

+    mchunkptr p = mem2chunk(mem);

+    if (cinuse(p))

+      return chunksize(p) - overhead_for(p);

+  }

+  return 0;

+}

+

+int dlmallopt(int param_number, int value) {

+  return change_mparam(param_number, value);

+}

+

+#endif /* !ONLY_MSPACES */

+

+/* ----------------------------- user mspaces ---------------------------- */

+

+#if MSPACES

+

+static mstate init_user_mstate(char* tbase, size_t tsize) {

+  size_t msize = pad_request(sizeof(struct malloc_state));

+  mchunkptr mn;

+  mchunkptr msp = align_as_chunk(tbase);

+  mstate m = (mstate)(chunk2mem(msp));

+  memset(m, 0, msize);

+  INITIAL_LOCK(&m->mutex);

+  msp->head = (msize|PINUSE_BIT|CINUSE_BIT);

+  m->seg.base = m->least_addr = tbase;

+  m->seg.size = m->footprint = m->max_footprint = tsize;

+  m->magic = mparams.magic;

+  m->mflags = mparams.default_mflags;

+  disable_contiguous(m);

+  init_bins(m);

+  mn = next_chunk(mem2chunk(m));

+  init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);

+  check_top_chunk(m, m->top);

+  return m;

+}

+

+mspace create_mspace(size_t capacity, int locked) {

+  mstate m = 0;

+  size_t msize = pad_request(sizeof(struct malloc_state));

+  init_mparams(); /* Ensure pagesize etc initialized */

+

+  if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {

+    size_t rs = ((capacity == 0)? mparams.granularity :

+                 (capacity + TOP_FOOT_SIZE + msize));

+    size_t tsize = granularity_align(rs);

+    char* tbase = (char*)(CALL_MMAP(tsize));

+    if (tbase != CMFAIL) {

+      m = init_user_mstate(tbase, tsize);

+      m->seg.sflags = IS_MMAPPED_BIT;

+      set_lock(m, locked);

+    }

+  }

+  return (mspace)m;

+}

+

+mspace create_mspace_with_base(void* base, size_t capacity, int locked) {

+  mstate m = 0;

+  size_t msize = pad_request(sizeof(struct malloc_state));

+  init_mparams(); /* Ensure pagesize etc initialized */

+

+  if (capacity > msize + TOP_FOOT_SIZE &&

+      capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {

+    m = init_user_mstate((char*)base, capacity);

+    m->seg.sflags = EXTERN_BIT;

+    set_lock(m, locked);

+  }

+  return (mspace)m;

+}

+

+size_t destroy_mspace(mspace msp) {

+  size_t freed = 0;

+  mstate ms = (mstate)msp;

+  if (ok_magic(ms)) {

+    msegmentptr sp = &ms->seg;

+    while (sp != 0) {

+      char* base = sp->base;

+      size_t size = sp->size;

+      flag_t flag = sp->sflags;

+      sp = sp->next;

+      if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&

+          CALL_MUNMAP(base, size) == 0)

+        freed += size;

+    }

+  }

+  else {

+    USAGE_ERROR_ACTION(ms,ms);

+  }

+  return freed;

+}

+

+/*

+  mspace versions of routines are near-clones of the global

+  versions. This is not so nice but better than the alternatives.

+*/

+

+

+void* mspace_malloc(mspace msp, size_t bytes) {

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+    return 0;

+  }

+  if (!PREACTION(ms)) {

+    void* mem;

+    size_t nb;

+    if (bytes <= MAX_SMALL_REQUEST) {

+      bindex_t idx;

+      binmap_t smallbits;

+      nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);

+      idx = small_index(nb);

+      smallbits = ms->smallmap >> idx;

+

+      if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */

+        mchunkptr b, p;

+        idx += ~smallbits & 1;       /* Uses next bin if idx empty */

+        b = smallbin_at(ms, idx);

+        p = b->fd;

+        assert(chunksize(p) == small_index2size(idx));

+        unlink_first_small_chunk(ms, b, p, idx);

+        set_inuse_and_pinuse(ms, p, small_index2size(idx));

+        mem = chunk2mem(p);

+        check_malloced_chunk(ms, mem, nb);

+        goto postaction;

+      }

+

+      else if (nb > ms->dvsize) {

+        if (smallbits != 0) { /* Use chunk in next nonempty smallbin */

+          mchunkptr b, p, r;

+          size_t rsize;

+          bindex_t i;

+          binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));

+          binmap_t leastbit = least_bit(leftbits);

+          compute_bit2idx(leastbit, i);

+          b = smallbin_at(ms, i);

+          p = b->fd;

+          assert(chunksize(p) == small_index2size(i));

+          unlink_first_small_chunk(ms, b, p, i);

+          rsize = small_index2size(i) - nb;

+          /* Fit here cannot be remainderless if 4byte sizes */

+          if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)

+            set_inuse_and_pinuse(ms, p, small_index2size(i));

+          else {

+            set_size_and_pinuse_of_inuse_chunk(ms, p, nb);

+            r = chunk_plus_offset(p, nb);

+            set_size_and_pinuse_of_free_chunk(r, rsize);

+            replace_dv(ms, r, rsize);

+          }

+          mem = chunk2mem(p);

+          check_malloced_chunk(ms, mem, nb);

+          goto postaction;

+        }

+

+        else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {

+          check_malloced_chunk(ms, mem, nb);

+          goto postaction;

+        }

+      }

+    }

+    else if (bytes >= MAX_REQUEST)

+      nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */

+    else {

+      nb = pad_request(bytes);

+      if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {

+        check_malloced_chunk(ms, mem, nb);

+        goto postaction;

+      }

+    }

+

+    if (nb <= ms->dvsize) {

+      size_t rsize = ms->dvsize - nb;

+      mchunkptr p = ms->dv;

+      if (rsize >= MIN_CHUNK_SIZE) { /* split dv */

+        mchunkptr r = ms->dv = chunk_plus_offset(p, nb);

+        ms->dvsize = rsize;

+        set_size_and_pinuse_of_free_chunk(r, rsize);

+        set_size_and_pinuse_of_inuse_chunk(ms, p, nb);

+      }

+      else { /* exhaust dv */

+        size_t dvs = ms->dvsize;

+        ms->dvsize = 0;

+        ms->dv = 0;

+        set_inuse_and_pinuse(ms, p, dvs);

+      }

+      mem = chunk2mem(p);

+      check_malloced_chunk(ms, mem, nb);

+      goto postaction;

+    }

+

+    else if (nb < ms->topsize) { /* Split top */

+      size_t rsize = ms->topsize -= nb;

+      mchunkptr p = ms->top;

+      mchunkptr r = ms->top = chunk_plus_offset(p, nb);

+      r->head = rsize | PINUSE_BIT;

+      set_size_and_pinuse_of_inuse_chunk(ms, p, nb);

+      mem = chunk2mem(p);

+      check_top_chunk(ms, ms->top);

+      check_malloced_chunk(ms, mem, nb);

+      goto postaction;

+    }

+

+    mem = sys_alloc(ms, nb);

+

+  postaction:

+    POSTACTION(ms);

+    return mem;

+  }

+

+  return 0;

+}

+

+void mspace_free(mspace msp, void* mem) {

+  if (mem != 0) {

+    mchunkptr p  = mem2chunk(mem);

+#if FOOTERS

+    mstate fm = get_mstate_for(p);

+#else /* FOOTERS */

+    mstate fm = (mstate)msp;

+#endif /* FOOTERS */

+    if (!ok_magic(fm)) {

+      USAGE_ERROR_ACTION(fm, p);

+      return;

+    }

+    if (!PREACTION(fm)) {

+      check_inuse_chunk(fm, p);

+      if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {

+        size_t psize = chunksize(p);

+        mchunkptr next = chunk_plus_offset(p, psize);

+        if (!pinuse(p)) {

+          size_t prevsize = p->prev_foot;

+          if ((prevsize & IS_MMAPPED_BIT) != 0) {

+            prevsize &= ~IS_MMAPPED_BIT;

+            psize += prevsize + MMAP_FOOT_PAD;

+            if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)

+              fm->footprint -= psize;

+            goto postaction;

+          }

+          else {

+            mchunkptr prev = chunk_minus_offset(p, prevsize);

+            psize += prevsize;

+            p = prev;

+            if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */

+              if (p != fm->dv) {

+                unlink_chunk(fm, p, prevsize);

+              }

+              else if ((next->head & INUSE_BITS) == INUSE_BITS) {

+                fm->dvsize = psize;

+                set_free_with_pinuse(p, psize, next);

+                goto postaction;

+              }

+            }

+            else

+              goto erroraction;

+          }

+        }

+

+        if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {

+          if (!cinuse(next)) {  /* consolidate forward */

+            if (next == fm->top) {

+              size_t tsize = fm->topsize += psize;

+              fm->top = p;

+              p->head = tsize | PINUSE_BIT;

+              if (p == fm->dv) {

+                fm->dv = 0;

+                fm->dvsize = 0;

+              }

+              if (should_trim(fm, tsize))

+                sys_trim(fm, 0);

+              goto postaction;

+            }

+            else if (next == fm->dv) {

+              size_t dsize = fm->dvsize += psize;

+              fm->dv = p;

+              set_size_and_pinuse_of_free_chunk(p, dsize);

+              goto postaction;

+            }

+            else {

+              size_t nsize = chunksize(next);

+              psize += nsize;

+              unlink_chunk(fm, next, nsize);

+              set_size_and_pinuse_of_free_chunk(p, psize);

+              if (p == fm->dv) {

+                fm->dvsize = psize;

+                goto postaction;

+              }

+            }

+          }

+          else

+            set_free_with_pinuse(p, psize, next);

+          insert_chunk(fm, p, psize);

+          check_free_chunk(fm, p);

+          goto postaction;

+        }

+      }

+    erroraction:

+      USAGE_ERROR_ACTION(fm, p);

+    postaction:

+      POSTACTION(fm);

+    }

+  }

+}

+

+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) {

+  void* mem;

+  size_t req = 0;

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+    return 0;

+  }

+  if (n_elements != 0) {

+    req = n_elements * elem_size;

+    if (((n_elements | elem_size) & ~(size_t)0xffff) &&

+        (req / n_elements != elem_size))

+      req = MAX_SIZE_T; /* force downstream failure on overflow */

+  }

+  mem = internal_malloc(ms, req);

+  if (mem != 0 && calloc_must_clear(mem2chunk(mem)))

+    memset(mem, 0, req);

+  return mem;

+}

+

+void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) {

+  if (oldmem == 0)

+    return mspace_malloc(msp, bytes);

+#ifdef REALLOC_ZERO_BYTES_FREES

+  if (bytes == 0) {

+    mspace_free(msp, oldmem);

+    return 0;

+  }

+#endif /* REALLOC_ZERO_BYTES_FREES */

+  else {

+#if FOOTERS

+    mchunkptr p  = mem2chunk(oldmem);

+    mstate ms = get_mstate_for(p);

+#else /* FOOTERS */

+    mstate ms = (mstate)msp;

+#endif /* FOOTERS */

+    if (!ok_magic(ms)) {

+      USAGE_ERROR_ACTION(ms,ms);

+      return 0;

+    }

+    return internal_realloc(ms, oldmem, bytes);

+  }

+}

+

+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+    return 0;

+  }

+  return internal_memalign(ms, alignment, bytes);

+}

+

+void** mspace_independent_calloc(mspace msp, size_t n_elements,

+                                 size_t elem_size, void* chunks[]) {

+  size_t sz = elem_size; /* serves as 1-element array */

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+    return 0;

+  }

+  return ialloc(ms, n_elements, &sz, 3, chunks);

+}

+

+void** mspace_independent_comalloc(mspace msp, size_t n_elements,

+                                   size_t sizes[], void* chunks[]) {

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+    return 0;

+  }

+  return ialloc(ms, n_elements, sizes, 0, chunks);

+}

+

+int mspace_trim(mspace msp, size_t pad) {

+  int result = 0;

+  mstate ms = (mstate)msp;

+  if (ok_magic(ms)) {

+    if (!PREACTION(ms)) {

+      result = sys_trim(ms, pad);

+      POSTACTION(ms);

+    }

+  }

+  else {

+    USAGE_ERROR_ACTION(ms,ms);

+  }

+  return result;

+}

+

+void mspace_malloc_stats(mspace msp) {

+  mstate ms = (mstate)msp;

+  if (ok_magic(ms)) {

+    internal_malloc_stats(ms);

+  }

+  else {

+    USAGE_ERROR_ACTION(ms,ms);

+  }

+}

+

+size_t mspace_footprint(mspace msp) {

+  size_t result;

+  mstate ms = (mstate)msp;

+  if (ok_magic(ms)) {

+    result = ms->footprint;

+  }

+  USAGE_ERROR_ACTION(ms,ms);

+  return result;

+}

+

+

+size_t mspace_max_footprint(mspace msp) {

+  size_t result;

+  mstate ms = (mstate)msp;

+  if (ok_magic(ms)) {

+    result = ms->max_footprint;

+  }

+  USAGE_ERROR_ACTION(ms,ms);

+  return result;

+}

+

+

+#if !NO_MALLINFO

+struct mallinfo mspace_mallinfo(mspace msp) {

+  mstate ms = (mstate)msp;

+  if (!ok_magic(ms)) {

+    USAGE_ERROR_ACTION(ms,ms);

+  }

+  return internal_mallinfo(ms);

+}

+#endif /* NO_MALLINFO */

+

+int mspace_mallopt(int param_number, int value) {

+  return change_mparam(param_number, value);

+}

+

+#endif /* MSPACES */

+

+/* -------------------- Alternative MORECORE functions ------------------- */

+

+/*

+  Guidelines for creating a custom version of MORECORE:

+

+  * For best performance, MORECORE should allocate in multiples of pagesize.

+  * MORECORE may allocate more memory than requested. (Or even less,

+      but this will usually result in a malloc failure.)

+  * MORECORE must not allocate memory when given argument zero, but

+      instead return one past the end address of memory from previous

+      nonzero call.

+  * For best performance, consecutive calls to MORECORE with positive

+      arguments should return increasing addresses, indicating that

+      space has been contiguously extended.

+  * Even though consecutive calls to MORECORE need not return contiguous

+      addresses, it must be OK for malloc'ed chunks to span multiple

+      regions in those cases where they do happen to be contiguous.

+  * MORECORE need not handle negative arguments -- it may instead

+      just return MFAIL when given negative arguments.

+      Negative arguments are always multiples of pagesize. MORECORE

+      must not misinterpret negative args as large positive unsigned

+      args. You can suppress all such calls from even occurring by defining

+      MORECORE_CANNOT_TRIM,

+

+  As an example alternative MORECORE, here is a custom allocator

+  kindly contributed for pre-OSX macOS.  It uses virtually but not

+  necessarily physically contiguous non-paged memory (locked in,

+  present and won't get swapped out).  You can use it by uncommenting

+  this section, adding some #includes, and setting up the appropriate

+  defines above:

+

+      #define MORECORE osMoreCore

+

+  There is also a shutdown routine that should somehow be called for

+  cleanup upon program exit.

+

+  #define MAX_POOL_ENTRIES 100

+  #define MINIMUM_MORECORE_SIZE  (64 * 1024U)

+  static int next_os_pool;

+  void *our_os_pools[MAX_POOL_ENTRIES];

+

+  void *osMoreCore(int size)

+  {

+    void *ptr = 0;

+    static void *sbrk_top = 0;

+

+    if (size > 0)

+    {

+      if (size < MINIMUM_MORECORE_SIZE)

+         size = MINIMUM_MORECORE_SIZE;

+      if (CurrentExecutionLevel() == kTaskLevel)

+         ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);

+      if (ptr == 0)

+      {

+        return (void *) MFAIL;

+      }

+      // save ptrs so they can be freed during cleanup

+      our_os_pools[next_os_pool] = ptr;

+      next_os_pool++;

+      ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);

+      sbrk_top = (char *) ptr + size;

+      return ptr;

+    }

+    else if (size < 0)

+    {

+      // we don't currently support shrink behavior

+      return (void *) MFAIL;

+    }

+    else

+    {

+      return sbrk_top;

+    }

+  }

+

+  // cleanup any allocated memory pools

+  // called as last thing before shutting down driver

+

+  void osCleanupMem(void)

+  {

+    void **ptr;

+

+    for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)

+      if (*ptr)

+      {

+         PoolDeallocate(*ptr);

+         *ptr = 0;

+      }

+  }

+

+*/

+

+

+/* -----------------------------------------------------------------------

+History:

+    V2.8.3 Thu Sep 22 11:16:32 2005  Doug Lea  (dl at gee)

+      * Add max_footprint functions

+      * Ensure all appropriate literals are size_t

+      * Fix conditional compilation problem for some #define settings

+      * Avoid concatenating segments with the one provided

+        in create_mspace_with_base

+      * Rename some variables to avoid compiler shadowing warnings

+      * Use explicit lock initialization.

+      * Better handling of sbrk interference.

+      * Simplify and fix segment insertion, trimming and mspace_destroy

+      * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x

+      * Thanks especially to Dennis Flanagan for help on these.

+

+    V2.8.2 Sun Jun 12 16:01:10 2005  Doug Lea  (dl at gee)

+      * Fix memalign brace error.

+

+    V2.8.1 Wed Jun  8 16:11:46 2005  Doug Lea  (dl at gee)

+      * Fix improper #endif nesting in C++

+      * Add explicit casts needed for C++

+

+    V2.8.0 Mon May 30 14:09:02 2005  Doug Lea  (dl at gee)

+      * Use trees for large bins

+      * Support mspaces

+      * Use segments to unify sbrk-based and mmap-based system allocation,

+        removing need for emulation on most platforms without sbrk.

+      * Default safety checks

+      * Optional footer checks. Thanks to William Robertson for the idea.

+      * Internal code refactoring

+      * Incorporate suggestions and platform-specific changes.

+        Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,

+        Aaron Bachmann,  Emery Berger, and others.

+      * Speed up non-fastbin processing enough to remove fastbins.

+      * Remove useless cfree() to avoid conflicts with other apps.

+      * Remove internal memcpy, memset. Compilers handle builtins better.

+      * Remove some options that no one ever used and rename others.

+

+    V2.7.2 Sat Aug 17 09:07:30 2002  Doug Lea  (dl at gee)

+      * Fix malloc_state bitmap array misdeclaration

+

+    V2.7.1 Thu Jul 25 10:58:03 2002  Doug Lea  (dl at gee)

+      * Allow tuning of FIRST_SORTED_BIN_SIZE

+      * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.

+      * Better detection and support for non-contiguousness of MORECORE.

+        Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger

+      * Bypass most of malloc if no frees. Thanks To Emery Berger.

+      * Fix freeing of old top non-contiguous chunk im sysmalloc.

+      * Raised default trim and map thresholds to 256K.

+      * Fix mmap-related #defines. Thanks to Lubos Lunak.

+      * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.

+      * Branch-free bin calculation

+      * Default trim and mmap thresholds now 256K.

+

+    V2.7.0 Sun Mar 11 14:14:06 2001  Doug Lea  (dl at gee)

+      * Introduce independent_comalloc and independent_calloc.

+        Thanks to Michael Pachos for motivation and help.

+      * Make optional .h file available

+      * Allow > 2GB requests on 32bit systems.

+      * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.

+        Thanks also to Andreas Mueller <a.mueller at paradatec.de>,

+        and Anonymous.

+      * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for

+        helping test this.)

+      * memalign: check alignment arg

+      * realloc: don't try to shift chunks backwards, since this

+        leads to  more fragmentation in some programs and doesn't

+        seem to help in any others.

+      * Collect all cases in malloc requiring system memory into sysmalloc

+      * Use mmap as backup to sbrk

+      * Place all internal state in malloc_state

+      * Introduce fastbins (although similar to 2.5.1)

+      * Many minor tunings and cosmetic improvements

+      * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK

+      * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS

+        Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.

+      * Include errno.h to support default failure action.

+

+    V2.6.6 Sun Dec  5 07:42:19 1999  Doug Lea  (dl at gee)

+      * return null for negative arguments

+      * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>

+         * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'

+          (e.g. WIN32 platforms)

+         * Cleanup header file inclusion for WIN32 platforms

+         * Cleanup code to avoid Microsoft Visual C++ compiler complaints

+         * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing

+           memory allocation routines

+         * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)

+         * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to

+           usage of 'assert' in non-WIN32 code

+         * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to

+           avoid infinite loop

+      * Always call 'fREe()' rather than 'free()'

+

+    V2.6.5 Wed Jun 17 15:57:31 1998  Doug Lea  (dl at gee)

+      * Fixed ordering problem with boundary-stamping

+

+    V2.6.3 Sun May 19 08:17:58 1996  Doug Lea  (dl at gee)

+      * Added pvalloc, as recommended by H.J. Liu

+      * Added 64bit pointer support mainly from Wolfram Gloger

+      * Added anonymously donated WIN32 sbrk emulation

+      * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen

+      * malloc_extend_top: fix mask error that caused wastage after

+        foreign sbrks

+      * Add linux mremap support code from HJ Liu

+

+    V2.6.2 Tue Dec  5 06:52:55 1995  Doug Lea  (dl at gee)

+      * Integrated most documentation with the code.

+      * Add support for mmap, with help from

+        Wolfram Gloger (Gloger@lrz.uni-muenchen.de).

+      * Use last_remainder in more cases.

+      * Pack bins using idea from  colin@nyx10.cs.du.edu

+      * Use ordered bins instead of best-fit threshhold

+      * Eliminate block-local decls to simplify tracing and debugging.

+      * Support another case of realloc via move into top

+      * Fix error occuring when initial sbrk_base not word-aligned.

+      * Rely on page size for units instead of SBRK_UNIT to

+        avoid surprises about sbrk alignment conventions.

+      * Add mallinfo, mallopt. Thanks to Raymond Nijssen

+        (raymond@es.ele.tue.nl) for the suggestion.

+      * Add `pad' argument to malloc_trim and top_pad mallopt parameter.

+      * More precautions for cases where other routines call sbrk,

+        courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).

+      * Added macros etc., allowing use in linux libc from

+        H.J. Lu (hjl@gnu.ai.mit.edu)

+      * Inverted this history list

+

+    V2.6.1 Sat Dec  2 14:10:57 1995  Doug Lea  (dl at gee)

+      * Re-tuned and fixed to behave more nicely with V2.6.0 changes.

+      * Removed all preallocation code since under current scheme

+        the work required to undo bad preallocations exceeds

+        the work saved in good cases for most test programs.

+      * No longer use return list or unconsolidated bins since

+        no scheme using them consistently outperforms those that don't

+        given above changes.

+      * Use best fit for very large chunks to prevent some worst-cases.

+      * Added some support for debugging

+

+    V2.6.0 Sat Nov  4 07:05:23 1995  Doug Lea  (dl at gee)

+      * Removed footers when chunks are in use. Thanks to

+        Paul Wilson (wilson@cs.texas.edu) for the suggestion.

+

+    V2.5.4 Wed Nov  1 07:54:51 1995  Doug Lea  (dl at gee)

+      * Added malloc_trim, with help from Wolfram Gloger

+        (wmglo@Dent.MED.Uni-Muenchen.DE).

+

+    V2.5.3 Tue Apr 26 10:16:01 1994  Doug Lea  (dl at g)

+

+    V2.5.2 Tue Apr  5 16:20:40 1994  Doug Lea  (dl at g)

+      * realloc: try to expand in both directions

+      * malloc: swap order of clean-bin strategy;

+      * realloc: only conditionally expand backwards

+      * Try not to scavenge used bins

+      * Use bin counts as a guide to preallocation

+      * Occasionally bin return list chunks in first scan

+      * Add a few optimizations from colin@nyx10.cs.du.edu

+

+    V2.5.1 Sat Aug 14 15:40:43 1993  Doug Lea  (dl at g)

+      * faster bin computation & slightly different binning

+      * merged all consolidations to one part of malloc proper

+         (eliminating old malloc_find_space & malloc_clean_bin)

+      * Scan 2 returns chunks (not just 1)

+      * Propagate failure in realloc if malloc returns 0

+      * Add stuff to allow compilation on non-ANSI compilers

+          from kpv@research.att.com

+

+    V2.5 Sat Aug  7 07:41:59 1993  Doug Lea  (dl at g.oswego.edu)

+      * removed potential for odd address access in prev_chunk

+      * removed dependency on getpagesize.h

+      * misc cosmetics and a bit more internal documentation

+      * anticosmetics: mangled names in macros to evade debugger strangeness

+      * tested on sparc, hp-700, dec-mips, rs6000

+          with gcc & native cc (hp, dec only) allowing

+          Detlefs & Zorn comparison study (in SIGPLAN Notices.)

+

+    Trial version Fri Aug 28 13:14:29 1992  Doug Lea  (dl at g.oswego.edu)

+      * Based loosely on libg++-1.2X malloc. (It retains some of the overall

+         structure of old version,  but most details differ.)

+

+*/

diff --git a/lib/dlmalloc.h b/lib/dlmalloc.h
new file mode 100755
index 000000000..197b36667
--- /dev/null
+++ b/lib/dlmalloc.h
@@ -0,0 +1,1143 @@
+#ifndef DLMALLOC_H

+#define DLMALLOC_H

+

+#define USE_DL_PREFIX

+

+/*

+

+#define FOOTERS 1

+#define DEBUG 1

+#define ABORT_ON_ASSERT_FAILURE 0

+*/

+

+/*

+  This is a version (aka dlmalloc) of malloc/free/realloc written by

+  Doug Lea and released to the public domain, as explained at

+  http://creativecommons.org/licenses/publicdomain.  Send questions,

+  comments, complaints, performance data, etc to dl@cs.oswego.edu

+

+* Version 2.8.3 Thu Sep 22 11:16:15 2005  Doug Lea  (dl at gee)

+

+   Note: There may be an updated version of this malloc obtainable at

+           ftp://gee.cs.oswego.edu/pub/misc/malloc.c

+         Check before installing!

+

+* Quickstart

+

+  This library is all in one file to simplify the most common usage:

+  ftp it, compile it (-O3), and link it into another program. All of

+  the compile-time options default to reasonable values for use on

+  most platforms.  You might later want to step through various

+  compile-time and dynamic tuning options.

+

+  For convenience, an include file for code using this malloc is at:

+     ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h

+  You don't really need this .h file unless you call functions not

+  defined in your system include files.  The .h file contains only the

+  excerpts from this file needed for using this malloc on ANSI C/C++

+  systems, so long as you haven't changed compile-time options about

+  naming and tuning parameters.  If you do, then you can create your

+  own malloc.h that does include all settings by cutting at the point

+  indicated below. Note that you may already by default be using a C

+  library containing a malloc that is based on some version of this

+  malloc (for example in linux). You might still want to use the one

+  in this file to customize settings or to avoid overheads associated

+  with library versions.

+

+* Vital statistics:

+

+  Supported pointer/size_t representation:       4 or 8 bytes

+       size_t MUST be an unsigned type of the same width as

+       pointers. (If you are using an ancient system that declares

+       size_t as a signed type, or need it to be a different width

+       than pointers, you can use a previous release of this malloc

+       (e.g. 2.7.2) supporting these.)

+

+  Alignment:                                     8 bytes (default)

+       This suffices for nearly all current machines and C compilers.

+       However, you can define MALLOC_ALIGNMENT to be wider than this

+       if necessary (up to 128bytes), at the expense of using more space.

+

+  Minimum overhead per allocated chunk:   4 or  8 bytes (if 4byte sizes)

+                                          8 or 16 bytes (if 8byte sizes)

+       Each malloced chunk has a hidden word of overhead holding size

+       and status information, and additional cross-check word

+       if FOOTERS is defined.

+

+  Minimum allocated size: 4-byte ptrs:  16 bytes    (including overhead)

+                          8-byte ptrs:  32 bytes    (including overhead)

+

+       Even a request for zero bytes (i.e., malloc(0)) returns a

+       pointer to something of the minimum allocatable size.

+       The maximum overhead wastage (i.e., number of extra bytes

+       allocated than were requested in malloc) is less than or equal

+       to the minimum size, except for requests >= mmap_threshold that

+       are serviced via mmap(), where the worst case wastage is about

+       32 bytes plus the remainder from a system page (the minimal

+       mmap unit); typically 4096 or 8192 bytes.

+

+  Security: static-safe; optionally more or less

+       The "security" of malloc refers to the ability of malicious

+       code to accentuate the effects of errors (for example, freeing

+       space that is not currently malloc'ed or overwriting past the

+       ends of chunks) in code that calls malloc.  This malloc

+       guarantees not to modify any memory locations below the base of

+       heap, i.e., static variables, even in the presence of usage

+       errors.  The routines additionally detect most improper frees

+       and reallocs.  All this holds as long as the static bookkeeping

+       for malloc itself is not corrupted by some other means.  This

+       is only one aspect of security -- these checks do not, and

+       cannot, detect all possible programming errors.

+

+       If FOOTERS is defined nonzero, then each allocated chunk

+       carries an additional check word to verify that it was malloced

+       from its space.  These check words are the same within each

+       execution of a program using malloc, but differ across

+       executions, so externally crafted fake chunks cannot be

+       freed. This improves security by rejecting frees/reallocs that

+       could corrupt heap memory, in addition to the checks preventing

+       writes to statics that are always on.  This may further improve

+       security at the expense of time and space overhead.  (Note that

+       FOOTERS may also be worth using with MSPACES.)

+

+       By default detected errors cause the program to abort (calling

+       "abort()"). You can override this to instead proceed past

+       errors by defining PROCEED_ON_ERROR.  In this case, a bad free

+       has no effect, and a malloc that encounters a bad address

+       caused by user overwrites will ignore the bad address by

+       dropping pointers and indices to all known memory. This may

+       be appropriate for programs that should continue if at all

+       possible in the face of programming errors, although they may

+       run out of memory because dropped memory is never reclaimed.

+

+       If you don't like either of these options, you can define

+       CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything

+       else. And if if you are sure that your program using malloc has

+       no errors or vulnerabilities, you can define INSECURE to 1,

+       which might (or might not) provide a small performance improvement.

+

+  Thread-safety: NOT thread-safe unless USE_LOCKS defined

+       When USE_LOCKS is defined, each public call to malloc, free,

+       etc is surrounded with either a pthread mutex or a win32

+       spinlock (depending on WIN32). This is not especially fast, and

+       can be a major bottleneck.  It is designed only to provide

+       minimal protection in concurrent environments, and to provide a

+       basis for extensions.  If you are using malloc in a concurrent

+       program, consider instead using ptmalloc, which is derived from

+       a version of this malloc. (See http://www.malloc.de).

+

+  System requirements: Any combination of MORECORE and/or MMAP/MUNMAP

+       This malloc can use unix sbrk or any emulation (invoked using

+       the CALL_MORECORE macro) and/or mmap/munmap or any emulation

+       (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system

+       memory.  On most unix systems, it tends to work best if both

+       MORECORE and MMAP are enabled.  On Win32, it uses emulations

+       based on VirtualAlloc. It also uses common C library functions

+       like memset.

+

+  Compliance: I believe it is compliant with the Single Unix Specification

+       (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably

+       others as well.

+

+* Overview of algorithms

+

+  This is not the fastest, most space-conserving, most portable, or

+  most tunable malloc ever written. However it is among the fastest

+  while also being among the most space-conserving, portable and

+  tunable.  Consistent balance across these factors results in a good

+  general-purpose allocator for malloc-intensive programs.

+

+  In most ways, this malloc is a best-fit allocator. Generally, it

+  chooses the best-fitting existing chunk for a request, with ties

+  broken in approximately least-recently-used order. (This strategy

+  normally maintains low fragmentation.) However, for requests less

+  than 256bytes, it deviates from best-fit when there is not an

+  exactly fitting available chunk by preferring to use space adjacent

+  to that used for the previous small request, as well as by breaking

+  ties in approximately most-recently-used order. (These enhance

+  locality of series of small allocations.)  And for very large requests

+  (>= 256Kb by default), it relies on system memory mapping

+  facilities, if supported.  (This helps avoid carrying around and

+  possibly fragmenting memory used only for large chunks.)

+

+  All operations (except malloc_stats and mallinfo) have execution

+  times that are bounded by a constant factor of the number of bits in

+  a size_t, not counting any clearing in calloc or copying in realloc,

+  or actions surrounding MORECORE and MMAP that have times

+  proportional to the number of non-contiguous regions returned by

+  system allocation routines, which is often just 1.

+

+  The implementation is not very modular and seriously overuses

+  macros. Perhaps someday all C compilers will do as good a job

+  inlining modular code as can now be done by brute-force expansion,

+  but now, enough of them seem not to.

+

+  Some compilers issue a lot of warnings about code that is

+  dead/unreachable only on some platforms, and also about intentional

+  uses of negation on unsigned types. All known cases of each can be

+  ignored.

+

+  For a longer but out of date high-level description, see

+     http://gee.cs.oswego.edu/dl/html/malloc.html

+

+* MSPACES

+  If MSPACES is defined, then in addition to malloc, free, etc.,

+  this file also defines mspace_malloc, mspace_free, etc. These

+  are versions of malloc routines that take an "mspace" argument

+  obtained using create_mspace, to control all internal bookkeeping.

+  If ONLY_MSPACES is defined, only these versions are compiled.

+  So if you would like to use this allocator for only some allocations,

+  and your system malloc for others, you can compile with

+  ONLY_MSPACES and then do something like...

+    static mspace mymspace = create_mspace(0,0); // for example

+    #define mymalloc(bytes)  mspace_malloc(mymspace, bytes)

+

+  (Note: If you only need one instance of an mspace, you can instead

+  use "USE_DL_PREFIX" to relabel the global malloc.)

+

+  You can similarly create thread-local allocators by storing

+  mspaces as thread-locals. For example:

+    static __thread mspace tlms = 0;

+    void*  tlmalloc(size_t bytes) {

+      if (tlms == 0) tlms = create_mspace(0, 0);

+      return mspace_malloc(tlms, bytes);

+    }

+    void  tlfree(void* mem) { mspace_free(tlms, mem); }

+

+  Unless FOOTERS is defined, each mspace is completely independent.

+  You cannot allocate from one and free to another (although

+  conformance is only weakly checked, so usage errors are not always

+  caught). If FOOTERS is defined, then each chunk carries around a tag

+  indicating its originating mspace, and frees are directed to their

+  originating spaces.

+

+ -------------------------  Compile-time options ---------------------------

+

+Be careful in setting #define values for numerical constants of type

+size_t. On some systems, literal values are not automatically extended

+to size_t precision unless they are explicitly casted.

+

+WIN32                    default: defined if _WIN32 defined

+  Defining WIN32 sets up defaults for MS environment and compilers.

+  Otherwise defaults are for unix.

+

+MALLOC_ALIGNMENT         default: (size_t)8

+  Controls the minimum alignment for malloc'ed chunks.  It must be a

+  power of two and at least 8, even on machines for which smaller

+  alignments would suffice. It may be defined as larger than this

+  though. Note however that code and data structures are optimized for

+  the case of 8-byte alignment.

+

+MSPACES                  default: 0 (false)

+  If true, compile in support for independent allocation spaces.

+  This is only supported if HAVE_MMAP is true.

+

+ONLY_MSPACES             default: 0 (false)

+  If true, only compile in mspace versions, not regular versions.

+

+USE_LOCKS                default: 0 (false)

+  Causes each call to each public routine to be surrounded with

+  pthread or WIN32 mutex lock/unlock. (If set true, this can be

+  overridden on a per-mspace basis for mspace versions.)

+

+FOOTERS                  default: 0

+  If true, provide extra checking and dispatching by placing

+  information in the footers of allocated chunks. This adds

+  space and time overhead.

+

+INSECURE                 default: 0

+  If true, omit checks for usage errors and heap space overwrites.

+

+USE_DL_PREFIX            default: NOT defined

+  Causes compiler to prefix all public routines with the string 'dl'.

+  This can be useful when you only want to use this malloc in one part

+  of a program, using your regular system malloc elsewhere.

+

+ABORT                    default: defined as abort()

+  Defines how to abort on failed checks.  On most systems, a failed

+  check cannot die with an "assert" or even print an informative

+  message, because the underlying print routines in turn call malloc,

+  which will fail again.  Generally, the best policy is to simply call

+  abort(). It's not very useful to do more than this because many

+  errors due to overwriting will show up as address faults (null, odd

+  addresses etc) rather than malloc-triggered checks, so will also

+  abort.  Also, most compilers know that abort() does not return, so

+  can better optimize code conditionally calling it.

+

+PROCEED_ON_ERROR           default: defined as 0 (false)

+  Controls whether detected bad addresses cause them to bypassed

+  rather than aborting. If set, detected bad arguments to free and

+  realloc are ignored. And all bookkeeping information is zeroed out

+  upon a detected overwrite of freed heap space, thus losing the

+  ability to ever return it from malloc again, but enabling the

+  application to proceed. If PROCEED_ON_ERROR is defined, the

+  static variable malloc_corruption_error_count is compiled in

+  and can be examined to see if errors have occurred. This option

+  generates slower code than the default abort policy.

+

+DEBUG                    default: NOT defined

+  The DEBUG setting is mainly intended for people trying to modify

+  this code or diagnose problems when porting to new platforms.

+  However, it may also be able to better isolate user errors than just

+  using runtime checks.  The assertions in the check routines spell

+  out in more detail the assumptions and invariants underlying the

+  algorithms.  The checking is fairly extensive, and will slow down

+  execution noticeably. Calling malloc_stats or mallinfo with DEBUG

+  set will attempt to check every non-mmapped allocated and free chunk

+  in the course of computing the summaries.

+

+ABORT_ON_ASSERT_FAILURE   default: defined as 1 (true)

+  Debugging assertion failures can be nearly impossible if your

+  version of the assert macro causes malloc to be called, which will

+  lead to a cascade of further failures, blowing the runtime stack.

+  ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),

+  which will usually make debugging easier.

+

+MALLOC_FAILURE_ACTION     default: sets errno to ENOMEM, or no-op on win32

+  The action to take before "return 0" when malloc fails to be able to

+  return memory because there is none available.

+

+HAVE_MORECORE             default: 1 (true) unless win32 or ONLY_MSPACES

+  True if this system supports sbrk or an emulation of it.

+

+MORECORE                  default: sbrk

+  The name of the sbrk-style system routine to call to obtain more

+  memory.  See below for guidance on writing custom MORECORE

+  functions. The type of the argument to sbrk/MORECORE varies across

+  systems.  It cannot be size_t, because it supports negative

+  arguments, so it is normally the signed type of the same width as

+  size_t (sometimes declared as "intptr_t").  It doesn't much matter

+  though. Internally, we only call it with arguments less than half

+  the max value of a size_t, which should work across all reasonable

+  possibilities, although sometimes generating compiler warnings.  See

+  near the end of this file for guidelines for creating a custom

+  version of MORECORE.

+

+MORECORE_CONTIGUOUS       default: 1 (true)

+  If true, take advantage of fact that consecutive calls to MORECORE

+  with positive arguments always return contiguous increasing

+  addresses.  This is true of unix sbrk. It does not hurt too much to

+  set it true anyway, since malloc copes with non-contiguities.

+  Setting it false when definitely non-contiguous saves time

+  and possibly wasted space it would take to discover this though.

+

+MORECORE_CANNOT_TRIM      default: NOT defined

+  True if MORECORE cannot release space back to the system when given

+  negative arguments. This is generally necessary only if you are

+  using a hand-crafted MORECORE function that cannot handle negative

+  arguments.

+

+HAVE_MMAP                 default: 1 (true)

+  True if this system supports mmap or an emulation of it.  If so, and

+  HAVE_MORECORE is not true, MMAP is used for all system

+  allocation. If set and HAVE_MORECORE is true as well, MMAP is

+  primarily used to directly allocate very large blocks. It is also

+  used as a backup strategy in cases where MORECORE fails to provide

+  space from system. Note: A single call to MUNMAP is assumed to be

+  able to unmap memory that may have be allocated using multiple calls

+  to MMAP, so long as they are adjacent.

+

+HAVE_MREMAP               default: 1 on linux, else 0

+  If true realloc() uses mremap() to re-allocate large blocks and

+  extend or shrink allocation spaces.

+

+MMAP_CLEARS               default: 1 on unix

+  True if mmap clears memory so calloc doesn't need to. This is true

+  for standard unix mmap using /dev/zero.

+

+USE_BUILTIN_FFS            default: 0 (i.e., not used)

+  Causes malloc to use the builtin ffs() function to compute indices.

+  Some compilers may recognize and intrinsify ffs to be faster than the

+  supplied C version. Also, the case of x86 using gcc is special-cased

+  to an asm instruction, so is already as fast as it can be, and so

+  this setting has no effect. (On most x86s, the asm version is only

+  slightly faster than the C version.)

+

+malloc_getpagesize         default: derive from system includes, or 4096.

+  The system page size. To the extent possible, this malloc manages

+  memory from the system in page-size units.  This may be (and

+  usually is) a function rather than a constant. This is ignored

+  if WIN32, where page size is determined using getSystemInfo during

+  initialization.

+

+USE_DEV_RANDOM             default: 0 (i.e., not used)

+  Causes malloc to use /dev/random to initialize secure magic seed for

+  stamping footers. Otherwise, the current time is used.

+

+NO_MALLINFO                default: 0

+  If defined, don't compile "mallinfo". This can be a simple way

+  of dealing with mismatches between system declarations and

+  those in this file.

+

+MALLINFO_FIELD_TYPE        default: size_t

+  The type of the fields in the mallinfo struct. This was originally

+  defined as "int" in SVID etc, but is more usefully defined as

+  size_t. The value is used only if  HAVE_USR_INCLUDE_MALLOC_H is not set

+

+REALLOC_ZERO_BYTES_FREES    default: not defined

+  This should be set if a call to realloc with zero bytes should

+  be the same as a call to free. Some people think it should. Otherwise,

+  since this malloc returns a unique pointer for malloc(0), so does

+  realloc(p, 0).

+

+LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H

+LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H,  LACKS_ERRNO_H

+LACKS_STDLIB_H                default: NOT defined unless on WIN32

+  Define these if your system does not have these header files.

+  You might need to manually insert some of the declarations they provide.

+

+DEFAULT_GRANULARITY        default: page size if MORECORE_CONTIGUOUS,

+                                system_info.dwAllocationGranularity in WIN32,

+                                otherwise 64K.

+      Also settable using mallopt(M_GRANULARITY, x)

+  The unit for allocating and deallocating memory from the system.  On

+  most systems with contiguous MORECORE, there is no reason to

+  make this more than a page. However, systems with MMAP tend to

+  either require or encourage larger granularities.  You can increase

+  this value to prevent system allocation functions to be called so

+  often, especially if they are slow.  The value must be at least one

+  page and must be a power of two.  Setting to 0 causes initialization

+  to either page size or win32 region size.  (Note: In previous

+  versions of malloc, the equivalent of this option was called

+  "TOP_PAD")

+

+DEFAULT_TRIM_THRESHOLD    default: 2MB

+      Also settable using mallopt(M_TRIM_THRESHOLD, x)

+  The maximum amount of unused top-most memory to keep before

+  releasing via malloc_trim in free().  Automatic trimming is mainly

+  useful in long-lived programs using contiguous MORECORE.  Because

+  trimming via sbrk can be slow on some systems, and can sometimes be

+  wasteful (in cases where programs immediately afterward allocate

+  more large chunks) the value should be high enough so that your

+  overall system performance would improve by releasing this much

+  memory.  As a rough guide, you might set to a value close to the

+  average size of a process (program) running on your system.

+  Releasing this much memory would allow such a process to run in

+  memory.  Generally, it is worth tuning trim thresholds when a

+  program undergoes phases where several large chunks are allocated

+  and released in ways that can reuse each other's storage, perhaps

+  mixed with phases where there are no such chunks at all. The trim

+  value must be greater than page size to have any useful effect.  To

+  disable trimming completely, you can set to MAX_SIZE_T. Note that the trick

+  some people use of mallocing a huge space and then freeing it at

+  program startup, in an attempt to reserve system memory, doesn't

+  have the intended effect under automatic trimming, since that memory

+  will immediately be returned to the system.

+

+DEFAULT_MMAP_THRESHOLD       default: 256K

+      Also settable using mallopt(M_MMAP_THRESHOLD, x)

+  The request size threshold for using MMAP to directly service a

+  request. Requests of at least this size that cannot be allocated

+  using already-existing space will be serviced via mmap.  (If enough

+  normal freed space already exists it is used instead.)  Using mmap

+  segregates relatively large chunks of memory so that they can be

+  individually obtained and released from the host system. A request

+  serviced through mmap is never reused by any other request (at least

+  not directly; the system may just so happen to remap successive

+  requests to the same locations).  Segregating space in this way has

+  the benefits that: Mmapped space can always be individually released

+  back to the system, which helps keep the system level memory demands

+  of a long-lived program low.  Also, mapped memory doesn't become

+  `locked' between other chunks, as can happen with normally allocated

+  chunks, which means that even trimming via malloc_trim would not

+  release them.  However, it has the disadvantage that the space

+  cannot be reclaimed, consolidated, and then used to service later

+  requests, as happens with normal chunks.  The advantages of mmap

+  nearly always outweigh disadvantages for "large" chunks, but the

+  value of "large" may vary across systems.  The default is an

+  empirically derived value that works well in most systems. You can

+  disable mmap by setting to MAX_SIZE_T.

+

+*/

+

+#ifndef WIN32

+#ifdef _WIN32

+#define WIN32 1

+#endif  /* _WIN32 */

+#endif  /* WIN32 */

+#ifdef WIN32

+#define WIN32_LEAN_AND_MEAN

+#include <windows.h>

+#define HAVE_MMAP 1

+#define HAVE_MORECORE 0

+#define LACKS_UNISTD_H

+#define LACKS_SYS_PARAM_H

+#define LACKS_SYS_MMAN_H

+#define LACKS_STRING_H

+#define LACKS_STRINGS_H

+#define LACKS_SYS_TYPES_H

+#define LACKS_ERRNO_H

+#define MALLOC_FAILURE_ACTION

+#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */

+#endif  /* WIN32 */

+

+#if defined(DARWIN) || defined(_DARWIN)

+/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */

+#ifndef HAVE_MORECORE

+#define HAVE_MORECORE 0

+#define HAVE_MMAP 1

+#endif  /* HAVE_MORECORE */

+#endif  /* DARWIN */

+

+#ifndef LACKS_SYS_TYPES_H

+#include <sys/types.h>  /* For size_t */

+#endif  /* LACKS_SYS_TYPES_H */

+

+/* The maximum possible size_t value has all bits set */

+#define MAX_SIZE_T           (~(size_t)0)

+

+#ifndef ONLY_MSPACES

+#define ONLY_MSPACES 0

+#endif  /* ONLY_MSPACES */

+#ifndef MSPACES

+#if ONLY_MSPACES

+#define MSPACES 1

+#else   /* ONLY_MSPACES */

+#define MSPACES 0

+#endif  /* ONLY_MSPACES */

+#endif  /* MSPACES */

+#ifndef MALLOC_ALIGNMENT

+#define MALLOC_ALIGNMENT ((size_t)8U)

+#endif  /* MALLOC_ALIGNMENT */

+#ifndef FOOTERS

+#define FOOTERS 0

+#endif  /* FOOTERS */

+#ifndef ABORT

+#define ABORT  abort()

+#endif  /* ABORT */

+#ifndef ABORT_ON_ASSERT_FAILURE

+#define ABORT_ON_ASSERT_FAILURE 1

+#endif  /* ABORT_ON_ASSERT_FAILURE */

+#ifndef PROCEED_ON_ERROR

+#define PROCEED_ON_ERROR 0

+#endif  /* PROCEED_ON_ERROR */

+#ifndef USE_LOCKS

+#define USE_LOCKS 0

+#endif  /* USE_LOCKS */

+#ifndef INSECURE

+#define INSECURE 0

+#endif  /* INSECURE */

+#ifndef HAVE_MMAP

+#define HAVE_MMAP 1

+#endif  /* HAVE_MMAP */

+#ifndef MMAP_CLEARS

+#define MMAP_CLEARS 1

+#endif  /* MMAP_CLEARS */

+#ifndef HAVE_MREMAP

+#ifdef linux

+#define HAVE_MREMAP 1

+#else   /* linux */

+#define HAVE_MREMAP 0

+#endif  /* linux */

+#endif  /* HAVE_MREMAP */

+#ifndef MALLOC_FAILURE_ACTION

+#define MALLOC_FAILURE_ACTION  errno = ENOMEM;

+#endif  /* MALLOC_FAILURE_ACTION */

+#ifndef HAVE_MORECORE

+#if ONLY_MSPACES

+#define HAVE_MORECORE 0

+#else   /* ONLY_MSPACES */

+#define HAVE_MORECORE 1

+#endif  /* ONLY_MSPACES */

+#endif  /* HAVE_MORECORE */

+#if !HAVE_MORECORE

+#define MORECORE_CONTIGUOUS 0

+#else   /* !HAVE_MORECORE */

+#ifndef MORECORE

+#define MORECORE sbrk

+#endif  /* MORECORE */

+#ifndef MORECORE_CONTIGUOUS

+#define MORECORE_CONTIGUOUS 1

+#endif  /* MORECORE_CONTIGUOUS */

+#endif  /* HAVE_MORECORE */

+#ifndef DEFAULT_GRANULARITY

+#if MORECORE_CONTIGUOUS

+#define DEFAULT_GRANULARITY (0)  /* 0 means to compute in init_mparams */

+#else   /* MORECORE_CONTIGUOUS */

+#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)

+#endif  /* MORECORE_CONTIGUOUS */

+#endif  /* DEFAULT_GRANULARITY */

+#ifndef DEFAULT_TRIM_THRESHOLD

+#ifndef MORECORE_CANNOT_TRIM

+#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)

+#else   /* MORECORE_CANNOT_TRIM */

+#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T

+#endif  /* MORECORE_CANNOT_TRIM */

+#endif  /* DEFAULT_TRIM_THRESHOLD */

+#ifndef DEFAULT_MMAP_THRESHOLD

+#if HAVE_MMAP

+#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)

+#else   /* HAVE_MMAP */

+#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T

+#endif  /* HAVE_MMAP */

+#endif  /* DEFAULT_MMAP_THRESHOLD */

+#ifndef USE_BUILTIN_FFS

+#define USE_BUILTIN_FFS 0

+#endif  /* USE_BUILTIN_FFS */

+#ifndef USE_DEV_RANDOM

+#define USE_DEV_RANDOM 0

+#endif  /* USE_DEV_RANDOM */

+#ifndef NO_MALLINFO

+#define NO_MALLINFO 0

+#endif  /* NO_MALLINFO */

+#ifndef MALLINFO_FIELD_TYPE

+#define MALLINFO_FIELD_TYPE size_t

+#endif  /* MALLINFO_FIELD_TYPE */

+

+/*

+  mallopt tuning options.  SVID/XPG defines four standard parameter

+  numbers for mallopt, normally defined in malloc.h.  None of these

+  are used in this malloc, so setting them has no effect. But this

+  malloc does support the following options.

+*/

+

+#define M_TRIM_THRESHOLD     (-1)

+#define M_GRANULARITY        (-2)

+#define M_MMAP_THRESHOLD     (-3)

+

+/* ------------------------ Mallinfo declarations ------------------------ */

+

+#if !NO_MALLINFO

+/*

+  This version of malloc supports the standard SVID/XPG mallinfo

+  routine that returns a struct containing usage properties and

+  statistics. It should work on any system that has a

+  /usr/include/malloc.h defining struct mallinfo.  The main

+  declaration needed is the mallinfo struct that is returned (by-copy)

+  by mallinfo().  The malloinfo struct contains a bunch of fields that

+  are not even meaningful in this version of malloc.  These fields are

+  are instead filled by mallinfo() with other numbers that might be of

+  interest.

+

+  HAVE_USR_INCLUDE_MALLOC_H should be set if you have a

+  /usr/include/malloc.h file that includes a declaration of struct

+  mallinfo.  If so, it is included; else a compliant version is

+  declared below.  These must be precisely the same for mallinfo() to

+  work.  The original SVID version of this struct, defined on most

+  systems with mallinfo, declares all fields as ints. But some others

+  define as unsigned long. If your system defines the fields using a

+  type of different width than listed here, you MUST #include your

+  system version and #define HAVE_USR_INCLUDE_MALLOC_H.

+*/

+

+/* #define HAVE_USR_INCLUDE_MALLOC_H */

+

+#ifdef HAVE_USR_INCLUDE_MALLOC_H

+#include "/usr/include/malloc.h"

+#else /* HAVE_USR_INCLUDE_MALLOC_H */

+

+struct mallinfo {

+  MALLINFO_FIELD_TYPE arena;    /* non-mmapped space allocated from system */

+  MALLINFO_FIELD_TYPE ordblks;  /* number of free chunks */

+  MALLINFO_FIELD_TYPE smblks;   /* always 0 */

+  MALLINFO_FIELD_TYPE hblks;    /* always 0 */

+  MALLINFO_FIELD_TYPE hblkhd;   /* space in mmapped regions */

+  MALLINFO_FIELD_TYPE usmblks;  /* maximum total allocated space */

+  MALLINFO_FIELD_TYPE fsmblks;  /* always 0 */

+  MALLINFO_FIELD_TYPE uordblks; /* total allocated space */

+  MALLINFO_FIELD_TYPE fordblks; /* total free space */

+  MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */

+};

+

+#endif /* HAVE_USR_INCLUDE_MALLOC_H */

+#endif /* NO_MALLINFO */

+

+#ifdef __cplusplus

+extern "C" {

+#endif /* __cplusplus */

+

+#if !ONLY_MSPACES

+

+/* ------------------- Declarations of public routines ------------------- */

+

+#ifndef USE_DL_PREFIX

+#define dlcalloc               calloc

+#define dlfree                 free

+#define dlmalloc               malloc

+#define dlmemalign             memalign

+#define dlrealloc              realloc

+#define dlvalloc               valloc

+#define dlpvalloc              pvalloc

+#define dlmallinfo             mallinfo

+#define dlmallopt              mallopt

+#define dlmalloc_trim          malloc_trim

+#define dlmalloc_stats         malloc_stats

+#define dlmalloc_usable_size   malloc_usable_size

+#define dlmalloc_footprint     malloc_footprint

+#define dlmalloc_max_footprint malloc_max_footprint

+#define dlindependent_calloc   independent_calloc

+#define dlindependent_comalloc independent_comalloc

+#endif /* USE_DL_PREFIX */

+

+

+/*

+  malloc(size_t n)

+  Returns a pointer to a newly allocated chunk of at least n bytes, or

+  null if no space is available, in which case errno is set to ENOMEM

+  on ANSI C systems.

+

+  If n is zero, malloc returns a minimum-sized chunk. (The minimum

+  size is 16 bytes on most 32bit systems, and 32 bytes on 64bit

+  systems.)  Note that size_t is an unsigned type, so calls with

+  arguments that would be negative if signed are interpreted as

+  requests for huge amounts of space, which will often fail. The

+  maximum supported value of n differs across systems, but is in all

+  cases less than the maximum representable value of a size_t.

+*/

+void* dlmalloc(size_t);

+

+/*

+  free(void* p)

+  Releases the chunk of memory pointed to by p, that had been previously

+  allocated using malloc or a related routine such as realloc.

+  It has no effect if p is null. If p was not malloced or already

+  freed, free(p) will by default cause the current program to abort.

+*/

+void  dlfree(void*);

+

+/*

+  calloc(size_t n_elements, size_t element_size);

+  Returns a pointer to n_elements * element_size bytes, with all locations

+  set to zero.

+*/

+void* dlcalloc(size_t, size_t);

+

+/*

+  realloc(void* p, size_t n)

+  Returns a pointer to a chunk of size n that contains the same data

+  as does chunk p up to the minimum of (n, p's size) bytes, or null

+  if no space is available.

+

+  The returned pointer may or may not be the same as p. The algorithm

+  prefers extending p in most cases when possible, otherwise it

+  employs the equivalent of a malloc-copy-free sequence.

+

+  If p is null, realloc is equivalent to malloc.

+

+  If space is not available, realloc returns null, errno is set (if on

+  ANSI) and p is NOT freed.

+

+  if n is for fewer bytes than already held by p, the newly unused

+  space is lopped off and freed if possible.  realloc with a size

+  argument of zero (re)allocates a minimum-sized chunk.

+

+  The old unix realloc convention of allowing the last-free'd chunk

+  to be used as an argument to realloc is not supported.

+*/

+

+void* dlrealloc(void*, size_t);

+

+/*

+  memalign(size_t alignment, size_t n);

+  Returns a pointer to a newly allocated chunk of n bytes, aligned

+  in accord with the alignment argument.

+

+  The alignment argument should be a power of two. If the argument is

+  not a power of two, the nearest greater power is used.

+  8-byte alignment is guaranteed by normal malloc calls, so don't

+  bother calling memalign with an argument of 8 or less.

+

+  Overreliance on memalign is a sure way to fragment space.

+*/

+void* dlmemalign(size_t, size_t);

+

+/*

+  valloc(size_t n);

+  Equivalent to memalign(pagesize, n), where pagesize is the page

+  size of the system. If the pagesize is unknown, 4096 is used.

+*/

+void* dlvalloc(size_t);

+

+/*

+  mallopt(int parameter_number, int parameter_value)

+  Sets tunable parameters The format is to provide a

+  (parameter-number, parameter-value) pair.  mallopt then sets the

+  corresponding parameter to the argument value if it can (i.e., so

+  long as the value is meaningful), and returns 1 if successful else

+  0.  SVID/XPG/ANSI defines four standard param numbers for mallopt,

+  normally defined in malloc.h.  None of these are use in this malloc,

+  so setting them has no effect. But this malloc also supports other

+  options in mallopt. See below for details.  Briefly, supported

+  parameters are as follows (listed defaults are for "typical"

+  configurations).

+

+  Symbol            param #  default    allowed param values

+  M_TRIM_THRESHOLD     -1   2*1024*1024   any   (MAX_SIZE_T disables)

+  M_GRANULARITY        -2     page size   any power of 2 >= page size

+  M_MMAP_THRESHOLD     -3      256*1024   any   (or 0 if no MMAP support)

+*/

+int dlmallopt(int, int);

+

+/*

+  malloc_footprint();

+  Returns the number of bytes obtained from the system.  The total

+  number of bytes allocated by malloc, realloc etc., is less than this

+  value. Unlike mallinfo, this function returns only a precomputed

+  result, so can be called frequently to monitor memory consumption.

+  Even if locks are otherwise defined, this function does not use them,

+  so results might not be up to date.

+*/

+size_t dlmalloc_footprint(void);

+

+/*

+  malloc_max_footprint();

+  Returns the maximum number of bytes obtained from the system. This

+  value will be greater than current footprint if deallocated space

+  has been reclaimed by the system. The peak number of bytes allocated

+  by malloc, realloc etc., is less than this value. Unlike mallinfo,

+  this function returns only a precomputed result, so can be called

+  frequently to monitor memory consumption.  Even if locks are

+  otherwise defined, this function does not use them, so results might

+  not be up to date.

+*/

+size_t dlmalloc_max_footprint(void);

+

+#if !NO_MALLINFO

+/*

+  mallinfo()

+  Returns (by copy) a struct containing various summary statistics:

+

+  arena:     current total non-mmapped bytes allocated from system

+  ordblks:   the number of free chunks

+  smblks:    always zero.

+  hblks:     current number of mmapped regions

+  hblkhd:    total bytes held in mmapped regions

+  usmblks:   the maximum total allocated space. This will be greater

+                than current total if trimming has occurred.

+  fsmblks:   always zero

+  uordblks:  current total allocated space (normal or mmapped)

+  fordblks:  total free space

+  keepcost:  the maximum number of bytes that could ideally be released

+               back to system via malloc_trim. ("ideally" means that

+               it ignores page restrictions etc.)

+

+  Because these fields are ints, but internal bookkeeping may

+  be kept as longs, the reported values may wrap around zero and

+  thus be inaccurate.

+*/

+struct mallinfo dlmallinfo(void);

+#endif /* NO_MALLINFO */

+

+/*

+  independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);

+

+  independent_calloc is similar to calloc, but instead of returning a

+  single cleared space, it returns an array of pointers to n_elements

+  independent elements that can hold contents of size elem_size, each

+  of which starts out cleared, and can be independently freed,

+  realloc'ed etc. The elements are guaranteed to be adjacently

+  allocated (this is not guaranteed to occur with multiple callocs or

+  mallocs), which may also improve cache locality in some

+  applications.

+

+  The "chunks" argument is optional (i.e., may be null, which is

+  probably the most typical usage). If it is null, the returned array

+  is itself dynamically allocated and should also be freed when it is

+  no longer needed. Otherwise, the chunks array must be of at least

+  n_elements in length. It is filled in with the pointers to the

+  chunks.

+

+  In either case, independent_calloc returns this pointer array, or

+  null if the allocation failed.  If n_elements is zero and "chunks"

+  is null, it returns a chunk representing an array with zero elements

+  (which should be freed if not wanted).

+

+  Each element must be individually freed when it is no longer

+  needed. If you'd like to instead be able to free all at once, you

+  should instead use regular calloc and assign pointers into this

+  space to represent elements.  (In this case though, you cannot

+  independently free elements.)

+

+  independent_calloc simplifies and speeds up implementations of many

+  kinds of pools.  It may also be useful when constructing large data

+  structures that initially have a fixed number of fixed-sized nodes,

+  but the number is not known at compile time, and some of the nodes

+  may later need to be freed. For example:

+

+  struct Node { int item; struct Node* next; };

+

+  struct Node* build_list() {

+    struct Node** pool;

+    int n = read_number_of_nodes_needed();

+    if (n <= 0) return 0;

+    pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);

+    if (pool == 0) die();

+    // organize into a linked list...

+    struct Node* first = pool[0];

+    for (i = 0; i < n-1; ++i)

+      pool[i]->next = pool[i+1];

+    free(pool);     // Can now free the array (or not, if it is needed later)

+    return first;

+  }

+*/

+void** dlindependent_calloc(size_t, size_t, void**);

+

+/*

+  independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);

+

+  independent_comalloc allocates, all at once, a set of n_elements

+  chunks with sizes indicated in the "sizes" array.    It returns

+  an array of pointers to these elements, each of which can be

+  independently freed, realloc'ed etc. The elements are guaranteed to

+  be adjacently allocated (this is not guaranteed to occur with

+  multiple callocs or mallocs), which may also improve cache locality

+  in some applications.

+

+  The "chunks" argument is optional (i.e., may be null). If it is null

+  the returned array is itself dynamically allocated and should also

+  be freed when it is no longer needed. Otherwise, the chunks array

+  must be of at least n_elements in length. It is filled in with the

+  pointers to the chunks.

+

+  In either case, independent_comalloc returns this pointer array, or

+  null if the allocation failed.  If n_elements is zero and chunks is

+  null, it returns a chunk representing an array with zero elements

+  (which should be freed if not wanted).

+

+  Each element must be individually freed when it is no longer

+  needed. If you'd like to instead be able to free all at once, you

+  should instead use a single regular malloc, and assign pointers at

+  particular offsets in the aggregate space. (In this case though, you

+  cannot independently free elements.)

+

+  independent_comallac differs from independent_calloc in that each

+  element may have a different size, and also that it does not

+  automatically clear elements.

+

+  independent_comalloc can be used to speed up allocation in cases

+  where several structs or objects must always be allocated at the

+  same time.  For example:

+

+  struct Head { ... }

+  struct Foot { ... }

+

+  void send_message(char* msg) {

+    int msglen = strlen(msg);

+    size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };

+    void* chunks[3];

+    if (independent_comalloc(3, sizes, chunks) == 0)

+      die();

+    struct Head* head = (struct Head*)(chunks[0]);

+    char*        body = (char*)(chunks[1]);

+    struct Foot* foot = (struct Foot*)(chunks[2]);

+    // ...

+  }

+

+  In general though, independent_comalloc is worth using only for

+  larger values of n_elements. For small values, you probably won't

+  detect enough difference from series of malloc calls to bother.

+

+  Overuse of independent_comalloc can increase overall memory usage,

+  since it cannot reuse existing noncontiguous small chunks that

+  might be available for some of the elements.

+*/

+void** dlindependent_comalloc(size_t, size_t*, void**);

+

+

+/*

+  pvalloc(size_t n);

+  Equivalent to valloc(minimum-page-that-holds(n)), that is,

+  round up n to nearest pagesize.

+ */

+void*  dlpvalloc(size_t);

+

+/*

+  malloc_trim(size_t pad);

+

+  If possible, gives memory back to the system (via negative arguments

+  to sbrk) if there is unused memory at the `high' end of the malloc

+  pool or in unused MMAP segments. You can call this after freeing

+  large blocks of memory to potentially reduce the system-level memory

+  requirements of a program. However, it cannot guarantee to reduce

+  memory. Under some allocation patterns, some large free blocks of

+  memory will be locked between two used chunks, so they cannot be

+  given back to the system.

+

+  The `pad' argument to malloc_trim represents the amount of free

+  trailing space to leave untrimmed. If this argument is zero, only

+  the minimum amount of memory to maintain internal data structures

+  will be left. Non-zero arguments can be supplied to maintain enough

+  trailing space to service future expected allocations without having

+  to re-obtain memory from the system.

+

+  Malloc_trim returns 1 if it actually released any memory, else 0.

+*/

+int  dlmalloc_trim(size_t);

+

+/*

+  malloc_usable_size(void* p);

+

+  Returns the number of bytes you can actually use in

+  an allocated chunk, which may be more than you requested (although

+  often not) due to alignment and minimum size constraints.

+  You can use this many bytes without worrying about

+  overwriting other allocated objects. This is not a particularly great

+  programming practice. malloc_usable_size can be more useful in

+  debugging and assertions, for example:

+

+  p = malloc(n);

+  assert(malloc_usable_size(p) >= 256);

+*/

+size_t dlmalloc_usable_size(void*);

+

+/*

+  malloc_stats();

+  Prints on stderr the amount of space obtained from the system (both

+  via sbrk and mmap), the maximum amount (which may be more than

+  current if malloc_trim and/or munmap got called), and the current

+  number of bytes allocated via malloc (or realloc, etc) but not yet

+  freed. Note that this is the number of bytes allocated, not the

+  number requested. It will be larger than the number requested

+  because of alignment and bookkeeping overhead. Because it includes

+  alignment wastage as being in use, this figure may be greater than

+  zero even when no user-level chunks are allocated.

+

+  The reported current and maximum system memory can be inaccurate if

+  a program makes other calls to system memory allocation functions

+  (normally sbrk) outside of malloc.

+

+  malloc_stats prints only the most commonly interesting statistics.

+  More information can be obtained by calling mallinfo.

+*/

+void  dlmalloc_stats(void);

+

+#endif /* ONLY_MSPACES */

+

+#if MSPACES

+

+/*

+  mspace is an opaque type representing an independent

+  region of space that supports mspace_malloc, etc.

+*/

+typedef void* mspace;

+

+/*

+  create_mspace creates and returns a new independent space with the

+  given initial capacity, or, if 0, the default granularity size.  It

+  returns null if there is no system memory available to create the

+  space.  If argument locked is non-zero, the space uses a separate

+  lock to control access. The capacity of the space will grow

+  dynamically as needed to service mspace_malloc requests.  You can

+  control the sizes of incremental increases of this space by

+  compiling with a different DEFAULT_GRANULARITY or dynamically

+  setting with mallopt(M_GRANULARITY, value).

+*/

+mspace create_mspace(size_t capacity, int locked);

+

+/*

+  destroy_mspace destroys the given space, and attempts to return all

+  of its memory back to the system, returning the total number of

+  bytes freed. After destruction, the results of access to all memory

+  used by the space become undefined.

+*/

+size_t destroy_mspace(mspace msp);

+

+/*

+  create_mspace_with_base uses the memory supplied as the initial base

+  of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this

+  space is used for bookkeeping, so the capacity must be at least this

+  large. (Otherwise 0 is returned.) When this initial space is

+  exhausted, additional memory will be obtained from the system.

+  Destroying this space will deallocate all additionally allocated

+  space (if possible) but not the initial base.

+*/

+mspace create_mspace_with_base(void* base, size_t capacity, int locked);

+

+/*

+  mspace_malloc behaves as malloc, but operates within

+  the given space.

+*/

+void* mspace_malloc(mspace msp, size_t bytes);

+

+/*

+  mspace_free behaves as free, but operates within

+  the given space.

+

+  If compiled with FOOTERS==1, mspace_free is not actually needed.

+  free may be called instead of mspace_free because freed chunks from

+  any space are handled by their originating spaces.

+*/

+void mspace_free(mspace msp, void* mem);

+

+/*

+  mspace_realloc behaves as realloc, but operates within

+  the given space.

+

+  If compiled with FOOTERS==1, mspace_realloc is not actually

+  needed.  realloc may be called instead of mspace_realloc because

+  realloced chunks from any space are handled by their originating

+  spaces.

+*/

+void* mspace_realloc(mspace msp, void* mem, size_t newsize);

+

+/*

+  mspace_calloc behaves as calloc, but operates within

+  the given space.

+*/

+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);

+

+/*

+  mspace_memalign behaves as memalign, but operates within

+  the given space.

+*/

+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);

+

+/*

+  mspace_independent_calloc behaves as independent_calloc, but

+  operates within the given space.

+*/

+void** mspace_independent_calloc(mspace msp, size_t n_elements,

+                                 size_t elem_size, void* chunks[]);

+

+/*

+  mspace_independent_comalloc behaves as independent_comalloc, but

+  operates within the given space.

+*/

+void** mspace_independent_comalloc(mspace msp, size_t n_elements,

+                                   size_t sizes[], void* chunks[]);

+

+/*

+  mspace_footprint() returns the number of bytes obtained from the

+  system for this space.

+*/

+size_t mspace_footprint(mspace msp);

+

+/*

+  mspace_max_footprint() returns the peak number of bytes obtained from the

+  system for this space.

+*/

+size_t mspace_max_footprint(mspace msp);

+

+

+#if !NO_MALLINFO

+/*

+  mspace_mallinfo behaves as mallinfo, but reports properties of

+  the given space.

+*/

+struct mallinfo mspace_mallinfo(mspace msp);

+#endif /* NO_MALLINFO */

+

+/*

+  mspace_malloc_stats behaves as malloc_stats, but reports

+  properties of the given space.

+*/

+void mspace_malloc_stats(mspace msp);

+

+/*

+  mspace_trim behaves as malloc_trim, but

+  operates within the given space.

+*/

+int mspace_trim(mspace msp, size_t pad);

+

+/*

+  An alias for mallopt.

+*/

+int mspace_mallopt(int, int);

+

+#endif /* MSPACES */

+

+#ifdef __cplusplus

+};  /* end of extern "C" */

+#endif /* __cplusplus */

+

+#endif /* DLMALLOC_H */

diff --git a/lib/dyncalls.nim b/lib/dyncalls.nim
new file mode 100755
index 000000000..78c3fa115
--- /dev/null
+++ b/lib/dyncalls.nim
@@ -0,0 +1,143 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+#
+# This file implements the ability to call native procs from libraries.
+# It is not possible to do this in a platform independant way, unfortunately.
+# However, the interface has been designed to take platform differences into
+# account and been ported to all major platforms.
+#
+# interface
+
+type
+  EInvalidLibrary = object of EOS
+
+when defined(windows) or defined(dos):
+  {.define: USE_DLL.}
+elif defined(posix):
+  {.define: USE_DLOPEN.}
+elif defined(mac):
+  {.define: USE_DYLD.}
+
+type
+  TLibHandle = pointer       # private type
+  TProcAddr = pointer        # libary loading and loading of procs:
+
+const
+  NilLibHandle: TLibHandle = nil
+
+proc nimLoadLibrary(path: string): TLibHandle {.compilerproc.}
+proc nimUnloadLibrary(lib: TLibHandle) {.compilerproc.}
+proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr {.compilerproc.}
+
+#implementation
+
+# this code was inspired from Lua's source code:
+# Lua - An Extensible Extension Language
+# Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
+# http://www.lua.org
+# mailto:info@lua.org
+
+when defined(USE_DLOPEN):
+  #
+  # =========================================================================
+  # This is an implementation based on the dlfcn interface.
+  # The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD,
+  # NetBSD, AIX 4.2, HPUX 11, and probably most other Unix flavors, at least
+  # as an emulation layer on top of native functions.
+  # =========================================================================
+  #
+
+  # c stuff:
+  var
+    RTLD_NOW {.importc: "RTLD_NOW", header: "<dlfcn.h>".}: int
+
+  proc dlclose(lib: TLibHandle) {.importc, header: "<dlfcn.h>".}
+  proc dlopen(path: CString, mode: int): TLibHandle {.
+      importc, header: "<dlfcn.h>".}
+  proc dlsym(lib: TLibHandle, name: cstring): TProcAddr {.
+      importc, header: "<dlfcn.h>".}
+
+  proc nimUnloadLibrary(lib: TLibHandle) =
+    dlclose(lib)
+
+  proc nimLoadLibrary(path: string): TLibHandle =
+    result = dlopen(path, RTLD_NOW)
+    if result == nil:
+      raise newException(EInvalidLibrary, "could not load: " & path)
+
+  proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr =
+    result = dlsym(lib, name)
+
+elif defined(USE_DLL):
+  #
+  # =======================================================================
+  # Native Windows Implementation
+  # =======================================================================
+  #
+  type
+    THINSTANCE {.importc: "HINSTANCE".} = pointer
+
+  proc FreeLibrary(lib: THINSTANCE) {.importc, header: "<windows.h>", stdcall.}
+  proc winLoadLibrary(path: cstring): THINSTANCE {.
+      importc: "LoadLibraryA", header: "<windows.h>", stdcall.}
+  proc GetProcAddress(lib: THINSTANCE, name: cstring): TProcAddr {.
+      importc: "GetProcAddress", header: "<windows.h>", stdcall.}
+
+  proc nimUnloadLibrary(lib: TLibHandle) =
+    FreeLibrary(cast[THINSTANCE](lib))
+
+  proc nimLoadLibrary(path: string): TLibHandle =
+    result = cast[TLibHandle](winLoadLibrary(path))
+    if result == nil: 
+      raise newException(EInvalidLibrary, "could not load: " & path)
+
+  proc nimGetProcAddr(lib: TLibHandle, name: cstring): TProcAddr =
+    result = GetProcAddress(cast[THINSTANCE](lib), name)
+
+elif defined(USE_DYLD):
+  #
+  # =======================================================================
+  # Native Mac OS X / Darwin Implementation
+  # =======================================================================
+  #
+  {.error: "no implementation for dyncalls yet".}
+
+  proc nimUnloadLibrary(lib: TLibHandle) =
+    NSUnLinkModule(NSModule(lib), NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES)
+
+  var
+    dyld_present {.importc: "_dyld_present", header: "<dyld.h>".}: int
+
+  proc nimLoadLibrary(path: string): TLibHandle =
+    var
+      img: NSObjectFileImage
+      ret: NSObjectFileImageReturnCode
+      modul: NSModule
+    # this would be a rare case, but prevents crashing if it happens
+    result = nil
+    if dyld_present != 0:
+      ret = NSCreateObjectFileImageFromFile(path, addr(img))
+      if ret == NSObjectFileImageSuccess:
+        modul = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE or
+                                        NSLINKMODULE_OPTION_RETURN_ON_ERROR)
+        NSDestroyObjectFileImage(img)
+        result = TLibHandle(modul)
+        if result == nil:
+          raise newException(EInvalidLibrary, "could not load: " & path)
+
+  proc nimGetProcAddr(lib: TLibHandle, cname: string): TProcAddr =
+    var
+      nss: NSSymbol
+    nss = NSLookupSymbolInModule(NSModule(lib), name)
+    result = TProcAddr(NSAddressOfSymbol(nss))
+
+else: # workaround a newly introduced bug :-(
+  {.error: "no implementation for dyncalls".}
diff --git a/lib/excpt.nim b/lib/excpt.nim
new file mode 100755
index 000000000..ae057cc97
--- /dev/null
+++ b/lib/excpt.nim
@@ -0,0 +1,251 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+# Exception handling code. This is difficult because it has
+# to work if there is no more memory. Thus we have to use
+# a static string. Do not use ``sprintf``, etc. as they are
+# unsafe!
+
+when not defined(windows) or not defined(guiapp):
+  proc writeToStdErr(msg: CString) = write(stdout, msg)
+
+else:
+  proc MessageBoxA(hWnd: cint, lpText, lpCaption: cstring, uType: int): int32 {.
+    header: "<windows.h>", nodecl.}
+
+  proc writeToStdErr(msg: CString) =
+    discard MessageBoxA(0, msg, nil, 0)
+
+proc raiseException(e: ref E_Base, ename: CString) {.compilerproc.}
+proc reraiseException() {.compilerproc.}
+
+proc registerSignalHandler() {.compilerproc.}
+
+proc chckIndx(i, a, b: int): int {.inline, compilerproc.}
+proc chckRange(i, a, b: int): int {.inline, compilerproc.}
+proc chckRangeF(x, a, b: float): float {.inline, compilerproc.}
+proc chckNil(p: pointer) {.inline, compilerproc.}
+
+type
+  PSafePoint = ptr TSafePoint
+  TSafePoint {.compilerproc.} = record
+    prev: PSafePoint # points to next safe point ON THE STACK
+    exc: ref E_Base
+    status: int
+    context: C_JmpBuf
+
+var
+  excHandler {.compilerproc, volatile.}: PSafePoint = nil
+    # list of exception handlers
+    # a global variable for the root of all try blocks
+
+proc reraiseException() =
+  if excHandler != nil:
+    raise newException(ENoExceptionToReraise, "no exception to reraise")
+  else:
+    c_longjmp(excHandler.context, 1)
+
+type
+  PFrame = ptr TFrame
+  TFrame {.importc, nodecl.} = record
+    prev: PFrame
+    procname: CString
+    line: int # current line number
+    filename: CString
+    len: int  # length of slots (when not debugging always zero)
+
+  TTempFrame = record # used for recursion elimination in WriteStackTrace
+    procname: CString
+    line: int
+
+var
+  buf: string       # cannot be allocated on the stack!
+  assertBuf: string # we need a different buffer for
+                    # assert, as it raises an exception and
+                    # exception handler needs the buffer too
+
+  framePtr {.exportc, volatile.}: PFrame
+
+  tempFrames: array [0..255, TTempFrame] # cannot be allocated
+                                         # on the stack!
+
+proc auxWriteStackTrace(f: PFrame, s: var string) =
+  var
+    it = f
+    i = 0
+    total = 0
+  while it != nil and i <= high(tempFrames):
+    tempFrames[i].procname = it.procname
+    tempFrames[i].line = it.line
+    inc(i)
+    inc(total)
+    it = it.prev
+  while it != nil:
+    inc(total)
+    it = it.prev
+  # if the buffer overflowed print '...':
+  if total != i:
+    add(s, "(")
+    add(s, $(total-i))
+    add(s, " calls omitted) ...\n")
+  for j in countdown(i-1, 0):
+    add(s, $tempFrames[j].procname)
+    if tempFrames[j].line > 0:
+      add(s, ", line: ")
+      add(s, $tempFrames[j].line)
+    add(s, "\n")
+
+proc rawWriteStackTrace(s: var string) =
+  if framePtr == nil:
+    add(s, "No stack traceback available\n")
+  else:
+    add(s, "Traceback (most recent call last)\n")
+    auxWriteStackTrace(framePtr, s)
+
+proc quitOrDebug() {.inline.} =
+  when not defined(emdb):
+    quit(1)
+  else:
+    emdbStep() # call the debugger
+
+proc raiseException(e: ref E_Base, ename: CString) =
+  GC_disable() # a bad thing is an error in the GC while raising an exception
+  e.name = ename
+  if excHandler != nil:
+    excHandler.exc = e
+    c_longjmp(excHandler.context, 1)
+  else:
+    if cast[pointer](buf) != nil:
+      setLen(buf, 0)
+      rawWriteStackTrace(buf)
+      if e.msg != nil and e.msg[0] != '\0':
+        add(buf, "Error: unhandled exception: ")
+        add(buf, $e.msg)
+      else:
+        add(buf, "Error: unhandled exception")
+      add(buf, " [")
+      add(buf, $ename)
+      add(buf, "]\n")
+      writeToStdErr(buf)
+    else:
+      writeToStdErr("*** FATAL ERROR *** ")
+      writeToStdErr(ename)
+      writeToStdErr("\n")
+    quitOrDebug()
+  GC_enable()
+
+var
+  gAssertionFailed: ref EAssertionFailed
+
+proc internalAssert(file: cstring, line: int, cond: bool) {.compilerproc.} =
+  if not cond:
+    GC_disable() # BUGFIX: `$` allocates a new string object!
+    if cast[pointer](assertBuf) != nil: # BUGFIX: when debugging the GC, assertBuf may be nil
+      setLen(assertBuf, 0)
+      add(assertBuf, "[Assertion failure] file: ")
+      add(assertBuf, file)
+      add(assertBuf, " line: ")
+      add(assertBuf, $line)
+      add(assertBuf, "\n")
+      gAssertionFailed.msg = assertBuf
+    GC_enable()
+    raise gAssertionFailed # newException(EAssertionFailed, assertBuf)
+
+proc WriteStackTrace() =
+  var
+    s: string = ""
+  rawWriteStackTrace(s)
+  writeToStdErr(s)
+
+var
+  dbgAborting: bool # whether the debugger wants to abort
+
+proc signalHandler(sig: cint) {.exportc: "signalHandler", noconv.} =
+  # print stack trace and quit
+  var
+    s = int(sig)
+  setLen(buf, 0)
+  rawWriteStackTrace(buf)
+
+  if s == SIGINT: add(buf, "SIGINT: Interrupted by Ctrl-C.\n")
+  elif s == SIGSEGV: add(buf, "SIGSEGV: Illegal storage access.\n")
+  elif s == SIGABRT:
+    if dbgAborting: return # the debugger wants to abort
+    add(buf, "SIGABRT: Abnormal termination.\n")
+  elif s == SIGFPE: add(buf, "SIGFPE: Arithmetic error.\n")
+  elif s == SIGILL: add(buf, "SIGILL: Illegal operation.\n")
+  elif s == SIGBUS: add(buf, "SIGBUS: Illegal storage access.\n")
+  else: add(buf, "unknown signal\n")
+  writeToStdErr(buf)
+  dbgAborting = True # play safe here...
+  quit(1) # always quit when SIGABRT
+
+proc registerSignalHandler() =
+  c_signal(SIGINT, signalHandler)
+  c_signal(SIGSEGV, signalHandler)
+  c_signal(SIGABRT, signalHandler)
+  c_signal(SIGFPE, signalHandler)
+  c_signal(SIGILL, signalHandler)
+  c_signal(SIGBUS, signalHandler)
+
+registerSignalHandler() # call it in initialization section 
+# for easier debugging of the GC, this memory is only allocated after the 
+# signal handlers have been registered
+new(gAssertionFailed)
+buf = newString(2048)
+assertBuf = newString(2048)
+setLen(buf, 0)
+setLen(assertBuf, 0)
+
+proc raiseRangeError() {.compilerproc, noreturn.} =
+  raise newException(EOutOfRange, "value out of range")
+
+proc raiseIndexError() {.compilerproc, noreturn.} =
+  raise newException(EInvalidIndex, "index out of bounds")
+
+proc chckIndx(i, a, b: int): int =
+  if i >= a and i <= b:
+    return i
+  else:
+    raiseIndexError()
+
+proc chckRange(i, a, b: int): int =
+  if i >= a and i <= b:
+    return i
+  else:
+    raiseRangeError()
+
+proc chckRange64(i, a, b: int64): int64 {.compilerproc.} =
+  if i >= a and i <= b:
+    return i
+  else:
+    raiseRangeError()
+
+proc chckRangeF(x, a, b: float): float =
+  if x >= a and x <= b:
+    return x
+  else:
+    raiseRangeError()
+
+proc chckNil(p: pointer) =
+  if p == nil: c_raise(SIGSEGV)
+
+proc chckObj(obj, subclass: PNimType) {.compilerproc.} =
+  # checks if obj is of type subclass:
+  var x = obj
+  if x == subclass: return # optimized fast path
+  while x != subclass:
+    if x == nil:
+      raise newException(EInvalidObjectConversion, "invalid object conversion")
+    x = x.base
+
+proc chckObjAsgn(a, b: PNimType) {.compilerproc, inline.} =
+  if a != b:
+    raise newException(EInvalidObjectAssignment, "invalid object assignment")
diff --git a/lib/gc.nim b/lib/gc.nim
new file mode 100755
index 000000000..570c484e6
--- /dev/null
+++ b/lib/gc.nim
@@ -0,0 +1,897 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+#            Garbage Collector
+
+# For a description of the algorithms used here see:
+# intern.html
+
+#{.define: debugGC.}   # we wish to debug the GC...
+
+#when defined(debugGC):
+#  {.define: logGC.} # define if the GC should log some of its activities
+
+{.define: cycleGC.}
+
+# Guess the page size of the system; if it is the
+# wrong value, performance may be worse (this is not
+# for sure though), but GC still works; must be a power of two!
+const
+  PageSize = 1024 * sizeof(int)
+  RC_Increase = 7 * PageSize # is an additive increase
+  CycleIncrease = 2 # is a multiplicative increase
+
+when defined(debugGC):
+  const InitialThreshold = 64*1024
+  const stressGC = True    # GC is debugged; no need to stress it
+else:
+  const stressGC = False
+  const InitialThreshold = RC_Increase
+  # this may need benchmarking...
+
+# things the System module thinks should be available:
+when defined(useDL) or defined(nativeDL):
+  type
+    TMallocInfo {.importc: "struct mallinfo", nodecl.} = record
+      arena: cint    # non-mmapped space allocated from system
+      ordblks: cint  # number of free chunks
+      smblks: cint   # number of fastbin blocks
+      hblks: cint    # number of mmapped regions
+      hblkhd: cint   # space in mmapped regions
+      usmblks: cint  # maximum total allocated space
+      fsmblks: cint  # space available in freed fastbin blocks
+      uordblks: cint # total allocated space
+      fordblks: cint # total free space
+      keepcost: cint # top-most, releasable (via malloc_trim) space
+
+when defined(useDL):
+  proc mallinfo: TMallocInfo {.importc: "dlmallinfo", nodecl.}
+elif defined(nativeDL):
+  proc mallinfo: TMallocInfo {.importc: "mallinfo", nodecl.}
+
+when defined(useDL) or defined(nativeDL):
+  proc getOccupiedMem(): int = return mallinfo().uordblks
+  proc getFreeMem(): int = return mallinfo().fordblks
+  proc getTotalMem(): int =
+    var m = mallinfo()
+    return int(m.hblkhd) + int(m.arena)
+else: # not available:
+  proc getOccupiedMem(): int = return -1
+  proc getFreeMem(): int = return -1
+  proc getTotalMem(): int = return -1
+
+var
+  rcThreshold: int = InitialThreshold
+  cycleThreshold: int = InitialThreshold
+
+  memUsed: int = 0 # we have to keep track how much we have allocated
+
+  recGcLock: int = 0
+    # we use a lock to prevend the garbage collector to
+    # be triggered in a finalizer; the collector should not call
+    # itself this way! Thus every object allocated by a finalizer
+    # will not trigger a garbage collection. This is wasteful but safe.
+    # This is a lock against recursive garbage collection, not a lock for
+    # threads!
+
+when defined(useDL) and not defined(nativeDL):
+  {.compile: "dlmalloc.c".}
+
+type
+  TFinalizer {.compilerproc.} = proc (self: pointer)
+    # A ref type can have a finalizer that is called before the object's
+    # storage is freed.
+  PPointer = ptr pointer
+
+proc asgnRef(dest: ppointer, src: pointer) {.compilerproc.}
+proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc.}
+  # unsureAsgnRef updates the reference counters only if dest is not on the
+  # stack. It is used by the code generator if it cannot decide wether a
+  # reference is in the stack or not (this can happen for out/var parameters).
+proc growObj(old: pointer, newsize: int): pointer {.compilerproc.}
+proc newObj(typ: PNimType, size: int): pointer {.compilerproc.}
+proc newSeq(typ: PNimType, len: int): pointer {.compilerproc.}
+
+# implementation:
+
+when defined(useDL):
+  proc nimSize(p: pointer): int {.
+    importc: "dlmalloc_usable_size", header: "dlmalloc.h".}
+elif defined(nativeDL):
+  proc nimSize(p: pointer): int {.
+    importc: "malloc_usable_size", header: "<malloc.h>".}
+
+type
+  TWalkOp = enum
+    waNone, waRelease, waZctDecRef, waCycleDecRef, waCycleIncRef, waDebugIncRef
+
+  TCollectorData = int
+  TCell = record
+    refcount: TCollectorData  # the refcount and bit flags
+    typ: PNimType
+    stackcount: int           # stack counter for debugging
+    drefc: int                # real reference counter for debugging
+
+  PCell = ptr TCell
+
+var
+  gOutOfMem: ref EOutOfMemory
+
+proc raiseOutOfMem() {.noreturn.} =
+  if gOutOfMem == nil:
+    writeToStdErr("out of memory; cannot even throw an exception")
+    quit(1)
+  gOutOfMem.msg = "out of memory"
+  raise gOutOfMem
+
+proc cellToUsr(cell: PCell): pointer {.inline.} =
+  # convert object (=pointer to refcount) to pointer to userdata
+  result = cast[pointer](cast[TAddress](cell)+%TAddress(sizeof(TCell)))
+
+proc usrToCell(usr: pointer): PCell {.inline.} =
+  # convert pointer to userdata to object (=pointer to refcount)
+  result = cast[PCell](cast[TAddress](usr)-%TAddress(sizeof(TCell)))
+
+proc extGetCellType(c: pointer): PNimType {.compilerproc.} =
+  # used for code generation concerning debugging
+  result = usrToCell(c).typ
+
+proc internRefcount(p: pointer): int {.exportc: "getRefcount".} =
+  result = int(usrToCell(p).refcount)
+
+proc gcAlloc(size: int): pointer =
+  result = alloc0(size)
+  if result == nil: raiseOutOfMem()
+
+proc GC_disable() = inc(recGcLock)
+proc GC_enable() =
+  if recGcLock > 0: dec(recGcLock)
+
+proc GC_setStrategy(strategy: TGC_Strategy) =
+  case strategy
+  of gcThroughput: nil
+  of gcResponsiveness: nil
+  of gcOptimizeSpace: nil
+  of gcOptimizeTime: nil
+
+proc GC_enableMarkAndSweep() =
+  cycleThreshold = InitialThreshold
+
+proc GC_disableMarkAndSweep() =
+  cycleThreshold = high(cycleThreshold)-1
+  # set to the max value to suppress the cycle detector
+
+proc nextTry(h, maxHash: int): int {.inline.} =
+  result = ((5*h) + 1) and maxHash
+  # For any initial h in range(maxHash), repeating that maxHash times
+  # generates each int in range(maxHash) exactly once (see any text on
+  # random-number generation for proof).
+
+# ------------------ Zero count table (ZCT) and any table (AT) -------------
+
+# these values are for DL-malloc known for sure (and other allocators
+# can only be worse):
+when defined(useDL) or not defined(bcc):
+  const MemAlignment = 8 # minimal memory block that can be allocated
+else:
+  const MemAlignment = 4 # Borland's memory manager is terrible!
+
+const
+  BitsPerUnit = sizeof(int)*8
+    # a "unit" is a word, i.e. 4 bytes
+    # on a 32 bit system; I do not use the term "word" because under 32-bit
+    # Windows it is sometimes only 16 bits
+
+  BitsPerPage = PageSize div MemAlignment
+  UnitsPerPage = BitsPerPage div BitsPerUnit
+    # how many units do we need to describe a page:
+    # on 32 bit systems this is only 16 (!)
+
+# this that has to equals zero, otherwise we have to round up UnitsPerPage:
+when BitsPerPage mod BitsPerUnit != 0:
+  {.error: "(BitsPerPage mod BitsPerUnit) should be zero!".}
+
+# ------------------- cell set handling ------------------------------
+# A cellset consists of a hash table of page descriptors. A page
+# descriptor has a bit for
+# every Memalignment'th byte in the page.
+# However, only bits corresponding to addresses that start memory blocks
+# are set.
+# Page descriptors are also linked to a list; the list
+# is used for easy traversing of all page descriptors; this allows a
+# fast iterator.
+# We use a specialized hashing scheme; the formula is :
+# hash = Page bitand max
+# We use linear probing with the formular: (5*h)+1
+# Thus we likely get no collisions at all if the pages are given us
+# sequentially by the operating system!
+type
+  PPageDesc = ptr TPageDesc
+
+  TBitIndex = range[0..UnitsPerPage-1]
+
+  TPageDesc = record
+    next: PPageDesc # all nodes are connected with this pointer
+    key: TAddress   # start address at bit 0
+    bits: array[TBitIndex, int] # a bit vector
+
+  PPageDescArray = ptr array[0..1000_000, PPageDesc]
+  TCellSet = record
+    counter, max: int
+    head: PPageDesc
+    data: PPageDescArray
+
+const
+  InitCellSetSize = 1024 # must be a power of two!
+
+proc CellSetInit(s: var TCellSet) =
+  s.data = cast[PPageDescArray](gcAlloc(InitCellSetSize * sizeof(PPageDesc)))
+  s.max = InitCellSetSize-1
+  s.counter = 0
+  s.head = nil
+
+proc CellSetDeinit(s: var TCellSet) =
+  var it = s.head
+  while it != nil:
+    var n = it.next
+    dealloc(it)
+    it = n
+  s.head = nil # play it safe here
+  dealloc(s.data)
+  s.data = nil
+  s.counter = 0
+
+proc CellSetGet(t: TCellSet, key: TAddress): PPageDesc =
+  var h = cast[int](key) and t.max
+  while t.data[h] != nil:
+    if t.data[h].key == key: return t.data[h]
+    h = nextTry(h, t.max)
+  return nil
+
+proc CellSetRawInsert(t: TCellSet, data: PPageDescArray,
+                      desc: PPageDesc) =
+  var h = cast[int](desc.key) and t.max
+  while data[h] != nil:
+    assert(data[h] != desc)
+    h = nextTry(h, t.max)
+  assert(data[h] == nil)
+  data[h] = desc
+
+proc CellSetEnlarge(t: var TCellSet) =
+  var
+    n: PPageDescArray
+    oldMax = t.max
+  t.max = ((t.max+1)*2)-1
+  n = cast[PPageDescArray](gcAlloc((t.max + 1) * sizeof(PPageDesc)))
+  for i in 0 .. oldmax:
+    if t.data[i] != nil:
+      CellSetRawInsert(t, n, t.data[i])
+  dealloc(t.data)
+  t.data = n
+
+proc CellSetPut(t: var TCellSet, key: TAddress): PPageDesc =
+  var h = cast[int](key) and t.max
+  while true:
+    var x = t.data[h]
+    if x == nil: break
+    if x.key == key: return x
+    h = nextTry(h, t.max)
+
+  if (t.max+1) * 2 < t.counter * 3: CellSetEnlarge(t)
+  inc(t.counter)
+  h = cast[int](key) and t.max
+  while t.data[h] != nil: h = nextTry(h, t.max)
+  assert(t.data[h] == nil)
+  # the new page descriptor goes into result
+  result = cast[PPageDesc](gcAlloc(sizeof(TPageDesc)))
+  result.next = t.head
+  result.key = key
+  t.head = result
+  t.data[h] = result
+
+# ---------- slightly higher level procs ----------------------------------
+
+proc in_Operator(s: TCellSet, cell: PCell): bool =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetGet(s, u /% PageSize)
+  if t != nil:
+    u = (u %% PageSize) /% MemAlignment
+    result = (t.bits[u /% BitsPerUnit] and (1 shl (u %% BitsPerUnit))) != 0
+  else:
+    result = false
+
+proc incl(s: var TCellSet, cell: PCell) =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetPut(s, u /% PageSize)
+  u = (u %% PageSize) /% MemAlignment
+  t.bits[u /% BitsPerUnit] = t.bits[u /% BitsPerUnit] or
+    (1 shl (u %% BitsPerUnit))
+
+proc excl(s: var TCellSet, cell: PCell) =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetGet(s, u /% PageSize)
+  if t != nil:
+    u = (u %% PageSize) /% MemAlignment
+    t.bits[u /% BitsPerUnit] = (t.bits[u /% BitsPerUnit] and
+                                  not (1 shl (u %% BitsPerUnit)))
+
+iterator elements(t: TCellSet): PCell {.inline.} =
+  # while traversing it is forbidden to add pointers to the tree!
+  var r = t.head
+  while r != nil:
+    var i = 0
+    while i <= high(r.bits):
+      var w = r.bits[i] # taking a copy of r.bits[i] here is correct, because
+      # modifying operations are not allowed during traversation
+      var j = 0
+      while w != 0:         # test all remaining bits for zero
+        if (w and 1) != 0:  # the bit is set!
+          yield cast[PCell]((r.key *% PageSize) +%
+                              (i*%BitsPerUnit+%j) *% MemAlignment)
+        inc(j)
+        w = w shr 1
+      inc(i)
+    r = r.next
+
+# --------------- end of Cellset routines -------------------------------------
+
+proc testPageDescs() =
+  var root: TCellSet
+  CellSetInit(root)
+  var u = 10_000
+  while u <= 20_000:
+    incl(root, cast[PCell](u))
+    inc(u, 8)
+  for cell in elements(root):
+    c_fprintf(c_stdout, "%ld\n", cast[int](cell))
+
+# testPageDescs()
+
+when defined(debugGC):
+  proc writeCell(msg: CString, c: PCell) =
+    c_fprintf(c_stdout, "%s: %p\n", msg, c)
+  proc writePtr(msg: CString, p: Pointer) =
+    c_fprintf(c_stdout, "%s: %p\n", msg, p)
+
+# -------------------------------------------------------------------------
+
+type
+  PStackCells = ptr array[0..1000_0000, PCell]
+  TCountTables = record     # this contains the zero count and
+                            # non-zero count table
+    mask: TAddress          # mask for fast pointer detection
+    zct: TCellSet           # the zero count table
+    at: TCellSet            # a table that contains all references
+    newAT: TCellSet
+    newZCT: TCellSet
+    stackCells: PStackCells # cells that need to be decremented because they
+                            # are in the hardware stack; a cell may occur
+                            # several times in this data structure
+    stackLen, stackMax: int # for managing the stack cells
+
+proc addStackCell(ct: var TCountTables, cell: PCell) =
+  if ct.stackLen >= ct.stackMax:
+    ct.stackMax = ct.stackMax * 3 div 2
+    ct.stackCells = cast[PStackCells](realloc(ct.stackCells, ct.stackMax *
+                                      sizeof(PCell)))
+    if ct.stackCells == nil: raiseOutOfMem()
+  ct.stackCells[ct.stackLen] = cell
+  inc(ct.stackLen)
+
+var
+  stackBottom: pointer
+  ct: TCountTables
+
+proc GC_invariant(): bool =
+  result = True
+  when stressGC:
+    if recGcLock == 0:
+      GC_disable()
+      for cell in elements(ct.at):
+        var t = cell.typ # getCellType(cell)
+        if t == nil or t.kind notin {tySequence, tyString, tyRef}:
+          writeCell("corrupt cell?", cell)
+          result = false
+      GC_enable()
+
+when stressGC:
+  proc GCdebugHook() =
+    if not GC_invariant():
+      assert(false)
+
+  dbgLineHook = GCdebugHook
+
+proc prepareDealloc(cell: PCell) =
+  if cell.typ.finalizer != nil:
+    # the finalizer could invoke something that
+    # allocates memory; this could trigger a garbage
+    # collection. Since we are already collecting we
+    # prevend recursive entering here by a lock.
+    # XXX: we should set the cell's children to nil!
+    inc(recGcLock)
+    (cast[TFinalizer](cell.typ.finalizer))(cellToUsr(cell))
+    dec(recGcLock)
+
+  when defined(nimSize):
+    memUsed = memUsed - nimSize(cell)
+  else:
+    memUsed = memUsed - cell.typ.size
+
+proc setStackBottom(theStackBottom: pointer) {.compilerproc.} =
+  stackBottom = theStackBottom
+
+proc initGC() =
+  # init the rt
+  CellSetInit(ct.zct)
+  CellSetInit(ct.at)
+  ct.stackLen = 0
+  ct.stackMax = 255
+  ct.stackCells = cast[PStackCells](gcAlloc((ct.stackMax+1) * sizeof(PCell)))
+  ct.mask = 0
+  new(gOutOfMem) # reserve space for the EOutOfMemory exception here!
+  assert(GC_invariant())
+
+# forward declarations:
+proc collectCT(ct: var TCountTables)
+proc IsOnStack(p: pointer): bool
+proc forAllChildren(cell: PCell, op: TWalkOp)
+proc collectCycles()
+
+proc reprAny(p: pointer, typ: PNimType): string {.compilerproc.}
+# we need the prototype here for debugging purposes
+
+proc outputCell(c: PCell) =
+  inc(recGcLock)
+  write(stdout, reprAny(cellToUsr(c), c.typ))
+  dec(recGcLock)
+
+proc writeGraph() =
+  {.checkpoint.}
+  block:
+    inc(recGcLock)
+    for c in elements(ct.AT): outputCell(c)
+    dec(recGcLock)
+
+proc checkRefc(): bool =
+  if recGcLock >= 1: return true # prevent endless recursion
+  inc(recGcLock)
+  result = True
+  # set counters back to zero:
+  for c in elements(ct.AT):
+    c.drefc = 0
+  for c in elements(ct.AT):
+    forAllChildren(c, waDebugIncRef)
+  for c in elements(ct.AT):
+    if c.drefc > c.refcount - c.stackcount:
+      result = false # failed
+      c_fprintf(c_stdout,
+         "broken cell: %p, refc: %ld, stack: %ld, real: %ld\n",
+         c, c.refcount, c.stackcount, c.drefc)
+  dec(recGcLock)
+
+proc seqCheck(cell: PCell): bool =
+  assert(cell.typ != nil)
+  if cell.typ.kind in {tySequence, tyString}:
+    result = cell.refcount - cell.stackcount <= 1
+  else:
+    result = true
+
+proc decRef(cell: PCell) {.inline.} =
+  assert(cell in ct.AT)
+  when defined(debugGC):
+    if cell.refcount == 0:
+      writePtr("decref broken", cellToUsr(cell))
+  assert(cell.refcount > 0) # this should be the case!
+  assert(seqCheck(cell))
+  dec(cell.refcount)
+  if cell.refcount == 0:
+    incl(ct.zct, cell)
+
+proc incRef(cell: PCell) {.inline.} =
+  assert(seqCheck(cell))
+  inc(cell.refcount)
+
+proc asgnRef(dest: ppointer, src: pointer) =
+  # the code generator calls this proc!
+  assert(not isOnStack(dest))
+  # BUGFIX: first incRef then decRef!
+  if src != nil: incRef(usrToCell(src))
+  if dest^ != nil: decRef(usrToCell(dest^))
+  dest^ = src
+  #assert(checkRefc())
+
+proc unsureAsgnRef(dest: ppointer, src: pointer) =
+  if not IsOnStack(dest):
+    if src != nil: incRef(usrToCell(src))
+    if dest^ != nil: decRef(usrToCell(dest^))
+  dest^ = src
+  #assert(checkRefc())
+
+proc restore(cell: PCell) =
+  if cell notin ct.newAT:
+    incl(ct.newAT, Cell)
+    forAllChildren(cell, waCycleIncRef)
+
+proc doOperation(p: pointer, op: TWalkOp) =
+  if p == nil: return
+  var cell: PCell = usrToCell(p)
+  assert(cell != nil)
+  case op # faster than function pointers because of easy prediction
+  of waNone: assert(false)
+  of waRelease: decRef(cell) # DEAD CODE!
+  of waZctDecRef:
+    assert(cell.refcount > 0)
+    assert(seqCheck(cell))
+    dec(cell.refcount)
+    if cell.refcount == 0:
+      incl(ct.newZCT, cell)
+  of waCycleDecRef:
+    assert(cell.refcount != 0)
+    dec(cell.refcount)
+  of waCycleIncRef:
+    inc(cell.refcount) # restore proper reference counts!
+    restore(cell)
+  of waDebugIncRef:
+    inc(cell.drefc)
+
+type
+  TByteArray = array[0..1000_0000, byte]
+  PByte = ptr TByteArray
+  PString = ptr string
+
+proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp)
+
+proc getDiscriminant(aa: Pointer, n: ptr TNimNode): int =
+  assert(n.kind == nkCase)
+  var d: int32
+  var a = cast[TAddress](aa)
+  case n.typ.size
+  of 1: d = toU32(cast[ptr int8](a +% n.offset)^)
+  of 2: d = toU32(cast[ptr int16](a +% n.offset)^)
+  of 4: d = toU32(cast[ptr int32](a +% n.offset)^)
+  else: assert(false)
+  return int(d)
+
+proc selectBranch(aa: Pointer, n: ptr TNimNode): ptr TNimNode =
+  var discr = getDiscriminant(aa, n)
+  if discr <% n.len:
+    result = n.sons[discr]
+    if result == nil: result = n.sons[n.len]
+    # n.sons[n.len] contains the ``else`` part (but may be nil)
+  else:
+    result = n.sons[n.len]
+
+proc forAllSlotsAux(dest: pointer, n: ptr TNimNode, op: TWalkOp) =
+  var
+    d = cast[TAddress](dest)
+  case n.kind
+  of nkNone: assert(false)
+  of nkSlot: forAllChildrenAux(cast[pointer](d +% n.offset), n.typ, op)
+  of nkList:
+    for i in 0..n.len-1: forAllSlotsAux(dest, n.sons[i], op)
+  of nkCase:
+    var m = selectBranch(dest, n)
+    if m != nil: forAllSlotsAux(dest, m, op)
+
+proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) =
+  var
+    d = cast[TAddress](dest)
+  if dest == nil: return # nothing to do
+  case mt.Kind
+  of tyArray, tyArrayConstr, tyOpenArray:
+    for i in 0..(mt.size div mt.base.size)-1:
+      forAllChildrenAux(cast[pointer](d +% i *% mt.base.size), mt.base, op)
+  of tyRef, tyString, tySequence: # leaf:
+    doOperation(cast[ppointer](d)^, op)
+  of tyRecord, tyObject, tyTuple:
+    forAllSlotsAux(dest, mt.node, op)
+  else: nil
+
+proc forAllChildren(cell: PCell, op: TWalkOp) =
+  assert(cell != nil)
+  when defined(debugGC):
+    if cell.typ == nil:
+      writeCell("cell has no type descriptor", cell)
+  assert(cell.typ != nil)
+  case cell.typ.Kind
+  of tyRef: # common case
+    forAllChildrenAux(cellToUsr(cell), cell.typ.base, op)
+  of tySequence:
+    var d = cast[TAddress](cellToUsr(cell))
+    var s = cast[PGenericSeq](d)
+    if s != nil: # BUGFIX
+      for i in 0..s.len-1:
+        forAllChildrenAux(cast[pointer](d +% i *% cell.typ.base.size +%
+          GenericSeqSize), cell.typ.base, op)
+  of tyString: nil
+  else: assert(false)
+
+proc checkCollection() {.inline.} =
+  # checks if a collection should be done
+  if recGcLock == 0:
+    if memUsed >= rcThreshold or stressGC:
+      collectCT(ct)
+      when defined(debugGC):
+        write(stdout, "threshold is now: ")
+        writeln(stdout, rcThreshold)
+
+proc newObj(typ: PNimType, size: int): pointer =
+  # generates a new object and sets its reference counter to 0
+  var
+    res: PCell
+  assert(typ.kind in {tyRef, tyString, tySequence})
+  # check if we have to collect:
+  checkCollection()
+  res = cast[PCell](Alloc0(size + sizeof(TCell)))
+  if res == nil: raiseOutOfMem()
+  when defined(nimSize):
+    memUsed = memUsed + nimSize(res)
+  else:
+    memUsed = memUsed + size
+
+  res.refcount = 0
+  # now it is buffered in the ZCT
+  res.typ = typ
+  incl(ct.zct, res) # its refcount is zero, so add it to the ZCT
+  incl(ct.at, res)  # add it to the any table too
+  ct.mask = ct.mask or cast[TAddress](res)
+  when defined(debugGC):
+    writeCell("new cell", res)
+    assert(gcInvariant())
+  result = cellToUsr(res)
+
+proc newSeq(typ: PNimType, len: int): pointer =
+  # XXX: overflow checks!
+  result = newObj(typ, len * typ.base.size + GenericSeqSize)
+  cast[PGenericSeq](result).len = len
+  cast[PGenericSeq](result).space = len
+
+proc growObj(old: pointer, newsize: int): pointer =
+  var
+    res, ol: PCell
+  checkCollection()
+  ol = usrToCell(old)
+  assert(ol.typ.kind in {tyString, tySequence})
+  assert(seqCheck(ol))
+  when defined(nimSize):
+    memUsed = memUsed - nimSize(ol)
+  else:
+    memUsed = memUsed - ol.size # this is not exact
+  # pity that we don't know the old size
+  res = cast[PCell](realloc(ol, newsize + sizeof(TCell)))
+  when defined(nimSize):
+    memUsed = memUsed + nimSize(res)
+  else:
+    memUsed = memUsed + newsize
+
+  if res != ol:
+    if res == nil: raiseOutOfMem()
+    excl(ct.zct, ol) # remove old pointer in any case:
+    # It may have a refcount > 0 and is still in the ZCT.
+    # So do it safe here and remove it anyway.
+    excl(ct.at, ol)
+    if res.refcount == 0:
+      # store new pointer in ZCT, if refcount == 0:
+      incl(ct.zct, res)
+    incl(ct.at, res)
+    ct.mask = ct.mask or cast[TAddress](res)
+    when defined(debugGC):
+      writeCell("growObj old cell", ol)
+      writeCell("growObj new cell", res)
+  result = cellToUsr(res)
+  #assert(checkRefc())
+
+proc collectCycles() =
+  when defined(debugGC):
+    echo("collecting cycles!\n")
+
+  # step 1: pretend that any node is dead
+  for c in elements(ct.at):
+    forallChildren(c, waCycleDecRef)
+  CellSetInit(ct.newAt)
+  # step 2: restore life cells
+  for c in elements(ct.at):
+    if c.refcount > 0: restore(c)
+  # step 3: free dead cells:
+  for cell in elements(ct.at):
+    if cell.refcount == 0:
+      assert(cell notin ct.zct)
+      # We free an object that is part of a cycle here. Its children
+      # may have been freed already. Thus the finalizer could access
+      # garbage. To handle this case properly we need two passes for
+      # freeing here which is too expensive. We just don't call the
+      # finalizer for now. YYY: Any better ideas?
+      prepareDealloc(cell)
+      dealloc(cell)
+      when defined(debugGC):
+        writeCell("cycle collector dealloc cell", cell)
+  CellSetDeinit(ct.at)
+  ct.at = ct.newAt
+  #ct.newAt = nil
+
+proc gcMark(p: pointer) =
+  # the addresses are not as objects on the stack, so turn them to objects:
+  var cell = usrToCell(p)
+  var c = cast[TAddress](cell)
+  if ((c and ct.mask) == c) and cell in ct.at:
+    # is the page that p "points to" in the AT? (All allocated pages are
+    # always in the AT)
+    inc(cell.refcount)
+    inc(cell.stackcount)
+    addStackCell(ct, cell)
+
+proc unmarkStackAndRegisters() =
+  for i in 0 .. ct.stackLen-1:
+    var cell = ct.stackCells[i]
+    assert(cell.refcount > 0)
+    when defined(debugGC):
+      if cell.stackcount == 0:
+        writeGraph()
+        writePtr("broken stackcount", cellToUsr(cell))
+    assert(cell.stackcount > 0)
+    dec(cell.refcount)
+    dec(cell.stackcount)
+    if cell.refcount == 0:
+      incl(ct.zct, cell)
+  ct.stackLen = 0 # reset to zero
+
+# ----------------- stack management --------------------------------------
+#  inspired from Smart Eiffel (c)
+
+proc stackSize(): int =
+  var stackTop: array[0..1, pointer]
+  result = abs(cast[int](addr(stackTop[0])) - cast[int](stackBottom))
+
+when defined(sparc): # For SPARC architecture.
+
+  proc isOnStack(p: pointer): bool =
+    var
+      stackTop: array[0..1, pointer]
+    result = p >= addr(stackTop[0]) and p <= stackBottom
+
+  proc markStackAndRegisters() =
+    when defined(sparcv9):
+      asm  " flushw"
+    else:
+      asm  " ta      0x3   ! ST_FLUSH_WINDOWS"
+
+    var
+      max = stackBottom
+      sp: PPointer
+      stackTop: array[0..1, pointer]
+    stackTop[0] = nil
+    stackTop[1] = nil
+    sp = addr(stackTop[0])
+    # Addresses decrease as the stack grows.
+    while sp <= max:
+      gcMark(sp^)
+      sp = cast[ppointer](cast[TAddress](sp) +% sizeof(pointer))
+
+elif defined(ELATE):
+  {.error: "stack marking code has to be written for this architecture".}
+
+elif defined(hppa) or defined(hp9000) or defined(hp9000s300) or
+     defined(hp9000s700) or defined(hp9000s800) or defined(hp9000s820):
+  # ---------------------------------------------------------------------------
+  # Generic code for architectures where addresses increase as the stack grows.
+  # ---------------------------------------------------------------------------
+
+  proc isOnStack(p: pointer): bool =
+    var
+      stackTop: array[0..1, pointer]
+    result = p <= addr(stackTop[0]) and p >= stackBottom
+
+  var
+    jmpbufSize {.importc: "sizeof(jmp_buf)".}: int
+      # a little hack to get the size of a TJmpBuf in the generated C code
+      # in a platform independant way
+
+  proc markStackAndRegisters() =
+    var
+      max = stackBottom
+      registers: C_JmpBuf # The jmp_buf buffer is in the C stack.
+      sp: PPointer        # Used to traverse the stack and registers assuming
+                          # that `setjmp' will save registers in the C stack.
+    c_setjmp(registers)   # To fill the C stack with registers.
+    sp = cast[ppointer](cast[TAddress](addr(registers)) +%
+           jmpbufSize -% sizeof(pointer))
+    # sp will traverse the JMP_BUF as well (jmp_buf size is added,
+    # otherwise sp would be below the registers structure).
+    while sp >= max:
+      gcMark(sp^)
+      sp = cast[ppointer](cast[TAddress](sp) -% sizeof(pointer))
+
+else:
+  # ---------------------------------------------------------------------------
+  # Generic code for architectures where addresses decrease as the stack grows.
+  # ---------------------------------------------------------------------------
+  proc isOnStack(p: pointer): bool =
+    var
+      stackTop: array [0..1, pointer]
+    result = p >= addr(stackTop[0]) and p <= stackBottom
+
+  proc markStackAndRegisters() =
+    var
+      max = stackBottom
+      registers: C_JmpBuf # The jmp_buf buffer is in the C stack.
+      sp: PPointer        # Used to traverse the stack and registers assuming
+                          # that `setjmp' will save registers in the C stack.
+    c_setjmp(registers)   # To fill the C stack with registers.
+    sp = cast[ppointer](addr(registers))
+    while sp <= max:
+      gcMark(sp^)
+      sp = cast[ppointer](cast[TAddress](sp) +% sizeof(pointer))
+
+# ----------------------------------------------------------------------------
+# end of non-portable code
+# ----------------------------------------------------------------------------
+
+proc CollectZCT =
+  CellSetInit(ct.newZCT)
+  for c in elements(ct.zct):
+    if c.refcount == 0:
+      # if != 0 the reference count has been increased, so this does not
+      # belong to the ZCT. We simply do nothing - it won't appear in the newZCT
+      # anyway.
+      # We are about to free the object, call the finalizer BEFORE its
+      # children are deleted as well, because otherwise the finalizer may
+      # access invalid memory. This is done by prepareDealloc():
+      prepareDealloc(c)
+      forAllChildren(c, waZctDecRef)
+      assert(c.refcount == 0) # should still be zero
+      excl(ct.at, c)
+      excl(ct.newZCT, c) # BUGFIX
+      when defined(debugGC):
+        writeCell("zct dealloc cell", c)
+      dealloc(c)
+  CellSetDeinit(ct.zct)
+  ct.zct = ct.newZCT
+  #ct.newZCT = nil
+
+proc collectCT(ct: var TCountTables) =
+  when defined(debugGC):
+    c_fprintf(c_stdout, "collecting zero count table; stack size: %ld\n",
+              stackSize())
+  markStackAndRegisters()
+  assert(GC_invariant())
+  while True:
+    collectZCT()
+    if ct.zct.counter == 0: break
+    # ``counter`` counts the pages, but zero pages means zero cells
+
+  when defined(cycleGC):
+    # still over the cycle threshold?
+    if memUsed >= cycleThreshold or stressGC:
+      # collect the cyclic things:
+      assert(ct.zct.counter == 0)
+      assert(GC_invariant())
+      collectCycles()
+
+  # recompute the thresholds:
+  rcThreshold = (memUsed div RC_increase + 1) * RC_Increase
+  cycleThreshold = memUsed * cycleIncrease
+
+  assert(GC_invariant())
+  unmarkStackAndRegisters()
+
+proc GC_fullCollect() =
+  var oldThreshold = cycleThreshold
+  cycleThreshold = 0 # forces cycle collection
+  collectCT(ct)
+  cycleThreshold = oldThreshold
diff --git a/lib/hti.nim b/lib/hti.nim
new file mode 100755
index 000000000..8fc46cdd7
--- /dev/null
+++ b/lib/hti.nim
@@ -0,0 +1,51 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2008 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+type # This should be he same as ast.TTypeKind
+     # some enum fields are not used at runtime
+  TNimKind = enum
+    tyNone, tyBool, tyChar,
+    tyEmptySet, tyArrayConstr, tyNil, tyRecordConstr,
+    tyGeneric,
+    tyGenericInst,
+    tyGenericParam,
+    tyEnum, tyAnyEnum,
+    tyArray,
+    tyRecord,
+    tyObject,
+    tyTuple,
+    tySet,
+    tyRange,
+    tyPtr, tyRef,
+    tyVar,
+    tySequence,
+    tyProc,
+    tyPointer, tyOpenArray,
+    tyString, tyCString, tyForward,
+    tyInt, tyInt8, tyInt16, tyInt32, tyInt64,
+    tyFloat, tyFloat32, tyFloat64, tyFloat128
+
+  TNimNodeKind = enum nkNone, nkSlot, nkList, nkCase
+  TNimNode {.compilerproc.} = record
+    kind: TNimNodeKind
+    offset: int
+    typ: ptr TNimType
+    name: Cstring
+    len: int
+    sons: ptr array [0..0x7fff, ptr TNimNode]
+
+  TNimType {.compilerproc.} = record
+    size: int
+    kind: TNimKind
+    base: ptr TNimType
+    node: ptr TNimNode # valid for tyRecord, tyObject, tyTuple, tyEnum
+    finalizer: pointer # the finalizer for the type
+  PNimType = ptr TNimType
+  
+# node.len may be the ``first`` element of a set
diff --git a/lib/i386.asm.in b/lib/i386.asm.in
new file mode 100755
index 000000000..483dc2d95
--- /dev/null
+++ b/lib/i386.asm.in
@@ -0,0 +1,70 @@
+; This contains the CPU-dependant variants of some routines.

+; (C) 2005 Andreas Rumpf

+; This code was inspired by the Freepascal compiler's sources

+; All routines here have the _cdecl calling convention because

+; that is the only convention any C compiler supports.

+

+\python{

+# as usual I use my own preprocessor :-)

+import os

+

+def c(name): 

+  if os.name == 'posix':

+    return name

+  else:

+    return "_" + name

+}

+

+segment code

+

+global \c{cpu_inc_locked}

+global \c{cpu_dec_locked}

+global \c{cpu_lock}

+global \c{cpu_unlock}

+

+\c{cpu_dec_locked}:  

+          push ebp 

+          mov ebp,esp 

+          mov eax,[ebp+8] ; first parameter to function 

+          lock dec dword [eax]

+          setz      al

+          mov esp,ebp 

+          pop ebp 

+          ret

+

+\c{cpu_inc_locked}:

+          push ebp 

+          mov ebp,esp 

+          mov eax,[ebp+8] ; first parameter to function 

+          lock inc dword [eax]

+          mov esp,ebp 

+          pop ebp 

+          ret

+

+; This code uses the highest bit of the RC to indicate that the RC is

+; locked (spinlock).

+\c{cpu_lock}

+          push ebp 

+          mov ebp, esp 

+          mov eax, [ebp+8]     ; first parameter to function 

+          mov edx, [eax]       ; load RC

+          or  edx, 0x80000000  ; set highest bit

+     spin:

+          xchg [eax], edx      ; atomic instruction!

+          pause                ; wait a few cycles

+          and edx, 0x80000000  ; mask highest bit

+          jnz spin

+          mov esp, ebp

+          pop ebp

+          ret

+

+\c{cpu_unlock}

+          push ebp            

+          mov ebp, esp 

+          mov eax, [ebp+8]     ; first parameter to function 

+          mov edx, [eax]       ; load RC

+          and edx, 0x7FFFFFFF  ; unset highest bit

+          xchg [eax], edx      ; atomic instruction!

+          mov esp, ebp

+          pop ebp

+          ret

diff --git a/lib/int64s.nim b/lib/int64s.nim
new file mode 100755
index 000000000..bac6b9ccd
--- /dev/null
+++ b/lib/int64s.nim
@@ -0,0 +1,72 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+# 64 bit integers for platforms that don't have those

+

+type

+  IInt64 = record # "internal" int64

+    lo, hi: int32

+

+proc cmpI64(x, y: IInt64): int32 {.compilerproc.} =

+  result = x.hi -% y.hi

+  if result == 0: result = x.lo -% y.lo

+

+proc addI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result = x

+  result.lo = result.lo +% y.lo

+  result.hi = result.hi +% y.hi

+  if y.lo > 0 and result.lo < y.lo:

+    inc(result.hi)

+  elif y.lo < 0 and result.lo > y.lo:

+    dec(result.hi)

+

+proc subI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result = x

+  result.lo = result.lo -% y.lo

+  result.hi = result.hi -% y.hi

+  if y.lo > 0 and result.lo < y.lo:

+    inc(result.hi)

+  elif y.lo < 0 and result.lo > y.lo:

+    dec(result.hi)

+

+proc mulI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result.lo = x.lo *% y.lo

+  result.hi = y.hi *% y.hi

+  if y.lo > 0 and result.lo < y.lo:

+    inc(result.hi)

+  elif y.lo < 0 and result.lo > y.lo:

+    dec(result.hi)

+

+proc divI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  # XXX: to implement

+

+proc modI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  # XXX: to implement

+

+proc bitandI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result.hi = x.hi and y.hi

+  result.lo = x.lo and y.lo

+

+proc bitorI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result.hi = x.hi or y.hi

+  result.lo = x.lo or y.lo

+

+proc bitxorI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  result.hi = x.hi xor y.hi

+  result.lo = x.lo xor y.lo

+

+proc bitnotI64(x: IInt64): IInt64 {.compilerproc.} =

+  result.lo = not x.lo

+  result.hi = not x.hi

+

+proc shlI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  # XXX: to implement

+

+proc shrI64(x, y: IInt64): IInt64 {.compilerproc.} =

+  # XXX: to implement

diff --git a/lib/lgpl.txt b/lib/lgpl.txt
new file mode 100755
index 000000000..f6fa6c9e5
--- /dev/null
+++ b/lib/lgpl.txt
@@ -0,0 +1,502 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/lib/locks.nim b/lib/locks.nim
new file mode 100755
index 000000000..89d26dfca
--- /dev/null
+++ b/lib/locks.nim
@@ -0,0 +1,18 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2008 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+# Simple platform dependant lock implementation
+
+type
+  TSimpleLock = pointer
+
+proc initLock(s: TSimpleLock)
+proc deinitLock(s: TSimpleLock)
+proc lock(s: TSimpleLock)
+proc unlock(s: TSimpleLock)
diff --git a/lib/math.nim b/lib/math.nim
new file mode 100755
index 000000000..84cba9894
--- /dev/null
+++ b/lib/math.nim
@@ -0,0 +1,131 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+
+# math routines
+
+# interface
+
+{.push debugger:off .} # the user does not want to trace a part
+                       # of the standard library!
+
+{.push checks:off, line_dir:off, stack_trace:off.}
+
+proc nextPowerOfTwo*(x: int): int
+  ## returns the nearest power of two, so that
+  ## result**2 >= x > (result-1)**2.
+proc isPowerOfTwo*(x: int): bool {.noSideEffect.}
+  ## returns true, if x is a power of two, false otherwise.
+  ## Negative numbers are not a power of two.
+proc countBits*(n: int32): int {.noSideEffect.}
+  ## counts the set bits in `n`.
+
+proc random*(max: int): int
+  ## returns a random number in the range 0..max-1. The sequence of
+  ## random number is always the same, unless `randomize` is called
+  ## which initializes the random number generator with a "random"
+  ## number, i.e. a tickcount.
+proc randomize*()
+  ## initializes the random number generator with a "random"
+  ## number, i.e. a tickcount.
+
+proc sqrt*(x: float): float {.importc: "sqrt", header: "<math.h>".}
+  ## computes the square root of `x`.
+
+proc ln*(x: float): float {.importc: "log", header: "<math.h>".}
+  ## computes ln(x).
+proc exp*(x: float): float {.importc: "exp", header: "<math.h>".}
+  ## computes e**x.
+
+proc frexp*(x: float, exponent: var int): float {.
+  importc: "frexp", header: "<math.h>".}
+  ## Split a number into mantissa and exponent.
+  ## `frexp` calculates the mantissa m (a float greater than or equal to 0.5
+  ## and less than 1) and the integer value n such that `x` (the original
+  ## float value) equals m * 2**n. frexp stores n in `exponent` and returns
+  ## m.
+
+proc arccos*(x: float): float {.importc: "acos", header: "<math.h>".}
+proc arcsin*(x: float): float {.importc: "asin", header: "<math.h>".}
+proc arctan*(x: float): float {.importc: "atan", header: "<math.h>".}
+proc arctan2*(y, x: float): float {.importc: "atan2", header: "<math.h>".}
+  ## Calculate the arc tangent of `y` / `x`.
+  ## `atan2` returns the arc tangent of `y` / `x`; it produces correct
+  ## results even when the resulting angle is near pi/2 or -pi/2
+  ## (`x` near 0).
+
+proc cos*(x: float): float {.importc: "cos", header: "<math.h>".}
+proc cosh*(x: float): float {.importc: "cosh", header: "<math.h>".}
+proc hypot*(x: float): float {.importc: "hypot", header: "<math.h>".}
+proc log10*(x: float): float {.importc: "log10", header: "<math.h>".}
+proc sinh*(x: float): float {.importc: "sinh", header: "<math.h>".}
+proc tan*(x: float): float {.importc: "tan", header: "<math.h>".}
+proc tanh*(x: float): float {.importc: "tanh", header: "<math.h>".}
+proc pow*(x, y: float): float {.importc: "pos", header: "<math.h>".}
+  ## computes x to power raised of y.
+
+type
+  TFloatClass* = enum ## describes the class a floating point value belongs to.
+                      ## This is the type that is returned by `classify`.
+    fcNormal,    ## value is an ordinary nonzero floating point value
+    fcSubnormal, ## value is a subnormal (a very small) floating point value
+    fcZero,      ## value is zero
+    fcNegZero,   ## value is the negative zero
+    fcNan,       ## value is Not-A-Number (NAN)
+    fcInf,       ## value is positive infinity
+    fcNegInf     ## value is negative infinity
+
+proc classify*(x: float): TFloatClass
+  ## classifies a floating point value. Returns `x`'s class as specified by
+  ## `TFloatClass`
+
+# implementation
+
+include cntbits
+
+proc nextPowerOfTwo(x: int): int =
+  result = x - 1
+  when defined(cpu64):
+    result = result or (result shr 32)
+  result = result or (result shr 16)
+  result = result or (result shr 8)
+  result = result or (result shr 4)
+  result = result or (result shr 2)
+  result = result or (result shr 1)
+  Inc(result)
+
+# C procs:
+proc gettime(dummy: ptr cint): cint {.
+  importc: "time", header: "<time.h>".}
+proc srand(seed: cint) {.
+  importc: "srand", nodecl.}
+proc rand(): cint {.importc: "rand", nodecl.}
+
+# most C compilers have no classify:
+proc classify(x: float): TFloatClass =
+  if x == 0.0:
+    if 1.0/x == 1.0/0.0:
+      return fcZero
+    else:
+      return fcNegZero
+  if x*0.5 == x:
+    if x > 0.0: return fcInf
+    else: return fcNegInf
+  if x != x: return fcNan
+  return fcNormal
+  # XXX: fcSubnormal is not detected!
+
+proc randomize() = srand(gettime(nil))
+proc random(max: int): int = return rand() mod max
+
+proc isPowerOfTwo(x: int): bool = return (x and -x) == x
+
+{.pop.}
+{.pop.}
diff --git a/lib/memman.nim b/lib/memman.nim
new file mode 100755
index 000000000..f0ca078f7
--- /dev/null
+++ b/lib/memman.nim
@@ -0,0 +1,599 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2008 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+# Memory manager. Based on:
+# Two Levels Segregate Fit memory allocator (TLSF)
+# Version 2.4.2
+#
+# Written by Miguel Masmano Tello <mimastel@doctor.upv.es>
+#
+# Thanks to Ismael Ripoll for his suggestions and reviews
+#
+# Copyright (C) 2008, 2007, 2006, 2005, 2004
+# 
+# This code is released using a dual license strategy: GPL/LGPL
+# You can choose the licence that better fits your requirements.
+# 
+# Released under the terms of the GNU General Public License Version 2.0
+# Released under the terms of the GNU Lesser General Public License Version 2.1
+
+
+# Some IMPORTANT TLSF parameters
+const
+  blockAlign = sizeof(pointer) * 2
+  maxFli = 30
+  maxLog2Sli = 5
+  maxSli = 1 shl maxLog2Sli
+  
+  fliOffset = 6 # tlsf structure just will manage blocks bigger than 128 bytes
+  smallBlock = 128
+  realFli = MaxFli - fliOffset
+  
+type
+  TFreePtr = record
+    prev, next: PBhdr
+  Pbhdr = ptr Tbhdr
+  Tbhdr = record
+    prevHdr: Pbhdr # this is just valid if the first bit of size is set
+    size: int # the size is stored in bytes 
+              # bit 0 indicates whether the block is used and
+              # bit 1 allows to know whether the previous block is free
+    freePtr: TFreePtr # at this offset bhdr.buffer starts (was a union in the
+                      # C version)
+  TAreaInfo = record  # This structure is embedded at the beginning of each
+                      # area, giving us enough information to cope with a set
+                      # of areas
+    theEnd: Pbhdr
+    next: PAreaInfo
+  PAreaInfo = ptr TAreaInfo
+
+  TLSF = record    
+    tlsf_signature: int32 # the TLSF's structure signature
+    usedSize, maxSize: int
+    areaHead: PAreaInfo # A linked list holding all the existing areas
+
+    flBitmap: int32  # the first-level bitmap
+                     # This array should have a size of REAL_FLI bits
+    slBitmap: array[0..realFli, int32] # the second-level bitmap
+    matrix: array [0..realFli, array[0..maxSli, PBhdr]]
+  
+const
+  minBlockSize = sizeof(TFreePtr)
+  bhdrOverhead = sizeof(Tbhdr) - minBlockSize
+  tlsfSignature = 0x2A59FA59
+  ptrMask = sizeof(pointer) - 1
+  blockSize = 0xFFFFFFFF - ptrMask
+  memAlign = blockAlign - 1
+  blockState = 0x1
+  prevState = 0x2
+
+  freeBlock = 0x1 # bit 0 of the block size
+  usedBlock = 0x0
+
+  prevFree = 0x2 # bit 1 of the block size
+  prevUsed = 0x0
+  
+  defaultAreaSize = 64*1024 # 1024*10
+  pageSize = if defined(cpu32): 4096 else: 4096*2
+  
+
+proc getNextBlock(adr: pointer, r: int): PBhdr {.inline.} = 
+  return cast[PBhdr](cast[TAddress](adr) +% r)
+
+proc roundupSize(r: int): int = return (r +% memAlign) and not memAlign
+proc rounddownSize(r: int): int = return r and not memAlign
+proc roundup(x, v: int): int = return (((not x)+%1) and (v-%1)) +% x
+
+proc addSize(s: PTLSF, b: Pbhdr) =
+  inc(s.usedSize, (b.size and blockSize) + bhdrOverhead)
+  s.maxSize = max(s.maxSize, s.usedSize)
+
+proc removeSize(s: PTLSF, b: Pbhdr) =
+  dec(s.usedSize, (b.size and blockSize) + bhdrOverhead)
+
+# ------------ platform specific code -----------------------------------------
+
+when defined(posix): 
+  const # XXX: make these variables for portability?
+    PROT_READ  = 1             # page can be read 
+    PROT_WRITE = 2             # page can be written 
+    PROT_EXEC  = 4             # page can be executed 
+    PROT_NONE  = 0             # page can not be accessed 
+
+    MAP_SHARED    = 1          # Share changes 
+    MAP_PRIVATE   = 2          # Changes are private 
+    MAP_TYPE      = 0xf        # Mask for type of mapping 
+    MAP_FIXED     = 0x10       # Interpret addr exactly 
+    MAP_ANONYMOUS = 0x20       # don't use a file 
+
+    MAP_GROWSDOWN  = 0x100     # stack-like segment 
+    MAP_DENYWRITE  = 0x800     # ETXTBSY 
+    MAP_EXECUTABLE = 0x1000    # mark it as an executable 
+    MAP_LOCKED     = 0x2000    # pages are locked 
+    MAP_NORESERVE  = 0x4000    # don't check for reservations 
+
+  proc mmap(adr: pointer, len: int, prot, flags, fildes: cint,
+            off: int): pointer {.header: "<sys/mman.h>".}
+
+  proc getNewArea(size: var int): pointer {.inline.} = 
+    size = roundup(size, PageSize)
+    result = mmap(0, size, PROT_READ or PROT_WRITE, 
+                           MAP_PRIVATE or MAP_ANONYMOUS, -1, 0)
+    if result == nil or result == cast[pointer](-1):
+      raiseOutOfMem()
+  
+elif defined(windows): 
+  const
+    MEM_RESERVE = 0x2000 
+    MEM_COMMIT = 0x1000
+    MEM_TOP_DOWN = 0x100000
+    PAGE_READWRITE = 0x04
+
+  proc VirtualAlloc(lpAddress: pointer, dwSize: int, flAllocationType,
+                    flProtect: int32): pointer {.
+                    header: "<windows.h>", stdcall.}
+  
+  proc getNewArea(size: var int): pointer {.inline.} = 
+    size = roundup(size, PageSize)
+    result = VirtualAlloc(nil, size, MEM_RESERVE or MEM_COMMIT or MEM_TOP_DOWN,
+                          PAGE_READWRITE)
+    if result == nil: raiseOutOfMem()
+
+else: 
+  # generic implementation relying on malloc:
+  proc malloc(size: int): pointer {.nodecl, importc.}
+  
+  proc getNewArea(size: var int): pointer {.inline.} = 
+    size = roundup(size, PageSize)
+    result = malloc(size)
+    if result == nil: raiseOutOfMem()
+
+# ----------------------------------------------------------------------------
+#     helpers
+
+const
+  table: array[0..255, int8] = [
+      -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
+      4, 4, 4, 4, 4, 4, 4, 4, 4,
+      5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+      5, 5, 5, 5, 5, 5, 5, 5,
+      6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+      6, 6, 6, 6, 6, 6, 6, 6,
+      6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+      6, 6, 6, 6, 6, 6, 6, 6,
+      7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+      7, 7, 7, 7, 7, 7, 7, 7
+    ]
+
+proc ls_bit(i: int32): int {.inline.} = 
+  var 
+    a: int = 0
+    x: int = i and -i
+  if x <=% 0xffff:
+    if x <=% ff: a = 0
+    else: a = 8
+  elif x <=% 0xffffff: a = 16
+  else: a = 24
+  return table[x shr a] + a
+
+proc ms_bit(i: int): int {.inline.} = 
+  var
+    a = if i <=% 0xffff: (if i <=% 0xff: 0 else: 8) elif 
+           i <=% 0xffffff: 16 else: 24
+  return table[i shr a] + a
+
+proc set_bit[IX](nr: int, adr: var array[IX, int32]) {.inline.} =
+  adr[nr shr 5] = adr[nr shr 5] or (1 shl (nr and 0x1f))
+
+proc clear_bit[IX](nr: int, adr: var array[IX, int32]) {.inline.} =
+  adr[nr shr 5] = adr[nr shr 5] and not (1 shl (nr and 0x1f))
+
+proc mappingSearch(r, fl, sl: var int) {.inline.} = 
+  if r < smallBlock: 
+    fl = 0
+    sl = r div (smallBlock div maxSli)
+  else:
+    var t = (1 shl (ms_bit(r) - maxLog2Sli)) - 1
+    r = r + t
+    fl = ms_bit(r)
+    sl = (r shl (fl - maxLog2Sli)) - maxSli
+    fl = fl - fliOffset
+    r = r and not t
+
+proc mappingInsert(r: int, fl, sl: var int) {.inline.} = 
+  if r < smallBlock:
+    fl = 0
+    sl = r div (smallBlock div maxSli)
+  else:
+    fl = ms_bit(r)
+    sl = (r shr (fl - maxLog2Sli)) - maxSli
+    fl = fl - fliOffset
+
+proc findSuitableBlock(t: var TLSF, fl, sl: var int): Pbhdr =
+  var tmp = t.slBitmap[fl] and ((not 0) shl sl)
+  if tmp != 0:
+    sl = ls_bit(tmp)
+    result = t.matrix[fl][sl]
+  else:
+    fl = ls_bit(t.flBitmap and (not 0 shl (fl + 1)))
+    if fl > 0: # likely
+      sl = ls_bit(t.slBitmap[fl])
+      result = t.matrix[fl][sl]
+
+proc extractBlockHdr(b: Pbhdr, t: var TLSF, fl, sl: int) {.inline.} = 
+  t.matrix[fl][sl] = b.freePtr.next
+  if t.matrix[fl][sl] != 0:
+    t.matrix[fl][sl].freePtr.prev = nil
+  else:
+    clear_bit(sl, t.slBitmap[fl])
+    if t.slBitmap[fl] == 0:
+      clear_bit(fl, t.flBitmap)
+  b.freePtr.prev = nil
+  b.freePtr.next = nil
+
+proc extractBlock(b: Pbhdr, t: var TLSF, fl, sl: int) {.inline.} =
+  if b.freePtr.next != nil:
+    b.freePtr.next.freePtr.prev = b.freePtr.prev
+  if b.freePtr.prev != nil:
+    b.freePtr.prev.freePtr.next = b.freePtr.next
+  if t.matrix[fl][sl] == b:
+    t.matrix[fl][sl] = b.freePtr.next
+    if t.matrix[fl][sl] == nil:
+      clear_bit(sl, t.slBitmap[fl])
+      if t.slBitmap[fl] == 0:
+        clear_bit(fl, t.flBitmap)
+  b.freePtr.prev = nil
+  b.freePtr.next = nil
+
+proc insertBlock(b: Pbhdr, t: var TLSF, fl, sl: int) {.inline.} = 
+  b.freePtr.prev = nil
+  b.freePtr.next = t.matrix[fl][sl] 
+  if t.matrix[fl][sl] != 0:
+    t.matrix[fl][sl].freePtr.prev = b		
+  t.matrix[fl][sl] = b
+  set_bit(sl, t.slBitmap[fl])
+  set_bit(fl, t.flBitmap)
+
+proc getBuffer(b: Pbhdr): pointer {.inline.} = 
+  result = cast[pointer](addr(b.freePtr))
+
+proc processArea(area: pointer, size: int): Pbhdr =
+  var 
+    b, lb, ib: Pbhdr
+    ai: PAreaInfo
+  ib = cast[Pbhdr](area)
+  if sizeof(TAreaInfo) < minBlockSize:
+    ib.size = minBlockSize or usedBlock or prevUsed
+  else
+    ib.size = roundupSize(sizeof(TAreaInfo)) or usedBlock or prevUsed
+  b = getNextBlock(getBuffer(ib), ib.size and blockSize)
+  b.size = rounddownSize(size - 3 * bhdrOverhead - (ib.size and blockSize)) or
+           usedBlock or prevUsed
+  b.freePtr.prev = nil
+  b.freePtr.next = nil
+  lb = getNextBlock(getBuffer(b), b.size and blockSize)
+  lb.prevHdr = b
+  lb.size = 0 or usedBlock or prevFree
+  ai = cast[PAreaInfo](getBuffer(ib))
+  ai.next = nil
+  ai.theEnd = lb
+  return ib
+
+# ----------------------------------------------------------------------------
+#                  Begin of the allocator code
+
+var
+  mp: pointer # default memory pool.
+
+proc initMemoryPool(memPoolSize: int, memPool: pointer): int = 
+  var
+    t: PLSF
+    b, ib: Pbhdr
+
+  if memPool == nil or memPoolSize < sizeof(TLSF) + bhdrOverhead * 8:
+    writeToStdErr("initMemoryPool(): memory_pool invalid\n")
+    return -1
+
+  if (memPool and ptrMask) != 0:
+    writeToStdErr("initMemoryPool(): memPool must be aligned to a word\n")
+    return -1
+  t = cast[PLSF](memPool)
+  # Check if already initialised
+  if t.signature == tlsfSignature:
+    mp = memPool
+    b = getNextBlock(mp, roundupSize(sizeof(TLSF)))
+    return b.size and blockSize
+  mp = memPool
+  zeroMem(memPool, sizeof(TLSF))
+
+  t.signature = tlsfSignature
+  ib = processArea(getNextBlock(memPool, roundupSize(sizeof(TLSF))), 
+                   rounddownSize(memPoolSize - sizeof(TLSF)))
+  b = getNextBlock(getBuffer(ib), ib.size and blockSize)
+  freeEx(getBuffer(b), t)
+  t.areaHead = cast[PAreaInfo](getBuffer(ib))
+
+  t.used_size = memPoolSize - (b.size and blockSize)
+  t.max_size = t.used_size
+  return b.size and blockSize
+
+
+proc addNewArea(area: pointer, areaSize: int, t: var TLSF): int = 
+  var
+    p, ptrPrev, ai: PAreaInfo
+    ib0, b0, lb0, ib1, b1, lb1, nextB: Pbhdr
+
+  zeroMem(area, areaSize)
+  p = t.areaHead
+  ptrPrev = 0
+
+  ib0 = processArea(area, areaSize)
+  b0 = getNextBlock(getBuffer(ib0), ib0.size and blockSize)
+  lb0 = getNextBlock(getBuffer(b0), b0.size and blockSize)
+
+  # Before inserting the new area, we have to merge this area with the
+  # already existing ones
+  while p != nil:
+    ib1 = cast[Pbhdr](cast[TAddress](p) -% bhdrOverhead) 
+    b1 = getNextBlock(getBuffer(ib1), ib1.size and blockSize)
+    lb1 = p.theEnd
+
+    # Merging the new area with the next physically contigous one
+    if cast[TAddress](ib1) == cast[TAddress](lb0) +% bhdrOverhead:
+      if t.areaHead == p:
+        t.areaHead = p.next
+        p = p.next
+      else:
+        ptrPrev.next = p.next
+        p = p.next
+      b0.size = rounddownSize((b0.size and blockSize) +
+                         (ib1.size and blockSize) + 2 * bhdrOverhead) or
+                         usedBlock or prevUsed
+      b1.prevHdr = b0
+      lb0 = lb1
+      continue
+
+    # Merging the new area with the previous physically contigous one
+    if getBuffer(lb1) == pointer(ib0):
+      if t.areaHead == p:
+        t.areaHead = p.next
+        p = p.next
+      else:
+        ptrPrev.next = p.next
+        p = p.next
+      lb1->size = rounddownSize((b0.size and blockSize) +
+                   (ib0.size and blockSize) + 2 * bhdrOverhead) or
+                   usedBlock or (lb1.size and prevState)
+      nextB = getNextBlock(getBuffer(lb1), lb1.size and blockSize)
+      nextB.prevHdr = lb1
+      b0 = lb1
+      ib0 = ib1
+      continue
+    ptrPrev = p
+    p = p.next
+
+  # Inserting the area in the list of linked areas 
+  ai = cast[PAreaInfo](getBuffer(ib0))
+  ai.next = t.areaHead
+  ai.theEnd = lb0
+  t.areaHead = ai
+  freeEx(getBuffer(b0), memPool)
+  return (b0.size and blockSize)
+
+proc mallocEx(asize: int, t: var TLSF): pointer = 
+  var
+    b, b2, nextB: Pbhdr
+    fl, sl, tmpSize, size: int
+
+  size = if asize < minBlockSize: minBlockSize else: roundupSize(asize)
+
+  # Rounding up the requested size and calculating fl and sl
+  mappingSearch(size, fl, sl)
+
+  # Searching a free block, recall that this function changes the values
+  # of fl and sl, so they are not longer valid when the function fails
+  b = findSuitableBlock(tlsf, fl, sl)
+  if b == nil: 
+    # Growing the pool size when needed 
+    # size plus enough room for the required headers:
+    var areaSize = max(size + bhdrOverhead * 8, defaultAreaSize)
+    var area = getNewArea(areaSize)
+    addNewArea(area, areaSize, t)
+    # Rounding up the requested size and calculating fl and sl
+    mappingSearch(size, fl, sl)
+    # Searching a free block
+    b = findSuitableBlock(t, fl, sl)
+    if b == nil: 
+      raiseOutOfMem()
+
+  extractBlockHdr(b, t, fl, sl)
+
+  #-- found:
+  nextB = getNextBlock(getBuffer(b), b.size and blockSize)
+  # Should the block be split?
+  tmpSize = (b.size and blockSize) - size
+  if tmpSize >= sizeof(Tbhdr):
+    dec(tmpSize, bhdrOverhead)
+    b2 = getNextBlock(getBuffer(b), size)
+    b2.size = tmpSize or freeBlock or prevUsed
+    nextB.prevHdr = b2
+    mappingInsert(tmpSize, fl, sl)
+    insertBlock(b2, t, fl, sl)
+
+    b.size = size or (b.size and prevState)
+  else:
+    nextB.size = nextB.size and not prevFree
+    b.size = b.size and not freeBlock # Now it's used
+
+  addSize(t, b)
+  return getBuffer(b)
+
+
+proc freeEx(p: pointer, t: var TLSF) =
+  var
+    fl = 0
+    sl = 0
+    b, tmpB: Pbhdr
+
+  assert(p != nil)
+  b = cast[Pbhdr](cast[TAddress](p) -% bhdrOverhead)
+  b.size = b.size or freeBlock
+
+  removeSize(t, b)
+  b.freePtr.prev = nil
+  b.freePtr.next = nil
+  tmpB = getNextBlock(getBuffer(b), b.size and blockSize)
+  if tmpB.size and freeBlock != 0:
+    mappingInsert(tmpB.size and blockSize, fl, sl)
+    extractBlock(tmpB, t, fl, sl)
+    inc(b.size, (tmpB.size and blockSize) + bhdrOverhead)
+  if (b.size and prevFree) != 0:
+    tmpB = b.prevHdr
+    mappingInsert(tmpB.size and blockSize, fl, sl)
+    extractBlock(tmpB, t, fl, sl)
+    inc(tmpB.size, (b.size and blockSize) + bhdrOverhead)
+    b = tmpB
+  mappingInsert(b.size and blockSize, fl, sl)
+  insertBlock(b, t, fl, sl)
+
+  tmpB = getNextBlock(getBuffer(b), b.size and blockSize)
+  tmpB.size = tmpB.size or prevFree
+  tmpB.prevHdr = b
+
+proc reallocEx(p: pointer, newSize: int, t: var TLSF): pointer = 
+  var
+    cpsize, fl, sl, tmpSize: int
+    b, tmpB, nextB: Pbhdr
+
+  assert(p != nil)
+  assert(newSize > 0)
+
+  b = cast[Pbhdr](cast[TAddress](p) -% bhdrOverhead)
+  nextB = getNextBlock(getBuffer(b), b.size and blockSize)
+  newSize = if newSize < minBlockSize: minBlockSize else: roundupSize(newSize)
+  tmpSize = b.size and blockSize
+  if newSize <= tmpSize:
+    removeSize(t, b)
+    if (nextB.size and freeBlock) != 0: 
+      mappingInsert(nextB.size and blockSize, fl, sl)
+      extractBlock(nextB, t, fl, sl)
+      inc(tmpSize, (nextB.size and blockSize) + bhdrOverhead)
+      nextB = getNextBlock(getBuffer(nextB), nextB.size and blockSize)
+      # We always reenter this free block because tmpSize will
+      # be greater then sizeof(Tbhdr)
+    dec(tmpSize, newSize)
+    if tmpSize >= sizeof(Tbhdr):
+      dec(tmpSize, bhdrOverhead)
+      tmpB = getNextBlock(getBuffer(b), newSize)
+      tmpB.size = tmpSize or freeBlock or prevUsed
+      nextB.prevHdr = tmpB
+      nextB.size = nextB.size or prevFree
+      mappingInsert(tmpSize, fl, sl)
+      insertBlock(tmpB, t, fl, sl)
+      b.size = newSize or (b.size and prevState)
+    addSize(t, b)
+    return getBuffer(b)
+  
+  if (nextB.size and freeBlock) != 0:
+    if newSize <= tmpSize + (nextB.size and blockSize):
+      removeSize(t, b)
+      mappingInsert(nextB.size and blockSize, fl, sl)
+      extractBlock(nextB, t, fl, sl)
+      inc(b.size, (nextB.size and blockSize) + bhdrOverhead)
+      nextB = getNextBlock(getBuffer(b), b.size and blockSize)
+      nextB.prevHdr = b
+      nextB.size = nextB.size and not prevFree
+      tmpSize = (b.size and blockSize) - newSize
+      if tmpSize >= sizeof(Tbhdr):
+        dec(tmpSize, bhdrOverhead)
+        tmpB = getNextBlock(getBuffer(b), newSize)
+        tmpB.size = tmpSize or freeBlock or prevUsed
+        nextB.prevHdr = tmpB
+        nextB.size = nextB.size or prevFree
+        mappingInsert(tmpSize, fl, sl)
+        insertBlock(tmpB, t, fl, sl)
+        b.size = newSize or (b.size and prevState)
+      addSize(t, b)
+      return getBuffer(b)
+
+  var ptrAux = mallocEx(newSize, t)
+  cpsize = if (b.size and blockSize) > newSize: newSize else:
+                                                (b.size and blockSize)
+  copyMem(ptrAux, p, cpsize)
+  freeEx(p, memPool)
+  return ptrAux
+
+
+proc ansiCrealloc(p: pointer, newSize: int, t: var TLSF): pointer = 
+  if p == nil: 
+    if newSize > 0: 
+      result = mallocEx(newSize, t)
+    else:
+      result = nil
+  elif newSize <= 0:
+    freeEx(p, t)
+    result = nil
+  else:
+    result = reallocEx(p, newSize, t)
+
+
+void *tlsf_malloc(size_t size)
+{
+  void *ret
+
+#if USE_MMAP || USE_SBRK
+  if (!mp) {
+    size_t areaSize
+    void *area
+
+    areaSize = sizeof(tlsf_t) + BHDR_OVERHEAD * 8 # Just a safety constant
+    areaSize = (areaSize > DEFAULT_areaSize) ? areaSize : DEFAULT_areaSize
+    area = get_new_area(&areaSize)
+    if (area == ((void *) ~0))
+      return NULL        # Not enough system memory 
+    initMemoryPool(areaSize, area)
+  }
+#endif
+
+  TLSF_ACQUIRE_LOCK(&((tlsf_t *)mp)->lock)
+
+  ret = malloc_ex(size, mp)
+
+  TLSF_RELEASE_LOCK(&((tlsf_t *)mp)->lock)
+
+  return ret
+}
+
+void tlsf_free(void *p)
+{
+  TLSF_ACQUIRE_LOCK(&((tlsf_t *)mp)->lock)
+  free_ex(p, mp)
+  TLSF_RELEASE_LOCK(&((tlsf_t *)mp)->lock)
+}
+
+void *tlsf_realloc(void *p, size_t size)
+{
+  void *ret
+#if USE_MMAP || USE_SBRK
+  if (!mp) {
+    return tlsf_malloc(size)
+  }
+#endif
+  TLSF_ACQUIRE_LOCK(&((tlsf_t *)mp)->lock)
+  ret = realloc_ex(p, size, mp)
+  TLSF_RELEASE_LOCK(&((tlsf_t *)mp)->lock)
+  return ret
+}
diff --git a/lib/nimbase.h b/lib/nimbase.h
new file mode 100755
index 000000000..99ee2f20c
--- /dev/null
+++ b/lib/nimbase.h
@@ -0,0 +1,403 @@
+/*
+
+            Nimrod's Runtime Library
+        (c) Copyright 2006 Andreas Rumpf
+
+    See the file "copying.txt", included in this
+    distribution, for details about the copyright.
+*/
+
+#ifndef NIMBASE_H
+#define NIMBASE_H
+
+/* calling convention mess ----------------------------------------------- */
+#if defined(__GNUC__) || defined(__LCC__) || defined(__POCC__)
+  /* these should support C99's inline */
+  /* the test for __POCC__ has to come before the test for _MSC_VER,
+     because PellesC defines _MSC_VER too. This is brain-dead. */
+#  define N_INLINE(rettype, name) inline rettype name
+#elif defined(__BORLANDC__) || defined(_MSC_VER)
+/* Borland's compiler is really STRANGE here; note that the __fastcall
+   keyword cannot be before the return type, but __inline cannot be after
+   the return type, so we do not handle this mess in the code generator
+   but rather here. */
+#  define N_INLINE(rettype, name) __inline rettype name
+#elif defined(__DMC__)
+#  define N_INLINE(rettype, name) inline rettype name
+#elif defined(__WATCOMC__)
+#  define N_INLINE(rettype, name) __inline rettype name
+#else /* others are less picky: */
+#  define N_INLINE(rettype, name) rettype __inline name
+#endif
+
+#if defined(_MSC_VER)
+#  define HAVE_LRINT 1
+#endif
+
+/* --------------- how int64 constants should be declared: ----------- */
+#if defined(__GNUC__) || defined(__LCC__) || \
+    defined(__POCC__) || defined(__DMC__)
+#  define IL64(x) x##LL
+#else /* works only without LL */
+#  define IL64(x) x
+#endif
+
+/* ------------------------------------------------------------------- */
+
+#if defined(WIN32) || defined(_WIN32) /* only Windows has this mess... */
+#  define N_CDECL(rettype, name) rettype __cdecl name
+#  define N_STDCALL(rettype, name) rettype __stdcall name
+#  define N_SYSCALL(rettype, name) rettype __syscall name
+#  define N_FASTCALL(rettype, name) rettype __fastcall name
+#  define N_SAFECALL(rettype, name) rettype __safecall name
+/* function pointers with calling convention: */
+#  define N_CDECL_PTR(rettype, name) rettype (__cdecl *name)
+#  define N_STDCALL_PTR(rettype, name) rettype (__stdcall *name)
+#  define N_SYSCALL_PTR(rettype, name) rettype (__syscall *name)
+#  define N_FASTCALL_PTR(rettype, name) rettype (__fastcall *name)
+#  define N_SAFECALL_PTR(rettype, name) rettype (__safecall *name)
+
+#  define N_LIB_EXPORT  __declspec(dllexport)
+#  define N_LIB_IMPORT  __declspec(dllimport)
+#else
+#  define N_CDECL(rettype, name) rettype name
+#  define N_STDCALL(rettype, name) rettype name
+#  define N_SYSCALL(rettype, name) rettype name
+#  define N_FASTCALL(rettype, name) rettype name
+#  define N_SAFECALL(rettype, name) rettype name
+/* function pointers with calling convention: */
+#  define N_CDECL_PTR(rettype, name) rettype (*name)
+#  define N_STDCALL_PTR(rettype, name) rettype (*name)
+#  define N_SYSCALL_PTR(rettype, name) rettype (*name)
+#  define N_FASTCALL_PTR(rettype, name) rettype (*name)
+#  define N_SAFECALL_PTR(rettype, name) rettype (*name)
+
+#  define N_LIB_EXPORT
+#  define N_LIB_IMPORT  extern
+#endif
+
+#define N_NOCONV(rettype, name) rettype name
+/* specify no calling convention */
+#define N_NOCONV_PTR(rettype, name) rettype (*name)
+
+#define N_CLOSURE(rettype, name) rettype name
+/* specify no calling convention */
+#define N_CLOSURE_PTR(rettype, name) rettype (*name)
+
+
+#if defined(__BORLANDC__) || defined(__WATCOMC__) || \
+    defined(__POCC__) || defined(_MSC_VER)
+/* these compilers have a fastcall so use it: */
+#  define N_NIMCALL(rettype, name) rettype __fastcall name
+#  define N_NIMCALL_PTR(rettype, name) rettype (__fastcall *name)
+#else
+#  define N_NIMCALL(rettype, name) rettype name /* no modifier */
+#  define N_NIMCALL_PTR(rettype, name) rettype (*name)
+#endif
+
+/* ----------------------------------------------------------------------- */
+
+/* from float_cast.h: */
+
+/*
+** Copyright (C) 2001 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+**
+** Permission to use, copy, modify, distribute, and sell this file for any
+** purpose is hereby granted without fee, provided that the above copyright
+** and this permission notice appear in all copies.  No representations are
+** made about the suitability of this software for any purpose.  It is
+** provided "as is" without express or implied warranty.
+*/
+
+/* Version 1.1 */
+
+
+/*============================================================================
+**  On Intel Pentium processors (especially PIII and probably P4), converting
+**  from float to int is very slow. To meet the C specs, the code produced by
+**  most C compilers targeting Pentium needs to change the FPU rounding mode
+**  before the float to int conversion is performed.
+**
+**  Changing the FPU rounding mode causes the FPU pipeline to be flushed. It
+**  is this flushing of the pipeline which is so slow.
+**
+**  Fortunately the ISO C99 specifications define the functions lrint, lrintf,
+**  llrint and llrintf which fix this problem as a side effect.
+**
+**  On Unix-like systems, the configure process should have detected the
+**  presence of these functions. If they weren't found we have to replace them
+**  here with a standard C cast.
+*/
+
+/*
+**	The C99 prototypes for lrint and lrintf are as follows:
+**
+**		long int lrintf (float x);
+**		long int lrint  (double x);
+*/
+
+#if defined(__LCC__) || defined(__POCC__) \
+                     || (defined(__GNUC__) && defined(WIN32))
+/* Linux' GCC does not seem to have these. Why? */
+#  define HAVE_LRINT
+#  define HAVE_LRINTF
+#endif
+
+#if defined(HAVE_LRINT) && defined(HAVE_LRINTF)
+
+/*  These defines enable functionality introduced with the 1999 ISO C
+**  standard. They must be defined before the inclusion of math.h to
+**  engage them. If optimisation is enabled, these functions will be
+**  inlined. With optimisation switched off, you have to link in the
+**  maths library using -lm.
+*/
+
+#  define  _ISOC9X_SOURCE  1
+#  define  _ISOC99_SOURCE  1
+#  define  __USE_ISOC9X  1
+#  define  __USE_ISOC99  1
+#  include  <math.h>
+
+#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \
+   && !defined(__BORLANDC__)
+
+#  include  <math.h>
+
+/*  Win32 doesn't seem to have these functions.
+**  Therefore implement inline versions of these functions here.
+*/
+static N_INLINE(long int, lrint)(double flt) {
+  long int intgr;
+  _asm {
+    fld flt
+    fistp intgr
+  };
+  return intgr;
+}
+
+static N_INLINE(long int, lrintf)(float flt) {
+  long int intgr;
+  _asm {
+    fld flt
+    fistp intgr
+  };
+  return intgr;
+}
+
+#else
+
+#  include <math.h>
+
+#  ifndef lrint
+#    define  lrint(dbl)   ((long int)(dbl))
+#  endif
+#  ifndef lrintf
+#    define  lrintf(flt)  ((long int)(flt))
+#  endif
+
+#endif /* defined(HAVE_LRINT) && defined(HAVE_LRINTF) */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#include <stddef.h>
+#include <signal.h>
+#include <setjmp.h>
+
+/* compiler symbols:
+__BORLANDC__
+_MSC_VER
+__WATCOMC__
+__LCC__
+__GNUC__
+__DMC__
+__POCC__
+*/
+
+/* C99 compiler? */
+#if (defined(__STD_VERSION__) && (__STD_VERSION__ >= 199901))
+#  define HAVE_STDINT_H
+#endif
+
+#if defined(__LCC__) || defined(__GNUC__) || defined(__DMC__) \
+ || defined(__POCC__)
+#  define HAVE_STDINT_H
+#endif
+
+/* bool types (C++ has it): */
+#ifdef __cplusplus
+#  ifndef NIM_TRUE
+#    define NIM_TRUE true
+#  endif
+#  ifndef NIM_FALSE
+#    define NIM_FALSE false
+#  endif
+#  define NIM_BOOL bool
+#else
+#  ifdef bool
+#    define NIM_BOOL bool
+#  else
+  typedef unsigned char NIM_BOOL;
+#  endif
+#  ifndef NIM_TRUE
+#    define NIM_TRUE ((NIM_BOOL) 1)
+#  endif
+#  ifndef NIM_FALSE
+#    define NIM_FALSE ((NIM_BOOL) 0)
+#  endif
+#endif
+
+#define NIM_NIL ((void*)0) /* C's NULL is fucked up in some C compilers, so
+  the generated code does not rely on it anymore */
+
+#if defined(HAVE_STDINT_H)
+#  include <stdint.h>
+typedef int8_t NS8;
+typedef int16_t NS16;
+typedef int32_t NS32;
+typedef int64_t NS64;
+typedef uint64_t NU64;
+typedef uint8_t NU8;
+typedef uint16_t NU16;
+typedef uint32_t NU32;
+#elif defined(__BORLANDC__) || defined(__DMC__) \
+   || defined(__WATCOMC__) || defined(_MSC_VER)
+typedef signed char NS8;
+typedef signed short int NS16;
+typedef signed int NS32;
+/* XXX: Float128? */
+typedef unsigned char NU8;
+typedef unsigned short int NU16;
+typedef unsigned __int64 NU64;
+typedef __int64 NS64;
+typedef unsigned int NU32;
+#else
+typedef signed char NS8;
+typedef signed short int NS16;
+typedef signed int NS32;
+/* XXX: Float128? */
+typedef unsigned char NU8;
+typedef unsigned short int NU16;
+typedef unsigned long long int NU64;
+typedef long long int NS64;
+typedef unsigned int NU32;
+#endif
+
+#if defined(_MSC_VER) && (defined(AMD64) || defined(_M_AMD64))
+/* Microsoft C is brain-dead in this case; long is still not an int64 */
+typedef unsigned long long int NU;
+typedef signed long long int NS;
+#else
+typedef unsigned long int NU; /* note: int would be wrong for AMD64 */
+typedef signed long int NS;
+#endif
+
+typedef float NF32;
+typedef double NF64;
+typedef double NF;
+
+typedef char NIM_CHAR;
+typedef char* NCSTRING;
+
+#ifdef NIM_BIG_ENDIAN
+#  define NIM_IMAN 1
+#else
+#  define NIM_IMAN 0
+#endif
+
+static N_INLINE(NS32, float64ToInt32)(double val) {
+  val = val + 68719476736.0*1.5;
+  /* 2^36 * 1.5,  (52-_shiftamt=36) uses limited precisicion to floor */
+  return ((NS32*)&val)[NIM_IMAN] >> 16; /* 16.16 fixed point representation */
+}
+
+static N_INLINE(NS32, float32ToInt32)(float val) {
+  return float64ToInt32((double)val);
+}
+
+#define zeroMem(a, size) memset(a, 0, size)
+#define equalMem(a, b, size) (memcmp(a, b, size) == 0)
+
+#define STRING_LITERAL(name, str, length) \
+  static const struct {                   \
+    NS len, space;                        \
+    NIM_CHAR data[length + 1];            \
+  } name = {length, length, str}
+
+typedef struct TStringDesc* string;
+
+/* declared size of a sequence: */
+#if defined(__GNUC__)
+#  define SEQ_DECL_SIZE /* empty is correct! */
+#else
+#  define SEQ_DECL_SIZE  1000000
+#endif
+
+#define ALLOC_0(size)  calloc(1, size)
+#define DL_ALLOC_0(size) dlcalloc(1, size)
+
+#define GenericSeqSize sizeof(TGenericSeq)
+#define paramCount() cmdCount
+
+#ifndef NAN
+#  define NAN (0.0 / 0.0)
+#endif
+
+#ifndef INF
+#  ifdef INFINITY
+#    define INF INFINITY
+#  elif defined(HUGE_VAL)
+#    define INF  HUGE_VAL
+#  else
+#    define INF (1.0 / 0.0)
+#  endif
+#endif
+/*
+typedef struct TSafePoint TSafePoint;
+struct TSafePoint {
+  NS exc;
+  NCSTRING excname;
+  NCSTRING msg;
+  TSafePoint* prev;
+  jmp_buf context;
+}; */
+
+typedef struct TFrame TFrame;
+struct TFrame {
+  TFrame* prev;
+  NCSTRING procname;
+  NS line;
+  NCSTRING filename;
+  NS len;
+};
+
+extern TFrame* volatile framePtr;
+/*extern TSafePoint* volatile excHandler; */
+
+#if defined(__cplusplus)
+struct NimException {
+  TSafePoint sp;
+
+  NimException(NS aExc, NCSTRING aExcname, NCSTRING aMsg) {
+    sp.exc = aExc; sp.excname = aExcname; sp.msg = aMsg;
+    sp.prev = excHandler;
+    excHandler = &sp;
+  }
+};
+#endif
+
+typedef struct TStringDesc {
+  NS len;
+  NS space;
+  NIM_CHAR data[1]; /* SEQ_DECL_SIZE]; */
+} TStringDesc;
+
+typedef struct {
+  NS len, space;
+} TGenericSeq;
+
+typedef TGenericSeq* PGenericSeq;
+
+#endif
diff --git a/lib/optparse.nim b/lib/optparse.nim
new file mode 100755
index 000000000..58007b5a9
--- /dev/null
+++ b/lib/optparse.nim
@@ -0,0 +1,39 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+

+## This module provides a command line parser.

+## It supports one iterator over all command line options.

+

+#interface

+

+{.push debugger: off.}

+

+import

+  os

+

+proc findSep(s: string): int {.nostatic.} =

+  for i in 0 .. high(s)-1:

+    if s[i] in {'=', ':'}: return i

+  return high(s)+1

+

+iterator getopt*(): tuple[string, string] =

+  # returns a (cmd, arg) tuple.

+  for k in 1 .. ParamCount():

+    var param = paramStr(k)

+    if param[0] == '-':

+      var j = findSep(param)

+      cmd = copy(param, 0, j-1)

+      arg = copy(param, j+1)

+    else:

+      cmd = ""

+      arg = param

+    yield cmd, arg

+

+{.pop.}

diff --git a/lib/os.nim b/lib/os.nim
new file mode 100755
index 000000000..5f9ea88a1
--- /dev/null
+++ b/lib/os.nim
@@ -0,0 +1,939 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+## Basic operating system facilities like retrieving environment variables,
+## reading command line arguments, working with directories, running shell
+## commands, etc. This module is -- like any other basic library --
+## platform independant.
+
+{.push debugger:off.}
+
+import
+  strutils, times
+
+# copied from excpt.nim, because I don't want to make this template public
+template newException(exceptn, message: expr): expr = 
+  block: # open a new scope
+    var
+      e: ref exceptn
+    new(e)
+    e.msg = message
+    e
+
+when defined(windows) or defined(OS2) or defined(DOS):
+  {.define: doslike.} # DOS-like filesystem
+
+when defined(Nimdoc): # only for proper documentation:
+  const
+    CurDir* = '.'
+      ## The constant string used by the operating system to refer to the
+      ## current directory.
+      ##
+      ## For example: '.' for POSIX or ':' for the classic Macintosh.
+
+    ParDir* = ".."
+      ## The constant string used by the operating system to refer to the parent
+      ## directory.
+      ##
+      ## For example: ".." for POSIX or "::" for the classic Macintosh.
+
+    DirSep* = '/'
+      ## The character used by the operating system to separate pathname
+      ## components, for example, '/' for POSIX or ':' for the classic
+      ## Macintosh.
+      ##
+      ## Note that knowing this is not sufficient to be able to parse or
+      ## concatenate pathnames -- use `splitPath` and `joinPath` instead --
+      ## but it is occasionally useful.
+
+    AltSep* = '/'
+      ## An alternative character used by the operating system to separate
+      ## pathname components, or the same as `DirSep` if only one separator
+      ## character exists. This is set to '/' on Windows systems where `DirSep`
+      ## is a backslash.
+
+    PathSep* = ':'
+      ## The character conventionally used by the operating system to separate
+      ## search patch components (as in PATH), such as ':' for POSIX or ';' for
+      ## Windows.
+
+    FileSystemCaseSensitive* = True
+      ## True if the file system is case sensitive, false otherwise. Used by
+      ## `cmpPaths` to compare filenames properly.
+
+elif defined(macos):
+  const
+    curdir* = ':'
+    pardir* = "::"
+    dirsep* = ':'
+    altsep* = dirsep
+    pathsep* = ','
+    FileSystemCaseSensitive* = false
+
+  #  MacOS paths
+  #  ===========
+  #  MacOS directory separator is a colon ":" which is the only character not
+  #  allowed in filenames.
+  #
+  #  A path containing no colon or which begins with a colon is a partial path.
+  #  E.g. ":kalle:petter" ":kalle" "kalle"
+  #
+  #  All other paths are full (absolute) paths. E.g. "HD:kalle:" "HD:"
+  #  When generating paths, one is safe if one ensures that all partial paths
+  #  begin with a colon, and all full paths end with a colon.
+  #  In full paths the first name (e g HD above) is the name of a mounted
+  #  volume.
+  #  These names are not unique, because, for instance, two diskettes with the
+  #  same names could be inserted. This means that paths on MacOS is not
+  #  waterproof. In case of equal names the first volume found will do.
+  #  Two colons "::" are the relative path to the parent. Three is to the
+  #  grandparent etc.
+elif defined(doslike):
+  const
+    curdir* = '.'
+    pardir* = ".."
+    dirsep* = '\\' # seperator within paths
+    altsep* = '/'
+    pathSep* = ';' # seperator between paths
+    FileSystemCaseSensitive* = false
+elif defined(PalmOS) or defined(MorphOS):
+  const
+    dirsep* = '/'
+    altsep* = dirsep
+    PathSep* = ';'
+    pardir* = ".."
+    FileSystemCaseSensitive* = false
+elif defined(RISCOS):
+  const
+    dirsep* = '.'
+    altsep* = '.'
+    pardir* = ".." # is this correct?
+    pathSep* = ','
+    FileSystemCaseSensitive* = true
+else: # UNIX-like operating system
+  const
+    curdir* = '.'
+    pardir* = ".."
+    dirsep* = '/'
+    altsep* = dirsep
+    pathSep* = ':'
+    FileSystemCaseSensitive* = true
+
+const
+  ExtSep* = '.'
+    ## The character which separates the base filename from the extension;
+    ## for example, the '.' in ``os.nim``.
+
+proc getApplicationDir*(): string {.noSideEffect.}
+  ## Gets the directory of the application's executable.
+
+proc getApplicationFilename*(): string {.noSideEffect.}
+  ## Gets the filename of the application's executable.
+
+proc getCurrentDir*(): string {.noSideEffect.}
+  ## Gets the current working directory.
+
+proc setCurrentDir*(newDir: string) {.inline.}
+  ## Sets the current working directory; `EOS` is raised if
+  ## `newDir` cannot been set.
+
+proc getHomeDir*(): string {.noSideEffect.}
+  ## Gets the home directory of the current user.
+
+proc getConfigDir*(): string {.noSideEffect.}
+  ## Gets the config directory of the current user for applications.
+
+proc expandFilename*(filename: string): string
+  ## Returns the full path of `filename`, "" on error.
+
+proc ExistsFile*(filename: string): bool
+  ## Returns true if the file exists, false otherwise.
+
+proc JoinPath*(head, tail: string): string {.noSideEffect.}
+  ## Joins two directory names to one.
+  ##
+  ## For example on Unix::
+  ##
+  ##   JoinPath("usr", "lib")
+  ##
+  ## results in::
+  ##
+  ##   "usr/lib"
+  ##
+  ## If head is the empty string, tail is returned.
+  ## If tail is the empty string, head is returned.
+
+proc `/` * (head, tail: string): string {.noSideEffect.} =
+  ## The same as ``joinPath(head, tail)``
+  return joinPath(head, tail)
+
+proc JoinPath*(parts: openarray[string]): string {.noSideEffect.}
+  ## The same as `JoinPath(head, tail)`, but works with any number
+  ## of directory parts.
+
+proc SplitPath*(path: string, head, tail: var string) {.noSideEffect.}
+  ## Splits a directory into (head, tail), so that
+  ## ``JoinPath(head, tail) == path``.
+  ##
+  ## Example: After ``SplitPath("usr/local/bin", head, tail)``,
+  ## `head` is "usr/local" and `tail` is "bin".
+  ## Example: After ``SplitPath("usr/local/bin/", head, tail)``,
+  ## `head` is "usr/local/bin" and `tail` is "".
+
+proc parentDir*(path: string): string {.noSideEffect.}
+  ## Returns the parent directory of `path`.
+  ##
+  ## This is often the same as the ``head`` result of ``splitPath``.
+  ## If there is no parent, ``path`` is returned.
+  ## Example: ``parentDir("/usr/local/bin") == "/usr/local"``.
+  ## Example: ``parentDir("/usr/local/bin/") == "/usr/local"``.
+
+proc `/../` * (head, tail: string): string {.noSideEffect.} =
+  ## The same as ``parentDir(head) / tail``
+  return parentDir(head) / tail
+
+proc UnixToNativePath*(path: string): string {.noSideEffect.}
+  ## Converts an UNIX-like path to a native one.
+  ##
+  ## On an UNIX system this does nothing. Else it converts
+  ## '/', '.', '..' to the appropriate things.
+
+proc SplitFilename*(filename: string, name, extension: var string) {.
+  noSideEffect.}
+  ## Splits a filename into (name, extension), so that
+  ## ``name & extension == filename``.
+  ##
+  ## Example: After ``SplitFilename("usr/local/nimrodc.html", name, ext)``,
+  ## `name` is "usr/local/nimrodc" and `ext` is ".html".
+  ## It the file has no extension, extention is the empty string.
+
+proc extractDir*(path: string): string {.noSideEffect.}
+  ## Extracts the directory of a given path. This is the `head`
+  ## result of `splitPath`.
+
+proc extractFilename*(path: string): string {.noSideEffect.}
+  ## Extracts the filename of a given `path`. This the the `tail`
+  ## result of `splitPath`.
+  # XXX: this is not true: /usr/lib/ --> filename should be empty!
+
+proc cmpPaths*(pathA, pathB: string): int {.noSideEffect.}
+  ## Compares two paths.
+  ##
+  ## On a case-sensitive filesystem this is done
+  ## case-sensitively otherwise case-insensitively. Returns:
+  ##
+  ## | 0 iff pathA == pathB
+  ## | < 0 iff pathA < pathB
+  ## | > 0 iff pathA > pathB
+
+proc AppendFileExt*(filename, ext: string): string {.noSideEffect.}
+  ## Appends the file extension `ext` to the `filename`, even if
+  ## the `filename` already has an extension.
+  ##
+  ## `Ext` should be given without the leading '.', because some
+  ## filesystems may use a different character.
+  ## (Although I know of none such beast.)
+
+proc ChangeFileExt*(filename, ext: string): string {.noSideEffect.}
+  ## Changes the file extension to `ext`.
+  ##
+  ## If the `filename` has no extension, `ext` will be added.
+  ## If `ext` == "" then the filename will get no extension.
+  ## `Ext` should be given without the leading '.', because some
+  ## filesystems may use a different character. (Although I know
+  ## of none such beast.)
+
+# procs dealing with processes:
+proc executeProcess*(command: string): int
+  ## Executes a process.
+  ##
+  ## Command has the form 'program args' where args are the command
+  ## line arguments given to program. The proc returns the error code
+  ## of the process when it has finished. The proc does not return
+  ## until the process has finished.
+
+proc executeShellCommand*(command: string): int
+  ## Executes a shell command.
+  ##
+  ## The syntax of the command is unspecified and depends on the used
+  ## shell. The proc returns the error code of the shell when it has finished.
+
+# procs operating on a high level for files:
+proc copyFile*(dest, source: string)
+  ## Copies a file from `dest` to `source`. If this fails,
+  ## `EOS` is raised.
+
+proc moveFile*(dest, source: string)
+  ## Moves a file from `dest` to `source`. If this fails, `EOS` is raised.
+
+proc removeFile*(file: string)
+  ## Removes the `file`. If this fails, `EOS` is raised.
+
+proc removeDir*(dir: string)
+  ## Removes the directory `dir` including all subdirectories or files
+  ## in `dir` (recursively). If this fails, `EOS` is raised.
+
+proc createDir*(dir: string)
+  ## Creates the directory `dir`.
+  ##
+  ## The directory may contain several
+  ## subdirectories that do not exist yet. The full path is created. If this
+  ## fails, `EOS` is raised. It does NOT fail if the path already exists
+  ## because for most usages this does not indicate an error.
+
+proc existsDir*(dir: string): bool
+  ## Returns true iff the directory `dir` exists. If `dir` is a file, false
+  ## is returned.
+
+proc getLastModificationTime*(file: string): TTime
+  ## Gets the time of the `file`'s last modification.
+
+# procs dealing with environment variables:
+proc putEnv*(key, val: string)
+  ## Sets the value of the environment variable named `key` to `val`.
+  ## If an error occurs, `EInvalidEnvVar` is raised.
+
+proc getEnv*(key: string): string
+  ## Gets the value of the environment variable named `key`.
+  ##
+  ## If the variable does not exist, "" is returned. To distinguish
+  ## whether a variable exists or it's value is just "", call
+  ## `existsEnv(key)`.
+
+proc existsEnv*(key: string): bool
+  ## Checks whether the environment variable named `key` exists.
+  ## Returns true if it exists, false otherwise.
+
+# procs dealing with command line arguments:
+proc paramCount*(): int
+  ## Returns the number of command line arguments given to the
+  ## application.
+
+proc paramStr*(i: int): string
+  ## Returns the `i`-th command line arguments given to the
+  ## application.
+  ##
+  ## `i` should be in the range `1..paramCount()`, else
+  ## the `EOutOfIndex` exception is raised.
+
+# implementation
+
+proc UnixToNativePath(path: string): string =
+  when defined(unix):
+    result = path
+  else:
+    var start: int
+    if path[0] == '/':
+      # an absolute path
+      when defined(doslike):
+        result = r"C:\"
+      elif defined(macos):
+        result = "" # must not start with ':'
+      else:
+        result = $dirSep
+      start = 1
+    elif path[0] == '.' and path[1] == '/':
+      # current directory
+      result = $curdir
+      start = 2
+    else:
+      result = ""
+      start = 0
+
+    var i = start
+    while i < len(path): # ../../../ --> ::::
+      if path[i] == '.' and path[i+1] == '.' and path[i+2] == '/':
+        # parent directory
+        when defined(macos):
+          if result[high(result)] == ':':
+            add result, ':'
+          else:
+            add result, pardir
+        else:
+          add result, pardir & dirSep
+        inc(i, 3)
+      elif path[i] == '/':
+        add result, dirSep
+        inc(i)
+      else:
+        add result, $path[i]
+        inc(i)
+
+# interface to C library:
+
+type
+  TStat {.importc: "struct stat".} = record
+    st_dev: int16
+    st_ino: int16
+    st_mode: int16
+    st_nlink: int16
+    st_uid: int16
+    st_gid: int16
+    st_rdev: int32
+    st_size: int32
+    st_atime: TTime
+    st_mtime: TTime
+    st_ctime: TTime
+
+var
+  errno {.importc: "errno", header: "<errno.h>".}: cint
+  EEXIST {.importc: "EEXIST", header: "<errno.h>".}: cint
+
+when defined(unix):
+  const dirHeader = "<sys/stat.h>"
+elif defined(windows):
+  const dirHeader = "<direct.h>"
+else:
+  {.error: "os library not ported to your OS. Please help!".}
+
+
+proc chdir(path: CString): cint {.importc: "chdir", header: dirHeader.}
+
+when defined(unix):
+  proc mkdir(dir: CString, theAccess: cint): cint {.
+    importc: "mkdir", header: dirHeader.}
+  proc realpath(name, resolved: CString): CString {.
+    importc: "realpath", header: "<stdlib.h>".}
+  proc getcwd(buf: CString, buflen: cint): CString {.
+    importc: "getcwd", header: "<unistd.h>".}
+elif defined(windows):
+  proc mkdir(dir: CString): cint {.
+    importc: "mkdir", header: dirHeader.}
+  proc fullpath(buffer, file: CString, size: int): CString {.
+    importc: "_fullpath", header: "<stdlib.h>".}
+  proc getcwd(buf: CString, buflen: cint): CString {.
+    importc: "getcwd", header: "<direct.h>".}
+
+  proc CreateDirectory(pathName: cstring, security: Pointer): cint {.
+    importc: "CreateDirectory", header: "<windows.h>".}
+  proc GetLastError(): cint {.importc, header: "<windows.h>".}
+else:
+  {.error: "os library not ported to your OS. Please help!".}
+
+
+proc rmdir(dir: CString): cint {.importc: "rmdir", header: "<time.h>".}
+  # rmdir is of course in ``dirHeader``, but we check here to include
+  # time.h which is needed for stat(). stat() needs time.h and
+  # sys/stat.h; we workaround a C library issue here.
+
+proc free(c: cstring) {.importc: "free", nodecl.}
+  # some C procs return a buffer that has to be freed with free(),
+  # so we define it here
+proc strlen(str: CString): int {.importc: "strlen", nodecl.}
+
+proc stat(f: CString, res: var TStat): cint {.
+  importc: "stat", header: "<sys/stat.h>".}
+
+proc sameFile*(path1, path2: string): bool =
+  ## Returns True if both pathname arguments refer to the same file or
+  ## directory (as indicated by device number and i-node number).
+  ## Raises an exception if an os.stat() call on either pathname fails.
+  var
+    a, b: TStat
+  if stat(path1, a) < 0 or stat(path2, b) < 0:
+    raise newException(EOS, "stat() call failed")
+  return int(a.st_dev) == b.st_dev and int(a.st_ino) == b.st_ino
+
+when defined(windows):
+  proc getModuleFilename(handle: int32, buf: CString, size: int32): int32 {.
+    importc: "GetModuleFileName", header: "<windows.h>".}
+
+proc getLastModificationTime(file: string): TTime =
+  var
+    res: TStat
+  discard stat(file, res)
+  return res.st_mtime
+
+proc setCurrentDir(newDir: string) =
+  if chdir(newDir) != 0:
+    raise newException(EOS, "cannot change the working directory to '$1'" % 
+      newDir)
+
+when defined(linux) or defined(solaris) or defined(bsd):
+  proc readlink(link, buf: cstring, size: int): int {.
+    header: "<unistd.h>", cdecl.}
+  
+  proc getApplAux(procPath: string): string =
+    result = newString(256)
+    var len = readlink(procPath, result, 256)
+    if len > 256:
+      result = newString(len+1)
+      len = readlink(procPath, result, len)
+    setlen(result, len)
+
+when defined(solaris) or defined(bsd):
+  proc getpid(): int {.importc, header: "<unistd.h>", cdecl.}
+
+proc getApplicationFilename(): string =
+  # Linux: /proc/<pid>/exe
+  # Solaris:
+  # /proc/<pid>/object/a.out (filename only)
+  # /proc/<pid>/path/a.out (complete pathname)
+  # *BSD (and maybe Darwing too):
+  # /proc/<pid>/file
+  when defined(windows):
+    result = newString(256)
+    var len = getModuleFileName(0, result, 256)
+    setlen(result, int(len))
+  elif defined(linux):
+    result = getApplAux("/proc/self/exe")
+  elif defined(solaris):
+    result = getApplAux("/proc/" & $getpid() & "/path/a.out")
+  elif defined(bsd):
+    result = getApplAux("/proc/" & $getpid() & "file")
+  else:
+    # little heuristic that may work on other POSIX-like systems:
+    result = getEnv("_")
+    if len(result) == 0:
+      result = ParamStr(0) # POSIX guaranties that this contains the executable
+                           # as it has been executed by the calling process
+      if len(result) > 0 and result[0] != DirSep: # not an absolute path?
+        # iterate over any path in the $PATH environment variable
+        for p in split(getEnv("PATH"), {PathSep}):
+          var x = joinPath(p, result)
+          if ExistsFile(x): return x
+
+{.push warnings: off.}
+proc getApplicationDir(): string =
+  var tail: string
+  splitPath(getApplicationFilename(), result, tail)
+{.pop.}
+
+proc getCurrentDir(): string =
+  const
+    bufsize = 512 # should be enough
+  result = newString(bufsize)
+  if getcwd(result, bufsize) != nil:
+    setlen(result, strlen(result))
+  else:
+    raise newException(EOS, "getcwd failed")
+
+proc JoinPath(head, tail: string): string =
+  if len(head) == 0:
+    result = tail
+  elif head[len(head)-1] in {DirSep, AltSep}:
+    if tail[0] in {DirSep, AltSep}:
+      result = head & copy(tail, 1)
+    else:
+      result = head & tail
+  else:
+    if tail[0] in {DirSep, AltSep}:
+      result = head & tail
+    else:
+      result = head & DirSep & tail
+
+proc JoinPath(parts: openarray[string]): string =
+  result = parts[0]
+  for i in 1..high(parts):
+    result = JoinPath(result, parts[i])
+
+proc parentDir(path: string): string =
+  var
+    sepPos = -1
+    q = 1
+  if path[len(path)-1] in {dirsep, altsep}:
+    q = 2
+  for i in countdown(len(path)-q, 0):
+    if path[i] in {dirsep, altsep}:
+      sepPos = i
+      break
+  if sepPos >= 0:
+    result = copy(path, 0, sepPos-1)
+  else:
+    result = path
+
+proc SplitPath(path: string, head, tail: var string) =
+  var
+    sepPos = -1
+  for i in countdown(len(path)-1, 0):
+    if path[i] in {dirsep, altsep}:
+      sepPos = i
+      break
+  if sepPos >= 0:
+    head = copy(path, 0, sepPos-1)
+    tail = copy(path, sepPos+1)
+  else:
+    head = ""
+    tail = path # make a string copy here
+
+# helper:
+proc searchExtPos(s: string): int =
+  result = -1
+  for i in countdown(len(s)-1, 0):
+    if s[i] == extsep:
+      result = i
+      break
+    elif s[i] in {dirsep, altsep}:
+      break # do not skip over path
+
+proc SplitFilename(filename: string, name, extension: var string) =
+  var
+    extPos = searchExtPos(filename)
+  if extPos >= 0:
+    name = copy(filename, 0, extPos-1)
+    extension = copy(filename, extPos)
+  else:
+    name = filename # make a string copy here
+    extension = ""
+
+proc normExt(ext: string): string =
+  if ext == "" or ext[0] == extSep: result = ext # no copy needed here
+  else: result = extSep & ext
+
+proc ChangeFileExt(filename, ext: string): string =
+  var
+    extPos = searchExtPos(filename)
+  if extPos < 0: result = filename & normExt(ext)
+  else: result = copy(filename, 0, extPos-1) & normExt(ext)
+
+proc AppendFileExt(filename, ext: string): string =
+  var
+    extPos = searchExtPos(filename)
+  if extPos < 0: result = filename & normExt(ext)
+  else: result = filename #make a string copy here
+
+# some more C things:
+
+proc csystem(cmd: CString): cint {.importc: "system", noDecl.}
+  # is in <stdlib.h>!
+
+when defined(wcc):
+  # everywhere it is in <stdlib.h>, except for Watcom C ...
+  proc cputenv(env: CString): cint {.importc: "putenv", header: "<process.h>".}
+
+else: # is in <stdlib.h>
+  proc cputenv(env: CString): cint {.importc: "putenv", noDecl.} 
+
+proc cgetenv(env: CString): CString {.importc: "getenv", noDecl.}
+
+#long  _findfirst(char *, struct _finddata_t *);
+#int  _findnext(long, struct _finddata_t *);
+#int  _findclose(long);
+when defined(windows):
+  type
+    TFindData {.importc: "struct _finddata_t".} = record
+      attrib {.importc: "attrib".}: cint
+      time_create {.importc: "time_create".}: cint
+      time_access {.importc: "time_access".}: cint
+      time_write {.importc: "time_write".}: cint
+      size {.importc: "size".}: cint
+      name {.importc: "name".}: array[0..259, char]
+
+  proc findfirst(pathname: CString, f: ptr TFindData): cint {.
+    importc: "_findfirst", header: "<io.h>".}
+  proc findnext(handle: cint, f: ptr TFindData): cint {.
+    importc: "_findnext", header: "<io.h>".}
+  proc findclose(handle: cint) {.importc: "_findclose", header: "<io.h>".}
+else:
+  type
+    TFindData {.importc: "glob_t".} = record
+      gl_pathc: int     # count of paths matched by pattern
+      gl_pathv: ptr array[0..1000_000, CString] # list of matched path names
+      gl_offs: int      # slots to reserve at beginning of gl_pathv
+    PFindData = ptr TFindData
+
+  proc glob(pattern: cstring, flags: cint, errfunc: pointer,
+            pglob: PFindData): cint {.
+    importc: "glob", header: "<glob.h>".}
+
+  proc globfree(pglob: PFindData) {.
+    importc: "globfree", header: "<glob.h>".}
+
+proc cremove(filename: CString): cint {.importc: "remove", noDecl.}
+proc crename(oldname, newname: CString): cint {.importc: "rename", noDecl.}
+
+when defined(Windows):
+  proc cCopyFile(lpExistingFileName, lpNewFileName: CString,
+                 bFailIfExists: cint): cint {.
+    importc: "CopyFile", header: "<windows.h>".}
+  #  cMoveFile(lpExistingFileName, lpNewFileName: CString): int
+  #    {.importc: "MoveFile", noDecl, header: "<winbase.h>".}
+  #  cRemoveFile(filename: CString, cmo: int)
+  #    {.importc: "DeleteFile", noDecl, header: "<winbase.h>".}
+else:
+  # generic version of cCopyFile which works for any platform:
+  proc cCopyFile(lpExistingFileName, lpNewFileName: CString,
+            bFailIfExists: cint): cint =
+    const
+      bufSize = 8192 # 8K buffer
+    var
+      dest, src: TFile
+    if not openFile(src, $lpExistingFilename): return -1
+    if not openFile(dest, $lpNewFilename, fmWrite):
+      closeFile(src)
+      return -1
+    var
+      buf: Pointer = alloc(bufsize)
+      bytesread, byteswritten: int
+    while True:
+      bytesread = readBuffer(src, buf, bufsize)
+      byteswritten = writeBuffer(dest, buf, bytesread)
+      if bytesread != bufSize: break
+    if byteswritten == bytesread: result = 0
+    else: result = -1
+    dealloc(buf)
+    closeFile(src)
+    closeFile(dest)
+
+
+proc moveFile(dest, source: string) =
+  if crename(source, dest) != 0:
+    raise newException(EOS, "cannot move file from '$1' to '$2'" %
+      [source, dest])
+
+proc copyFile(dest, source: string) =
+  if cCopyFile(source, dest, 0) != 0:
+    raise newException(EOS, "cannot copy file from '$1' to '$2'" %
+      [source, dest])
+
+proc removeFile(file: string) =
+  if cremove(file) != 0:
+    raise newException(EOS, "cannot remove file '$1'" % file)
+
+proc removeDir(dir: string) =
+  if rmdir(dir) != 0:
+    raise newException(EOS, "cannot remove directory '$1'" % dir)
+
+proc createDir(dir: string) =
+  when defined(unix):
+    if mkdir(dir, 0o711) != 0 and int(errno) != EEXIST:
+      raise newException(EOS, "cannot create directory '$1'" % dir)
+  else:
+    if CreateDirectory(dir, nil) == 0 and GetLastError() != 183:
+      raise newException(EOS, "cannot create directory '$1'" % dir)
+
+proc existsDir(dir: string): bool =
+  var safe = getCurrentDir()
+  # just try to set the current dir to dir; if it works, it must exist:
+  result = chdir(dir) == 0
+  if result:
+    setCurrentDir(safe) # set back to the old working directory
+
+proc executeProcess(command: string): int =
+  return csystem(command) # XXX: do this without shell
+
+proc executeShellCommand(command: string): int =
+  return csystem(command)
+
+var
+  envComputed: bool = false
+  environment {.noStatic.}: seq[string] = []
+
+when defined(windows):
+  # because we support Windows GUI applications, things get really
+  # messy here...
+  proc GetEnvironmentStrings(): Pointer {.
+    importc: "GetEnvironmentStrings", header: "<windows.h>".}
+  proc FreeEnvironmentStrings(env: Pointer) {.
+    importc: "FreeEnvironmentStrings", header: "<windows.h>".}
+  proc strEnd(cstr: CString, c = 0): CString {.importc: "strchr", nodecl.}
+
+  proc getEnvVarsC() {.noStatic.} =
+    if not envComputed:
+      var
+        env = cast[CString](getEnvironmentStrings())
+        e = env
+      if e == nil: return # an error occured
+      while True:
+        var eend = strEnd(e)
+        add environment, $e
+        e = cast[CString](cast[TAddress](eend)+1)
+        if eend[1] == '\0': break
+      envComputed = true
+      FreeEnvironmentStrings(env)
+
+else:
+  var
+    gEnv {.importc: "gEnv".}: ptr array [0..10_000, CString]
+
+  proc getEnvVarsC() {.noStatic.} =
+    # retrieves the variables of char** env of C's main proc
+    if not envComputed:
+      var
+        i: int = 0
+      while True:
+        if gEnv[i] == nil: break
+        add environment, $gEnv[i]
+        inc(i)
+      envComputed = true
+
+proc findEnvVar(key: string): int =
+  getEnvVarsC()
+  var temp = key & '='
+  for i in 0..high(environment):
+    if findSubStr(temp, environment[i]) == 0: return i
+  return -1
+
+proc getEnv(key: string): string =
+  var i = findEnvVar(key)
+  if i >= 0: 
+    return copy(environment[i], findSubStr("=", environment[i])+1)
+  else: 
+    var env = cgetenv(key)
+    if env == nil: return ""
+    result = $env
+
+proc existsEnv(key: string): bool =
+  if cgetenv(key) != nil: return true
+  else: return findEnvVar(key) >= 0
+
+iterator iterOverEnvironment*(): tuple[string, string] =
+  ## Iterate over all environments varialbes. In the first component of the
+  ## tuple is the name of the current variable stored, in the second its value.
+  getEnvVarsC()
+  for i in 0..high(environment):
+    var p = findSubStr("=", environment[i])
+    yield (copy(environment[i], 0, p-1), copy(environment[i], p+1))
+
+proc putEnv(key, val: string) =
+  # Note: by storing the string in the environment sequence,
+  # we gurantee that we don't free the memory before the program
+  # ends (this is needed for POSIX compliance). It is also needed so that 
+  # the process itself may access its modified environment variables!
+  var indx = findEnvVar(key)
+  if indx >= 0:
+    environment[indx] = key & '=' & val
+  else:
+    add environment, (key & '=' & val)
+    indx = high(environment)
+  if cputenv(environment[indx]) != 0:
+    raise newException(EOS, "attempt to set an invalid environment variable")
+
+iterator walkFiles*(pattern: string): string =
+  ## Iterate over all the files that match the `pattern`.
+  ##
+  ## `pattern` is OS dependant, but at least the "\*.ext"
+  ## notation is supported.
+  when defined(windows):
+    var
+      f: TFindData
+      res: int
+    res = findfirst(pattern, addr(f))
+    if res != -1:
+      while true:
+        yield $f.name
+        if int(findnext(res, addr(f))) == -1: break
+      findclose(res)
+  else: # here we use glob
+    var
+      f: TFindData
+      res: int
+    f.gl_offs = 0
+    f.gl_pathc = 0
+    f.gl_pathv = nil
+    res = glob(pattern, 0, nil, addr(f))
+    if res != 0: raise newException(EOS, "walkFiles() failed")
+    for i in 0.. f.gl_pathc - 1:
+      assert(f.gl_pathv[i] != nil)
+      yield $f.gl_pathv[i]
+    globfree(addr(f))
+
+{.push warnings:off.}
+proc ExistsFile(filename: string): bool =
+  var
+    res: TStat
+  return stat(filename, res) >= 0
+{.pop.}
+
+proc cmpPaths(pathA, pathB: string): int =
+  if FileSystemCaseSensitive:
+    result = cmp(pathA, pathB)
+  else:
+    result = cmpIgnoreCase(pathA, pathB)
+
+proc extractDir(path: string): string =
+  var
+    tail: string
+  splitPath(path, result, tail)
+
+proc extractFilename(path: string): string =
+  var
+    head: string
+  splitPath(path, head, result)
+
+proc expandFilename(filename: string): string =
+  # returns the full path of 'filename'; "" on error
+  var
+    res: CString
+  when defined(unix):
+    res = realpath(filename, nil)
+  else:
+    res = fullpath(nil, filename, 0)
+  if res == nil:
+    result = "" # an error occured
+  else:
+    result = $res
+    free(res)
+
+when defined(windows):
+  proc GetHomeDir(): string = return getEnv("USERPROFILE") & "\\"
+  proc GetConfigDir(): string = return getEnv("APPDATA") & "\\"
+
+  # Since we support GUI applications with Nimrod, we sometimes generate
+  # a WinMain entry proc. But a WinMain proc has no access to the parsed
+  # command line arguments. The way to get them differs. Thus we parse them
+  # ourselves. This has the additional benefit that the program's behaviour
+  # is always the same -- independent of the used C compiler.
+  proc GetCommandLine(): CString {.
+    importc: "GetCommandLine", header: "<windows.h>".}
+
+  var
+    ownArgc: int = -1
+    ownArgv: seq[string] = []
+
+  proc parseCmdLine() =
+    if ownArgc != -1: return # already processed
+    var
+      i = 0
+      j = 0
+      c = getCommandLine()
+    ownArgc = 0
+    while c[i] != '\0':
+      var a = ""
+      while c[i] >= '\1' and c[i] <= ' ': inc(i) # skip whitespace
+      case c[i]
+      of '\'', '\"':
+        var delim = c[i]
+        inc(i) # skip ' or "
+        while c[i] != '\0' and c[i] != delim:
+          add a, c[i]
+          inc(i)
+        if c[i] != '\0': inc(i)
+      else:
+        while c[i] > ' ':
+          add a, c[i]
+          inc(i)
+      add ownArgv, a
+      inc(ownArgc)
+
+  proc paramStr(i: int): string =
+    parseCmdLine()
+    if i < ownArgc and i >= 0:
+      return ownArgv[i]
+    raise newException(EInvalidIndex, "invalid index")
+
+  proc paramCount(): int =
+    parseCmdLine()
+    result = ownArgc-1
+
+else:
+  proc GetHomeDir(): string = return getEnv("HOME") & "/"
+  proc GetConfigDir(): string = return getEnv("HOME") & "/"
+
+  var
+    cmdCount {.importc: "cmdCount".}: int
+    cmdLine {.importc: "cmdLine".}: cstringArray
+
+  proc paramStr(i: int): string =
+    if i < cmdCount and i >= 0: return $cmdLine[i]
+    raise newException(EInvalidIndex, "invalid index")
+
+  proc paramCount(): int = return cmdCount-1
+
+{.pop.}
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
new file mode 100755
index 000000000..9a18d0e17
--- /dev/null
+++ b/lib/posix/posix.nim
@@ -0,0 +1,1818 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+# Until ndbm!!

+# done: ipc, pwd, stat, semaphore, sys/types, sys/utsname, pthread, unistd,

+# statvfs, mman, time, wait, signal, nl_types, sched, spawn, select, ucontext

+

+## This is a raw POSIX interface module. It does not not provide any

+## convenience: cstrings are used instead of proper Nimrod strings and

+## return codes indicate errors. If you want exceptions 

+## and a proper Nimrod-like interface, use the OS module.

+

+## Coding conventions:

+## ALL types are named the same as in the POSIX standard except that they start

+## with 'T' or 'P' (if they are pointers) and without the '_t' prefix to be

+## consistent with Nimrod conventions. If an identifier is a Nimrod keyword

+## the `identifier` notation is used.

+##

+## This library relies on the header files of your C compiler. Thus the

+## resulting C code will just include <XYZ.h> and *not* define the

+## symbols declared here.

+

+const

+  C_IRUSR* = 0c000400 ## Read by owner.

+  C_IWUSR* = 0c000200 ## Write by owner.

+  C_IXUSR* = 0c000100 ## Execute by owner.

+  C_IRGRP* = 0c000040 ## Read by group.

+  C_IWGRP* = 0c000020 ## Write by group.

+  C_IXGRP* = 0c000010 ## Execute by group.

+  C_IROTH* = 0c000004 ## Read by others.

+  C_IWOTH* = 0c000002 ## Write by others.

+  C_IXOTH* = 0c000001 ## Execute by others.

+  C_ISUID* = 0c004000 ## Set user ID.

+  C_ISGID* = 0c002000 ## Set group ID.

+  C_ISVTX* = 0c001000 ## On directories, restricted deletion flag.

+  C_ISDIR* = 0c040000 ## Directory.

+  C_ISFIFO* = 0c010000 ##FIFO.

+  C_ISREG* = 0c100000 ## Regular file.

+  C_ISBLK* = 0c060000 ## Block special.

+  C_ISCHR* = 0c020000 ## Character special.

+  C_ISCTG* = 0c110000 ## Reserved.

+  C_ISLNK* = 0c120000 ## Symbolic link.</p>

+  C_ISSOCK* = 0c140000 ## Socket.

+

+  MM_NULLLBL* = nil

+  MM_NULLSEV* = 0

+  MM_NULLMC* = 0

+  MM_NULLTXT* = nil

+  MM_NULLACT* = nil

+  MM_NULLTAG* = nil

+  

+  STDERR_FILENO = 2 ## File number of stderr;

+  STDIN_FILENO = 0 ## File number of stdin;

+  STDOUT_FILENO = 1 ## File number of stdout; 

+

+type

+  Taiocb* {.importc: "struct aiocb", header: "<aio.h>".} = record

+    aio_fildes*: cint ##    File descriptor. 

+    aio_offset*: TOff ##    File offset. 

+    aio_buf*: pointer ##    Location of buffer. 

+    aio_nbytes*: int   ##  Length of transfer. 

+    aio_reqprio*: cint ##   Request priority offset. 

+    aio_sigevent*: TSigEvent  ## Signal number and value. 

+    aio_lio_opcode: cint ## Operation to be performed. 

+

+  TDIR* {.importc: "DIR", header: "<dirent.h>".} = record

+    ## A type representing a directory stream. 

+

+  Tdirent* {.importc: "struct dirent", header: "<dirent.h>".} = record

+    d_ino*: TIno  ## File serial number.

+    d_name*: array [0..255, char] ## Name of entry.

+

+  Tflock* {.importc: "flock", header: "<fcntl>".} = record

+    l_type*: cshort  ## Type of lock; F_RDLCK, F_WRLCK, F_UNLCK. 

+    l_whence*: cshort ## Flag for starting offset. 

+    l_start*: Toff ## Relative offset in bytes. 

+    l_len*: Toff   ## Size; if 0 then until EOF. 

+    l_pid*: TPid   ## Process ID of the process holding the lock; 

+                   ## returned with F_GETLK. 

+  

+  Tfenv* {.importc: "fenv_t", header: "<fenv.h>".} = 

+    record ## Represents the entire floating-point environment. The

+           ## floating-point environment refers collectively to any

+           ## floating-point status flags and control modes supported

+           ## by the implementation.

+  Tfexcept* {.importc: "fexcept_t", header: "<fenv.h>".} = 

+    record ## Represents the floating-point status flags collectively, 

+           ## including any status the implementation associates with the 

+           ## flags. A floating-point status flag is a system variable 

+           ## whose value is set (but never cleared) when a floating-point

+           ## exception is raised, which occurs as a side effect of

+           ## exceptional floating-point arithmetic to provide auxiliary

+           ## information. A floating-point control mode is a system variable

+           ## whose value may be set by the user to affect the subsequent 

+           ## behavior of floating-point arithmetic.

+

+  TFTW* {.importc: "struct FTW", header: "<ftw.h>".} = record

+    base*: cint

+    level*: cint

+    

+  TGlob* {.importc: "glob_t", header: "<glob.h>".} = record

+    gl_pathc*: int ## Count of paths matched by pattern. 

+    gl_pathv*: ptr cstring ## Pointer to a list of matched pathnames. 

+    gl_offs*: int ##  Slots to reserve at the beginning of gl_pathv. 

+  

+  TGroup* {.importc: "struct group", header: "<grp.h>".} = record

+    gr_name*: cstring ## The name of the group. 

+    gr_gid*: TGid  ## Numerical group ID. 

+    gr_mem*: cstringArray ## Pointer to a null-terminated array of character 

+                          ## pointers to member names. 

+

+  Ticonv* {.importc: "iconv_t", header: "<iconv.h>".} = 

+    record ## Identifies the conversion from one codeset to another.

+

+  Tlconv* {.importc: "struct lconv", header: "<locale.h>".} = record

+    currency_symbol*: cstring

+    decimal_point*: cstring

+    frac_digits*: char

+    grouping*: cstring

+    int_curr_symbol*: cstring

+    int_frac_digits*: char

+    int_n_cs_precedes*: char

+    int_n_sep_by_space*: char

+    int_n_sign_posn*: char

+    int_p_cs_precedes*: char

+    int_p_sep_by_space*: char

+    int_p_sign_posn*: char

+    mon_decimal_point*: cstring

+    mon_grouping*: cstring

+    mon_thousands_sep*: cstring

+    negative_sign*: cstring

+    n_cs_precedes*: char

+    n_sep_by_space*: char

+    n_sign_posn*: char

+    positive_sign*: cstring

+    p_cs_precedes*: char

+    p_sep_by_space*: char

+    p_sign_posn*: char

+    thousands_sep*: cstring

+

+  TMqd* {.importc: "mqd_t", header: "<mqueue.h>".} = record

+  TMqAttr* {.importc: "struct mq_attr", header: "<mqueue.h>".} = record

+    mq_flags*: int ##    Message queue flags. 

+    mq_maxmsg*: int ##   Maximum number of messages. 

+    mq_msgsize*: int ##  Maximum message size. 

+    mq_curmsgs*: int ##  Number of messages currently queued. 

+

+  TPasswd* {.importc: "struct passwd", header: "<pwd.h>".} = record

+    pw_name*: cstring ##   User's login name. 

+    pw_uid*: TUid ##    Numerical user ID. 

+    pw_gid*: TGid ##    Numerical group ID. 

+    pw_dir*: cstring ## Initial working directory. 

+    pw_shell*: cstring ##  Program to use as shell. 

+

+  Tblkcnt* {.importc: "blkcnt_t", header: "<sys/types.h>".} = int

+    ## used for file block counts

+  Tblksize* {.importc: "blksize_t", header: "<sys/types.h>".} = int

+    ## used for block sizes

+  TClock* {.importc: "clock_t", header: "<sys/types.h>".} = int

+  TClockId* {.importc: "clockid_t", header: "<sys/types.h>".} = int

+  TDev* {.importc: "dev_t", header: "<sys/types.h>".} = int

+  Tfsblkcnt* {.importc: "fsblkcnt_t", header: "<sys/types.h>".} = int

+  Tfsfilcnt* {.importc: "fsfilcnt_t", header: "<sys/types.h>".} = int

+  TGid* {.importc: "gid_t", header: "<sys/types.h>".} = int

+  Tid* {.importc: "id_t", header: "<sys/types.h>".} = int

+  Tino* {.importc: "ino_t", header: "<sys/types.h>".} = int

+  TKey* {.importc: "key_t", header: "<sys/types.h>".} = int

+  TMode* {.importc: "mode_t", header: "<sys/types.h>".} = int

+  TNlink* {.importc: "nlink_t", header: "<sys/types.h>".} = int

+  TOff* {.importc: "off_t", header: "<sys/types.h>".} = int64

+  TPid* {.importc: "pid_t", header: "<sys/types.h>".} = int

+  Tpthread_attr* {.importc: "pthread_attr_t", header: "<sys/types.h>".} = int

+  Tpthread_barrier* {.importc: "pthread_barrier_t", header: "<sys/types.h>".} = int

+  Tpthread_barrierattr* {.importc: "pthread_barrierattr_t", header: "<sys/types.h>".} = int

+  Tpthread_cond* {.importc: "pthread_cond_t", header: "<sys/types.h>".} = int

+  Tpthread_condattr* {.importc: "pthread_condattr_t", header: "<sys/types.h>".} = int

+  Tpthread_key* {.importc: "pthread_key_t", header: "<sys/types.h>".} = int

+  Tpthread_mutex* {.importc: "pthread_mutex_t", header: "<sys/types.h>".} = int

+  Tpthread_mutexattr* {.importc: "pthread_mutexattr_t", header: "<sys/types.h>".} = int

+  Tpthread_once* {.importc: "pthread_once_t", header: "<sys/types.h>".} = int

+  Tpthread_rwlock* {.importc: "pthread_rwlock_t", header: "<sys/types.h>".} = int

+  Tpthread_rwlockattr* {.importc: "pthread_rwlockattr_t", header: "<sys/types.h>".} = int

+  Tpthread_spinlock* {.importc: "pthread_spinlock_t", header: "<sys/types.h>".} = int

+  Tpthread* {.importc: "pthread_t", header: "<sys/types.h>".} = int

+  Tsuseconds* {.importc: "suseconds_t", header: "<sys/types.h>".} = int

+  Ttime* {.importc: "time_t", header: "<sys/types.h>".} = int

+  Ttimer* {.importc: "timer_t", header: "<sys/types.h>".} = int

+  Ttrace_attr* {.importc: "trace_attr_t", header: "<sys/types.h>".} = int

+  Ttrace_event_id* {.importc: "trace_event_id_t", header: "<sys/types.h>".} = int

+  Ttrace_event_set* {.importc: "trace_event_set_t", header: "<sys/types.h>".} = int

+  Ttrace_id* {.importc: "trace_id_t", header: "<sys/types.h>".} = int

+  Tuid* {.importc: "uid_t", header: "<sys/types.h>".} = int

+  Tuseconds* {.importc: "useconds_t", header: "<sys/types.h>".} = int

+  

+  Tutsname* {.importc: "struct utsname", header: "<sys/utsname.h>".} = record

+    sysname*,    ## Name of this implementation of the operating system. 

+      nodename*,   ## Name of this node within the communications 

+                   ## network to which this node is attached, if any. 

+      release*,    ## Current release level of this implementation. 

+      version*,    ## Current version level of this release. 

+      machine*: array [0..255, char] ## Name of the hardware type on which the

+                                     ## system is running. 

+

+  TSem* {.importc: "sem_t", header: "<semaphore.h>".} = record

+  Tipc_perm* {.importc: "struct ipc_perm", header: "<sys/ipc.h>".} = record

+    uid*: tuid    ## Owner's user ID. 

+    gid*: tgid    ## Owner's group ID. 

+    cuid*: Tuid   ## Creator's user ID. 

+    cgid*: Tgid   ## Creator's group ID. 

+    mode*: TMode   ## Read/write permission. 

+  

+  TStat* {.importc: "struct stat", header: "<sys/stat.h>".} = record

+    st_dev*: TDev  ##   Device ID of device containing file. 

+    st_ino*: TIno  ##   File serial number. 

+    st_mode*: TMode ##   Mode of file (see below). 

+    st_nlink*: tnlink ##   Number of hard links to the file. 

+    st_uid*: tuid ##   User ID of file. 

+    st_gid*: Tgid ##   Group ID of file. 

+    st_rdev*: TDev ##   Device ID (if file is character or block special). 

+    st_size*: TOff ##   For regular files, the file size in bytes. 

+                   ## For symbolic links, the length in bytes of the 

+                   ## pathname contained in the symbolic link. 

+                   ## For a shared memory object, the length in bytes. 

+                   ## For a typed memory object, the length in bytes. 

+                   ## For other file types, the use of this field is 

+                   ## unspecified. 

+    st_atime*: ttime ## Time of last access. 

+    st_mtime*: ttime ## Time of last data modification. 

+    st_ctime*: ttime ## Time of last status change. 

+    st_blksize*: Tblksize ## A file system-specific preferred I/O block size  

+                          ## for this object. In some file system types, this 

+                          ## may vary from file to file. 

+    st_blocks*: Tblkcnt ## Number of blocks allocated for this object. 

+

+  

+  TStatvfs* {.importc: "struct statvfs", header: "<sys/statvfs.h>".} = record  

+    f_bsize*: int   ## File system block size. 

+    f_frsize*: int  ## Fundamental file system block size. 

+    f_blocks*: Tfsblkcnt  ## Total number of blocks on file system in units of f_frsize. 

+    f_bfree*: Tfsblkcnt  ## Total number of free blocks. 

+    f_bavail*: Tfsblkcnt ## Number of free blocks available to 

+                         ## non-privileged process. 

+    f_files*: Tfsfilcnt  ## Total number of file serial numbers. 

+    f_ffree*: Tfsfilcnt   ## Total number of free file serial numbers. 

+    f_favail*: Tfsfilcnt  ## Number of file serial numbers available to 

+                          ## non-privileged process. 

+    f_fsid*: int    ## File system ID. 

+    f_flag*: int    ## Bit mask of f_flag values. 

+    f_namemax*: int ##  Maximum filename length. 

+

+  Tposix_typed_mem_info* {.importc: "struct posix_typed_mem_info", 

+                           header: "<sys/mman.h>".} = record

+    posix_tmi_length*: int

+  

+  Ttm* {.importc: "struct tm", header: "<time.h>".} = record

+    tm_sec*: cint ## Seconds [0,60]. 

+    tm_min*: cint   ## Minutes [0,59]. 

+    tm_hour*: cint  ## Hour [0,23]. 

+    tm_mday*: cint  ## Day of month [1,31]. 

+    tm_mon*: cint   ## Month of year [0,11]. 

+    tm_year*: cint  ## Years since 1900. 

+    tm_wday*: cint  ## Day of week [0,6] (Sunday =0). 

+    tm_yday*: cint  ## Day of year [0,365]. 

+    tm_isdst*: cint ## Daylight Savings flag. 

+  Ttimespec* {.importc: "struct timespec", header: "<time.h>".} = record

+    tv_sec*: Ttime ## Seconds. 

+    tv_nsec*: int ## Nanoseconds. 

+  titimerspec* {.importc: "struct itimerspec", header: "<time.h>".} = record

+    it_interval*: ttimespec ## Timer period. 

+    it_value*: ttimespec    ## Timer expiration. 

+  

+  Tsig_atomic* {.importc: "sig_atomic_t", header: "<signal.h>".} = cint

+    ## Possibly volatile-qualified integer type of an object that can be 

+    ## accessed as an atomic entity, even in the presence of asynchronous

+    ## interrupts.

+  Tsigset* {.importc: "sigset_t", header: "<signal.h>".} = record

+  

+  TsigEvent* {.importc: "struct sigevent", header: "<signal.h>".} = record

+    sigev_notify*: cint           ## Notification type. 

+    sigev_signo*: cint            ## Signal number. 

+    sigev_value*: Tsigval        ##     Signal value. 

+    sigev_notify_function*: proc (x: TSigval) {.noconv.} ##  Notification function. 

+    sigev_notify_attributes*: ptr Tpthreadattr ## Notification attributes.

+

+  TsigVal* {.importc: "union sigval", header: "<signal.h>".} = record

+    sival_ptr*: pointer ## pointer signal value; 

+                        ## integer signal value not defined!

+  TSigaction* {.importc: "struct sigaction", header: "<signal.h>".} = record

+    sa_handler*: proc (x: cint) {.noconv.}  ## Pointer to a signal-catching

+                                            ## function or one of the macros 

+                                            ## SIG_IGN or SIG_DFL. 

+    sa_mask*: TsigSet ## Set of signals to be blocked during execution of 

+                      ## the signal handling function. 

+    sa_flags*: cint   ## Special flags. 

+    sa_sigaction*: proc (x: cint, y: var TSigInfo, z: pointer) {.noconv.}

+

+  TStack* {.importc: "stack_t", header: "<signal.h>".} = record

+    ss_sp*: pointer ##       Stack base or pointer. 

+    ss_size*: int ##     Stack size. 

+    ss_flags*: cint ##    Flags. 

+

+  TSigStack* {.importc: "struct sigstack", header: "<signal.h>".} = record

+    ss_onstack*: cint ##  Non-zero when signal stack is in use. 

+    ss_sp*: pointer ## Signal stack pointer. 

+

+  TsigInfo* {.importc: "siginfo_t", header: "<signal.h>".} = record

+    si_signo*: cint ##  Signal number. 

+    si_code*: cint ##   Signal code. 

+    si_errno*: cint ##  If non-zero, an errno value associated with 

+                    ## this signal, as defined in <errno.h>. 

+    si_pid*: tpid ##    Sending process ID. 

+    si_uid*: tuid ##    Real user ID of sending process. 

+    si_addr*: pointer ##   Address of faulting instruction. 

+    si_status*: cint ## Exit value or signal. 

+    si_band*: int ##   Band event for SIGPOLL. 

+    si_value*: TSigval ## Signal value. 

+  

+  Tnl_item* {.importc: "nl_item", header: "<nl_types.h>".} = cint

+  Tnl_catd* {.importc: "nl_catd", header: "<nl_types.h>".} = cint

+

+  Tsched_param* {.importc: "struct sched_param", header: "<sched.h>".} = record

+    sched_priority*: cint

+    sched_ss_low_priority*: cint ## Low scheduling priority for 

+                                 ## sporadic server. 

+    sched_ss_repl_period*: ttimespec ## Replenishment period for 

+                                     ## sporadic server. 

+    sched_ss_init_budget*: ttimespec ##  Initial budget for sporadic server. 

+    sched_ss_max_repl*: cint    ## Maximum pending replenishments for 

+                                ## sporadic server. 

+

+  Ttimeval* {.importc: "struct timeval", header: "<sys/select.h>".} = record

+    tv_sec*: ttime ##      Seconds. 

+    tv_usec*: tsuseconds ##     Microseconds. 

+  Tfd_set* {.importc: "struct fd_set", header: "<sys/select.h>".} = record

+ 

+  Tposix_spawnattr* {.importc: "posix_spawnattr_t", header: "<spawn.h>".} = cint

+  Tposix_spawn_file_actions* {.importc: "posix_spawn_file_actions_t", header: "<spawn.h>".} = cint 

+  Tmcontext* {.importc: "mcontext_t", header: "<ucontext.h>".} = record

+  Tucontext* {.importc: "ucontext_t", header: "<ucontext.h>".} = record

+    uc_link*: ptr Tucontext ## Pointer to the context that is resumed 

+                            ## when this context returns. 

+    uc_sigmask*: Tsigset ## The set of signals that are blocked when this 

+                         ## context is active. 

+    uc_stack*: TStack    ## The stack used by this context. 

+    uc_mcontext*: Tmcontext ## A machine-specific representation of the saved 

+                            ## context. 

+

+

+  

+# Constants as variables:

+var

+  AIO_ALLDONE* {.importc, header: "<aio.h>".}: cint

+    ## A return value indicating that none of the requested operations 

+    ## could be canceled since they are already complete.

+  AIO_CANCELED* {.importc, header: "<aio.h>".}: cint

+    ## A return value indicating that all requested operations have

+    ## been canceled.

+  AIO_NOTCANCELED* {.importc, header: "<aio.h>".}: cint

+    ## A return value indicating that some of the requested operations could 

+    ## not be canceled since they are in progress.

+  LIO_NOP* {.importc, header: "<aio.h>".}: cint

+    ## A lio_listio() element operation option indicating that no transfer is

+    ## requested.

+  LIO_NOWAIT* {.importc, header: "<aio.h>".}: cint

+    ## A lio_listio() synchronization operation indicating that the calling 

+    ## thread is to continue execution while the lio_listio() operation is 

+    ## being performed, and no notification is given when the operation is

+    ## complete.

+  LIO_READ* {.importc, header: "<aio.h>".}: cint

+    ## A lio_listio() element operation option requesting a read.

+  LIO_WAIT* {.importc, header: "<aio.h>".}: cint

+    ## A lio_listio() synchronization operation indicating that the calling 

+    ## thread is to suspend until the lio_listio() operation is complete.

+  LIO_WRITE* {.importc, header: "<aio.h>".}: cint

+    ## A lio_listio() element operation option requesting a write.

+

+  RTLD_LAZY* {.importc, header: "<dlfcn.h>".}: cint

+    ## Relocations are performed at an implementation-defined time.

+  RTLD_NOW* {.importc, header: "<dlfcn.h>".}: cint

+    ## Relocations are performed when the object is loaded.

+  RTLD_GLOBAL* {.importc, header: "<dlfcn.h>".}: cint

+    ## All symbols are available for relocation processing of other modules.

+  RTLD_LOCAL* {.importc, header: "<dlfcn.h>".}: cint

+    ## All symbols are not made available for relocation processing by 

+    ## other modules. 

+    

+  errno* {.importc, header: "<errno.h>".}: cint ## error variable

+  E2BIG* {.importc, header: "<errno.h>".}: cint

+      ## Argument list too long.

+  EACCES* {.importc, header: "<errno.h>".}: cint

+      ## Permission denied.

+  EADDRINUSE* {.importc, header: "<errno.h>".}: cint

+      ## Address in use.

+  EADDRNOTAVAIL* {.importc, header: "<errno.h>".}: cint

+      ## Address not available.

+  EAFNOSUPPORT* {.importc, header: "<errno.h>".}: cint

+      ## Address family not supported.

+  EAGAIN* {.importc, header: "<errno.h>".}: cint

+      ## Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).

+  EALREADY* {.importc, header: "<errno.h>".}: cint

+      ## Connection already in progress.

+  EBADF* {.importc, header: "<errno.h>".}: cint

+      ## Bad file descriptor.

+  EBADMSG* {.importc, header: "<errno.h>".}: cint

+      ## Bad message.

+  EBUSY* {.importc, header: "<errno.h>".}: cint

+      ## Device or resource busy.

+  ECANCELED* {.importc, header: "<errno.h>".}: cint

+      ## Operation canceled.

+  ECHILD* {.importc, header: "<errno.h>".}: cint

+      ## No child processes.

+  ECONNABORTED* {.importc, header: "<errno.h>".}: cint

+      ## Connection aborted.

+  ECONNREFUSED* {.importc, header: "<errno.h>".}: cint

+      ## Connection refused.

+  ECONNRESET* {.importc, header: "<errno.h>".}: cint

+      ## Connection reset.

+  EDEADLK* {.importc, header: "<errno.h>".}: cint

+      ## Resource deadlock would occur.

+  EDESTADDRREQ* {.importc, header: "<errno.h>".}: cint

+      ## Destination address required.

+  EDOM* {.importc, header: "<errno.h>".}: cint

+      ## Mathematics argument out of domain of function.

+  EDQUOT* {.importc, header: "<errno.h>".}: cint

+      ## Reserved.

+  EEXIST* {.importc, header: "<errno.h>".}: cint

+      ## File exists.

+  EFAULT* {.importc, header: "<errno.h>".}: cint

+      ## Bad address.

+  EFBIG* {.importc, header: "<errno.h>".}: cint

+      ## File too large.

+  EHOSTUNREACH* {.importc, header: "<errno.h>".}: cint

+      ## Host is unreachable.

+  EIDRM* {.importc, header: "<errno.h>".}: cint

+      ## Identifier removed.

+  EILSEQ* {.importc, header: "<errno.h>".}: cint

+      ## Illegal byte sequence.

+  EINPROGRESS* {.importc, header: "<errno.h>".}: cint

+      ## Operation in progress.

+  EINTR* {.importc, header: "<errno.h>".}: cint

+      ## Interrupted function.

+  EINVAL* {.importc, header: "<errno.h>".}: cint

+      ## Invalid argument.

+  EIO* {.importc, header: "<errno.h>".}: cint

+      ## I/O error.

+  EISCONN* {.importc, header: "<errno.h>".}: cint

+      ## Socket is connected.

+  EISDIR* {.importc, header: "<errno.h>".}: cint

+      ## Is a directory.

+  ELOOP* {.importc, header: "<errno.h>".}: cint

+      ## Too many levels of symbolic links.

+  EMFILE* {.importc, header: "<errno.h>".}: cint

+      ## Too many open files.

+  EMLINK* {.importc, header: "<errno.h>".}: cint

+      ## Too many links.

+  EMSGSIZE* {.importc, header: "<errno.h>".}: cint

+      ## Message too large.

+  EMULTIHOP* {.importc, header: "<errno.h>".}: cint

+      ## Reserved.

+  ENAMETOOLONG* {.importc, header: "<errno.h>".}: cint

+      ## Filename too long.

+  ENETDOWN* {.importc, header: "<errno.h>".}: cint

+      ## Network is down.

+  ENETRESET* {.importc, header: "<errno.h>".}: cint

+      ## Connection aborted by network.

+  ENETUNREACH* {.importc, header: "<errno.h>".}: cint

+      ## Network unreachable.

+  ENFILE* {.importc, header: "<errno.h>".}: cint

+      ## Too many files open in system.

+  ENOBUFS* {.importc, header: "<errno.h>".}: cint

+      ## No buffer space available.

+  ENODATA* {.importc, header: "<errno.h>".}: cint

+      ## No message is available on the STREAM head read queue.

+  ENODEV* {.importc, header: "<errno.h>".}: cint

+      ## No such device.

+  ENOENT* {.importc, header: "<errno.h>".}: cint

+      ## No such file or directory.

+  ENOEXEC* {.importc, header: "<errno.h>".}: cint

+      ## Executable file format error.

+  ENOLCK* {.importc, header: "<errno.h>".}: cint

+      ## No locks available.

+  ENOLINK* {.importc, header: "<errno.h>".}: cint

+      ## Reserved.

+  ENOMEM* {.importc, header: "<errno.h>".}: cint

+      ## Not enough space.

+  ENOMSG* {.importc, header: "<errno.h>".}: cint

+      ## No message of the desired type.

+  ENOPROTOOPT* {.importc, header: "<errno.h>".}: cint

+      ## Protocol not available.

+  ENOSPC* {.importc, header: "<errno.h>".}: cint

+      ## No space left on device.

+  ENOSR* {.importc, header: "<errno.h>".}: cint

+      ## No STREAM resources.

+  ENOSTR* {.importc, header: "<errno.h>".}: cint

+      ## Not a STREAM.

+  ENOSYS* {.importc, header: "<errno.h>".}: cint

+      ## Function not supported.

+  ENOTCONN* {.importc, header: "<errno.h>".}: cint

+      ## The socket is not connected.

+  ENOTDIR* {.importc, header: "<errno.h>".}: cint

+      ## Not a directory.

+  ENOTEMPTY* {.importc, header: "<errno.h>".}: cint

+      ## Directory not empty.

+  ENOTSOCK* {.importc, header: "<errno.h>".}: cint

+      ## Not a socket.

+  ENOTSUP* {.importc, header: "<errno.h>".}: cint

+      ## Not supported.

+  ENOTTY* {.importc, header: "<errno.h>".}: cint

+      ## Inappropriate I/O control operation.

+  ENXIO* {.importc, header: "<errno.h>".}: cint

+      ## No such device or address.

+  EOPNOTSUPP* {.importc, header: "<errno.h>".}: cint

+      ## Operation not supported on socket.

+  EOVERFLOW* {.importc, header: "<errno.h>".}: cint

+      ## Value too large to be stored in data type.

+  EPERM* {.importc, header: "<errno.h>".}: cint

+      ## Operation not permitted.

+  EPIPE* {.importc, header: "<errno.h>".}: cint

+      ## Broken pipe.

+  EPROTO* {.importc, header: "<errno.h>".}: cint

+      ## Protocol error.

+  EPROTONOSUPPORT* {.importc, header: "<errno.h>".}: cint

+      ## Protocol not supported.

+  EPROTOTYPE* {.importc, header: "<errno.h>".}: cint

+      ## Protocol wrong type for socket.

+  ERANGE* {.importc, header: "<errno.h>".}: cint

+      ## Result too large.

+  EROFS* {.importc, header: "<errno.h>".}: cint

+      ## Read-only file system.

+  ESPIPE* {.importc, header: "<errno.h>".}: cint

+      ## Invalid seek.

+  ESRCH* {.importc, header: "<errno.h>".}: cint

+      ## No such process.

+  ESTALE* {.importc, header: "<errno.h>".}: cint

+      ## Reserved.

+  ETIME* {.importc, header: "<errno.h>".}: cint

+      ## Stream ioctl() timeout.

+  ETIMEDOUT* {.importc, header: "<errno.h>".}: cint

+      ## Connection timed out.

+  ETXTBSY* {.importc, header: "<errno.h>".}: cint

+      ## Text file busy.

+  EWOULDBLOCK* {.importc, header: "<errno.h>".}: cint

+      ## Operation would block (may be the same value as [EAGAIN]).

+  EXDEV* {.importc, header: "<errno.h>".}: cint

+      ## Cross-device link.   

+

+  F_DUPFD* {.importc, header: "<fcntl.h>".}: cint

+    ## Duplicate file descriptor.

+  F_GETFD* {.importc, header: "<fcntl.h>".}: cint

+    ## Get file descriptor flags.

+  F_SETFD* {.importc, header: "<fcntl.h>".}: cint

+    ## Set file descriptor flags.

+  F_GETFL* {.importc, header: "<fcntl.h>".}: cint

+    ## Get file status flags and file access modes.

+  F_SETFL* {.importc, header: "<fcntl.h>".}: cint

+    ## Set file status flags.

+  F_GETLK* {.importc, header: "<fcntl.h>".}: cint

+    ## Get record locking information.

+  F_SETLK* {.importc, header: "<fcntl.h>".}: cint

+    ## Set record locking information.

+  F_SETLKW* {.importc, header: "<fcntl.h>".}: cint

+    ## Set record locking information; wait if blocked.

+  F_GETOWN* {.importc, header: "<fcntl.h>".}: cint

+    ## Get process or process group ID to receive SIGURG signals.

+  F_SETOWN* {.importc, header: "<fcntl.h>".}: cint

+    ## Set process or process group ID to receive SIGURG signals. 

+  FD_CLOEXEC* {.importc, header: "<fcntl.h>".}: cint

+    ## Close the file descriptor upon execution of an exec family function. 

+  F_RDLCK* {.importc, header: "<fcntl.h>".}: cint

+    ## Shared or read lock.

+  F_UNLCK* {.importc, header: "<fcntl.h>".}: cint

+    ## Unlock.

+  F_WRLCK* {.importc, header: "<fcntl.h>".}: cint

+    ## Exclusive or write lock. 

+  O_CREAT* {.importc, header: "<fcntl.h>".}: cint

+    ## Create file if it does not exist.

+  O_EXCL* {.importc, header: "<fcntl.h>".}: cint

+    ## Exclusive use flag.

+  O_NOCTTY* {.importc, header: "<fcntl.h>".}: cint

+    ## Do not assign controlling terminal.

+  O_TRUNC* {.importc, header: "<fcntl.h>".}: cint

+    ## Truncate flag. 

+  O_APPEND* {.importc, header: "<fcntl.h>".}: cint

+    ## Set append mode.

+  O_DSYNC* {.importc, header: "<fcntl.h>".}: cint

+    ## Write according to synchronized I/O data integrity completion.

+  O_NONBLOCK* {.importc, header: "<fcntl.h>".}: cint

+    ## Non-blocking mode.

+  O_RSYNC* {.importc, header: "<fcntl.h>".}: cint

+    ## Synchronized read I/O operations.

+  O_SYNC* {.importc, header: "<fcntl.h>".}: cint

+    ## Write according to synchronized I/O file integrity completion. 

+  O_ACCMODE* {.importc, header: "<fcntl.h>".}: cint

+    ## Mask for file access modes.      

+  O_RDONLY* {.importc, header: "<fcntl.h>".}: cint

+    ## Open for reading only.

+  O_RDWR* {.importc, header: "<fcntl.h>".}: cint

+    ## Open for reading and writing.

+  O_WRONLY* {.importc, header: "<fcntl.h>".}: cint

+    ## Open for writing only. 

+  POSIX_FADV_NORMAL* {.importc, header: "<fcntl.h>".}: cint

+    ## The application has no advice to give on its behavior with

+    ## respect to the specified data. It is the default characteristic

+    ## if no advice is given for an open file.

+  POSIX_FADV_SEQUENTIAL* {.importc, header: "<fcntl.h>".}: cint

+    ## The application expects to access the specified data 

+    # sequentially from lower offsets to higher offsets.

+  POSIX_FADV_RANDOM* {.importc, header: "<fcntl.h>".}: cint

+    ## The application expects to access the specified data in a random order.

+  POSIX_FADV_WILLNEED* {.importc, header: "<fcntl.h>".}: cint

+    ## The application expects to access the specified data in the near future.

+  POSIX_FADV_DONTNEED* {.importc, header: "<fcntl.h>".}: cint

+    ## The application expects that it will not access the specified data

+    ## in the near future.

+  POSIX_FADV_NOREUSE* {.importc, header: "<fcntl.h>".}: cint

+    ## The application expects to access the specified data once and 

+    ## then not reuse it thereafter. 

+

+  FE_DIVBYZERO* {.importc, header: "<fenv.h>".}: cint

+  FE_INEXACT* {.importc, header: "<fenv.h>".}: cint

+  FE_INVALID* {.importc, header: "<fenv.h>".}: cint

+  FE_OVERFLOW* {.importc, header: "<fenv.h>".}: cint

+  FE_UNDERFLOW* {.importc, header: "<fenv.h>".}: cint

+  FE_ALL_EXCEPT* {.importc, header: "<fenv.h>".}: cint

+  FE_DOWNWARD* {.importc, header: "<fenv.h>".}: cint

+  FE_TONEAREST* {.importc, header: "<fenv.h>".}: cint

+  FE_TOWARDZERO* {.importc, header: "<fenv.h>".}: cint

+  FE_UPWARD* {.importc, header: "<fenv.h>".}: cint

+  FE_DFL_ENV* {.importc, header: "<fenv.h>".}: cint

+

+  MM_HARD* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Source of the condition is hardware.

+  MM_SOFT* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Source of the condition is software.

+  MM_FIRM* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Source of the condition is firmware.

+  MM_APPL* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Condition detected by application.

+  MM_UTIL* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Condition detected by utility.

+  MM_OPSYS* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Condition detected by operating system.

+  MM_RECOVER* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Recoverable error.

+  MM_NRECOV* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Non-recoverable error.

+  MM_HALT* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Error causing application to halt.

+  MM_ERROR* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Application has encountered a non-fatal fault.

+  MM_WARNING* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Application has detected unusual non-error condition.

+  MM_INFO* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Informative message.

+  MM_NOSEV* {.importc, header: "<fmtmsg.h>".}: cint

+    ## No severity level provided for the message.

+  MM_PRINT* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Display message on standard error.

+  MM_CONSOLE* {.importc, header: "<fmtmsg.h>".}: cint

+    ## Display message on system console. 

+

+  MM_OK* {.importc, header: "<fmtmsg.h>".}: cint

+    ## The function succeeded.

+  MM_NOTOK* {.importc, header: "<fmtmsg.h>".}: cint

+    ## The function failed completely.

+  MM_NOMSG* {.importc, header: "<fmtmsg.h>".}: cint

+    ## The function was unable to generate a message on standard error, 

+    ## but otherwise succeeded.

+  MM_NOCON* {.importc, header: "<fmtmsg.h>".}: cint

+    ## The function was unable to generate a console message, but 

+    ## otherwise succeeded. 

+    

+  FNM_NOMATCH* {.importc, header: "<fnmatch.h>".}: cint

+    ## The string does not match the specified pattern.

+  FNM_PATHNAME* {.importc, header: "<fnmatch.h>".}: cint

+    ## Slash in string only matches slash in pattern.

+  FNM_PERIOD* {.importc, header: "<fnmatch.h>".}: cint

+    ## Leading period in string must be exactly matched by period in pattern.

+  FNM_NOESCAPE* {.importc, header: "<fnmatch.h>".}: cint

+    ## Disable backslash escaping.

+  FNM_NOSYS* {.importc, header: "<fnmatch.h>".}: cint

+    ## Reserved.

+

+  FTW_F* {.importc, header: "<ftw.h>".}: cint

+    ## File.

+  FTW_D* {.importc, header: "<ftw.h>".}: cint

+    ## Directory.

+  FTW_DNR* {.importc, header: "<ftw.h>".}: cint

+    ## Directory without read permission.

+  FTW_DP* {.importc, header: "<ftw.h>".}: cint

+    ## Directory with subdirectories visited.

+  FTW_NS* {.importc, header: "<ftw.h>".}: cint

+    ## Unknown type; stat() failed.

+  FTW_SL* {.importc, header: "<ftw.h>".}: cint

+    ## Symbolic link.

+  FTW_SLN* {.importc, header: "<ftw.h>".}: cint

+    ## Symbolic link that names a nonexistent file.

+

+  FTW_PHYS* {.importc, header: "<ftw.h>".}: cint

+    ## Physical walk, does not follow symbolic links. Otherwise, nftw() 

+    ## follows links but does not walk down any path that crosses itself.

+  FTW_MOUNT* {.importc, header: "<ftw.h>".}: cint

+    ## The walk does not cross a mount point.

+  FTW_DEPTH* {.importc, header: "<ftw.h>".}: cint

+    ## All subdirectories are visited before the directory itself.

+  FTW_CHDIR* {.importc, header: "<ftw.h>".}: cint

+    ## The walk changes to each directory before reading it. 

+

+  GLOB_APPEND* {.importc, header: "<glob.h>".}: cint

+    ## Append generated pathnames to those previously obtained.

+  GLOB_DOOFFS* {.importc, header: "<glob.h>".}: cint

+    ## Specify how many null pointers to add to the beginning of gl_pathv.

+  GLOB_ERR* {.importc, header: "<glob.h>".}: cint

+    ## Cause glob() to return on error.

+  GLOB_MARK* {.importc, header: "<glob.h>".}: cint

+    ## Each pathname that is a directory that matches pattern has a 

+    ## slash appended.

+  GLOB_NOCHECK* {.importc, header: "<glob.h>".}: cint

+    ## If pattern does not match any pathname, then return a list

+    ## consisting of only pattern.

+  GLOB_NOESCAPE* {.importc, header: "<glob.h>".}: cint

+    ## Disable backslash escaping.

+  GLOB_NOSORT* {.importc, header: "<glob.h>".}: cint

+    ## Do not sort the pathnames returned.

+  GLOB_ABORTED* {.importc, header: "<glob.h>".}: cint

+    ## The scan was stopped because GLOB_ERR was set or (*errfunc)() 

+    ## returned non-zero.

+  GLOB_NOMATCH* {.importc, header: "<glob.h>".}: cint

+    ## The pattern does not match any existing pathname, and GLOB_NOCHECK 

+    ## was not set in flags.

+  GLOB_NOSPACE* {.importc, header: "<glob.h>".}: cint

+    ## An attempt to allocate memory failed.

+  GLOB_NOSYS* {.importc, header: "<glob.h>".}: cint

+    ## Reserved

+

+  CODESET* {.importc, header: "<langinfo.h>".}: cint

+    ## Codeset name.

+  D_T_FMT* {.importc, header: "<langinfo.h>".}: cint

+    ## String for formatting date and time.

+  D_FMT * {.importc, header: "<langinfo.h>".}: cint

+    ## Date format string.

+  T_FMT* {.importc, header: "<langinfo.h>".}: cint

+    ## Time format string.

+  T_FMT_AMPM* {.importc, header: "<langinfo.h>".}: cint

+    ## a.m. or p.m. time format string.

+  AM_STR* {.importc, header: "<langinfo.h>".}: cint

+    ## Ante-meridiem affix.

+  PM_STR* {.importc, header: "<langinfo.h>".}: cint

+    ## Post-meridiem affix.

+  DAY_1* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the first day of the week (for example, Sunday).

+  DAY_2* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the second day of the week (for example, Monday).

+  DAY_3* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the third day of the week (for example, Tuesday).

+  DAY_4* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the fourth day of the week (for example, Wednesday).

+  DAY_5* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the fifth day of the week (for example, Thursday).

+  DAY_6* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the sixth day of the week (for example, Friday).

+  DAY_7* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the seventh day of the week (for example, Saturday).

+  ABDAY_1* {.importc, header: "<langinfo.h>".}: cint

+    ## Abbreviated name of the first day of the week.

+  ABDAY_2* {.importc, header: "<langinfo.h>".}: cint

+  ABDAY_3* {.importc, header: "<langinfo.h>".}: cint

+  ABDAY_4* {.importc, header: "<langinfo.h>".}: cint

+  ABDAY_5* {.importc, header: "<langinfo.h>".}: cint

+  ABDAY_6* {.importc, header: "<langinfo.h>".}: cint

+  ABDAY_7* {.importc, header: "<langinfo.h>".}: cint

+  MON_1* {.importc, header: "<langinfo.h>".}: cint

+    ## Name of the first month of the year.

+  MON_2* {.importc, header: "<langinfo.h>".}: cint

+  MON_3* {.importc, header: "<langinfo.h>".}: cint

+  MON_4* {.importc, header: "<langinfo.h>".}: cint

+  MON_5* {.importc, header: "<langinfo.h>".}: cint

+  MON_6* {.importc, header: "<langinfo.h>".}: cint

+  MON_7* {.importc, header: "<langinfo.h>".}: cint

+  MON_8* {.importc, header: "<langinfo.h>".}: cint

+  MON_9* {.importc, header: "<langinfo.h>".}: cint

+  MON_10* {.importc, header: "<langinfo.h>".}: cint

+  MON_11* {.importc, header: "<langinfo.h>".}: cint

+  MON_12* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_1* {.importc, header: "<langinfo.h>".}: cint

+    ## Abbreviated name of the first month.

+  ABMON_2* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_3* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_4* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_5* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_6* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_7* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_8* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_9* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_10* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_11* {.importc, header: "<langinfo.h>".}: cint

+  ABMON_12* {.importc, header: "<langinfo.h>".}: cint

+  ERA* {.importc, header: "<langinfo.h>".}: cint

+    ## Era description segments.

+  ERA_D_FMT* {.importc, header: "<langinfo.h>".}: cint

+    ## Era date format string.

+  ERA_D_T_FMT* {.importc, header: "<langinfo.h>".}: cint

+    ## Era date and time format string.

+  ERA_T_FMT* {.importc, header: "<langinfo.h>".}: cint

+    ## Era time format string.

+  ALT_DIGITS* {.importc, header: "<langinfo.h>".}: cint

+    ## Alternative symbols for digits.

+  RADIXCHAR* {.importc, header: "<langinfo.h>".}: cint

+    ## Radix character.

+  THOUSEP* {.importc, header: "<langinfo.h>".}: cint

+    ## Separator for thousands.

+  YESEXPR* {.importc, header: "<langinfo.h>".}: cint

+    ## Affirmative response expression.

+  NOEXPR* {.importc, header: "<langinfo.h>".}: cint

+    ## Negative response expression.

+  CRNCYSTR* {.importc, header: "<langinfo.h>".}: cint

+    ## Local currency symbol, preceded by '-' if the symbol 

+    ## should appear before the value, '+' if the symbol should appear 

+    ## after the value, or '.' if the symbol should replace the radix

+    ## character. If the local currency symbol is the empty string, 

+    ## implementations may return the empty string ( "" ).

+

+  LC_ALL* {.importc, header: "<locale.h>".}: cint

+  LC_COLLATE* {.importc, header: "<locale.h>".}: cint

+  LC_CTYPE* {.importc, header: "<locale.h>".}: cint

+  LC_MESSAGES* {.importc, header: "<locale.h>".}: cint

+  LC_MONETARY* {.importc, header: "<locale.h>".}: cint

+  LC_NUMERIC* {.importc, header: "<locale.h>".}: cint

+  LC_TIME* {.importc, header: "<locale.h>".}: cint

+  

+  PTHREAD_BARRIER_SERIAL_THREAD* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CANCEL_ASYNCHRONOUS* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CANCEL_ENABLE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CANCEL_DEFERRED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CANCEL_DISABLE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CANCELED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_COND_INITIALIZER* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CREATE_DETACHED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_CREATE_JOINABLE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_EXPLICIT_SCHED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_INHERIT_SCHED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_MUTEX_DEFAULT* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_MUTEX_ERRORCHECK* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_MUTEX_INITIALIZER* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_MUTEX_NORMAL* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_MUTEX_RECURSIVE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_ONCE_INIT* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_PRIO_INHERIT* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_PRIO_NONE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_PRIO_PROTECT* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_PROCESS_SHARED* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_PROCESS_PRIVATE* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_SCOPE_PROCESS* {.importc, header: "<pthread.h>".}: cint

+  PTHREAD_SCOPE_SYSTEM* {.importc, header: "<pthread.h>".}: cint

+

+  POSIX_ASYNC_IO* {.importc: "_POSIX_ASYNC_IO", header: "<unistd.h>".}: cint

+  POSIX_PRIO_IO* {.importc: "_POSIX_PRIO_IO", header: "<unistd.h>".}: cint

+  POSIX_SYNC_IO* {.importc: "_POSIX_SYNC_IO", header: "<unistd.h>".}: cint

+  F_OK* {.importc: "F_OK", header: "<unistd.h>".}: cint

+  R_OK* {.importc: "R_OK", header: "<unistd.h>".}: cint

+  W_OK* {.importc: "W_OK", header: "<unistd.h>".}: cint

+  X_OK* {.importc: "X_OK", header: "<unistd.h>".}: cint

+

+  CS_PATH* {.importc: "_CS_PATH", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFF32_CFLAGS* {.importc: "_CS_POSIX_V6_ILP32_OFF32_CFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFF32_LDFLAGS* {.importc: "_CS_POSIX_V6_ILP32_OFF32_LDFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFF32_LIBS* {.importc: "_CS_POSIX_V6_ILP32_OFF32_LIBS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFFBIG_CFLAGS* {.importc: "_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS* {.importc: "_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_ILP32_OFFBIG_LIBS* {.importc: "_CS_POSIX_V6_ILP32_OFFBIG_LIBS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LP64_OFF64_CFLAGS* {.importc: "_CS_POSIX_V6_LP64_OFF64_CFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LP64_OFF64_LDFLAGS* {.importc: "_CS_POSIX_V6_LP64_OFF64_LDFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LP64_OFF64_LIBS* {.importc: "_CS_POSIX_V6_LP64_OFF64_LIBS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS* {.importc: "_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS* {.importc: "_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_LPBIG_OFFBIG_LIBS* {.importc: "_CS_POSIX_V6_LPBIG_OFFBIG_LIBS", header: "<unistd.h>".}: cint

+  CS_POSIX_V6_WIDTH_RESTRICTED_ENVS* {.importc: "_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS", header: "<unistd.h>".}: cint

+  F_LOCK* {.importc: "F_LOCK", header: "<unistd.h>".}: cint

+  F_TEST* {.importc: "F_TEST", header: "<unistd.h>".}: cint

+  F_TLOCK* {.importc: "F_TLOCK", header: "<unistd.h>".}: cint

+  F_ULOCK* {.importc: "F_ULOCK", header: "<unistd.h>".}: cint

+  PC_2_SYMLINKS* {.importc: "_PC_2_SYMLINKS", header: "<unistd.h>".}: cint

+  PC_ALLOC_SIZE_MIN* {.importc: "_PC_ALLOC_SIZE_MIN", header: "<unistd.h>".}: cint

+  PC_ASYNC_IO* {.importc: "_PC_ASYNC_IO", header: "<unistd.h>".}: cint

+  PC_CHOWN_RESTRICTED* {.importc: "_PC_CHOWN_RESTRICTED", header: "<unistd.h>".}: cint

+  PC_FILESIZEBITS* {.importc: "_PC_FILESIZEBITS", header: "<unistd.h>".}: cint

+  PC_LINK_MAX* {.importc: "_PC_LINK_MAX", header: "<unistd.h>".}: cint

+  PC_MAX_CANON* {.importc: "_PC_MAX_CANON", header: "<unistd.h>".}: cint

+

+  PC_MAX_INPUT*{.importc: "_PC_MAX_INPUT", header: "<unistd.h>".}: cint

+  PC_NAME_MAX*{.importc: "_PC_NAME_MAX", header: "<unistd.h>".}: cint

+  PC_NO_TRUNC*{.importc: "_PC_NO_TRUNC", header: "<unistd.h>".}: cint

+  PC_PATH_MAX*{.importc: "_PC_PATH_MAX", header: "<unistd.h>".}: cint

+  PC_PIPE_BUF*{.importc: "_PC_PIPE_BUF", header: "<unistd.h>".}: cint

+  PC_PRIO_IO*{.importc: "_PC_PRIO_IO", header: "<unistd.h>".}: cint

+  PC_REC_INCR_XFER_SIZE*{.importc: "_PC_REC_INCR_XFER_SIZE", header: "<unistd.h>".}: cint

+  PC_REC_MIN_XFER_SIZE*{.importc: "_PC_REC_MIN_XFER_SIZE", header: "<unistd.h>".}: cint

+  PC_REC_XFER_ALIGN*{.importc: "_PC_REC_XFER_ALIGN", header: "<unistd.h>".}: cint

+  PC_SYMLINK_MAX*{.importc: "_PC_SYMLINK_MAX", header: "<unistd.h>".}: cint

+  PC_SYNC_IO*{.importc: "_PC_SYNC_IO", header: "<unistd.h>".}: cint

+  PC_VDISABLE*{.importc: "_PC_VDISABLE", header: "<unistd.h>".}: cint

+  SC_2_C_BIND*{.importc: "_SC_2_C_BIND", header: "<unistd.h>".}: cint

+  SC_2_C_DEV*{.importc: "_SC_2_C_DEV", header: "<unistd.h>".}: cint

+  SC_2_CHAR_TERM*{.importc: "_SC_2_CHAR_TERM", header: "<unistd.h>".}: cint

+  SC_2_FORT_DEV*{.importc: "_SC_2_FORT_DEV", header: "<unistd.h>".}: cint

+  SC_2_FORT_RUN*{.importc: "_SC_2_FORT_RUN", header: "<unistd.h>".}: cint

+  SC_2_LOCALEDEF*{.importc: "_SC_2_LOCALEDEF", header: "<unistd.h>".}: cint

+  SC_2_PBS*{.importc: "_SC_2_PBS", header: "<unistd.h>".}: cint

+  SC_2_PBS_ACCOUNTING*{.importc: "_SC_2_PBS_ACCOUNTING", header: "<unistd.h>".}: cint

+  SC_2_PBS_CHECKPOINT*{.importc: "_SC_2_PBS_CHECKPOINT", header: "<unistd.h>".}: cint

+  SC_2_PBS_LOCATE*{.importc: "_SC_2_PBS_LOCATE", header: "<unistd.h>".}: cint

+  SC_2_PBS_MESSAGE*{.importc: "_SC_2_PBS_MESSAGE", header: "<unistd.h>".}: cint

+  SC_2_PBS_TRACK*{.importc: "_SC_2_PBS_TRACK", header: "<unistd.h>".}: cint

+  SC_2_SW_DEV*{.importc: "_SC_2_SW_DEV", header: "<unistd.h>".}: cint

+  SC_2_UPE*{.importc: "_SC_2_UPE", header: "<unistd.h>".}: cint

+  SC_2_VERSION*{.importc: "_SC_2_VERSION", header: "<unistd.h>".}: cint

+  SC_ADVISORY_INFO*{.importc: "_SC_ADVISORY_INFO", header: "<unistd.h>".}: cint

+  SC_AIO_LISTIO_MAX*{.importc: "_SC_AIO_LISTIO_MAX", header: "<unistd.h>".}: cint

+  SC_AIO_MAX*{.importc: "_SC_AIO_MAX", header: "<unistd.h>".}: cint

+  SC_AIO_PRIO_DELTA_MAX*{.importc: "_SC_AIO_PRIO_DELTA_MAX", header: "<unistd.h>".}: cint

+  SC_ARG_MAX*{.importc: "_SC_ARG_MAX", header: "<unistd.h>".}: cint

+  SC_ASYNCHRONOUS_IO*{.importc: "_SC_ASYNCHRONOUS_IO", header: "<unistd.h>".}: cint

+  SC_ATEXIT_MAX*{.importc: "_SC_ATEXIT_MAX", header: "<unistd.h>".}: cint

+  SC_BARRIERS*{.importc: "_SC_BARRIERS", header: "<unistd.h>".}: cint

+  SC_BC_BASE_MAX*{.importc: "_SC_BC_BASE_MAX", header: "<unistd.h>".}: cint

+  SC_BC_DIM_MAX*{.importc: "_SC_BC_DIM_MAX", header: "<unistd.h>".}: cint

+  SC_BC_SCALE_MAX*{.importc: "_SC_BC_SCALE_MAX", header: "<unistd.h>".}: cint

+  SC_BC_STRING_MAX*{.importc: "_SC_BC_STRING_MAX", header: "<unistd.h>".}: cint

+  SC_CHILD_MAX*{.importc: "_SC_CHILD_MAX", header: "<unistd.h>".}: cint

+  SC_CLK_TCK*{.importc: "_SC_CLK_TCK", header: "<unistd.h>".}: cint

+  SC_CLOCK_SELECTION*{.importc: "_SC_CLOCK_SELECTION", header: "<unistd.h>".}: cint

+  SC_COLL_WEIGHTS_MAX*{.importc: "_SC_COLL_WEIGHTS_MAX", header: "<unistd.h>".}: cint

+  SC_CPUTIME*{.importc: "_SC_CPUTIME", header: "<unistd.h>".}: cint

+  SC_DELAYTIMER_MAX*{.importc: "_SC_DELAYTIMER_MAX", header: "<unistd.h>".}: cint

+  SC_EXPR_NEST_MAX*{.importc: "_SC_EXPR_NEST_MAX", header: "<unistd.h>".}: cint

+  SC_FSYNC*{.importc: "_SC_FSYNC", header: "<unistd.h>".}: cint

+  SC_GETGR_R_SIZE_MAX*{.importc: "_SC_GETGR_R_SIZE_MAX", header: "<unistd.h>".}: cint

+  SC_GETPW_R_SIZE_MAX*{.importc: "_SC_GETPW_R_SIZE_MAX", header: "<unistd.h>".}: cint

+  SC_HOST_NAME_MAX*{.importc: "_SC_HOST_NAME_MAX", header: "<unistd.h>".}: cint

+  SC_IOV_MAX*{.importc: "_SC_IOV_MAX", header: "<unistd.h>".}: cint

+  SC_IPV6*{.importc: "_SC_IPV6", header: "<unistd.h>".}: cint

+  SC_JOB_CONTROL*{.importc: "_SC_JOB_CONTROL", header: "<unistd.h>".}: cint

+  SC_LINE_MAX*{.importc: "_SC_LINE_MAX", header: "<unistd.h>".}: cint

+  SC_LOGIN_NAME_MAX*{.importc: "_SC_LOGIN_NAME_MAX", header: "<unistd.h>".}: cint

+  SC_MAPPED_FILES*{.importc: "_SC_MAPPED_FILES", header: "<unistd.h>".}: cint

+  SC_MEMLOCK*{.importc: "_SC_MEMLOCK", header: "<unistd.h>".}: cint

+  SC_MEMLOCK_RANGE*{.importc: "_SC_MEMLOCK_RANGE", header: "<unistd.h>".}: cint

+  SC_MEMORY_PROTECTION*{.importc: "_SC_MEMORY_PROTECTION", header: "<unistd.h>".}: cint

+  SC_MESSAGE_PASSING*{.importc: "_SC_MESSAGE_PASSING", header: "<unistd.h>".}: cint

+  SC_MONOTONIC_CLOCK*{.importc: "_SC_MONOTONIC_CLOCK", header: "<unistd.h>".}: cint

+  SC_MQ_OPEN_MAX*{.importc: "_SC_MQ_OPEN_MAX", header: "<unistd.h>".}: cint

+  SC_MQ_PRIO_MAX*{.importc: "_SC_MQ_PRIO_MAX", header: "<unistd.h>".}: cint

+  SC_NGROUPS_MAX*{.importc: "_SC_NGROUPS_MAX", header: "<unistd.h>".}: cint

+  SC_OPEN_MAX*{.importc: "_SC_OPEN_MAX", header: "<unistd.h>".}: cint

+  SC_PAGE_SIZE*{.importc: "_SC_PAGE_SIZE", header: "<unistd.h>".}: cint

+  SC_PRIORITIZED_IO*{.importc: "_SC_PRIORITIZED_IO", header: "<unistd.h>".}: cint

+  SC_PRIORITY_SCHEDULING*{.importc: "_SC_PRIORITY_SCHEDULING", header: "<unistd.h>".}: cint

+  SC_RAW_SOCKETS*{.importc: "_SC_RAW_SOCKETS", header: "<unistd.h>".}: cint

+  SC_RE_DUP_MAX*{.importc: "_SC_RE_DUP_MAX", header: "<unistd.h>".}: cint

+  SC_READER_WRITER_LOCKS*{.importc: "_SC_READER_WRITER_LOCKS", header: "<unistd.h>".}: cint

+  SC_REALTIME_SIGNALS*{.importc: "_SC_REALTIME_SIGNALS", header: "<unistd.h>".}: cint

+  SC_REGEXP*{.importc: "_SC_REGEXP", header: "<unistd.h>".}: cint

+  SC_RTSIG_MAX*{.importc: "_SC_RTSIG_MAX", header: "<unistd.h>".}: cint

+  SC_SAVED_IDS*{.importc: "_SC_SAVED_IDS", header: "<unistd.h>".}: cint

+  SC_SEM_NSEMS_MAX*{.importc: "_SC_SEM_NSEMS_MAX", header: "<unistd.h>".}: cint

+  SC_SEM_VALUE_MAX*{.importc: "_SC_SEM_VALUE_MAX", header: "<unistd.h>".}: cint

+  SC_SEMAPHORES*{.importc: "_SC_SEMAPHORES", header: "<unistd.h>".}: cint

+  SC_SHARED_MEMORY_OBJECTS*{.importc: "_SC_SHARED_MEMORY_OBJECTS", header: "<unistd.h>".}: cint

+  SC_SHELL*{.importc: "_SC_SHELL", header: "<unistd.h>".}: cint

+  SC_SIGQUEUE_MAX*{.importc: "_SC_SIGQUEUE_MAX", header: "<unistd.h>".}: cint

+  SC_SPAWN*{.importc: "_SC_SPAWN", header: "<unistd.h>".}: cint

+  SC_SPIN_LOCKS*{.importc: "_SC_SPIN_LOCKS", header: "<unistd.h>".}: cint

+  SC_SPORADIC_SERVER*{.importc: "_SC_SPORADIC_SERVER", header: "<unistd.h>".}: cint

+  SC_SS_REPL_MAX*{.importc: "_SC_SS_REPL_MAX", header: "<unistd.h>".}: cint

+  SC_STREAM_MAX*{.importc: "_SC_STREAM_MAX", header: "<unistd.h>".}: cint

+  SC_SYMLOOP_MAX*{.importc: "_SC_SYMLOOP_MAX", header: "<unistd.h>".}: cint

+  SC_SYNCHRONIZED_IO*{.importc: "_SC_SYNCHRONIZED_IO", header: "<unistd.h>".}: cint

+  SC_THREAD_ATTR_STACKADDR*{.importc: "_SC_THREAD_ATTR_STACKADDR", header: "<unistd.h>".}: cint

+  SC_THREAD_ATTR_STACKSIZE*{.importc: "_SC_THREAD_ATTR_STACKSIZE", header: "<unistd.h>".}: cint

+  SC_THREAD_CPUTIME*{.importc: "_SC_THREAD_CPUTIME", header: "<unistd.h>".}: cint

+  SC_THREAD_DESTRUCTOR_ITERATIONS*{.importc: "_SC_THREAD_DESTRUCTOR_ITERATIONS", header: "<unistd.h>".}: cint

+  SC_THREAD_KEYS_MAX*{.importc: "_SC_THREAD_KEYS_MAX", header: "<unistd.h>".}: cint

+  SC_THREAD_PRIO_INHERIT*{.importc: "_SC_THREAD_PRIO_INHERIT", header: "<unistd.h>".}: cint

+  SC_THREAD_PRIO_PROTECT*{.importc: "_SC_THREAD_PRIO_PROTECT", header: "<unistd.h>".}: cint

+  SC_THREAD_PRIORITY_SCHEDULING*{.importc: "_SC_THREAD_PRIORITY_SCHEDULING", header: "<unistd.h>".}: cint

+  SC_THREAD_PROCESS_SHARED*{.importc: "_SC_THREAD_PROCESS_SHARED", header: "<unistd.h>".}: cint

+  SC_THREAD_SAFE_FUNCTIONS*{.importc: "_SC_THREAD_SAFE_FUNCTIONS", header: "<unistd.h>".}: cint

+  SC_THREAD_SPORADIC_SERVER*{.importc: "_SC_THREAD_SPORADIC_SERVER", header: "<unistd.h>".}: cint

+  SC_THREAD_STACK_MIN*{.importc: "_SC_THREAD_STACK_MIN", header: "<unistd.h>".}: cint

+  SC_THREAD_THREADS_MAX*{.importc: "_SC_THREAD_THREADS_MAX", header: "<unistd.h>".}: cint

+  SC_THREADS*{.importc: "_SC_THREADS", header: "<unistd.h>".}: cint

+  SC_TIMEOUTS*{.importc: "_SC_TIMEOUTS", header: "<unistd.h>".}: cint

+  SC_TIMER_MAX*{.importc: "_SC_TIMER_MAX", header: "<unistd.h>".}: cint

+  SC_TIMERS*{.importc: "_SC_TIMERS", header: "<unistd.h>".}: cint

+  SC_TRACE*{.importc: "_SC_TRACE", header: "<unistd.h>".}: cint

+  SC_TRACE_EVENT_FILTER*{.importc: "_SC_TRACE_EVENT_FILTER", header: "<unistd.h>".}: cint

+  SC_TRACE_EVENT_NAME_MAX*{.importc: "_SC_TRACE_EVENT_NAME_MAX", header: "<unistd.h>".}: cint

+  SC_TRACE_INHERIT*{.importc: "_SC_TRACE_INHERIT", header: "<unistd.h>".}: cint

+  SC_TRACE_LOG*{.importc: "_SC_TRACE_LOG", header: "<unistd.h>".}: cint

+  SC_TRACE_NAME_MAX*{.importc: "_SC_TRACE_NAME_MAX", header: "<unistd.h>".}: cint

+  SC_TRACE_SYS_MAX*{.importc: "_SC_TRACE_SYS_MAX", header: "<unistd.h>".}: cint

+  SC_TRACE_USER_EVENT_MAX*{.importc: "_SC_TRACE_USER_EVENT_MAX", header: "<unistd.h>".}: cint

+  SC_TTY_NAME_MAX*{.importc: "_SC_TTY_NAME_MAX", header: "<unistd.h>".}: cint

+  SC_TYPED_MEMORY_OBJECTS*{.importc: "_SC_TYPED_MEMORY_OBJECTS", header: "<unistd.h>".}: cint

+  SC_TZNAME_MAX*{.importc: "_SC_TZNAME_MAX", header: "<unistd.h>".}: cint

+  SC_V6_ILP32_OFF32*{.importc: "_SC_V6_ILP32_OFF32", header: "<unistd.h>".}: cint

+  SC_V6_ILP32_OFFBIG*{.importc: "_SC_V6_ILP32_OFFBIG", header: "<unistd.h>".}: cint

+  SC_V6_LP64_OFF64*{.importc: "_SC_V6_LP64_OFF64", header: "<unistd.h>".}: cint

+  SC_V6_LPBIG_OFFBIG*{.importc: "_SC_V6_LPBIG_OFFBIG", header: "<unistd.h>".}: cint

+  SC_VERSION*{.importc: "_SC_VERSION", header: "<unistd.h>".}: cint

+  SC_XBS5_ILP32_OFF32*{.importc: "_SC_XBS5_ILP32_OFF32", header: "<unistd.h>".}: cint

+  SC_XBS5_ILP32_OFFBIG*{.importc: "_SC_XBS5_ILP32_OFFBIG", header: "<unistd.h>".}: cint

+  SC_XBS5_LP64_OFF64*{.importc: "_SC_XBS5_LP64_OFF64", header: "<unistd.h>".}: cint

+  SC_XBS5_LPBIG_OFFBIG*{.importc: "_SC_XBS5_LPBIG_OFFBIG", header: "<unistd.h>".}: cint

+  SC_XOPEN_CRYPT*{.importc: "_SC_XOPEN_CRYPT", header: "<unistd.h>".}: cint

+  SC_XOPEN_ENH_I18N*{.importc: "_SC_XOPEN_ENH_I18N", header: "<unistd.h>".}: cint

+  SC_XOPEN_LEGACY*{.importc: "_SC_XOPEN_LEGACY", header: "<unistd.h>".}: cint

+  SC_XOPEN_REALTIME*{.importc: "_SC_XOPEN_REALTIME", header: "<unistd.h>".}: cint

+  SC_XOPEN_REALTIME_THREADS*{.importc: "_SC_XOPEN_REALTIME_THREADS", header: "<unistd.h>".}: cint

+  SC_XOPEN_SHM*{.importc: "_SC_XOPEN_SHM", header: "<unistd.h>".}: cint

+  SC_XOPEN_STREAMS*{.importc: "_SC_XOPEN_STREAMS", header: "<unistd.h>".}: cint

+  SC_XOPEN_UNIX*{.importc: "_SC_XOPEN_UNIX", header: "<unistd.h>".}: cint

+  SC_XOPEN_VERSION*{.importc: "_SC_XOPEN_VERSION", header: "<unistd.h>".}: cint

+  

+  SEM_FAILED* {.importc, header: "<semaphore.h>".}: cint

+  IPC_CREAT* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Create entry if key does not exist.

+  IPC_EXCL* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Fail if key exists.

+  IPC_NOWAIT* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Error if request must wait.

+

+  IPC_PRIVATE* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Private key.

+

+  IPC_RMID* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Remove identifier.

+  IPC_SET* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Set options.

+  IPC_STAT* {.importc, header: "<sys/ipc.h>".}: cint

+    ## Get options. 

+

+  S_IFMT* {.importc, header: "<sys/stat.h>".}: cint

+    ## Type of file.

+  S_IFBLK* {.importc, header: "<sys/stat.h>".}: cint

+    ## Block special.

+  S_IFCHR* {.importc, header: "<sys/stat.h>".}: cint

+    ## Character special.

+  S_IFIFO* {.importc, header: "<sys/stat.h>".}: cint

+    ## FIFO special.

+  S_IFREG* {.importc, header: "<sys/stat.h>".}: cint

+    ## Regular.

+  S_IFDIR* {.importc, header: "<sys/stat.h>".}: cint

+    ## Directory.

+  S_IFLNK* {.importc, header: "<sys/stat.h>".}: cint

+    ## Symbolic link.

+  S_IFSOCK* {.importc, header: "<sys/stat.h>".}: cint

+    ## Socket.

+  S_IRWXU* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read, write, execute/search by owner.

+  S_IRUSR* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read permission, owner.

+  S_IWUSR* {.importc, header: "<sys/stat.h>".}: cint

+    ## Write permission, owner.

+  S_IXUSR* {.importc, header: "<sys/stat.h>".}: cint

+    ## Execute/search permission, owner.

+  S_IRWXG* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read, write, execute/search by group.

+  S_IRGRP* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read permission, group.

+  S_IWGRP* {.importc, header: "<sys/stat.h>".}: cint

+    ## Write permission, group.

+  S_IXGRP* {.importc, header: "<sys/stat.h>".}: cint

+    ## Execute/search permission, group.

+  S_IRWXO* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read, write, execute/search by others.

+  S_IROTH* {.importc, header: "<sys/stat.h>".}: cint

+    ## Read permission, others.

+  S_IWOTH* {.importc, header: "<sys/stat.h>".}: cint

+    ## Write permission, others.

+  S_IXOTH* {.importc, header: "<sys/stat.h>".}: cint

+    ## Execute/search permission, others.

+  S_ISUID* {.importc, header: "<sys/stat.h>".}: cint

+    ## Set-user-ID on execution.

+  S_ISGID* {.importc, header: "<sys/stat.h>".}: cint

+    ## Set-group-ID on execution.

+  S_ISVTX* {.importc, header: "<sys/stat.h>".}: cint

+    ## On directories, restricted deletion flag.

+  

+  ST_RDONLY* {.importc, header: "<sys/statvfs.h>".}: cint

+    ## Read-only file system.

+  ST_NOSUID* {.importc, header: "<sys/statvfs.h>".}: cint

+    ## Does not support the semantics of the ST_ISUID and ST_ISGID file mode bits.

+       

+  PROT_READ* {.importc, header: "<sys/mman.h>".}: cint

+    ## Page can be read.

+  PROT_WRITE* {.importc, header: "<sys/mman.h>".}: cint

+    ## Page can be written.

+  PROT_EXEC* {.importc, header: "<sys/mman.h>".}: cint

+    ## Page can be executed.

+  PROT_NONE* {.importc, header: "<sys/mman.h>".}: cint

+    ## Page cannot be accessed.

+  MAP_SHARED* {.importc, header: "<sys/mman.h>".}: cint

+    ## Share changes.

+  MAP_PRIVATE* {.importc, header: "<sys/mman.h>".}: cint

+    ## Changes are private.

+  MAP_FIXED* {.importc, header: "<sys/mman.h>".}: cint

+    ## Interpret addr exactly.

+  MS_ASYNC* {.importc, header: "<sys/mman.h>".}: cint

+    ## Perform asynchronous writes.

+  MS_SYNC* {.importc, header: "<sys/mman.h>".}: cint

+    ## Perform synchronous writes.

+  MS_INVALIDATE* {.importc, header: "<sys/mman.h>".}: cint

+    ## Invalidate mappings.

+  MCL_CURRENT* {.importc, header: "<sys/mman.h>".}: cint

+    ## Lock currently mapped pages.

+  MCL_FUTURE* {.importc, header: "<sys/mman.h>".}: cint

+    ## Lock pages that become mapped.

+  MAP_FAILED* {.importc, header: "<sys/mman.h>".}: cint

+  POSIX_MADV_NORMAL* {.importc, header: "<sys/mman.h>".}: cint

+    ## The application has no advice to give on its behavior with respect to the specified range. It is the default characteristic if no advice is given for a range of memory.

+  POSIX_MADV_SEQUENTIAL* {.importc, header: "<sys/mman.h>".}: cint

+    ## The application expects to access the specified range sequentially from lower addresses to higher addresses.

+  POSIX_MADV_RANDOM* {.importc, header: "<sys/mman.h>".}: cint

+    ## The application expects to access the specified range in a random order.

+  POSIX_MADV_WILLNEED* {.importc, header: "<sys/mman.h>".}: cint

+    ## The application expects to access the specified range in the near future.

+  POSIX_MADV_DONTNEED* {.importc, header: "<sys/mman.h>".}: cint

+  POSIX_TYPED_MEM_ALLOCATE* {.importc, header: "<sys/mman.h>".}: cint

+  POSIX_TYPED_MEM_ALLOCATE_CONTIG* {.importc, header: "<sys/mman.h>".}: cint

+  POSIX_TYPED_MEM_MAP_ALLOCATABLE* {.importc, header: "<sys/mman.h>".}: cint

+

+

+  CLOCKS_PER_SEC* {.importc, header: "<time.h>".}: cint

+    ## A number used to convert the value returned by the clock() function

+    ## into seconds.

+  CLOCK_PROCESS_CPUTIME_ID* {.importc, header: "<time.h>".}: cstring

+    ## The identifier of the CPU-time clock associated with the process 

+    ## making a clock() or timer*() function call.

+  CLOCK_THREAD_CPUTIME_ID* {.importc, header: "<time.h>".}: cstring

+  CLOCK_REALTIME* {.importc, header: "<time.h>".}: cstring

+    ## The identifier of the system-wide realtime clock.

+  TIMER_ABSTIME* {.importc, header: "<time.h>".}: cint

+    ## Flag indicating time is absolute. For functions taking timer objects, this refers to the clock associated with the timer. [Option End]

+  CLOCK_MONOTONIC* {.importc, header: "<time.h>".}: cint

+  daylight* {.importc, header: "<time.h>".}: cint

+  timezone* {.importc, header: "<time.h>".}: int

+

+  WNOHANG* {.importc, header: "<sys/wait.h>".}: cint

+    ## Do not hang if no status is available; return immediately.

+  WUNTRACED* {.importc, header: "<sys/wait.h>".}: cint

+    ## Report status of stopped child process.

+  WEXITSTATUS* {.importc, header: "<sys/wait.h>".}: cint

+    ## Return exit status.

+  WIFCONTINUED* {.importc, header: "<sys/wait.h>".}: cint

+    ## True if child has been continued.

+  WIFEXITED* {.importc, header: "<sys/wait.h>".}: cint

+    ## True if child exited normally.

+  WIFSIGNALED* {.importc, header: "<sys/wait.h>".}: cint

+    ## True if child exited due to uncaught signal.

+  WIFSTOPPED* {.importc, header: "<sys/wait.h>".}: cint

+    ## True if child is currently stopped.

+  WSTOPSIG* {.importc, header: "<sys/wait.h>".}: cint

+    ## Return signal number that caused process to stop.

+  WTERMSIG* {.importc, header: "<sys/wait.h>".}: cint

+    ## Return signal number that caused process to terminate.

+  WEXITED* {.importc, header: "<sys/wait.h>".}: cint

+    ## Wait for processes that have exited.

+  WSTOPPED* {.importc, header: "<sys/wait.h>".}: cint

+    ## Status is returned for any child that has stopped upon receipt of a signal.

+  WCONTINUED* {.importc, header: "<sys/wait.h>".}: cint

+    ## Status is returned for any child that was stopped and has been continued.

+  WNOWAIT* {.importc, header: "<sys/wait.h>".}: cint

+    ## Keep the process whose status is returned in infop in a waitable state. 

+  P_ALL* {.importc, header: "<sys/wait.h>".}: cint 

+  P_PID* {.importc, header: "<sys/wait.h>".}: cint 

+  P_PGID* {.importc, header: "<sys/wait.h>".}: cint

+       

+  SIG_DFL* {.importc, header: "<signal.h>".}: proc (x: cint) {.noconv.}

+    ## Request for default signal handling.

+  SIG_ERR* {.importc, header: "<signal.h>".}: proc (x: cint) {.noconv.}

+    ## Return value from signal() in case of error.

+  cSIG_HOLD* {.importc: "SIG_HOLD", header: "<signal.h>".}: proc (x: cint) {.noconv.}

+    ## Request that signal be held.

+  SIG_IGN* {.importc, header: "<signal.h>".}: proc (x: cint) {.noconv.}

+    ## Request that signal be ignored. 

+

+  SIGEV_NONE* {.importc, header: "<signal.h>".}: cint

+  SIGEV_SIGNAL* {.importc, header: "<signal.h>".}: cint

+  SIGEV_THREAD* {.importc, header: "<signal.h>".}: cint

+  SIGABRT* {.importc, header: "<signal.h>".}: cint

+  SIGALRM* {.importc, header: "<signal.h>".}: cint

+  SIGBUS* {.importc, header: "<signal.h>".}: cint

+  SIGCHLD* {.importc, header: "<signal.h>".}: cint

+  SIGCONT* {.importc, header: "<signal.h>".}: cint

+  SIGFPE* {.importc, header: "<signal.h>".}: cint

+  SIGHUP* {.importc, header: "<signal.h>".}: cint

+  SIGILL* {.importc, header: "<signal.h>".}: cint

+  SIGINT* {.importc, header: "<signal.h>".}: cint

+  SIGKILL* {.importc, header: "<signal.h>".}: cint

+  SIGPIPE* {.importc, header: "<signal.h>".}: cint

+  SIGQUIT* {.importc, header: "<signal.h>".}: cint

+  SIGSEGV* {.importc, header: "<signal.h>".}: cint

+  SIGSTOP* {.importc, header: "<signal.h>".}: cint

+  SIGTERM* {.importc, header: "<signal.h>".}: cint

+  SIGTSTP* {.importc, header: "<signal.h>".}: cint

+  SIGTTIN* {.importc, header: "<signal.h>".}: cint

+  SIGTTOU* {.importc, header: "<signal.h>".}: cint

+  SIGUSR1* {.importc, header: "<signal.h>".}: cint

+  SIGUSR2* {.importc, header: "<signal.h>".}: cint

+  SIGPOLL* {.importc, header: "<signal.h>".}: cint

+  SIGPROF* {.importc, header: "<signal.h>".}: cint

+  SIGSYS* {.importc, header: "<signal.h>".}: cint

+  SIGTRAP* {.importc, header: "<signal.h>".}: cint

+  SIGURG* {.importc, header: "<signal.h>".}: cint

+  SIGVTALRM* {.importc, header: "<signal.h>".}: cint

+  SIGXCPU* {.importc, header: "<signal.h>".}: cint

+  SIGXFSZ* {.importc, header: "<signal.h>".}: cint

+  SA_NOCLDSTOP* {.importc, header: "<signal.h>".}: cint

+  SIG_BLOCK* {.importc, header: "<signal.h>".}: cint

+  SIG_UNBLOCK* {.importc, header: "<signal.h>".}: cint

+  SIG_SETMASK* {.importc, header: "<signal.h>".}: cint

+  SA_ONSTACK* {.importc, header: "<signal.h>".}: cint

+  SA_RESETHAND* {.importc, header: "<signal.h>".}: cint

+  SA_RESTART* {.importc, header: "<signal.h>".}: cint

+  SA_SIGINFO* {.importc, header: "<signal.h>".}: cint

+  SA_NOCLDWAIT* {.importc, header: "<signal.h>".}: cint

+  SA_NODEFER* {.importc, header: "<signal.h>".}: cint

+  SS_ONSTACK* {.importc, header: "<signal.h>".}: cint

+  SS_DISABLE* {.importc, header: "<signal.h>".}: cint

+  MINSIGSTKSZ* {.importc, header: "<signal.h>".}: cint

+  SIGSTKSZ* {.importc, header: "<signal.h>".}: cint

+

+  NL_SETD* {.importc, header: "<nl_types.h>".}: cint

+  NL_CAT_LOCALE* {.importc, header: "<nl_types.h>".}: cint

+

+  SCHED_FIFO* {.importc, header: "<sched.h>".}: cint

+  SCHED_RR* {.importc, header: "<sched.h>".}: cint

+  SCHED_SPORADIC* {.importc, header: "<sched.h>".}: cint

+  SCHED_OTHER* {.importc, header: "<sched.h>".}: cint

+  FD_SETSIZE* {.importc, header: "<sys/select.h>".}: cint

+

+  POSIX_SPAWN_RESETIDS* {.importc, header: "<spawn.h>".}: cint

+  POSIX_SPAWN_SETPGROUP* {.importc, header: "<spawn.h>".}: cint

+  POSIX_SPAWN_SETSCHEDPARAM* {.importc, header: "<spawn.h>".}: cint

+  POSIX_SPAWN_SETSCHEDULER* {.importc, header: "<spawn.h>".}: cint

+  POSIX_SPAWN_SETSIGDEF* {.importc, header: "<spawn.h>".}: cint

+  POSIX_SPAWN_SETSIGMASK* {.importc, header: "<spawn.h>".}: cint

+

+proc aio_cancel*(a1: cint, a2: ptr Taiocb): cint {.importc, header: "<aio.h>".}

+proc aio_error*(a1: ptr Taiocb): cint {.importc, header: "<aio.h>".}

+proc aio_fsync*(a1: cint, a2: ptr Taiocb): cint {.importc, header: "<aio.h>".}

+proc aio_read*(a1: ptr Taiocb): cint {.importc, header: "<aio.h>".}

+proc aio_return*(a1: ptr Taiocb): int {.importc, header: "<aio.h>".}

+proc aio_suspend*(a1: ptr ptr Taiocb, a2: cint, a3: ptr ttimespec): cint {.

+                 importc, header: "<aio.h>".}

+proc aio_write*(a1: ptr Taiocb): cint {.importc, header: "<aio.h>".}

+proc lio_listio*(a1: cint, a2: ptr ptr Taiocb, a3: cint,

+             a4: ptr Tsigevent): cint {.importc, header: "<aio.h>".}

+

+# arpa/inet.h

+proc htonl*(a1: int32): int32 {.importc, header: "<arpa/inet.h>".}

+proc htons*(a1: int16): int16 {.importc, header: "<arpa/inet.h>".}

+proc ntohl*(a1: int32): int32 {.importc, header: "<arpa/inet.h>".}

+proc ntohs*(a1: int16): int16 {.importc, header: "<arpa/inet.h>".}

+

+proc inet_addr*(a1: cstring): int32 {.importc, header: "<arpa/inet.h>".}

+proc inet_ntoa*(a1: int32): cstring {.importc, header: "<arpa/inet.h>".}

+proc inet_ntop*(a1: cint, a2: pointer, a3: cstring, a4: int32): cstring {.importc, header: "<arpa/inet.h>".}

+proc inet_pton*(a1: cint, a2: cstring, a3: pointer): cint {.importc, header: "<arpa/inet.h>".}

+

+# dirent.h

+proc closedir*(a1: ptr TDIR): cint  {.importc, header: "<dirent.h>".}

+proc opendir*(a1: cstring): ptr TDir {.importc, header: "<dirent.h>".}

+proc readdir*(a1: ptr TDIR): ptr TDirent  {.importc, header: "<dirent.h>".}

+proc readdir_r*(a1: ptr TDIR, a2: ptr Tdirent, a3: ptr ptr TDirent): cint  {.

+                importc, header: "<dirent.h>".}

+proc rewinddir*(a1: ptr TDIR)  {.importc, header: "<dirent.h>".}

+proc seekdir*(a1: ptr TDIR, a2: int)  {.importc, header: "<dirent.h>".}

+proc telldir*(a1: ptr TDIR): int {.importc, header: "<dirent.h>".}

+

+# dlfcn.h

+proc dlclose*(a1: pointer): cint {.importc, header: "<dlfcn.h>".}

+proc dlerror*(): cstring {.importc, header: "<dlfcn.h>".}

+proc dlopen*(a1: cstring, a2: cint): pointer {.importc, header: "<dlfcn.h>".}

+proc dlsym*(a1: pointer, a2: cstring): pointer {.importc, header: "<dlfcn.h>".}

+

+proc creat*(a1: cstring, a2: Tmode): cint {.importc, header: "<fcntl.h>".}

+proc fcntl*(a1: cint, a2: cint): cint {.varargs, importc, header: "<fcntl.h>".}

+proc open*(a1: cstring, a2: cint): cint {.varargs, importc, header: "<fcntl.h>".}

+proc posix_fadvise*(a1: cint, a2, a3: Toff, a4: cint): cint {.importc, header: "<fcntl.h>".}

+proc posix_fallocate*(a1: cint, a2, a3: Toff): cint {.importc, header: "<fcntl.h>".}

+

+proc feclearexcept*(a1: cint): cint {.importc, header: "<fenv.h>".}

+proc fegetexceptflag*(a1: ptr Tfexcept, a2: cint): cint {.importc, header: "<fenv.h>".}

+proc feraiseexcept*(a1: cint): cint {.importc, header: "<fenv.h>".}

+proc fesetexceptflag*(a1: ptr Tfexcept, a2: cint): cint {.importc, header: "<fenv.h>".}

+proc fetestexcept*(a1: cint): cint {.importc, header: "<fenv.h>".}

+proc fegetround*(): cint {.importc, header: "<fenv.h>".}

+proc fesetround*(a1: cint): cint {.importc, header: "<fenv.h>".}

+proc fegetenv*(a1: ptr Tfenv): cint {.importc, header: "<fenv.h>".}

+proc feholdexcept*(a1: ptr Tfenv): cint {.importc, header: "<fenv.h>".}

+proc fesetenv*(a1: ptr Tfenv): cint {.importc, header: "<fenv.h>".}

+proc feupdateenv*(a1: ptr TFenv): cint {.importc, header: "<fenv.h>".}

+

+proc fmtmsg*(a1: int, a2: cstring, a3: cint,

+            a4, a5, a6: cstring): cint {.importc, header: "<fmtmsg.h>".}

+            

+proc fnmatch*(a1, a2: cstring, a3: cint): cint {.importc, header: "<fnmatch.h>".}

+proc ftw*(a1: cstring, 

+         a2: proc (x1: cstring, x2: ptr TStat, x3: cint): cint {.noconv.},

+         a3: cint): cint {.importc, header: "<ftw.h>".}

+proc nftw*(a1: cstring, 

+          a2: proc (x1: cstring, x2: ptr TStat, x3: cint, x4: ptr TFTW): cint {.noconv.},

+          a3: cint,

+          a4: cint): cint {.importc, header: "<ftw.h>".}

+

+proc glob*(a1: cstring, a2: cint,

+          a3: proc (x1: cstring, x2: cint): cint {.noconv.},

+          a4: ptr Tglob): cint {.importc, header: "<glob.h>".}

+proc globfree*(a1: ptr TGlob) {.importc, header: "<glob.h>".}

+

+proc getgrgid*(a1: TGid): ptr TGroup {.importc, header: "<grp.h>".}

+proc getgrnam*(a1: cstring): ptr TGroup {.importc, header: "<grp.h>".}

+proc getgrgid_r*(a1: Tgid, a2: ptr TGroup, a3: cstring, a4: int,

+                 a5: ptr ptr TGroup): cint {.importc, header: "<grp.h>".}

+proc getgrnam_r*(a1: cstring, a2: ptr TGroup, a3: cstring, 

+                  a4: int, a5: ptr ptr TGroup): cint {.importc, header: "<grp.h>".}

+proc getgrent*(): ptr TGroup {.importc, header: "<grp.h>".}

+proc endgrent*() {.importc, header: "<grp.h>".}

+proc setgrent*() {.importc, header: "<grp.h>".}

+

+

+proc iconv_open*(a1, a2: cstring): TIconv {.importc, header: "<iconv.h>".}

+proc iconv*(a1: Ticonv, a2: var cstring, a3: var int, a4: var cstring,

+            a5: var int): int {.importc, header: "<iconv.h>".}

+proc iconv_close*(a1: Ticonv): cint {.importc, header: "<iconv.h>".}

+

+proc nl_langinfo*(a1: Tnl_item): cstring {.importc, header: "<langinfo.h>".}

+

+proc basename*(a1: cstring): cstring {.importc, header: "<libgen.h>".}

+proc dirname*(a1: cstring): cstring {.importc, header: "<libgen.h>".}

+

+proc localeconv*(): ptr Tlconv {.importc, header: "<locale.h>".}

+proc setlocale*(a1: cint, a2: cstring): cstring {.

+                importc, header: "<locale.h>".}

+

+proc strfmon*(a1: cstring, a2: int, a3: cstring): int {.varargs,

+   importc, header: "<monetary.h>".}

+

+proc mq_close*(a1: Tmqd): cint {.importc, header: "<mqueue.h>".}

+proc mq_getattr*(a1: Tmqd, a2: ptr Tmq_attr): cint {.importc, header: "<mqueue.h>".}

+proc mq_notify*(a1: Tmqd, a2: ptr Tsigevent): cint {.importc, header: "<mqueue.h>".}

+proc mq_open*(a1: cstring, a2: cint): TMqd {.varargs, importc, header: "<mqueue.h>".}

+proc mq_receive*(a1: Tmqd, a2: cstring, a3: int, a4: var int): int {.importc, header: "<mqueue.h>".}

+proc mq_send*(a1: Tmqd, a2: cstring, a3: int, a4: int): cint {.importc, header: "<mqueue.h>".}

+proc mq_setattr*(a1: Tmqd, a2, a3: ptr Tmq_attr): cint {.importc, header: "<mqueue.h>".}

+

+proc mq_timedreceive*(a1: Tmqd, a2: cstring, a3: int, a4: int, 

+                      a5: ptr TTimespec): int {.importc, header: "<mqueue.h>".}

+proc mq_timedsend*(a1: Tmqd, a2: cstring, a3: int, a4: int, 

+                   a5: ptr TTimeSpec): cint {.importc, header: "<mqueue.h>".}

+proc mq_unlink*(a1: cstring): cint {.importc, header: "<mqueue.h>".}

+

+

+proc getpwnam*(a1: cstring): ptr TPasswd {.importc, header: "<pwd.h>".}

+proc getpwuid*(a1: Tuid): ptr TPasswd {.importc, header: "<pwd.h>".}

+proc getpwnam_r(a1: cstring, a2: ptr Tpasswd, a3: cstring, a4: int,

+                a5: ptr ptr Tpasswd): cint {.importc, header: "<pwd.h>".}

+proc getpwuid_r*(a1: Tuid, a2: ptr Tpasswd, a3: cstring,

+      a4: int, a5: ptr ptr Tpasswd): cint {.importc, header: "<pwd.h>".}

+proc endpwent*() {.importc, header: "<pwd.h>".}

+proc getpwent*(): ptr TPasswd {.importc, header: "<pwd.h>".}

+proc setpwent*() {.importc, header: "<pwd.h>".}

+

+proc uname*(a1: var Tutsname): cint {.importc, header: "<sys/utsname.h>".}

+

+proc pthread_atfork*(a1, a2, a3: proc {.noconv.}): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_destroy*(a1: ptr Tpthread_attr): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getdetachstate*(a1: ptr Tpthread_attr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getguardsize*(a1: ptr Tpthread_attr, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getinheritsched*(a1: ptr Tpthread_attr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getschedparam*(a1: ptr Tpthread_attr,

+          a2: ptr Tsched_param): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getschedpolicy*(a1: ptr Tpthread_attr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getscope*(a1: ptr Tpthread_attr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getstack*(a1: ptr Tpthread_attr,

+         a2: var pointer, a3: var int): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getstackaddr*(a1: ptr Tpthread_attr,

+          a2: var pointer): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_getstacksize*(a1: ptr Tpthread_attr,

+          a2: var int): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_init*(a1: ptr Tpthread_attr): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setdetachstate*(a1: ptr Tpthread_attr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setguardsize*(a1: ptr Tpthread_attr, a2: int): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setinheritsched*(a1: ptr Tpthread_attr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setschedparam*(a1: ptr Tpthread_attr,

+          a2: ptr Tsched_param): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setschedpolicy*(a1: ptr Tpthread_attr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setscope*(a1: ptr Tpthread_attr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setstack*(a1: ptr Tpthread_attr, a2: pointer, a3: int): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setstackaddr*(a1: ptr TPthread_attr, a2: pointer): cint {.importc, header: "<pthread.h>".}

+proc pthread_attr_setstacksize*(a1: ptr TPthread_attr, a2: int): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrier_destroy*(a1: ptr Tpthread_barrier): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrier_init*(a1: ptr Tpthread_barrier,

+         a2: ptr Tpthread_barrierattr, a3: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrier_wait*(a1: ptr Tpthread_barrier): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrierattr_destroy*(a1: ptr Tpthread_barrierattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrierattr_getpshared*(

+          a1: ptr Tpthread_barrierattr, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrierattr_init*(a1: ptr TPthread_barrierattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_barrierattr_setpshared*(a1: ptr TPthread_barrierattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_cancel*(a1: Tpthread): cint {.importc, header: "<pthread.h>".}

+proc pthread_cleanup_push*(a1: proc (x: pointer) {.noconv.}, a2: pointer) {.importc, header: "<pthread.h>".}

+proc pthread_cleanup_pop*(a1: cint) {.importc, header: "<pthread.h>".}

+proc pthread_cond_broadcast*(a1: ptr Tpthread_cond): cint {.importc, header: "<pthread.h>".}

+proc pthread_cond_destroy*(a1: ptr Tpthread_cond): cint {.importc, header: "<pthread.h>".}

+proc pthread_cond_init*(a1: ptr Tpthread_cond,

+          a2: ptr Tpthread_condattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_cond_signal*(a1: ptr Tpthread_cond): cint {.importc, header: "<pthread.h>".}

+proc pthread_cond_timedwait*(a1: ptr Tpthread_cond,

+          a2: ptr Tpthread_mutex, a3: ptr Ttimespec): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_cond_wait*(a1: ptr Tpthread_cond,

+          a2: ptr Tpthread_mutex): cint {.importc, header: "<pthread.h>".}

+proc pthread_condattr_destroy*(a1: ptr Tpthread_condattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_condattr_getclock*(a1: ptr Tpthread_condattr,

+          a2: var Tclockid): cint {.importc, header: "<pthread.h>".}

+proc pthread_condattr_getpshared*(a1: ptr Tpthread_condattr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+          

+proc pthread_condattr_init*(a1: ptr TPthread_condattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_condattr_setclock*(a1: ptr TPthread_condattr,a2: Tclockid): cint {.importc, header: "<pthread.h>".}

+proc pthread_condattr_setpshared*(a1: ptr TPthread_condattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_create*(a1: ptr Tpthread, a2: ptr Tpthread_attr,

+          a3: proc (x: pointer): pointer {.noconv.}, a4: pointer): cint {.importc, header: "<pthread.h>".}

+proc pthread_detach*(a1: Tpthread): cint {.importc, header: "<pthread.h>".}

+proc pthread_equal*(a1, a2: Tpthread): cint {.importc, header: "<pthread.h>".}

+proc pthread_exit*(a1: pointer) {.importc, header: "<pthread.h>".}

+proc pthread_getconcurrency*(): cint {.importc, header: "<pthread.h>".}

+proc pthread_getcpuclockid*(a1: Tpthread, a2: var Tclockid): cint {.importc, header: "<pthread.h>".}

+proc pthread_getschedparam*(a1: Tpthread,  a2: var cint,

+          a3: ptr Tsched_param): cint {.importc, header: "<pthread.h>".}

+proc pthread_getspecific*(a1: Tpthread_key): pointer {.importc, header: "<pthread.h>".}

+proc pthread_join*(a1: Tpthread, a2: ptr pointer): cint {.importc, header: "<pthread.h>".}

+proc pthread_key_create*(a1: ptr Tpthread_key, a2: proc (x: pointer) {.noconv.}): cint {.importc, header: "<pthread.h>".}

+proc pthread_key_delete*(a1: Tpthread_key): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_mutex_destroy*(a1: ptr Tpthread_mutex): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_getprioceiling*(a1: ptr Tpthread_mutex,

+         a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_init*(a1: ptr Tpthread_mutex,

+          a2: ptr Tpthread_mutexattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_lock*(a1: ptr Tpthread_mutex): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_setprioceiling*(a1: ptr Tpthread_mutex,a2: cint,

+          a3: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_timedlock*(a1: ptr Tpthread_mutex,

+          a2: ptr Ttimespec): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_trylock*(a1: ptr Tpthread_mutex): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutex_unlock*(a1: ptr Tpthread_mutex): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_destroy*(a1: ptr Tpthread_mutexattr): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_mutexattr_getprioceiling*(

+          a1: ptr Tpthread_mutexattr, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_getprotocol*(a1: ptr Tpthread_mutexattr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_getpshared*(a1: ptr Tpthread_mutexattr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_gettype*(a1: ptr Tpthread_mutexattr,

+          a2: var cint): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_mutexattr_init*(a1: ptr Tpthread_mutexattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_setprioceiling*(a1: ptr tpthread_mutexattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_setprotocol*(a1: ptr Tpthread_mutexattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_setpshared*(a1: ptr Tpthread_mutexattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_mutexattr_settype*(a1: ptr Tpthread_mutexattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_once*(a1: ptr Tpthread_once, a2: proc {.noconv.}): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_rwlock_destroy*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_init*(a1: ptr Tpthread_rwlock,

+          a2: ptr Tpthread_rwlockattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_rdlock*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_timedrdlock*(a1: ptr Tpthread_rwlock,

+          a2: ptr Ttimespec): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_timedwrlock*(a1: ptr Tpthread_rwlock,

+          a2: ptr Ttimespec): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_rwlock_tryrdlock*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_trywrlock*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_unlock*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlock_wrlock*(a1: ptr Tpthread_rwlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlockattr_destroy*(a1: ptr Tpthread_rwlockattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlockattr_getpshared*(

+          a1: ptr Tpthread_rwlockattr, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlockattr_init*(a1: ptr Tpthread_rwlockattr): cint {.importc, header: "<pthread.h>".}

+proc pthread_rwlockattr_setpshared*(a1: ptr Tpthread_rwlockattr, a2: cint): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_self*(): Tpthread {.importc, header: "<pthread.h>".}

+proc pthread_setcancelstate*(a1: cint, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_setcanceltype*(a1: cint, a2: var cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_setconcurrency*(a1: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_setschedparam*(a1: Tpthread, a2: cint,

+          a3: ptr Tsched_param): cint {.importc, header: "<pthread.h>".}

+

+proc pthread_setschedprio*(a1: Tpthread, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_setspecific*(a1: Tpthread_key, a2: pointer): cint {.importc, header: "<pthread.h>".}

+proc pthread_spin_destroy*(a1: ptr Tpthread_spinlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_spin_init*(a1: ptr Tpthread_spinlock, a2: cint): cint {.importc, header: "<pthread.h>".}

+proc pthread_spin_lock*(a1: ptr Tpthread_spinlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_spin_trylock*(a1: ptr Tpthread_spinlock): cint{.importc, header: "<pthread.h>".}

+proc pthread_spin_unlock*(a1: ptr Tpthread_spinlock): cint {.importc, header: "<pthread.h>".}

+proc pthread_testcancel*() {.importc, header: "<pthread.h>".}

+

+

+proc access*(a1: cstring, a2: cint): cint {.importc, header: "<unistd.h>".}

+proc alarm*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc chdir*(a1: cstring): cint {.importc, header: "<unistd.h>".}

+proc chown*(a1: cstring, a2: Tuid, a3: Tgid): cint {.importc, header: "<unistd.h>".}

+proc close*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc confstr*(a1: cint, a2: cstring, a3: int): int {.importc, header: "<unistd.h>".}

+proc crypt*(a1, a2: cstring): cstring {.importc, header: "<unistd.h>".}

+proc ctermid*(a1: cstring): cstring {.importc, header: "<unistd.h>".}

+proc dup*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc dup2*(a1, a2: cint): cint {.importc, header: "<unistd.h>".}

+proc encrypt*(a1: array[0..63, char], a2: cint) {.importc, header: "<unistd.h>".}

+

+proc execl*(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}

+proc execle*(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}

+proc execlp*(a1, a2: cstring): cint {.varargs, importc, header: "<unistd.h>".}

+proc execv*(a1: cstring, a2: cstringArray): cint {.importc, header: "<unistd.h>".}

+proc execve*(a1: cstring, a2, a3: cstringArray): cint {.importc, header: "<unistd.h>".}

+proc execvp*(a1: cstring, a2: cstringArray): cint {.importc, header: "<unistd.h>".}

+proc fchown*(a1: cint, a2: Tuid, a3: Tgid): cint {.importc, header: "<unistd.h>".}

+proc fchdir*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc fdatasync*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc fork*(): Tpid {.importc, header: "<unistd.h>".}

+proc fpathconf*(a1, a2: cint): int {.importc, header: "<unistd.h>".}

+proc fsync*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc ftruncate*(a1: cint, a2: Toff): cint {.importc, header: "<unistd.h>".}

+proc getcwd*(a1: cstring, a2: int): cstring {.importc, header: "<unistd.h>".}

+proc getegid*(): TGid {.importc, header: "<unistd.h>".}

+proc geteuid*(): TUid {.importc, header: "<unistd.h>".}

+proc getgid*(): TGid {.importc, header: "<unistd.h>".}

+

+proc getgroups*(a1: cint, a2: ptr array[0..255, Tgid]): cint {.importc, header: "<unistd.h>".}

+proc gethostid*(): int {.importc, header: "<unistd.h>".}

+proc gethostname*(a1: cstring, a2: int): cint {.importc, header: "<unistd.h>".}

+proc getlogin*(): cstring {.importc, header: "<unistd.h>".}

+proc getlogin_r*(a1: cstring, a2: int): cint {.importc, header: "<unistd.h>".}

+

+proc getopt*(a1: cint, a2: cstringArray, a3: cstring): cint {.importc, header: "<unistd.h>".}

+proc getpgid*(a1: Tpid): Tpid {.importc, header: "<unistd.h>".}

+proc getpgrp*(): Tpid {.importc, header: "<unistd.h>".}

+proc getpid*(): Tpid {.importc, header: "<unistd.h>".}

+proc getppid*(): Tpid {.importc, header: "<unistd.h>".}

+proc getsid*(a1: Tpid): Tpid {.importc, header: "<unistd.h>".}

+proc getuid*(): Tuid {.importc, header: "<unistd.h>".}

+proc getwd*(a1: cstring): cstring {.importc, header: "<unistd.h>".}

+proc isatty*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc lchown*(a1: cstring, a2: Tuid, a3: Tgid): cint {.importc, header: "<unistd.h>".}

+proc link*(a1, a2: cstring): cint {.importc, header: "<unistd.h>".}

+

+proc lockf*(a1, a2: cint, a3: Toff): cint {.importc, header: "<unistd.h>".}

+proc lseek*(a1: cint, a2: Toff, a3: cint): Toff {.importc, header: "<unistd.h>".}

+proc nice*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc pathconf*(a1: cstring, a2: cint): int {.importc, header: "<unistd.h>".}

+

+proc pause*(): cint {.importc, header: "<unistd.h>".}

+proc pipe*(a: array[0..1, cint]): cint {.importc, header: "<unistd.h>".}

+proc pread*(a1: cint, a2: pointer, a3: int, a4: Toff): int {.importc, header: "<unistd.h>".}

+proc pwrite*(a1: cint, a2: pointer, a3: int, a4: Toff): int {.importc, header: "<unistd.h>".}

+proc read*(a1: cint, a2: pointer, a3: int): int {.importc, header: "<unistd.h>".}

+proc readlink*(a1, a2: cstring, a3: int): int {.importc, header: "<unistd.h>".}

+

+proc rmdir*(a1: cstring): cint {.importc, header: "<unistd.h>".}

+proc setegid*(a1: Tgid): cint {.importc, header: "<unistd.h>".}

+proc seteuid*(a1: Tuid): cint {.importc, header: "<unistd.h>".}

+proc setgid*(a1: Tgid): cint {.importc, header: "<unistd.h>".}

+

+proc setpgid*(a1, a2: Tpid): cint {.importc, header: "<unistd.h>".}

+proc setpgrp*(): Tpid {.importc, header: "<unistd.h>".}

+proc setregid*(a1, a2: Tgid): cint {.importc, header: "<unistd.h>".}

+proc setreuid*(a1, a2: Tuid): cint {.importc, header: "<unistd.h>".}

+proc setsid*(): Tpid {.importc, header: "<unistd.h>".}

+proc setuid*(a1: Tuid): cint {.importc, header: "<unistd.h>".}

+proc sleep*(a1: cint): cint {.importc, header: "<unistd.h>".}

+proc swab*(a1, a2: pointer, a3: int) {.importc, header: "<unistd.h>".}

+proc symlink*(a1, a2: cstring): cint {.importc, header: "<unistd.h>".}

+proc sync*() {.importc, header: "<unistd.h>".}

+proc sysconf*(a1: cint): int {.importc, header: "<unistd.h>".}

+proc tcgetpgrp*(a1: cint): tpid {.importc, header: "<unistd.h>".}

+proc tcsetpgrp*(a1: cint, a2: Tpid): cint {.importc, header: "<unistd.h>".}

+proc truncate*(a1: cstring, a2: Toff): cint {.importc, header: "<unistd.h>".}

+proc ttyname*(a1: cint): cstring {.importc, header: "<unistd.h>".}

+proc ttyname_r*(a1: cint, a2: cstring, a3: int): cint {.importc, header: "<unistd.h>".}

+proc ualarm*(a1, a2: Tuseconds): Tuseconds {.importc, header: "<unistd.h>".}

+proc unlink*(a1: cstring): cint {.importc, header: "<unistd.h>".}

+proc usleep*(a1: Tuseconds): cint {.importc, header: "<unistd.h>".}

+proc vfork*(): tpid {.importc, header: "<unistd.h>".}

+proc write*(a1: cint, a2: pointer, a3: int): int {.importc, header: "<unistd.h>".}

+

+proc sem_close*(a1: ptr Tsem): cint {.importc, header: "<semaphore.h>".}

+proc sem_destroy*(a1: ptr Tsem): cint {.importc, header: "<semaphore.h>".}

+proc sem_getvalue*(a1: ptr Tsem, a2: var cint): cint {.importc, header: "<semaphore.h>".}

+proc sem_init*(a1: ptr Tsem, a2: cint, a3: cint): cint {.importc, header: "<semaphore.h>".}

+proc sem_open*(a1: cstring, a2: cint): ptr TSem {.varargs, importc, header: "<semaphore.h>".}

+proc sem_post*(a1: ptr Tsem): cint {.importc, header: "<semaphore.h>".}

+proc sem_timedwait*(a1: ptr Tsem, a2: ptr Ttimespec): cint {.importc, header: "<semaphore.h>".}

+proc sem_trywait*(a1: ptr Tsem): cint {.importc, header: "<semaphore.h>".}

+proc sem_unlink*(a1: cstring): cint {.importc, header: "<semaphore.h>".}

+proc sem_wait*(a1: ptr Tsem): cint {.importc, header: "<semaphore.h>".}

+

+proc ftok*(a1: cstring, a2: cint): Tkey {.importc, header: "<sys/ipc.h>".}

+

+proc statvfs*(a1: cstring, a2: var Tstatvfs): cint {.importc, header: "<sys/statvfs.h>".}

+proc fstatvfs*(a1: cint, a2: var Tstatvfs): cint {.importc, header: "<sys/statvfs.h>".}

+

+proc chmod*(a1: cstring, a2: TMode): cint {.importc, header: "<sys/stat.h>".}

+proc fchmod*(a1: cint, a2: TMode): cint {.importc, header: "<sys/stat.h>".}

+proc fstat*(a1: cint, a2: var Tstat): cint {.importc, header: "<sys/stat.h>".}

+proc lstat*(a1: cstring, a2: var Tstat): cint {.importc, header: "<sys/stat.h>".}

+proc mkdir*(a1: cstring, a2: TMode): cint {.importc, header: "<sys/stat.h>".}

+proc mkfifo*(a1: cstring, a2: TMode): cint {.importc, header: "<sys/stat.h>".}

+proc mknod*(a1: cstring, a2: TMode, a3: Tdev): cint {.importc, header: "<sys/stat.h>".}

+proc stat*(a1: cstring, a2: var Tstat): cint {.importc, header: "<sys/stat.h>".}

+proc umask*(a1: Tmode): TMode {.importc, header: "<sys/stat.h>".}

+

+proc S_ISBLK*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a block special file.

+proc S_ISCHR*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a character special file.

+proc S_ISDIR*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a directory.

+proc S_ISFIFO*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a pipe or FIFO special file.

+proc S_ISREG*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a regular file.

+proc S_ISLNK*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a symbolic link.

+proc S_ISSOCK*(m: Tmode): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a socket. 

+    

+proc S_TYPEISMQ*(buf: var TStat): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a message queue.

+proc S_TYPEISSEM*(buf: var TStat): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a semaphore.

+proc S_TYPEISSHM*(buf: var TStat): bool {.importc, header: "<sys/stat.h>".}

+  ## Test for a shared memory object. 

+    

+proc S_TYPEISTMO*(buf: var TStat): bool {.importc, header: "<sys/stat.h>".}

+  ## Test macro for a typed memory object. 

+  

+proc mlock*(a1: pointer, a2: int): cint {.importc, header: "<sys/mman.h>".}

+proc mlockall*(a1: cint): cint {.importc, header: "<sys/mman.h>".}

+proc mmap*(a1: pointer, a2: int, a3, a4, a5: cint, a6: Toff): pointer {.importc, header: "<sys/mman.h>".}

+proc mprotect*(a1: pointer, a2: int, a3: cint): cint {.importc, header: "<sys/mman.h>".}

+proc msync*(a1: pointer, a2: int, a3: cint): cint {.importc, header: "<sys/mman.h>".}

+proc munlock*(a1: pointer, a2: int): cint {.importc, header: "<sys/mman.h>".}

+proc munlockall*(): cint {.importc, header: "<sys/mman.h>".}

+proc munmap*(a1: pointer, a2: int): cint {.importc, header: "<sys/mman.h>".}

+proc posix_madvise*(a1: pointer, a2: int, a3: cint): cint {.importc, header: "<sys/mman.h>".}

+proc posix_mem_offset*(a1: pointer, a2: int, a3: var Toff,

+           a4: var int, a5: var cint): cint {.importc, header: "<sys/mman.h>".}

+proc posix_typed_mem_get_info*(a1: cint, a2: var Tposix_typed_mem_info): cint {.importc, header: "<sys/mman.h>".}

+proc posix_typed_mem_open*(a1: cstring, a2, a3: cint): cint {.importc, header: "<sys/mman.h>".}

+proc shm_open*(a1: cstring, a2: cint, a3: Tmode): cint {.importc, header: "<sys/mman.h>".}

+proc shm_unlink*(a1: cstring): cint {.importc, header: "<sys/mman.h>".}

+

+proc asctime*(a1: var ttm): cstring{.importc, header: "<time.h>".}

+

+proc asctime_r*(a1: var ttm, a2: cstring): cstring {.importc, header: "<time.h>".}

+proc clock*(): Tclock {.importc, header: "<time.h>".}

+proc clock_getcpuclockid*(a1: tpid, a2: var Tclockid): cint {.importc, header: "<time.h>".}

+proc clock_getres*(a1: Tclockid, a2: var Ttimespec): cint {.importc, header: "<time.h>".}

+proc clock_gettime*(a1: Tclockid, a2: var Ttimespec): cint {.importc, header: "<time.h>".}

+proc clock_nanosleep*(a1: Tclockid, a2: cint, a3: var Ttimespec,

+               a4: var Ttimespec): cint {.importc, header: "<time.h>".}

+proc clock_settime*(a1: Tclockid, a2: var Ttimespec): cint {.importc, header: "<time.h>".}

+

+proc ctime*(a1: var Ttime): cstring {.importc, header: "<time.h>".}

+proc ctime_r*(a1: var Ttime, a2: cstring): cstring {.importc, header: "<time.h>".}

+proc difftime*(a1, a2: Ttime): cdouble {.importc, header: "<time.h>".}

+proc getdate*(a1: cstring): ptr ttm {.importc, header: "<time.h>".}

+

+proc gmtime*(a1: var ttime): ptr ttm {.importc, header: "<time.h>".}

+proc gmtime_r*(a1: var ttime, a2: var ttm): ptr ttm {.importc, header: "<time.h>".}

+proc localtime*(a1: var ttime): ptr ttm {.importc, header: "<time.h>".}

+proc localtime_r*(a1: var ttime, a2: var ttm): ptr ttm {.importc, header: "<time.h>".}

+proc mktime*(a1: var ttm): ttime  {.importc, header: "<time.h>".}

+proc nanosleep*(a1, a2: var Ttimespec): cint {.importc, header: "<time.h>".}

+proc strftime*(a1: cstring, a2: int, a3: cstring,

+           a4: var ttm): int {.importc, header: "<time.h>".}

+proc strptime*(a1, a2: cstring, a3: var ttm): cstring {.importc, header: "<time.h>".}

+proc time*(a1: var Ttime): ttime {.importc, header: "<time.h>".}

+proc timer_create*(a1: var Tclockid, a2: var Tsigevent,

+               a3: var Ttimer): cint {.importc, header: "<time.h>".}

+proc timer_delete*(a1: var Ttimer): cint {.importc, header: "<time.h>".}

+proc timer_gettime*(a1: Ttimer, a2: var Titimerspec): cint {.importc, header: "<time.h>".}

+proc timer_getoverrun*(a1: Ttimer): cint {.importc, header: "<time.h>".}

+proc timer_settime*(a1: Ttimer, a2: cint, a3: var Titimerspec,

+               a4: var titimerspec): cint {.importc, header: "<time.h>".}

+proc tzset*() {.importc, header: "<time.h>".}

+

+

+proc wait*(a1: var cint): tpid {.importc, header: "<sys/wait.h>".}

+proc waitid*(a1: cint, a2: tid, a3: var Tsiginfo, a4: cint): cint {.importc, header: "<sys/wait.h>".}

+proc waitpid*(a1: tpid, a2: var cint, a3: cint): tpid  {.importc, header: "<sys/wait.h>".}

+

+proc bsd_signal*(a1: cint, a2: proc (x: pointer) {.noconv.}) {.importc, header: "<signal.h>".}

+proc kill*(a1: Tpid, a2: cint): cint {.importc, header: "<signal.h>".}

+proc killpg*(a1: Tpid, a2: cint): cint {.importc, header: "<signal.h>".}

+proc pthread_kill*(a1: tpthread, a2: cint): cint {.importc, header: "<signal.h>".}

+proc pthread_sigmask*(a1: cint, a2, a3: var Tsigset): cint {.importc, header: "<signal.h>".}

+proc `raise`*(a1: cint): cint {.importc, header: "<signal.h>".}

+proc sigaction*(a1: cint, a2, a3: var Tsigaction): cint {.importc, header: "<signal.h>".}

+proc sigaddset*(a1: var Tsigset, a2: cint): cint {.importc, header: "<signal.h>".}

+proc sigaltstack*(a1, a2: var Tstack): cint {.importc, header: "<signal.h>".}

+proc sigdelset*(a1: var Tsigset, a2: cint): cint {.importc, header: "<signal.h>".}

+proc sigemptyset*(a1: var Tsigset): cint {.importc, header: "<signal.h>".}

+proc sigfillset*(a1: var Tsigset): cint {.importc, header: "<signal.h>".}

+proc sighold*(a1: cint): cint {.importc, header: "<signal.h>".}

+proc sigignore*(a1: cint): cint {.importc, header: "<signal.h>".}

+proc siginterrupt*(a1, a2: cint): cint {.importc, header: "<signal.h>".}

+proc sigismember*(a1: var Tsigset, a2: cint): cint {.importc, header: "<signal.h>".}

+proc signal*(a1: cint, a2: proc (x: cint) {.noconv.}) {.importc, header: "<signal.h>".}

+proc sigpause*(a1: cint): cint {.importc, header: "<signal.h>".}

+proc sigpending*(a1: var tsigset): cint {.importc, header: "<signal.h>".}

+proc sigprocmask*(a1: cint, a2, a3: var tsigset): cint {.importc, header: "<signal.h>".}

+proc sigqueue*(a1: tpid, a2: cint, a3: Tsigval): cint {.importc, header: "<signal.h>".}

+proc sigrelse*(a1: cint): cint {.importc, header: "<signal.h>".}

+proc sigset*(a1: int, a2: proc (x: cint) {.noconv.}) {.importc, header: "<signal.h>".}

+proc sigsuspend*(a1: var Tsigset): cint {.importc, header: "<signal.h>".}

+proc sigtimedwait*(a1: var Tsigset, a2: var tsiginfo, a3: var ttimespec): cint {.importc, header: "<signal.h>".}

+proc sigwait*(a1: var Tsigset, a2: var cint): cint {.importc, header: "<signal.h>".}

+proc sigwaitinfo*(a1: var Tsigset, a2: var tsiginfo): cint {.importc, header: "<signal.h>".}

+

+

+proc catclose*(a1: Tnl_catd): cint {.importc, header: "<nl_types.h>".}

+proc catgets*(a1: Tnl_catd, a2, a3: cint, a4: cstring): cstring {.importc, header: "<nl_types.h>".}

+proc catopen*(a1: cstring, a2: cint): Tnl_catd {.importc, header: "<nl_types.h>".}

+

+proc sched_get_priority_max*(a1: cint): cint {.importc, header: "<sched.h>".}

+proc sched_get_priority_min*(a1: cint): cint {.importc, header: "<sched.h>".}

+proc sched_getparam*(a1: tpid, a2: var Tsched_param): cint {.importc, header: "<sched.h>".}

+proc sched_getscheduler*(a1: tpid): cint {.importc, header: "<sched.h>".}

+proc sched_rr_get_interval*(a1: tpid, a2: var Ttimespec): cint {.importc, header: "<sched.h>".}

+proc sched_setparam*(a1: tpid, a2: var Tsched_param): cint {.importc, header: "<sched.h>".}

+proc sched_setscheduler*(a1: tpid, a2: cint, a3: var tsched_param): cint {.importc, header: "<sched.h>".}

+proc sched_yield*(): cint {.importc, header: "<sched.h>".}

+

+proc strerror*(errnum: cint): cstring {.importc, header: "<string.h>".}

+

+proc FD_CLR*(a1: cint, a2: var Tfd_set) {.importc, header: "<sys/select.h>".}

+proc FD_ISSET*(a1: cint, a2: var Tfd_set): cint {.importc, header: "<sys/select.h>".}

+proc FD_SET*(a1: cint, a2: var Tfd_set) {.importc, header: "<sys/select.h>".}

+proc FD_ZERO*(a1: var Tfd_set) {.importc, header: "<sys/select.h>".}

+

+proc pselect*(a1: cint, a2, a3, a4: var Tfd_set, a5: var ttimespec,

+         a6: var Tsigset): cint  {.importc, header: "<sys/select.h>".}

+proc select*(a1: cint, a2, a3, a4: var Tfd_set, a5: var ttimeval): cint {.

+             importc, header: "<sys/select.h>".}

+

+proc posix_spawn*(a1: var tpid, a2: cstring,

+          a3: var Tposix_spawn_file_actions,

+          a4: var Tposix_spawnattr, a5, a6: cstringArray): cint {.importc, header: "<spawn.h>".}

+proc posix_spawn_file_actions_addclose*(a1: var tposix_spawn_file_actions,

+          a2: cint): cint {.importc, header: "<spawn.h>".}

+proc posix_spawn_file_actions_adddup2*(a1: var tposix_spawn_file_actions,

+          a2, a3: cint): cint {.importc, header: "<spawn.h>".}

+proc posix_spawn_file_actions_addopen*(a1: var tposix_spawn_file_actions,

+          a2: cint, a3: cstring, a4: cint, a5: tmode): cint {.importc, header: "<spawn.h>".}

+proc posix_spawn_file_actions_destroy*(a1: var tposix_spawn_file_actions): cint {.importc, header: "<spawn.h>".}

+proc posix_spawn_file_actions_init*(a1: var tposix_spawn_file_actions): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_destroy*(a1: var tposix_spawnattr): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getsigdefault*(a1: var tposix_spawnattr,

+          a2: var Tsigset): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getflags*(a1: var tposix_spawnattr,

+          a2: var cshort): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getpgroup*(a1: var tposix_spawnattr,

+          a2: var tpid): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getschedparam*(a1: var tposix_spawnattr,

+          a2: var tsched_param): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getschedpolicy*(a1: var tposix_spawnattr,

+          a2: var cint): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_getsigmask*(a1: var tposix_spawnattr,

+          a2: var tsigset): cint {.importc, header: "<spawn.h>".}

+

+proc posix_spawnattr_init*(a1: var tposix_spawnattr): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_setsigdefault*(a1: var tposix_spawnattr,

+          a2: var tsigset): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_setflags*(a1: var tposix_spawnattr, a2: cshort): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_setpgroup*(a1: var tposix_spawnattr, a2: tpid): cint {.importc, header: "<spawn.h>".}

+

+proc posix_spawnattr_setschedparam*(a1: var tposix_spawnattr,

+          a2: var tsched_param): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_setschedpolicy*(a1: var tposix_spawnattr, a2: cint): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnattr_setsigmask*(a1: var tposix_spawnattr,

+          a2: var tsigset): cint {.importc, header: "<spawn.h>".}

+proc posix_spawnp*(a1: var tpid, a2: cstring,

+          a3: var tposix_spawn_file_actions,

+          a4: var tposix_spawnattr,

+          a5, a6: cstringArray): cint {.importc, header: "<spawn.h>".}

+

+proc getcontext*(a1: var Tucontext): cint {.importc, header: "<ucontext.h>".}

+proc makecontext*(a1: var Tucontext, a4: proc (){.noconv.}, a3: cint) {.varargs, importc, header: "<ucontext.h>".}

+proc setcontext*(a1: var Tucontext): cint {.importc, header: "<ucontext.h>".}

+proc swapcontext*(a1, a2: var Tucontext): cint {.importc, header: "<ucontext.h>".}

diff --git a/lib/powerpc.asm.in b/lib/powerpc.asm.in
new file mode 100755
index 000000000..107f887ab
--- /dev/null
+++ b/lib/powerpc.asm.in
@@ -0,0 +1,35 @@
+; This contains the CPU-dependant variants of some routines.

+; (C) 2005 Andreas Rumpf

+; This code was inspired by the Freepascal compiler's sources

+; All routines here have the _cdecl calling convention because

+; that is the only convention any C compiler supports.

+

+\python{

+def c(name): 

+  if os.name == 'posix':

+    return name

+  else:

+    return "_" + name

+}

+

+segment code

+

+global \c{cpu_inc_locked}

+global \c{cpu_dec_locked}

+

+\c{cpu_dec_locked}: 

+; input:  address of arg in r3 

+  .LDecLockedLoop:

+    lwarx   r10,0,r3

+    subi    r10,r10,1

+    stwcx.  r10,0,r3

+    bne-    .LDecLockedLoop

+    cntlzw  r3,r10

+    srwi    r3,r3,5

+     

+\c{cpu_inc_locked}:

+  .LIncLockedLoop:

+    lwarx   r10,0,r3

+    addi    r10,r10,1

+    stwcx.  r10,0,r3

+    bne-    .LIncLockedLoop

diff --git a/lib/process.nim b/lib/process.nim
new file mode 100755
index 000000000..ebeeb3f47
--- /dev/null
+++ b/lib/process.nim
@@ -0,0 +1,1009 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+

+interface

+

+type

+  TProcess = opaque

+

+proc

+  open(out p: TProcess, command, workingDir: string,

+

+implementation

+

+

+Uses Classes,

+     pipes,

+     SysUtils;

+

+Type

+  TProcessOption = (poRunSuspended,poWaitOnExit,

+                    poUsePipes,poStderrToOutPut,

+                    poNoConsole,poNewConsole,

+                    poDefaultErrorMode,poNewProcessGroup,

+                    poDebugProcess,poDebugOnlyThisProcess);

+

+  TShowWindowOptions = (swoNone,swoHIDE,swoMaximize,swoMinimize,swoRestore,swoShow,

+                        swoShowDefault,swoShowMaximized,swoShowMinimized,

+                        swoshowMinNOActive,swoShowNA,swoShowNoActivate,swoShowNormal);

+

+  TStartupOption = (suoUseShowWindow,suoUseSize,suoUsePosition,

+                    suoUseCountChars,suoUseFillAttribute);

+

+  TProcessPriority = (ppHigh,ppIdle,ppNormal,ppRealTime);

+

+  TProcessOptions = Set of TPRocessOption;

+  TstartUpoptions = set of TStartupOption;

+

+

+Type

+  TProcess = Class (TComponent)

+  Private

+    FProcessOptions : TProcessOptions;

+    FStartupOptions : TStartupOptions;

+    FProcessID : Integer;

+    FThreadID : Integer;

+    FProcessHandle : Thandle;

+    FThreadHandle : Thandle;

+    FFillAttribute : Cardinal;

+    FApplicationName : string;

+    FConsoleTitle : String;

+    FCommandLine : String;

+    FCurrentDirectory : String;

+    FDeskTop : String;

+    FEnvironment : Tstrings;

+    FExitCode : Cardinal;

+    FShowWindow : TShowWindowOptions;

+    FInherithandles : Boolean;

+    FInputSTream  : TOutputPipeStream;

+    FOutputStream : TInPutPipeStream;

+    FStdErrStream : TInputPipeStream;

+    FRunning : Boolean;

+    FPRocessPriority : TProcessPriority;

+    dwXCountchars,

+    dwXSize,

+    dwYsize,

+    dwx,

+    dwYcountChars,

+    dwy : Cardinal;

+    Procedure FreeStreams;

+    Function  GetExitStatus : Integer;

+    Function  GetRunning : Boolean;

+    Function  GetWindowRect : TRect;

+    Procedure SetWindowRect (Value : TRect);

+    Procedure SetShowWindow (Value : TShowWindowOptions);

+    Procedure SetWindowColumns (Value : Cardinal);

+    Procedure SetWindowHeight (Value : Cardinal);

+    Procedure SetWindowLeft (Value : Cardinal);

+    Procedure SetWindowRows (Value : Cardinal);

+    Procedure SetWindowTop (Value : Cardinal);

+    Procedure SetWindowWidth (Value : Cardinal);

+    Procedure CreateStreams(InHandle,OutHandle,Errhandle : Longint);

+    procedure SetApplicationname(const Value: String);

+    procedure SetProcessOptions(const Value: TProcessOptions);

+    procedure SetActive(const Value: Boolean);

+    procedure SetEnvironment(const Value: TStrings);

+    function  PeekExitStatus: Boolean;

+    procedure CloseProcessHandles;

+  Public

+    Constructor Create (AOwner : TComponent);override;

+    Destructor Destroy; override;

+    Procedure Execute; virtual;

+    Function Resume : Integer; virtual;

+    Function Suspend : Integer; virtual;

+    Function Terminate (AExitCode : Integer): Boolean; virtual;

+    Function WaitOnExit : DWord;

+    Property WindowRect : Trect Read GetWindowRect Write SetWindowRect;

+    Property Handle : THandle Read FProcessHandle;

+    Property ProcessHandle : THandle Read FProcessHandle;

+    Property ThreadHandle : THandle Read FThreadHandle;

+    Property ProcessID : Integer Read FProcessID;

+    Property ThreadID : Integer Read FThreadID;

+    Property Input  : TOutPutPipeStream Read FInPutStream;

+    Property OutPut : TInputPipeStream  Read FOutPutStream;

+    Property StdErr : TinputPipeStream  Read FStdErrStream;

+    Property ExitStatus : Integer Read GetExitStatus;

+    Property InheritHandles : Boolean Read FInheritHandles Write FInheritHandles;

+  Published

+    Property Active : Boolean Read Getrunning Write SetActive;

+    Property ApplicationName : String Read FApplicationname Write SetApplicationname;

+    Property CommandLine : String Read FCommandLine Write FCommandLine;

+    Property ConsoleTitle : String Read FConsoleTitle Write FConsoleTitle;

+    Property CurrentDirectory : String Read FCurrentDirectory Write FCurrentDirectory;

+    Property DeskTop : String Read FDeskTop Write FDeskTop;

+    Property Environment : TStrings Read FEnvironment Write SetEnvironment;

+    Property Options : TProcessOptions Read FProcessOptions Write SetPRocessOptions;

+    Property Priority : TProcessPriority Read FProcessPriority Write FProcessPriority;

+    Property StartUpOptions : TStartUpOptions Read FStartUpOptions Write FStartupOptions;

+    Property Running : Boolean Read GetRunning;

+    Property ShowWindow : TShowWindowOptions Read FShowWindow Write SetShowWindow;

+    Property WindowColumns : Cardinal Read dwXCountchars Write SetWindowColumns;

+    Property WindowHeight : Cardinal Read dwYsize Write SetWindowHeight;

+    Property WindowLeft : Cardinal Read dwx Write SetWindowLeft;

+    Property WindowRows : Cardinal Read dwYcountChars Write SetWindowRows;

+    Property WindowTop : Cardinal Read dwy Write SetWindowTop ;

+    Property WindowWidth : Cardinal Read dwXsize Write SetWindowWidth;

+    Property FillAttribute : Cardinal read FFillAttribute Write FFillAttribute;

+  end;

+

+implementation

+

+{

+  Win32 Process .inc.

+}

+

+uses Windows;

+

+Const

+  PriorityConstants : Array [TProcessPriority] of Cardinal =

+                      (HIGH_PRIORITY_CLASS,IDLE_PRIORITY_CLASS,

+                       NORMAL_PRIORITY_CLASS,REALTIME_PRIORITY_CLASS);

+

+procedure TProcess.CloseProcessHandles;

+begin

+  if (FProcessHandle<>0) then

+    CloseHandle(FProcessHandle);

+  if (FThreadHandle<>0) then

+    CloseHandle(FThreadHandle);

+end;

+

+Function TProcess.PeekExitStatus : Boolean;

+

+begin

+  GetExitCodeProcess(ProcessHandle,FExitCode);

+  Result:=(FExitCode<>Still_Active);

+end;

+

+Function GetStartupFlags (P : TProcess): Cardinal;

+

+begin

+  With P do

+    begin

+    Result:=0;

+    if poUsePipes in FProcessOptions then

+       Result:=Result or Startf_UseStdHandles;

+    if suoUseShowWindow in FStartupOptions then

+      Result:=Result or startf_USESHOWWINDOW;

+    if suoUSESIZE in FStartupOptions then

+      Result:=Result or startf_usesize;

+    if suoUsePosition in FStartupOptions then

+      Result:=Result or startf_USEPOSITION;

+    if suoUSECOUNTCHARS in FStartupoptions then

+      Result:=Result or startf_usecountchars;

+    if suoUsefIllAttribute in FStartupOptions then

+      Result:=Result or startf_USEFILLATTRIBUTE;

+    end;

+end;

+

+Function GetCreationFlags(P : TProcess) : Cardinal;

+

+begin

+  With P do

+    begin

+    Result:=0;

+    if poNoConsole in FProcessOptions then

+      Result:=Result or Detached_Process;

+    if poNewConsole in FProcessOptions then

+      Result:=Result or Create_new_console;

+    if poNewProcessGroup in FProcessOptions then

+      Result:=Result or CREATE_NEW_PROCESS_GROUP;

+    If poRunSuspended in FProcessOptions Then

+      Result:=Result or Create_Suspended;

+    if poDebugProcess in FProcessOptions Then

+      Result:=Result or DEBUG_PROCESS;

+    if poDebugOnlyThisProcess in FProcessOptions Then

+      Result:=Result or DEBUG_ONLY_THIS_PROCESS;

+    if poDefaultErrorMode in FProcessOptions Then

+      Result:=Result or CREATE_DEFAULT_ERROR_MODE;

+    result:=result or PriorityConstants[FProcessPriority];

+    end;

+end;

+

+Function StringsToPChars(List : TStrings): pointer;

+

+var

+  EnvBlock: string;

+  I: Integer;

+

+begin

+  EnvBlock := '';

+  For I:=0 to List.Count-1 do

+    EnvBlock := EnvBlock + List[i] + #0;

+  EnvBlock := EnvBlock + #0;

+  GetMem(Result, Length(EnvBlock));

+  CopyMemory(Result, @EnvBlock[1], Length(EnvBlock));

+end;

+

+Procedure InitProcessAttributes(P : TProcess; Var PA : TSecurityAttributes);

+

+begin

+  FillChar(PA,SizeOf(PA),0);

+  PA.nLength := SizeOf(PA);

+end;

+

+Procedure InitThreadAttributes(P : TProcess; Var TA : TSecurityAttributes);

+

+begin

+  FillChar(TA,SizeOf(TA),0);

+  TA.nLength := SizeOf(TA);

+end;

+

+Procedure InitStartupInfo(P : TProcess; Var SI : STARTUPINFO);

+

+Const

+  SWC : Array [TShowWindowOptions] of Cardinal =

+             (0,SW_HIDE,SW_Maximize,SW_Minimize,SW_Restore,SW_Show,

+             SW_ShowDefault,SW_ShowMaximized,SW_ShowMinimized,

+               SW_showMinNOActive,SW_ShowNA,SW_ShowNoActivate,SW_ShowNormal);

+

+begin

+  FillChar(SI,SizeOf(SI),0);

+  With SI do

+    begin

+    dwFlags:=GetStartupFlags(P);

+    if P.FShowWindow<>swoNone then

+     dwFlags:=dwFlags or Startf_UseShowWindow

+    else

+      dwFlags:=dwFlags and not Startf_UseShowWindow;

+    wShowWindow:=SWC[P.FShowWindow];

+    if (poUsePipes in P.Options) then

+      begin

+      dwFlags:=dwFlags or Startf_UseStdHandles;

+      end;

+    if P.FillAttribute<>0 then

+      begin

+      dwFlags:=dwFlags or Startf_UseFillAttribute;

+      dwFillAttribute:=P.FillAttribute;

+      end;

+     dwXCountChars:=P.WindowColumns;

+     dwYCountChars:=P.WindowRows;

+     dwYsize:=P.WindowHeight;

+     dwXsize:=P.WindowWidth;

+     dwy:=P.WindowTop;

+     dwX:=P.WindowLeft;

+     end;

+end;

+

+Procedure CreatePipes(Var HI,HO,HE : Thandle; Var SI : TStartupInfo; CE : Boolean);

+

+  Procedure DoCreatePipeHandles(Var H1,H2 : THandle);

+

+  Var

+    I,O : Longint;

+

+  begin

+    CreatePipeHandles(I,O);

+    H1:=Thandle(I);

+    H2:=THandle(O);

+  end;

+

+

+

+

+begin

+  DoCreatePipeHandles(SI.hStdInput,HI);

+  DoCreatePipeHandles(HO,Si.hStdOutput);

+  if CE then

+    DoCreatePipeHandles(HE,SI.hStdError)

+  else

+    begin

+    SI.hStdError:=SI.hStdOutput;

+    HE:=HO;

+    end;

+end;

+

+

+Procedure TProcess.Execute;

+

+

+Var

+  PName,PDir,PCommandLine : PChar;

+  FEnv: pointer;

+  FCreationFlags : Cardinal;

+  FProcessAttributes : TSecurityAttributes;

+  FThreadAttributes : TSecurityAttributes;

+  FProcessInformation : TProcessInformation;

+  FStartupInfo : STARTUPINFO;

+  HI,HO,HE : THandle;

+

+begin

+  FInheritHandles:=True;

+  PName:=Nil;

+  PCommandLine:=Nil;

+  PDir:=Nil;

+  If FApplicationName<>'' then

+    PName:=Pchar(FApplicationName);

+  If FCommandLine<>'' then

+    PCommandLine:=Pchar(FCommandLine);

+  If FCurrentDirectory<>'' then

+    PDir:=Pchar(FCurrentDirectory);

+  if FEnvironment.Count<>0 then

+    FEnv:=StringsToPChars(FEnvironment)

+  else

+    FEnv:=Nil;

+  Try

+    FCreationFlags:=GetCreationFlags(Self);

+    InitProcessAttributes(Self,FProcessAttributes);

+    InitThreadAttributes(Self,FThreadAttributes);

+    InitStartupInfo(Self,FStartUpInfo);

+    If poUsePipes in FProcessOptions then

+      CreatePipes(HI,HO,HE,FStartupInfo,Not(poStdErrToOutPut in FProcessOptions));

+    Try

+      If Not CreateProcess (PName,PCommandLine,@FProcessAttributes,@FThreadAttributes,

+                   FInheritHandles,FCreationFlags,FEnv,PDir,FStartupInfo,

+                   fProcessInformation) then

+        Raise Exception.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);

+      FProcessHandle:=FProcessInformation.hProcess;

+      FThreadHandle:=FProcessInformation.hThread;

+      FProcessID:=FProcessINformation.dwProcessID;

+    Finally

+      if POUsePipes in FProcessOptions then

+        begin

+        FileClose(FStartupInfo.hStdInput);

+        FileClose(FStartupInfo.hStdOutput);

+        if Not (poStdErrToOutPut in FProcessOptions) then

+          FileClose(FStartupInfo.hStdError);

+        CreateStreams(HI,HO,HE);

+        end;

+    end;

+    FRunning:=True;

+  Finally

+    If FEnv<>Nil then

+      FreeMem(FEnv);

+  end;

+  if not (csDesigning in ComponentState) and // This would hang the IDE !

+     (poWaitOnExit in FProcessOptions) and

+      not (poRunSuspended in FProcessOptions) then

+    WaitOnExit;

+end;

+

+Function TProcess.WaitOnExit : Dword;

+

+begin

+  Result:=WaitForSingleObject (FProcessHandle,Infinite);

+  If Result<>Wait_Failed then

+    GetExitStatus;

+  FRunning:=False;

+end;

+

+Function TProcess.Suspend : Longint;

+

+begin

+  Result:=SuspendThread(ThreadHandle);

+end;

+

+Function TProcess.Resume : LongInt;

+

+begin

+  Result:=ResumeThread(ThreadHandle);

+end;

+

+Function TProcess.Terminate(AExitCode : Integer) : Boolean;

+

+begin

+  Result:=False;

+  If ExitStatus=Still_active then

+    Result:=TerminateProcess(Handle,AexitCode);

+end;

+

+Procedure TProcess.SetShowWindow (Value : TShowWindowOptions);

+

+

+begin

+  FShowWindow:=Value;

+end;

+

+// ---------------------------- end of platform dependant code --------------

+

+{

+  Unix Process .inc.

+}

+

+uses

+   Unix,

+   Baseunix;

+

+

+

+Const

+  PriorityConstants : Array [TProcessPriority] of Integer =

+                      (20,20,0,-20);

+

+Const

+  GeometryOption : String = '-geometry';

+  TitleOption : String ='-title';

+

+

+

+procedure TProcess.CloseProcessHandles;

+

+begin

+ // Do nothing. Win32 call.

+end;

+

+Function TProcess.PeekExitStatus : Boolean;

+

+begin

+  Result:=fpWaitPid(Handle,@FExitCode,WNOHANG)=Handle;

+  If Result then

+    FExitCode:=wexitstatus(FExitCode)

+  else

+    FexitCode:=0;

+end;

+

+Type

+  TPCharArray = Array[Word] of pchar;

+  PPCharArray = ^TPcharArray;

+

+Function StringsToPCharList(List : TStrings) : PPChar;

+

+Var

+  I : Integer;

+  S : String;

+

+begin

+  I:=(List.Count)+1;

+  GetMem(Result,I*sizeOf(PChar));

+  PPCharArray(Result)^[List.Count]:=Nil;

+  For I:=0 to List.Count-1 do

+    begin

+    S:=List[i];

+    Result[i]:=StrNew(PChar(S));

+    end;

+end;

+

+Procedure FreePCharList(List : PPChar);

+

+Var

+  I : integer;

+

+begin

+  I:=0;

+  While List[i]<>Nil do

+    begin

+    StrDispose(List[i]);

+    Inc(I);

+    end;

+  FreeMem(List);

+end;

+

+

+Procedure CommandToList(S : String; List : TStrings);

+

+  Function GetNextWord : String;

+

+  Const

+    WhiteSpace = [' ',#8,#10];

+    Literals = ['"',''''];

+

+  Var

+    Wstart,wend : Integer;

+    InLiteral : Boolean;

+    LastLiteral : char;

+

+  begin

+    WStart:=1;

+    While (WStart<=Length(S)) and (S[WStart] in WhiteSpace) do

+      Inc(WStart);

+    WEnd:=WStart;

+    InLiteral:=False;

+    LastLiteral:=#0;

+    While (Wend<=Length(S)) and (Not (S[Wend] in WhiteSpace) or InLiteral) do

+      begin

+      if S[Wend] in Literals then

+        If InLiteral then

+          InLiteral:=Not (S[Wend]=LastLiteral)

+        else

+          begin

+          InLiteral:=True;

+          LastLiteral:=S[Wend];

+          end;

+       inc(wend);

+       end;

+     Result:=Copy(S,WStart,WEnd-WStart);

+     Result:=StringReplace(Result,'"','',[rfReplaceAll]);

+     Result:=StringReplace(Result,'''','',[rfReplaceAll]);

+     While (WEnd<=Length(S)) and (S[Wend] in WhiteSpace) do

+       inc(Wend);

+     Delete(S,1,WEnd-1);

+

+  end;

+

+Var

+  W : String;

+

+begin

+  While Length(S)>0 do

+    begin

+    W:=GetNextWord;

+    If (W<>'') then

+      List.Add(W);

+    end;

+end;

+

+

+Function MakeCommand(P : TProcess) : PPchar;

+

+Const

+  SNoCommandLine = 'Cannot execute empty command-line';

+

+Var

+  Cmd : String;

+  S  : TStringList;

+  G : String;

+

+begin

+  if (P.ApplicationName='') then

+    begin

+    If (P.CommandLine='') then

+      Raise Exception.Create(SNoCommandline);

+    Cmd:=P.CommandLine;

+    end

+  else

+    begin

+    If (P.CommandLine='') then

+      Cmd:=P.ApplicationName

+    else

+      Cmd:=P.CommandLine;

+    end;

+  S:=TStringList.Create;

+  try

+    CommandToList(Cmd,S);

+    if poNewConsole in P.Options then

+      begin

+      S.Insert(0,'-e');

+      If (P.ApplicationName<>'') then

+        begin

+        S.Insert(0,P.ApplicationName);

+        S.Insert(0,'-title');

+        end;

+      if suoUseCountChars in P.StartupOptions then

+        begin

+        S.Insert(0,Format('%dx%d',[P.dwXCountChars,P.dwYCountChars]));

+        S.Insert(0,'-geometry');

+        end;

+      S.Insert(0,'xterm');

+      end;

+    if (P.ApplicationName<>'') then

+      begin

+      S.Add(TitleOption);

+      S.Add(P.ApplicationName);

+      end;

+    G:='';

+    if (suoUseSize in P.StartupOptions) then

+      g:=format('%dx%d',[P.dwXSize,P.dwYsize]);

+    if (suoUsePosition in P.StartupOptions) then

+      g:=g+Format('+%d+%d',[P.dwX,P.dwY]);

+    if G<>'' then

+      begin

+      S.Add(GeometryOption);

+      S.Add(g);

+      end;

+    Result:=StringsToPcharList(S);

+  Finally

+    S.free;

+  end;

+end;

+

+Function GetLastError : Integer;

+

+begin

+  Result:=-1;

+end;

+

+Type

+  TPipeEnd = (peRead,peWrite);

+  TPipePair = Array[TPipeEnd] of Integer;

+

+Procedure CreatePipes(Var HI,HO,HE : TPipePair; CE : Boolean);

+

+  Procedure CreatePair(Var P : TPipePair);

+

+   begin

+    If not CreatePipeHandles(P[peRead],P[peWrite]) then

+      Raise Exception.Create('Failed to create pipes');

+   end;

+

+  Procedure ClosePair(Var P : TPipePair);

+

+  begin

+    if (P[peRead]<>-1) then

+      FileClose(P[peRead]);

+    if (P[peWrite]<>-1) then

+      FileClose(P[peWrite]);

+  end;

+

+begin

+  HO[peRead]:=-1;HO[peWrite]:=-1;

+  HI[peRead]:=-1;HI[peWrite]:=-1;

+  HE[peRead]:=-1;HE[peWrite]:=-1;

+  Try

+    CreatePair(HO);

+    CreatePair(HI);

+    If CE then

+      CreatePair(HE);

+  except

+    ClosePair(HO);

+    ClosePair(HI);

+    If CE then

+      ClosePair(HE);

+    Raise;

+  end;

+end;

+

+Procedure TProcess.Execute;

+

+Var

+  HI,HO,HE : TPipePair;

+  PID      : Longint;

+  FEnv     : PPChar;

+  Argv     : PPChar;

+  fd       : Integer;

+  PName    : String;

+

+begin

+  If (poUsePipes in FProcessOptions) then

+    CreatePipes(HI,HO,HE,Not (poStdErrToOutPut in FProcessOptions));

+  Try

+    if FEnvironment.Count<>0 then

+      FEnv:=StringsToPcharList(FEnvironment)

+    else

+      FEnv:=Nil;

+    Try

+      Argv:=MakeCommand(Self);

+      Try

+        If (Argv<>Nil) and (ArgV[0]<>Nil) then

+          PName:=StrPas(Argv[0])

+        else

+          begin

+          // This should never happen, actually.

+          PName:=ApplicationName;

+          If (PName='') then

+            PName:=CommandLine;

+          end;

+        if (pos('/',PName)<>1) then

+          PName:=FileSearch(Pname,fpgetenv('PATH'));

+        Pid:=fpfork;

+        if Pid<0 then

+          Raise Exception.Create('Failed to Fork process');

+        if (PID>0) then

+          begin

+          // Parent process. Copy process information.

+          FProcessHandle:=PID;

+          FThreadHandle:=PID;

+          FProcessId:=PID;

+          //FThreadId:=PID;

+          end

+        else

+          begin

+          { We're in the child }

+          if (FCurrentDirectory<>'') then

+             ChDir(FCurrentDirectory);

+          if PoUsePipes in Options then

+            begin

+            fpdup2(HI[peRead],0);

+            fpdup2(HO[peWrite],1);

+            if (poStdErrToOutPut in Options) then

+              fpdup2(HO[peWrite],2)

+            else

+              fpdup2(HE[peWrite],2);

+            end

+          else if poNoConsole in Options then

+            begin

+            fd:=FileOpen('/dev/null',fmOpenReadWrite);

+            fpdup2(fd,0);

+            fpdup2(fd,1);

+            fpdup2(fd,2);

+            end;

+          if (poRunSuspended in Options) then

+            sigraise(SIGSTOP);

+          if FEnv<>Nil then

+            fpexecve(PName,Argv,Fenv)

+          else

+            fpexecv(PName,argv);

+          Halt(127);

+          end

+      Finally

+        FreePcharList(Argv);

+      end;

+    Finally

+      If (FEnv<>Nil) then

+        FreePCharList(FEnv);

+    end;

+  Finally

+    if POUsePipes in FProcessOptions then

+      begin

+      FileClose(HO[peWrite]);

+      FileClose(HI[peRead]);

+      if Not (poStdErrToOutPut in FProcessOptions) then

+        FileClose(HE[peWrite]);

+      CreateStreams(HI[peWrite],HO[peRead],HE[peRead]);

+      end;

+  end;

+  FRunning:=True;

+  if not (csDesigning in ComponentState) and // This would hang the IDE !

+     (poWaitOnExit in FProcessOptions) and

+      not (poRunSuspended in FProcessOptions) then

+    WaitOnExit;

+end;

+

+Function TProcess.WaitOnExit : Dword;

+

+begin

+  Result:=fpWaitPid(Handle,@FExitCode,0);

+  If Result=Handle then

+    FExitCode:=WexitStatus(FExitCode);

+  FRunning:=False;

+end;

+

+Function TProcess.Suspend : Longint;

+

+begin

+  If fpkill(Handle,SIGSTOP)<>0 then

+    Result:=-1

+  else

+    Result:=1;

+end;

+

+Function TProcess.Resume : LongInt;

+

+begin

+  If fpKill(Handle,SIGCONT)<>0 then

+    Result:=-1

+  else

+    Result:=0;

+end;

+

+Function TProcess.Terminate(AExitCode : Integer) : Boolean;

+

+begin

+  Result:=False;

+  Result:=fpkill(Handle,SIGTERM)=0;

+  If Result then

+    begin

+    If Running then

+      Result:=fpkill(Handle,SIGKILL)=0;

+    end;

+  GetExitStatus;

+end;

+

+Procedure TProcess.SetShowWindow (Value : TShowWindowOptions);

+

+begin

+  FShowWindow:=Value;

+end;

+

+// ---------------------------------------------------------------------------

+

+

+Constructor TProcess.Create (AOwner : TComponent);

+begin

+  Inherited;

+  FProcessPriority:=ppNormal;

+  FShowWindow:=swoNone;

+  FInheritHandles:=True;

+  FEnvironment:=TStringList.Create;

+end;

+

+Destructor TProcess.Destroy;

+

+begin

+  FEnvironment.Free;

+  FreeStreams;

+  CloseProcessHandles;

+  Inherited Destroy;

+end;

+

+Procedure TProcess.FreeStreams;

+

+  procedure FreeStream(var S: THandleStream);

+

+  begin

+    if (S<>Nil) then

+      begin

+      FileClose(S.Handle);

+      FreeAndNil(S);

+      end;

+  end;

+

+begin

+  If FStdErrStream<>FOutputStream then

+    FreeStream(FStdErrStream);

+  FreeStream(FOutputStream);

+  FreeStream(FInputStream);

+end;

+

+

+Function TProcess.GetExitStatus : Integer;

+

+begin

+  If FRunning then

+    PeekExitStatus;

+  Result:=FExitCode;

+end;

+

+

+Function TProcess.GetRunning : Boolean;

+

+begin

+  IF FRunning then

+    FRunning:=Not PeekExitStatus;

+  Result:=FRunning;

+end;

+

+

+Procedure TProcess.CreateStreams(InHandle,OutHandle,Errhandle : Longint);

+

+begin

+  FreeStreams;

+  FInputStream:=TOutputPipeStream.Create (InHandle);

+  FOutputStream:=TInputPipeStream.Create (OutHandle);

+  if Not (poStdErrToOutPut in FProcessOptions) then

+    FStdErrStream:=TInputPipeStream.Create(ErrHandle);

+end;

+

+

+Procedure TProcess.SetWindowColumns (Value : Cardinal);

+

+begin

+  if Value<>0 then

+    Include(FStartUpOptions,suoUseCountChars);

+  dwXCountChars:=Value;

+end;

+

+

+Procedure TProcess.SetWindowHeight (Value : Cardinal);

+

+begin

+  if Value<>0 then

+    include(FStartUpOptions,suoUsePosition);

+  dwYSize:=Value;

+end;

+

+Procedure TProcess.SetWindowLeft (Value : Cardinal);

+

+begin

+  if Value<>0 then

+    Include(FStartUpOptions,suoUseSize);

+  dwx:=Value;

+end;

+

+Procedure TProcess.SetWindowTop (Value : Cardinal);

+

+begin

+  if Value<>0 then

+    Include(FStartUpOptions,suoUsePosition);

+  dwy:=Value;

+end;

+

+Procedure TProcess.SetWindowWidth (Value : Cardinal);

+begin

+  If (Value<>0) then

+    Include(FStartUpOptions,suoUseSize);

+  dwXSize:=Value;

+end;

+

+Function TProcess.GetWindowRect : TRect;

+begin

+  With Result do

+    begin

+    Left:=dwx;

+    Right:=dwx+dwxSize;

+    Top:=dwy;

+    Bottom:=dwy+dwysize;

+    end;

+end;

+

+Procedure TProcess.SetWindowRect (Value : Trect);

+begin

+  Include(FStartupOptions,suouseSize);

+  Include(FStartupOptions,suoUsePosition);

+  With Value do

+    begin

+    dwx:=Left;

+    dwxSize:=Right-Left;

+    dwy:=Top;

+    dwySize:=Bottom-top;

+    end;

+end;

+

+

+Procedure TProcess.SetWindowRows (Value : Cardinal);

+

+begin

+  if Value<>0 then

+    Include(FStartUpOptions,suoUseCountChars);

+  dwYCountChars:=Value;

+end;

+

+procedure TProcess.SetApplicationname(const Value: String);

+begin

+  FApplicationname := Value;

+  If (csdesigning in ComponentState) and

+     (FCommandLine='') then

+    FCommandLine:=Value;

+end;

+

+procedure TProcess.SetProcessOptions(const Value: TProcessOptions);

+begin

+  FProcessOptions := Value;

+  If poNewConsole in FPRocessOptions then

+    Exclude(FProcessoptions,poNoConsole);

+  if poRunSuspended in FProcessOptions then

+    Exclude(FPRocessoptions,poWaitOnExit);

+end;

+

+procedure TProcess.SetActive(const Value: Boolean);

+begin

+  if (Value<>GetRunning) then

+    If Value then

+      Execute

+    else

+      Terminate(0);

+end;

+

+procedure TProcess.SetEnvironment(const Value: TStrings);

+begin

+  FEnvironment.Assign(Value);

+end;

+

+function CallProcess(const command: string): string;

+const

+  READ_BYTES = 2048;

+// executes the command and returns the program's output

+var

+  M: TMemoryStream;

+  P: TProcess;

+  n: LongInt;

+  BytesRead: LongInt;

+begin

+  // We cannot use poWaitOnExit here since we don't

+  // know the size of the output. On Linux the size of the

+  // output pipe is 2 kB. If the output data is more, we

+  // need to read the data. This isn't possible since we are

+  // waiting. So we get a deadlock here.

+  //

+  // A temp Memorystream is used to buffer the output

+

+  M := TMemoryStream.Create;

+  BytesRead := 0;

+

+  P := TProcess.Create(nil);

+  P.CommandLine := Command;

+  P.Options := [poUsePipes];

+  P.Execute;

+  while P.Running do begin

+    // make sure we have room

+    M.SetSize(BytesRead + READ_BYTES);

+

+    // try reading it

+    n := P.Output.Read((M.Memory + BytesRead)^, READ_BYTES);

+    if n > 0 then

+      Inc(BytesRead, n)

+    else

+      // no data, wait 100 ms

+      Sleep(100)

+  end;

+  // read last part

+  repeat

+    // make sure we have room

+    M.SetSize(BytesRead + READ_BYTES);

+    // try reading it

+    n := P.Output.Read((M.Memory + BytesRead)^, READ_BYTES);

+    if n > 0 then Inc(BytesRead, n)

+  until n <= 0;

+  M.SetSize(BytesRead);

+

+  setLength(result, bytesRead);

+  m.read(result[1], bytesRead);

+  P.Free; M.Free;

+end;

+

+end.

diff --git a/lib/ptrset.nim b/lib/ptrset.nim
new file mode 100755
index 000000000..f1b9e58e5
--- /dev/null
+++ b/lib/ptrset.nim
@@ -0,0 +1,205 @@
+# This implements a new pointer set. Access time O(1). For 32 bit systems, we
+# currently need 3 memory accesses. 
+
+const
+  PageSize = 1024 * sizeof(int)
+  MemAlignment = 8 # minimal memory block that can be allocated
+  BitsPerUnit = sizeof(int)*8 
+    # a "unit" is a word, i.e. 4 bytes
+    # on a 32 bit system; I do not use the term "word" because under 32-bit
+    # Windows it is sometimes only 16 bits
+
+  BitsPerPage = PageSize div MemAlignment
+  UnitsPerPage = BitsPerPage div BitsPerUnit
+    # how many units do we need to describe a page:
+    # on 32 bit systems this is only 16 (!)
+
+type
+  PPointer = ptr pointer
+
+  TCollectorData = int
+  TCell = record
+    refcount: TCollectorData  # the refcount and bit flags
+    typ: PNimType                  
+    stackcount: int           # stack counter for debugging
+    drefc: int                # real reference counter for debugging
+
+  PCell = ptr TCell
+
+proc cellToUsr(cell: PCell): pointer {.inline.} =
+  # convert object (=pointer to refcount) to pointer to userdata
+  result = cast[pointer](cast[TAddress](cell)+%TAddress(sizeof(TCell)))
+
+proc usrToCell(usr: pointer): PCell {.inline.} =
+  # convert pointer to userdata to object (=pointer to refcount)
+  result = cast[PCell](cast[TAddress](usr)-%TAddress(sizeof(TCell)))
+
+proc gcAlloc(size: int): pointer =
+  result = alloc0(size)
+  if result == nil: raiseOutOfMem() 
+
+# ------------------ Zero count table (ZCT) and any table (AT) -------------
+
+# this that has to equals zero, otherwise we have to round up UnitsPerPage:
+when BitsPerPage mod BitsPerUnit != 0:
+  {.error: "(BitsPerPage mod BitsPerUnit) should be zero!".}
+
+# ------------------- cell set handling ------------------------------
+# A cellset consists of a hash table of page descriptors. A page
+# descriptor has a bit for
+# every Memalignment'th byte in the page.
+# However, only bits corresponding to addresses that start memory blocks
+# are set.
+# Page descriptors are also linked to a list; the list
+# is used for easy traversing of all page descriptors; this allows a
+# fast iterator.
+# We use a specialized hashing scheme; the formula is :
+# hash = Page bitand max
+# We use linear probing with the formular: (5*h)+1
+# Thus we likely get no collisions at all if the pages are given to us
+# in a sequential manner by the operating system!
+const
+  bitsPerNode = 10 # we use 10 bits per node; this means 3 memory accesses on
+                   # 32 bit systems
+
+type
+  PPageDesc = ptr TPageDesc
+
+  TBitIndex = range[0..UnitsPerPage-1]
+
+  TPageDesc = record
+    next: PPageDesc # all nodes are connected with this pointer
+    key: TAddress   # start address at bit 0
+    bits: array[TBitIndex, int] # a bit vector
+
+  PPageDescArray = ptr array[0..1000_000, PPageDesc]
+  TCellSet = record
+    counter, max: int
+    head: PPageDesc
+    data: PPageDescArray
+    
+  TSetNode = record
+    n: array[0.. (1 shl bitsPerNode)-1, PSetNode]
+  PSetNode = ptr TSetNode
+
+const
+  InitCellSetSize = 1024 # must be a power of two!
+
+proc CellSetInit(s: var TCellSet) =
+  s.data = gcAlloc(InitCellSetSize * sizeof(PPageDesc))
+  s.max = InitCellSetSize-1
+  s.counter = 0
+  s.head = nil
+
+proc CellSetDeinit(s: var TCellSet) =
+  var it = s.head
+  while it != nil:
+    var n = it.next
+    dealloc(it)
+    it = n
+  s.head = nil # play it safe here
+  dealloc(s.data)
+  s.data = nil
+  s.counter = 0
+
+proc CellSetGet(t: TCellSet, key: TAddress): PPageDesc =
+  var h = cast[int](key) and t.max
+  while t.data[h] != nil:
+    if t.data[h].key == key: return t.data[h]
+    h = nextTry(h, t.max)
+  return nil
+
+proc CellSetRawInsert(t: TCellSet, data: PPageDescArray,
+                      desc: PPageDesc) =
+  var h = cast[int](desc.key) and t.max
+  while data[h] != nil:
+    assert(data[h] != desc)
+    h = nextTry(h, t.max)
+  assert(data[h] == nil)
+  data[h] = desc
+
+proc CellSetEnlarge(t: var TCellSet) =
+  var
+    n: PPageDescArray
+    oldMax = t.max
+  t.max = ((t.max+1)*2)-1
+  n = gcAlloc((t.max + 1) * sizeof(PPageDesc))
+  for i in 0 .. oldmax:
+    if t.data[i] != nil:
+      CellSetRawInsert(t, n, t.data[i])
+  dealloc(t.data)
+  t.data = n
+
+proc CellSetPut(t: var TCellSet, key: TAddress): PPageDesc =
+  var h = cast[int](key) and t.max
+  while true:
+    var x = t.data[h]
+    if x == nil: break
+    if x.key == key: return x
+    h = nextTry(h, t.max)
+
+  if (t.max+1) * 2 < t.counter * 3: CellSetEnlarge(t)
+  inc(t.counter)
+  h = cast[int](key) and t.max
+  while t.data[h] != nil: h = nextTry(h, t.max)
+  assert(t.data[h] == nil)
+  # the new page descriptor goes into result
+  result = gcAlloc(sizeof(TPageDesc))
+  result.next = t.head
+  result.key = key
+  t.head = result
+  t.data[h] = result
+
+# ---------- slightly higher level procs ----------------------------------
+
+proc in_Operator(s: TCellSet, cell: PCell): bool =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetGet(s, u /% PageSize)
+  if t != nil:
+    u = (u %% PageSize) /% MemAlignment
+    result = (t.bits[u /% BitsPerUnit] and (1 shl (u %% BitsPerUnit))) != 0
+  else:
+    result = false
+
+proc incl(s: var TCellSet, cell: PCell) =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetPut(s, u /% PageSize)
+  u = (u %% PageSize) /% MemAlignment
+  t.bits[u /% BitsPerUnit] = t.bits[u /% BitsPerUnit] or 
+    (1 shl (u %% BitsPerUnit))
+
+proc excl(s: var TCellSet, cell: PCell) =
+  var
+    u: TAddress
+    t: PPageDesc
+  u = cast[TAddress](cell)
+  t = CellSetGet(s, u /% PageSize)
+  if t != nil:
+    u = (u %% PageSize) /% MemAlignment
+    t.bits[u %% BitsPerUnit] = (t.bits[u /% BitsPerUnit] and
+                                  not (1 shl (u %% BitsPerUnit)))
+
+iterator elements(t: TCellSet): PCell {.inline.} =
+  # while traversing it is forbidden to add pointers to the tree!
+  var r = t.head
+  while r != nil:
+    var i = 0
+    while i <= high(r.bits):
+      var w = r.bits[i] # taking a copy of r.bits[i] here is correct, because
+      # modifying operations are not allowed during traversation
+      var j = 0
+      while w != 0:         # test all remaining bits for zero
+        if (w and 1) != 0:  # the bit is set!
+          yield cast[PCell]((r.key *% PageSize) +%
+                              (i*%BitsPerUnit+%j) *% MemAlignment)
+        inc(j)
+        w = w shr 1
+      inc(i)
+    r = r.next
+
diff --git a/lib/repr.nim b/lib/repr.nim
new file mode 100755
index 000000000..e5106c38d
--- /dev/null
+++ b/lib/repr.nim
@@ -0,0 +1,233 @@
+#

+#

+#            Nimrod's Runtime Library

+#        (c) Copyright 2006 Andreas Rumpf

+#

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

+#    distribution, for details about the copyright.

+#

+

+# The generic ``repr`` procedure. It is an invaluable debugging tool.

+

+#proc cstrToNimStrDummy(s: cstring): string {.inline.} =

+#  result = cast[string](cstrToNimStr(s))

+

+proc reprInt(x: int64): string {.compilerproc.} = return $x

+proc reprFloat(x: float): string {.compilerproc.} = return $x

+

+proc reprPointer(x: pointer): string {.compilerproc.} =

+  var buf: array [0..59, char] 

+  c_sprintf(buf, "%p", x)

+  return $buf

+

+proc reprStrAux(result: var string, s: string) =

+  if cast[pointer](s) == nil:

+    add result "nil"

+    return

+  add result, reprPointer(cast[pointer](s)) & "\""

+  for c in items(s):

+    case c

+    of '"': add result "\\\""

+    of '\\': add result, "\\\\" # BUGFIX: forgotten

+    of '\10': add result, "\\10\"\n\"" # " \n " # better readability

+    of '\128' .. '\255', '\0'..'\9', '\11'..'\31':

+      add result, "\\" & reprInt(ord(c))

+    else: result.add(c)

+  add result, "\""

+

+proc reprStr(s: string): string {.compilerproc.} =

+  result = ""

+  reprStrAux(result, s)

+

+proc reprBool(x: bool): string {.compilerproc.} =

+  if x: result = "true"

+  else: result = "false"

+

+proc reprChar(x: char): string {.compilerproc.} =

+  result = "\'"

+  case x

+  of '"': add result, "\\\""

+  of '\\': add result, "\\\\"

+  of '\128' .. '\255', '\0'..'\31': add result, "\\" & reprInt(ord(x))

+  else: add result, x

+  add result, "\'"

+

+proc reprEnum(e: int, typ: PNimType): string {.compilerproc.} =

+  if e <% typ.node.len: # BUGFIX

+    result = $typ.node.sons[e].name

+  else:

+    result = $e & " (invalid data!)"

+

+type

+  pbyteArray = ptr array[0.. 0xffff, byte]

+

+proc addSetElem(result: var string, elem: int, typ: PNimType) =

+  case typ.kind

+  of tyEnum: add result, reprEnum(elem, typ)

+  of tyBool: add result, reprBool(bool(elem))

+  of tyChar: add result, reprChar(chr(elem))

+  of tyRange: addSetElem(result, elem, typ.base)

+  of tyInt..tyInt64: add result, reprInt(elem)

+  else: # data corrupt --> inform the user

+    add result, " (invalid data!)"

+

+proc reprSetAux(result: var string, p: pointer, typ: PNimType) =

+  # "typ.slots.len" field is for sets the "first" field

+  var elemCounter = 0  # we need this flag for adding the comma at

+                       # the right places

+  add result, "{"

+  var u: int64

+  case typ.size

+  of 1: u = ze64(cast[ptr int8](p)^)

+  of 2: u = ze64(cast[ptr int16](p)^)

+  of 4: u = ze64(cast[ptr int32](p)^)

+  of 8: u = ze64(cast[ptr int64](p)^)

+  else:

+    var a = cast[pbyteArray](p)^

+    for i in 0 .. typ.size*8-1:

+      if (a[i div 8] and (1 shl (i mod 8))) != 0:

+        if elemCounter > 0: add result, ", "

+        addSetElem(result, i+typ.node.len, typ.base)

+        inc(elemCounter)

+  if typ.size <= 8:

+    for i in 0..sizeof(int64)*8-1:

+      if (u and (1 shl i)) != 0:

+        if elemCounter > 0: add result, ", "

+        addSetElem(result, i+typ.node.len, typ.base)

+        inc(elemCounter)

+  add result, "}"

+

+proc reprSet(p: pointer, typ: PNimType): string {.compilerproc.} =

+  result = ""

+  reprSetAux(result, p, typ)

+

+type

+  TReprClosure = record # we cannot use a global variable here

+                        # as this wouldn't be thread-safe

+    marked: TCellSet

+    recdepth: int       # do not recurse endless

+    indent: int         # indentation

+

+proc initReprClosure(cl: var TReprClosure) =

+  CellSetInit(cl.marked)

+  cl.recdepth = -1      # default is to display everything!

+  cl.indent = 0

+

+proc deinitReprClosure(cl: var TReprClosure) =

+  CellSetDeinit(cl.marked)

+

+proc reprBreak(result: var string, cl: TReprClosure) =

+  add result, "\n"

+  for i in 0..cl.indent-1: add result, ' '

+

+proc reprAux(result: var string, p: pointer, typ: PNimType,

+             cl: var TReprClosure)

+

+proc reprArray(result: var string, p: pointer, typ: PNimType,

+               cl: var TReprClosure) =

+  add result, "["

+  var bs = typ.base.size

+  for i in 0..typ.size div bs - 1:

+    if i > 0: add result, ", "

+    reprAux(result, cast[pointer](cast[TAddress](p) + i*bs), typ.base, cl)

+  add result, "]"

+

+proc reprSequence(result: var string, p: pointer, typ: PNimType,

+                  cl: var TReprClosure) =

+  if p == nil:

+    add result, "nil"

+    return

+  result.add(reprPointer(p) & "[")

+  var bs = typ.base.size

+  for i in 0..cast[PGenericSeq](p).len-1:

+    if i > 0: add result, ", "

+    reprAux(result, cast[pointer](cast[TAddress](p) + GenericSeqSize + i*bs),

+            typ.Base, cl)

+  add result, "]"

+

+

+proc reprRecordAux(result: var string, p: pointer, n: ptr TNimNode,

+                   cl: var TReprClosure) =

+  case n.kind

+  of nkNone: assert(false)

+  of nkSlot:

+    add result, $n.name 

+    add result, " = "

+    reprAux(result, cast[pointer](cast[TAddress](p) + n.offset), n.typ, cl)

+  of nkList:

+    for i in 0..n.len-1: 

+      if i > 0: add result, ",\n"

+      reprRecordAux(result, p, n.sons[i], cl)

+  of nkCase: 

+    var m = selectBranch(p, n)

+    reprAux(result, cast[pointer](cast[TAddress](p) + n.offset), n.typ, cl)

+    if m != nil: reprRecordAux(result, p, m, cl)

+    

+proc reprRecord(result: var string, p: pointer, typ: PNimType,

+                cl: var TReprClosure) =

+  add result, "["

+  reprRecordAux(result, p, typ.node, cl)

+  add result, "]"

+

+proc reprRef(result: var string, p: pointer, typ: PNimType,

+             cl: var TReprClosure) =

+  # we know that p is not nil here:

+  var cell = usrToCell(p)

+  add result, "ref " & reprPointer(p)

+  if cell notin cl.marked:

+    # only the address is shown:

+    incl(cl.marked, cell)

+    add result, " --> "

+    reprAux(result, p, typ.base, cl)

+

+proc reprAux(result: var string, p: pointer, typ: PNimType,

+             cl: var TReprClosure) =

+  if cl.recdepth == 0:

+    add result, "..."

+    return

+  dec(cl.recdepth)

+  case typ.kind

+  of tySet: reprSetAux(result, p, typ)

+  of tyArray: reprArray(result, p, typ, cl)

+  of tyRecord: reprRecord(result, p, typ, cl)

+  of tyObject: # result = reprRecord(p, typ, cl)

+    var t = cast[ptr PNimType](p)^

+    reprRecord(result, p, t, cl)

+  of tyRef, tyPtr:

+    assert(p != nil)

+    if cast[ppointer](p)^ == nil: add result, "nil"

+    else: reprRef(result, cast[ppointer](p)^, typ, cl)

+  of tySequence:

+    reprSequence(result, cast[ppointer](p)^, typ, cl)

+  of tyInt: add result, $(cast[ptr int](p)^)

+  of tyInt8: add result, $int(cast[ptr Int8](p)^)

+  of tyInt16: add result, $int(cast[ptr Int16](p)^)

+  of tyInt32: add result, $int(cast[ptr Int32](p)^)

+  of tyInt64: add result, $(cast[ptr Int64](p)^)

+  of tyFloat: add result, $(cast[ptr float](p)^)

+  of tyFloat32: add result, $(cast[ptr float32](p)^)

+  of tyFloat64: add result, $(cast[ptr float64](p)^)

+  of tyEnum: add result, reprEnum(cast[ptr int](p)^, typ)

+  of tyBool: add result, reprBool(cast[ptr bool](p)^)

+  of tyChar: add result, reprChar(cast[ptr char](p)^)

+  of tyString: reprStrAux(result, cast[ptr string](p)^)

+  of tyCString: reprStrAux(result, $(cast[ptr cstring](p)^))

+  of tyRange: reprAux(result, p, typ.base, cl)

+  of tyProc, tyPointer:

+    if cast[ppointer](p)^ == nil: add result, "nil"

+    else: add result, reprPointer(cast[ppointer](p)^)

+  else:

+    add result, "(invalid data!)"

+  inc(cl.recdepth)

+

+proc reprAny(p: pointer, typ: PNimType): string =

+  var

+    cl: TReprClosure

+  initReprClosure(cl)

+  result = ""

+  if typ.kind in {tyObject, tyRecord, tyArray, tySet}:

+    reprAux(result, p, typ, cl)

+  else:

+    reprAux(result, addr(p), typ, cl)

+  add result, "\n"

+  deinitReprClosure(cl)

diff --git a/lib/sets.nim b/lib/sets.nim
new file mode 100755
index 000000000..3aeae235c
--- /dev/null
+++ b/lib/sets.nim
@@ -0,0 +1,88 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+# set handling
+
+type
+  TMyByte = int8
+  TNimSet = array [0..4*2048-1, TMyByte]
+
+# implementation:
+
+proc countBits(n: int32): int {.exportc: "countBits".}
+# We use a prototype here, not in "cntbits.nim", because that is included
+# in math.nim too. So when linking with math.nim it'd give a duplicated
+# symbol error which we avoid by renaming here.
+
+include cntbits
+
+proc unionSets(res: var TNimSet, a, b: TNimSet, len: int) {.
+    compilerproc, inline.} =
+  for i in countup(0, len-1): res[i] = toU8(ze(a[i]) or ze(b[i]))
+
+proc diffSets(res: var TNimSet, a, b: TNimSet, len: int) {.
+    compilerproc, inline.} =
+  for i in countup(0, len-1): res[i] = toU8(ze(a[i]) and not ze(b[i]))
+
+proc intersectSets(res: var TNimSet, a, b: TNimSet, len: int) {.
+    compilerproc, inline.} =
+  for i in countup(0, len-1): res[i] = toU8(ze(a[i]) and ze(b[i]))
+
+proc symdiffSets(res: var TNimSet, a, b: TNimSet, len: int) {.
+    compilerproc, inline.} =
+  for i in countup(0, len-1): res[i] = toU8(ze(a[i]) xor ze(b[i]))
+
+proc containsSets(a, b: TNimSet, len: int): bool {.compilerproc, inline.} =
+  # s1 <= s2 ?
+  for i in countup(0, len-1):
+    if (ze(a[i]) and not ze(b[i])) != 0: return false
+  return true
+
+proc containsSubsets(a, b: TNimSet, len: int): bool {.compilerproc, inline.} =
+  # s1 < s2 ?
+  result = false # assume they are equal
+  for i in countup(0, len-1):
+    if (ze(a[i]) and not ze(b[i])) != 0: return false
+    if ze(a[i]) != ze(b[i]): result = true # they are not equal
+
+proc equalSets(a, b: TNimSet, len: int): bool {.compilerproc, inline.} =
+  for i in countup(0, len-1):
+    if ze(a[i]) != ze(b[i]): return false
+  return true
+
+proc cardSet(s: TNimSet, len: int): int {.compilerproc, inline.} =
+  result = 0
+  for i in countup(0, len-1):
+    inc(result, countBits(ze(s[i])))
+
+const
+  WORD_SIZE = sizeof(TMyByte)*8
+
+proc inSet(s: TNimSet, elem: int): bool {.compilerproc, inline.} =
+  return (s[elem /% WORD_SIZE] and (1 shl (elem %% WORD_SIZE))) != 0
+
+proc inclSets(s: var TNimSet, e: int) {.compilerproc, inline.} =
+  s[e /% WORD_SIZE] = toU8(s[e /% WORD_SIZE] or (1 shl (e %% WORD_SIZE)))
+
+proc inclRange(s: var TNimSet, first, last: int) {.compilerproc.} =
+  # not very fast, but it is seldom used
+  for i in countup(first, last): inclSets(s, i)
+
+proc smallInclRange(s: var int, first, last: int) {.compilerproc.} =
+  # not very fast, but it is seldom used
+  for i in countup(first, last):
+    s = s or (1 shl (i %% sizeof(int)*8))
+
+proc exclSets(s: var TNimSet, e: int) {.compilerproc, inline.} =
+  s[e /% WORD_SIZE] = toU8(s[e /% WORD_SIZE] and
+    not (1 shl (e %% WORD_SIZE)))
+
+proc smallContainsSubsets(a, b: int): bool {.compilerProc, inline.} =
+  # not used by new code generator
+  return ((a and not b) != 0) and (a != b)
diff --git a/lib/strutils.nim b/lib/strutils.nim
new file mode 100755
index 000000000..e2aca01b4
--- /dev/null
+++ b/lib/strutils.nim
@@ -0,0 +1,627 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+
+## This module contains various string utility routines.
+## See the module `regexprs` for regular expression support.
+
+{.push debugger:off .} # the user does not want to trace a part
+                       # of the standard library!
+
+# copied from excpt.nim, because I don't want to make this template public
+template newException(exceptn, message: expr): expr = 
+  block: # open a new scope
+    var
+      e: ref exceptn
+    new(e)
+    e.msg = message
+    e
+
+type
+  TCharSet* = set[char] # for compability for Nim
+
+const
+  Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'}
+    ## All the characters that count as whitespace.
+
+  strStart* = 0 # this is only for bootstraping
+                # XXX: remove this someday
+  nl* = "\n"    # this is only for bootstraping XXX: remove this somehow
+
+proc strip*(s: string): string {.noSideEffect.}
+  ## Strips leading and trailing whitespace from `s`.
+
+proc toLower*(s: string): string {.noSideEffect.}
+  ## Converts `s` into lower case. This works only for the letters A-Z.
+  ## See `charsets.nativeToLower` for a version that is locale-dependant.
+
+proc toLower*(c: Char): Char {.noSideEffect.}
+  ## Converts `c` into lower case. This works only for the letters A-Z.
+  ## See `charsets.nativeToLower()` for a version that is locale-dependant.
+
+proc toUpper*(s: string): string {.noSideEffect.}
+  ## Converts `s` into upper case. This works only for the letters a-z.
+  ## See `charsets.nativeToUpper()` for a version that is locale-dependant.
+
+proc toUpper*(c: Char): Char {.noSideEffect.}
+  ## Converts `c` into upper case. This works only for the letters a-z.
+  ## See `charsets.nativeToUpper()` for a version that is locale-dependant.
+
+proc capitalize*(s: string): string {.noSideEffect.}
+  ## Converts the first character of `s` into upper case.
+  ## This works only for the letters a-z.
+
+proc normalize*(s: string): string {.noSideEffect.}
+  ## Normalizes the string `s`. That means to convert it to lower case and
+  ## remove any '_'. This is needed for Nimrod identifiers for example.
+
+proc findSubStr*(sub, s: string, start: int = 0): int {.noSideEffect.}
+  ## Searches for `sub` in `s` starting at position `start`. Searching is
+  ## case-sensitive. If `sub` is not in `s`, -1 is returned.
+
+proc findSubStr*(sub: char, s: string, start: int = 0): int {.noSideEffect.}
+  ## Searches for `sub` in `s` starting at position `start`. Searching is
+  ## case-sensitive. If `sub` is not in `s`, -1 is returned.
+
+proc replaceStr*(s, sub, by: string): string {.noSideEffect.}
+  ## Replaces `sub` in `s` by the string `by`.
+
+proc deleteStr*(s: var string, first, last: int)
+  ## Deletes in `s` the characters at position `first`..`last`. This modifies
+  ## `s` itself, it does not return a copy.
+
+proc toOctal*(c: char): string
+  ## Converts a character `c` to its octal representation. The resulting
+  ## string may not have a leading zero. Its length is always exactly 3.
+
+iterator split*(s: string, seps: set[char] = Whitespace): string =
+  ## Splits the string `s` into substrings.
+  ##
+  ## Substrings are separated by a substring containing only `seps`.
+  ## The seperator substrings are not returned in `sub`, nor are they part
+  ## of `sub`.
+  ## Examples::
+  ##
+  ##   for word in split("  this is an  example  "):
+  ##     writeln(stdout, word)
+  ##
+  ## Results in::
+  ##
+  ##   "this"
+  ##   "is"
+  ##   "an"
+  ##   "example"
+  ##
+  ##   for word in split(";;this;is;an;;example;;;", {';'}):
+  ##     writeln(stdout, word)
+  ##
+  ## produces in the same output.
+  var
+    first: int = 0
+    last: int = 0
+  assert(not ('\0' in seps))
+  while last < len(s):
+    while s[last] in seps: inc(last)
+    first = last
+    while last < len(s) and s[last] not_in seps: inc(last) # BUGFIX!
+    yield copy(s, first, last-1)
+
+proc splitSeq*(s: string, seps: set[char] = Whitespace): seq[string] {.
+  noSideEffect.}
+  ## The same as `split`, but is a proc that returns a sequence of substrings.
+
+proc cmpIgnoreCase*(a, b: string): int {.noSideEffect.}
+  ## Compares two strings in a case insensitive manner. Returns:
+  ##
+  ## | 0 iff a == b
+  ## | < 0 iff a < b
+  ## | > 0 iff a > b
+
+proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect.}
+  ## Compares two strings normalized (i.e. case and
+  ## underscores do not matter). Returns:
+  ##
+  ## | 0 iff a == b
+  ## | < 0 iff a < b
+  ## | > 0 iff a > b
+
+proc in_Operator*(s: string, c: char): bool {.noSideEffect.}
+  ## Same as `findSubStr(c, s) >= 0`.
+
+proc in_Operator*(s, sub: string): bool {.noSideEffect.}
+  ## Same as `findSubStr(sub, s) >= 0`.
+
+proc toHex*(x: BiggestInt, len: int): string {.noSideEffect.}
+  ## Converts `x` to its hexadecimal representation. The resulting string
+  ## will be exactly `len` characters long. No prefix like ``0x``
+  ## is generated. `x` is treated as unsigned value.
+
+proc intToStr*(x: int, minchars: int = 1): string
+  ## Converts `x` to its decimal representation. The resulting string
+  ## will be minimally `minchars` characters long. This is achieved by
+  ## adding leading zeros.
+
+proc ParseInt*(s: string): int {.noSideEffect.}
+  ## Parses a decimal integer value contained in `s`. If `s` is not
+  ## a valid integer, `EInvalidValue` is raised.
+  # XXX: make this biggestint!
+
+proc ParseFloat*(s: string): float {.noSideEffect.}
+  ## Parses a decimal floating point value contained in `s`. If `s` is not
+  ## a valid floating point number, `EInvalidValue` is raised.
+  # XXX: make this biggestfloat.
+
+# the stringify and format operators:
+proc toString*[Ty](x: Ty): string
+  ## This generic proc is the same as the stringify operator `$`.
+
+proc `%` *(formatstr: string, a: openarray[string]): string {.noSideEffect.}
+  ## The substitution operator performs string substitutions in `formatstr`
+  ## and returns the modified `formatstr`.
+  ##
+  ## This is best explained by an example::
+  ##
+  ##   "$1 eats $2." % ["The cat", "fish"]
+  ##
+  ## Results in::
+  ##
+  ##   "The cat eats fish."
+  ##
+  ## The substitution variables (the thing after the ``$``)
+  ## are enumerated from 1 to 9.
+  ## Substitution variables can also be words (that is
+  ## ``[A-Za-z_]+[A-Za-z0-9_]*``) in which case the arguments in `a` with even
+  ## indices are keys and with odd indices are the corresponding values. Again
+  ## an example::
+  ##
+  ##   "$animal eats $food." % ["animal", "The cat", "food", "fish"]
+  ##
+  ## Results in::
+  ##
+  ##   "The cat eats fish."
+  ##
+  ## The variables are compared with `cmpIgnoreStyle`. `EInvalidValue` is 
+  ## raised if an ill-formed format string has been passed to the `%` operator.
+
+proc `%` *(formatstr, a: string): string {.noSideEffect.}
+  ## This is the same as `formatstr % [a]`.
+
+proc repeatChar*(count: int, c: Char = ' '): string
+  ## Returns a string of length `count` consisting only of
+  ## the character `c`.
+
+proc startsWith*(s, prefix: string): bool {.noSideEffect.}
+  ## Returns true iff ``s`` starts with ``prefix``.
+  ## If ``prefix == ""`` true is returned.
+
+proc endsWith*(s, suffix: string): bool {.noSideEffect.}
+  ## Returns true iff ``s`` ends with ``suffix``.
+  ## If ``suffix == ""`` true is returned.
+
+# implementation
+
+proc allCharsInSet*(s: string, theSet: TCharSet): bool =
+  ## returns true iff each character of `s` is in the set `theSet`.
+  for c in items(s):
+    if not (c in theSet): return false
+  return true
+
+proc c_strcmp(a, b: CString): int {.importc: "strcmp", nodecl.}
+
+proc startsWith(s, prefix: string): bool =
+  var i = 0
+  while true:
+    if prefix[i] == '\0': return true
+    if s[i] != prefix[i]: return false
+    inc(i)
+
+proc endsWith(s, suffix: string): bool =
+  var
+    i = 0
+    j = len(s) - len(suffix)
+  while true:
+    if suffix[i] == '\0': return true
+    if s[i+j] != suffix[i]: return false
+    inc(i)
+
+proc repeatChar(count: int, c: Char = ' '): string =
+  result = newString(count)
+  for i in 0..count-1:
+    result[i] = c
+
+proc intToStr(x: int, minchars: int = 1): string =
+  result = $abs(x)
+  for i in 1 .. minchars - len(result):
+    result = '0' & result
+  if x < 0:
+    result = '-' & result
+
+proc toString[Ty](x: Ty): string = return $x
+
+proc toOctal(c: char): string =
+  var
+    val: int
+  result = newString(3)
+  val = ord(c)
+  for i in countdown(2, 0):
+    result[i] = Chr(val mod 8 + ord('0'))
+    val = val div 8
+
+proc `%`(formatstr: string, a: string): string =
+  return formatstr % [a]
+
+proc findNormalized(x: string, inArray: openarray[string]): int =
+  var i = 0
+  while i < high(inArray):
+    if cmpIgnoreStyle(x, inArray[i]) == 0: return i
+    inc(i, 2) # incrementing by 1 would probably result in a
+    # security whole ...
+  return -1
+
+proc `%`(formatstr: string, a: openarray[string]): string =
+  # the format operator
+  const
+    PatternChars = {'a'..'z', 'A'..'Z', '0'..'9', '\128'..'\255', '_'}
+  result = ""
+  var i = 0
+  while i < len(formatstr):
+    if formatstr[i] == '$':
+      case formatstr[i+1] # again we use the fact that strings
+                          # are zero-terminated here
+      of '$':
+        add result, '$'
+        inc(i, 2)
+      of '1'..'9':
+        var j = 0
+        inc(i) # skip $
+        while formatstr[i] in {'0'..'9'}:
+          j = j * 10 + ord(formatstr[i]) - ord('0')
+          inc(i)
+        add result, a[j - 1]
+      of '{':
+        var j = i+1
+        while formatstr[j] notin {'\0', '}'}: inc(j)
+        var x = findNormalized(copy(formatstr, i+2, j-1), a)
+        if x >= 0 and x < high(a): add result, a[x+1]
+        else: raise newException(EInvalidValue, "invalid format string")
+        i = j+1
+      of 'a'..'z', 'A'..'Z', '\128'..'\255', '_':
+        var j = i+1
+        while formatstr[j] in PatternChars: inc(j)
+        var x = findNormalized(copy(formatstr, i+1, j-1), a)
+        if x >= 0 and x < high(a): add result, a[x+1]
+        else: raise newException(EInvalidValue, "invalid format string")
+        i = j
+      else: raise newException(EInvalidValue, "invalid format string")
+    else:
+      add result, formatstr[i]
+      inc(i)
+
+proc cmpIgnoreCase(a, b: string): int =
+  # makes usage of the fact that strings are zero-terminated
+  var
+    aa, bb: char
+  for i in 0..len(a)-1:
+    aa = toLower(a[i])
+    bb = toLower(b[i])
+    result = ord(aa) - ord(bb)
+    if result != 0: break
+
+{.push checks: off, line_trace: off .} # this is a hot-spot in the compiler!
+                                       # thus we compile without checks here
+
+proc cmpIgnoreStyle(a, b: string): int =
+  var
+    aa, bb: char
+    i = 0
+    j = 0
+  while True:
+    while a[i] == '_': inc(i)
+    while b[j] == '_': inc(j) # BUGFIX: typo
+    aa = toLower(a[i])
+    bb = toLower(b[j])
+    result = ord(aa) - ord(bb)
+    if result != 0 or aa == '\0': break
+    inc(i)
+    inc(j)
+
+{.pop.}
+
+# ---------- splitting -----------------------------------------------------
+
+proc splitSeq(s: string, seps: set[char]): seq[string] =
+  result = []
+  for sub in split(s, seps): add result, sub
+
+# ---------------------------------------------------------------------------
+
+proc strip(s: string): string =
+  const
+    chars: set[Char] = Whitespace
+  var
+    first = 0
+    last = len(s)-1
+  while s[first] in chars: inc(first)
+  while last >= 0 and s[last] in chars: dec(last)
+  result = copy(s, first, last)
+
+proc toLower(c: Char): Char =
+  if c in {'A'..'Z'}:
+    result = chr(ord(c) + (ord('a') - ord('A')))
+  else:
+    result = c
+
+proc toLower(s: string): string =
+  result = newString(len(s))
+  for i in 0..len(s) - 1:
+    result[i] = toLower(s[i])
+
+proc toUpper(c: Char): Char =
+  if c in {'a'..'z'}:
+    result = Chr(Ord(c) - (Ord('a') - Ord('A')))
+  else:
+    result = c
+
+proc toUpper(s: string): string =
+  result = newString(len(s))
+  for i in 0..len(s) - 1:
+    result[i] = toUpper(s[i])
+
+proc capitalize(s: string): string =
+  result = toUpper(s[0]) & copy(s, 1)
+
+proc normalize(s: string): string =
+  result = ""
+  for i in 0..len(s) - 1:
+    if s[i] in {'A'..'Z'}:
+      add result, Chr(Ord(s[i]) + (Ord('a') - Ord('A')))
+    elif s[i] != '_':
+      add result, s[i]
+
+type
+  TSkipTable = array[Char, int]
+
+proc preprocessSub(sub: string, a: var TSkipTable) =
+  var m = len(sub)
+  for i in 0..0xff: a[chr(i)] = m+1
+  for i in 0..m-1: a[sub[i]] = m-i
+
+proc findSubStrAux(sub, s: string, start: int, a: TSkipTable): int =
+  # fast "quick search" algorithm:
+  var
+    m = len(sub)
+    n = len(s)
+  # search:
+  var j = start
+  while j <= n - m:
+    block match:
+      for k in 0..m-1:
+        if sub[k] != s[k+j]: break match
+      return j
+    inc(j, a[s[j+m]])
+  return -1
+
+proc findSubStr(sub, s: string, start: int = 0): int =
+  var a: TSkipTable
+  preprocessSub(sub, a)
+  result = findSubStrAux(sub, s, start, a)
+  # slow linear search:
+  #var
+  #  i, j, M, N: int
+  #M = len(sub)
+  #N = len(s)
+  #i = start
+  #j = 0
+  #if i >= N:
+  #  result = -1
+  #else:
+  #  while True:
+  #    if s[i] == sub[j]:
+  #      Inc(i)
+  #      Inc(j)
+  #    else:
+  #      i = i - j + 1
+  #      j = 0
+  #    if (j >= M):
+  #      return i - M
+  #    elif (i >= N):
+  #      return -1
+
+
+proc findSubStr(sub: char, s: string, start: int = 0): int =
+  for i in start..len(s)-1:
+    if sub == s[i]: return i
+  return -1
+
+proc in_Operator(s: string, c: char): bool =
+  return findSubStr(c, s) >= 0
+
+proc in_Operator(s, sub: string): bool =
+  return findSubStr(sub, s) >= 0
+
+proc replaceStr(s, sub, by: string): string =
+  var
+    i, j: int
+    a: TSkipTable
+  result = ""
+  preprocessSub(sub, a)
+  i = 0
+  while true:
+    j = findSubStrAux(sub, s, i, a)
+    if j < 0: break
+    add result, copy(s, i, j - 1)
+    add result, by
+    i = j + len(sub)
+  # copy the rest:
+  add result, copy(s, i)
+
+proc deleteStr(s: var string, first, last: int) =
+  # example: "abc___uvwxyz\0"  (___ is to be deleted)
+  # --> first == 3, last == 5
+  # s[first..] = s[last+1..]
+  var
+    i = first
+  while last+i+1 < len(s):
+    s[i] = s[last+i+1]
+    inc(i)
+  setlen(s, len(s)-(last-first+1))
+
+# parsing numbers:
+
+proc sprintf(buf, frmt: CString) {.nodecl, importc: "sprintf", varargs.}
+
+proc toHex(x: BiggestInt, len: int): string =
+  const
+    HexChars = "0123456789ABCDEF"
+  var
+    shift: BiggestInt
+  result = newString(len)
+  shift = 0
+  for j in countdown(len-1, 0):
+    result[j] = HexChars[toU32(x shr shift) and 0xF]
+    shift = shift + 4
+
+{.push overflowChecks: on.}
+# this must be compiled with overflow checking turned on:
+proc rawParseInt(s: string, index: var int): BiggestInt =
+  # index contains the start position at proc entry; end position will be
+  # an index before the proc returns; index = -1 on error (no number at all)
+  # the problem here is that integers have an asymmetrical range: there is
+  # one more valid negative than prositive integer. Thus we perform the
+  # computation as a negative number and then change the sign at the end.
+  var
+    i: int
+    sign: BiggestInt
+  i = index
+  # a local i is more efficient than accessing an in out parameter
+  sign = -1
+  if s[i] == '+':
+    inc(i)
+  elif s[i] == '-':
+    inc(i)
+    sign = 1
+  if s[i] in {'0'..'9'}:
+    result = 0
+    while s[i] in {'0'..'9'}:
+      result = result * 10 - (ord(s[i]) - ord('0'))
+      inc(i)
+      while s[i] == '_':
+        inc(i)               # underscores are allowed and ignored
+    result = result * sign
+    index = i                # store index back
+  else:
+    index = -1
+
+{.pop.} # overflowChecks
+
+proc parseInt(s: string): int =
+  var
+    index: int
+    res: BiggestInt
+  index = strStart
+  res = rawParseInt(s, index)
+  if index == -1:
+    raise newException(EInvalidValue, "invalid integer: " & s)
+  elif (sizeof(int) <= 4) and
+      ((res < low(int)) or (res > high(int))):
+    raise newException(EOverflow, "overflow")
+  else:
+    result = int(res) # convert to smaller integer type
+
+proc ParseFloat(s: string): float =
+  var
+    hd, esign, sign: float
+    exponent, i: int
+    flags: int
+  result = 0.0
+  i = 0
+  exponent = 0
+  esign = 1.0
+  flags = 0
+  sign = 1.0
+  if s[i] == '+': inc(i)
+  elif s[i] == '-':
+    sign = -1.0
+    inc(i)
+  while s[i] in {'0'..'9'}:
+    # Read integer part
+    flags = flags or 1
+    result = result * 10.0 + toFloat(ord(s[i]) - ord('0'))
+    inc(i)
+    while s[i] == '_': inc(i)
+  # Decimal?
+  if s[i] == '.':
+    hd = 1.0
+    inc(i)
+    while s[i] in {'0'..'9'}:
+      # Read fractional part
+      flags = flags or 2
+      result = result * 10.0 + toFloat(ord(s[i]) - ord('0'))
+      hd = hd * 10.0
+      inc(i)
+      while s[i] == '_': inc(i)
+    result = result / hd # this complicated way preserves precision
+  # Again, read integer and fractional part
+  if flags == 0:
+    raise newException(EInvalidValue, "invalid float:" & s)
+  # Exponent?
+  if s[i] in {'e', 'E'}:
+    inc(i)
+    if s[i] == '+':
+      inc(i)
+    elif s[i] == '-':
+      esign = -1.0
+      inc(i)
+    if s[i] notin {'0'..'9'}: 
+      raise newException(EInvalidValue, "invalid float: " & s)
+    while s[i] in {'0'..'9'}:
+      exponent = exponent * 10 + ord(s[i]) - ord('0')
+      inc(i)
+      while s[i] == '_': inc(i)
+  # Calculate Exponent
+  hd = 1.0
+  for j in 1..exponent:
+    hd = hd * 10.0
+  if esign > 0.0: result = result * hd
+  else:           result = result / hd
+  # Not all characters are read?
+  if s[i] != '\0': raise newException(EInvalidValue, "invalid float: " & s)
+  # evaluate sign
+  result = result * sign
+
+proc toOct*(x: BiggestInt, len: int): string =
+  ## converts `x` into its octal representation. The resulting string is
+  ## always `len` characters long. No leading ``0c`` prefix is generated.
+  var
+    mask, shift: BiggestInt
+  assert(len > 0)
+  result = newString(len)
+  mask = 7
+  shift = 0
+  for j in countdown(len-1, 0):
+    result[j] = chr(int((x and mask) shr shift) + ord('0'))
+    shift = shift + 3
+    mask = mask shl 3
+
+proc toBin*(x: BiggestInt, len: int): string =
+  ## converts `x` into its binary representation. The resulting string is
+  ## always `len` characters long. No leading ``0b`` prefix is generated.
+  var
+    mask, shift: BiggestInt
+  assert(len > 0)
+  result = newString(len)
+  mask = 1
+  shift = 0
+  for j in countdown(len-1, 0):
+    result[j] = chr(int((x and mask) shr shift) + ord('0'))
+    shift = shift + 1
+    mask = mask shl 1
+
+{.pop.}
diff --git a/lib/sysio.nim b/lib/sysio.nim
new file mode 100755
index 000000000..bb028b0de
--- /dev/null
+++ b/lib/sysio.nim
@@ -0,0 +1,163 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+## Nimrod's standard IO library. It contains high-performance
+## routines for reading and writing data to (buffered) files or
+## TTYs.
+
+{.push debugger:off .} # the user does not want to trace a part
+                       # of the standard library!
+
+
+proc fputs(c: cstring, f: TFile) {.importc: "fputs", noDecl.}
+proc fgets(c: cstring, n: int, f: TFile): cstring {.importc: "fgets", noDecl.}
+proc fgetc(stream: TFile): int {.importc: "fgetc", nodecl.}
+proc ungetc(c: int, f: TFile) {.importc: "ungetc", nodecl.}
+proc putc(c: Char, stream: TFile) {.importc: "putc", nodecl.}
+proc fprintf(f: TFile, frmt: CString) {.importc: "fprintf", nodecl, varargs.}
+proc strlen(c: cstring): int {.importc: "strlen", nodecl.}
+
+proc setvbuf(stream: TFile, buf: pointer, typ, size: cint): cint {.
+  importc, nodecl.}
+
+proc write(f: TFile, c: cstring) = fputs(c, f)
+
+var
+  IOFBF {.importc: "_IOFBF", nodecl.}: cint
+  IONBF {.importc: "_IONBF", nodecl.}: cint
+
+# copied here to remove dependancy on strutils:
+#proc toNimstr(x: Cstring, len: int): string {.
+#  noSideEffect, importc: "toNimStr".}
+
+proc rawReadLine(f: TFile, result: var string) {.noStatic.} =
+  # of course this could be optimized a bit; but IO is slow anyway...
+  # and it was difficult to get this CORRECT with Ansi C's methods
+  var
+    c: cint
+  setLen(result, 0) # reuse the buffer!
+  while True:
+    c = fgetc(f)
+    if c < 0:
+      result = nil
+      break # EOF
+    if c == 10: break # LF
+    if c == 13:  # CR
+      c = fgetc(f) # is the next char LF?
+      if c != 10: ungetc(c, f) # no, put the character back
+      break
+    add result, chr(int(c))
+
+proc readLine(f: TFile): string =
+  result = ""
+  rawReadLine(f, result)
+
+proc readFile(filename: string): string =
+  var f: TFile
+  try:
+    if openFile(f, filename):
+      var len = getFileSize(f)
+      if len < high(int):
+        result = newString(int(len))
+        if readBuffer(f, addr(result[0]), int(len)) != len:
+          result = nil
+      closeFile(f)
+    else:
+      result = nil
+  except EIO:
+    result = nil
+
+proc write(f: TFile, s: string) = fputs(s, f)
+proc write(f: TFile, i: int) = fprintf(f, "%ld", i)
+proc write(f: TFile, b: bool) = 
+  if b: write(f, "true")
+  else: write(f, "false")
+proc write(f: TFile, r: float) = fprintf(f, "%g", r)
+proc write(f: TFile, c: Char) = putc(c, f)
+
+proc EndOfFile(f: TFile): bool =
+  # do not blame me; blame the ANSI C standard this is so brain-damaged
+  var
+    c: int
+  c = fgetc(f)
+  ungetc(c, f)
+  return c == -1
+
+proc writeln[Ty](f: TFile, x: Ty) =
+  write(f, x)
+  write(f, "\n")
+proc echo[Ty](x: Ty) = writeln(stdout, x)
+
+# interface to the C procs:
+proc fopen(filename, mode: CString): pointer {.importc: "fopen", noDecl.}
+
+const
+  FormatOpen: array [TFileMode, string] = ["rb", "wb", "w+b", "r+b", "ab"]
+    #"rt", "wt", "w+t", "r+t", "at"
+    # we always use binary here as for Nimrod the OS line ending
+    # should not be translated.
+
+
+proc OpenFile(f: var TFile, filename: string,
+              mode: TFileMode = fmRead,
+              bufSize: int = -1): Bool =
+  var
+    p: pointer
+  p = fopen(filename, FormatOpen[mode])
+  result = (p != nil)
+  f = cast[TFile](p)
+  if bufSize > 0:
+    if setvbuf(f, nil, IOFBF, bufSize) != 0:
+      raise newException(EOutOfMemory, "out of memory")
+  elif bufSize == 0:
+    discard setvbuf(f, nil, IONBF, 0)
+
+# C routine that is used here:
+proc fread(buf: Pointer, size, n: int, f: TFile): int {.
+  importc: "fread", noDecl.}
+proc fseek(f: TFile, offset: clong, whence: int): int {.
+  importc: "fseek", noDecl.}
+proc ftell(f: TFile): int {.importc: "ftell", noDecl.}
+
+proc fwrite(buf: Pointer, size, n: int, f: TFile): int {.
+  importc: "fwrite", noDecl.}
+# size_t fwrite(const void *ptr, size_t size, size_t n, FILE *stream);
+
+proc readBuffer(f: TFile, buffer: pointer, len: int): int =
+  result = fread(buffer, 1, len, f)
+
+proc ReadBytes(f: TFile, a: var openarray[byte], start, len: int): int =
+  result = readBuffer(f, addr(a[start]), len)
+
+proc ReadChars(f: TFile, a: var openarray[char], start, len: int): int =
+  result = readBuffer(f, addr(a[start]), len)
+
+proc writeBytes(f: TFile, a: openarray[byte], start, len: int): int =
+  result = writeBuffer(f, addr(a[start]), len)
+proc writeChars(f: TFile, a: openarray[char], start, len: int): int =
+  result = writeBuffer(f, addr(a[start]), len)
+proc writeBuffer(f: TFile, buffer: pointer, len: int): int =
+  result = fwrite(buffer, 1, len, f)
+
+proc setFilePos(f: TFile, pos: int64) =
+  if fseek(f, clong(pos), 0) != 0:
+    raise newException(EIO, "cannot set file position")
+
+proc getFilePos(f: TFile): int64 =
+  result = ftell(f)
+  if result < 0: raise newException(EIO, "cannot retrieve file position")
+
+proc getFileSize(f: TFile): int64 =
+  var oldPos = getFilePos(f)
+  discard fseek(f, 0, 2) # seek the end of the file
+  result = getFilePos(f)
+  setFilePos(f, oldPos)
+
+{.pop.}
diff --git a/lib/sysstr.nim b/lib/sysstr.nim
new file mode 100755
index 000000000..0ff43216c
--- /dev/null
+++ b/lib/sysstr.nim
@@ -0,0 +1,294 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+# string & sequence handling procedures needed by the code generator
+
+# strings are dynamically resized, have a length field
+# and are zero-terminated, so they can be casted to C
+# strings easily
+# we don't use refcounts because that's a behaviour
+# the programmer may not want
+
+type
+  TStringDesc {.importc, nodecl.} = record
+    len, space: int # len and space without counting the terminating zero
+    data: array[0..0, char] # for the '\0' character
+
+  mstring {.importc: "string".} = ptr TStringDesc
+
+# implementation:
+
+proc resize(old: int): int {.inline.} =
+  assert(old < 65536 * 4)
+  if old <= 0: return 1
+  elif old < 65536: return old * 2
+  else: return old * 3 div 2 # for large arrays * 3/2 is better
+
+proc cmpStrings(a, b: mstring): int {.inline, compilerProc.} =
+  if a == b: return 0
+  if a == nil: return -1
+  if b == nil: return 1
+  return c_strcmp(a.data, b.data)
+
+proc eqStrings(a, b: mstring): bool {.inline, compilerProc.} =
+  if a == b: return true
+  if a == nil or b == nil: return false
+  return a.len == b.len and
+    c_memcmp(a.data, b.data, a.len * sizeof(char)) == 0
+
+proc rawNewString(space: int): mstring {.compilerProc.} =
+  result = cast[mstring](newObj(addr(strDesc), sizeof(TStringDesc) + 
+                         space * sizeof(char)))
+  result.len = 0
+  result.space = space
+  result.data[0] = '\0'
+
+proc mnewString(len: int): mstring {.exportc.} =
+  result = rawNewString(len)
+  result.len = len
+  result.data[len] = '\0'
+
+proc toNimStr(str: CString, len: int): mstring {.compilerProc.} =
+  result = rawNewString(len)
+  result.len = len
+  c_memcpy(result.data, str, (len+1) * sizeof(Char))
+  result.data[len] = '\0' # IO.readline relies on this!
+
+proc cstrToNimstr(str: CString): mstring {.compilerProc.} =
+  return toNimstr(str, c_strlen(str))
+
+proc copyString(src: mstring): mstring {.compilerProc.} =
+  result = rawNewString(src.space)
+  result.len = src.len
+  c_memcpy(result.data, src.data, (src.len + 1) * sizeof(Char))
+
+proc hashString(s: string): int {.compilerproc.} =
+  # the compiler needs exactly the same hash function!
+  # this used to be used for efficient generation of string case statements
+  var
+    h: int
+  h = 0
+  for i in 0..Len(s)-1:
+    h = h +% Ord(s[i])
+    h = h +% h shl 10
+    h = h xor (h shr 6)
+  h = h +% h shl 3
+  h = h xor (h shr 11)
+  h = h +% h shl 15
+  result = h
+
+#  copy(s: string, start = 0): string
+#    {.extern: "copyStr", noDecl, noSideEffect.}
+#  copy(s: string, start, len: int): string
+#    {.extern: "copyStrLen", noDecl, noSideEffect.}
+#
+#  setLength(var s: string, newlen: int)
+#    {.extern: "setLengthStr", noDecl, noSideEffect.}
+
+
+proc copyStrLast(s: mstring, start, last: int): mstring {.exportc.} =
+  var
+    len: int
+  if start >= s.len: return mnewString(0) # BUGFIX
+  if last >= s.len:
+    len = s.len - start # - 1 + 1
+  else:
+    len = last - start + 1
+  result = rawNewString(len)
+  result.len = len
+  c_memcpy(result.data, addr(s.data[start]), len * sizeof(Char))
+  result.data[len] = '\0'
+
+proc copyStr(s: mstring, start: int): mstring {.exportc.} =
+  return copyStrLast(s, start, s.len-1)
+
+proc addChar(s: mstring, c: char): mstring {.compilerProc.} =
+  result = s
+  if result.len >= result.space:
+    result.space = resize(result.space)
+    result = cast[mstring](growObj(result,
+      sizeof(TStringDesc) + result.space * sizeof(char)))
+  result.data[result.len] = c
+  result.data[result.len+1] = '\0'
+  inc(result.len)
+
+# These routines should be used like following:
+#   <Nimrod code>
+#   s &= "hallo " & name & " how do you feel?"
+#
+#   <generated C code>
+#   {
+#     s = resizeString(s, 6 + name->len + 17);
+#     appendString(s, strLit1);
+#     appendString(s, strLit2);
+#     appendString(s, strLit3);
+#   }
+#
+#   <Nimrod code>
+#   s = "hallo " & name & " how do you feel?"
+#
+#   <generated C code>
+#   {
+#     string tmp0;
+#     tmp0 = rawNewString(6 + name->len + 17);
+#     appendString(s, strLit1);
+#     appendString(s, strLit2);
+#     appendString(s, strLit3);
+#     s = tmp0;
+#   }
+#
+#   <Nimrod code>
+#   s = ""
+#
+#   <generated C code>
+#   s = rawNewString(0);
+
+proc resizeString(dest: mstring, addlen: int): mstring {.compilerproc.} =
+  if dest.len + addLen + 1 <= dest.space: # BUGFIX: this is horrible!
+    result = dest
+  else: # slow path:
+    var
+      sp = max(resize(dest.space), dest.len + addLen + 1)
+    result = cast[mstring](growObj(dest, sizeof(TStringDesc) + 
+                           sp * sizeof(Char)))
+    # DO NOT UPDATE LEN YET: dest.len = newLen
+    result.space = sp
+
+proc appendString(dest, src: mstring) {.compilerproc, inline.} =
+  c_memcpy(addr(dest.data[dest.len]), src.data, (src.len + 1) * sizeof(Char))
+  inc(dest.len, src.len)
+
+proc appendChar(dest: mstring, c: char) {.compilerproc, inline.} =
+  dest.data[dest.len] = c
+  dest.data[dest.len+1] = '\0'
+  inc(dest.len)
+
+proc setLengthStr(s: mstring, newLen: int): mstring {.compilerProc.} =
+  var n = max(newLen, 0)
+  if n <= s.space:
+    result = s
+  else:
+    result = resizeString(s, n)
+  result.len = n
+  result.data[n] = '\0'
+
+# ----------------- sequences ----------------------------------------------
+
+proc incrSeq(seq: PGenericSeq, elemSize: int): PGenericSeq {.compilerProc.} =
+  # increments the length by one:
+  # this is needed for supporting the &= operator;
+  #
+  #  add seq x  generates:
+  #  seq = incrSeq(seq, sizeof(x));
+  #  seq[seq->len-1] = x;
+  result = seq
+  if result.len >= result.space:
+    var
+      s: TAddress
+    result.space = resize(result.space)
+    result = cast[PGenericSeq](growObj(result, elemSize * result.space + 
+                               GenericSeqSize))
+    # set new elements to zero:
+    s = cast[TAddress](result)
+    zeroMem(cast[pointer](s + GenericSeqSize + (result.len * elemSize)),
+      (result.space - result.len) * elemSize)
+    # for i in len .. space-1:
+    #   seq->data[i] = 0
+  inc(result.len)
+
+proc setLengthSeq(seq: PGenericSeq, elemSize, newLen: int): PGenericSeq {.
+    compilerProc.} =
+  result = seq
+  if result.space < newLen:
+    var
+      s: TAddress
+    result.space = max(resize(result.space), newLen)
+    result = cast[PGenericSeq](growObj(result, elemSize * result.space + 
+                               GenericSeqSize))
+    # set new elements to zero (needed for GC):
+    s = cast[TAddress](result)
+    zeroMem(cast[pointer](s + GenericSeqSize + (result.len * elemSize)),
+      (result.space - result.len) * elemSize)
+  # Else: We could decref references, if we had type information here :-(
+  #       However, this does not happen often
+  result.len = newLen
+
+# --------------- other string routines ----------------------------------
+proc `$`(x: int): string =
+  result = newString(sizeof(x)*4)
+  var i = 0
+  var y = x
+  while True:
+    var d = y div 10
+    result[i] = chr(abs(int(y - d*10)) + ord('0'))
+    inc(i)
+    y = d
+    if y == 0: break
+  if x < 0:
+    result[i] = '-'
+    inc(i)
+  setLen(result, i)
+  # mirror the string:
+  for j in 0..i div 2 - 1:
+    swap(result[j], result[i-j-1])
+
+{.push warnings: off.}
+proc `$`(x: float): string =
+  var buf: array [0..59, char]
+  c_sprintf(buf, "%#g", x)
+  return $buf
+{.pop.}
+
+proc `$`(x: int64): string =
+  # we don't rely on C's runtime here as some C compiler's
+  # int64 support is weak
+  result = newString(sizeof(x)*4)
+  var i = 0
+  var y = x
+  while True:
+    var d = y div 10
+    result[i] = chr(abs(int(y - d*10)) + ord('0'))
+    inc(i)
+    y = d
+    if y == 0: break
+  if x < 0:
+    result[i] = '-'
+    inc(i)
+  setLen(result, i)
+  # mirror the string:
+  for j in 0..i div 2 - 1:
+    swap(result[j], result[i-j-1])
+
+proc `$`(x: bool): string =
+  if x: result = "true"
+  else: result = "false"
+
+proc `$`(x: char): string =
+  result = newString(1)
+  result[0] = x
+
+proc `$`(x: string): string =
+  # this is useful for generic code!
+  return x
+
+
+proc binaryStrSearch(x: openarray[string], y: string): int {.compilerproc.} =
+  var
+    a = 0
+    b = len(x)
+  while a < b:
+     var mid = (a + b) div 2
+     if x[mid] < y:
+       a = mid + 1
+     else:
+       b = mid
+  if (a < len(x)) and (x[a] == y):
+    return a
+  else:
+    return -1
diff --git a/lib/system.nim b/lib/system.nim
new file mode 100755
index 000000000..8e8fc5d6d
--- /dev/null
+++ b/lib/system.nim
@@ -0,0 +1,1184 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2008 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+## The compiler depends on the System module to work properly and the System
+## module depends on the compiler. Most of the routines listed here use
+## special compiler magic.
+## Each module implicitly imports the System module; it may not be listed
+## explicitly. Because of this there can not be a user-defined module named
+## ``system``.
+##
+##   *"The good thing about reinventing the wheel is that you can get a
+##   round one."*
+
+{.push hints: off.}
+
+proc defined*[T] (x: T): bool {.magic: "Defined", noSideEffect.}
+  ## Special comile-time procedure that checks whether `x` is
+  ## defined. `x` has to be an identifier or a qualified identifier.
+  ## This can be used to check whether a library provides a certain
+  ## feature or not:
+  ##
+  ## .. code-block:: Nimrod
+  ##   when not defined(strutils.toUpper):
+  ##     # provide our own toUpper proc here, because strutils is
+  ##     # missing it.
+
+when defined(macosX):
+  {.define: useDL.}
+
+when defined(linux):
+  {.define: useDL.}
+
+when defined(unix):
+  # This may seem strange, but we cannot write "when not defined"
+  # here, because ``not`` has not been defined yet.
+  {.hint: "unix is defined".}
+else:
+  {.define: useDL.}
+  {.hint: "unix is not defined".}
+  # use Doug Lea's memory allocator; you can undefine it if you
+  # know that your system uses this library anyway (smaller code) or if
+  # your malloc() doesn't suck (most systems use it anyway)
+
+# these require compiler magic:
+proc `not` *(x: bool): bool {.magic: "Not", noSideEffect.}
+  ## Boolean not; returns true iff ``x == false``.
+
+proc new*[T](a: var ref T) {.magic: "New".}
+  ## creates a new object of type ``T`` and returns a safe (traced)
+  ## reference to it in ``a``.
+
+proc new*[T](a: var ref T, finalizer: proc (x: ref T)) {.magic: "NewFinalize".}
+  ## creates a new object of type ``T`` and returns a safe (traced)
+  ## reference to it in ``a``. When the garbage collector frees the object,
+  ## `finalizer` is called. The `finalizer` may not keep a reference to the 
+  ## object pointed to by `x`. The `finalizer` cannot prevent the GC from
+  ## freeing the object. Note: The `finalizer` refers to the type `T`, not to
+  ## the object! This means that for each object of type `T` the finalizer 
+  ## will be called!
+
+# for low and high the return type T may not be correct, but
+# we handle that with compiler magic in SemLowHigh()
+proc high*[T](x: T): T {.magic: "High", noSideEffect.}
+  ## returns the highest possible index of an array, a sequence, a string or
+  ## the highest possible value of an ordinal value `x`. As a special
+  ## semantic rule, `x` may also be a type identifier.
+
+proc low*[T](x: T): T {.magic: "Low", noSideEffect.}
+  ## returns the lowest possible index of an array, a sequence, a string or
+  ## the lowest possible value of an ordinal value `x`. As a special
+  ## semantic rule, `x` may also be a type identifier.
+
+type
+  range*{.magic: "Range".} [T] ## Generic type to construct range types.
+  array*{.magic: "Array".}[I, T]  ## Generic type to construct
+                                  ## fixed-length arrays.
+  openarray*{.magic: "OpenArray".}[T]  ## Generic type to construct open arrays.
+                                       ## Open arrays are implemented as a
+                                       ## pointer to the array data and a
+                                       ## length field.
+  seq*{.magic: "Seq".}[T]  ## Generic type to construct sequences.
+  set*{.magic: "Set".}[T]  ## Generic type to construct bit sets.
+  tuple*{.magic: "Tuple".}[T]  ## Generic type to construct tuple types.
+
+  Byte* = Int8 ## this is an alias for ``int8``, that is a signed
+               ## int 8 bits wide.
+
+  Natural* = range[0..high(int)]
+    ## is an int type ranging from zero to the maximum value
+    ## of an int. This type is often useful for documentation and debugging.
+
+  Positive* = range[1..high(int)]
+    ## is an int type ranging from one to the maximum value
+    ## of an int. This type is often useful for documentation and debugging.
+
+  TObject* = object ## the root of Nimrod's object hierarchy. Objects should
+                    ## inherit from TObject or one of its descendants. However,
+                    ## objects that have no ancestor are allowed.
+  PObject* = ref TObject ## reference to TObject
+
+  E_Base* {.compilerproc.} = object of TObject ## base exception class; 
+                                               ## each exception has to
+                                               ## inherit from `E_Base`.
+    name*: cstring            ## The exception's name is its Nimrod identifier.
+                              ## This field is filled automatically in the
+                              ## ``raise`` statement.
+    msg*: cstring             ## the exception's message. Not providing an
+                              ## exception message is bad style.
+
+  EAsynch* = object of E_Base ## Abstract exception class for
+                              ## *asynchronous exceptions* (interrupts).
+                              ## This is rarely needed: Most
+                              ## exception types inherit from `ESynch`
+  ESynch* = object of E_Base  ## Abstract exception class for
+                              ## *synchronous exceptions*. Most exceptions
+                              ## should be inherited (directly or indirectly)
+                              ## from ESynch.
+  ESystem* = object of ESynch ## Abstract class for exceptions that the runtime
+                              ## system raises.
+  EIO* = object of ESystem    ## raised if an IO error occured.
+  EOS* = object of ESystem    ## raised if an operating system service failed.
+  ERessourceExhausted* = object of ESystem ## raised if a ressource request
+                                           ## could not be fullfilled.
+  EArithmetic* = object of ESynch       ## raised if any kind of arithmetic
+                                        ## error occured.
+  EDivByZero* = object of EArithmetic   ## is the exception class for integer
+                                        ## divide-by-zero errors.
+  EOverflow* = object of EArithmetic    ## is the exception class for integer
+                                        ## calculations whose results are too
+                                        ## large to fit in the provided bits.
+
+  EAccessViolation* = object of ESynch  ## the exception class for
+                                        ## invalid memory access errors
+
+  EAssertionFailed* = object of ESynch  ## is the exception class for Assert
+                                        ## procedures that is raised if the
+                                        ## assertion proves wrong
+
+  EControlC* = object of EAsynch        ## is the exception class for Ctrl+C
+                                        ## key presses in console applications.
+
+  EInvalidValue* = object of ESynch     ## is the exception class for string
+                                        ## and object conversion errors.
+
+  EOutOfMemory* = object of ESystem     ## is the exception class for
+                                        ## unsuccessful attempts to allocate
+                                        ## memory.
+
+  EInvalidIndex* = object of ESynch     ## is raised if an array index is out
+                                        ## of bounds.
+
+  EOutOfRange* = object of ESynch       ## is raised if a range check error
+                                        ## occured.
+
+  EStackOverflow* = object of ESystem   ## is raised if the hardware stack
+                                        ## used for subroutine calls overflowed.
+
+  ENoExceptionToReraise* = object of ESynch ## is raised if there is no
+                                            ## exception to reraise.
+
+  EInvalidObjectAssignment* = object of ESynch ## is raised if an object
+                                               ## gets assigned to its
+                                               ## farther's object.
+
+  EInvalidObjectConversion* = object of ESynch ## is raised if an object is
+                                               ## converted to an incompatible
+                                               ## object type.
+
+  TResult* = enum Failure, Success
+
+proc sizeof*[T](x: T): natural {.magic: "SizeOf", noSideEffect.}
+  ## returns the size of ``x`` in bytes. Since this is a low-level proc,
+  ## its usage is discouraged - using ``new`` for the most cases suffices
+  ## that one never needs to know ``x``'s size. As a special semantic rule,
+  ## ``x`` may also be a type identifier (``sizeof(int)`` is valid).
+
+proc succ*[T](x: T, y = 1): T {.magic: "Succ", noSideEffect.}
+  ## returns the ``y``-th successor of the value ``x``. ``T`` has to be
+  ## an ordinal type. If such a value does not exist, ``EOutOfRange`` is raised
+  ## or a compile time error occurs.
+
+proc pred*[T](x: T, y = 1): T {.magic: "Pred", noSideEffect.}
+  ## returns the ``y``-th predecessor of the value ``x``. ``T`` has to be
+  ## an ordinal type. If such a value does not exist, ``EOutOfRange`` is raised
+  ## or a compile time error occurs.
+
+proc inc*[T](x: var T, y = 1) {.magic: "Inc".}
+  ## increments the ordinal ``x`` by ``y``. If such a value does not
+  ## exist, ``EOutOfRange`` is raised or a compile time error occurs. This is a
+  ## short notation for: ``x = succ(x, y)``.
+
+proc dec*[T](x: var T, y = 1) {.magic: "Dec".}
+  ## decrements the ordinal ``x`` by ``y``. If such a value does not
+  ## exist, ``EOutOfRange`` is raised or a compile time error occurs. This is a
+  ## short notation for: ``x = pred(x, y)``.
+
+proc len*[T](x: openarray[T]): int {.magic: "LengthOpenArray", noSideEffect.}
+proc len*(x: string): int {.magic: "LengthStr", noSideEffect.}
+proc len*[I, T](x: array[I, T]): int {.magic: "LengthArray", noSideEffect.}
+proc len*[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}
+  ## returns the length of an array, a sequence or a string.
+  ## This is rougly the same as ``high(T)-low(T)+1``, but its resulting type is
+  ## always an int.
+
+# set routines:
+proc incl*[T](x: var set[T], y: T) {.magic: "Incl".}
+  ## includes element ``y`` to the set ``x``. This is the same as
+  ## ``x = x + {y}``, but it might be more efficient.
+
+proc excl*[T](x: var set[T], y: T) {.magic: "Excl".}
+  ## excludes element ``y`` to the set ``x``. This is the same as
+  ## ``x = x - {y}``, but it might be more efficient.
+
+proc card*[T](x: set[T]): int {.magic: "Card", noSideEffect.}
+  ## returns the cardinality of the set ``x``, i.e. the number of elements
+  ## in the set.
+
+proc ord*[T](x: T): int {.magic: "Ord", noSideEffect.}
+  ## returns the internal int value of an ordinal value ``x``.
+
+proc chr*(u: range[0..255]): char {.magic: "Chr", noSideEffect.}
+  ## converts an int in the range 0..255 to a character.
+
+# --------------------------------------------------------------------------
+# built-in operators
+
+# integer calculations:
+proc `+` *(x: int): int {.magic: "UnaryPlusI", noSideEffect.}
+  ## Unary `+` operator for an integer. Has no effect.
+
+proc `-` *(x: int): int {.magic: "UnaryMinusI", noSideEffect.}
+  ## Unary `-` operator for an integer. Negates `x`.
+
+proc `not` *(x: int): int {.magic: "BitnotI", noSideEffect.}
+  ## computes the `bitwise complement` of the integer `x`.
+
+proc `+` *(x, y: int): int {.magic: "AddI", noSideEffect.}
+proc `-` *(x, y: int): int {.magic: "SubI", noSideEffect.}
+proc `*` *(x, y: int): int {.magic: "MulI", noSideEffect.}
+proc `div` *(x, y: int): int {.magic: "DivI", noSideEffect.}
+  ## computes the integer division. This is roughly the same as
+  ## ``floor(x/y)``.
+proc `mod` *(x, y: int): int {.magic: "ModI", noSideEffect.}
+  ## computes the integer modulo operation. This is the same as
+  ## ``x - (x div y) * y``.
+
+proc `shr` *(x, y: int): int {.magic: "ShrI", noSideEffect.}
+  ## computes the `shift right` operation of `x` and `y`.
+proc `shl` *(x, y: int): int {.magic: "ShlI", noSideEffect.}
+  ## computes the `shift left` operation of `x` and `y`.
+proc `and` *(x, y: int): int {.magic: "BitandI", noSideEffect.}
+  ## computes the `bitwise and` of numbers `x` and `y`.
+proc `or` *(x, y: int): int {.magic: "BitorI", noSideEffect.}
+  ## computes the `bitwise or` of numbers `x` and `y`.
+proc `xor` *(x, y: int): int {.magic: "BitxorI", noSideEffect.}
+  ## computes the `bitwise xor` of numbers `x` and `y`.
+
+proc `==` *(x, y: int): bool {.magic: "EqI", noSideEffect.}
+proc `<=` *(x, y: int): bool {.magic: "LeI", noSideEffect.}
+proc `<`  *(x, y: int): bool {.magic: "LtI", noSideEffect.}
+proc abs*(x: int): int {.magic: "AbsI", noSideEffect.}
+proc min*(x, y: int): int {.magic: "MinI", noSideEffect.}
+proc max*(x, y: int): int {.magic: "MaxI", noSideEffect.}
+
+proc `+` *(x: int64): int64 {.magic: "UnaryPlusI64", noSideEffect.}
+proc `-` *(x: int64): int64 {.magic: "UnaryMinusI64", noSideEffect.}
+proc `not` *(x: int64): int64 {.magic: "BitnotI64", noSideEffect.}
+  ## computes the `bitwise complement` of the integer `x`.
+
+proc `+` *(x, y: int64): int64 {.magic: "AddI64", noSideEffect.}
+  ## Unary `+` operator for an integer. Has no effect.
+proc `-` *(x, y: int64): int64 {.magic: "SubI64", noSideEffect.}
+  ## Unary `-` operator for an int64. Negates `x`.
+proc `*` *(x, y: int64): int64 {.magic: "MulI64", noSideEffect.}
+proc `div` *(x, y: int64): int64 {.magic: "DivI64", noSideEffect.}
+  ## computes the integer division. This is roughly the same as
+  ## ``floor(x/y)``.
+proc `mod` *(x, y: int64): int64 {.magic: "ModI64", noSideEffect.}
+  ## computes the integer modulo operation. This is the same as
+  ## ``x - (x div y) * y``.
+proc `shr` *(x, y: int64): int64 {.magic: "ShrI64", noSideEffect.}
+  ## computes the `shift right` operation of `x` and `y`.
+proc `shl` *(x, y: int64): int64 {.magic: "ShlI64", noSideEffect.}
+  ## computes the `shift left` operation of `x` and `y`.
+proc `and` *(x, y: int64): int64 {.magic: "BitandI64", noSideEffect.}
+  ## computes the `bitwise and` of numbers `x` and `y`.
+proc `or` *(x, y: int64): int64 {.magic: "BitorI64", noSideEffect.}
+  ## computes the `bitwise or` of numbers `x` and `y`.
+proc `xor` *(x, y: int64): int64 {.magic: "BitxorI64", noSideEffect.}
+  ## computes the `bitwise xor` of numbers `x` and `y`.
+
+proc `==` *(x, y: int64): bool {.magic: "EqI64", noSideEffect.}
+proc `<=` *(x, y: int64): bool {.magic: "LeI64", noSideEffect.}
+proc `<`  *(x, y: int64): bool {.magic: "LtI64", noSideEffect.}
+proc abs*(x: int64): int64 {.magic: "AbsI64", noSideEffect.}
+proc min*(x, y: int64): int64 {.magic: "MinI64", noSideEffect.}
+proc max*(x, y: int64): int64 {.magic: "MaxI64", noSideEffect.}
+
+# same for floating point:
+proc `+` *(x: float): float {.magic: "UnaryPlusF64", noSideEffect.}
+proc `-` *(x: float): float {.magic: "UnaryMinusF64", noSideEffect.}
+proc `+` *(x, y: float): float {.magic: "AddF64", noSideEffect.}
+proc `-` *(x, y: float): float {.magic: "SubF64", noSideEffect.}
+proc `*` *(x, y: float): float {.magic: "MulF64", noSideEffect.}
+proc `/` *(x, y: float): float {.magic: "DivF64", noSideEffect.}
+  ## computes the floating point division
+
+proc `==` *(x, y: float): bool {.magic: "EqF64", noSideEffect.}
+proc `<=` *(x, y: float): bool {.magic: "LeF64", noSideEffect.}
+proc `<`  *(x, y: float): bool {.magic: "LtF64", noSideEffect.}
+proc abs*(x: float): float {.magic: "AbsF64", noSideEffect.}
+proc min*(x, y: float): float {.magic: "MinF64", noSideEffect.}
+proc max*(x, y: float): float {.magic: "MaxF64", noSideEffect.}
+
+# boolean operators:
+proc `and`*(x, y: bool): bool {.magic: "And", noSideEffect.}
+  ## Boolean ``and``; returns true iff ``x == y == true``.
+  ## Evaluation is short-circuited: This means that if ``x`` is false,
+  ## ``y`` will not even be evaluated.
+proc `or`*(x, y: bool): bool {.magic: "Or", noSideEffect.}
+  ## Boolean ``or``; returns true iff ``not (not x and not y)``.
+  ## Evaluation is short-circuited: This means that if ``x`` is true,
+  ## ``y`` will not even be evaluated.
+proc `xor`*(x, y: bool): bool {.magic: "Xor", noSideEffect.}
+  ## Boolean `exclusive or`; returns true iff ``x != y``.
+
+# set operators
+proc `*` *[T](x, y: set[T]): set[T] {.magic: "MulSet", noSideEffect.}
+  ## This operator computes the intersection of two sets.
+proc `+` *[T](x, y: set[T]): set[T] {.magic: "PlusSet", noSideEffect.}
+  ## This operator computes the union of two sets.
+proc `-` *[T](x, y: set[T]): set[T] {.magic: "MinusSet", noSideEffect.}
+  ## This operator computes the difference of two sets.
+proc `-+-` *[T](x, y: set[T]): set[T] {.magic: "SymDiffSet", noSideEffect.}
+  ## computes the symmetric set difference. This is the same as
+  ## ``(A - B) + (B - A)``, but more efficient.
+
+# comparison operators:
+proc `==` *(x, y: TAnyEnum): bool {.magic: "EqEnum", noSideEffect.}
+proc `==` *(x, y: pointer): bool {.magic: "EqRef", noSideEffect.}
+proc `==` *(x, y: string): bool {.magic: "EqStr", noSideEffect.}
+proc `==` *(x, y: cstring): bool {.magic: "EqCString", noSideEffect.}
+proc `==` *(x, y: char): bool {.magic: "EqCh", noSideEffect.}
+proc `==` *(x, y: bool): bool {.magic: "EqB", noSideEffect.}
+proc `==` *[T](x, y: set[T]): bool {.magic: "EqSet", noSideEffect.}
+proc `==` *[T](x, y: ref T): bool {.magic: "EqRef", noSideEffect.}
+proc `==` *[T](x, y: ptr T): bool {.magic: "EqRef", noSideEffect.}
+
+proc `<=` *(x, y: TAnyEnum): bool {.magic: "LeEnum", noSideEffect.}
+proc `<=` *(x, y: string): bool {.magic: "LeStr", noSideEffect.}
+proc `<=` *(x, y: char): bool {.magic: "LeCh", noSideEffect.}
+proc `<=` *[T](x, y: set[T]): bool {.magic: "LeSet", noSideEffect.}
+proc `<=` *(x, y: bool): bool {.magic: "LeB", noSideEffect.}
+proc `<=` *[T](x, y: ref T): bool {.magic: "LePtr", noSideEffect.}
+proc `<=` *(x, y: pointer): bool {.magic: "LePtr", noSideEffect.}
+
+proc `<` *(x, y: TAnyEnum): bool {.magic: "LtEnum", noSideEffect.}
+proc `<` *(x, y: string): bool {.magic: "LtStr", noSideEffect.}
+proc `<` *(x, y: char): bool {.magic: "LtCh", noSideEffect.}
+proc `<` *[T](x, y: set[T]): bool {.magic: "LtSet", noSideEffect.}
+proc `<` *(x, y: bool): bool {.magic: "LtB", noSideEffect.}
+proc `<` *[T](x, y: ref T): bool {.magic: "LtPtr", noSideEffect.}
+proc `<` *[T](x, y: ptr T): bool {.magic: "LtPtr", noSideEffect.}
+proc `<` *(x, y: pointer): bool {.magic: "LtPtr", noSideEffect.}
+
+template `!=` * (x, y: expr): expr =
+  ## unequals operator. This is a shorthand for ``not (x == y)``.
+  not (x == y)
+
+template `>=` * (x, y: expr): expr =
+  ## "is greater or equals" operator. This is the same as ``y <= x``.
+  y <= x
+
+template `>` * (x, y: expr): expr =
+  ## "is greater" operator. This is the same as ``y < x``.
+  y < x
+
+proc in_Operator*[T](x: set[T], y: T): bool {.magic: "InSet", noSideEffect.}
+  ## One should overload this proc if one wants to overload the ``in`` operator.
+  ## The parameters are in reverse order! This is because the unification
+  ## algorithm that Nimrod uses for overload resolution works from left to
+  ## right.
+  ## But for the ``in`` operator that would be the wrong direction for this
+  ## piece of code:
+  ##
+  ## .. code-block:: Nimrod
+  ##   var s: set[range['a'..'z']] = {'a'..'c'}
+  ##   writeln(stdout, 'b' in s)
+  ##
+  ## If ``in`` had been declared as ``[T](elem: T, s: set[T])`` then ``T`` would
+  ## have been bound to ``char``. But ``s`` is not compatible with type
+  ## ``set[char]``! The solution is to bind ``T`` to ``range['a'..'z']``. This
+  ## is achieved by reversing the parameters for ``in_operator``; ``in`` then
+  ## passes its arguments in reverse order.
+
+template `in` * (x, y: expr): expr = in_Operator(y, x)
+template `not_in` * (x, y: expr): expr = not in_Operator(y, x)
+
+proc `is` *[T, S](x: T, y: S): bool {.magic: "Is", noSideEffect.}
+template `is_not` *(x, y: expr): expr = not (x is y)
+
+proc cmp*[T](x, y: T): int =
+  ## Generic compare proc. Returns a value < 0 iff x < y, a value > 0 iff x > y
+  ## and 0 iff x == y. This is useful for writing generic algorithms without
+  ## performance loss. This generic implementation uses the `==` and `<`
+  ## operators.
+  if x == y: return 0
+  if x < y: return -1
+  return 1
+
+proc cmp*(x, y: string): int {.noSideEffect.}
+  ## Compare proc for strings. More efficient than the generic version.
+
+# concat operator:
+proc `&` * (x: string, y: char): string {.
+  magic: "ConStrStr", noSideEffect, returnsNew.}
+proc `&` * (x: char, y: char): string {.
+  magic: "ConStrStr", noSideEffect, returnsNew.}
+proc `&` * (x, y: string): string {.
+  magic: "ConStrStr", noSideEffect, returnsNew.}
+proc `&` * (x: char, y: string): string {.
+  magic: "ConStrStr", noSideEffect, returnsNew.}
+  ## is the `concatenation operator`. It
+  ## concatenates `x` and `y`.
+
+proc add * (x: var string, y: char) {.magic: "AppendStrCh".}
+proc add * (x: var string, y: string) {.magic: "AppendStrStr".}
+
+proc add* (x: var string, y: cstring) =
+  var i = 0
+  while y[i] != '\0':
+    add(x, y[i])
+    inc(i)
+
+proc add *[T](x: var seq[T], y: T) {.magic: "AppendSeqElem".}
+proc add *[T](x: var seq[T], y: seq[T]) {.magic: "AppendSeqSeq".}
+  ## Generic proc for adding a data item `y` to a container `x`.
+  ## For containers that have an order, `add` means *append*. New generic
+  ## containers should also call their adding proc `add` for consistency.
+  ## Generic code becomes much easier to write if the Nimrod naming scheme is
+  ## respected.
+
+proc repr*[T](x: T): string {.magic: "Repr", noSideEffect.}
+  ## takes any Nimrod variable and returns its string representation. It
+  ## works even for complex data graphs with cycles. This is an invaluable
+  ## debugging tool.
+
+type
+  TAddress* = int
+    ## is the signed integer type that should be used for converting
+    ## pointers to integer addresses.
+
+type
+  BiggestInt* = int64
+    ## is an alias for the biggest signed integer type the Nimrod compiler
+    ## supports. Currently this is ``int64``, but it is platform-dependant
+    ## in general.
+
+  BiggestFloat* = float64
+    ## is an alias for the biggest floating point type the Nimrod
+    ## compiler supports. Currently this is ``float64``, but it is
+    ## platform-dependant in general.
+
+type # these work for most platforms:
+  cchar* {.importc: "char", nodecl.} = char
+    ## This is the same as the type ``char`` in *C*.
+  cschar* {.importc: "signed char", nodecl.} = byte
+    ## This is the same as the type ``signed char`` in *C*.
+  cshort* {.importc: "short", nodecl.} = int16
+    ## This is the same as the type ``short`` in *C*.
+  cint* {.importc: "int", nodecl.} = int32
+    ## This is the same as the type ``int`` in *C*.
+  clong* {.importc: "long", nodecl.} = int
+    ## This is the same as the type ``long`` in *C*.
+  clonglong* {.importc: "long long", nodecl.} = int64
+    ## This is the same as the type ``long long`` in *C*.
+  cfloat* {.importc: "float", nodecl.} = float32
+    ## This is the same as the type ``float`` in *C*.
+  cdouble* {.importc: "double", nodecl.} = float64
+    ## This is the same as the type ``double`` in *C*.
+  clongdouble* {.importc: "long double", nodecl.} = BiggestFloat
+    ## This is the same as the type ``long double`` in *C*.
+    ## This C type is not supported by Nimrod's code generator
+
+  cstringArray* {.importc: "char**", nodecl.} = array [0..50_000, cstring]
+    ## This is the same as the type ``char**`` in *C*.
+
+  TEndian* = enum ## is a type describing the endianness of a processor.
+    littleEndian, bigEndian
+    
+  PFloat32* = ptr Float32 ## an alias for ``ptr float32``
+  PFloat64* = ptr Float64 ## an alias for ``ptr float64``
+  PInt64* = ptr Int64 ## an alias for ``ptr int64``
+  PInt32* = ptr Int32 ## an alias for ``ptr int32``
+
+const
+  QuitSuccess* = 0
+    ## is the value that should be passed to ``quit`` to indicate
+    ## success.
+
+  QuitFailure* = 1
+    ## is the value that should be passed to ``quit`` to indicate
+    ## failure.
+
+  CompileDate* {.magic: "CompileDate"}: string = "0000-00-00"
+    ## is the date of compilation as a string of the form
+    ## ``YYYY-MM-DD``.
+
+  CompileTime* {.magic: "CompileTime"}: string = "00:00:00"
+    ## is the time of compilation as a string of the form
+    ## ``HH:MM:SS``.
+
+  NimrodVersion* {.magic: "NimrodVersion"}: string = "0.0.0"
+    ## is the version of Nimrod as a string.
+
+  NimrodMajor* {.magic: "NimrodMajor"}: int = 0
+    ## is the major number of Nimrod's version.
+
+  NimrodMinor* {.magic: "NimrodMinor"}: int = 0
+    ## is the minor number of Nimrod's version.
+
+  NimrodPatch* {.magic: "NimrodPatch"}: int = 0
+    ## is the patch number of Nimrod's version.
+
+  cpuEndian* {.magic: "CpuEndian"}: TEndian = littleEndian
+    ## is the endianness of the target CPU. This is a valuable information
+    ## for low-level code only.
+
+
+proc toFloat*(i: int): float {.
+  magic: "ToFloat", noSideEffect, importc: "toFloat".}
+  ## converts an integer `i` into a ``float``. If the conversion
+  ## fails, `EInvalidValue` is raised. Note that on most platforms the
+  ## conversion cannot fail, however.
+
+proc toBiggestFloat*(i: biggestint): biggestfloat {.
+  magic: "ToBiggestFloat", noSideEffect, importc: "toBiggestFloat".}
+  ## converts an biggestint `i` into a ``biggestfloat``. If the conversion
+  ## fails, `EInvalidValue` is raised. Note that on most platforms the
+  ## conversion cannot fail, however.
+
+proc toInt*(f: float): int {.
+  magic: "ToInt", noSideEffect, importc: "toInt".}
+  ## converts a floating point number `f` into an ``int``. Conversion
+  ## rounds `f` if it does not contain an integer value. If the conversion
+  ## fails (because `f` is infinite for example), `EInvalidValue` is raised.
+
+proc toBiggestInt*(f: biggestfloat): biggestint {.
+  magic: "ToBiggestInt", noSideEffect, importc: "toBiggestInt".}
+  ## converts a biggestfloat `f` into a ``biggestint``. Conversion
+  ## rounds `f` if it does not contain an integer value. If the conversion
+  ## fails (because `f` is infinite for example), `EInvalidValue` is raised.
+
+proc quit*(errorcode: int = QuitSuccess) {.
+  magic: "Exit", importc: "exit", noDecl, noReturn.}
+  ## stops the program immediately; before stopping the program the
+  ## "quit procedures" are called in the opposite order they were added
+  ## with ``addQuitProc``. ``quit`` never returns and ignores any
+  ## exception that may have been raised by the quit procedures.
+  ## It does *not* call the garbage collector to free all the memory,
+  ## unless a quit procedure calls ``GC_collect``.
+
+proc addQuitProc*(QuitProc: proc {.noconv.}) {.importc: "atexit", nodecl.}
+  ## adds/registers a quit procedure. Each call to ``addQuitProc``
+  ## registers another quit procedure. Up to 30 procedures can be
+  ## registered. They are executed on a last-in, first-out basis
+  ## (that is, the last function registered is the first to be executed).
+  ## ``addQuitProc`` raises an EOutOfIndex if ``quitProc`` cannot be
+  ## registered.
+
+# Support for addQuitProc() is done by Ansi C's facilities here.
+# In case of an unhandled exeption the exit handlers should
+# not be called explicitly! The user may decide to do this manually though.
+
+proc copy*(s: string, first = 0): string {.importc: "copyStr", noSideEffect.}
+proc copy*(s: string, first, last: int): string {.importc: "copyStrLast",
+                                                  noSideEffect.}
+  ## copies a slice of `s` into a new string and returns this new
+  ## string. The bounds `first` and `last` denote the indices of
+  ## the first and last characters that shall be copied. If ``last``
+  ## is omitted, it is treated as ``high(s)``.
+
+proc setLen*(s: var string, newlen: int) {.magic: "SetLengthStr".}
+  ## sets the length of `s` to `newlen`.
+  ## If the current length is greater than the new length,
+  ## ``s`` will be truncated.
+
+proc newString*(len: int): string {.importc: "mnewString", noSideEffect.}
+  ## returns a new string of length ``len`` but with uninitialized
+  ## content. One needs to fill the string character after character
+  ## with the index operator ``s[i]``. This procedure exists only for
+  ## optimization purposes; the same effect can be achieved with the
+  ## ``&`` operator.
+
+proc zeroMem*(p: Pointer, size: int) {.importc, noDecl.}
+  ## overwrites the contents of the memory at ``p`` with the value 0.
+  ## Exactly ``size`` bytes will be overwritten. Like any procedure
+  ## dealing with raw memory this is *unsafe*.
+
+proc copyMem*(dest, source: Pointer, size: int) {.importc: "memcpy", noDecl.}
+  ## copies the contents from the memory at ``source`` to the memory
+  ## at ``dest``. Exactly ``size`` bytes will be copied. The memory
+  ## regions may not overlap. Like any procedure dealing with raw
+  ## memory this is *unsafe*.
+
+proc moveMem*(dest, source: Pointer, size: int) {.importc: "memmove", noDecl.}
+  ## copies the contents from the memory at ``source`` to the memory
+  ## at ``dest``. Exactly ``size`` bytes will be copied. The memory
+  ## regions may overlap, ``moveMem`` handles this case appropriately
+  ## and is thus somewhat more safe than ``copyMem``. Like any procedure
+  ## dealing with raw memory this is still *unsafe*, though.
+
+proc equalMem*(a, b: Pointer, size: int): bool {.
+  importc: "equalMem", noDecl, noSideEffect.}
+  ## compares the memory blocks ``a`` and ``b``. ``size`` bytes will
+  ## be compared. If the blocks are equal, true is returned, false
+  ## otherwise. Like any procedure dealing with raw memory this is
+  ## *unsafe*.
+
+const
+  mallocHeader = if defined(useDL): "dlmalloc.h" else: "<stdlib.h>"
+
+proc alloc*(size: int): pointer {.
+  importc: if defined(useDL): "dlmalloc" else: "malloc",
+  header: mallocHeader, noconv.}
+  ## allocates a new memory block with at least ``size`` bytes. The
+  ## block has to be freed with ``realloc(block, 0)`` or
+  ## ``dealloc(block)``. The block is not initialized, so reading
+  ## from it before writing to it is undefined behaviour!
+proc alloc0*(size: int): pointer {.
+  importc: if defined(useDL): "DL_ALLOC_0" else: "ALLOC_0",
+  header: mallocHeader, noconv.}
+  ## allocates a new memory block with at least ``size`` bytes. The
+  ## block has to be freed with ``realloc(block, 0)`` or
+  ## ``dealloc(block)``. The block is initialized with all bytes
+  ## containing zero, so it is somewhat safer than ``alloc``.
+proc realloc*(p: Pointer, newsize: int): pointer {.
+  importc: if defined(useDL): "dlrealloc" else: "realloc",
+  header: mallocHeader, noconv.}
+  ## grows or shrinks a given memory block. If p is **nil** then a new
+  ## memory block is returned. In either way the block has at least
+  ## ``newsize`` bytes. If ``newsize == 0`` and p is not **nil**
+  ## ``realloc`` calls ``dealloc(p)``. In other cases the block has to
+  ## be freed with ``dealloc``.
+proc dealloc*(p: Pointer) {.
+  importc: if defined(useDL): "dlfree" else: "free",
+  header: mallocHeader, noconv.}
+  ## frees the memory allocated with ``alloc``, ``alloc0`` or
+  ## ``realloc``. This procedure is dangerous! If one forgets to
+  ## free the memory a leak occurs; if one tries to access freed
+  ## memory (or just freeing it twice!) a core dump may happen
+  ## or other memory may be corrupted. So this procedure is really
+  ## *unsafe*.
+
+proc setLen*[T](s: var seq[T], newlen: int) {.magic: "SetLengthSeq".}
+  ## sets the length of `s` to `newlen`.
+  ## ``T`` may be any sequence type.
+  ## If the current length is greater than the new length,
+  ## ``s`` will be truncated.
+
+proc assert*(cond: bool) {.magic: "Assert".}
+  ## provides a means to implement `programming by contracts` in Nimrod.
+  ## ``assert`` evaluates expression ``cond`` and if ``cond`` is false, it
+  ## raises an ``EAssertionFailure`` exception. However, the compiler may
+  ## not generate any code at all for ``assert`` if it is advised to do so.
+  ## Thus one should use ``assert`` for debugging purposes only.
+
+proc swap*[T](a, b: var T) {.magic: "Swap".}
+  ## swaps the values `a` and `b`. This is often more efficient than
+  ## ``tmp = a; a = b; b = tmp``. Particularly useful for sorting algorithms.
+
+proc ze*(x: int8): int {.magic: "Ze", noSideEffect.}
+  ## zero extends a smaller integer type to ``int``. This treats `x` as
+  ## unsigned.
+proc ze*(x: int16): int {.magic: "Ze", noSideEffect.}
+  ## zero extends a smaller integer type to ``int``. This treats `x` as
+  ## unsigned.
+
+proc ze64*(x: int32): int64 {.magic: "Ze64", noSideEffect.}
+  ## zero extends a smaller integer type to ``int64``. This treats `x` as
+  ## unsigned.
+proc ze*(x: int): int64 {.magic: "Ze", noDecl, noSideEffect.}
+  ## zero extends a smaller integer type to ``int64``. This treats `x` as
+  ## unsigned. Does nothing if the size of an ``int`` is the same as ``int64``.
+  ## (This is the case an 64 bit processors.)
+
+proc toU8*(x: int): int8 {.magic: "ToU8", noSideEffect.}
+  ## treats `x` as unsigned and converts it to a byte by taking the last 8 bits
+  ## from `x`.
+proc toU16*(x: int): int16 {.magic: "ToU16", noSideEffect.}
+  ## treats `x` as unsigned and converts it to an ``int16`` by taking the last
+  ## 16 bits from `x`.
+proc toU32*(x: int64): int32 {.magic: "ToU32", noSideEffect.}
+  ## treats `x` as unsigned and converts it to an ``int32`` by taking the
+  ## last 32 bits from `x`.
+
+proc `+%` *(x, y: int): int {.magic: "AddU", noSideEffect.}
+proc `+%` *(x, y: int64): int64 {.magic: "AddU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and adds them. The result is truncated to
+  ## fit into the result. This implements modulo arithmetic. No overflow
+  ## errors are possible.
+
+proc `-%` *(x, y: int): int {.magic: "SubU", noSideEffect.}
+proc `-%` *(x, y: int64): int64 {.magic: "SubU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and subtracts them. The result is
+  ## truncated to fit into the result. This implements modulo arithmetic.
+  ## No overflow errors are possible.
+
+proc `*%` *(x, y: int): int {.magic: "MulU", noSideEffect.}
+proc `*%` *(x, y: int64): int64 {.magic: "MulU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and multiplies them. The result is
+  ## truncated to fit into the result. This implements modulo arithmetic.
+  ## No overflow errors are possible.
+
+proc `/%` *(x, y: int): int {.magic: "DivU", noSideEffect.}
+proc `/%` *(x, y: int64): int64 {.magic: "DivU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and divides them. The result is
+  ## truncated to fit into the result. This implements modulo arithmetic.
+  ## No overflow errors are possible.
+
+proc `%%` *(x, y: int): int {.magic: "ModU", noSideEffect.}
+proc `%%` *(x, y: int64): int64 {.magic: "ModU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and compute the modulo of `x` and `y`.
+  ## The result is truncated to fit into the result.
+  ## This implements modulo arithmetic.
+  ## No overflow errors are possible.
+
+proc `<=%` *(x, y: int): bool {.magic: "LeU", noSideEffect.}
+proc `<=%` *(x, y: int64): bool {.magic: "LeU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and compares them.
+  ## Returns true iff ``unsigned(x) <= unsigned(y)``.
+
+proc `<%` *(x, y: int): bool {.magic: "LtU", noSideEffect.}
+proc `<%` *(x, y: int64): bool {.magic: "LtU64", noSideEffect.}
+  ## treats `x` and `y` as unsigned and compares them.
+  ## Returns true iff ``unsigned(x) < unsigned(y)``.
+
+template `>=%` *(x, y: expr): expr = y <=% x
+  ## treats `x` and `y` as unsigned and compares them.
+  ## Returns true iff ``unsigned(x) >= unsigned(y)``.
+
+template `>%` *(x, y: expr): expr = y <% x
+  ## treats `x` and `y` as unsigned and compares them.
+  ## Returns true iff ``unsigned(x) > unsigned(y)``.
+
+proc `$` *(x: int): string {.noSideEffect.}
+  ## The stingify operator for an integer argument. Returns `x`
+  ## converted to a decimal string.
+
+proc `$` *(x: int64): string {.noSideEffect.}
+  ## The stingify operator for an integer argument. Returns `x`
+  ## converted to a decimal string.
+
+proc `$` *(x: float): string {.noSideEffect.}
+  ## The stingify operator for a float argument. Returns `x`
+  ## converted to a decimal string.
+
+proc `$` *(x: bool): string {.noSideEffect.}
+  ## The stingify operator for a boolean argument. Returns `x`
+  ## converted to the string "false" or "true".
+
+proc `$` *(x: char): string {.noSideEffect.}
+  ## The stingify operator for a character argument. Returns `x`
+  ## converted to a string.
+
+proc `$` *(x: Cstring): string {.noSideEffect, importc: "cstrToNimstr".}
+  ## The stingify operator for a CString argument. Returns `x`
+  ## converted to a string.
+
+proc `$` *(x: string): string {.noSideEffect.}
+  ## The stingify operator for a string argument. Returns `x`
+  ## as it is. This operator is useful for generic code, so
+  ## that ``$expr`` works if ``expr`` is already a string.
+
+# undocumented:
+proc getRefcount*[T](x: ref T): int {.importc: "getRefcount".}
+  ## retrieves the reference count of an heap-allocated object. The
+  ## value is implementation-dependant. 
+
+#proc writeStackTrace() {.export: "writeStackTrace".}
+proc getCurrentExceptionMsg*(): string {.exportc.}
+  ## retrieves the error message that was attached to the current
+  ## exception; if there is none, "" is returned.
+
+# new constants:
+const
+  inf* = 1.0 / 0.0
+    ## contains the IEEE floating point value of positive infinity.
+  nan* = 0.0 / 0.0
+    ## contains the IEEE floating point value of *Not A Number*. Note
+    ## that you cannot compare a floating point value to this value
+    ## and expect a reasonable result - use the `classify` procedure
+    ## in the module ``math`` for checking for NaN.
+
+var
+  dbgLineHook*: proc = nil
+    ## set this variable to provide a procedure that should be called before
+    ## each executed instruction. This should only be used by debuggers!
+    ## Only code compiled with the ``debugger:on`` switch calls this hook.
+
+# GC interface:
+when defined(Unix) and not defined(macosX) and not defined(linux): 
+  # BUGFIX for macosX
+  {.define: nativeDL.}
+
+when defined(useDL) or defined(nativeDL):
+  proc getOccupiedMem*(): int
+    ## returns the number of bytes that are owned by the process and hold data.
+  
+  proc getFreeMem*(): int
+    ## returns the number of bytes that are owned by the process, but do not
+    ## hold any meaningful data.
+  
+  proc getTotalMem*(): int
+    ## returns the number of bytes that are owned by the process.
+
+
+iterator countdown*[T](a, b: T, step = 1): T {.inline.} =
+  ## Counts from ordinal value `a` down to `b` with the given
+  ## step count. `T` may be any ordinal type, `step` may only
+  ## be positive.
+  var res = a
+  while res >= b:
+    yield res
+    dec(res, step)
+
+iterator countup*[T](a, b: T, step = 1): T {.inline.} =
+  ## Counts from ordinal value `a` up to `b` with the given
+  ## step count. `T` may be any ordinal type, `step` may only
+  ## be positive.
+  var res = a
+  while res <= b:
+    yield res
+    inc(res, step)
+  # we cannot use ``for x in a..b: `` here, because that is not
+  # known in the System module
+
+iterator items*[T](a: openarray[T]): T {.inline.} =
+  ## iterates over each item of `a`.
+  var i = 0
+  while i < len(a):
+    yield a[i]
+    inc(i)
+
+iterator items*[IX, T](a: array[IX, T]): T {.inline.} =
+  ## iterates over each item of `a`.
+  var i = low(IX)
+  while i <= high(IX):
+    yield a[i]
+    inc(i)
+
+iterator items*[T](a: seq[T]): T {.inline.} =
+  ## iterates over each item of `a`.
+  var i = 0
+  while i < len(a):
+    yield a[i]
+    inc(i)
+
+iterator items*(a: string): char {.inline.} =
+  ## iterates over each item of `a`.
+  var i = 0
+  while i < len(a):
+    yield a[i]
+    inc(i)
+
+iterator items*[T](a: set[T]): T {.inline.} =
+  ## iterates over each element of `a`. `items` iterates only over the
+  ## elements that are really in the set (and not over the ones the set is
+  ## able to hold).
+  var i = low(T)
+  while i <= high(T):
+    if i in a: yield i
+    inc(i)
+
+iterator items*(a: cstring): char {.inline.} =
+  ## iterates over each item of `a`.
+  var i = 0
+  while a[i] != '\0':
+    yield a[i]
+    inc(i)
+
+# Fixup some magic symbols here:
+{.fixup_system.} # This is an undocumented pragma that can only be used
+                 # once in the system module.
+
+proc `&` *[T](x, y: seq[T]): seq[T] {.noSideEffect, returnsNew.} =
+  result = []
+  setLen(result, x.len + y.len)
+  for i in 0..x.len-1:
+    result[i] = x[i]
+  for i in 0..y.len-1:
+    result[i] = y[i]
+
+proc `&` *[T](x: seq[T], y: T): seq[T] {.noSideEffect, returnsNew.} =
+  result = []
+  setLen(x.len + 1)
+  for i in 0..x.len-1:
+    result[i] = x[i]
+  result[x.len] = y
+
+proc `&` *[T](x: T, y: seq[T]): seq[T] {.noSideEffect, returnsNew.} =
+  result = []
+  setLen(y.len + 1)
+  for i in 0..y.len-1:
+    result[i] = y[i]
+  result[y.len] = x
+
+proc `&` *[T](x, y: T): seq[T] {.noSideEffect, returnsNew.} =
+  return [x, y]
+
+proc `==` *[T](x, y: seq[T]): bool {.noSideEffect.} =
+  ## Generic equals operator for sequences: relies on a equals operator for
+  ## the element type `T`.
+  if cast[pointer](x) == cast[pointer](y):
+    result = true
+  elif cast[pointer](x) == nil or cast[pointer](y) == nil:
+    result = false
+  elif x.len == y.len:
+    for i in 0..x.len-1:
+      if x[i] != y[i]: return false
+    result = true
+
+{.push checks: off, line_dir: off, debugger: off,
+  assertions: on.}  # obviously we cannot generate checking operations here :-)
+                    # because it would yield into an endless recursion
+                    # however, stack-traces are available for most parts
+                    # of the code
+
+include hti
+
+proc initGC()
+
+var
+  strDesc: TNimType
+
+strDesc.size = sizeof(string)
+strDesc.kind = tyString
+initGC() # BUGFIX: need to be called here!
+
+{.push stack_trace: off.}
+
+include ansi_c
+
+proc cmp(x, y: string): int =
+  return c_strcmp(x, y)
+
+when defined(windows):
+  # work-around C's sucking abstraction:
+  # BUGFIX: stdin and stdout should be binary files!
+  const pccHack = if defined(pcc): "_" else: "" # Hack for PCC
+  proc setmode(handle, mode: int) {.importc: pccHack & "setmode",
+                                    header: "<io.h>".}
+  proc fileno(f: C_TextFileStar): int {.importc: pccHack & "fileno",
+                                        header: "<fcntl.h>".}
+  var
+    O_BINARY {.importc: pccHack & "O_BINARY", nodecl.}: int
+
+  # we use binary mode in Windows:
+  setmode(fileno(c_stdin), O_BINARY)
+  setmode(fileno(c_stdout), O_BINARY)
+
+when defined(endb):
+  proc endbStep()
+
+
+template newException(exceptn, message: expr): expr =
+  block: # open a new scope
+    var
+      e: ref exceptn
+    new(e)
+    e.msg = message
+    e
+    
+# ----------------- GC interface ---------------------------------------------
+
+proc GC_disable*() 
+  ## disables the GC. If called n-times, n calls to `GC_enable` are needed to
+  ## reactivate the GC. Note that in most circumstances one should only disable
+  ## the mark and sweep phase with `GC_disableMarkAndSweep`. 
+
+proc GC_enable*() 
+  ## enables the GC again.
+  
+proc GC_fullCollect*()
+  ## forces a full garbage collection pass. 
+  ## Ordinary code does not need to call this.
+
+type
+  TGC_Strategy* = enum ## the strategy the GC should use for the application
+    gcThroughput ,     ## optimize for throughput
+    gcResponsiveness,  ## optimize for responsiveness (default)
+    gcOptimizeTime,    ## optimize for speed
+    gcOptimizeSpace    ## optimize for memory footprint
+
+proc GC_setStrategy*(strategy: TGC_Strategy)
+  ## tells the GC the desired strategy for the application.
+  
+proc GC_enableMarkAndSweep*()
+proc GC_disableMarkAndSweep*()
+  ## the current implementation uses a reference counting garbage collector
+  ## with a seldomly run mark and sweep phase to free cycles. The mark and
+  ## sweep phase may take a long time and is not needed if the application
+  ## does not create cycles. Thus the mark and sweep phase can be deactivated
+  ## and activated separately from the rest of the GC.
+
+    
+# ----------------- IO Part --------------------------------------------------
+
+type
+  CFile {.importc: "FILE", nodecl.} = record  # empty record for
+                                              # data hiding
+  TFile* = ptr CFile ## The type representing a file handle.
+
+  TFileMode* = enum           ## The file mode when opening a file.
+    fmRead,                   ## Open the file for read access only.
+    fmWrite,                  ## Open the file for write access only.
+    fmReadWrite,              ## Open the file for read and write access.
+                              ## If the file does not exist, it will be
+                              ## created.
+    fmReadWriteExisting,      ## Open the file for read and write access.
+                              ## If the file does not exist, it will not be
+                              ## created.
+    fmAppend                  ## Open the file for writing only; append data
+                              ## at the end.
+
+# text file handling:
+var
+  stdin* {.importc: "stdin", noDecl.}: TFile   ## The standard input stream.
+  stdout* {.importc: "stdout", noDecl.}: TFile ## The standard output stream.
+  stderr* {.importc: "stderr", noDecl.}: TFile
+    ## The standard error stream.
+    ##
+    ## Note: In my opinion, this should not be used -- the concept of a
+    ## separate error stream is a design flaw of UNIX. A seperate *message
+    ## stream* is a good idea, but since it is named ``stderr`` there are few
+    ## programs out there that distinguish properly between ``stdout`` and
+    ## ``stderr``. So, that's what you get if you don't name your variables
+    ## appropriately. It also annoys people if redirection via ``>output.txt``
+    ## does not work because the program writes to ``stderr``.
+
+proc OpenFile*(f: var TFile, filename: string,
+               mode: TFileMode = fmRead, bufSize: int = -1): Bool
+  ## Opens a file named `filename` with given `mode`.
+  ##
+  ## Default mode is readonly. Returns true iff the file could be opened.
+  ## This throws no exception if the file could not be opened. The reason is
+  ## that the programmer needs to provide an appropriate error message anyway
+  ## (yes, even in scripts).
+
+proc CloseFile*(f: TFile) {.importc: "fclose", nodecl.}
+  ## Closes the file.
+proc EndOfFile*(f: TFile): Bool
+  ## Returns true iff `f` is at the end.
+proc readChar*(f: TFile): char {.importc: "fgetc", nodecl.}
+  ## Reads a single character from the stream `f`. If the stream
+  ## has no more characters, `EEndOfFile` is raised.
+proc FlushFile*(f: TFile) {.importc: "fflush", noDecl.}
+  ## Flushes `f`'s buffer.
+
+proc readFile*(filename: string): string
+  ## Opens a file name `filename` for reading. Then reads the
+  ## file's content completely into a string and
+  ## closes the file afterwards. Returns the string. Returns nil if there was
+  ## an error. Does not throw an IO exception.
+
+proc write*(f: TFile, r: float)
+proc write*(f: TFile, i: int)
+proc write*(f: TFile, s: string)
+proc write*(f: TFile, b: Bool)
+proc write*(f: TFile, c: char)
+proc write*(f: TFile, c: cstring)
+  ## Writes a value to the file `f`. May throw an IO exception.
+
+proc readLine*(f: TFile): string
+  ## reads a line of text from the file `f`. May throw an IO exception.
+  ## Reading from an empty file buffer, does not throw an exception, but
+  ## returns nil. A line of text may be delimited by ``CR``, ``LF`` or
+  ## ``CRLF``. The newline character(s) are not part of the returned string.
+
+proc writeln*[Ty](f: TFile, x: Ty) {.inline.}
+  ## writes a value `x` to `f` and then writes "\n". May throw an IO exception.
+proc echo*[Ty](x: Ty) {.inline.}
+  ## equivalent to ``writeln(stdout, x); flush(stdout)``.
+
+proc getFileSize*(f: TFile): int64
+  ## retrieves the file size (in bytes) of `f`.
+
+proc ReadBytes*(f: TFile, a: var openarray[byte], start, len: int): int
+  ## reads `len` bytes into the buffer `a` starting at ``a[start]``. Returns
+  ## the actual number of bytes that have been read which may be less than
+  ## `len` (if not as many bytes are remaining), but not greater.
+
+proc ReadChars*(f: TFile, a: var openarray[char], start, len: int): int
+  ## reads `len` bytes into the buffer `a` starting at ``a[start]``. Returns
+  ## the actual number of bytes that have been read which may be less than
+  ## `len` (if not as many bytes are remaining), but not greater.
+
+proc readBuffer*(f: TFile, buffer: pointer, len: int): int
+  ## reads `len` bytes into the buffer pointed to by `buffer`. Returns
+  ## the actual number of bytes that have been read which may be less than
+  ## `len` (if not as many bytes are remaining), but not greater.
+
+proc writeBytes*(f: TFile, a: openarray[byte], start, len: int): int
+  ## writes the bytes of ``a[start..start+len-1]`` to the file `f`. Returns
+  ## the number of actual written bytes, which may be less than `len` in case
+  ## of an error.
+
+proc writeChars*(f: tFile, a: openarray[char], start, len: int): int
+  ## writes the bytes of ``a[start..start+len-1]`` to the file `f`. Returns
+  ## the number of actual written bytes, which may be less than `len` in case
+  ## of an error.
+
+proc writeBuffer*(f: TFile, buffer: pointer, len: int): int
+  ## writes the bytes of buffer pointed to by the parameter `buffer` to the
+  ## file `f`. Returns the number of actual written bytes, which may be less
+  ## than `len` in case of an error.
+
+proc setFilePos*(f: TFile, pos: int64)
+  ## sets the position of the file pointer that is used for read/write
+  ## operations. The file's first byte has the index zero.
+
+proc getFilePos*(f: TFile): int64
+  ## retrieves the current position of the file pointer that is used to
+  ## read from the file `f`. The file's first byte has the index zero.
+
+include sysio
+
+iterator lines*(filename: string): string =
+  ## Iterate over any line in the file named `filename`.
+  ## If the file does not exist `EIO` is raised.
+  var
+    f: TFile
+  if not openFile(f, filename):
+    raise newException(EIO, "cannot open: " & filename)
+  var res = ""
+  while not endOfFile(f):
+    rawReadLine(f, res)
+    yield res
+  CloseFile(f)
+
+# ----------------------------------------------------------------------------
+
+include excpt
+# we cannot compile this with stack tracing on
+# as it would recurse endlessly!
+include arithm
+{.pop.} # stack trace
+
+# sequence type declarations here because the GC needs them too:
+type
+  TGenericSeq {.importc, nodecl.} = record
+    len, space: int
+
+  PGenericSeq {.importc, nodecl.} = ptr TGenericSeq
+
+const
+  GenericSeqSize = (2 * sizeof(int))
+
+when not defined(boehmgc) and not defined(nogc):
+  include gc
+
+include sysstr
+include assign
+include dyncalls
+include repr
+
+# we have to implement it here after gentostr for the cstrToNimStrDummy proc
+proc getCurrentExceptionMsg(): string =
+  if excHandler == nil: return ""
+  return $excHandler.exc.msg
+
+{.push stack_trace: off.}
+when defined(endb):
+  include debugger
+{.pop.} # stacktrace
+{.pop.} # checks
+
+{.pop.} # hints
diff --git a/lib/times.nim b/lib/times.nim
new file mode 100755
index 000000000..e1b32e754
--- /dev/null
+++ b/lib/times.nim
@@ -0,0 +1,179 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+
+## This module contains routines and types for dealing with time.
+
+{.push debugger:off .} # the user does not want to trace a part
+                       # of the standard library!
+
+import
+  strutils
+
+type
+  TMonth* = enum ## represents a month
+    mJan, mFeb, mMar, mApr, mMay, mJun, mJul, mAug, mSep, mOct, mNov, mDec
+  TWeekDay* = enum ## represents a weekday
+    dMon, dTue, dWed, dThu, dFri, dSat, dSun
+
+  TTime* {.importc: "time_t".} = record ## abstract type that represents a time
+
+  TTimeInfo* = record         ## represents a time in different parts
+    second*: range[0..61]     ## The number of seconds after the minute,
+                              ## normally in the range 0 to 59, but can
+                              ## be up to 61 to allow for leap seconds.
+    minute*: range[0..59]     ## The number of minutes after the hour,
+                              ## in the range 0 to 59.
+    hour*: range[0..23]       ## The number of hours past midnight,
+                              ## in the range 0 to 23.
+    monthday*: range[1..31]   ## The day of the month, in the range 1 to 31.
+    month*: TMonth            ## The current month.
+    year*: int                ## The current year.
+    weekday*: TWeekDay        ## The current day of the week.
+    yearday*: range[0..365]   ## The number of days since January 1,
+                              ## in the range 0 to 365.
+
+proc getTime*(): TTime ## gets the current calendar time
+proc getLocalTime*(t: TTime): TTimeInfo
+  ## converts the calendar time `t` to broken-time representation,
+  ## expressed relative to the user's specified time zone.
+proc getGMTime*(t: TTime): TTimeInfo
+  ## converts the calendar time `t` to broken-down time representation,
+  ## expressed in Coordinated Universal Time (UTC).
+
+proc TimeInfoToTime*(timeInfo: TTimeInfo): TTime
+  ## converts a broken-down time structure, expressed as local time, to
+  ## calendar time representation. The function ignores the specified
+  ## contents of the structure members `weekday` and `yearday` and recomputes
+  ## them from the other information in the broken-down time structure.
+
+proc `$` *(timeInfo: TTimeInfo): string
+  ## converts a `TTimeInfo` record to a
+  ## string representation.
+proc `$` *(time: TTime): string
+  ## converts a calendar time to a
+  ## string representation.
+
+proc getDateStr*(): string
+  ## gets the current date as a string of the format
+  ## ``YYYY-MM-DD``.
+proc getClockStr*(): string
+  ## gets the current clock time as a string of the format ``HH:MM:SS``.
+
+proc `-` *(a, b: TTime): int64
+  ## computes the difference of two calendar times. Result is in seconds.
+
+proc getStartMilsecs*(): int
+  ## get the miliseconds from the start of the program
+
+#implementation
+
+# C wrapper:
+type
+  structTM {.importc: "struct tm".} = record
+    second {.importc: "tm_sec".},
+      minute {.importc: "tm_min".},
+      hour {.importc: "tm_hour".},
+      monthday {.importc: "tm_mday".},
+      month {.importc: "tm_mon".},
+      year {.importc: "tm_year".},
+      weekday {.importc: "tm_wday".},
+      yearday {.importc: "tm_yday".},
+      isdst {.importc: "tm_isdst".}: cint
+
+  PTimeInfo = ptr structTM
+  PTime = ptr TTime
+
+  TClock {.importc: "clock_t".} = range[low(int)..high(int)]
+
+proc localtime(timer: PTime): PTimeInfo {.
+  importc: "localtime", header: "<time.h>".}
+proc gmtime(timer: PTime): PTimeInfo {.importc: "gmtime", header: "<time.h>".}
+proc timec(timer: PTime): TTime      {.importc: "time", header: "<time.h>".}
+proc mktime(t: structTM): TTime      {.importc: "mktime", header: "<time.h>".}
+proc asctime(tblock: structTM): CString {.
+  importc: "asctime", header: "<time.h>".}
+proc ctime(time: PTime): CString     {.importc: "ctime", header: "<time.h>".}
+#  strftime(s: CString, maxsize: int, fmt: CString, t: tm): int {.
+#    importc: "strftime", header: "<time.h>".}
+proc clock(): TClock {.importc: "clock", header: "<time.h>".}
+proc difftime(a, b: TTime): float {.importc: "difftime", header: "<time.h>".}
+
+var
+  clocksPerSec {.importc: "CLOCKS_PER_SEC", nodecl.}: int
+
+
+# our own procs on top of that:
+proc tmToTimeInfo(tm: structTM): TTimeInfo =
+  const
+    weekDays: array [0..6, TWeekDay] = [
+      dSun, dMon, dTue, dWed, dThu, dFri, dSat]
+  result.second = int(tm.second)
+  result.minute = int(tm.minute)
+  result.hour = int(tm.hour)
+  result.monthday = int(tm.monthday)
+  result.month = TMonth(tm.month)
+  result.year = tm.year + 1900
+  result.weekday = weekDays[int(tm.weekDay)]
+  result.yearday = int(tm.yearday)
+
+proc timeInfoToTM(t: TTimeInfo): structTM =
+  const
+    weekDays: array [TWeekDay, int] = [1, 2, 3, 4, 5, 6, 0]
+  result.second = t.second
+  result.minute = t.minute
+  result.hour = t.hour
+  result.monthday = t.monthday
+  result.month = ord(t.month)
+  result.year = t.year - 1900
+  result.weekday = weekDays[t.weekDay]
+  result.yearday = t.yearday
+  result.isdst = -1
+
+proc `-` (a, b: TTime): int64 =
+  return toInt(difftime(a, b)) # XXX: toBiggestInt is needed here, but
+                               # Nim does not support it!
+
+proc getStartMilsecs(): int = return clock() div (clocksPerSec div 1000)
+proc getTime(): TTime = return timec(nil)
+proc getLocalTime(t: TTime): TTimeInfo =
+  var a = t
+  result = tmToTimeInfo(localtime(addr(a))^)
+  # copying is needed anyway to provide reentrancity; thus
+  # the convertion is not expensive
+
+proc getGMTime(t: TTime): TTimeInfo =
+  var a = t
+  result = tmToTimeInfo(gmtime(addr(a))^)
+  # copying is needed anyway to provide reentrancity; thus
+  # the convertion is not expensive
+
+proc TimeInfoToTime(timeInfo: TTimeInfo): TTime =
+  var cTimeInfo = timeInfo # for C++ we have to make a copy,
+  # because the header of mktime is broken in my version of libc
+  return mktime(timeInfoToTM(cTimeInfo))
+
+proc getDateStr(): string =
+  var ti = getLocalTime(getTime())
+  result = $ti.year & "-" & intToStr(ord(ti.month)+1, 2) &
+    "-" & intToStr(ti.monthDay, 2)
+
+proc getClockStr(): string =
+  var ti = getLocalTime(getTime())
+  result = intToStr(ti.hour, 2) & ':' & intToStr(ti.minute, 2) &
+    ':' & intToStr(ti.second, 2)
+
+proc `$`(timeInfo: TTimeInfo): string =
+  return $asctime(timeInfoToTM(timeInfo))
+
+proc `$`(time: TTime): string =
+  var a = time
+  return $ctime(addr(a))
+
+{.pop.}
diff --git a/lib/typeinfo.nim b/lib/typeinfo.nim
new file mode 100755
index 000000000..b4d8f8f3a
--- /dev/null
+++ b/lib/typeinfo.nim
@@ -0,0 +1,221 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+# type-info module for Nimrod
+
+include hti
+
+proc typeid(x: any): PNimType
+
+type
+  Variant = opaque record
+    # contains the address and a typeinfo
+    a: pointer # an address
+    k: TNimTypeKind
+
+# conversions to any and from any are inserted by the compiler!
+# x.attr is supported, as well as x[]!
+# here is a special iterator for variants:
+iterator fields(x: variant): (fieldname: string, value: variant) =
+proc setField(structure: variant, fieldname: string, value: variant)
+proc getField(structure: variant, fieldname: string)
+
+# any is implemented as a pair (val: pointer, info: PTypeInfo)
+# val is for:
+# an array - its address
+# a record - its address
+# an object - its address
+# a string - the address of the pointer to the string data
+# a sequence - the address of the pointer to the sequence data
+# a float - the address of a memory location where the float is stored
+#           this is a given address; storage comes from compiler or is
+#           already there (in a container)
+# an int - the address of a memory location where the int is stored
+#         storage comes from compiler or is
+#         already there (in a container)
+# a cstring - the address of an address of an array of chars
+# a ref - the address of the ref! (not the ref itself!)
+
+# But this does not work too well...
+# Better: any is a ref to Object; than we define intObj, floatObj,
+#   etc.; for strings this not needed as they already fit into the
+#   scheme!
+#
+
+type
+  TAnyImpl {.exportc: "TAnyImpl".} = record
+    typ {.exportc: "info".}: PNimType
+    val {.exportc: "val".}: pointer
+
+proc
+  typeKind(p: PNimType): TTypeKind {.inline.}
+
+  getAnyLength(x: any): int
+
+  isContainer(x: any): bool
+
+  writeAny(container: any, index: int, val: any)
+  readAny(container: any, index: int): any
+
+  writeAny(container: any, name: string, val: any)
+  readAny(container: any, name: string): any
+
+  getAttr(container: any, index: int, out name: string, out val: any)
+
+  getEnumStrings(enumeration: any): sequence of string
+
+  anyToInt(x: any): biggestint
+  anyToFloat(x: any): biggestfloat
+  anyToString(x: any): string
+  anyToChar(x: any): char
+  anyToBool(x: any): bool
+  #anyToT{T}(x: any, out result: T)
+
+  # etc...
+
+  #write(a: array of any) # also possible!
+
+#generic proc
+#  deepCopy{T}(x: T): T
+
+import
+  strutils
+
+proc anyToImpl(a: any): TAnyImpl {.inline.} =
+  result = cast{TAnyImpl}(a)
+
+proc typeKind(p: PNimType): TTypeKind =
+  result = p.typeKind
+
+type
+  Pint = untraced ref int
+  Pint8 = untraced ref int8
+  Pint16 = untraced ref int16
+  Pint32 = untraced ref int32
+  Pint64 = untraced ref int64
+  Puint = untraced ref uint
+  Puint8 = untraced ref uint8
+  Puint16 = untraced ref uint16
+  Puint32 = untraced ref uint32
+  Puint64 = untraced ref uint64
+  Pfloat = untraced ref float
+  Pfloat32 = untraced ref float32
+  Pfloat64 = untraced ref float64
+  Pstring = untraced ref string
+  Pbool = untraced ref bool
+  Pchar = untraced ref char
+
+proc anyToInt(x: any): biggestint =
+  var impl = anyToImpl(x)
+  case impl.typ.typeKind
+    of tyInt, tyEnum: result = cast{pint}(x.val)^
+    of tySInt8:  result = cast{pint8}(x.val)^
+    of tySInt16: result = cast{pint16}(x.val)^
+    of tySInt32: result = cast{pint32}(x.val)^
+    of tySInt64: result = cast{pint64}(x.val)^
+    of tyUInt:   result = cast{puint}(x.val)^
+    of tyUInt8:  result = cast{puint8}(x.val)^
+    of tyUInt16: result = cast{puint16}(x.val)^
+    of tyUInt32: result = cast{puint32}(x.val)^
+    of tyUInt64: result = cast{puint64}(x.val)^
+    else: raise EConvertError
+
+proc anyToFloat(x: any): biggestfloat =
+  var impl = anyToImpl(x)
+  case impl.typ.typeKind
+    of tyReal:   result = cast{pfloat}(x.val)^
+    of tyReal32: result = cast{pfloat32}(x.val)^
+    of tyReal64: result = cast{pfloat64}(x.val)^
+    # of tyReal128:
+    else: raise EConvertError
+
+proc anyToString(x: any): string =
+  var impl = anyToImpl(x)
+  case impl.typ.typeKind
+    of tyString: result = cast{pstring}(x.val)^
+    else: raise EConvertError
+
+proc anyToChar(x: any): char =
+  var impl = anyToImpl(x)
+  case impl.typ.typeKind
+    of tyChar: result = cast{pchar}(x.val)^
+    else: raise EConvertError
+
+proc anyToBool(x: any): bool =
+  var impl = anyToImpl(x)
+  case impl.typ.typeKind
+    of tyBool: result = cast{pbool}(x.val)^
+    else: raise EConvertError
+
+proc getAnyLength(x: any): int =
+  result = anyToImpl(x).typ.len
+
+const
+  ContainerSet = {tyArray, tyRecord, tyObject, tyOpenArray, tySequence, tyTable}
+
+proc isContainer(x: any): bool =
+  result = anyToImpl(x).typ.typeKind in ContainerSet
+
+proc strcmp(a, b: cstring): int {.external: "strcmp", nodecl.}
+
+proc strToIndex(info: PTypeInfo, str: string): int =
+  for i in 0..typ.len-1:
+    if strcmp(info.slots[i].name, str) == 0:
+      return i
+  raise EConvertError
+
+proc writeAny(container: any, index: int, val: any) =
+  var x = anyToImpl(container)
+  if index >= 0 and index < container.len:
+    case x.typ.typeKind
+      of tySequence:
+        var u = cast{TAddress}(x.val)
+        genericAssignAux(cast{pointer}(u) +% x.typ.slots[index].offset +%
+                         GenericSeqSize,
+                         anyToImpl(val).val, u.typ.baseType)
+      of tyArray:
+      of tyRecord, tyObject:
+      else: raise EConvertError
+  else:
+    raise EIndexError
+
+
+proc readAny(container: any, index: int): any =
+  var x = anyToImpl(container)
+  if x.typ.typeKind in ContainerSet:
+    if index >= 0 and index < container.len:
+    # XXX
+
+    else:
+      raise EIndexError
+  else:
+    raise EConvertError
+
+proc writeAny(container: any, name: string, val: any) =
+  result = writeAny(container, strToIndex(anyToImpl(container).typ), val)
+
+proc readAny(container: any, name: string): any =
+  result = readAny(container, strToIndex(anyToImpl(container).typ))
+
+proc getAttr(container: any, index: int, out name: string, out val: any) =
+  var x = anyToImpl(container)
+  if x.typ.typeKind in ContainerSet:
+    val = readAny(container, index)
+    name = $x.typ.slots[index].name
+  else:
+    raise EConvertError
+
+proc getEnumStrings(enumeration: any): sequence of string =
+  result = []
+  var x = anyToImpl(enumeration)
+  if x.typ.typekind == tyEnum:
+    for i in 0 .. x.typ.len-1:
+      result &= $x.typ.slots[i].name
+  else:
+    raise EConvertError
diff --git a/lib/unicode.nim b/lib/unicode.nim
new file mode 100755
index 000000000..6829ede50
--- /dev/null
+++ b/lib/unicode.nim
@@ -0,0 +1,103 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+type
+  TUniChar* = int32 ## type that can hold any Unicode character
+  TUniChar16* = int16 ##
+  
+template ones(n) = ((1 shl n)-1)
+
+proc uniCharLen*(s: string): int =
+  ## returns the number of Unicode characters of the string `s`.
+  var i = 0
+  while i < len(s):
+    if ord(s[i]) <= 127:
+      inc(i)
+    elif ord(s[i]) shr 5 == 0b110:
+      inc(i, 2)
+    elif ord(s[i]) shr 4 == 0b1110:
+      inc(i, 3)
+    elif ord(s[i]) shr 3 == 0b11110:
+      inc(i, 4)
+    else:
+      assert(false)
+    inc(result)
+
+proc uniCharAt*(s: string, i: int): TUniChar =
+  if ord(s[i]) <= 127:
+    result = ord(s[i])
+  elif ord(s[i]) shr 5 == 0b110:
+    assert(ord(s[i+1]) shr 6 == 0b10)
+    result = (ord(s[i]) and ones(5)) shl 6 or (ord(s[i+1]) and ones(6))
+  elif ord(s[i]) shr 4 == 0b1110:
+    assert(ord(s[i+1]) shr 6 == 0b10)
+    assert(ord(s[i+2]) shr 6 == 0b10)
+    result = (ord(s[i]) and ones(4)) shl 12 or
+             (ord(s[i+1]) and ones(6)) shl 6 or
+             (ord(s[i+2]) and ones(6))
+  elif ord(s[i]) shr 3 == 0b11110:
+    assert(ord(s[i+1]) shr 6 == 0b10)
+    assert(ord(s[i+2]) shr 6 == 0b10)
+    assert(ord(s[i+3]) shr 6 == 0b10)
+    result = (ord(s[i]) and ones(3)) shl 18 or
+             (ord(s[i+1]) and ones(6)) shl 12 or
+             (ord(s[i+2]) and ones(6)) shl 6 or
+             (ord(s[i+3]) and ones(6))
+  else:
+    assert(false)
+
+iterator unichars*(s: string): TUniChar =
+  ## iterates over any unicode character of the string `s`. Fastest possible
+  ## method.
+  var
+    i = 0
+    result: TUniChar
+  while i < len(s):
+    if ord(s[i]) <= 127:
+      result = ord(s[i])
+      inc(i)
+    elif ord(s[i]) shr 5 == 0b110:
+      result = (ord(s[i]) and ones(5)) shl 6 or (ord(s[i+1]) and ones(6))
+      inc(i, 2)
+    elif ord(s[i]) shr 4 == 0b1110:
+      result = (ord(s[i]) and ones(4)) shl 12 or
+               (ord(s[i+1]) and ones(6)) shl 6 or
+               (ord(s[i+2]) and ones(6))
+      inc(i, 3)
+    elif ord(s[i]) shr 3 == 0b11110:
+      result = (ord(s[i]) and ones(3)) shl 18 or
+               (ord(s[i+1]) and ones(6)) shl 12 or
+               (ord(s[i+2]) and ones(6)) shl 6 or
+               (ord(s[i+3]) and ones(6))
+      inc(i, 4)
+    else:
+      assert(false)
+    yield result
+
+proc utf8toLocale*(s: string): string
+proc localeToUtf8*(s: string): string
+
+proc utf8toUtf16*(s: string): seq[TUniChar16]
+proc utf8toUcs4*(s: string): seq[TUniChar] =
+  result = []
+  for u in unichars(s): 
+
+proc ucs4ToUtf8(s: seq[TUnichar]): string
+proc utf16ToUtf8(s: seq[TUnichar16]): string
+proc ucs4toUft16(s: seq[TUnichar]): seq[TUnichar16]
+proc uft16toUcs4(s: seq[Tunichar16]): seq[TUnichar]
+
+proc cmpUnicode*(a, b: string): int =
+  ## treats `a` and `b` as UTF-8 strings and compares them. Returns:
+  ## | < 0 iff a < b
+  ## | > 0 iff a > b
+  ## | == 0 iff a == b
+  ## This routine is useful for sorting UTF-8 strings.
+  return -1
+  
diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim
new file mode 100755
index 000000000..b18ae2be4
--- /dev/null
+++ b/lib/windows/mmsystem.nim
@@ -0,0 +1,2656 @@
+#
+#
+#            Nimrod'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
+#*******************************
+
+import
+  windows
+
+type
+  MMRESULT* = UINT
+  MMVERSION* = UINT
+  HWAVEOUT* = THandle
+  LPHWAVEOUT* = ptr HWAVEOUT
+  HWAVEIN* = THandle
+  LPHWAVEIN* = ptr HWAVEOUT
+  HWAVE* = THandle
+  LPHWAVE* = ptr THandle
+  LPUINT* = ptr UINT
+
+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* = THandle
+
+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: tHandle, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+      stdcall.}
+
+proc sndPlaySoundA*(Name: LPCSTR, flags: UINT): BOOL{.stdcall,
+    dynlib: "winmm.dll", importc: "sndPlaySoundA".}
+proc sndPlaySoundW*(Name: LPCWSTR, flags: UINT): BOOL{.stdcall,
+    dynlib: "winmm.dll", importc: "sndPlaySoundW".}
+when defined(winUNICODE):
+  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
+      dynlib: "winmm.dll", importc: "sndPlaySoundW".}
+else:
+  proc sndPlaySound*(Name: cstring, flags: UINT): 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* = UINT(- 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* = UINT(- 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* = record
+    wType*: UINT
+    hour*, min*, sec*, frame*, fps*, dummy*: int8
+    pad*: array[0..1, int8]
+
+  PMMTIME* = ptr mmtime
+  NPMMTIME* = ptr mmtime
+  LPMMTIME* = ptr mmtime
+  PWAVEHDR* = ptr wavehdr
+  TMMTime* = mmtime
+  wavehdr* = record
+    lpData*: cstring
+    dwBufferLength*: DWORD
+    dwBytesRecorded*: DWORD
+    dwUser*: DWORD
+    dwFlags*: DWORD
+    dwLoops*: DWORD
+    lpNext*: PWAVEHDR
+    reserved*: DWORD
+
+  TWAVEHDR* = WAVEHDR
+  NPWAVEHDR* = ptr wavehdr
+  LPWAVEHDR* = ptr wavehdr
+  WAVEOUTCAPSA* = record
+    wMid*: int16
+    wPid*: int16
+    vDriverVersion*: MMVERSION
+    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    dwFormats*: DWORD
+    wChannels*: int16
+    wReserved1*: int16
+    dwSupport*: DWORD
+
+  TWAVEOUTCAPSA* = WAVEOUTCAPSA
+  PWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
+  NPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
+  LPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
+  WAVEOUTCAPSW* = record
+    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
+  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* = record
+    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* = record
+    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* = record
+    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* = record
+    wf*: WAVEFORMAT
+    wBitsPerSample*: int16
+
+  PPCMWAVEFORMAT* = ptr pcmwaveformat
+  NPPCMWAVEFORMAT* = ptr pcmwaveformat
+  LPPCMWAVEFORMAT* = ptr pcmwaveformat
+  TPCMWAVEFORMAT* = PCMWAVEFORMAT
+  WAVEFORMATEX* = record
+    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* = THandle
+  HMIDIIN* = THandle
+  HMIDIOUT* = THandle
+  HMIDISTRM* = THandle
+  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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    dwDeltaTime*: DWORD
+    dwStreamID*: DWORD
+    dwEvent*: DWORD
+    dwParms*: array[0..Pred(1), DWORD]
+
+  TMIDIEVENT* = MIDIEVENT
+  midistrmbuffver* = record
+    dwVersion*: DWORD
+    dwMid*: DWORD
+    dwOEMVersion*: DWORD
+
+  TMIDISTRMBUFFVER* = MIDISTRMBUFFVER
+  Tmidiproptimediv* = record
+    cbStruct*: DWORD
+    dwTimeDiv*: DWORD
+
+  LPMIDIPROPTIMEDIV* = ptr Tmidiproptimediv
+  Tmidiproptempo* = record
+    cbStruct*: DWORD
+    dwTempo*: DWORD
+
+  LPMIDIPROPTEMPO* = ptr Tmidiproptempo
+  AUXCAPSA* = record
+    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* = record
+    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* = THandle
+  LPHMIXEROBJ* = ptr HMIXEROBJ
+  HMIXER* = THandle
+  LPHMIXER* = ptr HMIXER
+
+proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+                               importc: "mixerGetNumDevs".}
+type
+  MIXERCAPSA* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    cbStruct*: DWORD
+    dwLineID*: DWORD
+    dwControlType*, cControls*, cbmxctrl*: DWORD
+    pamxctrl*: PMIXERCONTROLA
+
+  PMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
+  LPMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
+  TMIXERLINECONTROLSA* = MIXERLINECONTROLSA
+  MIXERLINECONTROLSW* = record
+    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* = record
+    cbStruct*: DWORD
+    dwControlID*: DWORD
+    cChannels*: DWORD
+    cMultipleItems*, cbDetails*: DWORD
+    paDetails*: Pointer
+
+  MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS
+  PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
+  LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
+  MIXERCONTROLDETAILS_LISTTEXTA* = record
+    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* = record
+    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* = record
+    fValue*: int32
+
+  PMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
+  LPMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
+  TMIXERCONTROLDETAILS_BOOLEAN* = MIXERCONTROLDETAILS_BOOLEAN
+  MIXERCONTROLDETAILS_SIGNED* = record
+    lValue*: int32
+
+  PMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
+  LPMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
+  TMIXERCONTROLDETAILS_SIGNED* = MIXERCONTROLDETAILS_SIGNED
+  MIXERCONTROLDETAILS_UNSIGNED* = record
+    dwValue*: DWORD
+
+  PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
+  LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
+  TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED
+  LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+      stdcall.}
+  TTIMECALLBACK* = LPTIMECALLBACK
+  timecaps* = record
+    wPeriodMin*: UINT
+    wPeriodMax*: UINT
+
+  PTIMECAPS* = ptr timecaps
+  NPTIMECAPS* = ptr timecaps
+  LPTIMECAPS* = ptr timecaps
+  TTIMECAS* = TIMECAPS
+  JOYCAPSA* = record
+    wMid*: int16
+    wPid*: int16
+    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    wXmin*: UINT
+    wXmax*: UINT
+    wYmin*: UINT
+    wYmax*: UINT
+    wZmin*: UINT
+    wZmax*: UINT
+    wNumButtons*: UINT
+    wPeriodMin*: UINT
+    wPeriodMax*: UINT
+    wRmin*: UINT
+    wRmax*: UINT
+    wUmin*: UINT
+    wUmax*: UINT
+    wVmin*: UINT
+    wVmax*: UINT
+    wCaps*: UINT
+    wMaxAxes*: UINT
+    wNumAxes*: UINT
+    wMaxButtons*: UINT
+    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* = record
+    wMid*: int16
+    wPid*: int16
+    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    wXmin*: UINT
+    wXmax*: UINT
+    wYmin*: UINT
+    wYmax*: UINT
+    wZmin*: UINT
+    wZmax*: UINT
+    wNumButtons*: UINT
+    wPeriodMin*: UINT
+    wPeriodMax*: UINT
+    wRmin*: UINT
+    wRmax*: UINT
+    wUmin*: UINT
+    wUmax*: UINT
+    wVmin*: UINT
+    wVmax*: UINT
+    wCaps*: UINT
+    wMaxAxes*: UINT
+    wNumAxes*: UINT
+    wMaxButtons*: UINT
+    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* = record
+    wXpos*: UINT
+    wYpos*: UINT
+    wZpos*: UINT
+    wButtons*: UINT
+
+  PJOYINFO* = ptr joyinfo
+  NPJOYINFO* = ptr joyinfo
+  LPJOYINFO* = ptr joyinfo
+  TJOYINFO* = JOYINFO
+  joyinfoex* = record
+    dwSize*: DWORD
+    dwFlags*: DWORD
+    wXpos*: UINT
+    wYpos*: UINT
+    wZpos*: UINT
+    dwRpos*: DWORD
+    dwUpos*: DWORD
+    dwVpos*: DWORD
+    wButtons*: UINT
+    dwButtonNumber*: DWORD
+    dwPOV*: DWORD
+    dwReserved1*: DWORD
+    dwReserved2*: DWORD
+
+  PJOYINFOEX* = ptr joyinfoex
+  NPJOYINFOEX* = ptr joyinfoex
+  LPJOYINFOEX* = ptr joyinfoex
+  TJOYINFOEX* = JOYINFOEX
+  FOURCC* = DWORD
+  HPSTR* = cstring
+  HMMIO* = THandle
+  LPMMIOPROC* = proc (x1: LPSTR, x2: UINT, x3, x4: LPARAM): LRESULT{.stdcall.}
+  TMMIOPROC* = LPMMIOPROC
+  MMIOINFO* = record
+    dwFlags*: DWORD
+    fccIOProc*: FOURCC
+    pIOProc*: LPMMIOPROC
+    wErrorRet*: UINT
+    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* = record
+    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* = UINT
+  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.}
+  TYIELDPROC* = YIELDPROC
+  MCI_GENERIC_PARMS* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    lpstrReturn*: cstring
+    dwRetSize*: DWORD
+
+  LPMCI_INFO_PARMSA* = ptr MCI_INFO_PARMSA
+  TMCI_INFO_PARMSA* = MCI_INFO_PARMSA
+  MCI_INFO_PARMSW* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    lpstrReturn*: cstring
+    dwRetSize*: DWORD
+    dwNumber*: DWORD
+    wDeviceType*: UINT
+
+  PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
+  LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
+  TMCI_SYSINFO_PARMSA* = MCI_SYSINFO_PARMSA
+  MCI_SYSINFO_PARMSW* = record
+    dwCallback*: DWORD
+    lpstrReturn*: LPWSTR
+    dwRetSize*: DWORD
+    dwNumber*: DWORD
+    wDeviceType*: UINT
+
+  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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    dwFrom*: DWORD
+    dwTo*: DWORD
+
+  LPMCI_RECORD_PARMS* = ptr MCI_RECORD_PARMS
+  TMCI_RECORD_PARMS* = MCI_RECORD_PARMS
+  MCI_VD_PLAY_PARMS* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    dwTimeFormat*: DWORD
+    dwAudio*: DWORD
+    wInput*: UINT
+    wOutput*: UINT
+    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* = record
+    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* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    hWnd*: HWND
+    nCmdShow*: UINT
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    hWnd*: HWND
+    nCmdShow*: UINT
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    rc*: TRECT
+
+  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* = record
+    dwCallback*: DWORD
+    rc*: TRECT
+    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* = record
+    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* = record
+    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* = record
+    dwCallback*: DWORD
+    hWnd*: HWND
+    nCmdShow*: UINT
+    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* = record
+    dwCallback*: DWORD
+    hWnd*: HWND
+    nCmdShow*: UINT
+    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* = record
+    dwCallback*: DWORD
+    rc*: TRECT
+
+  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* = record
+    dwCallback*: DWORD
+    lpfilename*: LPCSTR
+    rc*: TRECT
+
+  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* = record
+    dwCallback*: DWORD
+    lpfilename*: LPCWSTR
+    rc*: TRECT
+
+  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* = record
+    dwCallback*: DWORD
+    lpfilename*: LPCSTR
+    rc*: TRECT
+
+  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* = record
+    dwCallback*: DWORD
+    lpfilename*: LPCWSTR
+    rc*: TRECT
+
+  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
+
+type
+  pcmwaveformat_tag* = PCMWAVEFORMAT
+
+proc mmioStringToFOURCCA*(x1: LPCSTR, x2: UINT): FOURCC{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
+proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: UINT): FOURCC{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioStringToFOURCCW".}
+proc mmioStringToFOURCC*(x1: cstring, x2: UINT): 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: UINT): 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: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioGetInfo".}
+proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioSetInfo".}
+proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "mmioSetBuffer".}
+proc mmioFlush*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "mmioFlush".}
+proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioAdvance".}
+proc mmioSendMessage*(x1: HMMIO, x2: UINT, x3: LPARAM, x4: LPARAM): LRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "mmioSendMessage".}
+proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "mmioDescend".}
+proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioAscend".}
+proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mmioCreateChunk".}
+proc mciSendCommandA*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
+proc mciSendCommandW*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandW".}
+proc mciSendCommand*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
+proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: UINT, x4: HWND): MCIERROR{.
+    stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
+proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: UINT, x4: HWND): MCIERROR{.
+    stdcall, dynlib: "winmm.dll", importc: "mciSendStringW".}
+proc mciSendString*(x1: cstring, x2: cstring, x3: UINT, 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: UINT): BOOL{.stdcall,
+    dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
+proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: UINT): BOOL{.stdcall,
+    dynlib: "winmm.dll", importc: "mciGetErrorStringW".}
+proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: UINT): 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: UINT, x2: LPJOYINFO): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joyGetPos".}
+proc joyGetPosEx*(x1: UINT, x2: LPJOYINFOEX): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joyGetPosEx".}
+proc joyGetThreshold*(x1: UINT, x2: LPUINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joyGetThreshold".}
+proc joyReleaseCapture*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "joyReleaseCapture".}
+proc joySetCapture*(x1: HWND, x2: UINT, x3: UINT, x4: BOOL): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joySetCapture".}
+proc joySetThreshold*(x1: UINT, x2: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joySetThreshold".}
+proc waveOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+                                 importc: "waveOutGetNumDevs".}
+proc waveOutGetDevCapsA*(x1: UINT, x2: LPWAVEOUTCAPSA, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
+proc waveOutGetDevCapsW*(x1: UINT, x2: LPWAVEOUTCAPSW, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsW".}
+proc waveOutGetDevCaps*(x1: UINT, x2: LPWAVEOUTCAPS, x3: UINT): 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
+proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextW".}
+proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
+proc waveOutOpen*(x1: LPHWAVEOUT, x2: UINT, 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutPrepareHeader".}
+proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutUnprepareHeader".}
+proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): 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: UINT): 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: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveOutMessage".}
+proc waveInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+                                importc: "waveInGetNumDevs".}
+proc waveInGetDevCapsA*(x1: UINT, x2: LPWAVEINCAPSA, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
+proc waveInGetDevCapsW*(x1: UINT, x2: LPWAVEINCAPSW, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsW".}
+proc waveInGetDevCaps*(x1: UINT, x2: LPWAVEINCAPS, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
+proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
+proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextW".}
+proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
+proc waveInOpen*(x1: LPHWAVEIN, x2: UINT, 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInPrepareHeader".}
+proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "waveInUnprepareHeader".}
+proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): 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: UINT): 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: UINT, 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*(): UINT{.stdcall, dynlib: "winmm.dll",
+                             importc: "joyGetNumDevs".}
+proc joyGetDevCapsA*(x1: UINT, x2: LPJOYCAPSA, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
+proc joyGetDevCapsW*(x1: UINT, x2: LPJOYCAPSW, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "joyGetDevCapsW".}
+proc joyGetDevCaps*(x1: UINT, x2: LPJOYCAPS, x3: UINT): 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: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "timeGetSystemTime".}
+proc timeGetTime*(): DWORD{.stdcall, dynlib: "winmm.dll", importc: "timeGetTime".}
+proc timeSetEvent*(x1: UINT, x2: UINT, x3: LPTIMECALLBACK, x4: DWORD, x5: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "timeSetEvent".}
+proc timeKillEvent*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "timeKillEvent".}
+proc timeGetDevCaps*(x1: LPTIMECAPS, x2: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "timeGetDevCaps".}
+proc timeBeginPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "timeBeginPeriod".}
+proc timeEndPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "timeEndPeriod".}
+proc mixerGetDevCapsA*(x1: UINT, x2: LPMIXERCAPSA, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
+proc mixerGetDevCapsW*(x1: UINT, x2: LPMIXERCAPSW, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mixerGetDevCapsW".}
+proc mixerGetDevCaps*(x1: UINT, x2: LPMIXERCAPS, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
+proc mixerOpen*(x1: LPHMIXER, x2: UINT, 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: UINT, x3: DWORD, x4: DWORD): DWORD{.stdcall,
+    dynlib: "winmm.dll", importc: "mixerMessage".}
+proc auxGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+                             importc: "auxGetNumDevs".}
+proc auxGetDevCapsA*(x1: UINT, x2: LPAUXCAPSA, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
+proc auxGetDevCapsW*(x1: UINT, x2: LPAUXCAPSW, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "auxGetDevCapsW".}
+proc auxGetDevCaps*(x1: UINT, x2: LPAUXCAPS, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
+proc auxSetVolume*(x1: UINT, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "auxSetVolume".}
+proc auxGetVolume*(x1: UINT, x2: LPDWORD): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "auxGetVolume".}
+proc auxOutMessage*(x1: UINT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "auxOutMessage".}
+proc midiOutGetNumDevs*(): UINT{.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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiStreamPosition".}
+proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: UINT): 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: UINT, x2: LPMIDIOUTCAPSA, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
+proc midiOutGetDevCapsW*(x1: UINT, x2: LPMIDIOUTCAPSW, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsW".}
+proc midiOutGetDevCaps*(x1: UINT, x2: LPMIDIOUTCAPS, x3: UINT): 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
+proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextW".}
+proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
+proc midiOutOpen*(x1: LPHMIDIOUT, x2: UINT, 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutPrepareHeader".}
+proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): 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: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "midiOutLongMsg".}
+proc midiOutReset*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+    importc: "midiOutReset".}
+proc midiOutCachePatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutCachePatches".}
+proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): 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: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiOutMessage".}
+proc midiInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+                                importc: "midiInGetNumDevs".}
+proc midiInGetDevCapsA*(x1: UINT, x2: LPMIDIINCAPSA, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
+proc midiInGetDevCapsW*(x1: UINT, x2: LPMIDIINCAPSW, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsW".}
+proc midiInGetDevCaps*(x1: UINT, x2: LPMIDIINCAPS, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
+proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+    dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
+proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextW".}
+proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
+proc midiInOpen*(x1: LPHMIDIIN, x2: UINT, 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: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInPrepareHeader".}
+proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+    stdcall, dynlib: "winmm.dll", importc: "midiInUnprepareHeader".}
+proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): 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: UINT, 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 UINT, 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 = (x shr 24) And 0x000000FF
+
+proc MEVT_EVENTPARM(x: DWORD): DWORD =
+  result = x And 0x00FFFFFF
+
+type
+  TFourBytes = array[0..3, int8]
+
+proc MCI_MSF_MINUTE(msf: int32): int8 =
+  result = msf and 0xff
+
+proc MCI_TMSF_TRACK(tmsf: int32): int8 =
+  result = tmsf and 0xff
+
+proc MCI_HMS_HOUR(h: int32): int8 =
+  result = h and 0xff
+
+proc MCI_MSF_SECOND(msf: int32): int8 =
+  result = msf shr 8 and 0xff
+
+proc MCI_TMSF_MINUTE(tmsf: int32): int8 =
+  result = tmsf shr 8 and 0xff
+
+proc MCI_HMS_MINUTE(h: int32): int8 =
+  result = h shr 8 and 0xff
+
+proc MCI_MSF_FRAME(msf: int32): int8 =
+  result = msf shr 16 and 0xff
+
+proc MCI_TMSF_SECOND(tmsf: int32): int8 =
+  result = tmsf shr 16 and 0xff
+
+proc MCI_HMS_SECOND(h: int32): int8 =
+  result = h shr 16 and 0xff
+
+proc MCI_MAKE_MSF(m, s, f: int8): int32 =
+  result = m or s shl 8 or f shl 16
+
+proc MCI_MAKE_HMS(h, m, s: int8): int32 =
+  result = h or m shl 8 or s shl 16
+
+proc MCI_TMSF_FRAME(tmsf: int32): int8 =
+  result = tmsf shr 24 and 0xff
+
+proc mci_Make_TMSF(t, m, s, f: int8): int32 =
+  result = t or m shl 8 or s shl 16 or f shl 24
+
+proc DIBINDEX(n: int32): int32 =
+  result = n Or 0x000010FF shl 16
diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim
new file mode 100755
index 000000000..8c61bbaf7
--- /dev/null
+++ b/lib/windows/nb30.nim
@@ -0,0 +1,230 @@
+#
+#
+#            Nimrod'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 unit contains the definitions for portable NetBIOS 3.0 support. 
+
+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 TNCB
+  TNCBPostProc* = proc (P: PNCB)
+  TNCB* = record # 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*: TNCBPostProc   # 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*: THandle       # HANDLE to Win32 event which
+                              # will be set to the signalled
+                              # state when an ASYNCH command
+                              # completes
+  
+  PAdapterStatus* = ptr TAdapterStatus
+  TAdapterStatus* = record 
+    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 TNameBuffer
+  TNameBuffer* = record 
+    name*: array[0..NCBNAMSZ - 1, Char]
+    name_num*: Char
+    name_flags*: Char
+
+
+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 TSessionHeader
+  TSessionHeader* = record 
+    sess_name*: Char
+    num_sess*: Char
+    rcv_dg_outstanding*: Char
+    rcv_any_outstanding*: Char
+
+  PSessionBuffer* = ptr TSessionBuffer
+  TSessionBuffer* = record 
+    lsn*: Char
+    state*: Char
+    local_name*: array[0..NCBNAMSZ - 1, Char]
+    remote_name*: array[0..NCBNAMSZ - 1, Char]
+    rcvs_outstanding*: Char
+    sends_outstanding*: Char
+
+
+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* = record # 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 TFindNameHeader
+  TFindNameHeader* = record 
+    node_count*: int16
+    reserved*: Char
+    unique_group*: Char
+
+  PFindNameBuffer* = ptr TFindNameBuffer
+  TFindNameBuffer* = record # 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 TActionHeader
+  TActionHeader* = record 
+    transport_id*: int32
+    action_code*: int16
+    reserved*: int16
+
+
+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/ole2.nim b/lib/windows/ole2.nim
new file mode 100755
index 000000000..ec0ab8f5d
--- /dev/null
+++ b/lib/windows/ole2.nim
@@ -0,0 +1,208 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+import 
+  windows
+
+const 
+  GUID_NULL*: TGUID = (D1: 0x00000000, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000000])
+  IID_IUnknown*: TGUID = (D1: 0x00000000, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IClassFactory*: TGUID = (D1: 0x00000001, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IMarshal*: TGUID = (D1: 0x00000003, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IMalloc*: TGUID = (D1: 0x00000002, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IStdMarshalInfo*: TGUID = (D1: 0x00000018, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IExternalConnection*: TGUID = (D1: 0x00000019, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IEnumUnknown*: TGUID = (D1: 0x00000100, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IBindCtx*: TGUID = (D1: 0x0000000E, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumMoniker*: TGUID = (D1: 0x00000102, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IRunnableObject*: TGUID = (D1: 0x00000126, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IRunningObjectTable*: TGUID = (D1: 0x00000010, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IPersist*: TGUID = (D1: 0x0000010C, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IPersistStream*: TGUID = (D1: 0x00000109, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IMoniker*: TGUID = (D1: 0x0000000F, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumString*: TGUID = (D1: 0x00000101, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IStream*: TGUID = (D1: 0x0000000C, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumStatStg*: TGUID = (D1: 0x0000000D, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IStorage*: TGUID = (D1: 0x0000000B, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IPersistFile*: TGUID = (D1: 0x0000010B, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IPersistStorage*: TGUID = (D1: 0x0000010A, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_ILockBytes*: TGUID = (D1: 0x0000000A, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumFormatEtc*: TGUID = (D1: 0x00000103, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumStatData*: TGUID = (D1: 0x00000105, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IRootStorage*: TGUID = (D1: 0x00000012, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IAdviseSink*: TGUID = (D1: 0x0000010F, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IAdviseSink2*: TGUID = (D1: 0x00000125, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IDataObject*: TGUID = (D1: 0x0000010E, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IDataAdviseHolder*: TGUID = (D1: 0x00000110, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IMessageFilter*: TGUID = (D1: 0x00000016, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IRpcChannelBuffer*: TGUID = (D1: 0xD5F56B60, D2: 0x0000593B, 
+    D3: 0x0000101A, D4: [0x000000B5, 0x00000069, 0x00000008, 0x00000000, 
+                         0x0000002B, 0x0000002D, 0x000000BF, 0x0000007A])
+  IID_IRpcProxyBuffer*: TGUID = (D1: 0xD5F56A34, D2: 0x0000593B, D3: 0x0000101A, D4: [
+      0x000000B5, 0x00000069, 0x00000008, 0x00000000, 0x0000002B, 0x0000002D, 
+      0x000000BF, 0x0000007A])
+  IID_IRpcStubBuffer*: TGUID = (D1: 0xD5F56AFC, D2: 0x0000593B, D3: 0x0000101A, D4: [
+      0x000000B5, 0x00000069, 0x00000008, 0x00000000, 0x0000002B, 0x0000002D, 
+      0x000000BF, 0x0000007A])
+  IID_IPSFactoryBuffer*: TGUID = (D1: 0xD5F569D0, D2: 0x0000593B, 
+    D3: 0x0000101A, D4: [0x000000B5, 0x00000069, 0x00000008, 0x00000000, 
+                         0x0000002B, 0x0000002D, 0x000000BF, 0x0000007A])
+  IID_ICreateTypeInfo*: TGUID = (D1: 0x00020405, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_ICreateTypeLib*: TGUID = (D1: 0x00020406, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IDispatch*: TGUID = (D1: 0x00020400, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumVariant*: TGUID = (D1: 0x00020404, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_ITypeComp*: TGUID = (D1: 0x00020403, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_ITypeInfo*: TGUID = (D1: 0x00020401, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_ITypeLib*: TGUID = (D1: 0x00020402, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IErrorInfo*: TGUID = (D1: 0x1CF2B120, D2: 0x0000547D, D3: 0x0000101B, D4: [
+      0x0000008E, 0x00000065, 0x00000008, 0x00000000, 0x0000002B, 0x0000002B, 
+      0x000000D1, 0x00000019])
+  IID_ICreateErrorInfo*: TGUID = (D1: 0x22F03340, D2: 0x0000547D, 
+    D3: 0x0000101B, D4: [0x0000008E, 0x00000065, 0x00000008, 0x00000000, 
+                         0x0000002B, 0x0000002B, 0x000000D1, 0x00000019])
+  IID_ISupportErrorInfo*: TGUID = (D1: 0xDF0B3D60, D2: 0x0000548F, 
+    D3: 0x0000101B, D4: [0x0000008E, 0x00000065, 0x00000008, 0x00000000, 
+                         0x0000002B, 0x0000002B, 0x000000D1, 0x00000019])
+  IID_IOleAdviseHolder*: TGUID = (D1: 0x00000111, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleCache*: TGUID = (D1: 0x0000011E, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleCache2*: TGUID = (D1: 0x00000128, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleCacheControl*: TGUID = (D1: 0x00000129, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IParseDisplayName*: TGUID = (D1: 0x0000011A, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleContainer*: TGUID = (D1: 0x0000011B, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleClientSite*: TGUID = (D1: 0x00000118, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleObject*: TGUID = (D1: 0x00000112, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleWindow*: TGUID = (D1: 0x00000114, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleLink*: TGUID = (D1: 0x0000011D, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IOleItemContainer*: TGUID = (D1: 0x0000011C, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleInPlaceUIWindow*: TGUID = (D1: 0x00000115, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleInPlaceActiveObject*: TGUID = (D1: 0x00000117, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleInPlaceFrame*: TGUID = (D1: 0x00000116, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleInPlaceObject*: TGUID = (D1: 0x00000113, D2: 0x00000000, 
+    D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000, 
+                         0x00000000, 0x00000000, 0x00000000, 0x00000046])
+  IID_IOleInPlaceSite*: TGUID = (D1: 0x00000119, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IViewObject*: TGUID = (D1: 0x0000010D, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IViewObject2*: TGUID = (D1: 0x00000127, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IDropSource*: TGUID = (D1: 0x00000121, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IDropTarget*: TGUID = (D1: 0x00000122, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
+  IID_IEnumOleVerb*: TGUID = (D1: 0x00000104, D2: 0x00000000, D3: 0x00000000, D4: [
+      0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
+      0x00000000, 0x00000046])
diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim
new file mode 100755
index 000000000..fbbd1999a
--- /dev/null
+++ b/lib/windows/shellapi.nim
@@ -0,0 +1,860 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+# 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* = THandle
+  UINT_PTR* = ptr UINT
+  DWORD_PTR* = ptr DWORD
+  pHICON* = ptr HICON
+  pBool* = ptr BOOL
+  STARTUPINFOW* = record      # 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
+  TSTARTUPINFOW* = STARTUPINFOW
+  PSTARTUPINFOW* = ptr STARTUPINFOW #unicode
+
+proc DragQueryFileA*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
+proc DragQueryFileW*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
+proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+    stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
+proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+    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*(hinst: HINST, HICON: 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: UINT): HICON{.
+    stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
+proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+    stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
+    stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+    stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
+  # if(WINVER >= 0x0400)
+type                          # init with sizeof(DRAGINFO)
+  DRAGINFOA* = record
+    uSize*: UINT
+    pt*: POINT
+    fNC*: BOOL
+    lpFileList*: LPSTR
+    grfKeyState*: DWORD
+
+  TDRAGINFOA* = DRAGINFOA
+  LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO)
+  DRAGINFOW* = record
+    uSize*: UINT
+    pt*: POINT
+    fNC*: BOOL
+    lpFileList*: LPWSTR
+    grfKeyState*: DWORD
+
+  TDRAGINFOW* = DRAGINFOW
+  LPDRAGINFOW* = ptr DRAGINFOW
+
+when defined(UNICODE):
+  type
+    DRAGINFO* = DRAGINFOW
+    TDRAGINFO* = DRAGINFOW
+    LPDRAGINFO* = LPDRAGINFOW
+else:
+  type
+    DRAGINFO* = DRAGINFOA
+    TDRAGINFO* = DRAGINFOW
+    LPDRAGINFO* = LPDRAGINFOA
+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* = record
+    cbSize*: DWORD
+    hWnd*: HWND
+    uCallbackMessage*: UINT
+    uEdge*: UINT
+    rc*: RECT
+    lParam*: LPARAM           # message specific
+
+  TAPPBARDATA* = AppBarData
+  PAPPBARDATA* = ptr AppBarData
+
+proc SHAppBarMessage*(dwMessage: DWORD, pData: APPBARDATA): UINT_PTR{.stdcall,
+    dynlib: "shell32.dll", importc: "SHAppBarMessage".}
+  #
+  #  EndAppBar
+  #
+proc DoEnvironmentSubstA*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+    dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
+proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+    dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
+proc DoEnvironmentSubst*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+    dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
+proc DoEnvironmentSubst*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+    dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
+  #Macro
+proc EIRESID*(x: int32): int32
+proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
+                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+    dynlib: "shell32.dll", importc: "ExtractIconExA".}
+proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
+                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+    dynlib: "shell32.dll", importc: "ExtractIconExW".}
+proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32,
+                     phiconLarge: var HICON, phiconSmall: var HIcon,
+                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+    importc: "ExtractIconExA".}
+proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32,
+                     phiconLarge: var HICON, phiconSmall: var HIcon,
+                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+    importc: "ExtractIconExW".}
+proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
+                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+    dynlib: "shell32.dll", importc: "ExtractIconExA".}
+proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
+                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+    dynlib: "shell32.dll", importc: "ExtractIconExW".}
+proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: var HICON,
+                    phiconSmall: var HIcon, nIcons: UINT): UINT{.stdcall,
+    dynlib: "shell32.dll", importc: "ExtractIconExA".}
+proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32,
+                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: UINT): UINT{.
+    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* = record
+    hwnd*: HWND
+    wFunc*: UINT
+    pFrom*: LPCSTR
+    pTo*: LPCSTR
+    fFlags*: FILEOP_FLAGS
+    fAnyOperationsAborted*: BOOL
+    hNameMappings*: LPVOID
+    lpszProgressTitle*: LPCSTR # only used if FOF_SIMPLEPROGRESS
+
+  TSHFILEOPSTRUCTA* = SHFILEOPSTRUCTA
+  LPSHFILEOPSTRUCTA* = ptr SHFILEOPSTRUCTA
+  SHFILEOPSTRUCTW* = record
+    hwnd*: HWND
+    wFunc*: UINT
+    pFrom*: LPCWSTR
+    pTo*: LPCWSTR
+    fFlags*: FILEOP_FLAGS
+    fAnyOperationsAborted*: BOOL
+    hNameMappings*: LPVOID
+    lpszProgressTitle*: LPCWSTR
+
+  TSHFILEOPSTRUCTW* = SHFILEOPSTRUCTW
+  LPSHFILEOPSTRUCTW* = ptr SHFILEOPSTRUCTW
+
+when defined(UNICODE):
+  type
+    SHFILEOPSTRUCT* = SHFILEOPSTRUCTW
+    TSHFILEOPSTRUCT* = SHFILEOPSTRUCTW
+    LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTW
+else:
+  type
+    SHFILEOPSTRUCT* = SHFILEOPSTRUCTA
+    TSHFILEOPSTRUCT* = SHFILEOPSTRUCTA
+    LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTA
+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: THandle){.stdcall,
+    dynlib: "shell32.dll", importc: "SHFreeNameMappings".}
+type
+  SHNAMEMAPPINGA* = record
+    pszOldPath*: LPSTR
+    pszNewPath*: LPSTR
+    cchOldPath*: int32
+    cchNewPath*: int32
+
+  TSHNAMEMAPPINGA* = SHNAMEMAPPINGA
+  LPSHNAMEMAPPINGA* = ptr SHNAMEMAPPINGA
+  SHNAMEMAPPINGW* = record
+    pszOldPath*: LPWSTR
+    pszNewPath*: LPWSTR
+    cchOldPath*: int32
+    cchNewPath*: int32
+
+  TSHNAMEMAPPINGW* = SHNAMEMAPPINGW
+  LPSHNAMEMAPPINGW* = ptr SHNAMEMAPPINGW
+
+when not(defined(UNICODE)):
+  type
+    SHNAMEMAPPING* = SHNAMEMAPPINGW
+    TSHNAMEMAPPING* = SHNAMEMAPPINGW
+    LPSHNAMEMAPPING* = LPSHNAMEMAPPINGW
+else:
+  type
+    SHNAMEMAPPING* = SHNAMEMAPPINGA
+    TSHNAMEMAPPING* = SHNAMEMAPPINGA
+    LPSHNAMEMAPPING* = LPSHNAMEMAPPINGA
+#
+# 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* = record
+    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
+
+  TSHELLEXECUTEINFOA* = SHELLEXECUTEINFOA
+  LPSHELLEXECUTEINFOA* = ptr SHELLEXECUTEINFOA
+  SHELLEXECUTEINFOW* = record
+    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
+
+  TSHELLEXECUTEINFOW* = SHELLEXECUTEINFOW
+  LPSHELLEXECUTEINFOW* = ptr SHELLEXECUTEINFOW
+
+when defined(UNICODE):
+  type
+    SHELLEXECUTEINFO* = SHELLEXECUTEINFOW
+    TSHELLEXECUTEINFO* = SHELLEXECUTEINFOW
+    LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOW
+else:
+  type
+    SHELLEXECUTEINFO* = SHELLEXECUTEINFOA
+    TSHELLEXECUTEINFO* = SHELLEXECUTEINFOA
+    LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOA
+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* = record
+    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
+
+  TSHCREATEPROCESSINFOW* = SHCREATEPROCESSINFOW
+  PSHCREATEPROCESSINFOW* = ptr 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* = record
+    cbSize*: DWORD
+    i64Size*: int64
+    i64NumItems*: int64
+
+  TSHQUERYRBINFO* = SHQUERYRBINFO
+  LPSHQUERYRBINFO* = ptr SHQUERYRBINFO # flags for SHEmptyRecycleBin
+
+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* = record
+    cbSize*: DWORD
+    hWnd*: HWND
+    uID*: UINT
+    uFlags*: UINT
+    uCallbackMessage*: UINT
+    hIcon*: HICON
+    szTip*: array[0..127, CHAR]
+    dwState*: DWORD
+    dwStateMask*: DWORD
+    szInfo*: array[0..255, CHAR]
+    uTimeout*: UINT           # also: uVersion
+    szInfoTitle*: array[0..63, CHAR]
+    dwInfoFlags*: DWORD
+    guidItem*: TGUID
+
+  TNOTIFYICONDATAA* = NOTIFYICONDATAA
+  PNOTIFYICONDATAA* = ptr NOTIFYICONDATAA
+  NOTIFYICONDATAW* = record
+    cbSize*: DWORD
+    hWnd*: HWND
+    uID*: UINT
+    uFlags*: UINT
+    uCallbackMessage*: UINT
+    hIcon*: HICON
+    szTip*: array[0..127, WCHAR]
+    dwState*: DWORD
+    dwStateMask*: DWORD
+    szInfo*: array[0..255, WCHAR]
+    uTimeout*: UINT           # also uVersion : UINT
+    szInfoTitle*: array[0..63, CHAR]
+    dwInfoFlags*: DWORD
+    guidItem*: TGUID
+
+  TNOTIFYICONDATAW* = NOTIFYICONDATAW
+  PNOTIFYICONDATAW* = ptr NOTIFYICONDATAW
+
+when defined(UNICODE):
+  type
+    NOTIFYICONDATA* = NOTIFYICONDATAW
+    TNOTIFYICONDATA* = NOTIFYICONDATAW
+    PNOTIFYICONDATA* = PNOTIFYICONDATAW
+else:
+  type
+    NOTIFYICONDATA* = NOTIFYICONDATAA
+    TNOTIFYICONDATA* = NOTIFYICONDATAA
+    PNOTIFYICONDATA* = PNOTIFYICONDATAA
+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* = record
+    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
+
+  TSHFILEINFOA* = SHFILEINFOA
+  pSHFILEINFOA* = ptr SHFILEINFOA
+  SHFILEINFOW* = record
+    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
+
+  TSHFILEINFOW* = SHFILEINFOW
+  pSHFILEINFOW* = ptr SHFILEINFOW
+
+when defined(UNICODE):
+  type
+    SHFILEINFO* = SHFILEINFOW
+    TSHFILEINFO* = SHFILEINFOW
+    pFILEINFO* = SHFILEINFOW
+else:
+  type
+    SHFILEINFO* = SHFILEINFOA
+    TSHFILEINFO* = SHFILEINFOA
+    pFILEINFO* = 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: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
+proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
+                     psfi: pSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
+proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
+                    psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
+proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
+                     psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
+proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
+                     psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
+proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
+                    psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+    stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
+proc SHGetFileInfo*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
+                    psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): 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: UINT): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
+proc SHGetNewLinkInfoW*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
+                        pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
+proc SHGetNewLinkInfo*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
+                       pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
+proc SHGetNewLinkInfo*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
+                       pfMustCopy: pBool, uFlags: UINT): 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: UINT, lpBuf1: LPCSTR,
+                              lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
+proc SHInvokePrinterCommandW*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
+                              lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
+proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
+                             lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+    dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
+proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, 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 = - int(x)
diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim
new file mode 100755
index 000000000..210f6441f
--- /dev/null
+++ b/lib/windows/shfolder.nim
@@ -0,0 +1,91 @@
+#
+#
+#            Nimrod'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.
+#  ---------------------------------------------------------------------
+
+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: THandle, Flags: DWord, 
+                       Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
+    importc: "SHGetFolderPathA".}
+proc SHGetFolderPathW*(Ahwnd: HWND, Csidl: int, Token: THandle, Flags: DWord, 
+                       Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
+    importc: "SHGetFolderPathW".}
+proc SHGetFolderPath*(Ahwnd: HWND, Csidl: int, Token: THandle, Flags: DWord, 
+                      Path: cstring): HRESULT{.stdcall, dynlib: LibName, 
+    importc: "SHGetFolderPathA".}
+type 
+  PFNSHGetFolderPathA* = proc (Ahwnd: HWND, Csidl: int, Token: THandle, 
+                               Flags: DWord, Path: cstring): HRESULT{.stdcall.}
+  PFNSHGetFolderPathW* = proc (Ahwnd: HWND, Csidl: int, Token: THandle, 
+                               Flags: DWord, Path: cstring): HRESULT{.stdcall.}
+  PFNSHGetFolderPath* = PFNSHGetFolderPathA
+  TSHGetFolderPathA* = PFNSHGetFolderPathA
+  TSHGetFolderPathW* = PFNSHGetFolderPathW
+  TSHGetFolderPath* = TSHGetFolderPathA
+
diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim
new file mode 100755
index 000000000..409977e7a
--- /dev/null
+++ b/lib/windows/windows.nim
@@ -0,0 +1,23909 @@
+#
+#
+#            Nimrod's Runtime Library
+#        (c) Copyright 2006 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.
+
+type
+  ATOM* = int16
+  TAtom* = ATOM
+  WINBOOL* = int32            # XXX: longbool;
+  WORDBOOL* = int16  # XXX: not a bool
+  CALTYPE* = int
+  CALID* = int
+  CCHAR* = char
+  COLORREF* = int
+  TCOLORREF* = int
+  SHORT* = int16
+  WINT* = int32
+  LONG* = int32
+  DWORD* = int
+  PINTEGER* = ptr int32
+  PBOOL* = ptr WINBOOL
+  LONGLONG* = int64
+  PLONGLONG* = ptr LONGLONG
+  LPLONGLONG* = ptr LONGLONG
+  ULONGLONG* = int64          # used in AMD64 CONTEXT
+  PULONGLONG* = ptr ULONGLONG #
+  DWORD64* = int64            #
+  PDWORD64* = ptr DWORD64     #
+  INT_PTR* = TAddress
+  UINT_PTR* = TAddress
+  LONG_PTR* = TAddress
+  ULONG_PTR* = TAddress
+  DWORDLONG* = int64          # was unsigned long
+  PDWORDLONG* = ptr DWORDLONG
+  HANDLE* = int32
+  THandle* = HANDLE
+  HRESULT* = int32
+  PHRESULT* = ptr HRESULT
+  HACCEL* = HANDLE
+  HBITMAP* = HANDLE
+  HBRUSH* = HANDLE
+  HCOLORSPACE* = HANDLE
+  HCONV* = HANDLE
+  HCONVLIST* = HANDLE
+  HCURSOR* = HANDLE
+  HDBC* = HANDLE
+  HDC* = HANDLE
+  HDDEDATA* = HANDLE
+  HDESK* = HANDLE
+  HDROP* = HANDLE
+  HDWP* = HANDLE
+  HENHMETAFILE* = HANDLE
+  HENV* = HANDLE
+  HFILE* = HANDLE
+  HFONT* = HANDLE
+  HGDIOBJ* = HANDLE
+  HGLOBAL* = HANDLE
+  HGLRC* = HANDLE
+  HHOOK* = HANDLE
+  HICON* = HANDLE
+  HIMAGELIST* = HANDLE
+  HINST* = HANDLE             # Not HINSTANCE, else it has problems with the var HInstance
+  HKEY* = HANDLE
+  HKL* = HANDLE
+  HLOCAL* = HANDLE
+  HMENU* = HANDLE
+  HMETAFILE* = HANDLE
+  HMODULE* = HANDLE
+  HPALETTE* = HANDLE
+  HPEN* = HANDLE
+  HRASCONN* = HANDLE
+  HRGN* = HANDLE
+  HRSRC* = HANDLE
+  HSTMT* = HANDLE
+  HSTR* = HANDLE
+  HSZ* = HANDLE
+  HWINSTA* = HANDLE
+  HWND* = HANDLE
+  HTASK* = HANDLE
+  LANGID* = int16
+  LCID* = DWORD
+  LCTYPE* = DWORD
+  LPARAM* = LONG_PTR
+  LP* = ptr int16
+  LPBOOL* = ptr WINBOOL
+  LPBYTE* = ptr int8
+  LPCCH* = cstring
+  LPCH* = cstring
+  LPCOLORREF* = ptr COLORREF
+  LPCSTR* = cstring
+  PWideChar* = ptr int16 # XXX
+  WideChar* = int16
+
+when defined(winUnicode):
+  type
+    LPCTSTR* = Pwidechar
+else:
+  type
+    LPCTSTR* = cstring
+type
+  LPCWCH* = Pwidechar
+  LPCWSTR* = Pwidechar
+  LPPCSTR* = ptr LPCSTR
+  LPPCTSTR* = ptr LPCTSTR
+  LPPCWSTR* = ptr LPCWSTR
+  LPDWORD* = ptr DWORD
+  LPHANDLE* = ptr HANDLE
+  LPINT* = ptr int32
+  LPLONG* = ptr int32
+  LPSTR* = cstring
+
+when defined(winUnicode):
+  type
+    LPTCH* = Pwidechar
+    LPTSTR* = Pwidechar
+else:
+  type
+    LPTCH* = cstring
+    LPTSTR* = cstring
+type
+  LRESULT* = LONG_PTR
+  LPVOID* = pointer
+  LPCVOID* = pointer
+  LPWCH* = Pwidechar
+  LPWORD* = ptr int16
+  LPWSTR* = Pwidechar
+  NWPSTR* = Pwidechar
+  PWINBOOL* = ptr WINBOOL
+  PBOOLEAN* = ptr int8
+  PBYTE* = ptr int8
+  PCCH* = cstring
+  PCH* = cstring
+  PCSTR* = cstring
+  PCWCH* = Pwidechar
+  PCWSTR* = Pwidechar
+  PDWORD* = ptr DWORD
+  PHANDLE* = ptr HANDLE
+  PHKEY* = ptr HKEY
+  PINT* = ptr int32
+  PLONG* = ptr int32
+  PSHORT* = ptr SHORT
+  PSTR* = cstring
+  PSZ* = cstring
+
+when defined(winUnicode):
+  type
+    PTBYTE* = ptr int16
+    PTCH* = Pwidechar
+    PTCHAR* = Pwidechar
+    PTSTR* = Pwidechar
+else:
+  type
+    PTBYTE* = ptr int8
+    PTCH* = cstring
+    PTCHAR* = cstring
+    PTSTR* = cstring
+type
+  PUCHAR* = ptr int8
+  PWCH* = Pwidechar
+  PWCHAR* = Pwidechar
+  PWORD* = ptr int16
+  PUINT* = ptr int
+  PULONG* = ptr int
+  PUSHORT* = ptr int16
+  PVOID* = pointer
+  RETCODE* = SHORT
+  SC_HANDLE* = HANDLE
+  SC_LOCK* = LPVOID
+  LPSC_HANDLE* = ptr SC_HANDLE
+  SERVICE_STATUS_HANDLE* = DWORD
+
+when defined(winUnicode):
+  type
+    TBYTE* = int16
+    TCHAR* = widechar
+    BCHAR* = int16
+else:
+  type
+    TBYTE* = int8
+    TCHAR* = char
+    BCHAR* = int8
+type
+  UCHAR* = int8
+  WCHAR* = WideChar
+  UINT* = int
+  ULONG* = int
+  USHORT* = int16
+  WPARAM* = LONG_PTR
+  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
+    TokenPrimary = 1, TokenImpersonation
+  MakeIntResourceA* = cstring
+  MakeIntResourceW* = PWideChar
+  MakeIntResource* = MakeIntResourceA
+
+proc GetBValue*(rgb: int32): int8
+proc GetGValue*(rgb: int32): int8
+proc GetRValue*(rgb: int32): int8
+proc RGB*(r, g, b: int32): DWORD
+proc HIBYTE*(w: int32): int8
+proc HIWORD*(L: int32): int16
+proc LOBYTE*(w: int32): int8
+proc LOWORD*(L: int32): int16
+proc MAKELONG*(a, b: int32): LONG
+proc MAKEWORD*(a, b: int32): int16
+proc SEXT_HIWORD*(L: int32): int32
+proc ZEXT_HIWORD*(L: int32): int32
+proc SEXT_LOWORD*(L: int32): int32
+proc INDEXTOOVERLAYMASK*(i: int32): int32
+proc INDEXTOSTATEIMAGEMASK*(i: int32): int32
+proc MAKEINTATOM*(i: int32): LPTSTR
+proc MAKELANGID*(p, s: int32): int32
+proc PRIMARYLANGID*(lgid: int32): int16
+proc SUBLANGID*(lgid: int32): int32
+proc LANGIDFROMLCID*(lcid: int32): int16
+proc SORTIDFROMLCID*(lcid: int32): int16
+proc MAKELCID*(lgid, srtid: int32): DWORD
+proc MAKELPARAM*(L, h: int32): LPARAM
+proc MAKELRESULT*(L, h: int32): LRESULT
+proc MAKEROP4*(fore, back: int32): DWORD
+proc MAKEWPARAM*(L, h: int32): WPARAM
+proc GET_X_LPARAM*(lp: Windows.LParam): int32
+proc GET_Y_LPARAM*(lp: Windows.LParam): int32
+proc PALETTEINDEX*(i: int32): COLORREF
+proc PALETTERGB*(r, g, b: int32): int32
+  #
+  #    Definitions for callback procedures
+  #
+type
+  BFFCALLBACK* = proc (para1: HWND, para2: UINT, para3: LPARAM, para4: LPARAM): int32{.
+      stdcall.}
+  LPCCHOOKPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM, para4: LPARAM): UINT{.
+      stdcall.}
+  LPCFHOOKPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM, para4: LPARAM): UINT{.
+      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: UINT, para3: WPARAM, para4: LPARAM): UINT{.
+      stdcall.}
+  LPOFNHOOKPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM, para4: LPARAM): UINT{.
+      stdcall.}
+  LPPRINTHOOKPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM,
+                           para4: LPARAM): UINT{.stdcall.}
+  LPSETUPHOOKPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM,
+                           para4: LPARAM): UINT{.stdcall.}
+  DLGPROC* = proc (para1: HWND, para2: UINT, para3: WPARAM, para4: LPARAM): LRESULT{.
+      stdcall.}
+  PFNPROPSHEETCALLBACK* = proc (para1: HWND, para2: UINT, 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: UINT, para3: WPARAM, para4: LPARAM): LRESULT{.
+      stdcall.}
+  FARPROC* = pointer
+  TFarProc* = FARPROC
+  TProc* = 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: UINT, para3: DWORD, para4: LRESULT){.
+      stdcall.}
+  TIMERPROC* = proc (para1: HWND, para2: UINT, para3: UINT, 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.}
+  TABORTPROC* = proc (para1: HDC, para2: int32): WINBOOL{.stdcall.}
+  LPPAGEPAINTHOOK* = proc (para1: HWND, para2: UINT, para3: WPARAM,
+                           para4: LPARAM): UINT{.stdcall.}
+  LPPAGESETUPHOOK* = proc (para1: HWND, para2: UINT, para3: WPARAM,
+                           para4: LPARAM): UINT{.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: UINT): UINT{.
+      stdcall.}
+  PFNRECONCILEPROFILE* = proc (para1: LPCTSTR, para2: LPCTSTR, para3: DWORD): UINT{.
+      stdcall.}
+  PFNPROCESSPOLICIES* = proc (para1: HWND, para2: LPCTSTR, para3: LPCTSTR,
+                              para4: LPCTSTR, para5: DWORD): WINBOOL{.stdcall.} #Not convertable by H2PAS
+                                                                                #  #define SECURITY_NULL_SID_AUTHORITY     {0,0,0,0,0,0}
+                                                                                #  #define SECURITY_WORLD_SID_AUTHORITY    {0,0,0,0,0,1}
+                                                                                #  #define SECURITY_LOCAL_SID_AUTHORITY    {0,0,0,0,0,2}
+                                                                                #  #define SECURITY_CREATOR_SID_AUTHORITY  {0,0,0,0,0,3}
+                                                                                #  #define SECURITY_NON_UNIQUE_AUTHORITY   {0,0,0,0,0,4}
+                                                                                #  #define SECURITY_NT_AUTHORITY           {0,0,0,0,0,5}
+                                                                                #
+
+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 = CALLB;
+  PFNCALLBACK* = proc (para1, para2: UINT, para3: HCONV, para4, para5: HSZ,
+                       para6: HDDEDATA, para7, para8: DWORD): HDDEData{.stdcall.} #
+                                                                                  # CALLB
+                                                                                  # =
+                                                                                  # procedure
+                                                                                  # ;CDECL;
+  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 #ERROR_NO_BROWSER_SERVERS_FOUND              = 6118; already above
+  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) # was #define dname def_expr
+
+proc UNICODE_NULL*(): WCHAR
+const
+  MAX_PATH* = 260
+  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 # BrowseCallbackProc
+                                     # 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        # ChangeDisplaySettings
+  DM_BITSPERPEL* = 0x00040000
+  DM_PELSWIDTH* = 0x00080000
+  DM_PELSHEIGHT* = 0x00100000
+  DM_DISPLAYFLAGS* = 0x00200000
+  DM_DISPLAYFREQUENCY* = 0x00400000
+  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_STATUS structure
+  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            # ChooseMatchToTarget
+                              # 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 & pipe
+  FILE_READ_DATA* = 0x00000001 # directory
+  FILE_LIST_DIRECTORY* = 0x00000001 # file & pipe
+  FILE_WRITE_DATA* = 0x00000002 # directory
+  FILE_ADD_FILE* = 0x00000002 # file
+  FILE_APPEND_DATA* = 0x00000004 # directory
+  FILE_ADD_SUBDIRECTORY* = 0x00000004 # named pipe
+  FILE_CREATE_PIPE_INSTANCE* = 0x00000004 # file & directory
+  FILE_READ_EA* = 0x00000008
+  FILE_READ_PROPERTIES* = FILE_READ_EA # file & directory
+  FILE_WRITE_EA* = 0x00000010
+  FILE_WRITE_PROPERTIES* = FILE_WRITE_EA # file
+  FILE_EXECUTE* = 0x00000020  # directory
+  FILE_TRAVERSE* = 0x00000020 # directory
+  FILE_DELETE_CHILD* = 0x00000040 # all
+  FILE_READ_ATTRIBUTES* = 0x00000080 # all
+  FILE_WRITE_ATTRIBUTES* = 0x00000100 # displaced lower
+                                      #  #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF)
+                                      #
+                                      #  #define FILE_GENERIC_READ         (STANDARD_RIGHTS_READ     |\
+                                      #                                     FILE_READ_DATA           |\
+                                      #                                     FILE_READ_ATTRIBUTES     |\
+                                      #                                     FILE_READ_EA             |\
+                                      #                                     SYNCHRONIZE)
+                                      #
+                                      #
+                                      #  #define FILE_GENERIC_WRITE        (STANDARD_RIGHTS_WRITE    |\
+                                      #                                     FILE_WRITE_DATA          |\
+                                      #                                     FILE_WRITE_ATTRIBUTES    |\
+                                      #                                     FILE_WRITE_EA            |\
+                                      #                                     FILE_APPEND_DATA         |\
+                                      #                                     SYNCHRONIZE)
+                                      #
+                                      #
+                                      #  #define FILE_GENERIC_EXECUTE      (STANDARD_RIGHTS_EXECUTE  |\
+                                      #                                     FILE_READ_ATTRIBUTES     |\
+                                      #                                     FILE_EXECUTE             |\
+                                      #                                     SYNCHRONIZE)
+                                      #
+  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      # already defined above !!
+                              #  #define LR_MONOCHROME (1)
+                              #
+                              # 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 # already defined above !!
+                                        #  #define SERVICE_WIN32_OWN_PROCESS     (16)
+                                        #  #define SERVICE_WIN32_SHARE_PROCESS   (32)
+                                        #  #define SERVICE_KERNEL_DRIVER (1)
+                                        #  #define SERVICE_FILE_SYSTEM_DRIVER    (2)
+                                        #  #define SERVICE_INTERACTIVE_PROCESS   (256)
+                                        #  #define SERVICE_BOOT_START    (0)
+                                        #  #define SERVICE_SYSTEM_START  (1)
+                                        #  #define SERVICE_AUTO_START    (2)
+                                        #  #define SERVICE_DEMAND_START  (3)
+                                        #  #define SERVICE_DISABLED      (4)
+                                        #
+  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        # already defined above !!
+                              #  #define WH_MSGFILTER  (-1)
+  WH_FOREGROUNDIDLE* = 11     # DefineDosDevice
+  DDD_RAW_TARGET_PATH* = 1
+  DDD_REMOVE_DEFINITION* = 2
+  DDD_EXACT_MATCH_ON_REMOVE* = 4 # DeviceCapbilities
+  DC_BINNAMES* = 12
+  DC_BINS* = 6
+  DC_COPIES* = 18
+  DC_DRIVER* = 11
+  DC_DATATYPE_PRODUCED* = 21
+  DC_DUPLEX* = 7
+  DC_EMF_COMPLIANT* = 20
+  DC_ENUMRESOLUTIONS* = 13
+  DC_EXTRA* = 9
+  DC_FIELDS* = 1
+  DC_FILEDEPENDENCIES* = 14
+  DC_MAXEXTENT* = 5
+  DC_MINEXTENT* = 4
+  DC_ORIENTATION* = 17
+  DC_PAPERNAMES* = 16
+  DC_PAPERS* = 2
+  DC_PAPERSIZE* = 3
+  DC_SIZE* = 8
+  DC_TRUETYPE* = 15
+  DCTT_BITMAP* = 0x00000001
+  DCTT_DOWNLOAD* = 0x00000002
+  DCTT_SUBDEV* = 0x00000004
+  DC_VERSION* = 10
+  DC_BINADJUST* = 19          # already defined above !!
+                              #  #define DC_DATATYPE_PRODUCED  (21)
+                              #
+                              # DeviceIoControl
+                              # 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      # DocumentProperties
+  DM_IN_BUFFER* = 8
+  DM_MODIFY* = 8
+  DM_IN_PROMPT* = 4
+  DM_PROMPT* = 4
+  DM_OUT_BUFFER* = 2
+  DM_COPY* = 2
+  DM_UPDATE* = 1              # 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
+  DATE_SHORTDATE* = 1
+  DATE_LONGDATE* = 2          # 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         # EnumPrinters
+                              # EnumProtocols
+                              # EnumResLangProc
+                              #
+                              # 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) # EnumServicesStatus
+
+const
+  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               # GetDateFormat
+                              # already defined above !!
+                              #  #define DATE_SHORTDATE        (1)
+                              #  #define DATE_LONGDATE (2)
+                              #
+  DATE_USE_ALT_CALENDAR* = 4  # 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             # already defined above !!
+                              #  #define PHYSICALWIDTH (110)
+                              #  #define PHYSICALHEIGHT        (111)
+                              #  #define PHYSICALOFFSETX       (112)
+                              #  #define PHYSICALOFFSETY       (113)
+                              #  #define SCALINGFACTORX        (114)
+                              #  #define SCALINGFACTORY        (115)
+                              #
+  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
+                                      # was #define dname def_expr
+
+proc IDC_ARROW*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_IBEAM*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_WAIT*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_CROSS*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_UPARROW*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZENWSE*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZENESW*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZEWE*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZENS*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZEALL*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_NO*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_APPSTARTING*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_HELP*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_APPLICATION*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_HAND*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_QUESTION*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_EXCLAMATION*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_ASTERISK*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDI_WINLOGO*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_SIZE*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_ICON*(): LPTSTR
+  # return type might be wrong
+  # was #define dname def_expr
+proc IDC_HAND*(): LPTSTR
+  # return type might be wrong
+  # GetMapMode
+const
+  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
+                              # was #define dname def_expr
+
+proc STD_INPUT_HANDLE*(): DWORD
+  # was #define dname def_expr
+proc STD_OUTPUT_HANDLE*(): DWORD
+  # was #define dname def_expr
+proc STD_ERROR_HANDLE*(): DWORD
+  # was #define dname def_expr
+const
+  INVALID_HANDLE_VALUE* = HANDLE(- 1) # GetStockObject
+
+const
+  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 # GetTimeZoneInformation
+                              # was #define dname def_expr
+
+const
+  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
+                                      # was #define dname def_expr
+
+proc HWND_BROADCAST*(): HWND
+  # PrepareTape
+const
+  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
+                              # was #define dname def_expr
+
+proc HKEY_CLASSES_ROOT*(): HKEY
+  # was #define dname def_expr
+proc HKEY_CURRENT_USER*(): HKEY
+  # was #define dname def_expr
+proc HKEY_LOCAL_MACHINE*(): HKEY
+  # was #define dname def_expr
+proc HKEY_USERS*(): HKEY
+  # was #define dname def_expr
+proc HKEY_PERFORMANCE_DATA*(): HKEY
+  # was #define dname def_expr
+proc HKEY_CURRENT_CONFIG*(): HKEY
+  # was #define dname def_expr
+proc HKEY_DYN_DATA*(): HKEY
+  # RegCreateKeyEx
+const
+  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
+                                 # was #define dname def_expr
+
+proc HWND_BOTTOM*(): HWND
+  # was #define dname def_expr
+proc HWND_NOTOPMOST*(): HWND
+  # was #define dname def_expr
+proc HWND_TOP*(): HWND
+  # was #define dname def_expr
+proc HWND_TOPMOST*(): HWND
+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* = 0xFFFFFFFF      # 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
+                              # was #define dname def_expr
+
+proc VS_FILE_INFO*(): LPTSTR
+  # return type might be wrong
+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
+  DM_ORIENTATION* = 0x00000001
+  DM_PAPERSIZE* = 0x00000002
+  DM_PAPERLENGTH* = 0x00000004
+  DM_PAPERWIDTH* = 0x00000008
+  DM_SCALE* = 0x00000010
+  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 = $40000;
+                              #     DM_PELSWIDTH = $80000;
+                              #     DM_PELSHEIGHT = $100000;
+                              #     DM_DISPLAYFLAGS = $200000;
+                              #     DM_DISPLAYFREQUENCY = $400000;already above
+  DM_ICMMETHOD* = 0x00800000
+  DM_ICMINTENT* = 0x01000000
+  DM_MEDIATYPE* = 0x02000000
+  DM_DITHERTYPE* = 0x04000000
+  DMORIENT_LANDSCAPE* = 2
+  DMORIENT_PORTRAIT* = 1
+  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
+  DMRES_HIGH* = - (4)
+  DMRES_MEDIUM* = - (3)
+  DMRES_LOW* = - (2)
+  DMRES_DRAFT* = - (1)
+  DMCOLOR_COLOR* = 2
+  DMCOLOR_MONOCHROME* = 1
+  DMDUP_SIMPLEX* = 1
+  DMDUP_HORIZONTAL* = 3
+  DMDUP_VERTICAL* = 2
+  DMTT_BITMAP* = 1
+  DMTT_DOWNLOAD* = 2
+  DMTT_SUBDEV* = 3
+  DMCOLLATE_TRUE* = 1
+  DMCOLLATE_FALSE* = 0
+  DM_GRAYSCALE* = 1
+  DM_INTERLACED* = 2
+  DMICMMETHOD_NONE* = 1
+  DMICMMETHOD_SYSTEM* = 2
+  DMICMMETHOD_DRIVER* = 3
+  DMICMMETHOD_DEVICE* = 4
+  DMICMMETHOD_USER* = 256
+  DMICM_SATURATE* = 1
+  DMICM_CONTRAST* = 2
+  DMICM_COLORMETRIC* = 3
+  DMICM_USER* = 256
+  DMMEDIA_STANDARD* = 1
+  DMMEDIA_GLOSSY* = 3
+  DMMEDIA_TRANSPARENCY* = 2
+  DMMEDIA_USER* = 256
+  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 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" # Common control styles
+  CCS_ADJUSTABLE* = 0x00000020
+  CCS_BOTTOM* = 0x00000003
+  CCS_NODIVIDER* = 0x00000040
+  CCS_NOMOVEY* = 0x00000002
+  CCS_NOPARENTALIGN* = 0x00000008
+  CCS_NORESIZE* = 0x00000004
+  CCS_TOP* = 0x00000001
+  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
+# winUnicode
+# Header control styles
+
+const
+  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
+                              # was #define dname def_expr
+
+proc HINST_COMMCTRL*(): HINST
+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 # was #define dname def_expr
+
+proc LPSTR_TEXTCALLBACKW*(): LPWSTR
+  # was #define dname def_expr
+proc LPSTR_TEXTCALLBACKA*(): LPSTR
+when defined(winUnicode):
+  proc LPSTR_TEXTCALLBACK*(): LPWSTR
+else:
+  proc LPSTR_TEXTCALLBACK*(): LPSTR
+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
+                              # added manually PM, TREEITEM is not defined in the C headers
+
+type
+  TREEITEM* = record
+  HTREEITEM* = ptr TREEITEM
+  TTREEITEM* = TREEITEM
+  PTREEITEM* = ptr TREEITEM   # was #define dname def_expr
+
+proc TVI_ROOT*(): HTREEITEM
+  # was #define dname def_expr
+proc TVI_FIRST*(): HTREEITEM
+  # was #define dname def_expr
+proc TVI_LAST*(): HTREEITEM
+  # was #define dname def_expr
+proc TVI_SORT*(): HTREEITEM
+  # TV_HITTESTINFO structure
+const
+  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 # 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
+# LBSELCHSTRING message
+
+const
+  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
+                              # was #define dname def_expr
+
+proc HWND_DESKTOP*(): HWND
+  # WM_SYSCOMMAND message
+const
+  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      # LAYERPLANEDESCRIPTOR structure
+                              # PIXELFORMATDESCRIPTOR structure
+  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 # TEXTMETRIC structure
+  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:
+                     #  Not convertable by H2PAS
+                     #  #define CRACK_VOID_F(fn,args) (void)(fn args)
+                     #  #define CRACK_BOOL_F(fn,args) (WINBOOL)(fn args)
+                     #  #define CRACK_HMENU_F(fn,args) (HMENU)(fn args)
+                     #  #define CRACK_HWND_F(fn,args) (HWND)(fn args)
+                     #  #define CRACK_LONG_F(fn, args) (LRESULT)(fn args)
+                     #  #define CRACK_ZERO_F(fn, args)  (fn args,0)
+                     #
+                     # 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
+  #  #define FORWARD_WM_CLOSE(h, fn)                 CRACK_VOID_F(fn,(h, WM_CLOSE, 0, 0))
+  #  #define FORWARD_WM_COMMAND(h, id, c, n, fn)     CRACK_VOID_F(fn,(h, WM_COMMAND, MAKEWPARAM(id,n), (LPARAM)c))
+  #  #define FORWARD_WM_CREATE(h, p, fn)             CRACK_BOOL_F(fn,(h, WM_CREATE, 0, (LPARAM)p))
+  #  #define FORWARD_WM_DESTROY(h, fn)               CRACK_VOID_F(fn,(h, WM_DESTROY, 0, 0))
+  #  #define FORWARD_WM_ENABLE(h, e, fn)             CRACK_VOID_F(fn,(h, WM_ENABLE, (WPARAM)e, 0))
+  #  #define FORWARD_WM_INITDIALOG(h, c, L, fn)      CRACK_BOOL_F(fn,(h, WM_INITDIALOG, (WPARAM)c, L))
+  #  #define FORWARD_WM_MDICASCADE(h, c, fn)         CRACK_BOOL_F(fn,(h, WM_MDICASCADE, (WPARAM)c, 0))
+  #  #define FORWARD_WM_MDIDESTROY(h, d, fn)         CRACK_VOID_F(fn,(h, WM_MDIDESTROY, (WPARAM)d, 0))
+  #  #define FORWARD_WM_MDIGETACTIVE(h, fn)          CRACK_HWND_F(fn,(h, WM_MDIGETACTIVE, 0, 0))
+  #  #define FORWARD_WM_MDIICONARRANGE(h, fn)        CRACK_VOID_F(fn,(h, WM_MDIICONARRANGE, 0, 0))
+  #  #define FORWARD_WM_MDISETMENU(h, fr, hf, hw, fn) CRACK_HMENU_F(fn,(h, WM_MDISETMENU, (WPARAM)((fr) ? (hf) : 0), (LPARAM)(hw)))
+  #  #define FORWARD_WM_MDITILE(h, c, fn)            CRACK_BOOL_F(fn,(h, WM_MDITILE, (WPARAM)(c), 0))
+  #  #define FORWARD_WM_PAINT(h, fn)                 CRACK_VOID_F(fn,(h, WM_PAINT, 0, 0))
+  #  #define FORWARD_WM_QUERYENDSESSION(h, fn)       CRACK_BOOL_F(fn,(h, WM_QUERYENDSESSION, 0, 0))
+  #  #define FORWARD_WM_SIZE(h, state, cx, cy, fn)   CRACK_VOID_F(fn,(h, WM_SIZE, (WPARAM)state, MAKELPARAM(cx, cy)))
+  #  #define FORWARD_WM_SYSCOMMAND(h, c, x, y, fn)   CRACK_VOID_F(fn,(h, WM_SYSCOMMAND, (WPARAM)c, MAKELPARAM(x, y)))
+  #
+  #  #define HANDLE_WM_CLOSE(h, w, L, fn)            CRACK_ZERO_F(fn,(h));
+  #  #define HANDLE_WM_COMMAND(h, w, L, fn)          CRACK_ZERO_F(fn,(h, SEXT_LOWORD(w), (HWND)L, HIWORD(w)))
+  #  #define HANDLE_WM_CREATE(h, w, L, fn)           (LRESULT)((fn(h, (CREATESTRUCT  )L)) ? 0 : -1)
+  #  #define HANDLE_WM_DESTROY(h, w, L, fn)          CRACK_ZERO_F(fn,(h))
+  #  #define HANDLE_WM_ENABLE(h, w, L, fn)           CRACK_ZERO_F(fn,(h, (WINBOOL)w))
+  #  #define HANDLE_WM_INITDIALOG(h, w, L, fn)       CRACK_LONG_F(fn,(h, (HWND)w, L))
+  #  #define HANDLE_WM_MDICASCADE(h, w, L, fn)       CRACK_LONG_F(fn, (h, (UINT)w)
+  #  #define HANDLE_WM_MDIDESTROY(h, w, L, fn)       CRACK_ZERO_F(fn,(h, (HWND)w))
+  #  #define HANDLE_WM_MDIGETACTIVE(h, w, L, fn)     CRACK_LONG_F(fn,(h))
+  #  #define HANDLE_WM_MDIICONARRANGE(h, w, L, fn)   CRACK_ZERO_F(fn,(h))
+  #  #define HANDLE_WM_MDISETMENU(h, w, L, fn)       CRACK_LONG_F(fn,(h, (WINBOOL)w, (HMENU)w, (HMENU)L)
+  #  #define HANDLE_WM_MDITILE(h, w, L, fn)          CRACK_LONG_F(fn,(h, (UINT)w))
+  #  #define HANDLE_WM_PAINT(h, w, L, fn)            CRACK_ZERO_F(fn,(h))
+  #  #define HANDLE_WM_QUERYENDSESSION(h, w, L, fn)  MAKELRESULT(fn(h), 0)
+  #  #define HANDLE_WM_SIZE(h, w, L, fn)             CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(L), SEXT_HIWORD(L)))
+  #  #define HANDLE_WM_SYSCOMMAND(h, w, L, fn)       CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(L), SEXT_HIWORD(L)))
+  #
+  # Totally disgusting! get wParam and lParam from the environment !
+  #  Not convertable by H2PAS
+  #  #define HANDLE_MSG(h, message, fn) case message: return HANDLE_##message(h, wParam, lParam, fn)
+  #
+  # END OF windowsx.h stuff from old headers
+  # ------------------------------------------------------------------
+  # BEGINNING of shellapi.h stuff from old headers
+const
+  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
+
+# was #define dname(params) def_expr
+
+proc FreeModule*(h: HINST): WINBOOL
+  # was #define dname(params) def_expr
+  # argument types are unknown
+  # return type might be wrong
+proc MakeProcInstance*(p, i: int32): int32
+  # return type might be wrong
+  # was #define dname(params) def_expr
+  # argument types are unknown
+  # return type might be wrong
+proc FreeProcInstance*(p: int32): int32
+  # return type might be wrong
+const                         # _fmemcpy = memcpy; these are functions
+                              # Used by wxwindows.
+  SIZEFULLSCREEN* = SIZE_MAXIMIZED
+  SIZENORMAL* = SIZE_RESTORED
+  SIZEICONIC* = SIZE_MINIMIZED # NPLOGPALETTE = PLOGPALETTE; probably a type
+                               # In the old winnt.h
+                               #  Not convertable by H2PAS anyhow with if 0
+                               #  #if 0
+                               #  #ifdef ANAL
+                               #  #define DECLARE_HANDLE(h) struct h## { int dummy; }; typedef struct h##  h
+                               #  #else
+                               #  #define DECLARE_HANDLE(h)  typedef void  h
+                               #  #endif
+                               #  DECLARE_HANDLE(HANDLE);
+                               #  #endif
+                               #
+
+const
+  EXCEPTION_READ_FAULT* = 0   # Access violation was caused by a read
+  EXCEPTION_WRITE_FAULT* = 1  # Access violation was caused by a write
+
+when defined(cpuia64):
+  const
+    EXCEPTION_EXECUTE_FAULT* = 2 # Access violation was caused by an instruction fetch
+else:
+  const
+    EXCEPTION_EXECUTE_FAULT* = 8
+when defined(cpupowerpc32):
+  # 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 defined(cpui386):
+  # 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 defined(cpux86_64):
+  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   # Define the facility codes
+
+const
+  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* = record
+    abcA*: int32
+    abcB*: UINT
+    abcC*: int32
+
+  LPABC* = ptr ABC
+  TABC* = ABC
+  PABC* = ptr ABC
+  ABCFLOAT* = record
+    abcfA*: float32
+    abcfB*: float32
+    abcfC*: float32
+
+  LPABCFLOAT* = ptr ABCFLOAT
+  TABCFLOAT* = ABCFLOAT
+  PABCFLOAT* = ptr ABCFLOAT
+  ACCEL* = record
+    fVirt*: int8
+    key*: int16
+    cmd*: int16
+
+  LPACCEL* = ptr ACCEL
+  TACCEL* = ACCEL
+  PACCEL* = ptr ACCEL
+  ACE_HEADER* = record
+    AceType*: int8
+    AceFlags*: int8
+    AceSize*: int16
+
+  TACE_HEADER* = ACE_HEADER
+  PACE_HEADER* = ptr ACE_HEADER
+  ACCESS_MASK* = DWORD
+  REGSAM* = ACCESS_MASK
+  ACCESS_ALLOWED_ACE* = record
+    Header*: ACE_HEADER
+    Mask*: ACCESS_MASK
+    SidStart*: DWORD
+
+  TACCESS_ALLOWED_ACE* = ACCESS_ALLOWED_ACE
+  PACCESS_ALLOWED_ACE* = ptr ACCESS_ALLOWED_ACE
+  ACCESS_DENIED_ACE* = record
+    Header*: ACE_HEADER
+    Mask*: ACCESS_MASK
+    SidStart*: DWORD
+
+  TACCESS_DENIED_ACE* = ACCESS_DENIED_ACE
+  ACCESSTIMEOUT* = record
+    cbSize*: UINT
+    dwFlags*: DWORD
+    iTimeOutMSec*: DWORD
+
+  TACCESSTIMEOUT* = ACCESSTIMEOUT
+  PACCESSTIMEOUT* = ptr ACCESSTIMEOUT
+  ACL* = record
+    AclRevision*: int8
+    Sbz1*: int8
+    AclSize*: int16
+    AceCount*: int16
+    Sbz2*: int16
+
+  PACL* = ptr ACL
+  TACL* = ACL
+  TACL_REVISION_INFORMATION* = record
+    AclRevision*: DWORD
+  PACLREVISIONINFORMATION* = ptr TACL_REVISION_INFORMATION
+
+  TACL_SIZE_INFORMATION* = record
+    AceCount*: DWORD
+    AclBytesInUse*: DWORD
+    AclBytesFree*: DWORD
+  PACLSIZEINFORMATION* = ptr TACL_SIZE_INFORMATION
+  ACTION_HEADER* = record
+    transport_id*: ULONG
+    action_code*: USHORT
+    reserved*: USHORT
+
+  TACTIONHEADER* = ACTION_HEADER
+  PACTIONHEADER* = ptr ACTION_HEADER
+  ADAPTER_STATUS* = record
+    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
+
+  TADAPTERSTATUS* = ADAPTER_STATUS
+  PADAPTERSTATUS* = ptr ADAPTER_STATUS
+  ADDJOB_INFO_1* = record
+    Path*: LPTSTR
+    JobId*: DWORD
+
+  TADDJOB_INFO_1* = ADDJOB_INFO_1
+  PADDJOB_INFO_1* = ptr ADDJOB_INFO_1
+  ANIMATIONINFO* = record
+    cbSize*: UINT
+    iMinAnimate*: int32
+
+  LPANIMATIONINFO* = ptr ANIMATIONINFO
+  TANIMATIONINFO* = ANIMATIONINFO
+  PANIMATIONINFO* = ptr ANIMATIONINFO
+  POINT* = record
+    x*: LONG
+    y*: LONG
+
+  LPPOINT* = ptr POINT
+  TPOINT* = POINT
+  PPOINT* = ptr POINT
+  RECT* = record
+    TopLeft*, BottomRight*: TPoint
+
+  LPRECT* = ptr RECT
+  TRECT* = RECT
+  PRECT* = ptr RECT
+  RECTL* = record
+    left*: LONG
+    top*: LONG
+    right*: LONG
+    bottom*: LONG
+
+  TRECTL* = RECTL
+  PRECTL* = ptr RECTL
+  APPBARDATA* = record
+    cbSize*: DWORD
+    hWnd*: HWND
+    uCallbackMessage*: UINT
+    uEdge*: UINT
+    rc*: RECT
+    lParam*: LPARAM
+
+  TAppBarData* = APPBARDATA
+  PAppBarData* = ptr APPBARDATA
+  BITMAP* = record
+    bmType*: LONG
+    bmWidth*: LONG
+    bmHeight*: LONG
+    bmWidthBytes*: LONG
+    bmPlanes*: int16
+    bmBitsPixel*: int16
+    bmBits*: LPVOID
+
+  PBITMAP* = ptr BITMAP
+  NPBITMAP* = ptr BITMAP
+  LPBITMAP* = ptr BITMAP
+  tagBITMAP* = BITMAP
+  TBITMAP* = BITMAP
+  BITMAPCOREHEADER* = record
+    bcSize*: DWORD
+    bcWidth*: int16
+    bcHeight*: int16
+    bcPlanes*: int16
+    bcBitCount*: int16
+
+  TBITMAPCOREHEADER* = BITMAPCOREHEADER
+  PBITMAPCOREHEADER* = ptr BITMAPCOREHEADER
+  RGBTRIPLE* = record
+    rgbtBlue*: int8
+    rgbtGreen*: int8
+    rgbtRed*: int8
+
+  TRGBTRIPLE* = RGBTRIPLE
+  PRGBTRIPLE* = ptr RGBTRIPLE
+  BITMAPCOREINFO* = record
+    bmciHeader*: BITMAPCOREHEADER
+    bmciColors*: array[0..0, RGBTRIPLE]
+
+  PBITMAPCOREINFO* = ptr BITMAPCOREINFO
+  LPBITMAPCOREINFO* = ptr BITMAPCOREINFO
+  TBITMAPCOREINFO* = BITMAPCOREINFO # error
+                                    #  WORD    bfReserved1;
+                                    #  WORD    bfReserved2;
+                                    # in declarator_list
+  BITMAPINFOHEADER* = record
+    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
+  TBITMAPINFOHEADER* = BITMAPINFOHEADER
+  PBITMAPINFOHEADER* = ptr BITMAPINFOHEADER
+  RGBQUAD* = record
+    rgbBlue*: int8
+    rgbGreen*: int8
+    rgbRed*: int8
+    rgbReserved*: int8
+
+  tagRGBQUAD* = RGBQUAD
+  TRGBQUAD* = RGBQUAD
+  PRGBQUAD* = ptr RGBQUAD
+  BITMAPINFO* = record
+    bmiHeader*: BITMAPINFOHEADER
+    bmiColors*: array[0..0, RGBQUAD]
+
+  LPBITMAPINFO* = ptr BITMAPINFO
+  PBITMAPINFO* = ptr BITMAPINFO
+  TBITMAPINFO* = BITMAPINFO
+  FXPT2DOT30* = int32
+  LPFXPT2DOT30* = ptr FXPT2DOT30
+  TPFXPT2DOT30* = FXPT2DOT30
+  PPFXPT2DOT30* = ptr FXPT2DOT30
+  CIEXYZ* = record
+    ciexyzX*: FXPT2DOT30
+    ciexyzY*: FXPT2DOT30
+    ciexyzZ*: FXPT2DOT30
+
+  tagCIEXYZ* = CIEXYZ
+  LPCIEXYZ* = ptr CIEXYZ
+  TPCIEXYZ* = CIEXYZ
+  PCIEXYZ* = ptr CIEXYZ
+  CIEXYZTRIPLE* = record
+    ciexyzRed*: CIEXYZ
+    ciexyzGreen*: CIEXYZ
+    ciexyzBlue*: CIEXYZ
+
+  tagCIEXYZTRIPLE* = CIEXYZTRIPLE
+  LPCIEXYZTRIPLE* = ptr CIEXYZTRIPLE
+  TCIEXYZTRIPLE* = CIEXYZTRIPLE
+  PCIEXYZTRIPLE* = ptr CIEXYZTRIPLE
+  BITMAPV4HEADER* = record
+    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
+  TBITMAPV4HEADER* = BITMAPV4HEADER
+  PBITMAPV4HEADER* = ptr BITMAPV4HEADER
+  BITMAPFILEHEADER* = record
+    bfType*: int16
+    bfSize*: DWord
+    bfReserved1*: int16
+    bfReserved2*: int16
+    bfOffBits*: DWord
+
+  BLOB* = record
+    cbSize*: ULONG
+    pBlobData*: ptr int8
+
+  TBLOB* = BLOB
+  PBLOB* = ptr BLOB
+  SHITEMID* = record
+    cb*: USHORT
+    abID*: array[0..0, int8]
+
+  LPSHITEMID* = ptr SHITEMID
+  LPCSHITEMID* = ptr SHITEMID
+  TSHITEMID* = SHITEMID
+  PSHITEMID* = ptr SHITEMID
+  ITEMIDLIST* = record
+    mkid*: SHITEMID
+
+  LPITEMIDLIST* = ptr ITEMIDLIST
+  LPCITEMIDLIST* = ptr ITEMIDLIST
+  TITEMIDLIST* = ITEMIDLIST
+  PITEMIDLIST* = ptr ITEMIDLIST
+  BROWSEINFO* = record
+    hwndOwner*: HWND
+    pidlRoot*: LPCITEMIDLIST
+    pszDisplayName*: LPSTR
+    lpszTitle*: LPCSTR
+    ulFlags*: UINT
+    lpfn*: BFFCALLBACK
+    lParam*: LPARAM
+    iImage*: int32
+
+  LPBROWSEINFO* = ptr BROWSEINFO
+  Tbrowseinfo* = BROWSEINFO
+  PBROWSEINFO* = ptr BROWSEINFO
+  FILETIME* = record
+    dwLowDateTime*: DWORD
+    dwHighDateTime*: DWORD
+
+  LPFILETIME* = ptr FILETIME
+  TFILETIME* = FILETIME
+  PFILETIME* = ptr FILETIME
+  BY_HANDLE_FILE_INFORMATION* = record
+    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
+  TBYHANDLEFILEINFORMATION* = BY_HANDLE_FILE_INFORMATION
+  PBYHANDLEFILEINFORMATION* = ptr BY_HANDLE_FILE_INFORMATION
+  FIXED* = record
+    fract*: int16
+    value*: SHORT
+
+  TFIXED* = FIXED
+  PFIXED* = ptr FIXED
+  POINTFX* = record
+    x*: FIXED
+    y*: FIXED
+
+  TPOINTFX* = POINTFX
+  PPOINTFX* = ptr POINTFX
+  POINTL* = record
+    x*: LONG
+    y*: LONG
+
+  TPOINTL* = POINTL
+  PPOINTL* = ptr POINTL
+  TSmallPoint* = record
+    X*, Y*: SHORT
+
+  POINTS* = record
+    x*: SHORT
+    y*: SHORT
+
+  TPOINTS* = POINTS
+  PPOINTS* = ptr POINTS
+  CANDIDATEFORM* = record
+    dwIndex*: DWORD
+    dwStyle*: DWORD
+    ptCurrentPos*: POINT
+    rcArea*: RECT
+
+  LPCANDIDATEFORM* = ptr CANDIDATEFORM
+  TCANDIDATEFORM* = CANDIDATEFORM
+  PCANDIDATEFORM* = ptr CANDIDATEFORM
+  CANDIDATELIST* = record
+    dwSize*: DWORD
+    dwStyle*: DWORD
+    dwCount*: DWORD
+    dwSelection*: DWORD
+    dwPageStart*: DWORD
+    dwPageSize*: DWORD
+    dwOffset*: array[0..0, DWORD]
+
+  LPCANDIDATELIST* = ptr CANDIDATELIST
+  TCANDIDATELIST* = CANDIDATELIST
+  PCANDIDATELIST* = ptr CANDIDATELIST
+  CREATESTRUCT* = record
+    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
+  TCREATESTRUCT* = CREATESTRUCT
+  PCREATESTRUCT* = ptr CREATESTRUCT
+  CBT_CREATEWND* = record
+    lpcs*: LPCREATESTRUCT
+    hwndInsertAfter*: HWND
+
+  TCBT_CREATEWND* = CBT_CREATEWND
+  PCBT_CREATEWND* = ptr CBT_CREATEWND
+  CBTACTIVATESTRUCT* = record
+    fMouse*: WINBOOL
+    hWndActive*: HWND
+
+  TCBTACTIVATESTRUCT* = CBTACTIVATESTRUCT
+  PCBTACTIVATESTRUCT* = ptr CBTACTIVATESTRUCT
+  CHAR_INFO* = record
+    UnicodeChar*: WCHAR
+    Attributes*: int16        # other union part: AsciiChar : CHAR
+
+  TCHAR_INFO* = CHAR_INFO
+  PCHAR_INFO* = ptr CHAR_INFO
+  CHARFORMAT* = record
+    cbSize*: UINT
+    dwMask*: DWORD
+    dwEffects*: DWORD
+    yHeight*: LONG
+    yOffset*: LONG
+    crTextColor*: COLORREF
+    bCharSet*: int8
+    bPitchAndFamily*: int8
+    szFaceName*: array[0..(LF_FACESIZE) - 1, TCHAR]
+
+  Tcharformat* = CHARFORMAT
+  Pcharformat* = ptr CHARFORMAT
+  CHARRANGE* = record
+    cpMin*: LONG
+    cpMax*: LONG
+
+  Tcharrange* = CHARRANGE
+  Pcharrange* = ptr CHARRANGE
+  CHARSET* = record
+    aflBlock*: array[0..2, DWORD]
+    flLang*: DWORD
+
+  TCHARSET* = CHARSET
+  PCHARSET* = ptr CHARSET
+  FONTSIGNATURE* = record
+    fsUsb*: array[0..3, DWORD]
+    fsCsb*: array[0..1, DWORD]
+
+  LPFONTSIGNATURE* = ptr FONTSIGNATURE
+  tagFONTSIGNATURE* = FONTSIGNATURE
+  TFONTSIGNATURE* = FONTSIGNATURE
+  PFONTSIGNATURE* = ptr FONTSIGNATURE
+  CHARSETINFO* = record
+    ciCharset*: UINT
+    ciACP*: UINT
+    fs*: FONTSIGNATURE
+
+  LPCHARSETINFO* = ptr CHARSETINFO
+  TCHARSETINFO* = CHARSETINFO
+  PCHARSETINFO* = ptr CHARSETINFO #CHOOSECOLOR = record confilcts with function ChooseColor
+  TCHOOSECOLOR* = record
+    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* = record
+    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, TCHAR]
+
+  LPLOGFONT* = ptr LOGFONT
+  TLOGFONT* = LOGFONT
+  TLOGFONTA* = LOGFONT
+  PLOGFONT* = ptr LOGFONT
+  PLOGFONTA* = PLOGFONT
+  LOGFONTW* = record
+    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
+  TLogFontW* = LOGFONTW
+  PLogFontW* = ptr TLogFontW
+  TCHOOSEFONT* = record
+    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* = record
+    cidl*: UINT
+    aoffset*: array[0..0, UINT]
+
+  LPIDA* = ptr CIDA
+  TIDA* = CIDA
+  PIDA* = ptr CIDA
+  CLIENTCREATESTRUCT* = record
+    hWindowMenu*: HANDLE
+    idFirstChild*: UINT
+
+  LPCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT
+  tagCLIENTCREATESTRUCT* = CLIENTCREATESTRUCT
+  TCLIENTCREATESTRUCT* = CLIENTCREATESTRUCT
+  PCLIENTCREATESTRUCT* = ptr CLIENTCREATESTRUCT
+  CMINVOKECOMMANDINFO* = record
+    cbSize*: DWORD
+    fMask*: DWORD
+    hwnd*: HWND
+    lpVerb*: LPCSTR
+    lpParameters*: LPCSTR
+    lpDirectory*: LPCSTR
+    nShow*: int32
+    dwHotKey*: DWORD
+    hIcon*: HANDLE
+
+  LPCMINVOKECOMMANDINFO* = ptr CMINVOKECOMMANDINFO
+  TCMInvokeCommandInfo* = CMINVOKECOMMANDINFO
+  PCMInvokeCommandInfo* = ptr CMINVOKECOMMANDINFO
+  COLORADJUSTMENT* = record
+    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
+  tagCOLORADJUSTMENT* = COLORADJUSTMENT
+  TCOLORADJUSTMENT* = COLORADJUSTMENT
+  PCOLORADJUSTMENT* = ptr COLORADJUSTMENT
+  COLORMAP* = record
+    `from`*: COLORREF
+    `to`*: COLORREF          # XXX!
+
+  LPCOLORMAP* = ptr COLORMAP
+  TCOLORMAP* = COLORMAP
+  PCOLORMAP* = ptr COLORMAP
+  DCB* = record
+    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
+  TDCB* = DCB
+  PDCB* = ptr DCB
+
+const
+  bm_DCB_fBinary* = 0x00000001
+  bp_DCB_fBinary* = 0
+  bm_DCB_fParity* = 0x00000002
+  bp_DCB_fParity* = 1
+  bm_DCB_fOutxCtsFlow* = 0x00000004
+  bp_DCB_fOutxCtsFlow* = 2
+  bm_DCB_fOutxDsrFlow* = 0x00000008
+  bp_DCB_fOutxDsrFlow* = 3
+  bm_DCB_fDtrControl* = 0x00000030
+  bp_DCB_fDtrControl* = 4
+  bm_DCB_fDsrSensitivity* = 0x00000040
+  bp_DCB_fDsrSensitivity* = 6
+  bm_DCB_fTXContinueOnXoff* = 0x00000080
+  bp_DCB_fTXContinueOnXoff* = 7
+  bm_DCB_fOutX* = 0x00000100
+  bp_DCB_fOutX* = 8
+  bm_DCB_fInX* = 0x00000200
+  bp_DCB_fInX* = 9
+  bm_DCB_fErrorChar* = 0x00000400
+  bp_DCB_fErrorChar* = 10
+  bm_DCB_fNull* = 0x00000800
+  bp_DCB_fNull* = 11
+  bm_DCB_fRtsControl* = 0x00003000
+  bp_DCB_fRtsControl* = 12
+  bm_DCB_fAbortOnError* = 0x00004000
+  bp_DCB_fAbortOnError* = 14
+  bm_DCB_fDummy2* = 0xFFFF8000
+  bp_DCB_fDummy2* = 15
+
+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* = record
+    dwSize*: DWORD
+    wVersion*: int16
+    wReserved*: int16
+    dcb*: DCB
+    dwProviderSubType*: DWORD
+    dwProviderOffset*: DWORD
+    dwProviderSize*: DWORD
+    wcProviderData*: array[0..0, WCHAR]
+
+  LPCOMMCONFIG* = ptr COMMCONFIG
+  TCOMMCONFIG* = COMMCONFIG
+  PCOMMCONFIG* = ptr COMMCONFIG
+  COMMPROP* = record
+    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
+  TCOMMPROP* = COMMPROP
+  PCOMMPROP* = ptr COMMPROP
+  COMMTIMEOUTS* = record
+    ReadIntervalTimeout*: DWORD
+    ReadTotalTimeoutMultiplier*: DWORD
+    ReadTotalTimeoutConstant*: DWORD
+    WriteTotalTimeoutMultiplier*: DWORD
+    WriteTotalTimeoutConstant*: DWORD
+
+  LPCOMMTIMEOUTS* = ptr COMMTIMEOUTS
+  TCOMMTIMEOUTS* = COMMTIMEOUTS
+  PCOMMTIMEOUTS* = ptr COMMTIMEOUTS
+  COMPAREITEMSTRUCT* = record
+    CtlType*: UINT
+    CtlID*: UINT
+    hwndItem*: HWND
+    itemID1*: UINT
+    itemData1*: ULONG_PTR
+    itemID2*: UINT
+    itemData2*: ULONG_PTR
+
+  tagCOMPAREITEMSTRUCT* = COMPAREITEMSTRUCT
+  TCOMPAREITEMSTRUCT* = COMPAREITEMSTRUCT
+  PCOMPAREITEMSTRUCT* = ptr COMPAREITEMSTRUCT
+  COMPCOLOR* = record
+    crText*: COLORREF
+    crBackground*: COLORREF
+    dwEffects*: DWORD
+
+  TCOMPCOLOR* = COMPCOLOR
+  PCOMPCOLOR* = ptr COMPCOLOR
+  COMPOSITIONFORM* = record
+    dwStyle*: DWORD
+    ptCurrentPos*: POINT
+    rcArea*: RECT
+
+  LPCOMPOSITIONFORM* = ptr COMPOSITIONFORM
+  TCOMPOSITIONFORM* = COMPOSITIONFORM
+  PCOMPOSITIONFORM* = ptr COMPOSITIONFORM #     TComStatFlags = set of (fCtsHold, fDsrHold, fRlsdHold , fXoffHold ,
+                                          #                    fXoffSent , fEof ,  fTxim  , fReserved);
+  COMSTAT* = record
+    flag0*: DWORD             # can't use tcomstatflags, set packing issues
+                              # and conflicts with macro's
+    cbInQue*: DWORD
+    cbOutQue*: DWORD
+
+  LPCOMSTAT* = ptr COMSTAT
+  TCOMSTAT* = COMSTAT
+  PCOMSTAT* = ptr COMSTAT
+
+const
+  bm_COMSTAT_fCtsHold* = 0x00000001
+  bp_COMSTAT_fCtsHold* = 0
+  bm_COMSTAT_fDsrHold* = 0x00000002
+  bp_COMSTAT_fDsrHold* = 1
+  bm_COMSTAT_fRlsdHold* = 0x00000004
+  bp_COMSTAT_fRlsdHold* = 2
+  bm_COMSTAT_fXoffHold* = 0x00000008
+  bp_COMSTAT_fXoffHold* = 3
+  bm_COMSTAT_fXoffSent* = 0x00000010
+  bp_COMSTAT_fXoffSent* = 4
+  bm_COMSTAT_fEof* = 0x00000020
+  bp_COMSTAT_fEof* = 5
+  bm_COMSTAT_fTxim* = 0x00000040
+  bp_COMSTAT_fTxim* = 6
+  bm_COMSTAT_fReserved* = 0xFFFFFF80
+  bp_COMSTAT_fReserved* = 7
+
+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* = record
+    dwSize*: DWORD
+    bVisible*: WINBOOL
+
+  PCONSOLE_CURSOR_INFO* = ptr CONSOLE_CURSOR_INFO
+  TCONSOLECURSORINFO* = CONSOLE_CURSOR_INFO
+  TCURSORINFO* = CONSOLE_CURSOR_INFO
+  COORD* = record
+    X*: SHORT
+    Y*: SHORT
+
+  TCOORD* = COORD
+  PCOORD* = ptr COORD
+  SMALL_RECT* = record
+    Left*: SHORT
+    Top*: SHORT
+    Right*: SHORT
+    Bottom*: SHORT
+
+  TSMALL_RECT* = SMALL_RECT
+  PSMALL_RECT* = ptr SMALL_RECT
+  CONSOLE_SCREEN_BUFFER_INFO* = record
+    dwSize*: COORD
+    dwCursorPosition*: COORD
+    wAttributes*: int16
+    srWindow*: SMALL_RECT
+    dwMaximumWindowSize*: COORD
+
+  PCONSOLE_SCREEN_BUFFER_INFO* = ptr CONSOLE_SCREEN_BUFFER_INFO
+  TCONSOLESCREENBUFFERINFO* = CONSOLE_SCREEN_BUFFER_INFO
+
+when defined(i386):
+  type
+    FLOATING_SAVE_AREA* = record
+      ControlWord*: DWORD
+      StatusWord*: DWORD
+      TagWord*: DWORD
+      ErrorOffset*: DWORD
+      ErrorSelector*: DWORD
+      DataOffset*: DWORD
+      DataSelector*: DWORD
+      RegisterArea*: array[0..79, int8]
+      Cr0NpxState*: DWORD
+
+    TFLOATINGSAVEAREA* = FLOATING_SAVE_AREA
+    PFLOATINGSAVEAREA* = ptr FLOATING_SAVE_AREA
+    CONTEXT* = record
+      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
+
+when defined(x86_64):
+  #
+  # Define 128-bit 16-byte aligned xmm register type.
+  #
+  type
+    M128A* = record
+      Low*: ULONGLONG
+      High*: LONGLONG
+
+    TM128A* = M128A
+    PM128A* = TM128A #
+                     # Format of data for 32-bit fxsave/fxrstor instructions.
+                     #
+                     #typedef struct _XMM_SAVE_AREA32 {
+  type
+    XMM_SAVE_AREA32* = record
+      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]
+
+    TXmmSaveArea* = XMM_SAVE_AREA32
+    PXmmSaveArea* = ptr TXmmSaveArea
+  const
+    LEGACY_SAVE_AREA_LENGTH* = sizeof(XMM_SAVE_AREA32)
+  type
+    CONTEXT* = record
+      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
+
+when defined(powerpc32):
+  # 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* = record
+      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
+
+type
+  LPCONTEXT* = ptr CONTEXT
+  TCONTEXT* = CONTEXT
+  PCONTEXT* = ptr CONTEXT
+
+type
+  LIST_ENTRY* = record
+    Flink*: ptr LIST_ENTRY
+    Blink*: ptr LIST_ENTRY
+
+  TLISTENTRY* = LIST_ENTRY
+  PLISTENTRY* = ptr LIST_ENTRY
+  CRITICAL_SECTION_DEBUG* = record
+    `type`*: int16
+    CreatorBackTraceIndex*: int16
+    CriticalSection*: ptr TCRITICAL_SECTION
+    ProcessLocksList*: LIST_ENTRY
+    EntryCount*: DWORD
+    ContentionCount*: DWORD
+    Depth*: DWORD
+    OwnerBackTrace*: array[0..4, PVOID]
+
+  TRTL_CRITICAL_SECTION* = record
+    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
+  TCRITICALSECTIONDEBUG* = CRITICAL_SECTION_DEBUG
+  TCRITICAL_SECTION* = TRTLCriticalSection
+  PCRITICAL_SECTION* = PRTLCriticalSection
+  LPCRITICAL_SECTION* = PRTLCriticalSection
+  SECURITY_QUALITY_OF_SERVICE* = record
+    len*: DWORD
+    ImpersonationLevel*: SECURITY_IMPERSONATION_LEVEL
+    ContextTrackingMode*: WINBOOL
+    EffectiveOnly*: bool
+
+  PSECURITY_QUALITY_OF_SERVICE* = ptr SECURITY_QUALITY_OF_SERVICE
+  TSECURITYQUALITYOFSERVICE* = SECURITY_QUALITY_OF_SERVICE
+  CONVCONTEXT* = record
+    cb*: UINT
+    wFlags*: UINT
+    wCountryID*: UINT
+    iCodePage*: int32
+    dwLangID*: DWORD
+    dwSecurity*: DWORD
+    qos*: SECURITY_QUALITY_OF_SERVICE
+
+  TCONVCONTEXT* = CONVCONTEXT
+  PCONVCONTEXT* = ptr CONVCONTEXT
+  CONVINFO* = record
+    cb*: DWORD
+    hUser*: DWORD
+    hConvPartner*: HCONV
+    hszSvcPartner*: HSZ
+    hszServiceReq*: HSZ
+    hszTopic*: HSZ
+    hszItem*: HSZ
+    wFmt*: UINT
+    wType*: UINT
+    wStatus*: UINT
+    wConvst*: UINT
+    wLastError*: UINT
+    hConvList*: HCONVLIST
+    ConvCtxt*: CONVCONTEXT
+    hwnd*: HWND
+    hwndPartner*: HWND
+
+  tagCONVINFO* = CONVINFO
+  TCONVINFO* = CONVINFO
+  PCONVINFO* = ptr CONVINFO
+  COPYDATASTRUCT* = record
+    dwData*: DWORD
+    cbData*: DWORD
+    lpData*: PVOID
+
+  tagCOPYDATASTRUCT* = COPYDATASTRUCT
+  TCOPYDATASTRUCT* = COPYDATASTRUCT
+  PCOPYDATASTRUCT* = ptr COPYDATASTRUCT
+  CPINFO* = record
+    MaxCharSize*: UINT
+    DefaultChar*: array[0..(MAX_DEFAULTCHAR) - 1, int8]
+    LeadByte*: array[0..(MAX_LEADBYTES) - 1, int8]
+
+  LPCPINFO* = ptr CPINFO
+  Tcpinfo* = CPINFO
+  Pcpinfo* = ptr CPINFO
+  CPLINFO* = record
+    idIcon*: int32
+    idName*: int32
+    idInfo*: int32
+    lData*: LONG
+
+  tagCPLINFO* = CPLINFO
+  TCPLINFO* = CPLINFO
+  PCPLINFO* = ptr CPLINFO
+  CREATE_PROCESS_DEBUG_INFO* = record
+    hFile*: HANDLE
+    hProcess*: HANDLE
+    hThread*: HANDLE
+    lpBaseOfImage*: LPVOID
+    dwDebugInfoFileOffset*: DWORD
+    nDebugInfoSize*: DWORD
+    lpThreadLocalBase*: LPVOID
+    lpStartAddress*: LPTHREAD_START_ROUTINE
+    lpImageName*: LPVOID
+    fUnicode*: int16
+
+  TCREATEPROCESSDEBUGINFO* = CREATE_PROCESS_DEBUG_INFO
+  PCREATEPROCESSDEBUGINFO* = ptr CREATE_PROCESS_DEBUG_INFO
+  CREATE_THREAD_DEBUG_INFO* = record
+    hThread*: HANDLE
+    lpThreadLocalBase*: LPVOID
+    lpStartAddress*: LPTHREAD_START_ROUTINE
+
+  TCREATETHREADDEBUGINFO* = CREATE_THREAD_DEBUG_INFO
+  PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO #
+                                                         #   TODO: sockets
+                                                         #  typedef struct _SOCKET_ADDRESS {
+                                                         #    LPSOCKADDR lpSockaddr ;
+                                                         #    INT iSockaddrLength ;
+                                                         #  } SOCKET_ADDRESS,  PSOCKET_ADDRESS,  LPSOCKET_ADDRESS;
+                                                         #   }
+                                                         #  {
+                                                         #  typedef struct _CSADDR_INFO {
+                                                         #    SOCKET_ADDRESS  LocalAddr;
+                                                         #    SOCKET_ADDRESS  RemoteAddr;
+                                                         #    INT             iSocketType;
+                                                         #    INT             iProtocol;
+                                                         #  } CSADDR_INFO;
+                                                         #
+  CURRENCYFMT* = record
+    NumDigits*: UINT
+    LeadingZero*: UINT
+    Grouping*: UINT
+    lpDecimalSep*: LPTSTR
+    lpThousandSep*: LPTSTR
+    NegativeOrder*: UINT
+    PositiveOrder*: UINT
+    lpCurrencySymbol*: LPTSTR
+
+  Tcurrencyfmt* = CURRENCYFMT
+  Pcurrencyfmt* = ptr CURRENCYFMT
+  CURSORSHAPE* = record
+    xHotSpot*: int32
+    yHotSpot*: int32
+    cx*: int32
+    cy*: int32
+    cbWidth*: int32
+    Planes*: int8
+    BitsPixel*: int8
+
+  LPCURSORSHAPE* = ptr CURSORSHAPE
+  TCURSORSHAPE* = CURSORSHAPE
+  PCURSORSHAPE* = ptr CURSORSHAPE
+  CWPRETSTRUCT* = record
+    lResult*: LRESULT
+    lParam*: LPARAM
+    wParam*: WPARAM
+    message*: DWORD
+    hwnd*: HWND
+
+  TCWPRETSTRUCT* = CWPRETSTRUCT
+  PCWPRETSTRUCT* = ptr CWPRETSTRUCT
+  CWPSTRUCT* = record
+    lParam*: LPARAM
+    wParam*: WPARAM
+    message*: UINT
+    hwnd*: HWND
+
+  TCWPSTRUCT* = CWPSTRUCT
+  PCWPSTRUCT* = ptr CWPSTRUCT
+  DATATYPES_INFO_1* = record
+    pName*: LPTSTR
+
+  TDATATYPESINFO1* = DATATYPES_INFO_1
+  PDATATYPESINFO1* = ptr DATATYPES_INFO_1
+  DDEACK* = record
+    flag0*: int16
+
+  TDDEACK* = DDEACK
+  PDDEACK* = ptr DDEACK
+
+const
+  bm_DDEACK_bAppReturnCode* = 0x000000FF
+  bp_DDEACK_bAppReturnCode* = 0
+  bm_DDEACK_reserved* = 0x00003F00
+  bp_DDEACK_reserved* = 8
+  bm_DDEACK_fBusy* = 0x00004000
+  bp_DDEACK_fBusy* = 14
+  bm_DDEACK_fAck* = 0x00008000
+  bp_DDEACK_fAck* = 15
+
+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* = record
+    flag0*: int16
+    cfFormat*: SHORT
+
+  TDDEADVISE* = DDEADVISE
+  PDDEADVISE* = ptr DDEADVISE
+
+const
+  bm_DDEADVISE_reserved* = 0x00003FFF
+  bp_DDEADVISE_reserved* = 0
+  bm_DDEADVISE_fDeferUpd* = 0x00004000
+  bp_DDEADVISE_fDeferUpd* = 14
+  bm_DDEADVISE_fAckReq* = 0x00008000
+  bp_DDEADVISE_fAckReq* = 15
+
+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* = record
+    flag0*: int16
+    cfFormat*: SHORT
+    Value*: array[0..0, int8]
+
+  PDDEDATA* = ptr DDEDATA
+
+const
+  bm_DDEDATA_unused* = 0x00000FFF
+  bp_DDEDATA_unused* = 0
+  bm_DDEDATA_fResponse* = 0x00001000
+  bp_DDEDATA_fResponse* = 12
+  bm_DDEDATA_fRelease* = 0x00002000
+  bp_DDEDATA_fRelease* = 13
+  bm_DDEDATA_reserved* = 0x00004000
+  bp_DDEDATA_reserved* = 14
+  bm_DDEDATA_fAckReq* = 0x00008000
+  bp_DDEDATA_fAckReq* = 15
+
+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* = record
+    flag0*: int16
+    cfFormat*: SHORT
+
+  TDDELN* = DDELN
+  PDDELN* = ptr DDELN
+
+const
+  bm_DDELN_unused* = 0x00001FFF
+  bp_DDELN_unused* = 0
+  bm_DDELN_fRelease* = 0x00002000
+  bp_DDELN_fRelease* = 13
+  bm_DDELN_fDeferUpd* = 0x00004000
+  bp_DDELN_fDeferUpd* = 14
+  bm_DDELN_fAckReq* = 0x00008000
+  bp_DDELN_fAckReq* = 15
+
+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* = record
+    uiLo*: UINT
+    uiHi*: UINT
+    cbData*: DWORD
+    Data*: array[0..7, DWORD]
+
+  TDDEMLMSGHOOKDATA* = DDEML_MSG_HOOK_DATA
+  PDDEMLMSGHOOKDATA* = ptr DDEML_MSG_HOOK_DATA
+  DDEPOKE* = record
+    flag0*: int16
+    cfFormat*: SHORT
+    Value*: array[0..0, int8]
+
+  TDDEPOKE* = DDEPOKE
+  PDDEPOKE* = ptr DDEPOKE
+
+const
+  bm_DDEPOKE_unused* = 0x00001FFF
+  bp_DDEPOKE_unused* = 0
+  bm_DDEPOKE_fRelease* = 0x00002000
+  bp_DDEPOKE_fRelease* = 13
+  bm_DDEPOKE_fReserved* = 0x0000C000
+  bp_DDEPOKE_fReserved* = 14
+
+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* = record
+    flag0*: int16
+    cfFormat*: SHORT
+    rgb*: array[0..0, int8]
+
+  TDDEUP* = DDEUP
+  PDDEUP* = ptr DDEUP
+
+const
+  bm_DDEUP_unused* = 0x00000FFF
+  bp_DDEUP_unused* = 0
+  bm_DDEUP_fAck* = 0x00001000
+  bp_DDEUP_fAck* = 12
+  bm_DDEUP_fRelease* = 0x00002000
+  bp_DDEUP_fRelease* = 13
+  bm_DDEUP_fReserved* = 0x00004000
+  bp_DDEUP_fReserved* = 14
+  bm_DDEUP_fAckReq* = 0x00008000
+  bp_DDEUP_fAckReq* = 15
+
+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* = record
+    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
+  TEXCEPTIONRECORD* = EXCEPTION_RECORD
+  EXCEPTION_DEBUG_INFO* = record
+    ExceptionRecord*: EXCEPTION_RECORD
+    dwFirstChance*: DWORD
+
+  PEXCEPTION_DEBUG_INFO* = ptr EXCEPTION_DEBUG_INFO
+  TEXCEPTIONDEBUGINFO* = EXCEPTION_DEBUG_INFO
+  EXCEPTION_RECORD32* = record
+    ExceptionCode*: DWORD
+    ExceptionFlags*: DWORD
+    ExceptionRecord*: DWORD
+    ExceptionAddress*: DWORD
+    NumberParameters*: DWORD
+    ExceptionInformation*: array[0..(EXCEPTION_MAXIMUM_PARAMETERS) - 1, DWORD]
+
+  PEXCEPTION_RECORD32* = ptr EXCEPTION_RECORD32
+  TExceptionRecord32* = EXCEPTION_RECORD32
+  EXCEPTION_DEBUG_INFO32* = record
+    ExceptionRecord*: EXCEPTION_RECORD32
+    dwFirstChance*: DWORD
+
+  PEXCEPTION_DEBUG_INFO32* = ptr EXCEPTION_DEBUG_INFO32
+  TExceptionDebugInfo32* = EXCEPTION_DEBUG_INFO32
+  EXCEPTION_RECORD64* = record
+    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
+  TExceptionRecord64* = EXCEPTION_RECORD64
+  EXCEPTION_DEBUG_INFO64* = record
+    ExceptionRecord*: EXCEPTION_RECORD64
+    dwFirstChance*: DWORD
+
+  PEXCEPTION_DEBUG_INFO64* = ptr EXCEPTION_DEBUG_INFO64
+  TExceptionDebugInfo64* = EXCEPTION_DEBUG_INFO64
+  EXIT_PROCESS_DEBUG_INFO* = record
+    dwExitCode*: DWORD
+
+  TEXITPROCESSDEBUGINFO* = EXIT_PROCESS_DEBUG_INFO
+  PEXITPROCESSDEBUGINFO* = ptr EXIT_PROCESS_DEBUG_INFO
+  EXIT_THREAD_DEBUG_INFO* = record
+    dwExitCode*: DWORD
+
+  TEXITTHREADDEBUGINFO* = EXIT_THREAD_DEBUG_INFO
+  PEXITTHREADDEBUGINFO* = ptr EXIT_THREAD_DEBUG_INFO
+  LOAD_DLL_DEBUG_INFO* = record
+    hFile*: HANDLE
+    lpBaseOfDll*: LPVOID
+    dwDebugInfoFileOffset*: DWORD
+    nDebugInfoSize*: DWORD
+    lpImageName*: LPVOID
+    fUnicode*: int16
+
+  TLOADDLLDEBUGINFO* = LOAD_DLL_DEBUG_INFO
+  PLOADDLLDEBUGINFO* = ptr LOAD_DLL_DEBUG_INFO
+  UNLOAD_DLL_DEBUG_INFO* = record
+    lpBaseOfDll*: LPVOID
+
+  TUNLOADDLLDEBUGINFO* = UNLOAD_DLL_DEBUG_INFO
+  PUNLOADDLLDEBUGINFO* = ptr UNLOAD_DLL_DEBUG_INFO
+  OUTPUT_DEBUG_STRING_INFO* = record
+    lpDebugStringData*: LPSTR
+    fUnicode*: int16
+    nDebugStringLength*: int16
+
+  TOUTPUTDEBUGSTRINGINFO* = OUTPUT_DEBUG_STRING_INFO
+  POUTPUTDEBUGSTRINGINFO* = ptr OUTPUT_DEBUG_STRING_INFO
+  RIP_INFO* = record
+    dwError*: DWORD
+    dwType*: DWORD
+
+  TRIPINFO* = RIP_INFO
+  PRIPINFO* = ptr RIP_INFO
+  DEBUG_EVENT* = record
+    dwDebugEventCode*: DWORD
+    dwProcessId*: DWORD
+    dwThreadId*: DWORD
+    data*: array[0..15, DWORD] #
+                               # case longint of
+                               # 0 : ( Exception : EXCEPTION_DEBUG_INFO );
+                               # 1 : ( CreateThread : CREATE_THREAD_DEBUG_INFO );
+                               # 2 : ( CreateProcessInfo : CREATE_PROCESS_DEBUG_INFO );
+                               # 3 : ( ExitThread : EXIT_THREAD_DEBUG_INFO );
+                               # 4 : ( ExitProcess : EXIT_PROCESS_DEBUG_INFO );
+                               # 5 : ( LoadDll : LOAD_DLL_DEBUG_INFO );
+                               # 6 : ( UnloadDll : UNLOAD_DLL_DEBUG_INFO );
+                               # 7 : ( DebugString : OUTPUT_DEBUG_STRING_INFO );
+                               # 8 : ( RipInfo : RIP_INFO );
+
+  LPDEBUG_EVENT* = ptr DEBUG_EVENT
+  TDEBUGEVENT* = DEBUG_EVENT
+  PDEBUGEVENT* = ptr DEBUG_EVENT
+  DEBUGHOOKINFO* = record
+    idThread*: DWORD
+    idThreadInstaller*: DWORD
+    lParam*: LPARAM
+    wParam*: WPARAM
+    code*: int32
+
+  TDEBUGHOOKINFO* = DEBUGHOOKINFO
+  PDEBUGHOOKINFO* = ptr DEBUGHOOKINFO
+  DELETEITEMSTRUCT* = record
+    CtlType*: UINT
+    CtlID*: UINT
+    itemID*: UINT
+    hwndItem*: HWND
+    itemData*: ULONG_PTR
+
+  TDELETEITEMSTRUCT* = DELETEITEMSTRUCT
+  PDELETEITEMSTRUCT* = ptr DELETEITEMSTRUCT
+  DEV_BROADCAST_HDR* = record
+    dbch_size*: ULONG
+    dbch_devicetype*: ULONG
+    dbch_reserved*: ULONG
+
+  PDEV_BROADCAST_HDR* = ptr DEV_BROADCAST_HDR
+  TDEVBROADCASTHDR* = DEV_BROADCAST_HDR
+  DEV_BROADCAST_OEM* = record
+    dbco_size*: ULONG
+    dbco_devicetype*: ULONG
+    dbco_reserved*: ULONG
+    dbco_identifier*: ULONG
+    dbco_suppfunc*: ULONG
+
+  PDEV_BROADCAST_OEM* = ptr DEV_BROADCAST_OEM
+  TDEVBROADCASTOEM* = DEV_BROADCAST_OEM
+  DEV_BROADCAST_PORT* = record
+    dbcp_size*: ULONG
+    dbcp_devicetype*: ULONG
+    dbcp_reserved*: ULONG
+    dbcp_name*: array[0..0, char]
+
+  PDEV_BROADCAST_PORT* = ptr DEV_BROADCAST_PORT
+  TDEVBROADCASTPORT* = DEV_BROADCAST_PORT
+  DEV_BROADCAST_USERDEFINED* = record
+    dbud_dbh*: DEV_BROADCAST_HDR
+    dbud_szName*: array[0..0, char]
+    dbud_rgbUserDefined*: array[0..0, int8]
+
+  TDEVBROADCASTUSERDEFINED* = DEV_BROADCAST_USERDEFINED
+  PDEVBROADCASTUSERDEFINED* = ptr DEV_BROADCAST_USERDEFINED
+  DEV_BROADCAST_VOLUME* = record
+    dbcv_size*: ULONG
+    dbcv_devicetype*: ULONG
+    dbcv_reserved*: ULONG
+    dbcv_unitmask*: ULONG
+    dbcv_flags*: USHORT
+
+  PDEV_BROADCAST_VOLUME* = ptr DEV_BROADCAST_VOLUME
+  TDEVBROADCASTVOLUME* = DEV_BROADCAST_VOLUME
+  DEVMODE* = record
+    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
+  tdevicemode* = DEVMODE
+  tdevicemodeA* = DEVMODE
+  PDeviceModeA* = LPDEVMODE
+  PDeviceMode* = LPDEVMODE
+  TDEVMODE* = DEVMODE
+  PDEVMODE* = LPDEVMODE
+  devmodeW* = record
+    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
+  TDeviceModeW* = DEVMODEW
+  PDeviceModeW* = LPDEVMODEW
+  TDEVMODEW* = DEVMODEW
+  PDEVMODEW* = LPDEVMODEW
+  DEVNAMES* = record
+    wDriverOffset*: int16
+    wDeviceOffset*: int16
+    wOutputOffset*: int16
+    wDefault*: int16
+
+  LPDEVNAMES* = ptr DEVNAMES
+  tagDEVNAMES* = DEVNAMES
+  TDEVNAMES* = DEVNAMES
+  PDEVNAMES* = ptr DEVNAMES
+  DIBSECTION* = record
+    dsBm*: BITMAP
+    dsBmih*: BITMAPINFOHEADER
+    dsBitfields*: array[0..2, DWORD]
+    dshSection*: HANDLE
+    dsOffset*: DWORD
+
+  tagDIBSECTION* = DIBSECTION
+  TDIBSECTION* = DIBSECTION
+  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
+  TLargeInteger* = Int64
+  PULARGE_INTEGER* = ptr ULARGE_INTEGER
+  TULargeInteger* = int64
+  DISK_GEOMETRY* = record
+    Cylinders*: LARGE_INTEGER
+    MediaType*: MEDIA_TYPE
+    TracksPerCylinder*: DWORD
+    SectorsPerTrack*: DWORD
+    BytesPerSector*: DWORD
+
+  TDISKGEOMETRY* = DISK_GEOMETRY
+  PDISKGEOMETRY* = ptr DISK_GEOMETRY
+  DISK_PERFORMANCE* = record
+    BytesRead*: LARGE_INTEGER
+    BytesWritten*: LARGE_INTEGER
+    ReadTime*: LARGE_INTEGER
+    WriteTime*: LARGE_INTEGER
+    ReadCount*: DWORD
+    WriteCount*: DWORD
+    QueueDepth*: DWORD
+
+  TDISKPERFORMANCE* = DISK_PERFORMANCE
+  PDISKPERFORMANCE* = ptr DISK_PERFORMANCE
+  DLGITEMTEMPLATE* = record
+    style*: DWORD
+    dwExtendedStyle*: DWORD
+    x*: int16
+    y*: int16
+    cx*: int16
+    cy*: int16
+    id*: int16
+
+  LPDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE
+  TDLGITEMTEMPLATE* = DLGITEMTEMPLATE
+  PDLGITEMTEMPLATE* = ptr DLGITEMTEMPLATE
+  DLGTEMPLATE* = record
+    style*: DWORD
+    dwExtendedStyle*: DWORD
+    cdit*: int16
+    x*: int16
+    y*: int16
+    cx*: int16
+    cy*: int16
+
+  LPDLGTEMPLATE* = ptr DLGTEMPLATE
+  LPCDLGTEMPLATE* = ptr DLGTEMPLATE
+  TDLGTEMPLATE* = DLGTEMPLATE
+  PDLGTEMPLATE* = ptr DLGTEMPLATE
+  DOC_INFO_1* = record
+    pDocName*: LPTSTR
+    pOutputFile*: LPTSTR
+    pDatatype*: LPTSTR
+
+  TDOCINFO1* = DOC_INFO_1
+  PDOCINFO1* = ptr DOC_INFO_1
+  DOC_INFO_2* = record
+    pDocName*: LPTSTR
+    pOutputFile*: LPTSTR
+    pDatatype*: LPTSTR
+    dwMode*: DWORD
+    JobId*: DWORD
+
+  TDOCINFO2* = DOC_INFO_2
+  PDOCINFO2* = ptr DOC_INFO_2
+  DOCINFO* = record
+    cbSize*: int32
+    lpszDocName*: LPCTSTR
+    lpszOutput*: LPCTSTR
+    lpszDatatype*: LPCTSTR
+    fwType*: DWORD
+
+  TDOCINFO* = DOCINFO
+  TDOCINFOA* = DOCINFO
+  PDOCINFO* = ptr DOCINFO
+  DRAGLISTINFO* = record
+    uNotification*: UINT
+    hWnd*: HWND
+    ptCursor*: POINT
+
+  LPDRAGLISTINFO* = ptr DRAGLISTINFO
+  TDRAGLISTINFO* = DRAGLISTINFO
+  PDRAGLISTINFO* = ptr DRAGLISTINFO
+  DRAWITEMSTRUCT* = record
+    CtlType*: UINT
+    CtlID*: UINT
+    itemID*: UINT
+    itemAction*: UINT
+    itemState*: UINT
+    hwndItem*: HWND
+    hDC*: HDC
+    rcItem*: RECT
+    itemData*: ULONG_PTR
+
+  LPDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT
+  tagDRAWITEMSTRUCT* = DRAWITEMSTRUCT
+  TDRAWITEMSTRUCT* = DRAWITEMSTRUCT
+  PDRAWITEMSTRUCT* = ptr DRAWITEMSTRUCT
+  DRAWTEXTPARAMS* = record
+    cbSize*: UINT
+    iTabLength*: int32
+    iLeftMargin*: int32
+    iRightMargin*: int32
+    uiLengthDrawn*: UINT
+
+  LPDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS
+  TDRAWTEXTPARAMS* = DRAWTEXTPARAMS
+  PDRAWTEXTPARAMS* = ptr DRAWTEXTPARAMS
+  PARTITION_INFORMATION* = record
+    PartitionType*: int8
+    BootIndicator*: bool
+    RecognizedPartition*: bool
+    RewritePartition*: bool
+    StartingOffset*: LARGE_INTEGER
+    PartitionLength*: LARGE_INTEGER
+    HiddenSectors*: LARGE_INTEGER
+
+  TPARTITIONINFORMATION* = PARTITION_INFORMATION
+  PPARTITIONINFORMATION* = ptr PARTITION_INFORMATION
+  DRIVE_LAYOUT_INFORMATION* = record
+    PartitionCount*: DWORD
+    Signature*: DWORD
+    PartitionEntry*: array[0..0, PARTITION_INFORMATION]
+
+  TDRIVELAYOUTINFORMATION* = DRIVE_LAYOUT_INFORMATION
+  PDRIVELAYOUTINFORMATION* = ptr DRIVE_LAYOUT_INFORMATION
+  DRIVER_INFO_1* = record
+    pName*: LPTSTR
+
+  TDRIVERINFO1* = DRIVER_INFO_1
+  PDRIVERINFO1* = ptr DRIVER_INFO_1
+  DRIVER_INFO_2* = record
+    cVersion*: DWORD
+    pName*: LPTSTR
+    pEnvironment*: LPTSTR
+    pDriverPath*: LPTSTR
+    pDataFile*: LPTSTR
+    pConfigFile*: LPTSTR
+
+  TDRIVERINFO2* = DRIVER_INFO_2
+  PDRIVERINFO2* = ptr DRIVER_INFO_2
+  DRIVER_INFO_3* = record
+    cVersion*: DWORD
+    pName*: LPTSTR
+    pEnvironment*: LPTSTR
+    pDriverPath*: LPTSTR
+    pDataFile*: LPTSTR
+    pConfigFile*: LPTSTR
+    pHelpFile*: LPTSTR
+    pDependentFiles*: LPTSTR
+    pMonitorName*: LPTSTR
+    pDefaultDataType*: LPTSTR
+
+  TDRIVERINFO3* = DRIVER_INFO_3
+  PDRIVERINFO3* = ptr DRIVER_INFO_3
+  EDITSTREAM* = record
+    dwCookie*: DWORD
+    dwError*: DWORD
+    pfnCallback*: EDITSTREAMCALLBACK
+
+  Teditstream* = EDITSTREAM
+  Peditstream* = ptr EDITSTREAM
+  EMR* = record
+    iType*: DWORD
+    nSize*: DWORD
+
+  tagEMR* = EMR
+  TEMR* = EMR
+  PEMR* = ptr EMR
+  EMRANGLEARC* = record
+    emr*: EMR
+    ptlCenter*: POINTL
+    nRadius*: DWORD
+    eStartAngle*: float32
+    eSweepAngle*: float32
+
+  tagEMRANGLEARC* = EMRANGLEARC
+  TEMRANGLEARC* = EMRANGLEARC
+  PEMRANGLEARC* = ptr EMRANGLEARC
+  EMRARC* = record
+    emr*: EMR
+    rclBox*: RECTL
+    ptlStart*: POINTL
+    ptlEnd*: POINTL
+
+  tagEMRARC* = EMRARC
+  TEMRARC* = EMRARC
+  PEMRARC* = ptr EMRARC
+  EMRARCTO* = EMRARC
+  TEMRARCTO* = EMRARC
+  PEMRARCTO* = ptr EMRARC
+  EMRCHORD* = EMRARC
+  TEMRCHORD* = EMRARC
+  PEMRCHORD* = ptr EMRARC
+  EMRPIE* = EMRARC
+  TEMRPIE* = EMRARC
+  PEMRPIE* = ptr EMRARC
+  XFORM* = record
+    eM11*: float32
+    eM12*: float32
+    eM21*: float32
+    eM22*: float32
+    eDx*: float32
+    eDy*: float32
+
+  LPXFORM* = ptr XFORM
+  TXFORM* = XFORM
+  PXFORM* = ptr XFORM
+  EMRBITBLT* = record
+    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
+
+  tagEMRBITBLT* = EMRBITBLT
+  TEMRBITBLT* = EMRBITBLT
+  PEMRBITBLT* = ptr EMRBITBLT
+  LOGBRUSH* = record
+    lbStyle*: UINT
+    lbColor*: COLORREF
+    lbHatch*: LONG
+
+  tagLOGBRUSH* = LOGBRUSH
+  TLOGBRUSH* = LOGBRUSH
+  PLOGBRUSH* = ptr LOGBRUSH
+  EMRCREATEBRUSHINDIRECT* = record
+    emr*: EMR
+    ihBrush*: DWORD
+    lb*: LOGBRUSH
+
+  tagEMRCREATEBRUSHINDIRECT* = EMRCREATEBRUSHINDIRECT
+  TEMRCREATEBRUSHINDIRECT* = EMRCREATEBRUSHINDIRECT
+  PEMRCREATEBRUSHINDIRECT* = ptr EMRCREATEBRUSHINDIRECT
+  LCSCSTYPE* = LONG
+  LCSGAMUTMATCH* = LONG
+  LOGCOLORSPACE* = record
+    lcsSignature*: DWORD
+    lcsVersion*: DWORD
+    lcsSize*: DWORD
+    lcsCSType*: LCSCSTYPE
+    lcsIntent*: LCSGAMUTMATCH
+    lcsEndpoints*: CIEXYZTRIPLE
+    lcsGammaRed*: DWORD
+    lcsGammaGreen*: DWORD
+    lcsGammaBlue*: DWORD
+    lcsFilename*: array[0..(MAX_PATH) - 1, TCHAR]
+
+  LPLOGCOLORSPACE* = ptr LOGCOLORSPACE
+  tagLOGCOLORSPACE* = LOGCOLORSPACE
+  TLOGCOLORSPACE* = LOGCOLORSPACE
+  TLOGCOLORSPACEA* = LOGCOLORSPACE
+  PLOGCOLORSPACE* = ptr LOGCOLORSPACE
+  EMRCREATECOLORSPACE* = record
+    emr*: EMR
+    ihCS*: DWORD
+    lcs*: LOGCOLORSPACE
+
+  tagEMRCREATECOLORSPACE* = EMRCREATECOLORSPACE
+  TEMRCREATECOLORSPACE* = EMRCREATECOLORSPACE
+  PEMRCREATECOLORSPACE* = ptr EMRCREATECOLORSPACE
+  EMRCREATEDIBPATTERNBRUSHPT* = record
+    emr*: EMR
+    ihBrush*: DWORD
+    iUsage*: DWORD
+    offBmi*: DWORD
+    cbBmi*: DWORD
+    offBits*: DWORD
+    cbBits*: DWORD
+
+  tagEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT
+  TEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT
+  PEMRCREATEDIBPATTERNBRUSHPT* = EMRCREATEDIBPATTERNBRUSHPT
+  EMRCREATEMONOBRUSH* = record
+    emr*: EMR
+    ihBrush*: DWORD
+    iUsage*: DWORD
+    offBmi*: DWORD
+    cbBmi*: DWORD
+    offBits*: DWORD
+    cbBits*: DWORD
+
+  tagEMRCREATEMONOBRUSH* = EMRCREATEMONOBRUSH
+  TEMRCREATEMONOBRUSH* = EMRCREATEMONOBRUSH
+  PEMRCREATEMONOBRUSH* = ptr EMRCREATEMONOBRUSH
+  PALETTEENTRY* = record
+    peRed*: int8
+    peGreen*: int8
+    peBlue*: int8
+    peFlags*: int8
+
+  LPPALETTEENTRY* = ptr PALETTEENTRY
+  tagPALETTEENTRY* = PALETTEENTRY
+  TPALETTEENTRY* = PALETTEENTRY
+  PPALETTEENTRY* = ptr PALETTEENTRY
+  LOGPALETTE* = record
+    palVersion*: int16
+    palNumEntries*: int16
+    palPalEntry*: array[0..0, PALETTEENTRY]
+
+  LPLOGPALETTE* = ptr LOGPALETTE
+  tagLOGPALETTE* = LOGPALETTE
+  TLOGPALETTE* = LOGPALETTE
+  PLOGPALETTE* = ptr LOGPALETTE
+  EMRCREATEPALETTE* = record
+    emr*: EMR
+    ihPal*: DWORD
+    lgpl*: LOGPALETTE
+
+  tagEMRCREATEPALETTE* = EMRCREATEPALETTE
+  TEMRCREATEPALETTE* = EMRCREATEPALETTE
+  PEMRCREATEPALETTE* = ptr EMRCREATEPALETTE
+  LOGPEN* = record
+    lopnStyle*: UINT
+    lopnWidth*: POINT
+    lopnColor*: COLORREF
+
+  tagLOGPEN* = LOGPEN
+  TLOGPEN* = LOGPEN
+  PLOGPEN* = ptr LOGPEN
+  EMRCREATEPEN* = record
+    emr*: EMR
+    ihPen*: DWORD
+    lopn*: LOGPEN
+
+  tagEMRCREATEPEN* = EMRCREATEPEN
+  TEMRCREATEPEN* = EMRCREATEPEN
+  PEMRCREATEPEN* = ptr EMRCREATEPEN
+  EMRELLIPSE* = record
+    emr*: EMR
+    rclBox*: RECTL
+
+  tagEMRELLIPSE* = EMRELLIPSE
+  TEMRELLIPSE* = EMRELLIPSE
+  PEMRELLIPSE* = ptr EMRELLIPSE
+  EMRRECTANGLE* = EMRELLIPSE
+  TEMRRECTANGLE* = EMRELLIPSE
+  PEMRRECTANGLE* = ptr EMRELLIPSE
+  EMREOF* = record
+    emr*: EMR
+    nPalEntries*: DWORD
+    offPalEntries*: DWORD
+    nSizeLast*: DWORD
+
+  tagEMREOF* = EMREOF
+  TEMREOF* = EMREOF
+  PEMREOF* = ptr EMREOF
+  EMREXCLUDECLIPRECT* = record
+    emr*: EMR
+    rclClip*: RECTL
+
+  tagEMREXCLUDECLIPRECT* = EMREXCLUDECLIPRECT
+  TEMREXCLUDECLIPRECT* = EMREXCLUDECLIPRECT
+  PEMREXCLUDECLIPRECT* = ptr EMREXCLUDECLIPRECT
+  EMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT
+  TEMRINTERSECTCLIPRECT* = EMREXCLUDECLIPRECT
+  PEMRINTERSECTCLIPRECT* = ptr EMREXCLUDECLIPRECT
+  PANOSE* = record
+    bFamilyType*: int8
+    bSerifStyle*: int8
+    bWeight*: int8
+    bProportion*: int8
+    bContrast*: int8
+    bStrokeVariation*: int8
+    bArmStyle*: int8
+    bLetterform*: int8
+    bMidline*: int8
+    bXHeight*: int8
+
+  tagPANOSE* = PANOSE
+  TPANOSE* = PANOSE
+  PPANOSE* = ptr PANOSE
+  EXTLOGFONT* = record
+    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
+
+  tagEXTLOGFONT* = EXTLOGFONT
+  TEXTLOGFONT* = EXTLOGFONT
+  PEXTLOGFONT* = ptr EXTLOGFONT
+  EMREXTCREATEFONTINDIRECTW* = record
+    emr*: EMR
+    ihFont*: DWORD
+    elfw*: EXTLOGFONT
+
+  tagEMREXTCREATEFONTINDIRECTW* = EMREXTCREATEFONTINDIRECTW
+  TEMREXTCREATEFONTINDIRECTW* = EMREXTCREATEFONTINDIRECTW
+  PEMREXTCREATEFONTINDIRECTW* = ptr EMREXTCREATEFONTINDIRECTW
+  EXTLOGPEN* = record
+    elpPenStyle*: UINT
+    elpWidth*: UINT
+    elpBrushStyle*: UINT
+    elpColor*: COLORREF
+    elpHatch*: LONG
+    elpNumEntries*: DWORD
+    elpStyleEntry*: array[0..0, DWORD]
+
+  tagEXTLOGPEN* = EXTLOGPEN
+  TEXTLOGPEN* = EXTLOGPEN
+  PEXTLOGPEN* = ptr EXTLOGPEN
+  EMREXTCREATEPEN* = record
+    emr*: EMR
+    ihPen*: DWORD
+    offBmi*: DWORD
+    cbBmi*: DWORD
+    offBits*: DWORD
+    cbBits*: DWORD
+    elp*: EXTLOGPEN
+
+  tagEMREXTCREATEPEN* = EMREXTCREATEPEN
+  TEMREXTCREATEPEN* = EMREXTCREATEPEN
+  PEMREXTCREATEPEN* = ptr EMREXTCREATEPEN
+  EMREXTFLOODFILL* = record
+    emr*: EMR
+    ptlStart*: POINTL
+    crColor*: COLORREF
+    iMode*: DWORD
+
+  tagEMREXTFLOODFILL* = EMREXTFLOODFILL
+  TEMREXTFLOODFILL* = EMREXTFLOODFILL
+  PEMREXTFLOODFILL* = ptr EMREXTFLOODFILL
+  EMREXTSELECTCLIPRGN* = record
+    emr*: EMR
+    cbRgnData*: DWORD
+    iMode*: DWORD
+    RgnData*: array[0..0, int8]
+
+  tagEMREXTSELECTCLIPRGN* = EMREXTSELECTCLIPRGN
+  TEMREXTSELECTCLIPRGN* = EMREXTSELECTCLIPRGN
+  PEMREXTSELECTCLIPRGN* = ptr EMREXTSELECTCLIPRGN
+  EMRTEXT* = record
+    ptlReference*: POINTL
+    nChars*: DWORD
+    offString*: DWORD
+    fOptions*: DWORD
+    rcl*: RECTL
+    offDx*: DWORD
+
+  tagEMRTEXT* = EMRTEXT
+  TEMRTEXT* = EMRTEXT
+  PEMRTEXT* = ptr EMRTEXT
+  EMREXTTEXTOUTA* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    iGraphicsMode*: DWORD
+    exScale*: float32
+    eyScale*: float32
+    emrtext*: EMRTEXT
+
+  tagEMREXTTEXTOUTA* = EMREXTTEXTOUTA
+  TEMREXTTEXTOUTA* = EMREXTTEXTOUTA
+  PEMREXTTEXTOUTA* = ptr EMREXTTEXTOUTA
+  EMREXTTEXTOUTW* = EMREXTTEXTOUTA
+  TEMREXTTEXTOUTW* = EMREXTTEXTOUTA
+  PEMREXTTEXTOUTW* = ptr EMREXTTEXTOUTA
+  EMRFILLPATH* = record
+    emr*: EMR
+    rclBounds*: RECTL
+
+  tagEMRFILLPATH* = EMRFILLPATH
+  TEMRFILLPATH* = EMRFILLPATH
+  PEMRFILLPATH* = ptr EMRFILLPATH
+  EMRSTROKEANDFILLPATH* = EMRFILLPATH
+  TEMRSTROKEANDFILLPATH* = EMRFILLPATH
+  PEMRSTROKEANDFILLPATH* = ptr EMRFILLPATH
+  EMRSTROKEPATH* = EMRFILLPATH
+  TEMRSTROKEPATH* = EMRFILLPATH
+  PEMRSTROKEPATH* = ptr EMRFILLPATH
+  EMRFILLRGN* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cbRgnData*: DWORD
+    ihBrush*: DWORD
+    RgnData*: array[0..0, int8]
+
+  tagEMRFILLRGN* = EMRFILLRGN
+  TEMRFILLRGN* = EMRFILLRGN
+  PEMRFILLRGN* = ptr EMRFILLRGN
+  EMRFORMAT* = record
+    dSignature*: DWORD
+    nVersion*: DWORD
+    cbData*: DWORD
+    offData*: DWORD
+
+  tagEMRFORMAT* = EMRFORMAT
+  TEMRFORMAT* = EMRFORMAT
+  PEMRFORMAT* = ptr EMRFORMAT
+  SIZE* = record
+    cx*: LONG
+    cy*: LONG
+
+  LPSIZE* = ptr SIZE
+  tagSIZE* = SIZE
+  TSIZE* = SIZE
+  PSIZE* = ptr SIZE
+  SIZEL* = SIZE
+  TSIZEL* = SIZE
+  PSIZEL* = ptr SIZE
+  LPSIZEL* = ptr SIZE
+  EMRFRAMERGN* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cbRgnData*: DWORD
+    ihBrush*: DWORD
+    szlStroke*: SIZEL
+    RgnData*: array[0..0, int8]
+
+  tagEMRFRAMERGN* = EMRFRAMERGN
+  TEMRFRAMERGN* = EMRFRAMERGN
+  PEMRFRAMERGN* = ptr EMRFRAMERGN
+  EMRGDICOMMENT* = record
+    emr*: EMR
+    cbData*: DWORD
+    Data*: array[0..0, int8]
+
+  tagEMRGDICOMMENT* = EMRGDICOMMENT
+  TEMRGDICOMMENT* = EMRGDICOMMENT
+  PEMRGDICOMMENT* = ptr EMRGDICOMMENT
+  EMRINVERTRGN* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cbRgnData*: DWORD
+    RgnData*: array[0..0, int8]
+
+  tagEMRINVERTRGN* = EMRINVERTRGN
+  TEMRINVERTRGN* = EMRINVERTRGN
+  PEMRINVERTRGN* = ptr EMRINVERTRGN
+  EMRPAINTRGN* = EMRINVERTRGN
+  TEMRPAINTRGN* = EMRINVERTRGN
+  PEMRPAINTRGN* = ptr EMRINVERTRGN
+  EMRLINETO* = record
+    emr*: EMR
+    ptl*: POINTL
+
+  tagEMRLINETO* = EMRLINETO
+  TEMRLINETO* = EMRLINETO
+  PEMRLINETO* = ptr EMRLINETO
+  EMRMOVETOEX* = EMRLINETO
+  TEMRMOVETOEX* = EMRLINETO
+  PEMRMOVETOEX* = ptr EMRLINETO
+  EMRMASKBLT* = record
+    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
+
+  tagEMRMASKBLT* = EMRMASKBLT
+  TEMRMASKBLT* = EMRMASKBLT
+  PEMRMASKBLT* = ptr EMRMASKBLT
+  EMRMODIFYWORLDTRANSFORM* = record
+    emr*: EMR
+    xform*: XFORM
+    iMode*: DWORD
+
+  tagEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM
+  TEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM
+  PEMRMODIFYWORLDTRANSFORM* = EMRMODIFYWORLDTRANSFORM
+  EMROFFSETCLIPRGN* = record
+    emr*: EMR
+    ptlOffset*: POINTL
+
+  tagEMROFFSETCLIPRGN* = EMROFFSETCLIPRGN
+  TEMROFFSETCLIPRGN* = EMROFFSETCLIPRGN
+  PEMROFFSETCLIPRGN* = ptr EMROFFSETCLIPRGN
+  EMRPLGBLT* = record
+    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
+
+  tagEMRPLGBLT* = EMRPLGBLT
+  TEMRPLGBLT* = EMRPLGBLT
+  PEMRPLGBLT* = ptr EMRPLGBLT
+  EMRPOLYDRAW* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cptl*: DWORD
+    aptl*: array[0..0, POINTL]
+    abTypes*: array[0..0, int8]
+
+  tagEMRPOLYDRAW* = EMRPOLYDRAW
+  TEMRPOLYDRAW* = EMRPOLYDRAW
+  PEMRPOLYDRAW* = ptr EMRPOLYDRAW
+  EMRPOLYDRAW16* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cpts*: DWORD
+    apts*: array[0..0, POINTS]
+    abTypes*: array[0..0, int8]
+
+  tagEMRPOLYDRAW16* = EMRPOLYDRAW16
+  TEMRPOLYDRAW16* = EMRPOLYDRAW16
+  PEMRPOLYDRAW16* = ptr EMRPOLYDRAW16
+  EMRPOLYLINE* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cptl*: DWORD
+    aptl*: array[0..0, POINTL]
+
+  tagEMRPOLYLINE* = EMRPOLYLINE
+  TEMRPOLYLINE* = EMRPOLYLINE
+  PEMRPOLYLINE* = ptr EMRPOLYLINE
+  EMRPOLYBEZIER* = EMRPOLYLINE
+  TEMRPOLYBEZIER* = EMRPOLYLINE
+  PEMRPOLYBEZIER* = ptr EMRPOLYLINE
+  EMRPOLYGON* = EMRPOLYLINE
+  TEMRPOLYGON* = EMRPOLYLINE
+  PEMRPOLYGON* = ptr EMRPOLYLINE
+  EMRPOLYBEZIERTO* = EMRPOLYLINE
+  TEMRPOLYBEZIERTO* = EMRPOLYLINE
+  PEMRPOLYBEZIERTO* = ptr EMRPOLYLINE
+  EMRPOLYLINETO* = EMRPOLYLINE
+  TEMRPOLYLINETO* = EMRPOLYLINE
+  PEMRPOLYLINETO* = ptr EMRPOLYLINE
+  EMRPOLYLINE16* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    cpts*: DWORD
+    apts*: array[0..0, POINTL]
+
+  tagEMRPOLYLINE16* = EMRPOLYLINE16
+  TEMRPOLYLINE16* = EMRPOLYLINE16
+  PEMRPOLYLINE16* = ptr EMRPOLYLINE16
+  EMRPOLYBEZIER16* = EMRPOLYLINE16
+  TEMRPOLYBEZIER16* = EMRPOLYLINE16
+  PEMRPOLYBEZIER16* = ptr EMRPOLYLINE16
+  EMRPOLYGON16* = EMRPOLYLINE16
+  TEMRPOLYGON16* = EMRPOLYLINE16
+  PEMRPOLYGON16* = ptr EMRPOLYLINE16
+  EMRPOLYBEZIERTO16* = EMRPOLYLINE16
+  TEMRPOLYBEZIERTO16* = EMRPOLYLINE16
+  PEMRPOLYBEZIERTO16* = ptr EMRPOLYLINE16
+  EMRPOLYLINETO16* = EMRPOLYLINE16
+  TEMRPOLYLINETO16* = EMRPOLYLINE16
+  PEMRPOLYLINETO16* = ptr EMRPOLYLINE16
+  EMRPOLYPOLYLINE* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    nPolys*: DWORD
+    cptl*: DWORD
+    aPolyCounts*: array[0..0, DWORD]
+    aptl*: array[0..0, POINTL]
+
+  tagEMRPOLYPOLYLINE* = EMRPOLYPOLYLINE
+  TEMRPOLYPOLYLINE* = EMRPOLYPOLYLINE
+  PEMRPOLYPOLYLINE* = ptr EMRPOLYPOLYLINE
+  EMRPOLYPOLYGON* = EMRPOLYPOLYLINE
+  TEMRPOLYPOLYGON* = EMRPOLYPOLYLINE
+  PEMRPOLYPOLYGON* = ptr EMRPOLYPOLYLINE
+  EMRPOLYPOLYLINE16* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    nPolys*: DWORD
+    cpts*: DWORD
+    aPolyCounts*: array[0..0, DWORD]
+    apts*: array[0..0, POINTS]
+
+  tagEMRPOLYPOLYLINE16* = EMRPOLYPOLYLINE16
+  TEMRPOLYPOLYLINE16* = EMRPOLYPOLYLINE16
+  PEMRPOLYPOLYLINE16* = ptr EMRPOLYPOLYLINE16
+  EMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16
+  TEMRPOLYPOLYGON16* = EMRPOLYPOLYLINE16
+  PEMRPOLYPOLYGON16* = ptr EMRPOLYPOLYLINE16
+  EMRPOLYTEXTOUTA* = record
+    emr*: EMR
+    rclBounds*: RECTL
+    iGraphicsMode*: DWORD
+    exScale*: float32
+    eyScale*: float32
+    cStrings*: LONG
+    aemrtext*: array[0..0, EMRTEXT]
+
+  tagEMRPOLYTEXTOUTA* = EMRPOLYTEXTOUTA
+  TEMRPOLYTEXTOUTA* = EMRPOLYTEXTOUTA
+  PEMRPOLYTEXTOUTA* = ptr EMRPOLYTEXTOUTA
+  EMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA
+  TEMRPOLYTEXTOUTW* = EMRPOLYTEXTOUTA
+  PEMRPOLYTEXTOUTW* = ptr EMRPOLYTEXTOUTA
+  EMRRESIZEPALETTE* = record
+    emr*: EMR
+    ihPal*: DWORD
+    cEntries*: DWORD
+
+  tagEMRRESIZEPALETTE* = EMRRESIZEPALETTE
+  TEMRRESIZEPALETTE* = EMRRESIZEPALETTE
+  PEMRRESIZEPALETTE* = ptr EMRRESIZEPALETTE
+  EMRRESTOREDC* = record
+    emr*: EMR
+    iRelative*: LONG
+
+  tagEMRRESTOREDC* = EMRRESTOREDC
+  TEMRRESTOREDC* = EMRRESTOREDC
+  PEMRRESTOREDC* = ptr EMRRESTOREDC
+  EMRROUNDRECT* = record
+    emr*: EMR
+    rclBox*: RECTL
+    szlCorner*: SIZEL
+
+  tagEMRROUNDRECT* = EMRROUNDRECT
+  TEMRROUNDRECT* = EMRROUNDRECT
+  PEMRROUNDRECT* = ptr EMRROUNDRECT
+  EMRSCALEVIEWPORTEXTEX* = record
+    emr*: EMR
+    xNum*: LONG
+    xDenom*: LONG
+    yNum*: LONG
+    yDenom*: LONG
+
+  tagEMRSCALEVIEWPORTEXTEX* = EMRSCALEVIEWPORTEXTEX
+  TEMRSCALEVIEWPORTEXTEX* = EMRSCALEVIEWPORTEXTEX
+  PEMRSCALEVIEWPORTEXTEX* = ptr EMRSCALEVIEWPORTEXTEX
+  EMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX
+  TEMRSCALEWINDOWEXTEX* = EMRSCALEVIEWPORTEXTEX
+  PEMRSCALEWINDOWEXTEX* = ptr EMRSCALEVIEWPORTEXTEX
+  EMRSELECTCOLORSPACE* = record
+    emr*: EMR
+    ihCS*: DWORD
+
+  tagEMRSELECTCOLORSPACE* = EMRSELECTCOLORSPACE
+  TEMRSELECTCOLORSPACE* = EMRSELECTCOLORSPACE
+  PEMRSELECTCOLORSPACE* = ptr EMRSELECTCOLORSPACE
+  EMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE
+  TEMRDELETECOLORSPACE* = EMRSELECTCOLORSPACE
+  PEMRDELETECOLORSPACE* = ptr EMRSELECTCOLORSPACE
+  EMRSELECTOBJECT* = record
+    emr*: EMR
+    ihObject*: DWORD
+
+  tagEMRSELECTOBJECT* = EMRSELECTOBJECT
+  TEMRSELECTOBJECT* = EMRSELECTOBJECT
+  PEMRSELECTOBJECT* = ptr EMRSELECTOBJECT
+  EMRDELETEOBJECT* = EMRSELECTOBJECT
+  TEMRDELETEOBJECT* = EMRSELECTOBJECT
+  PEMRDELETEOBJECT* = ptr EMRSELECTOBJECT
+  EMRSELECTPALETTE* = record
+    emr*: EMR
+    ihPal*: DWORD
+
+  tagEMRSELECTPALETTE* = EMRSELECTPALETTE
+  TEMRSELECTPALETTE* = EMRSELECTPALETTE
+  PEMRSELECTPALETTE* = ptr EMRSELECTPALETTE
+  EMRSETARCDIRECTION* = record
+    emr*: EMR
+    iArcDirection*: DWORD
+
+  tagEMRSETARCDIRECTION* = EMRSETARCDIRECTION
+  TEMRSETARCDIRECTION* = EMRSETARCDIRECTION
+  PEMRSETARCDIRECTION* = ptr EMRSETARCDIRECTION
+  EMRSETBKCOLOR* = record
+    emr*: EMR
+    crColor*: COLORREF
+
+  tagEMRSETTEXTCOLOR* = EMRSETBKCOLOR
+  TEMRSETBKCOLOR* = EMRSETBKCOLOR
+  PEMRSETBKCOLOR* = ptr EMRSETBKCOLOR
+  EMRSETTEXTCOLOR* = EMRSETBKCOLOR
+  TEMRSETTEXTCOLOR* = EMRSETBKCOLOR
+  PEMRSETTEXTCOLOR* = ptr EMRSETBKCOLOR
+  EMRSETCOLORADJUSTMENT* = record
+    emr*: EMR
+    ColorAdjustment*: COLORADJUSTMENT
+
+  tagEMRSETCOLORADJUSTMENT* = EMRSETCOLORADJUSTMENT
+  TEMRSETCOLORADJUSTMENT* = EMRSETCOLORADJUSTMENT
+  PEMRSETCOLORADJUSTMENT* = ptr EMRSETCOLORADJUSTMENT
+  EMRSETDIBITSTODEVICE* = record
+    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
+
+  tagEMRSETDIBITSTODEVICE* = EMRSETDIBITSTODEVICE
+  TEMRSETDIBITSTODEVICE* = EMRSETDIBITSTODEVICE
+  PEMRSETDIBITSTODEVICE* = ptr EMRSETDIBITSTODEVICE
+  EMRSETMAPPERFLAGS* = record
+    emr*: EMR
+    dwFlags*: DWORD
+
+  tagEMRSETMAPPERFLAGS* = EMRSETMAPPERFLAGS
+  TEMRSETMAPPERFLAGS* = EMRSETMAPPERFLAGS
+  PEMRSETMAPPERFLAGS* = ptr EMRSETMAPPERFLAGS
+  EMRSETMITERLIMIT* = record
+    emr*: EMR
+    eMiterLimit*: float32
+
+  tagEMRSETMITERLIMIT* = EMRSETMITERLIMIT
+  TEMRSETMITERLIMIT* = EMRSETMITERLIMIT
+  PEMRSETMITERLIMIT* = ptr EMRSETMITERLIMIT
+  EMRSETPALETTEENTRIES* = record
+    emr*: EMR
+    ihPal*: DWORD
+    iStart*: DWORD
+    cEntries*: DWORD
+    aPalEntries*: array[0..0, PALETTEENTRY]
+
+  tagEMRSETPALETTEENTRIES* = EMRSETPALETTEENTRIES
+  TEMRSETPALETTEENTRIES* = EMRSETPALETTEENTRIES
+  PEMRSETPALETTEENTRIES* = ptr EMRSETPALETTEENTRIES
+  EMRSETPIXELV* = record
+    emr*: EMR
+    ptlPixel*: POINTL
+    crColor*: COLORREF
+
+  tagEMRSETPIXELV* = EMRSETPIXELV
+  TEMRSETPIXELV* = EMRSETPIXELV
+  PEMRSETPIXELV* = ptr EMRSETPIXELV
+  EMRSETVIEWPORTEXTEX* = record
+    emr*: EMR
+    szlExtent*: SIZEL
+
+  tagEMRSETVIEWPORTEXTEX* = EMRSETVIEWPORTEXTEX
+  TEMRSETVIEWPORTEXTEX* = EMRSETVIEWPORTEXTEX
+  PEMRSETVIEWPORTEXTEX* = ptr EMRSETVIEWPORTEXTEX
+  EMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX
+  TEMRSETWINDOWEXTEX* = EMRSETVIEWPORTEXTEX
+  PEMRSETWINDOWEXTEX* = ptr EMRSETVIEWPORTEXTEX
+  EMRSETVIEWPORTORGEX* = record
+    emr*: EMR
+    ptlOrigin*: POINTL
+
+  tagEMRSETVIEWPORTORGEX* = EMRSETVIEWPORTORGEX
+  TEMRSETVIEWPORTORGEX* = EMRSETVIEWPORTORGEX
+  PEMRSETVIEWPORTORGEX* = ptr EMRSETVIEWPORTORGEX
+  EMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX
+  TEMRSETWINDOWORGEX* = EMRSETVIEWPORTORGEX
+  PEMRSETWINDOWORGEX* = ptr EMRSETVIEWPORTORGEX
+  EMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX
+  TEMRSETBRUSHORGEX* = EMRSETVIEWPORTORGEX
+  PEMRSETBRUSHORGEX* = ptr EMRSETVIEWPORTORGEX
+  EMRSETWORLDTRANSFORM* = record
+    emr*: EMR
+    xform*: XFORM
+
+  tagEMRSETWORLDTRANSFORM* = EMRSETWORLDTRANSFORM
+  TEMRSETWORLDTRANSFORM* = EMRSETWORLDTRANSFORM
+  PEMRSETWORLDTRANSFORM* = ptr EMRSETWORLDTRANSFORM
+  EMRSTRETCHBLT* = record
+    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
+
+  tagEMRSTRETCHBLT* = EMRSTRETCHBLT
+  TEMRSTRETCHBLT* = EMRSTRETCHBLT
+  PEMRSTRETCHBLT* = ptr EMRSTRETCHBLT
+  EMRSTRETCHDIBITS* = record
+    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
+
+  tagEMRSTRETCHDIBITS* = EMRSTRETCHDIBITS
+  TEMRSTRETCHDIBITS* = EMRSTRETCHDIBITS
+  PEMRSTRETCHDIBITS* = ptr EMRSTRETCHDIBITS
+  EMRABORTPATH* = record
+    emr*: EMR
+
+  TEMRABORTPATH* = EMRABORTPATH
+  PEMRABORTPATH* = ptr EMRABORTPATH
+  tagABORTPATH* = EMRABORTPATH
+  TABORTPATH* = EMRABORTPATH
+  EMRBEGINPATH* = EMRABORTPATH
+  TEMRBEGINPATH* = EMRABORTPATH
+  PEMRBEGINPATH* = ptr EMRABORTPATH
+  EMRENDPATH* = EMRABORTPATH
+  TEMRENDPATH* = EMRABORTPATH
+  PEMRENDPATH* = ptr EMRABORTPATH
+  EMRCLOSEFIGURE* = EMRABORTPATH
+  TEMRCLOSEFIGURE* = EMRABORTPATH
+  PEMRCLOSEFIGURE* = ptr EMRABORTPATH
+  EMRFLATTENPATH* = EMRABORTPATH
+  TEMRFLATTENPATH* = EMRABORTPATH
+  PEMRFLATTENPATH* = ptr EMRABORTPATH
+  EMRWIDENPATH* = EMRABORTPATH
+  TEMRWIDENPATH* = EMRABORTPATH
+  PEMRWIDENPATH* = ptr EMRABORTPATH
+  EMRSETMETARGN* = EMRABORTPATH
+  TEMRSETMETARGN* = EMRABORTPATH
+  PEMRSETMETARGN* = ptr EMRABORTPATH
+  EMRSAVEDC* = EMRABORTPATH
+  TEMRSAVEDC* = EMRABORTPATH
+  PEMRSAVEDC* = ptr EMRABORTPATH
+  EMRREALIZEPALETTE* = EMRABORTPATH
+  TEMRREALIZEPALETTE* = EMRABORTPATH
+  PEMRREALIZEPALETTE* = ptr EMRABORTPATH
+  EMRSELECTCLIPPATH* = record
+    emr*: EMR
+    iMode*: DWORD
+
+  tagEMRSELECTCLIPPATH* = EMRSELECTCLIPPATH
+  TEMRSELECTCLIPPATH* = EMRSELECTCLIPPATH
+  PEMRSELECTCLIPPATH* = ptr EMRSELECTCLIPPATH
+  EMRSETBKMODE* = EMRSELECTCLIPPATH
+  TEMRSETBKMODE* = EMRSELECTCLIPPATH
+  PEMRSETBKMODE* = ptr EMRSELECTCLIPPATH
+  EMRSETMAPMODE* = EMRSELECTCLIPPATH
+  TEMRSETMAPMODE* = EMRSELECTCLIPPATH
+  PEMRSETMAPMODE* = ptr EMRSELECTCLIPPATH
+  EMRSETPOLYFILLMODE* = EMRSELECTCLIPPATH
+  TEMRSETPOLYFILLMODE* = EMRSELECTCLIPPATH
+  PEMRSETPOLYFILLMODE* = ptr EMRSELECTCLIPPATH
+  EMRSETROP2* = EMRSELECTCLIPPATH
+  TEMRSETROP2* = EMRSELECTCLIPPATH
+  PEMRSETROP2* = ptr EMRSELECTCLIPPATH
+  EMRSETSTRETCHBLTMODE* = EMRSELECTCLIPPATH
+  TEMRSETSTRETCHBLTMODE* = EMRSELECTCLIPPATH
+  PEMRSETSTRETCHBLTMODE* = ptr EMRSELECTCLIPPATH
+  EMRSETTEXTALIGN* = EMRSELECTCLIPPATH
+  TEMRSETTEXTALIGN* = EMRSELECTCLIPPATH
+  PEMRSETTEXTALIGN* = ptr EMRSELECTCLIPPATH
+  EMRENABLEICM* = EMRSELECTCLIPPATH
+  TEMRENABLEICM* = EMRSELECTCLIPPATH
+  PEMRENABLEICM* = ptr EMRSELECTCLIPPATH
+  NMHDR* = record
+    hwndFrom*: HWND
+    idFrom*: UINT
+    code*: UINT
+
+  tagNMHDR* = NMHDR
+  TNMHDR* = NMHDR
+  PNMHDR* = ptr NMHDR
+  TENCORRECTTEXT* = record
+    nmhdr*: NMHDR
+    chrg*: CHARRANGE
+    seltyp*: int16
+
+  Pencorrecttext* = ptr TENCORRECTTEXT
+  TENDROPFILES* = record
+    nmhdr*: NMHDR
+    hDrop*: HANDLE
+    cp*: LONG
+    fProtected*: WINBOOL
+
+  Pendropfiles* = ptr TENDROPFILES
+  TENSAVECLIPBOARD* = record
+    nmhdr*: NMHDR
+    cObjectCount*: LONG
+    cch*: LONG
+
+  PENSAVECLIPBOARD* = ptr TENSAVECLIPBOARD
+  TENOLEOPFAILED* = record
+    nmhdr*: NMHDR
+    iob*: LONG
+    lOper*: LONG
+    hr*: HRESULT
+
+  PENOLEOPFAILED* = ptr TENOLEOPFAILED
+  TENHMETAHEADER* = record
+    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 TENHMETAHEADER
+  PENHMETAHEADER* = ptr TENHMETAHEADER
+  TENHMETARECORD* = record
+    iType*: DWORD
+    nSize*: DWORD
+    dParm*: array[0..0, DWORD]
+
+  LPENHMETARECORD* = ptr TENHMETARECORD
+  PENHMETARECORD* = ptr TENHMETARECORD
+  TENPROTECTED* = record
+    nmhdr*: NMHDR
+    msg*: UINT
+    wParam*: WPARAM
+    lParam*: LPARAM
+    chrg*: CHARRANGE
+
+  Penprotected* = ptr TENPROTECTED
+  SERVICE_STATUS* = record
+    dwServiceType*: DWORD
+    dwCurrentState*: DWORD
+    dwControlsAccepted*: DWORD
+    dwWin32ExitCode*: DWORD
+    dwServiceSpecificExitCode*: DWORD
+    dwCheckPoint*: DWORD
+    dwWaitHint*: DWORD
+
+  LPSERVICE_STATUS* = ptr SERVICE_STATUS
+  TSERVICESTATUS* = SERVICE_STATUS
+  PSERVICESTATUS* = ptr SERVICE_STATUS
+  ENUM_SERVICE_STATUS* = record
+    lpServiceName*: LPTSTR
+    lpDisplayName*: LPTSTR
+    ServiceStatus*: SERVICE_STATUS
+
+  LPENUM_SERVICE_STATUS* = ptr ENUM_SERVICE_STATUS
+  TENUMSERVICESTATUS* = ENUM_SERVICE_STATUS
+  PENUMSERVICESTATUS* = ptr ENUM_SERVICE_STATUS
+  ENUMLOGFONT* = record
+    elfLogFont*: LOGFONT
+    elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR]
+    elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR]
+
+  TENUMLOGFONT* = ENUMLOGFONT
+  PENUMLOGFONT* = ptr ENUMLOGFONT
+  ENUMLOGFONTEX* = record
+    elfLogFont*: LOGFONT
+    elfFullName*: array[0..(LF_FULLFACESIZE) - 1, BCHAR]
+    elfStyle*: array[0..(LF_FACESIZE) - 1, BCHAR]
+    elfScript*: array[0..(LF_FACESIZE) - 1, BCHAR]
+
+  tagENUMLOGFONTEX* = ENUMLOGFONTEX
+  TENUMLOGFONTEX* = ENUMLOGFONTEX
+  PENUMLOGFONTEX* = ptr ENUMLOGFONTEX #
+                                      #    Then follow:
+                                      #
+                                      #    TCHAR SourceName[]
+                                      #    TCHAR Computername[]
+                                      #    SID   UserSid
+                                      #    TCHAR Strings[]
+                                      #    BYTE  Data[]
+                                      #    CHAR  Pad[]
+                                      #    DWORD Length;
+                                      #
+  EVENTLOGRECORD* = record
+    len*: 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
+
+  TEVENTLOGRECORD* = EVENTLOGRECORD
+  PEVENTLOGRECORD* = ptr EVENTLOGRECORD
+  EVENTMSG* = record
+    message*: UINT
+    paramL*: UINT
+    paramH*: UINT
+    time*: DWORD
+    hwnd*: HWND
+
+  tagEVENTMSG* = EVENTMSG
+  TEVENTMSG* = EVENTMSG
+  PEVENTMSG* = ptr EVENTMSG
+  EXCEPTION_POINTERS* = record
+    ExceptionRecord*: PEXCEPTION_RECORD
+    ContextRecord*: PCONTEXT
+
+  LPEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS
+  PEXCEPTION_POINTERS* = ptr EXCEPTION_POINTERS
+  TEXCEPTIONPOINTERS* = EXCEPTION_POINTERS
+  EXT_BUTTON* = record
+    idCommand*: int16
+    idsHelp*: int16
+    fsStyle*: int16
+
+  LPEXT_BUTTON* = ptr EXT_BUTTON
+  TEXTBUTTON* = EXT_BUTTON
+  PEXTBUTTON* = ptr EXT_BUTTON
+  FILTERKEYS* = record
+    cbSize*: UINT
+    dwFlags*: DWORD
+    iWaitMSec*: DWORD
+    iDelayMSec*: DWORD
+    iRepeatMSec*: DWORD
+    iBounceMSec*: DWORD
+
+  TFILTERKEYS* = FILTERKEYS
+  PFILTERKEYS* = ptr FILTERKEYS
+  FIND_NAME_BUFFER* = record
+    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]
+
+  TFINDNAMEBUFFER* = FIND_NAME_BUFFER
+  PFINDNAMEBUFFER* = ptr FIND_NAME_BUFFER
+  FIND_NAME_HEADER* = record
+    node_count*: int16
+    reserved*: UCHAR
+    unique_group*: UCHAR
+
+  TFINDNAMEHEADER* = FIND_NAME_HEADER
+  PFINDNAMEHEADER* = ptr FIND_NAME_HEADER
+  FINDREPLACE* = record
+    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
+  TFINDREPLACE* = FINDREPLACE
+  PFINDREPLACE* = ptr FINDREPLACE #FINDTEXT = record conflicts with FindText function
+  TFINDTEXT* = record
+    chrg*: CHARRANGE
+    lpstrText*: LPSTR
+
+  Pfindtext* = ptr TFINDTEXT
+  FINDTEXTEX* = record
+    chrg*: CHARRANGE
+    lpstrText*: LPSTR
+    chrgText*: CHARRANGE
+
+  Tfindtextex* = FINDTEXTEX
+  Pfindtextex* = ptr FINDTEXTEX
+  FMS_GETDRIVEINFO* = record
+    dwTotalSpace*: DWORD
+    dwFreeSpace*: DWORD
+    szPath*: array[0..259, TCHAR]
+    szVolume*: array[0..13, TCHAR]
+    szShare*: array[0..127, TCHAR]
+
+  TFMSGETDRIVEINFO* = FMS_GETDRIVEINFO
+  PFMSGETDRIVEINFO* = ptr FMS_GETDRIVEINFO
+  FMS_GETFILESEL* = record
+    ftTime*: FILETIME
+    dwSize*: DWORD
+    bAttr*: int8
+    szName*: array[0..259, TCHAR]
+
+  TFMSGETFILESEL* = FMS_GETFILESEL
+  PFMSGETFILESEL* = ptr FMS_GETFILESEL
+  FMS_LOAD* = record
+    dwSize*: DWORD
+    szMenuName*: array[0..(MENU_TEXT_LEN) - 1, TCHAR]
+    hMenu*: HMENU
+    wMenuDelta*: UINT
+
+  TFMSLOAD* = FMS_LOAD
+  PFMSLOAD* = ptr FMS_LOAD
+  FMS_TOOLBARLOAD* = record
+    dwSize*: DWORD
+    lpButtons*: LPEXT_BUTTON
+    cButtons*: int16
+    cBitmaps*: int16
+    idBitmap*: int16
+    hBitmap*: HBITMAP
+
+  TFMSTOOLBARLOAD* = FMS_TOOLBARLOAD
+  PFMSTOOLBARLOAD* = ptr FMS_TOOLBARLOAD
+  FOCUS_EVENT_RECORD* = record
+    bSetFocus*: WINBOOL
+
+  TFOCUSEVENTRECORD* = FOCUS_EVENT_RECORD
+  PFOCUSEVENTRECORD* = ptr FOCUS_EVENT_RECORD
+  FORM_INFO_1* = record
+    Flags*: DWORD
+    pName*: LPTSTR
+    Size*: SIZEL
+    ImageableArea*: RECTL
+
+  TFORMINFO1* = FORM_INFO_1
+  PFORMINFO1* = ptr FORM_INFO_1
+  FORMAT_PARAMETERS* = record
+    MediaType*: MEDIA_TYPE
+    StartCylinderNumber*: DWORD
+    EndCylinderNumber*: DWORD
+    StartHeadNumber*: DWORD
+    EndHeadNumber*: DWORD
+
+  TFORMATPARAMETERS* = FORMAT_PARAMETERS
+  PFORMATPARAMETERS* = ptr FORMAT_PARAMETERS
+  FORMATRANGE* = record
+    hdc*: HDC
+    hdcTarget*: HDC
+    rc*: RECT
+    rcPage*: RECT
+    chrg*: CHARRANGE
+
+  Tformatrange* = FORMATRANGE
+  Pformatrange* = ptr FORMATRANGE
+  GCP_RESULTS* = record
+    lStructSize*: DWORD
+    lpOutString*: LPTSTR
+    lpOrder*: ptr UINT
+    lpDx*: ptr WINT
+    lpCaretPos*: ptr WINT
+    lpClass*: LPTSTR
+    lpGlyphs*: ptr UINT
+    nGlyphs*: UINT
+    nMaxFit*: UINT
+
+  LPGCP_RESULTS* = ptr GCP_RESULTS
+  tagGCP_RESULTS* = GCP_RESULTS
+  TGCPRESULTS* = GCP_RESULTS
+  PGCPRESULTS* = ptr GCP_RESULTS
+  GENERIC_MAPPING* = record
+    GenericRead*: ACCESS_MASK
+    GenericWrite*: ACCESS_MASK
+    GenericExecute*: ACCESS_MASK
+    GenericAll*: ACCESS_MASK
+
+  PGENERIC_MAPPING* = ptr GENERIC_MAPPING
+  TGENERICMAPPING* = GENERIC_MAPPING
+  GLYPHMETRICS* = record
+    gmBlackBoxX*: UINT
+    gmBlackBoxY*: UINT
+    gmptGlyphOrigin*: POINT
+    gmCellIncX*: SHORT
+    gmCellIncY*: SHORT
+
+  LPGLYPHMETRICS* = ptr GLYPHMETRICS
+  TGLYPHMETRICS* = GLYPHMETRICS
+  PGLYPHMETRICS* = ptr GLYPHMETRICS
+  HANDLETABLE* = record
+    objectHandle*: array[0..0, HGDIOBJ]
+
+  tagHANDLETABLE* = HANDLETABLE
+  THANDLETABLE* = HANDLETABLE
+  LPHANDLETABLE* = ptr HANDLETABLE
+  HD_HITTESTINFO* = record
+    pt*: POINT
+    flags*: UINT
+    iItem*: int32
+
+  THDHITTESTINFO* = HD_HITTESTINFO
+  PHDHITTESTINFO* = ptr HD_HITTESTINFO
+  HD_ITEM* = record
+    mask*: UINT
+    cxy*: int32
+    pszText*: LPTSTR
+    hbm*: HBITMAP
+    cchTextMax*: int32
+    fmt*: int32
+    lParam*: LPARAM
+
+  THDITEM* = HD_ITEM
+  PHDITEM* = ptr HD_ITEM
+  WINDOWPOS* = record
+    hwnd*: HWND
+    hwndInsertAfter*: HWND
+    x*: int32
+    y*: int32
+    cx*: int32
+    cy*: int32
+    flags*: UINT
+
+  LPWINDOWPOS* = ptr WINDOWPOS
+  TWINDOWPOS* = WINDOWPOS
+  PWINDOWPOS* = ptr WINDOWPOS
+  HD_LAYOUT* = record
+    prc*: ptr RECT
+    pwpos*: ptr WINDOWPOS
+
+  THDLAYOUT* = HD_LAYOUT
+  PHDLAYOUT* = ptr HD_LAYOUT
+  HD_NOTIFY* = record
+    hdr*: NMHDR
+    iItem*: int32
+    iButton*: int32
+    pitem*: ptr HD_ITEM
+
+  THDNOTIFY* = HD_NOTIFY
+  PHDNOTIFY* = ptr HD_NOTIFY
+  HELPINFO* = record
+    cbSize*: UINT
+    iContextType*: int32
+    iCtrlId*: int32
+    hItemHandle*: HANDLE
+    dwContextId*: DWORD
+    MousePos*: POINT
+
+  LPHELPINFO* = ptr HELPINFO
+  tagHELPINFO* = HELPINFO
+  THELPINFO* = HELPINFO
+  PHELPINFO* = ptr HELPINFO
+  HELPWININFO* = record
+    wStructSize*: int32
+    x*: int32
+    y*: int32
+    dx*: int32
+    dy*: int32
+    wMax*: int32
+    rgchMember*: array[0..1, TCHAR]
+
+  THELPWININFO* = HELPWININFO
+  PHELPWININFO* = ptr HELPWININFO
+  HIGHCONTRAST* = record
+    cbSize*: UINT
+    dwFlags*: DWORD
+    lpszDefaultScheme*: LPTSTR
+
+  LPHIGHCONTRAST* = ptr HIGHCONTRAST
+  tagHIGHCONTRAST* = HIGHCONTRAST
+  THIGHCONTRAST* = HIGHCONTRAST
+  PHIGHCONTRAST* = ptr HIGHCONTRAST
+  HSZPAIR* = record
+    hszSvc*: HSZ
+    hszTopic*: HSZ
+
+  tagHSZPAIR* = HSZPAIR
+  THSZPAIR* = HSZPAIR
+  PHSZPAIR* = ptr HSZPAIR
+  ICONINFO* = record
+    fIcon*: WINBOOL
+    xHotspot*: DWORD
+    yHotspot*: DWORD
+    hbmMask*: HBITMAP
+    hbmColor*: HBITMAP
+
+  TICONINFO* = ICONINFO
+  PICONINFO* = ptr ICONINFO
+  ICONMETRICS* = record
+    cbSize*: UINT
+    iHorzSpacing*: int32
+    iVertSpacing*: int32
+    iTitleWrap*: int32
+    lfFont*: LOGFONT
+
+  LPICONMETRICS* = ptr ICONMETRICS
+  tagICONMETRICS* = ICONMETRICS
+  TICONMETRICS* = ICONMETRICS
+  PICONMETRICS* = ptr ICONMETRICS
+  IMAGEINFO* = record
+    hbmImage*: HBITMAP
+    hbmMask*: HBITMAP
+    Unused1*: int32
+    Unused2*: int32
+    rcImage*: RECT
+
+  TIMAGEINFO* = IMAGEINFO
+  PIMAGEINFO* = ptr IMAGEINFO
+  KEY_EVENT_RECORD* = record
+    bKeyDown*: WINBOOL
+    wRepeatCount*: int16
+    wVirtualKeyCode*: int16
+    wVirtualScanCode*: int16
+    UnicodeChar*: WCHAR
+    dwControlKeyState*: DWORD # other union part: AsciiChar: CHAR
+
+  TKEYEVENTRECORD* = KEY_EVENT_RECORD
+  PKEYEVENTRECORD* = ptr KEY_EVENT_RECORD
+  MOUSE_EVENT_RECORD* = record
+    dwMousePosition*: COORD
+    dwButtonState*: DWORD
+    dwControlKeyState*: DWORD
+    dwEventFlags*: DWORD
+
+  TMOUSEEVENTRECORD* = MOUSE_EVENT_RECORD
+  PMOUSEEVENTRECORD* = ptr MOUSE_EVENT_RECORD
+  WINDOW_BUFFER_SIZE_RECORD* = record
+    dwSize*: COORD
+
+  TWINDOWBUFFERSIZERECORD* = WINDOW_BUFFER_SIZE_RECORD
+  PWINDOWBUFFERSIZERECORD* = ptr WINDOW_BUFFER_SIZE_RECORD
+  MENU_EVENT_RECORD* = record
+    dwCommandId*: UINT
+
+  PMENU_EVENT_RECORD* = ptr MENU_EVENT_RECORD
+  TMENUEVENTRECORD* = MENU_EVENT_RECORD
+  INPUT_RECORD* = record
+    EventType*: int16
+    Reserved*: int16
+    event*: array[0..5, DWORD] #Event : record case longint of
+                               #                 0 : ( KeyEvent : KEY_EVENT_RECORD );
+                               #                 1 : ( MouseEvent : MOUSE_EVENT_RECORD );
+                               #                 2 : ( WindowBufferSizeEvent : WINDOW_BUFFER_SIZE_RECORD );
+                               #                 3 : ( MenuEvent : MENU_EVENT_RECORD );
+                               #                 4 : ( FocusEvent : FOCUS_EVENT_RECORD );
+                               #       end;
+
+  PINPUT_RECORD* = ptr INPUT_RECORD
+  TINPUTRECORD* = INPUT_RECORD
+  SYSTEMTIME* = record
+    wYear*: int16
+    wMonth*: int16
+    wDayOfWeek*: int16
+    wDay*: int16
+    wHour*: int16
+    wMinute*: int16
+    wSecond*: int16
+    wMilliseconds*: int16
+
+  LPSYSTEMTIME* = ptr SYSTEMTIME
+  TSYSTEMTIME* = SYSTEMTIME
+  PSYSTEMTIME* = ptr SYSTEMTIME
+  JOB_INFO_1* = record
+    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
+
+  TJOBINFO1* = JOB_INFO_1
+  PJOBINFO1* = ptr JOB_INFO_1
+  SID_IDENTIFIER_AUTHORITY* = record
+    Value*: array[0..5, int8]
+
+  LPSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY
+  PSID_IDENTIFIER_AUTHORITY* = ptr SID_IDENTIFIER_AUTHORITY
+  TSIDIDENTIFIERAUTHORITY* = SID_IDENTIFIER_AUTHORITY
+  SID* = record
+    Revision*: int8
+    SubAuthorityCount*: int8
+    IdentifierAuthority*: SID_IDENTIFIER_AUTHORITY
+    SubAuthority*: array[0..(ANYSIZE_ARRAY) - 1, DWORD]
+
+  TSID* = SID
+  PSID* = ptr SID
+  SECURITY_DESCRIPTOR_CONTROL* = int16
+  PSECURITY_DESCRIPTOR_CONTROL* = ptr SECURITY_DESCRIPTOR_CONTROL
+  TSECURITYDESCRIPTORCONTROL* = SECURITY_DESCRIPTOR_CONTROL
+  SECURITY_DESCRIPTOR* = record
+    Revision*: int8
+    Sbz1*: int8
+    Control*: SECURITY_DESCRIPTOR_CONTROL
+    Owner*: PSID
+    Group*: PSID
+    Sacl*: PACL
+    Dacl*: PACL
+
+  PSECURITY_DESCRIPTOR* = ptr SECURITY_DESCRIPTOR
+  TSECURITYDESCRIPTOR* = SECURITY_DESCRIPTOR
+  JOB_INFO_2* = record
+    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
+
+  TJOBINFO2* = JOB_INFO_2
+  PJOBINFO2* = ptr JOB_INFO_2
+  KERNINGPAIR* = record
+    wFirst*: int16
+    wSecond*: int16
+    iKernAmount*: int32
+
+  LPKERNINGPAIR* = ptr KERNINGPAIR
+  TKERNINGPAIR* = KERNINGPAIR
+  PKERNINGPAIR* = ptr KERNINGPAIR
+  LANA_ENUM* = record
+    len*: UCHAR
+    lana*: array[0..(MAX_LANA) - 1, UCHAR]
+
+  TLANAENUM* = LANA_ENUM
+  PLANAENUM* = ptr LANA_ENUM
+  LDT_ENTRY* = record
+    LimitLow*: int16
+    BaseLow*: int16
+    BaseMid*: int8
+    Flags1*: int8
+    Flags2*: int8
+    BaseHi*: int8
+
+  LPLDT_ENTRY* = ptr LDT_ENTRY
+  PLDT_ENTRY* = ptr LDT_ENTRY
+  TLDTENTRY* = LDT_ENTRY
+
+const
+  bm_LDT_ENTRY_BaseMid* = 0x000000FF
+  bp_LDT_ENTRY_BaseMid* = 0
+  bm_LDT_ENTRY_Type* = 0x00001F00
+  bp_LDT_ENTRY_Type* = 8
+  bm_LDT_ENTRY_Dpl* = 0x00006000
+  bp_LDT_ENTRY_Dpl* = 13
+  bm_LDT_ENTRY_Pres* = 0x00008000
+  bp_LDT_ENTRY_Pres* = 15
+  bm_LDT_ENTRY_LimitHi* = 0x000F0000
+  bp_LDT_ENTRY_LimitHi* = 16
+  bm_LDT_ENTRY_Sys* = 0x00100000
+  bp_LDT_ENTRY_Sys* = 20
+  bm_LDT_ENTRY_Reserved_0* = 0x00200000
+  bp_LDT_ENTRY_Reserved_0* = 21
+  bm_LDT_ENTRY_Default_Big* = 0x00400000
+  bp_LDT_ENTRY_Default_Big* = 22
+  bm_LDT_ENTRY_Granularity* = 0x00800000
+  bp_LDT_ENTRY_Granularity* = 23
+  bm_LDT_ENTRY_BaseHi* = 0xFF000000
+  bp_LDT_ENTRY_BaseHi* = 24
+
+type
+  LOCALESIGNATURE* = record
+    lsUsb*: array[0..3, DWORD]
+    lsCsbDefault*: array[0..1, DWORD]
+    lsCsbSupported*: array[0..1, DWORD]
+
+  tagLOCALESIGNATURE* = LOCALESIGNATURE
+  TLOCALESIGNATURE* = LOCALESIGNATURE
+  PLOCALESIGNATURE* = ptr LOCALESIGNATURE
+  LOCALGROUP_MEMBERS_INFO_0* = record
+    lgrmi0_sid*: PSID
+
+  TLOCALGROUPMEMBERSINFO0* = LOCALGROUP_MEMBERS_INFO_0
+  PLOCALGROUPMEMBERSINFO0* = ptr LOCALGROUP_MEMBERS_INFO_0
+  LOCALGROUP_MEMBERS_INFO_3* = record
+    lgrmi3_domainandname*: LPWSTR
+
+  TLOCALGROUPMEMBERSINFO3* = LOCALGROUP_MEMBERS_INFO_3
+  PLOCALGROUPMEMBERSINFO3* = ptr LOCALGROUP_MEMBERS_INFO_3
+  FXPT16DOT16* = int32
+  LPFXPT16DOT16* = ptr FXPT16DOT16
+  TFXPT16DOT16* = FXPT16DOT16
+  PFXPT16DOT16* = ptr FXPT16DOT16
+  LUID* = TlargeInteger
+  TLUID* = LUID
+  PLUID* = ptr LUID
+  LUID_AND_ATTRIBUTES* = record
+    Luid*: LUID
+    Attributes*: DWORD
+
+  TLUIDANDATTRIBUTES* = LUID_AND_ATTRIBUTES
+  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
+  TLUIDANDATTRIBUTESARRAY* = LUID_AND_ATTRIBUTES_ARRAY
+  LV_COLUMN* = record
+    mask*: UINT
+    fmt*: int32
+    cx*: int32
+    pszText*: LPTSTR
+    cchTextMax*: int32
+    iSubItem*: int32
+
+  TLVCOLUMN* = LV_COLUMN
+  PLVCOLUMN* = ptr LV_COLUMN
+  LV_ITEM* = record
+    mask*: UINT
+    iItem*: int32
+    iSubItem*: int32
+    state*: UINT
+    stateMask*: UINT
+    pszText*: LPTSTR
+    cchTextMax*: int32
+    iImage*: int32
+    lParam*: LPARAM
+
+  TLVITEM* = LV_ITEM
+  PLVITEM* = ptr LV_ITEM
+  LV_DISPINFO* = record
+    hdr*: NMHDR
+    item*: LV_ITEM
+
+  tagLV_DISPINFO* = LV_DISPINFO
+  TLVDISPINFO* = LV_DISPINFO
+  PLVDISPINFO* = ptr LV_DISPINFO
+  LV_FINDINFO* = record
+    flags*: UINT
+    psz*: LPCTSTR
+    lParam*: LPARAM
+    pt*: POINT
+    vkDirection*: UINT
+
+  TLVFINDINFO* = LV_FINDINFO
+  PLVFINDINFO* = ptr LV_FINDINFO
+  LV_HITTESTINFO* = record
+    pt*: POINT
+    flags*: UINT
+    iItem*: int32
+
+  TLVHITTESTINFO* = LV_HITTESTINFO
+  PLVHITTESTINFO* = ptr LV_HITTESTINFO
+  LV_KEYDOWN* = record
+    hdr*: NMHDR
+    wVKey*: int16
+    flags*: UINT
+
+  tagLV_KEYDOWN* = LV_KEYDOWN
+  TLVKEYDOWN* = LV_KEYDOWN
+  PLVKEYDOWN* = ptr LV_KEYDOWN
+  MAT2* = record
+    eM11*: FIXED
+    eM12*: FIXED
+    eM21*: FIXED
+    eM22*: FIXED
+
+  TMAT2* = MAT2
+  PMAT2* = ptr MAT2
+  MDICREATESTRUCT* = record
+    szClass*: LPCTSTR
+    szTitle*: LPCTSTR
+    hOwner*: HANDLE
+    x*: int32
+    y*: int32
+    cx*: int32
+    cy*: int32
+    style*: DWORD
+    lParam*: LPARAM
+
+  LPMDICREATESTRUCT* = ptr MDICREATESTRUCT
+  tagMDICREATESTRUCT* = MDICREATESTRUCT
+  TMDICREATESTRUCT* = MDICREATESTRUCT
+  PMDICREATESTRUCT* = ptr MDICREATESTRUCT
+  MEASUREITEMSTRUCT* = record
+    CtlType*: UINT
+    CtlID*: UINT
+    itemID*: UINT
+    itemWidth*: UINT
+    itemHeight*: UINT
+    itemData*: ULONG_PTR
+
+  LPMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT
+  tagMEASUREITEMSTRUCT* = MEASUREITEMSTRUCT
+  TMEASUREITEMSTRUCT* = MEASUREITEMSTRUCT
+  PMEASUREITEMSTRUCT* = ptr MEASUREITEMSTRUCT
+  MEMORY_BASIC_INFORMATION* = record
+    BaseAddress*: PVOID
+    AllocationBase*: PVOID
+    AllocationProtect*: DWORD
+    RegionSize*: DWORD
+    State*: DWORD
+    Protect*: DWORD
+    `type`*: DWORD
+
+  PMEMORY_BASIC_INFORMATION* = ptr MEMORY_BASIC_INFORMATION
+  TMEMORYBASICINFORMATION* = MEMORY_BASIC_INFORMATION
+  MEMORYSTATUS* = record
+    dwLength*: DWORD
+    dwMemoryLoad*: DWORD
+    dwTotalPhys*: int
+    dwAvailPhys*: int
+    dwTotalPageFile*: int
+    dwAvailPageFile*: int
+    dwTotalVirtual*: int
+    dwAvailVirtual*: int
+
+  TGUID* = record
+    D1*: int32
+    D2*: int16
+    D3*: int16
+    D4*: array [0..7, int8]
+
+  LPMEMORYSTATUS* = ptr MEMORYSTATUS
+  TMEMORYSTATUS* = MEMORYSTATUS
+  PMEMORYSTATUS* = ptr MEMORYSTATUS
+  MENUEX_TEMPLATE_HEADER* = record
+    wVersion*: int16
+    wOffset*: int16
+    dwHelpId*: DWORD
+
+  TMENUXTEMPLATEHEADER* = MENUEX_TEMPLATE_HEADER
+  PMENUXTEMPLATEHEADER* = ptr MENUEX_TEMPLATE_HEADER
+  MENUEX_TEMPLATE_ITEM* = record
+    dwType*: DWORD
+    dwState*: DWORD
+    uId*: UINT
+    bResInfo*: int8
+    szText*: array[0..0, WCHAR]
+    dwHelpId*: DWORD
+
+  TMENUEXTEMPLATEITEM* = MENUEX_TEMPLATE_ITEM
+  PMENUEXTEMPLATEITEM* = ptr MENUEX_TEMPLATE_ITEM
+  MENUINFO* = record
+    cbSize*: DWORD
+    fMask*: DWORD
+    dwStyle*: DWORD
+    cyMax*: UINT
+    hbrBack*: HBRUSH
+    dwContextHelpID*: DWORD
+    dwMenuData*: ULONG_PTR
+
+  LPMENUINFO* = ptr MENUINFO
+  LPCMENUINFO* = ptr MENUINFO
+  tagMENUINFO* = MENUINFO
+  TMENUINFO* = MENUINFO
+  PMENUINFO* = ptr MENUINFO
+  MENUITEMINFO* = record
+    cbSize*: UINT
+    fMask*: UINT
+    fType*: UINT
+    fState*: UINT
+    wID*: UINT
+    hSubMenu*: HMENU
+    hbmpChecked*: HBITMAP
+    hbmpUnchecked*: HBITMAP
+    dwItemData*: ULONG_PTR
+    dwTypeData*: LPTSTR
+    cch*: UINT
+    hbmpItem*: HBITMAP
+
+  LPMENUITEMINFO* = ptr MENUITEMINFO
+  LPCMENUITEMINFO* = ptr MENUITEMINFO
+  tagMENUITEMINFO* = MENUITEMINFO
+  TMENUITEMINFO* = MENUITEMINFO
+  TMENUITEMINFOA* = MENUITEMINFO
+  PMENUITEMINFO* = ptr MENUITEMINFO
+  MENUITEMTEMPLATE* = record
+    mtOption*: int16
+    mtID*: int16
+    mtString*: array[0..0, WCHAR]
+
+  TMENUITEMTEMPLATE* = MENUITEMTEMPLATE
+  PMENUITEMTEMPLATE* = ptr MENUITEMTEMPLATE
+  MENUITEMTEMPLATEHEADER* = record
+    versionNumber*: int16
+    offset*: int16
+
+  TMENUITEMTEMPLATEHEADER* = MENUITEMTEMPLATEHEADER
+  PMENUITEMTEMPLATEHEADER* = ptr MENUITEMTEMPLATEHEADER
+  MENUTEMPLATE* = record
+  LPMENUTEMPLATE* = ptr MENUTEMPLATE
+  TMENUTEMPLATE* = MENUTEMPLATE
+  PMENUTEMPLATE* = ptr MENUTEMPLATE
+  METAFILEPICT* = record
+    mm*: LONG
+    xExt*: LONG
+    yExt*: LONG
+    hMF*: HMETAFILE
+
+  LPMETAFILEPICT* = ptr METAFILEPICT
+  tagMETAFILEPICT* = METAFILEPICT
+  TMETAFILEPICT* = METAFILEPICT
+  PMETAFILEPICT* = ptr METAFILEPICT
+  METAHEADER* = record
+    mtType*: int16
+    mtHeaderSize*: int16
+    mtVersion*: int16
+    mtSize*: DWORD
+    mtNoObjects*: int16
+    mtMaxRecord*: DWORD
+    mtNoParameters*: int16
+
+  tagMETAHEADER* = METAHEADER
+  TMETAHEADER* = METAHEADER
+  PMETAHEADER* = ptr METAHEADER
+  METARECORD* = record
+    rdSize*: DWORD
+    rdFunction*: int16
+    rdParm*: array[0..0, int16]
+
+  LPMETARECORD* = ptr METARECORD
+  tagMETARECORD* = METARECORD
+  TMETARECORD* = METARECORD
+  PMETARECORD* = ptr METARECORD
+  MINIMIZEDMETRICS* = record
+    cbSize*: UINT
+    iWidth*: int32
+    iHorzGap*: int32
+    iVertGap*: int32
+    iArrange*: int32
+
+  LPMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS
+  tagMINIMIZEDMETRICS* = MINIMIZEDMETRICS
+  TMINIMIZEDMETRICS* = MINIMIZEDMETRICS
+  PMINIMIZEDMETRICS* = ptr MINIMIZEDMETRICS
+  MINMAXINFO* = record
+    ptReserved*: POINT
+    ptMaxSize*: POINT
+    ptMaxPosition*: POINT
+    ptMinTrackSize*: POINT
+    ptMaxTrackSize*: POINT
+
+  tagMINMAXINFO* = MINMAXINFO
+  TMINMAXINFO* = MINMAXINFO
+  PMINMAXINFO* = ptr MINMAXINFO
+  MODEMDEVCAPS* = record
+    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
+  TMODEMDEVCAPS* = MODEMDEVCAPS
+  PMODEMDEVCAPS* = ptr MODEMDEVCAPS
+  modemdevcaps_tag* = MODEMDEVCAPS
+  MODEMSETTINGS* = record
+    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
+  TMODEMSETTINGS* = MODEMSETTINGS
+  PMODEMSETTINGS* = ptr MODEMSETTINGS
+  modemsettings_tag* = MODEMSETTINGS
+  MONCBSTRUCT* = record
+    cb*: UINT
+    dwTime*: DWORD
+    hTask*: HANDLE
+    dwRet*: DWORD
+    wType*: UINT
+    wFmt*: UINT
+    hConv*: HCONV
+    hsz1*: HSZ
+    hsz2*: HSZ
+    hData*: HDDEDATA
+    dwData1*: DWORD
+    dwData2*: DWORD
+    cc*: CONVCONTEXT
+    cbData*: DWORD
+    Data*: array[0..7, DWORD]
+
+  tagMONCBSTRUCT* = MONCBSTRUCT
+  TMONCBSTRUCT* = MONCBSTRUCT
+  PMONCBSTRUCT* = ptr MONCBSTRUCT
+  MONCONVSTRUCT* = record
+    cb*: UINT
+    fConnect*: WINBOOL
+    dwTime*: DWORD
+    hTask*: HANDLE
+    hszSvc*: HSZ
+    hszTopic*: HSZ
+    hConvClient*: HCONV
+    hConvServer*: HCONV
+
+  tagMONCONVSTRUCT* = MONCONVSTRUCT
+  TMONCONVSTRUCT* = MONCONVSTRUCT
+  PMONCONVSTRUCT* = ptr MONCONVSTRUCT
+  MONERRSTRUCT* = record
+    cb*: UINT
+    wLastError*: UINT
+    dwTime*: DWORD
+    hTask*: HANDLE
+
+  tagMONERRSTRUCT* = MONERRSTRUCT
+  TMONERRSTRUCT* = MONERRSTRUCT
+  PMONERRSTRUCT* = ptr MONERRSTRUCT
+  MONHSZSTRUCT* = record
+    cb*: UINT
+    fsAction*: WINBOOL
+    dwTime*: DWORD
+    hsz*: HSZ
+    hTask*: HANDLE
+    str*: array[0..0, TCHAR]
+
+  tagMONHSZSTRUCT* = MONHSZSTRUCT
+  TMONHSZSTRUCT* = MONHSZSTRUCT
+  PMONHSZSTRUCT* = ptr MONHSZSTRUCT
+  MONITOR_INFO_1* = record
+    pName*: LPTSTR
+
+  TMONITORINFO1* = MONITOR_INFO_1
+  PMONITORINFO1* = ptr MONITOR_INFO_1
+  MONITOR_INFO_2* = record
+    pName*: LPTSTR
+    pEnvironment*: LPTSTR
+    pDLLName*: LPTSTR
+
+  TMONITORINFO2* = MONITOR_INFO_2
+  PMONITORINFO2* = ptr MONITOR_INFO_2
+  MONLINKSTRUCT* = record
+    cb*: UINT
+    dwTime*: DWORD
+    hTask*: HANDLE
+    fEstablished*: WINBOOL
+    fNoData*: WINBOOL
+    hszSvc*: HSZ
+    hszTopic*: HSZ
+    hszItem*: HSZ
+    wFmt*: UINT
+    fServer*: WINBOOL
+    hConvServer*: HCONV
+    hConvClient*: HCONV
+
+  tagMONLINKSTRUCT* = MONLINKSTRUCT
+  TMONLINKSTRUCT* = MONLINKSTRUCT
+  PMONLINKSTRUCT* = ptr MONLINKSTRUCT
+  MONMSGSTRUCT* = record
+    cb*: UINT
+    hwndTo*: HWND
+    dwTime*: DWORD
+    hTask*: HANDLE
+    wMsg*: UINT
+    wParam*: WPARAM
+    lParam*: LPARAM
+    dmhd*: DDEML_MSG_HOOK_DATA
+
+  tagMONMSGSTRUCT* = MONMSGSTRUCT
+  TMONMSGSTRUCT* = MONMSGSTRUCT
+  PMONMSGSTRUCT* = ptr MONMSGSTRUCT
+  MOUSEHOOKSTRUCT* = record
+    pt*: POINT
+    hwnd*: HWND
+    wHitTestCode*: UINT
+    dwExtraInfo*: DWORD
+
+  LPMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT
+  tagMOUSEHOOKSTRUCT* = MOUSEHOOKSTRUCT
+  TMOUSEHOOKSTRUCT* = MOUSEHOOKSTRUCT
+  PMOUSEHOOKSTRUCT* = ptr MOUSEHOOKSTRUCT
+  MOUSEKEYS* = record
+    cbSize*: DWORD
+    dwFlags*: DWORD
+    iMaxSpeed*: DWORD
+    iTimeToMaxSpeed*: DWORD
+    iCtrlSpeed*: DWORD
+    dwReserved1*: DWORD
+    dwReserved2*: DWORD
+
+  TMOUSEKEYS* = MOUSEKEYS
+  PMOUSEKEYS* = ptr MOUSEKEYS
+  MSGBOXCALLBACK* = proc (lpHelpInfo: LPHELPINFO){.stdcall.}
+  TMSGBOXCALLBACK* = MSGBOXCALLBACK
+  MSGBOXPARAMS* = record
+    cbSize*: UINT
+    hwndOwner*: HWND
+    hInstance*: HINST
+    lpszText*: LPCSTR
+    lpszCaption*: LPCSTR
+    dwStyle*: DWORD
+    lpszIcon*: LPCSTR
+    dwContextHelpId*: DWORD
+    lpfnMsgBoxCallback*: MSGBOXCALLBACK
+    dwLanguageId*: DWORD
+
+  LPMSGBOXPARAMS* = ptr MSGBOXPARAMS
+  TMSGBOXPARAMS* = MSGBOXPARAMS
+  TMSGBOXPARAMSA* = MSGBOXPARAMS
+  PMSGBOXPARAMS* = ptr MSGBOXPARAMS
+  MSGFILTER* = record
+    nmhdr*: NMHDR
+    msg*: UINT
+    wParam*: WPARAM
+    lParam*: LPARAM
+
+  Tmsgfilter* = MSGFILTER
+  Pmsgfilter* = ptr MSGFILTER
+  MULTIKEYHELP* = record
+    mkSize*: DWORD
+    mkKeylist*: TCHAR
+    szKeyphrase*: array[0..0, TCHAR]
+
+  tagMULTIKEYHELP* = MULTIKEYHELP
+  TMULTIKEYHELP* = MULTIKEYHELP
+  PMULTIKEYHELP* = ptr MULTIKEYHELP
+  NAME_BUFFER* = record
+    name*: array[0..(NCBNAMSZ) - 1, UCHAR]
+    name_num*: UCHAR
+    name_flags*: UCHAR
+
+  TNAMEBUFFER* = NAME_BUFFER
+  PNAMEBUFFER* = ptr NAME_BUFFER
+  p_NCB* = ptr NCB
+  NCB* = record
+    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
+
+  TNCB* = NCB
+  NCCALCSIZE_PARAMS* = record
+    rgrc*: array[0..2, RECT]
+    lppos*: PWINDOWPOS
+
+  TNCCALCSIZEPARAMS* = NCCALCSIZE_PARAMS
+  PNCCALCSIZEPARAMS* = ptr NCCALCSIZE_PARAMS
+  NDDESHAREINFO* = record
+    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
+
+  TNDDESHAREINFO* = NDDESHAREINFO
+  PNDDESHAREINFO* = ptr NDDESHAREINFO
+  NETRESOURCE* = record
+    dwScope*: DWORD
+    dwType*: DWORD
+    dwDisplayType*: DWORD
+    dwUsage*: DWORD
+    lpLocalName*: LPTSTR
+    lpRemoteName*: LPTSTR
+    lpComment*: LPTSTR
+    lpProvider*: LPTSTR
+
+  LPNETRESOURCE* = ptr NETRESOURCE
+  TNETRESOURCE* = NETRESOURCE
+  TNETRESOURCEA* = NETRESOURCE
+  PNETRESOURCE* = ptr NETRESOURCE
+  PNETRESOURCEA* = ptr NETRESOURCE
+  NEWCPLINFO* = record
+    dwSize*: DWORD
+    dwFlags*: DWORD
+    dwHelpContext*: DWORD
+    lData*: LONG
+    hIcon*: HICON
+    szName*: array[0..31, TCHAR]
+    szInfo*: array[0..63, TCHAR]
+    szHelpFile*: array[0..127, TCHAR]
+
+  tagNEWCPLINFO* = NEWCPLINFO
+  TNEWCPLINFO* = NEWCPLINFO
+  PNEWCPLINFO* = ptr NEWCPLINFO
+  NEWTEXTMETRIC* = record
+    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*: UINT
+    ntmCellHeight*: UINT
+    ntmAvgWidth*: UINT
+
+  tagNEWTEXTMETRIC* = NEWTEXTMETRIC
+  TNEWTEXTMETRIC* = NEWTEXTMETRIC
+  PNEWTEXTMETRIC* = ptr NEWTEXTMETRIC
+  NEWTEXTMETRICEX* = record
+    ntmentm*: NEWTEXTMETRIC
+    ntmeFontSignature*: FONTSIGNATURE
+
+  tagNEWTEXTMETRICEX* = NEWTEXTMETRICEX
+  TNEWTEXTMETRICEX* = NEWTEXTMETRICEX
+  PNEWTEXTMETRICEX* = ptr NEWTEXTMETRICEX
+  NM_LISTVIEW* = record
+    hdr*: NMHDR
+    iItem*: int32
+    iSubItem*: int32
+    uNewState*: UINT
+    uOldState*: UINT
+    uChanged*: UINT
+    ptAction*: POINT
+    lParam*: LPARAM
+
+  tagNM_LISTVIEW* = NM_LISTVIEW
+  TNMLISTVIEW* = NM_LISTVIEW
+  PNMLISTVIEW* = ptr NM_LISTVIEW
+  TV_ITEM* = record
+    mask*: UINT
+    hItem*: HTREEITEM
+    state*: UINT
+    stateMask*: UINT
+    pszText*: LPTSTR
+    cchTextMax*: int32
+    iImage*: int32
+    iSelectedImage*: int32
+    cChildren*: int32
+    lParam*: LPARAM
+
+  LPTV_ITEM* = ptr TV_ITEM
+  TTVITEM* = TV_ITEM
+  PTVITEM* = ptr TV_ITEM
+  NM_TREEVIEW* = record
+    hdr*: NMHDR
+    action*: UINT
+    itemOld*: TV_ITEM
+    itemNew*: TV_ITEM
+    ptDrag*: POINT
+
+  LPNM_TREEVIEW* = ptr NM_TREEVIEW
+  TNMTREEVIEW* = NM_TREEVIEW
+  PNMTREEVIEW* = ptr NM_TREEVIEW
+  NM_UPDOWNW* = record
+    hdr*: NMHDR
+    iPos*: int32
+    iDelta*: int32
+
+  TNMUPDOWN* = NM_UPDOWNW
+  PNMUPDOWN* = ptr NM_UPDOWNW
+  NONCLIENTMETRICS* = record
+    cbSize*: UINT
+    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
+  tagNONCLIENTMETRICS* = NONCLIENTMETRICS
+  TNONCLIENTMETRICS* = NONCLIENTMETRICS
+  PNONCLIENTMETRICS* = ptr NONCLIENTMETRICS
+  SERVICE_ADDRESS* = record
+    dwAddressType*: DWORD
+    dwAddressFlags*: DWORD
+    dwAddressLength*: DWORD
+    dwPrincipalLength*: DWORD
+    lpAddress*: ptr int8
+    lpPrincipal*: ptr int8
+
+  TSERVICEADDRESS* = SERVICE_ADDRESS
+  PSERVICEADDRESS* = ptr SERVICE_ADDRESS
+  SERVICE_ADDRESSES* = record
+    dwAddressCount*: DWORD
+    Addresses*: array[0..0, SERVICE_ADDRESS]
+
+  LPSERVICE_ADDRESSES* = ptr SERVICE_ADDRESSES
+  TSERVICEADDRESSES* = SERVICE_ADDRESSES
+  PSERVICEADDRESSES* = ptr SERVICE_ADDRESSES
+  LPGUID* = ptr TGUID
+  PGUID* = ptr TGUID
+  CLSID* = TGUID
+  LPCLSID* = ptr CLSID
+  TCLSID* = CLSID
+  PCLSID* = ptr CLSID
+  SERVICE_INFO* = record
+    lpServiceType*: LPGUID
+    lpServiceName*: LPTSTR
+    lpComment*: LPTSTR
+    lpLocale*: LPTSTR
+    dwDisplayHint*: DWORD
+    dwVersion*: DWORD
+    dwTime*: DWORD
+    lpMachineName*: LPTSTR
+    lpServiceAddress*: LPSERVICE_ADDRESSES
+    ServiceSpecificInfo*: BLOB
+
+  TSERVICEINFO* = SERVICE_INFO
+  PSERVICEINFO* = ptr SERVICE_INFO
+  NS_SERVICE_INFO* = record
+    dwNameSpace*: DWORD
+    ServiceInfo*: SERVICE_INFO
+
+  TNSSERVICEINFO* = NS_SERVICE_INFO
+  PNSSERVICEINFO* = ptr NS_SERVICE_INFO
+  NUMBERFMT* = record
+    NumDigits*: UINT
+    LeadingZero*: UINT
+    Grouping*: UINT
+    lpDecimalSep*: LPTSTR
+    lpThousandSep*: LPTSTR
+    NegativeOrder*: UINT
+
+  Tnumberfmt* = NUMBERFMT
+  Pnumberfmt* = ptr NUMBERFMT
+  OFSTRUCT* = record
+    cBytes*: int8
+    fFixedDisk*: int8
+    nErrCode*: int16
+    Reserved1*: int16
+    Reserved2*: int16
+    szPathName*: array[0..(OFS_MAXPATHNAME) - 1, CHAR]
+
+  LPOFSTRUCT* = ptr OFSTRUCT
+  TOFSTRUCT* = OFSTRUCT
+  POFSTRUCT* = ptr OFSTRUCT
+  OPENFILENAME_NT4* = record
+    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
+  TOPENFILENAME_NT4* = OPENFILENAME_NT4
+  POPENFILENAME_NT4* = ptr OPENFILENAME_NT4
+  TOPENFILENAME* = record
+    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 TOPENFILENAME
+  POPENFILENAME* = ptr TOPENFILENAME
+  OFN* = TOPENFILENAME
+  POFN* = ptr TOPENFILENAME
+  OFNOTIFY* = record
+    hdr*: NMHDR
+    lpOFN*: LPOPENFILENAME
+    pszFile*: LPTSTR
+
+  LPOFNOTIFY* = ptr OFNOTIFY
+  TOFNOTIFY* = OFNOTIFY
+  POFNOTIFY* = ptr OFNOTIFY
+  OSVERSIONINFO* = record
+    dwOSVersionInfoSize*: DWORD
+    dwMajorVersion*: DWORD
+    dwMinorVersion*: DWORD
+    dwBuildNumber*: DWORD
+    dwPlatformId*: DWORD
+    szCSDVersion*: array[0..127, TCHAR]
+
+  LPOSVERSIONINFO* = ptr OSVERSIONINFO
+  TOSVERSIONINFO* = OSVERSIONINFO
+  POSVERSIONINFO* = ptr OSVERSIONINFO
+  OSVERSIONINFOW* = record
+    dwOSVersionInfoSize*: DWORD
+    dwMajorVersion*: DWORD
+    dwMinorVersion*: DWORD
+    dwBuildNumber*: DWORD
+    dwPlatformId*: DWORD
+    szCSDVersion*: array[0..127, WCHAR]
+
+  LPOSVERSIONINFOW* = ptr OSVERSIONINFOW
+  TOSVERSIONINFOW* = OSVERSIONINFOW
+  POSVERSIONINFOW* = ptr OSVERSIONINFOW
+  TEXTMETRIC* = record
+    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
+  tagTEXTMETRIC* = TEXTMETRIC
+  TTEXTMETRIC* = TEXTMETRIC
+  PTEXTMETRIC* = ptr TEXTMETRIC
+  TEXTMETRICW* = record
+    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
+  tagTEXTMETRICW* = TEXTMETRICW
+  TTEXTMETRICW* = TEXTMETRICW
+  PTEXTMETRICW* = ptr TEXTMETRICW
+  OUTLINETEXTMETRIC* = record
+    otmSize*: UINT
+    otmTextMetrics*: TEXTMETRIC
+    otmFiller*: int8
+    otmPanoseNumber*: PANOSE
+    otmfsSelection*: UINT
+    otmfsType*: UINT
+    otmsCharSlopeRise*: int32
+    otmsCharSlopeRun*: int32
+    otmItalicAngle*: int32
+    otmEMSquare*: UINT
+    otmAscent*: int32
+    otmDescent*: int32
+    otmLineGap*: UINT
+    otmsCapEmHeight*: UINT
+    otmsXHeight*: UINT
+    otmrcFontBox*: RECT
+    otmMacAscent*: int32
+    otmMacDescent*: int32
+    otmMacLineGap*: UINT
+    otmusMinimumPPEM*: UINT
+    otmptSubscriptSize*: POINT
+    otmptSubscriptOffset*: POINT
+    otmptSuperscriptSize*: POINT
+    otmptSuperscriptOffset*: POINT
+    otmsStrikeoutSize*: UINT
+    otmsStrikeoutPosition*: int32
+    otmsUnderscoreSize*: int32
+    otmsUnderscorePosition*: int32
+    otmpFamilyName*: PSTR
+    otmpFaceName*: PSTR
+    otmpStyleName*: PSTR
+    otmpFullName*: PSTR
+
+  LPOUTLINETEXTMETRIC* = ptr OUTLINETEXTMETRIC
+  TOUTLINETEXTMETRIC* = OUTLINETEXTMETRIC
+  POUTLINETEXTMETRIC* = ptr OUTLINETEXTMETRIC
+  OVERLAPPED* = record
+    Internal*: DWORD
+    InternalHigh*: DWORD
+    Offset*: DWORD
+    OffsetHigh*: DWORD
+    hEvent*: HANDLE
+
+  LPOVERLAPPED* = ptr OVERLAPPED
+  TOVERLAPPED* = OVERLAPPED
+  POVERLAPPED* = ptr OVERLAPPED #PAGESETUPDLG = record conflicts with function PageSetupDlg
+  TPAGESETUPDLG* = record
+    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
+  tagPSD* = TPAGESETUPDLG
+  TPSD* = TPAGESETUPDLG
+  PPSD* = ptr TPAGESETUPDLG
+  PAINTSTRUCT* = record
+    hdc*: HDC
+    fErase*: WINBOOL
+    rcPaint*: RECT
+    fRestore*: WINBOOL
+    fIncUpdate*: WINBOOL
+    rgbReserved*: array[0..31, int8]
+
+  LPPAINTSTRUCT* = ptr PAINTSTRUCT
+  tagPAINTSTRUCT* = PAINTSTRUCT
+  TPAINTSTRUCT* = PAINTSTRUCT
+  PPAINTSTRUCT* = ptr PAINTSTRUCT
+  PARAFORMAT* = record
+    cbSize*: UINT
+    dwMask*: DWORD
+    wNumbering*: int16
+    wReserved*: int16
+    dxStartIndent*: LONG
+    dxRightIndent*: LONG
+    dxOffset*: LONG
+    wAlignment*: int16
+    cTabCount*: SHORT
+    rgxTabs*: array[0..(MAX_TAB_STOPS) - 1, LONG]
+
+  Tparaformat* = PARAFORMAT
+  Pparaformat* = ptr PARAFORMAT
+  PERF_COUNTER_BLOCK* = record
+    ByteLength*: DWORD
+
+  TPERFCOUNTERBLOCK* = PERF_COUNTER_BLOCK
+  PPERFCOUNTERBLOCK* = ptr PERF_COUNTER_BLOCK
+  PERF_COUNTER_DEFINITION* = record
+    ByteLength*: DWORD
+    CounterNameTitleIndex*: DWORD
+    CounterNameTitle*: LPWSTR
+    CounterHelpTitleIndex*: DWORD
+    CounterHelpTitle*: LPWSTR
+    DefaultScale*: DWORD
+    DetailLevel*: DWORD
+    CounterType*: DWORD
+    CounterSize*: DWORD
+    CounterOffset*: DWORD
+
+  TPERFCOUNTERDEFINITION* = PERF_COUNTER_DEFINITION
+  PPERFCOUNTERDEFINITION* = ptr PERF_COUNTER_DEFINITION
+  PERF_DATA_BLOCK* = record
+    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
+
+  TPERFDATABLOCK* = PERF_DATA_BLOCK
+  PPERFDATABLOCK* = ptr PERF_DATA_BLOCK
+  PERF_INSTANCE_DEFINITION* = record
+    ByteLength*: DWORD
+    ParentObjectTitleIndex*: DWORD
+    ParentObjectInstance*: DWORD
+    UniqueID*: DWORD
+    NameOffset*: DWORD
+    NameLength*: DWORD
+
+  TPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION
+  PPERFINSTANCEDEFINITION* = PERF_INSTANCE_DEFINITION
+  PERF_OBJECT_TYPE* = record
+    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
+
+  TPERFOBJECTTYPE* = PERF_OBJECT_TYPE
+  PPERFOBJECTTYPE* = ptr PERF_OBJECT_TYPE
+  POLYTEXT* = record
+    x*: int32
+    y*: int32
+    n*: UINT
+    lpstr*: LPCTSTR
+    uiFlags*: UINT
+    rcl*: RECT
+    pdx*: ptr int32
+
+  TPOLYTEXT* = POLYTEXT
+  PPOLYTEXT* = ptr POLYTEXT
+  PORT_INFO_1* = record
+    pName*: LPTSTR
+
+  TPORTINFO1* = PORT_INFO_1
+  PPORTINFO1* = ptr PORT_INFO_1
+  PORT_INFO_2* = record
+    pPortName*: LPSTR
+    pMonitorName*: LPSTR
+    pDescription*: LPSTR
+    fPortType*: DWORD
+    Reserved*: DWORD
+
+  TPORTINFO2* = PORT_INFO_2
+  PPORTINFO2* = ptr PORT_INFO_2
+  PREVENT_MEDIA_REMOVAL* = record
+    PreventMediaRemoval*: bool
+
+  TPREVENTMEDIAREMOVAL* = PREVENT_MEDIA_REMOVAL
+  PPREVENTMEDIAREMOVAL* = ptr PREVENT_MEDIA_REMOVAL #PRINTDLG = record conflicts with PrintDlg function
+  TPRINTDLG* = record
+    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
+  tagPD* = TPRINTDLG
+  TPD* = TPRINTDLG
+  PPD* = ptr TPRINTDLG
+  PRINTER_DEFAULTS* = record
+    pDatatype*: LPTSTR
+    pDevMode*: LPDEVMODE
+    DesiredAccess*: ACCESS_MASK
+
+  TPRINTERDEFAULTS* = PRINTER_DEFAULTS
+  PPRINTERDEFAULTS* = ptr PRINTER_DEFAULTS
+  PRINTER_INFO_1* = record
+    Flags*: DWORD
+    pDescription*: LPTSTR
+    pName*: LPTSTR
+    pComment*: LPTSTR
+
+  LPPRINTER_INFO_1* = ptr PRINTER_INFO_1
+  PPRINTER_INFO_1* = ptr PRINTER_INFO_1
+  TPRINTERINFO1* = PRINTER_INFO_1
+  PRINTER_INFO_2* = record
+    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
+
+  TPRINTERINFO2* = PRINTER_INFO_2
+  PPRINTERINFO2* = ptr PRINTER_INFO_2
+  PRINTER_INFO_3* = record
+    pSecurityDescriptor*: PSECURITY_DESCRIPTOR
+
+  TPRINTERINFO3* = PRINTER_INFO_3
+  PPRINTERINFO3* = ptr PRINTER_INFO_3
+  PRINTER_INFO_4* = record
+    pPrinterName*: LPTSTR
+    pServerName*: LPTSTR
+    Attributes*: DWORD
+
+  TPRINTERINFO4* = PRINTER_INFO_4
+  PPRINTERINFO4* = ptr PRINTER_INFO_4
+  PRINTER_INFO_5* = record
+    pPrinterName*: LPTSTR
+    pPortName*: LPTSTR
+    Attributes*: DWORD
+    DeviceNotSelectedTimeout*: DWORD
+    TransmissionRetryTimeout*: DWORD
+
+  TPRINTERINFO5* = PRINTER_INFO_5
+  PPRINTERINFO5* = ptr PRINTER_INFO_5
+  PRINTER_NOTIFY_INFO_DATA* = record
+    `type`*: int16
+    Field*: int16
+    Reserved*: DWORD
+    Id*: DWORD
+    cbBuf*: DWORD
+    pBuf*: LPVOID
+
+  TPRINTERNOTIFYINFODATA* = PRINTER_NOTIFY_INFO_DATA
+  PPRINTERNOTIFYINFODATA* = ptr PRINTER_NOTIFY_INFO_DATA
+  PRINTER_NOTIFY_INFO* = record
+    Version*: DWORD
+    Flags*: DWORD
+    Count*: DWORD
+    aData*: array[0..0, PRINTER_NOTIFY_INFO_DATA]
+
+  TPRINTERNOTIFYINFO* = PRINTER_NOTIFY_INFO
+  PPRINTERNOTIFYINFO* = ptr PRINTER_NOTIFY_INFO
+  PRINTER_NOTIFY_OPTIONS_TYPE* = record
+    `type`*: int16
+    Reserved0*: int16
+    Reserved1*: DWORD
+    Reserved2*: DWORD
+    Count*: DWORD
+    pFields*: PWORD
+
+  PPRINTER_NOTIFY_OPTIONS_TYPE* = ptr PRINTER_NOTIFY_OPTIONS_TYPE
+  TPRINTERNOTIFYOPTIONSTYPE* = PRINTER_NOTIFY_OPTIONS_TYPE
+  PRINTER_NOTIFY_OPTIONS* = record
+    Version*: DWORD
+    Flags*: DWORD
+    Count*: DWORD
+    pTypes*: PPRINTER_NOTIFY_OPTIONS_TYPE
+
+  TPRINTERNOTIFYOPTIONS* = PRINTER_NOTIFY_OPTIONS
+  PPRINTERNOTIFYOPTIONS* = ptr PRINTER_NOTIFY_OPTIONS
+  PRINTPROCESSOR_INFO_1* = record
+    pName*: LPTSTR
+
+  TPRINTPROCESSORINFO1* = PRINTPROCESSOR_INFO_1
+  PPRINTPROCESSORINFO1* = ptr PRINTPROCESSOR_INFO_1
+  PRIVILEGE_SET* = record
+    PrivilegeCount*: DWORD
+    Control*: DWORD
+    Privilege*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES]
+
+  LPPRIVILEGE_SET* = ptr PRIVILEGE_SET
+  PPRIVILEGE_SET* = ptr PRIVILEGE_SET
+  TPRIVILEGESET* = PRIVILEGE_SET
+  PROCESS_HEAPENTRY* = record
+    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
+  TPROCESSHEAPENTRY* = PROCESS_HEAPENTRY
+  PPROCESSHEAPENTRY* = ptr PROCESS_HEAPENTRY
+  PROCESS_INFORMATION* = record
+    hProcess*: HANDLE
+    hThread*: HANDLE
+    dwProcessId*: DWORD
+    dwThreadId*: DWORD
+
+  LPPROCESS_INFORMATION* = ptr PROCESS_INFORMATION
+  TPROCESSINFORMATION* = PROCESS_INFORMATION
+  PPROCESSINFORMATION* = ptr PROCESS_INFORMATION
+  LPFNPSPCALLBACK* = proc (para1: HWND, para2: UINT, para3: LPVOID): UINT{.
+      stdcall.}
+  TFNPSPCALLBACK* = LPFNPSPCALLBACK
+  PROPSHEETPAGE* = record
+    dwSize*: DWORD
+    dwFlags*: DWORD
+    hInstance*: HINST
+    pszIcon*: LPCTSTR
+    pszTitle*: LPCTSTR
+    pfnDlgProc*: DLGPROC
+    lParam*: LPARAM
+    pfnCallback*: LPFNPSPCALLBACK
+    pcRefParent*: ptr UINT
+
+  LPPROPSHEETPAGE* = ptr PROPSHEETPAGE
+  LPCPROPSHEETPAGE* = ptr PROPSHEETPAGE
+  TPROPSHEETPAGE* = PROPSHEETPAGE
+  PPROPSHEETPAGE* = ptr PROPSHEETPAGE
+  emptyrecord* = record
+  lpemptyrecord* = ptr emptyrecord
+  HPROPSHEETPAGE* = ptr emptyrecord
+  PROPSHEETHEADER* = record
+    dwSize*: DWORD
+    dwFlags*: DWORD
+    hwndParent*: HWND
+    hInstance*: HINST
+    pszIcon*: LPCTSTR
+    pszCaption*: LPCTSTR
+    nPages*: UINT
+    pStartPage*: LPCTSTR
+    phpage*: ptr HPROPSHEETPAGE
+    pfnCallback*: PFNPROPSHEETCALLBACK
+    pszbmWatermark*: LPCTSTR
+    hplWatermark*: HPALETTE
+    pszbmHeader*: cstring
+
+  LPPROPSHEETHEADER* = ptr PROPSHEETHEADER
+  LPCPROPSHEETHEADER* = ptr PROPSHEETHEADER
+  TPROPSHEETHEADER* = PROPSHEETHEADER
+  PPROPSHEETHEADER* = ptr PROPSHEETHEADER # PropertySheet callbacks
+  LPFNADDPROPSHEETPAGE* = proc (para1: HPROPSHEETPAGE, para2: LPARAM): WINBOOL{.
+      stdcall.}
+  TFNADDPROPSHEETPAGE* = LPFNADDPROPSHEETPAGE
+  LPFNADDPROPSHEETPAGES* = proc (para1: LPVOID, para2: LPFNADDPROPSHEETPAGE,
+                                 para3: LPARAM): WINBOOL{.stdcall.}
+  TFNADDPROPSHEETPAGES* = LPFNADDPROPSHEETPAGES
+  PROTOCOL_INFO* = record
+    dwServiceFlags*: DWORD
+    iAddressFamily*: WINT
+    iMaxSockAddr*: WINT
+    iMinSockAddr*: WINT
+    iSocketType*: WINT
+    iProtocol*: WINT
+    dwMessageSize*: DWORD
+    lpProtocol*: LPTSTR
+
+  TPROTOCOLINFO* = PROTOCOL_INFO
+  PPROTOCOLINFO* = ptr PROTOCOL_INFO
+  PROVIDOR_INFO_1* = record
+    pName*: LPTSTR
+    pEnvironment*: LPTSTR
+    pDLLName*: LPTSTR
+
+  TPROVIDORINFO1* = PROVIDOR_INFO_1
+  PPROVIDORINFO1* = ptr PROVIDOR_INFO_1
+  PSHNOTIFY* = record
+    hdr*: NMHDR
+    lParam*: LPARAM
+
+  LPPSHNOTIFY* = ptr PSHNOTIFY
+  TPSHNOTIFY* = PSHNOTIFY
+  PPSHNOTIFY* = ptr PSHNOTIFY
+  PUNCTUATION* = record
+    iSize*: UINT
+    szPunctuation*: LPSTR
+
+  Tpunctuation* = PUNCTUATION
+  Ppunctuation* = ptr PUNCTUATION
+  TQUERY_SERVICE_CONFIG* = record
+    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* = record
+    fIsLocked*: DWORD
+    lpLockOwner*: LPTSTR
+    dwLockDuration*: DWORD
+
+  LPQUERY_SERVICE_LOCK_STATUS* = ptr TQUERY_SERVICE_LOCK_STATUS
+  PQUERYSERVICELOCKSTATUS* = ptr TQUERY_SERVICE_LOCK_STATUS
+  RASAMB* = record
+    dwSize*: DWORD
+    dwError*: DWORD
+    szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, TCHAR]
+    bLana*: int8
+
+  TRASAMB* = RASAMB
+  PRASAMB* = ptr RASAMB
+  RASCONN* = record
+    dwSize*: DWORD
+    hrasconn*: HRASCONN
+    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR]
+    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, CHAR]
+    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, CHAR]
+
+  TRASCONN* = RASCONN
+  PRASCONN* = ptr RASCONN
+  RASCONNSTATUS* = record
+    dwSize*: DWORD
+    rasconnstate*: RASCONNSTATE
+    dwError*: DWORD
+    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, TCHAR]
+    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, TCHAR]
+
+  TRASCONNSTATUS* = RASCONNSTATUS
+  PRASCONNSTATUS* = ptr RASCONNSTATUS
+  RASDIALEXTENSIONS* = record
+    dwSize*: DWORD
+    dwfOptions*: DWORD
+    hwndParent*: HWND
+    reserved*: DWORD
+
+  TRASDIALEXTENSIONS* = RASDIALEXTENSIONS
+  PRASDIALEXTENSIONS* = ptr RASDIALEXTENSIONS
+  RASDIALPARAMS* = record
+    dwSize*: DWORD
+    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR]
+    szPhoneNumber*: array[0..(RAS_MaxPhoneNumber + 1) - 1, TCHAR]
+    szCallbackNumber*: array[0..(RAS_MaxCallbackNumber + 1) - 1, TCHAR]
+    szUserName*: array[0..(UNLEN + 1) - 1, TCHAR]
+    szPassword*: array[0..(PWLEN + 1) - 1, TCHAR]
+    szDomain*: array[0..(DNLEN + 1) - 1, TCHAR]
+
+  TRASDIALPARAMS* = RASDIALPARAMS
+  PRASDIALPARAMS* = ptr RASDIALPARAMS
+  RASENTRYNAME* = record
+    dwSize*: DWORD
+    szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR]
+
+  TRASENTRYNAME* = RASENTRYNAME
+  PRASENTRYNAME* = ptr RASENTRYNAME
+  RASPPPIP* = record
+    dwSize*: DWORD
+    dwError*: DWORD
+    szIpAddress*: array[0..(RAS_MaxIpAddress + 1) - 1, TCHAR]
+
+  TRASPPPIP* = RASPPPIP
+  PRASPPPIP* = ptr RASPPPIP
+  RASPPPIPX* = record
+    dwSize*: DWORD
+    dwError*: DWORD
+    szIpxAddress*: array[0..(RAS_MaxIpxAddress + 1) - 1, TCHAR]
+
+  TRASPPPIPX* = RASPPPIPX
+  PRASPPPIPX* = ptr RASPPPIPX
+  RASPPPNBF* = record
+    dwSize*: DWORD
+    dwError*: DWORD
+    dwNetBiosError*: DWORD
+    szNetBiosError*: array[0..(NETBIOS_NAME_LEN + 1) - 1, TCHAR]
+    szWorkstationName*: array[0..(NETBIOS_NAME_LEN + 1) - 1, TCHAR]
+    bLana*: int8
+
+  TRASPPPNBF* = RASPPPNBF
+  PRASPPPNBF* = ptr RASPPPNBF
+  RASTERIZER_STATUS* = record
+    nSize*: short
+    wFlags*: short
+    nLanguageID*: short
+
+  LPRASTERIZER_STATUS* = ptr RASTERIZER_STATUS
+  TRASTERIZERSTATUS* = RASTERIZER_STATUS
+  PRASTERIZERSTATUS* = ptr RASTERIZER_STATUS
+  REASSIGN_BLOCKS* = record
+    Reserved*: int16
+    Count*: int16
+    BlockNumber*: array[0..0, DWORD]
+
+  TREASSIGNBLOCKS* = REASSIGN_BLOCKS
+  PREASSIGNBLOCKS* = ptr REASSIGN_BLOCKS
+  REMOTE_NAME_INFO* = record
+    lpUniversalName*: LPTSTR
+    lpConnectionName*: LPTSTR
+    lpRemainingPath*: LPTSTR
+
+  TREMOTENAMEINFO* = REMOTE_NAME_INFO
+  PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO #
+                                          #   TODO: OLE
+                                          #  typedef struct _reobject {
+                                          #    DWORD  cbStruct;
+                                          #    LONG   cp;
+                                          #    CLSID  clsid;
+                                          #    LPOLEOBJECT      poleobj;
+                                          #    LPSTORAGE        pstg;
+                                          #    LPOLECLIENTSITE  polesite;
+                                          #    SIZEL  sizel;
+                                          #    DWORD  dvaspect;
+                                          #    DWORD  dwFlags;
+                                          #    DWORD  dwUser;
+                                          #  } REOBJECT;
+                                          #
+  REPASTESPECIAL* = record
+    dwAspect*: DWORD
+    dwParam*: DWORD
+
+  Trepastespecial* = REPASTESPECIAL
+  Prepastespecial* = ptr REPASTESPECIAL
+  REQRESIZE* = record
+    nmhdr*: NMHDR
+    rc*: RECT
+
+  Treqresize* = REQRESIZE
+  Preqresize* = ptr REQRESIZE
+  RGNDATAHEADER* = record
+    dwSize*: DWORD
+    iType*: DWORD
+    nCount*: DWORD
+    nRgnSize*: DWORD
+    rcBound*: RECT
+
+  TRGNDATAHEADER* = RGNDATAHEADER
+  PRGNDATAHEADER* = ptr RGNDATAHEADER
+  RGNDATA* = record
+    rdh*: RGNDATAHEADER
+    Buffer*: array[0..0, char]
+
+  LPRGNDATA* = ptr RGNDATA
+  TRGNDATA* = RGNDATA
+  PRGNDATA* = ptr RGNDATA
+  SCROLLINFO* = record
+    cbSize*: UINT
+    fMask*: UINT
+    nMin*: int32
+    nMax*: int32
+    nPage*: UINT
+    nPos*: int32
+    nTrackPos*: int32
+
+  LPSCROLLINFO* = ptr SCROLLINFO
+  LPCSCROLLINFO* = ptr SCROLLINFO
+  TSCROLLINFO* = SCROLLINFO
+  PSCROLLINFO* = ptr SCROLLINFO
+  SECURITY_ATTRIBUTES* = record
+    nLength*: DWORD
+    lpSecurityDescriptor*: LPVOID
+    bInheritHandle*: WINBOOL
+
+  LPSECURITY_ATTRIBUTES* = ptr SECURITY_ATTRIBUTES
+  TSECURITYATTRIBUTES* = SECURITY_ATTRIBUTES
+  PSECURITYATTRIBUTES* = ptr SECURITY_ATTRIBUTES
+  SECURITY_INFORMATION* = DWORD
+  PSECURITY_INFORMATION* = ptr SECURITY_INFORMATION
+  TSECURITYINFORMATION* = SECURITY_INFORMATION
+  SELCHANGE* = record
+    nmhdr*: NMHDR
+    chrg*: CHARRANGE
+    seltyp*: int16
+
+  Tselchange* = SELCHANGE
+  Pselchange* = ptr SELCHANGE
+  SERIALKEYS* = record
+    cbSize*: DWORD
+    dwFlags*: DWORD
+    lpszActivePort*: LPSTR
+    lpszPort*: LPSTR
+    iBaudRate*: DWORD
+    iPortState*: DWORD
+
+  LPSERIALKEYS* = ptr SERIALKEYS
+  TSERIALKEYS* = SERIALKEYS
+  PSERIALKEYS* = ptr SERIALKEYS
+  SERVICE_TABLE_ENTRY* = record
+    lpServiceName*: LPTSTR
+    lpServiceProc*: LPSERVICE_MAIN_FUNCTION
+
+  LPSERVICE_TABLE_ENTRY* = ptr SERVICE_TABLE_ENTRY
+  TSERVICETABLEENTRY* = SERVICE_TABLE_ENTRY
+  PSERVICETABLEENTRY* = ptr SERVICE_TABLE_ENTRY
+  SERVICE_TYPE_VALUE_ABS* = record
+    dwNameSpace*: DWORD
+    dwValueType*: DWORD
+    dwValueSize*: DWORD
+    lpValueName*: LPTSTR
+    lpValue*: PVOID
+
+  TSERVICETYPEVALUEABS* = SERVICE_TYPE_VALUE_ABS
+  PSERVICETYPEVALUEABS* = ptr SERVICE_TYPE_VALUE_ABS
+  SERVICE_TYPE_INFO_ABS* = record
+    lpTypeName*: LPTSTR
+    dwValueCount*: DWORD
+    Values*: array[0..0, SERVICE_TYPE_VALUE_ABS]
+
+  TSERVICETYPEINFOABS* = SERVICE_TYPE_INFO_ABS
+  PSERVICETYPEINFOABS* = ptr SERVICE_TYPE_INFO_ABS
+  SESSION_BUFFER* = record
+    lsn*: UCHAR
+    state*: UCHAR
+    local_name*: array[0..(NCBNAMSZ) - 1, UCHAR]
+    remote_name*: array[0..(NCBNAMSZ) - 1, UCHAR]
+    rcvs_outstanding*: UCHAR
+    sends_outstanding*: UCHAR
+
+  TSESSIONBUFFER* = SESSION_BUFFER
+  PSESSIONBUFFER* = ptr SESSION_BUFFER
+  SESSION_HEADER* = record
+    sess_name*: UCHAR
+    num_sess*: UCHAR
+    rcv_dg_outstanding*: UCHAR
+    rcv_any_outstanding*: UCHAR
+
+  TSESSIONHEADER* = SESSION_HEADER
+  PSESSIONHEADER* = ptr SESSION_HEADER
+  SET_PARTITION_INFORMATION* = record
+    PartitionType*: int8
+
+  TSETPARTITIONINFORMATION* = SET_PARTITION_INFORMATION
+  PSETPARTITIONINFORMATION* = ptr SET_PARTITION_INFORMATION
+  SHCONTF* = enum
+    SHCONTF_FOLDERS = 32, SHCONTF_NONFOLDERS = 64, SHCONTF_INCLUDEHIDDEN = 128
+  TSHCONTF* = SHCONTF
+  SHFILEINFO* = record
+    hIcon*: HICON
+    iIcon*: int32
+    dwAttributes*: DWORD
+    szDisplayName*: array[0..(MAX_PATH) - 1, char]
+    szTypeName*: array[0..79, char]
+
+  TSHFILEINFO* = SHFILEINFO
+  PSHFILEINFO* = ptr SHFILEINFO
+  FILEOP_FLAGS* = int16
+  TFILEOPFLAGS* = FILEOP_FLAGS
+  PFILEOPFLAGS* = ptr FILEOP_FLAGS
+  SHFILEOPSTRUCT* = record
+    hwnd*: HWND
+    wFunc*: UINT
+    pFrom*: LPCSTR
+    pTo*: LPCSTR
+    fFlags*: FILEOP_FLAGS
+    fAnyOperationsAborted*: WINBOOL
+    hNameMappings*: LPVOID
+    lpszProgressTitle*: LPCSTR
+
+  LPSHFILEOPSTRUCT* = ptr SHFILEOPSTRUCT
+  TSHFILEOPSTRUCT* = SHFILEOPSTRUCT
+  PSHFILEOPSTRUCT* = ptr SHFILEOPSTRUCT
+  SHGNO* = enum
+    SHGDN_NORMAL = 0, SHGDN_INFOLDER = 1, SHGDN_FORPARSING = 0x00008000
+  tagSHGDN* = SHGNO
+  TSHGDN* = SHGNO
+  SHNAMEMAPPING* = record
+    pszOldPath*: LPSTR
+    pszNewPath*: LPSTR
+    cchOldPath*: int32
+    cchNewPath*: int32
+
+  LPSHNAMEMAPPING* = ptr SHNAMEMAPPING
+  TSHNAMEMAPPING* = SHNAMEMAPPING
+  PSHNAMEMAPPING* = ptr SHNAMEMAPPING
+  SID_AND_ATTRIBUTES* = record
+    Sid*: PSID
+    Attributes*: DWORD
+
+  TSIDANDATTRIBUTES* = SID_AND_ATTRIBUTES
+  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
+  TSIDANDATTRIBUTESARRAY* = SID_AND_ATTRIBUTES_ARRAY
+  SINGLE_LIST_ENTRY* = record
+    Next*: ptr SINGLE_LIST_ENTRY
+
+  TSINGLELISTENTRY* = SINGLE_LIST_ENTRY
+  PSINGLELISTENTRY* = ptr SINGLE_LIST_ENTRY
+  SOUNDSENTRY* = record
+    cbSize*: UINT
+    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
+  tagSOUNDSENTRY* = SOUNDSENTRY
+  TSOUNDSENTRY* = SOUNDSENTRY
+  PSOUNDSENTRY* = ptr SOUNDSENTRY
+  STARTUPINFO* = record
+    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
+  TSTARTUPINFO* = STARTUPINFO
+  PSTARTUPINFO* = ptr STARTUPINFO
+  STICKYKEYS* = record
+    cbSize*: DWORD
+    dwFlags*: DWORD
+
+  LPSTICKYKEYS* = ptr STICKYKEYS
+  TSTICKYKEYS* = STICKYKEYS
+  PSTICKYKEYS* = ptr STICKYKEYS
+  STRRET* = record
+    uType*: UINT
+    cStr*: array[0..(MAX_PATH) - 1, char]
+
+  LPSTRRET* = ptr STRRET
+  TSTRRET* = STRRET
+  PSTRRET* = ptr STRRET
+  STYLEBUF* = record
+    dwStyle*: DWORD
+    szDescription*: array[0..31, CHAR]
+
+  LPSTYLEBUF* = ptr STYLEBUF
+  TSTYLEBUF* = STYLEBUF
+  PSTYLEBUF* = ptr STYLEBUF
+  STYLESTRUCT* = record
+    styleOld*: DWORD
+    styleNew*: DWORD
+
+  LPSTYLESTRUCT* = ptr STYLESTRUCT
+  TSTYLESTRUCT* = STYLESTRUCT
+  PSTYLESTRUCT* = ptr STYLESTRUCT
+  SYSTEM_AUDIT_ACE* = record
+    Header*: ACE_HEADER
+    Mask*: ACCESS_MASK
+    SidStart*: DWORD
+
+  TSYSTEMAUDITACE* = SYSTEM_AUDIT_ACE
+  PSYSTEMAUDITACE* = ptr SYSTEM_AUDIT_ACE
+  SYSTEM_INFO* = record
+    dwOemId*: DWORD
+    dwPageSize*: DWORD
+    lpMinimumApplicationAddress*: LPVOID
+    lpMaximumApplicationAddress*: LPVOID
+    dwActiveProcessorMask*: DWORD
+    dwNumberOfProcessors*: DWORD
+    dwProcessorType*: DWORD
+    dwAllocationGranularity*: DWORD
+    wProcessorLevel*: int16
+    wProcessorRevision*: int16
+
+  LPSYSTEM_INFO* = ptr SYSTEM_INFO
+  TSYSTEMINFO* = SYSTEM_INFO
+  PSYSTEMINFO* = ptr SYSTEM_INFO
+  SYSTEM_POWER_STATUS* = record
+    ACLineStatus*: int8
+    BatteryFlag*: int8
+    BatteryLifePercent*: int8
+    Reserved1*: int8
+    BatteryLifeTime*: DWORD
+    BatteryFullLifeTime*: DWORD
+
+  TSYSTEMPOWERSTATUS* = SYSTEM_POWER_STATUS
+  PSYSTEMPOWERSTATUS* = ptr SYSTEM_POWER_STATUS
+  LPSYSTEM_POWER_STATUS* = ptr emptyrecord
+  TAPE_ERASE* = record
+    `type`*: ULONG
+
+  TTAPEERASE* = TAPE_ERASE
+  PTAPEERASE* = ptr TAPE_ERASE
+  TAPE_GET_DRIVE_PARAMETERS* = record
+    ECC*: bool
+    Compression*: bool
+    DataPadding*: bool
+    ReportSetmarks*: bool
+    DefaultBlockSize*: ULONG
+    MaximumBlockSize*: ULONG
+    MinimumBlockSize*: ULONG
+    MaximumPartitionCount*: ULONG
+    FeaturesLow*: ULONG
+    FeaturesHigh*: ULONG
+    EOTWarningZoneSize*: ULONG
+
+  TTAPEGETDRIVEPARAMETERS* = TAPE_GET_DRIVE_PARAMETERS
+  PTAPEGETDRIVEPARAMETERS* = ptr TAPE_GET_DRIVE_PARAMETERS
+  TAPE_GET_MEDIA_PARAMETERS* = record
+    Capacity*: LARGE_INTEGER
+    Remaining*: LARGE_INTEGER
+    BlockSize*: DWORD
+    PartitionCount*: DWORD
+    WriteProtected*: bool
+
+  TTAPEGETMEDIAPARAMETERS* = TAPE_GET_MEDIA_PARAMETERS
+  PTAPEGETMEDIAPARAMETERS* = ptr TAPE_GET_MEDIA_PARAMETERS
+  TAPE_GET_POSITION* = record
+    `type`*: ULONG
+    Partition*: ULONG
+    OffsetLow*: ULONG
+    OffsetHigh*: ULONG
+
+  TTAPEGETPOSITION* = TAPE_GET_POSITION
+  PTAPEGETPOSITION* = ptr TAPE_GET_POSITION
+  TAPE_PREPARE* = record
+    Operation*: ULONG
+
+  TTAPEPREPARE* = TAPE_PREPARE
+  PTAPEPREPARE* = ptr TAPE_PREPARE
+  TAPE_SET_DRIVE_PARAMETERS* = record
+    ECC*: bool
+    Compression*: bool
+    DataPadding*: bool
+    ReportSetmarks*: bool
+    EOTWarningZoneSize*: ULONG
+
+  TTAPESETDRIVEPARAMETERS* = TAPE_SET_DRIVE_PARAMETERS
+  PTAPESETDRIVEPARAMETERS* = ptr TAPE_SET_DRIVE_PARAMETERS
+  TAPE_SET_MEDIA_PARAMETERS* = record
+    BlockSize*: ULONG
+
+  TTAPESETMEDIAPARAMETERS* = TAPE_SET_MEDIA_PARAMETERS
+  PTAPESETMEDIAPARAMETERS* = ptr TAPE_SET_MEDIA_PARAMETERS
+  TAPE_SET_POSITION* = record
+    `Method`*: ULONG
+    Partition*: ULONG
+    OffsetLow*: ULONG
+    OffsetHigh*: ULONG
+
+  TTAPESETPOSITION* = TAPE_SET_POSITION
+  PTAPESETPOSITION* = ptr TAPE_SET_POSITION
+  TAPE_WRITE_MARKS* = record
+    `type`*: ULONG
+    Count*: ULONG
+
+  TTAPEWRITEMARKS* = TAPE_WRITE_MARKS
+  PTAPEWRITEMARKS* = ptr TAPE_WRITE_MARKS
+  TTBADDBITMAP* = record
+    hInst*: HINST
+    nID*: UINT
+
+  LPTBADDBITMAP* = ptr TTBADDBITMAP
+  PTBADDBITMAP* = ptr TTBADDBITMAP
+  TBBUTTON* = record
+    iBitmap*: int32
+    idCommand*: int32
+    fsState*: int8
+    fsStyle*: int8
+    dwData*: DWORD
+    iString*: int32
+
+  LPTBBUTTON* = ptr TBBUTTON
+  LPCTBBUTTON* = ptr TBBUTTON
+  TTBBUTTON* = TBBUTTON
+  PTBBUTTON* = ptr TBBUTTON
+  TBNOTIFY* = record
+    hdr*: NMHDR
+    iItem*: int32
+    tbButton*: TBBUTTON
+    cchText*: int32
+    pszText*: LPTSTR
+
+  LPTBNOTIFY* = ptr TBNOTIFY
+  TTBNOTIFY* = TBNOTIFY
+  PTBNOTIFY* = ptr TBNOTIFY
+  TBSAVEPARAMS* = record
+    hkr*: HKEY
+    pszSubKey*: LPCTSTR
+    pszValueName*: LPCTSTR
+
+  TTBSAVEPARAMS* = TBSAVEPARAMS
+  PTBSAVEPARAMS* = ptr TBSAVEPARAMS
+  TC_HITTESTINFO* = record
+    pt*: POINT
+    flags*: UINT
+
+  TTCHITTESTINFO* = TC_HITTESTINFO
+  PTCHITTESTINFO* = ptr TC_HITTESTINFO
+  TC_ITEM* = record
+    mask*: UINT
+    lpReserved1*: UINT
+    lpReserved2*: UINT
+    pszText*: LPTSTR
+    cchTextMax*: int32
+    iImage*: int32
+    lParam*: LPARAM
+
+  TTCITEM* = TC_ITEM
+  PTCITEM* = ptr TC_ITEM
+  TC_ITEMHEADER* = record
+    mask*: UINT
+    lpReserved1*: UINT
+    lpReserved2*: UINT
+    pszText*: LPTSTR
+    cchTextMax*: int32
+    iImage*: int32
+
+  TTCITEMHEADER* = TC_ITEMHEADER
+  PTCITEMHEADER* = ptr TC_ITEMHEADER
+  TC_KEYDOWN* = record
+    hdr*: NMHDR
+    wVKey*: int16
+    flags*: UINT
+
+  TTCKEYDOWN* = TC_KEYDOWN
+  PTCKEYDOWN* = ptr TC_KEYDOWN
+  TEXTRANGE* = record
+    chrg*: CHARRANGE
+    lpstrText*: LPSTR
+
+  Ttextrange* = TEXTRANGE
+  Ptextrange* = ptr TEXTRANGE
+  TIME_ZONE_INFORMATION* = record
+    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
+  TTIMEZONEINFORMATION* = TIME_ZONE_INFORMATION
+  PTIMEZONEINFORMATION* = ptr TIME_ZONE_INFORMATION
+  TOGGLEKEYS* = record
+    cbSize*: DWORD
+    dwFlags*: DWORD
+
+  TTOGGLEKEYS* = TOGGLEKEYS
+  PTOGGLEKEYS* = ptr TOGGLEKEYS
+  TTOKEN_SOURCE* = record
+    SourceName*: array[0..7, CHAR]
+    SourceIdentifier*: LUID
+
+  PTOKENSOURCE* = ptr TTOKEN_SOURCE
+  TOKEN_CONTROL* = record
+    TokenId*: LUID
+    AuthenticationId*: LUID
+    ModifiedId*: LUID
+    TokenSource*: TTOKEN_SOURCE
+
+  TTOKENCONTROL* = TOKEN_CONTROL
+  PTOKENCONTROL* = ptr TOKEN_CONTROL
+  TTOKEN_DEFAULT_DACL* = record
+    DefaultDacl*: PACL
+
+  PTOKENDEFAULTDACL* = ptr TTOKEN_DEFAULT_DACL
+  TTOKEN_GROUPS* = record
+    GroupCount*: DWORD
+    Groups*: array[0..(ANYSIZE_ARRAY) - 1, SID_AND_ATTRIBUTES]
+
+  LPTOKEN_GROUPS* = ptr TTOKEN_GROUPS
+  PTOKENGROUPS* = ptr TTOKEN_GROUPS
+  TTOKEN_OWNER* = record
+    Owner*: PSID
+
+  PTOKENOWNER* = ptr TTOKEN_OWNER
+  TTOKEN_PRIMARY_GROUP* = record
+    PrimaryGroup*: PSID
+
+  PTOKENPRIMARYGROUP* = ptr TTOKEN_PRIMARY_GROUP
+  TTOKEN_PRIVILEGES* = record
+    PrivilegeCount*: DWORD
+    Privileges*: array[0..(ANYSIZE_ARRAY) - 1, LUID_AND_ATTRIBUTES]
+
+  PTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES
+  LPTOKEN_PRIVILEGES* = ptr TTOKEN_PRIVILEGES
+  TTOKEN_STATISTICS* = record
+    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* = record
+    User*: SID_AND_ATTRIBUTES
+
+  PTOKENUSER* = ptr TTOKEN_USER
+  TOOLINFO* = record
+    cbSize*: UINT
+    uFlags*: UINT
+    hwnd*: HWND
+    uId*: UINT
+    rect*: RECT
+    hinst*: HINST
+    lpszText*: LPTSTR
+
+  LPTOOLINFO* = ptr TOOLINFO
+  TTOOLINFO* = TOOLINFO
+  PTOOLINFO* = ptr TOOLINFO
+  TOOLTIPTEXT* = record
+    hdr*: NMHDR
+    lpszText*: LPTSTR
+    szText*: array[0..79, char]
+    hinst*: HINST
+    uFlags*: UINT
+
+  LPTOOLTIPTEXT* = ptr TOOLTIPTEXT
+  TTOOLTIPTEXT* = TOOLTIPTEXT
+  PTOOLTIPTEXT* = ptr TOOLTIPTEXT
+  TPMPARAMS* = record
+    cbSize*: UINT
+    rcExclude*: RECT
+
+  LPTPMPARAMS* = ptr TPMPARAMS
+  tagTPMPARAMS* = TPMPARAMS
+  TTPMPARAMS* = TPMPARAMS
+  PTPMPARAMS* = ptr TPMPARAMS
+  TRANSMIT_FILE_BUFFERS* = record
+    Head*: PVOID
+    HeadLength*: DWORD
+    Tail*: PVOID
+    TailLength*: DWORD
+
+  TTRANSMITFILEBUFFERS* = TRANSMIT_FILE_BUFFERS
+  PTRANSMITFILEBUFFERS* = ptr TRANSMIT_FILE_BUFFERS
+  TTHITTESTINFO* = record
+    hwnd*: HWND
+    pt*: POINT
+    ti*: TOOLINFO
+
+  LPHITTESTINFO* = ptr TTHITTESTINFO
+  TTTHITTESTINFO* = TTHITTESTINFO
+  PTTHITTESTINFO* = ptr TTHITTESTINFO
+  TTPOLYCURVE* = record
+    wType*: int16
+    cpfx*: int16
+    apfx*: array[0..0, POINTFX]
+
+  LPTTPOLYCURVE* = ptr TTPOLYCURVE
+  TTTPOLYCURVE* = TTPOLYCURVE
+  PTTPOLYCURVE* = ptr TTPOLYCURVE
+  TTPOLYGONHEADER* = record
+    cb*: DWORD
+    dwType*: DWORD
+    pfxStart*: POINTFX
+
+  LPTTPOLYGONHEADER* = ptr TTPOLYGONHEADER
+  TTTPOLYGONHEADER* = TTPOLYGONHEADER
+  PTTPOLYGONHEADER* = ptr TTPOLYGONHEADER
+  TV_DISPINFO* = record
+    hdr*: NMHDR
+    item*: TV_ITEM
+
+  TTVDISPINFO* = TV_DISPINFO
+  PTVDISPINFO* = ptr TV_DISPINFO
+  TV_HITTESTINFO* = record
+    pt*: POINT
+    flags*: UINT
+    hItem*: HTREEITEM
+
+  LPTV_HITTESTINFO* = ptr TV_HITTESTINFO
+  TTVHITTESTINFO* = TV_HITTESTINFO
+  PTVHITTESTINFO* = ptr TV_HITTESTINFO
+  TV_INSERTSTRUCT* = record
+    hParent*: HTREEITEM
+    hInsertAfter*: HTREEITEM
+    item*: TV_ITEM
+
+  LPTV_INSERTSTRUCT* = ptr TV_INSERTSTRUCT
+  TTVINSERTSTRUCT* = TV_INSERTSTRUCT
+  PTVINSERTSTRUCT* = ptr TV_INSERTSTRUCT
+  TV_KEYDOWN* = record
+    hdr*: NMHDR
+    wVKey*: int16
+    flags*: UINT
+
+  TTVKEYDOWN* = TV_KEYDOWN
+  PTVKEYDOWN* = ptr TV_KEYDOWN
+  TV_SORTCB* = record
+    hParent*: HTREEITEM
+    lpfnCompare*: PFNTVCOMPARE
+    lParam*: LPARAM
+
+  LPTV_SORTCB* = ptr TV_SORTCB
+  TTVSORTCB* = TV_SORTCB
+  PTVSORTCB* = ptr TV_SORTCB
+  UDACCEL* = record
+    nSec*: UINT
+    nInc*: UINT
+
+  TUDACCEL* = UDACCEL
+  PUDACCEL* = ptr UDACCEL
+  UNIVERSAL_NAME_INFO* = record
+    lpUniversalName*: LPTSTR
+
+  TUNIVERSALNAMEINFO* = UNIVERSAL_NAME_INFO
+  PUNIVERSALNAMEINFO* = ptr UNIVERSAL_NAME_INFO
+  USEROBJECTFLAGS* = record
+    fInherit*: WINBOOL
+    fReserved*: WINBOOL
+    dwFlags*: DWORD
+
+  tagUSEROBJECTFLAGS* = USEROBJECTFLAGS
+  TUSEROBJECTFLAGS* = USEROBJECTFLAGS
+  PUSEROBJECTFLAGS* = ptr USEROBJECTFLAGS
+  VALENT* = record
+    ve_valuename*: LPTSTR
+    ve_valuelen*: DWORD
+    ve_valueptr*: DWORD
+    ve_type*: DWORD
+
+  TVALENT* = VALENT
+  PVALENT* = ptr VALENT
+  value_ent* = VALENT
+  Tvalue_ent* = VALENT
+  Pvalue_ent* = ptr VALENT
+  VERIFY_INFORMATION* = record
+    StartingOffset*: LARGE_INTEGER
+    len*: DWORD
+
+  TVERIFYINFORMATION* = VERIFY_INFORMATION
+  PVERIFYINFORMATION* = ptr VERIFY_INFORMATION
+  VS_FIXEDFILEINFO* = record
+    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
+
+  TVSFIXEDFILEINFO* = VS_FIXEDFILEINFO
+  PVSFIXEDFILEINFO* = ptr VS_FIXEDFILEINFO
+  WIN32_FIND_DATA* = record
+    dwFileAttributes*: DWORD
+    ftCreationTime*: FILETIME
+    ftLastAccessTime*: FILETIME
+    ftLastWriteTime*: FILETIME
+    nFileSizeHigh*: DWORD
+    nFileSizeLow*: DWORD
+    dwReserved0*: DWORD
+    dwReserved1*: DWORD
+    cFileName*: array[0..(MAX_PATH) - 1, TCHAR]
+    cAlternateFileName*: array[0..13, TCHAR]
+
+  LPWIN32_FIND_DATA* = ptr WIN32_FIND_DATA
+  PWIN32_FIND_DATA* = ptr WIN32_FIND_DATA
+  TWIN32FINDDATA* = WIN32_FIND_DATA
+  TWIN32FINDDATAA* = WIN32_FIND_DATA
+  WIN32_FIND_DATAW* = record
+    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
+  TWIN32FINDDATAW* = WIN32_FIND_DATAW
+  WIN32_STREAM_ID* = record
+    dwStreamId*: DWORD
+    dwStreamAttributes*: DWORD
+    Size*: LARGE_INTEGER
+    dwStreamNameSize*: DWORD
+    cStreamName*: ptr WCHAR
+
+  TWIN32STREAMID* = WIN32_STREAM_ID
+  PWIN32STREAMID* = ptr WIN32_STREAM_ID
+  WINDOWPLACEMENT* = record
+    len*: UINT
+    flags*: UINT
+    showCmd*: UINT
+    ptMinPosition*: POINT
+    ptMaxPosition*: POINT
+    rcNormalPosition*: RECT
+
+  TWINDOWPLACEMENT* = WINDOWPLACEMENT
+  PWINDOWPLACEMENT* = ptr WINDOWPLACEMENT
+  WNDCLASS* = record
+    style*: UINT
+    lpfnWndProc*: WNDPROC
+    cbClsExtra*: int32
+    cbWndExtra*: int32
+    hInstance*: HANDLE
+    hIcon*: HICON
+    hCursor*: HCURSOR
+    hbrBackground*: HBRUSH
+    lpszMenuName*: LPCTSTR
+    lpszClassName*: LPCTSTR
+
+  LPWNDCLASS* = ptr WNDCLASS
+  TWNDCLASS* = WNDCLASS
+  TWNDCLASSA* = WNDCLASS
+  PWNDCLASS* = ptr WNDCLASS
+  WNDCLASSW* = record
+    style*: UINT
+    lpfnWndProc*: WNDPROC
+    cbClsExtra*: int32
+    cbWndExtra*: int32
+    hInstance*: HANDLE
+    hIcon*: HICON
+    hCursor*: HCURSOR
+    hbrBackground*: HBRUSH
+    lpszMenuName*: LPCWSTR
+    lpszClassName*: LPCWSTR
+
+  LPWNDCLASSW* = ptr WNDCLASSW
+  TWNDCLASSW* = WNDCLASSW
+  PWNDCLASSW* = ptr WNDCLASSW
+  WNDCLASSEX* = record
+    cbSize*: UINT
+    style*: UINT
+    lpfnWndProc*: WNDPROC
+    cbClsExtra*: int32
+    cbWndExtra*: int32
+    hInstance*: HANDLE
+    hIcon*: HICON
+    hCursor*: HCURSOR
+    hbrBackground*: HBRUSH
+    lpszMenuName*: LPCTSTR
+    lpszClassName*: LPCTSTR
+    hIconSm*: HANDLE
+
+  LPWNDCLASSEX* = ptr WNDCLASSEX
+  TWNDCLASSEX* = WNDCLASSEX
+  TWNDCLASSEXA* = WNDCLASSEX
+  PWNDCLASSEX* = ptr WNDCLASSEX
+  WNDCLASSEXW* = record
+    cbSize*: UINT
+    style*: UINT
+    lpfnWndProc*: WNDPROC
+    cbClsExtra*: int32
+    cbWndExtra*: int32
+    hInstance*: HANDLE
+    hIcon*: HICON
+    hCursor*: HCURSOR
+    hbrBackground*: HBRUSH
+    lpszMenuName*: LPCWSTR
+    lpszClassName*: LPCWSTR
+    hIconSm*: HANDLE
+
+  LPWNDCLASSEXW* = ptr WNDCLASSEXW
+  TWNDCLASSEXW* = WNDCLASSEXW
+  PWNDCLASSEXW* = ptr WNDCLASSEXW
+  CONNECTDLGSTRUCT* = record
+    cbStructure*: DWORD
+    hwndOwner*: HWND
+    lpConnRes*: LPNETRESOURCE
+    dwFlags*: DWORD
+    dwDevNum*: DWORD
+
+  LPCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT
+  TCONNECTDLGSTRUCT* = CONNECTDLGSTRUCT
+  PCONNECTDLGSTRUCT* = ptr CONNECTDLGSTRUCT
+  DISCDLGSTRUCT* = record
+    cbStructure*: DWORD
+    hwndOwner*: HWND
+    lpLocalName*: LPTSTR
+    lpRemoteName*: LPTSTR
+    dwFlags*: DWORD
+
+  LPDISCDLGSTRUCT* = ptr DISCDLGSTRUCT
+  TDISCDLGSTRUCT* = DISCDLGSTRUCT
+  TDISCDLGSTRUCTA* = DISCDLGSTRUCT
+  PDISCDLGSTRUCT* = ptr DISCDLGSTRUCT
+  NETINFOSTRUCT* = record
+    cbStructure*: DWORD
+    dwProviderVersion*: DWORD
+    dwStatus*: DWORD
+    dwCharacteristics*: DWORD
+    dwHandle*: DWORD
+    wNetType*: int16
+    dwPrinters*: DWORD
+    dwDrives*: DWORD
+
+  LPNETINFOSTRUCT* = ptr NETINFOSTRUCT
+  TNETINFOSTRUCT* = NETINFOSTRUCT
+  PNETINFOSTRUCT* = ptr NETINFOSTRUCT
+  NETCONNECTINFOSTRUCT* = record
+    cbStructure*: DWORD
+    dwFlags*: DWORD
+    dwSpeed*: DWORD
+    dwDelay*: DWORD
+    dwOptDataSize*: DWORD
+
+  LPNETCONNECTINFOSTRUCT* = ptr NETCONNECTINFOSTRUCT
+  TNETCONNECTINFOSTRUCT* = 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: TENHMETARECORD,
+                           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* = record
+    x*: float32
+    y*: float32
+
+  TPOINTFLOAT* = POINTFLOAT
+  PPOINTFLOAT* = ptr POINTFLOAT
+  GLYPHMETRICSFLOAT* = record
+    gmfBlackBoxX*: float32
+    gmfBlackBoxY*: float32
+    gmfptGlyphOrigin*: POINTFLOAT
+    gmfCellIncX*: float32
+    gmfCellIncY*: float32
+
+  LPGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT
+  TGLYPHMETRICSFLOAT* = GLYPHMETRICSFLOAT
+  PGLYPHMETRICSFLOAT* = ptr GLYPHMETRICSFLOAT
+  LAYERPLANEDESCRIPTOR* = record
+    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
+  tagLAYERPLANEDESCRIPTOR* = LAYERPLANEDESCRIPTOR
+  TLAYERPLANEDESCRIPTOR* = LAYERPLANEDESCRIPTOR
+  PLAYERPLANEDESCRIPTOR* = ptr LAYERPLANEDESCRIPTOR
+  PIXELFORMATDESCRIPTOR* = record
+    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
+  tagPIXELFORMATDESCRIPTOR* = PIXELFORMATDESCRIPTOR
+  TPIXELFORMATDESCRIPTOR* = PIXELFORMATDESCRIPTOR
+  PPIXELFORMATDESCRIPTOR* = ptr PIXELFORMATDESCRIPTOR
+  USER_INFO_2* = record
+    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
+  TUSERINFO2* = USER_INFO_2
+  USER_INFO_0* = record
+    usri0_name*: LPWSTR
+
+  PUSER_INFO_0* = ptr USER_INFO_0
+  LPUSER_INFO_0* = ptr USER_INFO_0
+  TUSERINFO0* = USER_INFO_0
+  USER_INFO_3* = record
+    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
+  TUSERINFO3* = USER_INFO_3
+  GROUP_INFO_2* = record
+    grpi2_name*: LPWSTR
+    grpi2_comment*: LPWSTR
+    grpi2_group_id*: DWORD
+    grpi2_attributes*: DWORD
+
+  PGROUP_INFO_2* = ptr GROUP_INFO_2
+  TGROUPINFO2* = GROUP_INFO_2
+  LOCALGROUP_INFO_0* = record
+    lgrpi0_name*: LPWSTR
+
+  PLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0
+  LPLOCALGROUP_INFO_0* = ptr LOCALGROUP_INFO_0
+  TLOCALGROUPINFO0* = LOCALGROUP_INFO_0
+  IMAGE_DOS_HEADER* = record
+    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
+  TIMAGEDOSHEADER* = IMAGE_DOS_HEADER
+  NOTIFYICONDATAA* = record
+    cbSize*: DWORD
+    Wnd*: HWND
+    uID*: UINT
+    uFlags*: UINT
+    uCallbackMessage*: UINT
+    hIcon*: HICON
+    szTip*: array[0..63, Char]
+
+  NOTIFYICONDATA* = NOTIFYICONDATAA
+  NOTIFYICONDATAW* = record
+    cbSize*: DWORD
+    Wnd*: HWND
+    uID*: UINT
+    uFlags*: UINT
+    uCallbackMessage*: UINT
+    hIcon*: HICON
+    szTip*: array[0..63, int16]
+
+  TNotifyIconDataA* = NOTIFYICONDATAA
+  TNotifyIconDataW* = NOTIFYICONDATAW
+  TNotifyIconData* = TNotifyIconDataA
+  PNotifyIconDataA* = ptr TNotifyIconDataA
+  PNotifyIconDataW* = ptr TNotifyIconDataW
+  PNotifyIconData* = PNotifyIconDataA
+  TWOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, HANDLE]
+  PWOHandleArray* = ptr TWOHandleArray
+  MMRESULT* = int32
+
+type
+  PWaveFormatEx* = ptr TWaveFormatEx
+  TWaveFormatEx* = record
+    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* = record
+    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* = record
+    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
+# Hot key control
+
+const
+  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
+# Up/down control
+
+const
+  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* = record
+    hwnd*: HWND
+    message*: UINT
+    wParam*: WPARAM
+    lParam*: LPARAM
+    time*: DWORD
+    pt*: POINT
+
+  LPMSG* = ptr MSG
+  tagMSG* = MSG
+  TMSG* = MSG
+  PMSG* = ptr MSG
+  PMessage* = ptr TMessage
+  TMessage* = record          #fields according to ICS
+    msg*: UINT
+    wParam*: WPARAM
+    lParam*: LPARAM
+    Result*: LRESULT
+
+  TWMSize* = record
+    Msg*: UINT
+    SizeType*: WPARAM
+    Width*: HALFPARAM
+    Height*: HALFPARAM
+    Result*: LRESULT
+
+  TWMNoParams* = record
+    Msg*: UINT
+    Unused*: array[0..3, HALFPARAM]
+    Result*: LRESULT
+
+  TWMCancelMode* = TWMNoParams
+  TWMNCDestroy* = TWMNoParams
+  TWMDestroy* = TWMNoParams
+  TWMClose* = TWMNoParams
+  TWMQueryUIState* = TWMNoParams
+  TWMUIState* = record
+    Msg*: UINT
+    Action*: int16
+    Flags*: int16
+    Unused*: HRESULT
+
+  TWMChangeUIState* = TWMUIState
+  TWMUpdateUIState* = TWMUIState
+  TWMKey* = record
+    Msg*: UINT
+    CharCode*: int16
+    Unused*: int16
+    KeyData*: int32
+    Result*: LRESULT
+
+  TWMKeyDown* = TWMKey
+  TWMKeyUp* = TWMKey
+  TWMChar* = TWMKey
+  TWMSysChar* = TWMKey
+  TWMSysKeyDown* = TWMKey
+  TWMSysKeyUp* = TWMKey
+  TWMMenuChar* = record
+    Msg*: UINT
+    User*: Char
+    MenuFlag*: int16
+    Menu*: HMENU
+    Result*: LRESULT
+
+  TWMGetDlgCode* = TWMNoParams
+  TWMFontChange* = TWMNoParams
+  TWMGetFont* = TWMNoParams
+  TWMSysColorChange* = TWMNoParams
+  TWMQueryDragIcon* = TWMNoParams
+  TWMScroll* = record
+    Msg*: UINT
+    ScrollCode*: HALFPARAM
+    Pos*: HALFPARAM
+    ScrollBar*: HWND
+    Result*: LRESULT
+
+  TWMHScroll* = TWMScroll
+  TWMVScroll* = TWMScroll
+  TWMGetText* = record
+    Msg*: UINT
+    TextMax*: LPARAM
+    Text*: cstring
+    Result*: LRESULT
+
+  TWMGetTextLength* = TWMNoParams
+  TWMKillFocus* = record
+    Msg*: UINT
+    FocusedWnd*: HWND
+    UnUsed*: WPARAM
+    Result*: LRESULT
+
+  TWMSetCursor* = record
+    Msg*: UINT
+    CursorWnd*: HWND
+    HitTest*: HALFPARAM
+    MouseMsg*: HALFPARAM
+    Result*: LRESULT
+
+  TWMSetFocus* = record
+    Msg*: UINT
+    FocusedWnd*: HWND
+    Unused*: WPARAM
+    Result*: LRESULT
+
+  TWMSetFont* = record
+    Msg*: UINT
+    Font*: HFONT
+    Redraw*: HALFPARAMBOOL
+    Unused*: HALFPARAM
+    Result*: LRESULT
+
+  TWMShowWindow* = record
+    Msg*: UINT
+    Show*: HALFPARAMBOOL
+    Unused*: HALFPARAM
+    Status*: WPARAM
+    Result*: LRESULT
+
+  TWMEraseBkgnd* = record
+    Msg*: UINT
+    DC*: HDC
+    Unused*: LPARAM
+    Result*: LRESULT
+
+  TWMNCHitTest* = record
+    Msg*: UINT
+    Unused*: int32
+    Pos*: TSmallPoint
+    Result*: LRESULT
+
+  TWMMouse* = record
+    Msg*: UINT
+    Keys*: int32
+    Pos*: TSmallPoint
+    Result*: LRESULT
+
+  TWMLButtonDblClk* = TWMMouse
+  TWMLButtonDown* = TWMMouse
+  TWMLButtonUp* = TWMMouse
+  TWMMButtonDblClk* = TWMMouse
+  TWMMButtonDown* = TWMMouse
+  TWMMButtonUp* = TWMMouse
+  TWMMouseWheel* = record
+    Msg*: UINT
+    Keys*: int16
+    WheelDelta*: int16
+    Pos*: TSmallPoint
+    Result*: LRESULT
+
+  TWMNCHitMessage* = record
+    Msg*: UINT
+    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* = record
+    Msg*: UINT
+    DC*: HDC
+    Unused*: int32
+    Result*: LRESULT
+
+  TWMCommand* = record
+    Msg*: UINT
+    ItemID*: int16
+    NotifyCode*: int16
+    Ctl*: HWND
+    Result*: LRESULT
+
+  TWMNotify* = record
+    Msg*: UINT
+    IDCtrl*: int32
+    NMHdr*: PNMHdr
+    Result*: LRESULT
+
+  TWMPrint* = record
+    Msg*: UINT
+    DC*: HDC
+    Flags*: int
+    Result*: LRESULT
+
+  TWMPrintClient* = TWMPrint
+  TWMWinIniChange* = record
+    Msg*: UINT
+    Unused*: int
+    Section*: cstring
+    Result*: LRESULT
+
+  TWMContextMenu* = record
+    Msg*: UINT
+    hWnd*: HWND
+    Pos*: TSmallPoint
+    Result*: LRESULT
+
+  TWMNCCalcSize* = record
+    Msg*: UINT
+    CalcValidRects*: WINBOOL
+    CalcSize_Params*: PNCCalcSizeParams
+    Result*: LRESULT
+
+  TWMCharToItem* = record
+    Msg*: UINT
+    Key*: int16
+    CaretPos*: int16
+    ListBox*: HWND
+    Result*: LRESULT
+
+  TWMVKeyToItem* = TWMCharToItem
+  TMyEventRange = range[0'i16..16000'i16]
+  TWMParentNotify* = record
+    Msg*: UINT
+    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* = record
+    Msg*: UINT
+    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* = record
+    Msg*: UINT
+    Unused*: int
+    Pos*: TSmallPoint
+    Result*: LRESULT
+
+  TWMWindowPosMsg* = record
+    Msg*: UINT
+    Unused*: int
+    WindowPos*: PWindowPos
+    Result*: LRESULT
+
+  TWMWindowPosChanged* = TWMWindowPosMsg
+  TWMWindowPosChanging* = TWMWindowPosMsg
+  TWMCompareItem* = record
+    Msg*: UINT
+    Ctl*: HWnd
+    CompareItemStruct*: PCompareItemStruct
+    Result*: LRESULT
+
+  TWMDeleteItem* = record
+    Msg*: UINT
+    Ctl*: HWND
+    DeleteItemStruct*: PDeleteItemStruct
+    Result*: LRESULT
+
+  TWMDrawItem* = record
+    Msg*: UINT
+    Ctl*: HWND
+    DrawItemStruct*: PDrawItemStruct
+    Result*: LRESULT
+
+  TWMMeasureItem* = record
+    Msg*: UINT
+    IDCtl*: HWnd
+    MeasureItemStruct*: PMeasureItemStruct
+    Result*: LRESULT
+
+  TWMNCCreate* = record
+    Msg*: UINT
+    Unused*: int
+    CreateStruct*: PCreateStruct
+    Result*: LRESULT
+
+  TWMInitMenuPopup* = record
+    Msg*: UINT
+    MenuPopup*: HMENU
+    Pos*: int16
+    SystemMenu*: WordBool
+    Result*: LRESULT
+
+  TWMMenuSelect* = record
+    Msg*: UINT
+    IDItem*: int16
+    MenuFlag*: int16
+    Menu*: HMENU
+    Result*: LRESULT
+
+  TWMActivate* = record
+    Msg*: UINT
+    Active*: int16
+    Minimized*: WordBool
+    ActiveWindow*: HWND
+    Result*: LRESULT
+
+  TWMQueryEndSession* = record
+    Msg*: UINT
+    Source*: int32
+    Unused*: int32
+    Result*: LRESULT
+
+  TWMMDIActivate* = record
+    Msg*: UINT
+    DeactiveWnd*: HWND
+    ActiveWnd*: HWND
+    Result*: LRESULT
+
+  TWMNextDlgCtl* = record
+    Msg*: UINT
+    CtlFocus*: int32
+    Handle*: WordBool
+    Unused*: int16
+    Result*: LRESULT
+
+  TWMHelp* = record
+    Msg*: UINT
+    Unused*: int
+    HelpInfo*: PHelpInfo
+    Result*: LRESULT
+
+  TWMGetMinMaxInfo* = record
+    Msg*: UINT
+    Unused*: int
+    MinMaxInfo*: PMinMaxInfo
+    Result*: LRESULT
+
+  TWMSettingChange* = record
+    Msg*: UINT
+    Flag*: int
+    Section*: cstring
+    Result*: LRESULT
+
+  TWMCreate* = record
+    Msg*: UINT
+    Unused*: int
+    CreateStruct*: PCreateStruct
+    Result*: LRESULT
+
+  TWMCtlColor* = record
+    Msg*: UINT
+    ChildDC*: HDC
+    ChildWnd*: HWND
+    Result*: LRESULT
+
+  TWMCtlColorScrollbar* = TWMCtlColor
+  TWMCtlColorStatic* = TWMCtlColor
+  TWMCtlColorBtn* = TWMCtlColor
+  TWMCtlColorListbox* = TWMCtlColor
+  TWMCtlColorMsgbox* = TWMCtlColor
+  TWMCtlColorDlg* = TWMCtlColor
+  TWMCtlColorEdit* = TWMCtlColor
+  TWMInitDialog* = record
+    Msg*: UINT
+    Focus*: HWND
+    InitParam*: int32
+    Result*: LRESULT
+
+  TWMNCPaint* = record
+    Msg*: UINT
+    RGN*: HRGN
+    Unused*: int32
+    Result*: LRESULT
+
+  TWMSetText* = record
+    Msg*: UINT
+    Unused*: int32
+    Text*: cstring
+    Result*: LRESULT
+
+  TWMSizeClipboard* = record
+    Msg*: UINT
+    Viewer*: HWND
+    RC*: THandle
+    Result*: LRESULT
+
+  TWMSpoolerStatus* = record
+    Msg*: UINT
+    JobStatus*: LPARAM
+    JobsLeft*: WPARAM
+    Unused*: WPARAM
+    Result*: LRESULT
+
+  TWMStyleChange* = record
+    Msg*: UINT
+    StyleType*: LPARAM
+    StyleStruct*: PStyleStruct
+    Result*: LRESULT
+
+  TWMStyleChanged* = TWMStyleChange
+  TWMStyleChanging* = TWMStyleChange
+  TWMSysDeadChar* = record
+    Msg*: UINT
+    CharCode*: WPARAM
+    Unused*: WPARAM
+    KeyData*: LPARAM
+    Result*: LRESULT
+
+  TWMSystemError* = record
+    Msg*: UINT
+    ErrSpec*: WPARAM
+    Unused*: LPARAM
+    Result*: LRESULT
+
+  TWMTimeChange* = TWMNoParams
+  TWMTimer* = record
+    Msg*: UINT
+    TimerID*: LPARAM
+    TimerProc*: TFarProc
+    Result*: LRESULT
+
+  TWMUndo* = TWMNoParams
+  TWMVScrollClipboard* = record
+    Msg*: UINT
+    Viewer*: HWND
+    ScollCode*: WPARAM
+    ThumbPos*: WPARAM
+    Result*: LRESULT
+
+  TWMDisplayChange* = record
+    Msg*: UINT
+    BitsPerPixel*: int
+    Width*: WPARAM
+    Height*: WPARAM
+    Result*: LRESULT
+
+  TWMDropFiles* = record
+    Msg*: UINT
+    Drop*: THANDLE
+    Unused*: LPARAM
+    Result*: LRESULT
+
+  TWMEnable* = record
+    Msg*: int
+    Enabled*: WINBOOL
+    Unused*: int32
+    Result*: int32
+
+  TWMMouseActivate* = record
+    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: UINT, 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): UINT{.
+    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): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetAtomNameA".}
+proc GetProfileIntA*(lpAppName: LPCSTR, lpKeyName: LPCSTR, nDefault: WINT): UINT{.
+    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): UINT{.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): UINT{.stdcall, dynlib: "kernel32",
+    importc: "GetDriveTypeA".}
+proc GetSystemDirectoryA*(lpBuffer: LPSTR, uSize: UINT): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetSystemDirectoryA".}
+proc GetTempPathA*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.stdcall,
+    dynlib: "kernel32", importc: "GetTempPathA".}
+proc GetTempFileNameA*(lpPathName: LPCSTR, lpPrefixString: LPCSTR,
+                       uUnique: UINT, lpTempFileName: LPSTR): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetTempFileNameA".}
+proc GetWindowsDirectoryA*(lpBuffer: LPSTR, uSize: UINT): UINT{.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: UINT): 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, hWnd: 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: UINT): 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,
+                    lParam: 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, lParam: 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): UINT{.stdcall, dynlib: "user32",
+    importc: "RegisterWindowMessageA".}
+proc GetMessageA*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                  wMsgFilterMax: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetMessageA".}
+proc DispatchMessageA*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",
+    importc: "DispatchMessageA".}
+proc PeekMessageA*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                   wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "PeekMessageA".}
+proc SendMessageA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageA".}
+proc SendMessageTimeoutA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM,
+                          fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}
+proc SendNotifyMessageA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SendNotifyMessageA".}
+proc SendMessageCallbackA*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                           lParam: LPARAM, lpResultCallBack: SENDASYNCPROC,
+                           dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SendMessageCallbackA".}
+proc PostMessageA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "PostMessageA".}
+proc PostThreadMessageA*(idThread: DWORD, Msg: UINT, wParam: WPARAM,
+                         lParam: LPARAM): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "PostThreadMessageA".}
+proc DefWindowProcA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "DefWindowProcA".}
+proc CallWindowProcA*(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT,
+                      wParam: WPARAM, lParam: 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,
+                      hMenu: 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): UINT{.stdcall, dynlib: "user32",
+    importc: "GetDlgItemTextA".}
+proc SendDlgItemMessageA*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT,
+                          wParam: WPARAM, lParam: LPARAM): LONG{.stdcall,
+    dynlib: "user32", importc: "SendDlgItemMessageA".}
+proc DefDlgProcA*(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "DefDlgProcA".}
+proc CallMsgFilterA*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "CallMsgFilterA".}
+proc RegisterClipboardFormatA*(lpszFormat: LPCSTR): UINT{.stdcall,
+    dynlib: "user32", importc: "RegisterClipboardFormatA".}
+proc GetClipboardFormatNameA*(format: UINT, 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: UINT, uMapType: UINT): UINT{.stdcall,
+    dynlib: "user32", importc: "MapVirtualKeyA".}
+proc MapVirtualKeyExA*(uCode: UINT, uMapType: UINT, dwhkl: HKL): UINT{.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*(hWnd: 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*(hMenu: HMENU, cmd: UINT, lpszNewItem: LPCSTR, cmdInsert: UINT,
+                  flags: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ChangeMenuA".}
+proc GetMenuStringA*(hMenu: HMENU, uIDItem: UINT, lpString: LPSTR,
+                     nMaxCount: int32, uFlag: UINT): int32{.stdcall,
+    dynlib: "user32", importc: "GetMenuStringA".}
+proc InsertMenuA*(hMenu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "InsertMenuA".}
+proc AppendMenuA*(hMenu: HMENU, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "AppendMenuA".}
+proc ModifyMenuA*(hMnu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ModifyMenuA".}
+proc InsertMenuItemA*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                      para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "InsertMenuItemA".}
+proc GetMenuItemInfoA*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetMenuItemInfoA".}
+proc SetMenuItemInfoA*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetMenuItemInfoA".}
+proc DrawTextA*(hDC: HDC, lpString: LPCSTR, nCount: int32, lpRect: LPRECT,
+                uFormat: UINT): int32{.stdcall, dynlib: "user32",
+                                       importc: "DrawTextA".}
+proc DrawTextExA*(para1: HDC, para2: LPSTR, para3: int32, para4: LPRECT,
+                  para5: UINT, 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: UINT): 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*(hWnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetPropA".}
+proc GetPropA*(hWnd: HWND, lpString: LPCSTR): HANDLE{.stdcall, dynlib: "user32",
+    importc: "GetPropA".}
+proc RemovePropA*(hWnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,
+    dynlib: "user32", importc: "RemovePropA".}
+proc EnumPropsExA*(hWnd: HWND, lpEnumFunc: PROPENUMPROCEX, lParam: LPARAM): int32{.
+    stdcall, dynlib: "user32", importc: "EnumPropsExA".}
+proc EnumPropsA*(hWnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,
+    dynlib: "user32", importc: "EnumPropsA".}
+proc SetWindowTextA*(hWnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetWindowTextA".}
+proc GetWindowTextA*(hWnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{.
+    stdcall, dynlib: "user32", importc: "GetWindowTextA".}
+proc GetWindowTextLengthA*(hWnd: HWND): int32{.stdcall, dynlib: "user32",
+    importc: "GetWindowTextLengthA".}
+proc MessageBoxA*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32{.
+    stdcall, dynlib: "user32", importc: "MessageBoxA".}
+proc MessageBoxExA*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT,
+                    wLanguageId: int16): int32{.stdcall, dynlib: "user32",
+    importc: "MessageBoxExA".}
+proc MessageBoxIndirectA*(para1: LPMSGBOXPARAMS): int32{.stdcall,
+    dynlib: "user32", importc: "MessageBoxIndirectA".}
+proc GetWindowLongA*(hWnd: HWND, nIndex: int32): LONG{.stdcall,
+    dynlib: "user32", importc: "GetWindowLongA".}
+proc SetWindowLongA*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall,
+    dynlib: "user32", importc: "SetWindowLongA".}
+proc GetClassLongA*(hWnd: HWND, nIndex: int32): DWORD{.stdcall,
+    dynlib: "user32", importc: "GetClassLongA".}
+proc SetClassLongA*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall,
+    dynlib: "user32", importc: "SetClassLongA".}
+when defined(cpu64):
+  proc GetWindowLongPtrA*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongPtrA".}
+  proc SetWindowLongPtrA*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".}
+  proc GetClassLongPtrA*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetClassLongPtrA".}
+  proc SetClassLongPtrA*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetClassLongPtrA".}
+else:
+  proc GetWindowLongPtrA*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongA".}
+  proc SetWindowLongPtrA*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongA".}
+  proc GetClassLongPtrA*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetClassLongA".}
+  proc SetClassLongPtrA*(hWnd: 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*(hWnd: 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: UINT, para4: int32,
+                 para5: int32, para6: UINT): HANDLE{.stdcall, dynlib: "user32",
+    importc: "LoadImageA".}
+proc LoadStringA*(hInstance: HINST, uID: UINT, 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: UINT): 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: UINT): int32{.
+    stdcall, dynlib: "user32", importc: "DlgDirListComboBoxA".}
+proc DlgDirSelectComboBoxExA*(hDlg: HWND, lpString: LPSTR, nCount: int32,
+                              nIDComboBox: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "DlgDirSelectComboBoxExA".}
+proc DefFrameProcA*(hWnd: HWND, hWndMDIClient: HWND, uMsg: UINT, wParam: WPARAM,
+                    lParam: LPARAM): LRESULT{.stdcall, dynlib: "user32",
+    importc: "DefFrameProcA".}
+proc DefMDIChildProcA*(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: 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, lParam: LPARAM): HWND{.
+    stdcall, dynlib: "user32", importc: "CreateMDIWindowA".}
+proc WinHelpA*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: UINT, 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: UINT, uiParam: UINT, pvParam: PVOID,
+                            fWinIni: UINT): 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: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthA".}
+proc GetCharWidth32A*(para1: HDC, para2: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidth32A".}
+proc GetCharWidthFloatA*(para1: HDC, para2: UINT, para3: UINT, para4: ptr float32): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}
+proc GetCharABCWidthsA*(para1: HDC, para2: UINT, para3: UINT, para4: LPABC): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}
+proc GetCharABCWidthsFloatA*(para1: HDC, para2: UINT, para3: UINT,
+                             para4: LPABCFLOAT): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}
+proc GetGlyphOutlineA*(para1: HDC, para2: UINT, para3: UINT,
+                       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: UINT, para3: LPOUTLINETEXTMETRIC): UINT{.
+    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: UINT, para3: LPSTR): UINT{.
+    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: UINT,
+                  para5: LPRECT, para6: LPCSTR, para7: UINT, 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: UINT): 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: UINT, uFlags: UINT): HIMAGELIST{.
+    stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageA".}
+proc CreateStatusWindowA*(style: LONG, lpszText: LPCSTR, hwndParent: HWND,
+                          wID: UINT): HWND{.stdcall, dynlib: "comctl32",
+    importc: "CreateStatusWindowA".}
+proc DrawStatusTextA*(hDC: HDC, lprc: LPRECT, pszText: LPCSTR, uFlags: UINT){.
+    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, hMenu: 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, hKey: HKEY, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}
+proc RegCreateKeyA*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}
+proc RegCreateKeyExA*(hKey: 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*(hKey: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegDeleteKeyA".}
+proc RegDeleteValueA*(hKey: HKEY, lpValueName: LPCSTR): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegDeleteValueA".}
+proc RegEnumKeyA*(hKey: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".}
+proc RegEnumKeyExA*(hKey: HKEY, dwIndex: DWORD, lpName: LPSTR,
+                    lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR,
+                    lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}
+proc RegEnumValueA*(hKey: HKEY, dwIndex: DWORD, lpValueName: LPSTR,
+                    lpcbValueName: LPDWORD, lpReserved: LPDWORD,
+                    lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}
+proc RegLoadKeyA*(hKey: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegLoadKeyA".}
+proc RegOpenKeyA*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}
+proc RegOpenKeyExA*(hKey: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,
+                    samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegOpenKeyExA".}
+proc RegQueryInfoKeyA*(hKey: 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*(hKey: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR,
+                     lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",
+    importc: "RegQueryValueA".}
+proc RegQueryMultipleValuesA*(hKey: HKEY, val_list: PVALENT, num_vals: DWORD,
+                              lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}
+proc RegQueryValueExA*(hKey: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD,
+                       lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".}
+proc RegReplaceKeyA*(hKey: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR,
+                     lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32",
+    importc: "RegReplaceKeyA".}
+proc RegRestoreKeyA*(hKey: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegRestoreKeyA".}
+proc RegSaveKeyA*(hKey: HKEY, lpFile: LPCSTR,
+                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegSaveKeyA".}
+proc RegSetValueA*(hKey: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR,
+                   cbData: DWORD): LONG{.stdcall, dynlib: "advapi32",
+    importc: "RegSetValueA".}
+proc RegSetValueExA*(hKey: HKEY, lpValueName: LPCSTR, Reserved: DWORD,
+                     dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}
+proc RegUnLoadKeyA*(hKey: 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): UINT{.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: UINT, 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): UINT{.
+    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): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetAtomNameW".}
+proc GetProfileIntW*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR, nDefault: WINT): UINT{.
+    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): UINT{.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): UINT{.stdcall, dynlib: "kernel32",
+    importc: "GetDriveTypeW".}
+proc GetSystemDirectoryW*(lpBuffer: LPWSTR, uSize: UINT): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetSystemDirectoryW".}
+proc GetTempPathW*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.stdcall,
+    dynlib: "kernel32", importc: "GetTempPathW".}
+proc GetTempFileNameW*(lpPathName: LPCWSTR, lpPrefixString: LPCWSTR,
+                       uUnique: UINT, lpTempFileName: LPWSTR): UINT{.stdcall,
+    dynlib: "kernel32", importc: "GetTempFileNameW".}
+proc GetWindowsDirectoryW*(lpBuffer: LPWSTR, uSize: UINT): UINT{.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: UINT): 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, hWnd: 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: UINT): 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,
+                    lParam: 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, lParam: 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): UINT{.stdcall,
+    dynlib: "user32", importc: "RegisterWindowMessageW".}
+proc GetMessageW*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                  wMsgFilterMax: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetMessageW".}
+proc DispatchMessageW*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",
+    importc: "DispatchMessageW".}
+proc PeekMessageW*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                   wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "PeekMessageW".}
+proc SendMessageW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageW".}
+proc SendMessageTimeoutW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM,
+                          fuFlags: UINT, uTimeout: UINT, lpdwResult: LPDWORD): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".}
+proc SendNotifyMessageW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SendNotifyMessageW".}
+proc SendMessageCallbackW*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                           lParam: LPARAM, lpResultCallBack: SENDASYNCPROC,
+                           dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SendMessageCallbackW".}
+proc PostMessageW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "PostMessageW".}
+proc PostThreadMessageW*(idThread: DWORD, Msg: UINT, wParam: WPARAM,
+                         lParam: LPARAM): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "PostThreadMessageW".}
+proc DefWindowProcW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "DefWindowProcW".}
+proc CallWindowProcW*(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT,
+                      wParam: WPARAM, lParam: 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,
+                      hMenu: 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): UINT{.stdcall, dynlib: "user32",
+    importc: "GetDlgItemTextW".}
+proc SendDlgItemMessageW*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT,
+                          wParam: WPARAM, lParam: LPARAM): LONG{.stdcall,
+    dynlib: "user32", importc: "SendDlgItemMessageW".}
+proc DefDlgProcW*(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "DefDlgProcW".}
+proc CallMsgFilterW*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "CallMsgFilterW".}
+proc RegisterClipboardFormatW*(lpszFormat: LPCWSTR): UINT{.stdcall,
+    dynlib: "user32", importc: "RegisterClipboardFormatW".}
+proc GetClipboardFormatNameW*(format: UINT, 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: UINT, uMapType: UINT): UINT{.stdcall,
+    dynlib: "user32", importc: "MapVirtualKeyW".}
+proc MapVirtualKeyExW*(uCode: UINT, uMapType: UINT, dwhkl: HKL): UINT{.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*(hWnd: 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*(hMenu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR,
+                  cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ChangeMenuW".}
+proc GetMenuStringW*(hMenu: HMENU, uIDItem: UINT, lpString: LPWSTR,
+                     nMaxCount: int32, uFlag: UINT): int32{.stdcall,
+    dynlib: "user32", importc: "GetMenuStringW".}
+proc InsertMenuW*(hMenu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "InsertMenuW".}
+proc AppendMenuW*(hMenu: HMENU, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "AppendMenuW".}
+proc ModifyMenuW*(hMnu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                  lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ModifyMenuW".}
+proc InsertMenuItemW*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                      para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "InsertMenuItemW".}
+proc GetMenuItemInfoW*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetMenuItemInfoW".}
+proc SetMenuItemInfoW*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetMenuItemInfoW".}
+proc DrawTextW*(hDC: HDC, lpString: LPCWSTR, nCount: int32, lpRect: LPRECT,
+                uFormat: UINT): int32{.stdcall, dynlib: "user32",
+                                       importc: "DrawTextW".}
+proc DrawTextExW*(para1: HDC, para2: LPWSTR, para3: int32, para4: LPRECT,
+                  para5: UINT, 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: UINT): 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*(hWnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetPropW".}
+proc GetPropW*(hWnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,
+    dynlib: "user32", importc: "GetPropW".}
+proc RemovePropW*(hWnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,
+    dynlib: "user32", importc: "RemovePropW".}
+proc EnumPropsExW*(hWnd: HWND, lpEnumFunc: PROPENUMPROCEX, lParam: LPARAM): int32{.
+    stdcall, dynlib: "user32", importc: "EnumPropsExW".}
+proc EnumPropsW*(hWnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,
+    dynlib: "user32", importc: "EnumPropsW".}
+proc SetWindowTextW*(hWnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetWindowTextW".}
+proc GetWindowTextW*(hWnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{.
+    stdcall, dynlib: "user32", importc: "GetWindowTextW".}
+proc GetWindowTextLengthW*(hWnd: HWND): int32{.stdcall, dynlib: "user32",
+    importc: "GetWindowTextLengthW".}
+proc MessageBoxW*(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{.
+    stdcall, dynlib: "user32", importc: "MessageBoxW".}
+proc MessageBoxExW*(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR,
+                    uType: UINT, wLanguageId: int16): int32{.stdcall,
+    dynlib: "user32", importc: "MessageBoxExW".}
+proc MessageBoxIndirectW*(para1: LPMSGBOXPARAMS): int32{.stdcall,
+    dynlib: "user32", importc: "MessageBoxIndirectW".}
+proc GetWindowLongW*(hWnd: HWND, nIndex: int32): LONG{.stdcall,
+    dynlib: "user32", importc: "GetWindowLongW".}
+proc SetWindowLongW*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.stdcall,
+    dynlib: "user32", importc: "SetWindowLongW".}
+proc GetClassLongW*(hWnd: HWND, nIndex: int32): DWORD{.stdcall,
+    dynlib: "user32", importc: "GetClassLongW".}
+proc SetClassLongW*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.stdcall,
+    dynlib: "user32", importc: "SetClassLongW".}
+when defined(cpu64):
+  proc GetWindowLongPtrW*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongPtrW".}
+  proc SetWindowLongPtrW*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".}
+  proc GetClassLongPtrW*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetClassLongPtrW".}
+  proc SetClassLongPtrW*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetClassLongPtrW".}
+else:
+  proc GetWindowLongPtrW*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongW".}
+  proc SetWindowLongPtrW*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongW".}
+  proc GetClassLongPtrW*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+      dynlib: "user32", importc: "GetClassLongW".}
+  proc SetClassLongPtrW*(hWnd: 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*(hWnd: 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: UINT, para4: int32,
+                 para5: int32, para6: UINT): HANDLE{.stdcall, dynlib: "user32",
+    importc: "LoadImageW".}
+proc LoadStringW*(hInstance: HINST, uID: UINT, 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: UINT): 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: UINT): int32{.
+    stdcall, dynlib: "user32", importc: "DlgDirListComboBoxW".}
+proc DlgDirSelectComboBoxExW*(hDlg: HWND, lpString: LPWSTR, nCount: int32,
+                              nIDComboBox: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "DlgDirSelectComboBoxExW".}
+proc DefFrameProcW*(hWnd: HWND, hWndMDIClient: HWND, uMsg: UINT, wParam: WPARAM,
+                    lParam: LPARAM): LRESULT{.stdcall, dynlib: "user32",
+    importc: "DefFrameProcW".}
+proc DefMDIChildProcW*(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: 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,
+                       lParam: LPARAM): HWND{.stdcall, dynlib: "user32",
+    importc: "CreateMDIWindowW".}
+proc WinHelpW*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: UINT, 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: UINT, uiParam: UINT, pvParam: PVOID,
+                            fWinIni: UINT): 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: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthW".}
+proc GetCharWidth32W*(para1: HDC, para2: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidth32W".}
+proc GetCharWidthFloatW*(para1: HDC, para2: UINT, para3: UINT, para4: ptr float32): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}
+proc GetCharABCWidthsW*(para1: HDC, para2: UINT, para3: UINT, para4: LPABC): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}
+proc GetCharABCWidthsFloatW*(para1: HDC, para2: UINT, para3: UINT,
+                             para4: LPABCFLOAT): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}
+proc GetGlyphOutlineW*(para1: HDC, para2: UINT, para3: UINT,
+                       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: UINT, para3: LPOUTLINETEXTMETRIC): UINT{.
+    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: UINT, para3: LPWSTR): UINT{.
+    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: UINT,
+                  para5: LPRECT, para6: LPCWSTR, para7: UINT, 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: UINT): 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: UINT, uFlags: UINT): HIMAGELIST{.
+    stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageW".}
+proc CreateStatusWindowW*(style: LONG, lpszText: LPCWSTR, hwndParent: HWND,
+                          wID: UINT): HWND{.stdcall, dynlib: "comctl32",
+    importc: "CreateStatusWindowW".}
+proc DrawStatusTextW*(hDC: HDC, lprc: LPRECT, pszText: LPCWSTR, uFlags: UINT){.
+    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, hMenu: 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*(hKey: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,
+                     dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}
+proc RegUnLoadKeyW*(hKey: 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*(hKey: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".}
+proc RegSaveKeyW*(hKey: HKEY, lpFile: LPCWSTR,
+                  lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegSaveKeyW".}
+proc RegSetValueW*(hKey: HKEY, lpSubKey: LPCWSTR, dwType: DWORD,
+                   lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegSetValueW".}
+proc RegQueryValueW*(hKey: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR,
+                     lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",
+    importc: "RegQueryValueW".}
+proc RegQueryMultipleValuesW*(hKey: HKEY, val_list: PVALENT, num_vals: DWORD,
+                              lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}
+proc RegQueryValueExW*(hKey: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD,
+                       lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".}
+proc RegReplaceKeyW*(hKey: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR,
+                     lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32",
+    importc: "RegReplaceKeyW".}
+proc RegConnectRegistryW*(lpMachineName: LPWSTR, hKey: HKEY, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}
+proc RegCreateKeyW*(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}
+proc RegCreateKeyExW*(hKey: 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*(hKey: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegDeleteKeyW".}
+proc RegDeleteValueW*(hKey: HKEY, lpValueName: LPCWSTR): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegDeleteValueW".}
+proc RegEnumKeyW*(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".}
+proc RegEnumKeyExW*(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR,
+                    lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR,
+                    lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}
+proc RegEnumValueW*(hKey: HKEY, dwIndex: DWORD, lpValueName: LPWSTR,
+                    lpcbValueName: LPDWORD, lpReserved: LPDWORD,
+                    lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}
+proc RegLoadKeyW*(hKey: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".}
+proc RegOpenKeyW*(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}
+proc RegOpenKeyExW*(hKey: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD,
+                    samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegOpenKeyExW".}
+proc RegQueryInfoKeyW*(hKey: 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): UINT{.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: UINT, 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): UINT{.
+      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): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetAtomNameW".}
+  proc GetProfileInt*(lpAppName: LPCWSTR, lpKeyName: LPCWSTR, nDefault: WINT): UINT{.
+      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): UINT{.
+      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): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetDriveTypeW".}
+  proc GetSystemDirectory*(lpBuffer: LPWSTR, uSize: UINT): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetSystemDirectoryW".}
+  proc GetTempPath*(nBufferLength: DWORD, lpBuffer: LPWSTR): DWORD{.stdcall,
+      dynlib: "kernel32", importc: "GetTempPathW".}
+  proc GetTempFileName*(lpPathName: LPCWSTR, lpPrefixString: LPCWSTR,
+                        uUnique: UINT, lpTempFileName: LPWSTR): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetTempFileNameW".}
+  proc GetWindowsDirectory*(lpBuffer: LPWSTR, uSize: UINT): UINT{.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: UINT): 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, hWnd: 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: UINT): 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,
+                     lParam: 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, lParam: 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): UINT{.stdcall,
+      dynlib: "user32", importc: "RegisterWindowMessageW".}
+  proc GetMessage*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                   wMsgFilterMax: UINT): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "GetMessageW".}
+  proc DispatchMessage*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",
+      importc: "DispatchMessageW".}
+  proc PeekMessage*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                    wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "PeekMessageW".}
+  proc SendMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "SendMessageW".}
+  proc SendMessageTimeout*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                           lParam: LPARAM, fuFlags: UINT, uTimeout: UINT,
+                           lpdwResult: LPDWORD): LRESULT{.stdcall,
+      dynlib: "user32", importc: "SendMessageTimeoutW".}
+  proc SendNotifyMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+      stdcall, dynlib: "user32", importc: "SendNotifyMessageW".}
+  proc SendMessageCallback*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                            lParam: LPARAM, lpResultCallBack: SENDASYNCPROC,
+                            dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "SendMessageCallbackW".}
+  proc PostMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+      stdcall, dynlib: "user32", importc: "PostMessageW".}
+  proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wParam: WPARAM,
+                          lParam: LPARAM): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "PostThreadMessageW".}
+  proc DefWindowProc*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "DefWindowProcW".}
+  proc CallWindowProc*(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT,
+                       wParam: WPARAM, lParam: 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, hMenu: 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): UINT{.stdcall, dynlib: "user32",
+      importc: "GetDlgItemTextW".}
+  proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT,
+                           wParam: WPARAM, lParam: LPARAM): LONG{.stdcall,
+      dynlib: "user32", importc: "SendDlgItemMessageW".}
+  proc DefDlgProc*(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "DefDlgProcW".}
+  proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "CallMsgFilterW".}
+  proc RegisterClipboardFormat*(lpszFormat: LPCWSTR): UINT{.stdcall,
+      dynlib: "user32", importc: "RegisterClipboardFormatW".}
+  proc GetClipboardFormatName*(format: UINT, 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: UINT, uMapType: UINT): UINT{.stdcall,
+      dynlib: "user32", importc: "MapVirtualKeyW".}
+  proc MapVirtualKeyEx*(uCode: UINT, uMapType: UINT, dwhkl: HKL): UINT{.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*(hWnd: 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*(hMenu: HMENU, cmd: UINT, lpszNewItem: LPCWSTR,
+                   cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "ChangeMenuW".}
+  proc GetMenuString*(hMenu: HMENU, uIDItem: UINT, lpString: LPWSTR,
+                      nMaxCount: int32, uFlag: UINT): int32{.stdcall,
+      dynlib: "user32", importc: "GetMenuStringW".}
+  proc InsertMenu*(hMenu: HMENU, uPosition: UINT, uFlags: UINT,
+                   uIDNewItem: UINT, lpNewItem: LPCWSTR): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "InsertMenuW".}
+  proc AppendMenu*(hMenu: HMENU, uFlags: UINT, uIDNewItem: UINT,
+                   lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "AppendMenuW".}
+  proc ModifyMenu*(hMnu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                   lpNewItem: LPCWSTR): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "ModifyMenuW".}
+  proc InsertMenuItem*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "InsertMenuItemW".}
+  proc GetMenuItemInfo*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                        para4: LPMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "GetMenuItemInfoW".}
+  proc SetMenuItemInfo*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                        para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetMenuItemInfoW".}
+  proc DrawText*(hDC: HDC, lpString: LPCWSTR, nCount: int32, lpRect: LPRECT,
+                 uFormat: UINT): int32{.stdcall, dynlib: "user32",
+                                        importc: "DrawTextW".}
+  proc DrawTextEx*(para1: HDC, para2: LPWSTR, para3: int32, para4: LPRECT,
+                   para5: UINT, 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: UINT): 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*(hWnd: HWND, lpString: LPCWSTR, hData: HANDLE): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetPropW".}
+  proc GetProp*(hWnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,
+      dynlib: "user32", importc: "GetPropW".}
+  proc RemoveProp*(hWnd: HWND, lpString: LPCWSTR): HANDLE{.stdcall,
+      dynlib: "user32", importc: "RemovePropW".}
+  proc EnumPropsEx*(hWnd: HWND, lpEnumFunc: PROPENUMPROCEX, lParam: LPARAM): int32{.
+      stdcall, dynlib: "user32", importc: "EnumPropsExW".}
+  proc EnumProps*(hWnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,
+      dynlib: "user32", importc: "EnumPropsW".}
+  proc SetWindowText*(hWnd: HWND, lpString: LPCWSTR): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetWindowTextW".}
+  proc GetWindowText*(hWnd: HWND, lpString: LPWSTR, nMaxCount: int32): int32{.
+      stdcall, dynlib: "user32", importc: "GetWindowTextW".}
+  proc GetWindowTextLength*(hWnd: HWND): int32{.stdcall, dynlib: "user32",
+      importc: "GetWindowTextLengthW".}
+  proc MessageBox*(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR, uType: UINT): int32{.
+      stdcall, dynlib: "user32", importc: "MessageBoxW".}
+  proc MessageBoxEx*(hWnd: HWND, lpText: LPCWSTR, lpCaption: LPCWSTR,
+                     uType: UINT, wLanguageId: int16): int32{.stdcall,
+      dynlib: "user32", importc: "MessageBoxExW".}
+  proc MessageBoxIndirect*(para1: LPMSGBOXPARAMS): int32{.stdcall,
+      dynlib: "user32", importc: "MessageBoxIndirectW".}
+  proc GetWindowLong*(hWnd: HWND, nIndex: int32): LONG{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongW".}
+  proc SetWindowLong*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongW".}
+  proc GetClassLong*(hWnd: HWND, nIndex: int32): DWORD{.stdcall,
+      dynlib: "user32", importc: "GetClassLongW".}
+  proc SetClassLong*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.
+      stdcall, dynlib: "user32", importc: "SetClassLongW".}
+  when defined(cpu64):
+    proc GetWindowLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetWindowLongPtrW".}
+    proc SetWindowLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetWindowLongPtrW".}
+    proc GetClassLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetClassLongPtrW".}
+    proc SetClassLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetClassLongPtrW".}
+  else:
+    proc GetWindowLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetWindowLongW".}
+    proc SetWindowLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetWindowLongW".}
+    proc GetClassLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetClassLongW".}
+    proc SetClassLongPtr*(hWnd: 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*(hWnd: 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: UINT, para4: int32,
+                  para5: int32, para6: UINT): HANDLE{.stdcall, dynlib: "user32",
+      importc: "LoadImageW".}
+  proc LoadString*(hInstance: HINST, uID: UINT, 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: UINT): 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: UINT): int32{.
+      stdcall, dynlib: "user32", importc: "DlgDirListComboBoxW".}
+  proc DlgDirSelectComboBoxEx*(hDlg: HWND, lpString: LPWSTR, nCount: int32,
+                               nIDComboBox: int32): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "DlgDirSelectComboBoxExW".}
+  proc DefFrameProc*(hWnd: HWND, hWndMDIClient: HWND, uMsg: UINT,
+                     wParam: WPARAM, lParam: LPARAM): LRESULT{.stdcall,
+      dynlib: "user32", importc: "DefFrameProcW".}
+  proc DefMDIChildProc*(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: 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,
+                        lParam: LPARAM): HWND{.stdcall, dynlib: "user32",
+      importc: "CreateMDIWindowW".}
+  proc WinHelp*(hWndMain: HWND, lpszHelp: LPCWSTR, uCommand: UINT, 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: UINT, uiParam: UINT, pvParam: PVOID,
+                             fWinIni: UINT): 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: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidthW".}
+  proc GetCharWidth32*(para1: HDC, para2: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidth32W".}
+  proc GetCharWidthFloat*(para1: HDC, para2: UINT, para3: UINT, para4: ptr float32): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}
+  proc GetCharABCWidths*(para1: HDC, para2: UINT, para3: UINT, para4: LPABC): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}
+  proc GetCharABCWidthsFloat*(para1: HDC, para2: UINT, para3: UINT,
+                              para4: LPABCFLOAT): WINBOOL{.stdcall,
+      dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}
+  proc GetGlyphOutline*(para1: HDC, para2: UINT, para3: UINT,
+                        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: UINT,
+                              para3: LPOUTLINETEXTMETRIC): UINT{.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: UINT,
+                                  para3: LPWSTR): UINT{.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: UINT,
+                   para5: LPRECT, para6: LPCWSTR, para7: UINT, 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: UINT): 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: UINT, uFlags: UINT): HIMAGELIST{.
+      stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageW".}
+  proc CreateStatusWindow*(style: LONG, lpszText: LPCWSTR, hwndParent: HWND,
+                           wID: UINT): HWND{.stdcall, dynlib: "comctl32",
+      importc: "CreateStatusWindowW".}
+  proc DrawStatusText*(hDC: HDC, lprc: LPRECT, pszText: LPCWSTR, uFlags: UINT){.
+      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, hMenu: 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*(hKey: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,
+                      dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}
+  proc RegUnLoadKey*(hKey: 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*(hKey: HKEY, lpFile: LPCWSTR, dwFlags: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegRestoreKeyW".}
+  proc RegSaveKey*(hKey: HKEY, lpFile: LPCWSTR,
+                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegSaveKeyW".}
+  proc RegSetValue*(hKey: HKEY, lpSubKey: LPCWSTR, dwType: DWORD,
+                    lpData: LPCWSTR, cbData: DWORD): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegSetValueW".}
+  proc RegQueryValue*(hKey: HKEY, lpSubKey: LPCWSTR, lpValue: LPWSTR,
+                      lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",
+      importc: "RegQueryValueW".}
+  proc RegQueryMultipleValues*(hKey: HKEY, val_list: PVALENT, num_vals: DWORD,
+                               lpValueBuf: LPWSTR, ldwTotsize: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}
+  proc RegQueryValueEx*(hKey: HKEY, lpValueName: LPCWSTR, lpReserved: LPDWORD,
+                        lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegQueryValueExW".}
+  proc RegReplaceKey*(hKey: HKEY, lpSubKey: LPCWSTR, lpNewFile: LPCWSTR,
+                      lpOldFile: LPCWSTR): LONG{.stdcall, dynlib: "advapi32",
+      importc: "RegReplaceKeyW".}
+  proc RegConnectRegistry*(lpMachineName: LPWSTR, hKey: HKEY, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}
+  proc RegCreateKey*(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}
+  proc RegCreateKeyEx*(hKey: 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*(hKey: HKEY, lpSubKey: LPCWSTR): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegDeleteKeyW".}
+  proc RegDeleteValue*(hKey: HKEY, lpValueName: LPCWSTR): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegDeleteValueW".}
+  proc RegEnumKey*(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR, cbName: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumKeyW".}
+  proc RegEnumKeyEx*(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR,
+                     lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPWSTR,
+                     lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}
+  proc RegEnumValue*(hKey: HKEY, dwIndex: DWORD, lpValueName: LPWSTR,
+                     lpcbValueName: LPDWORD, lpReserved: LPDWORD,
+                     lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}
+  proc RegLoadKey*(hKey: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegLoadKeyW".}
+  proc RegOpenKey*(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}
+  proc RegOpenKeyEx*(hKey: HKEY, lpSubKey: LPCWSTR, ulOptions: DWORD,
+                     samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegOpenKeyExW".}
+  proc RegQueryInfoKey*(hKey: 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): UINT{.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: UINT, 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): UINT{.
+      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): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetAtomNameA".}
+  proc GetProfileInt*(lpAppName: LPCSTR, lpKeyName: LPCSTR, nDefault: WINT): UINT{.
+      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): UINT{.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): UINT{.stdcall, dynlib: "kernel32",
+      importc: "GetDriveTypeA".}
+  proc GetSystemDirectory*(lpBuffer: LPSTR, uSize: UINT): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetSystemDirectoryA".}
+  proc GetTempPath*(nBufferLength: DWORD, lpBuffer: LPSTR): DWORD{.stdcall,
+      dynlib: "kernel32", importc: "GetTempPathA".}
+  proc GetTempFileName*(lpPathName: LPCSTR, lpPrefixString: LPCSTR,
+                        uUnique: UINT, lpTempFileName: LPSTR): UINT{.stdcall,
+      dynlib: "kernel32", importc: "GetTempFileNameA".}
+  proc GetWindowsDirectory*(lpBuffer: LPSTR, uSize: UINT): UINT{.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: UINT): 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, hWnd: 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: UINT): 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,
+                     lParam: 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, lParam: 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): UINT{.stdcall,
+      dynlib: "user32", importc: "RegisterWindowMessageA".}
+  proc GetMessage*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                   wMsgFilterMax: UINT): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "GetMessageA".}
+  proc DispatchMessage*(lpMsg: LPMSG): LONG{.stdcall, dynlib: "user32",
+      importc: "DispatchMessageA".}
+  proc PeekMessage*(lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT,
+                    wMsgFilterMax: UINT, wRemoveMsg: UINT): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "PeekMessageA".}
+  proc SendMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "SendMessageA".}
+  proc SendMessageTimeout*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                           lParam: LPARAM, fuFlags: UINT, uTimeout: UINT,
+                           lpdwResult: LPDWORD): LRESULT{.stdcall,
+      dynlib: "user32", importc: "SendMessageTimeoutA".}
+  proc SendNotifyMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+      stdcall, dynlib: "user32", importc: "SendNotifyMessageA".}
+  proc SendMessageCallback*(hWnd: HWND, Msg: UINT, wParam: WPARAM,
+                            lParam: LPARAM, lpResultCallBack: SENDASYNCPROC,
+                            dwData: DWORD): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "SendMessageCallbackA".}
+  proc PostMessage*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): WINBOOL{.
+      stdcall, dynlib: "user32", importc: "PostMessageA".}
+  proc PostThreadMessage*(idThread: DWORD, Msg: UINT, wParam: WPARAM,
+                          lParam: LPARAM): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "PostThreadMessageA".}
+  proc DefWindowProc*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "DefWindowProcA".}
+  proc CallWindowProc*(lpPrevWndFunc: WNDPROC, hWnd: HWND, Msg: UINT,
+                       wParam: WPARAM, lParam: 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,
+                       hMenu: 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): UINT{.stdcall, dynlib: "user32",
+      importc: "GetDlgItemTextA".}
+  proc SendDlgItemMessage*(hDlg: HWND, nIDDlgItem: int32, Msg: UINT,
+                           wParam: WPARAM, lParam: LPARAM): LONG{.stdcall,
+      dynlib: "user32", importc: "SendDlgItemMessageA".}
+  proc DefDlgProc*(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+      stdcall, dynlib: "user32", importc: "DefDlgProcA".}
+  proc CallMsgFilter*(lpMsg: LPMSG, nCode: int32): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "CallMsgFilterA".}
+  proc RegisterClipboardFormat*(lpszFormat: LPCSTR): UINT{.stdcall,
+      dynlib: "user32", importc: "RegisterClipboardFormatA".}
+  proc GetClipboardFormatName*(format: UINT, 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: UINT, uMapType: UINT): UINT{.stdcall,
+      dynlib: "user32", importc: "MapVirtualKeyA".}
+  proc MapVirtualKeyEx*(uCode: UINT, uMapType: UINT, dwhkl: HKL): UINT{.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*(hWnd: 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*(hMenu: HMENU, cmd: UINT, lpszNewItem: LPCSTR,
+                   cmdInsert: UINT, flags: UINT): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "ChangeMenuA".}
+  proc GetMenuString*(hMenu: HMENU, uIDItem: UINT, lpString: LPSTR,
+                      nMaxCount: int32, uFlag: UINT): int32{.stdcall,
+      dynlib: "user32", importc: "GetMenuStringA".}
+  proc InsertMenu*(hMenu: HMENU, uPosition: UINT, uFlags: UINT,
+                   uIDNewItem: UINT, lpNewItem: LPCSTR): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "InsertMenuA".}
+  proc AppendMenu*(hMenu: HMENU, uFlags: UINT, uIDNewItem: UINT,
+                   lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "AppendMenuA".}
+  proc ModifyMenu*(hMnu: HMENU, uPosition: UINT, uFlags: UINT, uIDNewItem: UINT,
+                   lpNewItem: LPCSTR): WINBOOL{.stdcall, dynlib: "user32",
+      importc: "ModifyMenuA".}
+  proc InsertMenuItem*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                       para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "InsertMenuItemA".}
+  proc GetMenuItemInfo*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                        para4: LPMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "GetMenuItemInfoA".}
+  proc SetMenuItemInfo*(para1: HMENU, para2: UINT, para3: WINBOOL,
+                        para4: LPCMENUITEMINFO): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetMenuItemInfoA".}
+  proc DrawText*(hDC: HDC, lpString: LPCSTR, nCount: int32, lpRect: LPRECT,
+                 uFormat: UINT): int32{.stdcall, dynlib: "user32",
+                                        importc: "DrawTextA".}
+  proc DrawTextEx*(para1: HDC, para2: LPSTR, para3: int32, para4: LPRECT,
+                   para5: UINT, 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: UINT): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "DrawStateA".}
+  proc TabbedTextOut*(hDC: 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*(hWnd: HWND, lpString: LPCSTR, hData: HANDLE): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetPropA".}
+  proc GetProp*(hWnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,
+      dynlib: "user32", importc: "GetPropA".}
+  proc RemoveProp*(hWnd: HWND, lpString: LPCSTR): HANDLE{.stdcall,
+      dynlib: "user32", importc: "RemovePropA".}
+  proc EnumPropsEx*(hWnd: HWND, lpEnumFunc: PROPENUMPROCEX, lParam: LPARAM): int32{.
+      stdcall, dynlib: "user32", importc: "EnumPropsExA".}
+  proc EnumProps*(hWnd: HWND, lpEnumFunc: PROPENUMPROC): int32{.stdcall,
+      dynlib: "user32", importc: "EnumPropsA".}
+  proc SetWindowText*(hWnd: HWND, lpString: LPCSTR): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "SetWindowTextA".}
+  proc GetWindowText*(hWnd: HWND, lpString: LPSTR, nMaxCount: int32): int32{.
+      stdcall, dynlib: "user32", importc: "GetWindowTextA".}
+  proc GetWindowTextLength*(hWnd: HWND): int32{.stdcall, dynlib: "user32",
+      importc: "GetWindowTextLengthA".}
+  proc MessageBox*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32{.
+      stdcall, dynlib: "user32", importc: "MessageBoxA".}
+  proc MessageBoxEx*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT,
+                     wLanguageId: int16): int32{.stdcall, dynlib: "user32",
+      importc: "MessageBoxExA".}
+  proc MessageBoxIndirect*(para1: LPMSGBOXPARAMS): int32{.stdcall,
+      dynlib: "user32", importc: "MessageBoxIndirectA".}
+  proc GetWindowLong*(hWnd: HWND, nIndex: int32): LONG{.stdcall,
+      dynlib: "user32", importc: "GetWindowLongA".}
+  proc SetWindowLong*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): LONG{.
+      stdcall, dynlib: "user32", importc: "SetWindowLongA".}
+  proc GetClassLong*(hWnd: HWND, nIndex: int32): DWORD{.stdcall,
+      dynlib: "user32", importc: "GetClassLongA".}
+  proc SetClassLong*(hWnd: HWND, nIndex: int32, dwNewLong: LONG): DWORD{.
+      stdcall, dynlib: "user32", importc: "SetClassLongA".}
+  when defined(cpu64):
+    proc GetWindowLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetWindowLongPtrA".}
+    proc SetWindowLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetWindowLongPtrA".}
+    proc GetClassLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetClassLongPtrA".}
+    proc SetClassLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetClassLongPtrA".}
+  else:
+    proc GetWindowLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetWindowLongA".}
+    proc SetWindowLongPtr*(hWnd: HWND, nIndex: int32, dwNewLong: LONG_PTR): LONG_PTR{.
+        stdcall, dynlib: "user32", importc: "SetWindowLongA".}
+    proc GetClassLongPtr*(hWnd: HWND, nIndex: int32): LONG_PTR{.stdcall,
+        dynlib: "user32", importc: "GetClassLongA".}
+    proc SetClassLongPtr*(hWnd: 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*(hWnd: 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: UINT, para4: int32,
+                  para5: int32, para6: UINT): HANDLE{.stdcall, dynlib: "user32",
+      importc: "LoadImageA".}
+  proc LoadString*(hInstance: HINST, uID: UINT, 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: UINT): 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: UINT): int32{.
+      stdcall, dynlib: "user32", importc: "DlgDirListComboBoxA".}
+  proc DlgDirSelectComboBoxEx*(hDlg: HWND, lpString: LPSTR, nCount: int32,
+                               nIDComboBox: int32): WINBOOL{.stdcall,
+      dynlib: "user32", importc: "DlgDirSelectComboBoxExA".}
+  proc DefFrameProc*(hWnd: HWND, hWndMDIClient: HWND, uMsg: UINT,
+                     wParam: WPARAM, lParam: LPARAM): LRESULT{.stdcall,
+      dynlib: "user32", importc: "DefFrameProcA".}
+  proc DefMDIChildProc*(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: 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, lParam: LPARAM): HWND{.
+      stdcall, dynlib: "user32", importc: "CreateMDIWindowA".}
+  proc WinHelp*(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: UINT, 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: UINT, uiParam: UINT, pvParam: PVOID,
+                             fWinIni: UINT): 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: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidthA".}
+  proc GetCharWidth32*(para1: HDC, para2: UINT, para3: UINT, para4: LPINT): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidth32A".}
+  proc GetCharWidthFloat*(para1: HDC, para2: UINT, para3: UINT, para4: ptr float32): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}
+  proc GetCharABCWidths*(para1: HDC, para2: UINT, para3: UINT, para4: LPABC): WINBOOL{.
+      stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}
+  proc GetCharABCWidthsFloat*(para1: HDC, para2: UINT, para3: UINT,
+                              para4: LPABCFLOAT): WINBOOL{.stdcall,
+      dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}
+  proc GetGlyphOutline*(para1: HDC, para2: UINT, para3: UINT,
+                        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: UINT,
+                              para3: LPOUTLINETEXTMETRIC): UINT{.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: UINT, para3: LPSTR): UINT{.
+      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: UINT,
+                   para5: LPRECT, para6: LPCSTR, para7: UINT, 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: UINT): 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: UINT, uFlags: UINT): HIMAGELIST{.
+      stdcall, dynlib: "comctl32", importc: "ImageList_LoadImageA".}
+  proc CreateStatusWindow*(style: LONG, lpszText: LPCSTR, hwndParent: HWND,
+                           wID: UINT): HWND{.stdcall, dynlib: "comctl32",
+      importc: "CreateStatusWindowA".}
+  proc DrawStatusText*(hDC: HDC, lprc: LPRECT, pszText: LPCSTR, uFlags: UINT){.
+      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, hMenu: 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, hKey: HKEY, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}
+  proc RegCreateKey*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}
+  proc RegCreateKeyEx*(hKey: 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*(hKey: HKEY, lpSubKey: LPCSTR): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegDeleteKeyA".}
+  proc RegDeleteValue*(hKey: HKEY, lpValueName: LPCSTR): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegDeleteValueA".}
+  proc RegEnumKey*(hKey: HKEY, dwIndex: DWORD, lpName: LPSTR, cbName: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumKeyA".}
+  proc RegEnumKeyEx*(hKey: HKEY, dwIndex: DWORD, lpName: LPSTR,
+                     lpcbName: LPDWORD, lpReserved: LPDWORD, lpClass: LPSTR,
+                     lpcbClass: LPDWORD, lpftLastWriteTime: PFILETIME): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}
+  proc RegEnumValue*(hKey: HKEY, dwIndex: DWORD, lpValueName: LPSTR,
+                     lpcbValueName: LPDWORD, lpReserved: LPDWORD,
+                     lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}
+  proc RegLoadKey*(hKey: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegLoadKeyA".}
+  proc RegOpenKey*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}
+  proc RegOpenKeyEx*(hKey: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,
+                     samDesired: REGSAM, phkResult: PHKEY): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegOpenKeyExA".}
+  proc RegQueryInfoKey*(hKey: 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*(hKey: HKEY, lpSubKey: LPCSTR, lpValue: LPSTR,
+                      lpcbValue: PLONG): LONG{.stdcall, dynlib: "advapi32",
+      importc: "RegQueryValueA".}
+  proc RegQueryMultipleValues*(hKey: HKEY, val_list: PVALENT, num_vals: DWORD,
+                               lpValueBuf: LPSTR, ldwTotsize: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}
+  proc RegQueryValueEx*(hKey: HKEY, lpValueName: LPCSTR, lpReserved: LPDWORD,
+                        lpType: LPDWORD, lpData: LPBYTE, lpcbData: LPDWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegQueryValueExA".}
+  proc RegReplaceKey*(hKey: HKEY, lpSubKey: LPCSTR, lpNewFile: LPCSTR,
+                      lpOldFile: LPCSTR): LONG{.stdcall, dynlib: "advapi32",
+      importc: "RegReplaceKeyA".}
+  proc RegRestoreKey*(hKey: HKEY, lpFile: LPCSTR, dwFlags: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegRestoreKeyA".}
+  proc RegSaveKey*(hKey: HKEY, lpFile: LPCSTR,
+                   lpSecurityAttributes: LPSECURITY_ATTRIBUTES): LONG{.stdcall,
+      dynlib: "advapi32", importc: "RegSaveKeyA".}
+  proc RegSetValue*(hKey: HKEY, lpSubKey: LPCSTR, dwType: DWORD, lpData: LPCSTR,
+                    cbData: DWORD): LONG{.stdcall, dynlib: "advapi32",
+      importc: "RegSetValueA".}
+  proc RegSetValueEx*(hKey: HKEY, lpValueName: LPCSTR, Reserved: DWORD,
+                      dwType: DWORD, lpData: LPBYTE, cbData: DWORD): LONG{.
+      stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}
+  proc RegUnLoadKey*(hKey: 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): UINT{.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: UINT, dwBytes: DWORD): HGLOBAL{.stdcall,
+    dynlib: "kernel32", importc: "GlobalAlloc".}
+proc GlobalDiscard*(hglbMem: HGLOBAL): HGLOBAL
+proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: UINT): HGLOBAL{.
+    stdcall, dynlib: "kernel32", importc: "GlobalReAlloc".}
+proc GlobalSize*(hMem: HGLOBAL): DWORD{.stdcall, dynlib: "kernel32",
+                                        importc: "GlobalSize".}
+proc GlobalFlags*(hMem: HGLOBAL): UINT{.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): UINT{.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: UINT, uBytes: UINT): HLOCAL{.stdcall,
+    dynlib: "kernel32", importc: "LocalAlloc".}
+proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL
+proc LocalReAlloc*(hMem: HLOCAL, uBytes: UINT, uFlags: UINT): HLOCAL{.stdcall,
+    dynlib: "kernel32", importc: "LocalReAlloc".}
+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): UINT{.stdcall, dynlib: "kernel32",
+                                     importc: "LocalSize".}
+proc LocalFlags*(hMem: HLOCAL): UINT{.stdcall, dynlib: "kernel32",
+                                      importc: "LocalFlags".}
+proc LocalFree*(hMem: HLOCAL): HLOCAL{.stdcall, dynlib: "kernel32",
+                                       importc: "LocalFree".}
+proc LocalShrink*(hMem: HLOCAL, cbNewSize: UINT): UINT{.stdcall,
+    dynlib: "kernel32", importc: "LocalShrink".}
+proc LocalCompact*(uMinFree: UINT): UINT{.stdcall, dynlib: "kernel32",
+    importc: "LocalCompact".}
+proc FlushInstructionCache*(hProcess: HANDLE, lpBaseAddress: LPCVOID,
+                            dwSize: DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "FlushInstructionCache".}
+proc VirtualAlloc*(lpAddress: LPVOID, dwSize: DWORD, flAllocationType: DWORD,
+                   flProtect: DWORD): LPVOID{.stdcall, dynlib: "kernel32",
+    importc: "VirtualAlloc".}
+proc VirtualFree*(lpAddress: LPVOID, dwSize: DWORD, dwFreeType: DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "VirtualFree".}
+proc VirtualProtect*(lpAddress: LPVOID, dwSize: DWORD, flNewProtect: DWORD,
+                     lpflOldProtect: PDWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "VirtualProtect".}
+proc VirtualQuery*(lpAddress: LPCVOID, lpBuffer: PMEMORY_BASIC_INFORMATION,
+                   dwLength: DWORD): DWORD{.stdcall, dynlib: "kernel32",
+    importc: "VirtualQuery".}
+proc VirtualProtectEx*(hProcess: HANDLE, lpAddress: LPVOID, dwSize: DWORD,
+                       flNewProtect: DWORD, lpflOldProtect: PDWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "VirtualProtectEx".}
+proc VirtualQueryEx*(hProcess: HANDLE, lpAddress: LPCVOID,
+                     lpBuffer: PMEMORY_BASIC_INFORMATION, dwLength: DWORD): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "VirtualQueryEx".}
+proc HeapCreate*(flOptions: DWORD, dwInitialSize: DWORD, dwMaximumSize: DWORD): HANDLE{.
+    stdcall, dynlib: "kernel32", importc: "HeapCreate".}
+proc HeapDestroy*(hHeap: HANDLE): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "HeapDestroy".}
+proc HeapAlloc*(hHeap: HANDLE, dwFlags: DWORD, dwBytes: DWORD): LPVOID{.stdcall,
+    dynlib: "kernel32", importc: "HeapAlloc".}
+proc HeapReAlloc*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: DWORD): LPVOID{.
+    stdcall, dynlib: "kernel32", importc: "HeapReAlloc".}
+proc HeapFree*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "HeapFree".}
+proc HeapSize*(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID): DWORD{.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): UINT{.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: UINT){.stdcall, dynlib: "kernel32",
+                                    importc: "ExitProcess".}
+proc TerminateProcess*(hProcess: HANDLE, uExitCode: UINT): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "TerminateProcess".}
+proc SetProcessAffinityMask*(hProcess: THandle, 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: UINT): UINT{.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 WaitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray,
+                             bWaitAll: WINBOOL, dwMilliseconds: DWORD): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "WaitForMultipleObjects".}
+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: UINT): UINT{.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: UINT): UINT{.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*(lpFileTime: 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: UINT): 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: UINT): UINT{.stdcall,
+    dynlib: "kernel32", importc: "_lread".}
+proc lwrite*(hFile: HFILE, lpBuffer: LPCSTR, uBytes: UINT): UINT{.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*(hFile: HFILE): HFILE{.stdcall, dynlib: "kernel32",
+                                   importc: "_lclose".}
+proc llseek*(hFile: 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: DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "VirtualLock".}
+proc VirtualUnlock*(lpAddress: LPVOID, dwSize: DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "VirtualUnlock".}
+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: UINT): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "IsBadReadPtr".}
+proc IsBadWritePtr*(lp: LPVOID, ucb: UINT): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "IsBadWritePtr".}
+proc IsBadHugeReadPtr*(lp: pointer, ucb: UINT): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "IsBadHugeReadPtr".}
+proc IsBadHugeWritePtr*(lp: LPVOID, ucb: UINT): 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: UINT): 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, lParam: 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*(hWnd: HWND, anID: int32, fsModifiers: UINT, vk: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "RegisterHotKey".}
+proc UnregisterHotKey*(hWnd: HWND, anID: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "UnregisterHotKey".}
+proc ExitWindowsEx*(uFlags: UINT, 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*(lParam: LPARAM): LPARAM{.stdcall, dynlib: "user32",
+    importc: "SetMessageExtraInfo".}
+proc BroadcastSystemMessage*(para1: DWORD, para2: LPDWORD, para3: UINT,
+                             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*(): UINT{.stdcall, dynlib: "user32",
+                                  importc: "GetDoubleClickTime".}
+proc SetDoubleClickTime*(para1: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetDoubleClickTime".}
+proc IsWindow*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                     importc: "IsWindow".}
+proc IsMenu*(hMenu: HMENU): WINBOOL{.stdcall, dynlib: "user32",
+                                     importc: "IsMenu".}
+proc IsChild*(hWndParent: HWND, hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "IsChild".}
+proc DestroyWindow*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "DestroyWindow".}
+proc ShowWindow*(hWnd: HWND, nCmdShow: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ShowWindow".}
+proc ShowWindowAsync*(hWnd: HWND, nCmdShow: int32): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ShowWindowAsync".}
+proc FlashWindow*(hWnd: HWND, bInvert: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "FlashWindow".}
+proc ShowOwnedPopups*(hWnd: HWND, fShow: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ShowOwnedPopups".}
+proc OpenIcon*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                     importc: "OpenIcon".}
+proc CloseWindow*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                        importc: "CloseWindow".}
+proc MoveWindow*(hWnd: HWND, X: int32, Y: int32, nWidth: int32, nHeight: int32,
+                 bRepaint: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "MoveWindow".}
+proc SetWindowPos*(hWnd: HWND, hWndInsertAfter: HWND, X: int32, Y: int32,
+                   cx: int32, cy: int32, uFlags: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetWindowPos".}
+proc GetWindowPlacement*(hWnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetWindowPlacement".}
+proc SetWindowPlacement*(hWnd: HWND, lpwndpl: var WINDOWPLACEMENT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetWindowPlacement".}
+proc GetWindowPlacement*(hWnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetWindowPlacement".}
+proc SetWindowPlacement*(hWnd: HWND, lpwndpl: PWINDOWPLACEMENT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetWindowPlacement".}
+proc BeginDeferWindowPos*(nNumWindows: int32): HDWP{.stdcall, dynlib: "user32",
+    importc: "BeginDeferWindowPos".}
+proc DeferWindowPos*(hWinPosInfo: HDWP, hWnd: HWND, hWndInsertAfter: HWND,
+                     x: int32, y: int32, cx: int32, cy: int32, uFlags: UINT): HDWP{.
+    stdcall, dynlib: "user32", importc: "DeferWindowPos".}
+proc EndDeferWindowPos*(hWinPosInfo: HDWP): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "EndDeferWindowPos".}
+proc IsWindowVisible*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "IsWindowVisible".}
+proc IsIconic*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                     importc: "IsIconic".}
+proc AnyPopup*(): WINBOOL{.stdcall, dynlib: "user32", importc: "AnyPopup".}
+proc BringWindowToTop*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "BringWindowToTop".}
+proc IsZoomed*(hWnd: 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: UINT,
+                    bSigned: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetDlgItemInt".}
+proc GetDlgItemInt*(hDlg: HWND, nIDDlgItem: int32, lpTranslated: var WINBOOL,
+                    bSigned: WINBOOL): UINT{.stdcall, dynlib: "user32",
+    importc: "GetDlgItemInt".}
+proc CheckDlgButton*(hDlg: HWND, nIDButton: int32, uCheck: UINT): 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): UINT{.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*(hWnd: 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: UINT, hMem: HANDLE): HANDLE{.stdcall,
+    dynlib: "user32", importc: "SetClipboardData".}
+proc GetClipboardData*(uFormat: UINT): HANDLE{.stdcall, dynlib: "user32",
+    importc: "GetClipboardData".}
+proc CountClipboardFormats*(): int32{.stdcall, dynlib: "user32",
+                                      importc: "CountClipboardFormats".}
+proc EnumClipboardFormats*(format: UINT): UINT{.stdcall, dynlib: "user32",
+    importc: "EnumClipboardFormats".}
+proc EmptyClipboard*(): WINBOOL{.stdcall, dynlib: "user32",
+                                 importc: "EmptyClipboard".}
+proc IsClipboardFormatAvailable*(format: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "IsClipboardFormatAvailable".}
+proc GetPriorityClipboardFormat*(paFormatPriorityList: var UINT, 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*(hWnd: 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*(): UINT{.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: UINT, uScanCode: UINT, lpKeyState: PBYTE,
+              lpChar: LPWORD, uFlags: UINT): int32{.stdcall, dynlib: "user32",
+    importc: "ToAscii".}
+proc ToAsciiEx*(uVirtKey: UINT, uScanCode: UINT, lpKeyState: PBYTE,
+                lpChar: LPWORD, uFlags: UINT, dwhkl: HKL): int32{.stdcall,
+    dynlib: "user32", importc: "ToAsciiEx".}
+proc ToUnicode*(wVirtKey: UINT, wScanCode: UINT, lpKeyState: PBYTE,
+                pwszBuff: LPWSTR, cchBuff: int32, wFlags: UINT): 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: UINT): DWORD{.stdcall, dynlib: "user32",
+    importc: "GetQueueStatus".}
+proc GetCapture*(): HWND{.stdcall, dynlib: "user32", importc: "GetCapture".}
+proc SetCapture*(hWnd: 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*(hWnd: HWND, nIDEvent: UINT, uElapse: UINT, lpTimerFunc: TIMERPROC): UINT{.
+    stdcall, dynlib: "user32", importc: "SetTimer".}
+proc KillTimer*(hWnd: HWND, uIDEvent: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "KillTimer".}
+proc IsWindowUnicode*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "IsWindowUnicode".}
+proc EnableWindow*(hWnd: HWND, bEnable: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "EnableWindow".}
+proc IsWindowEnabled*(hWnd: 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*(hWnd: HWND): HMENU{.stdcall, dynlib: "user32", importc: "GetMenu".}
+proc SetMenu*(hWnd: HWND, hMenu: HMENU): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetMenu".}
+proc HiliteMenuItem*(hWnd: HWND, hMenu: HMENU, uIDHiliteItem: UINT,
+                     uHilite: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "HiliteMenuItem".}
+proc GetMenuState*(hMenu: HMENU, uId: UINT, uFlags: UINT): UINT{.stdcall,
+    dynlib: "user32", importc: "GetMenuState".}
+proc DrawMenuBar*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                        importc: "DrawMenuBar".}
+proc GetSystemMenu*(hWnd: 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*(hMenu: HMENU): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "DestroyMenu".}
+proc CheckMenuItem*(hMenu: HMENU, uIDCheckItem: UINT, uCheck: UINT): DWORD{.
+    stdcall, dynlib: "user32", importc: "CheckMenuItem".}
+proc EnableMenuItem*(hMenu: HMENU, uIDEnableItem: UINT, uEnable: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "EnableMenuItem".}
+proc GetSubMenu*(hMenu: HMENU, nPos: int32): HMENU{.stdcall, dynlib: "user32",
+    importc: "GetSubMenu".}
+proc GetMenuItemID*(hMenu: HMENU, nPos: int32): UINT{.stdcall, dynlib: "user32",
+    importc: "GetMenuItemID".}
+proc GetMenuItemCount*(hMenu: HMENU): int32{.stdcall, dynlib: "user32",
+    importc: "GetMenuItemCount".}
+proc RemoveMenu*(hMenu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "RemoveMenu".}
+proc DeleteMenu*(hMenu: HMENU, uPosition: UINT, uFlags: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "DeleteMenu".}
+proc SetMenuItemBitmaps*(hMenu: HMENU, uPosition: UINT, uFlags: UINT,
+                         hBitmapUnchecked: HBITMAP, hBitmapChecked: HBITMAP): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetMenuItemBitmaps".}
+proc GetMenuCheckMarkDimensions*(): LONG{.stdcall, dynlib: "user32",
+    importc: "GetMenuCheckMarkDimensions".}
+proc TrackPopupMenu*(hMenu: HMENU, uFlags: UINT, x: int32, y: int32,
+                     nReserved: int32, hWnd: HWND, prcRect: var RECT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "TrackPopupMenu".}
+proc GetMenuDefaultItem*(hMenu: HMENU, fByPos: UINT, gmdiFlags: UINT): UINT{.
+    stdcall, dynlib: "user32", importc: "GetMenuDefaultItem".}
+proc SetMenuDefaultItem*(hMenu: HMENU, uItem: UINT, fByPos: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetMenuDefaultItem".}
+proc GetMenuItemRect*(hWnd: HWND, hMenu: HMENU, uItem: UINT, lprcItem: LPRECT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetMenuItemRect".}
+proc MenuItemFromPoint*(hWnd: HWND, hMenu: HMENU, ptScreen: POINT): int32{.
+    stdcall, dynlib: "user32", importc: "MenuItemFromPoint".}
+proc DragObject*(para1: HWND, para2: HWND, para3: UINT, para4: DWORD,
+                 para5: HCURSOR): DWORD{.stdcall, dynlib: "user32",
+    importc: "DragObject".}
+proc DragDetect*(hwnd: HWND, pt: POINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "DragDetect".}
+proc DrawIcon*(hDC: HDC, X: int32, Y: int32, hIcon: HICON): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "DrawIcon".}
+proc UpdateWindow*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "UpdateWindow".}
+proc SetActiveWindow*(hWnd: 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*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetForegroundWindow".}
+proc WindowFromDC*(hDC: HDC): HWND{.stdcall, dynlib: "user32",
+                                    importc: "WindowFromDC".}
+proc GetDC*(hWnd: HWND): HDC{.stdcall, dynlib: "user32", importc: "GetDC".}
+proc GetDCEx*(hWnd: HWND, hrgnClip: HRGN, flags: DWORD): HDC{.stdcall,
+    dynlib: "user32", importc: "GetDCEx".}
+proc GetWindowDC*(hWnd: HWND): HDC{.stdcall, dynlib: "user32",
+                                    importc: "GetWindowDC".}
+proc ReleaseDC*(hWnd: HWND, hDC: HDC): int32{.stdcall, dynlib: "user32",
+    importc: "ReleaseDC".}
+proc BeginPaint*(hWnd: HWND, lpPaint: LPPAINTSTRUCT): HDC{.stdcall,
+    dynlib: "user32", importc: "BeginPaint".}
+proc EndPaint*(hWnd: HWND, lpPaint: LPPAINTSTRUCT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "EndPaint".}
+proc GetUpdateRect*(hWnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetUpdateRect".}
+proc GetUpdateRgn*(hWnd: HWND, hRgn: HRGN, bErase: WINBOOL): int32{.stdcall,
+    dynlib: "user32", importc: "GetUpdateRgn".}
+proc SetWindowRgn*(hWnd: HWND, hRgn: HRGN, bRedraw: WINBOOL): int32{.stdcall,
+    dynlib: "user32", importc: "SetWindowRgn".}
+proc GetWindowRgn*(hWnd: HWND, hRgn: HRGN): int32{.stdcall, dynlib: "user32",
+    importc: "GetWindowRgn".}
+proc ExcludeUpdateRgn*(hDC: HDC, hWnd: HWND): int32{.stdcall, dynlib: "user32",
+    importc: "ExcludeUpdateRgn".}
+proc InvalidateRect*(hWnd: HWND, lpRect: var RECT, bErase: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "InvalidateRect".}
+proc InvalidateRect*(hWnd: HWND, lpRect: LPRECT, bErase: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "InvalidateRect".}
+proc ValidateRect*(hWnd: HWND, lpRect: var RECT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ValidateRect".}
+proc ValidateRect*(hWnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ValidateRect".}
+proc InvalidateRgn*(hWnd: HWND, hRgn: HRGN, bErase: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "InvalidateRgn".}
+proc ValidateRgn*(hWnd: HWND, hRgn: HRGN): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ValidateRgn".}
+proc RedrawWindow*(hWnd: HWND, lprcUpdate: var RECT, hrgnUpdate: HRGN,
+                   flags: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "RedrawWindow".}
+proc RedrawWindow*(hWnd: HWND, lprcUpdate: LPRECT, hrgnUpdate: HRGN, flags: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "RedrawWindow".}
+proc LockWindowUpdate*(hWndLock: HWND): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "LockWindowUpdate".}
+proc ScrollWindow*(hWnd: 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*(hWnd: HWND, dx: int32, dy: int32, prcScroll: var RECT,
+                     prcClip: var RECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,
+                     flags: UINT): int32{.stdcall, dynlib: "user32",
+    importc: "ScrollWindowEx".}
+proc SetScrollPos*(hWnd: HWND, nBar: int32, nPos: int32, bRedraw: WINBOOL): int32{.
+    stdcall, dynlib: "user32", importc: "SetScrollPos".}
+proc GetScrollPos*(hWnd: HWND, nBar: int32): int32{.stdcall, dynlib: "user32",
+    importc: "GetScrollPos".}
+proc SetScrollRange*(hWnd: HWND, nBar: int32, nMinPos: int32, nMaxPos: int32,
+                     bRedraw: WINBOOL): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetScrollRange".}
+proc GetScrollRange*(hWnd: HWND, nBar: int32, lpMinPos: LPINT, lpMaxPos: LPINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetScrollRange".}
+proc ShowScrollBar*(hWnd: HWND, wBar: int32, bShow: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ShowScrollBar".}
+proc EnableScrollBar*(hWnd: HWND, wSBflags: UINT, wArrows: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "EnableScrollBar".}
+proc GetClientRect*(hWnd: HWND, lpRect: LPRECT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetClientRect".}
+proc GetWindowRect*(hWnd: 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: UINT): 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*(hCursor: 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*(hWnd: HWND, hBitmap: HBITMAP, nWidth: int32, nHeight: int32): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "CreateCaret".}
+proc GetCaretBlinkTime*(): UINT{.stdcall, dynlib: "user32",
+                                 importc: "GetCaretBlinkTime".}
+proc SetCaretBlinkTime*(uMSeconds: UINT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetCaretBlinkTime".}
+proc DestroyCaret*(): WINBOOL{.stdcall, dynlib: "user32",
+                               importc: "DestroyCaret".}
+proc HideCaret*(hWnd: HWND): WINBOOL{.stdcall, dynlib: "user32",
+                                      importc: "HideCaret".}
+proc ShowCaret*(hWnd: 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*(hWnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ClientToScreen".}
+proc ScreenToClient*(hWnd: HWND, lpPoint: LPPOINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ScreenToClient".}
+proc MapWindowPoints*(hWndFrom: HWND, hWndTo: HWND, lpPoints: LPPOINT,
+                      cPoints: UINT): 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: 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*(hWnd: HWND, nIndex: int32): int16{.stdcall,
+    dynlib: "user32", importc: "GetWindowWord".}
+proc SetWindowWord*(hWnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall,
+    dynlib: "user32", importc: "SetWindowWord".}
+proc GetClassWord*(hWnd: HWND, nIndex: int32): int16{.stdcall, dynlib: "user32",
+    importc: "GetClassWord".}
+proc SetClassWord*(hWnd: HWND, nIndex: int32, wNewWord: int16): int16{.stdcall,
+    dynlib: "user32", importc: "SetClassWord".}
+proc GetDesktopWindow*(): HWND{.stdcall, dynlib: "user32",
+                                importc: "GetDesktopWindow".}
+proc GetParent*(hWnd: 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,
+                       lParam: LPARAM): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "EnumChildWindows".}
+proc EnumWindows*(lpEnumFunc: ENUMWINDOWSPROC, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "EnumWindows".}
+proc EnumThreadWindows*(dwThreadId: DWORD, lpfn: ENUMWINDOWSPROC, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "EnumThreadWindows".}
+proc EnumTaskWindows*(hTask: HWND, lpfn: FARPROC, lParam: LPARAM): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "EnumThreadWindows".}
+proc GetTopWindow*(hWnd: HWND): HWND{.stdcall, dynlib: "user32",
+                                      importc: "GetTopWindow".}
+proc GetWindowThreadProcessId*(hWnd: HWND, lpdwProcessId: LPDWORD): DWORD{.
+    stdcall, dynlib: "user32", importc: "GetWindowThreadProcessId".}
+proc GetLastActivePopup*(hWnd: HWND): HWND{.stdcall, dynlib: "user32",
+    importc: "GetLastActivePopup".}
+proc GetWindow*(hWnd: HWND, uCmd: UINT): 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, wParam: WPARAM, lParam: LPARAM): LRESULT{.
+    stdcall, dynlib: "user32", importc: "CallNextHookEx".}
+proc CheckMenuRadioItem*(para1: HMENU, para2: UINT, para3: UINT, para4: UINT,
+                         para5: UINT): 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*(hCursor: 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*(hIcon: 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: UINT): 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: UINT): HICON{.stdcall,
+    dynlib: "user32", importc: "CreateIconFromResourceEx".}
+proc CopyImage*(para1: HANDLE, para2: UINT, para3: int32, para4: int32,
+                para5: UINT): HICON{.stdcall, dynlib: "user32",
+                                     importc: "CopyImage".}
+proc CreateIconIndirect*(piconinfo: PICONINFO): HICON{.stdcall,
+    dynlib: "user32", importc: "CreateIconIndirect".}
+proc CopyIcon*(hIcon: HICON): HICON{.stdcall, dynlib: "user32",
+                                     importc: "CopyIcon".}
+proc GetIconInfo*(hIcon: 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*(hWnd: HWND): UINT{.stdcall, dynlib: "user32",
+    importc: "ArrangeIconicWindows".}
+proc TileWindows*(hwndParent: HWND, wHow: UINT, lpRect: var RECT, cKids: UINT,
+                  lpKids: var HWND): int16{.stdcall, dynlib: "user32",
+    importc: "TileWindows".}
+proc CascadeWindows*(hwndParent: HWND, wHow: UINT, lpRect: var RECT,
+                     cKids: UINT, 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: UINT, grfFlags: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DrawEdge".}
+proc DrawFrameControl*(para1: HDC, para2: LPRECT, para3: UINT, para4: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DrawFrameControl".}
+proc DrawCaption*(para1: HWND, para2: HDC, para3: var RECT, para4: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DrawCaption".}
+proc DrawAnimatedRects*(hwnd: HWND, idAni: int32, lprcFrom: var RECT,
+                        lprcTo: var RECT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "DrawAnimatedRects".}
+proc TrackPopupMenuEx*(para1: HMENU, para2: UINT, para3: int32, para4: int32,
+                       para5: HWND, para6: LPTPMPARAMS): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "TrackPopupMenuEx".}
+proc ChildWindowFromPointEx*(para1: HWND, para2: POINT, para3: UINT): HWND{.
+    stdcall, dynlib: "user32", importc: "ChildWindowFromPointEx".}
+proc DrawIconEx*(hdc: HDC, xLeft: int32, yTop: int32, hIcon: HICON,
+                 cxWidth: int32, cyWidth: int32, istepIfAniCur: UINT,
+                 hbrFlickerFreeDraw: HBRUSH, diFlags: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "DrawIconEx".}
+proc AnimatePalette*(para1: HPALETTE, para2: UINT, para3: UINT,
+                     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: UINT, para4: UINT,
+                   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: UINT): HBITMAP{.
+    stdcall, dynlib: "gdi32", importc: "CreateDIBitmap".}
+proc CreateDIBPatternBrush*(para1: HGLOBAL, para2: UINT): HBRUSH{.stdcall,
+    dynlib: "gdi32", importc: "CreateDIBPatternBrush".}
+proc CreateDIBPatternBrushPt*(para1: pointer, para2: UINT): 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: UINT): 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: UINT): UINT{.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: UINT): 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: UINT, para4: UINT,
+                para5: LPVOID, para6: LPBITMAPINFO, para7: UINT): 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: UINT, para3: LPVOID): UINT{.
+    stdcall, dynlib: "gdi32", importc: "GetMetaFileBitsEx".}
+proc GetNearestColor*(para1: HDC, para2: COLORREF): COLORREF{.stdcall,
+    dynlib: "gdi32", importc: "GetNearestColor".}
+proc GetNearestPaletteIndex*(para1: HPALETTE, para2: COLORREF): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetNearestPaletteIndex".}
+proc GetObjectType*(h: HGDIOBJ): DWORD{.stdcall, dynlib: "gdi32",
+                                        importc: "GetObjectType".}
+proc GetPaletteEntries*(para1: HPALETTE, para2: UINT, para3: UINT,
+                        para4: LPPALETTEENTRY): UINT{.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: UINT): 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: UINT, para3: UINT,
+                              para4: LPPALETTEENTRY): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetSystemPaletteEntries".}
+proc GetSystemPaletteUse*(para1: HDC): UINT{.stdcall, dynlib: "gdi32",
+    importc: "GetSystemPaletteUse".}
+proc GetTextCharacterExtra*(para1: HDC): int32{.stdcall, dynlib: "gdi32",
+    importc: "GetTextCharacterExtra".}
+proc GetTextAlign*(para1: HDC): UINT{.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): UINT{.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: UINT): 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: UINT): UINT{.stdcall,
+    dynlib: "gdi32", importc: "SetBoundsRect".}
+proc SetDIBits*(para1: HDC, para2: HBITMAP, para3: UINT, para4: UINT,
+                para5: pointer, para6: PBITMAPINFO, para7: UINT): int32{.
+    stdcall, dynlib: "gdi32", importc: "SetDIBits".}
+proc SetDIBitsToDevice*(para1: HDC, para2: int32, para3: int32, para4: DWORD,
+                        para5: DWORD, para6: int32, para7: int32, para8: UINT,
+                        para9: UINT, para10: pointer, para11: var BITMAPINFO,
+                        para12: UINT): 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: UINT, para2: var int8): HMETAFILE{.stdcall,
+    dynlib: "gdi32", importc: "SetMetaFileBitsEx".}
+proc SetPaletteEntries*(para1: HPALETTE, para2: UINT, para3: UINT,
+                        para4: var PALETTEENTRY): UINT{.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: UINT, 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: UINT): UINT{.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: UINT): UINT{.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: UINT): 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: UINT,
+                           para3: LPENHMETAHEADER): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetEnhMetaFileHeader".}
+proc GetEnhMetaFilePaletteEntries*(para1: HENHMETAFILE, para2: UINT,
+                                   para3: LPPALETTEENTRY): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetEnhMetaFilePaletteEntries".}
+proc GetEnhMetaFileBits*(para1: HENHMETAFILE, para2: UINT, para3: LPBYTE): UINT{.
+    stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileBits".}
+proc GetWinMetaFileBits*(para1: HENHMETAFILE, para2: UINT, para3: LPBYTE,
+                         para4: wINT, para5: HDC): UINT{.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 TENHMETARECORD, para4: UINT): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "PlayEnhMetaFileRecord".}
+proc SetEnhMetaFileBits*(para1: UINT, para2: var int8): HENHMETAFILE{.stdcall,
+    dynlib: "gdi32", importc: "SetEnhMetaFileBits".}
+proc SetWinMetaFileBits*(para1: UINT, para2: var int8, para3: HDC,
+                         para4: var METAFILEPICT): HENHMETAFILE{.stdcall,
+    dynlib: "gdi32", importc: "SetWinMetaFileBits".}
+proc GdiComment*(para1: HDC, para2: UINT, 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: UINT,
+                       para4: var pointer, para5: HANDLE, para6: DWORD): HBITMAP{.
+    stdcall, dynlib: "gdi32", importc: "CreateDIBSection".}
+proc GetDIBColorTable*(para1: HDC, para2: UINT, para3: UINT, para4: var RGBQUAD): UINT{.
+    stdcall, dynlib: "gdi32", importc: "GetDIBColorTable".}
+proc SetDIBColorTable*(para1: HDC, para2: UINT, para3: UINT, para4: var RGBQUAD): UINT{.
+    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: TABORTPROC): 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: UINT, 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: UINT): 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: UINT): 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: UINT): 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: UINT): int{.stdcall,
+    dynlib: "comctl32.dll", importc: "ImageList_SetImageCount".}
+proc CreateToolbarEx*(hwnd: HWND, ws: DWORD, wID: UINT, nBitmaps: int32,
+                      hBMInst: HINST, wBMID: UINT, lpButtons: LPCTBBUTTON,
+                      iNumButtons: int32, dxButton: int32, dyButton: int32,
+                      dxBitmap: int32, dyBitmap: int32, uStructSize: UINT): HWND{.
+    stdcall, dynlib: "comctl32", importc: "CreateToolbarEx".}
+proc CreateMappedBitmap*(hInstance: HINST, idBitmap: int32, wFlags: UINT,
+                         lpColorMap: LPCOLORMAP, iNumMaps: int32): HBITMAP{.
+    stdcall, dynlib: "comctl32", importc: "CreateMappedBitmap".}
+proc MenuHelp*(uMsg: UINT, wParam: WPARAM, lParam: LPARAM, hMainMenu: HMENU,
+               hInst: HINST, hwndStatus: HWND, lpwIDs: var UINT){.stdcall,
+    dynlib: "comctl32", importc: "MenuHelp".}
+proc ShowHideMenuCtl*(hWnd: HWND, uFlags: UINT, lpInfo: LPINT): WINBOOL{.
+    stdcall, dynlib: "comctl32", importc: "ShowHideMenuCtl".}
+proc GetEffectiveClientRect*(hWnd: 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*(hKey: HKEY): LONG{.stdcall, dynlib: "advapi32",
+                                     importc: "RegCloseKey".}
+proc RegSetKeySecurity*(hKey: HKEY, SecurityInformation: SECURITY_INFORMATION,
+                        pSecurityDescriptor: PSECURITY_DESCRIPTOR): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetKeySecurity".}
+proc RegFlushKey*(hKey: HKEY): LONG{.stdcall, dynlib: "advapi32",
+                                     importc: "RegFlushKey".}
+proc RegGetKeySecurity*(hKey: HKEY, SecurityInformation: SECURITY_INFORMATION,
+                        pSecurityDescriptor: PSECURITY_DESCRIPTOR,
+                        lpcbSecurityDescriptor: LPDWORD): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegGetKeySecurity".}
+proc RegNotifyChangeKeyValue*(hKey: HKEY, bWatchSubtree: WINBOOL,
+                              dwNotifyFilter: DWORD, hEvent: HANDLE,
+                              fAsynchronus: WINBOOL): LONG{.stdcall,
+    dynlib: "advapi32", importc: "RegNotifyChangeKeyValue".}
+proc IsValidCodePage*(CodePage: UINT): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "IsValidCodePage".}
+proc GetACP*(): UINT{.stdcall, dynlib: "kernel32", importc: "GetACP".}
+proc GetOEMCP*(): UINT{.stdcall, dynlib: "kernel32", importc: "GetOEMCP".}
+proc GetCPInfo*(para1: UINT, para2: LPCPINFO): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetCPInfo".}
+proc IsDBCSLeadByte*(TestChar: int8): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "IsDBCSLeadByte".}
+proc IsDBCSLeadByteEx*(CodePage: UINT, TestChar: int8): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "IsDBCSLeadByteEx".}
+proc MultiByteToWideChar*(CodePage: UINT, dwFlags: DWORD,
+                          lpMultiByteStr: LPCSTR, cchMultiByte: int32,
+                          lpWideCharStr: LPWSTR, cchWideChar: int32): int32{.
+    stdcall, dynlib: "kernel32", importc: "MultiByteToWideChar".}
+proc WideCharToMultiByte*(CodePage: UINT, 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*(): UINT{.stdcall, dynlib: "kernel32", importc: "GetConsoleCP".}
+proc SetConsoleCP*(wCodePageID: UINT): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "SetConsoleCP".}
+proc GetConsoleOutputCP*(): UINT{.stdcall, dynlib: "kernel32",
+                                  importc: "GetConsoleOutputCP".}
+proc SetConsoleOutputCP*(wCodePageID: UINT): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "SetConsoleOutputCP".}
+proc WNetConnectionDialog*(hwnd: HWND, dwType: DWORD): DWORD{.stdcall,
+    dynlib: "mpr", importc: "WNetConnectionDialog".}
+proc WNetDisconnectDialog*(hwnd: 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: UINT,
+                          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: UINT, para6: UINT, 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: UINT, para7: UINT): 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: UINT): 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): UINT{.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: UINT): 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): UINT{.
+    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: UINT, para2: LPCVOID){.stdcall,
+    dynlib: "shell32", importc: "SHAddToRecentDocs".}
+proc SHBrowseForFolder*(para1: LPBROWSEINFO): LPITEMIDLIST{.stdcall,
+    dynlib: "shell32", importc: "SHBrowseForFolder".}
+proc SHChangeNotify*(para1: LONG, para2: UINT, 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: UINT, para5: UINT): 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".}
+  # was missing, bug report 1808 PM
+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: UINT): 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".}
+  # Delphi doesn't declare these, but we do:
+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: UINT,
+                            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): TProc{.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: UINT): 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*(hwnd: HWND, szName: LPTSTR): LRESULT
+proc Animate_Play*(hwnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT
+
+proc Animate_Stop*(hwnd: HWND): LRESULT
+proc Animate_Close*(hwnd: HWND): LRESULT
+proc Animate_Seek*(hwnd: 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: UINT): LRESULT
+proc ListView_CreateDragImage*(hwnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT
+proc ListView_DeleteAllItems*(hwnd: HWND): LRESULT
+proc ListView_DeleteColumn*(hwnd: HWND, iCol: int32): LRESULT
+proc ListView_DeleteItem*(hwnd: HWND, iItem: int32): LRESULT
+proc ListView_EditLabel*(hwndLV: HWND, i: int32): LRESULT
+proc ListView_EnsureVisible*(hwndLV: HWND, i, fPartialOK: int32): LRESULT
+proc ListView_FindItem*(hwnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32
+proc ListView_GetBkColor*(hwnd: HWND): LRESULT
+proc ListView_GetCallbackMask*(hwnd: HWND): LRESULT
+proc ListView_GetColumn*(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT
+proc ListView_GetColumnWidth*(hwnd: HWND, iCol: int32): LRESULT
+proc ListView_GetCountPerPage*(hwndLV: HWND): LRESULT
+proc ListView_GetEditControl*(hwndLV: HWND): LRESULT
+proc ListView_GetImageList*(hwnd: HWND, iImageList: wINT): LRESULT
+proc ListView_GetISearchString*(hwndLV: HWND, lpsz: LPTSTR): LRESULT
+proc ListView_GetItem*(hwnd: HWND, item: var LV_ITEM): LRESULT
+proc ListView_GetItemCount*(hwnd: 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*(hwnd: 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*(hwnd: HWND): LRESULT
+proc ListView_GetTextColor*(hwnd: HWND): LRESULT
+proc ListView_GetTopIndex*(hwndLV: HWND): LRESULT
+proc ListView_GetViewRect*(hwnd: HWND, rc: var RECT): LRESULT
+proc ListView_HitTest*(hwndLV: HWND, info: var LV_HITTESTINFO): LRESULT
+proc ListView_InsertColumn*(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT
+proc ListView_InsertItem*(hwnd: 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*(hwnd: HWND, clrBk: COLORREF): LRESULT
+proc ListView_SetCallbackMask*(hwnd: HWND, mask: UINT): LRESULT
+proc ListView_SetColumn*(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT
+proc ListView_SetColumnWidth*(hwnd: HWND, iCol, cx: int32): LRESULT
+proc ListView_SetImageList*(hwnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT
+proc ListView_SetItem*(hwnd: 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*(hwnd: HWND, clrTextBk: COLORREF): LRESULT
+proc ListView_SetTextColor*(hwnd: 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*(hwnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT
+proc TreeView_DeleteItem*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_DeleteAllItems*(hwnd: HWND): LRESULT
+proc TreeView_Expand*(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT
+proc TreeView_GetCount*(hwnd: HWND): LRESULT
+proc TreeView_GetIndent*(hwnd: HWND): LRESULT
+proc TreeView_SetIndent*(hwnd: HWND, indent: int32): LRESULT
+proc TreeView_GetImageList*(hwnd: HWND, iImage: WPARAM): LRESULT
+proc TreeView_SetImageList*(hwnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT
+proc TreeView_GetNextItem*(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT
+proc TreeView_GetChild*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetNextSibling*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetPrevSibling*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetParent*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetFirstVisible*(hwnd: HWND): LRESULT
+proc TreeView_GetNextVisible*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetPrevVisible*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetSelection*(hwnd: HWND): LRESULT
+proc TreeView_GetDropHilight*(hwnd: HWND): LRESULT
+proc TreeView_GetRoot*(hwnd: HWND): LRESULT
+proc TreeView_Select*(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT
+proc TreeView_SelectItem*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_SelectDropTarget*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_SelectSetFirstVisible*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetItem*(hwnd: HWND, item: var TV_ITEM): LRESULT
+proc TreeView_SetItem*(hwnd: HWND, item: var TV_ITEM): LRESULT
+proc TreeView_EditLabel*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_GetEditControl*(hwnd: HWND): LRESULT
+proc TreeView_GetVisibleCount*(hwnd: HWND): LRESULT
+proc TreeView_HitTest*(hwnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT
+proc TreeView_CreateDragImage*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_SortChildren*(hwnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT
+proc TreeView_EnsureVisible*(hwnd: HWND, hitem: HTREEITEM): LRESULT
+proc TreeView_SortChildrenCB*(hwnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT
+proc TreeView_EndEditLabelNow*(hwnd: HWND, fCancel: int32): LRESULT
+proc TreeView_GetISearchString*(hwndTV: HWND, lpsz: LPTSTR): LRESULT
+proc TabCtrl_GetImageList*(hwnd: HWND): LRESULT
+proc TabCtrl_SetImageList*(hwnd: HWND, himl: HIMAGELIST): LRESULT
+proc TabCtrl_GetItemCount*(hwnd: HWND): LRESULT
+proc TabCtrl_GetItem*(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT
+proc TabCtrl_SetItem*(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT
+proc TabCtrl_InsertItem*(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT
+proc TabCtrl_DeleteItem*(hwnd: HWND, i: int32): LRESULT
+proc TabCtrl_DeleteAllItems*(hwnd: HWND): LRESULT
+proc TabCtrl_GetItemRect*(hwnd: HWND, i: int32, rc: var RECT): LRESULT
+proc TabCtrl_GetCurSel*(hwnd: HWND): LRESULT
+proc TabCtrl_SetCurSel*(hwnd: 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*(hwnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT
+proc TabCtrl_SetItemSize*(hwnd: HWND, x, y: int32): LRESULT
+proc TabCtrl_RemoveImage*(hwnd: HWND, i: WPARAM): LRESULT
+proc TabCtrl_SetPadding*(hwnd: HWND, cx, cy: int32): LRESULT
+proc TabCtrl_GetRowCount*(hwnd: HWND): LRESULT
+proc TabCtrl_GetToolTips*(hwnd: HWND): LRESULT
+proc TabCtrl_SetToolTips*(hwnd: HWND, hwndTT: int32): LRESULT
+proc TabCtrl_GetCurFocus*(hwnd: HWND): LRESULT
+proc TabCtrl_SetCurFocus*(hwnd: HWND, i: int32): LRESULT
+proc SNDMSG*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: 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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT
+else:
+  proc CommDlg_OpenSave_GetSpec*(hdlg: HWND, psz: LPWSTR, 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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT
+else:
+  proc CommDlg_OpenSave_GetFilePath*(hdlg: HWND, psz: LPWSTR, 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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT
+else:
+  proc CommDlg_OpenSave_GetFolderPath*(hdlg: HWND, psz: LPWSTR, 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*(hWnd: HWND, uCmd: UINT): 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* = TGUID
+  TFNDlgProc* = FARPROC
+  TFNThreadStartRoutine* = FARPROC
+  TFNTimerAPCRoutine* = FARPROC
+  TFNFiberStartRoutine* = FARPROC
+  TFNHookProc* = HOOKPROC
+  PObjectTypeList* = ptr TObjectTypeList
+  OBJECT_TYPE_LIST* = record
+    Level*: int16
+    Sbz*: int16
+    ObjectType*: PGUID
+
+  TObjectTypeList* = OBJECT_TYPE_LIST
+  AUDIT_EVENT_TYPE* = DWORD
+  PBlendFunction* = ptr TBlendFunction
+  BLENDFUNCTION* = record
+    BlendOp*: int8
+    BlendFlags*: int8
+    SourceConstantAlpha*: int8
+    AlphaFormat*: int8
+
+  TBlendFunction* = BLENDFUNCTION
+  WIN_CERTIFICATE* = record
+    dwLength*: DWord
+    wRevision*: int16
+    wCertificateType*: int16
+    bCertificate*: array[0..0, int8]
+
+  TWinCertificate* = WIN_CERTIFICATE
+  PWinCertificate* = ptr TWinCertificate
+  TMaxLogPalette* = record
+    palVersion*: int16
+    palNumEntries*: int16
+    palPalEntry*: array[int8, TPaletteEntry]
+
+  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
+  HFILE_ERROR* = HFILE(- 1) #
+                            #  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 TSERVICESTATUS): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "ControlService".}
+proc QueryServiceStatus*(hService: SC_HANDLE,
+                         lpServiceStatus: var TSERVICESTATUS): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "QueryServiceStatus".}
+proc SetServiceStatus*(hServiceStatus: SERVICE_STATUS_HANDLE,
+                       ServiceStatus: TSERVICESTATUS): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "SetServiceStatus".}
+proc AdjustTokenPrivileges*(TokenHandle: THandle, DisableAllPrivileges: WINBOOL,
+                            NewState: TTokenPrivileges, BufferLength: DWORD,
+                            PreviousState: var TTokenPrivileges,
+                            ReturnLength: var DWORD): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "AdjustTokenPrivileges".}
+proc AdjustWindowRect*(lpRect: var TRect, dwStyle: DWORD, bMenu: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "AdjustWindowRect".}
+proc AdjustWindowRectEx*(lpRect: var TRect, dwStyle: DWORD, bMenu: WINBOOL,
+                         dwExStyle: DWORD): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "AdjustWindowRectEx".}
+proc AllocateAndInitializeSid*(pIdentifierAuthority: TSIDIdentifierAuthority,
+                               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 TLargeInteger): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "AllocateLocallyUniqueId".}
+proc BackupRead*(hFile: THandle, lpBuffer: PByte, nNumberOfBytesToRead: DWORD,
+                 lpNumberOfBytesRead: var DWORD, bAbort: WINBOOL,
+                 bProcessSecurity: WINBOOL, lpContext: var Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "BackupRead".}
+proc BackupSeek*(hFile: THandle, dwLowBytesToSeek, dwHighBytesToSeek: DWORD,
+                 lpdwLowByteSeeked, lpdwHighByteSeeked: var DWORD,
+                 lpContext: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "BackupSeek".}
+proc BackupWrite*(hFile: THandle, lpBuffer: PByte, nNumberOfBytesToWrite: DWORD,
+                  lpNumberOfBytesWritten: var DWORD,
+                  bAbort, bProcessSecurity: WINBOOL, lpContext: var Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "BackupWrite".}
+proc BeginPaint*(hWnd: HWND, lpPaint: var TPaintStruct): HDC{.stdcall,
+    dynlib: "user32", importc: "BeginPaint".}
+proc BuildCommDCB*(lpDef: cstring, lpDCB: var TDCB): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "BuildCommDCBA".}
+proc BuildCommDCBA*(lpDef: LPCSTR, lpDCB: var TDCB): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "BuildCommDCBA".}
+proc BuildCommDCBAndTimeouts*(lpDef: cstring, lpDCB: var TDCB,
+                              lpCommTimeouts: var TCommTimeouts): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}
+proc BuildCommDCBAndTimeoutsA*(lpDef: LPCSTR, lpDCB: var TDCB,
+                               lpCommTimeouts: var TCommTimeouts): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsA".}
+proc BuildCommDCBAndTimeoutsW*(lpDef: LPWSTR, lpDCB: var TDCB,
+                               lpCommTimeouts: var TCommTimeouts): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "BuildCommDCBAndTimeoutsW".}
+proc BuildCommDCBW*(lpDef: LPWSTR, lpDCB: var TDCB): 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: TCLSID, para2: pointer, para3: DWORD,
+                            para4: DWORD, out_para5: DWORD): HRESULT{.stdcall,
+    dynlib: "ole32.dll", importc: "CoRegisterClassObject".}
+proc ChangeDisplaySettings*(lpDevMode: var TDeviceMode, dwFlags: DWORD): int32{.
+    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}
+proc ChangeDisplaySettingsA*(lpDevMode: var TDeviceModeA, dwFlags: DWORD): int32{.
+    stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}
+proc ChangeDisplaySettingsEx*(lpszDeviceName: cstring,
+                              lpDevMode: var TDeviceMode, wnd: HWND,
+                              dwFlags: DWORD, lParam: Pointer): int32{.stdcall,
+    dynlib: "user32", importc: "ChangeDisplaySettingsExA".}
+proc ChangeDisplaySettingsExA*(lpszDeviceName: LPCSTR,
+                               lpDevMode: var TDeviceModeA, wnd: HWND,
+                               dwFlags: DWORD, lParam: Pointer): int32{.stdcall,
+    dynlib: "user32", importc: "ChangeDisplaySettingsExA".}
+proc ChangeDisplaySettingsExW*(lpszDeviceName: LPWSTR,
+                               lpDevMode: var TDeviceModeW, wnd: HWND,
+                               dwFlags: DWORD, lParam: Pointer): int32{.stdcall,
+    dynlib: "user32", importc: "ChangeDisplaySettingsExW".}
+proc ChangeDisplaySettingsW*(lpDevMode: var TDeviceModeW, 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: THandle, lpErrors: var DWORD, lpStat: PComStat): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ClearCommError".}
+proc ClientToScreen*(hWnd: HWND, lpPoint: var TPoint): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ClientToScreen".}
+proc ClipCursor*(lpRect: var RECT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ClipCursor".}
+  #function CombineTransform(var p1: TXForm; const p2, p3: TXForm): WINBOOL; stdcall; external 'gdi32' name 'CombineTransform';
+proc CommConfigDialog*(lpszName: cstring, hWnd: HWND, lpCC: var TCommConfig): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}
+proc CommConfigDialogA*(lpszName: LPCSTR, hWnd: HWND, lpCC: var TCommConfig): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CommConfigDialogA".}
+proc CommConfigDialogW*(lpszName: LPWSTR, hWnd: HWND, lpCC: var TCommConfig): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CommConfigDialogW".}
+  #function CompareFileTime(const lpFileTime1, lpFileTime2: TFileTime): Longint; stdcall; external 'kernel32' name 'CompareFileTime';
+  #function ConvertToAutoInheritPrivateObjectSecurity(ParentDescriptor, CurrentSecurityDescriptor: PSecurityDescriptor; var NewDescriptor: PSecurityDescriptor; ObjectType: PGUID; IsDirectoryObject: WINBOOL; const GenericMapping: TGenericMapping): 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 TRect, lprcSrc: TRect): 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: TBitmap): HBITMAP; stdcall; external 'gdi32' name 'CreateBitmapIndirect';
+  #function CreateBrushIndirect(const p1: TLogBrush): HBRUSH; stdcall; external 'gdi32' name 'CreateBrushIndirect';
+proc CreateColorSpace*(ColorSpace: var TLogColorSpace): HCOLORSPACE{.stdcall,
+    dynlib: "gdi32", importc: "CreateColorSpaceA".}
+proc CreateColorSpaceA*(ColorSpace: var TLogColorSpaceA): HCOLORSPACE{.stdcall,
+    dynlib: "gdi32", importc: "CreateColorSpaceA".}
+  #function CreateColorSpaceW(var ColorSpace: TLogColorSpaceW): HCOLORSPACE; stdcall; external 'gdi32' name 'CreateColorSpaceW';
+proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: TDlgTemplate,
+                                hWndParent: HWND, lpDialogFunc: TFNDlgProc,
+                                dwInitParam: LPARAM): HWND{.stdcall,
+    dynlib: "user32", importc: "CreateDialogIndirectParamA".}
+  #function CreateDialogIndirectParamA(hInstance: HINST; const lpTemplate: TDlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamA';
+  #function CreateDialogIndirectParamW(hInstance: HINST; const lpTemplate: TDlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamW';
+  #function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader; dwUsage: DWORD; InitBits: PChar; var InitInfo: TBitmapInfo; wUsage: UINT): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBitmap';
+  #function CreateDIBPatternBrushPt(const p1: Pointer; p2: UINT): HBRUSH; stdcall; external 'gdi32' name 'CreateDIBPatternBrushPt';
+  #function CreateDIBSection(DC: HDC; const p2: TBitmapInfo; p3: UINT; var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBSection';
+  #function CreateEllipticRgnIndirect(const p1: TRect): HRGN; stdcall; external 'gdi32' name 'CreateEllipticRgnIndirect';
+  #function CreateFontIndirect(const p1: TLogFont): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectA';
+  #function CreateFontIndirectA(const p1: TLogFontA): 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: TLogFontW): HFONT; stdcall; external 'gdi32' name 'CreateFontIndirectW';
+proc CreateIconIndirect*(piconinfo: var TIconInfo): HICON{.stdcall,
+    dynlib: "user32", importc: "CreateIconIndirect".}
+  #function CreatePalette(const LogPalette: TLogPalette): HPalette; stdcall; external 'gdi32' name 'CreatePalette';
+  #function CreatePenIndirect(const LogPen: TLogPen): HPEN; stdcall; external 'gdi32' name 'CreatePenIndirect';
+proc CreatePipe*(hReadPipe, hWritePipe: var THandle,
+                 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: THandle; const GenericMapping: TGenericMapping): WINBOOL;
+  #  stdcall; external 'advapi32' name 'CreatePrivateObjectSecurity';
+  #function CreatePrivateObjectSecurityEx(ParentDescriptor, CreatorDescriptor: PSecurityDescriptor; var NewDescriptor: PSecurityDescriptor; ObjectType: PGUID; IsContainerObject: WINBOOL; AutoInheritFlags: ULONG; Token: THandle;
+  #  const GenericMapping: TGenericMapping): WINBOOL;stdcall; external 'advapi32' name 'CreatePrivateObjectSecurityEx';
+proc CreateProcess*(lpApplicationName: cstring, lpCommandLine: cstring,
+    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,
+                    bInheritHandles: WINBOOL, dwCreationFlags: DWORD,
+                    lpEnvironment: Pointer, lpCurrentDirectory: cstring,
+                    lpStartupInfo: TStartupInfo,
+                    lpProcessInformation: var TProcessInformation): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CreateProcessA".}
+proc CreateProcessA*(lpApplicationName: LPCSTR, lpCommandLine: LPCSTR,
+    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,
+                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,
+                     lpEnvironment: Pointer, lpCurrentDirectory: LPCSTR,
+                     lpStartupInfo: TStartupInfo,
+                     lpProcessInformation: var TProcessInformation): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CreateProcessA".}
+  #function CreateProcessAsUser(hToken: THandle; lpApplicationName: PChar; lpCommandLine: PChar; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;
+  # lpEnvironment: Pointer; lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL;stdcall; external 'advapi32' name 'CreateProcessAsUserA';
+  #function CreateProcessAsUserA(hToken: THandle; lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;
+  #  lpEnvironment: Pointer; lpCurrentDirectory: LPCSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserA';
+  #function CreateProcessAsUserW(hToken: THandle; lpApplicationName: LPWSTR; lpCommandLine: LPWSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;
+  #  lpEnvironment: Pointer; lpCurrentDirectory: LPWSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserW';
+proc CreateProcessW*(lpApplicationName: LPWSTR, lpCommandLine: LPWSTR,
+    lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,
+                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,
+                     lpEnvironment: Pointer, lpCurrentDirectory: LPWSTR,
+                     lpStartupInfo: TStartupInfo,
+                     lpProcessInformation: var TProcessInformation): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "CreateProcessW".}
+  #function CreateRectRgnIndirect(const p1: TRect): HRGN; stdcall; external 'gdi32' name 'CreateRectRgnIndirect';
+proc CreateRemoteThread*(hProcess: THandle, lpThreadAttributes: Pointer,
+                         dwStackSize: DWORD,
+                         lpStartAddress: TFNThreadStartRoutine,
+                         lpParameter: Pointer, dwCreationFlags: DWORD,
+                         lpThreadId: var DWORD): THandle{.stdcall,
+    dynlib: "kernel32", importc: "CreateRemoteThread".}
+proc CreateThread*(lpThreadAttributes: Pointer, dwStackSize: DWORD,
+                   lpStartAddress: TFNThreadStartRoutine, lpParameter: Pointer,
+                   dwCreationFlags: DWORD, lpThreadId: var DWORD): THandle{.
+    stdcall, dynlib: "kernel32", importc: "CreateThread".}
+proc DdeSetQualityOfService*(hWndClient: HWnd,
+                             pqosNew: TSecurityQualityOfService,
+                             pqosPrev: PSecurityQualityOfService): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DdeSetQualityOfService".}
+  #function DeleteAce(var pAcl: TACL; dwAceIndex: DWORD): WINBOOL; stdcall; external 'advapi32' name 'DeleteAce';
+proc DescribePixelFormat*(DC: HDC, p2: int, p3: UINT,
+                          p4: var TPixelFormatDescriptor): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "DescribePixelFormat".}
+  #function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): WINBOOL; stdcall; external 'advapi32' name 'DestroyPrivateObjectSecurity';
+proc DeviceIoControl*(hDevice: THandle, 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: TDlgTemplate,
+                             hWndParent: HWND, lpDialogFunc: TFNDlgProc,
+                             dwInitParam: LPARAM): int{.stdcall,
+    dynlib: "user32", importc: "DialogBoxIndirectParamA".}
+proc DialogBoxIndirectParamA*(hInstance: HINST, lpDialogTemplate: TDlgTemplate,
+                              hWndParent: HWND, lpDialogFunc: TFNDlgProc,
+                              dwInitParam: LPARAM): int{.stdcall,
+    dynlib: "user32", importc: "DialogBoxIndirectParamA".}
+proc DialogBoxIndirectParamW*(hInstance: HINST, lpDialogTemplate: TDlgTemplate,
+                              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 TFileTime): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "DosDateTimeToFileTime".}
+proc DPtoLP*(DC: HDC, Points: pointer, Count: int): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "DPtoLP".}
+  # function DrawAnimatedRects(hwnd: HWND; idAni: Integer; const lprcFrom, lprcTo: TRect): WINBOOL; stdcall; external 'user32' name 'DrawAnimatedRects';
+  #function DrawCaption(p1: HWND; p2: HDC; const p3: TRect; p4: UINT): WINBOOL; stdcall; external 'user32' name 'DrawCaption';
+proc DrawEdge*(hdc: HDC, qrc: var TRect, edge: UINT, grfFlags: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DrawEdge".}
+  #function DrawFocusRect(hDC: HDC; const lprc: TRect): WINBOOL; stdcall; external 'user32' name 'DrawFocusRect';
+proc DrawFrameControl*(DC: HDC, Rect: TRect, uType, uState: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "DrawFrameControl".}
+proc DrawText*(hDC: HDC, lpString: cstring, nCount: int, lpRect: var TRect,
+               uFormat: UINT): int{.stdcall, dynlib: "user32",
+                                    importc: "DrawTextA".}
+proc DrawTextA*(hDC: HDC, lpString: LPCSTR, nCount: int, lpRect: var TRect,
+                uFormat: UINT): int{.stdcall, dynlib: "user32",
+                                     importc: "DrawTextA".}
+proc DrawTextEx*(DC: HDC, lpchText: cstring, cchText: int, p4: var TRect,
+                 dwDTFormat: UINT, DTParams: PDrawTextParams): int{.stdcall,
+    dynlib: "user32", importc: "DrawTextExA".}
+proc DrawTextExA*(DC: HDC, lpchText: LPCSTR, cchText: int, p4: var TRect,
+                  dwDTFormat: UINT, DTParams: PDrawTextParams): int{.stdcall,
+    dynlib: "user32", importc: "DrawTextExA".}
+proc DrawTextExW*(DC: HDC, lpchText: LPWSTR, cchText: int, p4: var TRect,
+                  dwDTFormat: UINT, DTParams: PDrawTextParams): int{.stdcall,
+    dynlib: "user32", importc: "DrawTextExW".}
+proc DrawTextW*(hDC: HDC, lpString: LPWSTR, nCount: int, lpRect: var TRect,
+                uFormat: UINT): int{.stdcall, dynlib: "user32",
+                                     importc: "DrawTextW".}
+  #function DuplicateTokenEx(hExistingToken: THandle; dwDesiredAccess: DWORD; lpTokenAttributes: PSecurityAttributes; ImpersonationLevel: TSecurityImpersonationLevel; TokenType: TTokenType; var phNewToken: THandle): WINBOOL;
+  #  stdcall; external 'advapi32' name 'DuplicateTokenEx';
+proc EndPaint*(hWnd: HWND, lpPaint: TPaintStruct): 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 TDeviceMode): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "EnumDisplaySettingsA".}
+proc EnumDisplaySettingsA*(lpszDeviceName: LPCSTR, iModeNum: DWORD,
+                           lpDevMode: var TDeviceModeA): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "EnumDisplaySettingsA".}
+proc EnumDisplaySettingsW*(lpszDeviceName: LPWSTR, iModeNum: DWORD,
+                           lpDevMode: var TDeviceModeW): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "EnumDisplaySettingsW".}
+  #function EnumEnhMetaFile(DC: HDC; p2: HENHMETAFILE; p3: TFNEnhMFEnumProc; p4: Pointer; const p5: TRect): WINBOOL; stdcall; external 'gdi32' name 'EnumEnhMetaFile';
+  #function EnumFontFamiliesEx(DC: HDC; var p2: TLogFont; p3: TFNFontEnumProc; p4: LPARAM; p5: DWORD): WINBOOL;stdcall; external 'gdi32' name 'EnumFontFamiliesExA';
+  #function EnumFontFamiliesExA(DC: HDC; var p2: TLogFontA; p3: TFNFontEnumProcA; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExA';
+  #function EnumFontFamiliesExW(DC: HDC; var p2: TLogFontW; p3: TFNFontEnumProcW; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExW';
+  #function EqualRect(const lprc1, lprc2: TRect): WINBOOL; stdcall; external 'user32' name 'EqualRect';
+proc ExtCreatePen*(PenStyle, Width: DWORD, Brush: TLogBrush, StyleCount: DWORD,
+                   Style: Pointer): HPEN{.stdcall, dynlib: "gdi32",
+    importc: "ExtCreatePen".}
+proc ExtCreateRegion*(p1: PXForm, p2: DWORD, p3: TRgnData): 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: TFileTime,
+                            lpFatDate, lpFatTime: var int16): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "FileTimeToDosDateTime".}
+proc FileTimeToLocalFileTime*(lpFileTime: TFileTime,
+                              lpLocalFileTime: var TFileTime): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "FileTimeToLocalFileTime".}
+proc FileTimeToSystemTime*(lpFileTime: TFileTime, lpSystemTime: var TSystemTime): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FileTimeToSystemTime".}
+proc FillConsoleOutputAttribute*(hConsoleOutput: THandle, wAttribute: int16,
+                                 nLength: DWORD, dwWriteCoord: TCoord,
+                                 lpNumberOfAttrsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputAttribute".}
+proc FillConsoleOutputCharacter*(hConsoleOutput: THandle, cCharacter: Char,
+                                 nLength: DWORD, dwWriteCoord: TCoord,
+                                 lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}
+proc FillConsoleOutputCharacterA*(hConsoleOutput: THandle, cCharacter: char,
+                                  nLength: DWORD, dwWriteCoord: TCoord,
+                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}
+proc FillConsoleOutputCharacterW*(hConsoleOutput: THandle, cCharacter: WideChar,
+                                  nLength: DWORD, dwWriteCoord: TCoord,
+                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterW".}
+  #function FillRect(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall; external 'user32' name 'FillRect';
+proc FindFirstFile*(lpFileName: cstring, lpFindFileData: var TWIN32FindData): THandle{.
+    stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}
+proc FindFirstFileA*(lpFileName: LPCSTR, lpFindFileData: var TWIN32FindDataA): THandle{.
+    stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}
+proc FindFirstFileW*(lpFileName: LPWSTR, lpFindFileData: var TWIN32FindDataW): THandle{.
+    stdcall, dynlib: "kernel32", importc: "FindFirstFileW".}
+  #function FindFirstFreeAce(var pAcl: TACL; var pAce: Pointer): WINBOOL; stdcall; external 'advapi32' name 'FindFirstFreeAce';
+proc FindNextFile*(hFindFile: THandle, lpFindFileData: var TWIN32FindData): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FindNextFileA".}
+proc FindNextFileA*(hFindFile: THandle, lpFindFileData: var TWIN32FindDataA): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FindNextFileA".}
+proc FindNextFileW*(hFindFile: THandle, lpFindFileData: var TWIN32FindDataW): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "FindNextFileW".}
+  #function FlushInstructionCache(hProcess: THandle; 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: TRect; hbr: HBRUSH): Integer; stdcall; external 'user32' name 'FrameRect';
+  #function GetAce(const pAcl: TACL; dwAceIndex: DWORD; var pAce: Pointer): WINBOOL; stdcall; external 'advapi32' name 'GetAce';
+  #function GetAclInformation(const pAcl: TACL; pAclInformation: Pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'GetAclInformation';
+  #function GetAltTabInfo(hwnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: PChar; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';
+  #function GetAltTabInfoA(hwnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPCSTR; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';
+  #function GetAltTabInfoW(hwnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPWSTR; cchItemText: UINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoW';
+proc GetAspectRatioFilterEx*(DC: HDC, p2: var TSize): 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 TSize): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetBitmapDimensionEx".}
+proc GetBoundsRect*(DC: HDC, p2: var TRect, p3: UINT): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetBoundsRect".}
+proc GetBrushOrgEx*(DC: HDC, p2: var TPoint): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetBrushOrgEx".}
+proc GetCaretPos*(lpPoint: var TPoint): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetCaretPos".}
+proc GetCharABCWidths*(DC: HDC, p2, p3: UINT, ABCStructs: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}
+proc GetCharABCWidthsA*(DC: HDC, p2, p3: UINT, ABCStructs: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsA".}
+proc GetCharABCWidthsFloat*(DC: HDC, p2, p3: UINT, ABCFloatSturcts: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}
+proc GetCharABCWidthsFloatA*(DC: HDC, p2, p3: UINT, ABCFloatSturcts: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatA".}
+proc GetCharABCWidthsFloatW*(DC: HDC, p2, p3: UINT, ABCFloatSturcts: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsFloatW".}
+  #function GetCharABCWidthsI(DC: HDC; p2, p3: UINT; p4: PWORD; const Widths): WINBOOL;stdcall; external 'gdi32' name 'GetCharABCWidthsI';
+proc GetCharABCWidthsW*(DC: HDC, p2, p3: UINT, ABCStructs: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharABCWidthsW".}
+proc GetCharacterPlacement*(DC: HDC, p2: cstring, p3, p4: WINBOOL,
+                            p5: var TGCPResults, p6: DWORD): DWORD{.stdcall,
+    dynlib: "gdi32", importc: "GetCharacterPlacementA".}
+proc GetCharacterPlacementA*(DC: HDC, p2: LPCSTR, p3, p4: WINBOOL,
+                             p5: var TGCPResults, p6: DWORD): DWORD{.stdcall,
+    dynlib: "gdi32", importc: "GetCharacterPlacementA".}
+proc GetCharacterPlacementW*(DC: HDC, p2: LPWSTR, p3, p4: WINBOOL,
+                             p5: var TGCPResults, p6: DWORD): DWORD{.stdcall,
+    dynlib: "gdi32", importc: "GetCharacterPlacementW".}
+proc GetCharWidth*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidthA".}
+proc GetCharWidth32*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidth32A".}
+proc GetCharWidth32A*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidth32A".}
+proc GetCharWidth32W*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidth32W".}
+proc GetCharWidthA*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidthA".}
+proc GetCharWidthFloat*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}
+proc GetCharWidthFloatA*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatA".}
+proc GetCharWidthFloatW*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetCharWidthFloatW".}
+  #function GetCharWidthI(DC: HDC; p2, p3: UINT; p4: PWORD; const Widths:pointer): WINBOOL;stdcall; external 'gdi32' name 'GetCharWidthI';
+proc GetCharWidthW*(DC: HDC, p2, p3: UINT, Widths: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetCharWidthW".}
+proc GetClassInfo*(hInstance: HINST, lpClassName: cstring,
+                   lpWndClass: var TWndClass): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetClassInfoA".}
+proc GetClassInfoA*(hInstance: HINST, lpClassName: LPCSTR,
+                    lpWndClass: var TWndClassA): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetClassInfoA".}
+proc GetClassInfoEx*(Instance: HINST, Classname: cstring,
+                     WndClass: var TWndClassEx): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetClassInfoExA".}
+  #function GetClassInfoExA(Instance: HINST; Classname: LPCSTR; var WndClass: TWndClassExA): WINBOOL; stdcall; external 'user32' name 'GetClassInfoExA';
+  #function GetClassInfoExW(Instance: HINST; Classname: LPWSTR; var WndClass: TWndClassExW): WINBOOL; stdcall; external 'user32' name 'GetClassInfoExW';
+  #function GetClassInfoW(hInstance: HINST; lpClassName: LPWSTR; var lpWndClass: TWndClassW): WINBOOL; stdcall; external 'user32' name 'GetClassInfoW';
+proc GetClientRect*(hWnd: HWND, lpRect: var TRect): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetClientRect".}
+proc GetClipBox*(DC: HDC, Rect: var TRect): int{.stdcall, dynlib: "gdi32",
+    importc: "GetClipBox".}
+proc GetClipCursor*(lpRect: var TRect): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetClipCursor".}
+proc GetColorAdjustment*(DC: HDC, p2: var TColorAdjustment): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetColorAdjustment".}
+proc GetCommConfig*(hCommDev: THandle, lpCC: var TCommConfig,
+                    lpdwSize: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "GetCommConfig".}
+proc GetCommMask*(hFile: THandle, lpEvtMask: var DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetCommMask".}
+proc GetCommModemStatus*(hFile: THandle, lpModemStat: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetCommModemStatus".}
+proc GetCommProperties*(hFile: THandle, lpCommProp: var TCommProp): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetCommProperties".}
+proc GetCommState*(hFile: THandle, lpDCB: var TDCB): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetCommState".}
+proc GetCommTimeouts*(hFile: THandle, lpCommTimeouts: var TCommTimeouts): 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: THandle,
+                           lpConsoleCursorInfo: var TConsoleCursorInfo): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetConsoleCursorInfo".}
+proc GetConsoleMode*(hConsoleHandle: THandle, lpMode: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetConsoleMode".}
+proc GetConsoleScreenBufferInfo*(hConsoleOutput: THandle,
+    lpConsoleScreenBufferInfo: var TConsoleScreenBufferInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetConsoleScreenBufferInfo".}
+proc GetCPInfo*(CodePage: UINT, lpCPInfo: var TCPInfo): 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 TCursorInfo): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetCursorInfo".}
+proc GetCursorPos*(lpPoint: var TPoint): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "GetCursorPos".}
+proc GetDCOrgEx*(DC: HDC, Origin: var TPoint): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetDCOrgEx".}
+proc GetDefaultCommConfig*(lpszName: cstring, lpCC: var TCommConfig,
+                           lpdwSize: var DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetDefaultCommConfigA".}
+proc GetDefaultCommConfigA*(lpszName: LPCSTR, lpCC: var TCommConfig,
+                            lpdwSize: var DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetDefaultCommConfigA".}
+proc GetDefaultCommConfigW*(lpszName: LPWSTR, lpCC: var TCommConfig,
+                            lpdwSize: var DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetDefaultCommConfigW".}
+proc GetDIBColorTable*(DC: HDC, p2, p3: UINT, RGBQuadStructs: pointer): UINT{.
+    stdcall, dynlib: "gdi32", importc: "GetDIBColorTable".}
+proc GetDIBits*(DC: HDC, Bitmap: HBitmap, StartScan, NumScans: UINT,
+                Bits: Pointer, BitInfo: var TBitmapInfo, Usage: UINT): 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 TLargeInteger,
+                         lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}
+proc GetDiskFreeSpaceExA*(lpDirectoryName: LPCSTR, lpFreeBytesAvailableToCaller,
+    lpTotalNumberOfBytes: var TLargeInteger,
+                          lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}
+proc GetDiskFreeSpaceExW*(lpDirectoryName: LPWSTR, lpFreeBytesAvailableToCaller,
+    lpTotalNumberOfBytes: var TLargeInteger,
+                          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: TPixelFormatDescriptor): UINT;stdcall; external 'gdi32' name 'GetEnhMetaFilePixelFormat';
+proc GetExitCodeProcess*(hProcess: THandle, lpExitCode: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".}
+proc GetExitCodeThread*(hThread: THandle, lpExitCode: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetExitCodeThread".}
+proc GetFileInformationByHandle*(hFile: THandle, lpFileInformation: var TByHandleFileInformation): 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: UINT, p4: TGlyphMetrics, p5: DWORD,
+                      p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",
+    importc: "GetGlyphOutlineA".}
+proc GetGlyphOutlineA*(DC: HDC, p2, p3: UINT, p4: TGlyphMetrics, p5: DWORD,
+                       p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",
+    importc: "GetGlyphOutlineA".}
+proc GetGlyphOutlineW*(DC: HDC, p2, p3: UINT, p4: TGlyphMetrics, p5: DWORD,
+                       p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",
+    importc: "GetGlyphOutlineW".}
+  #function GetGUIThreadInfo(idThread: DWORD; var pgui: TGUIThreadinfo): WINBOOL;stdcall; external 'user32' name 'GetGUIThreadInfo';
+proc GetHandleInformation*(hObject: THandle, 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*(hIcon: HICON, piconinfo: var TIconInfo): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetIconInfo".}
+  #function GetKernelObjectSecurity(Handle: THandle; 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): UINT{.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 TLogColorSpace,
+                       Size: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetLogColorSpaceA".}
+proc GetLogColorSpaceA*(p1: HCOLORSPACE, ColorSpace: var TLogColorSpaceA,
+                        Size: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetLogColorSpaceA".}
+  #function GetLogColorSpaceW(p1: HCOLORSPACE; var ColorSpace: TLogColorSpaceW; Size: DWORD): WINBOOL; stdcall; external 'gdi32' name 'GetLogColorSpaceW';
+proc GetMailslotInfo*(hMailslot: THandle, 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(hMenu: HMENU; var lpmi: TMenuInfo): WINBOOL;stdcall; external 'user32' name 'GetMenuInfo';
+proc GetMenuItemInfo*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: var TMenuItemInfo): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetMenuItemInfoA".}
+proc GetMenuItemInfoA*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: var TMenuItemInfoA): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetMenuItemInfoA".}
+  #function GetMenuItemInfoW(p1: HMENU; p2: UINT; p3: WINBOOL; var p4: TMenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'GetMenuItemInfoW';
+proc GetMenuItemRect*(hWnd: HWND, hMenu: HMENU, uItem: UINT, lprcItem: var TRect): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetMenuItemRect".}
+proc GetMessage*(lpMsg: var TMsg, hWnd: HWND, wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetMessageA".}
+proc GetMessageA*(lpMsg: var TMsg, hWnd: HWND,
+                  wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetMessageA".}
+proc GetMessageW*(lpMsg: var TMsg, hWnd: HWND,
+                  wMsgFilterMin, wMsgFilterMax: UINT): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetMessageW".}
+proc GetMiterLimit*(DC: HDC, Limit: var float32): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetMiterLimit".}
+  #function GetMouseMovePoints(cbSize: UINT; var lppt, lpptBuf: TMouseMovePoint; nBufPoints: Integer; resolution: DWORD): Integer;stdcall; external 'user32' name 'GetMouseMovePoints';
+proc GetNamedPipeInfo*(hNamedPipe: THandle, lpFlags: var DWORD,
+                       lpOutBufferSize, lpInBufferSize, lpMaxInstances: Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetNamedPipeInfo".}
+proc GetNumberOfConsoleInputEvents*(hConsoleInput: THandle,
+                                    lpNumberOfEvents: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetNumberOfConsoleInputEvents".}
+proc GetNumberOfConsoleMouseButtons*(lpNumberOfMouseButtons: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetNumberOfConsoleMouseButtons".}
+  #function GetNumberOfEventLogRecords(hEventLog: THandle; var NumberOfRecords: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetNumberOfEventLogRecords';
+  #function GetOldestEventLogRecord(hEventLog: THandle; var OldestRecord: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetOldestEventLogRecord';
+proc GetOverlappedResult*(hFile: THandle, lpOverlapped: TOverlapped,
+                          lpNumberOfBytesTransferred: var DWORD, bWait: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetOverlappedResult".}
+proc GetPaletteEntries*(Palette: HPALETTE, StartIndex, NumEntries: UINT,
+                        PaletteEntries: pointer): UINT{.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: UINT, szFile: LPCSTR): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructA".}
+proc GetPrivateProfileStructW*(lpszSection, lpszKey: LPCWSTR, lpStruct: LPVOID,
+                               uSizeStruct: UINT, szFile: LPCWSTR): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructW".}
+proc GetPrivateProfileStruct*(lpszSection, lpszKey: LPCTSTR, lpStruct: LPVOID,
+                              uSizeStruct: UINT, szFile: LPCTSTR): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStructA".}
+proc GetProcessAffinityMask*(hProcess: THandle, lpProcessAffinityMask,
+    lpSystemAffinityMask: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "GetProcessAffinityMask".}
+proc GetProcessHeaps*(NumberOfHeaps: DWORD, ProcessHeaps: var THandle): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "GetProcessHeaps".}
+proc GetProcessPriorityBoost*(hThread: THandle,
+                              DisablePriorityBoost: var WINBOOL): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetProcessPriorityBoost".}
+proc GetProcessShutdownParameters*(lpdwLevel, lpdwFlags: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetProcessShutdownParameters".}
+proc GetProcessTimes*(hProcess: THandle, lpCreationTime, lpExitTime,
+    lpKernelTime, lpUserTime: var TFileTime): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetProcessTimes".}
+proc GetProcessWorkingSetSize*(hProcess: THandle, lpMinimumWorkingSetSize,
+    lpMaximumWorkingSetSize: var DWORD): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "GetProcessWorkingSetSize".}
+proc GetQueuedCompletionStatus*(CompletionPort: THandle,
+    lpNumberOfBytesTransferred, lpCompletionKey: var DWORD,
+                                lpOverlapped: var POverlapped,
+                                dwMilliseconds: DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetQueuedCompletionStatus".}
+proc GetRasterizerCaps*(p1: var TRasterizerStatus, p2: UINT): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetRasterizerCaps".}
+proc GetRgnBox*(RGN: HRGN, p2: var TRect): int{.stdcall, dynlib: "gdi32",
+    importc: "GetRgnBox".}
+proc GetScrollInfo*(hWnd: HWND, BarFlag: int, ScrollInfo: var TScrollInfo): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetScrollInfo".}
+proc GetScrollRange*(hWnd: 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 TSTARTUPINFO){.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: UINT,
+                              PaletteEntries: pointer): UINT{.stdcall,
+    dynlib: "gdi32", importc: "GetSystemPaletteEntries".}
+proc GetSystemPowerStatus*(lpSystemPowerStatus: var TSystemPowerStatus): 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 TFILETIME){.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: THandle, dwOperation: DWORD,
+                        lpdwSize: var DWORD, lpTapeInformation: Pointer): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "GetTapeParameters".}
+proc GetTapePosition*(hDevice: THandle, 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 TSize): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetTextExtentExPointA".}
+proc GetTextExtentExPointA*(DC: HDC, p2: LPCSTR, p3, p4: int, p5, p6: PInteger,
+                            p7: var TSize): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetTextExtentExPointA".}
+  #function GetTextExtentExPointI(DC: HDC; p2: PWORD; p3, p4: Integer; p5, p6: PINT; var p7: TSize): WINBOOL;stdcall; external 'gdi32' name 'GetTextExtentExPointI';
+proc GetTextExtentExPointW*(DC: HDC, p2: LPWSTR, p3, p4: int, p5, p6: PInteger,
+                            p7: var TSize): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "GetTextExtentExPointW".}
+proc GetTextExtentPoint*(DC: HDC, Str: cstring, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointA".}
+proc GetTextExtentPoint32*(DC: HDC, Str: cstring, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32A".}
+proc GetTextExtentPoint32A*(DC: HDC, Str: LPCSTR, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32A".}
+proc GetTextExtentPoint32W*(DC: HDC, Str: LPWSTR, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPoint32W".}
+proc GetTextExtentPointA*(DC: HDC, Str: LPCSTR, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointA".}
+  #function GetTextExtentPointI(DC: HDC; p2: PWORD; p3: Integer; var p4: TSize): WINBOOL;stdcall; external 'gdi32' name 'GetTextExtentPointI';
+proc GetTextExtentPointW*(DC: HDC, Str: LPWSTR, Count: int, Size: var TSize): WINBOOL{.
+    stdcall, dynlib: "gdi32", importc: "GetTextExtentPointW".}
+proc GetTextMetrics*(DC: HDC, TM: var TTextMetric): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetTextMetricsA".}
+  #function GetTextMetricsA(DC: HDC; var TM: TTextMetricA): WINBOOL; stdcall; external 'gdi32' name 'GetTextMetricsA';
+  #function GetTextMetricsW(DC: HDC; var TM: TTextMetricW): WINBOOL; stdcall; external 'gdi32' name 'GetTextMetricsW';
+proc GetThreadContext*(hThread: THandle, lpContext: var TContext): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetThreadContext".}
+proc GetThreadPriorityBoost*(hThread: THandle, DisablePriorityBoost: var WINBOOL): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetThreadPriorityBoost".}
+proc GetThreadSelectorEntry*(hThread: THandle, dwSelector: DWORD,
+                             lpSelectorEntry: var TLDTEntry): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetThreadSelectorEntry".}
+proc GetThreadTimes*(hThread: THandle, lpCreationTime, lpExitTime, lpKernelTime,
+                                       lpUserTime: var TFileTime): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetThreadTimes".}
+proc GetTimeZoneInformation*(lpTimeZoneInformation: var TTimeZoneInformation): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "GetTimeZoneInformation".}
+  #function GetTitleBarInfo(hwnd: HWND; var pti: TTitleBarInfo): WINBOOL;stdcall; external 'user32' name 'GetTitleBarInfo';
+  #function GetTokenInformation(TokenHandle: THandle; TokenInformationClass: TTokenInformationClass; TokenInformation: Pointer; TokenInformationLength: DWORD; var ReturnLength: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetTokenInformation';
+proc GetUpdateRect*(hWnd: HWND, lpRect: var TRect, 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: THandle, nIndex: int, pvInfo: Pointer,
+                               nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}
+proc GetUserObjectInformationA*(hObj: THandle, nIndex: int, pvInfo: Pointer,
+                                nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}
+proc GetUserObjectInformationW*(hObj: THandle, nIndex: int, pvInfo: Pointer,
+                                nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".}
+proc GetUserObjectSecurity*(hObj: THandle, pSIRequested: var DWORD,
+                            pSID: PSecurityDescriptor, nLength: DWORD,
+                            lpnLengthNeeded: var DWORD): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetUserObjectSecurity".}
+proc GetVersionEx*(lpVersionInformation: var TOSVersionInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetVersionExA".}
+proc GetVersionExA*(lpVersionInformation: var TOSVersionInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "GetVersionExA".}
+proc GetVersionExW*(lpVersionInformation: var TOSVersionInfoW): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetVersionExW".}
+proc GetViewportExtEx*(DC: HDC, Size: var TSize): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetViewportExtEx".}
+proc GetViewportOrgEx*(DC: HDC, Point: var TPoint): 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 TSize): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetWindowExtEx".}
+  #function GetWindowInfo(hwnd: HWND; var pwi: TWindowInfo): WINBOOL;stdcall; external 'user32' name 'GetWindowInfo';
+proc GetWindowOrgEx*(DC: HDC, Point: var TPoint): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "GetWindowOrgEx".}
+proc GetWindowRect*(hWnd: HWND, lpRect: var TRect): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "GetWindowRect".}
+proc GetWorldTransform*(DC: HDC, p2: var TXForm): 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: THandle, lpEntry: var TProcessHeapEntry): 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 TRect, dx, dy: int): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "InflateRect".}
+proc InitializeAcl*(pAcl: var TACL, nAclLength, dwAclRevision: DWORD): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "InitializeAcl".}
+proc InitializeCriticalSectionAndSpinCount*(
+    lpCriticalSection: var TRTLCriticalSection, dwSpinCount: DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32",
+    importc: "InitializeCriticalSectionAndSpinCount".}
+proc InitializeSid*(Sid: Pointer, pIdentifierAuthority: TSIDIdentifierAuthority,
+                    nSubAuthorityCount: int8): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "InitializeSid".}
+proc InsertMenuItem*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfo): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "InsertMenuItemA".}
+proc InsertMenuItemA*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfoA): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "InsertMenuItemA".}
+  #function InsertMenuItemW(p1: HMENU; p2: UINT; p3: WINBOOL; const p4: TMenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'InsertMenuItemW';
+proc IntersectRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "IntersectRect".}
+  #function InvertRect(hDC: HDC; const lprc: TRect): 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: TRect): WINBOOL; stdcall; external 'user32' name 'IsRectEmpty';
+proc IsValidAcl*(pAcl: TACL): WINBOOL{.stdcall, dynlib: "advapi32",
+                                       importc: "IsValidAcl".}
+proc LocalFileTimeToFileTime*(lpLocalFileTime: TFileTime,
+                              lpFileTime: var TFileTime): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "LocalFileTimeToFileTime".}
+proc LockFileEx*(hFile: THandle, dwFlags, dwReserved: DWORD,
+                 nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD,
+                 lpOverlapped: TOverlapped): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "LockFileEx".}
+proc LogonUser*(lpszUsername, lpszDomain, lpszPassword: cstring,
+                dwLogonType, dwLogonProvider: DWORD, phToken: var THandle): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "LogonUserA".}
+proc LogonUserA*(lpszUsername, lpszDomain, lpszPassword: LPCSTR,
+                 dwLogonType, dwLogonProvider: DWORD, phToken: var THandle): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "LogonUserA".}
+proc LogonUserW*(lpszUsername, lpszDomain, lpszPassword: LPWSTR,
+                 dwLogonType, dwLogonProvider: DWORD, phToken: var THandle): 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 TLargeInteger,
+                          lpName: cstring, cbName: var DWORD): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "LookupPrivilegeNameA".}
+proc LookupPrivilegeNameA*(lpSystemName: LPCSTR, lpLuid: var TLargeInteger,
+                           lpName: LPCSTR, cbName: var DWORD): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "LookupPrivilegeNameA".}
+proc LookupPrivilegeNameW*(lpSystemName: LPWSTR, lpLuid: var TLargeInteger,
+                           lpName: LPWSTR, cbName: var DWORD): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "LookupPrivilegeNameW".}
+proc LookupPrivilegeValue*(lpSystemName, lpName: cstring,
+                           lpLuid: var TLargeInteger): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "LookupPrivilegeValueA".}
+proc LookupPrivilegeValueA*(lpSystemName, lpName: LPCSTR,
+                            lpLuid: var TLargeInteger): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "LookupPrivilegeValueA".}
+proc LookupPrivilegeValueW*(lpSystemName, lpName: LPWSTR,
+                            lpLuid: var TLargeInteger): 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 TACL, lpdwDaclSize: var DWORD, pSacl: var TACL,
+                     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 TRect): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "MapDialogRect".}
+proc MapWindowPoints*(hWndFrom, hWndTo: HWND, lpPoints: pointer, cPoints: UINT): int{.
+    stdcall, dynlib: "user32", importc: "MapWindowPoints".}
+proc MessageBoxIndirect*(MsgBoxParams: TMsgBoxParams): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "MessageBoxIndirectA".}
+proc MessageBoxIndirectA*(MsgBoxParams: TMsgBoxParamsA): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "MessageBoxIndirectA".}
+  #function MessageBoxIndirectW(const MsgBoxParams: TMsgBoxParamsW): WINBOOL; stdcall; external 'user32' name 'MessageBoxIndirectW';
+  #function ModifyWorldTransform(DC: HDC; const p2: TXForm; 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: UINT; 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: THandle,
+                           DesiredAccess, GrantedAccess: DWORD,
+                           Privileges: var TPrivilegeSet,
+                           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: THandle,
+                            DesiredAccess, GrantedAccess: DWORD,
+                            Privileges: var TPrivilegeSet,
+                            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: THandle,
+                            DesiredAccess, GrantedAccess: DWORD,
+                            Privileges: var TPrivilegeSet,
+                            ObjectCreation, AccessGranted: WINBOOL,
+                            GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "ObjectOpenAuditAlarmW".}
+proc ObjectPrivilegeAuditAlarm*(SubsystemName: cstring, HandleId: Pointer,
+                                ClientToken: THandle, DesiredAccess: DWORD,
+                                Privileges: var TPrivilegeSet,
+                                AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}
+proc ObjectPrivilegeAuditAlarmA*(SubsystemName: LPCSTR, HandleId: Pointer,
+                                 ClientToken: THandle, DesiredAccess: DWORD,
+                                 Privileges: var TPrivilegeSet,
+                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}
+proc ObjectPrivilegeAuditAlarmW*(SubsystemName: LPWSTR, HandleId: Pointer,
+                                 ClientToken: THandle, DesiredAccess: DWORD,
+                                 Privileges: var TPrivilegeSet,
+                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmW".}
+proc OffsetRect*(lprc: var TRect, 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 TOFStruct, uStyle: UINT): HFILE{.
+    stdcall, dynlib: "kernel32", importc: "OpenFile".}
+proc OpenProcessToken*(ProcessHandle: THandle, DesiredAccess: DWORD,
+                       TokenHandle: var THandle): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "OpenProcessToken".}
+proc OpenThreadToken*(ThreadHandle: THandle, DesiredAccess: DWORD,
+                      OpenAsSelf: WINBOOL, TokenHandle: var THandle): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "OpenThreadToken".}
+proc PeekConsoleInput*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                       nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}
+proc PeekConsoleInputA*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputA".}
+proc PeekConsoleInputW*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "PeekConsoleInputW".}
+proc PeekMessage*(lpMsg: var TMsg, hWnd: HWND,
+                  wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "PeekMessageA".}
+proc PeekMessageA*(lpMsg: var TMsg, hWnd: HWND,
+                   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "PeekMessageA".}
+proc PeekMessageW*(lpMsg: var TMsg, hWnd: HWND,
+                   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "PeekMessageW".}
+  #function PlayEnhMetaFile(DC: HDC; p2: HENHMETAFILE; const p3: TRect): WINBOOL; stdcall; external 'gdi32' name 'PlayEnhMetaFile';
+proc PlayEnhMetaFileRecord*(DC: HDC, p2: var THandleTable, p3: TEnhMetaRecord,
+                            p4: UINT): WINBOOL{.stdcall, dynlib: "gdi32",
+    importc: "PlayEnhMetaFileRecord".}
+proc PlayMetaFileRecord*(DC: HDC, p2: THandleTable, p3: TMetaRecord, p4: UINT): 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: THandle, RequiredPrivileges: TPrivilegeSet,
+                     pfResult: var WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "PrivilegeCheck".}
+proc PrivilegedServiceAuditAlarm*(SubsystemName, ServiceName: cstring,
+                                  ClientToken: THandle,
+                                  Privileges: var TPrivilegeSet,
+                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}
+proc PrivilegedServiceAuditAlarmA*(SubsystemName, ServiceName: LPCSTR,
+                                   ClientToken: THandle,
+                                   Privileges: var TPrivilegeSet,
+                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmA".}
+proc PrivilegedServiceAuditAlarmW*(SubsystemName, ServiceName: LPWSTR,
+                                   ClientToken: THandle,
+                                   Privileges: var TPrivilegeSet,
+                                   AccessGranted: WINBOOL): WINBOOL{.stdcall,
+    dynlib: "advapi32", importc: "PrivilegedServiceAuditAlarmW".}
+  #function PtInRect(const lprc: TRect; pt: TPoint): WINBOOL; stdcall; external 'user32' name 'PtInRect';
+proc QueryPerformanceCounter*(lpPerformanceCount: var TLargeInteger): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "QueryPerformanceCounter".}
+proc QueryPerformanceFrequency*(lpFrequency: var TLargeInteger): 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: THandle, lpBuffer: Pointer,
+                  nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,
+                  lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "ReadConsoleA".}
+proc ReadConsoleA*(hConsoleInput: THandle, lpBuffer: Pointer,
+                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,
+                   lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "ReadConsoleA".}
+proc ReadConsoleInput*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                       nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}
+proc ReadConsoleInputA*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputA".}
+proc ReadConsoleInputW*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
+                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}
+proc ReadConsoleOutput*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                        dwBufferSize, dwBufferCoord: TCoord,
+                        lpReadRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ReadConsoleOutputA".}
+proc ReadConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                         dwBufferSize, dwBufferCoord: TCoord,
+                         lpReadRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ReadConsoleOutputA".}
+proc ReadConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: Pointer,
+                                 nLength: DWORD, dwReadCoord: TCoord,
+                                 lpNumberOfAttrsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputAttribute".}
+proc ReadConsoleOutputCharacter*(hConsoleOutput: THandle, lpCharacter: LPCSTR,
+                                 nLength: DWORD, dwReadCoord: TCoord,
+                                 lpNumberOfCharsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}
+proc ReadConsoleOutputCharacterA*(hConsoleOutput: THandle, lpCharacter: LPCSTR,
+                                  nLength: DWORD, dwReadCoord: TCoord,
+                                  lpNumberOfCharsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterA".}
+proc ReadConsoleOutputCharacterW*(hConsoleOutput: THandle, lpCharacter: LPCSTR,
+                                  nLength: DWORD, dwReadCoord: TCoord,
+                                  lpNumberOfCharsRead: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".}
+proc ReadConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                         dwBufferSize, dwBufferCoord: TCoord,
+                         lpReadRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ReadConsoleOutputW".}
+proc ReadConsoleW*(hConsoleInput: THandle, lpBuffer: Pointer,
+                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,
+                   lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",
+    importc: "ReadConsoleW".}
+proc ReadEventLog*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,
+                   lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,
+                   pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}
+proc ReadEventLogA*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,
+                    lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,
+                    pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}
+proc ReadEventLogW*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,
+                    lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,
+                    pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.
+    stdcall, dynlib: "advapi32", importc: "ReadEventLogW".}
+proc ReadFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: DWORD,
+               lpNumberOfBytesRead: var DWORD, lpOverlapped: POverlapped): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "ReadFile".}
+proc ReadProcessMemory*(hProcess: THandle, lpBaseAddress: Pointer,
+                        lpBuffer: Pointer, nSize: DWORD,
+                        lpNumberOfBytesRead: var DWORD): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ReadProcessMemory".}
+  #function RectInRegion(RGN: HRGN; const p2: TRect): WINBOOL; stdcall; external 'gdi32' name 'RectInRegion';
+  #function RectVisible(DC: HDC; const Rect: TRect): WINBOOL; stdcall; external 'gdi32' name 'RectVisible';
+proc RegConnectRegistry*(lpMachineName: cstring, hKey: HKEY, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}
+proc RegConnectRegistryA*(lpMachineName: LPCSTR, hKey: HKEY, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryA".}
+proc RegConnectRegistryW*(lpMachineName: LPWSTR, hKey: HKEY, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegConnectRegistryW".}
+proc RegCreateKey*(hKey: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}
+proc RegCreateKeyA*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegCreateKeyA".}
+proc RegCreateKeyEx*(hKey: 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*(hKey: 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*(hKey: 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*(hKey: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}
+proc RegEnumKeyEx*(hKey: HKEY, dwIndex: DWORD, lpName: cstring,
+                   lpcbName: var DWORD, lpReserved: Pointer, lpClass: cstring,
+                   lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}
+proc RegEnumKeyExA*(hKey: HKEY, dwIndex: DWORD, lpName: LPCSTR,
+                    lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPCSTR,
+                    lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}
+proc RegEnumKeyExW*(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR,
+                    lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPWSTR,
+                    lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}
+proc RegEnumValue*(hKey: HKEY, dwIndex: DWORD, lpValueName: cstring,
+                   lpcbValueName: var DWORD, lpReserved: Pointer,
+                   lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}
+proc RegEnumValueA*(hKey: HKEY, dwIndex: DWORD, lpValueName: cstring,
+                    lpcbValueName: var DWORD, lpReserved: Pointer,
+                    lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}
+proc RegEnumValueW*(hKey: HKEY, dwIndex: DWORD, lpValueName: cstring,
+                    lpcbValueName: var DWORD, lpReserved: Pointer,
+                    lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}
+proc RegGetKeySecurity*(hKey: HKEY, SecurityInformation: SECURITY_INFORMATION,
+                        pSecurityDescriptor: PSecurityDescriptor,
+                        lpcbSecurityDescriptor: var DWORD): int32{.stdcall,
+    dynlib: "advapi32", importc: "RegGetKeySecurity".}
+proc RegSetValueEx*(hKey: HKEY, lpValueName: LPCSTR, Reserved: DWORD,
+                    dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}
+proc RegSetValueExA*(hKey: HKEY, lpValueName: LPCSTR, Reserved: DWORD,
+                     dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetValueExA".}
+proc RegSetValueExW*(hKey: HKEY, lpValueName: LPCWSTR, Reserved: DWORD,
+                     dwType: DWORD, lpData: pointer, cbData: DWORD): LONG{.
+    stdcall, dynlib: "advapi32", importc: "RegSetValueExW".}
+proc RegisterClass*(lpWndClass: TWndClass): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassA".}
+proc RegisterClassA*(lpWndClass: TWndClassA): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassA".}
+proc RegisterClassEx*(WndClass: TWndClassEx): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassExA".}
+proc RegisterClassExA*(WndClass: TWndClassExA): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassExA".}
+proc RegisterClassExW*(WndClass: TWndClassExW): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassExW".}
+proc RegisterClassW*(lpWndClass: TWndClassW): ATOM{.stdcall, dynlib: "user32",
+    importc: "RegisterClassW".}
+proc RegOpenKey*(hKey: HKEY, lpSubKey: cstring, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}
+proc RegOpenKeyA*(hKey: HKEY, lpSubKey: LPCSTR, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegOpenKeyA".}
+proc RegOpenKeyEx*(hKey: HKEY, lpSubKey: cstring, ulOptions: DWORD,
+                   samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,
+    dynlib: "advapi32", importc: "RegOpenKeyExA".}
+proc RegOpenKeyExA*(hKey: HKEY, lpSubKey: LPCSTR, ulOptions: DWORD,
+                    samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,
+    dynlib: "advapi32", importc: "RegOpenKeyExA".}
+proc RegOpenKeyExW*(hKey: HKEY, lpSubKey: LPWSTR, ulOptions: DWORD,
+                    samDesired: REGSAM, phkResult: var HKEY): int32{.stdcall,
+    dynlib: "advapi32", importc: "RegOpenKeyExW".}
+proc RegOpenKeyW*(hKey: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegOpenKeyW".}
+proc RegQueryMultipleValues*(hKey: HKEY, ValList: pointer, NumVals: DWORD,
+                             lpValueBuf: cstring, ldwTotsize: var DWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}
+proc RegQueryMultipleValuesA*(hKey: HKEY, ValList: pointer, NumVals: DWORD,
+                              lpValueBuf: LPCSTR, ldwTotsize: var DWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesA".}
+proc RegQueryMultipleValuesW*(hKey: HKEY, ValList: pointer, NumVals: DWORD,
+                              lpValueBuf: LPWSTR, ldwTotsize: var DWORD): int32{.
+    stdcall, dynlib: "advapi32", importc: "RegQueryMultipleValuesW".}
+proc RegQueryValue*(hKey: HKEY, lpSubKey: cstring, lpValue: cstring,
+                    lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",
+    importc: "RegQueryValueA".}
+proc RegQueryValueA*(hKey: HKEY, lpSubKey: LPCSTR, lpValue: LPCSTR,
+                     lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",
+    importc: "RegQueryValueA".}
+proc RegQueryValueW*(hKey: HKEY, lpSubKey: LPWSTR, lpValue: LPWSTR,
+                     lpcbValue: var int32): int32{.stdcall, dynlib: "advapi32",
+    importc: "RegQueryValueW".}
+proc ResetDC*(DC: HDC, p2: TDeviceMode): HDC{.stdcall, dynlib: "gdi32",
+    importc: "ResetDCA".}
+proc ResetDCA*(DC: HDC, p2: TDeviceModeA): HDC{.stdcall, dynlib: "gdi32",
+    importc: "ResetDCA".}
+  #function ResetDCW(DC: HDC; const p2: TDeviceModeW): HDC; stdcall; external 'gdi32' name 'ResetDCW';
+proc ScreenToClient*(hWnd: HWND, lpPoint: var TPoint): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "ScreenToClient".}
+proc ScrollConsoleScreenBuffer*(hConsoleOutput: THandle,
+                                lpScrollRectangle: TSmallRect,
+                                lpClipRectangle: TSmallRect,
+                                dwDestinationOrigin: TCoord,
+                                lpFill: var TCharInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}
+proc ScrollConsoleScreenBufferA*(hConsoleOutput: THandle,
+                                 lpScrollRectangle: TSmallRect,
+                                 lpClipRectangle: TSmallRect,
+                                 dwDestinationOrigin: TCoord,
+                                 lpFill: var TCharInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferA".}
+proc ScrollConsoleScreenBufferW*(hConsoleOutput: THandle,
+                                 lpScrollRectangle: TSmallRect,
+                                 lpClipRectangle: TSmallRect,
+                                 dwDestinationOrigin: TCoord,
+                                 lpFill: var TCharInfo): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".}
+proc ScrollWindow*(hWnd: HWND, XAmount: int32, YAmount: int32, lpRect: lpRECT,
+                   lpClipRect: lpRECT): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "ScrollWindow".}
+proc ScrollWindowEx*(hWnd: HWND, dx: int32, dy: int32, prcScroll: lpRECT,
+                     prcClip: lpRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,
+                     flags: UINT): int32{.stdcall, dynlib: "user32",
+    importc: "ScrollWindowEx".}
+  #function ScrollDC(DC: HDC; DX, DY: Integer; var Scroll, Clip: TRect; 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: UINT; var pInputs: TInput; cbSize: Integer): UINT;stdcall; external 'user32' name 'SendInput';
+proc SendMessageTimeout*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM,
+                         fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}
+proc SendMessageTimeoutA*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM,
+                          fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageTimeoutA".}
+proc SendMessageTimeoutW*(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM,
+                          fuFlags, uTimeout: UINT, lpdwResult: var DWORD): LRESULT{.
+    stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".}
+  #function SetAclInformation(var pAcl: TACL; pAclInformation: Pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'SetAclInformation';
+  #function SetColorAdjustment(DC: HDC; const p2: TColorAdjustment): WINBOOL; stdcall; external 'gdi32' name 'SetColorAdjustment';
+proc SetCommConfig*(hCommDev: THandle, lpCC: TCommConfig, dwSize: DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "SetCommConfig".}
+proc SetCommState*(hFile: THandle, lpDCB: TDCB): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "SetCommState".}
+proc SetCommTimeouts*(hFile: THandle, lpCommTimeouts: TCommTimeouts): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "SetCommTimeouts".}
+proc SetConsoleCursorInfo*(hConsoleOutput: THandle,
+                           lpConsoleCursorInfo: TConsoleCursorInfo): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "SetConsoleCursorInfo".}
+  #function SetConsoleWindowInfo(hConsoleOutput: THandle; bAbsolute: WINBOOL; const lpConsoleWindow: TSmallRect): WINBOOL; stdcall; external 'kernel32' name 'SetConsoleWindowInfo';
+proc SetCriticalSectionSpinCount*(lpCriticalSection: var TRTLCriticalSection,
+                                  dwSpinCount: DWORD): DWORD{.stdcall,
+    dynlib: "kernel32", importc: "SetCriticalSectionSpinCount".}
+proc SetDeviceGammaRamp*(DC: HDC, Ramp: pointer): WINBOOL{.stdcall,
+    dynlib: "gdi32", importc: "SetDeviceGammaRamp".}
+proc SetDIBColorTable*(DC: HDC, p2, p3: UINT, RGBQuadSTructs: pointer): UINT{.
+    stdcall, dynlib: "gdi32", importc: "SetDIBColorTable".}
+proc SetDIBits*(DC: HDC, Bitmap: HBITMAP, StartScan, NumScans: UINT,
+                Bits: Pointer, BitsInfo: var TBitmapInfo, Usage: UINT): int{.
+    stdcall, dynlib: "gdi32", importc: "SetDIBits".}
+  #function SetDIBitsToDevice(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD; SrcX, SrcY: Integer; nStartScan, NumScans: UINT; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall; external 'gdi32' name 'SetDIBitsToDevice';
+proc SetEnhMetaFileBits*(para1: UINT, 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: TSystemTime): WINBOOL; stdcall; external 'kernel32' name 'SetLocalTime';
+  #function SetMenuInfo(hMenu: HMENU; const lpcmi: TMenuInfo): WINBOOL;stdcall; external 'user32' name 'SetMenuInfo';
+proc SetMenuItemInfo*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfo): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetMenuItemInfoA".}
+proc SetMenuItemInfoA*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfoA): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetMenuItemInfoA".}
+  #function SetMenuItemInfoW(p1: HMENU; p2: UINT; p3: WINBOOL; const p4: TMenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'SetMenuItemInfoW';
+proc SetMetaFileBitsEx*(p1: UINT, p2: cstring): HMETAFILE{.stdcall,
+    dynlib: "gdi32", importc: "SetMetaFileBitsEx".}
+proc SetNamedPipeHandleState*(hNamedPipe: THandle, lpMode: var DWORD,
+    lpMaxCollectionCount, lpCollectDataTimeout: Pointer): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "SetNamedPipeHandleState".}
+proc SetPaletteEntries*(Palette: HPALETTE, StartIndex, NumEntries: UINT,
+                        PaletteEntries: pointer): UINT{.stdcall,
+    dynlib: "gdi32", importc: "SetPaletteEntries".}
+  #function SetPrivateObjectSecurity(SecurityInformation: SECURITY_INFORMATION; ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor; const GenericMapping: TGenericMapping; Token: THandle): WINBOOL;
+  #  stdcall; external 'advapi32' name 'SetPrivateObjectSecurity';
+  #function SetPrivateObjectSecurityEx(SecurityInformation: SECURITY_INFORMATION; ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor; AutoInheritFlags: ULONG;
+  #  const GenericMapping: TGenericMapping; Token: THandle): WINBOOL;stdcall; external 'advapi32' name 'SetPrivateObjectSecurityEx';
+proc SetRect*(lprc: var TRect, xLeft, yTop, xRight, yBottom: int): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SetRect".}
+proc SetRectEmpty*(lprc: var TRect): WINBOOL{.stdcall, dynlib: "user32",
+    importc: "SetRectEmpty".}
+proc SetScrollInfo*(hWnd: HWND, BarFlag: int, ScrollInfo: TScrollInfo,
+                    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: TSystemTime): WINBOOL; stdcall; external 'kernel32' name 'SetSystemTime';
+proc SetThreadContext*(hThread: THandle, lpContext: TContext): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "SetThreadContext".}
+  #function SetTimeZoneInformation(const lpTimeZoneInformation: TTimeZoneInformation): WINBOOL; stdcall; external 'kernel32' name 'SetTimeZoneInformation';
+proc SetUserObjectSecurity*(hObj: THandle, pSIRequested: var DWORD,
+                            pSID: PSecurityDescriptor): WINBOOL{.stdcall,
+    dynlib: "user32", importc: "SetUserObjectSecurity".}
+proc SetWaitableTimer*(hTimer: THandle, lpDueTime: var TLargeInteger,
+                       lPeriod: int32, pfnCompletionRoutine: TFNTimerAPCRoutine,
+                       lpArgToCompletionRoutine: Pointer, fResume: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "SetWaitableTimer".}
+proc SetWinMetaFileBits*(p1: UINT, p2: cstring, p3: HDC, p4: TMetaFilePict): HENHMETAFILE{.
+    stdcall, dynlib: "gdi32", importc: "SetWinMetaFileBits".}
+  #function SetWorldTransform(DC: HDC; const p2: TXForm): WINBOOL; stdcall; external 'gdi32' name 'SetWorldTransform';
+proc StartDoc*(DC: HDC, p2: TDocInfo): int{.stdcall, dynlib: "gdi32",
+    importc: "StartDocA".}
+proc StartDocA*(DC: HDC, p2: TDocInfoA): int{.stdcall, dynlib: "gdi32",
+    importc: "StartDocA".}
+  #function StartDocW(DC: HDC; const p2: TDocInfoW): Integer; stdcall; external 'gdi32' name 'StartDocW';
+  #function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX, SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT; Rop: DWORD): Integer; stdcall; external 'gdi32' name 'StretchDIBits';
+proc SubtractRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "SubtractRect".}
+proc SystemTimeToFileTime*(lpSystemTime: TSystemTime, lpFileTime: var TFileTime): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "SystemTimeToFileTime".}
+proc SystemTimeToTzSpecificLocalTime*(lpTimeZoneInformation: PTimeZoneInformation,
+    lpUniversalTime, lpLocalTime: var TSystemTime): 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: UINT; const KeyState: TKeyboardState; lpChar: PChar; uFlags: UINT): Integer; stdcall; external 'user32' name 'ToAscii';
+  #function ToAsciiEx(uVirtKey: UINT; uScanCode: UINT; const KeyState: TKeyboardState; lpChar: PChar; uFlags: UINT; dwhkl: HKL): Integer; stdcall; external 'user32' name 'ToAsciiEx';
+  #function ToUnicode(wVirtKey, wScanCode: UINT; const KeyState: TKeyboardState; var pwszBuff; cchBuff: Integer; wFlags: UINT): 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*(hMenu: HMENU, uFlags: UINT, x: int32, y: int32,
+                     nReserved: int32, hWnd: HWND, prcRect: PRect): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "TrackPopupMenu".}
+proc TransactNamedPipe*(hNamedPipe: THandle, lpInBuffer: Pointer,
+                        nInBufferSize: DWORD, lpOutBuffer: Pointer,
+                        nOutBufferSize: DWORD, lpBytesRead: var DWORD,
+                        lpOverlapped: POverlapped): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "TransactNamedPipe".}
+proc TranslateAccelerator*(hWnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.
+    stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}
+proc TranslateAcceleratorA*(hWnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.
+    stdcall, dynlib: "user32", importc: "TranslateAcceleratorA".}
+proc TranslateAcceleratorW*(hWnd: HWND, hAccTable: HACCEL, lpMsg: var TMsg): int{.
+    stdcall, dynlib: "user32", importc: "TranslateAcceleratorW".}
+proc TranslateCharsetInfo*(lpSrc: var DWORD, lpCs: var TCharsetInfo,
+                           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: UINT; p9, p10, p11, p12: Integer; p13: UINT): WINBOOL;stdcall; external 'gdi32' name 'TransparentDIBits';
+proc TryEnterCriticalSection*(lpCriticalSection: var TRTLCriticalSection): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "TryEnterCriticalSection".}
+proc UnhandledExceptionFilter*(ExceptionInfo: TExceptionPointers): int32{.
+    stdcall, dynlib: "kernel32", importc: "UnhandledExceptionFilter".}
+proc UnionRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.
+    stdcall, dynlib: "user32", importc: "UnionRect".}
+proc UnlockFileEx*(hFile: THandle, dwReserved, nNumberOfBytesToUnlockLow: DWORD,
+                   nNumberOfBytesToUnlockHigh: DWORD, lpOverlapped: TOverlapped): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "UnlockFileEx".}
+proc VerFindFile*(uFlags: DWORD,
+                  szFileName, szWinDir, szAppDir, szCurDir: cstring,
+                  lpuCurDirLen: var UINT, szDestDir: cstring,
+                  lpuDestDirLen: var UINT): DWORD{.stdcall, dynlib: "version",
+    importc: "VerFindFileA".}
+proc VerFindFileA*(uFlags: DWORD,
+                   szFileName, szWinDir, szAppDir, szCurDir: LPCSTR,
+                   lpuCurDirLen: var UINT, szDestDir: LPCSTR,
+                   lpuDestDirLen: var UINT): DWORD{.stdcall, dynlib: "version",
+    importc: "VerFindFileA".}
+proc VerFindFileW*(uFlags: DWORD,
+                   szFileName, szWinDir, szAppDir, szCurDir: LPWSTR,
+                   lpuCurDirLen: var UINT, szDestDir: LPWSTR,
+                   lpuDestDirLen: var UINT): DWORD{.stdcall, dynlib: "version",
+    importc: "VerFindFileW".}
+proc VerInstallFile*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,
+                                    szDestDir, szCurDir, szTmpFile: cstring,
+                     lpuTmpFileLen: var UINT): DWORD{.stdcall,
+    dynlib: "version", importc: "VerInstallFileA".}
+proc VerInstallFileA*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,
+                                     szDestDir, szCurDir, szTmpFile: LPCSTR,
+                      lpuTmpFileLen: var UINT): DWORD{.stdcall,
+    dynlib: "version", importc: "VerInstallFileA".}
+proc VerInstallFileW*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,
+                                     szDestDir, szCurDir, szTmpFile: LPWSTR,
+                      lpuTmpFileLen: var UINT): DWORD{.stdcall,
+    dynlib: "version", importc: "VerInstallFileW".}
+proc VerQueryValue*(pBlock: Pointer, lpSubBlock: cstring,
+                    lplpBuffer: var Pointer, puLen: var UINT): WINBOOL{.stdcall,
+    dynlib: "version", importc: "VerQueryValueA".}
+proc VerQueryValueA*(pBlock: Pointer, lpSubBlock: LPCSTR,
+                     lplpBuffer: var Pointer, puLen: var UINT): WINBOOL{.
+    stdcall, dynlib: "version", importc: "VerQueryValueA".}
+proc VerQueryValueW*(pBlock: Pointer, lpSubBlock: LPWSTR,
+                     lplpBuffer: var Pointer, puLen: var UINT): WINBOOL{.
+    stdcall, dynlib: "version", importc: "VerQueryValueW".}
+proc VirtualQuery*(lpAddress: Pointer, lpBuffer: var TMemoryBasicInformation,
+                   dwLength: DWORD): DWORD{.stdcall, dynlib: "kernel32",
+    importc: "VirtualQuery".}
+proc VirtualQueryEx*(hProcess: THandle, lpAddress: Pointer,
+                     lpBuffer: var TMemoryBasicInformation, dwLength: DWORD): DWORD{.
+    stdcall, dynlib: "kernel32", importc: "VirtualQueryEx".}
+proc WaitCommEvent*(hFile: THandle, lpEvtMask: var DWORD,
+                    lpOverlapped: POverlapped): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WaitCommEvent".}
+proc WaitForDebugEvent*(lpDebugEvent: var TDebugEvent, dwMilliseconds: DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WaitForDebugEvent".}
+proc wglDescribeLayerPlane*(p1: HDC, p2, p3: int, p4: int,
+                            p5: var TLayerPlaneDescriptor): 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: UINT; const p2: PWGLSwap): DWORD;stdcall; external 'opengl32' name 'wglSwapMultipleBuffers';
+  #function WinSubmitCertificate(var lpCertificate: TWinCertificate): WINBOOL;stdcall; external 'imaghlp' name 'WinSubmitCertificate';
+  #function WinVerifyTrust(hwnd: HWND; const ActionID: TGUID; ActionData: Pointer): Longint;stdcall; external 'imaghlp' name 'WinVerifyTrust';
+proc WNetAddConnection2*(lpNetResource: var TNetResource,
+                         lpPassword, lpUserName: cstring, dwFlags: DWORD): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetAddConnection2A".}
+proc WNetAddConnection2A*(lpNetResource: var TNetResourceA,
+                          lpPassword, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetAddConnection2A".}
+  #function WNetAddConnection2W(var lpNetResource: TNetResourceW; lpPassword, lpUserName: LPWSTR; dwFlags: DWORD): DWORD; stdcall; external 'mpr' name 'WNetAddConnection2W';
+proc WNetAddConnection3*(hwndOwner: HWND, lpNetResource: var TNetResource,
+                         lpPassword, lpUserName: cstring, dwFlags: DWORD): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".}
+proc WNetAddConnection3A*(hwndOwner: HWND, lpNetResource: var TNetResourceA,
+                          lpPassword, lpUserName: LPCSTR, dwFlags: DWORD): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetAddConnection3A".}
+  #function WNetAddConnection3W(hwndOwner: HWND; var lpNetResource: TNetResourceW; lpPassword, lpUserName: LPWSTR; dwFlags: DWORD): DWORD; stdcall; external 'mpr' name 'WNetAddConnection3W';
+proc WNetConnectionDialog1*(lpConnDlgStruct: var TConnectDlgStruct): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}
+proc WNetConnectionDialog1A*(lpConnDlgStruct: var TConnectDlgStruct): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetConnectionDialog1A".}
+  #function WNetConnectionDialog1W(var lpConnDlgStruct: TConnectDlgStruct): DWORD; stdcall; external 'mpr' name 'WNetConnectionDialog1W';
+proc WNetDisconnectDialog1*(lpConnDlgStruct: var TDiscDlgStruct): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetDisconnectDialog1A".}
+proc WNetDisconnectDialog1A*(lpConnDlgStruct: var TDiscDlgStructA): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetDisconnectDialog1A".}
+  #function WNetDisconnectDialog1W(var lpConnDlgStruct: TDiscDlgStructW): DWORD; stdcall; external 'mpr' name 'WNetDisconnectDialog1W';
+proc WNetEnumResource*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: Pointer,
+                       lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",
+    importc: "WNetEnumResourceA".}
+proc WNetEnumResourceA*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: Pointer,
+                        lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",
+    importc: "WNetEnumResourceA".}
+proc WNetEnumResourceW*(hEnum: THandle, 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 TNetInfoStruct): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}
+proc WNetGetNetworkInformationA*(lpProvider: LPCSTR,
+                                 lpNetInfoStruct: var TNetInfoStruct): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetGetNetworkInformationA".}
+proc WNetGetNetworkInformationW*(lpProvider: LPWSTR,
+                                 lpNetInfoStruct: var TNetInfoStruct): 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 THandle): DWORD{.stdcall, dynlib: "mpr",
+    importc: "WNetOpenEnumA".}
+proc WNetOpenEnumA*(dwScope, dwType, dwUsage: DWORD,
+                    lpNetResource: PNetResourceA, lphEnum: var THandle): DWORD{.
+    stdcall, dynlib: "mpr", importc: "WNetOpenEnumA".}
+  #function WNetOpenEnumW(dwScope, dwType, dwUsage: DWORD; lpNetResource: PNetResourceW; var lphEnum: THandle): DWORD; stdcall; external 'mpr' name 'WNetOpenEnumW';
+proc WNetUseConnection*(hwndOwner: HWND, lpNetResource: var TNetResource,
+                        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 TNetResourceA,
+                         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: TNetResourceW; lpUserID: LPWSTR; lpPassword: LPWSTR; dwFlags: DWORD; lpAccessName: LPWSTR; var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall; external 'mpr' name 'WNetUseConnectionW';
+proc WriteConsole*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                   nNumberOfCharsToWrite: DWORD,
+                   lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}
+proc WriteConsoleA*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                    nNumberOfCharsToWrite: DWORD,
+                    lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}
+proc WriteConsoleInput*(hConsoleInput: THandle, lpBuffer: TInputRecord,
+                        nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}
+proc WriteConsoleInputA*(hConsoleInput: THandle, lpBuffer: TInputRecord,
+                         nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputA".}
+proc WriteConsoleInputW*(hConsoleInput: THandle, lpBuffer: TInputRecord,
+                         nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".}
+proc WriteConsoleOutput*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                         dwBufferSize, dwBufferCoord: TCoord,
+                         lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WriteConsoleOutputA".}
+proc WriteConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                          dwBufferSize, dwBufferCoord: TCoord,
+                          lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WriteConsoleOutputA".}
+proc WriteConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: Pointer,
+                                  nLength: DWORD, dwWriteCoord: TCoord,
+                                  lpNumberOfAttrsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputAttribute".}
+proc WriteConsoleOutputCharacter*(hConsoleOutput: THandle, lpCharacter: cstring,
+                                  nLength: DWORD, dwWriteCoord: TCoord,
+                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}
+proc WriteConsoleOutputCharacterA*(hConsoleOutput: THandle, lpCharacter: LPCSTR,
+                                   nLength: DWORD, dwWriteCoord: TCoord,
+                                   lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}
+proc WriteConsoleOutputCharacterW*(hConsoleOutput: THandle, lpCharacter: LPWSTR,
+                                   nLength: DWORD, dwWriteCoord: TCoord,
+                                   lpNumberOfCharsWritten: var DWORD): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".}
+proc WriteConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                          dwBufferSize, dwBufferCoord: TCoord,
+                          lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WriteConsoleOutputW".}
+proc WriteConsoleW*(hConsoleOutput: THandle, lpBuffer: Pointer,
+                    nNumberOfCharsToWrite: DWORD,
+                    lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteConsoleW".}
+proc WriteFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToWrite: DWORD,
+                lpNumberOfBytesWritten: var DWORD, lpOverlapped: POverlapped): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WriteFile".}
+proc WriteFileEx*(hFile: THandle, lpBuffer: Pointer,
+                  nNumberOfBytesToWrite: DWORD, lpOverlapped: TOverlapped,
+                  lpCompletionRoutine: FARPROC): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WriteFileEx".}
+proc WritePrivateProfileStructA*(lpszSection, lpszKey: LPCSTR, lpStruct: LPVOID,
+                                 uSizeStruct: UINT, szFile: LPCSTR): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStructA".}
+proc WritePrivateProfileStructW*(lpszSection, lpszKey: LPCWSTR,
+                                 lpStruct: LPVOID, uSizeStruct: UINT,
+                                 szFile: LPCWSTR): WINBOOL{.stdcall,
+    dynlib: "kernel32", importc: "WritePrivateProfileStructW".}
+proc WritePrivateProfileStruct*(lpszSection, lpszKey: LPCTSTR, lpStruct: LPVOID,
+                                uSizeStruct: UINT, szFile: LPCTSTR): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStructA".}
+proc WriteProcessMemory*(hProcess: THandle, 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 "depreciated"
+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
+# was #define dname(params) def_expr
+# argument types are unknown
+
+proc GetBValue(rgb: int32): int8 =
+  result = int8(rgb shr 16)
+
+proc GetGValue(rgb: int32): int8 =
+  result = int8((int16(rgb)) shr 8)
+
+proc GetRValue(rgb: int32): int8 =
+  result = int8(rgb)
+
+proc RGB(r, g, b: int32): DWORD =
+  result = DWORD(((DWORD(int8(r))) or ((DWORD(int16(g))) shl 8)) or
+      ((DWORD(int8(b))) shl 16))
+
+proc HIBYTE(w: int32): int8 =
+  result = int8(((int16(w)) shr 8) and 0x000000FF)
+
+proc HIWORD(L: int32): int16 =
+  result = int16(((DWORD(L)) shr 16) and 0x0000FFFF)
+
+proc LOBYTE(w: int32): int8 =
+  result = int8(w)
+
+proc LOWORD(L: int32): int16 =
+  result = int16(L)
+
+proc MAKELONG(a, b: int32): LONG =
+  result = LONG((int16(a)) or ((DWORD(int16(b))) shl 16))
+
+proc MAKEWORD(a, b: int32): int16 =
+  result = int16((int8(a)) or ((int16(int8(b))) shl 8))
+
+proc SEXT_HIWORD(L: int32): int32 =
+  # return type might be wrong
+  result = (int32(L)) shr 16
+
+proc ZEXT_HIWORD(L: int32): int32 =
+  # return type might be wrong
+  result = (int(L)) shr 16
+
+proc SEXT_LOWORD(L: int32): int32 =
+  result = int32(SHORT(L))
+
+proc INDEXTOOVERLAYMASK(i: int32): int32 =
+  # return type might be wrong
+  result = i shl 8
+
+proc INDEXTOSTATEIMAGEMASK(i: int32): int32 =
+  # return type might be wrong
+  result = i shl 12
+
+proc MAKEINTATOM(i: int32): LPTSTR =
+  result = cast[LPTSTR](cast[ULONG_PTR](int16(i)))
+
+proc MAKELANGID(p, s: int32): int32 =
+  # return type might be wrong
+  result = ((int16(s)) shl 10) or (int16(p))
+
+proc PRIMARYLANGID(lgid: int32): int16 =
+  # PRIMARYLANGID:=WORD(lgid(@($3ff)));
+  #         h2pas error here corrected by hand PM
+  result = int16(lgid) and (0x000003FF)
+
+proc SUBLANGID(lgid: int32): int32 =
+  # return type might be wrong
+  result = (int16(lgid)) shr 10
+
+proc LANGIDFROMLCID(lcid: int32): int16 =
+  result = int16(lcid)
+
+proc SORTIDFROMLCID(lcid: int32): int16 =
+  result = int16(((DWORD(lcid)) and 0x000FFFFF) shr 16)
+
+proc MAKELCID(lgid, srtid: int32): DWORD =
+  result = DWORD(((DWORD(int16(srtid))) shl 16) or (DWORD(int16(lgid))))
+
+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 = DWORD((DWORD(back shl 8) and 0xFF000000) or DWORD(fore))
+
+proc MAKEWPARAM(L, h: int32): WPARAM =
+  result = WPARAM(MAKELONG(L, h))
+
+proc GET_X_LPARAM(lp: Windows.LParam): int32 =
+  result = int16(LOWORD(lp))
+
+proc GET_Y_LPARAM(lp: Windows.LParam): int32 =
+  result = int16(HIWORD(lp))
+
+proc PALETTEINDEX(i: int32): COLORREF =
+  result = COLORREF(0x01000000 or (DWORD(int16(i))))
+
+proc PALETTERGB(r, g, b: int32): int32 =
+  # return type might be wrong
+  result = 0x02000000 or (RGB(r, g, b))
+
+proc UNICODE_NULL(): WCHAR =
+  result = 0
+
+proc IDC_ARROW(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32512)
+
+proc IDC_IBEAM(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32513)
+
+proc IDC_WAIT(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32514)
+
+proc IDC_CROSS(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32515)
+
+proc IDC_UPARROW(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32516)
+
+proc IDC_SIZENWSE(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32642)
+
+proc IDC_SIZENESW(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32643)
+
+proc IDC_SIZEWE(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32644)
+
+proc IDC_SIZENS(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32645)
+
+proc IDC_SIZEALL(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32646)
+
+proc IDC_NO(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32648)
+
+proc IDC_APPSTARTING(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32650)
+
+proc IDC_HELP(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32651)
+
+proc IDI_APPLICATION(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32512)
+
+proc IDI_HAND(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32513)
+
+proc IDI_QUESTION(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32514)
+
+proc IDI_EXCLAMATION(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32515)
+
+proc IDI_ASTERISK(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32516)
+
+proc IDI_WINLOGO(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32517)
+
+proc IDC_SIZE(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32640)
+
+proc IDC_ICON(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32641)
+
+proc IDC_HAND(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](32649)
+
+proc STD_INPUT_HANDLE(): DWORD =
+  result = DWORD(- (10))
+
+proc STD_OUTPUT_HANDLE(): DWORD =
+  result = DWORD(- (11))
+
+proc STD_ERROR_HANDLE(): DWORD =
+  result = DWORD(- (12))
+
+proc HWND_BROADCAST(): HWND =
+  result = HWND(0x0000FFFF)
+
+proc HKEY_CLASSES_ROOT(): HKEY =
+  result = HKEY(0x80000000)
+
+proc HKEY_CURRENT_USER(): HKEY =
+  result = HKEY(0x80000001)
+
+proc HKEY_LOCAL_MACHINE(): HKEY =
+  result = HKEY(0x80000002)
+
+proc HKEY_USERS(): HKEY =
+  result = HKEY(0x80000003)
+
+proc HKEY_PERFORMANCE_DATA(): HKEY =
+  result = HKEY(0x80000004)
+
+proc HKEY_CURRENT_CONFIG(): HKEY =
+  result = HKEY(0x80000005)
+
+proc HKEY_DYN_DATA(): HKEY =
+  result = HKEY(0x80000006)
+
+proc HWND_BOTTOM(): HWND =
+  result = HWND(1)
+
+proc HWND_NOTOPMOST(): HWND =
+  result = HWND(- (2))
+
+proc HWND_TOP(): HWND =
+  result = HWND(0)
+
+proc HWND_TOPMOST(): HWND =
+  result = HWND(- (1))
+
+proc VS_FILE_INFO(): LPTSTR =
+  # return type might be wrong
+  result = cast[MAKEINTRESOURCE](16)
+
+proc HINST_COMMCTRL(): HINST =
+  result = HINST(- (1))
+
+proc LPSTR_TEXTCALLBACKW(): LPWSTR =
+  result = cast[LPWSTR](- (1))
+
+proc LPSTR_TEXTCALLBACKA(): LPSTR =
+  result = cast[LPSTR](- (1))
+
+when defined(winUnicode):
+  #const this is a function in fact !!
+  #     LPSTR_TEXTCALLBACK = LPSTR_TEXTCALLBACKW;
+  proc LPSTR_TEXTCALLBACK(): LPWSTR =
+    result = cast[LPWSTR](- (1))
+
+else:
+  #const
+  #     LPSTR_TEXTCALLBACK = LPSTR_TEXTCALLBACKA;
+  proc LPSTR_TEXTCALLBACK(): LPSTR =
+    result = cast[LPSTR](- (1))
+
+# was #define dname def_expr
+
+proc TVI_ROOT(): HTREEITEM =
+  result = cast[HTREEITEM](0xFFFF0000)
+
+proc TVI_FIRST(): HTREEITEM =
+  result = cast[HTREEITEM](0xFFFF0001)
+
+proc TVI_LAST(): HTREEITEM =
+  result = cast[HTREEITEM](0xFFFF0002)
+
+proc TVI_SORT(): HTREEITEM =
+  result = cast[HTREEITEM](0xFFFF0003)
+
+proc HWND_DESKTOP(): HWND =
+  result = HWND(0)
+
+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 = int32(int(b) == LONG(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 FreeModule(h: HINST): WINBOOL =
+  result = FreeLibrary(h)
+
+proc MakeProcInstance(p, i: int32): int32 =
+  # return type might be wrong
+  result = p
+
+proc FreeProcInstance(p: int32): int32 =
+  # return type might be wrong
+  result = p
+
+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: int32, Y: int32, nWidth: int32, nHeight: int32,
+                   hWndParent: HWND, hMenu: HMENU, hInstance: HINST,
+                   lpParam: LPVOID): HWND =
+  result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,
+                           nHeight, hWndParent, hMenu, 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, hMenu: HMENU, hInstance: HINST,
+                   lpParam: LPVOID): HWND =
+  result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,
+                           nHeight, hWndParent, hMenu, 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, hMenu: 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, hMenu: HMENU, hInstance: HINST,
+                    lpParam: LPVOID): HWND =
+    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,
+                            nHeight, hWndParent, hMenu, 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 GlobalDiscard(hglbMem: HGLOBAL): HGLOBAL =
+  result = GlobalReAlloc(hglbMem, 0, GMEM_MOVEABLE)
+
+proc LocalDiscard(hlocMem: HLOCAL): HLOCAL =
+  result = LocalReAlloc(hlocMem, 0, LMEM_MOVEABLE)
+
+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(hwnd: HWND, szName: LPTSTR): LRESULT =
+  result = SendMessage(hwnd, ACM_OPEN, 0, cast[LPARAM](szName))
+
+proc Animate_Play(hwnd: HWND, `from`, `to`: int32, rep: UINT): LRESULT =
+  result = SendMessage(hwnd, ACM_PLAY, WPARAM(rep),
+                       LPARAM(MAKELONG(`from`, `to`)))
+
+proc Animate_Stop(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, ACM_STOP, 0, 0)
+
+proc Animate_Close(hwnd: HWND): LRESULT =
+  result = Animate_Open(hwnd, nil)
+
+proc Animate_Seek(hwnd: HWND, frame: int32): LRESULT =
+  result = Animate_Play(hwnd, 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: UINT): LRESULT =
+  result = SendMessage(hwndLV, LVM_ARRANGE, WPARAM(code), 0)
+
+proc ListView_CreateDragImage(hwnd: HWND, i: int32, lpptUpLeft: LPPOINT): LRESULT =
+  result = SendMessage(hwnd, LVM_CREATEDRAGIMAGE, WPARAM(i), cast[LPARAM](lpptUpLeft))
+
+proc ListView_DeleteAllItems(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0)
+
+proc ListView_DeleteColumn(hwnd: HWND, iCol: int32): LRESULT =
+  result = SendMessage(hwnd, LVM_DELETECOLUMN, WPARAM(iCol), 0)
+
+proc ListView_DeleteItem(hwnd: HWND, iItem: int32): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, iStart: int32, lvfi: var LV_FINDINFO): int32 =
+  result = SendMessage(hwnd, LVM_FINDITEM, WPARAM(iStart), cast[LPARAM](addr(lvfi)))
+
+proc ListView_GetBkColor(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, LVM_GETBKCOLOR, 0, 0)
+
+proc ListView_GetCallbackMask(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, LVM_GETCALLBACKMASK, 0, 0)
+
+proc ListView_GetColumn(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =
+  result = SendMessage(hwnd, LVM_GETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))
+
+proc ListView_GetColumnWidth(hwnd: HWND, iCol: int32): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, iImageList: wINT): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, item: var LV_ITEM): LRESULT =
+  result = SendMessage(hwnd, LVM_GETITEM, 0, cast[LPARAM](addr(item)))
+
+proc ListView_GetItemCount(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, 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)))
+
+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(hwnd: HWND, iStart, flags: int32): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, LVM_GETTEXTBKCOLOR, 0, 0)
+
+proc ListView_GetTextColor(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, LVM_GETTEXTCOLOR, 0, 0)
+
+proc ListView_GetTopIndex(hwndLV: HWND): LRESULT =
+  result = SendMessage(hwndLV, LVM_GETTOPINDEX, 0, 0)
+
+proc ListView_GetViewRect(hwnd: HWND, rc: var RECT): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =
+  result = SendMessage(hwnd, LVM_INSERTCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))
+
+proc ListView_InsertItem(hwnd: HWND, item: var LV_ITEM): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, clrBk: COLORREF): LRESULT =
+  result = SendMessage(hwnd, LVM_SETBKCOLOR, 0, LPARAM(clrBk))
+
+proc ListView_SetCallbackMask(hwnd: HWND, mask: UINT): LRESULT =
+  result = SendMessage(hwnd, LVM_SETCALLBACKMASK, WPARAM(mask), 0)
+
+proc ListView_SetColumn(hwnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT =
+  result = SendMessage(hwnd, LVM_SETCOLUMN, WPARAM(iCol), cast[LPARAM](addr(col)))
+
+proc ListView_SetColumnWidth(hwnd: HWND, iCol, cx: int32): LRESULT =
+  result = SendMessage(hwnd, LVM_SETCOLUMNWIDTH, WPARAM(iCol), MAKELPARAM(cx, 0))
+
+proc ListView_SetImageList(hwnd: HWND, himl: int32, iImageList: HIMAGELIST): LRESULT =
+  result = SendMessage(hwnd, LVM_SETIMAGELIST, WPARAM(iImageList),
+                       LPARAM(UINT(himl)))
+
+proc ListView_SetItem(hwnd: HWND, item: var LV_ITEM): LRESULT =
+  result = SendMessage(hwnd, 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 = mask
+  gnu_lvi.state = 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(hwnd: HWND, clrTextBk: COLORREF): LRESULT =
+  result = SendMessage(hwnd, LVM_SETTEXTBKCOLOR, 0, LPARAM(clrTextBk))
+
+proc ListView_SetTextColor(hwnd: HWND, clrText: COLORREF): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, lpis: LPTV_INSERTSTRUCT): LRESULT =
+  result = SendMessage(hwnd, TVM_INSERTITEM, 0, cast[LPARAM](lpis))
+
+proc TreeView_DeleteItem(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = SendMessage(hwnd, TVM_DELETEITEM, 0, cast[LPARAM](hitem))
+
+proc TreeView_DeleteAllItems(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TVM_DELETEITEM, 0, cast[LPARAM](TVI_ROOT))
+
+proc TreeView_Expand(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_EXPAND, WPARAM(code), cast[LPARAM](hitem))
+
+proc TreeView_GetCount(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TVM_GETCOUNT, 0, 0)
+
+proc TreeView_GetIndent(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TVM_GETINDENT, 0, 0)
+
+proc TreeView_SetIndent(hwnd: HWND, indent: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_SETINDENT, WPARAM(indent), 0)
+
+proc TreeView_GetImageList(hwnd: HWND, iImage: WPARAM): LRESULT =
+  result = SendMessage(hwnd, TVM_GETIMAGELIST, iImage, 0)
+
+proc TreeView_SetImageList(hwnd: HWND, himl: HIMAGELIST, iImage: WPARAM): LRESULT =
+  result = SendMessage(hwnd, TVM_SETIMAGELIST, iImage, LPARAM(UINT(himl)))
+
+proc TreeView_GetNextItem(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_GETNEXTITEM, WPARAM(code), cast[LPARAM](hitem))
+
+proc TreeView_GetChild(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
+
+proc TreeView_GetNextSibling(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
+
+proc TreeView_GetPrevSibling(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
+
+proc TreeView_GetParent(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
+
+proc TreeView_GetFirstVisible(hwnd: HWND): LRESULT =
+  result = TreeView_GetNextItem(hwnd, HTREEITEM(nil), TVGN_FIRSTVISIBLE)
+
+proc TreeView_GetNextVisible(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
+
+proc TreeView_GetPrevVisible(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
+
+proc TreeView_GetSelection(hwnd: HWND): LRESULT =
+  result = TreeView_GetNextItem(hwnd, HTREEITEM(nil), TVGN_CARET)
+
+proc TreeView_GetDropHilight(hwnd: HWND): LRESULT =
+  result = TreeView_GetNextItem(hwnd, HTREEITEM(nil), TVGN_DROPHILITE)
+
+proc TreeView_GetRoot(hwnd: HWND): LRESULT =
+  result = TreeView_GetNextItem(hwnd, HTREEITEM(nil), TVGN_ROOT)
+
+proc TreeView_Select(hwnd: HWND, hitem: HTREEITEM, code: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_SELECTITEM, WPARAM(code), cast[LPARAM](hitem))
+
+proc TreeView_SelectItem(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_Select(hwnd, hitem, TVGN_CARET)
+
+proc TreeView_SelectDropTarget(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
+
+proc TreeView_SelectSetFirstVisible(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
+
+proc TreeView_GetItem(hwnd: HWND, item: var TV_ITEM): LRESULT =
+  result = SendMessage(hwnd, TVM_GETITEM, 0, cast[LPARAM](addr(item)))
+
+proc TreeView_SetItem(hwnd: HWND, item: var TV_ITEM): LRESULT =
+  result = SendMessage(hwnd, TVM_SETITEM, 0, cast[LPARAM](addr(item)))
+
+proc TreeView_EditLabel(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  Result = SendMessage(hwnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem))
+
+proc TreeView_GetEditControl(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TVM_GETEDITCONTROL, 0, 0)
+
+proc TreeView_GetVisibleCount(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TVM_GETVISIBLECOUNT, 0, 0)
+
+proc TreeView_HitTest(hwnd: HWND, lpht: LPTV_HITTESTINFO): LRESULT =
+  result = SendMessage(hwnd, TVM_HITTEST, 0, cast[LPARAM](lpht))
+
+proc TreeView_CreateDragImage(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = SendMessage(hwnd, TVM_CREATEDRAGIMAGE, 0, cast[LPARAM](hitem))
+
+proc TreeView_SortChildren(hwnd: HWND, hitem: HTREEITEM, recurse: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_SORTCHILDREN, WPARAM(recurse), cast[LPARAM](hitem))
+
+proc TreeView_EnsureVisible(hwnd: HWND, hitem: HTREEITEM): LRESULT =
+  result = SendMessage(hwnd, TVM_ENSUREVISIBLE, 0, cast[LPARAM](hitem))
+
+proc TreeView_SortChildrenCB(hwnd: HWND, psort: LPTV_SORTCB, recurse: int32): LRESULT =
+  result = SendMessage(hwnd, TVM_SORTCHILDRENCB, WPARAM(recurse), cast[LPARAM](psort))
+
+proc TreeView_EndEditLabelNow(hwnd: HWND, fCancel: int32): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETIMAGELIST, 0, 0)
+
+proc TabCtrl_SetImageList(hwnd: HWND, himl: HIMAGELIST): LRESULT =
+  result = SendMessage(hwnd, TCM_SETIMAGELIST, 0, LPARAM(UINT(himl)))
+
+proc TabCtrl_GetItemCount(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETITEMCOUNT, 0, 0)
+
+proc TabCtrl_GetItem(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =
+  result = SendMessage(hwnd, TCM_GETITEM, WPARAM(iItem), cast[LPARAM](addr(item)))
+
+proc TabCtrl_SetItem(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =
+  result = SendMessage(hwnd, TCM_SETITEM, WPARAM(iItem), cast[LPARAM](addr(item)))
+
+proc TabCtrl_InsertItem(hwnd: HWND, iItem: int32, item: var TC_ITEM): LRESULT =
+  result = SendMessage(hwnd, TCM_INSERTITEM, WPARAM(iItem), cast[LPARAM](addr(item)))
+
+proc TabCtrl_DeleteItem(hwnd: HWND, i: int32): LRESULT =
+  result = SendMessage(hwnd, TCM_DELETEITEM, WPARAM(i), 0)
+
+proc TabCtrl_DeleteAllItems(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_DELETEALLITEMS, 0, 0)
+
+proc TabCtrl_GetItemRect(hwnd: HWND, i: int32, rc: var RECT): LRESULT =
+  result = SendMessage(hwnd, TCM_GETITEMRECT, WPARAM(int32(i)), cast[LPARAM](addr(rc)))
+
+proc TabCtrl_GetCurSel(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETCURSEL, 0, 0)
+
+proc TabCtrl_SetCurSel(hwnd: HWND, i: int32): LRESULT =
+  result = SendMessage(hwnd, 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(hwnd: HWND, bLarger: WINBOOL, rc: var RECT): LRESULT =
+  result = SendMessage(hwnd, TCM_ADJUSTRECT, WPARAM(bLarger), cast[LPARAM](addr(rc)))
+
+proc TabCtrl_SetItemSize(hwnd: HWND, x, y: int32): LRESULT =
+  result = SendMessage(hwnd, TCM_SETITEMSIZE, 0, MAKELPARAM(x, y))
+
+proc TabCtrl_RemoveImage(hwnd: HWND, i: WPARAM): LRESULT =
+  result = SendMessage(hwnd, TCM_REMOVEIMAGE, i, 0)
+
+proc TabCtrl_SetPadding(hwnd: HWND, cx, cy: int32): LRESULT =
+  result = SendMessage(hwnd, TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
+
+proc TabCtrl_GetRowCount(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETROWCOUNT, 0, 0)
+
+proc TabCtrl_GetToolTips(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETTOOLTIPS, 0, 0)
+
+proc TabCtrl_SetToolTips(hwnd: HWND, hwndTT: int32): LRESULT =
+  result = SendMessage(hwnd, TCM_SETTOOLTIPS, WPARAM(hwndTT), 0)
+
+proc TabCtrl_GetCurFocus(hwnd: HWND): LRESULT =
+  result = SendMessage(hwnd, TCM_GETCURFOCUS, 0, 0)
+
+proc TabCtrl_SetCurFocus(hwnd: HWND, i: int32): LRESULT =
+  result = SendMessage(hwnd, TCM_SETCURFOCUS, i, 0)
+
+proc SNDMSG(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT =
+  result = SendMessage(hWnd, Msg, wParam, lParam)
+
+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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =
+    result = SNDMSG(hdlg, CDM_GETSPEC, WPARAM(cbmax), cast[LPARAM](psz))
+
+else:
+  proc CommDlg_OpenSave_GetSpec(hdlg: HWND, psz: LPWSTR, 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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =
+    result = SNDMSG(hdlg, CDM_GETFILEPATH, WPARAM(cbmax), cast[LPARAM](psz))
+
+else:
+  proc CommDlg_OpenSave_GetFilePath(hdlg: HWND, psz: LPWSTR, 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 not(defined(winUnicode)):
+  proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPSTR, cbmax: int32): LRESULT =
+    result = SNDMSG(hdlg, CDM_GETFOLDERPATH, WPARAM(cbmax), cast[LPARAM](psz))
+
+else:
+  proc CommDlg_OpenSave_GetFolderPath(hdlg: HWND, psz: LPWSTR, 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 = res and 0x0000ffff # XXX: correct?
+  result.x = res shr 16
+
+proc Succeeded(Status: HRESULT): WINBOOL =
+  result = (Status and 0x80000000)
+
+proc Failed(Status: HRESULT): WINBOOL =
+  result = (Status and 0x80000000)
+
+proc IsError(Status: HRESULT): WINBOOL =
+  result = ord((Status shr 31) == SEVERITY_ERROR)
+
+proc HResultCode(hr: HRESULT): int32 =
+  result = hr and 0x0000FFFF
+
+proc HResultFacility(hr: HRESULT): int32 =
+  result = (hr shr 16) and 0x00001FFF
+
+proc HResultSeverity(hr: HRESULT): int32 =
+  result = (hr shr 31) and 0x00000001
+
+proc MakeResult(p1, p2, mask: int32): HRESULT =
+  result = (p1 shl 31) or (p2 shl 16) or mask
+
+proc HResultFromWin32(x: int32): HRESULT =
+  result = x
+  if result != 0:
+    result = ((result and 0x0000FFFF) or (FACILITY_WIN32 shl 16) or
+        0x80000000)
+
+proc HResultFromNT(x: int32): HRESULT =
+  result = x or FACILITY_NT_BIT
+
+proc MAKELANGID(PrimaryLang, SubLang: USHORT): int16 =
+  result = (SubLang shl 10) or PrimaryLang
+
+proc PRIMARYLANGID(LangId: int16): int16 =
+  result = LangId and 0x000003FF
+
+proc SUBLANGID(LangId: int16): int16 =
+  result = LangId shr 10
+
+proc MAKELCID(LangId, SortId: int16): DWORD =
+  result = (DWORD(SortId) shl 16) or DWORD(LangId)
+
+proc MAKESORTLCID(LangId, SortId, SortVersion: int16): DWORD =
+  result = MAKELCID(LangId, SortId) or (SortVersion shl 20)
+
+proc LANGIDFROMLCID(LocaleId: LCID): int16 =
+  result = int16(LocaleId)
+
+proc SORTIDFROMLCID(LocaleId: LCID): int16 =
+  result = int16((DWORD(LocaleId) shr 16) and 0x0000000F)
+
+proc SORTVERSIONFROMLCID(LocaleId: LCID): int16 =
+  result = int16((DWORD(LocaleId) shr 20) and 0x0000000F)
+
+proc LANG_SYSTEM_DEFAULT(): int16 =
+  result = MAKELANGID(int16(LANG_NEUTRAL), SUBLANG_SYS_DEFAULT)
+
+proc LANG_USER_DEFAULT(): int16 =
+  result = MAKELANGID(int16(LANG_NEUTRAL), SUBLANG_DEFAULT)
+
+proc LOCALE_NEUTRAL(): DWORD =
+  result = MAKELCID(MAKELANGID(int16(LANG_NEUTRAL), SUBLANG_NEUTRAL), SORT_DEFAULT)
+
+proc LOCALE_INVARIANT(): DWORD =
+  result = MAKELCID(MAKELANGID(int16(LANG_INVARIANT), SUBLANG_NEUTRAL), SORT_DEFAULT)